You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
938 B

3 years ago
// index.js
Page({
data: {
3 years ago
imageUrl: getApp().globalData.imageUrl,
3 years ago
bgImage: "background-image: url(" + getApp().globalData.imageUrl + "/img_mybg.png)",
statusBarHeight: 0,
nickName: "",
avatarUrl: "",
btnShow: false
3 years ago
},
3 years ago
onLoad: function () {
3 years ago
wx.getSystemInfo({
3 years ago
success: (res) => {
let statusBarHeight = res.statusBarHeight
this.setData({
statusBarHeight: statusBarHeight
})
}
3 years ago
})
3 years ago
},
onShow() {
this.getTabBar().init();
3 years ago
this.getUser();
3 years ago
},
3 years ago
getUser() {
if(wx.getStorageSync("userInfo")) {
let userInfo = wx.getStorageSync("userInfo");
this.setData({
nickName: userInfo.nickName,
avatarUrl: userInfo.avatarUrl,
btnShow: true
})
}
}
});