Commit 730bd6d7 by 匡雅琴

修改产品详情页面

1 parent e61ab099
...@@ -22,6 +22,9 @@ module.exports = { ...@@ -22,6 +22,9 @@ module.exports = {
}, },
getBaseDataConfig() { getBaseDataConfig() {
return api.getBaseDataByMock() return api.getBaseDataByMock()
},
getProductDetail() {
return api.getProductDetail()
} }
} }
} }
\ No newline at end of file \ No newline at end of file
...@@ -155,5 +155,21 @@ class Request { ...@@ -155,5 +155,21 @@ class Request {
}) })
}) })
} }
getProductDetail() {
let url = 'https://oss-config.dev.glsx.com.cn/mock/6264ff4760f415276f6dfe62/test-detail'
return new Promise((resolve) => {
wx.request({
url,
data: {},
method: 'GET',
header: {},
dataType: 'json',
responseType: 'text',
success(response) {
resolve(response.data)
}
})
})
}
} }
export default new Request() export default new Request()
\ No newline at end of file \ No newline at end of file
// packagesList/pages/productDetail/components/proDetail/proDetail.js // packagesList/pages/productDetail/components/proDetail/proDetail.js
import { senceData, productData1 } from '~/pages/tab/index/constant/senceData' // import { senceData, productData1 } from '~/pages/tab/index/constant/senceData'
const norTabList = ['海报案例', '测算营销', '产品介绍', '项目亮点'] const norTabList = ['海报案例', '测算营销', '产品介绍', '项目亮点']
import { componentsMixin } from "../../mixins/index"; import { componentsMixin } from "../../mixins/index";
Component({ Component({
...@@ -10,34 +10,38 @@ Component({ ...@@ -10,34 +10,38 @@ Component({
*/ */
properties: { properties: {
// 场景值下标 // 场景值下标
actNum: { // actNum: {
type: Number, // type: Number,
value: -1, // value: -1,
observer(n) { // observer(n) {
this.getInfo() // this.getInfo()
if (n == 3) { // if (n == 3) {
this.setVideoCtx() // this.setVideoCtx()
} // }
this.getImgHeight() // this.getImgHeight()
} // }
}, // },
// 选中的产品 // // 选中的产品
activeNavIdx: { // activeNavIdx: {
type: Number, // type: Number,
value: 0 // value: 0
}, // },
cardInfo: { // cardInfo: {
type: Object, // type: Object,
value: {} // value: {}
}, // },
// 配置url // // 配置url
activeUrl: { // activeUrl: {
type: String, // type: String,
value: '' // value: ''
}, // },
detailType: { detailType: {
type: String, type: String,
value: 'pro' value: 'pro'
},
proDetail: {
type: Object,
value: {}
} }
}, },
...@@ -47,7 +51,7 @@ Component({ ...@@ -47,7 +51,7 @@ Component({
data: { data: {
IMG_URL: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/', IMG_URL: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/',
videoBaseUrl: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/', videoBaseUrl: 'https://img02.glsx.com.cn/weapp/resource/saas/business-assistant/index/',
productData: productData1, // productData: productData1,
proInfo: {}, proInfo: {},
prodItemVideo: '', //选中的场景下的video的第一个 prodItemVideo: '', //选中的场景下的video的第一个
tabAct: 0, tabAct: 0,
...@@ -79,26 +83,26 @@ Component({ ...@@ -79,26 +83,26 @@ Component({
let { attr } = e.currentTarget.dataset let { attr } = e.currentTarget.dataset
this.data[attr] && this.data[attr].pause() this.data[attr] && this.data[attr].pause()
}, },
getInfo() { // getInfo() {
let { activeNavIdx, actNum } = this.data // let { activeNavIdx, actNum } = this.data
const spcList = [99] // 订阅模块需要特殊处理 // const spcList = [99] // 订阅模块需要特殊处理
const senceList = productData1[actNum].filter(item => item.name != '全部') // const senceList = productData1[actNum].filter(item => item.name != '全部')
for (let i = 0; i < senceList.length; i++) { // for (let i = 0; i < senceList.length; i++) {
let item = senceList[i] // let item = senceList[i]
let proIdList = item?.productList.map(k => k.id) // let proIdList = item?.productList.map(k => k.id)
if (proIdList.includes(activeNavIdx)) { // if (proIdList.includes(activeNavIdx)) {
let proInfo = item.productList.find(k => k.id == activeNavIdx) // let proInfo = item.productList.find(k => k.id == activeNavIdx)
this.setData({ // this.setData({
proInfo, // proInfo,
// productImgs: spcList.includes(actNum) ? proInfo.sceneImgs : item.productImgs, // // productImgs: spcList.includes(actNum) ? proInfo.sceneImgs : item.productImgs,
productImgs: spcList.includes(actNum) ? proInfo.sceneImgs : (proInfo.productImgs ? proInfo.productImgs : item.productImgs), // productImgs: spcList.includes(actNum) ? proInfo.sceneImgs : (proInfo.productImgs ? proInfo.productImgs : item.productImgs),
tabList: spcList.includes(actNum) ? proInfo.tabList : norTabList, // tabList: spcList.includes(actNum) ? proInfo.tabList : norTabList,
prodItemVideo: item.videoList.length ? spcList.includes(actNum) ?item.videoList[proInfo.currentIndex] : item.videoList[activeNavIdx] : item.noVideoPicture[0] // prodItemVideo: item.videoList.length ? spcList.includes(actNum) ?item.videoList[proInfo.currentIndex] : item.videoList[activeNavIdx] : item.noVideoPicture[0]
}) // })
break // break
} // }
} // }
}, // },
getImgHeight() { getImgHeight() {
let query = wx.createSelectorQuery().in(this) let query = wx.createSelectorQuery().in(this)
let heightArr = [] let heightArr = []
...@@ -122,8 +126,8 @@ Component({ ...@@ -122,8 +126,8 @@ Component({
.exec() .exec()
}, },
// 1.3查看活动详情按钮 // 1.3查看活动详情按钮
checkActive() { checkActive(e) {
let { activeUrl } = this.data let { activeUrl } = e.url
wx.$router.jumpH5(activeUrl); wx.$router.jumpH5(activeUrl);
}, },
...@@ -162,11 +166,12 @@ Component({ ...@@ -162,11 +166,12 @@ Component({
}, },
// 长按图片 // 长按图片
handleLongPress(e) { handleLongPress(e) {
let { actnum, index } = e.target.dataset console.log(e);
// 膨胀金活动,合作方式 let {item} = e.currentTarget.dataset
if (actnum == 99 && index == 4) { // 如果图片有长按事件
if (item.clickEvent == 1) {
wx.downloadFile({ wx.downloadFile({
url: 'https://scrm.glsx.com.cn/frontpdf/expand_agreement.pdf', url: item.linkUrl,
success: function (res) { success: function (res) {
const filePath = res.tempFilePath const filePath = res.tempFilePath
wx.openDocument({ wx.openDocument({
...@@ -177,6 +182,29 @@ Component({ ...@@ -177,6 +182,29 @@ Component({
} }
}) })
} }
} // 膨胀金活动,合作方式
// if (actnum == 99 && index == 4) {
// wx.downloadFile({
// url: 'https://scrm.glsx.com.cn/frontpdf/expand_agreement.pdf',
// success: function (res) {
// const filePath = res.tempFilePath
// wx.openDocument({
// filePath: filePath,
// success: function (res) {
// }
// })
// }
// })
// }
},
// 点击拨打电话
phoneCall(e) {
console.log(e);
let { phone } = e.currentTarget.dataset;
// wx.$api.phoneCall(phone);
wx.makePhoneCall({
phoneNumber: phone,
});
},
} }
}) })
<!-- packagesList/pages/productDetail/components/proDetail/proDetail.wxml --> <!-- packagesList/pages/productDetail/components/proDetail/proDetail.wxml -->
<view class="view-prod custom-class"> <view class="view-prod custom-class">
<view class="pro-head"> <view class="pro-head">
<view class="select-card" wx:if="{{detailType == 'pro'}}" bindtap="selectCard"> <view class="select-card" wx:if="{{detailType == 'pro'}}" bindtap="selectCard">
<glsx-image custom-class="icon-card" src="home/icon-card.png"></glsx-image> <glsx-image custom-class="icon-card" src="home/icon-card.png"></glsx-image>
<view>{{showCard ? '视频' : '名片'}}</view> <view>{{showCard ? '视频' : '名片'}}</view>
</view> </view>
<!-- 有视频 -->
<block wx:if="{{!showCard}}"> <block wx:if="{{!showCard}}">
<!-- <video class="frame" wx:if="{{actNum != 2}}" src="{{prodItemVideo.videoUrl}}" /> --> <!-- <video class="frame" wx:if="{{actNum != 2}}" src="{{prodItemVideo.videoUrl}}" /> -->
<video class="frame" id="video" wx:if="{{actNum != 2}}" src="{{prodItemVideo.videoUrl}}" bindplay="handleVideoPlay" data-attr="crowdVideoCtx"/> <!-- 产品详情是视频 -->
<image class="no-video" wx:if="{{actNum == 2}}" src="{{prodItemVideo.posterUrl}}?v={{img_version}}" /> <video class="frame" id="video" wx:if="{{proDetail.mainType == 'video'}}" src="{{proDetail.mainImg}}" bindplay="handleVideoPlay" data-attr="crowdVideoCtx" />
<!-- 产品详情是图片 -->
<image class="no-video" wx:if="{{proDetail.mainType == 'image'}}" src="{{proDetail.mainImg}}?v={{img_version}}" />
<!-- 标题+视频时展示观看人数 -->
<view class="title-wrap"> <view class="title-wrap">
<view class="title">{{prodItemVideo.name}}</view> <view class="title">{{proDetail.contentTitle}}</view>
<image class="check" wx:if="{{actNum != 2}}" src="{{IMG_URL}}index/poster/check.png?v={{img_version}}" /> <image class="check" wx:if="{{proDetail.mainType != 'image'}}" src="{{IMG_URL}}index/poster/check.png?v={{img_version}}" />
<view class="num" wx:if="{{actNum != 2}}">{{prodItemVideo.view}}</view> <view class="num" wx:if="{{proDetail.mainType != 'image'}}">{{proDetail.view}}</view>
</view> </view>
</block> </block>
<user-info wx:if="{{detailType == 'pro' && showCard}}" class="card-info" cardInfo="{{cardInfo}}"></user-info> <user-info wx:if="{{detailType == 'pro' && showCard}}" class="card-info" cardInfo="{{cardInfo}}"></user-info>
</view> </view>
<!-- tab菜单 -->
<view class="tab-wrap"> <view class="tab-wrap">
<van-tabs sticky bind:click="onClickTab" active="{{tabAct}}"> <van-tabs sticky bind:click="onClickTab" active="{{tabAct}}">
<van-tab wx:for="{{tabList}}" title="{{item}}" wx:key="idnex" /> <van-tab wx:for="{{proDetail.contentDetail}}" title="{{item.detailTypeName}}" wx:key="idnex" />
<!-- <van-tab title="合作案例" /> <!-- <van-tab title="合作案例" />
<van-tab title="合作方式" /> <van-tab title="合作方式" />
<van-tab title="适配产品" /> --> <van-tab title="适配产品" /> -->
</van-tabs> </van-tabs>
</view> </view>
<!-- 详情介绍 -->
<view class="prod-detail"> <view class="prod-detail">
<block wx:for="{{productImgs}}" wx:key="index"> <block wx:for="{{proDetail.contentDetail}}" wx:key="index">
<!-- <image webp wx:if="{{ index < 3}}" mode="widthFix" class="img-items" webp src="{{item.url?item.url:item}}?v={{img_version}}"> --> <!-- <image webp wx:if="{{ index < 3}}" mode="widthFix" class="img-items" webp src="{{item.url?item.url:item}}?v={{img_version}}"> -->
<image webp wx:if="{{ index < 3}}" mode="widthFix" class="img-items" src="{{item.url?item.url:item}}?v={{img_version}}"> <image webp mode="widthFix" class="img-items" src="{{item.detailImg?item.detailImg:item}}?v={{img_version}}" bindlongpress="handleLongPress" data-item="{{item}}">
<!-- 第一张图的点击拨打电话事件 -->
<block wx:if="{{ index == 0}}"> <block wx:if="{{ index == 0}}">
<!-- && phone --> <view class="phone" bindtap="phoneCall" data-phone="{{proDetail.telphoneNumber}}">
<view class="phone" bindtap="phoneCall" data-phone="{{phone}}"> <image src="{{IMGURL}}share-phone.png?v={{img_version}}" class="icon"></image>
<!-- <image src="{{IMGURL}}share-phone.png?v={{img_version}}" class="icon"></image> --> <glsx-image webp src="index/phone.png" class="icon" />
<!-- <glsx-image webp src="index/phone.png" class="icon" /> 请联系我
请联系我 --> <view style="color:#3666fe">{{proDetail.telphoneNumber}}</view>
<view style="color:#3666fe">{{sharephone}}</view>
</view> </view>
</block> </block>
<!-- 查看活动那个详情 1.3才有 -->
<!-- <block wx:if="{{ index == 1 && actNum == 3 && activeUrl}}"> --> <!-- 如果有活动跳转 -->
<block wx:if="{{ index == 0 && actNum == 3 && activeUrl}}"> <!-- 按钮点击事件 buttonClickEvent:0-无,1-有 -->
<view class="check-act" bindtap="checkActive">点击查看活动页面</view> <block wx:if="{{ item.buttonClickEvent == 1 }}">
<!-- <button class="check-act" type="default" plain="true" bindtap="checkActive">查看活动详情</button> --> <view class="check-act" bindtap="checkActive" data-url="{{item.buttonLinkUrl}}">{{item.buttonName}}</view>
</block> </block>
<!-- 获取更多详情 --> <!-- 获取更多详情 -->
<block wx:if="{{ index == 2 && showLeftFlag}}"> <!-- <block wx:if="{{ index == 2 && showLeftFlag}}">
<button class="more-btn" data-index="{{index}}" bindgetphonenumber="getUserInfo" open-type="getPhoneNumber"> <button class="more-btn" data-index="{{index}}" bindgetphonenumber="getUserInfo" open-type="getPhoneNumber">
点击查看更多详情 点击查看更多详情
</button> </button>
</block> -->
<!-- 如果有视频 -->
<block wx:if="{{ item.detailVideo }}">
<video class="crowd-video" id="crowd-video" bindplay="handleVideoPlay" data-attr="videoCtx" src="{{item.detailVideo}}" />
</block> </block>
</image> </image>
<!-- <image webp wx:if="{{ index >= 3 && !showLeftFlag}}" webp class="img-item {{item.className?item.className:''}} img-item{{index}} img-item{{actNum}}{{index}}" src="{{item.url?item.url:item}}?v={{img_version}}" bindlongpress="handleLongPress" data-actnum="{{actNum}}" data-index="{{index}}" /> -->
<image webp wx:if="{{ index >= 3 && !showLeftFlag}}" mode="widthFix" webp class="img-items {{item.className?item.className:''}}" src="{{item.url?item.url:item}}?v={{img_version}}" bindlongpress="handleLongPress" data-actnum="{{actNum}}" data-index="{{index}}"> <!-- <image webp wx:if="{{ index >= 3 && !showLeftFlag}}" mode="widthFix" webp class="img-items {{item.className?item.className:''}}" src="{{item.detailImg?item.detailImg:item}}?v={{img_version}}" bindlongpress="handleLongPress" data-actnum="{{actNum}}" data-index="{{index}}">
<!-- 众筹-视频 -->
<block wx:if="{{ index == 3 && actNum == 3 }}"> <block wx:if="{{ index == 3 && actNum == 3 }}">
<!-- <video class="crowd-video" src="{{videoBaseUrl}}video/crowd-detail.mp4" /> --> <video class="crowd-video" id="crowd-video" bindplay="handleVideoPlay" data-attr="videoCtx" src="{{detailVideo}}" />
<video class="crowd-video" id="crowd-video" bindplay="handleVideoPlay" data-attr="videoCtx" src="{{videoBaseUrl}}video/crowd-detail.mp4" />
</block> </block>
</image> </image> -->
</block> </block>
<view class="occupancy" wx:if="{{!isShare}}"> <view class="occupancy" wx:if="{{!isShare}}">
<!-- padding底部 占位元素 -->
</view> </view>
</view> </view>
</view>
<!-- 申请按钮 不是分享出去的显示按钮 -->
<!-- <apply-button wx:if="{{!isShare}}" downShow="{{false}}"></apply-button> -->
<!-- 授权昵称 -->
<!-- <view wx:if="{{authNcknameShow}}" class="user-profile" bindtap="getUserProfile"></view> -->
\ No newline at end of file \ No newline at end of file
</view>
\ No newline at end of file \ No newline at end of file
// packagesList/pages/productDetail/productDetail.js // packagesList/pages/productDetail/productDetail.js
import { import { behavior as computedBehavior } from "~/utils/lib/miniprogram-computed";
behavior as computedBehavior import { IMG_URL } from "~/utils/constantData.js";
} from '~/utils/lib/miniprogram-computed' // import {
import { // senceData,
IMG_URL // productData
} from "~/utils/constantData.js"; // } from "~/pages/tab/index/constant/senceData"
import {
senceData,
productData
} from "~/pages/tab/index/constant/senceData"
// import USERAPI from '~/api/usersApi/index' // import USERAPI from '~/api/usersApi/index'
import utils from '~/utils/util' import utils from "~/utils/util";
import {entmicroApi} from "~/api/api" import { entmicroApi, commonApi } from "~/api/api";
import {trackData} from '../../../utils/data' import { trackData } from "../../../utils/data";
Page({ Page({
/** /**
* 页面的初始数据 * 页面的初始数据
*/ */
...@@ -22,8 +17,8 @@ Page({ ...@@ -22,8 +17,8 @@ Page({
behaviors: [computedBehavior], behaviors: [computedBehavior],
data: { data: {
IMG_URL, IMG_URL,
senceData, // senceData,
productData, productData: {},
proInfo: {}, proInfo: {},
isShare: false, //是否是分享出去的 isShare: false, //是否是分享出去的
actNum: -1, actNum: -1,
...@@ -31,39 +26,47 @@ Page({ ...@@ -31,39 +26,47 @@ Page({
tabAct: 0, tabAct: 0,
showLeft: false, //更多按钮显示的内容 showLeft: false, //更多按钮显示的内容
scrollTop: 0, scrollTop: 0,
img_version: '0.1.0', img_version: "0.1.0",
// 是否授权昵称 // 是否授权昵称
hasUserInfo: false, hasUserInfo: false,
prodItemVideo: '', //选中的场景下的video的第一个 prodItemVideo: "", //选中的场景下的video的第一个
activeUrl: '', // 1.3场景才有的活动配置 activeUrl: "", // 1.3场景才有的活动配置
sharephone: '', //主要微信用户,服务商 sharephone: "", //主要微信用户,服务商
cardInfo: {}, cardInfo: {},
hasPhoneNumber: false, // 是否有授权手机号码 hasPhoneNumber: false, // 是否有授权手机号码
pageName: '', pageName: "",
proName: '', proName: "",
trackList: [ trackList: [
[trackData.EQUITYCARD], [trackData.EQUITYCARD],
[trackData.SOLARFILM], [trackData.SOLARFILM],
[trackData.PAINTPROTECT, trackData.CHANGEFILM], [trackData.PAINTPROTECT, trackData.CHANGEFILM],
[trackData.CARBEAUTY, trackData.SEATVENTILATE, trackData.ARNAVIGATION, trackData.LIGHT, trackData.NAVIGATIONARROUND, trackData.LOSSPGASE], [
[trackData.EXPANGOLD] trackData.CARBEAUTY,
trackData.SEATVENTILATE,
trackData.ARNAVIGATION,
trackData.LIGHT,
trackData.NAVIGATIONARROUND,
trackData.LOSSPGASE,
],
[trackData.EXPANGOLD],
],
systemTrackList: [
trackData.SYSUSER,
trackData.SYSNUMBER,
trackData.SYSCAR,
trackData.EXPANGOLD,
], ],
systemTrackList: [trackData.SYSUSER, trackData.SYSNUMBER, trackData.SYSCAR,trackData.EXPANGOLD], isLoadding: true,
isLoadding: true
}, },
// 计算属性 // 计算属性
computed: { computed: {
showLeftFlag(data) { showLeftFlag(data) {
// 1.分享出去 // 1.分享出去
// 2.点击可以改变状态 // 2.点击可以改变状态
return data.isShare && !data.showLeft return data.isShare && !data.showLeft;
}, },
prodItemVideo(data) { prodItemVideo(data) {
let { let { senceData, actNum, activeNavIdx } = data;
senceData,
actNum,
activeNavIdx
} = data
// if(actNum == 2){ // if(actNum == 2){
// return senceData[actNum]?.noVideoPicture[0] // return senceData[actNum]?.noVideoPicture[0]
// } // }
...@@ -71,203 +74,215 @@ Page({ ...@@ -71,203 +74,215 @@ Page({
}, },
// 授权昵称弹框显示 // 授权昵称弹框显示
authNcknameShow(data) { authNcknameShow(data) {
return data.isShare && !data.hasUserInfo return data.isShare && !data.hasUserInfo;
} },
}, },
//接受跳转的路由参数(小程序页面跳转) //接受跳转的路由参数(小程序页面跳转)
onRoute(options) { async onRoute(options) {
if (!options || utils.isEmptyObj(options)) return // if (!options || utils.isEmptyObj(options)) return
let { // let {
actNum = 0, activeNavIdx = 0, phone, hasPhoneNumber, name, proName // actNum = 0, activeNavIdx = 0, phone, hasPhoneNumber, name, proName
} = options // } = options
// this.setData({
// actNum, //选中的场景下标
// activeNavIdx, //选中的产品
// sharephone: phone, //联系电话 (登陆的用户)
// hasPhoneNumber:hasPhoneNumber,
// pageName: name,
// proName
// })
// if (name == '营销增值服务') {
// wx.$Track.sendTrack(this.data.trackList[actNum][activeNavIdx])
// } else if (name == '客户数字化') {
// wx.$Track.sendTrack(this.data.systemTrackList[activeNavIdx])
// }
// setTimeout(() => {
// utils.setNavigationBarTitle(proName)
// this.setData({
// isLoadding: false
// })
// },100)
if (!options || utils.isEmptyObj(options)) return;
let proData = await this.getProductDetail();
console.log(proData, "proData");
let { hasPhoneNumber } = options;
this.setData({ this.setData({
actNum, //选中的场景下标 hasPhoneNumber,
activeNavIdx, //选中的产品 productData: proData,
sharephone: phone, //联系电话 (登陆的用户) });
hasPhoneNumber:hasPhoneNumber,
pageName: name,
proName
})
if (name == '营销增值服务') {
wx.$Track.sendTrack(this.data.trackList[actNum][activeNavIdx])
} else if (name == '客户数字化') {
wx.$Track.sendTrack(this.data.systemTrackList[activeNavIdx])
}
setTimeout(() => { setTimeout(() => {
utils.setNavigationBarTitle(proName) utils.setNavigationBarTitle(proData.proTitle);
this.setData({ this.setData({
isLoadding: false isLoadding: false,
}) });
},100) }, 100);
}, },
// 获取产品详情
getProductDetail() {
return new Promise((resolve) => {
let _data;
commonApi.getProductDetail().then((res) => {
console.log(res);
_data = res.data;
resolve(_data);
});
});
},
onPageScroll: (function () { onPageScroll: (function () {
let timer = null; let timer = null;
return function (e) { return function (e) {
// 监听页面的滚动开始和结束 // 监听页面的滚动开始和结束
clearTimeout(timer); clearTimeout(timer);
timer = setTimeout(() => { timer = setTimeout(() => {
let proDetail = this.selectComponent("#pro-detail") let proDetail = this.selectComponent("#pro-detail");
proDetail.pageSroll(e) proDetail.pageSroll(e);
}, 100); }, 100);
}; };
})(), })(),
//获取配置url //获取配置url
async getActiveApiFn(){ // async getActiveApiFn(){
let {code,data} = await entmicroApi.getActiveApi() // let {code,data} = await entmicroApi.getActiveApi()
if(code == 0){ // if(code == 0){
this.setData({ // this.setData({
activeUrl: data // activeUrl: data
}) // })
} // }
}, // },
// 是否已经查看详情 // 是否已经查看详情
isgetAuthphone(){ isgetAuthphone() {
let authphone = wx.$storage.get("authphone"); let authphone = wx.$storage.get("authphone");
// if(authphone){ // if(authphone){
// // 显示后面的内容 // // 显示后面的内容
// setTimeout(() => { // setTimeout(() => {
// this.getImgHeight() // this.getImgHeight()
// },300) // },300)
// this.setData({ // this.setData({
// showLeft: true // showLeft: true
// }) // })
// //触发浏览埋点 // //触发浏览埋点
// // this.onLoad(null) // // this.onLoad(null)
// } // }
}, },
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { async onLoad(options) {
this.getActiveApiFn() console.log(options, 'options');
// this.getActiveApiFn()
if (options && options.cardId) { if (options && options.cardId) {
wx.$trackData = options wx.$trackData = options;
// wx.$trackData.cardId = options.cardId // wx.$trackData.cardId = options.cardId
wx.$storage.set('scene', options) wx.$storage.set("scene", options);
const {name, actNum, activeNavIdx, proName} = options const { proId } = options;
let proData = await this.getProductDetail();
this.setData({ this.setData({
actNum: options.actNum, productData: proData,
activeNavIdx: options.activeNavIdx, });
pageName: name,
proName
})
getApp() getApp()
.login() .login()
.then(({ data }) => { .then(({ data }) => {
this.setData({
isLoadding: false
})
if (data && data.phone) {
this.setData({ this.setData({
hasPhoneNumber: true isLoadding: false,
}) });
} if (data && data.phone) {
}) this.setData({
this.getCardDetail() hasPhoneNumber: true,
if (name == '营销增值服务') { });
wx.$Track.sendTrack(this.data.trackList[actNum][activeNavIdx]) }
} else if (name == '客户数字化') { });
wx.$Track.sendTrack(this.data.systemTrackList[activeNavIdx]) this.getCardDetail();
} // if (name == "营销增值服务") {
// wx.$Track.sendTrack(this.data.trackList[actNum][activeNavIdx]);
// } else if (name == "客户数字化") {
// wx.$Track.sendTrack(this.data.systemTrackList[activeNavIdx]);
// }
setTimeout(() => { setTimeout(() => {
utils.setNavigationBarTitle(proName) utils.setNavigationBarTitle(proData.proTitle);
},100) }, 100);
} else { } else {
this.getCardDetail() this.getCardDetail();
} }
}, },
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
onReady() { onReady() {},
},
/** /**
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {},
},
/** /**
* 生命周期函数--监听页面隐藏 * 生命周期函数--监听页面隐藏
*/ */
onHide() { onHide() {},
},
/** /**
* 生命周期函数--监听页面卸载 * 生命周期函数--监听页面卸载
*/ */
onUnload() { onUnload() {},
},
/** /**
* 页面相关事件处理函数--监听用户下拉动作 * 页面相关事件处理函数--监听用户下拉动作
*/ */
onPullDownRefresh() { onPullDownRefresh() {},
},
/** /**
* 页面上拉触底事件的处理函数 * 页面上拉触底事件的处理函数
*/ */
onReachBottom() { onReachBottom() {},
},
/** /**
* 用户点击右上角分享 * 用户点击右上角分享
*/ */
onShareAppMessage() { onShareAppMessage() {
const cardId = wx.$storage.get('scene').cardId const cardId = wx.$storage.get("scene").cardId;
// merchantId 兼容旧链接 // merchantId 兼容旧链接
const merchant = wx.$storage.get('scene').merchant || wx.$storage.get('scene').merchantId const merchant =
const shareType = 'SHARE_PRO' wx.$storage.get("scene").merchant || wx.$storage.get("scene").merchantId;
const {actNum, activeNavIdx, pageName, proName} = this.data const shareType = "SHARE_PRO";
// const {actNum, activeNavIdx, pageName, proName} = this.data
const { proId } = this.data.productData;
return { return {
title: `给你分享一个活动,戳我参与~`, title: `给你分享一个活动,戳我参与~`,
path: `packagesList/pages/productDetail/productDetail?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}&actNum=${actNum}&activeNavIdx=${activeNavIdx}&name=${pageName}&proName=${proName}` // path: `packagesList/pages/productDetail/productDetail?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}&actNum=${actNum}&activeNavIdx=${activeNavIdx}&name=${pageName}&proName=${proName}`
} path: `packagesList/pages/productDetail/productDetail?cardId=${cardId}&merchant=${merchant}&shareType=${shareType}&proId=${proId}`,
};
}, },
// 更新手机号码 // 更新手机号码
updatePhoneNumber(e) { updatePhoneNumber(e) {
this.setData({ this.setData({
hasPhoneNumber: e.detail ? true : false hasPhoneNumber: e.detail ? true : false,
}) });
}, },
// 获取员工名片信息 // 获取员工名片信息
getCardDetail() { getCardDetail() {
const scene = wx.$storage.get('scene') const scene = wx.$storage.get("scene");
let params = { let params = {
cardId: scene.cardId cardId: scene.cardId,
} };
entmicroApi.getCardDetail(params).then(({ data, code, message }) => { entmicroApi.getCardDetail(params).then(({ data, code, message }) => {
if (code == -1) { if (code == -1) {
wx.showToast({ wx.showToast({
title: message, title: message,
icon: 'none', icon: "none",
duration: 2000 duration: 2000,
}) });
} }
const cardInfo = data || this.data.defaultInfo
this.setData(
{
cardInfo
}
)
})
}
})
\ No newline at end of file \ No newline at end of file
const cardInfo = data || this.data.defaultInfo;
this.setData({
cardInfo,
});
});
},
});
<!--packagesList/pages/productDetail/productDetail.wxml--> <!--packagesList/pages/productDetail/productDetail.wxml-->
<loadding wx:if="{{isLoadding}}"></loadding> <loadding wx:if="{{isLoadding}}"></loadding>
<view wx:if="{{!isLoadding}}"> <view wx:if="{{!isLoadding}}">
<pro-detail id="pro-detail" custom-class="{{!hasPhoneNumber?'max_page_height':''}}" activeUrl="{{activeUrl}}" actNum="{{actNum}}" cardInfo="{{cardInfo}}" activeNavIdx="{{activeNavIdx}}" currentIndex="{{currentIndex}}"></pro-detail> <!-- <pro-detail id="pro-detail" custom-class="{{!hasPhoneNumber?'max_page_height':''}}" activeUrl="{{activeUrl}}" actNum="{{actNum}}" cardInfo="{{cardInfo}}" activeNavIdx="{{activeNavIdx}}" currentIndex="{{currentIndex}}"></pro-detail> -->
<pro-detail id="pro-detail" custom-class="{{!hasPhoneNumber?'max_page_height':''}}" cardInfo="{{cardInfo}}" proDetail="{{productData}}"></pro-detail>
<pro-phone-number custom-class="pro_phone_number" type="product" hasPhoneNumber="{{hasPhoneNumber}}" bind:updatePhoneNumber="updatePhoneNumber"></pro-phone-number> <pro-phone-number custom-class="pro_phone_number" type="product" hasPhoneNumber="{{hasPhoneNumber}}" bind:updatePhoneNumber="updatePhoneNumber"></pro-phone-number>
</view> </view>
\ No newline at end of file \ No newline at end of file
// packagesList/pages/videoDetal/videoDetal.js // packagesList/pages/videoDetal/videoDetal.js
import {trackData} from '../../../utils/data' import {trackData} from '../../../utils/data'
import {productData} from '../../../pages/tab/index/constant/senceData' // import {productData} from '../../../pages/tab/index/constant/senceData'
import {subscriptionSystemData} from '../../../pages/tab/index/constant/systemData' // import {subscriptionSystemData} from '../../../pages/tab/index/constant/systemData'
import utils from '~/utils/util' import utils from '~/utils/util'
Page({ Page({
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!