|
|
@@ -28,7 +28,6 @@
|
|
|
@click="couponChange(item, index + 1)"
|
|
|
>
|
|
|
<div class="list-img">
|
|
|
- <!-- 已过期 -->
|
|
|
<template v-if="couponSelInx && couponSelInx == (index + 1)">
|
|
|
<img :src="`${constant.imgUrl}/retail/coupon/is-check.png`" alt mode="widthFix" />
|
|
|
</template>
|
|
|
@@ -36,7 +35,6 @@
|
|
|
<img :src="`${constant.imgUrl}/retail/coupon/no-check.png`" alt mode="widthFix" />
|
|
|
</template>
|
|
|
</div>
|
|
|
- <!-- 列表 -->
|
|
|
<div class="list-det">
|
|
|
<div class="list-det-left">
|
|
|
<div class="price-wrap">
|
|
|
@@ -90,6 +88,11 @@ export default {
|
|
|
newArr.push("member");
|
|
|
this.selIndex = 1;
|
|
|
this.memberCheck = true;
|
|
|
+
|
|
|
+ this.$emit("calcDiscount", {
|
|
|
+ memberDiscount: this.data.member.discount,
|
|
|
+ couponDiscountAmount: 0
|
|
|
+ });
|
|
|
}
|
|
|
if (!this.$util.isEmpty(this.data.coupon)) {
|
|
|
newArr.push("coupon");
|
|
|
@@ -108,23 +111,34 @@ export default {
|
|
|
return arr;
|
|
|
},
|
|
|
checkChange(e) {
|
|
|
- console.log("切换radio");
|
|
|
- this.$emit("calcDiscount", {
|
|
|
- memberDiscount: 0.8,
|
|
|
- couponDiscountAmount: 0
|
|
|
- });
|
|
|
-
|
|
|
this.selIndex = e.detail.value;
|
|
|
+
|
|
|
if (this.selIndex == 1) {
|
|
|
+ this.$emit("calcDiscount", {
|
|
|
+ memberDiscount: this.data.member.discount,
|
|
|
+ couponDiscountAmount: 0
|
|
|
+ });
|
|
|
+ this.couponSelInx = null
|
|
|
this.couponId = 0;
|
|
|
}
|
|
|
- this.$emit("checkChange");
|
|
|
+
|
|
|
+ if (this.selIndex == 2) {
|
|
|
+ this.$emit("calcDiscount", {
|
|
|
+ memberDiscount: 1,
|
|
|
+ couponDiscountAmount: 0
|
|
|
+ });
|
|
|
+ }
|
|
|
},
|
|
|
// 优惠券选择
|
|
|
couponChange(item, index) {
|
|
|
this.couponSelInx = this.couponSelInx == index ? null : index;
|
|
|
this.couponId = item.id;
|
|
|
- this.$emit("couponChange");
|
|
|
+
|
|
|
+ this.$emit("calcDiscount", {
|
|
|
+ memberDiscount: 1,
|
|
|
+ couponDiscountAmount: item.amount
|
|
|
+ });
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
};
|