Authored by zhangwenxue

商品详情: 调整购买时,价格显示为选中的价格

... ... @@ -275,6 +275,7 @@ export default {
height: 0;
padding-bottom: 100%;
position: relative;
box-sizing: border-box;
}
.size {
... ...
... ... @@ -9,7 +9,7 @@
</div>
<div class="product">
<div>
<template v-if="product.least_price >= 0"> ¥{{product.least_price}}</template>
<template v-if="selectedPrice != null && selectedPrice >= 0"> ¥{{selectedPrice}}</template>
<template v-else>&nbsp;</template>
</div>
<div>
... ... @@ -89,6 +89,23 @@ export default {
return {};
},
selectedPrice() {
let price = this.product.least_price;
if (this.config.type === 'sell') {
return price;
}
if (this.selectedSize.size_id > 0) {
if (this.selectedSize.least_price > 0) {
price = this.selectedSize.least_price;
} else {
price = '-';
}
}
return price;
},
goods_name() {
return get(this.product, 'goods_list[0].goods_name', '');
},
... ...