@tbox.cn/app-module-mall-core 1.0.0-alpha.1 → 1.0.0-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (33) hide show
  1. package/AGENTS.md +3 -3
  2. package/README.md +4 -4
  3. package/dist/{chunk-QPBYZO27.js → chunk-ZBHJWURF.js} +1399 -1611
  4. package/dist/{chunk-FIHBQMON.js → chunk-ZVXAPBVE.js} +1 -1
  5. package/dist/client/index.d.ts +0 -11
  6. package/dist/client/index.js +1 -1
  7. package/dist/index.js +2 -2
  8. package/dist/server/index.d.ts +16 -16
  9. package/dist/server/index.js +1 -1
  10. package/package.json +7 -7
  11. package/src/client/HomeActivityDetailDialog.tsx +21 -81
  12. package/src/client/MallHome.tsx +109 -54
  13. package/src/client/cards/overrides/BumpInActivityChatCard.tsx +1 -1
  14. package/src/client/components/ActivityDetailPresentation/index.tsx +102 -9
  15. package/src/client/components/MemberGateSheet/index.tsx +38 -92
  16. package/src/client/home-slot.tsx +8 -64
  17. package/src/client/index.ts +4 -3
  18. package/src/client/member-gate-overlay.tsx +89 -0
  19. package/src/server/module-ports.ts +1 -1
  20. package/tbox.module.json +1 -2
  21. package/tests/MemberGateSheet.test.tsx +9 -0
  22. package/tests/home-slot.test.tsx +110 -30
  23. package/tsup.config.ts +0 -1
  24. package/dist/HomeActivityDetailDialog-2GJFYSMZ.less +0 -178
  25. package/dist/MallHome-PABCNS6D.less +0 -623
  26. package/dist/home-slot-WBZ6ONDP.less +0 -4
  27. package/dist/index-ELJ55M66.less +0 -256
  28. package/dist/index-U5YRUY7P.less +0 -352
  29. package/src/client/HomeActivityDetailDialog.less +0 -178
  30. package/src/client/MallHome.less +0 -623
  31. package/src/client/components/ActivityDetailPresentation/index.less +0 -352
  32. package/src/client/components/MemberGateSheet/index.less +0 -256
  33. package/src/client/home-slot.less +0 -4
@@ -35,7 +35,6 @@ import {
35
35
  HomeActivityDetailDialog,
36
36
  type SurfaceRect,
37
37
  } from './HomeActivityDetailDialog';
