From e61a6b57161e75185ba0691a3bfa3961f7a7a13e Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期四, 25 七月 2024 10:19:08 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'
---
wechat_staff/pages/detailDis/case.js | 36 ++++++++++++++++++++++++++++++++++++
1 files changed, 36 insertions(+), 0 deletions(-)
diff --git a/wechat_staff/pages/detailDis/case.js b/wechat_staff/pages/detailDis/case.js
index 71a0531..8766e9a 100644
--- a/wechat_staff/pages/detailDis/case.js
+++ b/wechat_staff/pages/detailDis/case.js
@@ -49,6 +49,42 @@
// path: '/pages/index/index?id=' + productDetail.id + '&shareuserid=' + userInfo.id + '&type=0'
// }
// },
+ handleEnjoy(e) {
+ const enjoyList = wx.getStorageSync('enjoyList') || []
+ const { type, flag } = e.detail
+ console.log('type', type);
+ console.log('flag', flag);
+ const info = this.data.info
+ if(type == 'enjoy'){
+ // 鐐瑰嚮浜嗗枩娆�
+ const index = enjoyList.findIndex( i => i.id === info.id )
+ if(index === -1){
+ info.isEnjoy = true
+ this.setData({ info })
+ enjoyList.push({
+ ...info,
+ joinType: '1',
+ timestamp: new Date().getTime()
+ })
+ }else{
+ info.isEnjoy = false
+ this.setData({ info })
+ enjoyList.splice(index, 1)
+ }
+ wx.setStorageSync('enjoyList', enjoyList)
+ }else{
+ actionDo({
+ id: info.id,
+ actionType: flag ? 'collect' : 'collect_cancel'
+ }).then(res => {
+ info.isCollection = flag
+ wx.showToast({title: flag ? '鏀惰棌鎴愬姛' : '鍙栨秷鏀惰棌'})
+ this.setData({
+ info
+ })
+ })
+ }
+ },
handleAction(e){
const actionType = e.currentTarget.dataset.code
const { info } = this.data
--
Gitblit v1.9.3