修正用户名显示逻辑进入服务列表页面自动刷新
This commit is contained in:
@@ -7,8 +7,8 @@
|
||||
<uni-easyinput v-model="deviceBindForm.deviceCode" placeholder="请输入设备编号" />
|
||||
</view>
|
||||
<view class="device-bind-field">
|
||||
<text class="device-bind-label">家长电话</text>
|
||||
<uni-easyinput v-model="deviceBindForm.salesPhone" placeholder="请输入销售电话" type="number" />
|
||||
<text class="device-bind-label">电话</text>
|
||||
<uni-easyinput v-model="deviceBindForm.salesPhone" placeholder="请输入电话" type="number" />
|
||||
</view>
|
||||
<view class="device-bind-field">
|
||||
<text class="device-bind-label">所属门店</text>
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
</view>
|
||||
|
||||
<view class="logo-title">
|
||||
<text class="uer-name" v-if="hasLogin">{{userInfo.nickname||userInfo.username||userInfo.mobile}}</text>
|
||||
<text class="uer-name" v-if="hasLogin">{{headerDisplayName}}</text>
|
||||
<text class="uer-name" v-else>{{$t('mine.notLogged')}}</text>
|
||||
</view>
|
||||
</view>
|
||||
@@ -287,6 +287,13 @@
|
||||
} catch (e) {
|
||||
return {};
|
||||
}
|
||||
},
|
||||
/** 与下方「用户名」卡片一致:优先后端登录名,避免 nickname 存成手机号时盖住真实用户名 */
|
||||
headerDisplayName() {
|
||||
const backend = (this.loginUserInfo && this.loginUserInfo.userName) || ''
|
||||
if (backend) return backend
|
||||
const u = this.userInfo || {}
|
||||
return u.username || u.nickname || u.mobile || ''
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -385,8 +392,12 @@
|
||||
this[item.event]();
|
||||
} else if (item.to) {
|
||||
// 如果是 tabBar 页面,使用 switchTab
|
||||
const tabBarPages = ['/pages/furniture_reception/furniture_reception', '/pages-subpackage/furniture_customer/furniture_customer', '/pages/ai_analysis/ai_analysis', '/pages/xixi/xixi', '/pages/ucenter/ucenter']
|
||||
if (tabBarPages.includes(item.to)) {
|
||||
const tabBarPages = ['/pages-subpackage/furniture_customer/furniture_customer', '/pages/ai_analysis/ai_analysis', '/pages/xixi/xixi', '/pages/ucenter/ucenter']
|
||||
if (item.to === '/pages/furniture_reception/furniture_reception') {
|
||||
uni.navigateTo({
|
||||
url: item.to
|
||||
})
|
||||
} else if (tabBarPages.includes(item.to)) {
|
||||
uni.switchTab({
|
||||
url: item.to
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user