Commit e8779c14 by 宋冰琦

修复订单详情售罄单价展示问题

parent 3572496b
......@@ -87,6 +87,7 @@ export default {
available: [],
goods: {},
skusDefault: [],
skusSellout: [],
pirce: 0,
size: 0,
}
......@@ -102,6 +103,10 @@ export default {
if (skus) {
const sku = skus.find(v => v.isDefault == 1 && v.state == 1) || skus.find(v => v.isDefault == 0 && v.state == 1);
this.skusDefault = skus.find(v => v.isDefault == 1);
this.skusSellout = skus.find(v => v.isDefault == 1 && v.state == 1)
|| skus.find(v => v.state == 1)
|| skus.find(v => v.isDefault == 1)
|| skus[0]
if (!sku) return;
this.selected.push(...sku.rules)
skus.forEach(item => {
......@@ -233,10 +238,13 @@ export default {
priceTotal() {
let discount = 0;
let price = 0;
const { goods } = this;
const { goods,skusSellout } = this;
if (goods.sku) {
discount = goods.sku.discount * this.size
price = goods.sku.price * this.size
}else if(skusSellout){
discount = Number(skusSellout.discount)
price = Number(skusSellout.price)
}
return { discount: discount.toFixed(2), price: price.toFixed(2) }
}
......
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