From 997036b27927bcc1e9207a40b7a69c106a10f30c Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期三, 31 七月 2024 15:49:52 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/zbomyoujia

---
 wechat_staff/components/disProduct/index.js |   29 +++++++++++++++++++++++++----
 1 files changed, 25 insertions(+), 4 deletions(-)

diff --git a/wechat_staff/components/disProduct/index.js b/wechat_staff/components/disProduct/index.js
index 2e23c6d..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'
@@ -120,9 +142,8 @@
     tagClick(e) {
       const code = e.currentTarget.dataset.code
       const paramIndex = e.currentTarget.dataset.index
-      const { secondCateList, tagCodes, activeParam, activeIndex } = this.data
-      const index = tagCodes.indexOf(code)
-      if(index === -1){
+      const { secondCateList, tagCodes, activeParam, activeIndex } = this.data 
+      if( secondCateList[activeIndex].tempParamIndex==null ||      secondCateList[activeIndex].tempParamIndex != paramIndex){
          // 鍚宲aram閲宑ode閲嶅
         // if (activeParam && activeParam.length > 0) {
         //   activeParam.forEach(item => {

--
Gitblit v1.9.3