diff --git a/pages/user/index.vue b/pages/user/index.vue index 387dbe0..9e96e62 100644 --- a/pages/user/index.vue +++ b/pages/user/index.vue @@ -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}); }); } },