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_jiaxuan/components/disCase/index.js |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/wechat_jiaxuan/components/disCase/index.js b/wechat_jiaxuan/components/disCase/index.js
index 695fc91..01aa0be 100644
--- a/wechat_jiaxuan/components/disCase/index.js
+++ b/wechat_jiaxuan/components/disCase/index.js
@@ -1,4 +1,5 @@
 import { getCataLogTagList, getZhongTaiWholecasePage, actionDo } from '../../api/index'
+import { eventBus } from '../../utils/eventBus'
 Component({
   /**
    * 缁勪欢鐨勫睘鎬у垪琛�
@@ -22,8 +23,25 @@
     sortType: '',
     catalogCode: 'whole_case'
   },
+  pageLifetimes: {
+    show: function() {
+      // 椤甸潰琚睍绀�
+      console.log('缁勪欢琚睍绀�');
+      eventBus.once('caseDeBack', (info) => {
+        const dataList = this.data.dataList
+        dataList.forEach(item => {
+          if(item.id === info.id){
+            item.isCollection = info.isCollection
+            item.viewCount ++
+          }
+        })
+        this.setData({ dataList })
+      })
+    },
+  },
   attached() {
     this.getCatelist()
+    this.getList()
   },
   methods: {
     getCatelist() {
@@ -35,9 +53,6 @@
           this.setData({
             cateList: res.data
           })
-          setTimeout(() => {
-            this.getList()
-          }, 300)
         }
       })
     },

--
Gitblit v1.9.3