fix: 修复 isAlipayDirect 变量声明顺序导致构建失败
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -70,6 +70,9 @@ export default function PaymentQRCode({
|
|||||||
const [popupBlocked, setPopupBlocked] = useState(false);
|
const [popupBlocked, setPopupBlocked] = useState(false);
|
||||||
const paymentMethodListenerAdded = useRef(false);
|
const paymentMethodListenerAdded = useRef(false);
|
||||||
|
|
||||||
|
// alipay_direct 使用电脑网站支付,payUrl 是跳转链接不是二维码内容
|
||||||
|
const isAlipayDirect = paymentType === 'alipay_direct';
|
||||||
|
|
||||||
const qrPayload = useMemo(() => {
|
const qrPayload = useMemo(() => {
|
||||||
// alipay_direct 的 payUrl 是跳转链接,不应生成二维码
|
// alipay_direct 的 payUrl 是跳转链接,不应生成二维码
|
||||||
if (isAlipayDirect && !qrCode) return '';
|
if (isAlipayDirect && !qrCode) return '';
|
||||||
@@ -316,8 +319,6 @@ export default function PaymentQRCode({
|
|||||||
};
|
};
|
||||||
|
|
||||||
const isWx = paymentType?.startsWith('wxpay');
|
const isWx = paymentType?.startsWith('wxpay');
|
||||||
// alipay_direct 使用电脑网站支付,payUrl 是跳转链接不是二维码内容
|
|
||||||
const isAlipayDirect = paymentType === 'alipay_direct';
|
|
||||||
const iconSrc = isStripe ? '' : isWx ? '/icons/wxpay.svg' : '/icons/alipay.svg';
|
const iconSrc = isStripe ? '' : isWx ? '/icons/wxpay.svg' : '/icons/alipay.svg';
|
||||||
const channelLabel = isStripe ? 'Stripe' : isWx ? '\u5FAE\u4FE1' : '\u652F\u4ED8\u5B9D';
|
const channelLabel = isStripe ? 'Stripe' : isWx ? '\u5FAE\u4FE1' : '\u652F\u4ED8\u5B9D';
|
||||||
const iconBgClass = isStripe ? 'bg-[#635bff]' : isWx ? 'bg-[#07C160]' : 'bg-[#1677FF]';
|
const iconBgClass = isStripe ? 'bg-[#635bff]' : isWx ? 'bg-[#07C160]' : 'bg-[#1677FF]';
|
||||||
|
|||||||
Reference in New Issue
Block a user