From 7b2847ac00849ffe33e4b1ca186fd9b6ad312dad Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期三, 31 七月 2024 13:56:07 +0800
Subject: [PATCH] lll
---
wechat_jiaxuan/pages/detailDis/product.js | 30 +++++++++++++++++++++++-------
1 files changed, 23 insertions(+), 7 deletions(-)
diff --git a/wechat_jiaxuan/pages/detailDis/product.js b/wechat_jiaxuan/pages/detailDis/product.js
index c65744e..beb90e7 100644
--- a/wechat_jiaxuan/pages/detailDis/product.js
+++ b/wechat_jiaxuan/pages/detailDis/product.js
@@ -3,6 +3,7 @@
actionDo,
getMemberInfo
} from '../../api/index'
+import { eventBus } from '../../utils/eventBus'
Page({
/**
* 椤甸潰鐨勫垵濮嬫暟鎹�
@@ -26,11 +27,28 @@
actionType: 'view',
id: options.id
})
- getMemberInfo().then(res => {
- this.setData({
- member: res.data
+ const member = wx.getStorageSync('member') || {}
+ if(!member.id){
+ getMemberInfo().then(res => {
+ this.setData({
+ member: res.data
+ })
})
- })
+ }
+ },
+ onShow() {
+ const member = wx.getStorageSync('member') || {}
+ if(member && member.id){
+ this.setData({
+ member
+ })
+ }
+ },
+ onUnload() {
+ console.log('璇︽儏杩涜浜嗛攢姣�');
+ setTimeout(() => {
+ eventBus.emit('productDeBack', this.data.info)
+ }, 500)
},
onLoad(options) {
var app = getApp().globalData
@@ -87,6 +105,7 @@
})
wx.showToast({
title: actionType == 'collect' ? '鏀惰棌鎴愬姛' : '鍙栨秷鏀惰棌',
+ icon: "none"
})
})
},
@@ -192,9 +211,6 @@
})
},
onHide() {
-
- },
- onUnload() {
},
onPullDownRefresh() {
--
Gitblit v1.9.3