From 2bd2684d71fdfed5ff1ff1ea821d01f245c2623f Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期五, 02 八月 2024 09:56:20 +0800
Subject: [PATCH] ''

---
 wechat_staff/components/disCase/index.js |   29 ++++++++++++++++++++++++-----
 1 files changed, 24 insertions(+), 5 deletions(-)

diff --git a/wechat_staff/components/disCase/index.js b/wechat_staff/components/disCase/index.js
index 04a3324..64b1b4c 100644
--- a/wechat_staff/components/disCase/index.js
+++ b/wechat_staff/components/disCase/index.js
@@ -19,13 +19,36 @@
     pageNum: 1,
     pageSize: 10,
     query: '',
-    sortType: 'NORMAL',
+    sortType: '',
     catalogCode: 'whole_case'
   },
   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