bayi 2 роки тому
батько
коміт
ebafee01a6
1 змінених файлів з 8 додано та 9 видалено
  1. 8 9
      pages/index/index.js

+ 8 - 9
pages/index/index.js

@@ -28,15 +28,7 @@ Page({
     categoryList: [],
     bannerList: []
   },
-  /**
-   * 生命周期函数--监听页面加载
-   */
-  onShow() {
-    if (typeof this.getTabBar === 'function') {
-      this.getTabBar().setData({
-        selected: 0
-      })
-    }
+  onLoad() {
     this.getLocUserInfo()
     if (Object.keys(this.data.userInfo).length > 0) {
       this.requestAgain()
@@ -61,6 +53,13 @@ Page({
       }, 6000)
     }
   },
+  onShow() {
+    if (typeof this.getTabBar === 'function') {
+      this.getTabBar().setData({
+        selected: 0
+      })
+    }
+  },
   onUnload() {
     this.storeBindings.destroyStoreBindings()
   },