From 81c4e094c30d1cf6eb16e3b48951db06d5b1dc79 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=80=81=E5=8F=B6?= Date: Wed, 26 Jan 2022 15:03:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AE=A2=E5=8D=95=E7=99=BB=E8=AE=B0=E9=87=91?= =?UTF-8?q?=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/order/edit/index2.js | 36 +------- pages/order/register/index.js | 158 ++++++++++++++++++++------------ pages/order/register/index.wxml | 52 +++++++---- 3 files changed, 134 insertions(+), 112 deletions(-) diff --git a/pages/order/edit/index2.js b/pages/order/edit/index2.js index 2b4308b..0d1790d 100644 --- a/pages/order/edit/index2.js +++ b/pages/order/edit/index2.js @@ -1000,40 +1000,6 @@ Page({ }) }, - //输入车身优惠 - inputDisc(e) { - if(parseFloat(e.detail.value)>parseFloat(this.data.priceinfo.dis_money)){ - wx.showToast({ - title: '已超过车身可优惠价格', - icon: 'none' - }) - this.setData({ - [e.currentTarget.dataset.key]: '' - }) - }else{ - this.setData({ - [e.currentTarget.dataset.key]: e.detail.value?parseFloat(e.detail.value):'', - }) - } - }, - - //输入精品优惠 - inputDiscFine(e) { - if(parseFloat(e.detail.value)>parseFloat(this.data.priceinfo.dis_fine_money)){ - wx.showToast({ - title: '已超过精品可优惠价格', - icon: 'none' - }) - this.setData({ - [e.currentTarget.dataset.key]: '' - }) - }else{ - this.setData({ - [e.currentTarget.dataset.key]: e.detail.value?parseFloat(e.detail.value):'', - }) - } - }, - //添加精品 addFine(){ this.data.fines.push({ @@ -1068,7 +1034,7 @@ Page({ } }, - //快截输入价格 + //快截输入代办价格 fillAgency(e){ this.setData({ ['agencyList['+e.currentTarget.dataset.index+'].sprice']:parseFloat(e.currentTarget.dataset.sprice), diff --git a/pages/order/register/index.js b/pages/order/register/index.js index 18cb7bf..06db361 100644 --- a/pages/order/register/index.js +++ b/pages/order/register/index.js @@ -79,8 +79,6 @@ Page({ checkCount: 2, checktext: '3s', isShowRemarks:false,//意向金备注 - - disc_money:'',//车身优惠金额 srv_total:0,//代办费用 agencyList:[],//代办数组 fine_total:0,//精品费用 @@ -89,9 +87,6 @@ Page({ isShowContract:false,//是否显示生成合同 if_fine:false,//精品尊享包 - disc_fine_money:'',//精品优惠金额 - - deposit:'',//定金 fines:[ { @@ -236,9 +231,9 @@ Page({ icon: 'none' }) } - else if(this.data.deposit == '' ){ + else if(this.data.priceinfo.sdeposit == '' ){ wx.showToast({ - title: '请选择定金', + title: '请设置定金', icon: 'none' }) } @@ -576,7 +571,6 @@ Page({ _.apiQuery.getAppSeriesInfo(params).then(res => { this.setData({ priceinfo:res.data, - disc_money:'', }) }); } @@ -671,7 +665,7 @@ Page({ params['color_id'] = that.data.color_id; params['incolor_id'] = that.data.incolor_id; params['price'] = that.data.priceinfo.price; - params['deposit'] = that.data.deposit; + params['deposit'] = that.data.priceinfo.sdeposit; params['payway'] = that.data.paymentIndex==0?'1':'0'; params['delry_time'] = that.data.delry_time; if(that.data.finance_id!= ''){ @@ -695,8 +689,8 @@ Page({ if(that.data.credit != ''){ params['credit'] = that.data.credit; } - if(!!that.data.disc_money && that.data.disc_money != '' ){ - params['disc_money'] = that.data.disc_money; + if(!!that.data.priceinfo.sdisc_money && that.data.priceinfo.sdisc_money != '' ){ + params['disc_money'] = that.data.priceinfo.sdisc_money; } let srv_arr = [] that.data.agencyList.forEach(item => { @@ -716,8 +710,8 @@ Page({ } if(that.data.priceinfo.fine_money){ params['if_fine'] = that.data.if_fine?'1':'0'; - if(that.data.if_fine&&that.data.disc_fine_money!= ''){ - params['disc_fine_money'] = that.data.disc_fine_money; + if(that.data.if_fine&&that.data.priceinfo.sdisc_fine_money&&that.data.priceinfo.sdisc_fine_money!= ''){ + params['disc_fine_money'] = that.data.priceinfo.sdisc_fine_money; } } _.apiQuery.postAppCusorderV2(params).then(res => { @@ -792,15 +786,6 @@ Page({ } }, - //选择定金 - depositPicker(e){ - if(e.currentTarget.dataset.deposit != this.data.deposit){ - this.setData({ - deposit:e.currentTarget.dataset.deposit, - }) - } - }, - //显示选择客户 showSelectCustomer(){ this.setData({ @@ -979,44 +964,10 @@ Page({ changeFineBag(){ this.setData({ if_fine:!this.data.if_fine, - disc_fine_money:'', + 'priceinfo.sdisc_fine_money':'', }) }, - //输入车身优惠 - inputDisc(e) { - if(parseFloat(e.detail.value)>parseFloat(this.data.priceinfo.dis_money)){ - wx.showToast({ - title: '已超过车身可优惠价格', - icon: 'none' - }) - this.setData({ - [e.currentTarget.dataset.key]: '' - }) - }else{ - this.setData({ - [e.currentTarget.dataset.key]: e.detail.value?parseFloat(e.detail.value):'', - }) - } - }, - - //输入精品优惠 - inputDiscFine(e) { - if(parseFloat(e.detail.value)>parseFloat(this.data.priceinfo.dis_fine_money)){ - wx.showToast({ - title: '已超过精品可优惠价格', - icon: 'none' - }) - this.setData({ - [e.currentTarget.dataset.key]: '' - }) - }else{ - this.setData({ - [e.currentTarget.dataset.key]: e.detail.value?parseFloat(e.detail.value):'', - }) - } - }, - //推送链接 viewDetails(e){ wx.redirectTo({ @@ -1066,7 +1017,7 @@ Page({ } }, - //快截输入价格 + //快截输入代办价格 fillAgency(e){ this.setData({ ['agencyList['+e.currentTarget.dataset.index+'].sprice']:parseFloat(e.currentTarget.dataset.sprice), @@ -1120,4 +1071,95 @@ Page({ } }, + //选择定金 + fillDeposit(e){ + this.setData({ + 'priceinfo.sdeposit':parseFloat(e.currentTarget.dataset.deposit), + }) + }, + + //修改定金 + inputDeposit(e){ + this.setData({ + 'priceinfo.sdeposit':parseFloat(e.detail.value), + }) + }, + + //判断修改定金是否小于限制 + inputBlurDeposit(e){ + if(!this.data.priceinfo.sdeposit||this.data.priceinfo.deposit>parseFloat(this.data.priceinfo.sdeposit)){ + wx.showToast({ + title: '定金设置过低', + icon: 'none' + }) + this.setData({ + 'priceinfo.sdeposit':this.data.priceinfo.deposit, + }) + } + }, + + //选择车身优惠 + fillDisc_money(e){ + this.setData({ + 'priceinfo.sdisc_money':parseFloat(e.currentTarget.dataset.disc_money), + }) + }, + + //修改车身优惠 + inputDisc_money(e){ + this.setData({ + 'priceinfo.sdisc_money':parseFloat(e.detail.value), + }) + }, + + //判断修改车身优惠是否小于限制 + inputBlurDisc_money(e){ + if(this.data.priceinfo.dis_money - + {{item}} + - 车身优惠 - - - + 车身优惠 + + + + + {{item}} + + + + @@ -229,10 +236,16 @@ - 精品优惠 - - - + 精品优惠 + + + + + {{item}} + + + + @@ -251,11 +264,12 @@ - {{item.price}} - {{item.price+200}} - {{item.price+400}} - + + {{price_list}} + + + {{item.text}} @@ -399,21 +413,21 @@ 意向金 {{inten_money}} - + 定金 - {{deposit}} + {{priceinfo.sdeposit}} - + 车身优惠 - {{disc_money}} + {{priceinfo.sdisc_money}} 精品尊享包 {{priceinfo.fine_money}} - + 精品优惠 - {{disc_fine_money}} + {{priceinfo.sdisc_fine_money}} 委托代办