38
- import './MallHome.less';
39
38
  interface MallHomeProps {
40
39
  readonly mallName?: string;
41
40
  readonly linkedOrder: LinkedOrderLoadState;
@@ -95,9 +94,12 @@ function HomeServiceCard({
95
94
  const valueId = `mall-home-${tone}-value`;
96
95
  const metaId = `mall-home-${tone}-meta`;
97
96
  return (
98
- <section className={`mall-home__service-card mall-home__service-card--${tone}`} aria-label={label}>
97
+ <section
98
+ className={`mall-home__service-card mall-home__service-card--${tone} relative min-w-0 overflow-hidden rounded-[16px] border-[0.5px] border-border bg-card shadow-[0_2px_16px_rgba(106,119,137,0.08)]`}
99
+ aria-label={label}
100
+ >
99
101
  <button
100
- className="mall-home__service-card-main"
102
+ className="mall-home__service-card-main relative flex h-full min-h-[95px] w-full cursor-pointer flex-col gap-1.5 border-0 bg-transparent p-3 text-left text-inherit [font-family:inherit] disabled:cursor-default disabled:opacity-[0.72] max-[360px]:px-2.5"
101
103
  type="button"
102
104
  disabled={disabled}
103
105
  onClick={onClick}
@@ -105,26 +107,37 @@ function HomeServiceCard({
105
107
  aria-labelledby={`${labelId} ${valueId}`}
106
108
  aria-describedby={metaId}
107
109
  >
108
- <img className="mall-home__service-card-icon" src={iconSrc} alt="" aria-hidden="true" />
109
- <span id={labelId} className="mall-home__service-card-eyebrow">{label}</span>
110
- <span id={valueId} className="mall-home__service-card-value" aria-live="polite">
110
+ <img
111
+ className="mall-home__service-card-icon absolute top-3 right-3 z-[1] block h-8 w-[33.18px] object-contain max-[360px]:right-2.5"
112
+ src={iconSrc}
113
+ alt=""
114
+ aria-hidden="true"
115
+ />
116
+ <span id={labelId} className="mall-home__service-card-eyebrow truncate pr-9 text-sm leading-5 text-foreground">{label}</span>
117
+ <span id={valueId} className="mall-home__service-card-value flex min-h-[22px] min-w-0 items-center" aria-live="polite">
111
118
  {loading
112
119
  ? (
113
120
  <>
114
121
  <span
115
- className="mall-home__service-card-skeleton mall-home__service-card-skeleton--value"
122
+ className="mall-home__service-card-skeleton mall-home__service-card-skeleton--value block h-[18px] w-[72%] shrink-0 rounded-[5px] bg-[linear-gradient(90deg,rgba(20,50,91,0.08),rgba(20,50,91,0.15),rgba(20,50,91,0.08))]"
116
123
  aria-hidden="true"
117
124
  />
118
- <span className="mall-home__service-card-loading-label">{loadingLabel}</span>
125
+ <span className="sr-only">{loadingLabel}</span>
119
126
  </>
120
127
  )
121
- : <strong className={primaryMonospace ? 'mall-home__plate' : undefined}>{primary}</strong>}
128
+ : (
129
+ <strong
130
+ className={`line-clamp-2 text-base font-semibold leading-[22px] text-foreground ${primaryMonospace ? ' mall-home__plate font-mono tracking-[0.02em] tabular-nums' : ''}`}
131
+ >
132
+ {primary}
133
+ </strong>
134
+ )}
122
135
  </span>
123
- <span id={metaId} className="mall-home__service-card-meta">
136
+ <span id={metaId} className="mall-home__service-card-meta line-clamp-2 min-h-[17px] text-left text-xs leading-[17px] text-secondary-foreground">
124
137
  {loading
125
138
  ? (
126
139
  <span
127
- className="mall-home__service-card-skeleton mall-home__service-card-skeleton--meta"
140
+ className="mall-home__service-card-skeleton mall-home__service-card-skeleton--meta block h-[13px] w-[88%] shrink-0 rounded-[5px] bg-[linear-gradient(90deg,rgba(20,50,91,0.08),rgba(20,50,91,0.15),rgba(20,50,91,0.08))]"
128
141
  aria-hidden="true"
129
142
  />
130
143
  )
@@ -234,6 +247,20 @@ interface BusinessArea {
234
247
  readonly actions: readonly HomeAction[];
235
248
  }
236
249
 
250
+ /**
251
+ * 区块色调:Tailwind 类名必须完整字面量才能被扫描,故按 tone 登记,不在运行时拼接。
252
+ * 图标底色/前景 + 动作卡键盘焦点描边;guide 是缺省主蓝(等价旧 `--area-color` 默认值)。
253
+ */
254
+ const AREA_TONE_CLASS: Record<BusinessArea['tone'], { readonly icon: string; readonly focus: string }> = Object.freeze({
255
+ guide: Object.freeze({ icon: 'bg-[#edf6ff] text-[#1679df]', focus: 'focus-visible:outline-[#1679df]' }),
256
+ member: Object.freeze({ icon: 'bg-[#fff7e7] text-[#bd7200]', focus: 'focus-visible:outline-[#bd7200]' }),
257
+ marketing: Object.freeze({ icon: 'bg-[#fff1ef] text-[#db4e45]', focus: 'focus-visible:outline-[#db4e45]' }),
258
+ parking: Object.freeze({ icon: 'bg-[#edf3fb] text-[#173e78]', focus: 'focus-visible:outline-[#173e78]' }),
259
+ });
260
+
261
+ /** 联单进度条内的提示行(含重试/授权按钮)共用一份样式,只换文案 */
262
+ const PROGRESS_MESSAGE_CLASS = 'mall-home__progress-message flex h-full w-full items-center justify-center gap-2 rounded-[16px] bg-[rgba(244,252,255,0.94)] px-2.5 text-center text-xs font-bold leading-[1.2] text-[#0a6eb8]';
263
+
237
264
  /**
238
265
  * 首页开发测试入口:保留旧首页已经验证过的自然语言 query,统一走现有对话分发链。
239
266
  * 这些入口不声明服务端能力已成功,只负责让同事快速触发对应能力做联调。
@@ -309,27 +336,39 @@ function LinkedOrderStatus({
309
336
  onReauthorizeLinkedOrder,
310
337
  }: Pick<MallHomeProps, 'linkedOrder' | 'onReloadLinkedOrder' | 'onReauthorizeLinkedOrder'>) {
311
338
  if (linkedOrder.status === 'loading') {
312
- return <div className="mall-home__progress-message" role="status">正在同步联单进度…</div>;
339
+ return <div className={PROGRESS_MESSAGE_CLASS} role="status">正在同步联单进度…</div>;
313
340
  }
314
341
 
315
342
  if (linkedOrder.status === 'unauthenticated') {
316
343
  return (
317
- <div className="mall-home__progress-message">
344
+ <div className={PROGRESS_MESSAGE_CLASS}>
318
345
  <span>登录支付宝后查看联单进度</span>
319
- <button type="button" onClick={() => onReauthorizeLinkedOrder?.()}>重新授权</button>
346
+ <button
347
+ className="shrink-0 cursor-pointer rounded-[10px] border-0 bg-[#137dc4] px-2 py-[3px] text-xs leading-[1.2] text-white [font-family:inherit]"
348
+ type="button"
349
+ onClick={() => onReauthorizeLinkedOrder?.()}
350
+ >
351
+ 重新授权
352
+ </button>
320
353
  </div>
321
354
  );
322
355
  }
323
356
 
324
357
  if (linkedOrder.status === 'forbidden') {
325
- return <div className="mall-home__progress-message">当前账号暂时无法查看联单进度</div>;
358
+ return <div className={PROGRESS_MESSAGE_CLASS}>当前账号暂时无法查看联单进度</div>;
326
359
  }
327
360
 
328
361
  if (linkedOrder.status === 'error') {
329
362
  return (
330
- <div className="mall-home__progress-message" role="alert">
363
+ <div className={PROGRESS_MESSAGE_CLASS} role="alert">
331
364
  <span>联单进度暂时无法同步</span>
332
- <button type="button" onClick={() => onReloadLinkedOrder?.()}>重新加载</button>
365
+ <button
366
+ className="shrink-0 cursor-pointer rounded-[10px] border-0 bg-[#137dc4] px-2 py-[3px] text-xs leading-[1.2] text-white [font-family:inherit]"
367
+ type="button"
368
+ onClick={() => onReloadLinkedOrder?.()}
369
+ >
370
+ 重新加载
371
+ </button>
333
372
  </div>
334
373
  );
335
374
  }
@@ -338,7 +377,7 @@ function LinkedOrderStatus({
338
377
  ? deriveLinkedOrderProgress(linkedOrder.banner)
339
378
  : null;
340
379
  if (!progress) {
341
- return <div className="mall-home__progress-message">当前暂无可查看的联单活动</div>;
380
+ return <div className={PROGRESS_MESSAGE_CLASS}>当前暂无可查看的联单活动</div>;
342
381
  }
343
382
 
344
383
  const nodes = progress.target <= 10
@@ -348,21 +387,31 @@ function LinkedOrderStatus({
348
387
 
349
388
  return (
350
389
  <div
351
- className="mall-home__progress-content"
390
+ className="mall-home__progress-content flex h-full w-full items-center justify-between"
352
391
  aria-label={`联单支付进度 ${progress.completed} / ${progress.target} ${progress.unit}`}
353
392
  >
354
- <strong className="mall-home__progress-label">联单进度</strong>
355
- <div className={`mall-home__nodes${nodes.length === 0 ? ' mall-home__nodes--summary' : ''}`} aria-hidden="true">
356
- <span className="mall-home__rail" />
357
- <span className="mall-home__rail-fill" style={{ width: railFill }} />
358
- {nodes.length === 0 && <span className="mall-home__nodes-summary">已完成 {progress.completed} {progress.unit}</span>}
393
+ <strong className="mall-home__progress-label shrink-0 text-xs font-extrabold leading-none whitespace-nowrap text-[#0a6eb8] [text-shadow:0_1px_0_rgba(255,255,255,0.72)]">联单进度</strong>
394
+ <div
395
+ className={`mall-home__nodes relative mx-2.5 flex min-w-0 flex-1 justify-between ${nodes.length === 0 ? ' mall-home__nodes--summary h-[22px] justify-center' : ''}`}
396
+ aria-hidden="true"
397
+ >
398
+ <span className="mall-home__rail absolute top-1/2 right-2 left-2 h-[3px] -translate-y-1/2 rounded-[2px] bg-[rgba(22,126,194,0.3)]" />
399
+ <span
400
+ className="mall-home__rail-fill absolute top-1/2 left-2 z-[1] h-[3px] max-w-[calc(100%_-_16px)] -translate-y-1/2 rounded-[2px] bg-[#087dd0] shadow-[0_0_6px_rgba(0,104,190,0.34)]"
401
+ style={{ width: railFill }}
402
+ />
403
+ {nodes.length === 0 && (
404
+ <span className="mall-home__nodes-summary relative z-[2] rounded-[9px] bg-[rgba(234,248,255,0.94)] px-[7px] py-0.5 text-xs font-bold leading-[1.2] text-[#0a6eb8]">
405
+ 已完成 {progress.completed} {progress.unit}
406
+ </span>
407
+ )}
359
408
  {nodes.map((node) => {
360
409
  const completed = node <= progress.completed;
361
410
  const milestone = node === progress.target;
362
411
  return (
363
412
  <span
364
413
  key={node}
365
- className={`mall-home__node${completed ? ' mall-home__node--completed' : ''}${milestone ? ' mall-home__node--milestone' : ''}`}
414
+ className={`mall-home__node relative z-[2] flex size-[22px] shrink-0 items-center justify-center rounded-full border-[1.5px] border-[#1682cb] bg-[#eaf8ff] text-xs font-extrabold leading-none text-[#0d6fae] shadow-[0_2px_5px_rgba(0,83,151,0.22)] ${completed ? ' mall-home__node--completed border-white bg-[#91dcf2] text-[#0068e8]' : milestone ? ' mall-home__node--milestone border-[#ffdc6a] bg-[#1475b6] text-white' : ''}`}
366
415
  >
367
416
  {completed
368
417
  ? <Check size={15} weight="bold" />
@@ -373,7 +422,7 @@ function LinkedOrderStatus({
373
422
  );
374
423
  })}
375
424
  </div>
376
- <strong className="mall-home__progress-value">{progress.completed}/{progress.target}</strong>
425
+ <strong className="mall-home__progress-value shrink-0 text-xs font-extrabold leading-none whitespace-nowrap text-[#0a6eb8] [text-shadow:0_1px_0_rgba(255,255,255,0.72)]">{progress.completed}/{progress.target}</strong>
377
426
  </div>
378
427
  );
379
428
  }
@@ -510,10 +559,10 @@ export function MallHome({
510
559
  {/* 素材变量链(主题轨 T-2.3):poster 转 CSS background(stage 默认 + 移动断点 compact 覆写);
511
560
  可点开活动详情时(canOpenActivity)为纯装饰,否则以 role=img 保留原 alt 语义 */}
512
561
  <span
513
- className="mall-home__linked-order-poster"
562
+ className="mall-home__linked-order-poster absolute top-0 left-1/2 block h-full w-full -translate-x-1/2 bg-cover bg-center bg-[image:var(--tbox-asset-home-poster-stage,linear-gradient(135deg,#eaf3ff,#d7e7fd))] max-[392px]:bg-[image:var(--tbox-asset-home-poster-compact,linear-gradient(135deg,#eaf3ff,#d7e7fd))]"
514
563
  {...(canOpenActivity ? { 'aria-hidden': true } : { role: 'img', 'aria-label': '参与联单,碰出惊喜' })}
515
564
  />
516
- <div className="mall-home__progress">
565
+ <div className="mall-home__progress absolute bottom-[18px] left-1/2 z-[2] h-8 w-[300px] -translate-x-1/2 max-[392px]:bottom-[7%] max-[392px]:h-[13.33%] max-[392px]:w-[85%]">
517
566
  <LinkedOrderStatus
518
567
  linkedOrder={linkedOrder}
519
568
  onReloadLinkedOrder={onReloadLinkedOrder}
@@ -538,7 +587,7 @@ export function MallHome({
538
587
  card: activityCard,
539
588
  renderDetail: renderActivityDetail,
540
589
  transitionVisual: (
541
- <section className="mall-home__linked-order" aria-hidden="true">
590
+ <section className="mall-home__linked-order relative mx-page h-60 overflow-hidden rounded-[14px] bg-[#fff8e9] leading-[0] shadow-[0_10px_24px_rgba(47,88,121,0.1)] max-[392px]:aspect-[353/240] max-[392px]:h-auto" aria-hidden="true">
542
591
  {linkedOrderVisual}
543
592
  </section>
544
593
  ),
@@ -547,25 +596,28 @@ export function MallHome({
547
596
  }, [activityCard, activityDetail, linkedOrderVisual, renderActivityDetail]);
548
597
 
549
598
  return (
550
- <main className="mall-home" aria-label="商场智能服务首页">
551
- <header className="mall-home__welcome">
599
+ <main className="mall-home @container/mall-home w-full pt-2 pb-8.5 text-foreground" aria-label="商场智能服务首页">
600
+ <header className="mall-home__welcome px-page pb-5.5 pt-1">
552
601
  <img
553
- className="mall-home__welcome-sparkle"
602
+ className="mall-home__welcome-sparkle block h-[25.5px] w-9 object-contain"
554
603
  src={welcomeSparkle}
555
604
  alt=""
556
605
  aria-hidden="true"
557
606
  />
558
- <h1>欢迎来到{displayMallName}</h1>
559
- <p>我可以帮你看联单进度、查停车、看会员与活动服务</p>
607
+ <h1 className="mt-1 text-xl font-bold leading-7 tracking-tight text-foreground">欢迎来到{displayMallName}</h1>
608
+ <p className="mt-1 text-xs leading-4.75 text-secondary-foreground">我可以帮你看联单进度、查停车、看会员与活动服务</p>
560
609
  </header>
561
610
 
562
- <section className="mall-home__linked-order" aria-label="碰一下联单活动">
611
+ <section
612
+ className="mall-home__linked-order relative mx-page h-60 overflow-hidden rounded-[14px] bg-[#fff8e9] leading-[0] shadow-[0_10px_24px_rgba(47,88,121,0.1)] max-[392px]:aspect-[353/240] max-[392px]:h-auto"
613
+ aria-label="碰一下联单活动"
614
+ >
563
615
  {linkedOrderVisual}
564
616
  {canOpenActivity && activityCard && (
565
617
  <button
566
618
  ref={activityTriggerRef}
567
619
  type="button"
568
- className="mall-home__linked-order-trigger"
620
+ className="mall-home__linked-order-trigger absolute inset-0 z-[3] h-full w-full cursor-pointer rounded-[inherit] border-0 bg-transparent p-0 outline-none focus-visible:shadow-[inset_0_0_0_3px_rgba(82,126,56,0.5)]"
569
621
  aria-label={`查看${linkedOrder.status === 'ready' ? linkedOrder.banner.title || '联单活动' : '联单活动'}详情`}
570
622
  aria-haspopup="dialog"
571
623
  aria-expanded={Boolean(activityDetail)}
@@ -587,7 +639,7 @@ export function MallHome({
587
639
  </HomeActivityDetailDialog>
588
640
  )}
589
641
 
590
- <div className="mall-home__service-pair">
642
+ <div className="mall-home__service-pair mx-page mt-4 grid grid-cols-2 items-stretch gap-3">
591
643
  <MemberServiceCard
592
644
  member={member}
593
645
  onMemberPointsQuery={onMemberPointsQuery}
@@ -608,37 +660,40 @@ export function MallHome({
608
660
 
609
661
  {/* 开发测试入口:后端开关(MALL_HOME_DEV_SERVICES → /api/m/mall-home/config)控制,fail-closed 缺省隐藏 */}
610
662
  {showDevServices && (
611
- <section className="mall-home__services" aria-labelledby="mall-home-services-title">
612
- <header className="mall-home__section-header">
663
+ <section className="mall-home__services mx-page mt-5.5" aria-labelledby="mall-home-services-title">
664
+ <header className="mall-home__section-header mb-3 flex items-end justify-between gap-2">
613
665
  <div>
614
- <h2 id="mall-home-services-title">常用服务</h2>
615
- <span className="mall-home__section-kicker">以下部分为开发测试入口,不对正式用户透出</span>
666
+ <h2 id="mall-home-services-title" className="text-lg font-bold leading-6 text-foreground">常用服务</h2>
667
+ <span className="mall-home__section-kicker mt-0.5 block text-xs leading-4 text-secondary-foreground">以下部分为开发测试入口,不对正式用户透出</span>
616
668
  </div>
617
669
  </header>
618
670
 
619
- <div className="mall-home__areas">
671
+ <div className="mall-home__areas grid grid-cols-1 gap-3 @min-[820px]/mall-home:grid-cols-2">
620
672
  {BUSINESS_AREAS.map((area) => {
621
673
  const AreaIcon = area.icon;
622
674
  return (
623
675
  <section
624
- className={`mall-home__area mall-home__area--${area.tone}`}
676
+ className={`mall-home__area mall-home__area--${area.tone} min-w-0 rounded-[16px] border-[0.5px] border-border bg-card p-3 shadow-[0_2px_16px_rgba(106,119,137,0.08)]`}
625
677
  aria-labelledby={`mall-home-${area.moduleId}`}
626
678
  key={area.moduleId}
627
679
  >
628
- <header className="mall-home__area-header">
629
- <span className="mall-home__area-copy">
630
- <h3 id={`mall-home-${area.moduleId}`}>{area.title}</h3>
631
- <p>{area.description}</p>
680
+ <header className="mall-home__area-header mb-3 flex items-center justify-between gap-2">
681
+ <span className="mall-home__area-copy min-w-0">
682
+ <h3 id={`mall-home-${area.moduleId}`} className="text-sm font-semibold leading-5 text-foreground">{area.title}</h3>
683
+ <p className="text-xs leading-[17px] text-secondary-foreground">{area.description}</p>
632
684
  </span>
633
- <span className="mall-home__area-icon" aria-hidden="true">
685
+ <span
686
+ className={`mall-home__area-icon flex size-8 shrink-0 items-center justify-center rounded-[10px] ${AREA_TONE_CLASS[area.tone].icon}`}
687
+ aria-hidden="true"
688
+ >
634
689
  <AreaIcon size={22} weight="regular" />
635
690
  </span>
636
691
  </header>
637
- <div className="mall-home__action-grid">
692
+ <div className="mall-home__action-grid grid grid-cols-[repeat(auto-fit,minmax(min(150px,100%),1fr))] gap-2">
638
693
  {area.actions.map((action) => {
639
694
  return (
640
695
  <button
641
- className="mall-home__action"
696
+ className={`mall-home__action grid min-h-[72px] w-full min-w-0 cursor-pointer grid-cols-[minmax(0,1fr)_12px] items-center gap-2 rounded-[14px] border-[0.5px] border-border bg-card p-2.5 text-left text-foreground shadow-[0_2px_12px_rgba(106,119,137,0.05)] [font-family:inherit] active:scale-[0.99] active:bg-[rgba(11,15,23,0.02)] focus-visible:outline-2 focus-visible:outline-offset-2 ${AREA_TONE_CLASS[area.tone].focus}`}
642
697
  type="button"
643
698
  key={action.label}
644
699
  onClick={() => {
@@ -647,11 +702,11 @@ export function MallHome({
647
702
  onSend(action.query);
648
703
  }}
649
704
  >
650
- <span className="mall-home__action-copy">
651
- <strong>{action.label}</strong>
652
- <small>{action.description}</small>
705
+ <span className="mall-home__action-copy min-w-0">
706
+ <strong className="block text-sm font-semibold leading-[18px] [overflow-wrap:anywhere]">{action.label}</strong>
707
+ <small className="mt-[3px] block text-xs leading-4 text-secondary-foreground [overflow-wrap:anywhere]">{action.description}</small>
653
708
  </span>
654
- <CaretRight size={14} weight="bold" aria-hidden="true" />
709
+ <CaretRight className="shrink-0 text-secondary-foreground" size={14} weight="bold" aria-hidden="true" />
655
710
  </button>
656
711
  );
657
712
  })}
@@ -54,7 +54,7 @@ export const BumpInActivityChatCard: CardComponent = (props) => {
54
54
  <button
55
55
  ref={triggerRef}
56
56
  type="button"
57
- className="activity-detail-presentation__detail-trigger"
57
+ className="activity-detail-presentation__detail-trigger mt-2 mb-0 flex min-h-8 w-full cursor-pointer items-center justify-center gap-0.5 rounded-none border-0 bg-transparent p-0 text-xs font-normal leading-[18px] text-[#686d69] shadow-none [font-family:inherit] [&_svg]:shrink-0 active:opacity-[0.68] focus-visible:rounded-[5px] focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-[rgba(9,107,250,0.28)]"
58
58
  aria-haspopup="dialog"
59
59
  aria-expanded={detailOrigin !== null}
60
60
  aria-controls={getHomeActivityDialogId(cardId)}
@@ -1,15 +1,99 @@
1
1
  import type { ReactNode } from 'react';
2
- import './index.less';
3
2
 
4
3
  /**
5
4
  * 联单主视觉(素材变量链,主题轨 T-2.3):img/picture → CSS background。
6
5
  * page 变体在移动断点(≤392px)切 compact 裁切;strip 恒定 stage(原实现语义保持)。
6
+ * 元素只消费不声明 `--tbox-asset-*`(声明会截断 html[data-theme] 覆写继承)。
7
7
  */
8
+ const POSTER_BASE = 'activity-detail-presentation__poster block h-full w-full bg-cover bg-center';
9
+ const POSTER_STAGE = 'bg-[image:var(--tbox-asset-home-poster-stage,linear-gradient(135deg,#eaf3ff,#d7e7fd))]';
10
+ const POSTER_COMPACT = 'max-[392px]:bg-[image:var(--tbox-asset-home-poster-compact,linear-gradient(135deg,#eaf3ff,#d7e7fd))]';
11
+
12
+ /**
13
+ * 嵌入皮肤(跨模块,写成后代工具类而不是样式文件):
14
+ * barrier 有两层,故这些规则只能是「描述别人的后代」(选择器权重 0,2,0 高于卡片自身工具类的 0,1,0):
15
+ * ① SDK 的 `.tbox-card` 卡框在 kit 的 `@layer base` 里——详情页自身已是完整表面,必须抹平;
16
+ * ② 卡主体是 module-alipay-activity 的 `.promotion-bumpin__*` 标记:聊天流用它自己的深蓝头图,
17
+ * 详情页要的是白底平铺(主视觉已由上方 hero 承载,不能重复)。
18
+ * 数组里每一项都是完整类名字面量(`join` 只补分隔空格,不拼类名),构建期可被扫描。
19
+ */
20
+ const EMBED_SKIN = [
21
+ // ① 卡框抹平:外边距/裁切/描边/圆角/阴影/入场动画全部让位
22
+ '[&_.tbox-card]:m-0 [&_.tbox-card]:animate-none [&_.tbox-card]:overflow-visible',
23
+ '[&_.tbox-card]:rounded-none [&_.tbox-card]:border-0 [&_.tbox-card]:bg-transparent [&_.tbox-card]:shadow-none',
24
+ // ② 头部:白底平铺,隐藏封面与遮罩伪元素,压掉深蓝渐变与最小高度
25
+ '[&_.promotion-bumpin]:m-0 [&_.promotion-bumpin]:overflow-visible [&_.promotion-bumpin]:rounded-none',
26
+ '[&_.promotion-bumpin]:border-0 [&_.promotion-bumpin]:bg-card [&_.promotion-bumpin]:shadow-none',
27
+ '[&_.promotion-bumpin__header]:block [&_.promotion-bumpin__header]:min-h-0',
28
+ '[&_.promotion-bumpin__header]:bg-card! [&_.promotion-bumpin__header]:bg-none!',
29
+ '[&_.promotion-bumpin__header]:px-[11px] [&_.promotion-bumpin__header]:pt-[10px] [&_.promotion-bumpin__header]:pb-[7px]',
30
+ '[&_.promotion-bumpin__header]:before:hidden',
31
+ '[&_.promotion-bumpin__cover]:hidden [&_.promotion-bumpin__cover-placeholder]:hidden',
32
+ '[&_.promotion-bumpin__header-copy]:relative [&_.promotion-bumpin__header-copy]:z-[1]',
33
+ '[&_.promotion-bumpin__header-copy]:grid [&_.promotion-bumpin__header-copy]:max-w-full [&_.promotion-bumpin__header-copy]:gap-[3.5px]',
34
+ // 标签 / 标题 / 时段:改浅底深字,与详情页正文同一套字号档位
35
+ '[&_.promotion-bumpin__tag]:justify-self-start [&_.promotion-bumpin__tag]:rounded-full',
36
+ '[&_.promotion-bumpin__tag]:border-0 [&_.promotion-bumpin__tag]:bg-[#edf8f1]',
37
+ '[&_.promotion-bumpin__tag]:px-[10px] [&_.promotion-bumpin__tag]:py-[3px]',
38
+ '[&_.promotion-bumpin__tag]:text-sm [&_.promotion-bumpin__tag]:leading-[19px] [&_.promotion-bumpin__tag]:text-[#19744a]',
39
+ '[&_.promotion-bumpin__title]:m-0 [&_.promotion-bumpin__title]:text-xl [&_.promotion-bumpin__title]:leading-[28px]',
40
+ '[&_.promotion-bumpin__title]:font-[750] [&_.promotion-bumpin__title]:text-[#263022]',
41
+ '[&_.promotion-bumpin__period]:justify-self-start [&_.promotion-bumpin__period]:bg-transparent [&_.promotion-bumpin__period]:px-0 [&_.promotion-bumpin__period]:py-0',
42
+ '[&_.promotion-bumpin__period]:text-sm [&_.promotion-bumpin__period]:leading-[21px] [&_.promotion-bumpin__period]:text-[#6f7969]',
43
+ '[&_.promotion-bumpin__subtitle]:justify-self-start [&_.promotion-bumpin__subtitle]:bg-transparent [&_.promotion-bumpin__subtitle]:px-0 [&_.promotion-bumpin__subtitle]:py-0',
44
+ '[&_.promotion-bumpin__subtitle]:text-sm [&_.promotion-bumpin__subtitle]:leading-[21px] [&_.promotion-bumpin__subtitle]:text-[#6f7969]',
45
+ // 进度:浅蓝底内嵌块 + 蓝系节点,与首页联单进度同一套色
46
+ '[&_.promotion-bumpin__progress]:mx-4 [&_.promotion-bumpin__progress]:gap-1 [&_.promotion-bumpin__progress]:overflow-hidden',
47
+ '[&_.promotion-bumpin__progress]:rounded-[14px] [&_.promotion-bumpin__progress]:border [&_.promotion-bumpin__progress]:border-[rgba(10,110,184,0.12)]',
48
+ '[&_.promotion-bumpin__progress]:bg-[#f2f8fc] [&_.promotion-bumpin__progress]:px-3.5 [&_.promotion-bumpin__progress]:pt-1.5 [&_.promotion-bumpin__progress]:pb-[5px]',
49
+ '[&_.promotion-bumpin__steps]:px-1.5 [&_.promotion-bumpin__step-item]:gap-0.5',
50
+ '[&_.promotion-bumpin__step-node]:size-[22px] [&_.promotion-bumpin__step-node]:text-xs',
51
+ '[&_.promotion-bumpin__step-node]:border-[#1682cb] [&_.promotion-bumpin__step-node]:bg-[#eaf8ff] [&_.promotion-bumpin__step-node]:text-[#0d6fae]',
52
+ '[&_.promotion-bumpin__step-node_svg]:size-3',
53
+ '[&_.promotion-bumpin__step-node--done]:border-[#0a6eb8] [&_.promotion-bumpin__step-node--done]:bg-[#0a6eb8] [&_.promotion-bumpin__step-node--done]:text-white',
54
+ '[&_.promotion-bumpin__step-node--done]:shadow-[0_3px_9px_rgba(10,110,184,0.22)]',
55
+ '[&_.promotion-bumpin__step-node--locked]:border-[#ffdc6a] [&_.promotion-bumpin__step-node--locked]:bg-[#1475b6] [&_.promotion-bumpin__step-node--locked]:text-white',
56
+ '[&_.promotion-bumpin__step-line]:top-[11px] [&_.promotion-bumpin__step-line]:h-[2px] [&_.promotion-bumpin__step-line]:bg-[rgba(22,126,194,0.22)]',
57
+ '[&_.promotion-bumpin__step-line--done]:bg-[#0a6eb8] [&_.promotion-bumpin__step-line--done]:shadow-none',
58
+ '[&_.promotion-bumpin__progress-fill]:bg-[#0a6eb8] [&_.promotion-bumpin__progress-fill]:shadow-none',
59
+ '[&_.promotion-bumpin__step-label]:text-xs [&_.promotion-bumpin__step-label]:leading-[13px] [&_.promotion-bumpin__step-label]:text-[#6f7969]',
60
+ '[&_.promotion-bumpin__progress-text]:text-xs [&_.promotion-bumpin__progress-text]:leading-[13px] [&_.promotion-bumpin__progress-text]:text-[#6f7969]',
61
+ '[&_.promotion-bumpin__progress-bar]:h-2 [&_.promotion-bumpin__progress-bar]:bg-[rgba(10,110,184,0.14)]',
62
+ // 奖励池 / 活动规则:白卡片 + 细描边,标题与条目按详情页正文排版
63
+ '[&_.promotion-bumpin__prizes]:mx-4 [&_.promotion-bumpin__prizes]:mt-4 [&_.promotion-bumpin__prizes]:overflow-hidden',
64
+ '[&_.promotion-bumpin__prizes]:rounded-[14px] [&_.promotion-bumpin__prizes]:border [&_.promotion-bumpin__prizes]:border-[rgba(106,119,137,0.16)]',
65
+ '[&_.promotion-bumpin__prizes]:bg-card [&_.promotion-bumpin__prizes]:shadow-[0_3px_12px_rgba(70,91,122,0.06)]',
66
+ '[&_.promotion-bumpin__rules]:mx-4 [&_.promotion-bumpin__rules]:mt-4 [&_.promotion-bumpin__rules]:overflow-hidden',
67
+ '[&_.promotion-bumpin__rules]:rounded-[14px] [&_.promotion-bumpin__rules]:border [&_.promotion-bumpin__rules]:border-[rgba(106,119,137,0.16)]',
68
+ '[&_.promotion-bumpin__rules]:bg-card [&_.promotion-bumpin__rules]:shadow-[0_3px_12px_rgba(70,91,122,0.06)]',
69
+ '[&_.promotion-bumpin__prizes-header]:gap-2 [&_.promotion-bumpin__prizes-header]:border-b [&_.promotion-bumpin__prizes-header]:border-[rgba(106,119,137,0.12)]',
70
+ '[&_.promotion-bumpin__prizes-header]:px-3.5 [&_.promotion-bumpin__prizes-header]:pt-3 [&_.promotion-bumpin__prizes-header]:pb-2.5',
71
+ '[&_.promotion-bumpin__prizes-header]:text-base [&_.promotion-bumpin__prizes-header]:font-semibold',
72
+ '[&_.promotion-bumpin__prizes-header]:leading-[22px] [&_.promotion-bumpin__prizes-header]:text-[#263022]',
73
+ '[&_.promotion-bumpin__rules-header]:border-b [&_.promotion-bumpin__rules-header]:border-[rgba(106,119,137,0.12)]',
74
+ '[&_.promotion-bumpin__rules-header]:px-3.5 [&_.promotion-bumpin__rules-header]:pt-3 [&_.promotion-bumpin__rules-header]:pb-2.5',
75
+ '[&_.promotion-bumpin__rules-header]:text-base [&_.promotion-bumpin__rules-header]:font-semibold',
76
+ '[&_.promotion-bumpin__rules-header]:leading-[22px] [&_.promotion-bumpin__rules-header]:text-[#263022]',
77
+ '[&_.promotion-bumpin__prizes-header_svg]:size-[26px] [&_.promotion-bumpin__prizes-header_svg]:rounded-[8px]',
78
+ '[&_.promotion-bumpin__prizes-header_svg]:bg-[#edf6ff] [&_.promotion-bumpin__prizes-header_svg]:p-1.5 [&_.promotion-bumpin__prizes-header_svg]:text-[#0a6eb8]',
79
+ '[&_.promotion-bumpin__prize-item]:gap-3 [&_.promotion-bumpin__prize-item]:border-b [&_.promotion-bumpin__prize-item]:border-[rgba(106,119,137,0.1)]',
80
+ '[&_.promotion-bumpin__prize-item]:bg-card [&_.promotion-bumpin__prize-item]:px-3.5 [&_.promotion-bumpin__prize-item]:py-3',
81
+ '[&_.promotion-bumpin__prize-logo]:size-[42px] [&_.promotion-bumpin__prize-logo]:rounded-[12px]',
82
+ '[&_.promotion-bumpin__prize-logo-placeholder]:size-[42px] [&_.promotion-bumpin__prize-logo-placeholder]:rounded-[12px]',
83
+ '[&_.promotion-bumpin__prize-copy_strong]:text-base [&_.promotion-bumpin__prize-copy_strong]:leading-[22px] [&_.promotion-bumpin__prize-copy_strong]:text-[#263022]',
84
+ '[&_.promotion-bumpin__prize-copy_small]:text-sm [&_.promotion-bumpin__prize-copy_small]:leading-5 [&_.promotion-bumpin__prize-copy_small]:text-[#6f7969]',
85
+ '[&_.promotion-bumpin__prize-amount]:text-sm [&_.promotion-bumpin__prize-amount]:leading-5 [&_.promotion-bumpin__prize-amount]:text-[#6f7969]',
86
+ '[&_.promotion-bumpin__prizes-toggle]:border-t [&_.promotion-bumpin__prizes-toggle]:border-[rgba(106,119,137,0.1)]',
87
+ '[&_.promotion-bumpin__prizes-toggle]:bg-[#f8fafc] [&_.promotion-bumpin__prizes-toggle]:px-3.5 [&_.promotion-bumpin__prizes-toggle]:py-[11px]',
88
+ '[&_.promotion-bumpin__prizes-toggle]:text-sm [&_.promotion-bumpin__prizes-toggle]:leading-5 [&_.promotion-bumpin__prizes-toggle]:text-[#6f7969]',
89
+ '[&_.promotion-bumpin__rules-content]:px-3.5 [&_.promotion-bumpin__rules-content]:pt-3 [&_.promotion-bumpin__rules-content]:pb-3.5',
90
+ '[&_.promotion-bumpin__rules-content]:text-sm [&_.promotion-bumpin__rules-content]:leading-6 [&_.promotion-bumpin__rules-content]:text-[#6f7969]',
91
+ ].join(' ');
92
+
8
93
  export function ActivityDetailHero({ variant = 'page' }: { readonly variant?: 'page' | 'strip' }) {
9
- const className =
10
- variant === 'strip'
11
- ? 'activity-detail-presentation__poster activity-detail-presentation__poster--stage'
12
- : 'activity-detail-presentation__poster';
94
+ const className = variant === 'strip'
95
+ ? `${POSTER_BASE} activity-detail-presentation__poster--stage ${POSTER_STAGE}`
96
+ : `${POSTER_BASE} ${POSTER_STAGE} ${POSTER_COMPACT}`;
13
97
  return <span className={className} role="img" aria-label="参与联单,碰出惊喜" />;
14
98
  }
15
99
 
@@ -20,12 +104,21 @@ export function ActivityDetailPresentation({
20
104
  readonly children: ReactNode;
21
105
  readonly variant: 'page' | 'inline';
22
106
  }) {
107
+ const isPage = variant === 'page';
23
108
  return (
24
- <div className={`activity-detail-presentation activity-detail-presentation--${variant}`}>
25
- <div className={`activity-detail-presentation__hero activity-detail-presentation__hero--${variant}`}>
26
- <ActivityDetailHero variant={variant === 'inline' ? 'strip' : 'page'} />
109
+ <div
110
+ className={`activity-detail-presentation activity-detail-presentation--${variant} w-full min-w-0 overflow-hidden bg-card text-[#263022] ${isPage ? '' : '@container/activity rounded-[14px] [contain:layout_paint]'}`}
111
+ >
112
+ <div
113
+ className={`activity-detail-presentation__hero activity-detail-presentation__hero--${variant} relative w-full overflow-hidden bg-[#fff8e9] ${isPage ? 'aspect-[353/240]' : 'aspect-auto h-[152px]'}`}
114
+ >
115
+ <ActivityDetailHero variant={isPage ? 'page' : 'strip'} />
116
+ </div>
117
+ <div
118
+ className={`activity-detail-presentation__body relative z-[1] min-w-0 bg-card [&>*]:w-full ${isPage ? '-mt-[50px] rounded-t-[22px] px-0 pt-1 pb-4.5 shadow-[0_-10px_28px_rgba(38,48,34,0.08)]' : '-mt-3.5 rounded-t-[16px] px-0 pt-0 pb-2 shadow-none'} ${EMBED_SKIN}`}
119
+ >
120
+ {children}
27
121
  </div>
28
- <div className="activity-detail-presentation__body">{children}</div>
29
122
  </div>
30
123
  );
31
124
  }