This commit is contained in:
@@ -62,7 +62,7 @@
|
||||
<image src="/static/bind-phone.png" mode="aspectFit" alt="绑定手机号"></image>
|
||||
</view>
|
||||
<view :class="['function-name', alreadyBindPhone ? 'text-primary' : '']">
|
||||
{{ alreadyBindPhone ? '已绑定' : '绑定手机号' }}
|
||||
{{ alreadyBindPhone ? '已绑定' : '未绑定' }}
|
||||
</view>
|
||||
</view>
|
||||
<view class="function-item interactive card-interactive" @tap="$emit('enter', 'change-phone')" role="button"
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user