|
@@ -88,7 +88,7 @@
|
|
</view>
|
|
</view>
|
|
</view>
|
|
</view>
|
|
<uni-popup ref="popup" background-color="#fff" type="bottom">
|
|
<uni-popup ref="popup" background-color="#fff" type="bottom">
|
|
- <view class="content" v-if="type=='0'" v-for="(item,index) in addressList" :key="index">
|
|
|
|
|
|
+ <view class="content" v-for="(item,index) in addressList" :key="index">
|
|
<scroll-view scroll-y="true" class="scroll-view">
|
|
<scroll-view scroll-y="true" class="scroll-view">
|
|
<view class="one">
|
|
<view class="one">
|
|
<view class="one_1">
|
|
<view class="one_1">
|
|
@@ -118,7 +118,9 @@
|
|
</view>
|
|
</view>
|
|
</scroll-view>
|
|
</scroll-view>
|
|
</view>
|
|
</view>
|
|
- <view class="content" v-else-if="type=='1'">
|
|
|
|
|
|
+ </uni-popup>
|
|
|
|
+ <uni-popup ref="popup2" background-color="#fff" type="bottom">
|
|
|
|
+ <view class="content">
|
|
<scroll-view scroll-y="true" class="scroll-view">
|
|
<scroll-view scroll-y="true" class="scroll-view">
|
|
<discount :Style="Style" :couponList="couponList" @toDiscount="toDiscount"></discount>
|
|
<discount :Style="Style" :couponList="couponList" @toDiscount="toDiscount"></discount>
|
|
</scroll-view>
|
|
</scroll-view>
|
|
@@ -153,7 +155,6 @@ export default {
|
|
coupon: [],
|
|
coupon: [],
|
|
// 优惠劵名称
|
|
// 优惠劵名称
|
|
coupon_name: '',
|
|
coupon_name: '',
|
|
- type: '',
|
|
|
|
};
|
|
};
|
|
},
|
|
},
|
|
onLoad: async function (e) {
|
|
onLoad: async function (e) {
|
|
@@ -167,15 +168,13 @@ export default {
|
|
const that = this;
|
|
const that = this;
|
|
that.$set(that, 'coupon_name', e.name)
|
|
that.$set(that, 'coupon_name', e.name)
|
|
that.coupon.push(e._id)
|
|
that.coupon.push(e._id)
|
|
- that.$refs.popup.close();
|
|
|
|
- // TODO 修改实付金额的显示
|
|
|
|
- this.computedTotal()
|
|
|
|
|
|
+ that.$refs.popup2.close();
|
|
|
|
+ this.computedTotal();
|
|
},
|
|
},
|
|
// 选择收货地址
|
|
// 选择收货地址
|
|
toChoose() {
|
|
toChoose() {
|
|
const that = this;
|
|
const that = this;
|
|
if (that.addressList.length > 0) {
|
|
if (that.addressList.length > 0) {
|
|
- that.$set(that, 'type', '0')
|
|
|
|
that.$refs.popup.open();
|
|
that.$refs.popup.open();
|
|
} else {
|
|
} else {
|
|
uni.showToast({
|
|
uni.showToast({
|
|
@@ -187,9 +186,8 @@ export default {
|
|
// 选择优惠劵
|
|
// 选择优惠劵
|
|
toCoupon() {
|
|
toCoupon() {
|
|
const that = this;
|
|
const that = this;
|
|
- that.$set(that, 'type', '1')
|
|
|
|
that.$set(that, 'coupon', [])
|
|
that.$set(that, 'coupon', [])
|
|
- that.$refs.popup.open();
|
|
|
|
|
|
+ that.$refs.popup2.open();
|
|
},
|
|
},
|
|
// 是否选中
|
|
// 是否选中
|
|
toCheckbox(e) {
|
|
toCheckbox(e) {
|
|
@@ -336,11 +334,10 @@ export default {
|
|
that.$set(that, `total_detail`, arr.data.orderTotal);
|
|
that.$set(that, `total_detail`, arr.data.orderTotal);
|
|
// var total = arr.data.orderTotal.freight_total + arr.data.orderTotal.goods_total
|
|
// var total = arr.data.orderTotal.freight_total + arr.data.orderTotal.goods_total
|
|
// that.$set(that, `goods_total`, total);
|
|
// that.$set(that, `goods_total`, total);
|
|
- that.computedTotal();
|
|
|
|
|
|
+ this.computedTotal();
|
|
that.$set(that, `couponList`, arr.data.couponList);
|
|
that.$set(that, `couponList`, arr.data.couponList);
|
|
}
|
|
}
|
|
},
|
|
},
|
|
-
|
|
|
|
async computedTotal() {
|
|
async computedTotal() {
|
|
const total_detail = this.total_detail;
|
|
const total_detail = this.total_detail;
|
|
let total = this.$plus(total_detail.freight_total, total_detail.goods_total)
|
|
let total = this.$plus(total_detail.freight_total, total_detail.goods_total)
|