From 646bc25b4f2378dea2da585ebd432f177d740873 Mon Sep 17 00:00:00 2001 From: zzlgreat Date: Sat, 13 Dec 2025 10:46:00 +0800 Subject: [PATCH] update pay ui --- .../Subscription/SubscriptionContentNew.tsx | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/components/Subscription/SubscriptionContentNew.tsx b/src/components/Subscription/SubscriptionContentNew.tsx index 8c02d3d5..d5d26a22 100644 --- a/src/components/Subscription/SubscriptionContentNew.tsx +++ b/src/components/Subscription/SubscriptionContentNew.tsx @@ -483,7 +483,13 @@ export default function SubscriptionContentNew() { : '/api/payment/create-order'; // 检测是否为移动端设备 - const isMobileDevice = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); + const userAgent = navigator.userAgent; + const isMobileDevice = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(userAgent); + + // 调试日志 + console.log('[支付] User-Agent:', userAgent); + console.log('[支付] 检测为移动端:', isMobileDevice); + console.log('[支付] 支付方式:', paymentMethod); const response = await fetch(apiUrl, { method: 'POST', @@ -505,9 +511,13 @@ export default function SubscriptionContentNew() { if (paymentMethod === 'alipay') { // 支付宝:跳转到支付页面 if (data.data.pay_url) { - // 检测是否为移动端设备 + // 检测是否为移动端设备(与上面保持一致) const isMobileDevice = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent); + console.log('[支付宝] 订单创建成功'); + console.log('[支付宝] pay_url:', data.data.pay_url.substring(0, 100) + '...'); + console.log('[支付宝] 是否移动端跳转:', isMobileDevice); + if (isMobileDevice) { // 手机端:直接在当前页面跳转(可调起支付宝APP) toast({