feat(UI): 退出/退出登录/清空记录弹窗统一改造 + 设置与广播页视觉优化

- 新增全局退出应用确认弹窗:新增 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 的冗余调度调用
This commit is contained in:
zm2000 2026-11-06 18:00:23 +08:00
parent 64a2602317
commit a5cedd525f
13 changed files with 564 additions and 209 deletions

View File

@ -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;

View File

@ -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:

View File

@ -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
}
})

View File

@ -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

View File

@ -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)
})
})

View File

@ -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,

View File

@ -7,8 +7,7 @@
</view>
<text class="header-title">全部功能</text>
<view class="edit-common-btn" :class="{ active: isEditMode }" @click="onEditCommon">
<u-icon :name="isEditMode ? 'checkmark-circle-fill' : 'edit-pen'" size="14" :color="isEditMode ? '#19be6b' : '#2979ff'"></u-icon>
<text class="edit-common-text">{{ isEditMode ? '完成' : '编辑常用' }}</text>
<text class="edit-common-text">{{ isEditMode ? '完成' : '编辑' }}</text>
</view>
</view>
@ -50,7 +49,7 @@
<scroll-view class="page-scroll" scroll-y>
<view v-if="isLoading" class="empty-state loading-state">
<u-loading mode="circle" color="#2979ff" size="26"></u-loading>
<u-loading-icon mode="circle" color="#2979ff" size="26"></u-loading-icon>
<text class="empty-text">正在加载功能列表...</text>
</view>
@ -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;

View File

@ -184,6 +184,21 @@
</scroll-view>
</view>
</u-popup>
<!-- 退出应用确认弹窗 -->
<view v-if="$store.state.app.exitConfirmVisible" class="exit-app-mask" @click="cancelExitApp">
<view class="exit-app-dialog" @click.stop>
<view class="exit-app-icon">
<u-icon name="info-circle" size="60" color="#f0ad4e"></u-icon>
</view>
<text class="exit-app-title">退出应用</text>
<text class="exit-app-desc">您确定要退出应用吗?</text>
<view class="exit-app-actions">
<u-button plain text="取消" @click="cancelExitApp"></u-button>
<u-button type="error" text="退出" @click="confirmExitApp"></u-button>
</view>
</view>
</view>
</view>
</template>
@ -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;
}
</style>

View File

@ -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;
}

View File

