|
@@ -152,13 +152,9 @@
|
|
|
</view>
|
|
|
</view>
|
|
|
<view class="thr">
|
|
|
- <view class="thr_1">
|
|
|
- <text>商品金额</text>
|
|
|
- <text>¥{{info.total_detail.goods_total}}</text>
|
|
|
- </view>
|
|
|
- <view class="thr_1">
|
|
|
- <text>运费</text>
|
|
|
- <text>¥{{info.total_detail.freight_total}}</text>
|
|
|
+ <view class="thr_1" v-for="(item,index) in info.total_detail" :key="index">
|
|
|
+ <text>{{item.zh}}</text>
|
|
|
+ <text>¥{{item.money}}</text>
|
|
|
</view>
|
|
|
<view class="thr_1">
|
|
|
<text>实付金额</text>
|
|
@@ -187,7 +183,7 @@
|
|
|
</scroll-view>
|
|
|
</view>
|
|
|
<view class="zero_1">
|
|
|
- <text>合计</text>
|
|
|
+ <text>合计:</text>
|
|
|
<text>¥{{info.goods_total}}</text>
|
|
|
</view>
|
|
|
</view>
|
|
@@ -230,31 +226,9 @@
|
|
|
if (res.errcode == '0') {
|
|
|
let status = that.statusList.find(i => i.value == res.data.status)
|
|
|
if (status) res.data.zhStatus = status.label;
|
|
|
- // 计算优惠劵
|
|
|
// 运费总数和商品总数相加
|
|
|
- let total = that.$plus(res.data.total_detail.freight_total, res.data.total_detail.goods_total)
|
|
|
- if (res.data?.total_detail?.discount_detail) {
|
|
|
- // 有优惠券
|
|
|
- var key = Object.keys(res.data.total_detail.discount_detail);
|
|
|
- var discount_detail = 0;
|
|
|
- for (let val of key) {
|
|
|
- for (let var1 in res.data.total_detail.discount_detail[val]) {
|
|
|
- // object取key和value
|
|
|
- if (Object.hasOwnProperty.call(res.data.total_detail.discount_detail[val], var1)) {
|
|
|
- var value = res.data.total_detail.discount_detail[val][var1]
|
|
|
- discount_detail = that.$plus(discount_detail, value)
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- // 优惠劵相减
|
|
|
- total = that.$minus(total, discount_detail);
|
|
|
- }
|
|
|
- if (res.data?.total_detail?.act) {
|
|
|
- let act_total = 0;
|
|
|
- for (let val of res.data.total_detail.act) act_total = that.$plus(act_total, val.discount)
|
|
|
- // 活动相减
|
|
|
- total = that.$minus(total, act_total);
|
|
|
- }
|
|
|
+ let total = 0;
|
|
|
+ for (let val of res.data?.total_detail) total = this.$plus(total, val.money)
|
|
|
res.data.goods_total = total
|
|
|
that.$set(that, `info`, res.data);
|
|
|
uni.hideLoading();
|