feat(chat): add quota-exhausted banner for guest users

Introduce ChatQuotaExhaustedBanner component that displays a pink gradient
banner with an "Unlock your membership to continue" CTA when a guest user's
free chat quota has been exhausted. The banner is shown in ChatScreen when
isGuest is true, quota has loaded, and the chat state machine's
quotaExceededTrigger has been incremented by a quota guard. Default click
navigates to /subscription, with an optional onUnlock callback for
overrides/tests. Styles align with the existing splash and sidebar VIP
card visual language.
This commit is contained in:
2026-06-16 15:17:44 +08:00
parent 9ffa30cc03
commit dcb6312fa3
8 changed files with 153 additions and 39 deletions
-7
View File
@@ -3,13 +3,6 @@
*
* 注:GuestChatQuota 仍位于 chat-machine.ts(属于业务常量,与上下文配对紧密)。
*
* 历史:
* - `isGuest: boolean` 字段已删(由 chat-screen 派生自 `auth.loginStatus === "guest"`
* - `guestRemainingQuota` / `guestTotalQuota` default 改 0
* - 游客:chat-screen 派 `ChatInit` → readInitData 调 ChatStorage → onDone 条件赋
* - 非游客:永不被赋值(业务事实"非游客无消息限制")—— 0 - 1 = max(0, -1) = 0 天然 no-op
* - 0 同时表示"未初始化"和"已耗尽" —— UI 用 `if (isGuest && ...)` 天然过滤
*
* 新增 `wsConnected: boolean`(仅 userSession 期间 true):
* - WS 已连 → 消息发送走 WS,不消耗次数
* - WS 未连 → 消息发送走 HTTP,消耗次数