Commit 5b0120ac by luyt

faet:添加产业测算

1 parent bd8605c1
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
"login/index/index", "login/index/index",
"login/accountItems/accountItems", "login/accountItems/accountItems",
"pages/viewVideo/index", "pages/viewVideo/index",
"pages/viewProd/index" "pages/viewProd/index",
"pages/measure/measure/measure",
"pages/measure/measureResult/measureResult"
], ],
"requiredPrivateInfos": [ "requiredPrivateInfos": [
"getLocation" "getLocation"
......
...@@ -34,7 +34,6 @@ page { ...@@ -34,7 +34,6 @@ page {
// background:var(--btnColor); // background:var(--btnColor);
width: 6rpx; width: 6rpx;
height: 36rpx; height: 36rpx;
transform: rotate(-180deg);
background: #3666fe; background: #3666fe;
border-radius: 8rpx 0 0 8rpx; border-radius: 8rpx 0 0 8rpx;
} }
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
<navigation-bar showBack="{{true}}" bindnavbarReady="navbarReady" navStyle="{{navStyle}}"> <navigation-bar showBack="{{true}}" bindnavbarReady="navbarReady" navStyle="{{navStyle}}">
申请业务 申请业务
</navigation-bar> </navigation-bar>
<view class="apply"> <view class="apply">
<image class="head" src="{{IMG_URL}}index/apply-title.png" style="height:{{tabBarStyle}}px;" /> <image class="head" src="{{IMG_URL}}index/apply-title.png" style="height:{{tabBarStyle}}px;" />
<image class="introduce" src="{{IMG_URL}}index/new-apply-bg.png" /> <image class="introduce" src="{{IMG_URL}}index/new-apply-bg.png" />
......
var measureList = Object.freeze([
{
name: '1.0 新车权益升级',
tips: '新车洽谈场景',
iconName: 'icon1',
product: [
{
name: '车损升级',
parentName: '1.0 新车权益升级',
tips: '新车洽谈场景',
value: '0-0',
typeIndex: '1.0',
isCheck: false,
rate: '0.5',
averagePrice: 1200,
flowCost: '0.4',
flowCostText: '40%',
serviceDividendRatio: '0.23'
}
]
},
{
name: '1.1 新车精品升级',
tips: '新车交付场景',
iconName: 'icon2',
product: [
{
name: '太阳膜升级',
parentName: '1.1 新车精品升级',
tips: '新车交付场景',
value: '1-0',
typeIndex: '1.1',
isCheck: false,
rate: '0.55',
averagePrice: 1400,
flowCost: '0.25',
flowCostText: '25%',
serviceDividendRatio: '0.65'
}
]
},
{
name: '1.2 次新车膨胀金活动',
iconName: 'icon3',
tips: '0-6个月',
product: [
{
name: '膨胀金活动-车衣',
parentName: '1.2 次新车膨胀金活动',
tips: '0-6个月',
value: '2-0',
typeIndex: '1.2',
isCheck: false,
rate: '0.09',
averagePrice: 5000,
flowCost: '0.1',
flowCostText: '10%',
serviceDividendRatio: '0.85'
},
{
name: '膨胀金活动-改色膜',
parentName: '1.2 次新车膨胀金活动',
tips: '0-6个月',
value: '2-1',
typeIndex: '1.2',
isCheck: false,
rate: '0.06',
averagePrice: 2999,
flowCost: '0.1',
flowCostText: '10%',
serviceDividendRatio: '0.74'
}
]
},
{
name: '1.3 售后直播众筹活动',
iconName: 'icon4',
tips: '6个月以上',
product: [
{
name: '360全景导航',
parentName: '1.3 售后直播众筹活动',
tips: '6个月以上',
typeIndex: '1.3',
value: '3-0',
isCheck: false,
rate: '0.015',
averagePrice: 2680,
flowCost: '0.25',
flowCostText: '25%',
serviceDividendRatio: '0.16'
},
{
name: 'AR导航',
parentName: '1.3 售后直播众筹活动',
tips: '6个月以上',
value: '3-1',
typeIndex: '1.3',
isCheck: false,
rate: '0.015',
averagePrice: 1680,
flowCost: '0.25',
flowCostText: '25%',
serviceDividendRatio: '0.24'
},
{
name: '氛围灯',
parentName: '1.3 售后直播众筹活动',
tips: '6个月以上',
value: '3-2',
typeIndex: '1.3',
isCheck: false,
rate: '0.015',
averagePrice: 2680,
flowCost: '0.25',
flowCostText: '25%',
serviceDividendRatio: '0.22'
},
{
name: '座椅通风',
parentName: '1.3 售后直播众筹活动',
tips: '6个月以上',
value: '3-3',
typeIndex: '1.3',
isCheck: false,
rate: '0.01',
averagePrice: 2580,
flowCost: '0.25',
flowCostText: '25%',
serviceDividendRatio: '0.21'
},
{
name: '智能香薰',
parentName: '1.3 售后直播众筹活动',
tips: '6个月以上',
value: '3-4',
typeIndex: '1.3',
isCheck: false,
rate: '0.015',
averagePrice: 1680,
flowCost: '0.25',
flowCostText: '25%',
serviceDividendRatio: '0.24'
}
]
}
])
export default {
measureList
}
\ No newline at end of file \ No newline at end of file
// pages/measure/measure.js
import Util from '~/utils/util'
import measureData from '../constant/data'
const checkMap = new Map()
let imgUrl = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/'
Page({
/**
* 页面的初始数据
*/
data: {
IMGURL:imgUrl,
measureList: measureData.measureList,
isDisabled: true,
checkArray: [],
formData: {
storeNumber: '',
carNumber: '',
customNumber: ''
}
},
// 提交
submit() {
const reg = /^[1-9]\d*$/
// for(let i in this.data.formData) {
// if (!reg.test(this.data.formData[i])) {
// wx.showToast({
// title: '请输入正整数',
// icon: 'none',
// duration: 1000
// })
// this.setData({
// isDisabled: true
// })
// return
// }
// }
if (!this.data.isDisabled) {
console.log(this.data.checkArray)
let checkArray = []
this.data.measureList.forEach(item => {
item.product.forEach(i => {
if (i.isCheck) {
checkArray.push(i)
}
})
})
console.log(checkArray)
const params = Object.assign({checkArray}, this.data.formData)
console.log(params)
wx.$router.go("measureResult", params);
}
},
// 选择产品
checkProduct(e) {
const value = e.target.dataset.value
const index = +value.split('-')[0]
const productIndex = +value.split('-')[1]
const name = `measureList[${index}].product[${productIndex}].isCheck`
const val = this.data.measureList[index].product[productIndex].isCheck
!val ? checkMap.set(value, !val) : checkMap.delete(value)
console.log(checkMap)
this.setData({
[name]: !val,
checkArray: [...checkMap.keys()]
})
this.validForm()
console.log(this.data.checkArray)
},
// 必填校验
validForm() {
const flag = this.data.formData.storeNumber && this.data.formData.carNumber && this.data.formData.customNumber && this.data.checkArray.length
this.setData({
isDisabled: !flag
})
return flag
},
// 表单输入
handleInput(e) {
let name = e.currentTarget.dataset.name
let val = this.validateNumber(e.detail.value)
console.log(val)
const form = `formData.${name}`
this.setData({
[form]: val
})
this.validForm()
},
// 输入正整数校验
validateNumber(val) {
console.log(val, val.replace(/\D/g, ''))
return val == 0 ? '' : val.replace(/\D/g, '')
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "展业测算"
}
\ No newline at end of file \ No newline at end of file
<!--pages/measure/measure.wxml-->
<view class="wrapper-measure">
<image class="header-bg" webp src="{{IMGURL}}measure/header-bg.png?v={{img_version}}"></image>
<view class="form first-form">
<view class="form-title">请输入4S店基本信息</view>
<view class="form-label">您合作的4S门店数量</view>
<input class="form-value" value="{{formData.storeNumber}}" bindinput="handleInput" data-name="storeNumber" maxlength="4" type="number" placeholder="请输入"/>
<view class="form-label">4S店单店月均新车销量</view>
<input class="form-value" value="{{formData.carNumber}}" bindinput="handleInput" data-name="carNumber" maxlength="4" type="number" placeholder="请输入"/>
<view class="form-label">4S店单店3年以上存量车主</view>
<input class="form-value" value="{{formData.customNumber}}" bindinput="handleInput" data-name="customNumber" maxlength="6" type="number" placeholder="请输入"/>
</view>
<view class="form second-form">
<view class="form-title">请选择场景/产品</view>
<block wx:for="{{measureList}}" wx:for-item="i" wx:key="index">
<view class="scenario">
<image class="icon" webp src="{{IMGURL}}measure/{{i.iconName}}.png?v={{img_version}}"></image>
{{i.name}}
<view wx:if="{{i.tips}}" class="title-tip">{{i.tips}}</view>
</view>
<view class="product-list">
<view class="product-item {{j.isCheck ? 'active':''}}" wx:for="{{i.product}}" wx:for-item="j" wx:key="index" data-value="{{j.value}}" bindtap="checkProduct">
<image hidden="{{!j.isCheck}}" class="iconCheck" webp src="{{IMGURL}}measure/icon-check.png?v={{img_version}}"></image>
{{j.name}}</view>
</view>
</block>
</view>
<view class="submit {{isDisabled ? 'disabled' : ''}}" bindtap="submit">开始测算</view>
</view>
/* pages/measure/measure.wxss */
.wrapper-measure {
position: relative;
padding: 0 24rpx 90rpx;
}
.header-bg {
position: absolute;
top: -224rpx;
left: 0;
width: 100%;
z-index: -1;
}
.form {
width: 100%;
box-sizing: border-box;
background: #fff;
box-shadow: 0 4rpx 32rpx 0 rgba(175,181,219,0.40);
border-radius: 16rpx;
padding: 32rpx 40rpx;
}
.form-title {
font-weight: 500;
font-size: 32rpx;
color: #333333;
letter-spacing: 0;
text-align: center;
line-height: 56rpx;
}
.first-form {
margin-top: 224rpx;
}
.second-form {
margin-top: 48rpx;
}
.form-label {
font-size: 28rpx;
margin-top: 32rpx;
}
.form-value {
margin-top: 16rpx;
height: 80rpx;
background: #FFFFFF;
border: 2rpx solid #E6E6E6;
border-radius: 4rpx;
padding: 0 20rpx;
box-sizing: border-box;
font-size: 28rpx;
font-size: 28rpx;
line-height: 48rpx;
}
.scenario {
display: flex;
align-items: center;
width: 100%;
padding: 10rpx 24rpx;
background: #F5F5FA;
border-radius: 8rpx;
margin-top: 48rpx;
font-weight: 500;
font-size: 28rpx;
color: #323436;
letter-spacing: 0;
line-height: 44rpx;
box-sizing: border-box;
}
.scenario .icon {
width: 40rpx;
height: 40rpx;
margin-right: 16rpx;
}
.title-tip {
font-weight: 400;
font-size: 24rpx;
color: #6E6E7A;
letter-spacing: 0;
line-height: 44rpx;
margin-left: 8rpx;
}
.product-list {
/* display: flex; */
width: 100%;
}
.product-item {
position: relative;
display: inline-block;
width: calc(50% - 42rpx);
background: #FFFFFF;
border: 2rpx solid #E6E6E6;
border-radius: 8rpx;
text-align: center;
padding: 14rpx;
margin-top: 18rpx;
font-size: 28rpx;
color: #323436;
letter-spacing: 0;
text-align: center;
line-height: 44rpx;
}
.product-item.active {
background-image: linear-gradient(0deg, #E8E8FF 14%, #FAFAFF 89%);
border: 2rpx solid #9994FF;
}
.product-item:nth-child(even) {
margin-left: 18rpx;
}
.iconCheck {
position: absolute;
width: 30rpx;
height: 22rpx;
top: -2rpx;
right: -2rpx;
}
.submit {
margin: 48rpx 32rpx;
padding: 24rpx 245rpx;
background: #5850FF;
border-radius: 8rpx;
font-weight: 500;
font-size: 32rpx;
color: #FFFFFF;
letter-spacing: 0.8rpx;
text-align: center;
}
.submit.disabled {
background: #D3D3DB;
}
\ No newline at end of file \ No newline at end of file
// pages/measureResult/measureResult.js
import Util from '~/utils/util'
import measureData from '../constant/data'
let imgUrl = 'https://img02.glsx.com.cn/weapp/resource/miniprogram/ai-card/'
Page({
/**
* 页面的初始数据
*/
data: {
IMGURL:imgUrl,
visible: false,
measureList: null,
formData: {
storeNumber: 1,
carNumber: 1,
customNumber: 1,
checkArray: []
},
checkList: [],
singleList: ['baseCustomersNumber', 'valueAddNumber', 'storeIncomeNumber', 'serviceIncomeNumber', 'singleValueAddNumber', 'singleStoreIncomeNumber', 'singleServiceIncomeNumber'],
countList: ['valueAddCount', 'storeIncomeCount', 'serviceIncomeCount', 'singleValueAddCount', 'singleStoreIncomeCount', 'singleServiceIncomeCount'],
countData: {},
dialogData: {
rate: '',
averagePrice: ''
}
},
// 计算公式
formula(name, item, list) {
console.log(name, item)
const {storeNumber, carNumber, customNumber} = this.data.formData
const {rate, averagePrice, flowCost, serviceDividendRatio, typeIndex} = item
console.log(storeNumber, carNumber, customNumber)
let value = 0
switch(name) {
// 增值产量(总)
case 'valueAddCount':
list.forEach(i => {
value = value + (+i.valueAddNumber)
})
break
// 4s店收入/年
case 'storeIncomeCount':
list.forEach(i => {
value = value + (+i.storeIncomeNumber)
})
break
// 服务商收入/年
case 'serviceIncomeCount':
list.forEach(i => {
value = value + (+i.serviceIncomeNumber)
})
break
// 单店均值
case 'singleValueAddCount':
let val = 0
list.forEach(i => {
val = val + (+i.valueAddNumber)
})
value = (val / storeNumber).toFixed(0)
break
// 单店均值
case 'singleStoreIncomeCount':
let val1 = 0
list.forEach(i => {
val1 = val1 + (+i.storeIncomeNumber)
})
value = (val1 / storeNumber).toFixed(0)
break
// 单店均值
case 'singleServiceIncomeCount':
let val2 = 0
list.forEach(i => {
val2 = val2 + (+i.serviceIncomeNumber)
})
value = (val2 / storeNumber).toFixed(0)
break
// 基盘客户数
case 'baseCustomersNumber':
if (typeIndex == '1.3') {
value = customNumber * storeNumber
} else {
value = carNumber * 12 * storeNumber
}
break
// 增量产值/年(单个产品)总
case 'valueAddNumber':
if (typeIndex == '1.3') {
value = (customNumber * storeNumber* rate * averagePrice).toFixed(0)
} else {
value = (carNumber * 12 * storeNumber * rate * averagePrice).toFixed(0)
}
break
// 单店产值
case 'singleValueAddNumber':
if (typeIndex == '1.3') {
value = (customNumber * storeNumber* rate * averagePrice / storeNumber).toFixed(0)
} else {
value = (carNumber * 12 * storeNumber * rate * averagePrice / storeNumber).toFixed(0)
}
break
// 4s店收入/年
case 'storeIncomeNumber':
if (typeIndex == '1.3') {
value = (customNumber * storeNumber* rate * averagePrice * flowCost).toFixed(0)
} else {
value = (carNumber * 12 * storeNumber * rate * averagePrice * flowCost).toFixed(0)
}
break
// 服务商收入/年
case 'serviceIncomeNumber':
if (typeIndex == '1.3') {
value = (customNumber * storeNumber* rate * averagePrice * serviceDividendRatio).toFixed(0)
} else {
value = (carNumber * 12 * storeNumber * rate * averagePrice * serviceDividendRatio).toFixed(0)
}
break
// 4s店收入/年,单店
case 'singleStoreIncomeNumber':
if (typeIndex == '1.3') {
value = (customNumber * storeNumber* rate * averagePrice * flowCost / storeNumber).toFixed(0)
} else {
value = (carNumber * 12 * storeNumber * rate * averagePrice * flowCost / storeNumber).toFixed(0)
}
break
// 服务商收入/年,单店
case 'singleServiceIncomeNumber':
if (typeIndex == '1.3') {
value = (customNumber * storeNumber* rate * averagePrice * serviceDividendRatio / storeNumber).toFixed(0)
} else {
value = (carNumber * 12 * storeNumber * rate * averagePrice * serviceDividendRatio / storeNumber).toFixed(0)
}
break
}
return value;
},
// 开始计算
getCalculate(checkArray, isCount = false) {
const checkList = checkArray
if (!isCount) {
const singleList = this.data.singleList
checkList.forEach(item => {
singleList.forEach(i => {
const value = this.formula(i, item)
item[i] = value
})
})
return checkList
} else {
const {countList} = this.data
const countData = {}
console.log(checkList)
checkList.forEach(i => {
countList.forEach(j => {
const value = this.formula(j, i, checkList)
countData[j] = value
})
})
return countData
}
},
// 编辑
toEdit(e) {
console.log(e)
const {item, index} = e.currentTarget.dataset
console.log(item)
this.setData({
visible: true,
'dialogData.rate': (item.rate * 10000 / 100).toFixed(2),
'dialogData.averagePrice': item.averagePrice,
'dialogData.index': index
});
},
showCalculate() {
this.setData({
visible: false
})
},
clickDialog(e) {
console.log(e.changedTouches[0].clientY);
if (e.changedTouches[0].clientY < 451) {
this.setData({
visible: false
});
}
},
submit(e) {
console.log(e, this.data.dialogData)
const {rate, averagePrice, index} = this.data.dialogData
console.log(index)
// const reg = /^[1-9]\d*$/
// const reg1 = /^[1-9]{0,1}\d{1}(.\d{0,2})$/
if (!rate) {
wx.showToast({
title: '请输入转化率',
icon: 'none',
duration: 2000
})
return
}
if (!averagePrice) {
wx.showToast({
title: '请输入客均单价',
icon: 'none',
duration: 2000
})
return
}
this.setData({
[`checkList[${index}].rate`]: rate / 100,
[`checkList[${index}].averagePrice`]: averagePrice,
visible: false
})
console.log(this.data)
const checkList = this.getCalculate(this.data.checkList)
const countData = this.getCalculate(this.data.checkList, true)
console.log(checkList, countData)
this.setData({
checkList,
countData
})
},
// 输入框输入
handleInput(e) {
console.log(e)
let value = e.detail.value
const name = e.target.dataset.name
const reg = /^[1-9]\d*$/
const reg1 = /^[1-9]{0,1}\d{1}(.\d{0,2})$/
console.log(value <100 && value > 0, (reg.test(value) || reg1.test(value)))
if (name == 'rate') {
if (value <= 0) {
value = null
} else if (value > 100) {
value = value.slice(0,2)
} else if (value > 0 && value < 100) {
const valueArr = value.split('.')
if (valueArr.length == 2) {
const decimal = value.split('.')[1].slice(0,2)
const integer = value.split('.')[0]
value = integer + '.' + decimal
}
} else {
console.log(value)
value = value.slice(0, value.length - 1)
}
} else {
value = this.validateNumber(value)
}
console.log(value)
const form = `dialogData.${name}`
this.setData({
[form]: value
})
// this.setData({
// 'dialogData.rate': value
// })
},
// 输入正整数校验
validateNumber(val) {
console.log(val, val.replace(/\D/g, ''))
return val == 0 ? '' : val.replace(/\D/g, '')
},
/**
* 生命周期函数--监听页面加载
*/
onLoad(options) {
wx.$router.getData(res => {
console.log(res)
const list = Util.deepClone(res)
this.setData({
formData: list
})
const checkList = this.getCalculate(list.checkArray)
const countData = this.getCalculate(list.checkArray, true)
console.log(checkList)
this.setData({
checkList,
countData,
})
console.log(countData)
})
},
/**
* 生命周期函数--监听页面初次渲染完成
*/
onReady() {
},
/**
* 生命周期函数--监听页面显示
*/
onShow() {
this.setData({
measureList: measureData.measureList
})
},
/**
* 生命周期函数--监听页面隐藏
*/
onHide() {
},
/**
* 生命周期函数--监听页面卸载
*/
onUnload() {
},
/**
* 页面相关事件处理函数--监听用户下拉动作
*/
onPullDownRefresh() {
},
/**
* 页面上拉触底事件的处理函数
*/
onReachBottom() {
},
/**
* 用户点击右上角分享
*/
onShareAppMessage() {
}
})
\ No newline at end of file \ No newline at end of file
{
"usingComponents": {},
"navigationBarTitleText": "测算结果"
}
\ No newline at end of file \ No newline at end of file
/* pages/measureResult/measureResult.wxss */
.wrapper {
padding-bottom: 90rpx;
}
.header-bg {
position: fixed;
top: 0;
left: 0;
width: 100%;
z-index: -1;
}
.banner1 {
height: 400rpx;
}
.wrapper-header {
padding: 48rpx 32rpx;
}
.store-number {
position: relative;
font-weight: 600;
font-size: 34rpx;
color: #2D2D2E;
}
.store-number::after {
content: '';
display: inline-block;
position: absolute;
left: 0;
bottom: -24rpx;
width: 48rpx;
height: 6rpx;
background-color: #F5A623;
}
.header-box {
margin-top: 62rpx;
}
.card-item {
display: inline-block;
width: calc(100%/3);
}
.card-label {
font-weight: 400;
font-size: 24rpx;
color: #2D2D33;
line-height: 36rpx;
}
.card-value {
display: flex;
align-items: baseline;
font-weight: 700;
font-size: 40rpx;
color: #FFA034;
line-height: 48rpx;
}
.card-single-unit {
display: inline-block;
font-size: 24rpx;
color: #1B233D;
}
.m-b-8 {
margin-bottom: 8rpx;
}
.m-b-4 {
margin-bottom: 4rpx;
}
.m-b-24 {
margin-top: 24rpx;
}
.card-box {
background: #FFFFFF;
box-shadow: 0 4rpx 24rpx 0 rgba(175,181,219,0.40);
border-radius: 16rpx;
margin: 0 24rpx 20rpx;
}
.card-title {
display: flex;
align-items: center;
justify-content: space-between;
font-weight: 500;
font-size: 32rpx;
color: #333333;
letter-spacing: 0;
line-height: 48rpx;
padding: 24rpx 32rpx;
border-bottom: 1rpx solid #F0F1F5;
}
.card-product {
display: inline-block;
font-weight: 400;
font-size: 28rpx;
color: #333333;
/* margin-left: 15rpx; */
}
.card-edit {
display: flex;
width: 100rpx;
align-items: center;
font-weight: 400;
font-size: 24rpx;
color: #5850FF;
}
.icon-edit {
margin-right: 8rpx;
width: 28rpx;
height: 28rpx;
}
.card-content {
padding: 23rpx 32rpx 32rpx;
}
.value-number {
margin-bottom: 32rpx;
}
.card-number {
display: inline-block;
}
.card-unit {
display: inline-block;
font-weight: 400;
font-size: 28rpx;
color: #FFA034;
}
.card-label.gray {
color: #6E6E7A;
font-weight: 400;
}
.card-value.gray {
font-size: 32rpx;
color: #6E6E7A;
font-weight: 400;
}
.card-value.card-single-value {
font-size: 32rpx;
color: #1B233D;
font-weight: 400;
}
.card-value.color {
color: #5850FF;
font-weight: 400;
font-size: 32rpx;
}
.card-value.normal {
color: #2D2D33;
font-weight: 400;
font-size: 32rpx;
}
/* 测算弹窗 */
.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: 540rpx;
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; */
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: 100%;
padding: 16rpx 20rpx;
border: 2rpx solid #E6E6E6;
border-radius: 4rpx;
}
.input-box {
position: relative;
/* margin-left: 64rpx; */
margin-right: 16rpx;
width: 446rpx;
}
.form-unit {
position: absolute;
right: -10rpx;
top: 50%;
transform: translateY(-50%);
font-size: 28rpx;
color: #9E9EA8;
}
.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;
}
\ No newline at end of file \ No newline at end of file
...@@ -37,6 +37,11 @@ Component({ ...@@ -37,6 +37,11 @@ Component({
prodPosterList(data){ prodPosterList(data){
return data.senceData[data.tabActive].posterList return data.senceData[data.tabActive].posterList
}, },
// 通知文字
scrollText(data){
let {tabActive,senceData} = data
return senceData[tabActive].scrollText
}
}, },
// 默认已深度监听 // 默认已深度监听
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
</van-tabs> </van-tabs>
</view> </view>
<view> <view>
<van-notice-bar custom-class="dy-notice" left-icon="{{IMG_URL}}index/ad.png" speed="{{30}}" text="在代码阅读过程中人们说脏话的频率是衡量代码质量的唯一标准。" /> <van-notice-bar custom-class="dy-notice" left-icon="{{IMG_URL}}index/ad.png" scrollable="{{false}}" text="{{scrollText}}" />
</view> </view>
<view class="pro-cont" id="pro-cont"> <view class="pro-cont" id="pro-cont">
<van-tree-select items="{{ items }}" height="{{contentHeight}}" main-active-index="{{ mainActiveIndex }}" bind:click-nav="onClickNav"> <van-tree-select items="{{ items }}" height="{{contentHeight}}" main-active-index="{{ mainActiveIndex }}" bind:click-nav="onClickNav">
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
<view class="bus-pro" bindtap="openBus"> <view class="bus-pro" bindtap="openBus">
+业务 +业务
</view> </view>
<view class="bus-pro" bindtap="openPro"> <view class="bus-pro" bindtap="openPro" wx:if="{{tabActive == 3}}">
+产品 +产品
</view> </view>
</view> </view>
......
...@@ -12,6 +12,7 @@ var senceData = [ ...@@ -12,6 +12,7 @@ var senceData = [
"sceneCode":"SC001", "sceneCode":"SC001",
tabname:'车损升级', tabname:'车损升级',
banner:`${IMG_URL}index/banner/banner0.png`, banner:`${IMG_URL}index/banner/banner0.png`,
scrollText:'车损升级详情',
sceneImgs:[ sceneImgs:[
`${IMG_URL}index/scene/scene00.png`, `${IMG_URL}index/scene/scene00.png`,
`${IMG_URL}index/scene/scene01.png`, `${IMG_URL}index/scene/scene01.png`,
...@@ -81,6 +82,7 @@ var senceData = [ ...@@ -81,6 +82,7 @@ var senceData = [
"sceneCode":"SC002", "sceneCode":"SC002",
tabname:'精品升级', tabname:'精品升级',
banner:`${IMG_URL}index/banner/banner1.png`, banner:`${IMG_URL}index/banner/banner1.png`,
scrollText:'精品升级详情',
sceneImgs:[ sceneImgs:[
`${IMG_URL}index/scene/scene10.png`, `${IMG_URL}index/scene/scene10.png`,
`${IMG_URL}index/scene/scene11.png`, `${IMG_URL}index/scene/scene11.png`,
...@@ -127,6 +129,7 @@ var senceData = [ ...@@ -127,6 +129,7 @@ var senceData = [
"sceneCode":"SC003", "sceneCode":"SC003",
tabname:'膨胀金活动', tabname:'膨胀金活动',
banner:`${IMG_URL}index/banner/banner2.png`, banner:`${IMG_URL}index/banner/banner2.png`,
scrollText:'膨胀金活动详情',
sceneImgs:[ sceneImgs:[
`${IMG_URL}index/scene/scene20.png`, `${IMG_URL}index/scene/scene20.png`,
`${IMG_URL}index/scene/scene21.png`, `${IMG_URL}index/scene/scene21.png`,
...@@ -181,6 +184,7 @@ var senceData = [ ...@@ -181,6 +184,7 @@ var senceData = [
"sceneCode":"SC004", "sceneCode":"SC004",
tabname:'众筹活动', tabname:'众筹活动',
banner:`${IMG_URL}index/banner/banner3.png`, banner:`${IMG_URL}index/banner/banner3.png`,
scrollText:'众筹活动详情',
sceneImgs:[ sceneImgs:[
`${IMG_URL}index/scene/scene30.png`, `${IMG_URL}index/scene/scene30.png`,
`${IMG_URL}index/scene/scene31.png`, `${IMG_URL}index/scene/scene31.png`,
...@@ -257,7 +261,7 @@ var senceData = [ ...@@ -257,7 +261,7 @@ var senceData = [
proName: '360全景导航', proName: '360全景导航',
price: '10000', price: '10000',
profit: '388800', profit: '388800',
type: 'service', type: 'light',
productType: 'navigation', productType: 'navigation',
path: 'navigationArround', path: 'navigationArround',
sale:10000, //销量 sale:10000, //销量
......
...@@ -134,10 +134,11 @@ Page({ ...@@ -134,10 +134,11 @@ Page({
}, },
// 预估弹框 // 预估弹框
showCalculate() { showCalculate() {
this.setData({ wx.$router.go("measure");
visible: !this.data.visible, // this.setData({
isReset: false // visible: !this.data.visible,
}) // isReset: false
// })
}, },
clickDialog(e) { clickDialog(e) {
console.log(e.changedTouches[0].clientY) console.log(e.changedTouches[0].clientY)
......
...@@ -51,6 +51,27 @@ ...@@ -51,6 +51,27 @@
color: #FFFFFF; color: #FFFFFF;
text-align: center; text-align: center;
line-height: 88rpx; line-height: 88rpx;
animation: scaleDrew 2.5s infinite;
} }
}
\ No newline at end of file \ No newline at end of file
}
@keyframes scaleDrew {
/* 定义关键帧、scaleDrew是需要绑定到选择器的关键帧名称 */
0% {
transform: scale(1);
}
25% {
transform: scale(0.95);
}
50% {
transform: scale(1);
}
75% {
transform: scale(0.95);
}
}
...@@ -52,7 +52,7 @@ Page({ ...@@ -52,7 +52,7 @@ Page({
if (!options || utils.isEmptyObj(options)) return if (!options || utils.isEmptyObj(options)) return
let {tabActive,videoIndex} = options let {tabActive,videoIndex} = options
// console.log("options: ", options, !!options); // console.log("options: ", options, !!options);
console.log('tabActive,videoIndex: ', tabActive,videoIndex); // console.log('tabActive,videoIndex: ', tabActive,videoIndex);
this.setData({ this.setData({
tabActive: tabActive, tabActive: tabActive,
videoIndex: videoIndex, videoIndex: videoIndex,
......
...@@ -160,6 +160,69 @@ const getCurrentPageUrl = () =>{ ...@@ -160,6 +160,69 @@ const getCurrentPageUrl = () =>{
return url return url
} }
const deepClone = (target) => {
const map = new WeakMap()
function isObject(target) {
return (typeof target === 'object' && target ) || typeof target === 'function'
}
function clone(data) {
if (!isObject(data)) {
return data
}
if ([Date, RegExp].includes(data.constructor)) {
return new data.constructor(data)
}
if (typeof data === 'function') {
return new Function('return ' + data.toString())()
}
const exist = map.get(data)
if (exist) {
return exist
}
if (data instanceof Map) {
const result = new Map()
map.set(data, result)
data.forEach((val, key) => {
if (isObject(val)) {
result.set(key, clone(val))
} else {
result.set(key, val)
}
})
return result
}
if (data instanceof Set) {
const result = new Set()
map.set(data, result)
data.forEach(val => {
if (isObject(val)) {
result.add(clone(val))
} else {
result.add(val)
}
})
return result
}
const keys = Reflect.ownKeys(data)
const allDesc = Object.getOwnPropertyDescriptors(data)
const result = Object.create(Object.getPrototypeOf(data), allDesc)
map.set(data, result)
keys.forEach(key => {
const val = data[key]
if (isObject(val)) {
result[key] = clone(val)
} else {
result[key] = val
}
})
return result
}
return clone(target)
}
const Util = { const Util = {
getImgVersion, getImgVersion,
onReachBottom, onReachBottom,
...@@ -168,6 +231,7 @@ const Util = { ...@@ -168,6 +231,7 @@ const Util = {
throttle, throttle,
isEmptyObj, isEmptyObj,
parseString, parseString,
getCurrentPageUrl getCurrentPageUrl,
deepClone
}; };
export default Util; export default Util;
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!