From d8c1bb93c2b7dbbed8ab726577ea6bf57f47eab2 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 01 八月 2024 14:28:16 +0800
Subject: [PATCH] aa

---
 wechat_jiaxuan/pages/index/index.js |   19 ++++++-------------
 1 files changed, 6 insertions(+), 13 deletions(-)

diff --git a/wechat_jiaxuan/pages/index/index.js b/wechat_jiaxuan/pages/index/index.js
index 3c1ace0..6031fc8 100644
--- a/wechat_jiaxuan/pages/index/index.js
+++ b/wechat_jiaxuan/pages/index/index.js
@@ -8,10 +8,7 @@
   getZhongTaiVideoPage,
   getZhongTaiProductNewsPage
 } from '../../api/index'
-const {
-  HYEventBus
-} = require('hy-event-store')
-const eventBus = new HYEventBus()
+import { eventBus } from '../../utils/eventBus'
 const app = getApp()
 Page({
 
@@ -56,26 +53,22 @@
   },
   onShow() {
     let that = this
-    const member = wx.getStorageSync('member') || {}
-    if (member && member.id) {
+    setTimeout(() => {
       getMemberInfo().then(res => {
         this.setData({
           member: res.data
         })
       })
-    } else {
-      this.setData({
-        member
-      })
-    }
-    eventBus.on("reloadHome", () => {
+    }, 500)
+    eventBus.once("reloadHome", () => {
       console.log('reloadHome');
       this.onLoad()
+      this.initData()
     })
   },
   onLoad(options) {
-    const member = wx.getStorageSync('member')
     this.initDictData()
+    this.initData()
   },
   changePath(e) {
     let index = e.currentTarget.dataset.type

--
Gitblit v1.9.3