diff --git a/api/promotion/coupon.js b/api/promotion/coupon.js
index 0d2d08bd..c40c9a3d 100644
--- a/api/promotion/coupon.js
+++ b/api/promotion/coupon.js
@@ -6,6 +6,11 @@ export function takeCoupon(templateId) {
});
}
+// 获得匹配指定商品的优惠劵列表
+export function getMatchCouponList(data) {
+ return request.get("app-api/promotion/coupon/match-list", data);
+}
+
export function getCouponPage(data) {
return request.get("app-api/promotion/coupon/page", data);
}
diff --git a/components/couponListWindow/index.vue b/components/couponListWindow/index.vue
index 0508cd1b..bdf5d4c8 100644
--- a/components/couponListWindow/index.vue
+++ b/components/couponListWindow/index.vue
@@ -1,6 +1,6 @@
-
+
通用券
商品券
@@ -82,11 +82,14 @@
this.type = 1
this.$emit('ChangCouponsClone');
},
+ /**
+ * 选择优惠劵
+ */
getCouponUser: function(index, id) {
// 领取优惠劵时,如果已经领取,则直接跳过
let list = this.coupon.list;
if (list[index].takeStatus && this.openType === 0) {
- return true;
+ return;
}
switch (this.openType) {
case 0: // 领取优惠券
@@ -98,6 +101,11 @@
})
break;
case 1: // 使用优惠劵
+ // TODO 芋艿:需要额外把不可用优惠劵的样式做了;
+ if (list[index].match === false) {
+ alert('该优惠劵无法使用,原因:' + list[index].description);
+ return;
+ }
this.$emit('ChangCoupons', index);
break;
}
diff --git a/pages/users/order_confirm/index.vue b/pages/users/order_confirm/index.vue
index 3f410b2e..6a65813f 100644
--- a/pages/users/order_confirm/index.vue
+++ b/pages/users/order_confirm/index.vue
@@ -171,7 +171,6 @@