@pisell/private-materials 6.3.131 → 6.3.132

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 (75) 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 +6 -6
  6. package/build/lowcode/view.js +6 -6
  7. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
  8. package/es/components/booking/info/service2/utils.d.ts +1 -1
  9. package/es/components/booking/utils.d.ts +2 -2
  10. package/es/components/ecocup/components/CupStatusModal/hooks.d.ts +1 -1
  11. package/es/components/eftposPay/amount.d.ts +1 -1
  12. package/es/components/eftposPay/device.d.ts +1 -1
  13. package/es/components/eftposPay/hooks.d.ts +2 -2
  14. package/es/components/eftposPay/store/index.d.ts +5 -5
  15. package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
  16. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
  17. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
  18. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
  19. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
  20. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  21. package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
  22. package/es/components/venueBooking/components/Cart/index.js +7 -7
  23. package/es/components/venueBooking/components/Checkout/index.js +2 -12
  24. package/es/components/venueBooking/components/Content/index.js +8 -7
  25. package/es/components/venueBooking/components/Footer/index.js +2 -8
  26. package/es/components/venueBooking/components/Header/index.js +37 -16
  27. package/es/components/venueBooking/components/VenueSelection/components/TimeGrid.js +52 -8
  28. package/es/components/venueBooking/components/VenueSelection/index.js +1 -5
  29. package/es/components/venueBooking/context.js +46 -24
  30. package/es/components/venueBooking/hooks.d.ts +1 -0
  31. package/es/components/venueBooking/hooks.js +8 -2
  32. package/es/components/venueBooking/index.js +30 -2
  33. package/es/components/venueBooking/locales.d.ts +15 -0
  34. package/es/components/venueBooking/locales.js +20 -5
  35. package/es/components/venueBooking/utils.d.ts +8 -0
  36. package/es/components/venueBooking/utils.js +12 -2
  37. package/es/hooks/usePaymentLogger.d.ts +1 -0
  38. package/es/plus/pisellSalesManagement/config/booking.d.ts +6 -6
  39. package/es/plus/pisellSalesManagement/hooks/useSalesGridData.d.ts +1 -0
  40. package/es/plus/walletEditor/components/ImageUpload/index.d.ts +1 -1
  41. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
  42. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  43. package/lib/components/booking/utils.d.ts +2 -2
  44. package/lib/components/ecocup/components/CupStatusModal/hooks.d.ts +1 -1
  45. package/lib/components/eftposPay/amount.d.ts +1 -1
  46. package/lib/components/eftposPay/device.d.ts +1 -1
  47. package/lib/components/eftposPay/hooks.d.ts +2 -2
  48. package/lib/components/eftposPay/store/index.d.ts +5 -5
  49. package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
  50. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
  51. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
  52. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
  53. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
  54. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
  55. package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
  56. package/lib/components/venueBooking/components/Cart/index.js +3 -8
  57. package/lib/components/venueBooking/components/Checkout/index.js +1 -5
  58. package/lib/components/venueBooking/components/Content/index.js +20 -15
  59. package/lib/components/venueBooking/components/Footer/index.js +1 -9
  60. package/lib/components/venueBooking/components/Header/index.js +11 -5
  61. package/lib/components/venueBooking/components/VenueSelection/components/TimeGrid.js +21 -3
  62. package/lib/components/venueBooking/components/VenueSelection/index.js +1 -2
  63. package/lib/components/venueBooking/context.js +32 -20
  64. package/lib/components/venueBooking/hooks.d.ts +1 -0
  65. package/lib/components/venueBooking/hooks.js +6 -1
  66. package/lib/components/venueBooking/index.js +19 -1
  67. package/lib/components/venueBooking/locales.d.ts +15 -0
  68. package/lib/components/venueBooking/locales.js +20 -5
  69. package/lib/components/venueBooking/utils.d.ts +8 -0
  70. package/lib/components/venueBooking/utils.js +3 -2
  71. package/lib/hooks/usePaymentLogger.d.ts +1 -0
  72. package/lib/plus/pisellSalesManagement/config/booking.d.ts +6 -6
  73. package/lib/plus/pisellSalesManagement/hooks/useSalesGridData.d.ts +1 -0
  74. package/lib/plus/walletEditor/components/ImageUpload/index.d.ts +1 -1
  75. package/package.json +18 -18
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const useIsLowSpeedNetwork: () => import("react").MutableRefObject<boolean>;
2
3
  export default useIsLowSpeedNetwork;
@@ -245,4 +245,4 @@ export declare const updateAppointmentServicePrice: (state: any, { start_date, e
245
245
  * @Author: WangHan
246
246
  * @Date: 2024-12-24 11:32
247
247
  */
248
- export declare const updateServicePrice: (state: any) => Promise<any> | never[];
248
+ export declare const updateServicePrice: (state: any) => never[] | Promise<any>;
@@ -166,10 +166,10 @@ export declare const getProductTotalPrice: (item: any) => number;
166
166
  export declare const getDuration: (duration: number | {
167
167
  type: string;
168
168
  value: number;
169
- }) => number | {
169
+ }) => number | "flexible" | {
170
170
  type: string;
171
171
  value: number;
172
- } | "flexible";
172
+ };
173
173
  export declare const isWalkIn: (customer_id?: number | string) => boolean;
