From e3a8d46ed7f215a7ad1d61d7e6d3a853e3922361 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期二, 30 七月 2024 19:13:47 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/zbomyoujia

---
 wechat_staff/components/disProduct/index.js |   24 +++++++++++++++++++++++-
 1 files changed, 23 insertions(+), 1 deletions(-)

diff --git a/wechat_staff/components/disProduct/index.js b/wechat_staff/components/disProduct/index.js
index d92ef71..3da72a6 100644
--- a/wechat_staff/components/disProduct/index.js
+++ b/wechat_staff/components/disProduct/index.js
@@ -22,7 +22,7 @@
     sortType: 'NORMAL',
     catalogCode: ""
   },
-  attached() {
+   attached() {
     this.getCatelist()
     var app = getApp()
     console.log('globalData', app.globalData);
@@ -35,6 +35,28 @@
     }
   },
   methods: {
+    refreshCount(){   
+      let  temData = wx.getStorageSync('conentCountTemp')  
+      if(temData && this.data.datalist){  
+          var dataList =this.data.datalist;
+          dataList.forEach(item =>{ 
+              if(item.id+'' == temData.id+'' ){
+                  item.viewCount = (item.viewCount ||0)+1; 
+                  if( item.isCollection != temData.isCollection){ 
+                    if(item.isCollection){
+                        item.collectCount = (item.collectCount || 0)-1
+                        item.collectCount  =   item.collectCount >=0?  item.collectCount :0;
+                    } else{ 
+                        item.collectCount = (item.collectCount || 0)+1
+                    }
+                    item.isCollection = temData.isCollection
+                }
+              }   
+          })
+          this.setData({datalist:dataList})
+           wx.setStorageSync('conentCountTemp',null)
+      }
+    },
     getCatelist(){
       getCatalogList({
         catalogCode: 'product_intro'

--
Gitblit v1.9.3