@tbox.cn/app-module-promotion 0.10.8 → 1.0.0-alpha.6

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tbox.cn/app-module-promotion",
3
- "version": "0.10.8",
3
+ "version": "1.0.0-alpha.6",
4
4
  "type": "module",
5
5
  "description": "商圈营销模块:资格校验、推荐降级链、券卡(codegen 源)。",
6
6
  "exports": {
@@ -18,12 +18,12 @@
18
18
  }
19
19
  },
20
20
  "dependencies": {
21
- "@tbox.cn/app-contracts": "0.13.3",
22
- "@tbox.cn/app-contracts-mall": "0.13.2",
23
21
  "jsbarcode": "^3.12.3",
24
22
  "qrcode": "^1.5.4",
25
- "@tbox.cn/app-agent-sdk-client": "0.2.0",
26
- "@tbox.cn/app-agent-sdk-server": "0.3.1"
23
+ "@tbox.cn/app-contracts": "1.0.0-alpha.6",
24
+ "@tbox.cn/app-contracts-mall": "1.0.0-alpha.6",
25
+ "@tbox.cn/app-agent-sdk-server": "1.0.0-alpha.6",
26
+ "@tbox.cn/app-agent-sdk-client": "1.0.0-alpha.6"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "@phosphor-icons/react": "2.1.10",
@@ -64,9 +64,6 @@
64
64
  "access": "public"
65
65
  },
66
66
  "license": "MIT",
