Commit fc6b9da2 by zhangquan

场景内容页

1 parent 3ceef9bc
// pages/tab/discovery/components/headerNav/headerNav.js
const navStyle = "background-color: transparent;";
import {imgUrlMixin} from '~/mixins/index'
Component({
behaviors: [imgUrlMixin],
/**
* 组件的属性列表
*/
properties: {
btnHeight: Number
},
/**
* 组件的初始数据
*/
data: {
navStyle,
// IMG_URL,
sceneList:['scene_talk.png','scene_delivery.png','scene_within_12mth.png','scene_more_12mth.png'],
},
navbarReady(e) {
let {
height
} = e.detail;
console.log(height,'heightheightheight')
this.setData({
btnHeight: `${height + 128}px`,
});
},
/**
* 组件的方法列表
*/
methods: {
}
})
{
"component": true,
"usingComponents": {}
}
\ No newline at end of file
/* pages/tab/discovery/components/headerNav/headerNav.wxss */
.header{
position: relative;
width: 100%;
margin-bottom: 80rpx;
box-shadow: 0 16rpx 16rpx 0 rgba(230, 236, 245, 0.6);
}
.scene-wrap{
position: absolute;
bottom: 0;
transform: translateY(75rpx);
white-space: nowrap;
}
.scene-item{
width: 672rpx;
height: 180rpx;
}
\ No newline at end of file
<!--pages/tab/discovery/components/headerNav/headerNav.wxml-->
<view style="height: {{btnHeight}}" class="header">
<image style="width: 100%;height: 100%" src="{{IMGURL}}discovery_center_bg.png"></image>
<scroll-view class="scene-wrap" scroll-x="{{true}}">
<block wx:for="{{sceneList}}" wx:key="index">
<image class="scene-item" src="{{IMGURL}}{{item}}"></image>
</block>
</scroll-view>
</view>
......@@ -14,12 +14,13 @@ Component({
*/
data: {
sceneList:['scene_talk.png','scene_delivery.png','scene_within_12mth.png','scene_more_12mth.png'],
navList:['360全景导航','AR实景导航','座椅通风','氛围灯','数字化美容'],
activeNavIdx: 0,
tab:['适用场景','营销链路','项目亮点','适用场景','转化漏斗','合作流程','适用场景','营销链路','项目亮点','适用场景','转化漏斗','合作流程'],
navList:['数字无忧权益卡'],
activeNavIdx: 0, //特色产品
tab:['适用场景','营销链路','项目亮点','转化漏斗','合作流程'],
heightArr:[],
curTabIdx:0,
intoViewId: 'to-0'
curTabIdx:0, //适用产品
intoViewId: 'to-0',
actNum: 0 //场景
},
lifetimes:{
ready: function (){
......@@ -32,6 +33,38 @@ Component({
* 组件的方法列表
*/
methods: {
changeSwiper(e){
console.log(e)
let actNum = e.detail.current
let navList = []
switch (actNum) {
case 0:
navList = ["数字无忧权益卡"];
break;
case 1:
navList = ["汽车太阳膜"];
break;
case 2:
navList = ["漆面保护膜", "改色膜"];
break;
case 3:
navList = [
"数字化美容",
"座椅通风",
"AR导航",
"氛围灯",
"360全景导航",
];
break;
}
this.setData({
navList,
actNum,
intoViewId: `to-0`,
activeNavIdx: 0
})
this.getImgHeight();
},
changeTab(e){
let idx = e.detail
this.setData({
......@@ -39,7 +72,6 @@ Component({
})
},
changeNav(event){
console.log(event,event.target.dataset.index,111)
this.setData({
activeNavIdx: event.target.dataset.index
})
......@@ -64,6 +96,23 @@ Component({
console.log( this.data.heightArr)
}).exec()
},
getImgHeight() {
let query = wx.createSelectorQuery().in(this);
let heightArr = [];
let s = 0;
query
.selectAll(".img-item")
.boundingClientRect((react) => {
react.forEach((item) => {
s += item.height;
heightArr.push(s);
});
this.data.heightArr = heightArr;
// console.log(heightArr[heightArr.length-1])
this.data.allHeight = heightArr[heightArr.length - 1];
})
.exec();
},
// 显示测算弹窗
showCalculate() {
this.setData({
......
.scene-wrap{
.scene-wrap {
white-space: nowrap;
height: 180rpx;
margin-bottom: 16rpx;
.scene-img{
.scene-img {
width: 100%;
}
}
// 特色产品
.prod-wrap .big-title{
.prod-wrap .big-title {
margin-left: 40rpx;
font-family: PingFangSC-S0pxibold;
font-weight: 600;
......@@ -15,14 +17,16 @@
color: #1B233D;
line-height: 56rpx;
}
.prod-wrap .nav-wrap{
.prod-wrap .nav-wrap {
white-space: nowrap;
box-sizing: border-box;
margin-top: 24rpx;
margin-bottom: 32rpx;
padding: 0 20rpx;
}
.prod-wrap .nav-wrap .nav{
.prod-wrap .nav-wrap .nav {
display: inline-block;
width: 188rpx;
height: 64rpx;
......@@ -37,41 +41,44 @@
background: #FFFFFF;
border: 2rpx solid #DDE3F0;
}
.prod-wrap .nav-wrap .active-nav{
.prod-wrap .nav-wrap .active-nav {
background-image: linear-gradient(0deg, #EBEFFF 8%, #FCFDFF 85%);
border: 2rpx solid rgba(68,97,240,0.50);
box-shadow: 0 8rpx 16rpx 0 rgba(175,187,219,0.35);
border: 2rpx solid rgba(68, 97, 240, 0.50);
box-shadow: 0 8rpx 16rpx 0 rgba(175, 187, 219, 0.35);
color: #4466F0;
}
.prod-wrap .nav-wrap .nav:last-child{
.prod-wrap .nav-wrap .nav:last-child {
margin-right: 0;
}
.prod-item{
.prod-item {
background-color: #F5F7FB;
border-radius: 48rpx 48rpx 0 0;
padding: 40rpx 24rpx 32rpx;
}
.prod-card{
.prod-card {
display: flex;
height: 208rpx;
background-image: linear-gradient(1deg, #FFFFFF 10%, #FDFCFF 100%);
border: 2rpx solid #FFFFFF;
box-shadow: 0 8rpx 20rpx 0 rgba(197,205,235,0.35);
box-shadow: 0 8rpx 20rpx 0 rgba(197, 205, 235, 0.35);
border-radius: 20rpx;
padding: 20rpx 24rpx;
box-sizing: border-box;
position: relative;
}
.prod-card .card-img{
.prod-card .card-img {
width: 160rpx;
height: 160rpx;
flex-shrink: 0;
border-radius: 4rpx;
}
.img-desc{
.img-desc {
position: absolute;
width: 104rpx;
height: 40rpx;
......@@ -85,40 +92,48 @@
letter-spacing: 0;
text-align: center;
}
.prod-info{
.prod-info {
display: flex;
flex-direction: column;
justify-content: space-between;
padding: 12rpx 0;
margin-left: 24rpx;
}
.prod-info>text{
.prod-info>text {
display: block;
white-space: nowrap;
height: 40rpx;
line-height: 40rpx;
}
.prod-info .title{
.prod-info .title {
font-family: PingFangSC-Medium;
font-weight: 500;
font-size: 28rpx;
color: #323436;
}
.prod-info .sale,.prod-info .earnings{
.prod-info .sale,
.prod-info .earnings {
font-size: 26rpx;
color: #7A8299;
}
.prod-info .sale-num{
.prod-info .sale-num {
font-size: 26rpx;
color: #323436;
}
.prod-info .earnings-num{
.prod-info .earnings-num {
font-size: 28rpx;
font-family: DINAlternate-Bold;
font-weight: Bold;
color: #F35251;
}
.share-btn{
.share-btn {
height: 56rpx;
line-height: 56rpx;
font-family: PingFangSC-Regular;
......@@ -135,21 +150,126 @@
top: 50%;
transform: translateY(-50%);
}
.share-btn .icon{
.share-btn .icon {
width: 24rpx;
height: 24rpx;
margin-right: 8rpx;
}
.project-wrap{
.project-wrap {
background-color: #F5F7FB;
}
.project-img{
.project-img {
height: 1200rpx;
white-space: nowrap;
.img-item{
height: 300rpx;
.img-item {
position: relative;
width: 100%;
}
// 流程图一
.img-item11 {
height: 1110rpx;
}
.img-item12 {
height: 1290rpx;
}
.img-item13 {
height: 596rpx;
}
.img-item14 {
height: 744rpx;
}
.img-item15 {
height: 490rpx;
}
.img-item16 {
height: 1532rpx;
}
// 流程图二
.img-item21 {
height: 2168rpx;
}
.img-item22 {
height: 1290rpx;
}
.img-item23 {
height: 596rpx;
}
.img-item24 {
height: 830rpx;
}
.img-item25 {
height: 490rpx;
}
.img-item26 {
height: 752rpx;
}
// 流程图三
.img-item31 {
height: 1110rpx;
}
.img-item32 {
height: 1290rpx;
}
.img-item33 {
height: 596rpx;
}
.img-item34 {
height: 984rpx;
}
.img-item35 {
height: 490rpx;
}
// .img-item26 {
// width: 100%;
// height: 752rpx;
// }
// 流程图四
.img-item41 {
height: 678rpx;
}
.img-item42 {
height: 1266rpx;
}
.img-item43 {
height: 1398rpx;
}
.img-item44 {
height: 830rpx;
}
.img-item45 {
height: 490rpx;
}
.img-item46 {
height: 1666rpx;
}
}
/* 测算 */
......@@ -158,10 +278,12 @@
right: 16rpx;
bottom: 160rpx;
}
.icon-calculate {
width: 216rpx;
height: 228rpx;
}
/* 测算弹窗 */
.dialog-wrapper {
position: fixed;
......@@ -170,31 +292,36 @@
left: 0;
right: 0;
bottom: 0;
background-color: rgba(45,45,51,0.50);
background-color: rgba(45, 45, 51, 0.50);
}
.dialog-box {
position: fixed;
bottom: 0;
width: 100%;
height: 744rpx;
background-color: #fff;
box-shadow: 0 -8rpx 20rpx 0 rgba(180,186,204,0.32);
box-shadow: 0 -8rpx 20rpx 0 rgba(180, 186, 204, 0.32);
border-radius: 32rpx 32rpx 0 0;
}
.dialog-header {
display: flex;
justify-content: space-between;
padding: 32rpx 48rpx;
border-bottom: 1rpx solid #eee;
}
.header-btn {
display: inline-block;
font-size: 32rpx;
line-height: 48rpx;
}
.btn-gray {
color: #6C737A;
}
.btn-primary {
background-color: #fff;
border: none;
......@@ -203,12 +330,15 @@
font-weight: 500;
color: #5850FF;
}
.btn-primary::after {
border: none;
}
.dialog-content {
padding: 40rpx 24rpx 60rpx;
}
.dialog-title {
font-weight: 600;
font-size: 36rpx;
......@@ -218,14 +348,16 @@
line-height: 56rpx;
margin-bottom: 24rpx;
}
.dialog-form {
width: 100%;
height: 384rpx;
background-image: linear-gradient(179deg, rgba(123,112,255,0.02) 15%, rgba(99,92,255,0.10) 100%);
background-image: linear-gradient(179deg, rgba(123, 112, 255, 0.02) 15%, rgba(99, 92, 255, 0.10) 100%);
border-radius: 8rpx;
padding: 32rpx;
box-sizing: border-box;
}
.form-item {
display: flex;
align-items: center;
......@@ -233,11 +365,13 @@
margin-bottom: 24rpx;
justify-content: space-between;
}
.form-label {
width: 256rpx;
font-size: 28rpx;
color: #2D2D33;
}
.form-input {
width: 216rpx;
padding: 16rpx 20rpx;
......@@ -246,10 +380,12 @@
margin-left: 64rpx;
margin-right: 16rpx;
}
.form-unit {
font-size: 28rpx;
color: #6E6E7A;
}
.dialog-btn {
width: 100%;
padding: 24rpx 0;
......@@ -264,15 +400,17 @@
line-height: 48rpx;
margin-top: 40rpx;
}
/* 了解更多 */
.understand-more {
position: absolute;
bottom: 0;
width: 100%;
height: 700rpx;
background-image: linear-gradient(180deg, rgba(255,255,255,0.00) 0%, #FFFFFF 68%);
background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.00) 0%, #FFFFFF 68%);
border-radius: 0 0 12rpx 12rpx;
}
.understand-more .more-btn {
width: 100%;
position: absolute;
......
<view class="header">
<swiper class="scene-wrap" circular="{{true}}" previousMargin="40rpx" nextMargin="40rpx">
<swiper bindchange="changeSwiper" class="scene-wrap" circular="{{true}}" previousMargin="40rpx" nextMargin="40rpx">
<block wx:for="{{sceneList}}" wx:key="index">
<swiper-item>
<image class="scene-img" src="{{IMGURL}}{{item}}"></image>
......@@ -40,8 +40,8 @@
</view>
<scroll-view class="project-img" scroll-into-view="{{intoViewId}}" bindscroll="scrolltoupper" scroll-y="{{true}}">
<block wx:for="{{tab}}" wx:key="index">
<view id="to-{{index}}" class="img-item">
{{item}}
<view id="to-{{index}}" class="img-item img-item{{actNum+1}}{{index+1}}">
<image class="img-item{{actNum+1}}{{index+1}}" src="{{IMGURL}}/scene/scene{{actNum+1}}{{index+1}}.png" />
</view>
</block>
</scroll-view>
......
{
"usingComponents": {
"headerNav": "./components/headerNav/headerNav",
"product": "./components/product/product"
},
"navigationStyle": "custom"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!