Commit 533a70e0 by 李嘉林

领取优惠券功能

parent a4ff3991
...@@ -511,12 +511,30 @@ export default { ...@@ -511,12 +511,30 @@ export default {
}, },
// 领取优惠券 // 领取优惠券
receiveCoupon(code, item) { receiveCoupon(code, item) {
console.log("----领取优惠券",code, item)
this.usingIntegrals = (item.consumeIntegral - 0).toFixed(0); this.usingIntegrals = (item.consumeIntegral - 0).toFixed(0);
this.couponCode = code; this.couponCode = code;
this.couItem = item; this.couItem = item;
let _this = this;
if (item.receiveCostType == 1) { if (item.receiveCostType == 1) {
this.showGetCouponPop = true; wx.showModal({
return; content: `是否消耗${this.usingIntegrals}积分领取`,
confirmText: "确认",
cancelText: "取消",
success: function(res) {
console.log(res);
//点击“确认”时打开设置页面
if (res.confirm) {
console.log("用户点击确认");
_this.useCoupon();
} else {
console.log("用户点击取消");
}
},
fail: function(res) {
wx.navigateBack();
}
});
} else { } else {
this.useCoupon(1); this.useCoupon(1);
} }
...@@ -538,10 +556,11 @@ export default { ...@@ -538,10 +556,11 @@ export default {
icon: "success" icon: "success"
}) })
} }
// item.receive=false;
} else { } else {
this.$toast(res.msg); wx.showToast({
// item.receive=true; title: res.data.msg,
icon: "none"
})
} }
}); });
}, },
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment