优惠券:完善优惠券领取接口

pull/3/head
owen 2023-09-26 23:20:56 +08:00
parent 810f311a13
commit 78da791d4c
5 changed files with 9 additions and 8 deletions

View File

@ -80,7 +80,7 @@
methods: { methods: {
close: function() { close: function() {
this.type = 1 this.type = 1
this.$emit('ChangCouponsClone'); this.$emit('ChangCouponsClose');
}, },
/** /**
* 选择优惠劵 * 选择优惠劵

View File

@ -226,7 +226,7 @@
<!-- 优惠劵弹窗 --> <!-- 优惠劵弹窗 -->
<couponListWindow <couponListWindow
:coupon='coupon' :coupon='coupon'
@ChangCouponsClone="ChangCouponsClone" @ChangCouponsClose="ChangCouponsClose"
@ChangCoupons="ChangCoupons" @ChangCoupons="ChangCoupons"
@tabCouponType="tabCouponType" @tabCouponType="tabCouponType"
/> />
@ -837,7 +837,7 @@
/** /**
* 关闭优惠劵弹窗 * 关闭优惠劵弹窗
*/ */
ChangCouponsClone: function() { ChangCouponsClose: function() {
this.$set(this.coupon, 'coupon', false) this.$set(this.coupon, 'coupon', false)
}, },
/** /**

View File

@ -394,7 +394,8 @@
*/ */
getCoupon: function(id, index) { getCoupon: function(id, index) {
CouponApi.takeCoupon(id).then(res => { CouponApi.takeCoupon(id).then(res => {
this.$set(this.couponList[index], 'takeStatus', true); //
this.$set(this.couponList[index], 'takeStatus', res.data !== true);
this.$util.Tips({ this.$util.Tips({
title: '领取成功' title: '领取成功'
}); });

View File

@ -139,7 +139,7 @@
<!-- 优惠劵的弹窗选择 --> <!-- 优惠劵的弹窗选择 -->
<couponListWindow <couponListWindow
:coupon='coupon' :coupon='coupon'
@ChangCouponsClone="ChangCouponsClone" @ChangCouponsClose="ChangCouponsClose"
:openType='openType' :openType='openType'
@ChangCoupons="ChangCoupons" @ChangCoupons="ChangCoupons"
:orderShow="orderShow" :orderShow="orderShow"
@ -441,7 +441,7 @@
/** /**
* 关闭 coupon 优惠劵的选择弹窗 * 关闭 coupon 优惠劵的选择弹窗
*/ */
ChangCouponsClone: function() { ChangCouponsClose: function() {
this.$set(this.coupon, 'coupon', false); this.$set(this.coupon, 'coupon', false);
}, },

View File

@ -111,8 +111,8 @@
getCoupon: function(id, index) { getCoupon: function(id, index) {
// //
CouponApi.takeCoupon(id).then(res => { CouponApi.takeCoupon(id).then(res => {
// todo take_limit_count //
this.couponsList[index].takeStatus = true; this.couponsList[index].takeStatus = res.data !== true;
this.$set(this, 'couponsList', this.couponsList); this.$set(this, 'couponsList', this.couponsList);
this.$util.Tips({ this.$util.Tips({
title: '领取成功' title: '领取成功'