|
@@ -18,26 +18,7 @@ Page({
|
|
|
/**
|
|
|
* 生命周期函数--监听页面加载
|
|
|
*/
|
|
|
- onLoad: async function (options) {
|
|
|
- let userMobile = await activity.getMobileCache();
|
|
|
- console.log(userMobile)
|
|
|
- if (userMobile.length !== 0) {
|
|
|
- this.setData({
|
|
|
- isLogin: true,
|
|
|
- mobileTop: userMobile,
|
|
|
- })
|
|
|
- }
|
|
|
- // this.setData({
|
|
|
- // isLogin: getMobileCache() != '',
|
|
|
- // mobileTop: getMobileCache(),
|
|
|
- // })
|
|
|
-
|
|
|
- if(this.data.isLogin){
|
|
|
- let nums = await this.getCountNum();
|
|
|
- this.setData({
|
|
|
- countNum: nums,
|
|
|
- })
|
|
|
- }
|
|
|
+ onLoad: function (options) {
|
|
|
|
|
|
},
|
|
|
|
|
@@ -195,10 +176,26 @@ Page({
|
|
|
/**
|
|
|
* 生命周期函数--监听页面显示
|
|
|
*/
|
|
|
- onShow: function () {
|
|
|
- this.setData({
|
|
|
- grayTheme: app.globalData.grayTheme
|
|
|
- })
|
|
|
+ onShow: async function () {
|
|
|
+ this.setData({
|
|
|
+ grayTheme: app.globalData.grayTheme
|
|
|
+ })
|
|
|
+ let userMobile = await activity.getMobileCache();
|
|
|
+ console.log(userMobile)
|
|
|
+ if (userMobile.length !== 0) {
|
|
|
+ this.setData({
|
|
|
+ isLogin: true,
|
|
|
+ mobileTop: userMobile,
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+ if(this.data.isLogin){
|
|
|
+ let nums = await this.getCountNum();
|
|
|
+ this.setData({
|
|
|
+ countNum: nums,
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
},
|
|
|
|
|
|
/**
|