fix: 弹窗提示
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 46s

This commit is contained in:
sexygoat
2026-04-23 16:49:24 +08:00
parent 94a31b2e47
commit 8dc8600b52
3 changed files with 36 additions and 27 deletions

View File

@@ -272,10 +272,13 @@
// 自定义金额
const customAmountNum = parseFloat(customAmount.value);
if (!customAmountNum || customAmountNum < 0.01) {
uni.showToast({
title: '请输入正确的充值金额',
icon: 'none'
});
showRechargeModal.value = false;
setTimeout(() => {
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);
}
};