fix: calculate actual total item count for multi-item orders
This commit is contained in:
@ -24,7 +24,7 @@
|
||||
<view class="good-info-right">
|
||||
<text class="good-total-price">¥{{ actual_price }}</text>
|
||||
<text class="fs-24 app-fc-normal good-num">
|
||||
共1件
|
||||
共{{ totalCount }}件
|
||||
</text>
|
||||
</view>
|
||||
</view>
|
||||
@ -56,6 +56,11 @@
|
||||
return sum + price * number;
|
||||
}, 0).toFixed(2);
|
||||
},
|
||||
totalCount() {
|
||||
return this.data.reduce((sum, item) => {
|
||||
return sum + parseInt(item.number || 1);
|
||||
}, 0);
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
console.log(this.data,'--')
|
||||
|
||||
Reference in New Issue
Block a user