修改登录、订单复核页面

This commit is contained in:
zm2000 2026-08-21 18:02:15 +08:00
parent f615f90c27
commit a304fe645d
6 changed files with 98 additions and 63 deletions

View File

@ -40,7 +40,7 @@
</view> </view>
</view> </view>
<view v-if="showSwitchMask" class="switch-mask"></view> <view v-show="switchMaskVisible" :class="['switch-mask', switchMaskActive ? 'switch-mask--active' : '']"></view>
</view> </view>
</template> </template>
@ -75,8 +75,10 @@ export default {
lastMenuClickAt: 0, lastMenuClickAt: 0,
routeSyncTimer: null, routeSyncTimer: null,
lastRoutePath: '', lastRoutePath: '',
showSwitchMask: false, switchMaskVisible: false,
switchMaskActive: false,
switchMaskTimer: null, switchMaskTimer: null,
switchMaskFadeTimer: null,
switchMaskStartedAt: 0, switchMaskStartedAt: 0,
currentUser: null, currentUser: null,
defaultMenus: [ defaultMenus: [
@ -148,6 +150,10 @@ export default {
clearTimeout(this.switchMaskTimer) clearTimeout(this.switchMaskTimer)
this.switchMaskTimer = null this.switchMaskTimer = null
} }
if (this.switchMaskFadeTimer) {
clearTimeout(this.switchMaskFadeTimer)
this.switchMaskFadeTimer = null
}
}, },
methods: { methods: {
normalizePath(path) { normalizePath(path) {
@ -183,22 +189,42 @@ export default {
return currentPage?.route ? `/${currentPage.route}` : '' return currentPage?.route ? `/${currentPage.route}` : ''
}, },
showNavigationMask() { showNavigationMask() {
this.showSwitchMask = true
this.switchMaskStartedAt = Date.now() this.switchMaskStartedAt = Date.now()
if (this.switchMaskTimer) { if (this.switchMaskTimer) {
clearTimeout(this.switchMaskTimer) clearTimeout(this.switchMaskTimer)
this.switchMaskTimer = null this.switchMaskTimer = null
} }
if (this.switchMaskFadeTimer) {
clearTimeout(this.switchMaskFadeTimer)
this.switchMaskFadeTimer = null
}
// 先把遮罩放回 DOM(透明状态),下一帧再激活透明度触发淡入
this.switchMaskActive = false
this.switchMaskVisible = true
this.$nextTick(() => {
this.switchMaskActive = true
})
}, },
hideNavigationMask() { hideNavigationMask() {
const elapsed = Date.now() - this.switchMaskStartedAt const elapsed = Date.now() - this.switchMaskStartedAt
const delay = elapsed >= 100 ? 0 : 100 - elapsed // 至少保持可见一段时间,给新页面留出首帧渲染时间,避免刚出现就消失造成闪烁
const minVisible = 180
const delay = elapsed >= minVisible ? 0 : minVisible - elapsed
if (this.switchMaskTimer) { if (this.switchMaskTimer) {
clearTimeout(this.switchMaskTimer) clearTimeout(this.switchMaskTimer)
} }
this.switchMaskTimer = setTimeout(() => { this.switchMaskTimer = setTimeout(() => {
this.showSwitchMask = false
this.switchMaskTimer = null this.switchMaskTimer = null
// 触发淡出过渡
this.switchMaskActive = false
if (this.switchMaskFadeTimer) {
clearTimeout(this.switchMaskFadeTimer)
}
// 淡出动画结束后再移除 DOM,保证过渡完整执行
this.switchMaskFadeTimer = setTimeout(() => {
this.switchMaskFadeTimer = null
this.switchMaskVisible = false
}, 200)
}, delay) }, delay)
}, },
navigateToMenu(targetPath) { navigateToMenu(targetPath) {
@ -322,6 +348,7 @@ export default {
} }
this.loadCurrentUserInfo() this.loadCurrentUserInfo()
this.closeMinePopup()
uni.showToast({ uni.showToast({
title: '角色切换成功', title: '角色切换成功',
icon: 'success', icon: 'success',
@ -402,7 +429,7 @@ export default {
} }
.top-nav-menu-text { .top-nav-menu-text {
font-size: 28rpx; font-size: 32rpx;
color: #fff; color: #fff;
font-weight: 500; font-weight: 500;
} }
@ -478,7 +505,7 @@ export default {
} }
.popup-user-text { .popup-user-text {
font-size: 24rpx; font-size: 28rpx;
color: #333; color: #333;
} }
@ -490,14 +517,14 @@ export default {
margin-top: 16rpx; margin-top: 16rpx;
height: 60rpx; height: 60rpx;
line-height: 60rpx; line-height: 60rpx;
font-size: 24rpx; font-size: 28rpx;
} }
.close-btn { .close-btn {
margin-top: 10rpx; margin-top: 10rpx;
height: 60rpx; height: 60rpx;
line-height: 60rpx; line-height: 60rpx;
font-size: 24rpx; font-size: 28rpx;
background-color: #f5f7fb; background-color: #f5f7fb;
color: #333; color: #333;
} }
@ -508,8 +535,16 @@ export default {
top: 0; top: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
background-color: rgba(248, 248, 248, 0.96); background-color: #f8f8f8;
z-index: 9999; z-index: 9999;
pointer-events: none; pointer-events: none;
opacity: 0;
visibility: hidden;
transition: opacity 0.2s ease, visibility 0.2s ease;
}
.switch-mask--active {
opacity: 1;
visibility: visible;
} }
</style> </style>

View File

@ -8,12 +8,9 @@
/> />
<view class="layout-main"> <view class="layout-main">
<component <keep-alive v-if="activeViewComponent">
v-if="activeViewComponent" <component :is="activeViewComponent" :embedded="true" compact-top />
:is="activeViewComponent" </keep-alive>
:key="activeMenuPath"
compact-top
/>
<view v-else class="module-placeholder"> <view v-else class="module-placeholder">
<text class="module-placeholder-title">{{ getActiveMenuTitle() || '请选择功能菜单' }}</text> <text class="module-placeholder-title">{{ getActiveMenuTitle() || '请选择功能菜单' }}</text>
<text v-if="activeMenuPath" class="module-placeholder-desc">该菜单页面尚未配置({{ activeMenuPath }})</text> <text v-if="activeMenuPath" class="module-placeholder-desc">该菜单页面尚未配置({{ activeMenuPath }})</text>

View File

@ -917,7 +917,7 @@ export default {
return return
} }
uni.reLaunch({ uni.reLaunch({
url: '/pages/order/index', url: '/pages/index/index',
}) })
}, 300) }, 300)
return return
@ -986,7 +986,7 @@ export default {
return return
} }
uni.reLaunch({ uni.reLaunch({
url: '/pages/order/index', url: '/pages/index/index',
}) })
}, 300) }, 300)
return return

