Commit eade8b7a by daqian

默认优惠价

parent f183ca51
...@@ -98,14 +98,21 @@ wxService.page({ ...@@ -98,14 +98,21 @@ wxService.page({
this.setPayPrice() this.setPayPrice()
}, },
setPayPrice() { setPayPrice() {
const { currentCoupon, orderInitPrice, isSelect, plusMemberPrice } = this.data const { currentCoupon, orderInitPrice, isSelect, plusMemberPrice, defalutCoupon } = this.data
let newCurrentCoupon = currentCoupon ? currentCoupon : 0 let newCurrentCoupon = currentCoupon ? currentCoupon : 0
let orderCoupon = parseFloat(newCurrentCoupon) // 优惠券价格 let orderCoupon = parseFloat(newCurrentCoupon) // 优惠券价格
let plusPrice = isSelect ? plusMemberPrice : 0 // plus let plusPrice = isSelect ? plusMemberPrice : 0 // plus
let calCouponPrice = defalutCoupon ? defalutCoupon : orderCoupon
console.log('优惠价', orderCoupon)
console.log('默认优惠', defalutCoupon)
console.log('参与计算coupon', calCouponPrice)
// 实际价格 - 优惠价 + plus // 实际价格 - 优惠价 + plus
this.setData({ this.setData({
// orderPrice: Math.round(orderInitPrice - orderCoupon) // orderPrice: Math.round(orderInitPrice - orderCoupon)
orderPrice: orderInitPrice - orderCoupon + plusPrice // orderPrice: orderInitPrice - orderCoupon + plusPrice
orderPrice: orderInitPrice - calCouponPrice + plusPrice
}) })
}, },
formSubmit(e) { formSubmit(e) {
......
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