From 75f1e6ad9621cede597782ef750ce54eed5a4062 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=BD=87?= Date: Tue, 1 Apr 2025 01:25:35 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E4=BC=98=E6=83=A0=E5=88=B8?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=20bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/my/promation/activities/index.js | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/pages/my/promation/activities/index.js b/pages/my/promation/activities/index.js index cb0babb..71cbabb 100644 --- a/pages/my/promation/activities/index.js +++ b/pages/my/promation/activities/index.js @@ -16,7 +16,9 @@ Page({ isShowModal:false, - errorMsg:'' + errorMsg:'', + + canReceive:false }, /** @@ -43,26 +45,22 @@ Page({ getting:true }) commonApi.activities.receive(this.data.activityId).then((data)=>{ - wx.showToast({ - title: '领取成功', - }); this.setData({ isShowModal:true, + getting:false, reveivedSuccess:true, errorMsg:'恭喜您已领取成功!' }) }).catch((e)=>{ this.setData({ isShowModal:true, + getting:false, errorMsg:e.message||'领取错误' }) - this.setData({ - getting:false - }) }) }, navToIndex(){ - if(this.data.hasProduct){ + if(this.data.hasProduct&&this.data.canReceive){ wx.reLaunch({ url: '/pages/my/coupon/index', }) @@ -97,6 +95,7 @@ Page({ }); return userApi.coupon.check(this.data.activityId); }).then((data)=>{ + this.data.canReceive = data.can_receive; if(!data.can_receive){ this.setData({ isShowModal:true,