Commit 98b1a091 authored by 刘攀's avatar 刘攀

Merge remote-tracking branch 'origin/hotfix/20190805-order-bug'

parents 7da22a58 fb78ab4e
......@@ -1095,23 +1095,32 @@ export default {
}
let callback = res => {
this.hideLoading()
if (res.errMsg) prompt.toast(res.errMsg)
// 计算减配送费(运费)
let freight = Number(res.data.freight).toFixed(2)
let orgFreight = freight
if (res.data.freight_minus) {
freight = util.numCalc('-', res.data.freight, res.data.freight_minus)
if (res.errMsg) {
prompt.toast(res.errMsg)
this.packageFee = this.freight = this.orgFreight = this.freightMinus = null
this.freightError = res.errMsg
this.amount = Number(this.baseAmount).toFixed(2)
} else {
// 计算减配送费(运费)
let freight = Number(res.data.freight).toFixed(2)
const orgFreight = freight
if (res.data.freight_minus) {
freight = util.numCalc('-', res.data.freight, res.data.freight_minus)
}
// 餐饮包装费
this.packageFee = Number(res.data.package_fee).toFixed(2)
// 零售运费、餐饮配送费
this.freight = freight
this.orgFreight = orgFreight
this.freightMinus = Number(res.data.freight_minus).toFixed(2)
this.freightError = ''
this.amount = (
Number(this.baseAmount) +
Number(freight) +
Number(res.data.package_fee)
).toFixed(2)
}
// 餐饮包装费
this.packageFee = res.errMsg ? null : Number(res.data.package_fee).toFixed(2)
// 零售运费、餐饮配送费
this.freight = res.errMsg ? null : freight
this.orgFreight = orgFreight
this.freightMinus = Number(res.data.freight_minus).toFixed(2)
this.freightError = res.errMsg ? res.errMsg : ''
this.amount = res.errMsg
? Number(this.baseAmount).toFixed(2)
: (Number(this.baseAmount) + Number(freight) + Number(res.data.package_fee)).toFixed(2)
resolve()
}
orderModel
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment