@pisell/private-materials 6.3.142 → 6.3.144

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 (49) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/render/default/view.js +1 -1
  6. package/build/lowcode/view.js +1 -1
  7. package/es/components/scanOrder/components/Check/index.js +2 -1
  8. package/es/components/scanOrder/context.js +16 -8
  9. package/lib/components/scanOrder/components/Check/index.js +3 -1
  10. package/lib/components/scanOrder/context.js +6 -0
  11. package/package.json +1 -1
  12. package/es/components/scanOrder/components/Cart/index.d.ts +0 -16
  13. package/es/components/scanOrder/components/Check/index.d.ts +0 -3
  14. package/es/components/scanOrder/components/Content/index.d.ts +0 -3
  15. package/es/components/scanOrder/components/Footer/index.d.ts +0 -12
  16. package/es/components/scanOrder/components/Menu/index.d.ts +0 -18
  17. package/es/components/scanOrder/types.d.ts +0 -79
  18. package/es/components/scanOrder/utils/toShoppingCartProducts.d.ts +0 -21
  19. package/es/components/scanOrder/utils/transformProductDetail.d.ts +0 -59
  20. package/es/components/venueBooking/components/Addons/index.d.ts +0 -3
  21. package/es/components/venueBooking/components/Cart/index.d.ts +0 -28
  22. package/es/components/venueBooking/components/Checkout/index.d.ts +0 -2
  23. package/es/components/venueBooking/components/Footer/index.d.ts +0 -3
  24. package/es/components/venueBooking/components/Header/index.d.ts +0 -2
  25. package/es/components/venueBooking/components/VenueSelection/components/TimeGrid.d.ts +0 -2
  26. package/es/components/venueBooking/context.d.ts +0 -9
  27. package/es/components/venueBooking/hooks.d.ts +0 -72
  28. package/es/components/venueBooking/index.d.ts +0 -6
  29. package/es/components/venueBooking/locales.d.ts +0 -627
  30. package/es/components/venueBooking/types.d.ts +0 -204
  31. package/lib/components/scanOrder/components/Cart/index.d.ts +0 -16
  32. package/lib/components/scanOrder/components/Check/index.d.ts +0 -3
  33. package/lib/components/scanOrder/components/Content/index.d.ts +0 -3
  34. package/lib/components/scanOrder/components/Footer/index.d.ts +0 -12
  35. package/lib/components/scanOrder/components/Menu/index.d.ts +0 -18
  36. package/lib/components/scanOrder/types.d.ts +0 -79
  37. package/lib/components/scanOrder/utils/toShoppingCartProducts.d.ts +0 -21
  38. package/lib/components/scanOrder/utils/transformProductDetail.d.ts +0 -59
  39. package/lib/components/venueBooking/components/Addons/index.d.ts +0 -3
  40. package/lib/components/venueBooking/components/Cart/index.d.ts +0 -28
  41. package/lib/components/venueBooking/components/Checkout/index.d.ts +0 -2
  42. package/lib/components/venueBooking/components/Footer/index.d.ts +0 -3
  43. package/lib/components/venueBooking/components/Header/index.d.ts +0 -2
  44. package/lib/components/venueBooking/components/VenueSelection/components/TimeGrid.d.ts +0 -2
  45. package/lib/components/venueBooking/context.d.ts +0 -9
  46. package/lib/components/venueBooking/hooks.d.ts +0 -72
  47. package/lib/components/venueBooking/index.d.ts +0 -6
  48. package/lib/components/venueBooking/locales.d.ts +0 -627
  49. package/lib/components/venueBooking/types.d.ts +0 -204
