Commit c6cb73ae by chenwq1

refactor(components): 统一组件样式和结构,优化用户交互

- 移除不必要的组件嵌套,简化 CarBrands 和 Employee 组件的模板结构
- 为多个组件添加统一的文本样式类,提升可读性和一致性
- 调整 Popup 组件的内容展示方式,使用 scroll-view 替代 view 以支持滚动
- 更新样式布局,修复选择项排列和按钮显示问题
- 优化登录页面输入框样式,增强用户体验
- 移除冗余的 CSS 规则,提升代码整洁性
- 更新 pnpm-lock.yaml,添加 vue-i18n 版本迁移提示
1 parent 9483f61f
Showing 32 changed files with 578 additions and 420 deletions
...@@ -3,7 +3,7 @@ ...@@ -3,7 +3,7 @@
"configurations" : [ "configurations" : [
{ {
"customPlaygroundType" : "local", "customPlaygroundType" : "local",
"playground" : "custom", "playground" : "standard",
"type" : "uni-app:app-android" "type" : "uni-app:app-android"
}, },
{ {
......
{
"permission": {
"edit": {
"*": "allow"
}
}
}
...@@ -11,7 +11,8 @@ let firstBackTime = 0; ...@@ -11,7 +11,8 @@ let firstBackTime = 0;
export default { export default {
onLaunch () { onLaunch () {
// #ifdef APP // #ifdef APP
// layoutService.init(); // 必须先 init:未初始化时 currentMode 默认为 pad,会误判手机为平板并先锁横屏
layoutService.init();
const sys = uni.getSystemInfoSync(); const sys = uni.getSystemInfoSync();
console.log(`[App] 当前分辨率:${ sys.screenWidth } x ${ sys.screenHeight}`); console.log(`[App] 当前分辨率:${ sys.screenWidth } x ${ sys.screenHeight}`);
// pad/大屏锁定横屏,手机锁定竖屏 // pad/大屏锁定横屏,手机锁定竖屏
...@@ -87,10 +88,10 @@ export default { ...@@ -87,10 +88,10 @@ export default {
@import "./adapt/portrait/1920/account-items.scss"; @import "./adapt/portrait/1920/account-items.scss";
/* 全局默认样式 */ /* 全局默认样式 */
uni-page-body { .layout-root {
font-size: 14px; font-size: 14px;
height: 100%; height: 100%;
min-height: 100%; min-height: 0;
} }
/* #ifdef H5 */ /* #ifdef H5 */
...@@ -128,7 +129,7 @@ uni-app uni-page-body, uni-app uni-left-window .uni-left-window, uni-app uni-rig ...@@ -128,7 +129,7 @@ uni-app uni-page-body, uni-app uni-left-window .uni-left-window, uni-app uni-rig
/* color 属性只能在 text、button、input、textarea 上使用 */ /* color 属性只能在 text、button、input、textarea 上使用 */
.un-segmented__item { .un-segmented__item {
.un-segmented__item__text { .un-segmented__item__text {
color: inherit; color: #1f2937;
} }
} }
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
/* ==================== 布局缩放变量 (Layout) ==================== */ /* ==================== 布局缩放变量 (Layout) ==================== */
/* 默认值:Pad 1024 基准,LayoutRoot 通过 layout-vars.uts + LayoutService 动态注入覆盖 */ /* 默认值:Pad 1024 基准,LayoutRoot 通过 layout-vars.uts + LayoutService 动态注入覆盖 */
:root { .layout-root {
--l-spacing-xs: 8px; --l-spacing-xs: 8px;
--l-spacing-sm: 12px; --l-spacing-sm: 12px;
--l-spacing-md: 16px; --l-spacing-md: 16px;
...@@ -843,54 +843,7 @@ ...@@ -843,54 +843,7 @@
margin-right: 20px; margin-right: 20px;
} }
/* Gap (需要在父元素上使用 flex) */ /* Gap 工具类在 uni-app x App 端不可用,改由具体组件显式设置 margin */
.gap-1 {
gap: 1px;
}
.gap-2 {
gap: 2px;
}
.gap-3 {
gap: 3px;
}
.gap-4 {
gap: 4px;
}
.gap-5 {
gap: 5px;
}
.gap-6 {
gap: 6px;
}
.gap-8 {
gap: 8px;
}
.gap-10 {
gap: 10px;
}
.gap-12 {
gap: 12px;
}
.gap-16 {
gap: 16px;
}
.gap-20 {
gap: 20px;
}
.gap-24 {
gap: 24px;
}
/* ==================== 尺寸 ==================== */ /* ==================== 尺寸 ==================== */
.w-full { .w-full {
...@@ -1665,7 +1618,6 @@ ...@@ -1665,7 +1618,6 @@
padding: 8px 12px; padding: 8px 12px;
font-size: 14px; font-size: 14px;
font-weight: 500; font-weight: 500;
outline: none;
border-width: 0; border-width: 0;
border-radius: 6px; border-radius: 6px;
} }
...@@ -1675,7 +1627,7 @@ ...@@ -1675,7 +1627,7 @@
background-color: #6366f1; background-color: #6366f1;
} }
.btn-primary:active { .btn-primary-active {
background-color: #4f46e5; background-color: #4f46e5;
} }
...@@ -1684,7 +1636,7 @@ ...@@ -1684,7 +1636,7 @@
background-color: #0ea5e9; background-color: #0ea5e9;
} }
.btn-secondary:active { .btn-secondary-active {
background-color: #0284c7; background-color: #0284c7;
} }
...@@ -1693,7 +1645,7 @@ ...@@ -1693,7 +1645,7 @@
background-color: #22c55e; background-color: #22c55e;
} }
.btn-success:active { .btn-success-active {
background-color: #16a34a; background-color: #16a34a;
} }
...@@ -1702,7 +1654,7 @@ ...@@ -1702,7 +1654,7 @@
background-color: #f97316; background-color: #f97316;
} }
.btn-warning:active { .btn-warning-active {
background-color: #ea580c; background-color: #ea580c;
} }
...@@ -1711,7 +1663,7 @@ ...@@ -1711,7 +1663,7 @@
background-color: #ef4444; background-color: #ef4444;
} }
.btn-danger:active { .btn-danger-active {
background-color: #dc2626; background-color: #dc2626;
} }
...@@ -1720,12 +1672,12 @@ ...@@ -1720,12 +1672,12 @@
background-color: #374151; background-color: #374151;
} }
.btn-dark:active { .btn-dark-active {
background-color: #111827; background-color: #111827;
} }
/* 按钮禁用状态 */ /* 按钮禁用状态 */
button:disabled { .btn-disabled {
background-color: #9ca3af; background-color: #9ca3af;
opacity: 0.6; opacity: 0.6;
} }
...@@ -1757,7 +1709,7 @@ button:disabled { ...@@ -1757,7 +1709,7 @@ button:disabled {
} }
.overflow-auto { .overflow-auto {
overflow: auto; overflow: hidden;
} }
/* ==================== 显示/隐藏 ==================== */ /* ==================== 显示/隐藏 ==================== */
...@@ -1766,7 +1718,8 @@ button:disabled { ...@@ -1766,7 +1718,8 @@ button:disabled {
} }
.block { .block {
display: block; display: flex;
flex-direction: column;
} }
/* ==================== Flex ==================== */ /* ==================== Flex ==================== */
...@@ -1846,7 +1799,8 @@ button:disabled { ...@@ -1846,7 +1799,8 @@ button:disabled {
} }
.min-h-screen { .min-h-screen {
min-height: 100%; height: 100%;
min-height: 0;
} }
/* ==================== 其他工具类 ==================== */ /* ==================== 其他工具类 ==================== */
...@@ -1854,37 +1808,3 @@ button:disabled { ...@@ -1854,37 +1808,3 @@ button:disabled {
/* 注意:uni-app x App 端不支持 CSS 渐变 */ /* 注意:uni-app x App 端不支持 CSS 渐变 */
/* 如需渐变效果,请在 Web 端使用条件编译 */ /* 如需渐变效果,请在 Web 端使用条件编译 */
/* 按钮激活状态 */
.active\:bg-blue-600:active {
background-color: #2563eb;
}
.active\:bg-indigo-600:active {
background-color: #4f46e5;
}
.active\:bg-pink-600:active {
background-color: #db2777;
}
.active\:bg-red-600:active {
background-color: #dc2626;
}
.active\:bg-green-600:active {
background-color: #16a34a;
}
.active\:bg-gray-800:active {
background-color: #1f2937;
}
/* 禁用状态 */
.disabled\:opacity-60:disabled {
opacity: 0.6;
}
.disabled\:bg-gray-400:disabled {
background-color: #9ca3af;
}
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
<view class="select-item" <view class="select-item"
:class="[{ checked: selectedBrandIndex == index }]" :class="[{ checked: selectedBrandIndex == index }]"
@click="selectBrand(item, index)"> @click="selectBrand(item, index)">
{{ (item as UTSJSONObject).name }} <text class="select-item-text">{{ (item as UTSJSONObject).name }}</text>
</view> </view>
</template> </template>
</view> </view>
...@@ -36,7 +36,7 @@ ...@@ -36,7 +36,7 @@
<view class="select-item" <view class="select-item"
:class="[{ checked: carModel == (item as UTSJSONObject).name }]" :class="[{ checked: carModel == (item as UTSJSONObject).name }]"
@click="handleSelect(item)"> @click="handleSelect(item)">
{{ (item as UTSJSONObject).name }} <text class="select-item-text">{{ (item as UTSJSONObject).name }}</text>
</view> </view>
</template> </template>
</view> </view>
...@@ -388,68 +388,41 @@ defineExpose({ open, close, autoSelect }); ...@@ -388,68 +388,41 @@ defineExpose({ open, close, autoSelect });
flex: 1; flex: 1;
.view-content { .view-content {
display: flex; display: flex;
flex-direction: row;
flex-wrap: wrap; flex-wrap: wrap;
justify-content: space-between;
width: 100%; width: 100%;
.select-item { .select-item {
width: 48%; width: 49%;
margin-right: 2%; margin-right: 0;
margin-bottom: 16px; margin-bottom: 16px;
height: 34px; height: 34px;
opacity: 1; opacity: 1;
border: 1px solid #dce0e6; border: 1px solid #dce0e6;
border-radius: 4px; border-radius: 4px;
display: flex; display: flex;
flex-direction: row;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
text {
text-align: center;
color: #333;
font-size: 16px;
line-height: 22px;
}
&:nth-child(4n) {
margin-right: 0;
}
&.checked { &.checked {
border: 1px solid #292d33; border: 1px solid #292d33;
} }
} }
} }
// 淡入 + 从左滑入动画(品牌列表)
.fade-in-left { .fade-in-left {
animation: fadeInLeft 0.3s ease-out forwards;
} }
// 淡入 + 从右滑入动画(车系列表)
.fade-in-right { .fade-in-right {
animation: fadeInRight 0.3s ease-out forwards;
}
}
@keyframes fadeInLeft {
from {
opacity: 0;
transform: translateX(-20px);
}
to {
opacity: 1;
transform: translateX(0);
} }
} }
@keyframes fadeInRight { .select-item-text {
from { text-align: center;
opacity: 0; color: #333;
transform: translateX(20px); font-size: 16px;
} line-height: 22px;
to {
opacity: 1;
transform: translateX(0);
}
} }
</style> </style>
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<view v-if="visible" <view v-if="visible"
class="popup-mask" class="popup-mask"
@tap="close"> @tap="close">
<view class="popup-box" @tap.stop=""> <view class="popup-box" :style="popupStyle" @tap.stop="">
<view class="popup-title"> <view class="popup-title">
<image class="popup-title-bg-img" <image class="popup-title-bg-img"
mode="aspectFill" mode="aspectFill"
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<text class="close-icon">×</text> <text class="close-icon">×</text>
</view> </view>
</view> </view>
<view class="popup-content"> <scroll-view class="popup-content" direction="vertical">
<view v-for="(item, index) in list" <view v-for="(item, index) in list"
:key="index" :key="index"
class="popup-item" class="popup-item"
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
<text class="item-describe">{{ (item as UTSJSONObject).describe ?? '' }}</text> <text class="item-describe">{{ (item as UTSJSONObject).describe ?? '' }}</text>
</view> </view>
</view> </view>
</view> </scroll-view>
</view> </view>
</view> </view>
</template> </template>
...@@ -46,6 +46,17 @@ const emit = defineEmits<{ ...@@ -46,6 +46,17 @@ const emit = defineEmits<{
}>(); }>();
const internalVisible = ref(false); const internalVisible = ref(false);
const popupStyle = computed((): UTSJSONObject => {
const info = uni.getWindowInfo();
const winH = info.windowHeight > 0 ? info.windowHeight : 768;
const heightPx = Math.round(winH * 0.8);
const minHeightPx = Math.round(winH * 0.32);
return {
height: `${heightPx}px`,
minHeight: `${minHeightPx}px`
} as UTSJSONObject;
});
const visible = computed((): boolean => { const visible = computed((): boolean => {
if (props.visible != null) return props.visible === true; if (props.visible != null) return props.visible === true;
return internalVisible.value; return internalVisible.value;
...@@ -91,8 +102,6 @@ defineExpose({ ...@@ -91,8 +102,6 @@ defineExpose({
.popup-box { .popup-box {
width: 700px; width: 700px;
max-height: 80%;
min-height: 32%;
background: #ffffff; background: #ffffff;
border-radius: var(--l-radius-xl); border-radius: var(--l-radius-xl);
overflow: hidden; overflow: hidden;
...@@ -151,7 +160,6 @@ defineExpose({ ...@@ -151,7 +160,6 @@ defineExpose({
.popup-content { .popup-content {
flex: 1; flex: 1;
overflow: auto;
padding: var(--l-spacing-lg); padding: var(--l-spacing-lg);
display: flex; display: flex;
flex-direction: column; flex-direction: column;
......
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
<view class="select-item" <view class="select-item"
:class="[{ checked: (salesUuid as string) == (item as UTSJSONObject).uuid }]" :class="[{ checked: (salesUuid as string) == (item as UTSJSONObject).uuid }]"
@click="handleSelect(item)"> @click="handleSelect(item)">
{{ (item as UTSJSONObject).staffName }} <text class="select-item-text">{{ (item as UTSJSONObject).staffName }}</text>
</view> </view>
</template> </template>
</scroll-view> </scroll-view>
...@@ -119,38 +119,35 @@ defineExpose({ open, close }); ...@@ -119,38 +119,35 @@ defineExpose({ open, close });
.select-box { .select-box {
margin: 20px 0; margin: 20px 0;
display: flex; display: flex;
flex-direction: row;
flex-wrap: wrap; flex-wrap: wrap;
overflow-y: scroll; justify-content: space-between;
max-height: 400px; max-height: 400px;
padding-bottom: 30px; padding-bottom: 30px;
flex-direction: row;
.select-item { .select-item {
width: 48%; width: 49%;
/* width: 23.5%; */ /* width: 23.5%; */
margin-right: 2%; margin-right: 0;
margin-bottom: 16px; margin-bottom: 16px;
height: 34px; height: 34px;
opacity: 1; opacity: 1;
border: 1px solid #dce0e6; border: 1px solid #dce0e6;
border-radius: 4px; border-radius: 4px;
display: flex; display: flex;
flex-direction: row;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
text {
text-align: center;
color: #333;
font-size: 16px;
line-height: 22px;
}
&:nth-child(4n) {
margin-right: 0;
}
&.checked { &.checked {
border: 1px solid #292d33; border: 1px solid #292d33;
} }
} }
} }
.select-item-text {
text-align: center;
color: #333;
font-size: 16px;
line-height: 22px;
}
</style> </style>
...@@ -13,12 +13,12 @@ ...@@ -13,12 +13,12 @@
<template v-if="step == 1"> <template v-if="step == 1">
<template v-if="!check(true)"> <template v-if="!check(true)">
<view v-if="errorTip" class="error-tip"> <view v-if="errorTip" class="error-tip">
<text>以下信息不能为空,请完善信息后保存</text> <text class="error-tip-text">以下信息不能为空,请完善信息后保存</text>
</view> </view>
<view v-else class="pop-tips-wrapper"> <view v-else class="pop-tips-wrapper">
<view class="pop-tips"> <view class="pop-tips">
<uni-icons :size="16" type="info-circle"></uni-icons> <uni-icons :size="16" type="info-circle"></uni-icons>
<text>{{ tipsText }}</text> <text class="pop-tips-text">{{ tipsText }}</text>
</view> </view>
</view> </view>
</template> </template>
...@@ -27,9 +27,9 @@ ...@@ -27,9 +27,9 @@
<view class="form-item"> <view class="form-item">
<view class="label"> <view class="label">
<view v-if="i.required == true" class="required"> <view v-if="i.required == true" class="required">
<text style="color: #ff0000;">*</text> <text class="required-text">*</text>
</view> </view>
<text>{{ i.label }}</text> <text class="form-label-text">{{ i.label }}</text>
</view> </view>
<view class="value" :class="[{ error: showError(i.key) && i.required == true }, { disabled: customerType == 0 || i.disabled == true }]"> <view class="value" :class="[{ error: showError(i.key) && i.required == true }, { disabled: customerType == 0 || i.disabled == true }]">
<template v-if="i.type == 'input'"> <template v-if="i.type == 'input'">
...@@ -47,7 +47,7 @@ ...@@ -47,7 +47,7 @@
:class="[{'placeholder': (formData as UTSJSONObject)[i.key] == ''}]" :class="[{'placeholder': (formData as UTSJSONObject)[i.key] == ''}]"
@click="showSelectPopup(i)"> @click="showSelectPopup(i)">
<view class="select-content"> <view class="select-content">
<text>{{ (formData as UTSJSONObject)[i.key] != '' ? (formData as UTSJSONObject)[i.key] : i.placeholder }}</text> <text class="select-text" :class="[(formData as UTSJSONObject)[i.key] == '' ? 'select-text-placeholder' : '']">{{ (formData as UTSJSONObject)[i.key] != '' ? (formData as UTSJSONObject)[i.key] : i.placeholder }}</text>
<uni-icons class="arrow" <uni-icons class="arrow"
:size="16" :size="16"
type="down"> type="down">
...@@ -64,7 +64,7 @@ ...@@ -64,7 +64,7 @@
<view class="pop-tips-wrapper"> <view class="pop-tips-wrapper">
<view class="pop-tips"> <view class="pop-tips">
<uni-icons :size="16" type="info-circle"></uni-icons> <uni-icons :size="16" type="info-circle"></uni-icons>
<text>请完善本次接待结果</text> <text class="pop-tips-text">请完善本次接待结果</text>
</view> </view>
</view> </view>
<view class="choose-box"> <view class="choose-box">
...@@ -74,7 +74,7 @@ ...@@ -74,7 +74,7 @@
@click="chooseResult(item.status)"> @click="chooseResult(item.status)">
<view class="sprite-icon" :class="[`icon-face-${item.status == receptionStatus ? `${item.icon}-active` : item.icon}`]"> <view class="sprite-icon" :class="[`icon-face-${item.status == receptionStatus ? `${item.icon}-active` : item.icon}`]">
</view> </view>
<text>{{ item.text }}</text> <text class="choose-item-text">{{ item.text }}</text>
</view> </view>
</template> </template>
</view> </view>
...@@ -553,11 +553,11 @@ defineExpose({ open, close }); ...@@ -553,11 +553,11 @@ defineExpose({ open, close });
padding: 0 20px; padding: 0 20px;
max-height: 500px; max-height: 500px;
flex: 1; flex: 1;
overflow-y: auto;
} }
.popup-footer { .popup-footer {
display: flex; display: flex;
flex-direction: row;
padding: 12px 20px; padding: 12px 20px;
// border-top: 1px solid #f0f0f0; // border-top: 1px solid #f0f0f0;
gap: 12px; gap: 12px;
...@@ -576,43 +576,44 @@ defineExpose({ open, close }); ...@@ -576,43 +576,44 @@ defineExpose({ open, close });
padding: 12px 5px 12px; padding: 12px 5px 12px;
/* padding: 12px 40px 12px; */ /* padding: 12px 40px 12px; */
margin-top: 15px; margin-top: 15px;
}
text { .pop-tips-text {
color: #2c66f7; color: #2c66f7;
font-size: 14px; font-size: 14px;
text-align: center; text-align: center;
} }
}
.error-tip { .error-tip {
padding: 16px 30px 12px; padding: 16px 30px 12px;
margin-top: 15px; margin-top: 15px;
text-align: center; text-align: center;
background-color: rgb(254, 237, 234); background-color: rgb(254, 237, 234);
}
text { .error-tip-text {
color: #f45c3d; color: #f45c3d;
font-size: 14px; font-size: 14px;
} }
}
.pop-tips-wrapper { .pop-tips-wrapper {
margin-top: 8px; margin-top: 8px;
.pop-tips { .pop-tips {
display: flex; display: flex;
flex-direction: row;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
gap: 6px;
padding: 10px 14px; padding: 10px 14px;
background: rgba(44, 102, 247, 0.08); background: rgba(44, 102, 247, 0.08);
border-radius: 6px; border-radius: 6px;
}
}
text { .pop-tips-wrapper .pop-tips-text {
color: #2c66f7; color: #2c66f7;
font-size: 13px; font-size: 13px;
} margin-left: 6px;
}
} }
.form { .form {
...@@ -634,18 +635,10 @@ defineExpose({ open, close }); ...@@ -634,18 +635,10 @@ defineExpose({ open, close });
display: flex; display: flex;
align-items: center; align-items: center;
text {
color: #6c6c70;
font-size: 15px;
}
.required{ .required{
text {
color: #ff0000;
margin-right: 2px; margin-right: 2px;
} }
} }
}
.value { .value {
flex: 1; flex: 1;
...@@ -676,17 +669,6 @@ defineExpose({ open, close }); ...@@ -676,17 +669,6 @@ defineExpose({ open, close });
border-radius: 4px; border-radius: 4px;
box-sizing: border-box; box-sizing: border-box;
text {
font-size: 15px;
color: #333333;
}
&.placeholder {
text {
color: #c9c9c9;
}
}
.arrow { .arrow {
flex-shrink: 0; flex-shrink: 0;
margin-left: auto; margin-left: auto;
...@@ -695,17 +677,12 @@ defineExpose({ open, close }); ...@@ -695,17 +677,12 @@ defineExpose({ open, close });
.select-content { .select-content {
display: flex; display: flex;
flex-direction: row;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
width: 100%; width: 100%;
height: 100%; height: 100%;
text {
flex: 1;
font-size: 15px;
color: #333333;
}
.arrow { .arrow {
flex-shrink: 0; flex-shrink: 0;
margin-left: auto; margin-left: auto;
...@@ -726,14 +703,11 @@ defineExpose({ open, close }); ...@@ -726,14 +703,11 @@ defineExpose({ open, close });
border: 1px solid #e8e8e8; border: 1px solid #e8e8e8;
border-radius: 8px; border-radius: 8px;
display: flex; display: flex;
flex-direction: row;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
margin-top: 12px; margin-top: 12px;
text {
/* 选择按钮内的文字样式 */
}
.sprite-icon { .sprite-icon {
margin-right: 8px; margin-right: 8px;
} }
...@@ -749,4 +723,28 @@ defineExpose({ open, close }); ...@@ -749,4 +723,28 @@ defineExpose({ open, close });
border-color: #f247241a; border-color: #f247241a;
} }
} }
.form-label-text {
color: #6c6c70;
font-size: 15px;
}
.required-text {
color: #ff0000;
}
.select-text {
flex: 1;
font-size: 15px;
color: #333333;
}
.select-text-placeholder {
color: #c9c9c9;
}
.choose-item-text {
font-size: 15px;
color: #333333;
}
</style> </style>
...@@ -38,23 +38,36 @@ ...@@ -38,23 +38,36 @@
@update:visible="onSettingVisible" /> @update:visible="onSettingVisible" />
</view> </view>
<!-- 竖屏手机:底部 TabBar,仅保留场景 Tab,不显示头像和底部两个按钮 --> <!-- 竖屏手机:uView 底部 TabBar,图标沿用 static/images/tabbar -->
<view v-else <view v-else
class="left-side left-side-portrait"> class="left-side left-side-portrait">
<view class="portrait-tabs-row"> <un-tabbar :model-value="currentTabIndex"
<view v-for="(item, index) in tabs" class="portrait-un-tabbar"
:fixed="false"
:placeholder="false"
:safe-area-inset-bottom="true"
active-color="#3773f8"
inactive-color="#8a98b5"
bg-color="#ffffff"
height="56"
@change="onPortraitTabChange(($event as string | number))">
<un-tabbar-item v-for="(item, index) in tabs"
:key="index" :key="index"
class="tab-item tab-item-inline" :name="index"
:class="[currentTabIndex === index ? 'tabActive' : '']" :text="item.label"
@click="onChangeTab(index)"> icon-size="24">
<view class="tab-icon-wrap"> <template #icon="{ active }">
<image class="tab-icon" <image v-if="active === true"
class="tabbar-icon-img"
mode="aspectFit" mode="aspectFit"
:src="getTabIconSrc(item.icon, currentTabIndex === index)" /> :src="getTabIconSrc(item.icon, true)" />
</view> <image v-else
<text class="tab-label">{{ item.label }}</text> class="tabbar-icon-img"
</view> mode="aspectFit"
</view> :src="getTabIconSrc(item.icon, false)" />
</template>
</un-tabbar-item>
</un-tabbar>
</view> </view>
</template> </template>
...@@ -196,6 +209,11 @@ function onChangeTab(index: number): void { ...@@ -196,6 +209,11 @@ function onChangeTab(index: number): void {
emit("changeTab", index); emit("changeTab", index);
} }
function onPortraitTabChange(name: string | number): void {
const idx = name as number;
emit("changeTab", idx);
}
function onScenePopupVisible(v: boolean): void { function onScenePopupVisible(v: boolean): void {
showScenePopup.value = v; showScenePopup.value = v;
} }
...@@ -274,12 +292,20 @@ function jumpPersonCenter(): void { ...@@ -274,12 +292,20 @@ function jumpPersonCenter(): void {
.left-side-portrait { .left-side-portrait {
width: 100%; width: 100%;
flex-direction: row; flex-shrink: 0;
align-items: center; flex-direction: column;
padding: var(--l-spacing-sm) var(--l-spacing-md); align-items: stretch;
min-height: 56px; padding: 0;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.06);
justify-content: center; }
.portrait-un-tabbar {
width: 100%;
}
.tabbar-icon-img {
width: 24px;
height: 24px;
} }
.portrait-top-row { .portrait-top-row {
...@@ -295,37 +321,6 @@ function jumpPersonCenter(): void { ...@@ -295,37 +321,6 @@ function jumpPersonCenter(): void {
flex-shrink: 0; flex-shrink: 0;
} }
.portrait-tabs-row {
flex: 1;
display: flex;
flex-direction: row;
align-items: center;
padding: 0 var(--l-spacing-sm);
justify-content: center;
}
.portrait-tabs-row .tab-item-inline {
margin-right: var(--l-spacing-md);
padding: var(--l-spacing-xs) var(--l-spacing-sm);
}
.portrait-tabs-row .tabActive .tab-label {
color: #3773f8;
}
.tab-icon-wrap {
width: 24px;
height: 24px;
display: flex;
justify-content: center;
align-items: center;
}
.tab-icon {
width: 24px;
height: 24px;
}
.portrait-action { .portrait-action {
flex-shrink: 0; flex-shrink: 0;
} }
...@@ -446,10 +441,4 @@ function jumpPersonCenter(): void { ...@@ -446,10 +441,4 @@ function jumpPersonCenter(): void {
margin: var(--l-spacing-sm) auto 0; margin: var(--l-spacing-sm) auto 0;
} }
.tab-item-inline {
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
}
</style> </style>
...@@ -449,7 +449,6 @@ ...@@ -449,7 +449,6 @@
/* 高度由 tagScrollStyle 内联 px 指定 */ /* 高度由 tagScrollStyle 内联 px 指定 */
.tag-list-view { .tag-list-view {
width: 100%; width: 100%;
max-width: 100%;
align-self: stretch; align-self: stretch;
box-sizing: border-box; box-sizing: border-box;
flex-shrink: 0; flex-shrink: 0;
......
...@@ -409,7 +409,6 @@ function handleClose(): void { ...@@ -409,7 +409,6 @@ function handleClose(): void {
.form-detail-scroll { .form-detail-scroll {
width: 100%; width: 100%;
max-width: 100%;
align-self: stretch; align-self: stretch;
box-sizing: border-box; box-sizing: border-box;
flex-shrink: 0; flex-shrink: 0;
...@@ -478,7 +477,7 @@ function handleClose(): void { ...@@ -478,7 +477,7 @@ function handleClose(): void {
flex-grow: 0; flex-grow: 0;
flex-shrink: 0; flex-shrink: 0;
height: auto; height: auto;
min-height: auto; min-height: 0;
/* 勿用大 padding-bottom;底部留白交给 .form-detail-scroll */ /* 勿用大 padding-bottom;底部留白交给 .form-detail-scroll */
padding-bottom: 0; padding-bottom: 0;
} }
...@@ -580,7 +579,6 @@ function handleClose(): void { ...@@ -580,7 +579,6 @@ function handleClose(): void {
.goods-card--half { .goods-card--half {
flex: 0 0 48%; flex: 0 0 48%;
width: 48%; width: 48%;
max-width: 48%;
} }
.goods-image-wrap { .goods-image-wrap {
...@@ -590,7 +588,6 @@ function handleClose(): void { ...@@ -590,7 +588,6 @@ function handleClose(): void {
.goods-image { .goods-image {
width: 100%; width: 100%;
display: block;
} }
.goods-info { .goods-info {
......
...@@ -248,7 +248,6 @@ ...@@ -248,7 +248,6 @@
.tag-list-view { .tag-list-view {
width: 100%; width: 100%;
max-width: 100%;
align-self: stretch; align-self: stretch;
box-sizing: border-box; box-sizing: border-box;
flex-shrink: 0; flex-shrink: 0;
......
...@@ -947,7 +947,7 @@ defineExpose({ ...@@ -947,7 +947,7 @@ defineExpose({
.score-wrap { .score-wrap {
display: flex; display: flex;
flex-direction: row; flex-direction: row;
align-items: baseline; align-items: flex-end;
} }
.score-num { .score-num {
...@@ -1578,7 +1578,6 @@ defineExpose({ ...@@ -1578,7 +1578,6 @@ defineExpose({
} }
.bubble-time { .bubble-time {
display: block;
font-size: 10px; font-size: 10px;
color: #9CA3AF; color: #9CA3AF;
margin-top: 4px; margin-top: 4px;
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
<un-icon name="arrow-left" size="20"></un-icon> <un-icon name="arrow-left" size="20"></un-icon>
</view> </view>
</template> </template>
{{ title }} <text class="tips-title-text">{{ title }}</text>
</view> </view>
<text v-if="content" <text v-if="content"
class="tips-text"> class="tips-text">
...@@ -36,15 +36,11 @@ ...@@ -36,15 +36,11 @@
<view v-if="showCancelBtn" <view v-if="showCancelBtn"
class="tips-btn close" class="tips-btn close"
@click="cancel"> @click="cancel">
{{ <text class="tips-btn-text tips-btn-text-close">{{ cancelBtnText }}</text>
cancelBtnText
}}
</view> </view>
<view class="tips-btn preview" <view class="tips-btn preview"
@click="confirm"> @click="confirm">
{{ <text class="tips-btn-text tips-btn-text-preview">{{ confirmBtnText }}</text>
confirmBtnText
}}
</view> </view>
</view> </view>
<template v-else> <template v-else>
...@@ -188,16 +184,10 @@ defineExpose({ open, close, hide }); ...@@ -188,16 +184,10 @@ defineExpose({ open, close, hide });
position: relative; position: relative;
width: 100%; width: 100%;
display: flex; display: flex;
flex-direction: row;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
text {
font-weight: 500;
font-size: 18px;
color: #292d33;
text-align: center;
}
.icon-back { .icon-back {
position: absolute; position: absolute;
left: 0; left: 0;
...@@ -208,17 +198,12 @@ defineExpose({ open, close, hide }); ...@@ -208,17 +198,12 @@ defineExpose({ open, close, hide });
} }
.tips-text { .tips-text {
display: block;
text-align: center;
margin-top: 24px;
text {
font-size: 15px; font-size: 15px;
color: #5a5e66; color: #5a5e66;
letter-spacing: 0.5px; letter-spacing: 0.5px;
line-height: 20px; line-height: 20px;
text-align: center; text-align: center;
} margin-top: 24px;
} }
.tips-footer { .tips-footer {
...@@ -230,32 +215,37 @@ defineExpose({ open, close, hide }); ...@@ -230,32 +215,37 @@ defineExpose({ open, close, hide });
border-top: 1px solid #e8e8e8; border-top: 1px solid #e8e8e8;
flex-direction: row; flex-direction: row;
.close {
text {
color: #6c6c70;
}
}
.preview {
text {
color: #2c66f7;
}
}
} }
.tips-btn { .tips-btn {
width: 50%; width: 50%;
display: flex; display: flex;
flex-direction: row;
align-items: center; align-items: center;
justify-content: center; justify-content: center;
}
}
.tips-title-text {
font-weight: 500;
font-size: 18px;
color: #292d33;
text-align: center;
}
text { .tips-btn-text {
text-align: center; text-align: center;
font-size: 16px; font-size: 16px;
line-height: 22px; line-height: 22px;
font-weight: 500; font-weight: 500;
} }
.tips-btn-text-close {
color: #6c6c70;
} }
.tips-btn-text-preview {
color: #2c66f7;
} }
.radius{ .radius{
border-radius: 10px; border-radius: 10px;
......
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
<view class="fab-item" <view class="fab-item"
@click="selectItem(item)"> @click="selectItem(item)">
<view class="icon-box"> <view class="icon-box">
<image class="btn-icon" <image v-if="item.shortTitleUrl != null && item.shortTitleUrl !== ''"
class="btn-icon"
mode="aspectFill" mode="aspectFill"
:src="item.shortTitleUrl" /> :src="item.shortTitleUrl" />
<text class="item-text">{{ item.shortTitle }}</text> <text class="item-text">{{ item.shortTitle }}</text>
......
...@@ -167,29 +167,6 @@ const tabClick = (index: number, item: any) => { ...@@ -167,29 +167,6 @@ const tabClick = (index: number, item: any) => {
color: #292d33; color: #292d33;
} }
.tab-item .text.active::before {
content: '';
position: absolute;
top: 0;
left: 32px;
right: 32px;
height: 100%;
background-color: #fff;
z-index: -1;
}
.tab-item .text.active::after {
content: '';
position: absolute;
bottom: 8px;
left: 50%;
transform: translateX(-50%);
width: 20px;
height: 3px;
background-color: #3b73ff;
border-radius: 8px;
}
.flex { .flex {
display: flex; display: flex;
} }
......
...@@ -41,6 +41,7 @@ ...@@ -41,6 +41,7 @@
} }
}, },
"orientation": [ "orientation": [
"portrait-primary",
"landscape-primary" "landscape-primary"
] ]
} }
...@@ -68,6 +69,7 @@ ...@@ -68,6 +69,7 @@
"default": {} "default": {}
}, },
"orientation": [ "orientation": [
"portrait-primary",
"landscape-primary" "landscape-primary"
], ],
"permissions": [ "permissions": [
...@@ -95,6 +97,7 @@ ...@@ -95,6 +97,7 @@
"icons": {}, "icons": {},
"splashScreens": {}, "splashScreens": {},
"orientation": [ "orientation": [
"portrait-primary",
"landscape-primary" "landscape-primary"
] ]
} }
......
<template> <template>
<view v-if="visible" class="popup-mask" @tap="close"> <view v-if="visible" class="popup-mask" @tap="close">
<view class="popup-box" @tap.stop=""> <view class="popup-box" :style="popupStyle" @tap.stop="">
<view class="popup-title"> <view class="popup-title">
<text class="popup-title-text">套餐详情</text> <text class="popup-title-text">套餐详情</text>
<view class="popup-close" @tap="close"> <view class="popup-close" @tap="close">
<text class="close-icon">×</text> <text class="close-icon">×</text>
</view> </view>
</view> </view>
<view class="popup-content"> <scroll-view class="popup-content" direction="vertical">
<slot></slot> <slot></slot>
</view> </scroll-view>
</view> </view>
</view> </view>
</template> </template>
<script setup lang="uts"> <script setup lang="uts">
import { ref, defineExpose } from 'vue' import { ref, defineExpose, computed } from 'vue'
const emit = defineEmits<{ const emit = defineEmits<{
close: [] close: []
}>() }>()
const visible = ref(false) const visible = ref(false)
const popupStyle = computed((): UTSJSONObject => {
const info = uni.getWindowInfo()
const winH = info.windowHeight > 0 ? info.windowHeight : 768
const heightPx = Math.round(winH * 0.8)
const minHeightPx = Math.round(winH * 0.32)
return {
height: `${heightPx}px`,
minHeight: `${minHeightPx}px`
} as UTSJSONObject
})
function open(): void { function open(): void {
visible.value = true visible.value = true
...@@ -54,8 +64,6 @@ defineExpose({ ...@@ -54,8 +64,6 @@ defineExpose({
.popup-box { .popup-box {
width: 700px; width: 700px;
max-height: 80%;
min-height: 32%;
background: #ffffff; background: #ffffff;
border-radius: var(--l-radius-xl); border-radius: var(--l-radius-xl);
overflow: hidden; overflow: hidden;
...@@ -97,7 +105,6 @@ defineExpose({ ...@@ -97,7 +105,6 @@ defineExpose({
.popup-content { .popup-content {
flex: 1; flex: 1;
overflow: auto;
padding: var(--l-spacing-lg); padding: var(--l-spacing-lg);
} }
</style> </style>
...@@ -40,11 +40,11 @@ ...@@ -40,11 +40,11 @@
class="input" class="input"
:class="[searchValue != '' ? '' : 'placeholder']" :class="[searchValue != '' ? '' : 'placeholder']"
@click="open"> @click="open">
<text v-if="searchValue != ''">{{ searchValue }}</text> <text v-if="searchValue != ''" class="search-input-text">{{ searchValue }}</text>
<text v-else class="placeholder"> <view v-else class="placeholder">
请输入门店名称/商户号搜索 <text class="search-placeholder-text">请输入门店名称/商户号搜索</text>
<view class="sprite-icon icon-search"></view> <view class="sprite-icon icon-search"></view>
</text> </view>
</view> </view>
<input v-else <input v-else
v-model="searchValue" v-model="searchValue"
...@@ -188,7 +188,6 @@ const chooseMerchant = (userInfo: any): void => { ...@@ -188,7 +188,6 @@ const chooseMerchant = (userInfo: any): void => {
.bg-image { .bg-image {
width: 100%; width: 100%;
height: 100%; height: 100%;
display: block;
} }
} }
...@@ -315,8 +314,9 @@ const chooseMerchant = (userInfo: any): void => { ...@@ -315,8 +314,9 @@ const chooseMerchant = (userInfo: any): void => {
align-items: center; align-items: center;
height: 100%; height: 100%;
width: 100%; width: 100%;
justify-content: center;
text { .search-input-text {
font-size: 14px; font-size: 14px;
text-align: center; text-align: center;
} }
...@@ -327,7 +327,12 @@ const chooseMerchant = (userInfo: any): void => { ...@@ -327,7 +327,12 @@ const chooseMerchant = (userInfo: any): void => {
} }
.placeholder { .placeholder {
text { display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
.search-placeholder-text {
font-size: 14px; font-size: 14px;
color: #999999; color: #999999;
text-align: center; text-align: center;
......
...@@ -20,7 +20,6 @@ ...@@ -20,7 +20,6 @@
width: 338px; width: 338px;
height: 281px; height: 281px;
margin: 191px auto 6px; margin: 191px auto 6px;
display: block;
} }
} }
</style> </style>
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
<view class="input"> <view class="input">
<input v-model="mobile" <input v-model="mobile"
class="input-control"
auto-blur auto-blur
maxlength="11" maxlength="11"
placeholder="请输入手机号" placeholder="请输入手机号"
...@@ -25,6 +26,7 @@ ...@@ -25,6 +26,7 @@
<view class="input"> <view class="input">
<input v-model="code" <input v-model="code"
class="input-control"
auto-blur auto-blur
maxlength="4" maxlength="4"
placeholder="请输入验证码" placeholder="请输入验证码"
...@@ -40,7 +42,7 @@ ...@@ -40,7 +42,7 @@
<view class="code-btn" <view class="code-btn"
:class="[count > 0 ? 'code-disabled' : '']" :class="[count > 0 ? 'code-disabled' : '']"
@click="getSmsCode"> @click="getSmsCode">
{{ count > 0 ? `重新发送(${count}s)` : '获取验证码' }} <text class="code-btn-text">{{ count > 0 ? `重新发送(${count}s)` : '获取验证码' }}</text>
</view> </view>
</view> </view>
...@@ -55,8 +57,8 @@ ...@@ -55,8 +57,8 @@
color="#2C66F7" color="#2C66F7"
@click="toggleReadingStatus"> @click="toggleReadingStatus">
</radio> </radio>
<text @click="toggleReadingStatus">我已阅读并同意</text> <text class="auto-login-text" @click="toggleReadingStatus">我已阅读并同意</text>
<text @click.stop="openPrivacy">《隐私协议》</text> <text class="auto-login-text" @click.stop="openPrivacy">《隐私协议》</text>
</view> </view>
<view class="autoLogin"> <view class="autoLogin">
...@@ -64,13 +66,13 @@ ...@@ -64,13 +66,13 @@
color="#2C66F7" color="#2C66F7"
@click="toggleNoSignIn"> @click="toggleNoSignIn">
</radio> </radio>
<text @click="toggleNoSignIn">30天内免登录</text> <text class="auto-login-text" @click="toggleNoSignIn">30天内免登录</text>
</view> </view>
</view> </view>
</view> </view>
<view class="app-code flex"> <view class="app-code flex">
APP编码:{{ deviceId }} <text class="app-code-text">APP编码:{{ deviceId }}</text>
<view class="sprite-icon icon-clone" <view class="sprite-icon icon-clone"
@click="copyDeviceId"> @click="copyDeviceId">
</view> </view>
...@@ -369,10 +371,9 @@ function toggleNoSignIn(): void { ...@@ -369,10 +371,9 @@ function toggleNoSignIn(): void {
border-radius: 5px; border-radius: 5px;
z-index: 999; z-index: 999;
text { .test-entry-text {
color: #fff; color: #fff;
font-size: 14px; font-size: 14px;
} }
} }
</style> </style>
...@@ -11,8 +11,7 @@ ...@@ -11,8 +11,7 @@
left: 0; left: 0;
width: 100%; width: 100%;
height: 100%; height: 100%;
background-image: url('@/assets/activeityCenterBg.png'); background-image: linear-gradient(180deg, #eef4ff 0%, #ffffff 100%);
background-size: 100% 100%;
} }
.login { .login {
...@@ -47,7 +46,7 @@ ...@@ -47,7 +46,7 @@
background: #f7f8fa; background: #f7f8fa;
border-radius: 28px; border-radius: 28px;
input { .input-control {
flex: 1; flex: 1;
height: 100%; height: 100%;
font-size: 16px; font-size: 16px;
...@@ -67,7 +66,7 @@ ...@@ -67,7 +66,7 @@
margin-right: 20px; margin-right: 20px;
border: none; border: none;
text { .code-btn-text {
font-size: 16px; font-size: 16px;
font-weight: 500; font-weight: 500;
color: #2c66f7; color: #2c66f7;
...@@ -92,8 +91,7 @@ ...@@ -92,8 +91,7 @@
border-radius: 28px; border-radius: 28px;
} }
.btn[disabled]:not([type]), .btn-disabled {
.btn[disabled][type='default'] {
background: #c9c9c9 !important; background: #c9c9c9 !important;
} }
...@@ -114,7 +112,7 @@ ...@@ -114,7 +112,7 @@
margin-right: 4px; margin-right: 4px;
} }
text { .auto-login-text {
color: #2c66f7; color: #2c66f7;
} }
} }
...@@ -127,7 +125,7 @@ ...@@ -127,7 +125,7 @@
left: 50%; left: 50%;
transform: translate(-50%); transform: translate(-50%);
text { .app-code-text {
font-size: 12px; font-size: 12px;
line-height: 20px; line-height: 20px;
color: #999; color: #999;
......
<template>
<view class="swipe-stack-root">
<template v-for="(item, index) in items"
:key="index">
<view class="swipe-stack-view"
:class="{ 'swipe-stack-show': isActive(item) }"
@touchstart.stop="touchStart"
@touchmove.stop="touchMove"
@touchend.stop="touchEnd">
<!-- uview-unix:与 uView Transition 文档一致的 mode(slide-left / slide-right) -->
<un-transition :show="isActive(item)"
:mode="enterModeSnap"
:duration="enterDurSnap"
timing-function="cubic-bezier(0.25, 1, 0.5, 1)"
class="swipe-stack-transition">
<slot :active="isActive(item)"
:index="index"
:item="item"
name="item"></slot>
</un-transition>
</view>
</template>
</view>
</template>
<script setup lang="uts">
import { watch } from "vue";
type SwipeNextResult = {
nextId: string
modeName: string
title: string
}
const props = defineProps({
items: {
type: Array,
default: (): Array<any> => []
},
toolItems: {
type: Array,
default: (): Array<any> => []
},
currentId: {
type: String,
default: ""
},
drawStatus: {
type: Boolean,
default: false
},
productModelStatus: {
type: Boolean,
default: false
},
scaleValueObject: {
type: UTSJSONObject,
default: (): UTSJSONObject => ({} as UTSJSONObject)
}
});
const emit = defineEmits(["update:currentId"]);
const modeName = ref<string>("");
/** 与当前次切换绑定,避免 modeName 清空后 un-transition 因 mode 变化再次播放入场 */
const enterModeSnap = ref<string>("fade");
const enterDurSnap = ref<number>(300);
const isTouching = ref<boolean>(false);
const touchDiffX = ref<number>(0);
const touchMoveTimerId = ref<number | null>(null);
const startX = ref<number>(0);
const startY = ref<number>(0);
const screenWidth = ref<number>(0);
function isActive(item: any | null): boolean {
if (item == null) {
return false;
}
const sid = (item as UTSJSONObject)["id"];
return sid == props.currentId;
}
onMounted(() => {
const systemInfo = uni.getSystemInfoSync();
screenWidth.value = systemInfo.screenWidth;
});
/** 与 gl_tape 一致:500ms 后清 modeName(仅用于内部方向状态,动效由 un-transition 承担) */
const MODE_CLEAR_MS = 500;
function applyTransitionSnapFromModeName(): void {
const m = modeName.value;
if (m === "to-right") {
enterModeSnap.value = "slide-right";
enterDurSnap.value = 400;
} else if (m === "to-left") {
enterModeSnap.value = "slide-left";
enterDurSnap.value = 400;
} else {
enterModeSnap.value = "fade";
enterDurSnap.value = 300;
}
}
function indexForCurrentId(cid: string): number {
const list = props.toolItems as Array<any>;
for (let i = 0; i < list.length; i++) {
const row = list[i] as UTSJSONObject;
const rid = row["id"];
if (rid != null && `${rid}` === `${cid}`) {
return i;
}
}
return -1;
}
function directionForIndexChange(oldIdx: number, newIdx: number, len: number): string {
if (len < 2 || oldIdx < 0 || newIdx < 0) {
return "";
}
let delta = newIdx - oldIdx;
if (delta > len / 2) {
delta -= len;
}
if (delta < -len / 2) {
delta += len;
}
if (delta > 0) {
return "to-right";
}
if (delta < 0) {
return "to-left";
}
return "";
}
/** Tab 等外部改 currentId 时补方向;滑动切换已在 touchEnd 里设置 modeName */
watch((): string => props.currentId, (newId: string, oldId: string): void => {
if (props.toolItems.length < 2) {
return;
}
if (oldId == null || `${oldId}` === "" || newId === oldId) {
return;
}
if (modeName.value === "") {
const oi = indexForCurrentId(`${oldId}`);
const ni = indexForCurrentId(`${newId}`);
const dir = directionForIndexChange(oi, ni, props.toolItems.length);
if (dir !== "") {
modeName.value = dir;
setTimeout((): void => {
modeName.value = "";
}, MODE_CLEAR_MS);
}
}
applyTransitionSnapFromModeName();
});
function touchStart(e: UniTouchEvent) {
if (props.drawStatus === true) return;
const touches = e.touches;
if (touches.length === 0) return;
const first = touches[0] as UniTouch;
startX.value = first.clientX != null ? first.clientX : 0;
startY.value = first.clientY != null ? first.clientY : 0;
isTouching.value = true;
touchDiffX.value = 0;
}
function touchMove(e: UniTouchEvent) {
if (!isTouching.value || props.drawStatus === true) return;
if (touchMoveTimerId.value != null) return;
touchMoveTimerId.value = setTimeout((): void => {
const touches = e.touches;
if (touches.length === 0) {
touchMoveTimerId.value = null;
return;
}
const t0 = touches[0] as UniTouch;
const moveX = t0.clientX != null ? t0.clientX : 0;
const moveY = t0.clientY != null ? t0.clientY : 0;
if (Math.abs(moveY - startY.value) > Math.abs(moveX - startX.value)) {
touchMoveTimerId.value = null;
return;
}
touchDiffX.value = moveX - startX.value;
touchMoveTimerId.value = null;
}, 1000 / 60) as number;
}
function getNextId(index: number, toolList: Array<any>, diffX: number): SwipeNextResult {
let nextItem: UTSJSONObject;
let swipeModeName = "";
if (diffX < 0) {
nextItem = index === toolList.length - 1 ? toolList[0] as UTSJSONObject : toolList[index + 1] as UTSJSONObject;
swipeModeName = "to-right";
} else {
nextItem = index === 0 ? toolList[toolList.length - 1] as UTSJSONObject : toolList[index - 1] as UTSJSONObject;
swipeModeName = "to-left";
}
const rawId = nextItem["id"];
const nextIdStr = rawId != null ? `${rawId}` : "";
let titleStr = "";
const tTitle = nextItem["title"];
if (tTitle != null) {
titleStr = `${tTitle}`;
}
if (titleStr === "") {
const tShort = nextItem["shortTitle"];
if (tShort != null) {
titleStr = `${tShort}`;
}
}
return {
nextId: nextIdStr,
modeName: swipeModeName,
title: titleStr
};
}
function touchEnd(e: UniTouchEvent) {
isTouching.value = false;
const pendingMoveTimer = touchMoveTimerId.value;
if (pendingMoveTimer != null) {
clearTimeout(pendingMoveTimer);
touchMoveTimerId.value = null;
}
if (modeName.value != null && modeName.value !== "") return;
try {
if (props.drawStatus === true || props.toolItems.length === 0) {
setTimeout(() => {
touchDiffX.value = 0;
}, 400);
return;
}
const changed = e.changedTouches;
if (changed.length === 0) {
setTimeout(() => {
touchDiffX.value = 0;
}, 400);
return;
}
const touch = changed[0] as UniTouch;
const endX = touch.clientX != null ? touch.clientX : 0;
const endY = touch.clientY != null ? touch.clientY : 0;
const diffX = endX - startX.value;
if (Math.abs(startY.value - endY) > 100) {
setTimeout(() => {
touchDiffX.value = 0;
}, 400);
return;
}
const sw = screenWidth.value;
const isDistanceSignificant = Math.abs(diffX) > sw / 8;
let index = -1;
for (let i = 0; i < props.toolItems.length; i++) {
const row = props.toolItems[i] as UTSJSONObject;
const itemIdVal = row["id"];
if (itemIdVal == props.currentId) {
index = i;
break;
}
}
const scaleKey = props.currentId != null ? props.currentId : "";
if (scaleKey !== "" && props.scaleValueObject[scaleKey] == null) {
props.scaleValueObject[scaleKey] = 1;
}
const scaleOk = scaleKey === "" ? true : props.scaleValueObject[scaleKey] == 1;
if (isDistanceSignificant === true && index != -1 && scaleOk === true && props.productModelStatus === false) {
const toolListResolved = props.toolItems as Array<any>;
const result = getNextId(index, toolListResolved, diffX);
modeName.value = result.modeName;
applyTransitionSnapFromModeName();
emit("update:currentId", result.nextId);
touchDiffX.value = 0;
setTimeout(() => {
modeName.value = "";
}, MODE_CLEAR_MS);
} else {
setTimeout(() => {
touchDiffX.value = 0;
}, 400);
}
} catch (error: any) {
const errText = error != null ? `${error}` : "unknown";
console.log(`ModuleSwipeStack touchEnd: ${errText}`);
touchDiffX.value = 0;
}
}
</script>
<style lang="scss">
.swipe-stack-root {
position: relative;
width: 100%;
height: 100%;
overflow: hidden;
}
.swipe-stack-view {
position: absolute;
width: 100%;
height: 100%;
z-index: -1;
top: 0;
left: 0;
visibility: hidden;
will-change: transform;
}
.swipe-stack-show {
position: absolute;
z-index: 1;
visibility: visible;
}
.swipe-stack-transition {
width: 100%;
height: 100%;
}
</style>
<template> <template>
<view class="reception"> <view class="reception">
<image :src="(props.views as UTSJSONObject).detailUrl" class="reception-image"> <scroll-view class="reception-scroll"
:scroll-y="true">
<image :src="(props.views as UTSJSONObject).detailUrl"
class="reception-image"
mode="widthFix">
</image> </image>
</scroll-view>
</view> </view>
</template> </template>
<script setup lang="uts"> <script setup lang="uts">
const props = defineProps({ const props = defineProps({
views: UTSJSONObject, views: {
type: UTSJSONObject,
default: (): UTSJSONObject => ({} as UTSJSONObject)
},
title: String, title: String,
show: Boolean show: Boolean
}) });
</script> </script>
<style lang="scss"> <style lang="scss">
.reception { .reception {
display: flex; display: flex;
justify-content: center; flex-direction: column;
align-items: center;
width: 100%; width: 100%;
height: 100%; height: 100%;
.reception-image { }
.reception-scroll {
flex: 1;
width: 100%; width: 100%;
height: 100%; height: 0;
min-height: 0;
} }
.reception-image {
width: 100%;
display: block;
} }
</style> </style>
...@@ -98,13 +98,13 @@ export function getResponsiveImage(img: ResponsiveImage): string { ...@@ -98,13 +98,13 @@ export function getResponsiveImage(img: ResponsiveImage): string {
// 高倍率屏优先使用高清图 // 高倍率屏优先使用高清图
if (pr >= 3) { if (pr >= 3) {
if (img.x3) return img.x3; if (img.x3 !== null) return img.x3;
if (img.x2) return img.x2; if (img.x2 !== null) return img.x2;
return img.x1; return img.x1;
} }
if (pr >= 2) { if (pr >= 2) {
if (img.x2) return img.x2; if (img.x2 !== null) return img.x2;
if (img.x3) return img.x3; if (img.x3 !== null) return img.x3;
return img.x1; return img.x1;
} }
......
...@@ -84,7 +84,7 @@ $uni-font-size-paragraph: 15px; ...@@ -84,7 +84,7 @@ $uni-font-size-paragraph: 15px;
.text-two-line { .text-two-line {
overflow: hidden; overflow: hidden;
text-overflow: ellipsis; text-overflow: ellipsis;
display: -webkit-flex; display: flex;
max-height: 48px; /* 根据 font-size * line-height * 2 计算 */ max-height: 48px; /* 根据 font-size * line-height * 2 计算 */
} }
...@@ -105,31 +105,6 @@ $uni-font-size-paragraph: 15px; ...@@ -105,31 +105,6 @@ $uni-font-size-paragraph: 15px;
align-items: center; align-items: center;
padding-left: 48rpx; padding-left: 48rpx;
/* color/font-size/font-weight only on <text> in uni-app-x; use .title-text inside */ /* color/font-size/font-weight only on <text> in uni-app-x; use .title-text inside */
&::after {
content: "";
position: absolute;
left: 0;
top: 0;
z-index: -2;
width: 100%;
height: 100%;
background: linear-gradient(0deg, #94c2ff00 0%, #5294ff 100%);
opacity: 0.15;
}
&::before {
content: "";
position: absolute;
left: -20rpx;
top: -28rpx;
z-index: -1;
width: 136rpx;
height: 136rpx;
opacity: 0.6;
background: linear-gradient(-44.4deg, #94c2ff00 0%, #5294ff 100%);
filter: blur(24rpx);
}
} }
.bg-title { .bg-title {
position: absolute; position: absolute;
...@@ -143,29 +118,4 @@ $uni-font-size-paragraph: 15px; ...@@ -143,29 +118,4 @@ $uni-font-size-paragraph: 15px;
color: #333333; color: #333333;
font-size: 34rpx; font-size: 34rpx;
font-weight: 500; font-weight: 500;
&::after {
content: "";
position: absolute;
left: 0;
top: 0;
z-index: -2;
width: 100%;
height: 100%;
background: linear-gradient(0deg, #94c2ff00 0%, #5294ff 100%);
opacity: 0.15;
}
&::before {
content: "";
position: absolute;
left: -20rpx;
top: -28rpx;
z-index: -1;
width: 136rpx;
height: 136rpx;
opacity: 0.6;
background: linear-gradient(-44.4deg, #94c2ff00 0%, #5294ff 100%);
filter: blur(24rpx);
}
} }
...@@ -15,6 +15,9 @@ var retryTimer: number = 0 ...@@ -15,6 +15,9 @@ var retryTimer: number = 0
export function applyScreenOrientationLock(): void { export function applyScreenOrientationLock(): void {
// #ifdef APP // #ifdef APP
if (!layoutService.isInitialized()) {
layoutService.init()
}
if (layoutService.isMode('pad') || layoutService.isMode('desktop')) { if (layoutService.isMode('pad') || layoutService.isMode('desktop')) {
lockOrientation('landscape-primary') lockOrientation('landscape-primary')
// 某些机型/框架在页面切换后会把方向“抖回去”,这里再补一次锁定 // 某些机型/框架在页面切换后会把方向“抖回去”,这里再补一次锁定
......
...@@ -747,8 +747,6 @@ importers: ...@@ -747,8 +747,6 @@ importers:
apps/uniappX/uniapp-x-tape/uni_modules/uni-logger: {} apps/uniappX/uniapp-x-tape/uni_modules/uni-logger: {}
apps/uniappX/uniapp-x-tape/uni_modules/uni-popup: {}
apps/uniappX/uniapp-x-tape/uni_modules/uni-recorder-x: {} apps/uniappX/uniapp-x-tape/uni_modules/uni-recorder-x: {}
apps/uniappX/uniapp-x-tape/uni_modules/uni-scss: {} apps/uniappX/uniapp-x-tape/uni_modules/uni-scss: {}
...@@ -759,7 +757,7 @@ importers: ...@@ -759,7 +757,7 @@ importers:
apps/uniappX/uniapp-x-tape/uni_modules/uts-openSchema: {} apps/uniappX/uniapp-x-tape/uni_modules/uts-openSchema: {}
apps/uniappX/uniapp-x-tape/uni_modules/uts-recorder: {} apps/uniappX/uniapp-x-tape/uni_modules/uview-unix: {}
apps/uniappX/uniapp-x-tape/uni_modules/z-paging-x: {} apps/uniappX/uniapp-x-tape/uni_modules/z-paging-x: {}
...@@ -10679,6 +10677,7 @@ packages: ...@@ -10679,6 +10677,7 @@ packages:
vue-i18n@9.14.5: vue-i18n@9.14.5:
resolution: {integrity: sha512-0jQ9Em3ymWngyiIkj0+c/k7WgaPO+TNzjKSNq9BvBQaKJECqn9cd9fL4tkDhB5G1QBskGl9YxxbDAhgbFtpe2g==} resolution: {integrity: sha512-0jQ9Em3ymWngyiIkj0+c/k7WgaPO+TNzjKSNq9BvBQaKJECqn9cd9fL4tkDhB5G1QBskGl9YxxbDAhgbFtpe2g==}
engines: {node: '>= 16'} engines: {node: '>= 16'}
deprecated: v9 and v10 no longer supported. please migrate to v11. about maintenance status, see https://vue-i18n.intlify.dev/guide/maintenance.html
peerDependencies: peerDependencies:
vue: ^3.5.17 vue: ^3.5.17
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!