商品详情: 调整购买时,价格显示为选中的价格
Showing
2 changed files
with
19 additions
and
1 deletions
@@ -9,7 +9,7 @@ | @@ -9,7 +9,7 @@ | ||
9 | </div> | 9 | </div> |
10 | <div class="product"> | 10 | <div class="product"> |
11 | <div> | 11 | <div> |
12 | - <template v-if="product.least_price >= 0"> ¥{{product.least_price}}</template> | 12 | + <template v-if="selectedPrice != null && selectedPrice >= 0"> ¥{{selectedPrice}}</template> |
13 | <template v-else> </template> | 13 | <template v-else> </template> |
14 | </div> | 14 | </div> |
15 | <div> | 15 | <div> |
@@ -89,6 +89,23 @@ export default { | @@ -89,6 +89,23 @@ export default { | ||
89 | 89 | ||
90 | return {}; | 90 | return {}; |
91 | }, | 91 | }, |
92 | + selectedPrice() { | ||
93 | + let price = this.product.least_price; | ||
94 | + | ||
95 | + if (this.config.type === 'sell') { | ||
96 | + return price; | ||
97 | + } | ||
98 | + | ||
99 | + if (this.selectedSize.size_id > 0) { | ||
100 | + if (this.selectedSize.least_price > 0) { | ||
101 | + price = this.selectedSize.least_price; | ||
102 | + } else { | ||
103 | + price = '-'; | ||
104 | + } | ||
105 | + } | ||
106 | + | ||
107 | + return price; | ||
108 | + }, | ||
92 | goods_name() { | 109 | goods_name() { |
93 | return get(this.product, 'goods_list[0].goods_name', ''); | 110 | return get(this.product, 'goods_list[0].goods_name', ''); |
94 | }, | 111 | }, |
-
Please register or login to post a comment