From 7dc29ed74ebaa8a0e66f68264d9a13f95dc3af21 Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期五, 02 八月 2024 11:09:06 +0800
Subject: [PATCH] aa

---
 wechat_staff/pages/discover/discover.js |   55 ++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 38 insertions(+), 17 deletions(-)

diff --git a/wechat_staff/pages/discover/discover.js b/wechat_staff/pages/discover/discover.js
index 9e16cde..662ba28 100644
--- a/wechat_staff/pages/discover/discover.js
+++ b/wechat_staff/pages/discover/discover.js
@@ -1,4 +1,6 @@
-// pages/discover/discover.js
+import { getCataLogTagList, getCatalogList,refreshEnjoy } from '../../api/index'
+const { HYEventBus } = require('hy-event-store')
+const eventBus = new HYEventBus()
 Page({
 
   /**
@@ -6,32 +8,51 @@
    */
   data: {
     menuButtonInfo: {},
-    activeTabs: '0'
-  },
+    catalogCode: "product_intro",
+    activeCate: '',
 
-  /**
-   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
-   */
+    height: 0,
+    top: 0,
+  },
   onLoad(options) {
     let menuButtonInfo = wx.getMenuButtonBoundingClientRect();
     this.setData({menuButtonInfo})
-    console.log('WindowInfo', menuButtonInfo);
-  },  
+  }, 
+  
+  onShow(){
+      
+    refreshEnjoy(this) 
+    this.refreshDatacount()
+    let discoverKey = wx.getStorageSync('discoverKey') || ''
+    if(discoverKey){
+      this.setData({ catalogCode: discoverKey })
+      setTimeout(() => {
+        wx.setStorageSync('discoverKey', '')
+      }, 500)
+    } 
+  },
+  refreshDatacount(){  
+    var child =null;
+    if(this.data.catalogCode == 'product_intro'){
+      child = this.selectComponent(".disProduct")
+    }else if(this.data.catalogCode == 'whole_case'){
+      child = this.selectComponent(".disCase")
+    }else if(this.data.catalogCode == 'real_case'){
+      child = this.selectComponent(".disRealpic")
+    }   
+    // 璋冪敤瀛愮粍浠朵腑瀹氫箟鐨勬柟娉� 
+    if(child){ 
+      child.refreshCount();
+    } 
+  },
   tabsClick(e) {
-    const activeTabs = e.currentTarget.dataset.tab
-    this.setData({activeTabs})
+    const catalogCode = e.currentTarget.dataset.code
+    this.setData({catalogCode})
   },
   /**
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍒濇娓叉煋瀹屾垚
    */
   onReady() {
-
-  },
-
-  /**
-   * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鏄剧ず
-   */
-  onShow() {
 
   },
 

--
Gitblit v1.9.3