@@ -1,204 +0,0 @@
1
- /// <reference types="react" />
2
- import type { Dayjs } from 'dayjs';
3
- /** 场地预订步骤枚举 */
4
- export declare type VenueBookingStepKey = 'select-venue' | 'addons' | 'checkout';
5
- /** 场地预订组件入口 props */
6
- export interface VenueBookingProps {
7
- biz?: string;
8
- resource_id?: string;
9
- }
10
- /** 标准化后的入口上下文(从 engine props 提取) */
11
- export interface VenueBookingEntryContext {
12
- biz: string;
13
- resource_id?: string;
14
- }
15
- /** 单个时段(来自 getTimeSlotGrid) */
16
- export interface VenueResourceSlot {
17
- startTime: string;
18
- endTime: string;
19
- status: 'past' | 'occupied' | 'available' | 'partially_occupied' | 'unavailable';
20
- price: string | null;
21
- /** per-product 子行的 slot 带 productId;外层合并 slot 不带 */
22
- productId?: number;
23
- }
24
- /** 多商品共享一个 resource 时的子行 */
25
- export interface VenueResourceSubRow {
26
- productId: number;
27
- productTitle: string;
28
- price: string;
29
- slots: VenueResourceSlot[];
30
- }
31
- /** 单个资源/场地(来自 getTimeSlotGrid) */
32
- export interface VenueResource {
33
- resourceId: number;
34
- resourceName: string;
35
- /** 单商品时唯一;多商品时取第一个(兼容字段,请优先使用 products) */
36
- productId: number;
37
- productTitle: string;
38
- slots: VenueResourceSlot[];
39
- /** 多商品子行;仅当 hasMultipleProducts 时存在 */
40
- products?: VenueResourceSubRow[];
41
- hasMultipleProducts?: boolean;
42
- /** 组合资源元信息(combined_resource.status === 1) */
43
- combinedResource?: {
44
- resourceIds: Array<number | string>;
45
- };
46
- }
47
- /** 日期时段网格(来自 getTimeSlotGrid) */
48
- export interface VenueTimeSlotGrid {
49
- date: string;
50
- timeLabels: string[];
51
- resources: VenueResource[];
52
- }
53
- /** 日期概览(来自 getDateRangeSummary) */
54
- export interface VenueDateSummaryItem {
55
- date: string;
56
- status: 'available' | 'few_left' | 'sold_out' | 'unavailable';
57
- startingPrice: string | null;
58
- totalSlots: number;
59
- availableSlots: number;
60
- }
61
- /** 时段价格信息(用于 TimeGrid 渲染样式) */
62
- export interface SlotPriceInfo {
63
- price: number;
64
- originalPrice: number | null;
65
- label: string;
66
- highlight: boolean;
67
- }
68
- /** 时段标签(Off-Peak / Promo 等) */
69
- export interface SlotTag {
70
- text: string;
71
- className: string;
72
- }
73
- /** 日期元数据(用于 DayTabs 展示状态标签) */
74
- export interface DateMeta {
75
- topTag: string | null;
76
- startingPrice: string | null;
77
- fewLeft: boolean;
78
- soldOut: boolean;
79
- unavailable: boolean;
80
- }
81
- /** 场地维度的可用性概况 */
82
- export interface CourtMeta {
83
- soldOut: boolean;
84
- fewLeft: boolean;
85
- }
86
- /** 时段维度的可用性概况 */
87
- export interface TimeMeta {
88
- soldOut: boolean;
89
- fewLeft: boolean;
90
- }
91
- /**
92
- * 视图模型 -- 聚合场地数据 + OS 模块数据
93
- * dateSummary / timeSlotGrid 来自 PisellOS venueBooking 模块
94
- * cartItems / summary / note 从 OS 模块快照构建
95
- */
96
- export interface VenueBookingViewModel {
97
- /** 一周日期概览(状态 + 起步价) */
98
- dateSummary: VenueDateSummaryItem[];
99
- /** 当前选中日期的时段网格(资源 × 时段) */
100
- timeSlotGrid: VenueTimeSlotGrid | null;
101
- /** 购物车商品列表(ShoppingCart 组件所需格式) */
102
- cartItems: any[];
103
- /** 金额汇总对象(total_amount / tax_fee 等) */
104
- summary: Record<string, any>;
105
- /** 订单备注 */
106
- note: string;
107
- /** 联系人信息(tempOrder.contacts_info) */
108
- contactsInfo: any[];
109
- /** 场地商品列表(来自 loadVenueProducts / getVenueProducts) */
110
- venueProducts: any[];
111
- /** 附加商品列表(缓存在 context 中,避免步骤切换时丢失) */
112
- addonProductList: any[];
113
- }
114
- /** Context 暴露给所有子组件的完整值类型 */
115
- export interface VenueBookingContextValue {
116
- /** PisellOS venueBooking 模块实例 */
117
- venueBookingModule: any;
118
- /** 当前步骤 */
119
- currentStep: VenueBookingStepKey;
120
- /** 步骤列表 */
121
- stepList: VenueBookingStepKey[];
122
- /** 聚合视图模型 */
123
- viewModel: VenueBookingViewModel;
124
- /** 日历锚点日期 */
125
- anchorDate: Dayjs;
126
- /** 场地类型筛选器 */
127
- filter: string;
128
- /** 场地搜索关键字 */
129
- search: string;
130
- /** 数据加载中(初始 bootstrap) */
131
- isLoading: boolean;
132
- /** 周视图(dateSummary)加载中:拉取一周场地概览网络请求期间为 true */
133
- isWeekLoading: boolean;
134
- /** 时段网格(timeSlotGrid)加载中:切换日期 / 切换周时短暂为 true */
135
- isGridLoading: boolean;
136
- /** 预订上限提示信息 */
137
- limitMessage: string;
138
- /** 移动端购物车抽屉是否展开 */
139
- mobileCartOpen: boolean;
140
- /** 月份选择器是否展开 */
141
- monthPickerOpen: boolean;
142
- /** 月份选择器当前游标月份 */
143
- monthCursor: Dayjs;
144
- /** 是否满足进入下一步的条件 */
145
- canNext: boolean;
146
- /** 购物车校验状态(从 OS 事件同步) */
147
- cartValidation: {
148
- passed: boolean | null;
149
- failures: any[];
150
- };
151
- /** Footer 操作按钮文案 */
152
- footerActionText: string;
153
- /** 下单提交中状态 */
154
- isSubmittingOrder: boolean;
155
- /** 是否已登录 */
156
- isLogin: boolean;
157
- /** 打开登录弹窗 */
158
- openLoginModal: (params: {
159
- callback: (status: string) => void;
160
- }) => void;
161
- /** 当前折扣/优惠券列表 */
162
- discountList: any[];
163
- /** 定金协议是否已勾选 */
164
- isAgreeDepositPolicy: boolean;
165
- /** 设置定金协议勾选状态 */
166
- setIsAgreeDepositPolicy: (val: boolean) => void;
167
- /** 步骤导航:跳转到指定步骤 */
168
- goToStep: (step: VenueBookingStepKey) => void;
169
- /** 步骤导航:下一步 */
170
- nextStep: () => void;
171
- /** 步骤导航:上一步 */
172
- prevStep: () => void;
173
- setAnchorDate: (date: Dayjs) => void;
174
- setFilter: (filter: string) => void;
175
- setSearch: (search: string) => void;
176
- setLimitMessage: (msg: string) => void;
177
- setMobileCartOpen: (open: boolean) => void;
178
- setMonthPickerOpen: (open: boolean) => void;
179
- setMonthCursor: (cursor: Dayjs) => void;
180
- setFooterActionText: (text: string) => void;
181
- /** 切换选中/取消某个时段(调用 OS venueBooking.toggleSlot) */
182
- toggleSlot: (resourceId: number, productId: number, slot: VenueResourceSlot) => Promise<void>;
183
- /** 刷新 OS 模块视图模型(调用 getSummary + 重建 viewModel),可选传入额外字段合并 */
184
- refreshViewModel: (extraFields?: Partial<VenueBookingViewModel>) => Promise<void>;
185
- /** 拉取指定周的资源数据并刷新 dateSummary + timeSlotGrid */
186
- fetchWeekData: (startDate: string, endDate: string) => Promise<void>;
187
- /** 从指定日期开始自动跳转到最近可用日期(必要时自动滚到后续周) */
188
- goToNearestAvailableDate: (fromDate: Dayjs) => Promise<void>;
189
- /** 刷新当前日期的 timeSlotGrid */
190
- refreshTimeSlotGrid: (date?: string) => void;
191
- /** 安全调用 OS 模块方法的快捷入口 */
192
- runModuleAction: (actionName: string, ...args: any[]) => Promise<any>;
193
- /** 更新订单备注到 OS 模块 */
194
- updateOrderNote: (note: string) => Promise<void>;
195
- /** 主操作按钮行为(根据当前步骤不同执行不同逻辑) */
196
- handlePrimaryAction: () => void;
197
- /** 结账步骤提交订单 */
198
- handleSubmitOrder: () => Promise<void>;
199
- }
200
- /** Provider 组件的 props */
201
- export interface VenueBookingProviderProps {
202
- entryContext: VenueBookingEntryContext;
203
- children: React.ReactNode;
204
- }
@@ -1,16 +0,0 @@
1
- import React from 'react';
2
- import './index.less';
3
- interface CartProps {
4
- open: boolean;
5
- onCancel: () => void;
6
- onNext: () => void;
7
- items: any[];
8
- summary: Record<string, any>;
9
- embedded?: boolean;
10
- confirmLoading?: boolean;
11
- extraContent?: React.ReactNode;
12
- /** 视觉禁用:按钮仍会触发 onNext,由父级自行拦截(用于弹 toast 等反馈) */
13
- disabled?: boolean;
14
- }
15
- export default function Cart(props: CartProps): JSX.Element | null;
16
- export {};
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import './index.less';
3
- export default function Check(): JSX.Element;
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import './index.less';
3
- export default function Content(): JSX.Element;
@@ -1,12 +0,0 @@
1
- /// <reference types="react" />
2
- import './index.less';
3
- interface FooterProps {
4
- cartItems: any[];
5
- summary: Record<string, any>;
6
- actionText: string;
7
- onAction: () => void;
8
- /** 视觉禁用:按钮仍会触发 onAction,由父级自行拦截(用于弹 toast 等反馈) */
9
- disabled?: boolean;
10
- }
11
- export default function Footer(props: FooterProps): JSX.Element;
12
- export {};
@@ -1,18 +0,0 @@
1
- /// <reference types="react" />
2
- interface MenuProps {
3
- onCheckout: () => void;
4
- /**
5
- * 商品列表(由上层 ReadyState 持有,配合 onEnsureProductList 做幂等拉取与持久化:
6
- * 切 step 回到 product 时 Menu 会 remount,但 productList 在 ReadyState 不会丢)
7
- */
8
- productList: any[];
9
- /**
10
- * 幂等触发商品列表拉取。Menu mount 时调用:
11
- * - 首次:真发请求
12
- * - 后续(如从 check 返回 product):命中缓存,直接短路,不重复发请求
13
- */
14
- isProductListLoading: boolean;
15
- onEnsureProductList: () => Promise<void>;
16
- }
17
- export default function Menu(props: MenuProps): JSX.Element;
18
- export {};
@@ -1,79 +0,0 @@
1
- import React from 'react';
2
- export interface ScanOrderEntryContext {
3
- biz: string;
4
- resource_id?: string;
5
- order_id?: string;
6
- }
7
- export interface ScanOrderProps {
8
- biz?: string;
9
- resource_id?: string;
10
- order_id?: string;
11
- entryContext?: ScanOrderEntryContext;
12
- }
13
- export declare type ScanOrderStepKey = 'init' | 'product' | 'check' | 'error';
14
- export declare type ScanOrderEntryMode = 'default' | 'additional_order';
15
- /** 步骤缓存中记录的 gate 标记(对应协议 / 表单 / 人数 modal 是否已走过) */
16
- export declare type ScanOrderGateKey = 'policyAccepted' | 'formSubmitted' | 'paxEntered';
17
- /** 存入 sessionStorage 桶内的 entryContext 快照(用于校验是否同一扫码场景) */
18
- export interface ScanOrderCachedEntryContext {
19
- resourceId?: string;
20
- hasOrderId?: boolean;
21
- biz?: string;
22
- }
23
- export interface ScanOrderViewModel {
24
- menuItems: any[];
25
- cartItems: any[];
26
- summary: Record<string, any>;
27
- note: string;
28
- }
29
- export interface ScanOrderContextValue {
30
- entryContext: ScanOrderEntryContext;
31
- scanOrderModule: any;
32
- cartValidation: {
33
- passed: boolean | null;
34
- failures: any[];
35
- };
36
- isLoading: boolean;
37
- errorMessage: string;
38
- currentStep: ScanOrderStepKey;
39
- stepList: ScanOrderStepKey[];
40
- viewModel: ScanOrderViewModel;
41
- footerActionText: string;
42
- tableName: string;
43
- entryMode: ScanOrderEntryMode;
44
- submitDisabledTips: string;
45
- /** 折扣/优惠券列表(来自 scanOrder 模块 getDiscountList) */
46
- discountList: any[];
47
- isReady: boolean;
48
- setCurrentStep: (step: ScanOrderStepKey) => void;
49
- setTableName: (name: string) => void;
50
- setEntryMode: (mode: ScanOrderEntryMode) => void;
51
- setSubmitDisabledTips: (tips: string) => void;
52
- goToStep: (step: ScanOrderStepKey) => void;
53
- nextStep: () => void;
54
- prevStep: () => void;
55
- refreshViewModel: () => Promise<void>;
56
- runModuleAction: (actionName: string, ...args: any[]) => Promise<any>;
57
- setFooterActionText: (text: string) => void;
58
- updateOrderNote: (note: string) => Promise<void>;
59
- /** 步骤缓存 hydrate 是否已完成(未完成时不建议写入 step,避免覆盖缓存) */
60
- isCacheHydrated: boolean;
61
- /** 将 gate 标记为已完成(写入 sessionStorage 桶) */
62
- markGate: (flag: ScanOrderGateKey) => void;
63
- /** 查询某个 gate 是否已完成 */
64
- isGatePassed: (flag: ScanOrderGateKey) => boolean;
65
- /** 整桶清空(提交成功 / restoreOrder 等场景) */
66
- clearStepCache: () => void;
67
- /**
68
- * bootstrap 结束后要恢复到的目标 step(仅记录 `'product' | 'check'`)。
69
- * hydrate 阶段不直接 `setCurrentStep`,避免在 checkResourceAvailable 之前让
70
- * `<Menu>` / `<Check>` mount、提前发出缺 menu_list_ids 的请求。
71
- */
72
- resumeStep: ScanOrderStepKey | null;
73
- /** 消费并清空 resumeStep;建议在完成 goToStep 后立刻调用 */
74
- consumeResumeStep: () => void;
75
- }
76
- export interface ScanOrderProviderProps {
77
- entryContext: ScanOrderEntryContext;
78
- children: React.ReactNode;
79
- }
@@ -1,21 +0,0 @@
1
- interface ScanOrderOrderProduct {
2
- product_id: number | null;
3
- product_variant_id: number;
4
- num?: number;
5
- /** 券后单品单价(订单域成交单价)。 */
6
- selling_price?: string | number;
7
- /** 券前单品单价(店铺售价)。 */
8
- original_price?: string | number;
9
- product_option_item?: any[];
10
- product_bundle?: any[];
11
- identity_key?: string;
12
- note?: string;
13
- metadata?: Record<string, any>;
14
- _origin?: Record<string, any>;
15
- [key: string]: any;
16
- }
17
- export declare function toShoppingCartProducts(params: {
18
- orderProducts: ScanOrderOrderProduct[];
19
- amountSymbol?: string;
20
- }): Record<string, any>[];
21
- export {};
@@ -1,59 +0,0 @@
1
- export interface ProductDetailOptionItem {
2
- product_option_item_id?: number | string;
3
- option_group_item_id?: number | string;
4
- option_group_id?: number | string;
5
- num?: number;
6
- price?: number | string;
7
- }
8
- export interface ProductDetailBundleItem {
9
- option?: ProductDetailOptionItem[];
10
- [key: string]: any;
11
- }
12
- export interface ProductDetailCallbackPayload {
13
- id?: number | string | null;
14
- product_id?: number | string | null;
15
- variant_id?: number | string;
16
- product_variant_id?: number | string;
17
- quantity?: number;
18
- num?: number;
19
- option?: ProductDetailOptionItem[];
20
- product_option_item?: ProductDetailOptionItem[];
21
- bundle?: ProductDetailBundleItem[];
22
- product_bundle?: ProductDetailBundleItem[];
23
- unique?: string;
24
- session?: any;
25
- form?: any;
26
- service_times?: number;
27
- machine_code?: string;
28
- schedule_id?: number[];
29
- duration?: number;
30
- policy_id?: number;
31
- source_shop_id?: number;
32
- origin?: any;
33
- [key: string]: any;
34
- }
35
- export interface ScanOrderOrderProductInput {
36
- product_id: number | null;
37
- product_variant_id: number;
38
- num: number;
39
- product_option_item: Array<{
40
- product_option_item_id: number;
41
- option_group_id: number;
42
- num: number;
43
- price: number;
44
- }>;
45
- product_bundle: ProductDetailBundleItem[];
46
- /** 券后单品单价;初次加购由入口置为 selling_price,之后由 SDK Rules 引擎维护。 */
47
- selling_price: string;
48
- /** 券前单品单价(店铺售价)。 */
49
- original_price: string;
50
- tax_fee: string;
51
- is_charge_tax: number;
52
- metadata: Record<string, any>;
53
- _origin: Record<string, any>;
54
- }
55
- export declare function transformProductDetailToOrderProduct(params: {
56
- payload: ProductDetailCallbackPayload;
57
- fallbackProductId?: number | string | null;
58
- sourceItem?: Record<string, any>;
59
- }): ScanOrderOrderProductInput | null;
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import './index.less';
3
- export default function Addons(): JSX.Element;
@@ -1,28 +0,0 @@
1
- /**
2
- * venueBooking 购物车组件
3
- * 参照 scanOrder/Cart 实现,使用系统内置 ShoppingCart + SubTotal 组件
4
- * 支持两种模式:embedded(桌面端内嵌)和 drawer(移动端抽屉弹出)
5
- */
6
- import React from 'react';
7
- import './index.less';
8
- /** Cart 组件 Props,与 scanOrder/Cart 对齐 */
9
- interface CartProps {
10
- /** 是否打开(drawer 模式生效) */
11
- open: boolean;
12
- /** 关闭回调(drawer 模式) */
13
- onCancel: () => void;
14
- /** 确认/下一步回调 */
15
- onNext: () => void;
16
- /** 购物车商品列表(从 OS 模块获取后由 toShoppingCartProducts 转换) */
17
- items: any[];
18
- /** 金额汇总(从 OS 模块 getSummary 获取) */
19
- summary: Record<string, any>;
20
- /** 是否内嵌模式(桌面端侧边栏使用) */
21
- embedded?: boolean;
22
- /** 确认按钮 loading 状态 */
23
- confirmLoading?: boolean;
24
- /** 购物车底部额外内容插槽 */
25
- extraContent?: React.ReactNode;
26
- }
27
- export default function Cart(props: CartProps): JSX.Element | null;
28
- export {};
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export default function Checkout(): JSX.Element;
@@ -1,3 +0,0 @@
1
- /// <reference types="react" />
2
- import './index.less';
3
- export default function Footer(): JSX.Element;
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export default function Header(): JSX.Element;
@@ -1,2 +0,0 @@
1
- /// <reference types="react" />
2
- export default function TimeGrid(): JSX.Element;
@@ -1,9 +0,0 @@
1
- /// <reference types="react" />
2
- import type { VenueBookingContextValue, VenueBookingProviderProps } from './types';
3
- /**
4
- * VenueBookingProvider -- 场地预订全局 Context
5
- * 管理步骤导航、场地选择状态、OS 模块集成
6
- */
7
- export declare function VenueBookingProvider({ entryContext, children }: VenueBookingProviderProps): JSX.Element;
8
- /** 消费 venueBooking Context 的 hook */
9
- export declare function useVenueBookingContext(): VenueBookingContextValue;
@@ -1,72 +0,0 @@
1
- import type { VenueBookingProps, VenueBookingEntryContext, VenueBookingViewModel, VenueTimeSlotGrid, VenueDateSummaryItem } from './types';
2
- /** 步骤定义常量 */
3
- export declare const VENUE_BOOKING_STEPS: readonly ["select-venue", "addons", "checkout"];
4
- /** 写死的场地商品 ID(后续改为从配置读取) */
5
- export declare const VENUE_PRODUCT_IDS: number[];
6
- /**
7
- * 获取 PisellOS venueBooking 业务模块
8
- * 使用 useRef 稳定模块引用,防止 getModule 返回值每次渲染变化时触发 bootstrap useEffect 重跑
9
- */
10
- export declare function useVenueBookingModule(): any;
11
- /** 统一获取货币前缀(优先引擎配置,兜底 '$') */
12
- export declare function useVenueBookingSymbol(): string;
13
- /** 获取引擎上下文中的 utils 工具集(action / token 等) */
14
- export declare function contextUtils(): any;
15
- /** 从 engine props 提取标准化的入口上下文 */
16
- export declare function normalizeEntryContext(props: VenueBookingProps): VenueBookingEntryContext;
17
- /**
18
- * 安全调用模块异步方法
19
- * 检查模块和方法是否存在,不存在时抛出友好错误
20
- */
21
- export declare function safeRunModuleAction(module: any, actionName: string, ...args: any[]): Promise<any>;
22
- /** 加载场地商品(初始化时调用一次) */
23
- export declare function loadVenueProducts(module: any, productIds: number[]): Promise<any>;
24
- /** 拉取资源可用性数据(按日期范围,翻周时调用) */
25
- export declare function fetchResourceAvailability(module: any, startDate: string, endDate: string): Promise<any>;
26
- /** 获取日期概览(纯计算不发请求,fetchResourceAvailability 后调用) */
27
- export declare function getDateRangeSummary(module: any, startDate: string, endDate: string): VenueDateSummaryItem[];
28
- /** 获取某天的时段网格(纯计算不发请求,切换日期时调用) */
29
- export declare function getTimeSlotGrid(module: any, date: string): VenueTimeSlotGrid | null;
30
- /** 切换选中/取消一个时段(同一资源下多商品场景必须携带 productId) */
31
- export declare function toggleSlotAction(module: any, params: {
32
- resourceId: number;
33
- productId: number;
34
- startTime: string;
35
- endTime: string;
36
- price: string;
37
- }): Promise<any>;
38
- /**
39
- * 查询某个时段是否已被选中
40
- * 不传 productId 时:该资源下任一商品选中即 true;传了则精确匹配
41
- */
42
- export declare function isSlotSelected(module: any, resourceId: number, startTime: string, productId?: number): boolean;
43
- /**
44
- * 询问 OS:该 (resourceId, productId, startTime) 格子是否因其它已选项而应禁用
45
- * 覆盖:同场地多商品互斥、组合资源 ↔ 子资源联动
46
- */
47
- export declare function isSlotDisabledBySelection(module: any, params: {
48
- resourceId: number;
49
- productId: number;
50
- startTime: string;
51
- }): boolean;
52
- /** 获取全部已选时段(按资源分组) */
53
- export declare function getAllSelectedSlots(module: any): any[];
54
- /** 查询 otherParams */
55
- export declare function getOtherParams(module: any): any;
56
- /**
57
- * 获取所有“已选时段”对应的日期 key(YYYY-MM-DD)
58
- * 兼容 venueBooking 模块返回 Map 或数组结构
59
- */
60
- export declare function getSelectedDateKeySet(module: any): Set<string>;
61
- /**
62
- * 从 OS 模块快照构建 ViewModel(购物车部分)
63
- * 购物车数据使用 toShoppingCartProducts 转换为 ShoppingCart 组件所需格式
64
- */
65
- export declare function createVenueBookingViewModel(module: any): Partial<VenueBookingViewModel>;
66
- /** 登录状态 hook(检查 token + 弹出登录弹窗) */
67
- export declare function useVenueBookingLogin(): {
68
- isLogin: boolean;
69
- openLoginModal: (params: {
70
- callback: any;
71
- }) => void;
72
- };
@@ -1,6 +0,0 @@
1
- /// <reference types="react" />
2
- import type { VenueBookingProps } from './types';
3
- /** 场地预订主组件 */
4
- declare function VenueBooking(props: VenueBookingProps): JSX.Element;
5
- export type { VenueBookingProps } from './types';
6
- export default VenueBooking;