@ -15,32 +15,41 @@
<!-- 设置表单(合并显示和编辑) -->
<view class="settings-form" v-show="broadcastEnabled">
<view class="panel-header">
<text class="panel-title">参数设置</text>
<text class="panel-sub">配置广播名与数据键名,保存后自动开始监听</text>
</view>
<!-- 广播名设置 -->
<view class="setting-item">
<view class="item-label">
<view class="label-dot"></view>
<text class="label-text">广播名 (Action)</text>
</view>
<view class="item-content">
<u-input v-model="newAction" placeholder="输入广播名,如:android.intent.action.SCANRESULT" border="bottom"
<view class="input-box">
<u-input v-model="newAction" placeholder="输入广播名,如:android.intent.action.SCANRESULT" border="none"
:clearable="true" :disabled="canChanges" class="value-input"></u-input>
</view>
<text class="current-value" v-if="broadcast.action && broadcast.action === newAction">
{{ broadcast.action }}
</text>
<view class="current-value" v-if="broadcast.action && broadcast.action === newAction">
<text class="current-value-tag">当前生效</text>
<text class="current-value-text">{{ broadcast.action }}</text>
</view>
</view>
<!-- 数据键名设置 -->
<view class="setting-item">
<view class="item-label">
<view class="label-dot"></view>
<text class="label-text">数据键名 (Key)</text>
</view>
<view class="item-content">
<u-input v-model="newKey" placeholder="输入数据键名,如:value" border="bottom" :clearable="true"
<view class="input-box">
<u-input v-model="newKey" placeholder="输入数据键名,如:value" border="none" :clearable="true"
:disabled="canChanges" class="value-input"></u-input>
</view>
<text class="current-value" v-if="broadcast.key && broadcast.key === newKey">
{{ broadcast.key }}
</text>
<view class="current-value" v-if="broadcast.key && broadcast.key === newKey">
<text class="current-value-tag">当前生效</text>
<text class="current-value-text">{{ broadcast.key }}</text>
</view>
</view>
</view>
@ -73,8 +82,10 @@
<!-- 读取扫描结果 -->
<view class="scan-result-section" v-show="broadcastEnabled">
<view class="section-header">
<text class="section-title">读取扫描结果</text>
<u-button size="mini" type="error" plain shape="circle" @click="clearScanResults"
<view class="section-title">
<text class="section-title-text">读取扫描结果</text>
</view>
<u-button type="error" plain shape="circle" @click="clearScanResults"
:disabled="recentScans.length === 0">
清空记录
</u-button>
@ -109,6 +120,18 @@
</view>
</scroll-view>
</view>
<!-- 清空记录确认弹窗 -->
<view v-if="showClearConfirm" class="clear-confirm-mask" @click="cancelClearScanResults">
<view class="clear-confirm-dialog" @click.stop>
<text class="clear-confirm-title">清空扫描记录</text>
<text class="clear-confirm-desc">确定要清空所有扫描记录吗?清空后不可恢复。</text>
<view class="clear-confirm-actions">
<u-button plain text="取消" @click="cancelClearScanResults"></u-button>
<u-button type="error" text="确定清空" @click="confirmClearScanResults"></u-button>
</view>
</view>
</view>
</view>
</template>
@ -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 @@
<style lang="scss" scoped>
/* 样式保持不变,与之前的相同 */
.box{
width: 100%;
padding: 12px;
height: 40px;
background-color: #f8f8f8;
flex: 1;
overflow: hidden;
background-color: #f7f8fa;
box-sizing: border-box;
}
.broadcast-settings {
height:100%;
padding: 24rpx 0;
box-sizing: border-box;
.broadcast-switch {
background: #fff;
border-radius: 16rpx;
border-radius: 20rpx;
padding: 30rpx;
margin-bottom: 30rpx;
margin: 0 24rpx 24rpx;
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.05);
.switch-left {
display: flex;
@ -506,7 +535,7 @@
}
.switch-desc {
font-size: 26rpx;
font-size: 30rpx;
color: #666;
}
}
@ -514,13 +543,33 @@
.settings-form {
background: #fff;
border-radius: 16rpx;
padding: 40rpx 30rpx;
margin-bottom: 30rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
border-radius: 20rpx;
padding: 30rpx;
margin: 0 24rpx 24rpx;
box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.05);
.panel-header {
display: flex;
flex-direction: column;
padding-bottom: 24rpx;
margin-bottom: 30rpx;
border-bottom: 1rpx solid #f0f0f0;
.panel-title {
font-size: 34rpx;
font-weight: 600;
color: #303133;
}
.panel-sub {
margin-top: 8rpx;
font-size: 30rpx;
color: #909399;
}
}
.setting-item {
margin-bottom: 50rpx;
margin-bottom: 40rpx;
&:last-child {
margin-bottom: 0;
@ -529,39 +578,73 @@
.item-label {
display: flex;
align-items: center;
margin-bottom: 25rpx;
margin-bottom: 20rpx;
.label-dot {
width: 10rpx;
height: 28rpx;
border-radius: 5rpx;
background: #2979ff;
margin-right: 16rpx;
}
.label-text {
font-size: 32rpx;
font-size: 30rpx;
font-weight: 500;
color: #333;
color: #303133;
}
}
.item-content {
.input-box {
display: flex;
align-items: center;
height: 88rpx;
padding: 0 24rpx;
background: #f5f7fa;
border-radius: 16rpx;
border: 1rpx solid #eef1f5;
box-sizing: border-box;
.value-input {
font-size: 30rpx;
width: 100%;
}
::v-deep .u-input__content__field-wrapper__field {
height: 88rpx;
line-height: 88rpx;
font-size: 30rpx !important;
}
}
.current-value {
display: block;
font-size: 26rpx;
color: #4cd964;
margin-top: 10rpx;
font-family: monospace;
background: #f5f5f5;
padding: 10rpx 20rpx;
border-radius: 8rpx;
word-break: break-all;
display: flex;
align-items: center;
margin-top: 16rpx;
.current-value-tag {
flex-shrink: 0;
font-size: 22rpx;
color: #19be6b;
background: rgba(25, 190, 107, 0.12);
border-radius: 8rpx;
padding: 4rpx 14rpx;
margin-right: 16rpx;
}
.current-value-text {
font-size: 30rpx;
color: #606266;
font-family: monospace;
word-break: break-all;
}
}
}
}
.action-buttons {
margin-bottom: 40rpx;
margin: 0 24rpx 24rpx;
::v-deep .u-btn {
::v-deep .u-button {
height: 90rpx;
font-size: 32rpx;
}
@ -569,10 +652,10 @@
.broadcast-status {
background: #fff;
border-radius: 16rpx;
border-radius: 20rpx;
padding: 30rpx;
margin-bottom: 30rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
margin: 0 24rpx 24rpx;
box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.05);
.status-item {
display: flex;
@ -584,12 +667,12 @@
}
.status-label {
font-size: 28rpx;
font-size: 30rpx;
color: #666;
}
.status-value {
font-size: 28rpx;
font-size: 30rpx;
color: #333;
font-weight: 500;
@ -602,21 +685,34 @@
.scan-result-section {
background: #fff;
border-radius: 16rpx;
border-radius: 20rpx;
padding: 30rpx;
margin-bottom: 30rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
margin: 0 24rpx 24rpx;
box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.05);
.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 30rpx;
.section-title {
font-size: 36rpx;
font-weight: 500;
color: #333;
flex: 1;
min-width: 0;
.section-title-text {
font-size: 36rpx;
font-weight: 500;
color: #333;
white-space: nowrap;
}
}
::v-deep .u-button {
flex: 1;
min-width: 0;
height: 80rpx;
margin-left: 24rpx;
font-size: 30rpx;
}
}
@ -639,7 +735,7 @@
}
.scan-content {
font-size: 28rpx;
font-size: 32rpx;
color: #333;
font-family: monospace;
flex: 1;
@ -647,7 +743,7 @@
}
.scan-time {
font-size: 24rpx;
font-size: 30rpx;
color: #999;
margin-left: 20rpx;
}
@ -661,14 +757,14 @@
.empty-text {
display: block;
font-size: 28rpx;
font-size: 30rpx;
color: #999;
margin-bottom: 15rpx;
}
.empty-hint {
display: block;
font-size: 24rpx;
font-size: 30rpx;
color: #ccc;
}
}
@ -677,9 +773,10 @@
.help-section {
background: #fff;
border-radius: 16rpx;
border-radius: 20rpx;
padding: 30rpx;
box-shadow: 0 4rpx 20rpx rgba(0, 0, 0, 0.05);
margin: 0 24rpx 24rpx;
box-shadow: 0 6rpx 16rpx rgba(0, 0, 0, 0.05);
.help-title {
display: block;
@ -692,10 +789,9 @@
.help-content {
display: flex;
flex-direction: column;
gap: 15rpx;
.help-item {
font-size: 26rpx;
font-size: 30rpx;
color: #666;
line-height: 1.5;
@ -703,8 +799,74 @@
content: "• ";
color: #4cd964;
}
+ .help-item {
margin-top: 15rpx;
}
}
}
}
}
/* 清空记录确认弹窗 */
.clear-confirm-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;
}
.clear-confirm-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);
}
.clear-confirm-title {
display: block;
text-align: center;
font-size: 36rpx;
font-weight: 600;
color: #303133;
}
.clear-confirm-desc {
display: block;
text-align: center;
margin-top: 24rpx;
font-size: 32rpx;
line-height: 1.6;
color: #606266;
}
.clear-confirm-actions {
display: flex;
margin-top: 40rpx;
}
.clear-confirm-actions ::v-deep .u-button {
flex: 1;
height: 80rpx;
}
.clear-confirm-actions ::v-deep .u-button__text,
.clear-confirm-actions ::v-deep .u-button__loading-text {
font-size: 36rpx !important;
}
.clear-confirm-actions ::v-deep .u-button + .u-button {
margin-left: 20rpx;
}
</style>

