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