Browse Source

我的登录初始化页面调整

kk.shi 3 years ago
parent
commit
b0ac8e5356
1 changed files with 17 additions and 21 deletions
  1. 17 21
      pages/welfareMall/personal/personal.js

+ 17 - 21
pages/welfareMall/personal/personal.js

@@ -16,26 +16,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) {
 
 
   },
   },
 
 
@@ -193,7 +174,22 @@ Page({
   /**
   /**
    * 生命周期函数--监听页面显示
    * 生命周期函数--监听页面显示
    */
    */
-  onShow: function () {
+  onShow: async function () {
+    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,
+      })
+    }
 
 
   },
   },