@pisell/private-materials 6.12.470 → 6.12.471

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 (81) 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/preview.js +1 -1
  6. package/build/lowcode/render/default/view.js +3 -3
  7. package/build/lowcode/view.js +3 -3
  8. package/es/components/bigSale/components/BookingFloatingPanel/useBookingPanelController.js +1 -0
  9. package/es/components/bigSale/components/ProductList/index.js +1 -0
  10. package/es/components/bigSale/components/TimeBar/index.js +1 -0
  11. package/es/components/bigSale/dialog.js +1 -0
  12. package/es/components/bigSale/hooks/useBigSaleContext.js +1 -0
  13. package/es/components/bigSale/hooks/useSelectFloorMapResourceForBigSale.js +1 -0
  14. package/es/components/bigSale/index.js +1 -0
  15. package/es/components/bigSale/templates/Kiosk/index.js +8 -2
  16. package/es/components/bigSale/templates/Kiosk/payment/index.js +16 -6
  17. package/es/components/bigSale/templates/Kiosk/payment/useKioskScreenProtection.js +13 -8
  18. package/es/components/kiosk/README.md +3 -2
  19. package/es/components/kiosk/components/BottomBar/index.d.ts +1 -1
  20. package/es/components/kiosk/components/BottomBar/index.js +3 -2
  21. package/es/components/kiosk/components/BottomBar/useKioskBarLayout.js +4 -6
  22. package/es/components/kiosk/components/Shell/KioskBottomBarHost.js +10 -5
  23. package/es/components/kiosk/components/Shell/index.d.ts +3 -0
  24. package/es/components/kiosk/components/Shell/index.js +3 -2
  25. package/es/components/kiosk/components/Shell/useKioskMemberAction.js +1 -0
  26. package/es/components/kiosk/sales/KioskSaleSession.js +16 -6
  27. package/es/components/kiosk/sales/contracts.d.ts +1 -0
  28. package/es/components/kiosk/sales/shopping/ShoppingOrderBar.js +3 -3
  29. package/es/components/kiosk/sales/shopping/ShoppingScreen.js +1 -2
  30. package/es/components/kiosk/sales/shopping/types.d.ts +0 -3
  31. package/es/components/kiosk/sales/useCheckout.js +1 -0
  32. package/es/components/kiosk/sales/useSaleSessionExit.js +1 -0
  33. package/es/components/kiosk/slices/payment/PaymentContent.js +5 -4
  34. package/es/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.js +1 -0
  35. package/es/components/vendingMachine/README.md +1 -1
  36. package/es/components/venueBookingSales/checkout/VenueBookingHolderStep.js +1 -0
  37. package/es/components/venueBookingSales/checkout/useVenueBookingCheckout.js +1 -0
  38. package/es/components/venueBookingSales/checkout/useVenueCustomerAccess.js +1 -0
  39. package/es/components/venueBookingSales/checkout/useVenueKioskCheckout.js +1 -0
  40. package/es/components/venueBookingSales/extras/VenueExtraDetailModal.js +1 -0
  41. package/es/components/venueBookingSales/useVenueBookingSession.js +1 -0
  42. package/es/index.js +2 -0
  43. package/es/plus/multiCurrencySettlement/index.js +1 -1
  44. package/es/plus/pisellReservation/data/bookingToReservationTables.js +1 -1
  45. package/es/plus/pisellReservation/floorMap/floorPlanApi.js +1 -1
  46. package/es/plus/pisellReservation/floorMap/reservationMock.js +1 -1
  47. package/es/plus/pisellReservation/index.js +17 -0
  48. package/es/plus/saleDetail/Base.js +1 -0
  49. package/es/plus/saleDetail/components/Client/hooks/useClientSelectorProps.js +1 -0
  50. package/es/plus/saleDetail/components/DetailActions/PrintAction.js +1 -0
  51. package/es/plus/saleDetail/components/DetailActions/index.js +1 -0
  52. package/es/plus/saleDetail/components/SummaryFinancialSections/index.js +1 -0
  53. package/es/plus/saleDetail/index.js +1 -0
  54. package/es/plus/saleDetail/tmpl/B/components/Dish/index.js +1 -0
  55. package/es/plus/saleDetail/tmpl/B/index.js +1 -0
  56. package/es/plus/salesSdk/index.js +54 -0
  57. package/es/plus/salesSdk/utils/addProductWithFlowDebounced.js +1 -1
  58. package/es/plus/salesSdk/utils/bookingDate.js +1 -1
  59. package/es/plus/salesSdk/utils/enrichCartLineHolderDisplay.js +1 -1
  60. package/es/pro/Login2.0/AuthModal.d.ts +1 -1
  61. package/es/pro/Login2.0/index.d.ts +2 -2
  62. package/es/pro/Login2.0/shared/types.d.ts +1 -1
  63. package/lib/components/bigSale/templates/Kiosk/index.js +7 -2
  64. package/lib/components/bigSale/templates/Kiosk/payment/index.js +16 -6
  65. package/lib/components/bigSale/templates/Kiosk/payment/useKioskScreenProtection.js +13 -8
  66. package/lib/components/kiosk/README.md +3 -2
  67. package/lib/components/kiosk/components/BottomBar/index.d.ts +1 -1
  68. package/lib/components/kiosk/components/BottomBar/index.js +3 -2
  69. package/lib/components/kiosk/components/BottomBar/useKioskBarLayout.js +4 -6
  70. package/lib/components/kiosk/components/Shell/KioskBottomBarHost.js +10 -5
  71. package/lib/components/kiosk/components/Shell/index.d.ts +3 -0
  72. package/lib/components/kiosk/components/Shell/index.js +3 -2
  73. package/lib/components/kiosk/sales/KioskSaleSession.js +15 -6
  74. package/lib/components/kiosk/sales/contracts.d.ts +1 -0
  75. package/lib/components/kiosk/sales/shopping/ShoppingOrderBar.js +3 -3
  76. package/lib/components/kiosk/sales/shopping/ShoppingScreen.js +1 -2
  77. package/lib/components/kiosk/sales/shopping/types.d.ts +0 -3
  78. package/lib/components/kiosk/slices/payment/PaymentContent.js +4 -3
  79. package/lib/components/vendingMachine/README.md +1 -1
  80. package/package.json +4 -4
  81. package/es/private-materials/lowcode/authmodal/meta.d.ts +0 -1
@@ -1,5 +1,6 @@
1
1
  import useEngineContext from "../../../../hooks/useEngineContext.js";
2
2
  import { subscribeBookingDateChange } from "../../../../plus/salesSdk/utils/bookingDate.js";
3
+ import "../../../../plus/salesSdk/index.js";
3
4
  import dayjs from "dayjs";
4
5
  import { useCallback, useEffect, useState } from "react";
5
6
  //#region src/components/bigSale/components/BookingFloatingPanel/useBookingPanelController.ts
@@ -20,6 +20,7 @@ import { showAddToCartToast } from "../../../../plus/salesSdk/components/showAdd
20
20
  import { mergeBookingsForDisplay } from "../../../../plus/salesSdk/utils/mergeBookingsForDisplay.js";
21
21
  import useSalesSdkGlobalScanHandler from "../../../../plus/salesSdk/hooks/useSalesSdkGlobalScanHandler.js";
