Commit 41f35f14 by 胡悦

提交

1 parent 1bfe0a81
......@@ -7,4 +7,10 @@
.isFullSucreen {
padding-bottom: constant(safe-area-inset-bottom) !important;
padding-bottom: env(safe-area-inset-bottom) !important;
}
image {
vertical-align: top;
}
.default-img {
width: 100%;
}
\ No newline at end of file
// pages/addValue/addValue/addValue.js
import Util from '../../../utils/util'
import pageData from '../constant/data'
Page({
/**
* 页面的初始数据
*/
data: {
visible: false,
tabList: pageData.tabList,
tabActive: 2,
typeObj: {
service: {
name: '服务类',
class: 'service-color'
},
membrane: {
name: '膜类',
class: 'membrane-color'
},
beauty: {
name: '美容类',
class: 'beauty-color'
},
light: {
name: '轻改类',
class: 'light-color'
}
},
formData: {
sales: 100,
flow: 100
},
isReset: false,
hasPhoneNumber: false
},
// tab切换
tabChange(e) {
console.log(e)
const index = e.currentTarget.dataset.index
this.setData({
tabActive: index,
showPlay: false
})
},
// 提交测算
submit(e) {
console.log(e)
let sales = e ? +e.detail.value.sales : this.data.formData.sales
let flow = e ? +e.detail.value.flow : this.data.formData.flow
const _this = this
this.data.tabList.forEach((item, index) => {
item.productList.forEach((i, lastIndex) => {
if (i.profit) {
let name = `tabList[${index}].productList[${lastIndex}].profit`
let profit = _this.formula(i.productType, sales, flow)
this.setData({
[name]: profit
})
}
})
})
this.setData({
visible: false
})
},
// 计算公式,参数:productType
formula(productType, sales, flow) {
let profit = 0
switch(productType) {
case 'benefitCard':
// 数字无忧权益卡
profit = (sales * 0.5 * 2000 * 12).toFixed(0)
break
case 'sunMembrane':
// 汽车太阳膜
profit = (flow * 0.05 * 5000 * 12).toFixed(0)
break
case 'protectMembrane':
// 漆面保护膜
profit = (flow * 0.15 * 12000 * 12).toFixed(0)
break
case 'colorMembrane':
// 改色膜
profit = (flow * 0.05 * 5000 * 12).toFixed(0)
break
case 'digitBeauty':
// 数字化美容
profit = (sales * 0.2 * 300 * 12).toFixed(0)
break
case 'chair':
// 座椅通风
profit = (flow * 2580 * 0.9 * 0.01).toFixed(0)
break
case 'ar':
// AR导航
profit = (flow * 1680 * 0.9 * 0.015).toFixed(0)
break
case 'lamp':
// 氛围灯
profit = (flow * 2680 * 0.9 * 0.015).toFixed(0)
break
case 'navigation':
// 360全景导航
profit = (flow * 2880 * 0.9 * 0.015).toFixed(0)
break
}
console.log(profit.length)
if (profit.length > 8) {
return (profit / 10000).toFixed(0) + '万'
} else {
return profit
}
console.log(productType, sales, flow, profit)
return profit
},
reset() {
this.setData({
isReset: false,
formData: {
sales: 100,
flow: 100
}
})
},
focus() {
this.setData({
isReset: true
})
return false
},
// 显示测算弹窗
showCalculate() {
this.setData({
visible: !this.data.visible
})
},
clickDialog(e) {
console.log(e.changedTouches[0].clientY)
if (e.changedTouches[0].clientY < 352) {
this.setData({
visible: false
})
}
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
this.submit()
const userInfo = Util.getUserInfo()
console.log(userInfo)
if (userInfo.phone) {
this.setData({
hasPhoneNumber: true
})
}
console.log(this.data.tabList[this.data.tabActive].productList.slice(0,2))
},
/**
......
<!--pages/addValue/addValue/addValue.wxml-->
<page-meta page-style="overflow: {{visible ? 'hidden' : 'visible'}}" />
<view class="wrapper-banner">
<image mode="widthFix" class="img" webp src="{{IMGURL}}image/dijia/banner.png"></image>
<view class="banner-title">我们的产品和服务</view>
<view class="banner-after"></view>
</view>
<view class="tab-list">
<block wx:for="{{tabList}}" wx:key="index" class="">
<view class="tab-item {{tabActive == index ? 'tab-active' : ''}}" data-index="{{index}}" bindtap="tabChange">
<image class="tab-img" webp src="{{IMGURL}}image/dijia/{{tabActive == index ? item.active : item.img}}.png"></image>
<view class="tab-name {{tabActive == index ? 'name-active' : ''}}">{{item.name}}</view>
</view>
</block>
</view>
<!-- 阶段玩法 -->
<view class="tab-play">
<image mode="widthFix" class="default-img" lazy-load webp src="{{IMGURL}}image/dijia/{{tabList[tabActive].playImg}}.png"></image>
</view>
<!-- 特色产品 -->
<view class="product-box">
<view class="product-title">特色产品</view>
<view class="product-tips">预估收益根据您的新车销量 100台 测算所得</view>
<view class="product-list">
<block wx:for="{{tabList[tabActive].productList}}" wx:key="ind">
<view class="product-item">
<image webp src="{{IMGURL}}image/dijia/{{item.img}}.png"></image>
<view class="product-content" hidden="{{ind > 1 && !hasPhoneNumber}}">
<view class="product-type {{typeObj[item.type].class}}">{{typeObj[item.type].name}}</view>
<view class="product-name">{{item.proName}}</view>
<view class="product-price" wx:if="{{item.profit}}">
<view class="product-label">预估收益</view>
<view class="product-value price">¥{{item.profit}}</view>
</view>
<view class="product-price" wx:else>
<view class="product-disabled">暂无预估收益</view>
</view>
<view class="product-introduce">
{{item.profit ? '产品介绍' : '敬请期待'}}
<image wx:if="{{item.profit}}" class="icon-arrow" webp src="{{IMGURL}}image/dijia/icon-arrow.png"></image>
</view>
</view>
</view>
</block>
</view>
</view>
<view class="understand-more">
<phone-number bind:updatePhoneNumber="updatePhoneNumber"></phone-number>
</view>
<!-- 案例视频 -->
<block wx:if="{{hasPhoneNumber}}">
<view class="video-bg" wx:if="{{tabList[tabActive].videoList.length}}">
<view class="video-title">案例视频</view>
<view class="video-list">
<block wx:for="{{tabList[tabActive].videoList}}" wx:key="i">
<view class="video-item">
<!-- -->
<video poster="{{IMGURL}}video/{{item.posterUrl}}.png" src="{{IMGURL}}video/{{item.videoUrl}}.mp4"></video>
<view class="video-text">{{item.name}}</view>
</view>
</block>
<view class="video-tips">- 如需开通请咨询客服 -</view>
</view>
</view>
</block>
<!-- 测算按钮 -->
<view class="calculate" bindtap="showCalculate">
<image class="icon-calculate" webp src="{{IMGURL}}image/dijia/icon-calculate.png"></image>
</view>
<!-- 测算弹窗 -->
<view class="dialog-wrapper" bindtap="clickDialog" hidden="{{!visible}}">
<view class="dialog-box">
<form bindsubmit="submit">
<view class="dialog-header">
<view hidden="{{isReset}}" class="header-btn btn-gray" bindtap="showCalculate">取消</view>
<view hidden="{{!isReset}}" class="header-btn btn-gray" bindtap="reset">重置</view>
<button class="header-btn btn-primary" form-type="submit">确定</button>
</view>
<view class="dialog-content">
<view class="dialog-title">输入您门店的基本情况</view>
<view class="dialog-form">
<view class="form-item">
<view class="form-label">门店月平均新车销量</view>
<input class="form-input" bindfocus="focus" name="sales" value="{{formData.sales}}" type="number" />
<view class="form-unit">台</view>
</view>
<view class="form-item">
<view class="form-label">3年内售后存量用户</view>
<input class="form-input" bindfocus="focus" name="flow" type="number" value="{{formData.flow}}" />
<view class="form-unit">人</view>
</view>
<button class="dialog-btn" form-type="submit">提交测算</button>
</view>
</view>
</form>
</view>
</view>
\ No newline at end of file
/* pages/addValue/addValue/addValue.wxss */
/* tab样式 */
.img {
width: 100%;
}
......@@ -25,4 +26,361 @@
}
.tab-list {
display: flex;
}
\ No newline at end of file
font-size: 0;
}
.tab-item {
width: 25%;
text-align: center;
padding: 20rpx 0;
font-size: 0;
height: 144rpx;
box-sizing: border-box;
}
.tab-active {
position: relative;
}
.tab-active {
background-color: #5850FF;
}
.tab-active::after {
content: '';
display: inline-block;
width: 0;
height: 0;
position: absolute;
top: 144rpx;
left: 50%;
transform: translateX(-50%);
border: 16rpx solid;
border-color: #5850FF transparent transparent transparent;
}
.tab-img {
width: 56rpx;
height: 56rpx;
}
.tab-name {
font-size: 28rpx;
color: #6E6E7A;
line-height: 44rpx;
margin-top: 4rpx;
}
.name-active {
color: #fff;
font-weight: 500;
}
/* 阶段玩法样式 */
.tab-play {
padding: 44rpx 24rpx 112rpx;
width: clac(100% - 48rpx);
height: 1236rpx;
background: #2D28A8;
background-image: linear-gradient(180deg, #2D28A8 0%, #201F38 100%);
}
/* 特色产品 */
.product-box {
width: 100%;
background-color: #fff;
/* height: 500rpx; */
}
.product-title {
position: relative;
font-size: 48rpx;
color: #2D2D33;
line-height: 64rpx;
text-align: center;
letter-spacing: 0;
padding: 96rpx 0 28rpx;
font-weight: 900;
}
.product-title::after {
content: '';
display: block;
width: 48rpx;
height: 4rpx;
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
background-color: #5850FF;
}
.product-tips {
margin-top: 32rpx;
text-align: center;
font-size: 28rpx;
color: #9E9EA8;
}
.product-list {
display: flex;
flex-wrap: wrap;
padding: 64rpx 32rpx 128rpx;
}
.product-item {
width: calc(50% - 12rpx);
/* height: 536rpx; */
background-color: #FAFAFA;
box-shadow: 0 8rpx 20rpx 0 rgba(180,186,204,0.32);
border-radius: 16rpx;
margin-bottom: 32rpx;
box-sizing: border-box;
}
.product-item:nth-child(even) {
margin-left: 24rpx;
}
.product-item image {
width: 100%;
height: 200rpx;
}
.product-content {
padding: 32rpx 24rpx;
}
.product-type {
display: inline-block;
/* background-color: #EAE9FF; */
border-radius: 4rpx;
font-weight: 500;
font-size: 24rpx;
/* color: #5851FF; */
padding: 4rpx 16rpx;
}
.beauty-color {
background-color: #EAE9FF;
color: #5851FF;
}
.light-color {
background-color: #D7F5E5;
color: #21AB60;
}
.service-color {
background-color: #FFE7CD;
color: #EF971E;
}
.membrane-color {
background-color: #E3ECFF;
color: #4E87FB;
}
.product-name {
font-weight: 500;
font-size: 32rpx;
color: #2D2D33;
line-height: 40rpx;
margin-top: 24rpx;
margin-bottom: 32rpx;
}
.product-price {
display: flex;
font-size: 24rpx;
color: #6E6E7A;
line-height: 40rpx;
}
.product-price:first-child {
margin-top: 8rpx;
}
.product-value {
color: #333333;
margin-left: 16rpx;
flex: 1;
}
.product-label {
width: 96rpx;
}
.price {
font-weight: Bold;
font-size: 28rpx;
color: #5850FF;
}
.product-introduce {
display: flex;
align-items: center;
margin-top: 24rpx;
font-size: 24rpx;
color: #9E9EA8;
line-height: 40rpx;
}
.product-introduce .icon-arrow {
width: 32rpx;
height: 32rpx;
}
.product-disabled {
color: #9E9EA8;
font-size: 24rpx;
}
/* 案例视频 */
.video-bg {
width: 100%;
/* height: 500rpx; */
background-color: #201F38;
}
.video-title {
position: relative;
padding: 96rpx 0 24rpx;
text-align: center;
font-size: 48rpx;
font-weight: 900;
color: #FFFFFF;
letter-spacing: 0;
line-height: 64rpx;
}
.video-title::after {
content: '';
display: block;
width: 48rpx;
height: 4rpx;
position: absolute;
bottom: 0;
left: 50%;
transform: translateX(-50%);
background-color: #ffffff;
}
.video-list {
display: flex;
flex-wrap: wrap;
padding: 80rpx 32rpx;
font-size: 0;
}
.video-item {
width: calc(50% - 12rpx);
margin-bottom: 80rpx;
}
.video-item video {
width: 100%;
height: 588rpx;
}
.video-item:nth-child(even) {
margin-left: 24rpx;
}
.video-text {
font-size: 32rpx;
color: #FFFFFF;
line-height: 48rpx;
margin-top: 24rpx;
}
.video-tips {
width: 100%;
text-align: center;
font-size: 28rpx;
color: rgba(255,255,255,.6);
padding: 16rpx 0 92rpx;
}
/* 测算 */
.calculate {
position: fixed;
right: 16rpx;
bottom: 160rpx;
}
.icon-calculate {
width: 216rpx;
height: 228rpx;
}
/* 测算弹窗 */
.dialog-wrapper {
position: fixed;
height: 100vh;
top: 0;
left: 0;
right: 0;
bottom: 0;
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);
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;
margin: 0;
padding: 0;
font-weight: 500;
color: #5850FF;
}
.btn-primary::after {
border: none;
}
.dialog-content {
padding: 40rpx 24rpx 60rpx;
}
.dialog-title {
font-weight: 600;
font-size: 36rpx;
color: #333333;
letter-spacing: 0;
text-align: center;
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%);
border-radius: 8rpx;
padding: 32rpx;
box-sizing: border-box;
}
.form-item {
display: flex;
align-items: center;
height: 80rpx;
margin-bottom: 24rpx;
justify-content: space-between;
}
.form-label {
width: 256rpx;
font-size: 28rpx;
color: #2D2D33;
}
.form-input {
width: 216rpx;
padding: 16rpx 20rpx;
border: 2rpx solid #E6E6E6;
border-radius: 4rpx;
margin-left: 64rpx;
margin-right: 16rpx;
}
.form-unit {
font-size: 28rpx;
color: #6E6E7A;
}
.dialog-btn {
width: 100%;
padding: 24rpx 0;
box-sizing: border-box;
background: #5850FF;
border-radius: 8rpx;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
letter-spacing: 0.8rpx;
text-align: center;
line-height: 48rpx;
margin-top: 40rpx;
}
/* 了解更多 */
.understand-more {
position: fixed;
/* display: flex;
align-items: flex-end; */
bottom: 0;
width: 100%;
height: 500rpx;
background-image: linear-gradient(180deg, rgba(255,255,255,0.00) 0%, #FFFFFF 68%);
border-radius: 0 0 12rpx 12rpx;
}
var tabList = [
{
name: '新车交付',
img: 'icon-car1',
active: 'icon-car11',
playImg: 'img1',
productList: [
{
img: 'product-img1',
proName: '数字无忧权益卡',
price: '1500',
// profit: '92.4万',
profit: '99999999万',
type: 'service',
productType: 'benefitCard'
},
{
img: 'product-img2',
proName: '汽车太阳膜',
price: '1500',
profit: '1008万',
type: 'membrane',
productType: 'sunMembrane'
}
],
videoList: [
{
videoUrl: 'difital_card_30s',
posterUrl: 'difital_card_30s_bitmap',
name: '数字无忧卡服务30秒'
},
{
videoUrl: 'digital_card',
posterUrl: 'digital_card_bitmap',
name: '数字无忧卡服务'
},
{
videoUrl: 'digital_card_money3',
posterUrl: 'digital_card_money3_bitmap',
name: '数字无忧卡3道钱'
},
{
videoUrl: 'digital_card_reason6',
posterUrl: 'digital_card_reason6_bitmap',
name: '数字无忧卡6大理由'
},
{
videoUrl: 'solar',
posterUrl: 'solar_bitmap',
name: '太阳膜转化售中案例'
}
]
},
{
name: '0-12个月',
img: 'icon-car2',
active: 'icon-car21',
playImg: 'img2',
productList: [
{
img: 'product-img3',
proName: '漆面保护膜',
price: '12000',
profit: '216万',
type: 'membrane',
productType: 'protectMembrane'
},
{
img: 'product-img4',
proName: '改色膜',
price: '5000',
profit: '30万',
type: 'membrane',
productType: 'colorMembrane'
}
]
},
{
name: '12-36个月',
img: 'icon-car3',
active: 'icon-car31',
playImg: 'img3',
productList: [
{
img: 'product-img5',
proName: '数字化美容',
price: '300',
profit: '36万',
type: 'beauty',
productType: 'digitBeauty'
},
{
img: 'product-img6',
proName: '座椅通风',
price: '1500',
profit: '1008万',
type: 'light',
productType: 'chair'
},
{
img: 'product-img7',
proName: 'AR导航',
price: '1680',
profit: '22.68万',
type: 'light',
productType: 'ar'
},
{
img: 'product-img8',
proName: '氛围灯',
price: '2680',
profit: '36.18万',
type: 'light',
productType: 'lamp'
},
{
img: 'product-img9',
proName: '360全景导航',
price: '2880',
profit: '38.88万',
type: 'service',
productType: 'navigation'
}
],
videoList: [
{
videoUrl: 'seat',
posterUrl: 'seat_bitmap',
name: '座椅通风系统'
},
{
videoUrl: 'AR',
posterUrl: 'AR_bitmap',
name: '单品AR导航'
},
{
videoUrl: 'light',
posterUrl: 'light_bitmap',
name: '单品类氛围灯'
},
{
videoUrl: '360_AR',
posterUrl: '360_AR_bitmap',
name: '360全景导航'
}
]
},
{
name: '36个月以上',
img: 'icon-car4',
active: 'icon-car41',
playImg: 'img4',
productList: [
{
img: 'product-img10',
proName: '数字化美容',
price: '300',
profit: '36万',
type: 'beauty',
productType: 'digitBeauty'
},
{
img: 'product-img11',
proName: '车险续保',
price: '2500',
profit: '',
type: 'service'
},
{
img: 'product-img12',
proName: '金融车贷',
price: '200000',
profit: '',
type: 'service'
}
]
}
]
export default {
tabList
}
\ No newline at end of file
......@@ -43,7 +43,14 @@
{
"name": "",
"pathName": "pages/tab/index/index",
"query": "scene=sceneId%3D3100",
"query": "scene=sceneId%3D3102",
"launchMode": "default",
"scene": null
},
{
"name": "",
"pathName": "pages/addValue/addValue/addValue",
"query": "",
"launchMode": "default",
"scene": null
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!