我的页面,完善导航

This commit is contained in:
zhonghua1
2025-12-17 11:31:04 +08:00
parent 0467861168
commit 77ce611583
3 changed files with 102 additions and 15 deletions

View File

@@ -53,13 +53,13 @@ export default {
},
mine:{
showText: "文字",
signIn: "普通签到",
signIn: "接待",
signInByAd:"看广告签到",
toEvaluate: "去评分",
readArticles: "阅读过的文章",
myScore: "我的积分",
readArticles: "客户",
myScore: "团队",
invite: "分销推荐",
feedback: "问题与反馈",
feedback: "销冠",
settings: "设置",
checkUpdate: "检查更新",
about: "关于",

View File

@@ -632,7 +632,6 @@ import { getApiUrl } from "@/common/config.js";
},
buildServiceStatusItem(record = {}) {
if (!record || typeof record !== 'object') {
console.warn('[buildServiceStatusItem] 记录数据无效:', record);
return null;
}
@@ -648,7 +647,7 @@ import { getApiUrl } from "@/common/config.js";
tags.push({ text: `项目:${record.projectName}`, color: 'blue' });
}
const item = {
return {
id: record.id || '',
staffName: record.salesName || '未分配销售',
status: record.syncStatus || '服务中',
@@ -657,9 +656,6 @@ import { getApiUrl } from "@/common/config.js";
tags,
durationText: formattedUpdateTime ? `最近更新时间:${formattedUpdateTime}` : '最近暂无更新时间'
};
console.log('[buildServiceStatusItem] 构建的列表项:', item);
return item;
},
formatDateTime(value) {
if (!value) {

View File

@@ -13,6 +13,25 @@
<text class="uer-name" v-else>{{$t('mine.notLogged')}}</text>
</view>
</view>
<!-- 租户信息和登录人信息展示区域 -->
<view class="user-info-panel" v-if="hasLogin">
<view class="info-row">
<text class="info-label">租户ID</text>
<text class="info-value">{{tenantId || '未设置'}}</text>
</view>
<view class="info-row">
<text class="info-label">用户名</text>
<text class="info-value">{{loginUserInfo.userName || '未设置'}}</text>
</view>
<view class="info-row" v-if="loginUserInfo.phone">
<text class="info-label">手机号</text>
<text class="info-value">{{loginUserInfo.phone}}</text>
</view>
<view class="info-row" v-if="loginUserInfo.email">
<text class="info-label">邮箱</text>
<text class="info-value">{{loginUserInfo.email}}</text>
</view>
</view>
<uni-grid class="grid" :column="4" :showBorder="false" :square="true">
<uni-grid-item class="item" v-for="(item,index) in gridList" @click.native="tapGrid(index)" :key="index">
<uni-icons class="icon" color="#007AFF" :type="item.icon" size="26"></uni-icons>
@@ -59,6 +78,8 @@
// #endif
data() {
return {
tenantId: '',
loginUserInfo: {},
gridList: [{
"text": this.$t('mine.showText'),
"icon": "chat"
@@ -87,7 +108,7 @@
// #endif
{
"title": this.$t('mine.signIn'),
"event": 'signIn',
"to": '/pages/reception/reception',
"icon": "compose"
},
// #ifdef APP-PLUS
@@ -99,13 +120,12 @@
//#endif
{
"title":this.$t('mine.readArticles'),
"to": '/pages/ucenter/read-news-log/read-news-log',
"to": '/pages/customer/customer',
"icon": "flag"
},
{
"title": this.$t('mine.myScore'),
"to": '',
"event": 'getScore',
"to": '/pages/team/team',
"icon": "paperplane"
}
// #ifdef APP
@@ -118,7 +138,7 @@
],
[{
"title": this.$t('mine.feedback'),
"to": '/uni_modules/uni-feedback/pages/opendb-feedback/opendb-feedback',
"to": '/pages/champion/champion',
"icon": "help"
}, {
"title": this.$t('mine.settings'),
@@ -146,6 +166,8 @@
}
},
onLoad() {
// 加载用户信息
this.loadUserInfo()
//#ifdef APP-PLUS
this.ucenterList[this.ucenterList.length - 2].unshift({
title:this.$t('mine.checkUpdate'),// this.this.$t('mine.checkUpdate')"检查更新"
@@ -156,7 +178,10 @@
})
//#endif
},
onShow() {},
onShow() {
// 每次显示页面时更新租户信息和登录人信息
this.loadUserInfo()
},
computed: {
userInfo() {
return store.userInfo
@@ -174,6 +199,26 @@
}
},
methods: {
/**
* 加载用户信息租户ID和登录人信息
*/
loadUserInfo() {
try {
// 获取租户ID
this.tenantId = uni.getStorageSync('backend-tenant-id') || ''
// 获取登录人信息
const loginResponse = uni.getStorageSync('backend-login-response') || {}
this.loginUserInfo = {
userName: loginResponse.userName || '',
phone: loginResponse.phone || '',
email: loginResponse.email || '',
userId: loginResponse.userId || ''
}
} catch (e) {
console.error('加载用户信息失败:', e)
}
},
toSettings() {
uni.navigateTo({
url: "/pages/ucenter/settings/settings"
@@ -191,6 +236,19 @@
ucenterListClick(item) {
if (!item.to && item.event) {
this[item.event]();
} else if (item.to) {
// 如果是 tabBar 页面,使用 switchTab
const tabBarPages = ['/pages/reception/reception', '/pages/customer/customer', '/pages/team/team', '/pages/champion/champion']
if (tabBarPages.includes(item.to)) {
uni.switchTab({
url: item.to
})
} else {
// 其他页面使用 navigateTouni-list-item 会自动处理,但这里显式处理以确保正确)
uni.navigateTo({
url: item.to
})
}
}
},
async checkVersion() {
@@ -407,6 +465,39 @@
height: 40rpx;
}
.user-info-panel {
background-color: #FFFFFF;
margin: 20rpx 30rpx;
padding: 30rpx;
border-radius: 12rpx;
box-shadow: 0 2rpx 8rpx rgba(0, 0, 0, 0.1);
}
.info-row {
display: flex;
flex-direction: row;
align-items: center;
margin-bottom: 20rpx;
}
.info-row:last-child {
margin-bottom: 0;
}
.info-label {
font-size: 28rpx;
color: #666666;
width: 140rpx;
flex-shrink: 0;
}
.info-value {
font-size: 28rpx;
color: #333333;
flex: 1;
word-break: break-all;
}
.grid {
background-color: #FFFFFF;
margin-bottom: 6px;