tmp
This commit is contained in:
+10
-8
@@ -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() {
|
||||
|
||||
Reference in New Issue
Block a user