22
22
  import { useSalesSdkGlobalScanActivity } from "../../../../plus/salesSdk/context/SalesSdkGlobalScanActivityContext.js";
23
+ import "../../../../plus/salesSdk/index.js";
23
24
  import { buildBigSaleProductListPreferencesKey, readBigSaleProductListPreferences, readStoredBigSaleProductListPreferences, removeBigSaleProductListPreferences, resolveBigSaleAutoProductListPreferences, writeBigSaleProductListPreferences } from "../../utils/productListPreferences.js";
24
25
  import { resolveBigSaleProductDisplayConfig, useBigSaleProductListConfig } from "../../hooks/useBigSaleProductListConfig.js";
25
26
  import locales_default$1 from "../../locales/index.js";
@@ -5,6 +5,7 @@ import useInitLocalesOnce from "../../../../hooks/useInitLocalesOnce.js";
5
5
  import { subscribeBookingDateChange } from "../../../../plus/salesSdk/utils/bookingDate.js";
6
6
  import { setBookingTimeSelectionIntent } from "../../../../plus/salesSdk/utils/bookingTimeSelection.js";
7
7
  import { useSalesSdkBookingContext } from "../../../../plus/salesSdk/context/SalesSdkBookingContext.js";
8
+ import "../../../../plus/salesSdk/index.js";
8
9
  import locales_default from "../../locales/index.js";
9
10
  import { getPosWeekStartsOn, resolvePosCountryCode } from "../../../../utils/posDateLocale.js";
10
11
  import dayjs from "dayjs";
@@ -6,6 +6,7 @@ import { buildInitBookingContextParams, collectBookingIdsFromTempOrder } from ".
6
6
  import { useSalesSdk } from "../../plus/salesSdk/hooks/useSalesSdk.js";
7
7
  import { useSalesSdkCart } from "../../plus/salesSdk/hooks/useSalesSdkCart.js";
8
8
  import { SalesSdkPrepareOrderSwitchContext, SalesSdkRootRefreshContext } from "../../plus/salesSdk/context/SalesSdkProvider.js";
9
+ import "../../plus/salesSdk/index.js";
9
10
  import { isPersistedBigSaleOrderId } from "./utils/orderIdentity.js";
10
11
  import { seedDineInReservationToCart } from "../../plus/pisellReservation/utils/seedDineInReservationToCart.js";
11
12
  import BigSale from "./index.js";
@@ -4,6 +4,7 @@ import { useSalesSdkCustomer } from "../../../plus/salesSdk/hooks/useSalesSdkCus
4
4
  import { useSalesSdkBookingContext } from "../../../plus/salesSdk/context/SalesSdkBookingContext.js";
5
5
  import { useSalesSdkSummary } from "../../../plus/salesSdk/hooks/useSalesSdkSummary.js";
6
6
  import { useSalesSdkProducts } from "../../../plus/salesSdk/hooks/useSalesSdkProducts.js";
7
+ import "../../../plus/salesSdk/index.js";
7
8
  import { useMemo } from "react";
8
9
  //#region src/components/bigSale/hooks/useBigSaleContext.ts
9
10
  /**
@@ -3,6 +3,7 @@ import { _asyncToGenerator } from "../../../_virtual/_@oxc-project_runtime@0.122
3
3
  import { buildInitBookingContextParams, collectBookingIdsFromTempOrder } from "../../../plus/salesSdk/utils/buildDefaultLoadProductsParams.js";
4
4
  import { useSalesSdkUIHosts } from "../../../plus/salesSdk/context/SalesSdkUIHostsContext.js";
5
5
  import { SalesSdkRootRefreshContext } from "../../../plus/salesSdk/context/SalesSdkProvider.js";
6
+ import "../../../plus/salesSdk/index.js";
6
7
  import { isPersistedBigSaleOrderId } from "../utils/orderIdentity.js";
7
8
  import { resolveOrderIdForHostActions } from "../../../plus/pisellReservation/components/bookingDetailModal/bookingDetailHostActions.js";
8
9
  import { usePicoCodingOpenData } from "../../../plus/pisellReservation/hooks/usePicoCodingOpenData.js";
@@ -8,6 +8,7 @@ import { useSalesSdk } from "../../plus/salesSdk/hooks/useSalesSdk.js";
8
8
  import { useSalesSdkCustomer } from "../../plus/salesSdk/hooks/useSalesSdkCustomer.js";
9
9
  import { SalesSdkProvider } from "../../plus/salesSdk/context/SalesSdkProvider.js";
10
10
  import { SalesSdkBookingContextProvider } from "../../plus/salesSdk/context/SalesSdkBookingContext.js";
11
+ import "../../plus/salesSdk/index.js";
11
12
  import { resolveCustomerDetailAppearance } from "../../pro/skuDetailModal/customerDetailPolicy.js";
12
13
  import { resolveKioskPlatformSource, resolveKioskPresentation } from "../kioskSale/resolveKioskPresentation.js";
13
14
  import { isVenueKioskRuntime } from "../venueBookingSales/kiosk/customer.js";
@@ -14,6 +14,7 @@ import { useSalesSdkBusinessAvailability } from "../../../../plus/salesSdk/conte
14
14
  import { collectUnassignedHolderLines } from "../../../../plus/salesSdk/utils/holderSubmitValidation.js";
15
15
  import { isFulfillmentTimingBooking } from "../../../../plus/salesSdk/utils/fulfillmentTimingBooking.js";
16
16
  import { useSalesSdkGlobalScanActivity } from "../../../../plus/salesSdk/context/SalesSdkGlobalScanActivityContext.js";
17
+ import "../../../../plus/salesSdk/index.js";
17
18
  import { usePickSaleDetailContext } from "../../hooks/usePickSaleDetailContext.js";
18
19
  import { resolveBigSaleAutoProductListPreferences } from "../../utils/productListPreferences.js";
19
20
  import { resolveBigSaleProductDisplayConfig } from "../../hooks/useBigSaleProductListConfig.js";
@@ -332,7 +333,7 @@ function KioskBigSaleTemplate({ isActive = true, catalogPreparation, osKey, prod
332
333
  isReturningToAdvertisement,
333
334
  view
334
335
  ]);
335
- const protectScreen = useKioskScreenProtection(app, onPaymentPageActiveChange, isActive && view === "payment" && platform !== "kiosk");
336
+ const protectScreen = useKioskScreenProtection(app, onPaymentPageActiveChange, false);
336
337
  useEffect(() => {
337
338
  const bookingTicket = context.sales.bookingTicket;
338
339
  if (!bookingTicket || context.sales.status !== "ready" || !context.sales.tempOrder) return;
@@ -1238,7 +1239,12 @@ function KioskBigSaleTemplate({ isActive = true, catalogPreparation, osKey, prod
1238
1239
  context,
1239
1240
  checkoutPreparation: paymentPreparation,
1240
1241
  channel: platform,
1241
- protectPayment: isActive && platform === "kiosk" ? protectScreen : void 0,
1242
+ protectPayment: isActive ? protectScreen : void 0,
1243
+ onHostHome: isActive && onRequestHome ? () => {
1244
+ if (!paymentPageSessionRef.current || paymentPageSessionRef.current.completed) return;
1245
+ closePaymentPage();
1246
+ handleReturnToAdvertisement();
1247
+ } : void 0,
1242
1248
  onBack: () => {
1243
1249
  var _paymentPageSessionRe3, _paymentPageSessionRe4;
1244
1250
  const returnView = (_paymentPageSessionRe3 = (_paymentPageSessionRe4 = paymentPageSessionRef.current) === null || _paymentPageSessionRe4 === void 0 ? void 0 : _paymentPageSessionRe4.returnView) !== null && _paymentPageSessionRe3 !== void 0 ? _paymentPageSessionRe3 : "cart";
@@ -45,8 +45,8 @@ const paymentPageLocales = Object.entries(locales_default).reduce((result, [key,
45
45
  return result;
46
46
  }, {});
47
47
  /** Owns this Kiosk screen only; the existing POS PaymentModal is never mounted. */
