From a924e3906a3b77f04ac4fedcff9e76ebe0c997a2 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期三, 24 七月 2024 19:19:21 +0800
Subject: [PATCH] Merge remote-tracking branch 'origin/master'

---
 wechat_staff/pages/detailDis/realpic.js |   36 ++++++++++++++++++++++++++++++++++++
 1 files changed, 36 insertions(+), 0 deletions(-)

diff --git a/wechat_staff/pages/detailDis/realpic.js b/wechat_staff/pages/detailDis/realpic.js
index a6c9d1b..6795a0e 100644
--- a/wechat_staff/pages/detailDis/realpic.js
+++ b/wechat_staff/pages/detailDis/realpic.js
@@ -42,6 +42,42 @@
       this.setData({info})
     })
   },
+  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: 'product',
+          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
+        })
+      })
+    }
+  },
   getDetail(id) {
     getRealcaseInfo({id}).then(res => {
       this.setData({ info: res.data })

--
Gitblit v1.9.3