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/homeId/index.js |   32 +++++++++++++++++++++++---------
 1 files changed, 23 insertions(+), 9 deletions(-)

diff --git a/wechat_staff/pages/homeId/index.js b/wechat_staff/pages/homeId/index.js
index 95ecff5..e5d99fe 100644
--- a/wechat_staff/pages/homeId/index.js
+++ b/wechat_staff/pages/homeId/index.js
@@ -23,6 +23,11 @@
     this.getTabList()
     this.getList()
   },
+  onPullDownRefresh() {
+    this.setData({ dataList: [], pageNum: 1, total: 0 })
+    wx.stopPullDownRefresh()
+    this.getList()
+  },
   onReachBottom() {
     console.log('瑙﹀簳浜嬩欢');
     const { total, dataList, pageNum } = this.data
@@ -52,23 +57,35 @@
   },
   itemClick(e) {
     const item = e.currentTarget.dataset.item
-    console.log('item', item);
-    actionDo({actionType: 'view',id: item.id})
+    const { dataList } = this.data
+    dataList.forEach(ite => {
+      if(item.id === ite.id){
+        ite.viewCount += 1
+      }
+    })
+    this.setData({ dataList })
     if(item.contentType == 'video'){
       wx.previewMedia({
         sources: [{ url: item.content, type: 'video' }]
-      })
+      }) 
+      actionDo({actionType: 'view',id: item.id})
     }
     if(item.contentType == 'link'){
       wx.navigateTo({
-        url: '/pages/webView/index?link=' + item.content,
-      })
+        url: '/pages/webView/index',
+        success: function(res) {
+          // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹� 
+          res.eventChannel.emit('data',{link:item.content} );
+        }
+      }) 
+      actionDo({actionType: 'view',id: item.id})
     }
     if(item.contentType == 'page'){
       getApp().globalData.catalogCode=item.content
       wx.switchTab({
         url: '/pages/discover/discover'
-      })
+      }) 
+      actionDo({actionType: 'view',id: item.id})
     }
   },
   cateClick(e) {
@@ -120,9 +137,6 @@
   /**
    * 椤甸潰鐩稿叧浜嬩欢澶勭悊鍑芥暟--鐩戝惉鐢ㄦ埛涓嬫媺鍔ㄤ綔
    */
-  onPullDownRefresh() {
-
-  },
 
   /**
    * 椤甸潰涓婃媺瑙﹀簳浜嬩欢鐨勫鐞嗗嚱鏁�

--
Gitblit v1.9.3