From a58f332643c01469eae2c8dab587cea7361bdef3 Mon Sep 17 00:00:00 2001 From: xpz2018 <107107461@qq.com> Date: Thu, 26 Aug 2021 20:06:20 +0800 Subject: [PATCH] no message --- pages/process/payment/index.js | 10 ++++++--- pages/process/payment/index.wxml | 2 +- pages/storage/order-settlement/index.js | 25 ++++++++++++++++------- pages/storage/order-settlement/index.wxml | 7 ++++--- 4 files changed, 30 insertions(+), 14 deletions(-) diff --git a/pages/process/payment/index.js b/pages/process/payment/index.js index 7d19fcf..3cd76bf 100644 --- a/pages/process/payment/index.js +++ b/pages/process/payment/index.js @@ -104,12 +104,16 @@ Scene({ if (orderList && orderList.length) { for (let index = 0; index < orderList.length; index++) { const element = orderList[index] - amount = math.plus(amount, element.settlePrice) + amount = math.plus(amount, element.adjustedPrice) this.data.params.ids.push(element.id) if(!util.isEmpty(element.bankCardNo)){ this.data.params.bankCardNo = element.bankCardNo } - this.data.settleType = String(element.settleType) + // this.data.settleType = String(element.settleType) + } + var settleType = app.userInfo.factory.settleType + if(settleType){ + this.data.settleType = String(settleType) } this.data.orderStatus = orderList[0].status this.setData({ @@ -142,7 +146,7 @@ Scene({ this.data.params.ids = [] for (let index = 0; index < this.data.orderList.length; index++) { if(!this.data.orderList[index].checked){ - amount = math.plus(amount, this.data.orderList[index].settlePrice) + amount = math.plus(amount, this.data.orderList[index].adjustedPrice) this.data.params.ids.push(this.data.orderList[index].id) } } diff --git a/pages/process/payment/index.wxml b/pages/process/payment/index.wxml index 80a1417..e4ad59b 100644 --- a/pages/process/payment/index.wxml +++ b/pages/process/payment/index.wxml @@ -61,7 +61,7 @@ 品类:{{item.productName}} 重量:{{item.settleWeight}}公斤 - 金额:{{formate.formateAmount(item.settlePrice, 2)}}元 + 金额:{{formate.formateAmount(item.adjustedPrice, 2)}}元 diff --git a/pages/storage/order-settlement/index.js b/pages/storage/order-settlement/index.js index a13989e..ff2b951 100644 --- a/pages/storage/order-settlement/index.js +++ b/pages/storage/order-settlement/index.js @@ -152,17 +152,28 @@ Scene({ } else { this.setData({ ['form.netWeight']: e.detail }) } + } else { + this.statAmount() } - this.statAmount() }, statAmount: function(){ - if(!util.isEmpty(this.data.form.settleUnitPrice) && !util.isEmpty(this.data.form.settleWeight)){ - var amout = math.times(this.data.form.settleUnitPrice, this.data.form.settleWeight) - if(!util.isEmpty(this.data.form.otherFee)){ - amout = math.minus(amout, this.data.form.otherFee) - } - this.setData({ ['form.settlePrice']: amout }) + if(util.isEmpty(this.data.form.receivablePrice)){ + return + } + var amout = Number(this.data.form.receivablePrice) + if(!util.isEmpty(this.data.form.freight)){ + amout = math.minus(amout, this.data.form.freight) + } + if(!util.isEmpty(this.data.form.proxyPaySurcharge)){ + amout = math.minus(amout, this.data.form.proxyPaySurcharge) + } + if(!util.isEmpty(this.data.form.otherFee)){ + amout = math.minus(amout, this.data.form.otherFee) + } + if(!util.isEmpty(this.data.form.subsidy)){ + amout = math.plus(amout, this.data.form.subsidy) } + this.setData({ amout }) }, fileChange: function({detail}){ this.data.fileList = detail.fileList diff --git a/pages/storage/order-settlement/index.wxml b/pages/storage/order-settlement/index.wxml index 1c1c6a4..8652712 100644 --- a/pages/storage/order-settlement/index.wxml +++ b/pages/storage/order-settlement/index.wxml @@ -10,8 +10,8 @@ 结算信息 - - 关闭订单 + 关闭订单 + @@ -26,11 +26,12 @@ - + +