Commit 39c202e2 by 张立顺

订阅模块 页面显示开发完成

1 parent bc9c2442
// packagesList/pages/productDetail/components/proDetail/proDetail.js
import { senceData, productData } from "~/pages/tab/index/constant/senceData"
import { senceData, productData } from '~/pages/tab/index/constant/senceData'
const norTabList = ['项目亮点', '合作案例', '合作方式', '适配产品']
Component({
externalClasses: ['custom-class'],
/**
......@@ -36,7 +37,8 @@ Component({
prodItemVideo: '', //选中的场景下的video的第一个
tabAct: 0,
scrollTop: 0,
showCard: false
showCard: false,
tabList: []
},
/**
......@@ -47,16 +49,21 @@ Component({
let { activeNavIdx, actNum } = this.data
//console.log(actNum)
//console.log(activeNavIdx)
const spcList = [99] // 订阅模块需要特殊处理
console.log(productData, 'productData')
const senceList = productData[actNum].filter(item => item.name != '全部')
console.log(senceList)
for (let i = 0; i < senceList.length; i++) {
let item = senceList[i]
let proIdList = item?.productList.map(k => k.id)
if (proIdList.includes(activeNavIdx)) {
//console.log(item, 'item----')
//console.log(item.productList.find(k => k.id == activeNavIdx))
let proInfo = item.productList.find(k => k.id == activeNavIdx)
this.setData({
proInfo: item.productList.find(k => k.id == activeNavIdx),
productImgs: item.productImgs,
proInfo,
productImgs: spcList.includes(actNum) ? proInfo.sceneImgs : item.productImgs,
tabList: spcList.includes(actNum) ? proInfo.tabList : norTabList,
prodItemVideo: item.videoList.length ? item.videoList[activeNavIdx] : item.noVideoPicture[0]
})
//console.log(this.data.prodItemVideo, 'prodItemVideo--------')
......@@ -65,44 +72,43 @@ Component({
}
},
getImgHeight() {
let query = wx.createSelectorQuery().in(this);
let heightArr = [];
let imgTopArr = [];
let s = 0;
let top;
let query = wx.createSelectorQuery().in(this)
let heightArr = []
let imgTopArr = []
let s = 0
let top
let { scrollTop } = this.data
let _this = this;
let _this = this
query
.selectAll(".img-item")
.boundingClientRect((react) => {
.selectAll('.img-item')
.boundingClientRect(react => {
react.forEach((item, index) => {
//44 tab的高度
// console.log('item',item)
s = item.top - 44 + scrollTop;
imgTopArr.push(s);
});
s = item.top - 44 + scrollTop
imgTopArr.push(s)
})
_this.setData({
imgTopArr,
});
imgTopArr
})
})
.exec();
.exec()
// setTimeout(() => {
// console.log('imgTopArr',this.data.imgTopArr)
// },500)
},
onClickTab(event) {
// console.log('event: ', event);
let { index } = event.detail;
let { index } = event.detail
// console.log('index: ', index);
this.setData({
tabAct: index,
});
tabAct: index
})
let { imgTopArr } = this.data
wx.pageScrollTo({
scrollTop: imgTopArr[index] + 5
});
})
},
pageSroll(e) {
let { imgTopArr } = this.data
......@@ -111,15 +117,15 @@ Component({
if (imgTopArr[0] > e.scrollTop) {
idx = 0
} else if (imgTopArr[imgTopArr.length - 1] > e.scrollTop && imgTopArr[0] < e.scrollTop) {
idx = imgTopArr.findIndex((item) => item > e.scrollTop) - 1
idx = imgTopArr.findIndex(item => item > e.scrollTop) - 1
} else {
idx = imgTopArr.length - 1
}
this.setData({
tabAct: idx,
scrollTop: e.scrollTop
});
});
})
})
},
selectCard() {
//console.log(this.data.showCard)
......
......@@ -2,6 +2,7 @@
page {
background-color: #fff;
}
.view-prod {
.frame {
margin: 16rpx 32rpx;
......@@ -10,6 +11,7 @@ page {
border-radius: 16rpx;
box-sizing: border-box;
}
.title-wrap {
margin-bottom: 32rpx;
margin-left: 32rpx;
......@@ -17,6 +19,7 @@ page {
display: flex;
height: 104rpx;
align-items: center;
.title {
width: 564rpx;
height: 48rpx;
......@@ -25,55 +28,65 @@ page {
color: #323436;
// line-height: 48rpx;
}
.check {
margin-left: 30rpx;
margin-right: 6rpx;
width: 28rpx;
height: 28rpx;
}
.num {
font-size: 24rpx;
color: #5a6066;
}
}
.no-video{
.no-video {
margin: 16rpx auto 32rpx;
display: block;
width: 686rpx;
height: 386rpx;
border-radius: 16rpx;
}
.tab-wrap {
position: sticky;
top: 0;
margin-bottom: 20rpx;
z-index: 1;
.tabs-index--van-tabs{
top:-1px
.tabs-index--van-tabs {
top: -1px
}
.van-tab {
font-size: 28rpx;
color: #5a6066;
}
.van-tab--active {
font-weight: 600;
font-size: 28rpx;
color: #3666fe;
}frame
.van-tabs__line {
}
frame .van-tabs__line {
width: 112rpx !important;
height: 4rpx !important;
}
}
.prod-detail {
.occupancy{
.occupancy {
height: 120rpx;
}
.img-item{
.img-item {
position: relative;
}
.phone {
position: absolute;
top: 60rpx;
......@@ -83,20 +96,23 @@ page {
color: #6C6C6C;
display: flex;
align-items: center;
.icon {
width: 40rpx;
height: 40rpx;
margin-right: 6rpx;
}
}
.check-act{
.check-act {
position: absolute;
bottom: 94rpx;
right: 60rpx;
font-size: 24rpx;
color: #3666FE;
text-decoration:underline;
text-decoration: underline;
}
.more-btn {
position: absolute;
left: 50%;
......@@ -193,6 +209,7 @@ page {
width: 100%;
height: 864rpx;
}
// // 流程图四
.img-item30 {
width: 100%;
......@@ -209,12 +226,58 @@ page {
height: 490rpx;
}
.img-item33 {
.img-item46 {
width: 100%;
height: 1684rpx;
}
.img-item47 {
width: 100%;
height: 3688rpx;
}
// .img-item48 {
// width: 100%;
// height: 4004rpx;
// }
.img-item48 {
width: 100%;
height: 2002rpx;
height: 472rpx;
}
.img-item49 {
width: 100%;
height: 4594rpx;
}
.img-item50 {
width: 100%;
height: 1650rpx;
}
.img-item51 {
width: 100%;
height: 552rpx;
}
.img-item52 {
width: 100%;
height: 3534rpx;
}
.img-item53 {
width: 100%;
height: 1130rpx;
}
.img-item54 {
width: 100%;
height: 428rpx;
}
}
}
/* 用户授权 */
.user-profile {
position: fixed;
......@@ -228,6 +291,7 @@ page {
.pro-head {
position: relative;
.select-card {
position: absolute;
right: 0;
......@@ -235,7 +299,7 @@ page {
width: 142rpx;
height: 68rpx;
background: #FFFFFF;
box-shadow: 0 6rpx 16rpx 0 rgba(175,175,219,0.65);
box-shadow: 0 6rpx 16rpx 0 rgba(175, 175, 219, 0.65);
border-radius: 34rpx 0 0 34rpx;
z-index: 2;
display: flex;
......@@ -245,10 +309,11 @@ page {
font-weight: 600;
font-size: 26rpx;
color: #57578A;
.icon-card {
width: 48rpx;
height: 48rpx;
margin-right: 8rpx;
}
}
}
}
\ No newline at end of file
<!--packagesList/pages/productDetail/components/proDetail/proDetail.wxml-->
<!-- packagesList/pages/productDetail/components/proDetail/proDetail.wxml -->
<view class="view-prod custom-class">
<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>
<view class="select-card" bindtap="selectCard">
<glsx-image custom-class="icon-card" src="home/icon-card.png" />
<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}}" />
<image class="no-video" wx:if="{{actNum == 2}}" src="{{prodItemVideo.posterUrl}}?v={{img_version}}" />
<view class="title-wrap">
<view class="title">{{prodItemVideo.name}}</view>
......@@ -16,38 +16,33 @@
<view class="num" wx:if="{{actNum != 2}}">{{prodItemVideo.view}}</view>
</view>
</block>
<!-- 无视频 -->
<user-info wx:if="{{showCard}}" class="card-info" cardInfo="{{cardInfo}}"></user-info>
<user-info wx:if="{{showCard}}" class="card-info" cardInfo="{{cardInfo}}" />
</view>
<!-- <image class="no-video" wx:if="{{actNum == 2}}" src="{{IMG_URL}}index/poster/no-video.png?v={{img_version}}" /> -->
<view class="tab-wrap">
<van-tabs sticky bind:click="onClickTab" active="{{tabAct}}">
<van-tab title="项目亮点"></van-tab>
<van-tab title="合作案例"></van-tab>
<van-tab title="合作方式"></van-tab>
<van-tab title="适配产品"></van-tab>
<van-tab wx:for="{{tabList}}" title="{{item}}" wx:key="idnex" />
<!-- <van-tab title="合作案例" />
<van-tab title="合作方式" />
<van-tab title="适配产品" /> -->
</van-tabs>
</view>
<view class="prod-detail">
<block wx:for="{{productImgs}}" wx:key="index">
<image wx:if="{{ index < 3}}" webp class="img-item img-item{{index}} img-item{{actNum}}{{index}}" src="{{item}}?v={{img_version}}">
<image webp wx:if="{{ index < 3}}" webp class="img-item {{item.className?item.className:''}} img-item{{index}} img-item{{actNum}}{{index}}" src="{{item.url?item.url:item}}?v={{img_version}}">
<block wx:if="{{ index == 0}}">
<!-- && 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" />
请联系我
<view style="color:#3666fe">
{{sharephone}}
</view>
<view style="color:#3666fe">{{sharephone}}</view>
</view>
</block>
<!-- 查看活动那个详情 1.3才有 -->
<block wx:if="{{ index == 1 && actNum == 3 && activeUrl}}">
<view class="check-act" bindtap="checkActive">
点击查看活动页面
</view>
<view class="check-act" bindtap="checkActive">点击查看活动页面</view>
<!-- <button class="check-act" type="default" plain="true" bindtap="checkActive">查看活动详情</button> -->
</block>
<!-- 获取更多详情 -->
......@@ -57,8 +52,7 @@
</button>
</block>
</image>
<image wx:if="{{ index >= 3 && !showLeftFlag}}" webp class="img-item img-item{{index}} img-item{{actNum}}{{index}}" src="{{item}}?v={{img_version}}">
</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}}" />
</block>
<view class="occupancy" wx:if="{{!isShare}}">
<!-- padding底部 占位元素 -->
......@@ -68,4 +62,4 @@
<!-- 申请按钮 不是分享出去的显示按钮 -->
<!-- <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
......@@ -5,7 +5,8 @@ const subscriptionBannerUrl = IMG_URL2 + 'banner/banner4.webp'
const productImgs0 = [`${IMG_URL}index/productImgs/product00.webp`, `${IMG_URL}index/productImgs/product01.webp`, `${IMG_URL}index/productImgs/product02.webp`, `${IMG_URL}index/productImgs/product03.webp`]
// 车损升级
const sceneImgs5 = [`${IMG_URL}index/scene/scene00.png`, `${IMG_URL}index/scene/scene01.png`, `${IMG_URL}index/scene/scene02.png`, `${IMG_URL}index/scene/scene03.png`]
const tabList = ['项目亮点', '合作案例', '合作方式']
const sceneImgs5 = [`${IMG_URL}index/productImgs/scene00.png`, `${IMG_URL}index/productImgs/scene01.png`, `${IMG_URL}index/productImgs/scene02.png`, `${IMG_URL}index/productImgs/scene03.png`]
const videoList0 = [
{
videoUrl: `${IMG_URL2}video/digital_card_30s.mp4`,
......@@ -36,29 +37,11 @@ const videoList0 = [
// view: 1485
// }
]
// const posterList0 = [
// {
// src: `${IMG_URL}index/poster/poster3-0.webp`,
// name: '劲爆来袭'
// },
// {
// src: `${IMG_URL}index/poster/poster3-1.webp`,
// name: '疯狂让利'
// },
// {
// src: `${IMG_URL}index/poster/poster3-2.webp`,
// name: '娱乐系统'
// },
// {
// src: `${IMG_URL}index/poster/poster3-3.webp`,
// name: 'AR实景导航'
// }
// ]
const subscriptionSystemData = [
{
name: '客户沉淀',
//场景详情图片
sceneImgs: sceneImgs5,
// sceneImgs: sceneImgs5,
// 产品详情图片
productImgs: productImgs0,
productList: [
......@@ -77,10 +60,25 @@ const subscriptionSystemData = [
productCode: 'PC011',
productName: '私域用户活跃代运营',
category: '代运营',
prodImg: `${IMG_URL2}/prod2/prod4-0.webp`
prodImg: `${IMG_URL2}/prod2/prod4-0.webp`,
sceneImgs: [
{
url: `${IMG_URL}index/productImgs/product46.webp`,
className: 'img-item46'
},
{
url: `${IMG_URL}index/productImgs/product47.webp`,
className: 'img-item47'
},
{
url: `${IMG_URL}index/productImgs/product48.webp`,
className: 'img-item48'
}
],
tabList
},
{
id: 0,
id: 1,
img: 'product-img1',
proName: '定保/续保数字化招揽',
price: '100',
......@@ -94,7 +92,22 @@ const subscriptionSystemData = [
productCode: 'PC012',
productName: '定保/续保数字化招揽',
category: '招揽',
prodImg: `${IMG_URL}index/prod2/prod4-1.webp`
prodImg: `${IMG_URL}index/prod2/prod4-1.webp`,
sceneImgs: [
{
url: `${IMG_URL}index/productImgs/product49.webp`,
className: 'img-item49'
},
{
url: `${IMG_URL}index/productImgs/product50.webp`,
className: 'img-item50'
},
{
url: `${IMG_URL}index/productImgs/product51.webp`,
className: 'img-item51'
}
],
tabList
}
],
videoList: videoList0
......@@ -108,7 +121,7 @@ const subscriptionSystemData = [
productImgs: productImgs0,
productList: [
{
id: 0,
id: 2,
img: 'product-img1',
proName: '事故车救援服务',
price: '100',
......@@ -122,7 +135,22 @@ const subscriptionSystemData = [
productCode: 'PC001',
productName: '事故车救援服务',
category: '救援',
prodImg: `${IMG_URL}index/prod2/prod4-2.webp`
prodImg: `${IMG_URL}index/prod2/prod4-2.webp`,
sceneImgs: [
{
url: `${IMG_URL}index/productImgs/product52.webp`,
className: 'img-item52'
},
{
url: `${IMG_URL}index/productImgs/product53.webp`,
className: 'img-item53'
},
{
url: `${IMG_URL}index/productImgs/product54.webp`,
className: 'img-item54'
}
],
tabList
}
],
videoList: videoList0
......
......@@ -129,7 +129,7 @@ Page({
const { cardInfo } = this.data
let obj = {
// || 99
actNum: detail.scenIndex, //选中的场景 没有就是订阅系统的
actNum: isNaN(detail.scenIndex) ? 99 : detail.scenIndex, //选中的场景 没有就是订阅系统的
activeNavIdx: detail.id, //选中的产品,
cardInfo,
hasPhoneNumber: this.data.hasPhoneNumber
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!