From c7d7aff39b6566d05d3c0a080839c46bb2b6a8aa Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期五, 26 七月 2024 11:43:44 +0800
Subject: [PATCH] Merge branch 'master' of http://139.186.142.91:10010/r/productDev/zbomyoujia
---
wechat_staff/pages/detailDis/product.js | 22 ++++++++++++++++++----
1 files changed, 18 insertions(+), 4 deletions(-)
diff --git a/wechat_staff/pages/detailDis/product.js b/wechat_staff/pages/detailDis/product.js
index 0fa8bec..46d697f 100644
--- a/wechat_staff/pages/detailDis/product.js
+++ b/wechat_staff/pages/detailDis/product.js
@@ -1,7 +1,8 @@
import {
shareContent,
getProductInfo,
- actionDo
+ actionDo,
+ refreshEnjoy
} from '../../api/index'
import moment from "moment";
Page({
@@ -13,7 +14,15 @@
id: '',
info: {},
member: {},
- showShare: false
+ showShare: false,
+ enjoyList: []
+ },
+ onShow(){
+ console.log('onShow')
+ refreshEnjoy(this)
+ },
+ onHide() {
+ console.log('onHide')
},
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
@@ -34,13 +43,17 @@
member
})
},
+
// 缁勪欢浜嬩欢
handleEnjoy(e) {
+ const info = this.data.info
+ if(info.id == null ){
+ return
+ }
const enjoyList = wx.getStorageSync('enjoyList') || []
const { type, flag } = e.detail
console.log('type', type);
- console.log('flag', flag);
- const info = this.data.info
+ console.log('flag', flag);
if(type == 'enjoy'){
// 鐐瑰嚮浜嗗枩娆�
const index = enjoyList.findIndex( i => i.id === info.id )
@@ -58,6 +71,7 @@
enjoyList.splice(index, 1)
}
wx.setStorageSync('enjoyList', enjoyList)
+ refreshEnjoy(this)
}else{
actionDo({
id: info.id,
--
Gitblit v1.9.3