fix:微信支付
All checks were successful
构建并部署前端到生产环境 / build-and-deploy (push) Successful in 4m41s

This commit is contained in:
luo
2026-09-23 09:32:48 +08:00
parent a81b403cce
commit e82b0ab5da
12 changed files with 254 additions and 13 deletions

View File

@@ -238,11 +238,13 @@
handlePaymentError,
isValidAlipayPaymentLink,
isValidWechatPayConfig,
markPendingPaymentRefresh,
openAlipayPayment,
PAYMENT_REFRESH_TARGETS,
showPaymentToast,
wechatH5Pay
} from '@/utils/payment.js';
import { getPaymentErrorMessage, isUnknownPaymentResult } from '@/utils/payment-attempt.js';
import { formatMoney } from '@/utils/display.js';
import { getDefaultPaymentMethod, getPaymentMethodOptions, normalizePaymentMethods } from '@/utils/payment-methods.js';
@@ -683,9 +685,12 @@
uni.hideLoading();
console.error('充值失败', error);
showRechargeModal.value = false;
if (isUnknownPaymentResult(error)) {
markPendingPaymentRefresh(PAYMENT_REFRESH_TARGETS.MY_WALLET);
}
setTimeout(() => {
uni.showToast({
title: error.msg || error.message || '充值失败,请稍后重试',
title: getPaymentErrorMessage(error, '充值失败,请稍后重试'),
icon: 'none'
});
}, 50);
@@ -744,8 +749,11 @@
} catch (error) {
uni.hideLoading();
console.error('获取支付配置失败', error);
if (isUnknownPaymentResult(error)) {
markPendingPaymentRefresh(PAYMENT_REFRESH_TARGETS.MY_WALLET);
}
uni.showToast({
title: error.msg || error.message || '支付失败,请稍后重试',
title: getPaymentErrorMessage(error),
icon: 'none'
});
} finally {