Browse Source

优化navbar

bayi 2 years ago
parent
commit
53d4779ab5
4 changed files with 5 additions and 6 deletions
  1. 3 0
      components/navigationBar/index.js
  2. 0 5
      pages/index/index.js
  3. 1 1
      pages/index/index.wxml
  4. 1 0
      pages/reading/index.js

+ 3 - 0
components/navigationBar/index.js

@@ -75,6 +75,9 @@ Component({
         grade
       }, 'put')
       this.setUser(res)
+      setTimeout(() => {
+        this.triggerEvent('reload')
+      }, 300)
     },
   }
 })

+ 0 - 5
pages/index/index.js

@@ -30,15 +30,10 @@ Page({
         selected: 1
       })
     }
-    // if (wx.getStorageSync('uid')) {
-    //     this.getLocUserInfo()
-    //     this.loadMore()
-    // } else {
     getApp().callBack = (res) => {
       this.getLocUserInfo()
       this.loadMore()
     }
-    // }
   },
   onUnload() {
     this.storeBindings.destroyStoreBindings()

+ 1 - 1
pages/index/index.wxml

@@ -1,4 +1,4 @@
-<navigationBar></navigationBar>
+<navigationBar bind:reload='resetData'></navigationBar>
 <view class="recommend">
   <!-- 头部及轮播图 -->
   <view class="header">

+ 1 - 0
pages/reading/index.js

@@ -89,6 +89,7 @@ Page({
     this.storeBindings = createStoreBindings(this, {
       store,
       fields: {
+        userInfo: 'userInfo',
         readDetail: 'readDetail'
       },
       actions: {