修改优惠券跳转 bug

This commit is contained in:
2025-04-01 01:25:35 +08:00
parent a184608c32
commit 75f1e6ad96

View File

@ -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,