67
- "sideEffects": [
68
- "**/*.css"
69
- ],
70
67
  "scripts": {
71
68
  "typecheck": "tsc --noEmit",
72
69
  "test": "vitest run",
@@ -1,5 +1,9 @@
1
1
  import { GameController, Palette, Sparkle, Storefront } from '@phosphor-icons/react';
2
2
  import { ItemActionsRow } from '@tbox.cn/app-agent-sdk-client';
3
+ import {
4
+ PROMOTION_CATEGORY_ICON_TONE_CLASS,
5
+ PROMOTION_CHIP_ACTIVITY_CLASS,
6
+ } from '../../components/class-names';
3
7
  import type { PromotionActivityCategoryListCardData } from '@tbox.cn/app-contracts-mall';
4
8
 
5
9
  const icons = [GameController, Storefront, Palette, Sparkle] as const;
@@ -11,22 +15,22 @@ export function PromotionActivityCategoryListCard(props: {
11
15
  }) {
12
16
  const { data, cardId = '', isHistory = false } = props;
13
17
  return (
14
- <section className="promotion-card promotion-activity promotion-activity--categories">
15
- <header className="promotion-card__header promotion-card__header--compact">
16
- <span className="promotion-card__mark"><Sparkle weight="fill" /></span>
17
- <div><span className="promotion-card__eyebrow">会员活动</span><h3>探索会员活动</h3><p>按兴趣找到你的专属周末</p></div>
18
+ <section className="promotion-card promotion-activity promotion-activity--categories relative w-full overflow-hidden bg-card text-sm leading-[normal] tracking-[0] text-foreground">
19
+ <header className="promotion-card__header promotion-card__header--compact flex min-w-0 items-center gap-2.5 px-4 pt-3.5 pb-2.5 max-[380px]:px-[13px] min-[760px]:pt-[15px]">
20
+ <span className="promotion-card__mark grid h-[38px] w-[38px] flex-[0_0_38px] place-items-center rounded-[10px] border border-[rgba(8,119,95,0.18)] bg-[#dff6ed] text-[#08775f] shadow-[0_5px_14px_rgba(8,119,95,0.08)] [&_svg]:size-5"><Sparkle weight="fill" /></span>
21
+ <div className="min-w-0 flex-1"><span className="promotion-card__eyebrow mb-0.5 block text-xs font-bold leading-[14px] text-[#2368ec]">会员活动</span><h3 className="text-lg font-bold leading-[22px] text-foreground [overflow-wrap:anywhere] max-[380px]:text-base">探索会员活动</h3><p className="mt-0.5 truncate text-xs leading-4 text-secondary-foreground">按兴趣找到你的专属周末</p></div>
18
22
  </header>
19
- <div className="promotion-activity__categories">
23
+ <div className="promotion-activity__categories grid grid-cols-2 gap-[7px] px-3.5 pb-3.5">
20
24
  {data.items.map((item, index) => {
21
25
  const Icon = icons[index % icons.length];
22
- return <article key={item.categoryId}>
23
- <span className={`promotion-activity__category-icon promotion-activity__category-icon--${index % 4}`}><Icon weight="duotone" /></span>
24
- <span><strong>{item.name}</strong><small>发现精彩活动</small></span>
25
- <ItemActionsRow actions={item.itemActions ?? []} cardId={cardId} isHistory={isHistory} className="promotion-item-actions" chipClassName="promotion-chip" />
26
+ return <article key={item.categoryId} className="grid min-h-[46px] cursor-pointer grid-cols-[27px_minmax(0,1fr)_9px] items-center gap-1.5 rounded-[7px] border border-[#e5ece9] bg-[rgba(255,255,255,0.92)] px-2 py-1.75 text-left text-[#15372f] shadow-[0_5px_13px_rgba(23,74,61,0.08)] transition-[border-color,box-shadow,background] duration-[180ms] ease-[ease] motion-reduce:transition-none">
27
+ <span className={`promotion-activity__category-icon promotion-activity__category-icon--${index % 4} grid size-[27px] place-items-center rounded-[8px] [&_svg]:size-[15px] ${PROMOTION_CATEGORY_ICON_TONE_CLASS[index % 4] ?? ''}`}><Icon weight="duotone" /></span>
28
+ <span className="grid min-w-0 gap-[1px]"><strong className="truncate text-xs leading-[15px]">{item.name}</strong><small className="text-xs leading-3 text-[#687a74]">发现精彩活动</small></span>
29
+ <ItemActionsRow actions={item.itemActions ?? []} cardId={cardId} isHistory={isHistory} className="promotion-item-actions contents" chipClassName={PROMOTION_CHIP_ACTIVITY_CLASS} />
26
30
  </article>;
27
31
  })}
28
32
  </div>
29
- {!data.items.length && <div className="promotion-card__empty"><Sparkle size={28} /><span>{data.noResultsReason ?? '暂无活动分类'}</span></div>}
33
+ {!data.items.length && <div className="promotion-card__empty flex min-h-[94px] items-center justify-center gap-2 p-5 text-xs leading-[normal] text-secondary-foreground"><Sparkle size={28} /><span>{data.noResultsReason ?? '暂无活动分类'}</span></div>}
30
34
  </section>
31
35
  );
32
36
  }
@@ -2,6 +2,18 @@ import { ArrowSquareOut, CalendarDots, CheckCircle, Clock, Crown, ListChecks, Ma
2
2
  import type { PromotionActivityDetailCardData } from '@tbox.cn/app-contracts-mall';
3
3
  import { sendCardAction } from '@tbox.cn/app-agent-sdk-client';
4
4
  import { ImageWithFallback } from '../../components/ImageWithFallback';
5
+ import {
6
+ PROMOTION_ACTIVITY_STATUS_CLASS,
7
+ PROMOTION_ACTIVITY_STATUS_TONE_CLASS,
8
+ } from '../../components/class-names';
9
+
10
+ /** 活动卡头(promotion-card__header + --compact):三张 activity 子形态共用 */
11
+ const ACTIVITY_HEADER_COMPACT = 'flex min-w-0 items-center gap-2.5 px-4 pt-3.5 pb-2.5 max-[380px]:px-[13px] min-[760px]:pt-[15px]';
12
+ const ACTIVITY_MARK = 'grid h-[38px] w-[38px] flex-[0_0_38px] place-items-center rounded-[10px] border border-[rgba(8,119,95,0.18)] bg-[#dff6ed] text-[#08775f] shadow-[0_5px_14px_rgba(8,119,95,0.08)] [&_svg]:size-5';
13
+ const ACTIVITY_EYEBROW = 'mb-1 block text-xs font-bold leading-[14px] text-[#2368ec]';
14
+ const ACTIVITY_H3 = 'text-lg font-bold leading-[22px] text-foreground [overflow-wrap:anywhere] max-[380px]:text-base';
15
+ const ACTIVITY_HP = 'mt-0.5 truncate text-xs leading-4 text-secondary-foreground';
16
+ const ACTIVITY_READONLY = 'mx-3.5 mb-3 flex items-center gap-1 rounded-[6px] bg-[#f2f7f5] px-[7.5px] py-[6.5px] text-xs leading-[12.5px] text-[#596d66] [&_svg]:size-3 [&_svg]:shrink-0 [&_svg]:text-[#0b8a6f]';
5
17
 
6
18
  const sessionText: Record<string, string> = { OPEN: '可选', FULL: '已满', CLOSED: '已结束', UNKNOWN: '待确认' };
7
19
 
@@ -14,28 +26,28 @@ export function PromotionActivityDetailCard({ data, cardId = '', isHistory = fal
14
26
  function ActivityDetail({ data, cardId, isHistory }: { data: PromotionActivityDetailCardData; cardId: string; isHistory: boolean }) {
15
27
  const status = data.remainingQuota === 0 ? 'FULL' : 'AVAILABLE';
16
28
  return (
17
- <section className="promotion-card promotion-activity promotion-activity--detail">
18
- <div className="promotion-activity__cover">
19
- <ImageWithFallback src={data.coverUrl} alt={data.title} className="promotion-activity__cover-image" />
20
- <span className="promotion-activity__cover-shade" />
21
- <div className="promotion-activity__cover-meta"><span><Crown weight="fill" />会员专享体验</span><span className={`promotion-activity__status promotion-activity__status--${status.toLowerCase()}`}>{status === 'FULL' ? '已满' : '可报名'}</span></div>
29
+ <section className="promotion-card promotion-activity promotion-activity--detail relative w-full overflow-hidden bg-card text-sm leading-[normal] tracking-[0] text-foreground">
30
+ <div className="promotion-activity__cover relative h-[124px] bg-[#dfeee9]">
31
+ <ImageWithFallback src={data.coverUrl} alt={data.title} className="promotion-activity__cover-image h-full w-full object-cover" />
32
+ <span className="promotion-activity__cover-shade absolute inset-0 bg-[linear-gradient(90deg,rgba(12,39,32,0.82),rgba(12,39,32,0.3)_68%,transparent)]" />
33
+ <div className="promotion-activity__cover-meta absolute top-2.5 right-[11px] left-[11px] flex items-center justify-between"><span className="flex items-center gap-[3.5px] rounded-full border border-[rgba(255,255,255,0.58)] bg-[rgba(18,48,40,0.56)] px-[6.5px] py-2 text-xs font-bold leading-[normal] text-[#fff5d6] backdrop-blur-[7px]"><Crown weight="fill" />会员专享体验</span><span className={`promotion-activity__status promotion-activity__status--${status.toLowerCase()} ${PROMOTION_ACTIVITY_STATUS_CLASS} ${PROMOTION_ACTIVITY_STATUS_TONE_CLASS[status.toLowerCase()] ?? ''}`}>{status === 'FULL' ? '已满' : '可报名'}</span></div>
22
34
  </div>
23
- <div className="promotion-activity__detail-body">
24
- <small>{data.jumpOnly ? '首页精选 · 可跳转内容' : `活动详情 · ${data.categoryName ?? '会员活动'}`}</small>
25
- <h3>{data.title}</h3>
26
- {(data.subtitle ?? data.description) && <p>{data.subtitle ?? data.description}</p>}
27
- <div className="promotion-activity__spotlight">
28
- <span><CalendarDots weight="duotone" /><small>{data.jumpOnly ? '内容说明' : '活动时间'}</small><strong>{data.periodText ?? (data.jumpOnly ? '详情以跳转页面为准' : '以活动页为准')}</strong></span>
29
- <span><Users weight="duotone" /><small>活动名额</small><strong>{data.remainingQuota !== undefined ? `剩余 ${data.remainingQuota} 席` : data.registrationRequired ? '需提前报名' : '无需报名'}</strong></span>
35
+ <div className="promotion-activity__detail-body px-3.5 pt-[11px] pb-3.5">
36
+ <small className="text-xs font-bold leading-3 text-[#b8862e]">{data.jumpOnly ? '首页精选 · 可跳转内容' : `活动详情 · ${data.categoryName ?? '会员活动'}`}</small>
37
+ <h3 className="mt-[3px] mb-0.5 text-base font-bold leading-[20.5px] [overflow-wrap:anywhere]">{data.title}</h3>
38
+ {(data.subtitle ?? data.description) && <p className="text-xs leading-[14.5px] text-[#62736d]">{data.subtitle ?? data.description}</p>}
39
+ <div className="promotion-activity__spotlight mt-2.5 grid grid-cols-2 gap-1.5">
40
+ <span className="grid grid-cols-[18px_minmax(0,1fr)] gap-x-1 rounded-[7px] border border-[#e1ebe7] bg-[#f8fbfa] px-2 py-[7.5px] [&_svg]:row-span-2 [&_svg]:size-4 [&_svg]:self-center [&_svg]:text-[#0b8b70]"><CalendarDots weight="duotone" /><small className="text-xs leading-[11px] text-[#71817c]">{data.jumpOnly ? '内容说明' : '活动时间'}</small><strong className="truncate text-xs leading-[13px] text-[#213b34]">{data.periodText ?? (data.jumpOnly ? '详情以跳转页面为准' : '以活动页为准')}</strong></span>
41
+ <span className="grid grid-cols-[18px_minmax(0,1fr)] gap-x-1 rounded-[7px] border border-[#e1ebe7] bg-[#f8fbfa] px-2 py-[7.5px] [&_svg]:row-span-2 [&_svg]:size-4 [&_svg]:self-center [&_svg]:text-[#0b8b70]"><Users weight="duotone" /><small className="text-xs leading-[11px] text-[#71817c]">活动名额</small><strong className="truncate text-xs leading-[13px] text-[#213b34]">{data.remainingQuota !== undefined ? `剩余 ${data.remainingQuota} 席` : data.registrationRequired ? '需提前报名' : '无需报名'}</strong></span>
30
42
  </div>
31
- <div className="promotion-activity__venue"><MapPin weight="fill" /><span><small>活动地点</small><strong>{data.location ?? '当前商场'}</strong></span></div>
32
- {data.registrationRequired && <div className="promotion-activity__benefit"><Crown weight="fill" /><span><b>会员专享礼遇</b>完成会员身份校验后可参与</span></div>}
33
- {data.notice && <div className="promotion-activity__detail-notice"><Clock weight="duotone" /><span>{data.notice}</span></div>}
34
- {(data.sessions.length > 0 || data.guideSteps.length > 0) && <div className="promotion-activity__readonly"><ListChecks weight="fill" />可继续询问参与指南和可选场次</div>}
43
+ <div className="promotion-activity__venue mt-1.5 flex items-center gap-[5.5px] rounded-[7px] border border-[#e7ecea] px-2 py-1.75 [&>svg]:size-4 [&>svg]:text-[#e75c47]"><MapPin weight="fill" /><span className="grid"><small className="text-xs leading-[11px] text-[#71817c]">活动地点</small><strong className="text-xs leading-[13.5px]">{data.location ?? '当前商场'}</strong></span></div>
44
+ {data.registrationRequired && <div className="promotion-activity__benefit mt-1.5 flex items-center gap-1.5 rounded-[7px] border border-[rgba(184,134,46,0.2)] bg-[#fff6df] px-2 py-1.75 text-[#805616] [&>svg]:size-[17px] [&>svg]:shrink-0"><Crown weight="fill" /><span className="grid text-xs leading-3"><b className="text-xs leading-[13.5px]">会员专享礼遇</b>完成会员身份校验后可参与</span></div>}
45
+ {data.notice && <div className="promotion-activity__detail-notice mt-1.5 flex items-center gap-[5px] rounded-[6px] border border-[#e4e9e7] bg-[#f4f7f6] px-[7.5px] py-[6.5px] text-xs leading-[12.5px] text-[#596d66] [&>svg]:size-3 [&>svg]:shrink-0 [&>svg]:text-[#7b8e87]"><Clock weight="duotone" /><span>{data.notice}</span></div>}
46
+ {(data.sessions.length > 0 || data.guideSteps.length > 0) && <div className={`promotion-activity__readonly ${ACTIVITY_READONLY}`}><ListChecks weight="fill" />可继续询问参与指南和可选场次</div>}
35
47
  {(data.registrationRequired || data.jumpOnly) && data.registrationUrl && (
36
48
  <button
37
49
  type="button"
38
- className="promotion-activity__register"
50
+ className="promotion-activity__register flex min-h-[42px] w-full cursor-pointer touch-manipulation items-center justify-center gap-[5px] rounded-full border-0 bg-[linear-gradient(135deg,#ff8c33_0%,#ff6f1f_100%)] mt-[9px] text-xs font-bold leading-[14px] text-white shadow-[0_3px_7px_rgba(255,111,31,0.2)] [font-family:inherit] hover:not-disabled:opacity-80 focus-visible:outline-3 focus-visible:outline-offset-3 focus-visible:outline-[#0b8b70] disabled:cursor-default disabled:bg-[#e3e7ee] disabled:bg-none disabled:opacity-50 disabled:shadow-none [&_svg]:size-[13.5px] [&_svg]:shrink-0"
39
51
  disabled={isHistory}
40
52
  onClick={() => sendCardAction(cardId, { type: 'openLink', url: data.registrationUrl! })}
41
53
  >
@@ -43,7 +55,7 @@ function ActivityDetail({ data, cardId, isHistory }: { data: PromotionActivityDe
43
55
  {data.jumpOnly ? (data.jumpLabel ?? '打开小程序') : '去支付宝报名'}
44
56
  </button>
45
57
  )}
46
- {data.jumpOnly && !data.registrationUrl && <div className="promotion-activity__detail-notice"><Clock weight="duotone" /><span>该首页资源暂无可用跳转链接</span></div>}
58
+ {data.jumpOnly && !data.registrationUrl && <div className="promotion-activity__detail-notice mt-1.5 flex items-center gap-[5px] rounded-[6px] border border-[#e4e9e7] bg-[#f4f7f6] px-[7.5px] py-[6.5px] text-xs leading-[12.5px] text-[#596d66] [&>svg]:size-3 [&>svg]:shrink-0 [&>svg]:text-[#7b8e87]"><Clock weight="duotone" /><span>该首页资源暂无可用跳转链接</span></div>}
47
59
  </div>
48
60
  </section>
49
61
  );
@@ -51,14 +63,14 @@ function ActivityDetail({ data, cardId, isHistory }: { data: PromotionActivityDe
51
63
 
52
64
  function ActivitySchedule({ data }: { data: PromotionActivityDetailCardData }) {
53
65
  return (
54
- <section className="promotion-card promotion-activity promotion-activity--schedule">
66
+ <section className="promotion-card promotion-activity promotion-activity--schedule relative w-full overflow-hidden bg-card text-sm leading-[normal] tracking-[0] text-foreground">
55
67
  <ActivityHeader title="选择心仪场次" subtitle={data.title} icon="calendar" />
56
- <div className="promotion-activity__session-summary"><CalendarDots weight="duotone" /><span><small>可选场次</small><strong>{data.sessions.length} 场</strong></span><em>实时名额</em></div>
57
- <div className="promotion-activity__sessions">
58
- {data.sessions.map((session, index) => <article key={session.sessionRef} className={session.status === 'OPEN' ? 'is-available' : 'is-full'}><b>{String(index + 1).padStart(2, '0')}</b><span><strong>{session.title}</strong><small>{session.startText}{session.endText ? ` - ${session.endText}` : ''}</small></span><span><Users weight="duotone" />{session.remainingQuota !== undefined ? `余 ${session.remainingQuota} 席` : session.location ?? '名额实时'}</span><em>{sessionText[session.status]}</em></article>)}
59
- {!data.sessions.length && <div className="promotion-activity__empty-state"><Clock weight="duotone" /><span><strong>场次正在确认</strong><small>稍后再来查看最新安排</small></span></div>}
68
+ <div className="promotion-activity__session-summary mx-3.5 mb-[9px] grid grid-cols-[27px_minmax(0,1fr)_auto] items-center gap-1.5 rounded-[7px] border border-[rgba(184,134,46,0.2)] bg-[linear-gradient(105deg,#fff9eb,#fff4d8)] px-[8.5px] py-[7.5px] [&>svg]:size-[19px] [&>svg]:text-[#b8862e]"><CalendarDots weight="duotone" /><span className="grid"><small className="text-xs leading-[11px] text-[#806b43]">可选场次</small><strong className="text-xs leading-[14.5px] text-[#5c451c]">{data.sessions.length} 场</strong></span><em className="text-xs font-bold not-italic leading-[normal] text-[#9a6813]">实时名额</em></div>
69
+ <div className="promotion-activity__sessions grid gap-1.5 px-3.5 pb-[9px]">
70
+ {data.sessions.map((session, index) => <article key={session.sessionRef} className={`grid min-h-[46px] grid-cols-[25px_minmax(0,1fr)_auto_auto] items-center gap-[7px] rounded-[7px] border border-[#e0eae6] px-2 py-1.75 shadow-[0_4px_11px_rgba(31,77,65,0.06)] ${session.status === 'OPEN' ? 'is-available' : 'is-full opacity-[0.68]'}`}><b className="grid size-[25px] place-items-center rounded-[7px] bg-[#e5f7f1] text-xs leading-[normal] text-[#08735d]">{String(index + 1).padStart(2, '0')}</b><span className="grid gap-[0.5px]"><strong className="text-xs leading-[14px]">{session.title}</strong><small className="text-xs leading-3 text-[#71817c]">{session.startText}{session.endText ? ` - ${session.endText}` : ''}</small></span><span className="flex items-center gap-[2.5px] whitespace-nowrap text-xs text-[#61736d]"><Users weight="duotone" />{session.remainingQuota !== undefined ? `余 ${session.remainingQuota} 席` : session.location ?? '名额实时'}</span><em className="rounded-full bg-[#e7f8f2] px-[5px] py-[3px] text-xs font-bold not-italic leading-[normal] text-[#08735d]">{sessionText[session.status]}</em></article>)}
71
+ {!data.sessions.length && <div className="promotion-activity__empty-state flex min-h-[53px] items-center justify-center gap-[7px] rounded-[7px] border border-dashed border-[#cadbd5] bg-[#f8fbfa] text-xs text-[#667973] [&_svg]:size-[19px]"><Clock weight="duotone" /><span className="grid"><strong className="text-xs leading-[normal]">场次正在确认</strong><small className="text-xs leading-[normal]">稍后再来查看最新安排</small></span></div>}
60
72
  </div>
61
- <p className="promotion-activity__readonly"><CheckCircle weight="fill" />当前仅展示场次与名额,不会直接提交报名</p>
73
+ <p className={`promotion-activity__readonly ${ACTIVITY_READONLY}`}><CheckCircle weight="fill" />当前仅展示场次与名额,不会直接提交报名</p>
62
74
  </section>
63
75
  );
64
76
  }
@@ -67,18 +79,18 @@ function ActivityGuide({ data }: { data: PromotionActivityDetailCardData }) {
67
79
  const steps: Array<{ title: string; description?: string }> =
68
80
  data.guideItems ?? data.guideSteps.map((title) => ({ title }));
69
81
  return (
70
- <section className="promotion-card promotion-activity promotion-activity--guide">
82
+ <section className="promotion-card promotion-activity promotion-activity--guide relative w-full overflow-hidden bg-card text-sm leading-[normal] tracking-[0] text-foreground">
71
83
  <ActivityHeader title="参与指南" subtitle={data.title} icon="guide" />
72
- <div className="promotion-activity__guide-banner"><Sparkle weight="fill" /><span><small>HOW TO JOIN</small><strong>提前准备,到场更从容</strong></span></div>
73
- <ol className="promotion-activity__steps">{steps.map((step, index) => <li key={index}><b>{index + 1}</b><span><strong>{step.title}</strong><small>{step.description ?? ''}</small></span></li>)}</ol>
74
- {data.conditions.length > 0 && <div className="promotion-activity__requirements"><b>参与条件</b><div>{data.conditions.map((item) => <span key={item}><CheckCircle weight="fill" />{item}</span>)}</div></div>}
75
- <p className="promotion-activity__readonly"><CheckCircle weight="fill" />{data.notice ?? '当前仅提供参与说明,不会直接提交报名'}</p>
84
+ <div className="promotion-activity__guide-banner mx-3.5 mb-2.5 flex items-center gap-[7px] rounded-[7px] border border-[rgba(184,134,46,0.18)] bg-[linear-gradient(105deg,#fff9ed,#fff3d6)] px-[9px] py-2 text-[#78531a] [&>svg]:size-[19px]"><Sparkle weight="fill" /><span className="grid"><small className="text-xs font-extrabold leading-[11px]">HOW TO JOIN</small><strong className="text-xs leading-[14px]">提前准备,到场更从容</strong></span></div>
85
+ <ol className="promotion-activity__steps grid list-none px-3.5 pb-[9px]">{steps.map((step, index) => <li key={index} className="relative grid min-h-[41px] grid-cols-[24px_minmax(0,1fr)] items-start gap-[7px] [&:not(:last-child)]:after:absolute [&:not(:last-child)]:after:top-6 [&:not(:last-child)]:after:bottom-0.5 [&:not(:last-child)]:after:left-[11.5px] [&:not(:last-child)]:after:w-px [&:not(:last-child)]:after:bg-[#cbe6de] [&:not(:last-child)]:after:content-['']"><b className="z-[1] grid size-6 place-items-center rounded-full bg-[linear-gradient(145deg,#0e9a79,#08745f)] text-xs leading-[normal] text-white shadow-[0_3.5px_9px_rgba(8,116,95,0.18)]">{index + 1}</b><span className="grid gap-[1.5px] pt-[1.5px]"><strong className="text-xs leading-[14.5px]">{step.title}</strong><small className="text-xs leading-[13px] text-[#687a74]">{step.description ?? ''}</small></span></li>)}</ol>
86
+ {data.conditions.length > 0 && <div className="promotion-activity__requirements mx-3.5 mb-[9px] rounded-[7px] border border-[#dfebe7] bg-[#f8fbfa] px-[8.5px] py-[7.5px]"><b className="mb-[4.5px] block text-xs leading-[normal] text-[#29473e]">参与条件</b><div className="flex flex-wrap gap-1">{data.conditions.map((item) => <span key={item} className="flex items-center gap-[2.5px] rounded-full bg-[#e6f7f1] px-[5px] py-[3px] text-xs leading-[normal] text-[#08745f] [&_svg]:size-2.5"><CheckCircle weight="fill" />{item}</span>)}</div></div>}
87
+ <p className={`promotion-activity__readonly ${ACTIVITY_READONLY}`}><CheckCircle weight="fill" />{data.notice ?? '当前仅提供参与说明,不会直接提交报名'}</p>
76
88
  </section>
77
89
  );
78
90
  }
79
91
 
80
92
  function ActivityHeader({ title, subtitle, icon }: { title: string; subtitle: string; icon: 'calendar' | 'guide' }) {
81
- return <header className="promotion-card__header promotion-card__header--compact"><span className="promotion-card__mark">{icon === 'calendar' ? <CalendarDots weight="duotone" /> : <ListChecks weight="duotone" />}</span><div><span className="promotion-card__eyebrow">会员活动</span><h3>{title}</h3><p>{subtitle}</p></div></header>;
93
+ return <header className={`promotion-card__header promotion-card__header--compact ${ACTIVITY_HEADER_COMPACT}`}><span className={`promotion-card__mark ${ACTIVITY_MARK}`}>{icon === 'calendar' ? <CalendarDots weight="duotone" /> : <ListChecks weight="duotone" />}</span><div className="min-w-0 flex-1"><span className={`promotion-card__eyebrow ${ACTIVITY_EYEBROW}`}>会员活动</span><h3 className={ACTIVITY_H3}>{title}</h3><p className={ACTIVITY_HP}>{subtitle}</p></div></header>;
82
94
  }
83
95
 
84
96
  export default PromotionActivityDetailCard;
@@ -2,6 +2,10 @@ import { CalendarDots, Sparkle, Ticket } from '@phosphor-icons/react';
2
2
  import { sendCardAction } from '@tbox.cn/app-agent-sdk-client';
3
3
  import type { PromotionActivityListCardData } from '@tbox.cn/app-contracts-mall';
4
4
  import { ImageWithFallback } from '../../components/ImageWithFallback';
5
+ import {
6
+ PROMOTION_ACTIVITY_STATUS_CLASS,
7
+ PROMOTION_ACTIVITY_STATUS_TONE_CLASS,
8
+ } from '../../components/class-names';
5
9
 
6
10
  const statusText: Record<string, string> = { AVAILABLE: '可报名', FULL: '已满', ENDED: '已结束', UPCOMING: '即将开始', UNKNOWN: '待确认' };
7
11
 
@@ -12,17 +16,17 @@ export function PromotionActivityListCard(props: {
12
16
  }) {
13
17
  const { data, cardId = '', isHistory = false } = props;
14
18
  return (
15
- <section className="promotion-card promotion-activity promotion-activity--list">
16
- <header className="promotion-activity__header promotion-activity__header--pea">
17
- <div className="promotion-activity__header-copy">
18
- <div className="promotion-activity__header-title-row">
19
+ <section className="promotion-card promotion-activity promotion-activity--list relative w-full overflow-hidden bg-card text-sm leading-[normal] tracking-[0] text-foreground">
20
+ <header className="promotion-activity__header promotion-activity__header--pea relative flex min-h-[87px] items-center overflow-hidden bg-[#f9f1e2] bg-cover bg-center bg-[image:var(--tbox-asset-promotion-activity-header,linear-gradient(135deg,#fff1f3,#ffe4e8))] px-3.5 pt-3 pb-2.5">
21
+ <div className="promotion-activity__header-copy relative z-[1] w-[52%] min-w-0">
22
+ <div className="promotion-activity__header-title-row flex items-center gap-2.5 text-[#2f3a22] [&_svg]:size-[15px] [&_svg]:shrink-0 [&_svg]:text-[#4f7b37]">
19
23
  <Sparkle weight="fill" />
20
- <h3>活动中心</h3>
24
+ <h3 className="text-base font-bold leading-[21px] text-[#2f3a22] [overflow-wrap:anywhere]">活动中心</h3>
21
25
  </div>
22
- <p>发现商场近期精彩活动</p>
26
+ <p className="mt-1 text-xs leading-4 text-[#626b5c]">发现商场近期精彩活动</p>
23
27
  </div>
24
28
  </header>
25
- <div className="promotion-activity__list">
29
+ <div className="promotion-activity__list grid px-3.5 pt-0.5 pb-1.25">
26
30
  {data.items.map((item) => {
27
31
  const status = item.availabilityStatus ?? (item.remainingQuota === 0 ? 'FULL' : 'UNKNOWN');
28
32
  const action = item.itemActions?.find((candidate) => candidate.kind === 'send' || candidate.kind === 'link');
@@ -32,7 +36,7 @@ export function PromotionActivityListCard(props: {
32
36
  type="button"
33
37
  disabled={isHistory || !action}
34
38
  aria-label={action?.label ?? (jumpOnly ? `打开${item.title}` : `查看${item.title}详情`)}
35
- className={status === 'FULL' || status === 'ENDED' ? 'is-muted' : ''}
39
+ className={`grid min-h-[71px] w-full cursor-pointer touch-manipulation grid-cols-[71px_minmax(0,1fr)] items-center gap-[9px] border-0 border-t border-[#e6ecea] bg-transparent py-[9px] text-left text-inherit transition-[background-color] duration-[180ms] ease-[ease] first:border-t-0 hover:not-disabled:bg-[#f5f8ff] focus-visible:outline-3 focus-visible:outline-offset-[-3px] focus-visible:outline-[#0b8b70] disabled:cursor-default ${status === 'FULL' || status === 'ENDED' ? 'is-muted opacity-[0.68]' : ''}`}
36
40
  onClick={() => {
37
41
  if (!action || isHistory) return;
38
42
  if (action.kind === 'link') {
@@ -42,13 +46,13 @@ export function PromotionActivityListCard(props: {
42
46
  }
43
47
  }}
44
48
  >
45
- <span className="promotion-activity__visual"><ImageWithFallback src={item.coverUrl} alt={item.title} className="promotion-activity__thumb" /><span className={`promotion-activity__status promotion-activity__status--${status.toLowerCase()}`}>{statusText[status]}</span></span>
46
- <span className="promotion-activity__copy"><small><Sparkle weight="fill" />{item.categoryName ?? (jumpOnly ? '首页精选' : '会员活动')}</small><strong>{item.title}</strong><span><CalendarDots weight="duotone" />{item.periodText ?? (jumpOnly ? '点击打开查看内容' : '时间以活动页为准')}</span><em>{item.remainingQuota !== undefined ? item.remainingQuota > 0 ? `仅余 ${item.remainingQuota} 席` : '名额已满' : jumpOnly ? (item.jumpLabel ?? '打开查看') : item.registrationRequired ? '需提前报名' : '无需报名'}</em></span>
49
+ <span className="promotion-activity__visual relative h-[53px] w-[71px]"><ImageWithFallback src={item.coverUrl} alt={item.title} className="promotion-activity__thumb h-[53px] w-[71px] rounded-[7px] object-cover shadow-[0_5px_12px_rgba(22,62,51,0.14)]" /><span className={`promotion-activity__status promotion-activity__status--${status.toLowerCase()} absolute right-1 bottom-1 ${PROMOTION_ACTIVITY_STATUS_CLASS} ${PROMOTION_ACTIVITY_STATUS_TONE_CLASS[status.toLowerCase()] ?? ''}`}>{statusText[status]}</span></span>
50
+ <span className="promotion-activity__copy grid min-w-0 gap-[2.5px]"><small className="flex items-center gap-[2.5px] text-xs font-bold leading-3 text-[#b8862e]"><Sparkle weight="fill" />{item.categoryName ?? (jumpOnly ? '首页精选' : '会员活动')}</small><strong className="line-clamp-2 text-xs leading-[15.5px]">{item.title}</strong><span className="flex items-center gap-[3px] text-xs leading-[12.5px] text-[#60726c]"><CalendarDots weight="duotone" />{item.periodText ?? (jumpOnly ? '点击打开查看内容' : '时间以活动页为准')}</span><em className="text-xs font-bold not-italic leading-3 text-[#e75c47]">{item.remainingQuota !== undefined ? item.remainingQuota > 0 ? `仅余 ${item.remainingQuota} 席` : '名额已满' : jumpOnly ? (item.jumpLabel ?? '打开查看') : item.registrationRequired ? '需提前报名' : '无需报名'}</em></span>
47
51
  </button>;
48
52
  })}
49
53
  </div>
50
- {!data.items.length && <div className="promotion-card__empty"><CalendarDots size={28} /><span>{data.noResultsReason ?? '近期暂无活动'}</span></div>}
51
- <footer className="promotion-activity__footer"><Ticket weight="duotone" />会员活动名额实时变化,以活动详情为准</footer>
54
+ {!data.items.length && <div className="promotion-card__empty flex min-h-[94px] items-center justify-center gap-2 p-5 text-xs leading-[normal] text-secondary-foreground"><CalendarDots size={28} /><span>{data.noResultsReason ?? '近期暂无活动'}</span></div>}
55
+ <footer className="promotion-activity__footer flex items-center justify-center gap-1 border-t border-[#e7eeeb] px-3.5 pt-2 pb-2.5 text-xs leading-3 text-[#6c7c77]"><Ticket weight="duotone" />会员活动名额实时变化,以活动详情为准</footer>
52
56
  </section>
53
57
  );
54
58
  }
@@ -7,10 +7,10 @@ export function PromotionBestDealCard({ data }: { data: PromotionBestDealCardDat
7
7
  const savings = data.savingsCents ?? 0;
8
8
  const payable = data.expectedPayCents ?? Math.max(0, data.originalAmountCents - savings);
9
9
  return (
10
- <section className="promotion-card promotion-deal" aria-label="优惠测算">
11
- <header className="promotion-card__header"><span className="promotion-card__mark promotion-card__mark--cyan"><Calculator weight="duotone" /></span><div><span className="promotion-card__eyebrow">优惠方案</span><h3>优惠测算</h3><p>{data.authoritative ? '实时优惠测算' : '结算前优惠建议'}</p></div></header>
12
- {data.authoritative ? <div className="promotion-deal__hero"><span><small>预计实付</small><strong>¥{money(payable)}</strong></span><em>预计节省 ¥{money(savings)}</em></div> : <div className="promotion-deal__notice"><TrendUp weight="duotone" /><span><b>当前为建议结果</b>{data.message ?? '最终金额请在结算页确认'}</span></div>}
13
- <div className="promotion-deal__metrics"><span><small>消费金额</small><strong>¥{money(data.originalAmountCents)}</strong></span><span><small>预计节省</small><strong>¥{money(savings)}</strong></span><span><small>候选优惠</small><strong>{data.candidates?.length ?? data.appliedOfferRefs.length}</strong></span></div>
10
+ <section className="promotion-card promotion-deal relative w-full overflow-hidden bg-card pb-[15px] text-sm leading-[normal] tracking-[0] text-foreground" aria-label="优惠测算">
11
+ <header className="promotion-card__header flex min-w-0 items-center gap-2.5 px-4 pt-3.5 pb-3 max-[380px]:px-[13px] min-[760px]:pt-[15px]"><span className="promotion-card__mark promotion-card__mark--cyan grid h-[38px] w-[38px] flex-[0_0_38px] place-items-center rounded-[10px] border border-[rgba(13,115,132,0.18)] bg-[#e1f5f7] text-[#0d7384] shadow-[0_5px_14px_rgba(8,119,95,0.08)] [&_svg]:size-5"><Calculator weight="duotone" /></span><div className="min-w-0 flex-1"><span className="promotion-card__eyebrow mb-0.5 block text-xs font-bold leading-[14px] text-[#2368ec]">优惠方案</span><h3 className="text-lg font-bold leading-[22px] text-foreground [overflow-wrap:anywhere] max-[380px]:text-base">优惠测算</h3><p className="mt-0.5 truncate text-xs leading-4 text-secondary-foreground">{data.authoritative ? '实时优惠测算' : '结算前优惠建议'}</p></div></header>
12
+ {data.authoritative ? <div className="promotion-deal__hero mx-4 flex items-center justify-between gap-2.5 rounded-[8px] bg-[linear-gradient(135deg,#eaf8f1,var(--tbox-domain-promotion-surface,#fff1f3))] px-3 py-[11px]"><span className="grid"><small className="text-xs leading-[normal] text-secondary-foreground">预计实付</small><strong className="text-2xl tabular-nums leading-[normal] text-[var(--tbox-domain-promotion-accent,#e42f46)]">¥{money(payable)}</strong></span><em className="rounded-full bg-card px-2 py-1.25 text-xs font-bold not-italic leading-[normal] text-[var(--tbox-domain-promotion-accent,#e42f46)] shadow-[0_4px_12px_rgba(69,69,69,0.08)]">预计节省 ¥{money(savings)}</em></div> : <div className="promotion-deal__notice mx-4 mt-2.5 flex items-start gap-[7px] rounded-[7px] bg-[var(--tbox-domain-promotion-surface,#fff1f3)] px-[9px] py-2 text-xs leading-[normal] text-[#744333] [&_svg]:shrink-0 [&_svg]:text-[var(--tbox-domain-promotion-accent,#e42f46)]"><TrendUp weight="duotone" /><span className="grid gap-[1px]"><b>当前为建议结果</b>{data.message ?? '最终金额请在结算页确认'}</span></div>}
13
+ <div className="promotion-deal__metrics mx-4 mt-[9px] grid grid-cols-3 gap-1.5"><span className="grid min-w-0 gap-[0.5px] rounded-[6px] border border-border bg-[#f9fbfa] px-1.5 py-2 text-center"><small className="text-xs leading-[normal] text-secondary-foreground">消费金额</small><strong className="overflow-hidden text-ellipsis text-sm leading-[normal] text-[#128356]">¥{money(data.originalAmountCents)}</strong></span><span className="grid min-w-0 gap-[0.5px] rounded-[6px] border border-border bg-[#f9fbfa] px-1.5 py-2 text-center"><small className="text-xs leading-[normal] text-secondary-foreground">预计节省</small><strong className="overflow-hidden text-ellipsis text-sm leading-[normal] text-[#128356]">¥{money(savings)}</strong></span><span className="grid min-w-0 gap-[0.5px] rounded-[6px] border border-border bg-[#f9fbfa] px-1.5 py-2 text-center"><small className="text-xs leading-[normal] text-secondary-foreground">候选优惠</small><strong className="overflow-hidden text-ellipsis text-sm leading-[normal] text-[#128356]">{data.candidates?.length ?? data.appliedOfferRefs.length}</strong></span></div>
14
14
  </section>
15
15
  );
16
16
  }
@@ -9,6 +9,10 @@ import { ImageWithFallback } from '../../components/ImageWithFallback';
9
9
  import { sanitizeActivityHtml } from '../../utils/sanitize-activity-html';
10
10
  import { scrollCardBottom } from '../../utils/scroll-card-bottom';
11
11
  import { entitlementStatusLabel } from '../view';
12
+ import {
13
+ PROMOTION_CHIP_COUPON_CLASS,
14
+ PROMOTION_CHIP_COUPON_OFF_CLASS,
15
+ } from '../../components/class-names';
12
16
 
13
17
  export function PromotionEntitlementListCard(props: {
14
18
  data: PromotionEntitlementListCardData;
@@ -72,40 +76,40 @@ export function PromotionEntitlementListCard(props: {
72
76
  try { await navigator.clipboard?.writeText(code); setCopied(true); window.setTimeout(() => setCopied(false), 1600); } catch { setCopied(false); }
73
77
  };
74
78
  return (
75
- <section className="promotion-card promotion-list--coupon promotion-entitlements" aria-label="我的优惠权益">
76
- <header className="promotion-activity__header promotion-activity__header--pea promotion-coupon__header">
77
- <div className="promotion-activity__header-copy">
78
- <div className="promotion-activity__header-title-row">
79
+ <section className="promotion-card promotion-list--coupon promotion-entitlements relative w-full overflow-hidden bg-card text-sm leading-[normal] tracking-[0] text-foreground" aria-label="我的优惠权益">
80
+ <header className="promotion-activity__header promotion-activity__header--pea promotion-coupon__header relative flex min-h-[87px] items-center overflow-hidden bg-[#f9f1e2] bg-cover bg-center bg-[image:var(--tbox-asset-promotion-coupon-header,linear-gradient(135deg,#fff1f3,#ffe4e8))] px-3.5 pt-3 pb-2.5">
81
+ <div className="promotion-activity__header-copy relative z-[1] w-[52%] min-w-0">
82
+ <div className="promotion-activity__header-title-row flex items-center gap-2.5 text-[#2f3a22] [&_svg]:size-[15px] [&_svg]:shrink-0 [&_svg]:text-[#4f7b37]">
79
83
  <Ticket weight="fill" />
80
- <h3>我的优惠券</h3>
84
+ <h3 className="text-base font-bold leading-[21px] text-[#2f3a22] [overflow-wrap:anywhere]">我的优惠券</h3>
81
85
  </div>
82
- <p>当前账户 · 券包权益</p>
86
+ <p className="mt-1 text-xs leading-4 text-[#626b5c]">当前账户 · 券包权益</p>
83
87
  </div>
84
88
  </header>
85
- {!data.items.length ? <div className="promotion-card__empty"><Ticket size={28} weight="duotone" /><span>{data.noResultsReason ?? '当前账户暂无可用权益'}</span></div> : (
86
- <div ref={listRef} className={`promotion-list__items${expanded ? ' promotion-list__items--expanded' : ''}`} style={{ maxHeight: expanded ? listHeights.expanded || undefined : listHeights.collapsed || undefined }} onTransitionEnd={() => { if (bottomRef.current) scrollCardBottom(bottomRef.current); }}>
89
+ {!data.items.length ? <div className="promotion-card__empty flex min-h-[94px] items-center justify-center gap-2 p-5 text-xs leading-[normal] text-secondary-foreground"><Ticket size={28} weight="duotone" /><span>{data.noResultsReason ?? '当前账户暂无可用权益'}</span></div> : (
90
+ <div ref={listRef} className={`promotion-list__items overflow-hidden px-3.5 pb-1 ${expanded ? ' promotion-list__items--expanded transition-none' : ' transition-[max-height] duration-[320ms] ease-[ease]'}`} style={{ maxHeight: expanded ? listHeights.expanded || undefined : listHeights.collapsed || undefined }} onTransitionEnd={() => { if (bottomRef.current) scrollCardBottom(bottomRef.current); }}>
87
91
  {data.items.map((item) => (
88
92
  <article
89
93
  key={item.entitlementRef}
90
- className={`promotion-coupon-row${item.status === 'EFFECTIVE' ? '' : ' promotion-coupon-row--disabled'}`}
94
+ className={`promotion-coupon-row relative grid min-h-[77px] w-full cursor-pointer grid-cols-[56px_minmax(0,1fr)_auto] items-center gap-x-2 gap-y-0 overflow-hidden border-t border-[#f0f1f4] py-[9px] text-left text-inherit first:border-t-0 focus-visible:rounded-[6px] focus-visible:outline-2 focus-visible:outline-offset-[-2px] focus-visible:outline-[#2368ec] ${item.status === 'EFFECTIVE' ? '' : ' promotion-coupon-row--disabled opacity-72'}`}
91
95
  role="button"
92
96
  tabIndex={0}
93
97
  aria-label={`查看「${item.title}」`}
94
98
  onClick={() => setOpenRef(item.entitlementRef)}
95
99
  onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); setOpenRef(item.entitlementRef); } }}
96
100
  >
97
- <ImageWithFallback src={item.imageUrl} alt={item.title} className="promotion-coupon-row__thumb" />
98
- <div className="promotion-coupon-row__main">
99
- <strong className="promotion-coupon-row__title">{item.title}</strong>
101
+ <ImageWithFallback src={item.imageUrl} alt={item.title} className="promotion-coupon-row__thumb h-14 w-14 shrink-0 rounded-[6px] object-cover shadow-[inset_0_0_0_1px_rgba(11,15,23,0.04)] [&:not(.promotion-image--fallback)]:block" />
102
+ <div className="promotion-coupon-row__main relative flex min-w-0 flex-col justify-center gap-[3.5px] self-stretch pr-0.5">
103
+ <strong className="promotion-coupon-row__title line-clamp-2 text-xs font-bold leading-4 text-[rgba(11,15,23,0.9)]">{item.title}</strong>
100
104
  {item.usageNotice
101
- && <span className="promotion-coupon-row__sub" dangerouslySetInnerHTML={{ __html: sanitizeActivityHtml(item.usageNotice) }} />}
102
- <span className="promotion-coupon-row__price">
103
- <b>{item.benefitText ?? entitlementStatusLabel(item.status)}</b>
104
- {item.thresholdText && <em className="promotion-coupon-row__discount">{item.thresholdText}</em>}
105
+ && <span className="promotion-coupon-row__sub line-clamp-2 text-xs leading-[11.5px] text-[rgba(11,15,23,0.55)]" dangerouslySetInnerHTML={{ __html: sanitizeActivityHtml(item.usageNotice) }} />}
106
+ <span className="promotion-coupon-row__price mt-[1px] flex min-w-0 items-baseline gap-1">
107
+ <b className="shrink-0 text-sm font-extrabold leading-[17px] text-[#e8471c]">{item.benefitText ?? entitlementStatusLabel(item.status)}</b>
108
+ {item.thresholdText && <em className="promotion-coupon-row__discount shrink-0 rounded-[2px] bg-[#fff1eb] px-[3.5px] py-[1px] text-xs font-bold not-italic leading-[10.5px] text-[#e8471c]">{item.thresholdText}</em>}
105
109
  </span>
106
110
  </div>
107
111
  <span
108
- className={`promotion-owned-action promotion-chip promotion-chip--coupon promotion-coupon-row__state--${item.status.toLowerCase()}${item.status === 'EFFECTIVE' ? '' : ' promotion-chip--coupon-off'}`}
112
+ className={`promotion-owned-action promotion-chip promotion-chip--coupon promotion-coupon-row__state--${item.status.toLowerCase()} justify-self-end pointer-events-none ${item.status === 'EFFECTIVE' ? PROMOTION_CHIP_COUPON_CLASS : `promotion-chip--coupon-off ${PROMOTION_CHIP_COUPON_OFF_CLASS}`}`}
109
113
  aria-hidden="true"
110
114
  >
111
115
  {item.status === 'EFFECTIVE' ? '去使用' : entitlementStatusLabel(item.status)}
@@ -117,7 +121,7 @@ export function PromotionEntitlementListCard(props: {
117
121
  {data.items.length > maxItems && (
118
122
  <button
119
123
  type="button"
120
- className="promotion-list__toggle"
124
+ className="promotion-list__toggle inline-flex w-full cursor-pointer items-center justify-center gap-[3px] mt-0.5 border-0 border-t border-[rgba(188,205,191,0.42)] bg-[linear-gradient(105deg,#fffaf0_0%,#f9f5e9_46%,#eaf6f3_100%)] px-3 pt-[7px] pb-2 text-xs font-semibold leading-[normal] text-foreground [font-family:inherit] hover:brightness-[0.94] focus-visible:outline-3 focus-visible:outline-foreground focus-visible:outline-offset-[-3px] [&_svg]:transition-transform [&_svg]:duration-[160ms] [&_svg]:ease-[ease] [&_svg[data-rotated=true]]:rotate-180"
121
125
  aria-expanded={expanded}
122
126
  onClick={toggleExpanded}
123
127
  >
@@ -125,7 +129,7 @@ export function PromotionEntitlementListCard(props: {
125
129
  {expanded ? '收起' : `查看更多(${data.items.length - maxItems} 条)`}
126
130
  </button>
127
131
  )}
128
- {data.items.length > maxItems && <div ref={bottomRef} className="promotion-list__bottom-anchor" aria-hidden="true" />}
132
+ {data.items.length > maxItems && <div ref={bottomRef} className="promotion-list__bottom-anchor h-0 flex-none scroll-mb-[max(96px,calc(var(--tbox-chat-bottom-height,0px)_+_24px))]" aria-hidden="true" />}
129
133
  {sheetTarget && (() => {
130
134
  const facts = [
131
135
  sheetFact(<MapPinLine weight="duotone" />, '使用场景', sheetTarget.usageSceneText),
@@ -145,7 +149,7 @@ export function PromotionEntitlementListCard(props: {
145
149
  guaranteeText={sheetTarget.guaranteeText}
146
150
  facts={facts}
147
151
  onClose={() => setOpenRef(null)}
148
- beforeFacts={<>{sheetTarget.qrCodeEnabled && sheetTarget.code && <><CouponBarcode value={sheetTarget.code} disabled={sheetTarget.status !== 'EFFECTIVE'} /><CouponQrCode value={sheetTarget.code} disabled={sheetTarget.status !== 'EFFECTIVE'} /></>}{(sheetTarget.code || sheetTarget.codeMasked) && <div className={`promotion-sheet__code${sheetTarget.status === 'EFFECTIVE' ? '' : ' promotion-sheet__code--disabled'}`}><span>券码</span><strong>{sheetTarget.code || sheetTarget.codeMasked}</strong><button type="button" className="promotion-sheet__copy" onClick={() => copyCode(sheetTarget.code || sheetTarget.codeMasked!)}><Copy size={16} />{copied ? '已复制' : '复制'}</button></div>}{sheetTarget.stores?.length ? <><div className="promotion-sheet__section">适用商家</div><div className="promotion-sheet__stores">{sheetTarget.stores.map((store) => <div className="promotion-sheet__store" key={store.storeId}>{store.imageUrl && <ImageWithFallback src={store.imageUrl} alt={store.storeName} className="promotion-sheet__store-image" />}<span><strong>{store.storeName}</strong>{store.businessName && store.businessName !== store.storeName && <small>{store.businessName}</small>}{store.floor && <small>{store.floor}</small>}{store.address && <small>{store.address}</small>}</span>{store.latitude !== undefined && store.longitude !== undefined && <button type="button" className="promotion-sheet__navigate" aria-label={`导航到${store.storeName}`} onClick={(event) => { event.stopPropagation(); void callJsapi('openLocation', { latitude: store.latitude, longitude: store.longitude, name: store.storeName, address: store.address ?? '' }).catch(() => undefined); }}><NavigationArrow size={18} />导航</button>}</div>)}</div></> : null}</>}
152
+ beforeFacts={<>{sheetTarget.qrCodeEnabled && sheetTarget.code && <><CouponBarcode value={sheetTarget.code} disabled={sheetTarget.status !== 'EFFECTIVE'} /><CouponQrCode value={sheetTarget.code} disabled={sheetTarget.status !== 'EFFECTIVE'} /></>}{(sheetTarget.code || sheetTarget.codeMasked) && <div className={`promotion-sheet__code mx-4 mt-[11px] flex items-center gap-1.5 rounded-[10px] bg-card px-3 py-[11px] ${sheetTarget.status === 'EFFECTIVE' ? '' : ' promotion-sheet__code--disabled'}`}><span className="flex-none text-xs font-bold leading-[normal] text-[rgba(11,15,23,0.86)]">券码</span><strong className={`min-w-0 text-sm font-semibold leading-[normal] tracking-[1px] [overflow-wrap:anywhere] ${sheetTarget.status === 'EFFECTIVE' ? 'text-[rgba(11,15,23,0.9)]' : 'text-[#999] line-through'}`}>{sheetTarget.code || sheetTarget.codeMasked}</strong><button type="button" className="promotion-sheet__copy my-0 ml-auto inline-flex min-h-6 flex-none cursor-pointer items-center gap-[2.5px] rounded-full border-0 bg-[#c8a45e] px-2.5 py-[3.5px] text-xs leading-[normal] text-white [font-family:inherit]" onClick={() => copyCode(sheetTarget.code || sheetTarget.codeMasked!)}><Copy size={16} />{copied ? '已复制' : '复制'}</button></div>}{sheetTarget.stores?.length ? <><div className="promotion-sheet__section mx-4 mt-[17px] text-sm font-bold leading-5 text-[rgba(11,15,23,0.9)]">适用商家</div><div className="promotion-sheet__stores mx-4 mt-2 rounded-[10px] bg-card px-3 py-1">{sheetTarget.stores.map((store, storeIndex) => <div className={`promotion-sheet__store flex items-center gap-2 py-[9px] text-xs leading-[normal] text-[#493d36] ${storeIndex > 0 ? ' border-t border-[#ecedf1]' : ''}`} key={store.storeId}>{store.imageUrl && <ImageWithFallback src={store.imageUrl} alt={store.storeName} className="promotion-sheet__store-image h-8 w-8 rounded-[6px] object-cover" />}<span className="flex min-w-0 flex-col gap-0.5"><strong className="text-sm font-semibold leading-[normal] text-[rgba(11,15,23,0.9)]">{store.storeName}</strong>{store.businessName && store.businessName !== store.storeName && <small className="truncate text-xs leading-4 text-[rgba(11,15,23,0.55)]">{store.businessName}</small>}{store.floor && <small className="truncate text-xs leading-4 text-[rgba(11,15,23,0.55)]">{store.floor}</small>}{store.address && <small className="truncate text-xs leading-4 text-[rgba(11,15,23,0.55)]">{store.address}</small>}</span>{store.latitude !== undefined && store.longitude !== undefined && <button type="button" className="promotion-sheet__navigate ml-auto inline-flex flex-none cursor-pointer items-center gap-0.5 rounded-[4px] border-0 bg-[#fff1eb] px-[5px] py-1 text-xs leading-[normal] text-[#d4512d] [font-family:inherit]" aria-label={`导航到${store.storeName}`} onClick={(event) => { event.stopPropagation(); void callJsapi('openLocation', { latitude: store.latitude, longitude: store.longitude, name: store.storeName, address: store.address ?? '' }).catch(() => undefined); }}><NavigationArrow size={18} />导航</button>}</div>)}</div></> : null}</>}
149
153
  />
150
154
  );
151
155
  })()}
@@ -5,6 +5,16 @@ import { markSelfRendering, navigateToAlipayPage, sendCardAction } from '@tbox.c
5
5
  import { ImageWithFallback } from '../../components/ImageWithFallback';
6
6
  import { offerTypeLabel } from '../view';
7
7
  import { sanitizeActivityHtml } from '../../utils/sanitize-activity-html';
8
+ import { PROMOTION_STATUS_CLASS, PROMOTION_STATUS_TONE_CLASS } from '../../components/class-names';
9
+
10
+ /**
11
+ * 底部主 CTA(券详情:全宽不做票根斜切)。`hover/disabled` 变体自带更高优先级,
12
+ * 光标在 pending 分支单独给(cursor-wait 压过 cursor-pointer)。
13
+ */
14
+ const COUPON_MAIN_ACTION_CLASS = 'flex min-h-[38px] w-full items-center justify-center rounded-[6px] border-0 bg-[#d9273d] mt-[9px] text-xs font-extrabold leading-[normal] text-white [font-family:inherit] hover:not-disabled:bg-[#c82036] focus-visible:shadow-[inset_0_0_0_3px_#fff,inset_0_0_0_6px_#5f101d] focus-visible:outline-none disabled:cursor-not-allowed disabled:opacity-50';
15
+
16
+ /** 领取中:进度光带(keyframes 由宿主 tailwind 入口登记) */
17
+ const COUPON_MAIN_ACTION_PENDING_CLASS = 'relative overflow-hidden cursor-wait after:absolute after:inset-0 after:w-[38%] after:animate-[promotion-claim-progress_1.1s_ease-in-out_infinite] after:bg-[rgba(255,255,255,0.18)] after:content-[\'\'] after:[transform:translateX(-140%)_skewX(-18deg)] motion-reduce:after:animate-none';
8
18
 
9
19
  const modeText: Record<string, string> = {
10
20
  AUTOMATIC_DISCOUNT: '结算时自动优惠',
@@ -57,36 +67,36 @@ export function PromotionOfferDetailCard({ data, cardId = '', isHistory = false,
57
67
  const purchaseOnly = coupon && data.claimActionLabel === '抢购';
58
68
  const label = data.presentation === 'promotion' ? '本周活动' : data.presentation === 'package' ? '组合礼包' : '会员专享';
59
69
  return (
60
- <section className={`promotion-card promotion-detail${coupon ? ' promotion-detail--coupon' : ''}`} aria-label={data.title}>
61
- <div className="promotion-detail__hero">
62
- <ImageWithFallback src={data.imageUrl} alt={data.title} className="promotion-detail__image" />
63
- <span className="promotion-detail__hero-label">{label}</span>
64
- <div className="promotion-detail__glass"><small>{data.claimable ? '可领取' : '详情'}</small><strong>{data.benefitText ?? offerTypeLabel(data.offerType)}</strong><em>{data.subtitle ?? '当前商场可用'}</em></div>
70
+ <section className={`promotion-card promotion-detail relative w-full overflow-hidden bg-card text-sm leading-[normal] tracking-[0] text-foreground ${coupon ? ' promotion-detail--coupon' : ''}`} aria-label={data.title}>
71
+ <div className={coupon ? 'promotion-detail__hero relative mx-2.5 mt-[9px] h-[107px] overflow-hidden rounded-[8px] bg-[#f5f6f8]' : 'promotion-detail__hero relative h-[126px] overflow-hidden bg-[#eef2f8] min-[760px]:h-[138px]'}>
72
+ <ImageWithFallback src={data.imageUrl} alt={data.title} className="promotion-detail__image h-full w-full object-cover" />
73
+ <span className={coupon ? 'promotion-detail__hero-label absolute top-[7px] left-[7px] rounded-[3.5px] border-0 bg-[rgba(200,32,54,0.94)] px-[7px] py-1 text-xs font-bold leading-[normal] text-white backdrop-blur-[4px]' : 'promotion-detail__hero-label absolute top-2.5 left-3 rounded-full border border-[rgba(255,255,255,0.55)] bg-[rgba(6,42,101,0.66)] px-[7px] py-1 text-xs font-bold leading-[normal] text-white backdrop-blur-[4px]'}>{label}</span>
74
+ <div className={coupon ? 'promotion-detail__glass absolute right-[7px] bottom-[7px] left-[7px] grid grid-cols-[minmax(0,1fr)_auto] items-end gap-x-2.5 gap-y-[1px] rounded-[5px] border-0 bg-[rgba(255,241,243,0.94)] px-2 py-[6.5px] shadow-none backdrop-blur-[4px]' : 'promotion-detail__glass absolute right-3 bottom-2.5 left-3 grid grid-cols-[minmax(0,1fr)_auto] items-end gap-x-2.5 gap-y-[1px] rounded-[7px] border border-[rgba(255,255,255,0.62)] bg-[rgba(255,255,255,0.82)] px-2.5 py-2 shadow-[0_8px_22px_rgba(21,45,88,0.16)] backdrop-blur-[6px]'}><small className={coupon ? 'truncate text-xs font-bold leading-[normal] text-[#9f3d24]' : 'truncate text-xs font-bold leading-[normal] text-[#128356]'}>{data.claimable ? '可领取' : '详情'}</small><strong className={coupon ? 'col-start-2 row-span-2 text-lg leading-[21px] tabular-nums text-[var(--tbox-domain-promotion-accent,#e42f46)]' : 'col-start-2 row-span-2 text-2xl leading-6 tabular-nums text-[var(--tbox-domain-promotion-accent,#e42f46)]'}>{data.benefitText ?? offerTypeLabel(data.offerType)}</strong><em className={coupon ? 'truncate text-xs not-italic leading-[normal] text-[rgba(11,15,23,0.62)]' : 'truncate text-xs not-italic leading-[normal] text-secondary-foreground'}>{data.subtitle ?? '当前商场可用'}</em></div>
65
75
  </div>
66
- <div className="promotion-detail__body">
67
- <div className="promotion-detail__status"><span className={`promotion-status promotion-status--${data.claimable ? 'available' : 'unavailable'}`}><SealCheck weight="fill" />{data.claimable ? '可领取' : '暂不可领'}</span>{data.validityText && <small><Clock />{data.validityText}</small>}</div>
68
- <h3>{data.title}</h3>
69
- {(data.usageNoticeText || data.guaranteeText) && <div className="promotion-detail__notice-strip">
70
- {data.usageNoticeText && <span><b>须知</b>{data.usageNoticeText}</span>}
71
- {data.guaranteeText && <span><b>保障</b>{data.guaranteeText}</span>}
76
+ <div className={coupon ? 'promotion-detail__body px-3.5 pt-[11px] pb-3.5' : 'promotion-detail__body px-4 pt-[13px] pb-[15px] max-[380px]:px-[13px]'}>
77
+ <div className="promotion-detail__status flex items-center justify-between gap-2"><span className={`promotion-status promotion-status--${data.claimable ? 'available' : 'unavailable'} ${PROMOTION_STATUS_CLASS} ${PROMOTION_STATUS_TONE_CLASS[data.claimable ? 'available' : 'unavailable'] ?? ''}`}><SealCheck weight="fill" />{data.claimable ? '可领取' : '暂不可领'}</span>{data.validityText && <small className="flex items-center gap-1 text-xs leading-[normal] text-secondary-foreground [&_svg]:size-3"><Clock />{data.validityText}</small>}</div>
78
+ <h3 className={coupon ? 'mt-[6.5px] text-base font-bold leading-[19.5px] [overflow-wrap:anywhere]' : 'mt-2 text-lg font-bold leading-[22px] [overflow-wrap:anywhere]'}>{data.title}</h3>
79
+ {(data.usageNoticeText || data.guaranteeText) && <div className="promotion-detail__notice-strip mt-2 grid gap-[5px] rounded-[7px] bg-[#fff8ef] px-[9px] py-2">
80
+ {data.usageNoticeText && <span className="grid grid-cols-[46px_minmax(0,1fr)] items-baseline gap-2 text-xs leading-[15px] text-[#171717]"><b className="w-auto text-left text-xs leading-[normal] text-[#b38a3e]">须知</b>{data.usageNoticeText}</span>}
81
+ {data.guaranteeText && <span className="grid grid-cols-[46px_minmax(0,1fr)] items-baseline gap-2 text-xs leading-[15px] text-[#171717]"><b className="w-auto text-left text-xs leading-[normal] text-[#ef7654]">保障</b>{data.guaranteeText}</span>}
72
82
  </div>}
73
- {(data.usageSceneText || data.validityText || data.usageTimeText || data.thresholdText || data.claimTimeText) && <div className="promotion-detail__facts">
74
- {data.usageSceneText && <div><dt><MapPin weight="duotone" />使用场景</dt><dd>{data.usageSceneText}</dd></div>}
75
- {data.validityText && <div><dt><CalendarBlank weight="duotone" />有效期</dt><dd>{data.validityText}</dd></div>}
76
- {data.usageTimeText && <div><dt><Clock weight="duotone" />使用时间</dt><dd>{data.usageTimeText}</dd></div>}
77
- {data.thresholdText && <div><dt><Ticket weight="duotone" />使用限制</dt><dd>{data.thresholdText}</dd></div>}
78
- {data.claimTimeText && <div><dt><CalendarBlank weight="duotone" />可领取时间</dt><dd>{data.claimTimeText}</dd></div>}
83
+ {(data.usageSceneText || data.validityText || data.usageTimeText || data.thresholdText || data.claimTimeText) && <div className={coupon ? 'promotion-detail__facts mt-2.5 grid grid-cols-[56px_minmax(0,1fr)] overflow-hidden rounded-[7px] border border-[#eceef2] bg-[#fafafb]' : 'promotion-detail__facts mt-2.5 grid grid-cols-[56px_minmax(0,1fr)] overflow-hidden rounded-[7px] border border-border bg-[#f8faf9]'}>
84
+ {data.usageSceneText && <div className="contents"><dt className="m-0 border-t border-border px-[9px] py-1.75 text-xs leading-[normal] text-secondary-foreground"><MapPin weight="duotone" />使用场景</dt><dd className="m-0 border-t border-border px-[9px] py-1.75 text-right text-xs font-semibold leading-[normal]">{data.usageSceneText}</dd></div>}
85
+ {data.validityText && <div className="contents"><dt className="m-0 border-t border-border px-[9px] py-1.75 text-xs leading-[normal] text-secondary-foreground"><CalendarBlank weight="duotone" />有效期</dt><dd className="m-0 border-t border-border px-[9px] py-1.75 text-right text-xs font-semibold leading-[normal]">{data.validityText}</dd></div>}
86
+ {data.usageTimeText && <div className="contents"><dt className="m-0 border-t border-border px-[9px] py-1.75 text-xs leading-[normal] text-secondary-foreground"><Clock weight="duotone" />使用时间</dt><dd className="m-0 border-t border-border px-[9px] py-1.75 text-right text-xs font-semibold leading-[normal]">{data.usageTimeText}</dd></div>}
87
+ {data.thresholdText && <div className="contents"><dt className="m-0 border-t border-border px-[9px] py-1.75 text-xs leading-[normal] text-secondary-foreground"><Ticket weight="duotone" />使用限制</dt><dd className="m-0 border-t border-border px-[9px] py-1.75 text-right text-xs font-semibold leading-[normal]">{data.thresholdText}</dd></div>}
88
+ {data.claimTimeText && <div className="contents"><dt className="m-0 border-t border-border px-[9px] py-1.75 text-xs leading-[normal] text-secondary-foreground"><CalendarBlank weight="duotone" />可领取时间</dt><dd className="m-0 border-t border-border px-[9px] py-1.75 text-right text-xs font-semibold leading-[normal]">{data.claimTimeText}</dd></div>}
79
89
  </div>}
80
- {(data.steps?.length ?? 0) > 0 && <div className="promotion-detail__rules">{data.steps?.slice(0, 3).map((step, index) => <span key={index}><CheckCircle weight="fill" /><b>{step.title}</b><small>{step.description ?? ''}</small></span>)}</div>}
81
- {(data.usageRuleText || data.description) && <div className="promotion-detail__usage-rule"><strong>使用规则</strong><div dangerouslySetInnerHTML={{ __html: sanitizeActivityHtml(data.usageRuleText ?? data.description ?? '') }} /></div>}
82
- {purchaseOnly ? <button className="promotion-coupon-main-action" type="button" disabled={!data.purchaseUrl || isHistory} onClick={() => { if (!data.purchaseUrl) return; void navigateToAlipayPage(data.purchaseUrl).catch((err: unknown) => console.warn('[PromotionOfferDetailCard] navigateTo failed', err)); }}>{data.purchaseUrl ? '去小程序抢购' : '抢购链接暂不可用'}</button>
83
- : data.claimable && actionTokens?.['promotion.acquire'] && <button className={`promotion-coupon-main-action${acquiring ? ' promotion-coupon-main-action--pending' : ''}`} type="button" disabled={acquiring || claimed} onClick={() => { pendingClaimRef.current = true; setAcquiring(true); setClaimMessage('领取中,请稍候;领取成功后将自动展示我的券包'); sendCardAction(cardId, { type: 'moduleAction', actionId: 'promotion.acquire', contextToken: actionTokens['promotion.acquire'] }, { offerRef: data.offerRef }); }}>{claimed ? '已领取' : acquiring ? '领取中…' : '立即领取'}</button>}
84
- {claimMessage && <p className="promotion-detail__claim-status" role="status">{claimMessage}</p>}
85
- {(data.bundleItems?.length ?? 0) > 0 && <div className="promotion-detail__bundle">{data.bundleItems?.map((item, index) => <span key={index}><Gift weight="duotone" /><b>{item.name}</b><small>x{item.quantity}</small></span>)}</div>}
86
- {data.notice && <div className="promotion-detail__notice"><Info />{data.notice}</div>}
87
- {(data.stores?.length ?? 0) > 0 && <div className="promotion-detail__stores"><strong>适用门店</strong>{data.stores?.slice(0, 8).map((store) => <span key={store.storeId}><MapPin weight="fill" />{store.storeName}{store.floor ? ` · ${store.floor}` : ''}{store.address ? ` · ${store.address}` : ''}</span>)}</div>}
88
- {!data.claimable && data.unavailableReason && <div className="promotion-detail__notice"><Info />{data.unavailableReason}</div>}
89
- {data.caveats.length > 0 && <footer className="promotion-card__footer">{data.caveats.join(';')}</footer>}
90
+ {(data.steps?.length ?? 0) > 0 && <div className="promotion-detail__rules mt-[11px] grid gap-1.5">{data.steps?.slice(0, 3).map((step, index) => <span key={index} className="grid grid-cols-[14px_minmax(0,1fr)] items-start gap-x-1.5 gap-y-0 [&_svg]:row-span-2 [&_svg]:mt-0.5 [&_svg]:text-success"><CheckCircle weight="fill" /><b className="text-xs">{step.title}</b><small className="text-xs leading-[15px] text-secondary-foreground">{step.description ?? ''}</small></span>)}</div>}
91
+ {(data.usageRuleText || data.description) && <div className="promotion-detail__usage-rule mt-3 text-xs leading-4 text-secondary-foreground"><strong className="mb-1 block text-xs leading-[normal] text-[#171717]">使用规则</strong><div dangerouslySetInnerHTML={{ __html: sanitizeActivityHtml(data.usageRuleText ?? data.description ?? '') }} /></div>}
92
+ {purchaseOnly ? <button className={`promotion-coupon-main-action cursor-pointer ${COUPON_MAIN_ACTION_CLASS}`} type="button" disabled={!data.purchaseUrl || isHistory} onClick={() => { if (!data.purchaseUrl) return; void navigateToAlipayPage(data.purchaseUrl).catch((err: unknown) => console.warn('[PromotionOfferDetailCard] navigateTo failed', err)); }}>{data.purchaseUrl ? '去小程序抢购' : '抢购链接暂不可用'}</button>
93
+ : data.claimable && actionTokens?.['promotion.acquire'] && <button className={`promotion-coupon-main-action cursor-pointer ${COUPON_MAIN_ACTION_CLASS}${acquiring ? ` promotion-coupon-main-action--pending ${COUPON_MAIN_ACTION_PENDING_CLASS}` : ''}`} type="button" disabled={acquiring || claimed} onClick={() => { pendingClaimRef.current = true; setAcquiring(true); setClaimMessage('领取中,请稍候;领取成功后将自动展示我的券包'); sendCardAction(cardId, { type: 'moduleAction', actionId: 'promotion.acquire', contextToken: actionTokens['promotion.acquire'] }, { offerRef: data.offerRef }); }}>{claimed ? '已领取' : acquiring ? '领取中…' : '立即领取'}</button>}
94
+ {claimMessage && <p className="promotion-detail__claim-status mt-1.25 text-xs leading-[10px] text-[#9a4b12]" role="status">{claimMessage}</p>}
95
+ {(data.bundleItems?.length ?? 0) > 0 && <div className="promotion-detail__bundle mt-[11px] grid gap-[5px]">{data.bundleItems?.map((item, index) => <span key={index} className="grid grid-cols-[18px_minmax(0,1fr)_auto] items-center gap-1.5 rounded-[6px] border border-border bg-[#f8faf9] px-2 py-1.75 [&_svg]:text-[var(--tbox-domain-promotion-accent,#e42f46)]"><Gift weight="duotone" /><b className="text-xs leading-[normal]">{item.name}</b><small className="text-secondary-foreground">x{item.quantity}</small></span>)}</div>}
96
+ {data.notice && <div className={coupon ? 'promotion-detail__notice mt-2.5 flex items-start gap-1.5 rounded-[6px] border-0 bg-[var(--tbox-domain-promotion-surface,#fff1f3)] px-[9px] py-2 text-xs leading-[15px] text-[#8a4a3d] [&_svg]:mt-[1px] [&_svg]:size-3.5 [&_svg]:shrink-0' : 'promotion-detail__notice mt-2.5 flex items-start gap-1.5 rounded-[6px] border border-[rgba(228,47,70,0.12)] bg-[var(--tbox-domain-promotion-surface,#fff1f3)] px-[9px] py-2 text-xs leading-[15px] text-[#744333] [&_svg]:mt-[1px] [&_svg]:size-3.5 [&_svg]:shrink-0'}><Info />{data.notice}</div>}
97
+ {(data.stores?.length ?? 0) > 0 && <div className="promotion-detail__stores mt-1.5 grid gap-[3px] rounded-[4px] border border-[var(--promotion-line,#e5e7eb)] bg-[var(--promotion-surface-muted,#f8fafc)] px-1.5 py-1.25"><strong className="text-xs leading-[normal] text-[var(--promotion-ink,#17202a)]">适用门店</strong>{data.stores?.slice(0, 8).map((store) => <span key={store.storeId} className="flex gap-[2.5px] text-xs leading-[normal] text-[var(--promotion-muted,#667085)]"><MapPin weight="fill" />{store.storeName}{store.floor ? ` · ${store.floor}` : ''}{store.address ? ` · ${store.address}` : ''}</span>)}</div>}
98
+ {!data.claimable && data.unavailableReason && <div className={coupon ? 'promotion-detail__notice mt-2.5 flex items-start gap-1.5 rounded-[6px] border-0 bg-[var(--tbox-domain-promotion-surface,#fff1f3)] px-[9px] py-2 text-xs leading-[15px] text-[#8a4a3d] [&_svg]:mt-[1px] [&_svg]:size-3.5 [&_svg]:shrink-0' : 'promotion-detail__notice mt-2.5 flex items-start gap-1.5 rounded-[6px] border border-[rgba(228,47,70,0.12)] bg-[var(--tbox-domain-promotion-surface,#fff1f3)] px-[9px] py-2 text-xs leading-[15px] text-[#744333] [&_svg]:mt-[1px] [&_svg]:size-3.5 [&_svg]:shrink-0'}><Info />{data.unavailableReason}</div>}
99
+ {data.caveats.length > 0 && <footer className="promotion-card__footer flex items-center gap-[5px] border-t border-border px-4 pt-[9px] pb-[11px] text-xs leading-[15px] text-secondary-foreground">{data.caveats.join(';')}</footer>}
90
100
  </div>
91
101
  </section>
92
102
  );
@@ -96,17 +106,17 @@ function PromotionGuide({ data }: { data: PromotionOfferDetailCardData }) {
96
106
  const steps: Array<{ title: string; description?: string }> =
97
107
  data.steps ?? data.rules.map((rule) => ({ title: rule }));
98
108
  return (
99
- <section className="promotion-card promotion-guide" aria-label="活动参与方式">
100
- <header className="promotion-card__header promotion-card__header--compact">
101
- <span className="promotion-card__mark promotion-card__mark--cyan"><ListChecks weight="duotone" /></span>
102
- <div><span className="promotion-card__eyebrow">活动参与方式</span><h3>{data.title}</h3><p>{data.validityText ?? '当前活动有效期以现场为准'}</p></div>
103
- <b className={`promotion-status promotion-status--${data.claimable ? 'available' : 'unavailable'}`}>{data.claimable ? '可参与' : '查看规则'}</b>
109
+ <section className="promotion-card promotion-guide relative w-full overflow-hidden bg-card text-sm leading-[normal] tracking-[0] text-foreground" aria-label="活动参与方式">
110
+ <header className="promotion-card__header promotion-card__header--compact flex min-w-0 items-center gap-2.5 px-4 pt-3.5 pb-2.5 max-[380px]:px-[13px] min-[760px]:pt-[15px]">
111
+ <span className="promotion-card__mark promotion-card__mark--cyan grid h-[38px] w-[38px] flex-[0_0_38px] place-items-center rounded-[10px] border border-[rgba(13,115,132,0.18)] bg-[#e1f5f7] text-[#0d7384] shadow-[0_5px_14px_rgba(8,119,95,0.08)] [&_svg]:size-5"><ListChecks weight="duotone" /></span>
112
+ <div className="min-w-0 flex-1"><span className="promotion-card__eyebrow mb-0.5 block text-xs font-bold leading-[14px] text-[#2368ec]">活动参与方式</span><h3 className="text-lg font-bold leading-[22px] text-foreground [overflow-wrap:anywhere] max-[380px]:text-base">{data.title}</h3><p className="mt-0.5 truncate text-xs leading-4 text-secondary-foreground">{data.validityText ?? '当前活动有效期以现场为准'}</p></div>
113
+ <b className={`promotion-status promotion-status--${data.claimable ? 'available' : 'unavailable'} ${PROMOTION_STATUS_CLASS} ${PROMOTION_STATUS_TONE_CLASS[data.claimable ? 'available' : 'unavailable'] ?? ''}`}>{data.claimable ? '可参与' : '查看规则'}</b>
104
114
  </header>
105
- <div className="promotion-guide__summary"><span><MapPin weight="fill" />当前商场</span><strong>{modeText[data.participationMode ?? 'UNKNOWN']}</strong></div>
106
- <ol>{steps.map((step, index) => <li key={index}><b>{index + 1}</b><span><strong>{step.title}</strong><small>{step.description ?? ''}</small></span></li>)}</ol>
107
- {(data.requirements?.length ?? 0) > 0 && <div className="promotion-guide__requirements">{data.requirements?.map((item) => <span key={item}><CheckCircle weight="fill" />{item}</span>)}</div>}
108
- {data.notice && <div className="promotion-detail__notice"><Info weight="duotone" />{data.notice}</div>}
109
- <footer className="promotion-card__footer">参与资格和场次以活动现场实时信息为准</footer>
115
+ <div className="promotion-guide__summary mx-4 flex items-center justify-between gap-2 rounded-[7px] border border-[rgba(35,104,236,0.13)] bg-[#eaf3ff] px-2.5 py-2 text-xs leading-[normal] text-[#2368ec] [&_svg]:w-[13px]"><span className="flex items-center gap-1"><MapPin weight="fill" />当前商场</span><strong>{modeText[data.participationMode ?? 'UNKNOWN']}</strong></div>
116
+ <ol className="my-3 mx-4 grid list-none gap-2">{steps.map((step, index) => <li key={index} className="grid grid-cols-[24px_minmax(0,1fr)] gap-2"><b className="grid size-6 place-items-center rounded-full bg-success text-xs leading-[normal] text-white">{index + 1}</b><span className="grid gap-0.5 pt-0.5"><strong className="text-xs leading-[normal]">{step.title}</strong><small className="text-xs leading-[15px] text-secondary-foreground">{step.description ?? ''}</small></span></li>)}</ol>
117
+ {(data.requirements?.length ?? 0) > 0 && <div className="promotion-guide__requirements mx-4 mb-[11px] flex flex-wrap gap-[5px]">{data.requirements?.map((item) => <span key={item} className="flex items-center gap-[3px] rounded-[5px] bg-[#eaf8f1] px-1.75 py-1 text-xs leading-[normal] text-[#128356] [&_svg]:w-[11px]"><CheckCircle weight="fill" />{item}</span>)}</div>}
118
+ {data.notice && <div className="promotion-detail__notice mx-4 mt-2.5 flex items-start gap-1.5 rounded-[6px] border border-[rgba(228,47,70,0.12)] bg-[var(--tbox-domain-promotion-surface,#fff1f3)] px-[9px] py-2 text-xs leading-[15px] text-[#744333] [&_svg]:mt-[1px] [&_svg]:size-3.5 [&_svg]:shrink-0"><Info weight="duotone" />{data.notice}</div>}
119
+ <footer className="promotion-card__footer flex items-center gap-[5px] border-t border-border px-4 pt-[9px] pb-[11px] text-xs leading-[15px] text-secondary-foreground">参与资格和场次以活动现场实时信息为准</footer>
110
120
  </section>
111
121
  );
112
122
  }