From 1a6905045d38bb50b0c6554c3440bdfd339c8d23 Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期二, 30 七月 2024 19:13:46 +0800
Subject: [PATCH] ‘’
---
wechat_staff/pages/detailDis/product.js | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++----
1 files changed, 55 insertions(+), 4 deletions(-)
diff --git a/wechat_staff/pages/detailDis/product.js b/wechat_staff/pages/detailDis/product.js
index e15213f..1d3a8c5 100644
--- a/wechat_staff/pages/detailDis/product.js
+++ b/wechat_staff/pages/detailDis/product.js
@@ -1,7 +1,8 @@
import {
shareContent,
getProductInfo,
- actionDo
+ actionDo,
+ refreshEnjoy
} from '../../api/index'
import moment from "moment";
Page({
@@ -10,10 +11,20 @@
*/
data: {
bottomLift: 0,
+ current: 0,
id: '',
info: {},
member: {},
- showShare: false
+ showShare: false,
+ isFold: false,
+ enjoyList: []
+ },
+ onShow(){
+ console.log('onShow')
+ refreshEnjoy(this)
+ },
+ onHide() {
+ console.log('onHide')
},
/**
* 鐢熷懡鍛ㄦ湡鍑芥暟--鐩戝惉椤甸潰鍔犺浇
@@ -34,13 +45,17 @@
member
})
},
+
// 缁勪欢浜嬩欢
handleEnjoy(e) {
+ const info = this.data.info
+ if(info.id == null ){
+ return
+ }
const enjoyList = wx.getStorageSync('enjoyList') || []
const { type, flag } = e.detail
console.log('type', type);
- console.log('flag', flag);
- const info = this.data.info
+ console.log('flag', flag);
if(type == 'enjoy'){
// 鐐瑰嚮浜嗗枩娆�
const index = enjoyList.findIndex( i => i.id === info.id )
@@ -58,6 +73,7 @@
enjoyList.splice(index, 1)
}
wx.setStorageSync('enjoyList', enjoyList)
+ refreshEnjoy(this)
}else{
actionDo({
id: info.id,
@@ -70,6 +86,29 @@
})
})
}
+ },
+ priviewBanner(e) {
+ const url = e.currentTarget.dataset.url
+ const {
+ info
+ } = this.data
+ wx.previewImage({
+ urls: info.bannerImgList,
+ current: url
+ })
+ },
+ bindchange(e) {
+ this.setData({ current: e.detail.current })
+ },
+ priviewSpace(e) {
+ const url = e.currentTarget.dataset.url
+ const {
+ info
+ } = this.data
+ wx.previewImage({
+ urls: info.spaceList.map(i => i.spaceImg),
+ current: url
+ })
},
onShareAppMessage() {
console.log('鐢ㄦ埛鐐瑰嚮浜嗗垎浜�');
@@ -129,6 +168,9 @@
// this.setData({showShare: false})
// })
},
+ changeFold() {
+ this.setData({ isFold: !this.data.isFold })
+ },
// onShareAppMessage: function () {
// // let { productDetail, userInfo } = this.data
// return {
@@ -183,6 +225,15 @@
onHide() {
},
+ goTestPage(){
+ wx.navigateTo({
+ url: '/pages/webView/index',
+ success: function(res) {
+ // 閫氳繃eventChannel鍚戣鎵撳紑椤甸潰浼犻�佹暟鎹�
+ res.eventChannel.emit('data',{link:'http://crmtest.zhibang.com:8000/core/oauth/authorize/jump?timestamp=-465385833&agent_phone_number=18055151023&bindKey=mpAddIntention&sign=cdfe13abfe2727b40eee160085c80d11'} );
+ }
+ })
+ },
onUnload() {
},
--
Gitblit v1.9.3