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

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 (85) 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-VKDA6RXQ.js +1676 -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/shopping-guide-EGRHPEDA.css +2598 -0
  12. package/package.json +25 -16
  13. package/skills/shopping-guide/SKILL.md +127 -24
  14. package/src/client/cards/category-list/index.tsx +113 -0
  15. package/src/client/cards/human-guide-list/index.tsx +72 -0
  16. package/src/client/cards/index.ts +14 -0
  17. package/src/client/cards/location-handoff/index.tsx +52 -0
  18. package/src/client/cards/mall-directory/index.tsx +77 -0
  19. package/src/client/cards/nearby-mall-list/index.tsx +40 -0
  20. package/src/client/cards/product-comparison/index.tsx +100 -0
  21. package/src/client/cards/product-detail/index.tsx +97 -0
  22. package/src/client/cards/product-list/index.tsx +223 -0
  23. package/src/client/cards/recommend-merchants/index.tsx +147 -0
  24. package/src/client/cards/shop-detail/index.tsx +133 -0
  25. package/src/client/cards/shop-list/index.tsx +216 -0
  26. package/src/client/cards/view.ts +147 -0
  27. package/src/client/categories.ts +38 -0
  28. package/src/client/components/ImageWithFallback.tsx +34 -0
  29. package/src/client/components/MerchantRow.tsx +78 -0
  30. package/src/client/components/ShopDetailSheet.tsx +383 -0
  31. package/src/client/components/ShopGuideHeader.tsx +23 -0
  32. package/src/client/components/ShopGuideSectionLabel.tsx +10 -0
  33. package/src/client/components/ShopListSheet.tsx +293 -0
  34. package/src/client/index.ts +8 -6
  35. package/src/client/styles/shopping-guide.css +2598 -0
  36. package/src/client/types/css.d.ts +2 -0
  37. package/src/server/cards/category-list/meta.ts +0 -2
  38. package/src/server/cards/human-guide-list/meta.ts +0 -2
  39. package/src/server/cards/index.ts +10 -10
  40. package/src/server/cards/location-handoff/meta.ts +0 -2
  41. package/src/server/cards/mall-directory/meta.ts +0 -2
  42. package/src/server/cards/nearby-mall-list/meta.ts +1 -3
  43. package/src/server/cards/product-comparison/meta.ts +0 -2
  44. package/src/server/cards/product-detail/meta.ts +0 -2
  45. package/src/server/cards/product-list/meta.ts +0 -2
  46. package/src/server/cards/recommend-merchants/meta.ts +37 -0
  47. package/src/server/cards/recommend-merchants/samples.ts +189 -0
  48. package/src/server/cards/{merchant-detail → shop-detail}/meta.ts +6 -6
  49. package/src/server/cards/shop-detail/samples.ts +72 -0
  50. package/src/server/cards/{merchant-list → shop-list}/meta.ts +9 -9
  51. package/src/server/cards/shop-list/samples.ts +154 -0
  52. package/src/server/domain/value-objects.ts +1 -2
  53. package/src/server/handler.ts +63 -0
  54. package/src/server/index.ts +161 -101
  55. package/src/server/ports/index.ts +120 -91
  56. package/src/server/ports/local-adapters.ts +5 -55
  57. package/src/server/projections/index.ts +159 -41
  58. package/src/server/tools/index.ts +590 -315
  59. package/tbox.module.json +137 -0
  60. package/tests/cards-render.test.tsx +830 -0
  61. package/tests/floor-pretool.test.ts +275 -0
  62. package/tests/handler.test.ts +259 -0
  63. package/tests/merchant-list-limit.test.ts +53 -0
  64. package/tests/ports-resolve.test.ts +112 -0
  65. package/tests/samples.test.ts +71 -0
  66. package/tests/shopping-guide.test.ts +402 -234
  67. package/tests/skill.test.ts +86 -0
  68. package/tests/view.test.ts +42 -0
  69. package/tsup.config.ts +9 -1
  70. package/dist/chunk-AGBLC6XI.js +0 -1294
  71. package/dist/chunk-U4WDS5PQ.js +0 -173
  72. package/skills/shopping-guide/references/comparison-format.md +0 -5
  73. package/skills/shopping-guide/references/faq-answers.md +0 -5
  74. package/skills/shopping-guide/references/floor-directory.md +0 -4
  75. package/skills/shopping-guide/references/intent-patterns.md +0 -5
  76. package/skills/shopping-guide/references/location-format.md +0 -5
  77. package/skills/shopping-guide/references/policy-lookup.md +0 -5
  78. package/skills/shopping-guide/references/product-search-tips.md +0 -6
  79. package/skills/shopping-guide/references/recommendation-style.md +0 -5
  80. package/src/client/cards/index.tsx +0 -267
  81. package/src/server/cards/customer-service-faq/meta.ts +0 -18
  82. package/src/server/integrations/joycity/adapter.ts +0 -226
  83. package/src/server/integrations/joycity/auth-strategy.ts +0 -38
  84. package/src/server/integrations/joycity/gateway.ts +0 -128
  85. package/tbox.component.json +0 -48
