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 |   71 +++++++++++++++++++++++------------
 1 files changed, 47 insertions(+), 24 deletions(-)

diff --git a/wechat_staff/pages/detailDis/product.js b/wechat_staff/pages/detailDis/product.js
index b7e5dfd..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 )
@@ -49,7 +63,7 @@
         this.setData({ info })
         enjoyList.push({
           ...info,
-          joinType: 'product',
+          joinType: '0',
           timestamp: new Date().getTime()
         })
       }else{
@@ -58,6 +72,7 @@
         enjoyList.splice(index, 1)
       }
       wx.setStorageSync('enjoyList', enjoyList)
+      refreshEnjoy(this)
     }else{
       actionDo({
         id: info.id,
@@ -71,22 +86,27 @@
       })
     }
   },
-  handleAction(e) {
-    const actionType = e.currentTarget.dataset.code
+  priviewBanner(e) {
+    const url = e.currentTarget.dataset.url
     const {
       info
     } = this.data
-    actionDo({
-      actionType,
-      id: this.data.info.id
-    }).then(res => {
-      info.isCollection = !info.isCollection
-      this.setData({
-        info
-      })
-      wx.showToast({
-        title: actionType == 'collect' ? '鏀惰棌鎴愬姛' : '鍙栨秷鏀惰棌',
-      })
+    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() {
@@ -201,6 +221,15 @@
   onHide() {
 
   },
+  goTestPage(){  
+    wx.navigateTo({
+      url: '/pages/webView/index',
+      success: function(res) {
+        // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹� 
+        res.eventChannel.emit('data',{link:'http://crmtest.zhibang.com:8000/core/oauth/authorize/jump?timestamp=-465385833&agent_phone_number=18055151023&bindKey=mpAddIntention&sign=cdfe13abfe2727b40eee160085c80d11'} );
+      }
+    })
+  },
   onUnload() {
 
   },
@@ -211,10 +240,4 @@
 
   },
 
-  /**
-   * 鐢ㄦ埛鐐瑰嚮鍙充笂瑙掑垎浜�
-   */
-  onShareAppMessage() {
-
-  }
 })
\ No newline at end of file

--
Gitblit v1.9.3