Commit 6af28b82 by chenwq

详情

1 parent bc9c2442
...@@ -20,9 +20,19 @@ Component({ ...@@ -20,9 +20,19 @@ Component({
type: Number, type: Number,
value: 0 value: 0
}, },
// tab
tabList: {
type: Array,
value: [{ title: '项目亮点' }, { title: '合作案例' }, { title: '合作方式' }, { title: '适配产品' }]
},
cardInfo: { cardInfo: {
type: Object, type: Object,
value: {} value: {}
},
// 配置url
activeUrl: {
type: String,
value: ''
} }
}, },
...@@ -35,8 +45,7 @@ Component({ ...@@ -35,8 +45,7 @@ Component({
proInfo: {}, proInfo: {},
prodItemVideo: '', //选中的场景下的video的第一个 prodItemVideo: '', //选中的场景下的video的第一个
tabAct: 0, tabAct: 0,
scrollTop: 0, scrollTop: 0
showCard: false
}, },
/** /**
...@@ -52,14 +61,14 @@ Component({ ...@@ -52,14 +61,14 @@ Component({
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)) {
//console.log(item, 'item----') // console.log(item, 'item----')
//console.log(item.productList.find(k => k.id == activeNavIdx)) // console.log(item.productList.find(k => k.id == activeNavIdx))
this.setData({ this.setData({
proInfo: item.productList.find(k => k.id == activeNavIdx), proInfo: item.productList.find(k => k.id == activeNavIdx),
productImgs: item.productImgs, productImgs: item.productImgs,
prodItemVideo: item.videoList.length ? item.videoList[activeNavIdx] : item.noVideoPicture[0] prodItemVideo: item.videoList.length ? item.videoList[activeNavIdx] : item.noVideoPicture[0]
}) })
//console.log(this.data.prodItemVideo, 'prodItemVideo--------') // console.log(this.data.prodItemVideo, 'prodItemVideo--------')
break break
} }
} }
...@@ -78,7 +87,6 @@ Component({ ...@@ -78,7 +87,6 @@ Component({
.boundingClientRect((react) => { .boundingClientRect((react) => {
react.forEach((item, index) => { react.forEach((item, index) => {
//44 tab的高度 //44 tab的高度
// console.log('item',item)
s = item.top - 44 + scrollTop; s = item.top - 44 + scrollTop;
imgTopArr.push(s); imgTopArr.push(s);
}); });
...@@ -93,9 +101,7 @@ Component({ ...@@ -93,9 +101,7 @@ Component({
}, },
onClickTab(event) { onClickTab(event) {
// console.log('event: ', event);
let { index } = event.detail; let { index } = event.detail;
// console.log('index: ', index);
this.setData({ this.setData({
tabAct: index, tabAct: index,
}); });
...@@ -120,12 +126,6 @@ Component({ ...@@ -120,12 +126,6 @@ Component({
scrollTop: e.scrollTop scrollTop: e.scrollTop
}); });
}); });
},
selectCard() {
//console.log(this.data.showCard)
this.setData({
showCard: !this.data.showCard
})
} }
} }
}) })
<!--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" bindtap="selectCard">
<glsx-image custom-class="icon-card" src="home/icon-card.png"></glsx-image>
<view>{{showCard ? '视频' : '名片'}}</view>
</view>
<!-- 有视频 --> <!-- 有视频 -->
<block wx:if="{{!showCard}}"> <video class="frame" wx:if="{{actNum != 2}}" src="{{prodItemVideo.videoUrl}}"></video>
<video class="frame" wx:if="{{actNum != 2}}" src="{{prodItemVideo.videoUrl}}"></video> <image class="no-video" wx:if="{{actNum == 2}}" src="{{prodItemVideo.posterUrl}}?v={{img_version}}" />
<image class="no-video" wx:if="{{actNum == 2}}" src="{{prodItemVideo.posterUrl}}?v={{img_version}}" /> <view class="title-wrap">
<view class="title-wrap"> <view class="title">{{prodItemVideo.name}}</view>
<view class="title">{{prodItemVideo.name}}</view> <image class="check" wx:if="{{actNum != 2}}" src="{{IMG_URL}}index/poster/check.png?v={{img_version}}" />
<!-- <glsx-image class="check" src="index/poster/check.png" /> --> <view class="num" wx:if="{{actNum != 2}}">{{prodItemVideo.view}}</view>
<image class="check" wx:if="{{actNum != 2}}" src="{{IMG_URL}}index/poster/check.png?v={{img_version}}" /> </view>
<view class="num" wx:if="{{actNum != 2}}">{{prodItemVideo.view}}</view>
</view>
</block>
<!-- 无视频 -->
<user-info wx:if="{{showCard}}" class="card-info" cardInfo="{{cardInfo}}"></user-info>
</view> </view>
<!-- <image class="no-video" wx:if="{{actNum == 2}}" src="{{IMG_URL}}index/poster/no-video.png?v={{img_version}}" /> -->
<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 title="项目亮点"></van-tab> <van-tab wx:for="{{tabList}}" wx:key="index" title="{{item.title}}"></van-tab>
<van-tab title="合作案例"></van-tab>
<van-tab title="合作方式"></van-tab>
<van-tab title="适配产品"></van-tab>
</van-tabs> </van-tabs>
</view> </view>
<view class="prod-detail"> <view class="prod-detail">
...@@ -35,7 +22,6 @@ ...@@ -35,7 +22,6 @@
<block wx:if="{{ index == 0}}"> <block wx:if="{{ index == 0}}">
<!-- && phone --> <!-- && phone -->
<view class="phone" bindtap="phoneCall" data-phone="{{phone}}"> <view class="phone" bindtap="phoneCall" data-phone="{{phone}}">
<!-- <image src="{{IMGURL}}share-phone.png?v={{img_version}}" class="icon"></image> -->
<glsx-image webp src="index/phone.png" class="icon"></glsx-image> <glsx-image webp src="index/phone.png" class="icon"></glsx-image>
请联系我 请联系我
<view style="color:#3666fe"> <view style="color:#3666fe">
...@@ -48,7 +34,6 @@ ...@@ -48,7 +34,6 @@
<view class="check-act" bindtap="checkActive"> <view class="check-act" bindtap="checkActive">
点击查看活动页面 点击查看活动页面
</view> </view>
<!-- <button class="check-act" type="default" plain="true" bindtap="checkActive">查看活动详情</button> -->
</block> </block>
<!-- 获取更多详情 --> <!-- 获取更多详情 -->
<block wx:if="{{ index == 2 && showLeftFlag}}"> <block wx:if="{{ index == 2 && showLeftFlag}}">
...@@ -68,4 +53,4 @@ ...@@ -68,4 +53,4 @@
<!-- 申请按钮 不是分享出去的显示按钮 --> <!-- 申请按钮 不是分享出去的显示按钮 -->
<!-- <apply-button wx:if="{{!isShare}}" downShow="{{false}}"></apply-button> --> <!-- <apply-button wx:if="{{!isShare}}" downShow="{{false}}"></apply-button> -->
<!-- 授权昵称 --> <!-- 授权昵称 -->
<!-- <view wx:if="{{authNcknameShow}}" class="user-profile" bindtap="getUserProfile"></view> --> <!-- <view wx:if="{{authNcknameShow}}" class="user-profile" bindtap="getUserProfile"></view> -->
\ No newline at end of file \ No newline at end of file
...@@ -138,12 +138,81 @@ Page({ ...@@ -138,12 +138,81 @@ Page({
}; };
})(), })(),
//获取配置url
async getActiveApiFn(){
let {code,data} = await getActiveApi()
if(code == 0){
this.setData({
activeUrl: data
})
}
},
// 是否已经查看详情
isgetAuthphone(){
let authphone = wx.$storage.get("authphone");
if(authphone){
// 显示后面的内容
setTimeout(() => {
this.getImgHeight()
},300)
this.setData({
showLeft: true
})
//触发浏览埋点
// this.onLoad(null)
}
},
/** /**
* 生命周期函数--监听页面加载 * 生命周期函数--监听页面加载
*/ */
onLoad(options) { onLoad(options) {
this.getActiveApiFn()
// 是否已经查看详情
this.isgetAuthphone()
if (!options || utils.isEmptyObj(options)) return
let { actNum, activeNavIdx, isShare,sharephone } = options
if(isShare){
wx.hideHomeButton()
}
this.setData({
actNum,
activeNavIdx,
isShare,
sharephone
});
//分享数据
let senceItem = senceData[actNum]
let item = senceData[actNum]?.productList[activeNavIdx]
console.log('title',item.productName)
setTimeout(() => {
// wx.setNavigationBarTitle({
// title: " "+item.productName,
// });
utils.setNavigationBarTitle(item.productName)
},100)
let wx_user_info = wx.$storage.get('wx_user_info'),
shareOpenId = wx_user_info.openId || ''
// console.log('shareOpenId: ', shareOpenId);
// &shareOpenId=${shareOpenId}
this.shareQuery = `sceneCode=${senceItem?.sceneCode}&productCode=${item?.productCode}&isShare=${true}&productDesc=${item?.productName}&category=${item?.category}&actNum=${actNum}&activeNavIdx=${activeNavIdx}&sharephone=${sharephone}`
this.shareTrackData = {
sceneCode: senceItem?.sceneCode,
productCode: item?.productCode,
productName: item?.productName,
category: item?.category,
productDesc: item?.productName,
shareOpenId:shareOpenId
// actNum,
// activeNavIdx,
}
}, },
/** /**
......
<!--packagesList/pages/productDetail/productDetail.wxml--> <!--packagesList/pages/productDetail/productDetail.wxml-->
<pro-detail id="pro-detail" custom-class="{{!hasPhoneNumber?'max_page_height':''}}" actNum="{{actNum}}" cardInfo="{{cardInfo}}" activeNavIdx="{{activeNavIdx}}"></pro-detail> <pro-detail id="pro-detail" custom-class="{{!hasPhoneNumber?'max_page_height':''}}" activeUrl="{{activeUrl}}" actNum="{{actNum}}" cardInfo="{{cardInfo}}" activeNavIdx="{{activeNavIdx}}"></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>
\ No newline at end of file \ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!