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/disCase/index.js |   27 +++++++++++++++++++++++----
 1 files changed, 23 insertions(+), 4 deletions(-)

diff --git a/wechat_staff/components/disCase/index.js b/wechat_staff/components/disCase/index.js
index 04a3324..f4551fa 100644
--- a/wechat_staff/components/disCase/index.js
+++ b/wechat_staff/components/disCase/index.js
@@ -24,8 +24,31 @@
   },
   attached() {
     this.getCatelist()
+    this.getList()
   },
   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(){
       const { catalogCode } = this.data
       getCataLogTagList({
@@ -35,9 +58,6 @@
           this.setData({
             cateList: res.data
           })
-          setTimeout(() => {
-            this.getList()
-          }, 300)
         }
       })
     },
@@ -45,7 +65,6 @@
       if(this.data.isLoading){
         return
       }
-      
       this.setData({isLoading:true})
       const { sortType, query, tagCodes, pageNum, pageSize,catalogCode } = this.data
       getZhongTaiWholecasePage({

--
Gitblit v1.9.3