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,