@tbox.cn/app-module-shopping-guide 0.2.1 → 0.8.2

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 (89) hide show
  1. package/AGENTS.md +16 -0
  2. package/README.md +96 -0
  3. package/dist/chunk-AYQZO2FV.js +1496 -0
  4. package/dist/chunk-QDTU2FRN.js +1682 -0
  5. package/dist/client/index.d.ts +3 -3
  6. package/dist/client/index.js +1 -1
  7. package/dist/index.d.ts +1 -1
  8. package/dist/index.js +2 -8
  9. package/dist/server/index.d.ts +2512 -608
  10. package/dist/server/index.js +1 -7
  11. package/dist/shop-guide-header-art-pea-v2-OME4MKBW.jpg +0 -0
  12. package/dist/shopping-guide-OQ2SSHXL.css +2593 -0
  13. package/package.json +25 -16
  14. package/skills/shopping-guide/SKILL.md +127 -24
  15. package/src/client/assets/shop-guide-header-art-pea-v2.jpg +0 -0
  16. package/src/client/assets/shop-guide-header-art.png +0 -0
  17. package/src/client/assets.d.ts +10 -0
  18. package/src/client/cards/category-list/index.tsx +113 -0
  19. package/src/client/cards/human-guide-list/index.tsx +72 -0
  20. package/src/client/cards/index.ts +14 -0
  21. package/src/client/cards/location-handoff/index.tsx +52 -0
  22. package/src/client/cards/mall-directory/index.tsx +77 -0
  23. package/src/client/cards/nearby-mall-list/index.tsx +40 -0
  24. package/src/client/cards/product-comparison/index.tsx +100 -0
  25. package/src/client/cards/product-detail/index.tsx +97 -0
  26. package/src/client/cards/product-list/index.tsx +223 -0
  27. package/src/client/cards/recommend-merchants/index.tsx +147 -0
  28. package/src/client/cards/shop-detail/index.tsx +133 -0
  29. package/src/client/cards/shop-list/index.tsx +216 -0
  30. package/src/client/cards/view.ts +147 -0
  31. package/src/client/categories.ts +38 -0
  32. package/src/client/components/ImageWithFallback.tsx +34 -0
  33. package/src/client/components/MerchantRow.tsx +78 -0
  34. package/src/client/components/ShopDetailSheet.tsx +383 -0
  35. package/src/client/components/ShopGuideHeader.tsx +24 -0
  36. package/src/client/components/ShopGuideSectionLabel.tsx +10 -0
  37. package/src/client/components/ShopListSheet.tsx +293 -0
  38. package/src/client/index.ts +8 -6
  39. package/src/client/styles/shopping-guide.css +2593 -0
  40. package/src/client/types/css.d.ts +2 -0
  41. package/src/server/cards/category-list/meta.ts +0 -2
  42. package/src/server/cards/human-guide-list/meta.ts +0 -2
  43. package/src/server/cards/index.ts +10 -10
  44. package/src/server/cards/location-handoff/meta.ts +0 -2
  45. package/src/server/cards/mall-directory/meta.ts +0 -2
  46. package/src/server/cards/nearby-mall-list/meta.ts +1 -3
  47. package/src/server/cards/product-comparison/meta.ts +0 -2
  48. package/src/server/cards/product-detail/meta.ts +0 -2
  49. package/src/server/cards/product-list/meta.ts +0 -2
  50. package/src/server/cards/recommend-merchants/meta.ts +37 -0
  51. package/src/server/cards/recommend-merchants/samples.ts +189 -0
  52. package/src/server/cards/{merchant-detail → shop-detail}/meta.ts +6 -6
  53. package/src/server/cards/shop-detail/samples.ts +72 -0
  54. package/src/server/cards/{merchant-list → shop-list}/meta.ts +9 -9
  55. package/src/server/cards/shop-list/samples.ts +154 -0
  56. package/src/server/domain/value-objects.ts +1 -2
  57. package/src/server/handler.ts +63 -0
  58. package/src/server/index.ts +161 -101
  59. package/src/server/ports/index.ts +120 -91
  60. package/src/server/ports/local-adapters.ts +5 -55
  61. package/src/server/projections/index.ts +159 -41
  62. package/src/server/tools/index.ts +590 -315
  63. package/tbox.module.json +137 -0
  64. package/tests/cards-render.test.tsx +830 -0
  65. package/tests/floor-pretool.test.ts +275 -0
  66. package/tests/handler.test.ts +259 -0
  67. package/tests/merchant-list-limit.test.ts +53 -0
  68. package/tests/ports-resolve.test.ts +112 -0
  69. package/tests/samples.test.ts +71 -0
  70. package/tests/shopping-guide.test.ts +402 -234
  71. package/tests/skill.test.ts +86 -0
  72. package/tests/view.test.ts +42 -0
  73. package/tsup.config.ts +9 -1
  74. package/dist/chunk-AGBLC6XI.js +0 -1294
  75. package/dist/chunk-U4WDS5PQ.js +0 -173
  76. package/skills/shopping-guide/references/comparison-format.md +0 -5
  77. package/skills/shopping-guide/references/faq-answers.md +0 -5
  78. package/skills/shopping-guide/references/floor-directory.md +0 -4
  79. package/skills/shopping-guide/references/intent-patterns.md +0 -5
  80. package/skills/shopping-guide/references/location-format.md +0 -5
  81. package/skills/shopping-guide/references/policy-lookup.md +0 -5
  82. package/skills/shopping-guide/references/product-search-tips.md +0 -6
  83. package/skills/shopping-guide/references/recommendation-style.md +0 -5
  84. package/src/client/cards/index.tsx +0 -267
  85. package/src/server/cards/customer-service-faq/meta.ts +0 -18
  86. package/src/server/integrations/joycity/adapter.ts +0 -226
  87. package/src/server/integrations/joycity/auth-strategy.ts +0 -38
  88. package/src/server/integrations/joycity/gateway.ts +0 -128
  89. package/tbox.component.json +0 -48
