This commit is contained in:
lik
2026-09-03 11:46:06 +08:00
parent b4c8bf0add
commit 16ba1f654a
2 changed files with 30 additions and 24 deletions
+10 -8
View File
@@ -19,7 +19,7 @@ Page({
],
online: true,
profile: {
name: '王姐陪诊师',
name: '',
level: '初级陪诊师',
avatar: ''
},
@@ -76,14 +76,16 @@ Page({
loadUser() {
const app = getApp()
const user = app.globalData && app.globalData.user
if (user) {
this.setData({
'profile.name': user.nickname || this.data.profile.name,
'profile.level': user.level || this.data.profile.level,
'profile.avatar': user.avatar || ''
app.ensureLogin()
.then(user => {
if (!user) return
const p = user.profile || {}
this.setData({
'profile.name': p.name || '微信用户',
'profile.avatar': p.avatar || ''
})
})
}
.catch(() => {})
},
toggleOnline() {