From 8dc8600b527efa41557328e6df4e6940b6096880 Mon Sep 17 00:00:00 2001 From: sexygoat <1538832180@qq.com> Date: Thu, 23 Apr 2026 16:49:24 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=BC=B9=E7=AA=97=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- components/FunctionCard.vue | 2 +- pages/my-wallet/my-wallet.vue | 56 ++++++++++++++++++++++------------- utils/request.js | 5 ---- 3 files changed, 36 insertions(+), 27 deletions(-) diff --git a/components/FunctionCard.vue b/components/FunctionCard.vue index 5d4e09c..9d82651 100644 --- a/components/FunctionCard.vue +++ b/components/FunctionCard.vue @@ -62,7 +62,7 @@ 绑定手机号 - {{ alreadyBindPhone ? '已绑定' : '绑定手机号' }} + {{ alreadyBindPhone ? '已绑定' : '未绑定' }} { + uni.showToast({ + title: '请输入正确的充值金额', + icon: 'none' + }); + }, 50); return; } amount = Math.round(customAmountNum * 100); // 转换为分 @@ -283,10 +286,13 @@ // 预设金额 amount = selectedAmount.value; } else { - uni.showToast({ - title: '请选择充值金额', - icon: 'none' - }); + showRechargeModal.value = false; + setTimeout(() => { + uni.showToast({ + title: '请选择充值金额', + icon: 'none' + }); + }, 50); return; } @@ -313,11 +319,14 @@ // 检查金额范围 if (amount < checkData.min_amount || amount > checkData.max_amount) { uni.hideLoading(); - uni.showToast({ - title: `充值金额范围:¥${(checkData.min_amount / 100).toFixed(2)} - ¥${(checkData.max_amount / 100).toFixed(2)}`, - icon: 'none', - duration: 2500 - }); + showRechargeModal.value = false; + setTimeout(() => { + uni.showToast({ + title: `充值金额范围:¥${(checkData.min_amount / 100).toFixed(2)} - ¥${(checkData.max_amount / 100).toFixed(2)}`, + icon: 'none', + duration: 2500 + }); + }, 50); return; } @@ -333,10 +342,12 @@ // 验证支付配置 if (!rechargeData.pay_config || !rechargeData.pay_config.package) { - uni.showToast({ - title: '支付参数获取失败', - icon: 'none' - }); + setTimeout(() => { + uni.showToast({ + title: '支付参数获取失败', + icon: 'none' + }); + }, 50); return; } @@ -360,10 +371,13 @@ uni.hideLoading(); console.error('充值失败', e); const errorMsg = e.msg || e.message || '充值失败,请稍后重试'; - uni.showToast({ - title: errorMsg, - icon: 'none' - }); + showRechargeModal.value = false; + setTimeout(() => { + uni.showToast({ + title: errorMsg, + icon: 'none' + }); + }, 50); } }; diff --git a/utils/request.js b/utils/request.js index 71de9b0..e0cf1bc 100644 --- a/utils/request.js +++ b/utils/request.js @@ -34,11 +34,6 @@ const request = (options) => { if (code === 0 || code === 200) { resolve(data); } else { - uni.showToast({ - title: msg || '请求失败', - icon: 'none', - duration: 2000 - }); reject(res.data); } },