View File

@ -5,14 +5,16 @@
<view class="help-list">
<u-cell-group :border="false">
<u-cell v-for="(item, index) in helpList" :key="item.pageName" :title="item.title"
:icon="item.icon" :icon-color="item.iconColor" :isLink="true"
:icon="item.icon" :icon-style="getIconStyle(item.iconColor)"
:value="item.comingSoon ? '暂未开放' : ''" :isLink="true"
:border="index !== helpList.length - 1" @click="handleItemClick(item)">
</u-cell>
</u-cell-group>
</view>
<view class="help-tip">
<text class="help-tip-text">如遇问题,可先查看帮助手册或提交问题报障。</text>
<u-icon name="info-circle" color="#8a94a6" size="14"></u-icon>
<text class="help-tip-text">如有疑问,请联系门店管理员或系统技术支持。</text>
</view>
</view>
</view>
@ -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;
}

View File

@ -6,7 +6,9 @@
<view class="settings-list">
<u-cell-group :border="false">
<u-cell v-for="(item, index) in operationList" :key="index" :title="item.title" :icon="item.icon"
:icon-color="item.iconColor" :isLink="true" :border="index !== operationList.length - 1"
:icon-style="getIconStyle(item.iconColor)"
:value="item.comingSoon ? '暂未开放' : ''" :isLink="true"
:border="index !== operationList.length - 1"
@click="handleOperationClick(item)">
</u-cell>
</u-cell-group>
@ -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 @@
<style lang="scss" scoped>
.settings-page {
background-color: #f8f8f8;
background-color: #f7f8fa;
height: calc(100% - 44px - env(safe-area-inset-top));
// 页面标题
.page-header {
height: 120rpx;
background: linear-gradient(135deg, #4cd964, #5ac8fa);
display: flex;
align-items: center;
justify-content: center;
.page-title {
font-size: 40rpx;
font-weight: bold;
color: #fff;
text-align: center;
}
}
// 设置列表
.settings-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;
}
}
}