174
174
  export declare const getIsEdit: (state: any) => boolean;
175
175
  export {};
@@ -8,7 +8,7 @@ export declare const useCupAction: () => {
8
8
  * @return {*}
9
9
  */
10
10
  export declare const useBatchCupAction: () => {
11
- run: (this: unknown, eco_cup_ids: string[] | number[]) => Promise<boolean>;
11
+ run: (this: unknown, eco_cup_ids: number[] | string[]) => Promise<boolean>;
12
12
  loading: boolean;
13
13
  };
14
14
  /**
@@ -9,7 +9,7 @@ import { PosProps } from './const';
9
9
  */
10
10
  declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
11
11
  className?: string | undefined;
12
- onChange?: ((status: "success" | "page" | "fail" | "print" | "mark_tx_processed", params?: string | {
12
+ onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
13
13
  [keys: string]: unknown;
14
14
  } | undefined, other?: any) => void) | undefined;
15
15
  onClose: () => void;
@@ -11,7 +11,7 @@ import './device.less';
11
11
  declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
12
12
  api: PayProps['api'];
13
13
  className?: string | undefined;
14
- onChange?: ((status: "success" | "page" | "fail" | "print" | "mark_tx_processed", params?: string | {
14
+ onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
15
15
  [keys: string]: unknown;
16
16
  } | undefined, other?: any) => void) | undefined;
17
17
  onClose: () => void;
@@ -15,11 +15,11 @@ export declare const useStoreRef: <T extends {
15
15
  readonly numRef: React.MutableRefObject<string | number | undefined>;
16
16
  readonly orderIdRef: React.MutableRefObject<string | number>;
17
17
  readonly modeRef: React.MutableRefObject<ModeEnum>;
18
- readonly statusRef: React.MutableRefObject<"success" | "warn" | "loading" | "fail" | "pedding" | "resove" | "reject" | "question">;
18
+ readonly statusRef: React.MutableRefObject<"warn" | "success" | "loading" | "fail" | "pedding" | "resove" | "reject" | "question">;
19
19
  readonly netRef: React.MutableRefObject<boolean | undefined>;
20
20
  readonly symbolRef: React.MutableRefObject<string>;
21
21
  readonly amountRef: React.MutableRefObject<string | number>;
22
- readonly eftposRef: React.MutableRefObject<"tyro" | "payo" | "windcave" | "stripe" | "linkly">;
22
+ readonly eftposRef: React.MutableRefObject<"stripe" | "payo" | "tyro" | "windcave" | "linkly">;
23
23
  readonly clientRef: React.MutableRefObject<ClientEnum>;
24
24
  readonly dataRef: React.MutableRefObject<import("./store").State>;
25
25
  };
@@ -176,7 +176,7 @@ export declare const updateCustom: (payload: {
176
176
  export declare const updateStatus: (status: 'loading' | 'warn' | 'fail' | 'success' | 'question') => {
177
177
  type: EActionTypes;
178
178
  payload: {
179
- status: "success" | "warn" | "loading" | "fail" | "question";
179
+ status: "warn" | "success" | "loading" | "fail" | "question";
180
180
  };
181
181
  };
182
182
  /**
@@ -197,7 +197,7 @@ export declare const updateComponent: (component: string, render?: boolean) => {
197
197
  } | {
198
198
  readonly type: "step";
199
199
  readonly render: boolean;
200
- readonly component?: undefined;
200
+ component?: undefined;
201
201
  };
202
202
  };
203
203
  /**
@@ -297,9 +297,9 @@ export declare const backUpFree: (payload: Partial<State>) => {
297
297
  name?: string | undefined;
298
298
  symbol?: string | undefined;
299
299
  amount?: string | number | undefined;
300
- mode?: "pay" | "fullPay" | "refund" | "query" | undefined;
300
+ mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
301
301
  order_id?: string | number | undefined;
302
- eftpos?: "tyro" | "payo" | "windcave" | "stripe" | "linkly" | undefined;
302
+ eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | undefined;
303
303
  action?: "amount" | "pay" | "deviceList" | undefined;
304
304
  key?: number | undefined;
305
305
  step?: number | undefined;
@@ -310,7 +310,7 @@ export declare const backUpFree: (payload: Partial<State>) => {
310
310
  net?: boolean | undefined;
311
311
  component?: string | undefined;
312
312
  form?: string | undefined;
313
- status?: "success" | "warn" | "loading" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
313
+ status?: "warn" | "success" | "loading" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
314
314
  warn?: string | undefined;
315
315
  steps?: {
316
316
  /** 用于重置当前步骤 */
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  /**
2
3
  * @title: 获取 Tyro 资源
3
4
  * @description:
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Status: (props: any) => import("react").JSX.Element;
3
4
  export default Status;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const DayItem: (props: any) => import("react").JSX.Element;
3
4
  export default DayItem;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  import { CalendarItemProps } from '../../../../../type';
3
4
  declare const Item: (props: CalendarItemProps) => import("react").JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Status: (props: any) => import("react").JSX.Element;
3
4
  export default Status;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const StripeSDK: ({ public_key, client_secret, children, lang, }: {
2
3
  public_key: string;
3
4
  client_secret?: string | undefined;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Empty: (props: any) => import("react").JSX.Element;
3
4
  export default Empty;
@@ -67,20 +67,20 @@ export default function Cart(props) {
67
67
 
68
68
  // 从 summary 中提取总金额(兼容多种字段名)
69
69
  var totalAmount = (_ref = (_ref2 = (_ref3 = (_summary$total_amount = summary === null || summary === void 0 ? void 0 : summary.total_amount) !== null && _summary$total_amount !== void 0 ? _summary$total_amount : summary === null || summary === void 0 ? void 0 : summary.expect_amount) !== null && _ref3 !== void 0 ? _ref3 : summary === null || summary === void 0 ? void 0 : summary.amount) !== null && _ref2 !== void 0 ? _ref2 : summary === null || summary === void 0 ? void 0 : summary.total) !== null && _ref !== void 0 ? _ref : '0.00';
70
+
71
+ // VenueBooking 场景下不展示 ProductCard 的 like(心形)图标,
72
+ // 通过在 item 层注入 is_hide_like 覆盖 Time 组件的渲染条件
70
73
  var cartProducts = useMemo(function () {
71
74
  return (items || []).map(function (item) {
72
75
  return _objectSpread(_objectSpread({}, item), {}, {
73
- symbol: (item === null || item === void 0 ? void 0 : item.symbol) || symbol
76
+ symbol: (item === null || item === void 0 ? void 0 : item.symbol) || symbol,
77
+ is_hide_like: true
74
78
  });
75
79
  });
76
80
  }, [items, symbol]);
77
81
 
78
- // 根据当前步骤动态选择按钮文案
79
- var confirmOrderText = function () {
80
- if (currentStep === 'select-venue') return String(locales.getText('pisell2.venue.action.next.addons') || '下一步:附加项');
81
- if (currentStep === 'addons') return String(locales.getText('pisell2.venue.action.review.pay') || '确认 & 支付');
82
- return String(locales.getText('pisell2.venue.action.pay.now') || '立即支付');
83
- }();
82
+ // 按钮文案:最后一步显示"立即支付",其余步骤统一显示"下一步"
83
+ var confirmOrderText = currentStep === 'checkout' ? String(locales.getText('pisell2.venue.action.pay.now') || '立即支付') : String(locales.getText('pisell2.venue.action.next') || '下一步');
84
84
 
85
85
  /**
86
86
  * SubTotal 金额明细列表
@@ -43,10 +43,6 @@ export default function Checkout() {
43
43
  var _ref, _viewModel$summary$to, _viewModel$summary2, _viewModel$summary3;
44
44
  return Number((_ref = (_viewModel$summary$to = (_viewModel$summary2 = viewModel.summary) === null || _viewModel$summary2 === void 0 ? void 0 : _viewModel$summary2.total_amount) !== null && _viewModel$summary$to !== void 0 ? _viewModel$summary$to : (_viewModel$summary3 = viewModel.summary) === null || _viewModel$summary3 === void 0 ? void 0 : _viewModel$summary3.expect_amount) !== null && _ref !== void 0 ? _ref : 0);
45
45
  }, [viewModel.summary]);
46
- var taxFee = useMemo(function () {
47
- var _viewModel$summary$ta, _viewModel$summary4;
48
- return Number((_viewModel$summary$ta = (_viewModel$summary4 = viewModel.summary) === null || _viewModel$summary4 === void 0 ? void 0 : _viewModel$summary4.tax_fee) !== null && _viewModel$summary$ta !== void 0 ? _viewModel$summary$ta : 0);
49
- }, [viewModel.summary]);
50
46
 
51
47
  // 场地预订商品:带有时段信息(start_date / end_date)
52
48
  var venueCartItems = useMemo(function () {
@@ -186,18 +182,12 @@ export default function Checkout() {
186
182
  })), /*#__PURE__*/React.createElement("div", {
187
183
  className: "mt-2 text-[15px] text-zinc-500"
188
184
  }, locales.getText('pisell2.venue.checkout.addons.total') || '附加项合计', ": ", symbol, addonTotal.toFixed(2))) : null, /*#__PURE__*/React.createElement("div", {
189
- className: "rounded-[22px] bg-[#faf7f4] p-4 ring-1 ring-black/6"
185
+ className: "rounded-[22px] bg-[#faf7f4] p-4 ring-1 ring-black/6 md:col-span-2"
190
186
  }, /*#__PURE__*/React.createElement("div", {
191
187
  className: "text-sm font-semibold text-[#a69183]"
192
188
  }, locales.getText('pisell2.venue.checkout.subtotal') || '预订小计'), /*#__PURE__*/React.createElement("div", {
193
189
  className: "mt-3 text-[30px] font-extrabold text-zinc-900"
194
- }, symbol, Number.isNaN(bookingSubtotal) ? '0.00' : bookingSubtotal.toFixed(2))), taxFee > 0 ? /*#__PURE__*/React.createElement("div", {
195
- className: "rounded-[22px] bg-[#faf7f4] p-4 ring-1 ring-black/6"
196
- }, /*#__PURE__*/React.createElement("div", {
197
- className: "text-sm font-semibold text-[#a69183]"
198
- }, locales.getText('pisell2.venue.checkout.tax') || '税费'), /*#__PURE__*/React.createElement("div", {
199
- className: "mt-3 text-[15px] font-semibold text-zinc-900"
200
- }, symbol, Number.isNaN(taxFee) ? '0.00' : taxFee.toFixed(2))) : null)), /*#__PURE__*/React.createElement("div", {
190
+ }, symbol, Number.isNaN(bookingSubtotal) ? '0.00' : bookingSubtotal.toFixed(2))))), /*#__PURE__*/React.createElement("div", {
201
191
  className: "space-y-4"
202
192
  }, /*#__PURE__*/React.createElement("div", {
203
193
  className: "rounded-[28px] bg-white p-5 shadow-[0_10px_40px_rgba(20,20,20,0.06)] ring-1 ring-black/6 md:p-6"
@@ -27,8 +27,8 @@ export default function Content() {
27
27
 
28
28
  /**
29
29
  * 动态测量 Step Header 高度并写入 --vb-grid-sticky-top。
30
- * 供 TimeGrid 的 sticky 表头作为 top 偏移,避免被 Step Header 覆盖。
31
- * 宽屏下 Step Header 为 lg:static 不占据吸顶位置,此时写 0。
30
+ * 供 TimeGrid sticky 表头作为 top 偏移,以及 Cart 侧栏 sticky top 计算使用,
31
+ * 保证三者不互相覆盖。
32
32
  */
33
33
  useEffect(function () {
34
34
  var wrap = stepHeaderRef.current;
@@ -37,9 +37,7 @@ export default function Content() {
37
37
  if (!scope) return undefined;
38
38
  function update() {
39
39
  if (!wrap) return;
40
- var isSticky = typeof window !== 'undefined' && window.getComputedStyle(wrap).position === 'sticky';
41
- var value = isSticky ? "".concat(wrap.offsetHeight, "px") : '0px';
42
- scope === null || scope === void 0 || scope.style.setProperty('--vb-grid-sticky-top', value);
40
+ scope === null || scope === void 0 || scope.style.setProperty('--vb-grid-sticky-top', "".concat(wrap.offsetHeight, "px"));
43
41
  }
44
42
  update();
45
43
  var ro = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(update) : null;
@@ -59,13 +57,16 @@ export default function Content() {
59
57
  }
60
58
  }, /*#__PURE__*/React.createElement("div", {
61
59
  ref: stepHeaderRef,
62
- className: "sticky top-0 z-30 lg:static lg:z-auto"
60
+ className: "sticky top-0 z-40"
63
61
  }, /*#__PURE__*/React.createElement(Header, null)), /*#__PURE__*/React.createElement("div", {
64
62
  className: "grid max-w-full gap-2 md:gap-4 lg:grid-cols-[minmax(0,1fr)_390px] xl:grid-cols-[minmax(0,1fr)_420px]"
65
63
  }, /*#__PURE__*/React.createElement("section", {
66
64
  className: "min-w-0 space-y-3 overscroll-none md:space-y-5"
67
65
  }, stepRegistry[currentStep]), /*#__PURE__*/React.createElement("aside", {
68
- className: "hidden lg:block sticky top-6 self-start rounded-[28px] bg-white shadow-[0_10px_40px_rgba(20,20,20,0.06)] ring-1 ring-black/6"
66
+ className: "hidden lg:block sticky self-start z-10 rounded-[28px] bg-white shadow-[0_10px_40px_rgba(20,20,20,0.06)] ring-1 ring-black/6",
67
+ style: {
68
+ top: 'calc(var(--vb-grid-sticky-top, 0px) + 1.5rem)'
69
+ }
69
70
  }, /*#__PURE__*/React.createElement(Cart, {
70
71
  embedded: true,
71
72
  open: true,
@@ -41,15 +41,9 @@ export default function Footer() {
41
41
  return parsedAmount.toFixed(2);
42
42
  }, [viewModel.summary]);
43
43
 
44
- /** 操作按钮文案(根据当前步骤动态变化) */
44
+ /** 操作按钮文案:最后一步显示"立即支付",其余步骤统一显示"下一步" */
45
45
  var actionText = useMemo(function () {
46
- if (currentStep === 'select-venue') {
47
- return String(locales.getText('pisell2.venue.action.next.addons') || '下一步:附加项');
48
- }
49
- if (currentStep === 'addons') {
50
- return String(locales.getText('pisell2.venue.action.review.pay') || '确认 & 支付');
51
- }
52
- return String(locales.getText('pisell2.venue.action.pay.now') || '立即支付');
46
+ return currentStep === 'checkout' ? String(locales.getText('pisell2.venue.action.pay.now') || '立即支付') : String(locales.getText('pisell2.venue.action.next') || '下一步');
53
47
  }, [currentStep]);
54
48
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
55
49
  className: "pisell-venue-booking-footer"
@@ -1,3 +1,13 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
3
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
4
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
6
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
8
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
10
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
1
11
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
12
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
13
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -8,27 +18,13 @@ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
8
18
  * venueBooking 步骤导航头部
9
19
  * 展示三步流程进度条(选场地 → 附加商品 → 结账),支持点击跳转已完成步骤
10
20
  */
11
- import React, { useRef, useState } from 'react';
21
+ import React, { useMemo, useRef, useState } from 'react';
12
22
  import { Modal } from 'antd';
13
23
  import { locales } from '@pisell/utils';
14
24
  import { Iconfont } from '@pisell/materials';
15
25
  import { useVenueBookingContext } from "../../context";
16
-
17
- /** 步骤配置:序号、路由 key、国际化标题 key */
18
- var STEP_ITEMS = [{
19
- n: 1,
20
- key: 'select-venue',
21
- titleKey: 'pisell2.venue.step.select'
22
- }, {
23
- n: 2,
24
- key: 'addons',
25
- titleKey: 'pisell2.venue.step.addons'
26
- }, {
27
- n: 3,
28
- key: 'checkout',
29
- titleKey: 'pisell2.venue.step.checkout'
30
- }];
31
26
  export default function Header() {
27
+ var _viewModel$addonProdu2;
32
28
  var _useVenueBookingConte = useVenueBookingContext(),
33
29
  currentStep = _useVenueBookingConte.currentStep,
34
30
  canNext = _useVenueBookingConte.canNext,
@@ -44,6 +40,31 @@ export default function Header() {
44
40
  confirmOpen = _useState4[0],
45
41
  setConfirmOpen = _useState4[1];
46
42
  var cardRef = useRef(null);
43
+
44
+ /**
45
+ * 步骤配置:当 addonProductList 为空时跳过 addons 步骤,自动重排序号。
46
+ * - 有附加商品:select-venue → addons → checkout(3 步)
47
+ * - 无附加商品:select-venue → checkout(2 步)
48
+ */
49
+ var STEP_ITEMS = useMemo(function () {
50
+ var _viewModel$addonProdu;
51
+ var hasAddons = (((_viewModel$addonProdu = viewModel.addonProductList) === null || _viewModel$addonProdu === void 0 ? void 0 : _viewModel$addonProdu.length) || 0) > 0;
52
+ var base = [{
53
+ key: 'select-venue',
54
+ titleKey: 'pisell2.venue.step.select'
55
+ }].concat(_toConsumableArray(hasAddons ? [{
56
+ key: 'addons',
57
+ titleKey: 'pisell2.venue.step.addons'
58
+ }] : []), [{
59
+ key: 'checkout',
60
+ titleKey: 'pisell2.venue.step.checkout'
61
+ }]);
62
+ return base.map(function (item, idx) {
63
+ return _objectSpread(_objectSpread({}, item), {}, {
64
+ n: idx + 1
65
+ });
66
+ });
67
+ }, [(_viewModel$addonProdu2 = viewModel.addonProductList) === null || _viewModel$addonProdu2 === void 0 ? void 0 : _viewModel$addonProdu2.length]);
47
68
  var currentStepIndex = STEP_ITEMS.findIndex(function (item) {
48
69
  return item.key === currentStep;
49
70
  });
@@ -18,7 +18,7 @@ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e
18
18
  */
19
19
  import React, { useEffect, useMemo, useRef, useCallback } from 'react';
20
20
  import { Iconfont, PisellText } from '@pisell/materials';
21
- import { locales } from '@pisell/utils';
21
+ import { locales, isIos } from '@pisell/utils';
22
22
  import { useVenueBookingContext } from "../../../context";
23
23
  import { isSlotSelected as checkSlotSelected, useVenueBookingSymbol } from "../../../hooks";
24
24
  import { formatHourHeader, isHourBoundary, buildHourGroups, buildSlotPriceInfo, getPriceColor, getSlotTag, getColumnTag, getTimeMetaFromGrid, getResourceCourtMeta, getTableGridStyle, getFirstAvailableSlotIndex, FIRST_COLUMN_WIDTH } from "../../../utils";
@@ -40,6 +40,23 @@ export default function TimeGrid() {
40
40
  var tableGridStyle = useMemo(function () {
41
41
  return getTableGridStyle(timeLabels.length);
42
42
  }, [timeLabels.length]);
43
+
44
+ /**
45
+ * iOS 需要 overscroll-behavior: none 阻止 body 橡皮筋回弹导致的异常;
46
+ * 桌面端保留 Y 方向的 scroll chaining,使鼠标悬停在此区域时仍能上下滚页面。
47
+ */
48
+ var isIosDevice = useMemo(function () {
49
+ if (typeof navigator === 'undefined') return false;
50
+ return isIos();
51
+ }, []);
52
+ var scrollerOverscrollStyle = useMemo(function () {
53
+ return isIosDevice ? {
54
+ overscrollBehavior: 'none'
55
+ } : {
56
+ overscrollBehaviorX: 'none',
57
+ overscrollBehaviorY: 'auto'
58
+ };
59
+ }, [isIosDevice]);
43
60
  var visibleResources = useMemo(function () {
44
61
  return resources.filter(function (resource) {
45
62
  var hitType = filter === 'ALL' || resource.productTitle === filter;
@@ -80,8 +97,11 @@ export default function TimeGrid() {
80
97
  applyHeaderTransform(e.currentTarget.scrollLeft);
81
98
  }
82
99
 
83
- // 切换日期时自动滚动到第一个可用时段(留 1 格前置空间便于用户感知上下文)
100
+ // 切换日期/首次加载完成时自动滚动到第一个可用时段(留 1 格前置空间便于用户感知上下文)。
101
+ // 依赖 isGridLoading:骨架屏阶段真实 table DOM 卸载,ref 为 null;
102
+ // 骨架屏结束时重新触发,此时新 DOM 已挂载且布局完成,scrollWidth 可靠。
84
103
  useEffect(function () {
104
+ if (isGridLoading) return;
85
105
  var scroller = scrollTableRef.current;
86
106
  if (!scroller || !timeLabels.length || !grid) return;
87
107
  var firstAvailableIndex = getFirstAvailableSlotIndex(grid);
@@ -100,7 +120,7 @@ export default function TimeGrid() {
100
120
  });
101
121
  // smooth 滚动不会立即触发 onScroll 到目标值,先手动同步一次避免首帧错位
102
122
  applyHeaderTransform(targetLeft);
103
- }, [grid === null || grid === void 0 ? void 0 : grid.date, timeLabels.length, applyHeaderTransform]);
123
+ }, [grid === null || grid === void 0 ? void 0 : grid.date, timeLabels.length, isGridLoading, applyHeaderTransform]);
104
124
 
105
125
  // 横向拖拽滚动
106
126
  useEffect(function () {
@@ -161,6 +181,31 @@ export default function TimeGrid() {
161
181
  scroller.removeEventListener('pointercancel', endDrag);
162
182
  };
163
183
  }, [applyHeaderTransform]);
184
+
185
+ // overflow-x: auto 会使该容器成为滚动容器,浏览器默认将 wheel 事件优先交给它处理,
186
+ // 导致纵向滚动被静默吞掉、页面无法上下滚动。
187
+ // 此处拦截纵向主导的 wheel 事件,转发给 window,还原正常的页面滚动体验。
188
+ useEffect(function () {
189
+ var scroller = scrollTableRef.current;
190
+ if (!scroller) return undefined;
191
+ function onWheel(e) {
192
+ // 仅纵向滚动意图(deltaY 占主导)才转发给页面;
193
+ // 横向滚动(含 shift+scroll)不干预,由 overflow-x: auto 正常处理。
194
+ if (Math.abs(e.deltaY) > Math.abs(e.deltaX)) {
195
+ e.preventDefault();
196
+ window.scrollBy({
197
+ top: e.deltaY,
198
+ behavior: 'instant'
199
+ });
200
+ }
201
+ }
202
+ scroller.addEventListener('wheel', onWheel, {
203
+ passive: false
204
+ });
205
+ return function () {
206
+ return scroller.removeEventListener('wheel', onWheel);
207
+ };
208
+ }, []);
164
209
  function handleSlotClick(resourceId, slot) {
165
210
  if (dragStateRef.current.moved) {
166
211
  dragStateRef.current.moved = false;
@@ -236,11 +281,10 @@ export default function TimeGrid() {
236
281
  }))), /*#__PURE__*/React.createElement("div", {
237
282
  ref: scrollTableRef,
238
283
  onScroll: syncHeader,
239
- className: "max-w-full overflow-x-auto cursor-grab select-none touch-pan-y overscroll-none active:cursor-grabbing",
240
- style: {
241
- WebkitOverflowScrolling: 'touch',
242
- overscrollBehaviorX: 'none'
243
- }
284
+ className: "max-w-full overflow-x-auto cursor-grab select-none touch-pan-y active:cursor-grabbing",
285
+ style: _objectSpread({
286
+ WebkitOverflowScrolling: 'touch'
287
+ }, scrollerOverscrollStyle)
244
288
  }, /*#__PURE__*/React.createElement("div", {
245
289
  className: "w-full",
246
290
  key: grid.date
@@ -69,10 +69,6 @@ export default function VenueSelection() {
69
69
  onNextWeek: goNextWeek
70
70
  })), /*#__PURE__*/React.createElement(CourtFilter, null)), /*#__PURE__*/React.createElement("div", {
71
71
  ref: tableSectionRef,
72
- className: "w-full max-w-full isolate rounded-[28px] bg-white shadow-[0_10px_40px_rgba(20,20,20,0.06)] ring-1 ring-black/6",
73
- style: {
74
- overflowX: 'clip',
75
- overflowY: 'visible'
76
- }
72
+ className: "w-full max-w-full isolate rounded-[28px] bg-white shadow-[0_10px_40px_rgba(20,20,20,0.06)] ring-1 ring-black/6"
77
73
  }, /*#__PURE__*/React.createElement(TimeGrid, null)));
78
74
  }
@@ -7,10 +7,6 @@ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol"
7
7
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
8
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
9
9
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
10
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
11
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
12
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
13
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
14
10
  function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
15
11
  function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
16
12
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
@@ -27,7 +23,7 @@ import { message } from 'antd';
27
23
  import { locales } from '@pisell/utils';
28
24
  import { usePisellOS } from "../../hooks/useEngineContext";
29
25
  import useEngineContext from "../../hooks/useEngineContext";
30
- import { VENUE_BOOKING_STEPS, VENUE_PRODUCT_IDS, useVenueBookingModule, useVenueBookingLogin, safeRunModuleAction, createVenueBookingViewModel, loadVenueProducts, fetchResourceAvailability, getDateRangeSummary, getTimeSlotGrid, toggleSlotAction, getAllSelectedSlots, getOtherParams } from "./hooks";
26
+ import { VENUE_PRODUCT_IDS, useVenueBookingModule, useVenueBookingLogin, safeRunModuleAction, createVenueBookingViewModel, loadVenueProducts, fetchResourceAvailability, getDateRangeSummary, getTimeSlotGrid, toggleSlotAction, getAllSelectedSlots, getOtherParams } from "./hooks";
31
27
  import { formatDateKey, getWeekDays } from "./utils";
32
28
  var VenueBookingContext = /*#__PURE__*/createContext(undefined);
33
29
 
@@ -43,6 +39,13 @@ var INITIAL_VIEW_MODEL = {
43
39
  addonProductList: []
44
40
  };
45
41
 
42
+ /**
43
+ * 宿主 engineContext.appHelper.utils 缺失时的稳定兜底对象。
44
+ * 必须为模块级常量,避免在 Provider 内用 `|| {}` 字面量导致每次 render 产生新引用,
45
+ * 进而让依赖它的 useCallback / useEffect 反复失效,拖入重渲染循环。
46
+ */
47
+ var EMPTY_UTILS = {};
48
+
46
49
  /**
47
50
  * 计算 anchorDate 所在周的起止日期
48
51
  */
@@ -94,7 +97,7 @@ function findNearestAvailableDate(params) {
94
97
  * 管理步骤导航、场地选择状态、OS 模块集成
95
98
  */
96
99
  export function VenueBookingProvider(_ref) {
97
- var _engineContext$appHel, _viewModel$summary2;
100
+ var _viewModel$addonProdu2, _engineContext$appHel, _viewModel$summary2;
98
101
  var entryContext = _ref.entryContext,
99
102
  children = _ref.children;
100
103
  var pisellOS = usePisellOS();
@@ -105,7 +108,6 @@ export function VenueBookingProvider(_ref) {
105
108
  _useState2 = _slicedToArray(_useState, 2),
106
109
  currentStep = _useState2[0],
107
110
  setCurrentStep = _useState2[1];
108
- var stepList = _toConsumableArray(VENUE_BOOKING_STEPS);
109
111
 
110
112
  // ── 视图模型 ──
111
113
  var _useState3 = useState(INITIAL_VIEW_MODEL),
@@ -113,6 +115,17 @@ export function VenueBookingProvider(_ref) {
113
115
  viewModel = _useState4[0],
114
116
  setViewModel = _useState4[1];
115
117
 
118
+ /**
119
+ * 步骤列表:当 addonProductList 为空时跳过 addons 步骤。
120
+ * - 有附加商品:select-venue → addons → checkout(3 步)
121
+ * - 无附加商品:select-venue → checkout(2 步)
122
+ */
123
+ var stepList = useMemo(function () {
124
+ var _viewModel$addonProdu;
125
+ var hasAddons = (((_viewModel$addonProdu = viewModel.addonProductList) === null || _viewModel$addonProdu === void 0 ? void 0 : _viewModel$addonProdu.length) || 0) > 0;
126
+ return hasAddons ? ['select-venue', 'addons', 'checkout'] : ['select-venue', 'checkout'];
127
+ }, [(_viewModel$addonProdu2 = viewModel.addonProductList) === null || _viewModel$addonProdu2 === void 0 ? void 0 : _viewModel$addonProdu2.length]);
128
+
116
129
  // ── 加载状态 ──
117
130
  var _useState5 = useState(true),
118
131
  _useState6 = _slicedToArray(_useState5, 2),
@@ -165,7 +178,7 @@ export function VenueBookingProvider(_ref) {
165
178
  isLogin = _useVenueBookingLogin.isLogin,
166
179
  openLoginModal = _useVenueBookingLogin.openLoginModal;
167
180
  var engineContext = useEngineContext();
168
- var utils = (engineContext === null || engineContext === void 0 || (_engineContext$appHel = engineContext.appHelper) === null || _engineContext$appHel === void 0 ? void 0 : _engineContext$appHel.utils) || {};
181
+ var utils = (engineContext === null || engineContext === void 0 || (_engineContext$appHel = engineContext.appHelper) === null || _engineContext$appHel === void 0 ? void 0 : _engineContext$appHel.utils) || EMPTY_UTILS;
169
182
 
170
183
  // ── 折扣/优惠券状态 ──
171
184
  var _useState25 = useState([]),
@@ -734,7 +747,24 @@ export function VenueBookingProvider(_ref) {
734
747
  }, _callee10);
735
748
  })), [isLogin, openLoginModal, handleLoginSuccess, submitOrder]);
736
749
 
737
- /** 主操作按钮行为(含登录门禁) */
750
+ /** 跳转到 checkout,并在未登录时插入登录门禁(参照 scanOrder gotoCheckOrder) */
751
+ var proceedToCheckout = useCallback(function () {
752
+ if (!isLogin) {
753
+ openLoginModal({
754
+ callback: function callback(status) {
755
+ if (status === 'success') {
756
+ handleLoginSuccess().then(function () {
757
+ return goToStep('checkout');
758
+ });
759
+ }
760
+ }
761
+ });
762
+ return;
763
+ }
764
+ goToStep('checkout');
765
+ }, [isLogin, openLoginModal, handleLoginSuccess, goToStep]);
766
+
767
+ /** 主操作按钮行为(含登录门禁,自适应 2/3 步流程) */
738
768
  var handlePrimaryAction = useCallback(function () {
739
769
  var _viewModel$summary3, _deposit$deposit_poli;
740
770
  if (currentStep === 'select-venue') {
@@ -745,24 +775,16 @@ export function VenueBookingProvider(_ref) {
745
775
  });
746
776
  return;
747
777
  }
778
+ // 2 步模式:select-venue 直接进 checkout(带登录门禁);3 步模式:先去 addons
779
+ if (stepList[1] === 'checkout') {
780
+ proceedToCheckout();
781
+ return;
782
+ }
748
783
  goToStep('addons');
749
784
  return;
750
785
  }
751
- // addons -> checkout:插入登录门禁(参照 scanOrder gotoCheckOrder)
752
786
  if (currentStep === 'addons') {
753
- if (!isLogin) {
754
- openLoginModal({
755
- callback: function callback(status) {
756
- if (status === 'success') {
757
- handleLoginSuccess().then(function () {
758
- return goToStep('checkout');
759
- });
760
- }
761
- }
762
- });
763
- return;
764
- }
765
- goToStep('checkout');
787
+ proceedToCheckout();
766
788
  return;
767
789
  }
768
790
  // checkout -> 支付:有定金协议时必须已勾选,否则 Toast 提示
@@ -772,7 +794,7 @@ export function VenueBookingProvider(_ref) {
772
794
  return;
773
795
  }
774
796
  void handleSubmitOrder();
775
- }, [currentStep, canNext, isLogin, isAgreeDepositPolicy, viewModel.summary, goToStep, openLoginModal, handleLoginSuccess, handleSubmitOrder]);
797
+ }, [currentStep, canNext, isAgreeDepositPolicy, viewModel.summary, stepList, proceedToCheckout, goToStep, handleSubmitOrder]);
776
798
 
777
799
  // ── 监听全局登录成功事件(Voucher 区域内登录等场景) ──
778
800
  useEffect(function () {
@@ -5,6 +5,7 @@ export declare const VENUE_BOOKING_STEPS: readonly ["select-venue", "addons", "c
5
5
  export declare const VENUE_PRODUCT_IDS: number[];
6
6
  /**
7
7
  * 获取 PisellOS venueBooking 业务模块
8
+ * 使用 useRef 稳定模块引用,防止 getModule 返回值每次渲染变化时触发 bootstrap useEffect 重跑
8
9
  */
9
10
  export declare function useVenueBookingModule(): any;
10
11
  /** 统一获取货币前缀(优先引擎配置,兜底 '$') */