|
|
|
@ -144,7 +144,8 @@ Page({ |
|
|
|
// })
|
|
|
|
let price |
|
|
|
if (this.data.coupon) { |
|
|
|
if (this.data.coupon.discount_type == 'pricebreak') { |
|
|
|
console.log(app.globalData.couponInfo,this.data.coupon); |
|
|
|
if (this.data.coupon.activity.discount_type == 'pricebreak') { |
|
|
|
price = this.data.singlePrice * this.data.productNum - this.data.coupon.activity.money |
|
|
|
} else { |
|
|
|
price =(this.data.singlePrice * this.data.productNum * this.data.coupon.activity.fold)/ 10 |
|
|
|
@ -165,25 +166,26 @@ Page({ |
|
|
|
// console.log(this.data.singlePrice);
|
|
|
|
} |
|
|
|
// let price = this.data.singlePrice * this.data.productNum - (this.data.coupon?this.data.coupon.activity.money:0)
|
|
|
|
let price |
|
|
|
if (this.data.coupon) { |
|
|
|
if (this.data.coupon.discount_type == 'pricebreak') { |
|
|
|
price = this.data.singlePrice * this.data.productNum - this.data.coupon.activity.money |
|
|
|
} else { |
|
|
|
price =(this.data.singlePrice * this.data.productNum * this.data.coupon.activity.fold)/ 10 |
|
|
|
} |
|
|
|
} else { |
|
|
|
price = this.data.singlePrice * this.data.productNum |
|
|
|
} |
|
|
|
if (price >0) { |
|
|
|
this.setData({ |
|
|
|
price:price/100 |
|
|
|
}) |
|
|
|
}else { |
|
|
|
this.setData({ |
|
|
|
price:0 |
|
|
|
}) |
|
|
|
} |
|
|
|
// 多写了一遍
|
|
|
|
// let price
|
|
|
|
// if (this.data.coupon) {
|
|
|
|
// if (this.data.coupon.discount_type == 'pricebreak') {
|
|
|
|
// price = this.data.singlePrice * this.data.productNum - this.data.coupon.activity.money
|
|
|
|
// } else {
|
|
|
|
// price =(this.data.singlePrice * this.data.productNum * this.data.coupon.activity.fold)/ 10
|
|
|
|
// }
|
|
|
|
// } else {
|
|
|
|
// price = this.data.singlePrice * this.data.productNum
|
|
|
|
// }
|
|
|
|
// if (price >0) {
|
|
|
|
// this.setData({
|
|
|
|
// price:price/100
|
|
|
|
// })
|
|
|
|
// }else {
|
|
|
|
// this.setData({
|
|
|
|
// price:0
|
|
|
|
// })
|
|
|
|
// }
|
|
|
|
}, |
|
|
|
cancel: function () { |
|
|
|
this.setData({ |
|
|
|
@ -284,7 +286,7 @@ Page({ |
|
|
|
totalPrice(price) { |
|
|
|
let allPrice |
|
|
|
if (this.data.coupon) { |
|
|
|
if (this.data.coupon.discount_type == 'pricebreak') { |
|
|
|
if (this.data.coupon.activity.discount_type == 'pricebreak') { |
|
|
|
allPrice = this.data.singlePrice * this.data.productNum - this.data.coupon.activity.money |
|
|
|
} else { |
|
|
|
allPrice =(this.data.singlePrice * this.data.productNum * this.data.coupon.activity.fold)/ 10 |
|
|
|
|