@@ -0,0 +1,2 @@
1
+ /** 0.4.0 D1:模块自持 CSS(经 tsup loader: { '.css': 'copy' } 出货,样式在应用侧生效) */
2
+ declare module '*.css';
@@ -5,14 +5,12 @@ import { nowIso } from '../../domain/value-objects';
5
5
  const meta: CardMeta<typeof categoryListCardDataSchema> = {
6
6
  cardType: 'category-list',
7
7
  dataSchema: categoryListCardDataSchema,
8
- allowedTools: ['list-categories'],
9
8
  displayName: '业态分类目录',
10
9
  description: '商场全部业态分类(餐饮/零售/娱乐等)',
11
10
  sampleData: {
12
11
  categories: [{ code: 'c1', name: '餐饮', merchantCount: 42 }],
13
12
  observedAt: nowIso(),
14
13
  },
15
- priority: 100,
16
14
  schemaVersion: 1,
17
15
  };
18
16
 
@@ -4,7 +4,6 @@ import { humanGuideListCardDataSchema } from '@tbox.cn/app-contracts-mall';
4
4
  const meta: CardMeta<typeof humanGuideListCardDataSchema> = {
5
5
  cardType: 'human-guide-list',
6
6
  dataSchema: humanGuideListCardDataSchema,
7
- allowedTools: ['list-human-guides'],
8
7
  displayName: '人工导购',
9
8
  description: '指定门店可联系的导购员列表',
10
9
  sampleData: {
@@ -12,7 +11,6 @@ const meta: CardMeta<typeof humanGuideListCardDataSchema> = {
12
11
  merchantName: '示例门店',
13
12
  guides: [{ guideId: 'g1', name: '小导', available: true, itemActions: [] }],
14
13
  },
15
- priority: 100,
16
14
  schemaVersion: 1,
17
15
  };
18
16
 
@@ -1,43 +1,43 @@
1
1
  /**
2
- * 导购 11 卡 meta 聚合导出(每卡一个 meta.ts,doctor AST 约定)。
2
+ * 导购 11 卡 meta 聚合导出(每卡一个 meta.ts,doctor AST 约定;客服 FAQ 卡已拆分至客服模块)。
3
3
  */
4
4
  import productListMeta from './product-list/meta';
5
5
  import productDetailMeta from './product-detail/meta';
6
- import merchantListMeta from './merchant-list/meta';
7
- import merchantDetailMeta from './merchant-detail/meta';
6
+ import shopListMeta from './shop-list/meta';
7
+ import shopDetailMeta from './shop-detail/meta';
8
8
  import categoryListMeta from './category-list/meta';
9
9
  import productComparisonMeta from './product-comparison/meta';
10
10
  import mallDirectoryMeta from './mall-directory/meta';
11
11
  import nearbyMallListMeta from './nearby-mall-list/meta';
12
- import customerServiceFaqMeta from './customer-service-faq/meta';
13
12
  import humanGuideListMeta from './human-guide-list/meta';
14
13
  import locationHandoffMeta from './location-handoff/meta';
14
+ import recommendMerchantsMeta from './recommend-merchants/meta';
15
15
 
16
16
  export {
17
17
  productListMeta,
18
18
  productDetailMeta,
19
- merchantListMeta,
20
- merchantDetailMeta,
19
+ shopListMeta,
20
+ shopDetailMeta,
21
21
  categoryListMeta,
22
22
  productComparisonMeta,
23
23
  mallDirectoryMeta,
24
24
  nearbyMallListMeta,
25
- customerServiceFaqMeta,
26
25
  humanGuideListMeta,
27
26
  locationHandoffMeta,
27
+ recommendMerchantsMeta,
28
28
  };
29
29
 
30
30
  /** 11 卡 meta map(key 约定 = cardType) */
31
31
  export const shoppingGuideCards = {
32
32
  'product-list': productListMeta,
33
33
  'product-detail': productDetailMeta,
34
- 'merchant-list': merchantListMeta,
35
- 'merchant-detail': merchantDetailMeta,
34
+ 'shop-list': shopListMeta,
35
+ 'shop-detail': shopDetailMeta,
36
36
  'category-list': categoryListMeta,
37
37
  'product-comparison': productComparisonMeta,
38
38
  'mall-directory': mallDirectoryMeta,
39
39
  'nearby-mall-list': nearbyMallListMeta,
40
- 'customer-service-faq': customerServiceFaqMeta,
41
40
  'human-guide-list': humanGuideListMeta,
42
41
  'location-handoff': locationHandoffMeta,
42
+ 'recommend-merchants': recommendMerchantsMeta,
43
43
  } as const;
@@ -4,7 +4,6 @@ import { locationHandoffCardDataSchema } from '@tbox.cn/app-contracts-mall';
4
4
  const meta: CardMeta<typeof locationHandoffCardDataSchema> = {
5
5
  cardType: 'location-handoff',
6
6
  dataSchema: locationHandoffCardDataSchema,
7
- allowedTools: ['get-location'],
8
7
  displayName: '位置导航',
9
8
  description: '门店位置与导航能力',
10
9
  sampleData: {
@@ -13,7 +12,6 @@ const meta: CardMeta<typeof locationHandoffCardDataSchema> = {
13
12
  location: { displayText: 'A 栋 3 楼 301' },
14
13
  itemActions: [],
15
14
  },
16
- priority: 110,
17
15
  schemaVersion: 1,
18
16
  };
19
17
 
@@ -5,7 +5,6 @@ import { nowIso } from '../../domain/value-objects';
5
5
  const meta: CardMeta<typeof mallDirectoryCardDataSchema> = {
6
6
  cardType: 'mall-directory',
7
7
  dataSchema: mallDirectoryCardDataSchema,
8
- allowedTools: ['mall-directory'],
9
8
  displayName: '商场楼层目录',
10
9
  description: '楼栋-楼层结构(几楼有什么)',
11
10
  sampleData: {
@@ -20,7 +19,6 @@ const meta: CardMeta<typeof mallDirectoryCardDataSchema> = {
20
19
  ],
21
20
  observedAt: nowIso(),
22
21
  },
23
- priority: 100,
24
22
  schemaVersion: 1,
25
23
  };
26
24
 
@@ -4,13 +4,11 @@ import { nearbyMallListCardDataSchema } from '@tbox.cn/app-contracts-mall';
4
4
  const meta: CardMeta<typeof nearbyMallListCardDataSchema> = {
5
5
  cardType: 'nearby-mall-list',
6
6
  dataSchema: nearbyMallListCardDataSchema,
7
- allowedTools: ['list-nearby-malls'],
8
7
  displayName: '附近商场',
9
- description: '附近可切换的大悦城门店列表',
8
+ description: '附近可切换的门店列表',
10
9
  sampleData: {
11
10
  malls: [{ mallId: 'mall-1', name: '示例商场', address: '示例地址', status: { code: 'open', label: '营业中' }, itemActions: [] }],
12
11
  },
13
- priority: 100,
14
12
  schemaVersion: 1,
15
13
  };
16
14
 
@@ -5,7 +5,6 @@ import { nowIso } from '../../domain/value-objects';
5
5
  const meta: CardMeta<typeof productComparisonCardDataSchema> = {
6
6
  cardType: 'product-comparison',
7
7
  dataSchema: productComparisonCardDataSchema,
8
- allowedTools: ['compare-products'],
9
8
  displayName: '商品对比',
10
9
  description: '2-4 个商品价格/属性/库存并排对比',
11
10
  sampleData: {
@@ -22,7 +21,6 @@ const meta: CardMeta<typeof productComparisonCardDataSchema> = {
22
21
  ],
23
22
  observedAt: nowIso(),
24
23
  },
25
- priority: 120,
26
24
  schemaVersion: 1,
27
25
  };
28
26
 
@@ -5,7 +5,6 @@ import { nowIso } from '../../domain/value-objects';
5
5
  const meta: CardMeta<typeof productDetailCardDataSchema> = {
6
6
  cardType: 'product-detail',
7
7
  dataSchema: productDetailCardDataSchema,
8
- allowedTools: ['get-product'],
9
8
  displayName: '商品详情',
10
9
  description: '单个商品的完整快照(价格/库存/属性/商户)',
11
10
  sampleData: {
@@ -22,7 +21,6 @@ const meta: CardMeta<typeof productDetailCardDataSchema> = {
22
21
  humanGuideAvailable: false,
23
22
  itemActions: [],
24
23
  },
25
- priority: 80,
26
24
  schemaVersion: 1,
27
25
  };
28
26
 
@@ -5,7 +5,6 @@ import { nowIso } from '../../domain/value-objects';
5
5
  const meta: CardMeta<typeof productListCardDataSchema> = {
6
6
  cardType: 'product-list',
7
7
  dataSchema: productListCardDataSchema,
8
- allowedTools: ['recommend', 'search-products', 'list-browsing-history'],
9
8
  displayName: '商品列表',
10
9
  description: '推荐/搜索/历史商品列表(含价格、库存、门店)',
11
10
  sampleData: {
@@ -25,7 +24,6 @@ const meta: CardMeta<typeof productListCardDataSchema> = {
25
24
  ],
26
25
  refinements: [],
27
26
  },
28
- priority: 90,
29
27
  schemaVersion: 1,
30
28
  };
31
29
 
@@ -0,0 +1,37 @@
1
+ import type { CardMeta } from '@tbox.cn/app-contracts';
2
+ import { recommendMerchantsCardDataSchema } from '@tbox.cn/app-contracts-mall';
3
+ import { nowIso } from '../../domain/value-objects';
4
+ import { samples } from './samples';
5
+
6
+ const meta: CardMeta<typeof recommendMerchantsCardDataSchema> = {
7
+ cardType: 'recommend-merchants',
8
+ dataSchema: recommendMerchantsCardDataSchema,
9
+ displayName: '门店导览',
10
+ description: '按类目筛选的推荐门店列表',
11
+ sampleData: {
12
+ summary: '为您推荐以下门店',
13
+ categoryTabs: [
14
+ { code: 'food', name: '餐饮' },
15
+ { code: 'fashion', name: '服饰' },
16
+ ],
17
+ items: [
18
+ {
19
+ merchantId: 'm1',
20
+ name: '示例门店',
21
+ logoUrl: 'https://example.com/logo.png',
22
+ brand: '示例品牌',
23
+ businessCategories: ['餐饮'],
24
+ location: { displayText: 'A 栋 3 楼 301', floorName: '3F', buildingName: 'A 栋' },
25
+ status: { code: 'enabled', label: '营业中', observedAt: nowIso() },
26
+ promotionFacts: [],
27
+ itemActions: [],
28
+ },
29
+ ],
30
+ noResultsReason: undefined,
31
+ observedAt: nowIso(),
32
+ },
33
+ samples,
34
+ schemaVersion: 1,
35
+ };
36
+
37
+ export default meta;
@@ -0,0 +1,189 @@
1
+ /**
2
+ * recommend-merchants 附加预览样本(沉淀自 mall dev-gallery brand-guide 画廊)。
3
+ *
4
+ * 方法论:见同目录 ../shop-list/samples.ts 头注释(覆盖基准 = data 分支、等价输入合并、
5
+ * 样本即契约)。品类口径与 shop-list 样本保持一致(线上就是这套短名——两卡并排时
6
+ * 分类体系不能各说各话,画廊时期的历史修正随样本保留)。
7
+ */
8
+ import type { CardSample } from '@tbox.cn/app-contracts';
9
+ import type { RecommendMerchantsCardData } from '@tbox.cn/app-contracts-mall';
10
+
11
+ const OBSERVED_AT = '2026-08-28T00:00:00.000Z';
12
+
13
+
14
+
15
+ /** https 占位(契约 httpsUrlSchema 强制 https 前缀;gallery.invalid 恒不解析——预览页图位走缺图兜底) */
16
+ const ASSET = {
17
+ coffeeLogo: 'https://gallery.invalid/brand-guide/coffee-photo.png',
18
+ diningLogo: 'https://gallery.invalid/brand-guide/dining-photo.png',
19
+ lifestyleLogo: 'https://gallery.invalid/brand-guide/lifestyle-photo.png',
20
+ detailCover: 'https://gallery.invalid/brand-guide/detail-cover.png',
21
+ } as const;
22
+
23
+ const RECOMMENDATION_DATA = {
24
+ summary: '亲子玩乐 · 示例广场',
25
+ categoryTabs: [
26
+ { code: 'food', name: '餐饮' },
27
+ { code: 'coffee', name: '咖啡' },
28
+ { code: 'fashion', name: '服饰' },
29
+ { code: 'lifestyle', name: '生活方式' },
30
+ { code: 'sports', name: '运动' },
31
+ ],
32
+ items: [
33
+ {
34
+ merchantId: 'recommend-coffee',
35
+ name: '日光咖啡实验室',
36
+ logoUrl: ASSET.coffeeLogo,
37
+ coverUrl: ASSET.detailCover,
38
+ brand: '日光咖啡',
39
+ businessCategories: ['咖啡', '餐饮'],
40
+ location: { floorName: 'L1', displayText: 'A 座 L1' },
41
+ status: { code: 'enabled', label: '营业中', observedAt: OBSERVED_AT },
42
+ operatingStatus: '营业至 22:00',
43
+ rating: '4.8',
44
+ avgSpend: '¥36',
45
+ description: '以当季咖啡豆和城市灵感饮品为特色,提供适合短暂停留与朋友小聚的明亮空间。',
46
+ contactInfo: [
47
+ { channel: '营业时间', value: '10:00–22:00' },
48
+ { channel: '电话', value: 'tel:4000001122' },
49
+ ],
50
+ services: ['堂食', '外带'],
51
+ promotionFacts: [],
52
+ itemActions: [],
53
+ },
54
+ {
55
+ merchantId: 'recommend-fashion',
56
+ name: '织野城市生活馆',
57
+ logoUrl: ASSET.lifestyleLogo,
58
+ coverUrl: ASSET.lifestyleLogo,
59
+ businessCategories: ['服饰', '生活方式'],
60
+ location: { floorName: 'L2', displayText: 'A 座 L2' },
61
+ status: { code: 'disabled', label: '休息中', observedAt: OBSERVED_AT },
62
+ operatingStatus: '10:00 开始营业',
63
+ rating: '4.6',
64
+ avgSpend: '¥128',
65
+ services: ['到店自提'],
66
+ promotionFacts: [],
67
+ itemActions: [],
68
+ },
69
+ {
70
+ merchantId: 'recommend-dining',
71
+ name: '暖屿家庭餐厅',
72
+ logoUrl: ASSET.diningLogo,
73
+ coverUrl: ASSET.diningLogo,
74
+ businessCategories: ['餐饮'],
75
+ location: { floorName: 'L3', displayText: 'B 座 L3' },
76
+ status: { code: 'enabled', label: '营业中', observedAt: OBSERVED_AT },
77
+ operatingStatus: '营业至 21:30',
78
+ rating: '4.7',
79
+ avgSpend: '¥82',
80
+ contactInfo: [{ channel: '电话', value: 'tel:4000002233' }],
81
+ services: ['儿童座椅', '堂食'],
82
+ promotionFacts: [],
83
+ itemActions: [],
84
+ },
85
+ {
86
+ merchantId: 'recommend-family',
87
+ name: '小小星球亲子成长空间',
88
+ logoUrl: ASSET.lifestyleLogo,
89
+ businessCategories: ['亲子', '娱乐'],
90
+ location: { floorName: 'L4', displayText: 'B 座 L4' },
91
+ status: { code: 'enabled', label: '营业中', observedAt: OBSERVED_AT },
92
+ rating: '4.9',
93
+ avgSpend: '¥96',
94
+ services: ['亲子友好'],
95
+ promotionFacts: [],
96
+ itemActions: [],
97
+ },
98
+ {
99
+ merchantId: 'recommend-bakery',
100
+ name: '麦町烘焙工房',
101
+ logoUrl: ASSET.coffeeLogo,
102
+ businessCategories: ['咖啡', '餐饮'],
103
+ location: { floorName: 'L1', displayText: 'B 座 L1' },
104
+ status: { code: 'enabled', label: '营业中', observedAt: OBSERVED_AT },
105
+ rating: '4.5',
106
+ avgSpend: '¥42',
107
+ services: ['外带'],
108
+ promotionFacts: [],
109
+ itemActions: [],
110
+ },
111
+ {
112
+ merchantId: 'recommend-sport',
113
+ name: '跃动运动集合空间旗舰体验店',
114
+ businessCategories: ['运动'],
115
+ location: { floorName: 'L5', displayText: 'A 座 L5 中庭旁' },
116
+ status: { code: 'unknown', label: '状态待确认', observedAt: OBSERVED_AT },
117
+ promotionFacts: [],
118
+ itemActions: [],
119
+ },
120
+ {
121
+ merchantId: 'recommend-dining-two',
122
+ name: '谷川料理食堂',
123
+ logoUrl: ASSET.diningLogo,
124
+ businessCategories: ['餐饮'],
125
+ location: { floorName: 'L3', displayText: 'A 座 L3 A318' },
126
+ status: { code: 'enabled', label: '营业中', observedAt: OBSERVED_AT },
127
+ promotionFacts: [],
128
+ itemActions: [],
129
+ },
130
+ {
131
+ merchantId: 'recommend-shopping-two',
132
+ name: '一方生活选物',
133
+ logoUrl: ASSET.lifestyleLogo,
134
+ businessCategories: ['服饰', '生活方式'],
135
+ location: { floorName: 'L2', displayText: 'B 座 L2 B216' },
136
+ status: { code: 'disabled', label: '休息中', observedAt: OBSERVED_AT },
137
+ promotionFacts: [],
138
+ itemActions: [],
139
+ },
140
+ ],
141
+ observedAt: OBSERVED_AT,
142
+ } satisfies RecommendMerchantsCardData;
143
+
144
+ export const samples: CardSample<RecommendMerchantsCardData>[] = [
145
+ {
146
+ label: '门店推荐·完整信息',
147
+ note: '最多展示四个类目 Tab;评分、人均、营业状态与楼层信息同屏(契约强制 https 图位 → 预览页恒缺图兜底,有图形态需真机数据)',
148
+ group: '门店偏好推荐',
149
+ data: RECOMMENDATION_DATA,
150
+ },
151
+ {
152
+ label: '门店推荐·轻量信息',
153
+ note: '无评分、无客单价、无 Logo 的长名称门店,验证可选字段收缩',
154
+ group: '门店偏好推荐',
155
+ data: {
156
+ summary: '适合随便逛逛的生活方式品牌',
157
+ categoryTabs: [],
158
+ items: [{
159
+ merchantId: 'recommend-minimal',
160
+ name: '缓慢生长城市生活方式与手作集合空间',
161
+ businessCategories: ['生活方式'],
162
+ location: { floorName: 'L3', displayText: 'B 座 L3 中庭旁' },
163
+ status: { code: 'unknown', label: '状态待确认', observedAt: OBSERVED_AT },
164
+ promotionFacts: [],
165
+ itemActions: [],
166
+ }],
167
+ observedAt: OBSERVED_AT,
168
+ } satisfies RecommendMerchantsCardData,
169
+ },
170
+ {
171
+ label: '门店推荐·空态',
172
+ note: '推荐结果为空时展示解释文案,不显示门店计数',
173
+ group: '门店偏好推荐',
174
+ data: {
175
+ summary: '根据当前偏好推荐',
176
+ categoryTabs: [],
177
+ items: [],
178
+ noResultsReason: '暂时没有匹配的品牌,试试放宽偏好',
179
+ observedAt: OBSERVED_AT,
180
+ } satisfies RecommendMerchantsCardData,
181
+ },
182
+ {
183
+ label: '门店推荐·历史卡',
184
+ note: '历史态禁用类目 Tab、门店行和条目动作',
185
+ group: '门店偏好推荐',
186
+ data: RECOMMENDATION_DATA,
187
+ isHistory: true,
188
+ },
189
+ ];
@@ -1,11 +1,11 @@
1
1
  import type { CardMeta } from '@tbox.cn/app-contracts';
2
- import { merchantDetailCardDataSchema } from '@tbox.cn/app-contracts-mall';
2
+ import { shopDetailCardDataSchema } from '@tbox.cn/app-contracts-mall';
3
3
  import { nowIso } from '../../domain/value-objects';
4
+ import { samples } from './samples';
4
5
 
5
- const meta: CardMeta<typeof merchantDetailCardDataSchema> = {
6
- cardType: 'merchant-detail',
7
- dataSchema: merchantDetailCardDataSchema,
8
- allowedTools: ['get-merchant'],
6
+ const meta: CardMeta<typeof shopDetailCardDataSchema> = {
7
+ cardType: 'shop-detail',
8
+ dataSchema: shopDetailCardDataSchema,
9
9
  displayName: '门店详情',
10
10
  description: '单个门店完整快照(图片/简介/联系方式)',
11
11
  sampleData: {
@@ -20,7 +20,7 @@ const meta: CardMeta<typeof merchantDetailCardDataSchema> = {
20
20
  evidence: [],
21
21
  itemActions: [],
22
22
  },
23
- priority: 80,
23
+ samples,
24
24
  schemaVersion: 1,
25
25
  };
26
26
 
@@ -0,0 +1,72 @@
1
+ /**
2
+ * shop-detail 附加预览样本(沉淀自 mall dev-gallery brand-guide 画廊)。
3
+ * 方法论:见同目录 ../shop-list/samples.ts 头注释。
4
+ */
5
+ import type { CardSample } from '@tbox.cn/app-contracts';
6
+ import type { ShopDetailCardData } from '@tbox.cn/app-contracts-mall';
7
+
8
+ const OBSERVED_AT = '2026-08-28T00:00:00.000Z';
9
+
10
+
11
+
12
+ /** https 占位(契约 httpsUrlSchema 强制 https 前缀;gallery.invalid 恒不解析——预览页图位走缺图兜底) */
13
+ const ASSET = {
14
+ coffeeLogo: 'https://gallery.invalid/brand-guide/coffee-photo.png',
15
+ detailCover: 'https://gallery.invalid/brand-guide/detail-cover.png',
16
+ } as const;
17
+
18
+ const DETAIL_DATA = {
19
+ merchantId: 'detail-coffee',
20
+ name: '日光咖啡实验室',
21
+ logoUrl: ASSET.coffeeLogo,
22
+ coverUrls: [ASSET.detailCover],
23
+ brand: '日光咖啡',
24
+ businessCategories: ['咖啡', '轻食'],
25
+ location: { buildingName: 'A 座', floorName: 'L1', unitName: 'A117', displayText: 'A 座 L1 A117' },
26
+ status: { code: 'enabled', label: '营业中', observedAt: OBSERVED_AT },
27
+ description: '以当季咖啡豆和城市灵感饮品为特色,提供适合短暂停留与朋友小聚的明亮空间。',
28
+ contactInfo: [
29
+ { channel: '营业时间', value: '10:00–22:00' },
30
+ { channel: '电话', value: 'tel:4000001122' },
31
+ ],
32
+ services: ['堂食', '外带', '充电插座', '无障碍通行'],
33
+ promotionFacts: [],
34
+ evidence: [],
35
+ itemActions: [
36
+ { kind: 'send', label: '查看推荐', value: '日光咖啡有哪些招牌推荐' },
37
+ { kind: 'send', label: '怎么去', value: '带我去日光咖啡实验室' },
38
+ ],
39
+ } satisfies ShopDetailCardData;
40
+
41
+ export const samples: CardSample<ShopDetailCardData>[] = [
42
+ {
43
+ label: '门店详情·完整信息',
44
+ note: '封面与门店图(https 占位)、简介、服务、营业时间、电话与双动作完整呈现(契约强制 https → 预览页图位走缺图兜底)',
45
+ group: '门店详情',
46
+ data: DETAIL_DATA,
47
+ },
48
+ {
49
+ label: '门店详情·最小信息',
50
+ note: '无封面、无门店图、无简介时保持紧凑结构',
51
+ group: '门店详情',
52
+ data: {
53
+ merchantId: 'detail-minimal',
54
+ name: '一方小店',
55
+ coverUrls: [],
56
+ businessCategories: ['生活方式'],
57
+ location: { displayText: 'B 座 L3' },
58
+ status: { code: 'unknown', label: '状态待确认', observedAt: OBSERVED_AT },
59
+ services: [],
60
+ promotionFacts: [],
61
+ evidence: [],
62
+ itemActions: [],
63
+ } satisfies ShopDetailCardData,
64
+ },
65
+ {
66
+ label: '门店详情·历史卡',
67
+ note: '历史消息保留完整信息,但电话和卡内动作不可点击',
68
+ group: '门店详情',
69
+ data: DETAIL_DATA,
70
+ isHistory: true,
71
+ },
72
+ ];
@@ -1,13 +1,13 @@
1
1
  import type { CardMeta } from '@tbox.cn/app-contracts';
2
- import { merchantListCardDataSchema } from '@tbox.cn/app-contracts-mall';
2
+ import { shopListCardDataSchema } from '@tbox.cn/app-contracts-mall';
3
3
  import { nowIso } from '../../domain/value-objects';
4
+ import { samples } from './samples';
4
5
 
5
- const meta: CardMeta<typeof merchantListCardDataSchema> = {
6
- cardType: 'merchant-list',
7
- dataSchema: merchantListCardDataSchema,
8
- allowedTools: ['search-merchants'],
9
- displayName: '门店列表',
10
- description: '推荐/搜索门店列表(含位置、营业状态、促销)',
6
+ const meta: CardMeta<typeof shopListCardDataSchema> = {
7
+ cardType: 'shop-list',
8
+ dataSchema: shopListCardDataSchema,
9
+ displayName: '门店导览',
10
+ description: '推荐/搜索门店列表(含位置与营业状态)',
11
11
  sampleData: {
12
12
  context: 'search',
13
13
  items: [
@@ -18,13 +18,13 @@ const meta: CardMeta<typeof merchantListCardDataSchema> = {
18
18
  location: { displayText: 'A 栋 3 楼 301' },
19
19
  status: { code: 'enabled', label: '营业中', observedAt: nowIso() },
20
20
  services: ['堂食'],
21
- promotionFacts: ['会员 9 折'],
21
+ promotionFacts: [],
22
22
  itemActions: [],
23
23
  },
24
24
  ],
25
25
  refinements: [],
26
26
  },
27
- priority: 90,
27
+ samples,
28
28
  schemaVersion: 1,
29
29
  };
30
30