View File

@ -1,6 +1,6 @@
<template> <template>
<view class="page"> <view class="page">
<top-nav /> <top-nav v-if="!embedded" />
<view class="page-main order-review-one"> <view class="page-main order-review-one">
<view class="container container--compact-top"> <view class="container container--compact-top">
<view class="search-bar"> <view class="search-bar">
@ -215,6 +215,13 @@ export default {
components: { components: {
TopNav, TopNav,
}, },
props: {
// 在布局壳内渲染时为 true,隐藏内嵌顶栏;独立访问时不传,显示顶栏
embedded: {
type: Boolean,
default: false,
},
},
data() { data() {
return { return {
pendingCount: 134, pendingCount: 134,
@ -280,24 +287,18 @@ export default {
this.requestCameraPreview() this.requestCameraPreview()
this.bindFullscreenEvents() this.bindFullscreenEvents()
}, },
onReady() { activated() {
// keep-alive 从缓存恢复时重新初始化摄像头
this.requestCameraPreview() this.requestCameraPreview()
}, },
onShow() { deactivated() {
this.requestCameraPreview() // 切走时释放摄像头,避免设备被持续占用
this.stopCameraPreview()
}, },
beforeUnmount() { beforeUnmount() {
this.unbindFullscreenEvents() this.unbindFullscreenEvents()
this.stopCameraPreview() this.stopCameraPreview()
}, },
beforeDestroy() {
this.unbindFullscreenEvents()
this.stopCameraPreview()
},
onUnload() {
this.unbindFullscreenEvents()
this.stopCameraPreview()
},
methods: { methods: {
requestCameraPreview() { requestCameraPreview() {
if (this.cameraInitializing || this.cameraLoading || this.cameraReady) { if (this.cameraInitializing || this.cameraLoading || this.cameraReady) {
@ -898,8 +899,8 @@ export default {
<style> <style>
.page { .page {
height: 100vh; height: 100%;
min-height: 100vh; min-height: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow: hidden; overflow: hidden;
@ -907,10 +908,6 @@ export default {
background-color: #f8f8f8; background-color: #f8f8f8;
} }
.page > .top-nav {
flex-shrink: 0;
}
.page-main { .page-main {
flex: 1; flex: 1;
min-height: 0; min-height: 0;
@ -1034,7 +1031,7 @@ export default {
} }
.camera-control-icon { .camera-control-icon {
font-size: 30rpx; font-size: 28rpx;
line-height: 1; line-height: 1;
color: #ffffff; color: #ffffff;
} }
@ -1059,7 +1056,7 @@ export default {
.camera-zoom-text { .camera-zoom-text {
width: 88rpx; width: 88rpx;
text-align: center; text-align: center;
font-size: 26rpx; font-size: 28rpx;
color: #333; color: #333;
} }
@ -1075,7 +1072,7 @@ export default {
} }
.camera-preview-text { .camera-preview-text {
font-size: 24rpx; font-size: 28rpx;
color: #9098a4; color: #9098a4;
line-height: 1.5; line-height: 1.5;
text-align: center; text-align: center;
@ -1086,7 +1083,7 @@ export default {
} }
.left-summary-text { .left-summary-text {
font-size: 30rpx; font-size: 28rpx;
color: #333; color: #333;
line-height: 1.4; line-height: 1.4;
} }
@ -1143,7 +1140,7 @@ export default {
.settings-label { .settings-label {
width: 200rpx; width: 200rpx;
font-size: 24rpx; font-size: 28rpx;
color: #333; color: #333;
} }
@ -1153,7 +1150,7 @@ export default {
border: 1rpx solid #e5e5e5; border: 1rpx solid #e5e5e5;
border-radius: 8rpx; border-radius: 8rpx;
padding: 0 16rpx; padding: 0 16rpx;
font-size: 24rpx; font-size: 28rpx;
background-color: #fff; background-color: #fff;
box-sizing: border-box; box-sizing: border-box;
} }
@ -1168,7 +1165,7 @@ export default {
width: 100%; width: 100%;
height: 68rpx; height: 68rpx;
line-height: 68rpx; line-height: 68rpx;
font-size: 26rpx; font-size: 28rpx;
} }
.header-action-btn { .header-action-btn {
@ -1194,7 +1191,7 @@ export default {
.header-action-text { .header-action-text {
width: 100%; width: 100%;
text-align: center; text-align: center;
font-size: 22rpx; font-size: 28rpx;
line-height: 1; line-height: 1;
color: #333; color: #333;
} }
@ -1251,7 +1248,7 @@ export default {
} }
.pagination-info { .pagination-info {
font-size: 24rpx; font-size: 28rpx;
color: #666; color: #666;
} }
@ -1265,7 +1262,7 @@ export default {
width: 140rpx; width: 140rpx;
height: 56rpx; height: 56rpx;
line-height: 56rpx; line-height: 56rpx;
font-size: 24rpx; font-size: 28rpx;
margin: 0; margin: 0;
} }
@ -1318,7 +1315,7 @@ export default {
border: 1rpx solid #e6ebf5; border: 1rpx solid #e6ebf5;
background-color: #fff; background-color: #fff;
color: #999; color: #999;
font-size: 26rpx; font-size: 28rpx;
} }
.empty-panel--left { .empty-panel--left {
@ -1409,7 +1406,7 @@ export default {
.table-cell { .table-cell {
padding: 0 12rpx; padding: 0 12rpx;
font-size: 24rpx; font-size: 28rpx;
color: #333; color: #333;
line-height: 1.4; line-height: 1.4;
white-space: nowrap; white-space: nowrap;
@ -1467,7 +1464,7 @@ export default {
.empty { .empty {
text-align: center; text-align: center;
color: #999; color: #999;
font-size: 26rpx; font-size: 28rpx;
padding: 24rpx 0; padding: 24rpx 0;
} }

View File

@ -1,6 +1,6 @@
<template> <template>
<view class="page"> <view class="page">
<top-nav /> <top-nav v-if="!embedded" />
<view class="page-main"> <view class="page-main">
<view class="dynamic-view dynamic-view--returns"> <view class="dynamic-view dynamic-view--returns">
<view class="module-card"> <view class="module-card">
@ -20,13 +20,20 @@ export default {
components: { components: {
TopNav, TopNav,
}, },
props: {
// 在布局壳内渲染时为 true,隐藏内嵌顶栏;独立访问时不传,显示顶栏
embedded: {
type: Boolean,
default: false,
},
},
} }
</script> </script>
<style> <style>
.page { .page {
height: 100vh; height: 100%;
min-height: 100vh; min-height: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow: hidden; overflow: hidden;
@ -34,10 +41,6 @@ export default {
background-color: #f8f8f8; background-color: #f8f8f8;
} }
.page > .top-nav {
flex-shrink: 0;
}
.page-main { .page-main {
flex: 1; flex: 1;
min-height: 0; min-height: 0;

View File

@ -1,6 +1,6 @@
<template> <template>
<view class="page"> <view class="page">
<top-nav /> <top-nav v-if="!embedded" />
<view class="page-main"> <view class="page-main">
<view class="dynamic-view dynamic-view--catch-weight"> <view class="dynamic-view dynamic-view--catch-weight">
<view class="module-card"> <view class="module-card">
@ -20,13 +20,20 @@ export default {
components: { components: {
TopNav, TopNav,
}, },
props: {
// 在布局壳内渲染时为 true,隐藏内嵌顶栏;独立访问时不传,显示顶栏
embedded: {
type: Boolean,
default: false,
},
},
} }
</script> </script>
<style> <style>
.page { .page {
height: 100vh; height: 100%;
min-height: 100vh; min-height: 0;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow: hidden; overflow: hidden;
@ -34,10 +41,6 @@ export default {
background-color: #f8f8f8; background-color: #f8f8f8;
} }
.page > .top-nav {
flex-shrink: 0;
}
.page-main { .page-main {
flex: 1; flex: 1;
min-height: 0; min-height: 0;