feat: 首页/我的/设置界面改版 + 仓库切换 + 帮助支持 + 沉浸式状态栏
首页与状态栏 - manifest.json 开启沉浸式状态栏(immersed:true),首页 .status_bar 与顶部渐变同色 #106eff - pages.json 首页增加 navigationBarTextStyle:"white"(状态栏前景色白色) - 首页常用功能九宫格改版:卡片高度自适应、两行菜单名不裁剪、长按排序/管理移除、拖拽预览、骨架屏、跑马灯后台暂停 我的页 - 新增仓库切换弹窗组件 StoreSelector,顶部账号卡片/门店名点击切换仓库 - 修复原“个人资料”跳转死路由(profile 不存在 → 404) - 操作列表 5 项合并为「帮助与支持」入口,修复 u-cell 图标不渲染问题 设置页 - 新增「帮助与支持」二级页 helpSupport(问题报障/意见反馈/帮助手册/操作信息/网络检测) - 精简 settings 列表(移除登录信息块与声音通知块) - 关于页改版为「检查更新」,支持 autoCheck=1 自动检查,浅蓝背景 主入口 - main.js 停用未完成的悬浮消息浮窗初始化 initializeFloatWindow()
This commit is contained in:
parent
ab03288d67
commit
64a2602317
281
src/components/StoreSelector/StoreSelector.vue
Normal file
281
src/components/StoreSelector/StoreSelector.vue
Normal file
@ -0,0 +1,281 @@
|
||||
<template>
|
||||
<!-- 统一弹窗规范:底部圆角弹层 + 居中标题 + 内置关闭按钮 + 安全区留白 -->
|
||||
<u-popup :show="show" mode="bottom" round="20" :closeable="true" :safe-area-inset-bottom="true"
|
||||
:close-on-click-overlay="!switching" @close="handleClose">
|
||||
<view class="store-selector">
|
||||
<view class="selector-header">
|
||||
<text class="selector-title">切换仓库</text>
|
||||
<text class="selector-subtitle">共 {{ list.length }} 个可用仓库</text>
|
||||
</view>
|
||||
|
||||
<view v-if="currentName" class="selector-current">
|
||||
<view class="selector-current__icon">
|
||||
<u-icon name="home-fill" color="#3a7afe" size="16"></u-icon>
|
||||
</view>
|
||||
<text class="selector-current__label">当前仓库</text>
|
||||
<text class="selector-current__name">{{ currentName }}</text>
|
||||
</view>
|
||||
|
||||
<scroll-view class="selector-body" scroll-y>
|
||||
<view v-if="!list.length" class="selector-empty">
|
||||
<u-icon name="home" color="#c8c9cc" size="56"></u-icon>
|
||||
<text class="selector-empty__text">暂无可切换的仓库</text>
|
||||
</view>
|
||||
|
||||
<view v-for="(item, index) in list" :key="item.id || index" class="store-item"
|
||||
:class="{ 'is-current': isCurrent(item), 'is-switching': isSwitching(item) }"
|
||||
@click="handleSelect(item)">
|
||||
<view class="store-item__main">
|
||||
<view class="store-item__name-row">
|
||||
<text class="store-item__name">{{ item.store_name || '未命名仓库' }}</text>
|
||||
<text v-if="isCurrent(item)" class="store-item__badge">当前</text>
|
||||
</view>
|
||||
<text v-if="getDesc(item)" class="store-item__desc">{{ getDesc(item) }}</text>
|
||||
</view>
|
||||
|
||||
<view class="store-item__right">
|
||||
<u-loading-icon v-if="isSwitching(item)" mode="circle" size="18" color="#3a7afe"></u-loading-icon>
|
||||
<u-icon v-else-if="isCurrent(item)" name="checkmark-circle-fill" color="#3a7afe"
|
||||
size="22"></u-icon>
|
||||
<u-icon v-else name="checkmark-circle" color="#c8c9cc" size="22"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
</view>
|
||||
</u-popup>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
/**
|
||||
* 仓库切换弹窗
|
||||
* - show:是否显示(配合 :show + @update:show 使用)
|
||||
* - employees:可选仓库列表(user.employees,每项对应一个仓库/角色)
|
||||
* - currentId:当前仓库对应的员工/角色 ID(user.employees_id)
|
||||
* - switchingId:正在切换中的仓库 ID,用于行内 loading
|
||||
* - select:点击某个仓库时触发,由页面负责调用切换接口
|
||||
*/
|
||||
export default {
|
||||
name: 'StoreSelector',
|
||||
props: {
|
||||
show: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
employees: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
currentId: {
|
||||
type: [String, Number],
|
||||
default: ''
|
||||
},
|
||||
switchingId: {
|
||||
type: [String, Number],
|
||||
default: ''
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
list() {
|
||||
return Array.isArray(this.employees) ? this.employees : [];
|
||||
},
|
||||
currentName() {
|
||||
const current = this.list.find(item => this.isCurrent(item));
|
||||
return current ? current.store_name || '' : '';
|
||||
},
|
||||
switching() {
|
||||
return this.switchingId !== '' && this.switchingId !== null && typeof this.switchingId !== 'undefined';
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
isCurrent(item) {
|
||||
if (!item) return false;
|
||||
return String(item.id) === String(this.currentId);
|
||||
},
|
||||
isSwitching(item) {
|
||||
if (!item || !this.switching) return false;
|
||||
return String(item.id) === String(this.switchingId);
|
||||
},
|
||||
getDesc(item) {
|
||||
return item.store_remask || item.store_code || '';
|
||||
},
|
||||
handleSelect(item) {
|
||||
if (!item || this.switching) return;
|
||||
if (this.isCurrent(item)) {
|
||||
this.handleClose();
|
||||
return;
|
||||
}
|
||||
this.$emit('select', item);
|
||||
},
|
||||
handleClose() {
|
||||
if (this.switching) return;
|
||||
this.$emit('update:show', false);
|
||||
this.$emit('close');
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.store-selector {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
max-height: 70vh;
|
||||
background-color: #fff;
|
||||
/* 顶部圆角与 u-popup 的 round=20(20px)保持一致,并裁切内部白底/分隔线 */
|
||||
border-radius: 20px 20px 0 0;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
// 与首页「通知信息」等弹窗保持一致:居中标题 + 底部细分隔线
|
||||
.selector-header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 32rpx 30rpx 24rpx;
|
||||
border-bottom: 1rpx solid #f0f0f0;
|
||||
}
|
||||
|
||||
.selector-title {
|
||||
font-size: 38rpx;
|
||||
font-weight: 600;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.selector-subtitle {
|
||||
margin-top: 8rpx;
|
||||
font-size: 24rpx;
|
||||
color: #909399;
|
||||
}
|
||||
|
||||
// 当前仓库摘要
|
||||
.selector-current {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 24rpx 30rpx 0;
|
||||
padding: 20rpx 24rpx;
|
||||
border-radius: 16rpx;
|
||||
background-color: #f6f8fb;
|
||||
|
||||
&__icon {
|
||||
width: 36rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-right: 12rpx;
|
||||
}
|
||||
|
||||
&__label {
|
||||
font-size: 24rpx;
|
||||
color: #909399;
|
||||
margin-right: 12rpx;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
&__name {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
font-size: 28rpx;
|
||||
font-weight: 500;
|
||||
color: #303133;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
}
|
||||
|
||||
.selector-body {
|
||||
flex: 1;
|
||||
max-height: 46vh;
|
||||
box-sizing: border-box;
|
||||
padding: 8rpx 30rpx 30rpx;
|
||||
}
|
||||
|
||||
.selector-empty {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 80rpx 0;
|
||||
|
||||
&__text {
|
||||
margin-top: 20rpx;
|
||||
font-size: 26rpx;
|
||||
color: #909399;
|
||||
}
|
||||
}
|
||||
|
||||
.store-item {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 26rpx 24rpx;
|
||||
margin-top: 16rpx;
|
||||
border-radius: 16rpx;
|
||||
background-color: #f6f8fb;
|
||||
border: 2rpx solid transparent;
|
||||
transition: background-color 0.2s, border-color 0.2s;
|
||||
|
||||
&.is-current {
|
||||
background-color: rgba(58, 122, 254, 0.08);
|
||||
border-color: rgba(58, 122, 254, 0.35);
|
||||
}
|
||||
|
||||
&.is-switching {
|
||||
opacity: 0.75;
|
||||
}
|
||||
|
||||
&:active {
|
||||
background-color: #eef1f6;
|
||||
}
|
||||
|
||||
&__main {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
&__name-row {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
|
||||
&__name {
|
||||
font-size: 30rpx;
|
||||
color: #303133;
|
||||
font-weight: 500;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
&__badge {
|
||||
margin-left: 12rpx;
|
||||
padding: 0 10rpx;
|
||||
height: 32rpx;
|
||||
line-height: 32rpx;
|
||||
border-radius: 8rpx;
|
||||
font-size: 20rpx;
|
||||
color: #3a7afe;
|
||||
background-color: rgba(58, 122, 254, 0.14);
|
||||
flex-shrink: 0;
|
||||
}
|
||||
|
||||
&__desc {
|
||||
margin-top: 6rpx;
|
||||
font-size: 24rpx;
|
||||
color: #909399;
|
||||
overflow: hidden;
|
||||
white-space: nowrap;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
|
||||
&__right {
|
||||
margin-left: 16rpx;
|
||||
width: 44rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: flex-end;
|
||||
flex-shrink: 0;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -44,7 +44,9 @@ async function initializeApp() {
|
||||
|
||||
await store.dispatch("bluetoothPrint/initializeBluetooth");
|
||||
// 3. 初始化安卓消息窗口模块(APP环境)
|
||||
await initializeFloatWindow();
|
||||
// 已停用:浮窗功能未完成(落地页 /pages/message/index 为空,也无消息/角标数据来源),
|
||||
// 需要恢复时取消下面一行注释即可(路由守卫里的 is_visible 在未初始化时会安全返回 false)
|
||||
// await initializeFloatWindow();
|
||||
|
||||
// 4. 挂载路由和App
|
||||
RouterMount(app, router, "#app");
|
||||
|
||||
@ -6,6 +6,11 @@
|
||||
"versionCode" : 1000137,
|
||||
"transformPx" : false,
|
||||
"app-plus" : {
|
||||
"statusbar" : {
|
||||
"immersed" : true,
|
||||
"style" : "dark",
|
||||
"background" : "#FFFFFF"
|
||||
},
|
||||
"optimization" : {
|
||||
"subPackages" : true
|
||||
},
|
||||
|
||||
@ -19,6 +19,7 @@
|
||||
"path": "pages/index/index",
|
||||
"style": {
|
||||
"titleNView": false,
|
||||
"navigationBarTextStyle": "white",
|
||||
"backgroundColor": "#f2f8ff"
|
||||
}
|
||||
},
|
||||
@ -76,6 +77,13 @@
|
||||
"titleNView": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/settings/helpSupport",
|
||||
"style" :
|
||||
{
|
||||
"titleNView": false
|
||||
}
|
||||
},
|
||||
{
|
||||
"path" : "pages/work/storage/receiving/receiving",
|
||||
"meta": {
|
||||
|
||||
@ -16,7 +16,7 @@
|
||||
<view class="news-wrapper" @click="openNoticePopup">
|
||||
<view class="news-pill">
|
||||
<view class="news-pill__icon">
|
||||
<u-icon name="bell-fill" size="14" color="#FFFFFF"></u-icon>
|
||||
<u-icon name="bell-fill" size="14" color="#FF8C42"></u-icon>
|
||||
</view>
|
||||
<view class="news-pill__body">
|
||||
<view class="news-marquee">
|
||||
@ -26,7 +26,7 @@
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
<u-icon class="news-pill__arrow" name="arrow-right" size="12" color="rgba(255,255,255,0.75)"></u-icon>
|
||||
<u-icon class="news-pill__arrow" name="arrow-right" size="12" color="#FFA94D"></u-icon>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@ -53,7 +53,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 3行4列的快捷入口网格 -->
|
||||
<!-- 3行3列的快捷入口网格(每页 9 个) -->
|
||||
<view class="quick-grid-container">
|
||||
<!-- 上一页按钮 -->
|
||||
<view class="nav-arrow left-arrow" @click="prevPage" :class="{ disabled: currentPage === 1 }">
|
||||
@ -257,7 +257,8 @@
|
||||
unclaimedWaveCount: 0,
|
||||
showNoticePopup: false,
|
||||
quickActions: [],
|
||||
pageSize: 12,
|
||||
// 每页 9 个:3 列 × 3 行
|
||||
pageSize: 9,
|
||||
pageVisible: true,
|
||||
undoAction: null,
|
||||
FIXED_MENU_KEY: 'fixed_home_menus',
|
||||
@ -424,6 +425,8 @@
|
||||
|
||||
onShow() {
|
||||
this.pageVisible = true;
|
||||
// 首页顶部为深色渐变,状态栏文字/图标需改为白色(真机 App 端)
|
||||
this.setAppStatusBarStyle('light');
|
||||
if (this._skipNextShow) {
|
||||
this._skipNextShow = false;
|
||||
return;
|
||||
@ -435,6 +438,8 @@
|
||||
onHide() {
|
||||
// 离开页面时暂停跑马灯动画,避免后台持续占用渲染
|
||||
this.pageVisible = false;
|
||||
// 其他页面状态栏底色为白色,离开首页时恢复深色文字/图标
|
||||
this.setAppStatusBarStyle('dark');
|
||||
},
|
||||
|
||||
onUnload() {
|
||||
@ -443,6 +448,25 @@
|
||||
},
|
||||
|
||||
methods: {
|
||||
// 设置真机状态栏文字/图标颜色与底色(light=白色文字/蓝色底,dark=深色文字/白色底);非 App 端自动忽略
|
||||
setAppStatusBarStyle(style) {
|
||||
// #ifdef APP-PLUS
|
||||
try {
|
||||
if (typeof plus !== 'undefined' && plus.navigator) {
|
||||
if (plus.navigator.setStatusBarStyle) {
|
||||
plus.navigator.setStatusBarStyle(style);
|
||||
}
|
||||
// 首页顶部为深色渐变,状态栏底色需与页面顶部一致,让页面背景“包含”系统状态栏
|
||||
if (plus.navigator.setStatusBarBackground) {
|
||||
plus.navigator.setStatusBarBackground(style === 'light' ? '#106eff' : '#ffffff');
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.warn('[index] 设置状态栏样式失败:', e);
|
||||
}
|
||||
// #endif
|
||||
},
|
||||
|
||||
async getLatestUserInfo() {
|
||||
try {
|
||||
const latestUser = await this.$store.dispatch('getUserInfo');
|
||||
@ -761,8 +785,8 @@
|
||||
return [];
|
||||
}
|
||||
|
||||
// 用户权限菜单超过12个时,按固定优先级取前12个
|
||||
if (source.length > 12) {
|
||||
// 用户权限菜单超过一页时,按固定优先级取前 pageSize 个(默认 3×3 = 9 个)
|
||||
if (source.length > this.pageSize) {
|
||||
const defaultMenuNames = [
|
||||
'收货作业',
|
||||
'商品查询',
|
||||
@ -798,10 +822,10 @@
|
||||
return key && !selectedKeys.has(key);
|
||||
});
|
||||
|
||||
return [...prioritized, ...remaining].slice(0, 12);
|
||||
return [...prioritized, ...remaining].slice(0, this.pageSize);
|
||||
}
|
||||
|
||||
// 低于12个时,商品查询置顶,其余全部显示
|
||||
// 不足一页时,商品查询置顶,其余全部显示
|
||||
const selectedKeys = new Set();
|
||||
const prioritized = [];
|
||||
|
||||
@ -1581,6 +1605,9 @@
|
||||
src: url('~@/static/fonts/uicon-iconfont.ttf') format('truetype');
|
||||
}
|
||||
|
||||
// 首页各面板之间统一垂直间隔(数据面板 → 走马灯 → 常用功能 两段一致)
|
||||
$home-panel-gap: 24rpx;
|
||||
|
||||
.pda-home {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -1600,14 +1627,20 @@
|
||||
);
|
||||
}
|
||||
|
||||
// 状态栏区域使用与首页顶部渐变起点一致的纯色,保证页面背景“包含”系统状态栏(覆盖 App.vue 中全局的白色 .status_bar)
|
||||
.pda-home > .status_bar {
|
||||
flex-shrink: 0;
|
||||
background: #106eff;
|
||||
}
|
||||
|
||||
// 紧凑型头部(透明,叠在页面顶部渐变上)
|
||||
.compact-header {
|
||||
position: relative;
|
||||
padding: 16rpx 24rpx 20rpx;
|
||||
padding: 16rpx 24rpx 0;
|
||||
|
||||
// 数据条与跑马灯之间的间距(数据条被 v-if 隐藏时自动失效)
|
||||
.stat-strip + .org-switcher {
|
||||
margin-top: 16rpx;
|
||||
margin-top: $home-panel-gap;
|
||||
}
|
||||
|
||||
.org-switcher {
|
||||
@ -1622,12 +1655,12 @@
|
||||
.news-pill {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
height: 56rpx;
|
||||
height: 72rpx;
|
||||
padding: 0 18rpx;
|
||||
background: rgba(255, 255, 255, 0.16);
|
||||
border: 1rpx solid rgba(255, 255, 255, 0.22);
|
||||
border-radius: 28rpx;
|
||||
box-shadow: inset 0 1rpx 0 rgba(255, 255, 255, 0.25), 0 4rpx 12rpx rgba(6, 45, 120, 0.10);
|
||||
background: #ffffff;
|
||||
border: 1rpx solid transparent;
|
||||
border-radius: 36rpx;
|
||||
box-shadow: 0 4rpx 12rpx rgba(6, 45, 120, 0.10);
|
||||
box-sizing: border-box;
|
||||
overflow: hidden;
|
||||
|
||||
@ -1650,7 +1683,7 @@
|
||||
|
||||
.news-marquee {
|
||||
width: 100%;
|
||||
height: 56rpx;
|
||||
height: 72rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
overflow: hidden;
|
||||
@ -1672,7 +1705,7 @@
|
||||
white-space: nowrap;
|
||||
padding-right: 60rpx;
|
||||
font-size: 26rpx;
|
||||
color: #ffffff;
|
||||
color: #ff8c42;
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1688,37 +1721,40 @@
|
||||
.stat-item {
|
||||
flex: 1;
|
||||
min-width: 0;
|
||||
height: 140rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
padding: 14rpx 8rpx;
|
||||
background: rgba(255, 255, 255, 0.14);
|
||||
border: 1rpx solid rgba(255, 255, 255, 0.22);
|
||||
padding: 20rpx 8rpx;
|
||||
background: rgba(255, 255, 255, 0.18);
|
||||
backdrop-filter: blur(12rpx);
|
||||
-webkit-backdrop-filter: blur(12rpx);
|
||||
border: 1rpx solid rgba(255, 255, 255, 0.2);
|
||||
border-radius: 14rpx;
|
||||
box-shadow: inset 0 1rpx 0 rgba(255, 255, 255, 0.25), 0 6rpx 16rpx rgba(6, 45, 120, 0.12);
|
||||
|
||||
& + .stat-item {
|
||||
margin-left: 12rpx;
|
||||
}
|
||||
|
||||
&:active {
|
||||
background: rgba(255, 255, 255, 0.26);
|
||||
background: rgba(255, 255, 255, 0.3);
|
||||
}
|
||||
|
||||
&__value {
|
||||
font-size: 36rpx;
|
||||
font-weight: 600;
|
||||
font-weight: bold;
|
||||
color: #ffffff;
|
||||
line-height: 1.1;
|
||||
font-variant-numeric: tabular-nums;
|
||||
}
|
||||
|
||||
&__label {
|
||||
margin-top: 8rpx;
|
||||
margin-top: 14rpx;
|
||||
max-width: 100%;
|
||||
font-size: 22rpx;
|
||||
color: rgba(255, 255, 255, 0.78);
|
||||
color: rgba(255, 255, 255, 0.88);
|
||||
line-height: 1.2;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
@ -1757,11 +1793,11 @@
|
||||
-webkit-overflow-scrolling: touch;
|
||||
}
|
||||
|
||||
// 快捷入口区域
|
||||
// 快捷入口区域(按内容高度显示,不再强制撑到 tabBar)
|
||||
.quick-section {
|
||||
padding: 20rpx 20rpx 12rpx;
|
||||
background: #ffffff;
|
||||
margin: 16rpx 20rpx 20rpx;
|
||||
margin: $home-panel-gap 20rpx 20rpx;
|
||||
border-radius: 20rpx;
|
||||
box-shadow: 0 6rpx 24rpx rgba(15, 23, 42, 0.05);
|
||||
|
||||
@ -1769,7 +1805,7 @@
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
margin-bottom: 14rpx;
|
||||
margin-bottom: 30rpx;
|
||||
padding-bottom: 12rpx;
|
||||
border-bottom: 1rpx solid #f2f4f7;
|
||||
|
||||
@ -1885,12 +1921,15 @@
|
||||
.grid-page {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
grid-template-rows: repeat(4, auto);
|
||||
// 3 列 × 3 行,每页 9 个
|
||||
grid-template-rows: repeat(3, auto);
|
||||
gap: 10rpx;
|
||||
padding: 0 10rpx;
|
||||
|
||||
.grid-item {
|
||||
min-height: 170rpx;
|
||||
// 预留两行名称的高度(图标 92 + 间距 8 + 两行名称 90),
|
||||
// 保证 1 行 / 2 行名称时卡片高度一致,避免换行后卡片长高把底部挤出可视区
|
||||
min-height: 190rpx;
|
||||
box-sizing: border-box;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -1945,22 +1984,22 @@
|
||||
}
|
||||
|
||||
.item-icon-box {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 20rpx;
|
||||
width: 92rpx;
|
||||
height: 92rpx;
|
||||
border-radius: 18rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 12rpx;
|
||||
margin-bottom: 8rpx;
|
||||
|
||||
.item-icon-image {
|
||||
width: 52rpx;
|
||||
height: 52rpx;
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
}
|
||||
|
||||
.item-icon-font {
|
||||
font-family: 'uicon-iconfont' !important;
|
||||
font-size: 58rpx;
|
||||
font-size: 54rpx;
|
||||
line-height: 1;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
@ -1988,7 +2027,9 @@
|
||||
|
||||
.item-name {
|
||||
max-width: 100%;
|
||||
font-size: 34rpx;
|
||||
// 名称区固定按两行占位(32rpx × 1.4 × 2 ≈ 90rpx),避免换行后撑高整格
|
||||
min-height: 90rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
@ -2031,7 +2072,7 @@
|
||||
position: fixed;
|
||||
z-index: 999;
|
||||
width: 140rpx;
|
||||
height: 172rpx;
|
||||
height: 164rpx;
|
||||
border-radius: 12rpx;
|
||||
background: rgba(255, 255, 255, 0.96);
|
||||
box-shadow: 0 12rpx 32rpx rgba(0, 0, 0, 0.16);
|
||||
@ -2056,22 +2097,22 @@
|
||||
}
|
||||
|
||||
.item-icon-box {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 20rpx;
|
||||
width: 92rpx;
|
||||
height: 92rpx;
|
||||
border-radius: 18rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
margin-bottom: 12rpx;
|
||||
margin-bottom: 8rpx;
|
||||
|
||||
.item-icon-image {
|
||||
width: 52rpx;
|
||||
height: 52rpx;
|
||||
width: 48rpx;
|
||||
height: 48rpx;
|
||||
}
|
||||
|
||||
.item-icon-font {
|
||||
font-family: 'uicon-iconfont' !important;
|
||||
font-size: 58rpx;
|
||||
font-size: 54rpx;
|
||||
line-height: 1;
|
||||
font-style: normal;
|
||||
font-weight: normal;
|
||||
@ -2081,7 +2122,7 @@
|
||||
|
||||
.item-name {
|
||||
max-width: 100%;
|
||||
font-size: 34rpx;
|
||||
font-size: 32rpx;
|
||||
font-weight: bold;
|
||||
color: #333;
|
||||
text-align: center;
|
||||
@ -2122,12 +2163,13 @@
|
||||
width: 100%;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
grid-template-rows: repeat(4, auto);
|
||||
grid-template-rows: repeat(3, auto);
|
||||
gap: 10rpx;
|
||||
padding: 0 10rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.skeleton-item {
|
||||
// 与真实格子(两行名称预留后 190rpx)保持一致,避免加载完成时卡片高度跳变
|
||||
min-height: 190rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@ -2136,10 +2178,10 @@
|
||||
}
|
||||
|
||||
.skeleton-icon {
|
||||
width: 100rpx;
|
||||
height: 100rpx;
|
||||
border-radius: 20rpx;
|
||||
margin-bottom: 12rpx;
|
||||
width: 92rpx;
|
||||
height: 92rpx;
|
||||
border-radius: 18rpx;
|
||||
margin-bottom: 8rpx;
|
||||
background: #eef1f5;
|
||||
animation: skeleton-pulse 1.2s ease-in-out infinite;
|
||||
}
|
||||
|
||||
@ -1,31 +1,40 @@
|
||||
<template>
|
||||
<view class="about-page">
|
||||
<page-nav title="关于"></page-nav>
|
||||
<view class="about-content">
|
||||
<view class="about-logo">
|
||||
<u-icon name="info-circle" size="80" color="#2979ff"></u-icon>
|
||||
</view>
|
||||
<text class="about-name">WMS PDA</text>
|
||||
<text class="about-version">版本 {{ appVersion }}</text>
|
||||
<page-nav title="检查更新"></page-nav>
|
||||
|
||||
<view class="about-list">
|
||||
<scroll-view class="about-content" scroll-y>
|
||||
<!-- 顶部:保持原来的居中样式 -->
|
||||
<view class="about-header">
|
||||
<view class="about-logo">
|
||||
<u-icon name="info-circle" size="80" color="#2979ff"></u-icon>
|
||||
</view>
|
||||
<text class="about-name">WMS PDA</text>
|
||||
<text class="about-version">版本 {{ appVersion || '--' }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 基本信息 -->
|
||||
<view class="about-card">
|
||||
<u-cell-group :border="false">
|
||||
<u-cell title="项目名称" value="天豹云仓WMS_PDA"></u-cell>
|
||||
<u-cell title="技术框架" value="uni-app + uView UI"></u-cell>
|
||||
<u-cell title="运行平台" value="Android / iOS"></u-cell>
|
||||
<u-cell title="运行平台" value="Android / iOS" :border="false"></u-cell>
|
||||
</u-cell-group>
|
||||
</view>
|
||||
|
||||
<!-- 操作区 -->
|
||||
<view class="about-actions">
|
||||
<u-button type="primary" plain size="small" @click="handleCheckUpdate" :loading="updateChecking">
|
||||
<u-button type="primary" :loading="updateChecking" loading-text="检查中..."
|
||||
:custom-style="{ width: '100%', height: '88rpx', fontSize: '32rpx', borderRadius: '16rpx' }"
|
||||
@click="handleCheckUpdate">
|
||||
检查更新
|
||||
</u-button>
|
||||
<text class="about-hint">已是最新版本时不会弹出版本更新窗口</text>
|
||||
</view>
|
||||
|
||||
<view class="about-footer">
|
||||
<text class="about-copyright">© 2026 天豹云仓</text>
|
||||
</view>
|
||||
</view>
|
||||
</scroll-view>
|
||||
|
||||
<!-- 版本更新弹窗(与登录页同一套内联逻辑,真机验证可弹窗) -->
|
||||
<view v-if="showUpdateDialog" class="update-mask">
|
||||
@ -137,8 +146,12 @@ export default {
|
||||
checkResultDetail: ''
|
||||
};
|
||||
},
|
||||
onLoad() {
|
||||
onLoad(options = {}) {
|
||||
this.getAppVersion();
|
||||
// 从用户页「检查更新」入口进入时(autoCheck=1),自动触发一次更新检查
|
||||
if (options && options.autoCheck === '1') {
|
||||
this.handleCheckUpdate();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
getAppVersion() {
|
||||
@ -545,18 +558,38 @@ export default {
|
||||
<style lang="scss" scoped>
|
||||
.about-page {
|
||||
height: 100vh;
|
||||
background: #f8f9fa;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
/* 与「我的」页面保持一致的浅蓝背景 */
|
||||
background: #f2f8ff;
|
||||
|
||||
/* 导航栏(标题 + 状态栏)同步浅蓝底,避免出现白色条 */
|
||||
::v-deep .nav-title {
|
||||
background: #f2f8ff;
|
||||
}
|
||||
|
||||
::v-deep .status_bar {
|
||||
background-color: #f2f8ff !important;
|
||||
}
|
||||
}
|
||||
|
||||
.about-content {
|
||||
flex: 1;
|
||||
box-sizing: border-box;
|
||||
padding: 8rpx 24rpx 40rpx;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
/* 顶部:居中图标 + 应用名 + 版本号(保持原样式) */
|
||||
.about-header {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
padding: 40rpx 0;
|
||||
padding: 0 0 8rpx;
|
||||
}
|
||||
|
||||
.about-logo {
|
||||
margin-bottom: 24rpx;
|
||||
margin-bottom: 16rpx;
|
||||
}
|
||||
|
||||
.about-name {
|
||||
@ -569,23 +602,43 @@ export default {
|
||||
.about-version {
|
||||
font-size: 26rpx;
|
||||
color: #909399;
|
||||
margin-bottom: 32rpx;
|
||||
}
|
||||
|
||||
.about-list {
|
||||
width: 100%;
|
||||
padding: 0 24rpx;
|
||||
box-sizing: border-box;
|
||||
/* 基本信息卡片 */
|
||||
.about-card {
|
||||
margin-top: 24rpx;
|
||||
background-color: #fff;
|
||||
border-radius: 20rpx;
|
||||
overflow: hidden;
|
||||
|
||||
::v-deep .u-cell {
|
||||
padding: 10rpx 20rpx !important;
|
||||
}
|
||||
|
||||
::v-deep .u-cell_title {
|
||||
font-size: 30rpx !important;
|
||||
}
|
||||
}
|
||||
|
||||
/* 操作区 */
|
||||
.about-actions {
|
||||
padding: 48rpx 24rpx 0;
|
||||
margin-top: 48rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
width: 100%;
|
||||
box-sizing: border-box;
|
||||
}
|
||||
|
||||
.about-hint {
|
||||
margin-top: 20rpx;
|
||||
font-size: 22rpx;
|
||||
color: #a8b3c4;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.about-footer {
|
||||
margin-top: 60rpx;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.about-copyright {
|
||||
|
||||
138
src/pages/settings/helpSupport.vue
Normal file
138
src/pages/settings/helpSupport.vue
Normal file
@ -0,0 +1,138 @@
|
||||
<template>
|
||||
<view class="normar_container">
|
||||
<page-nav title="帮助与支持"></page-nav>
|
||||
<view class="help-page">
|
||||
<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"
|
||||
:border="index !== helpList.length - 1" @click="handleItemClick(item)">
|
||||
</u-cell>
|
||||
</u-cell-group>
|
||||
</view>
|
||||
|
||||
<view class="help-tip">
|
||||
<text class="help-tip-text">如遇问题,可先查看帮助手册或提交问题报障。</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 帮助与支持列表
|
||||
helpList: [
|
||||
{
|
||||
title: '问题报障',
|
||||
icon: 'order',
|
||||
iconColor: '#4cd964',
|
||||
pageName: 'problemGuarantee',
|
||||
url: '/pages/personal/problemGuarantee',
|
||||
needLogin: true
|
||||
},
|
||||
{
|
||||
title: '意见反馈',
|
||||
icon: 'email',
|
||||
iconColor: '#dd524d',
|
||||
pageName: 'feedback',
|
||||
url: '/pages/personal/feedback'
|
||||
},
|
||||
{
|
||||
title: '帮助手册',
|
||||
icon: 'bookmark',
|
||||
iconColor: '#007aff',
|
||||
pageName: 'helpManual',
|
||||
url: '/pages/personal/helpManual'
|
||||
},
|
||||
{
|
||||
title: '操作信息',
|
||||
icon: 'info-circle',
|
||||
iconColor: '#f0ad4e',
|
||||
pageName: 'operationInfo',
|
||||
url: '/pages/personal/operationInfo'
|
||||
},
|
||||
{
|
||||
title: '网络检测',
|
||||
icon: 'wifi',
|
||||
iconColor: '#10aeff',
|
||||
pageName: 'networkTest',
|
||||
url: '/pages/settings/networkTest'
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
handleItemClick(item) {
|
||||
if (item.needLogin && !this.checkLogin()) {
|
||||
uni.showToast({
|
||||
title: '请先登录',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
this.navigateTo(item.url);
|
||||
},
|
||||
|
||||
checkLogin() {
|
||||
const token = uni.getStorageSync('token');
|
||||
return !!token;
|
||||
},
|
||||
|
||||
navigateTo(url) {
|
||||
if (!url) {
|
||||
uni.showToast({
|
||||
title: '页面不存在',
|
||||
icon: 'error'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
uni.navigateTo({
|
||||
url: url,
|
||||
fail: (err) => {
|
||||
console.error('跳转失败:', err);
|
||||
uni.showToast({
|
||||
title: '该功能暂未开放',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.help-page {
|
||||
flex: 1;
|
||||
overflow-y: auto;
|
||||
background-color: #f8f8f8;
|
||||
padding-top: 20rpx;
|
||||
box-sizing: border-box;
|
||||
|
||||
.help-list {
|
||||
background-color: #fff;
|
||||
margin-bottom: 20rpx;
|
||||
|
||||
::v-deep .u-cell {
|
||||
padding: 10rpx 20rpx !important;
|
||||
}
|
||||
|
||||
::v-deep .u-cell_title {
|
||||
font-size: 34rpx !important;
|
||||
}
|
||||
}
|
||||
|
||||
.help-tip {
|
||||
padding: 0 30rpx;
|
||||
|
||||
.help-tip-text {
|
||||
font-size: 24rpx;
|
||||
color: #909399;
|
||||
}
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -2,33 +2,12 @@
|
||||
<view class="normar_container">
|
||||
<page-nav title="设置"></page-nav>
|
||||
<view class="settings-page">
|
||||
<!-- 当前登录信息 -->
|
||||
<view class="login-info">
|
||||
<text class="login-title">当前登录工号:</text>
|
||||
<text class="login-user">{{ userInfo.employees_name || '未登录' }}</text>
|
||||
</view>
|
||||
|
||||
<!-- 设置列表 -->
|
||||
<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" @click="handleOperationClick(item)">
|
||||
</u-cell>
|
||||
</u-cell-group>
|
||||
</view>
|
||||
|
||||
<!-- 声音与通知 -->
|
||||
<view class="settings-list settings-list--notification">
|
||||
<view class="settings-section-title">声音与通知</view>
|
||||
<u-cell-group :border="false">
|
||||
<u-cell title="语音播报" icon="volume" icon-color="#ff9900">
|
||||
<template #value>
|
||||
<u-switch
|
||||
v-model="voiceBroadcastEnabled"
|
||||
:active-color="'#4cd964'"
|
||||
@change="handleVoiceBroadcastToggle"
|
||||
></u-switch>
|
||||
</template>
|
||||
:icon-color="item.iconColor" :isLink="true" :border="index !== operationList.length - 1"
|
||||
@click="handleOperationClick(item)">
|
||||
</u-cell>
|
||||
</u-cell-group>
|
||||
</view>
|
||||
@ -42,9 +21,6 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
// 用户信息
|
||||
userInfo: {},
|
||||
|
||||
// 设置列表数据
|
||||
operationList: [{
|
||||
title: '账号与安全',
|
||||
@ -54,13 +30,6 @@
|
||||
url: '/pages/settings/accountSecurity',
|
||||
needLogin: true
|
||||
},
|
||||
{
|
||||
title: '广播设置',
|
||||
icon: 'scan',
|
||||
iconColor: '#dd524d',
|
||||
pageName: 'broadcastSettings',
|
||||
url: '/pages/settings/broadcastSettings'
|
||||
},
|
||||
{
|
||||
title: '设备查找',
|
||||
icon: 'search',
|
||||
@ -82,70 +51,24 @@
|
||||
iconColor: '#2979ff',
|
||||
pageName: 'bluetoothScale',
|
||||
url: '/pages/work/order/bluetoothScale'
|
||||
},
|
||||
{
|
||||
title: '关于',
|
||||
icon: 'info-circle',
|
||||
iconColor: '#808080',
|
||||
pageName: 'about',
|
||||
url: '/pages/settings/about'
|
||||
}
|
||||
],
|
||||
|
||||
// 登出相关
|
||||
voiceBroadcastEnabled: true
|
||||
]
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
// 页面显示时加载用户信息
|
||||
this.loadUserInfo();
|
||||
this.loadVoiceSettings();
|
||||
},
|
||||
methods: {
|
||||
// 加载用户信息
|
||||
// 校验登录状态
|
||||
loadUserInfo() {
|
||||
const token = uni.getStorageSync('token');
|
||||
const userData = this.$store.getters.user || {};
|
||||
if (token && Object.keys(userData).length > 0) {
|
||||
this.userInfo = userData;
|
||||
} else {
|
||||
this.userInfo = {};
|
||||
if (!token) {
|
||||
// 如果未登录,跳转到登录页
|
||||
goLogin();
|
||||
}
|
||||
},
|
||||
|
||||
async loadVoiceSettings() {
|
||||
try {
|
||||
const enabled = await this.$store.dispatch('setting/getValue', 'voice.enabled');
|
||||
this.voiceBroadcastEnabled = enabled !== 'false';
|
||||
} catch (error) {
|
||||
console.warn('加载语音播报设置失败:', error);
|
||||
this.voiceBroadcastEnabled = true;
|
||||
}
|
||||
},
|
||||
async handleVoiceBroadcastToggle(value) {
|
||||
const enabled = value !== false;
|
||||
this.voiceBroadcastEnabled = enabled;
|
||||
try {
|
||||
await this.$store.dispatch('setting/setValue', {
|
||||
key: 'voice.enabled',
|
||||
value: enabled ? 'true' : 'false'
|
||||
});
|
||||
uni.showToast({
|
||||
title: enabled ? '已开启语音播报' : '已关闭语音播报',
|
||||
icon: 'none'
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('保存语音播报设置失败:', error);
|
||||
this.voiceBroadcastEnabled = !enabled;
|
||||
uni.showToast({
|
||||
title: '保存失败,请重试',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
// 处理设置项点击
|
||||
handleOperationClick(item) {
|
||||
console.log('点击了:', item.title);
|
||||
|
||||
@ -172,10 +95,8 @@
|
||||
navigateTo(pageName, customUrl = null) {
|
||||
const routeMap = {
|
||||
accountSecurity: '/pages/settings/accountSecurity',
|
||||
broadcastSettings: '/pages/settings/broadcastSettings',
|
||||
deviceSearch: '/pages/settings/deviceSearch',
|
||||
scanSound: '/pages/settings/scanSound',
|
||||
about: '/pages/settings/about'
|
||||
scanSound: '/pages/settings/scanSound'
|
||||
};
|
||||
|
||||
const url = customUrl || routeMap[pageName];
|
||||
@ -225,29 +146,6 @@
|
||||
}
|
||||
}
|
||||
|
||||
// 登录信息
|
||||
.login-info {
|
||||
background-color: #fff;
|
||||
padding: 30rpx;
|
||||
margin-bottom: 20rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
border-bottom: 1px solid #f0f0f0;
|
||||
|
||||
.login-title {
|
||||
font-size: 32rpx;
|
||||
color: #333;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.login-user {
|
||||
font-size: 34rpx;
|
||||
color: #4cd964;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
||||
|
||||
// 设置列表
|
||||
.settings-list {
|
||||
background-color: #fff;
|
||||
@ -261,15 +159,5 @@
|
||||
font-size: 34rpx !important;
|
||||
}
|
||||
}
|
||||
|
||||
.settings-list--notification {
|
||||
padding-top: 6rpx;
|
||||
}
|
||||
|
||||
.settings-section-title {
|
||||
font-size: 26rpx;
|
||||
color: #909399;
|
||||
padding: 10rpx 24rpx 6rpx;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@ -2,14 +2,14 @@
|
||||
<view class="personal-center">
|
||||
<view class="status_bar">
|
||||
</view>
|
||||
<!-- 账号信息卡片 -->
|
||||
<view class="account-card" @click="navigateTo('profile')">
|
||||
<u-avatar :src="userInfo.avatar" size="60" mode="aspectFill"></u-avatar>
|
||||
<!-- 账号信息卡片:点击切换仓库(原 profile 页不存在,会命中通配符路由进 404) -->
|
||||
<view class="account-card" @click="openStoreSelector">
|
||||
<u-avatar :src="userInfo.avatar" size="52" mode="aspectFill"></u-avatar>
|
||||
<view class="user-info">
|
||||
<text class="user-name">{{ userInfo.employees_name }}</text>
|
||||
<text class="user-id" @click.stop="showStoreSelector">
|
||||
<text class="user-id" @click.stop="openStoreSelector">
|
||||
{{ userInfo.store_name }}
|
||||
<u-icon style="display:inline-block; margin-left: 10rpx;" name="arrow-right" color="#FFF" size="12" v-if="userInfo.employees.length > 1"></u-icon>
|
||||
<u-icon style="display:inline-block; margin-left: 10rpx;" name="arrow-right" color="#FFF" size="12" v-if="userInfo.employees && userInfo.employees.length > 1"></u-icon>
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
@ -22,8 +22,8 @@
|
||||
v-for="(item, index) in operationList"
|
||||
:key="index"
|
||||
:title="item.title"
|
||||
:icon="item.icon"
|
||||
:icon-color="item.iconColor"
|
||||
:icon="item.icon"
|
||||
:icon-style="getIconStyle(item.iconColor)"
|
||||
:is-link="true"
|
||||
:border="index !== operationList.length - 1"
|
||||
@click="handleOperationClick(item)"
|
||||
@ -32,6 +32,21 @@
|
||||
</u-cell-group>
|
||||
</view>
|
||||
|
||||
<!-- 声音与通知 -->
|
||||
<view class="content-card voice-card">
|
||||
<u-cell-group :border="false">
|
||||
<u-cell title="语音播报" icon="volume" :icon-style="getIconStyle('#12b886')" :border="false">
|
||||
<template #value>
|
||||
<u-switch
|
||||
v-model="voiceBroadcastEnabled"
|
||||
active-color="#4cd964"
|
||||
@change="handleVoiceBroadcastToggle"
|
||||
></u-switch>
|
||||
</template>
|
||||
</u-cell>
|
||||
</u-cell-group>
|
||||
</view>
|
||||
|
||||
<!-- 退出登录 -->
|
||||
<view class="logout-section">
|
||||
<u-button
|
||||
@ -55,13 +70,23 @@
|
||||
<text class="modal-desc">退出后将需要重新登录</text>
|
||||
</view>
|
||||
</u-modal>
|
||||
|
||||
<!-- 仓库切换弹窗 -->
|
||||
<store-selector :show="storeSelectorVisible" :employees="userInfo.employees"
|
||||
:current-id="userInfo.employees_id" :switching-id="storeSwitchingId"
|
||||
@update:show="storeSelectorVisible = $event" @select="handleStoreSwitch" />
|
||||
</view>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { goLogin, isLoginRoute, getCurrentRoute } from '@/core/utils/auth-guard'
|
||||
import StoreSelector from '@/components/StoreSelector/StoreSelector.vue'
|
||||
|
||||
export default {
|
||||
// 项目未配置 easycom 规则,组件需显式注册(否则 <store-selector> 会报 Unknown custom element)
|
||||
components: {
|
||||
StoreSelector
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 用户信息
|
||||
@ -70,54 +95,46 @@
|
||||
// 操作列表数据
|
||||
operationList: [
|
||||
{
|
||||
title: '问题报障',
|
||||
icon: 'order',
|
||||
iconColor: '#4cd964',
|
||||
pageName: 'problemGuarantee',
|
||||
url: '/pages/personal/problemGuarantee',
|
||||
needLogin: true
|
||||
title: '帮助与支持',
|
||||
icon: 'question-circle',
|
||||
iconColor: '#3a7afe',
|
||||
pageName: 'helpSupport',
|
||||
url: '/pages/settings/helpSupport'
|
||||
},
|
||||
{
|
||||
title: '意见反馈',
|
||||
icon: 'email',
|
||||
iconColor: '#dd524d',
|
||||
pageName: 'feedback',
|
||||
url: '/pages/personal/feedback'
|
||||
},
|
||||
{
|
||||
title: '帮助手册',
|
||||
icon: 'bookmark',
|
||||
iconColor: '#007aff',
|
||||
pageName: 'helpManual',
|
||||
url: '/pages/personal/helpManual'
|
||||
},
|
||||
{
|
||||
title: '操作信息',
|
||||
icon: 'info-circle',
|
||||
iconColor: '#f0ad4e',
|
||||
pageName: 'operationInfo',
|
||||
url: '/pages/personal/operationInfo',
|
||||
badge: 3
|
||||
},
|
||||
{
|
||||
title: '网络检测',
|
||||
icon: 'wifi',
|
||||
iconColor: '#10aeff',
|
||||
pageName: 'networkTest',
|
||||
url: '/pages/settings/networkTest'
|
||||
title: '广播设置',
|
||||
icon: 'scan',
|
||||
iconColor: '#7a5af8',
|
||||
pageName: 'broadcastSettings',
|
||||
url: '/pages/settings/broadcastSettings'
|
||||
},
|
||||
{
|
||||
title: '设置',
|
||||
icon: 'setting',
|
||||
iconColor: '#808080',
|
||||
iconColor: '#5b6b7f',
|
||||
pageName: 'settings',
|
||||
url: '/pages/settings/index'
|
||||
},
|
||||
{
|
||||
title: '检查更新',
|
||||
icon: 'download',
|
||||
iconColor: '#ff8f1f',
|
||||
pageName: 'about',
|
||||
// autoCheck=1:进入页面后自动触发一次更新检查
|
||||
url: '/pages/settings/about?autoCheck=1'
|
||||
}
|
||||
],
|
||||
|
||||
// 当前选中的组织
|
||||
currentOrg: null,
|
||||
|
||||
// 仓库切换弹窗
|
||||
storeSelectorVisible: false,
|
||||
storeSwitchingId: '',
|
||||
|
||||
// 语音播报
|
||||
voiceBroadcastEnabled: true,
|
||||
|
||||
// 退出登录
|
||||
showLogoutModal: false,
|
||||
logoutLoading: false,
|
||||
@ -139,8 +156,52 @@
|
||||
onShow() {
|
||||
// 页面显示时更新数据
|
||||
this.loadUserInfo();
|
||||
this.loadVoiceSettings();
|
||||
},
|
||||
methods: {
|
||||
// 左侧图标样式:u-cell 内部把 iconStyle 透传给 u-icon,颜色/字号在这里统一控制
|
||||
getIconStyle(color) {
|
||||
return {
|
||||
color: color || '#303133',
|
||||
fontSize: '22px',
|
||||
lineHeight: '22px'
|
||||
};
|
||||
},
|
||||
|
||||
// 加载语音播报设置
|
||||
async loadVoiceSettings() {
|
||||
try {
|
||||
const enabled = await this.$store.dispatch('setting/getValue', 'voice.enabled');
|
||||
this.voiceBroadcastEnabled = enabled !== 'false';
|
||||
} catch (error) {
|
||||
console.warn('加载语音播报设置失败:', error);
|
||||
this.voiceBroadcastEnabled = true;
|
||||
}
|
||||
},
|
||||
|
||||
// 切换语音播报
|
||||
async handleVoiceBroadcastToggle(value) {
|
||||
const enabled = value !== false;
|
||||
this.voiceBroadcastEnabled = enabled;
|
||||
try {
|
||||
await this.$store.dispatch('setting/setValue', {
|
||||
key: 'voice.enabled',
|
||||
value: enabled ? 'true' : 'false'
|
||||
});
|
||||
uni.showToast({
|
||||
title: enabled ? '已开启语音播报' : '已关闭语音播报',
|
||||
icon: 'none'
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('保存语音播报设置失败:', error);
|
||||
this.voiceBroadcastEnabled = !enabled;
|
||||
uni.showToast({
|
||||
title: '保存失败,请重试',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
// 加载用户信息
|
||||
async loadUserInfo() {
|
||||
if(!this.$store.getters.user){
|
||||
@ -159,56 +220,49 @@
|
||||
}
|
||||
},
|
||||
|
||||
// 显示店铺选择器 - 使用 ActionSheet
|
||||
showStoreSelector() {
|
||||
// 从 userInfo.employees 生成选项列表
|
||||
// 打开仓库选择弹窗
|
||||
openStoreSelector() {
|
||||
if (!this.userInfo.employees || this.userInfo.employees.length <= 1) {
|
||||
uni.showToast({
|
||||
title: '当前账号仅一个仓库',
|
||||
icon: 'none'
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
// 提取店铺名称列表
|
||||
const storeList = this.userInfo.employees.map(emp => emp.store_name);
|
||||
|
||||
uni.showActionSheet({
|
||||
itemList: storeList,
|
||||
success: (res) => {
|
||||
const selectedIndex = res.tapIndex;
|
||||
if (selectedIndex >= 0 && selectedIndex < this.userInfo.employees.length) {
|
||||
const selectedEmployee = this.userInfo.employees[selectedIndex];
|
||||
this.handleStoreSwitch(selectedEmployee);
|
||||
}
|
||||
},
|
||||
fail: (err) => {
|
||||
console.log('用户取消选择', err);
|
||||
}
|
||||
});
|
||||
this.storeSelectorVisible = true;
|
||||
},
|
||||
|
||||
// 处理店铺切换
|
||||
// 处理仓库切换(弹窗内选中后触发)
|
||||
async handleStoreSwitch(selectedEmployee) {
|
||||
if (!selectedEmployee || this.storeSwitchingId !== '') {
|
||||
return;
|
||||
}
|
||||
|
||||
// 已选中当前仓库:无需请求接口
|
||||
if (String(selectedEmployee.id) === String(this.userInfo.employees_id)) {
|
||||
this.storeSelectorVisible = false;
|
||||
return;
|
||||
}
|
||||
|
||||
this.storeSwitchingId = selectedEmployee.id;
|
||||
try {
|
||||
// 显示加载中
|
||||
uni.showLoading({
|
||||
title: '切换中...',
|
||||
mask: true
|
||||
});
|
||||
|
||||
// 调用 store 的 action 切换员工
|
||||
const result = await this.$store.dispatch('changeEmployee', selectedEmployee.id);
|
||||
// 调用 store 的 action 切换员工(内部会刷新 token 与用户信息)
|
||||
await this.$store.dispatch('changeEmployee', selectedEmployee.id);
|
||||
this.loadUserInfo();
|
||||
|
||||
this.storeSelectorVisible = false;
|
||||
uni.showToast({
|
||||
title: `已切换至${selectedEmployee.store_name || '新仓库'}`,
|
||||
icon: 'none'
|
||||
});
|
||||
} catch (error) {
|
||||
console.error('切换失败:', error);
|
||||
|
||||
// 隐藏加载提示
|
||||
uni.hideLoading();
|
||||
|
||||
// 显示错误提示
|
||||
uni.showToast({
|
||||
title: '切换失败,请重试',
|
||||
icon: 'error',
|
||||
icon: 'none',
|
||||
duration: 2000
|
||||
});
|
||||
} finally {
|
||||
this.storeSwitchingId = '';
|
||||
}
|
||||
},
|
||||
|
||||
@ -332,13 +386,10 @@
|
||||
|
||||
navigateTo(pageName, customUrl = null) {
|
||||
const routeMap = {
|
||||
profile: '/pages/personal/profile',
|
||||
problemGuarantee: '/pages/personal/problemGuarantee',
|
||||
feedback: '/pages/personal/feedback',
|
||||
helpManual: '/pages/personal/helpManual',
|
||||
operationInfo: '/pages/personal/operationInfo',
|
||||
networkTest: '/pages/personal/networkTest',
|
||||
settings: '/pages/personal/settings'
|
||||
helpSupport: '/pages/settings/helpSupport',
|
||||
broadcastSettings: '/pages/settings/broadcastSettings',
|
||||
about: '/pages/settings/about',
|
||||
settings: '/pages/settings/index'
|
||||
};
|
||||
|
||||
const url = customUrl || routeMap[pageName];
|
||||
@ -386,10 +437,9 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
margin: 20rpx 24rpx 0;
|
||||
padding: 40rpx 30rpx;
|
||||
padding: 32rpx 26rpx;
|
||||
background: linear-gradient(135deg, #2979ff 0%, #1fa2ff 100%);
|
||||
border-radius: 20rpx;
|
||||
box-shadow: 0 10rpx 24rpx rgba(41, 121, 255, 0.25);
|
||||
color: #fff;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
@ -420,7 +470,7 @@
|
||||
|
||||
.user-info {
|
||||
flex: 1;
|
||||
margin-left: 30rpx;
|
||||
margin-left: 28rpx;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
min-width: 0;
|
||||
@ -430,13 +480,13 @@
|
||||
.user-name {
|
||||
font-size: 36rpx;
|
||||
font-weight: bold;
|
||||
margin-bottom: 10rpx;
|
||||
margin-bottom: 8rpx;
|
||||
}
|
||||
|
||||
.user-id {
|
||||
font-size: 30rpx;
|
||||
font-size: 28rpx;
|
||||
opacity: 0.9;
|
||||
margin-top: 8rpx;
|
||||
margin-top: 6rpx;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
@ -463,6 +513,16 @@
|
||||
::v-deep .u-cell_title {
|
||||
font-size: 32rpx !important;
|
||||
}
|
||||
|
||||
// 图标与标题的间距:恢复原先带图标容器时的观感
|
||||
::v-deep .u-cell__left-icon-wrap {
|
||||
margin-right: 20rpx !important;
|
||||
}
|
||||
}
|
||||
|
||||
// 声音与通知卡片(紧跟在操作列表下方)
|
||||
.voice-card {
|
||||
margin-top: 0;
|
||||
}
|
||||
|
||||
// 退出登录按钮区域,固定贴在底部导航上方
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user