From a5cedd525f4c7b4eb044de4398149cbf59bb3b1b Mon Sep 17 00:00:00 2001 From: zm2000 <18386612143@163.com> Date: Fri, 6 Nov 2026 18:00:23 +0800 Subject: [PATCH] =?UTF-8?q?feat(UI):=20=E9=80=80=E5=87=BA/=E9=80=80?= =?UTF-8?q?=E5=87=BA=E7=99=BB=E5=BD=95/=E6=B8=85=E7=A9=BA=E8=AE=B0?= =?UTF-8?q?=E5=BD=95=E5=BC=B9=E7=AA=97=E7=BB=9F=E4=B8=80=E6=94=B9=E9=80=A0?= =?UTF-8?q?=20+=20=E8=AE=BE=E7=BD=AE=E4=B8=8E=E5=B9=BF=E6=92=AD=E9=A1=B5?= =?UTF-8?q?=E8=A7=86=E8=A7=89=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 新增全局退出应用确认弹窗:新增 app Vuex 模块(exitConfirmVisible), APP 退出事件由 uni.showModal 改为 commit('app/showExitConfirm'), 首页 index.vue 渲染自定义退出确认弹窗(取消/退出) - 「我的」退出登录确认弹窗由 u-modal 改为自定义 UI,新增退出中 loading 状态 - 广播设置页 UI 重构:参数设置面板增加标题/标签圆点/输入框样式/「当前生效」标签, 读取扫描结果布局调整,清空扫描记录改为二次确认弹窗 - 设置/帮助支持页:账号安全、设备查找、扫描音效、问题报障、意见反馈、 帮助手册、操作信息等标记为「暂未开放」,点击提示不再做登录检查跳转 - uView 适配:main.js 将 uView 引入提前到 App 之前(easycom 依赖 uni.$u); u-loading 改为 u-loading-icon;u-cell_title/u-btn 类名适配为 u-cell__title-text/u-button; 图标统一改用 icon-style - 首页全部功能页编辑按钮样式调整;仓库选择器 StoreSelector 字号调大 - 视觉统一:设置/帮助/关于等页面背景统一为 #f7f8fa,卡片圆角/阴影统一, 多页面字号整体调大 - 移除登录后 getCartList/getUserData 的冗余调度调用 --- .../StoreSelector/StoreSelector.vue | 8 +- src/core/router/index.js | 10 +- src/core/store/index.js | 4 +- src/core/store/modules/app.js | 20 ++ src/core/store/modules/user.js | 7 +- src/main.js | 7 +- src/pages/home/edit-quick-actions.vue | 31 +- src/pages/index/index.vue | 103 ++++++ src/pages/settings/about.vue | 31 +- src/pages/settings/broadcastSettings.vue | 316 +++++++++++++----- src/pages/settings/helpSupport.vue | 58 +++- src/pages/settings/index.vue | 63 ++-- src/pages/user/index.vue | 115 +++++-- 13 files changed, 564 insertions(+), 209 deletions(-) create mode 100644 src/core/store/modules/app.js diff --git a/src/components/StoreSelector/StoreSelector.vue b/src/components/StoreSelector/StoreSelector.vue index 112d695..b67fec5 100644 --- a/src/components/StoreSelector/StoreSelector.vue +++ b/src/components/StoreSelector/StoreSelector.vue @@ -174,7 +174,7 @@ &__name { flex: 1; min-width: 0; - font-size: 28rpx; + font-size: 32rpx; font-weight: 500; color: #303133; overflow: hidden; @@ -199,7 +199,7 @@ &__text { margin-top: 20rpx; - font-size: 26rpx; + font-size: 30rpx; color: #909399; } } @@ -240,7 +240,7 @@ } &__name { - font-size: 30rpx; + font-size: 34rpx; color: #303133; font-weight: 500; overflow: hidden; @@ -262,7 +262,7 @@ &__desc { margin-top: 6rpx; - font-size: 24rpx; + font-size: 30rpx; color: #909399; overflow: hidden; white-space: nowrap; diff --git a/src/core/router/index.js b/src/core/router/index.js index 965c425..d32cc14 100644 --- a/src/core/router/index.js +++ b/src/core/router/index.js @@ -22,15 +22,7 @@ const router = createRouter({ case 3: // APP退出应用 // #ifdef APP-PLUS router.$lockStatus = false; - uni.showModal({ - title: '提示', - content: '您确定要退出应用吗?', - success: function(res) { - if (res.confirm) { - plus.runtime.quit(); - } - } - }); + store.commit('app/showExitConfirm'); // #endif break; case 2: diff --git a/src/core/store/index.js b/src/core/store/index.js index a9ae08b..c6e033d 100644 --- a/src/core/store/index.js +++ b/src/core/store/index.js @@ -10,6 +10,7 @@ import bluetoothPrint from './modules/bluetoothPrint.js' import bluetoothScale from './modules/bluetoothScale.js' import print from './modules/print.js' import deviceInfo from './modules/deviceInfo.js' +import app from './modules/app.js' const store = new Vuex.Store({ modules: { @@ -20,7 +21,8 @@ const store = new Vuex.Store({ bluetoothPrint, bluetoothScale, print, - deviceInfo + deviceInfo, + app } }) diff --git a/src/core/store/modules/app.js b/src/core/store/modules/app.js new file mode 100644 index 0000000..93af32c --- /dev/null +++ b/src/core/store/modules/app.js @@ -0,0 +1,20 @@ +/** + * 应用级 UI 状态(全局弹窗等) + */ +const app = { + namespaced: true, + state: { + // 退出应用确认弹窗是否可见 + exitConfirmVisible: false + }, + mutations: { + showExitConfirm(state) { + state.exitConfirmVisible = true + }, + hideExitConfirm(state) { + state.exitConfirmVisible = false + } + } +} + +export default app diff --git a/src/core/store/modules/user.js b/src/core/store/modules/user.js index a12eed8..5539395 100644 --- a/src/core/store/modules/user.js +++ b/src/core/store/modules/user.js @@ -98,12 +98,7 @@ const actions = { commit('SET_ROLEID', user.employees_id) resolve(user) - }).then(() => { - // 只有在登录的时候请求购物车信息,订单信息,获取登录信息之后。 - token && dispatch('getCartList'); - token && dispatch('getUserData'); - }) - .catch(e => { + }).catch(e => { reject(e) }) }) diff --git a/src/main.js b/src/main.js index c9f7770..d592b7c 100644 --- a/src/main.js +++ b/src/main.js @@ -1,10 +1,11 @@ import Vue from 'vue' +// 引入全局uView(必须先于 App 导入:App.vue 模板里的 u-icon/u-button 走 easycom 自动导入, +// 其 props.js 依赖 uni.$u,需先由 uView 的 index.js 在模块加载时设置 uni.$u) +import uView from '@/uni_modules/uview-ui' + import App from './App' import core from "@/core"; -// 引入全局uView -import uView from '@/uni_modules/uview-ui' - import mixin from './common/mixin' import { router, diff --git a/src/pages/home/edit-quick-actions.vue b/src/pages/home/edit-quick-actions.vue index 2f36d45..4b1d1e2 100644 --- a/src/pages/home/edit-quick-actions.vue +++ b/src/pages/home/edit-quick-actions.vue @@ -7,8 +7,7 @@ 全部功能 - - {{ isEditMode ? '完成' : '编辑常用' }} + {{ isEditMode ? '完成' : '编辑' }} @@ -50,7 +49,7 @@ - + 正在加载功能列表... @@ -470,22 +469,28 @@ .edit-common-btn { position: absolute; right: 20rpx; - height: 56rpx; + height: 60rpx; display: flex; align-items: center; justify-content: center; - font-size: 32rpx; - color: #2979ff; - padding: 0 8rpx; + padding: 0 32rpx; + background: #2979ff; + border-radius: 12rpx; + transition: all 0.2s ease; .edit-common-text { - margin-left: 6rpx; - font-size: 32rpx; + font-size: 34rpx; + font-weight: 500; + color: #fff; line-height: 1; } + &:active { + opacity: 0.85; + } + &.active { - color: #19be6b; + background: #19be6b; } } } @@ -614,6 +619,10 @@ padding-right: 110rpx; } + ::v-deep .u-search__content__input { + font-size: 34rpx; + } + ::v-deep .u-search__content__close { margin-right: 12rpx; } @@ -638,7 +647,7 @@ flex-shrink: 0; &__text { - font-size: 30rpx; + font-size: 34rpx; font-weight: 500; color: #2979ff; line-height: 1; diff --git a/src/pages/index/index.vue b/src/pages/index/index.vue index 8f554a8..21f5f96 100644 --- a/src/pages/index/index.vue +++ b/src/pages/index/index.vue @@ -184,6 +184,21 @@ + + + + + + + + 退出应用 + 您确定要退出应用吗? + + + + + + @@ -448,6 +463,21 @@ }, methods: { + // 取消退出应用 + cancelExitApp() { + this.$store.commit('app/hideExitConfirm'); + }, + + // 确认退出应用 + confirmExitApp() { + // #ifdef APP-PLUS + plus.runtime.quit(); + // #endif + // #ifndef APP-PLUS + this.$store.commit('app/hideExitConfirm'); + // #endif + }, + // 设置真机状态栏文字/图标颜色与底色(light=白色文字/蓝色底,dark=深色文字/白色底);非 App 端自动忽略 setAppStatusBarStyle(style) { // #ifdef APP-PLUS @@ -2330,4 +2360,77 @@ color: #909399; } } + + /* 退出应用确认弹窗 */ + .exit-app-mask { + position: fixed; + left: 0; + top: 0; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, 0.48); + display: flex; + align-items: center; + justify-content: center; + z-index: 9999; + padding: 60rpx; + box-sizing: border-box; + } + + .exit-app-dialog { + width: 100%; + max-width: 620rpx; + background: #fff; + border-radius: 24rpx; + padding: 40rpx 36rpx 36rpx; + box-sizing: border-box; + box-shadow: 0 24rpx 80rpx rgba(0, 0, 0, 0.18); + display: flex; + flex-direction: column; + align-items: center; + } + + .exit-app-icon { + display: flex; + align-items: center; + justify-content: center; + } + + .exit-app-title { + display: block; + text-align: center; + margin-top: 30rpx; + font-size: 36rpx; + font-weight: 600; + color: #303133; + } + + .exit-app-desc { + display: block; + text-align: center; + margin-top: 16rpx; + font-size: 34rpx; + line-height: 1.6; + color: #606266; + } + + .exit-app-actions { + display: flex; + width: 100%; + margin-top: 40rpx; + } + + .exit-app-actions ::v-deep .u-button { + flex: 1; + height: 80rpx; + } + + .exit-app-actions ::v-deep .u-button__text, + .exit-app-actions ::v-deep .u-button__loading-text { + font-size: 36rpx !important; + } + + .exit-app-actions ::v-deep .u-button + .u-button { + margin-left: 20rpx; + } \ No newline at end of file diff --git a/src/pages/settings/about.vue b/src/pages/settings/about.vue index 6b66efa..6364dc0 100644 --- a/src/pages/settings/about.vue +++ b/src/pages/settings/about.vue @@ -560,17 +560,8 @@ export default { height: 100vh; display: flex; flex-direction: column; - /* 与「我的」页面保持一致的浅蓝背景 */ - background: #f2f8ff; - - /* 导航栏(标题 + 状态栏)同步浅蓝底,避免出现白色条 */ - ::v-deep .nav-title { - background: #f2f8ff; - } - - ::v-deep .status_bar { - background-color: #f2f8ff !important; - } + /* 与设置页保持一致的浅灰背景 */ + background: #f7f8fa; } .about-content { @@ -600,7 +591,7 @@ export default { } .about-version { - font-size: 26rpx; + font-size: 28rpx; color: #909399; } @@ -631,7 +622,7 @@ export default { .about-hint { margin-top: 20rpx; - font-size: 22rpx; + font-size: 28rpx; color: #a8b3c4; text-align: center; } @@ -642,7 +633,7 @@ export default { } .about-copyright { - font-size: 24rpx; + font-size: 28rpx; color: #c0c4cc; } @@ -687,7 +678,7 @@ export default { /* 旧真机 WebView 不支持 flex gap,改用 margin 控制间距 */ .update-version { margin-top: 10rpx; - font-size: 24rpx; + font-size: 28rpx; color: #5c6b77; } @@ -704,13 +695,13 @@ export default { .update-label { margin-right: 20rpx; - font-size: 26rpx; + font-size: 28rpx; color: #86909c; flex-shrink: 0; } .update-value { - font-size: 26rpx; + font-size: 28rpx; color: #333; text-align: right; word-break: break-all; @@ -725,7 +716,7 @@ export default { } .update-tip { - font-size: 26rpx; + font-size: 28rpx; line-height: 1.6; color: #4e5969; } @@ -750,7 +741,7 @@ export default { } .update-progress-text { - font-size: 26rpx; + font-size: 28rpx; color: #333; } @@ -769,7 +760,7 @@ export default { } .update-error { - font-size: 24rpx; + font-size: 28rpx; color: #fa3534; line-height: 1.6; } diff --git a/src/pages/settings/broadcastSettings.vue b/src/pages/settings/broadcastSettings.vue index eed89e6..16f50a3 100644 --- a/src/pages/settings/broadcastSettings.vue +++ b/src/pages/settings/broadcastSettings.vue @@ -15,32 +15,41 @@ + + 参数设置 + 配置广播名与数据键名,保存后自动开始监听 + + + 广播名 (Action) - - + - - {{ broadcast.action }} - + + 当前生效 + {{ broadcast.action }} + + 数据键名 (Key) - - + - - {{ broadcast.key }} - + + 当前生效 + {{ broadcast.key }} + @@ -73,8 +82,10 @@ - 读取扫描结果 - + 读取扫描结果 + + 清空记录 @@ -109,6 +120,18 @@ + + + + + 清空扫描记录 + 确定要清空所有扫描记录吗?清空后不可恢复。 + + + + + + @@ -136,6 +159,9 @@ // 广播状态 broadcastActive: false, + // 清空记录确认弹窗 + showClearConfirm: false, + // 当前回调引用(用于销毁) currentCallback: null } @@ -424,23 +450,26 @@ uni.setStorageSync('broadcast_recent_scans', allScans); }, - // 清空扫描记录 + // 清空扫描记录:弹出确认 clearScanResults() { - uni.showModal({ - title: '提示', - content: '确定要清空所有扫描记录吗?', - success: (res) => { - if (res.confirm) { - this.recentScans = []; - this.receivedCount = 0; - this.lastReceiveTime = null; - uni.removeStorageSync('broadcast_recent_scans'); - uni.showToast({ - title: '已清空扫描记录', - icon: 'success' - }); - } - } + this.showClearConfirm = true; + }, + + // 取消清空 + cancelClearScanResults() { + this.showClearConfirm = false; + }, + + // 确认清空 + confirmClearScanResults() { + this.recentScans = []; + this.receivedCount = 0; + this.lastReceiveTime = null; + uni.removeStorageSync('broadcast_recent_scans'); + this.showClearConfirm = false; + uni.showToast({ + title: '已清空扫描记录', + icon: 'success' }); }, @@ -475,24 +504,24 @@ \ No newline at end of file diff --git a/src/pages/settings/helpSupport.vue b/src/pages/settings/helpSupport.vue index 365fe59..3327093 100644 --- a/src/pages/settings/helpSupport.vue +++ b/src/pages/settings/helpSupport.vue @@ -5,14 +5,16 @@ - 如遇问题,可先查看帮助手册或提交问题报障。 + + 如有疑问,请联系门店管理员或系统技术支持。 @@ -30,28 +32,31 @@ iconColor: '#4cd964', pageName: 'problemGuarantee', url: '/pages/personal/problemGuarantee', - needLogin: true + comingSoon: true }, { title: '意见反馈', icon: 'email', iconColor: '#dd524d', pageName: 'feedback', - url: '/pages/personal/feedback' + url: '/pages/personal/feedback', + comingSoon: true }, { title: '帮助手册', icon: 'bookmark', iconColor: '#007aff', pageName: 'helpManual', - url: '/pages/personal/helpManual' + url: '/pages/personal/helpManual', + comingSoon: true }, { title: '操作信息', icon: 'info-circle', iconColor: '#f0ad4e', pageName: 'operationInfo', - url: '/pages/personal/operationInfo' + url: '/pages/personal/operationInfo', + comingSoon: true }, { title: '网络检测', @@ -65,9 +70,9 @@ }, methods: { handleItemClick(item) { - if (item.needLogin && !this.checkLogin()) { + if (item.comingSoon) { uni.showToast({ - title: '请先登录', + title: '该功能暂未开放', icon: 'none' }); return; @@ -76,9 +81,12 @@ this.navigateTo(item.url); }, - checkLogin() { - const token = uni.getStorageSync('token'); - return !!token; + getIconStyle(color) { + return { + color: color || '#303133', + fontSize: '22px', + lineHeight: '22px' + }; }, navigateTo(url) { @@ -109,27 +117,43 @@ .help-page { flex: 1; overflow-y: auto; - background-color: #f8f8f8; - padding-top: 20rpx; + background-color: #f7f8fa; box-sizing: border-box; .help-list { + margin: 24rpx; + padding: 10rpx 0; background-color: #fff; - margin-bottom: 20rpx; + border-radius: 20rpx; + box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.05); + overflow: hidden; ::v-deep .u-cell { padding: 10rpx 20rpx !important; } - ::v-deep .u-cell_title { - font-size: 34rpx !important; + ::v-deep .u-cell__title-text { + font-size: 36rpx !important; + } + + ::v-deep .u-cell__left-icon-wrap { + margin-right: 20rpx !important; + } + + ::v-deep .u-cell__value { + font-size: 26rpx !important; + color: #b0b7c3 !important; } } .help-tip { - padding: 0 30rpx; + display: flex; + align-items: center; + justify-content: center; + padding: 8rpx 30rpx 30rpx; .help-tip-text { + margin-left: 8rpx; font-size: 24rpx; color: #909399; } diff --git a/src/pages/settings/index.vue b/src/pages/settings/index.vue index 22922b0..33f1c1d 100644 --- a/src/pages/settings/index.vue +++ b/src/pages/settings/index.vue @@ -6,7 +6,9 @@ @@ -28,14 +30,15 @@ iconColor: '#4cd964', pageName: 'accountSecurity', url: '/pages/settings/accountSecurity', - needLogin: true + comingSoon: true }, { title: '设备查找', icon: 'search', iconColor: '#007aff', pageName: 'deviceSearch', - url: '/pages/settings/deviceSearch' + url: '/pages/settings/deviceSearch', + comingSoon: true }, { title: '扫描音效', @@ -43,7 +46,7 @@ iconColor: '#f0ad4e', pageName: 'scanSound', url: '/pages/settings/scanSound', - badge: 0 + comingSoon: true }, { title: '蓝牙秤演示', @@ -72,10 +75,10 @@ handleOperationClick(item) { console.log('点击了:', item.title); - // 检查是否需要登录 - if (item.needLogin && !this.checkLogin()) { + // 未开放的功能直接提示,不跳转 + if (item.comingSoon) { uni.showToast({ - title: '请先登录', + title: '该功能暂未开放', icon: 'none' }); return; @@ -85,18 +88,18 @@ this.navigateTo(item.pageName, item.url); }, - // 检查登录状态 - checkLogin() { - const token = uni.getStorageSync('token'); - return !!token; + getIconStyle(color) { + return { + color: color || '#303133', + fontSize: '22px', + lineHeight: '22px' + }; }, // 页面跳转 navigateTo(pageName, customUrl = null) { const routeMap = { - accountSecurity: '/pages/settings/accountSecurity', - deviceSearch: '/pages/settings/deviceSearch', - scanSound: '/pages/settings/scanSound' + bluetoothScale: '/pages/work/order/bluetoothScale' }; const url = customUrl || routeMap[pageName]; @@ -127,36 +130,28 @@ \ No newline at end of file