From 2c08a98f7e85ec7c9376f27a7933e75e44d672f7 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期二, 27 八月 2024 15:52:59 +0800
Subject: [PATCH] ll
---
wechat_jiaxuan/pages/consult/detail.js | 37 +++++++++++++++++++++++++++----------
1 files changed, 27 insertions(+), 10 deletions(-)
diff --git a/wechat_jiaxuan/pages/consult/detail.js b/wechat_jiaxuan/pages/consult/detail.js
index fd00085..c320ac0 100644
--- a/wechat_jiaxuan/pages/consult/detail.js
+++ b/wechat_jiaxuan/pages/consult/detail.js
@@ -1,4 +1,4 @@
-import { shareContent, getProductNewsInfo } from '../../api/index'
+import { actionDo, getProductNewsInfo, getMemberInfo } from '../../api/index'
Page({
/**
@@ -16,6 +16,12 @@
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
*/
+ onLoadLogin(options) {
+ this.getDetail(options.id, options.userId || '')
+ },
+ onShow(){
+ this.setData({ member: wx.getStorageSync('member') })
+ },
onLoad(options) {
var app = getApp().globalData
this.setData({
@@ -24,9 +30,16 @@
if(options.origin && options.origin == 'b'){
this.setData({ origin: 'b' })
}
- this.getDetail(options.id, options.userId || '')
+ // this.getDetail(options.id, options.userId || '')
},
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',
})
@@ -44,6 +57,14 @@
wx.setNavigationBarTitle({
title: res.data.title
})
+ if (userId) {
+ getMemberInfo().then(res => {
+ this.setData({
+ member: res.data
+ })
+ wx.setStorageSync('member', res.data)
+ })
+ }
})
},
openShare() {
@@ -51,15 +72,11 @@
},
handleShare() {
console.log('鐐瑰嚮浜嗗垎浜�');
- shareContent(this.data.info.id)
+ actionDo({
+ actionType: 'share',
+ id: this.data.info.id
+ })
},
- // onShareAppMessage: function () {
- // // let { productDetail, userInfo } = this.data
- // return {
- // title: productDetail.title,
- // path: '/pages/index/index?id=' + productDetail.id + '&shareuserid=' + userInfo.id + '&type=0'
- // }
- // },
onClose() {
this.setData({showShare: false})
},
--
Gitblit v1.9.3