48
- function KioskPaymentPage({ context, checkoutPreparation, channel, active = true, paymentPolicy, loadingFallback, onDisposed, protectPayment, onBack, onPaid }) {
49
- var _baseSales$getTempOrd, _utils$getApp, _utils$getApp$getLoca, _utils$storage, _utils$storage$get;
48
+ function KioskPaymentPage({ context, checkoutPreparation, channel, active = true, paymentPolicy, loadingFallback, onDisposed, protectPayment, onBack, onHostHome, onPaid }) {
49
+ var _utils$getApp, _baseSales$getTempOrd, _utils$getApp2, _utils$getApp2$getLoc, _utils$storage, _utils$storage$get;
50
50
  const utils = useEngineContext().appHelper.utils;
51
51
  const baseSales = context.sales.bookingTicket;
52
52
  const readAmount = (paymentPolicy === null || paymentPolicy === void 0 ? void 0 : paymentPolicy.readAmount) || readPaymentAmount;
@@ -61,7 +61,17 @@ function KioskPaymentPage({ context, checkoutPreparation, channel, active = true
61
61
  activeRef.current = active;
62
62
  const stateRef = useRef(hasUnresolvedDevicePayment(baseSales) ? "uncertain" : "idle");
63
63
  const [state, setState] = useState(stateRef.current);
64
- const attemptEvents = usePaymentAttemptProtection(state, protectPayment);
64
+ const retryPending = useRef(false);
65
+ const attemptEvents = usePaymentAttemptProtection(state, protectPayment, retryPending);
66
+ const history = onHostHome ? (_utils$getApp = utils.getApp) === null || _utils$getApp === void 0 || (_utils$getApp = _utils$getApp.call(utils)) === null || _utils$getApp === void 0 || (_utils$getApp = _utils$getApp.history) === null || _utils$getApp === void 0 ? void 0 : _utils$getApp.instance : void 0;
67
+ const handleNavigation = useMemoizedFn(({ pathname }) => {
68
+ if (pathname !== "/") return;
69
+ if (stateRef.current === "idle" || stateRef.current === "paying" && retryPending.current) onHostHome === null || onHostHome === void 0 || onHostHome();
70
+ });
71
+ useEffect(() => {
72
+ var _history$listen;
73
+ return history === null || history === void 0 || (_history$listen = history.listen) === null || _history$listen === void 0 ? void 0 : _history$listen.call(history, handleNavigation);
74
+ }, [history, handleNavigation]);
65
75
  const [methods, setMethods] = useState([]);
66
76
  const [ready, setReady] = useState(false);
67
77
  const [optionsError, setOptionsError] = useState();
@@ -107,7 +117,7 @@ function KioskPaymentPage({ context, checkoutPreparation, channel, active = true
107
117
  Promise.resolve((_disposalCallbackRef$ = disposalCallbackRef.current) === null || _disposalCallbackRef$ === void 0 ? void 0 : _disposalCallbackRef$.call(disposalCallbackRef)).catch(() => {});
108
118
  } catch (_unused2) {}
109
119
  });
110
- useInitLocalesOnce(paymentPageLocales, ((_utils$getApp = utils.getApp) === null || _utils$getApp === void 0 || (_utils$getApp = _utils$getApp.call(utils)) === null || _utils$getApp === void 0 || (_utils$getApp = _utils$getApp.locales) === null || _utils$getApp === void 0 || (_utils$getApp$getLoca = _utils$getApp.getLocale) === null || _utils$getApp$getLoca === void 0 ? void 0 : _utils$getApp$getLoca.call(_utils$getApp)) || ((_utils$storage = utils.storage) === null || _utils$storage === void 0 || (_utils$storage$get = _utils$storage.get) === null || _utils$storage$get === void 0 ? void 0 : _utils$storage$get.call(_utils$storage, "umi_locale")) || "en");
120
+ useInitLocalesOnce(paymentPageLocales, ((_utils$getApp2 = utils.getApp) === null || _utils$getApp2 === void 0 || (_utils$getApp2 = _utils$getApp2.call(utils)) === null || _utils$getApp2 === void 0 || (_utils$getApp2 = _utils$getApp2.locales) === null || _utils$getApp2 === void 0 || (_utils$getApp2$getLoc = _utils$getApp2.getLocale) === null || _utils$getApp2$getLoc === void 0 ? void 0 : _utils$getApp2$getLoc.call(_utils$getApp2)) || ((_utils$storage = utils.storage) === null || _utils$storage === void 0 || (_utils$storage$get = _utils$storage.get) === null || _utils$storage$get === void 0 ? void 0 : _utils$storage$get.call(_utils$storage, "umi_locale")) || "en");
111
121
  useEffect(() => {
112
122
  mountedRef.current = true;
113
123
  return () => {
@@ -374,9 +384,9 @@ function KioskPaymentPage({ context, checkoutPreparation, channel, active = true
374
384
  return release;
375
385
  });
376
386
  useEffect(() => {
377
- var _utils$getApp2, _app$applicationManag, _app$applicationManag2;
387
+ var _utils$getApp3, _app$applicationManag, _app$applicationManag2;
378
388
  if (normalizedChannel !== "kiosk") return;
379
- const app = ((_utils$getApp2 = utils.getApp) === null || _utils$getApp2 === void 0 ? void 0 : _utils$getApp2.call(utils)) || window.app;
389
+ const app = ((_utils$getApp3 = utils.getApp) === null || _utils$getApp3 === void 0 ? void 0 : _utils$getApp3.call(utils)) || window.app;
380
390
  const globalApp = app === null || app === void 0 || (_app$applicationManag = app.applicationManager) === null || _app$applicationManag === void 0 || (_app$applicationManag2 = _app$applicationManag.get) === null || _app$applicationManag2 === void 0 ? void 0 : _app$applicationManag2.call(_app$applicationManag, "global");
381
391
  let cleanup;
382
392
  try {
@@ -1,7 +1,6 @@
1
1
  import { useCallback, useLayoutEffect, useState } from "react";
2
2
  //#region src/components/bigSale/templates/Kiosk/payment/useKioskScreenProtection.ts
3
- /** Device workflows can protect a whole step. Ordinary Kiosk acquires the same
4
- * protection only while its payment page is processing a payment. */
3
+ /** Payment attempts and protected device steps (such as dispensing) share the host timer. */
5
4
  function useKioskScreenProtection(app, onActiveChange, protectWholeStep) {
6
5
  const protect = useCallback(() => {
7
6
  var _app$getPlugin, _app$history, _app$history$block;
@@ -28,16 +27,22 @@ function useKioskScreenProtection(app, onActiveChange, protectWholeStep) {
28
27
  }, [protectWholeStep, protect]);
29
28
  return protect;
30
29
  }
31
- function usePaymentAttemptProtection(state, protect) {
32
- const [waitingForRetry, setWaitingForRetry] = useState(false);
33
- const processing = state === "paying" || state === "authorizing" || state === "cancelling";
30
+ function usePaymentAttemptProtection(state, protect, retryPending) {
31
+ const [waitingForRetry, setRetryState] = useState(false);
32
+ const setWaitingForRetry = useCallback((waiting) => {
33
+ if (retryPending) retryPending.current = waiting;
34
+ setRetryState(waiting);
35
+ }, [retryPending]);
36
+ const processing = state === "paying" || state === "authorizing" || state === "cancelling" || state === "complete";
37
+ const awaitingRetry = state === "paying" && waitingForRetry;
34
38
  useLayoutEffect(() => {
35
39
  if (!processing) setWaitingForRetry(false);
36
- else if (!waitingForRetry) return protect === null || protect === void 0 ? void 0 : protect();
40
+ else if (!awaitingRetry) return protect === null || protect === void 0 ? void 0 : protect();
37
41
  }, [
38
42
  processing,
39
- waitingForRetry,
40
- protect
43
+ awaitingRetry,
44
+ protect,
45
+ setWaitingForRetry
41
46
  ]);
42
47
  return protect && {
43
48
  onAttemptStarted: () => setWaitingForRetry(false),
@@ -181,7 +181,7 @@ kiosk/
181
181
  ## 组件尺寸开关
182
182
 
183
183
  具有宽度相关尺寸调整的组件使用同名属性 `enableResponsiveScaling?: boolean`,默认 `false`。
184
- 每个组件只控制自己的尺寸,不从 SelfServiceKiosk、BigSale、父组件或全局 Context 继承。
184
+ 各组件独立控制尺寸。Retail vending 的 Catalog、购物车和支付页共用宿主传入的 `shoppingBottomBarProps`。
185
185
  关闭时采用原有规则在 **1080 CSS px** 下的计算值,保留 `clamp()` 上下限;开启时沿用原来的视口/容器宽度规则。
186
186
  普通容器填充、换行、滚动、安全区和弹窗边界限制始终保留。窄窗口下固定尺寸不会自动缩小。
187
187
 
@@ -189,7 +189,7 @@ kiosk/
189
189
  | --- | --- | --- |
190
190
  | `CatalogProductCard` | 商品名称、价格、促销字号、数量控件、卡片最小高度 | 组件 prop;在 `ProductCatalog` 中由 `getCardProps(product)` 返回该属性 |
191
191
  | `KioskCategorySidebar` | 分类侧栏宽度 | 组件 prop;组合目录通过 `categorySidebarProps` 透传 |
192
- | `KioskBottomBar` | 底栏字体、按钮、图标、间距及外壳底部偏移 | 组件 prop,或 `useKioskBottomBar` 声明中的同名字段;`KioskSliceBottomBar` 同样支持 |
192
+ | `KioskBottomBar` | 底栏字体、按钮、图标、间距及外壳底部偏移 | 同时设置 `enableResponsiveScaling` 和 `compactScale`(大于 0 且不超过 1)时启用,省略比例时使用固定尺寸 |
193
193
  | `KioskDialog` | 弹窗媒体查询中的字体、图标、内边距和按钮尺寸 | 组件 prop,模式直接设置在 Portal 根节点 |
194
194
  | 删除商品确认框 | 确认面板内边距 | `getOrderActionDialogProps({ enableResponsiveScaling: true })`;原 `orderActionDialogProps` 为固定模式 |
195
195
  | `IdleScreen` | 欢迎页文字和间距的容器断点 | 组件 prop |
@@ -207,6 +207,7 @@ kiosk/
207
207
  useKioskBottomBar({
208
208
  ariaLabel: 'Order actions',
209
209
  enableResponsiveScaling: true,
210
+ compactScale: 0.975,
210
211
  trailing: <button onClick={checkout}>Checkout</button>,
211
212
  });
212
213
 
@@ -2,7 +2,7 @@ import { ResponsiveScalingProps } from "../responsiveScaling.js";
2
2
  import React from "react";
3
3
  //#region src/components/kiosk/components/BottomBar/index.d.ts
4
4
  interface KioskBottomBarScalingProps extends ResponsiveScalingProps {
5
- /** Scale at a container width of 1024px, in (0, 1]. Defaults to 0.8. */
5
+ /** Scale at a container width of 1024px, in (0, 1]. Omit to keep the bar at its fixed size. */
6
6
  compactScale?: number;
7
7
  }
8
8
  interface KioskBottomBarProps extends KioskBottomBarScalingProps {
@@ -15,12 +15,13 @@ function KioskBackButton(_ref) {
15
15
  return /* @__PURE__ */ React.createElement("button", _objectSpread2({ type: "button" }, props), /* @__PURE__ */ React.createElement(ArrowLeftOutlined, { "aria-hidden": "true" }), /* @__PURE__ */ React.createElement("span", null, children));
16
16
  }
17
17
  function KioskBottomBar({ ariaLabel, leading, summary, trailing, enableResponsiveScaling = false, compactScale }) {
18
- const barRef = useKioskBarLayout(enableResponsiveScaling, compactScale);
18
+ const scale = enableResponsiveScaling && compactScale !== void 0 && compactScale > 0 && compactScale <= 1 ? compactScale : void 0;
19
+ const barRef = useKioskBarLayout(scale);
19
20
  return /* @__PURE__ */ React.createElement("footer", {
20
21
  ref: barRef,
21
22
  className: "pisell-kiosk-bottom-bar",
22
23
  "aria-label": ariaLabel,
23
- "data-responsive-scaling": enableResponsiveScaling
24
+ "data-responsive-scaling": scale !== void 0
24
25
  }, hasBottomBarContent(leading) && /* @__PURE__ */ React.createElement("div", { className: "pisell-kiosk-bottom-bar__leading" }, leading), hasBottomBarContent(summary) && /* @__PURE__ */ React.createElement("div", { className: "pisell-kiosk-bottom-bar__summary" }, summary), hasBottomBarContent(trailing) && /* @__PURE__ */ React.createElement("div", { className: "pisell-kiosk-bottom-bar__trailing" }, trailing));
25
26
  }
26
27
  //#endregion
@@ -1,8 +1,7 @@
1
1
  import { useLayoutEffect, useRef } from "react";
2
2
  //#region src/components/kiosk/components/BottomBar/useKioskBarLayout.ts
3
3
  const compactWidth = 1024;
4
- const defaultCompactScale = .8;
5
- function useKioskBarLayout(enableResponsiveScaling = false, compactScale = defaultCompactScale) {
4
+ function useKioskBarLayout(compactScale) {
6
5
  const barRef = useRef(null);
7
6
  useLayoutEffect(() => {
8
7
  const bar = barRef.current;
@@ -19,11 +18,10 @@ function useKioskBarLayout(enableResponsiveScaling = false, compactScale = defau
19
18
  else target.style.removeProperty(property);
20
19
  });
21
20
  setUnit(1);
22
- if (!enableResponsiveScaling || !container) return restore;
23
- const scale = compactScale > 0 && compactScale <= 1 ? compactScale : defaultCompactScale;
21
+ if (compactScale === void 0 || !container) return restore;
24
22
  const resize = (width) => {
25
23
  if (width <= 0) return;
26
- setUnit(width <= compactWidth ? scale * width / compactWidth : 1);
24
+ setUnit(width <= compactWidth ? compactScale * width / compactWidth : 1);
27
25
  };
28
26
  const measure = () => {
29
27
  const style = window.getComputedStyle(container);
@@ -41,7 +39,7 @@ function useKioskBarLayout(enableResponsiveScaling = false, compactScale = defau
41
39
  if (!observer) window.removeEventListener("resize", measure);
42
40
  restore();
43
41
  };
44
- }, [enableResponsiveScaling, compactScale]);
42
+ }, [compactScale]);
45
43
  return barRef;
46
44
  }
47
45
  //#endregion
@@ -1,9 +1,10 @@
1
+ import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
1
2
  import { KioskBottomBar, hasBottomBarContent } from "../BottomBar/index.js";
2
3
  import React, { createContext, useContext, useId, useLayoutEffect, useMemo, useState } from "react";
3
4
  import { createPortal } from "react-dom";
4
5
  //#region src/components/kiosk/components/Shell/KioskBottomBarHost.tsx
5
6
  const RegistrationContext = createContext(null);
6
- const DockContext = createContext(null);
7
+ const DockContext = createContext({ dock: null });
7
8
  const SurfaceContext = createContext("page");
8
9
  /** A retained background screen keeps its state while the foreground owns the dock. */
9
10
  function KioskBottomBarScope({ active, overlay, children }) {
@@ -46,7 +47,7 @@ function hasSlots({ leading, summary, trailing }) {
46
47
  ].some(hasBottomBarContent);
47
48
  }
48
49
  function DockedBar(props) {
49
- const dock = useContext(DockContext);
50
+ const { dock, bottomBarProps } = useContext(DockContext);
50
51
  useLayoutEffect(() => {
51
52
  const shell = dock === null || dock === void 0 ? void 0 : dock.parentElement;
52
53
  if (!dock || !shell) return;
@@ -75,7 +76,7 @@ function DockedBar(props) {
75
76
  shell.style.removeProperty("--pisell-kiosk-footer-clearance");
76
77
  };
77
78
  }, [dock]);
78
- return /* @__PURE__ */ React.createElement(KioskBottomBar, props);
79
+ return /* @__PURE__ */ React.createElement(KioskBottomBar, _objectSpread2(_objectSpread2({}, bottomBarProps), props));
79
80
  }
80
81
  /** Register the active screen's slots with the shell. Pass null to release its bar. */
81
82
  function useKioskBottomBar(declaration) {
@@ -88,10 +89,14 @@ function KioskSliceBottomBar(props) {
88
89
  useRegisterBottomBar(hasSlots(props) ? outlet : null);
89
90
  return target ? createPortal(/* @__PURE__ */ React.createElement(DockedBar, props), target) : null;
90
91
  }
91
- function KioskBottomBarHost({ children }) {
92
+ function KioskBottomBarHost({ children, bottomBarProps }) {
92
93
  const [active, setBar] = useState(null);
93
94
  const [dock, setDock] = useState(null);
94
- return /* @__PURE__ */ React.createElement(RegistrationContext.Provider, { value: setBar }, /* @__PURE__ */ React.createElement(DockContext.Provider, { value: dock }, children, /* @__PURE__ */ React.createElement("div", {
95
+ const dockContext = useMemo(() => ({
96
+ dock,
97
+ bottomBarProps
98
+ }), [dock, bottomBarProps]);
99
+ return /* @__PURE__ */ React.createElement(RegistrationContext.Provider, { value: setBar }, /* @__PURE__ */ React.createElement(DockContext.Provider, { value: dockContext }, children, /* @__PURE__ */ React.createElement("div", {
95
100
  className: "pisell-kiosk-shell__footer",
96
101
  ref: setDock,
97
102
  "data-surface": active === null || active === void 0 ? void 0 : active.surface
@@ -1,8 +1,10 @@
1
+ import { KioskBottomBarScalingProps } from "../BottomBar/index.js";
1
2
  import React from "react";
2
3
  //#region src/components/kiosk/components/Shell/index.d.ts
3
4
  type Props = React.HTMLAttributes<HTMLElement> & {
4
5
  children?: React.ReactNode;
5
6
  header?: React.ReactNode;
7
+ bottomBarProps?: KioskBottomBarScalingProps;
6
8
  blocking?: boolean;
7
9
  overlays?: React.ReactNode;
8
10
  };
@@ -10,6 +12,7 @@ declare function KioskShell({
10
12
  className,
11
13
  children,
12
14
  header,
15
+ bottomBarProps,
13
16
  overlays,
14
17
  blocking,
15
18
  ...props
@@ -9,12 +9,13 @@ const _excluded = [
9
9
  "className",
10
10
  "children",
11
11
  "header",
12
+ "bottomBarProps",
12
13
  "overlays",
13
14
  "blocking"
14
15
  ];
15
16
  function KioskShell(_ref) {
16
- let { className, children, header, overlays, blocking } = _ref, props = _objectWithoutProperties(_ref, _excluded);
17
- return /* @__PURE__ */ React.createElement("section", _objectSpread2(_objectSpread2({}, props), {}, { className: ["pisell-kiosk-shell", className].filter(Boolean).join(" ") }), header && /* @__PURE__ */ React.createElement("div", { className: "pisell-kiosk-shell__header" }, header), /* @__PURE__ */ React.createElement(KioskBottomBarHost, null, /* @__PURE__ */ React.createElement("main", { className: "pisell-kiosk-shell__main" }, children), /* @__PURE__ */ React.createElement("div", { className: "pisell-kiosk-shell__overlays" }, overlays)), blocking && /* @__PURE__ */ React.createElement("div", {
17
+ let { className, children, header, bottomBarProps, overlays, blocking } = _ref, props = _objectWithoutProperties(_ref, _excluded);
18
+ return /* @__PURE__ */ React.createElement("section", _objectSpread2(_objectSpread2({}, props), {}, { className: ["pisell-kiosk-shell", className].filter(Boolean).join(" ") }), header && /* @__PURE__ */ React.createElement("div", { className: "pisell-kiosk-shell__header" }, header), /* @__PURE__ */ React.createElement(KioskBottomBarHost, { bottomBarProps }, /* @__PURE__ */ React.createElement("main", { className: "pisell-kiosk-shell__main" }, children), /* @__PURE__ */ React.createElement("div", { className: "pisell-kiosk-shell__overlays" }, overlays)), blocking && /* @__PURE__ */ React.createElement("div", {
18
19
  className: "pisell-kiosk-shell__blocking",
19
20
  role: "status",
20
21
  "aria-busy": "true"
@@ -3,6 +3,7 @@ import { useSalesSdkHostBridges } from "../../../../plus/salesSdk/context/SalesS
3
3
  import { isValidOrderCustomerId } from "../../../../plus/salesSdk/utils/customerAuthGate.js";
4
4
  import { useSalesSdkGlobalScanActivity } from "../../../../plus/salesSdk/context/SalesSdkGlobalScanActivityContext.js";
5
5
  import { getClientDisplayName, normalizeCustomer } from "../../../../plus/saleDetail/components/Client/utils.js";
6
+ import "../../../../plus/salesSdk/index.js";
6
7
  import { useKioskSale } from "../../sales/KioskSaleContext.js";
7
8
  import { captureShoppingOrder } from "../../sales/shopping/orderIdentity.js";
8
9
  import { maskCustomerPhone } from "./memberPhone.js";
@@ -5,6 +5,7 @@ import { useSalesSdkBusinessAvailability } from "../../../plus/salesSdk/context/
5
5
  import { isFulfillmentTimingBooking } from "../../../plus/salesSdk/utils/fulfillmentTimingBooking.js";
6
6
  import { KioskDialog } from "../components/KioskDialog/index.js";
7
7
  import { useSalesSdkGlobalScanActivity } from "../../../plus/salesSdk/context/SalesSdkGlobalScanActivityContext.js";
8
+ import "../../../plus/salesSdk/index.js";
8
9
  import { resolveSaleDetailProductQuantity, resolveSaleDetailTempOrder } from "../../../plus/saleDetail/utils.js";
9
10
  import locales_default from "../../bigSale/locales/index.js";
10
11
  import { KioskSaleContext } from "./KioskSaleContext.js";
@@ -93,8 +94,7 @@ function KioskSaleSession({ sale, session, snapshot, isActive, runtime, scan, bi
93
94
  step,
94
95
  isActive
95
96
  ]);
96
- const ordinaryKiosk = checkout.paymentChannel.trim().toLowerCase() === "kiosk";
97
- const protectWholeStep = Boolean((_runtime$protectedAct = runtime.protectedActivities) === null || _runtime$protectedAct === void 0 ? void 0 : _runtime$protectedAct.includes(step)) || !ordinaryKiosk && (step === "checkout" || step === "payment");
97
+ const protectWholeStep = Boolean((_runtime$protectedAct = runtime.protectedActivities) === null || _runtime$protectedAct === void 0 ? void 0 : _runtime$protectedAct.includes(step));
98
98
  const protectScreen = useKioskScreenProtection(app, sale.onPaymentPageActiveChange, isActive && protectWholeStep);
99
99
  const nextOrder = useMemoizedFn(() => {
100
100
  leave("next");
@@ -108,15 +108,23 @@ function KioskSaleSession({ sale, session, snapshot, isActive, runtime, scan, bi
108
108
  ]);
109
109
  const sessionDestination = returnToEntry ? "next" : "home";
110
110
  const closeSale = useMemoizedFn((intent) => leave(sessionDestination, intent));
111
+ const restartFromPayment = useRef(null);
111
112
  useEffect(() => {
112
113
  var _runtime$subscribeExi;
113
114
  return (_runtime$subscribeExi = runtime.subscribeExit) === null || _runtime$subscribeExi === void 0 ? void 0 : _runtime$subscribeExi.call(runtime, () => {
114
- closeSale({
115
+ var _restartFromPayment$c;
116
+ const exit = () => closeSale({
115
117
  kind: "recovery",
116
118
  source: "host-idle"
117
119
  });
120
+ if (checkout.attempt.current) (_restartFromPayment$c = restartFromPayment.current) === null || _restartFromPayment$c === void 0 || _restartFromPayment$c.call(restartFromPayment, exit);
121
+ else exit();
118
122
  });
119
- }, [runtime.subscribeExit, closeSale]);
123
+ }, [
124
+ runtime.subscribeExit,
125
+ closeSale,
126
+ checkout.attempt
127
+ ]);
120
128
  const screenSession = useMemo(() => _objectSpread2(_objectSpread2({}, session), {}, { close: closeSale }), [session, closeSale]);
121
129
  const finish = useMemoizedFn(() => {
122
130
  closeSale({
@@ -201,7 +209,8 @@ function KioskSaleSession({ sale, session, snapshot, isActive, runtime, scan, bi
201
209
  locale,
202
210
  checkout,
203
211
  exiting,
204
- protectPayment: isActive && ordinaryKiosk && !protectWholeStep ? protectScreen : void 0,
212
+ protectPayment: isActive && !protectWholeStep ? protectScreen : void 0,
213
+ restartFromPayment,
205
214
  renderShopping,
206
215
  onHome: finish,
207
216
  onNext: nextOrder
@@ -213,8 +222,9 @@ function KioskSaleSession({ sale, session, snapshot, isActive, runtime, scan, bi
213
222
  isActive,
214
223
  screens,
215
224
  renderLayout: ({ page, overlays: stepOverlays }) => {
216
- var _runtime$hideHeaderAc;
225
+ var _sale$kioskAppBinding, _runtime$hideHeaderAc;
217
226
  return /* @__PURE__ */ React.createElement(KioskSaleShell, {
227
+ bottomBarProps: (_sale$kioskAppBinding = sale.kioskAppBindings) === null || _sale$kioskAppBinding === void 0 ? void 0 : _sale$kioskAppBinding.shoppingBottomBarProps,
218
228
  className: "pisell-self-service-kiosk",
219
229
  "data-view": step === "checkout" ? origin : step === "result" ? "success" : step,
220
230
  style: {
@@ -23,6 +23,7 @@ interface KioskSaleView {
23
23
  locale?: string;
24
24
  exiting: boolean;
25
25
  protectPayment?: ProtectKioskScreen;
26
+ restartFromPayment?: React.Ref<(afterCancel: () => void) => void>;
26
27
  /** Omitting the bar uses this shopping step's standard controls. */
27
28
  renderShopping(step: ShoppingStep, bottomBar?: React.ComponentType<ShoppingBarProps> | null): React.ReactNode;
28
29
  onHome(): void;
@@ -27,8 +27,8 @@ function OrderOffersButton({ locale, promotion, promotionCount, onPromotion, dis
27
27
  onClick: onPromotion
28
28
  }), /* @__PURE__ */ React.createElement(PercentageOutlined, { "aria-hidden": "true" }), showLabel && /* @__PURE__ */ React.createElement("span", null, label), promotionCount > 0 && /* @__PURE__ */ React.createElement("b", { className: "pisell-kiosk-bottom-bar__count" }, promotionCount));
29
29
  }
30
- function createShoppingOrderBar({ bottomBarProps, quantity, amountDue, total, disabled, backDisabled, writing, onBack, onCheckout }, actions) {
31
- return _objectSpread2(_objectSpread2({}, bottomBarProps), {}, {
30
+ function createShoppingOrderBar({ quantity, amountDue, total, disabled, backDisabled, writing, onBack, onCheckout }, actions) {
31
+ return {
32
32
  ariaLabel: locales.getText("pisell2.big-sale.kiosk.your-order"),
33
33
  leading: /* @__PURE__ */ React.createElement(KioskBackButton, _objectSpread2(_objectSpread2({}, orderButtonState(backDisabled, writing)), {}, { onClick: onBack }), locales.getText("pisell2.big-sale.kiosk.navigation-back")),
34
34
  summary: /* @__PURE__ */ React.createElement(React.Fragment, null, amountDue !== 0 && /* @__PURE__ */ React.createElement("span", {
@@ -36,7 +36,7 @@ function createShoppingOrderBar({ bottomBarProps, quantity, amountDue, total, di
36
36
  "aria-live": "polite"
37
37
  }, /* @__PURE__ */ React.createElement("small", null, locales.getText("pisell2.big-sale.kiosk.to-pay")), /* @__PURE__ */ React.createElement("strong", null, total)), actions),
38
38
  trailing: /* @__PURE__ */ React.createElement("button", _objectSpread2(_objectSpread2({ type: "button" }, orderButtonState(disabled, writing || quantity === 0)), {}, { onClick: onCheckout }), /* @__PURE__ */ React.createElement("span", null, locales.getText(quantity > 0 && amountDue === 0 ? "pisell2.big-sale.confirm" : "pisell2.big-sale.kiosk.checkout")), /* @__PURE__ */ React.createElement(ArrowRightOutlined, { "aria-hidden": "true" }))
39
- });
39
+ };
40
40
  }
41
41
  //#endregion
42
42
  export { OrderOffersButton, createShoppingOrderBar, orderButtonState };
@@ -20,7 +20,7 @@ import { Modal, theme } from "antd";
20
20
  import { locales } from "@pisell/utils";
21
21
  //#region src/components/kiosk/sales/shopping/ShoppingScreen.tsx
22
22
  function ShoppingScreen({ sale, step, BottomBar, busy, setScanPaused, blocked, quantity, error, reveal, onBack, onCheckout, onNavigate }) {
23
- var _context$summary$summ, _sale$kioskAppBinding;
23
+ var _context$summary$summ;
24
24
  const { context, locale, saleDetailModuleConfig, renderCatalog, isActive = true } = sale;
25
25
  useInitLocalesOnce(locales_default, locale || "en");
26
26
  const { token } = theme.useToken();
@@ -113,7 +113,6 @@ function ShoppingScreen({ sale, step, BottomBar, busy, setScanPaused, blocked, q
113
113
  const togglePromotion = isVirtualSettlementTempOrder(context.sales.tempOrder) || busy || blocked ? void 0 : () => setPromotion(!promotion);
114
114
  const backDisabled = !isActive || busy || searchOpen || manualCode || removalOpen || Boolean(orderNoteModal);
115
115
  return /* @__PURE__ */ React.createElement(React.Fragment, null, modalRoot, orderNoteModal, BottomBar && /* @__PURE__ */ React.createElement(BottomBar, {
116
- bottomBarProps: (_sale$kioskAppBinding = sale.kioskAppBindings) === null || _sale$kioskAppBinding === void 0 ? void 0 : _sale$kioskAppBinding.shoppingBottomBarProps,
117
116
  locale,
118
117
  quantity,
119
118
  amountDue,
@@ -1,9 +1,6 @@
1
- import { KioskBottomBarScalingProps } from "../../components/BottomBar/index.js";
2
-
3
1
  //#region src/components/kiosk/sales/shopping/types.d.ts
4
2
  type ShoppingStep = 'catalog' | 'cart';
5
3
  interface ShoppingBarProps {
6
- bottomBarProps?: KioskBottomBarScalingProps;
7
4
  locale?: string;
8
5
  quantity: number;
9
6
  amountDue: number;
@@ -6,6 +6,7 @@ import { isVirtualSettlementTempOrder } from "../../../plus/multiCurrencySettlem
6
6
  import { useSalesSdkBusinessAvailability } from "../../../plus/salesSdk/context/SalesSdkBusinessAvailabilityContext.js";
7
7
  import { collectUnassignedHolderLines } from "../../../plus/salesSdk/utils/holderSubmitValidation.js";
8
8
  import { useSalesSdkGlobalScanActivity } from "../../../plus/salesSdk/context/SalesSdkGlobalScanActivityContext.js";
9
+ import "../../../plus/salesSdk/index.js";
9
10
  import { defaultCheckoutOptions } from "../app/contracts.js";
10
11
  import { saveShoppingStep } from "./shopping/shoppingStepStorage.js";
11
12
  import { useSalesCommands } from "../runtime/operations/useSalesCommands.js";
@@ -2,6 +2,7 @@ import { _asyncToGenerator } from "../../../_virtual/_@oxc-project_runtime@0.122
2
2
  import { useSalesSdkHostBridges } from "../../../plus/salesSdk/context/SalesSdkHostBridgesContext.js";
3
3
  import { useSalesSdkBusinessAvailability } from "../../../plus/salesSdk/context/SalesSdkBusinessAvailabilityContext.js";
4
4
  import { useSalesSdkGlobalScanActivity } from "../../../plus/salesSdk/context/SalesSdkGlobalScanActivityContext.js";
5
+ import "../../../plus/salesSdk/index.js";
5
6
  import { saveShoppingStep } from "./shopping/shoppingStepStorage.js";
6
7
  import { useEffect, useRef, useState } from "react";
7
8
  import { useMemoizedFn } from "ahooks";
@@ -13,14 +13,14 @@ import { CHECKOUT_VISIBLE_PAYMENT_CODES } from "../../../checkout/constants.js";
13
13
  import { isCustomCashPaymentMethod } from "../../../checkout/utils.js";
14
14
  import { calculateDirectPaymentSurcharge } from "../../../checkout/components/PaymentOptionsModule/paymentMethodPolicy.js";
15
15
  import { KioskPaymentScreen } from "../../components/Checkout/PaymentScreen.js";
16
- import React, { useMemo, useState } from "react";
16
+ import React, { useImperativeHandle, useMemo, useState } from "react";
17
17
  import { formatAmount, locales } from "@pisell/utils";
18
18
  import { useMemoizedFn } from "ahooks";
19
19
  //#region src/components/kiosk/slices/payment/PaymentContent.tsx
20
20
  const t = (key) => locales.getText("pisell2.hdl-kiosk." + key);
21
21
  function PaymentContent({ payment, active }) {
22
22
  var _payment$feedback, _payment$feedback2, _payment$feedback3;
23
- const { context, checkout, onNext, locale, exiting } = useKioskSale();
23
+ const { context, checkout, onNext, locale, exiting, restartFromPayment } = useKioskSale();
24
24
  useInitLocalesOnce(localeTexts, locale);
25
25
  const [restarting, setRestarting] = useState(false);
26
26
  const { amount, currencySymbol, methods, ready, busy, recovery } = payment;
@@ -34,15 +34,16 @@ function PaymentContent({ payment, active }) {
34
34
  const total = amount == null ? void 0 : String(formatAmount(amount, 2, currencySymbol));
35
35
  const zero = ready && amount === 0;
36
36
  const selectable = available && !member.errorReference && ready && quantity > 0 && amount != null;
37
- const restart = useMemoizedFn(_asyncToGenerator(function* () {
37
+ const restart = useMemoizedFn(_asyncToGenerator(function* (afterCancel = onNext) {
38
38
  if (!available || scans.getIsProcessing() || !payment.canChangeOrder()) return;
39
39
  setRestarting(true);
40
40
  try {
41
- if (yield checkout.cancel()) onNext();
41
+ if (yield checkout.cancel()) afterCancel();
42
42
  } finally {
43
43
  setRestarting(false);
44
44
  }
45
45
  }));
46
+ useImperativeHandle(restartFromPayment, () => restart, [restart]);
46
47
  const bar = useMemo(() => ({
47
48
  ariaLabel: t("payment-actions-label"),
48
49
  leading: /* @__PURE__ */ React.createElement(KioskBackButton, {
@@ -2,6 +2,7 @@ import useEngineContext from "../../hooks/useEngineContext.js";
2
2
  import { _asyncToGenerator } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
3
3
  import { useSalesSdk } from "../../plus/salesSdk/hooks/useSalesSdk.js";
4
4
  import { TEMP_ORDER_SYNC_REQUEST_MESSAGE_TYPE, getTempOrderSyncPayload, shouldApplySharedTempOrderPayload } from "../../plus/salesSdk/tempOrderSync.js";
5
+ import "../../plus/salesSdk/index.js";
5
6
  import { useEffect, useRef, useState } from "react";
6
7
  //#region src/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.tsx
7
8
  function createRequestId() {
@@ -88,7 +88,7 @@ Home 的 Redeem Socks 入口打开独立 `RedeemPage`,展示扫码指引、扫
88
88
  - 设备端购物车与支付页共用 `resolveKioskPresentation` 的 `self-service` 外观。Kiosk/Vending 待付金额大于 0 时进入 Kiosk 自身的 `payment` 页面,由 `Kiosk/payment` 负责控制,不经过 SalesSdk `openCheckout`、宿主 PaymentModalPlugin 或 PaymentModal。H5、PC 和 POS 继续使用既有支付入口;设备页的外观不再跨 SDK/宿主透传。
89
89
  - 独立页复用公共 `PaymentMethodRuntime`、pending 支付生命周期和 BaseSales 订单 API,直接使用当前购物车/钱包。支付方式按实际 `channel` 和宿主终端偏好筛选,Vending 排除标准及自定义现金方式,也不开钱箱。Vending 与 Kiosk 支付页在方式加载及筛选完成、待付金额大于 0 且只有一种可用方式时,自动执行一次该支付卡片的操作;取消、失败或部分支付后不再次自动触发,可手动重试,退出后重新进入支付页可再次自动触发。付款结果待确认时锁定操作,已收款后的失败只重试订单同步。Kiosk 自定义支付的自动和手动入口均请求主屏授权并等候结果,不在本机直接记为已付。
90
90
  - 仅 Vending 支付页优先复用首页初始化销售模块时已准备的支付方式;读取的是 BaseSales 当前镜像,由其原有配置变更事件更新。镜像缺失/为空时保留异步加载兜底,宿主显示偏好、排序及禁用现金规则仍每次应用。普通 Kiosk 保留原有支付方式加载路径。设备配置缓存及其失效由宿主管理,结账库存刷新和设备状态预检保持实时执行。
91
- - 付款页面期间锁住销售扫码并暂停屏保,返回购物车保留原订单与券;只有明确足额支付并同步成功后,才冻结订单及原 checkoutSnapshot,再进入现有成功/出货交接。0 元仍使用原有直接确认流程,不进入支付方式页。
91
+ - 付款页锁住销售扫码。选择支付方式时(包括失败、取消后回到选择页)按主系统配置超时回首页,实际支付及出货交接期间暂停计时。返回购物车保留原订单与券;只有明确足额支付并同步成功后,才冻结订单及原 checkoutSnapshot,再进入现有成功/出货交接。0 元仍使用原有直接确认流程,不进入支付方式页。
92
92
  - 隐藏零元金额和显示 Confirm 由 Vending 平台决定,不依赖 `renderCatalog` 是否存在;自定义列表本身不改变其它 Kiosk/H5/PC 的金额展示规则。
93
93
  - `checkoutSnapshot.lines[].inventoryKey` 是结账时冻结的本次购买 SKU。宿主把它转换为 `DispenseItem.sku`,无需读取已清空的购物车或“最近一次结账”状态。快照仅供内存交接,未注入扩展的支付回调保持原顺序。
94
94
  - 物料只订阅宿主队列;订单防重、映射准备、逐件分配及插件控制由宿主承担。硬件参数不由 BigSale 或此组件解释。
@@ -7,6 +7,7 @@ import { useSalesSdkHolder } from "../../../plus/salesSdk/context/SalesSdkHolder
7
7
  import { assignHolderToCartLine } from "../../../plus/salesSdk/utils/assignHolderToCartLine.js";
8
8
  import { resolveLineByProductUid } from "../../../plus/salesSdk/utils/holderSubmitValidation.js";
9
9
  import { createOpenCustomerAuthHost } from "../../../plus/salesSdk/hosts/createOpenCustomerAuthHost.js";
10
+ import "../../../plus/salesSdk/index.js";
10
11
  import { isProgressTarget } from "../../../plus/venueBookingDesign/shared/booking-progress.js";
11
12
  import { useBookingProgress } from "../../../plus/venueBookingDesign/shared/useBookingProgress.js";
12
13
  import { Button as Button$1 } from "../../../plus/venueBookingDesign/shared/Controls.js";
@@ -7,6 +7,7 @@ import { useSalesSdkHostBridges } from "../../../plus/salesSdk/context/SalesSdkH
7
7
  import { isVirtualSettlementTempOrder } from "../../../plus/multiCurrencySettlement/index.js";
8
8
  import { freePayApi } from "../../Sales/Checkout/serve.js";
9
9
  import { useSalesSdkBusinessAvailability } from "../../../plus/salesSdk/context/SalesSdkBusinessAvailabilityContext.js";
10
+ import "../../../plus/salesSdk/index.js";
10
11
  import { isSalesOrderSubmitSuccess } from "../../../plus/saleDetail/components/DetailActions/utils.js";
11
12
  import { resolveKioskDeferredSubmission } from "../../bigSale/templates/Kiosk/deferredCheckout.js";
12
13
  import { isH5ZeroAmountValue, toFiniteKioskAmount } from "../../bigSale/templates/Kiosk/zeroAmountCheckout.js";
@@ -2,6 +2,7 @@ import { _asyncToGenerator } from "../../../_virtual/_@oxc-project_runtime@0.122
2
2
  import useSalesUserLogin from "../../../hooks/useSalesUserLogin.js";
3
3
  import { useSalesSdkHostBridges } from "../../../plus/salesSdk/context/SalesSdkHostBridgesContext.js";
4
4
  import { createOpenCustomerAuthHost } from "../../../plus/salesSdk/hosts/createOpenCustomerAuthHost.js";
5
+ import "../../../plus/salesSdk/index.js";
5
6
  import { orderIdentity } from "../presentation.js";
6
7
  import { ensureVenueKioskCustomer, isVenueKioskRuntime, venueKioskCustomerAuthRequest } from "../kiosk/customer.js";
7
8
  import { confirmationErrorMessage } from "./errorMessage.js";