From ce223f09d827c19a2d6d03c693316ff7b6bf9a51 Mon Sep 17 00:00:00 2001 From: erio Date: Sat, 14 Mar 2026 00:54:05 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E6=89=80=E6=9C=89=E6=94=AF=E4=BB=98?= =?UTF-8?q?=E5=85=A5=E5=8F=A3=E5=85=B3=E9=97=AD=E6=97=B6=E6=AD=A3=E7=A1=AE?= =?UTF-8?q?=E6=98=BE=E7=A4=BA"=E5=85=A5=E5=8F=A3=E6=9C=AA=E5=BC=80?= =?UTF-8?q?=E6=94=BE"=E6=8F=90=E7=A4=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 当没有可用支付方式(未配置或被禁用)且没有订阅套餐时, 显示"充值/订阅 入口未开放"提示,而不是空的订阅UI --- src/app/pay/page.tsx | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/app/pay/page.tsx b/src/app/pay/page.tsx index 0e1c4cb..a7b4184 100644 --- a/src/app/pay/page.tsx +++ b/src/app/pay/page.tsx @@ -130,6 +130,8 @@ function PayContent() { const hasChannels = channels.length > 0; // 是否有可售卖套餐 const hasPlans = plans.length > 0; + // 是否可以充值(未禁用且有支付方式) + const canTopUp = !balanceDisabled && config.enabledPaymentTypes.length > 0; useEffect(() => { if (typeof window === 'undefined') return; @@ -467,8 +469,8 @@ function PayContent() { }; // ── 渲染 ── - // R7: 检查是否所有入口都关闭 - const allEntriesClosed = channelsLoaded && balanceDisabled && !hasPlans; + // R7: 检查是否所有入口都关闭(无可用充值方式 且 无订阅套餐) + const allEntriesClosed = channelsLoaded && !canTopUp && !hasPlans; const showMainTabs = channelsLoaded && !allEntriesClosed && (hasChannels || hasPlans); const pageTitle = showMainTabs ? pickLocaleText(locale, '选择适合你的 订阅套餐', 'Choose Your Plan') @@ -595,7 +597,7 @@ function PayContent() {

- {pickLocaleText(locale, '充值/订阅入口已被管理员关闭', 'Recharge / Subscription entry has been closed by admin')} + {pickLocaleText(locale, '充值/订阅 入口未开放', 'Recharge / Subscription entry is not available')}

{pickLocaleText(locale, '如有疑问,请联系管理员', 'Please contact the administrator if you have questions')} @@ -606,9 +608,9 @@ function PayContent() { {/* ── 有渠道配置:新版UI ── */} {channelsLoaded && showMainTabs && (activeMobileTab === 'pay' || !isMobile) && !selectedPlan && !showTopUpForm && ( <> - + - {mainTab === 'topup' && !balanceDisabled && ( + {mainTab === 'topup' && canTopUp && (

{/* 按量付费说明 banner */}
0 && !selectedPlan && ( + {channelsLoaded && !showMainTabs && canTopUp && !selectedPlan && ( <> {isMobile ? ( activeMobileTab === 'pay' ? (