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 \ 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 \ 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({ ...@@ -14,12 +14,13 @@ Component({
*/ */
data: { data: {
sceneList:['scene_talk.png','scene_delivery.png','scene_within_12mth.png','scene_more_12mth.png'], sceneList:['scene_talk.png','scene_delivery.png','scene_within_12mth.png','scene_more_12mth.png'],
navList:['360全景导航','AR实景导航','座椅通风','氛围灯','数字化美容'], navList:['数字无忧权益卡'],
activeNavIdx: 0, activeNavIdx: 0, //特色产品
tab:['适用场景','营销链路','项目亮点','适用场景','转化漏斗','合作流程','适用场景','营销链路','项目亮点','适用场景','转化漏斗','合作流程'], tab:['适用场景','营销链路','项目亮点','转化漏斗','合作流程'],
heightArr:[], heightArr:[],
curTabIdx:0, curTabIdx:0, //适用产品
intoViewId: 'to-0' intoViewId: 'to-0',
actNum: 0 //场景
}, },
lifetimes:{ lifetimes:{
ready: function (){ ready: function (){
...@@ -32,6 +33,38 @@ Component({ ...@@ -32,6 +33,38 @@ Component({
* 组件的方法列表 * 组件的方法列表
*/ */
methods: { 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){ changeTab(e){
let idx = e.detail let idx = e.detail
this.setData({ this.setData({
...@@ -39,7 +72,6 @@ Component({ ...@@ -39,7 +72,6 @@ Component({
}) })
}, },
changeNav(event){ changeNav(event){
console.log(event,event.target.dataset.index,111)
this.setData({ this.setData({
activeNavIdx: event.target.dataset.index activeNavIdx: event.target.dataset.index
}) })
...@@ -64,6 +96,23 @@ Component({ ...@@ -64,6 +96,23 @@ Component({
console.log( this.data.heightArr) console.log( this.data.heightArr)
}).exec() }).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() { showCalculate() {
this.setData({ this.setData({
......
.scene-wrap{ .scene-wrap {
white-space: nowrap; white-space: nowrap;
height: 180rpx; height: 180rpx;
margin-bottom: 16rpx; margin-bottom: 16rpx;
.scene-img{
.scene-img {
width: 100%; width: 100%;
} }
} }
// 特色产品 // 特色产品
.prod-wrap .big-title{ .prod-wrap .big-title {
margin-left: 40rpx; margin-left: 40rpx;
font-family: PingFangSC-S0pxibold; font-family: PingFangSC-S0pxibold;
font-weight: 600; font-weight: 600;
...@@ -15,14 +17,16 @@ ...@@ -15,14 +17,16 @@
color: #1B233D; color: #1B233D;
line-height: 56rpx; line-height: 56rpx;
} }
.prod-wrap .nav-wrap{
.prod-wrap .nav-wrap {
white-space: nowrap; white-space: nowrap;
box-sizing: border-box; box-sizing: border-box;
margin-top: 24rpx; margin-top: 24rpx;
margin-bottom: 32rpx; margin-bottom: 32rpx;
padding: 0 20rpx; padding: 0 20rpx;
} }
.prod-wrap .nav-wrap .nav{
.prod-wrap .nav-wrap .nav {
display: inline-block; display: inline-block;
width: 188rpx; width: 188rpx;
height: 64rpx; height: 64rpx;
...@@ -37,41 +41,44 @@ ...@@ -37,41 +41,44 @@
background: #FFFFFF; background: #FFFFFF;
border: 2rpx solid #DDE3F0; 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%); background-image: linear-gradient(0deg, #EBEFFF 8%, #FCFDFF 85%);
border: 2rpx solid rgba(68,97,240,0.50); border: 2rpx solid rgba(68, 97, 240, 0.50);
box-shadow: 0 8rpx 16rpx 0 rgba(175,187,219,0.35); box-shadow: 0 8rpx 16rpx 0 rgba(175, 187, 219, 0.35);
color: #4466F0; color: #4466F0;
} }
.prod-wrap .nav-wrap .nav:last-child{
.prod-wrap .nav-wrap .nav:last-child {
margin-right: 0; margin-right: 0;
} }
.prod-item{ .prod-item {
background-color: #F5F7FB; background-color: #F5F7FB;
border-radius: 48rpx 48rpx 0 0; border-radius: 48rpx 48rpx 0 0;
padding: 40rpx 24rpx 32rpx; padding: 40rpx 24rpx 32rpx;
} }
.prod-card{ .prod-card {
display: flex; display: flex;
height: 208rpx; height: 208rpx;
background-image: linear-gradient(1deg, #FFFFFF 10%, #FDFCFF 100%); background-image: linear-gradient(1deg, #FFFFFF 10%, #FDFCFF 100%);
border: 2rpx solid #FFFFFF; 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; border-radius: 20rpx;
padding: 20rpx 24rpx; padding: 20rpx 24rpx;
box-sizing: border-box; box-sizing: border-box;
position: relative; position: relative;
} }
.prod-card .card-img{ .prod-card .card-img {
width: 160rpx; width: 160rpx;
height: 160rpx; height: 160rpx;
flex-shrink: 0; flex-shrink: 0;
border-radius: 4rpx; border-radius: 4rpx;
} }
.img-desc{
.img-desc {
position: absolute; position: absolute;
width: 104rpx; width: 104rpx;
height: 40rpx; height: 40rpx;
...@@ -85,40 +92,48 @@ ...@@ -85,40 +92,48 @@
letter-spacing: 0; letter-spacing: 0;
text-align: center; text-align: center;
} }
.prod-info{
.prod-info {
display: flex; display: flex;
flex-direction: column; flex-direction: column;
justify-content: space-between; justify-content: space-between;
padding: 12rpx 0; padding: 12rpx 0;
margin-left: 24rpx; margin-left: 24rpx;
} }
.prod-info>text{
.prod-info>text {
display: block; display: block;
white-space: nowrap; white-space: nowrap;
height: 40rpx; height: 40rpx;
line-height: 40rpx; line-height: 40rpx;
} }
.prod-info .title{
.prod-info .title {
font-family: PingFangSC-Medium; font-family: PingFangSC-Medium;
font-weight: 500; font-weight: 500;
font-size: 28rpx; font-size: 28rpx;
color: #323436; color: #323436;
} }
.prod-info .sale,.prod-info .earnings{
.prod-info .sale,
.prod-info .earnings {
font-size: 26rpx; font-size: 26rpx;
color: #7A8299; color: #7A8299;
} }
.prod-info .sale-num{
.prod-info .sale-num {
font-size: 26rpx; font-size: 26rpx;
color: #323436; color: #323436;
} }
.prod-info .earnings-num{
.prod-info .earnings-num {
font-size: 28rpx; font-size: 28rpx;
font-family: DINAlternate-Bold; font-family: DINAlternate-Bold;
font-weight: Bold; font-weight: Bold;
color: #F35251; color: #F35251;
} }
.share-btn{
.share-btn {
height: 56rpx; height: 56rpx;
line-height: 56rpx; line-height: 56rpx;
font-family: PingFangSC-Regular; font-family: PingFangSC-Regular;
...@@ -135,21 +150,126 @@ ...@@ -135,21 +150,126 @@
top: 50%; top: 50%;
transform: translateY(-50%); transform: translateY(-50%);
} }
.share-btn .icon{
.share-btn .icon {
width: 24rpx; width: 24rpx;
height: 24rpx; height: 24rpx;
margin-right: 8rpx; margin-right: 8rpx;
} }
.project-wrap{ .project-wrap {
background-color: #F5F7FB; background-color: #F5F7FB;
} }
.project-img{ .project-img {
height: 1200rpx;
white-space: nowrap; 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 @@ ...@@ -158,10 +278,12 @@
right: 16rpx; right: 16rpx;
bottom: 160rpx; bottom: 160rpx;
} }
.icon-calculate { .icon-calculate {
width: 216rpx; width: 216rpx;
height: 228rpx; height: 228rpx;
} }
/* 测算弹窗 */ /* 测算弹窗 */
.dialog-wrapper { .dialog-wrapper {
position: fixed; position: fixed;
...@@ -170,31 +292,36 @@ ...@@ -170,31 +292,36 @@
left: 0; left: 0;
right: 0; right: 0;
bottom: 0; bottom: 0;
background-color: rgba(45,45,51,0.50); background-color: rgba(45, 45, 51, 0.50);
} }
.dialog-box { .dialog-box {
position: fixed; position: fixed;
bottom: 0; bottom: 0;
width: 100%; width: 100%;
height: 744rpx; height: 744rpx;
background-color: #fff; 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; border-radius: 32rpx 32rpx 0 0;
} }
.dialog-header { .dialog-header {
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
padding: 32rpx 48rpx; padding: 32rpx 48rpx;
border-bottom: 1rpx solid #eee; border-bottom: 1rpx solid #eee;
} }
.header-btn { .header-btn {
display: inline-block; display: inline-block;
font-size: 32rpx; font-size: 32rpx;
line-height: 48rpx; line-height: 48rpx;
} }
.btn-gray { .btn-gray {
color: #6C737A; color: #6C737A;
} }
.btn-primary { .btn-primary {
background-color: #fff; background-color: #fff;
border: none; border: none;
...@@ -203,12 +330,15 @@ ...@@ -203,12 +330,15 @@
font-weight: 500; font-weight: 500;
color: #5850FF; color: #5850FF;
} }
.btn-primary::after { .btn-primary::after {
border: none; border: none;
} }
.dialog-content { .dialog-content {
padding: 40rpx 24rpx 60rpx; padding: 40rpx 24rpx 60rpx;
} }
.dialog-title { .dialog-title {
font-weight: 600; font-weight: 600;
font-size: 36rpx; font-size: 36rpx;
...@@ -218,14 +348,16 @@ ...@@ -218,14 +348,16 @@
line-height: 56rpx; line-height: 56rpx;
margin-bottom: 24rpx; margin-bottom: 24rpx;
} }
.dialog-form { .dialog-form {
width: 100%; width: 100%;
height: 384rpx; 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; border-radius: 8rpx;
padding: 32rpx; padding: 32rpx;
box-sizing: border-box; box-sizing: border-box;
} }
.form-item { .form-item {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -233,11 +365,13 @@ ...@@ -233,11 +365,13 @@
margin-bottom: 24rpx; margin-bottom: 24rpx;
justify-content: space-between; justify-content: space-between;
} }
.form-label { .form-label {
width: 256rpx; width: 256rpx;
font-size: 28rpx; font-size: 28rpx;
color: #2D2D33; color: #2D2D33;
} }
.form-input { .form-input {
width: 216rpx; width: 216rpx;
padding: 16rpx 20rpx; padding: 16rpx 20rpx;
...@@ -246,10 +380,12 @@ ...@@ -246,10 +380,12 @@
margin-left: 64rpx; margin-left: 64rpx;
margin-right: 16rpx; margin-right: 16rpx;
} }
.form-unit { .form-unit {
font-size: 28rpx; font-size: 28rpx;
color: #6E6E7A; color: #6E6E7A;
} }
.dialog-btn { .dialog-btn {
width: 100%; width: 100%;
padding: 24rpx 0; padding: 24rpx 0;
...@@ -264,15 +400,17 @@ ...@@ -264,15 +400,17 @@
line-height: 48rpx; line-height: 48rpx;
margin-top: 40rpx; margin-top: 40rpx;
} }
/* 了解更多 */ /* 了解更多 */
.understand-more { .understand-more {
position: absolute; position: absolute;
bottom: 0; bottom: 0;
width: 100%; width: 100%;
height: 700rpx; 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; border-radius: 0 0 12rpx 12rpx;
} }
.understand-more .more-btn { .understand-more .more-btn {
width: 100%; width: 100%;
position: absolute; position: absolute;
......
<view class="header"> <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"> <block wx:for="{{sceneList}}" wx:key="index">
<swiper-item> <swiper-item>
<image class="scene-img" src="{{IMGURL}}{{item}}"></image> <image class="scene-img" src="{{IMGURL}}{{item}}"></image>
...@@ -40,8 +40,8 @@ ...@@ -40,8 +40,8 @@
</view> </view>
<scroll-view class="project-img" scroll-into-view="{{intoViewId}}" bindscroll="scrolltoupper" scroll-y="{{true}}"> <scroll-view class="project-img" scroll-into-view="{{intoViewId}}" bindscroll="scrolltoupper" scroll-y="{{true}}">
<block wx:for="{{tab}}" wx:key="index"> <block wx:for="{{tab}}" wx:key="index">
<view id="to-{{index}}" class="img-item"> <view id="to-{{index}}" class="img-item img-item{{actNum+1}}{{index+1}}">
{{item}} <image class="img-item{{actNum+1}}{{index+1}}" src="{{IMGURL}}/scene/scene{{actNum+1}}{{index+1}}.png" />
</view> </view>
</block> </block>
</scroll-view> </scroll-view>
......
{ {
"usingComponents": { "usingComponents": {
"headerNav": "./components/headerNav/headerNav",
"product": "./components/product/product" "product": "./components/product/product"
}, },
"navigationStyle": "custom" "navigationStyle": "custom"
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!