From a1664efbefb313784e1920ffc8cfceda2a2ea1c8 Mon Sep 17 00:00:00 2001
From: k94314517 <8417338+k94314517@user.noreply.gitee.com>
Date: 星期三, 07 八月 2024 14:50:03 +0800
Subject: [PATCH] 代码提交
---
wechat_jiaxuan/pages/detailDis/product.js | 44 +++++++++++++++++++++++++++++++++-----------
1 files changed, 33 insertions(+), 11 deletions(-)
diff --git a/wechat_jiaxuan/pages/detailDis/product.js b/wechat_jiaxuan/pages/detailDis/product.js
index 16e0b4c..cc5c0d8 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,15 @@
actionType: 'view',
id: options.id
})
- getMemberInfo().then(res => {
- this.setData({
- member: res.data
- })
- })
+ },
+ onShow(){
+ this.setData({ member: wx.getStorageSync('member') })
+ },
+ onUnload() {
+ console.log('璇︽儏杩涜浜嗛攢姣�');
+ setTimeout(() => {
+ eventBus.emit('productDeBack', this.data.info)
+ }, 500)
},
onLoad(options) {
var app = getApp().globalData
@@ -71,7 +80,7 @@
const {
info, member
} = this.data
- if (member.authStatus == '0') {
+ if (!member.phone) {
return wx.navigateTo({
url: '/pages/auth/auth',
})
@@ -86,6 +95,7 @@
})
wx.showToast({
title: actionType == 'collect' ? '鏀惰棌鎴愬姛' : '鍙栨秷鏀惰棌',
+ icon: "none"
})
})
},
@@ -100,6 +110,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() {
@@ -121,6 +139,13 @@
})
},
handleDesign() {
+ const { member } = this.data
+ if (!member.phone) {
+ wx.setStorageSync('tempPath', '/pages/design/design')
+ return wx.navigateTo({
+ url: '/pages/auth/auth',
+ })
+ }
wx.navigateTo({
url: '/pages/design/design',
})
@@ -191,9 +216,6 @@
})
},
onHide() {
-
- },
- onUnload() {
},
onPullDownRefresh() {
--
Gitblit v1.9.3