refactor(chat): remove weekly limit flow

This commit is contained in:
2026-07-01 13:12:14 +08:00
parent d1ccf3631e
commit f6e7adbe96
9 changed files with 33 additions and 89 deletions
+5 -16
View File
@@ -58,19 +58,13 @@ export function ChatScreen() {
authState.loginStatus !== "notLoggedIn" &&
authState.loginStatus !== "guest";
// 消息数量限制由后端统一返回 lockDetail,前端不再处理本地额度
// 发送能力由后端统一返回,当前只处理积分不足引导
const showMessageLimitBanner =
state.upgradePromptVisible &&
(state.upgradeReason === "weekly_limit" ||
state.upgradeReason === "insufficient_credits");
state.upgradeReason === "insufficient_credits";
const messageLimitTitle =
state.upgradeReason === "insufficient_credits"
? "Insufficient credits\nTop up to continue chatting"
: "The limit for free chat times\nhas been reached";
const messageLimitCtaLabel =
state.upgradeReason === "insufficient_credits"
? "Top up credits to continue"
: "Unlock your membership to continue";
"Insufficient credits\nTop up to continue chatting";
const messageLimitCtaLabel = "Top up credits to continue";
const externalBrowserPromptShownRef = useRef(false);
@@ -188,15 +182,10 @@ export function ChatScreen() {
}
function handleMessageLimitUnlock(): void {
const subscriptionType =
state.upgradeReason === "insufficient_credits"
? getInsufficientCreditsSubscriptionType(userState.isVip)
: "vip";
router.push(
getChatPaywallNavigationUrl(
authState.loginStatus,
subscriptionType,
getInsufficientCreditsSubscriptionType(userState.isVip),
),
);
}
@@ -1,14 +1,14 @@
"use client";
/**
* ChatQuotaExhaustedBanner 游客配额耗尽横幅
* ChatQuotaExhaustedBanner 发送受限横幅
*
* 何时显示:
* - 后端返回 lockDetail.reason="weekly_limit" 且 showUpgrade=true
* - 后端返回 cannotSendReason="insufficient_credits"
*
* 视觉规格(与设计稿对齐):
* - 粉→品红渐变背景(与 splash 渐变一致)
* - 大字号粉色/白色提示文案"The limit for free chat times has been reached today"
* - 粉→品红渐变 pill 按钮"Unlock your membership to continue" → 跳 /subscription
* - 大字号粉色/白色提示文案
* - 粉→品红渐变 pill 按钮 → 跳 /subscription
*
* 业务关系:
* - 与 `src/app/sidebar/components/vip-benefits-card.tsx` 的 "Activate VIP Membership" 行为一致
@@ -36,8 +36,8 @@ export interface ChatQuotaExhaustedBannerProps {
}
export function ChatQuotaExhaustedBanner({
title = "The limit for free chat times\nhas been reached today",
ctaLabel = "Unlock your membership to continue",
title = "Insufficient credits\nTop up to continue chatting",
ctaLabel = "Top up credits to continue",
onUnlock,
}: ChatQuotaExhaustedBannerProps) {
const router = useRouter();