Commit 47af1d89 by 胡悦

xiugai

1 parent abc61b09
......@@ -34,9 +34,7 @@ Page({
productList: [],
isReset: false,
hasPhoneNumber: false,
userInfo: {
phone: ''
}
userInfo: {}
},
// tab切换
......@@ -52,14 +50,15 @@ Page({
// 提交测算
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;
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);
console.log(name, profit)
this.setData({
[name]: profit,
});
......@@ -67,8 +66,9 @@ Page({
});
});
this.setData({
visible: false,
visible: false
});
this.showCase()
},
// 计算公式,参数:productType
formula(productType, sales, flow) {
......@@ -112,13 +112,12 @@ Page({
break;
}
console.log(profit.length);
console.log(productType, sales, flow, profit);
if (profit.length > 8) {
return (profit / 10000).toFixed(0) + "万";
} else {
return profit;
}
console.log(productType, sales, flow, profit);
return profit;
},
reset() {
this.setData({
......@@ -167,6 +166,7 @@ Page({
this.showCase()
},
showCase() {
console.log(this.data.userInfo)
if (this.data.userInfo && this.data.userInfo.phone) {
this.setData({
hasPhoneNumber: true,
......
......@@ -20,7 +20,7 @@
<!-- 特色产品 -->
<view class="product-box">
<view class="product-title">特色产品</view>
<view class="product-tips">预估收益根据您的新车销量 {{formData.sales}}台 测算所得</view>
<view class="product-tips">预估收益根据您的输入的门店情况测算所得</view>
<view class="product-list">
<block wx:for="{{productList}}" wx:key="ind">
<view class="product-item" bindtap="goDetail" data-item="{{item.path}}">
......
......@@ -27,8 +27,8 @@ var tabList = [
],
videoList: [
{
videoUrl: 'difital_card_30s',
posterUrl: 'difital_card_30s_bitmap',
videoUrl: 'digital_card_30s',
posterUrl: 'digital_card_30s_bitmap',
name: '数字无忧卡服务30秒'
},
{
......
......@@ -50,7 +50,7 @@
{
"name": "",
"pathName": "pages/addValue/addValue/addValue",
"query": "",
"query": "scene=sceneId%3D3102",
"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!