Commit 533a70e0 by 李嘉林

领取优惠券功能

parent a4ff3991
......@@ -511,12 +511,30 @@ export default {
},
// 领取优惠券
receiveCoupon(code, item) {
console.log("----领取优惠券",code, item)
this.usingIntegrals = (item.consumeIntegral - 0).toFixed(0);
this.couponCode = code;
this.couItem = item;
let _this = this;
if (item.receiveCostType == 1) {
this.showGetCouponPop = true;
return;
wx.showModal({
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 {
this.useCoupon(1);
}
......@@ -538,10 +556,11 @@ export default {
icon: "success"
})
}
// item.receive=false;
} else {
this.$toast(res.msg);
// item.receive=true;
wx.showToast({
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