|
|
|
@ -378,35 +378,35 @@ Page({ |
|
|
|
coupon: app.globalData.couponInfo |
|
|
|
}) |
|
|
|
// 获取补贴
|
|
|
|
if (this.data.product) { |
|
|
|
commonApi.user_post("product/getProductAllowancePrice", { |
|
|
|
product_code: this.data.product.product.product_code |
|
|
|
}).then(resTwo => { |
|
|
|
if (resTwo && resTwo.code == 1) { |
|
|
|
this.setData({ |
|
|
|
allowance_data: resTwo.data |
|
|
|
}) |
|
|
|
let spread_price = Number(this.data.allowance_data.discount_limit_price - this.data.allowance_data.user_used_price) |
|
|
|
let sInfo = this.data.product.sku |
|
|
|
if (spread_price > 0) { |
|
|
|
if (spread_price < this.data.allowance_data.discount_rate / 100 * sInfo.price) { |
|
|
|
this.setData({ |
|
|
|
allowance_price: spread_price |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.setData({ |
|
|
|
allowance_price: this.data.allowance_data.discount_rate / 100 * sInfo.price |
|
|
|
}) |
|
|
|
} |
|
|
|
this.changePrice() |
|
|
|
} else { |
|
|
|
this.setData({ |
|
|
|
allowance_price: 0 |
|
|
|
}) |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
// if (this.data.product) {
|
|
|
|
// commonApi.user_post("product/getProductAllowancePrice", {
|
|
|
|
// product_code: this.data.product.product.product_code
|
|
|
|
// }).then(resTwo => {
|
|
|
|
// if (resTwo && resTwo.code == 1) {
|
|
|
|
// this.setData({
|
|
|
|
// allowance_data: resTwo.data
|
|
|
|
// })
|
|
|
|
// let spread_price = Number(this.data.allowance_data.discount_limit_price - this.data.allowance_data.user_used_price)
|
|
|
|
// let sInfo = this.data.product.sku
|
|
|
|
// if (spread_price > 0) {
|
|
|
|
// if (spread_price < this.data.allowance_data.discount_rate / 100 * sInfo.price) {
|
|
|
|
// this.setData({
|
|
|
|
// allowance_price: spread_price
|
|
|
|
// })
|
|
|
|
// } else {
|
|
|
|
// this.setData({
|
|
|
|
// allowance_price: this.data.allowance_data.discount_rate / 100 * sInfo.price
|
|
|
|
// })
|
|
|
|
// }
|
|
|
|
// this.changePrice()
|
|
|
|
// } else {
|
|
|
|
// this.setData({
|
|
|
|
// allowance_price: 0
|
|
|
|
// })
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
// })
|
|
|
|
// }
|
|
|
|
}, |
|
|
|
|
|
|
|
/** |
|
|
|
|