From bbeb31e8a33e00cb25dbfd5ab212f1db64e6ae7b Mon Sep 17 00:00:00 2001 From: paulGao Date: Fri, 21 Jan 2022 19:02:09 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E5=BA=97=E9=93=BA=E5=92=8C?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E4=BC=98=E6=83=A0=E5=88=B8=E5=90=8C=E6=97=B6?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E6=97=B6=EF=BC=8C=E6=98=BE=E7=A4=BA=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- buyer/src/pages/CouponCenter.vue | 2 ++ buyer/src/pages/payment/Pay.vue | 10 +++++++--- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/buyer/src/pages/CouponCenter.vue b/buyer/src/pages/CouponCenter.vue index e6220a07..e334f550 100644 --- a/buyer/src/pages/CouponCenter.vue +++ b/buyer/src/pages/CouponCenter.vue @@ -51,6 +51,7 @@ export default { list: [], // 优惠券列表 total: 0, // 优惠券总数 params: { // 请求参数 + getType: 'FREE', pageNumber: 1, pageSize: 20 } @@ -95,6 +96,7 @@ export default { content: '

优惠券领取成功,可到我的优惠券页面查看

', okText: '我的优惠券', cancelText: '立即使用', + closable: true, onOk: () => { this.$router.push('/home/Coupons') }, diff --git a/buyer/src/pages/payment/Pay.vue b/buyer/src/pages/payment/Pay.vue index b0d3a547..9b5d83b7 100644 --- a/buyer/src/pages/payment/Pay.vue +++ b/buyer/src/pages/payment/Pay.vue @@ -313,8 +313,12 @@ export default { let notSupArea = res.result.notSupportFreight; this.selectedCoupon = {}; if (res.result.platformCoupon) - this.selectedCoupon.platformCoupon = res.result.platformCoupon; - Object.assign(this.selectedCoupon, res.result.storeCoupons); + this.selectedCoupon[res.result.platformCoupon.memberCoupon.id] = res.result.platformCoupon; + if (res.result.storeCoupons && Object.keys(res.result.storeCoupons)[0]) { + let storeMemberCouponsId = Object.keys(res.result.storeCoupons)[0]; + let storeCouponId = res.result.storeCoupons[storeMemberCouponsId].memberCoupon.id; + this.selectedCoupon[storeCouponId] = res.result.storeCoupons[storeMemberCouponsId]; + } if (notSupArea) { let content = []; let title = ""; @@ -340,7 +344,7 @@ export default { const couponKeys = Object.keys(this.selectedCoupon); if (couponKeys.length) { this.couponList.forEach((e) => { - if (e.id === this.selectedCoupon[couponKeys].memberCoupon.id) { + if (this.selectedCoupon[e.id] && e.id === this.selectedCoupon[e.id].memberCoupon.id) { this.usedCouponId.push(e.id); } });