Commit 47af1d89 by 胡悦

xiugai

1 parent abc61b09
...@@ -34,9 +34,7 @@ Page({ ...@@ -34,9 +34,7 @@ Page({
productList: [], productList: [],
isReset: false, isReset: false,
hasPhoneNumber: false, hasPhoneNumber: false,
userInfo: { userInfo: {}
phone: ''
}
}, },
// tab切换 // tab切换
...@@ -52,14 +50,15 @@ Page({ ...@@ -52,14 +50,15 @@ Page({
// 提交测算 // 提交测算
submit(e) { submit(e) {
console.log(e); console.log(e);
let sales = e ? +e.detail.value.sales : this.data.formData.sales; let sales = e ? +e.detail.value.sales : this.data.formData.sales
let flow = e ? +e.detail.value.flow : this.data.formData.flow; let flow = e ? +e.detail.value.flow : this.data.formData.flow
const _this = this; const _this = this;
this.data.tabList.forEach((item, index) => { this.data.tabList.forEach((item, index) => {
item.productList.forEach((i, lastIndex) => { item.productList.forEach((i, lastIndex) => {
if (i.profit) { if (i.profit) {
let name = `tabList[${index}].productList[${lastIndex}].profit`; let name = `tabList[${index}].productList[${lastIndex}].profit`;
let profit = _this.formula(i.productType, sales, flow); let profit = _this.formula(i.productType, sales, flow);
console.log(name, profit)
this.setData({ this.setData({
[name]: profit, [name]: profit,
}); });
...@@ -67,8 +66,9 @@ Page({ ...@@ -67,8 +66,9 @@ Page({
}); });
}); });
this.setData({ this.setData({
visible: false, visible: false
}); });
this.showCase()
}, },
// 计算公式,参数:productType // 计算公式,参数:productType
formula(productType, sales, flow) { formula(productType, sales, flow) {
...@@ -112,13 +112,12 @@ Page({ ...@@ -112,13 +112,12 @@ Page({
break; break;
} }
console.log(profit.length); console.log(profit.length);
console.log(productType, sales, flow, profit);
if (profit.length > 8) { if (profit.length > 8) {
return (profit / 10000).toFixed(0) + "万"; return (profit / 10000).toFixed(0) + "万";
} else { } else {
return profit; return profit;
} }
console.log(productType, sales, flow, profit);
return profit;
}, },
reset() { reset() {
this.setData({ this.setData({
...@@ -167,6 +166,7 @@ Page({ ...@@ -167,6 +166,7 @@ Page({
this.showCase() this.showCase()
}, },
showCase() { showCase() {
console.log(this.data.userInfo)
if (this.data.userInfo && this.data.userInfo.phone) { if (this.data.userInfo && this.data.userInfo.phone) {
this.setData({ this.setData({
hasPhoneNumber: true, hasPhoneNumber: true,
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
<!-- 特色产品 --> <!-- 特色产品 -->
<view class="product-box"> <view class="product-box">
<view class="product-title">特色产品</view> <view class="product-title">特色产品</view>
<view class="product-tips">预估收益根据您的新车销量 {{formData.sales}}台 测算所得</view> <view class="product-tips">预估收益根据您的输入的门店情况测算所得</view>
<view class="product-list"> <view class="product-list">
<block wx:for="{{productList}}" wx:key="ind"> <block wx:for="{{productList}}" wx:key="ind">
<view class="product-item" bindtap="goDetail" data-item="{{item.path}}"> <view class="product-item" bindtap="goDetail" data-item="{{item.path}}">
......
...@@ -27,8 +27,8 @@ var tabList = [ ...@@ -27,8 +27,8 @@ var tabList = [
], ],
videoList: [ videoList: [
{ {
videoUrl: 'difital_card_30s', videoUrl: 'digital_card_30s',
posterUrl: 'difital_card_30s_bitmap', posterUrl: 'digital_card_30s_bitmap',
name: '数字无忧卡服务30秒' name: '数字无忧卡服务30秒'
}, },
{ {
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
{ {
"name": "", "name": "",
"pathName": "pages/addValue/addValue/addValue", "pathName": "pages/addValue/addValue/addValue",
"query": "", "query": "scene=sceneId%3D3102",
"launchMode": "default", "launchMode": "default",
"scene": null "scene": null
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!