|
|
@@ -139,7 +139,7 @@ const PaymentPage = () => {
|
|
|
|
|
|
// 处理额度支付
|
|
|
const handleCreditPayment = async () => {
|
|
|
- if (!orderId || !amount) {
|
|
|
+ if (!orderId) {
|
|
|
setErrorMessage('订单信息不完整')
|
|
|
return
|
|
|
}
|
|
|
@@ -149,6 +149,7 @@ const PaymentPage = () => {
|
|
|
return
|
|
|
}
|
|
|
|
|
|
+ // 检查额度是否足够(使用订单金额检查)
|
|
|
if (creditBalance.availableAmount < amount) {
|
|
|
setErrorMessage(`额度不足,可用额度: ¥${creditBalance.availableAmount.toFixed(2)}`)
|
|
|
return
|
|
|
@@ -161,8 +162,7 @@ const PaymentPage = () => {
|
|
|
try {
|
|
|
const response = await creditBalanceClient.payment.$post({
|
|
|
json: {
|
|
|
- amount: amount,
|
|
|
- referenceId: orderNo || `ORD${orderId}`,
|
|
|
+ referenceId: orderId.toString(), // 传递订单ID而不是订单号
|
|
|
remark: `订单支付 - ${orderNo || `ORD${orderId}`}`
|
|
|
}
|
|
|
})
|