提交 10adfd58 编写于 作者: guangjun.yang's avatar guangjun.yang

请选择优惠券

上级 221032ee
......@@ -6,9 +6,9 @@
<img @click="cancle" src="../../images/cme/close.png" />
</article>
<article v-if="selectCouponList.length" class="list-wrapper">
<p v-if="currentCoupon.couponId">
<p v-if="currentCouponInfo.couponId">
已选择1张优惠券,共抵扣
<span class="sc thin">¥{{yuan(currentCoupon.discountAmount)}}</span>
<span class="sc thin">¥{{yuan(currentCouponInfo.discountAmount)}}</span>
</p>
<p v-else-if="goodsInfo4Coupon.count">
请选择优惠券
......@@ -81,21 +81,33 @@ export default {
},
//
watch: {
isShowCoupon: {
handler(newVal) {
// 如果打开了选择弹框,则重新选中已经选中的项目
if (newVal) {
this.currentCouponInfo = this.currentCoupon;
}
}
},
},
// watch: {
// showSelectCoupon: {
// handler(newVal) {
// console.log('showSelectCoupon');
// // 如果打开了选择弹框,则重新选中已经选中的项目
// if (newVal) {
// this.currentCouponInfo = this.currentCoupon;
// }
// }
// },
// },
computed: {
...mapGetters(['currentCoupon', 'goodsInfo4Coupon', 'selectCouponList']),
isShow: {
get() {
console.log('showSelectCoupon', this.showSelectCoupon);
if(this.showSelectCoupon) {
if(this.currentCoupon && this.currentCoupon.couponId) {
let index = this.selectCouponList.findIndex( item => {
return item.couponId = this.currentCoupon.couponId
});
this.currentCoupon.isChecked = true;
this.selectCouponList.splice(index, 1, this.currentCoupon);
}
this.currentCouponInfo = this.currentCoupon;
}
return this.showSelectCoupon;
},
set() {}
......@@ -124,7 +136,8 @@ export default {
cItem.isChecked = false;
});
item.isChecked = true;
this.currentCouponInfo = JSON.parse(JSON.stringify(item));
// this.currentCouponInfo = JSON.parse(JSON.stringify(item));
this.currentCouponInfo = item;
} else {
this.currentCouponInfo = {};
item.isChecked = false;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册