优化:兑换码使用时显示弹框提示,需要确认是否使用

This commit is contained in:
wuhui_zzw 2024-03-09 17:12:01 +08:00
parent a106aff01c
commit 87a4f5aefb
1 changed files with 28 additions and 14 deletions

View File

@ -806,21 +806,35 @@
success(res) {
let result = res.result || '';
if(result){
vipExchangeCode({
exchange_code: result
}).then(res => {
if(res.status == 200){
uni.showModal({
title: '开通成功',
success: (res) => {
uni.navigateTo({
url: '/pages/annex/vip_center/index'
});
}
});
uni.showModal({
title: '确认使用!',
content: '使用后当前兑换码将立即生效!是否确认使用?',
showCancel: true, //
cancelText: '取消', //
confirmText: '立即使用', //
success: (res) => {
if (res.confirm) {
vipExchangeCode({
exchange_code: result
}).then(res => {
if(res.status == 200){
uni.showModal({
title: '开通成功',
success: (res) => {
uni.navigateTo({
url: '/pages/annex/vip_center/index'
});
}
});
}
}).catch(err => {
_this.$util.Tips({title: err});
});
}
if (res.cancel) {
console.log("取消")
}
}
}).catch(err => {
_this.$util.Tips({title: err});
});
}
},