|
|
@@ -12,6 +12,7 @@ Page({ |
|
|
|
data: { |
|
|
|
navigationBarHeight, |
|
|
|
avatarUrl: defaultAvatarUrl, |
|
|
|
nickName: '', |
|
|
|
theme: wx.getSystemInfoSync().theme, |
|
|
|
typeLsit: {}, |
|
|
|
}, |
|
|
@@ -75,10 +76,31 @@ Page({ |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
getUserInfo(token) { |
|
|
|
let that = this; |
|
|
|
Http.get({ |
|
|
|
url: config.api.getScore, |
|
|
|
data: { |
|
|
|
token: token |
|
|
|
} |
|
|
|
}).then(res => { |
|
|
|
console.log(res, 'res'); |
|
|
|
this.setData({ |
|
|
|
avatarUrl: res.data.avatarUrl, |
|
|
|
nickName: res.data.nickName |
|
|
|
}) |
|
|
|
}).catch(err => { |
|
|
|
console.log(err, 'err'); |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
* 生命周期函数--监听页面加载 |
|
|
|
*/ |
|
|
|
onLoad(options) { |
|
|
|
if (app.globalData.token) { |
|
|
|
this.getUserInfo(app.globalData.token) |
|
|
|
} |
|
|
|
this.getType(), |
|
|
|
wx.onThemeChange((result) => { |
|
|
|
this.setData({ |
|
|
|