Commit e8779c14 by 宋冰琦

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

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