View File

@ -62,14 +62,20 @@
</view>
<!-- 退出登录确认弹窗 -->
<u-modal :show="showLogoutModal" :show-cancel-button="true" confirm-text="确定退出" cancel-text="取消"
@confirm="logout" @cancel="showLogoutModal = false">
<view class="modal-content">
<u-icon name="info-circle" size="60" color="#f0ad4e"></u-icon>
<text class="modal-title">确认退出登录?</text>
<text class="modal-desc">退出后将需要重新登录</text>
<view v-if="showLogoutModal" class="logout-confirm-mask" @click="cancelLogout">
<view class="logout-confirm-dialog" @click.stop>
<view class="logout-confirm-icon">
<u-icon name="info-circle" size="60" color="#f0ad4e"></u-icon>
</view>
<text class="logout-confirm-title">确认退出登录?</text>
<text class="logout-confirm-desc">退出后将需要重新登录</text>
<view class="logout-confirm-actions">
<u-button plain text="取消" @click="cancelLogout"></u-button>
<u-button type="error" :loading="logoutLoading" loading-text="退出中..." text="确定退出"
@click="logout"></u-button>
</view>
</view>
</u-modal>
</view>
<!-- 仓库切换弹窗 -->
<store-selector :show="storeSelectorVisible" :employees="userInfo.employees"
@ -356,6 +362,11 @@
showLogoutConfirm() {
this.showLogoutModal = true;
},
// 取消退出登录
cancelLogout() {
this.showLogoutModal = false;
},
// 退出登录
async logout() {
@ -484,7 +495,7 @@
}
.user-id {
font-size: 28rpx;
font-size: 32rpx;
opacity: 0.9;
margin-top: 6rpx;
display: flex;
@ -510,8 +521,8 @@
padding: 10rpx 20rpx !important;
}
::v-deep .u-cell_title {
font-size: 32rpx !important;
::v-deep .u-cell__title-text {
font-size: 36rpx !important;
}
// 图标与标题的间距:恢复原先带图标容器时的观感
@ -553,27 +564,77 @@
}
}
// 模态框内容
.modal-content {
padding: 40rpx 0;
// 退出登录确认弹窗
.logout-confirm-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;
}
.logout-confirm-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;
}
.logout-confirm-icon {
display: flex;
align-items: center;
justify-content: center;
.modal-title {
font-size: 36rpx;
font-weight: bold;
color: #333;
margin-top: 30rpx;
margin-bottom: 20rpx;
}
.modal-desc {
font-size: 28rpx;
color: #666;
text-align: center;
}
}
.logout-confirm-title {
display: block;
text-align: center;
margin-top: 30rpx;
font-size: 36rpx;
font-weight: 600;
color: #303133;
}
.logout-confirm-desc {
display: block;
text-align: center;
margin-top: 16rpx;
font-size: 34rpx;
line-height: 1.6;
color: #606266;
}
.logout-confirm-actions {
display: flex;
width: 100%;
margin-top: 40rpx;
}
.logout-confirm-actions ::v-deep .u-button {
flex: 1;
height: 80rpx;
}
.logout-confirm-actions ::v-deep .u-button__text,
.logout-confirm-actions ::v-deep .u-button__loading-text {
font-size: 36rpx !important;
}
.logout-confirm-actions ::v-deep .u-button + .u-button {
margin-left: 20rpx;
}
}
</style>