From b5c218b2ed749a3e710c92c4770759773de4fc0c Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期四, 01 八月 2024 18:25:19 +0800
Subject: [PATCH] 代码提交
---
wechat_jiaxuan/components/disRealpic/index.js | 24 ++++++++++++++++++++++++
1 files changed, 24 insertions(+), 0 deletions(-)
diff --git a/wechat_jiaxuan/components/disRealpic/index.js b/wechat_jiaxuan/components/disRealpic/index.js
index c96868b..bc18860 100644
--- a/wechat_jiaxuan/components/disRealpic/index.js
+++ b/wechat_jiaxuan/components/disRealpic/index.js
@@ -1,4 +1,5 @@
import { getCataLogTagList, getZhongTaiRealcasePage, actionDo } from '../../api/index'
+import { eventBus } from '../../utils/eventBus'
Component({
/**
* 缁勪欢鐨勫睘鎬у垪琛�
@@ -21,6 +22,29 @@
sortType: '',
catalogCode: 'real_case'
},
+ pageLifetimes: {
+ show: function() {
+ // 椤甸潰琚睍绀�
+ console.log('缁勪欢琚睍绀�');
+ eventBus.once('realpicDeBack', (info) => {
+ const dataList = this.data.dataList
+ dataList.forEach(item => {
+ if(item.id === info.id){
+ if(item.isCollection != info.isCollection){
+ if(!item.isCollection){
+ item.collectCount = (item.collectCount || 0)+1
+ }else if(item.collectCount >0){
+ item.collectCount = (item.collectCount || 0)-1
+ }
+ }
+ item.isCollection = info.isCollection
+ item.viewCount ++
+ }
+ })
+ this.setData({ dataList })
+ })
+ },
+ },
attached() {
this.getCatelist()
},
--
Gitblit v1.9.3