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 | 46 +++++++++++++++++++++++++++++++++++-----------
1 files changed, 35 insertions(+), 11 deletions(-)
diff --git a/wechat_jiaxuan/pages/detailDis/product.js b/wechat_jiaxuan/pages/detailDis/product.js
index ba7ac8f..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 })
@@ -26,6 +31,15 @@
id: options.id
})
},
+ onShow(){
+ this.setData({ member: wx.getStorageSync('member') })
+ },
+ onUnload() {
+ console.log('璇︽儏杩涜浜嗛攢姣�');
+ setTimeout(() => {
+ eventBus.emit('productDeBack', this.data.info)
+ }, 500)
+ },
onLoad(options) {
var app = getApp().globalData
this.setData({
@@ -34,10 +48,8 @@
if (options.origin && options.origin == 'b') {
this.setData({ origin: 'b' })
}
- const member = wx.getStorageSync('member')
this.setData({
- id: options.id,
- member
+ id: options.id
})
},
bindchange(e) {
@@ -66,10 +78,9 @@
handleAction(e) {
const actionType = e.currentTarget.dataset.code
const {
- info
+ info, member
} = this.data
- const member = wx.getStorageSync('member')
- if (member.authStatus == '0') {
+ if (!member.phone) {
return wx.navigateTo({
url: '/pages/auth/auth',
})
@@ -84,6 +95,7 @@
})
wx.showToast({
title: actionType == 'collect' ? '鏀惰棌鎴愬姛' : '鍙栨秷鏀惰棌',
+ icon: "none"
})
})
},
@@ -98,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() {
@@ -119,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',
})
@@ -189,9 +216,6 @@
})
},
onHide() {
-
- },
- onUnload() {
},
onPullDownRefresh() {
--
Gitblit v1.9.3