@@ -0,0 +1,383 @@
1
+ import { useCallback, useEffect, useId, useRef, useState } from 'react';
2
+ import { createPortal } from 'react-dom';
3
+ import { Clock, MapPin, Phone, Star, Tag, X } from '@phosphor-icons/react';
4
+ import { ItemActionsRow, navigateToAlipayPage, sendCardAction } from '@tbox.cn/app-sdk/client';
5
+ import { ImageWithFallback } from './ImageWithFallback';
6
+ import type { ActionDraft } from '@tbox.cn/app-contracts-mall';
7
+
8
+ const HIDDEN_DETAIL_ACTION_LABELS = new Set(['查看详情', '导航', '问问导购']);
9
+
10
+ export interface ShopCouponData {
11
+ readonly name: string;
12
+ readonly imageUrl?: string;
13
+ /** 券面值(元,parValue/100) */
14
+ readonly faceValue?: number;
15
+ /** 售价(元,price/100;0 = 免费领取) */
16
+ readonly salePrice?: number;
17
+ /** 适用业态列表(券行右上角金色标签) */
18
+ readonly applicableCategories?: readonly string[];
19
+ /** 领取后有效小时数(不再展示,字段保留契约兼容) */
20
+ readonly validHours?: number;
21
+ /** 可用时间文案(useWeekTime 解析:星期段 + st-et 截前 5 位) */
22
+ readonly usageTimeText?: string;
23
+ /** 券的小程序详情入口;付费券固定跳转,免费券由 freeCouponClaimMode 决定。 */
24
+ readonly purchaseUrl?: string;
25
+ readonly freeCouponClaimMode?: 'DIRECT' | 'REDIRECT';
26
+ /** 营销域券引用(厂商 offerRef 形如 `offer:${couponNo}`)——DIRECT 模式下用于领取。 */
27
+ readonly offerRef?: string;
28
+ }
29
+
30
+ export interface ShopDetailSheetData {
31
+ readonly name: string;
32
+ readonly logoUrl?: string;
33
+ readonly coverUrl?: string;
34
+ readonly brand?: string;
35
+ readonly businessCategories: readonly string[];
36
+ readonly location: { readonly displayText: string };
37
+ readonly status: { readonly code: string; readonly label: string; readonly observedAt?: string };
38
+ readonly description?: string;
39
+ readonly contactInfo?: readonly { readonly channel: string; readonly value: string }[];
40
+ readonly services?: readonly string[];
41
+ readonly rating?: string;
42
+ readonly avgSpend?: string;
43
+ readonly operatingStatus?: string;
44
+ readonly itemActions?: readonly ActionDraft[];
45
+ readonly coupons?: readonly ShopCouponData[];
46
+ }
47
+
48
+ export function ShopDetailSheet(props: {
49
+ readonly open: boolean;
50
+ readonly data: ShopDetailSheetData | null;
51
+ readonly loading?: boolean;
52
+ readonly cardId: string;
53
+ readonly isHistory: boolean;
54
+ readonly onClose: () => void;
55
+ /** 本卡上下文的动作令牌(CardRenderer 透传)——券行领取用 */
56
+ readonly actionTokens?: Record<string, string>;
57
+ /** 券行领取动作 id(按打开上下文的卡类型取对应变体:shop-list / shop-detail) */
58
+ readonly claimActionId?: string;
59
+ }) {
60
+ const { open, data, loading = false, cardId, isHistory, onClose, actionTokens, claimActionId } = props;
61
+ const [closing, setClosing] = useState(false);
62
+ const [claimingRef, setClaimingRef] = useState<string | null>(null);
63
+ const [claimedRefs, setClaimedRefs] = useState<ReadonlySet<string>>(() => new Set());
64
+ const panelRef = useRef<HTMLElement>(null);
65
+ const closeButtonRef = useRef<HTMLButtonElement>(null);
66
+ const closingRef = useRef(false);
67
+ const closeTimerRef = useRef<number>();
68
+ const onCloseRef = useRef(onClose);
69
+ onCloseRef.current = onClose;
70
+ const titleId = useId();
71
+
72
+ const finishClose = useCallback(() => {
73
+ if (!closingRef.current) return;
74
+ window.clearTimeout(closeTimerRef.current);
75
+ closingRef.current = false;
76
+ setClosing(false);
77
+ onCloseRef.current();
78
+ }, []);
79
+
80
+ // DIRECT 领取结果监听(与 promotion-offer-list 逐字同构):成功 → 券行入已领态;
81
+ // 失败 → 全局 notice 通道(chat-store deps.toast)弹出 antd-mobile 轻提示,组件内零失败分支。
82
+ // REDIRECT/付费券复用抢购的 openLink,不进入本地领取状态机。
83
+ useEffect(() => {
84
+ if (!cardId || typeof window === 'undefined') return undefined;
85
+ const onNotice = (event: Event) => {
86
+ const detail = (event as CustomEvent<{ surfaceId?: string; text?: string; level?: string }>).detail;
87
+ if (!detail?.text || (detail.surfaceId && detail.surfaceId !== cardId)) return;
88
+ const ref = claimingRef;
89
+ if (!ref) return;
90
+ setClaimingRef(null);
91
+ if (detail.level === 'success' || /领取成功|已存入卡包|已领取/.test(detail.text)) {
92
+ setClaimedRefs((current) => new Set(current).add(ref));
93
+ }
94
+ };
95
+ window.addEventListener('tbox:notice', onNotice);
96
+ return () => window.removeEventListener('tbox:notice', onNotice);
97
+ }, [cardId, claimingRef]);
98
+
99
+ const claimCoupon = useCallback(
100
+ (offerRef: string) => {
101
+ if (!claimActionId) return; // 防御兜底(按钮渲染已门控 claimable:有令牌∧非历史)
102
+ const token = actionTokens?.[claimActionId];
103
+ if (!token) return;
104
+ setClaimingRef(offerRef);
105
+ sendCardAction(cardId, { type: 'moduleAction', actionId: claimActionId, contextToken: token }, { offerRef });
106
+ },
107
+ [actionTokens, cardId, claimActionId],
108
+ );
109
+
110
+ const requestClose = useCallback(() => {
111
+ if (closingRef.current) return;
112
+ closingRef.current = true;
113
+ setClosing(true);
114
+ const reducedMotion = window.matchMedia?.('(prefers-reduced-motion: reduce)')?.matches ?? false;
115
+ closeTimerRef.current = window.setTimeout(finishClose, reducedMotion ? 1 : 200);
116
+ }, [finishClose]);
117
+
118
+ useEffect(() => {
119
+ if (!open || !data) return;
120
+ closingRef.current = false;
121
+ setClosing(false);
122
+ const previousFocus = document.activeElement instanceof HTMLElement ? document.activeElement : null;
123
+ const previousOverflow = document.body.style.overflow;
124
+ document.body.style.overflow = 'hidden';
125
+ closeButtonRef.current?.focus();
126
+
127
+ const onKeyDown = (event: KeyboardEvent) => {
128
+ if (event.key === 'Escape') {
129
+ event.preventDefault();
130
+ requestClose();
131
+ return;
132
+ }
133
+ if (event.key !== 'Tab') return;
134
+ const focusable = panelRef.current?.querySelectorAll<HTMLElement>(
135
+ 'button:not(:disabled), a[href], input:not(:disabled), [tabindex]:not([tabindex="-1"])',
136
+ );
137
+ if (!focusable || focusable.length === 0) return;
138
+ const first = focusable[0];
139
+ const last = focusable[focusable.length - 1];
140
+ if (event.shiftKey && document.activeElement === first) {
141
+ event.preventDefault();
142
+ last.focus();
143
+ } else if (!event.shiftKey && document.activeElement === last) {
144
+ event.preventDefault();
145
+ first.focus();
146
+ }
147
+ };
148
+ document.addEventListener('keydown', onKeyDown);
149
+ return () => {
150
+ document.removeEventListener('keydown', onKeyDown);
151
+ document.body.style.overflow = previousOverflow;
152
+ previousFocus?.focus();
153
+ };
154
+ }, [open, requestClose]);
155
+
156
+ useEffect(() => () => window.clearTimeout(closeTimerRef.current), []);
157
+
158
+ if (!open || !data || typeof document === 'undefined') return null;
159
+ const phone = data.contactInfo?.find((item) => /phone|电话/i.test(item.channel));
160
+ // 营业时间缺省 → 商场默认营业时间(2026-09-03 用户裁定:周一-周日 10:00-22:00)
161
+ const hoursText = data.contactInfo?.find((item) => /hours|营业时间/i.test(item.channel))?.value
162
+ ?? '周一-周日 10:00-22:00';
163
+ const detailActions = data.itemActions?.filter(
164
+ (action) => !HIDDEN_DETAIL_ACTION_LABELS.has(action.label.trim()),
165
+ ) ?? [];
166
+
167
+ return createPortal(
168
+ <div
169
+ className={`sg-shop-sheet${closing ? ' sg-shop-sheet--closing' : ''}`}
170
+ role="presentation"
171
+ onAnimationEnd={(event) => {
172
+ if (closing && event.target === event.currentTarget) finishClose();
173
+ }}
174
+ >
175
+ <div className="sg-shop-sheet__mask" aria-hidden="true" onClick={requestClose} />
176
+ <section
177
+ ref={panelRef}
178
+ className="sg-shop-sheet__panel"
179
+ role="dialog"
180
+ aria-modal="true"
181
+ aria-labelledby={titleId}
182
+ aria-busy={loading || undefined}
183
+ >
184
+ <header className="sg-shop-sheet__header">
185
+ <h2 id={titleId}>门店详情</h2>
186
+ <button
187
+ ref={closeButtonRef}
188
+ type="button"
189
+ className="sg-shop-sheet__close"
190
+ aria-label="关闭门店详情"
191
+ onClick={requestClose}
192
+ >
193
+ <X size={20} weight="bold" />
194
+ </button>
195
+ </header>
196
+
197
+ <div className="sg-shop-sheet__body">
198
+ {(data.coverUrl || data.logoUrl) && (
199
+ <ImageWithFallback
200
+ src={data.coverUrl ?? data.logoUrl}
201
+ alt=""
202
+ className="sg-shop-sheet__cover"
203
+ size={176}
204
+ />
205
+ )}
206
+
207
+ <div className="sg-shop-sheet__identity">
208
+ <div className="sg-shop-sheet__identity-copy">
209
+ <div className="sg-shop-sheet__name-row">
210
+ <h3>{data.name}</h3>
211
+ </div>
212
+ {/* unknown 占位(线上厂商无真实营业状态,恒「营业状态以现场为准」)不显示——
213
+ 2026-09-04 用户裁定,同 MerchantRow 2026-09-02 列表行同结论;营业时间 Clock 行常显 */}
214
+ {(data.rating || data.avgSpend || (data.status.code !== 'unknown' && data.status.label) || loading) && (
215
+ <div className="sg-shop-sheet__stats">
216
+ {data.rating && (
217
+ <span className="sg-shop-sheet__rating">
218
+ <Star size={15} weight="fill" />
219
+ {data.rating}
220
+ </span>
221
+ )}
222
+ {data.avgSpend && <span>人均 {data.avgSpend}</span>}
223
+ {loading
224
+ ? <span className="sg-shop-sheet__skeleton sg-shop-sheet__skeleton--status" aria-hidden="true" />
225
+ : data.status.code !== 'unknown' && (
226
+ <span className={`sg-status sg-status-${data.status.code}`}>{data.status.label}</span>
227
+ )}
228
+ </div>
229
+ )}
230
+ </div>
231
+ {loading ? (
232
+ <span className="sg-shop-sheet__phone-skeleton" aria-hidden="true" />
233
+ ) : phone && (
234
+ <a
235
+ className="sg-shop-sheet__phone"
236
+ href={phone.value.startsWith('tel:') ? phone.value : `tel:${phone.value}`}
237
+ aria-label={`拨打${data.name}电话`}
238
+ >
239
+ <Phone size={20} weight="fill" />
240
+ <span>电话</span>
241
+ </a>
242
+ )}
243
+ </div>
244
+
245
+ <div className="sg-shop-sheet__facts">
246
+ <div>
247
+ {data.businessCategories.length > 0 && (
248
+ <span>{data.businessCategories.join(' · ')}</span>
249
+ )}
250
+ <MapPin size={17} weight="fill" />
251
+ <span className="sg-shop-sheet__location">{data.location.displayText}</span>
252
+ </div>
253
+ {!loading && data.operatingStatus && <div>{data.operatingStatus}</div>}
254
+ {!loading && (
255
+ <div>
256
+ <Clock size={18} />
257
+ <span>{hoursText}</span>
258
+ </div>
259
+ )}
260
+ {!loading && data.services && data.services.length > 0 && (
261
+ <div>支持{data.services.join('、')}</div>
262
+ )}
263
+ {loading && (
264
+ <div className="sg-shop-sheet__facts-skeleton" role="status" aria-label="门店详情加载中">
265
+ <span className="sg-shop-sheet__skeleton sg-shop-sheet__skeleton--fact" aria-hidden="true" />
266
+ <span className="sg-shop-sheet__skeleton sg-shop-sheet__skeleton--fact-short" aria-hidden="true" />
267
+ </div>
268
+ )}
269
+ </div>
270
+
271
+ {loading && (
272
+ <div className="sg-shop-sheet__details-skeleton" aria-hidden="true">
273
+ <span className="sg-shop-sheet__skeleton sg-shop-sheet__skeleton--detail-line" />
274
+ <span className="sg-shop-sheet__skeleton sg-shop-sheet__skeleton--detail-line-short" />
275
+ <span className="sg-shop-sheet__skeleton sg-shop-sheet__skeleton--detail-block" />
276
+ </div>
277
+ )}
278
+
279
+ {!loading && data.description && <p className="sg-shop-sheet__description">{data.description}</p>}
280
+
281
+ {!loading && data.coupons && data.coupons.length > 0 && (
282
+ <div className="sg-shop-sheet__coupons" aria-label="门店优惠">
283
+ <h3 className="sg-shop-sheet__section-title">
284
+ <Tag size={16} weight="fill" aria-hidden="true" />
285
+ 优惠活动
286
+ </h3>
287
+ <div className="sg-shop-sheet__coupon-list">
288
+ {data.coupons.map((coupon, index) => {
289
+ const purchaseOnly = coupon.salePrice !== undefined && coupon.salePrice > 0;
290
+ const redirectOnly = purchaseOnly || coupon.freeCouponClaimMode === 'REDIRECT';
291
+ const claimToken = coupon.offerRef && claimActionId ? actionTokens?.[claimActionId] : undefined;
292
+ const claimable = Boolean(!redirectOnly && coupon.offerRef && claimToken && !isHistory);
293
+ const redirectAction = redirectOnly && Boolean(coupon.offerRef || coupon.purchaseUrl);
294
+ const claimed = coupon.offerRef !== undefined && claimedRefs.has(coupon.offerRef);
295
+ return (
296
+ <div key={index} className="sg-shop-sheet__coupon-row">
297
+ {/* 右上角金色类型标签(useBusinessType → applicableCategories,样式对齐神券类目标签) */}
298
+ {coupon.applicableCategories && coupon.applicableCategories.length > 0 && (
299
+ <span className="sg-shop-sheet__coupon-tag">
300
+ {coupon.applicableCategories.join('、')}
301
+ </span>
302
+ )}
303
+ {coupon.imageUrl && (
304
+ <ImageWithFallback
305
+ src={coupon.imageUrl}
306
+ alt={coupon.name}
307
+ className="sg-shop-sheet__coupon-img"
308
+ size={112}
309
+ />
310
+ )}
311
+ <div className="sg-shop-sheet__coupon-body">
312
+ <strong className="sg-shop-sheet__coupon-name">{coupon.name}</strong>
313
+ {coupon.faceValue !== undefined && (
314
+ <p className="sg-shop-sheet__coupon-price">
315
+ {/* 价格行角色对齐神券行(2026-09-05):主价格 = 售价、划线 = 原面值;
316
+ 售价缺省退回面值为主。免费券主价格 =「免费」+ 面值划线(2026-09-05 文案对齐) */}
317
+ {coupon.salePrice === 0
318
+ ? <>
319
+ <span className="sg-shop-sheet__coupon-free">免费</span>
320
+ <s className="sg-shop-sheet__coupon-face--strike">¥{coupon.faceValue}</s>
321
+ </>
322
+ : coupon.salePrice !== undefined
323
+ ? <>
324
+ <span className="sg-shop-sheet__coupon-face">¥{coupon.salePrice}</span>
325
+ <s className="sg-shop-sheet__coupon-face--strike">¥{coupon.faceValue}</s>
326
+ </>
327
+ : <span className="sg-shop-sheet__coupon-face">¥{coupon.faceValue}</span>}
328
+ </p>
329
+ )}
330
+ {/* sub 行职责 = 可用时间文案(useWeekTime 解析,provider 直出;
331
+ 适用分类已上移为右上角标签,validHours 不再展示(2026-09-05) */}
332
+ {coupon.usageTimeText && (
333
+ <p className="sg-shop-sheet__coupon-sub">{coupon.usageTimeText}</p>
334
+ )}
335
+ </div>
336
+ {redirectAction ? (
337
+ <button
338
+ type="button"
339
+ className="sg-shop-sheet__coupon-claim"
340
+ disabled={!coupon.purchaseUrl}
341
+ onClick={() => {
342
+ if (!coupon.purchaseUrl) return;
343
+ void navigateToAlipayPage(coupon.purchaseUrl).catch((err: unknown) => {
344
+ console.warn('[ShopDetailSheet] navigateTo failed', err);
345
+ });
346
+ }}
347
+ >
348
+ {coupon.purchaseUrl
349
+ ? `去小程序${purchaseOnly ? '抢购' : '领取'}`
350
+ : `${purchaseOnly ? '抢购' : '领取'}链接暂不可用`}
351
+ </button>
352
+ ) : claimable && coupon.offerRef ? (
353
+ <button
354
+ type="button"
355
+ className="sg-shop-sheet__coupon-claim"
356
+ onClick={() => claimCoupon(coupon.offerRef!)}
357
+ disabled={claimingRef === coupon.offerRef || claimed}
358
+ >
359
+ {claimed ? '已领取' : claimingRef === coupon.offerRef ? '领取中,请稍候…' : '领取'}
360
+ </button>
361
+ ) : null}
362
+ </div>
363
+ );
364
+ })}
365
+ </div>
366
+ </div>
367
+ )}
368
+
369
+ {!loading && detailActions.length > 0 && (
370
+ <ItemActionsRow
371
+ actions={detailActions}
372
+ cardId={cardId}
373
+ isHistory={isHistory}
374
+ className="sg-shop-sheet__actions"
375
+ chipClassName="sg-shop-sheet__action"
376
+ />
377
+ )}
378
+ </div>
379
+ </section>
380
+ </div>,
381
+ document.body,
382
+ );
383
+ }
@@ -0,0 +1,24 @@
1
+ /**
2
+ * 门店导览卡头:推荐卡、列表卡、详情卡共用的唯一一份卡头。
3
+ *
4
+ * 与 MerchantRow 同一条理由——三张卡此前各抄一份同样的 JSX,副标题的兜底文案已经开始分叉
5
+ * (「按品类发现值得逛的门店」/「按品类快速找到想逛的门店」)。抄第三份之前先收成组件。
6
+ */
7
+ import { Storefront } from '@phosphor-icons/react';
8
+ import shopGuideHeaderArtUrl from '../assets/shop-guide-header-art-pea-v2.jpg';
9
+
10
+ export function ShopGuideHeader(props: { readonly subtitle: string }) {
11
+ return (
12
+ <header className="sg-rm-header">
13
+ <img src={shopGuideHeaderArtUrl} alt="" className="sg-rm-header-art" aria-hidden="true" />
14
+ <div className="sg-rm-header-copy">
15
+ <div className="sg-rm-header-title-row">
16
+ <Storefront size={22} weight="fill" />
17
+ <h3 className="sg-rm-header-title">门店导览</h3>
18
+ </div>
19
+ <p className="sg-rm-header-subtitle">{props.subtitle}</p>
20
+ </div>
21
+ <span className="sg-rm-header-badge">商场导览</span>
22
+ </header>
23
+ );
24
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * 列表分区标签:推荐卡与列表卡共用的唯一一份。
3
+ *
4
+ * 两处曾各写各的,标题「门店」/「推荐门店」分叉;现在只剩一个「门店」标题。
5
+ * 标题右侧原有「当前显示 N 家」计数(2026-09-02 去掉):列表本身就能数出来,紧挨着再报一次数是噪音;
6
+ * 半屏浮层因有搜索与筛选、列表可能很长,保留自己的「当前显示 N 家门店」计数行。
7
+ */
8
+ export function ShopGuideSectionLabel() {
9
+ return <div className="sg-rm-section-label">门店</div>;
10
+ }