From d9a89d83c2048a964f16ca179feb2b7f21b9d33a Mon Sep 17 00:00:00 2001
From: jiangping <jp@doumee.com>
Date: 星期一, 29 七月 2024 16:28:47 +0800
Subject: [PATCH] 提交

---
 wechat_staff/pages/detailDis/product.js |   46 ++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 42 insertions(+), 4 deletions(-)

diff --git a/wechat_staff/pages/detailDis/product.js b/wechat_staff/pages/detailDis/product.js
index 0fa8bec..302616e 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({
@@ -10,10 +11,19 @@
    */
   data: {
     bottomLift: 0,
+    current: 0,
     id: '',
     info: {},
     member: {},
-    showShare: false
+    showShare: false,
+    enjoyList: []
+  },
+  onShow(){
+    console.log('onShow')
+    refreshEnjoy(this)
+  },
+  onHide() {
+    console.log('onHide')
   },
   /**
    * 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
@@ -34,13 +44,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 +72,7 @@
         enjoyList.splice(index, 1)
       }
       wx.setStorageSync('enjoyList', enjoyList)
+      refreshEnjoy(this)
     }else{
       actionDo({
         id: info.id,
@@ -71,6 +86,29 @@
       })
     }
   },
+  priviewBanner(e) {
+    const url = e.currentTarget.dataset.url
+    const {
+      info
+    } = this.data
+    wx.previewImage({
+      urls: info.bannerImgList,
+      current: url
+    })
+  },
+  bindchange(e) {
+    this.setData({ current: e.detail.current })
+  },
+  priviewSpace(e) {
+    const url = e.currentTarget.dataset.url
+    const {
+      info
+    } = this.data
+    wx.previewImage({
+      urls: info.spaceList.map(i => i.spaceImg),
+      current: url
+    })
+  },
   onShareAppMessage() {
     console.log('鐢ㄦ埛鐐瑰嚮浜嗗垎浜�');
   },

--
Gitblit v1.9.3