feat: 支持官方支付宝与易支付支付宝同时展示

- PaymentType 改为 string 类型,支持复合 key(如 alipay_direct)
- 官方支付宝注册为 alipay_direct,易支付保持 alipay/wxpay
- 前端按 PAYMENT_TYPE_META 展示标签区分(官方直连/易支付)
- 管理后台显示统一改为 getPaymentTypeLabel 通用映射
- 修复 admin/OrderTable 中 wechat 拼写错误
This commit is contained in:
erio
2026-03-06 15:33:22 +08:00
parent 01d5a0b3c4
commit f53aa9e14c
14 changed files with 85 additions and 36 deletions

View File

@@ -10,7 +10,7 @@ interface PaymentQRCodeProps {
qrCode?: string | null;
clientSecret?: string | null;
stripePublishableKey?: string | null;
paymentType?: 'alipay' | 'wxpay' | 'stripe';
paymentType?: string;
amount: number;
payAmount?: number;
expiresAt: string;
@@ -110,7 +110,7 @@ export default function PaymentQRCode({
}, [qrPayload]);
// Initialize Stripe Payment Element
const isStripe = paymentType === 'stripe';
const isStripe = paymentType?.startsWith('stripe');
useEffect(() => {
if (!isStripe || !clientSecret || !stripePublishableKey) return;
@@ -313,7 +313,7 @@ export default function PaymentQRCode({
}
};
const isWx = paymentType === 'wxpay';
const isWx = paymentType?.startsWith('wxpay');
const iconSrc = isStripe ? '' : isWx ? '/icons/wxpay.svg' : '/icons/alipay.svg';
const channelLabel = isStripe ? 'Stripe' : isWx ? '\u5FAE\u4FE1' : '\u652F\u4ED8\u5B9D';
const iconBgClass = isStripe ? 'bg-[#635bff]' : isWx ? 'bg-[#07C160]' : 'bg-[#1677FF]';