From b4661b438355fe760beafe9604f24a907a81a42d Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期四, 01 八月 2024 08:54:10 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/zbomyoujia
---
wechat_jiaxuan/components/disProduct/index.js | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/wechat_jiaxuan/components/disProduct/index.js b/wechat_jiaxuan/components/disProduct/index.js
index 85c328b..396306d 100644
--- a/wechat_jiaxuan/components/disProduct/index.js
+++ b/wechat_jiaxuan/components/disProduct/index.js
@@ -34,8 +34,17 @@
const datalist = this.data.datalist
datalist.forEach(item => {
if(item.id === info.id){
+ console.log(item)
+ console.log(info)
+ 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 ++
+ item.viewCount =(item.viewCount||0) +1
}
})
this.setData({ datalist })
--
Gitblit v1.9.3