From 00bf17838b496e6fcfed2e521f9c27f8f0e3e3c7 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期一, 05 八月 2024 18:38:20 +0800
Subject: [PATCH] ‘’

---
 wechat_jiaxuan/pages/detailDis/product.js |   32 ++++++++++++++++++++++----------
 1 files changed, 22 insertions(+), 10 deletions(-)

diff --git a/wechat_jiaxuan/pages/detailDis/product.js b/wechat_jiaxuan/pages/detailDis/product.js
index 16e0b4c..ad52c22 100644
--- a/wechat_jiaxuan/pages/detailDis/product.js
+++ b/wechat_jiaxuan/pages/detailDis/product.js
@@ -1,7 +1,9 @@
 import {
   getProductInfo,
-  actionDo
+  actionDo,
+  getMemberInfo
 } from '../../api/index'
+import { eventBus } from '../../utils/eventBus'
 Page({
   /**
    * 椤甸潰鐨勫垵濮嬫暟鎹�
@@ -14,7 +16,10 @@
     isFold: false,
     info: {},
     member: {},
-    showShare: false
+    showShare: false,
+    options: {
+      empty: '鏃犲弬鏁�'
+    }
   },
   changeFold() {
     this.setData({ isFold: !this.data.isFold })
@@ -25,11 +30,12 @@
       actionType: 'view',
       id: options.id
     })
-    getMemberInfo().then(res => {
-      this.setData({
-        member: res.data
-      })
-    })
+  },
+  onUnload() {
+    console.log('璇︽儏杩涜浜嗛攢姣�');
+    setTimeout(() => {
+      eventBus.emit('productDeBack', this.data.info)
+    }, 500)
   },
   onLoad(options) {
     var app = getApp().globalData
@@ -86,6 +92,7 @@
       })
       wx.showToast({
         title: actionType == 'collect' ? '鏀惰棌鎴愬姛' : '鍙栨秷鏀惰棌',
+        icon: "none"
       })
     })
   },
@@ -100,6 +107,14 @@
       wx.setNavigationBarTitle({
         title: res.data.title
       })
+      if(userId){
+        getMemberInfo().then(res => {
+          this.setData({ member: res.data })
+          wx.setStorageSync('member', res.data)
+        })
+      }else{
+        this.setData({ member: wx.getStorageSync('member') })
+      }
     })
   },
   playVideo() {
@@ -191,9 +206,6 @@
     })
   },
   onHide() {
-
-  },
-  onUnload() {
 
   },
   onPullDownRefresh() {

--
Gitblit v1.9.3