From d59654f2777249dfe1c547469004522f0468abf6 Mon Sep 17 00:00:00 2001 From: kdletters Date: Wed, 10 Jun 2026 12:36:16 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E5=8F=A3=E4=B8=AA=E4=BA=BA=E4=B8=AD?= =?UTF-8?q?=E5=BF=83=E5=85=85=E5=80=BC=E5=95=86=E5=93=81=E5=8D=A1=E7=BB=84?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 个人中心充值商品整卡按钮改用 PlatformSubpanel as button 充值弹窗测试断言商品卡接入公共交互壳 补充 PlatformUiKit 收口文档和 Hermes 决策记录 --- .hermes/shared-memory/decision-log.md | 1 + ...端架构】PlatformUiKit弹窗组件收口计划-2026-06-08.md | 4 ++++ .../rpg-entry/RpgEntryHomeView.recharge.test.tsx | 12 +++++++++++- src/components/rpg-entry/RpgEntryHomeView.tsx | 11 ++++++++--- 4 files changed, 24 insertions(+), 4 deletions(-) diff --git a/.hermes/shared-memory/decision-log.md b/.hermes/shared-memory/decision-log.md index c5c7c9e9..6932aefd 100644 --- a/.hermes/shared-memory/decision-log.md +++ b/.hermes/shared-memory/decision-log.md @@ -72,6 +72,7 @@ - 2026-06-10 追加:个人中心邀请弹窗里的社区二维码卡、邀请码展示卡、成功邀请容器和邀请用户行使用 `PlatformSubpanel`,简单空态使用 `PlatformEmptyState`,小标题使用 `PlatformFieldLabel variant="section"`;外层弹窗、query 自动打开、复制邀请和提交邀请码状态机不随 UI chrome 收口改动。 - 2026-06-10 追加:个人中心任务中心任务条目使用 `PlatformSubpanel radius="sm" padding="md"` 承接原 `platform-subpanel` 外壳;业务组件只保留任务标题、进度、奖励、状态和领取按钮逻辑。 - 2026-06-10 追加:个人中心充值弹窗微信 Native 支付二维码确认面板使用 `PlatformSubpanel radius="sm" padding="md"`;业务组件只保留二维码生成、扫码展示和确认支付按钮流程。 +- 2026-06-10 追加:个人中心充值弹窗商品整卡按钮使用 `PlatformSubpanel as="button" surface="platform" radius="sm" padding="none" interactive`;商品标题、金额、角标、购买中态和购买回调留在业务组件,按钮壳、hover、focus、默认 type 与 disabled chrome 归公共组件。验证命令:`npm run test -- src/components/rpg-entry/RpgEntryHomeView.recharge.test.tsx -t "profile recharge modal trusts per-product first bonus display after points recharge"`、`npm run test -- src/components/common/PlatformSubpanel.test.tsx`。 - 2026-06-09 追加:抓大鹅结果页作品信息、发布封面和物品素材详情中的 section 字段标题迁移到 `PlatformFieldLabel variant="section"`;业务页不再重复拼 `text-xs font-bold tracking-[0.18em] text-[var(--platform-text-soft)]`。 - 2026-06-09 追加:方洞结果页主信息、形状选项、洞口选项和历史生成标题迁移到 `PlatformFieldLabel variant="section"`;业务页只保留字段文案、图标和按钮布局,不再重复拼 section 标题 class。 - 2026-06-09 追加:拼图结果页关卡详情的“关卡名称”和发布弹窗的“发布检查 / 封面关卡”标题迁移到 `PlatformFieldLabel variant="section"`;业务页保留 label 关联和弹窗布局,不再重复拼 section 标题 class。 diff --git a/docs/technical/【前端架构】PlatformUiKit弹窗组件收口计划-2026-06-08.md b/docs/technical/【前端架构】PlatformUiKit弹窗组件收口计划-2026-06-08.md index 409da58e..eedebd05 100644 --- a/docs/technical/【前端架构】PlatformUiKit弹窗组件收口计划-2026-06-08.md +++ b/docs/technical/【前端架构】PlatformUiKit弹窗组件收口计划-2026-06-08.md @@ -88,6 +88,7 @@ - `PlatformSubpanel` 补充:个人中心邀请弹窗里的社区二维码卡、邀请码展示卡、成功邀请容器和邀请用户行使用 `surface="flat" | "soft"` 的白底子面板;复制按钮、奖励说明卡和弹窗状态机不并入本轮。 - `PlatformSubpanel` 补充:个人中心任务中心里的任务条目使用 `radius="sm" padding="md"` 承接原 `platform-subpanel` 外壳;业务组件只保留任务标题、进度、奖励、状态和领取按钮逻辑。 - `PlatformSubpanel` 补充:个人中心充值弹窗里的微信 Native 支付二维码确认面板使用 `radius="sm" padding="md"`;业务组件保留二维码生成、扫码提示和确认支付按钮,不再手写 `platform-subpanel` 外壳。 +- `PlatformSubpanel` 补充:个人中心充值弹窗里的商品整卡按钮使用 `as="button" interactive radius="sm" padding="none"`;业务组件只保留商品标题、金额、角标、购买状态和下单回调,不再手写 `platform-subpanel` 按钮壳、hover、focus 或 disabled chrome。 - `PlatformSubpanel` 补充:当前 Interface 额外支持 `padding="xs"`、`radius="xs"` 和 `surface="dark"`,用于 RPG 暗色编辑器 / 运行态里的非交互小信息卡。任务目标、区域、进度、描述、角色维度、角色形象状态、自定义选择弹窗当前角色、地图场景切换当前 / 前往摘要、营地编组分区、同行者卡、营地气氛小卡、角色聊天状态和聊天总结这类只展示信息的小卡走该组合;暗色 HUD、动作按钮、可点击卡片和强玩法品牌面板仍保留业务布局。 - `PlatformSubpanel` 补充:当前 Interface 额外支持 `surface="darkSky" | "darkEmerald" | "darkAmber" | "darkRose"`,用于 RPG 暗色编辑器 / 运行态中带业务色强调的结构化信息面板;实体详情私聊提示、队友收束、玩家等级进度、角色面板等级 / 收束状态、任务奖励好感度 / 货币 / 经验数值卡、RPG 大编辑器上传封面中提示、地图场景切换目标场景面板,以及 `CharacterInfoShared.MultiplierContributionList` 状态标签外壳已迁移,后续同类 sky / emerald / amber / rose 暗色信息壳不再手写 `border-*-400/18 bg-*-500/8`。 - `PlatformSubpanel` 补充:RPG 大编辑器里的标题型暗色信息块通过本地 `EditorInfoPanel` 适配到 `surface="dark" radius="md" padding="md"`;场景幕角色槽位的当前角色 / 可选角色面板、幕背景预览面板和预设背景面板已迁移。业务 JSX 只保留标题、内容和局部 grid,不再重复拼 `rounded-2xl border border-white/8 bg-black/20 px-4 py-4`。 @@ -151,6 +152,7 @@ 18.3.4. 个人中心邀请弹窗内部的二维码卡、邀请码卡、成功邀请列表、邀请用户行、小标题和简单空态分别迁移到 `PlatformSubpanel`、`PlatformFieldLabel` 与 `PlatformEmptyState`;外层弹窗、query 自动打开、复制邀请、提交邀请码和社区面板信息架构不随本轮改变。 18.3.5. 个人中心任务中心任务条目迁移到 `PlatformSubpanel`;任务选择、领取、奖励和完成态仍由任务 ViewModel / 业务流程控制。 18.3.6. 个人中心充值弹窗 Native 支付二维码确认面板迁移到 `PlatformSubpanel`;支付渠道选择、二维码生成和确认支付流程不随 UI chrome 收口改动。 + 18.3.7. 个人中心充值弹窗商品整卡按钮迁移到 `PlatformSubpanel as="button" interactive`;支付渠道选择、商品展示、提交中态和购买回调不随按钮卡 chrome 收口改动。 18.4. 平台白底分段 Tab / 二选一 / 四选一配置项迁移到 `PlatformSegmentedTabs`;拼图结果页、抓大鹅结果页、抓大鹅素材配置、抓大鹅创作 / 结果页难度选择、视觉小说结果页和 creative-agent 模板确认弹窗已先迁移。后续同类控件只传选项、当前 id、变更回调、列数、尺寸、调性和外壳形态,不再在业务 JSX 中重复容器边框、`bg-white/62`、选中态和 `aria-pressed`。 18.4.1. `PlatformSegmentedTabs` 支持 `semantics="tabs"`、`tone="underline"`、`size="tab"` 和 `columns="one"`,用于承接认证入口短信 / 密码登录切换这类真实 Tab 语义;业务页不再维护本地 `LoginTabButton`、`role="tab"`、`aria-selected` 和下划线选中态。 18.5. 平台只读信息块迁移到 `PlatformInfoBlock`;错误弹窗和生成完成弹窗的来源、错误和状态展示、分享弹窗正文,以及汪汪声浪预览卡场景 / 形象 / 难度 / 声浪信息行已先迁移。后续弹窗、详情页或预览卡里只是展示短标签 + 只读正文,或无标签纯只读正文时,优先使用该 Module;横向信息行通过 `labelClassName` / `valueClassName` 保留标签和值排版,不在业务 JSX 中重复白底信息块 chrome。 @@ -215,6 +217,8 @@ - `npm run test -- src/components/rpg-runtime-panels/RpgAdventurePanel.questOffer.test.tsx src/components/common/PlatformSubpanel.test.tsx src/components/common/PlatformPillBadge.test.tsx src/components/common/PlatformQuantityBadge.test.tsx -t "quest offer accept button|quest reward strip|quest completion notice|battle reward modal|supports dark compact subpanel cards|supports dark RPG badge tones|renders a dark bottom-right quantity badge"` - `npm run test -- src/components/common/PlatformPillBadge.test.tsx` - `npm run test -- src/components/common/PlatformPillBadge.test.tsx src/components/rpg-entry/RpgEntryHomeView.recharge.test.tsx -t "wallet ledger|profile played modal summary"` +- `npm run test -- src/components/rpg-entry/RpgEntryHomeView.recharge.test.tsx -t "profile recharge modal trusts per-product first bonus display after points recharge"` +- `npm run test -- src/components/common/PlatformSubpanel.test.tsx` - `npm run test -- src/components/common/PlatformPillBadge.test.tsx` - `npm run test -- src/components/common/CopyFeedbackMessage.test.tsx` - `npm run test -- src/components/common/PlatformStatusMessage.test.tsx` diff --git a/src/components/rpg-entry/RpgEntryHomeView.recharge.test.tsx b/src/components/rpg-entry/RpgEntryHomeView.recharge.test.tsx index 0c6ec623..0f42aa1f 100644 --- a/src/components/rpg-entry/RpgEntryHomeView.recharge.test.tsx +++ b/src/components/rpg-entry/RpgEntryHomeView.recharge.test.tsx @@ -1446,7 +1446,17 @@ test('profile recharge modal trusts per-product first bonus display after points const rechargeDialog = await screen.findByText('账户充值'); expect(rechargeDialog).toBeTruthy(); - expect(screen.getByRole('button', { name: /60泥点/u })).toBeTruthy(); + const rechargeProductCard = screen.getByRole('button', { + name: /60泥点.*60\+60泥点.*购买/u, + }); + + expect(rechargeProductCard.className).toContain('platform-subpanel'); + expect(rechargeProductCard.className).toContain('platform-interactive-card'); + expect(rechargeProductCard.className).toContain('hover:bg-white'); + expect(rechargeProductCard.getAttribute('type')).toBe('button'); + expect(rechargeProductCard.className).toContain( + 'disabled:cursor-not-allowed', + ); expect(screen.getByText('首充双倍')).toBeTruthy(); expect(screen.getByText('60+60泥点')).toBeTruthy(); }); diff --git a/src/components/rpg-entry/RpgEntryHomeView.tsx b/src/components/rpg-entry/RpgEntryHomeView.tsx index 12ce6956..57241438 100644 --- a/src/components/rpg-entry/RpgEntryHomeView.tsx +++ b/src/components/rpg-entry/RpgEntryHomeView.tsx @@ -3070,11 +3070,16 @@ function RechargeProductCard({ const value = buildRechargeProductValueLabel(product); return ( - + ); }