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

@@ -62,7 +62,7 @@
<image src="/static/bind-phone.png" mode="aspectFit" alt="绑定手机号"></image> <image src="/static/bind-phone.png" mode="aspectFit" alt="绑定手机号"></image>
</view> </view>
<view :class="['function-name', alreadyBindPhone ? 'text-primary' : '']"> <view :class="['function-name', alreadyBindPhone ? 'text-primary' : '']">
{{ alreadyBindPhone ? '已绑定' : '绑定手机号' }} {{ alreadyBindPhone ? '已绑定' : '绑定' }}
</view> </view>
</view> </view>
<view class="function-item interactive card-interactive" @tap="$emit('enter', 'change-phone')" role="button" <view class="function-item interactive card-interactive" @tap="$emit('enter', 'change-phone')" role="button"

View File

@@ -272,10 +272,13 @@
// 自定义金额 // 自定义金额
const customAmountNum = parseFloat(customAmount.value); const customAmountNum = parseFloat(customAmount.value);
if (!customAmountNum || customAmountNum < 0.01) { if (!customAmountNum || customAmountNum < 0.01) {
uni.showToast({ showRechargeModal.value = false;
title: '请输入正确的充值金额', setTimeout(() => {
icon: 'none' uni.showToast({
}); title: '请输入正确的充值金额',
icon: 'none'
});
}, 50);
return; return;
} }
amount = Math.round(customAmountNum * 100); // 转换为分 amount = Math.round(customAmountNum * 100); // 转换为分
@@ -283,10 +286,13 @@
// 预设金额 // 预设金额
amount = selectedAmount.value; amount = selectedAmount.value;
} else { } else {
uni.showToast({ showRechargeModal.value = false;
title: '请选择充值金额', setTimeout(() => {
icon: 'none' uni.showToast({
}); title: '请选择充值金额',
icon: 'none'
});
}, 50);
return; return;
} }
@@ -313,11 +319,14 @@
// 检查金额范围 // 检查金额范围
if (amount < checkData.min_amount || amount > checkData.max_amount) { if (amount < checkData.min_amount || amount > checkData.max_amount) {
uni.hideLoading(); uni.hideLoading();
uni.showToast({ showRechargeModal.value = false;
title: `充值金额范围:¥${(checkData.min_amount / 100).toFixed(2)} - ¥${(checkData.max_amount / 100).toFixed(2)}`, setTimeout(() => {
icon: 'none', uni.showToast({
duration: 2500 title: `充值金额范围:¥${(checkData.min_amount / 100).toFixed(2)} - ¥${(checkData.max_amount / 100).toFixed(2)}`,
}); icon: 'none',
duration: 2500
});
}, 50);
return; return;
} }
@@ -333,10 +342,12 @@
// 验证支付配置 // 验证支付配置
if (!rechargeData.pay_config || !rechargeData.pay_config.package) { if (!rechargeData.pay_config || !rechargeData.pay_config.package) {
uni.showToast({ setTimeout(() => {
title: '支付参数获取失败', uni.showToast({
icon: 'none' title: '支付参数获取失败',
}); icon: 'none'
});
}, 50);
return; return;
} }
@@ -360,10 +371,13 @@
uni.hideLoading(); uni.hideLoading();
console.error('充值失败', e); console.error('充值失败', e);
const errorMsg = e.msg || e.message || '充值失败,请稍后重试'; const errorMsg = e.msg || e.message || '充值失败,请稍后重试';
uni.showToast({ showRechargeModal.value = false;
title: errorMsg, setTimeout(() => {
icon: 'none' uni.showToast({
}); title: errorMsg,
icon: 'none'
});
}, 50);
} }
}; };

View File

@@ -34,11 +34,6 @@ const request = (options) => {
if (code === 0 || code === 200) { if (code === 0 || code === 200) {
resolve(data); resolve(data);
} else { } else {
uni.showToast({
title: msg || '请求失败',
icon: 'none',
duration: 2000
});
reject(res.data); reject(res.data);
} }
}, },