@pisell/private-materials 6.12.160 → 6.12.161
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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +1 -1
- package/build/lowcode/render/default/view.js +18 -18
- package/build/lowcode/view.js +18 -18
- package/es/components/bigSale/components/BookingFloatingPanel/useBookingPanelController.js +1 -0
- package/es/components/bigSale/components/TimeBar/index.js +1 -0
- package/es/components/bigSale/dialog.js +1 -0
- package/es/components/bigSale/hooks/useBigSaleContext.js +1 -0
- package/es/components/bigSale/hooks/useSelectFloorMapResourceForBigSale.js +1 -0
- package/es/components/bigSale/index.js +3 -2
- package/es/components/bigSale/templates/Kiosk/index.js +1 -0
- package/es/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.js +1 -0
- package/es/index.js +2 -0
- package/es/plus/pisellReservation/data/bookingToReservationTables.js +1 -1
- package/es/plus/pisellReservation/floorMap/floorPlanApi.js +1 -1
- package/es/plus/pisellReservation/floorMap/reservationMock.js +1 -1
- package/es/plus/pisellReservation/index.js +17 -0
- package/es/plus/saleDetail/Base.js +1 -0
- package/es/plus/saleDetail/components/CartItems/Editable/index.js +1 -0
- package/es/plus/saleDetail/components/Client/hooks/useClientSelectorProps.js +1 -0
- package/es/plus/saleDetail/components/DetailActions/index.js +1 -0
- package/es/plus/saleDetail/components/SummaryFinancialSections/index.js +1 -0
- package/es/plus/saleDetail/index.js +1 -0
- package/es/plus/saleDetail/tmpl/B/components/Dish/index.js +1 -0
- package/es/plus/saleDetail/tmpl/B/index.js +1 -0
- package/es/plus/salesSdk/context/SalesSdkCartContext.js +25 -12
- package/es/plus/salesSdk/context/SalesSdkProvider.js +9 -5
- package/es/plus/salesSdk/hosts/BookingEditHostRenderer.js +12 -7
- package/es/plus/salesSdk/index.js +51 -0
- package/es/plus/salesSdk/utils/addProductWithFlowDebounced.js +1 -1
- package/es/plus/salesSdk/utils/bookingDate.js +1 -1
- package/es/plus/salesSdk/utils/customerAuthGate.js +1 -1
- package/es/plus/salesSdk/utils/enrichCartLineHolderDisplay.js +1 -1
- package/es/plus/salesSdk/utils/resolvePreviousService.js +28 -0
- package/es/plus/skuOptionsSelection/components/NormalCard/index.js +18 -12
- package/es/plus/skuOptionsSelection/docs/skuOptionsSelection.$tab-dev.md +66 -2
- package/es/plus/skuOptionsSelection/types.d.ts +50 -1
- package/es/plus/skuOptionsSelection/utils/normalizers.js +17 -0
- package/es/plus/skuOptionsSelection/utils/transformOptionGroup.js +17 -7
- package/es/plus/skuOptionsSelection/utils/transformSelectorValueToValue.js +89 -15
- package/es/plus/skuOptionsSelection/utils/transformValueToSelectorValue.js +31 -19
- package/es/pro/Login2.0/AuthModal.d.ts +1 -1
- package/es/pro/Login2.0/index.d.ts +2 -1
- package/es/pro/Login2.0/shared/types.d.ts +1 -1
- package/es/pro/Selector/Selector.js +11 -6
- package/es/pro/Selector/hooks/useSelectionController.js +54 -61
- package/es/pro/Selector/locales.js +10 -0
- package/es/pro/Selector/types.d.ts +5 -0
- package/es/pro/skuDetailModal/types.d.ts +1 -0
- package/lib/components/bigSale/index.js +2 -2
- package/lib/plus/saleDetail/components/CartItems/Editable/index.js +1 -0
- package/lib/plus/salesSdk/context/SalesSdkCartContext.js +25 -12
- package/lib/plus/salesSdk/context/SalesSdkProvider.js +9 -5
- package/lib/plus/salesSdk/hosts/BookingEditHostRenderer.js +12 -7
- package/lib/plus/salesSdk/utils/resolvePreviousService.js +30 -0
- package/lib/plus/skuOptionsSelection/components/NormalCard/index.js +18 -12
- package/lib/plus/skuOptionsSelection/docs/skuOptionsSelection.$tab-dev.md +66 -2
- package/lib/plus/skuOptionsSelection/types.d.ts +50 -1
- package/lib/plus/skuOptionsSelection/utils/normalizers.js +19 -0
- package/lib/plus/skuOptionsSelection/utils/transformOptionGroup.js +17 -7
- package/lib/plus/skuOptionsSelection/utils/transformSelectorValueToValue.js +89 -15
- package/lib/plus/skuOptionsSelection/utils/transformValueToSelectorValue.js +31 -19
- package/lib/pro/Selector/Selector.js +11 -6
- package/lib/pro/Selector/hooks/useSelectionController.js +54 -61
- package/lib/pro/Selector/locales.js +10 -0
- package/lib/pro/Selector/types.d.ts +5 -0
- package/lib/pro/skuDetailModal/types.d.ts +1 -0
- package/package.json +4 -4
- 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
|
|
@@ -4,6 +4,7 @@ import withResponsive from "../../../../responsive/withResponsive.js";
|
|
|
4
4
|
import useInitLocalesOnce from "../../../../hooks/useInitLocalesOnce.js";
|
|
5
5
|
import { subscribeBookingDateChange } from "../../../../plus/salesSdk/utils/bookingDate.js";
|
|
6
6
|
import { useSalesSdkBookingContext } from "../../../../plus/salesSdk/context/SalesSdkBookingContext.js";
|
|
7
|
+
import "../../../../plus/salesSdk/index.js";
|
|
7
8
|
import locales_default from "../../locales/index.js";
|
|
8
9
|
import dayjs from "dayjs";
|
|
9
10
|
import React, { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
@@ -5,6 +5,7 @@ import { buildInitBookingContextParams, collectBookingIdsFromTempOrder } from ".
|
|
|
5
5
|
import { useSalesSdk } from "../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
6
6
|
import { useSalesSdkCart } from "../../plus/salesSdk/hooks/useSalesSdkCart.js";
|
|
7
7
|
import { SalesSdkPrepareOrderSwitchContext, SalesSdkRootRefreshContext } from "../../plus/salesSdk/context/SalesSdkProvider.js";
|
|
8
|
+
import "../../plus/salesSdk/index.js";
|
|
8
9
|
import { seedDineInReservationToCart } from "../../plus/pisellReservation/utils/seedDineInReservationToCart.js";
|
|
9
10
|
import BigSale from "./index.js";
|
|
10
11
|
import dayjs from "dayjs";
|
|
@@ -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 useEngineContext from "../../../hooks/useEngineContext.js";
|
|
|
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 { resolveOrderIdForHostActions } from "../../../plus/pisellReservation/components/bookingDetailModal/bookingDetailHostActions.js";
|
|
7
8
|
import { usePicoCodingOpenData } from "../../../plus/pisellReservation/hooks/usePicoCodingOpenData.js";
|
|
8
9
|
import { seedDineInReservationToCart } from "../../../plus/pisellReservation/utils/seedDineInReservationToCart.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 { ResponsiveBigSaleBase } from "./Base.js";
|
|
12
13
|
import { isBigSaleProductSelectionFlowScene, resolveBigSaleSelectionFlowConfig } from "./selectionFlowConfig.js";
|
|
13
14
|
import dayjs from "dayjs";
|
|
@@ -47,7 +48,7 @@ const BigSaleHostRuntimeBridge = ({ runtimeRef }) => {
|
|
|
47
48
|
/**
|
|
48
49
|
* BigSale 入口:只创建 SalesSdkProvider 运行环境,UI 由 ResponsiveBigSaleBase 承载。
|
|
49
50
|
*/
|
|
50
|
-
const BigSale = ({ osKey = DEFAULT_OS_KEY, osModuleName, selectionFlowScene, lifecycleOwner, orderId, autoBootstrap, autoRestoreOnInit, restoreOrderAfterPaidCheckout, destroyOnUnmount, businessCode, bookingConfigParams, otherParams, rulesHooks, uiHosts, normalProductDetailConfig, mergeBookingLinesForDisplay, mode = "ticket", variant, tmpl, template, secondaryScreenDisplay, productLoadParams, productDisplayConfig, hideSelectFloorMapResourceAction, productCatalogSessionKey, productCatalogReady, saleDetailTemplate, saleDetailModuleConfig, autoCreate = true, enableTempOrderPersist, enableTempOrderSync = true, isActive = true, preserveProductCatalogOnInactiveCustomerClear, enableGlobalScanListener = false, promotionScanSuccessMessageKey, promotionItemIncreaseMessageKey, className, style, bootstrapSlot, saleDetailHeaderSlot, rightActionBarClose, overlaySlot, onOrderComplete, externalActionRequest, onExternalActionAccepted, onExternalPaymentSettled }) => {
|
|
51
|
+
const BigSale = ({ osKey = DEFAULT_OS_KEY, osModuleName, selectionFlowScene, lifecycleOwner, orderId, autoBootstrap, autoRestoreOnInit, restoreOrderAfterPaidCheckout, destroyOnUnmount, businessCode, bookingConfigParams, autoInitBookingContext, otherParams, rulesHooks, uiHosts, normalProductDetailConfig, mergeBookingLinesForDisplay, mode = "ticket", variant, tmpl, template, secondaryScreenDisplay, productLoadParams, productDisplayConfig, hideSelectFloorMapResourceAction, productCatalogSessionKey, productCatalogReady, saleDetailTemplate, saleDetailModuleConfig, autoCreate = true, enableTempOrderPersist, enableTempOrderSync = true, isActive = true, preserveProductCatalogOnInactiveCustomerClear, enableGlobalScanListener = false, promotionScanSuccessMessageKey, promotionItemIncreaseMessageKey, className, style, bootstrapSlot, saleDetailHeaderSlot, rightActionBarClose, overlaySlot, onOrderComplete, externalActionRequest, onExternalActionAccepted, onExternalPaymentSettled }) => {
|
|
51
52
|
var _context$appHelper, _context$appHelper2, _context$appHelper3, _ref;
|
|
52
53
|
const context = useEngineContext();
|
|
53
54
|
const action = context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.action;
|
|
@@ -129,7 +130,7 @@ const BigSale = ({ osKey = DEFAULT_OS_KEY, osModuleName, selectionFlowScene, lif
|
|
|
129
130
|
restoreOrderAfterPaidCheckout,
|
|
130
131
|
businessCode,
|
|
131
132
|
bookingConfigParams,
|
|
132
|
-
autoInitBookingContext
|
|
133
|
+
autoInitBookingContext,
|
|
133
134
|
otherParams,
|
|
134
135
|
shouldMergeProductLines,
|
|
135
136
|
rulesHooks,
|
|
@@ -6,6 +6,7 @@ import useSalesUserLogin, { isRequireLoginChannel } from "../../../../hooks/useS
|
|
|
6
6
|
import { resolvePaymentResultToastV2ViewModel } from "../../../checkout/components/PaymentResultToastV2/resolve.js";
|
|
7
7
|
import PaymentResultToastV2_default from "../../../checkout/components/PaymentResultToastV2/index.js";
|
|
8
8
|
import { useSalesSdk } from "../../../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
9
|
+
import "../../../../plus/salesSdk/index.js";
|
|
9
10
|
import { usePickSaleDetailContext } from "../../hooks/usePickSaleDetailContext.js";
|
|
10
11
|
import { resolveBigSaleAutoProductListPreferences } from "../../utils/productListPreferences.js";
|
|
11
12
|
import { resolveBigSaleProductDisplayConfig } from "../../hooks/useBigSaleProductListConfig.js";
|
|
@@ -2,6 +2,7 @@ import { _asyncToGenerator } from "../../_virtual/_@oxc-project_runtime@0.122.0/
|
|
|
2
2
|
import useEngineContext from "../../hooks/useEngineContext.js";
|
|
3
3
|
import { useSalesSdk } from "../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
4
4
|
import { getTempOrderSyncPayload, shouldApplySharedTempOrderPayload } from "../../plus/salesSdk/tempOrderSync.js";
|
|
5
|
+
import "../../plus/salesSdk/index.js";
|
|
5
6
|
import { useEffect, useRef } from "react";
|
|
6
7
|
import { useMemoizedFn } from "ahooks";
|
|
7
8
|
//#region src/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.tsx
|
package/es/index.js
CHANGED
|
@@ -85,6 +85,7 @@ import { useSalesSdkProducts } from "./plus/salesSdk/hooks/useSalesSdkProducts.j
|
|
|
85
85
|
import SalesSdkDemo from "./plus/salesSdk/demo/index.js";
|
|
86
86
|
import { useSalesSdkDish } from "./plus/salesSdk/hooks/useSalesSdkDish.js";
|
|
87
87
|
import { useSyncOsModule } from "./plus/salesSdk/hooks/useSyncOsModule.js";
|
|
88
|
+
import "./plus/salesSdk/index.js";
|
|
88
89
|
import BigSaleRightActionPanel from "./components/BigSaleRightActionPanel/index.js";
|
|
89
90
|
import { resolveBigSaleSelectionFlowConfig } from "./components/bigSale/selectionFlowConfig.js";
|
|
90
91
|
import BigSale from "./components/bigSale/index.js";
|
|
@@ -137,6 +138,7 @@ import PisellVenueControlPage from "./plus/pisellReservation/PisellVenueControlP
|
|
|
137
138
|
import PisellVenueWallPage from "./plus/pisellReservation/PisellVenueWallPage.js";
|
|
138
139
|
import PisellReservationTablePage from "./plus/pisellReservation/PisellReservationTablePage.js";
|
|
139
140
|
import SelectFloorMapResourceDialog from "./plus/pisellReservation/components/SelectFloorMapResourceDialog.js";
|
|
141
|
+
import "./plus/pisellReservation/index.js";
|
|
140
142
|
import { PisellTopology, PisellTopologyCore } from "./plus/pisellTopology/PisellTopology.js";
|
|
141
143
|
import cupProject_default from "./components/ecocup/cupProject/index.js";
|
|
142
144
|
import CupList from "./components/ecocup/cupList/index.js";
|
|
@@ -259,4 +259,4 @@ function bookingListToReservationTableRows(bookings) {
|
|
|
259
259
|
return rows;
|
|
260
260
|
}
|
|
261
261
|
//#endregion
|
|
262
|
-
export { applyHostResourceShellToBaseRow, bookingListToReservationTableRows, customerBrief, extractResourceRecordIds, filterBookingsByResourceIds, hostBookingUiPatchFromRecord, mergeBookingsForResourceRecord };
|
|
262
|
+
export { applyHostResourceShellToBaseRow, bookingListToReservationTableRows, customerBrief, extractResourceRecordIds, filterBookingsByResourceIds, hostBookingStatusToCardStatus, hostBookingUiPatchFromRecord, mergeBookingsForResourceRecord };
|
|
@@ -78,4 +78,4 @@ function toastFloorPlanLoadError(err) {
|
|
|
78
78
|
PisellToast({ content: err instanceof Error ? err.message : String(err) });
|
|
79
79
|
}
|
|
80
80
|
//#endregion
|
|
81
|
-
export { PISELL_RESERVATION_FLOOR_PLAN_CODE, ensureShopFloorPlanByCode, saveViewConfigToShopFloorPlan, shopLayoutToSceneElements$1 as shopLayoutToSceneElements, toastFloorPlanLoadError, toastFloorPlanSaveError, unsubscribeShopFloorPlanCodeQuery };
|
|
81
|
+
export { PISELL_RESERVATION_FLOOR_PLAN_CODE, buildDefaultReservationFloorPlanPostBody, ensureShopFloorPlanByCode, putShopFloorPlan, saveViewConfigToShopFloorPlan, shopLayoutToSceneElements$1 as shopLayoutToSceneElements, toastFloorPlanLoadError, toastFloorPlanSaveError, unsubscribeShopFloorPlanCodeQuery };
|
|
@@ -927,4 +927,4 @@ function getReservationDataSourceFormColumns() {
|
|
|
927
927
|
];
|
|
928
928
|
}
|
|
929
929
|
//#endregion
|
|
930
|
-
export { RESERVATION_BOUND_ROUND_TABLE_ELEMENT_KIND, RESERVATION_BOUND_TABLE_ELEMENT_KIND, applyReservationFloorMapLiveLabels, defaultReservationTableRows, getDefaultReservationFloorMapConfig, getReservationDataSourceFormColumns, getReservationFloorMapShellConfig, mergeFloorMapElementKindCategoriesWithDefaults, mergeFloorMapElementKindsWithDefaults };
|
|
930
|
+
export { RESERVATION_BOUND_ROUND_TABLE_ELEMENT_KIND, RESERVATION_BOUND_TABLE_ELEMENT_KIND, applyReservationFloorMapLiveLabels, defaultReservationSceneElements, defaultReservationTableRows, getDefaultReservationFloorMapConfig, getReservationDataSourceFormColumns, getReservationFloorMapShellConfig, mergeFloorMapElementKindCategoriesWithDefaults, mergeFloorMapElementKindsWithDefaults };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "./serve/formResourcePage.js";
|
|
2
|
+
import "./floorRoomCard/mapRowToFloorRoomCardData.js";
|
|
3
|
+
import "./floorRoomCard/ReservationFloorRoomCard.js";
|
|
4
|
+
import "./floorMap/reservationMock.js";
|
|
5
|
+
import "./floorMap/floorPlanApi.js";
|
|
6
|
+
import "./reservationConstants.js";
|
|
7
|
+
import "./data/bookingToReservationTables.js";
|
|
8
|
+
import "./data/formResourceToReservationTables.js";
|
|
9
|
+
import "./data/salesEmbeddedResourceToTableRows.js";
|
|
10
|
+
import "./floorMap/reservationCards.js";
|
|
11
|
+
import "./PisellReservation.js";
|
|
12
|
+
import "./PisellReservationBookingPage.js";
|
|
13
|
+
import "./PisellVenueControlPage.js";
|
|
14
|
+
import "./PisellVenueWallPage.js";
|
|
15
|
+
import "./PisellReservationTablePage.js";
|
|
16
|
+
import "./components/SelectFloorMapResourceDialog.js";
|
|
17
|
+
export {};
|
|
@@ -11,6 +11,7 @@ import { useSalesSdkCart } from "../salesSdk/hooks/useSalesSdkCart.js";
|
|
|
11
11
|
import { useSalesSdkCustomer } from "../salesSdk/hooks/useSalesSdkCustomer.js";
|
|
12
12
|
import { useSalesSdkBookingContext } from "../salesSdk/context/SalesSdkBookingContext.js";
|
|
13
13
|
import { useSalesSdkSummary } from "../salesSdk/hooks/useSalesSdkSummary.js";
|
|
14
|
+
import "../salesSdk/index.js";
|
|
14
15
|
import locales_default from "./locales.js";
|
|
15
16
|
import locales_default$1 from "./components/LineItem/locales.js";
|
|
16
17
|
import { SaleOrderActionBoundary } from "./actions/index.js";
|
|
@@ -107,6 +107,7 @@ function useCartLineRowActions({ item, quantityLoading, cardAction, isShowRightA
|
|
|
107
107
|
text: /* @__PURE__ */ React.createElement(PisellNumberSelector, {
|
|
108
108
|
enablePriceAdjust: true,
|
|
109
109
|
min: 1,
|
|
110
|
+
width: "max-content",
|
|
110
111
|
className: "pisell-sale-detail-cart-items__quantity-selector",
|
|
111
112
|
value: getBookingQuantity(item),
|
|
112
113
|
disabled: quantityLoading,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
2
2
|
import useEngineContext from "../../../../../hooks/useEngineContext.js";
|
|
3
3
|
import { useSalesSdkBookingContext } from "../../../../salesSdk/context/SalesSdkBookingContext.js";
|
|
4
|
+
import "../../../../salesSdk/index.js";
|
|
4
5
|
import { useMemo } from "react";
|
|
5
6
|
import { useMemoizedFn } from "ahooks";
|
|
6
7
|
//#region src/plus/saleDetail/components/Client/hooks/useClientSelectorProps.ts
|
|
@@ -9,6 +9,7 @@ import { useSalesSdk } from "../../../salesSdk/hooks/useSalesSdk.js";
|
|
|
9
9
|
import { useSalesSdkCart } from "../../../salesSdk/hooks/useSalesSdkCart.js";
|
|
10
10
|
import { useSalesSdkGlobalScanActivity } from "../../../salesSdk/context/SalesSdkGlobalScanActivityContext.js";
|
|
11
11
|
import { useSalesSdkSummary } from "../../../salesSdk/hooks/useSalesSdkSummary.js";
|
|
12
|
+
import "../../../salesSdk/index.js";
|
|
12
13
|
import { getNumericAmount, getSalesHostModule, resolveSaleDetailOrderIdFromSales, resolveSaleDetailOrderIdFromSalesResult, shouldCloseDialogAfterCheckout, updateLocalOrder } from "./utils.js";
|
|
13
14
|
import { getRemotePrintActions, getWristbandList } from "../../serve.js";
|
|
14
15
|
import { deriveSaleOrderSubmitState } from "../../actions/state.js";
|
|
@@ -3,6 +3,7 @@ import { resolvePaymentMethodName, usePaymentMethodNameMap } from "../../../pise
|
|
|
3
3
|
import { useSalesSdk } from "../../../salesSdk/hooks/useSalesSdk.js";
|
|
4
4
|
import { useSalesSdkCart } from "../../../salesSdk/hooks/useSalesSdkCart.js";
|
|
5
5
|
import { useSalesSdkSummary } from "../../../salesSdk/hooks/useSalesSdkSummary.js";
|
|
6
|
+
import "../../../salesSdk/index.js";
|
|
6
7
|
import React, { memo, useMemo } from "react";
|
|
7
8
|
import { formatAmount, locales } from "@pisell/utils";
|
|
8
9
|
import Decimal from "decimal.js";
|
|
@@ -4,6 +4,7 @@ import { useSalesSdk } from "../salesSdk/hooks/useSalesSdk.js";
|
|
|
4
4
|
import { SalesSdkProvider } from "../salesSdk/context/SalesSdkProvider.js";
|
|
5
5
|
import { SalesSdkDishProvider } from "../salesSdk/context/SalesSdkDishContext.js";
|
|
6
6
|
import { SalesSdkBookingContextProvider } from "../salesSdk/context/SalesSdkBookingContext.js";
|
|
7
|
+
import "../salesSdk/index.js";
|
|
7
8
|
import Base_default from "./Base.js";
|
|
8
9
|
import React, { forwardRef, useImperativeHandle } from "react";
|
|
9
10
|
//#region src/plus/saleDetail/index.tsx
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import useStableInstanceId from "../../../../../../hooks/useStableInstanceId.js";
|
|
2
2
|
import { useSalesSdkDish } from "../../../../../salesSdk/hooks/useSalesSdkDish.js";
|
|
3
3
|
import { useCurrentSalesSdkDish } from "../../../../../salesSdk/hooks/useCurrentSalesSdkDish.js";
|
|
4
|
+
import "../../../../../salesSdk/index.js";
|
|
4
5
|
import { SaleDetailStatusOverview } from "../shared/StatusOverview.js";
|
|
5
6
|
import { DishGroupView } from "./DishGroupView.js";
|
|
6
7
|
import dayjs from "dayjs";
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
2
2
|
import useEngineContext from "../../../../hooks/useEngineContext.js";
|
|
3
3
|
import { useCurrentSalesSdkDish } from "../../../salesSdk/hooks/useCurrentSalesSdkDish.js";
|
|
4
|
+
import "../../../salesSdk/index.js";
|
|
4
5
|
import { getInternalNotesByScheduleEvent } from "../../serve.js";
|
|
5
6
|
import { TEMPLATE_B_PAY_ACTIONS, TEMPLATE_B_SUMMARY_ACTIONS } from "../../components/DetailActions/configs/index.js";
|
|
6
7
|
import { DetailActions } from "../../components/DetailActions/index.js";
|
|
@@ -28,6 +28,7 @@ import { formatBookingDateTime } from "../utils/bookingDate.js";
|
|
|
28
28
|
import { assignHolderToCartLine } from "../utils/assignHolderToCartLine.js";
|
|
29
29
|
import { resolveLineByProductUid } from "../utils/holderSubmitValidation.js";
|
|
30
30
|
import { removeOrderProductsByIdentities } from "../utils/removeOrderProducts.js";
|
|
31
|
+
import { resolvePreviousService } from "../utils/resolvePreviousService.js";
|
|
31
32
|
import locales_default from "../../../components/ticketBooking/locales.js";
|
|
32
33
|
import { resolveEditCartLineTarget, shouldEditCartLineAsBooking } from "../utils/editCartLine.js";
|
|
33
34
|
import { resolveBookingLineSources, syncBookingLineQuantityByRows } from "../utils/syncBookingLineQuantityByRows.js";
|
|
@@ -793,6 +794,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
|
|
|
793
794
|
const customerId = resolveAddFlowCustomerId(liveTempOrder, void 0, bookingTicket === null || bookingTicket === void 0 || (_bookingTicket$getOrd2 = bookingTicket.getOrderCustomerSnapshot) === null || _bookingTicket$getOrd2 === void 0 || (_bookingTicket$getOrd2 = _bookingTicket$getOrd2.call(bookingTicket)) === null || _bookingTicket$getOrd2 === void 0 ? void 0 : _bookingTicket$getOrd2.id);
|
|
794
795
|
return {
|
|
795
796
|
bookingConfig: (_bookingTicket$getBoo5 = bookingTicket === null || bookingTicket === void 0 || (_bookingTicket$getBoo6 = bookingTicket.getBookingConfig) === null || _bookingTicket$getBoo6 === void 0 ? void 0 : _bookingTicket$getBoo6.call(bookingTicket)) !== null && _bookingTicket$getBoo5 !== void 0 ? _bookingTicket$getBoo5 : null,
|
|
797
|
+
previousService: resolvePreviousService(liveTempOrder),
|
|
796
798
|
customerId,
|
|
797
799
|
tempOrder: liveTempOrder,
|
|
798
800
|
isFranchisee: Boolean(bookingTicket === null || bookingTicket === void 0 || (_bookingTicket$getOth = bookingTicket.getOtherParams) === null || _bookingTicket$getOth === void 0 || (_bookingTicket$getOth = _bookingTicket$getOth.call(bookingTicket)) === null || _bookingTicket$getOth === void 0 ? void 0 : _bookingTicket$getOth.isFranchisee),
|
|
@@ -855,7 +857,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
|
|
|
855
857
|
});
|
|
856
858
|
const addProductToOrderFromCacheImpl = useMemoizedFn(function() {
|
|
857
859
|
var _ref9 = _asyncToGenerator(function* (item, cacheItem, options) {
|
|
858
|
-
var _flowCtx$date, _ref8, _cacheItemForTransfor, _cacheItemForTransfor2;
|
|
860
|
+
var _flowCtx$date, _flowCtx$bookingConfi, _ref8, _cacheItemForTransfor, _cacheItemForTransfor2;
|
|
859
861
|
if (!bookingTicket) throw new Error("[SalesSdk] Cart: bookingTicket 未初始化");
|
|
860
862
|
if (typeof bookingTicket.transformDetailToProductAndBooking !== "function") throw new Error("[SalesSdk] Cart: bookingTicket.transformDetailToProductAndBooking 不可用");
|
|
861
863
|
const flowCtx = getAddFlowContext();
|
|
@@ -865,7 +867,9 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
|
|
|
865
867
|
cacheItem: cacheItemForTransform,
|
|
866
868
|
options: {
|
|
867
869
|
quantity: options === null || options === void 0 ? void 0 : options.quantity,
|
|
868
|
-
date: (_flowCtx$date = flowCtx.date) !== null && _flowCtx$date !== void 0 ? _flowCtx$date : void 0
|
|
870
|
+
date: (_flowCtx$date = flowCtx.date) !== null && _flowCtx$date !== void 0 ? _flowCtx$date : void 0,
|
|
871
|
+
bookingConfig: (_flowCtx$bookingConfi = flowCtx.bookingConfig) !== null && _flowCtx$bookingConfi !== void 0 ? _flowCtx$bookingConfi : void 0,
|
|
872
|
+
previousService: flowCtx.previousService
|
|
869
873
|
}
|
|
870
874
|
});
|
|
871
875
|
orderLine.note = (_ref8 = (_cacheItemForTransfor = cacheItemForTransform === null || cacheItemForTransform === void 0 || (_cacheItemForTransfor2 = cacheItemForTransform._extend) === null || _cacheItemForTransfor2 === void 0 ? void 0 : _cacheItemForTransfor2.note) !== null && _cacheItemForTransfor !== void 0 ? _cacheItemForTransfor : orderLine.note) !== null && _ref8 !== void 0 ? _ref8 : "";
|
|
@@ -917,7 +921,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
|
|
|
917
921
|
*/
|
|
918
922
|
const addProduct = useMemoizedFn(function() {
|
|
919
923
|
var _ref13 = _asyncToGenerator(function* (product, options) {
|
|
920
|
-
var _flowCtx$date2;
|
|
924
|
+
var _flowCtx$date2, _flowCtx$bookingConfi2;
|
|
921
925
|
if (!bookingTicket) throw new Error("[SalesSdk] Cart: bookingTicket 未初始化");
|
|
922
926
|
if (typeof bookingTicket.decideAddProduct !== "function") throw new Error("[SalesSdk] Cart: bookingTicket.decideAddProduct 不可用,请升级 pisellos");
|
|
923
927
|
const flowCtx = getAddFlowContext();
|
|
@@ -966,7 +970,9 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
|
|
|
966
970
|
type: (options === null || options === void 0 ? void 0 : options.type) || "select",
|
|
967
971
|
quantity: options === null || options === void 0 ? void 0 : options.quantity,
|
|
968
972
|
date: (_flowCtx$date2 = flowCtx.date) !== null && _flowCtx$date2 !== void 0 ? _flowCtx$date2 : void 0,
|
|
969
|
-
customerId: flowCtx.customerId
|
|
973
|
+
customerId: flowCtx.customerId,
|
|
974
|
+
bookingConfig: (_flowCtx$bookingConfi2 = flowCtx.bookingConfig) !== null && _flowCtx$bookingConfi2 !== void 0 ? _flowCtx$bookingConfi2 : void 0,
|
|
975
|
+
previousService: flowCtx.previousService
|
|
970
976
|
});
|
|
971
977
|
if (decision.action === "reloadCatalog") {
|
|
972
978
|
yield reloadProductCatalogForStaleSession();
|
|
@@ -986,14 +992,16 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
|
|
|
986
992
|
};
|
|
987
993
|
}
|
|
988
994
|
if (decision.action === "requiresDetail") {
|
|
989
|
-
var _decision$payload, _bookingTicket$buildR, _flowCtx$date4;
|
|
995
|
+
var _decision$payload, _bookingTicket$buildR, _flowCtx$date4, _flowCtx$bookingConfi3;
|
|
990
996
|
return {
|
|
991
997
|
status: "requiresDetail",
|
|
992
998
|
payload: (_decision$payload = decision.payload) !== null && _decision$payload !== void 0 ? _decision$payload : (_bookingTicket$buildR = bookingTicket.buildRequiresDetailPayload) === null || _bookingTicket$buildR === void 0 ? void 0 : _bookingTicket$buildR.call(bookingTicket, product, {
|
|
993
999
|
type: (options === null || options === void 0 ? void 0 : options.type) || "select",
|
|
994
1000
|
quantity: options === null || options === void 0 ? void 0 : options.quantity,
|
|
995
1001
|
date: (_flowCtx$date4 = flowCtx.date) !== null && _flowCtx$date4 !== void 0 ? _flowCtx$date4 : void 0,
|
|
996
|
-
customerId: flowCtx.customerId
|
|
1002
|
+
customerId: flowCtx.customerId,
|
|
1003
|
+
bookingConfig: (_flowCtx$bookingConfi3 = flowCtx.bookingConfig) !== null && _flowCtx$bookingConfi3 !== void 0 ? _flowCtx$bookingConfi3 : void 0,
|
|
1004
|
+
previousService: flowCtx.previousService
|
|
997
1005
|
})
|
|
998
1006
|
};
|
|
999
1007
|
}
|
|
@@ -1019,7 +1027,7 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
|
|
|
1019
1027
|
*/
|
|
1020
1028
|
const confirmDetail = useMemoizedFn(function() {
|
|
1021
1029
|
var _ref15 = _asyncToGenerator(function* (input) {
|
|
1022
|
-
var _flowCtx$date7, _input$options, _input$options3;
|
|
1030
|
+
var _flowCtx$date7, _flowCtx$bookingConfi4, _input$options, _input$options3;
|
|
1023
1031
|
if (!bookingTicket) throw new Error("[SalesSdk] Cart: bookingTicket 未初始化");
|
|
1024
1032
|
if (typeof bookingTicket.transformDetailToProductAndBooking !== "function") throw new Error("[SalesSdk] Cart: bookingTicket.transformDetailToProductAndBooking 不可用");
|
|
1025
1033
|
const confirmQuantity = resolveConfirmDetailQuantity(input);
|
|
@@ -1030,7 +1038,9 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
|
|
|
1030
1038
|
options: {
|
|
1031
1039
|
quantity: confirmQuantity,
|
|
1032
1040
|
date: (_flowCtx$date7 = flowCtx.date) !== null && _flowCtx$date7 !== void 0 ? _flowCtx$date7 : void 0,
|
|
1033
|
-
customerId: flowCtx.customerId
|
|
1041
|
+
customerId: flowCtx.customerId,
|
|
1042
|
+
bookingConfig: (_flowCtx$bookingConfi4 = flowCtx.bookingConfig) !== null && _flowCtx$bookingConfi4 !== void 0 ? _flowCtx$bookingConfi4 : void 0,
|
|
1043
|
+
previousService: flowCtx.previousService
|
|
1034
1044
|
}
|
|
1035
1045
|
});
|
|
1036
1046
|
const catalogItem = input.item;
|
|
@@ -1038,12 +1048,13 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
|
|
|
1038
1048
|
if ((_input$options = input.options) === null || _input$options === void 0 ? void 0 : _input$options.multiDayRange) cacheItem = patchCacheItemDateRange(cacheItem, input.options.multiDayRange);
|
|
1039
1049
|
else cacheItem = applyDefaultMultiDayRangeIfNeeded(cacheItem, catalogItem, flowCtx.date);
|
|
1040
1050
|
if (typeof bookingTicket.decideAfterDetail === "function") {
|
|
1041
|
-
var _flowCtx$date8, _flowCtx$
|
|
1051
|
+
var _flowCtx$date8, _flowCtx$bookingConfi5, _input$options2;
|
|
1042
1052
|
const decision = bookingTicket.decideAfterDetail(cacheItem, {
|
|
1043
1053
|
quantity: confirmQuantity,
|
|
1044
1054
|
customerId: flowCtx.customerId,
|
|
1045
1055
|
date: (_flowCtx$date8 = flowCtx.date) !== null && _flowCtx$date8 !== void 0 ? _flowCtx$date8 : void 0,
|
|
1046
|
-
bookingConfig: (_flowCtx$
|
|
1056
|
+
bookingConfig: (_flowCtx$bookingConfi5 = flowCtx.bookingConfig) !== null && _flowCtx$bookingConfi5 !== void 0 ? _flowCtx$bookingConfi5 : void 0,
|
|
1057
|
+
previousService: flowCtx.previousService
|
|
1047
1058
|
});
|
|
1048
1059
|
if (decision.action === "requiresBookingEdit") {
|
|
1049
1060
|
var _decision$payload5, _ref14, _flowCtx$date9, _decision$payload6, _flowCtx$customerId2, _decision$payload7;
|
|
@@ -1162,13 +1173,15 @@ const SalesSdkCartProvider = ({ children, shouldMergeProductLines, mergeBookingL
|
|
|
1162
1173
|
};
|
|
1163
1174
|
}(),
|
|
1164
1175
|
decideAddProduct: (product, opts) => {
|
|
1165
|
-
var _flowCtx$date11;
|
|
1176
|
+
var _flowCtx$date11, _flowCtx$bookingConfi6;
|
|
1166
1177
|
const ticket = bookingTicketRef.current;
|
|
1167
1178
|
if (!ticket || typeof ticket.decideAddProduct !== "function") return { action: "requiresDetail" };
|
|
1168
1179
|
const flowCtx = getAddFlowContextRef.current();
|
|
1169
1180
|
return ticket.decideAddProduct(product, _objectSpread2(_objectSpread2({}, opts), {}, {
|
|
1170
1181
|
date: (_flowCtx$date11 = flowCtx.date) !== null && _flowCtx$date11 !== void 0 ? _flowCtx$date11 : void 0,
|
|
1171
|
-
customerId: flowCtx.customerId
|
|
1182
|
+
customerId: flowCtx.customerId,
|
|
1183
|
+
bookingConfig: (_flowCtx$bookingConfi6 = flowCtx.bookingConfig) !== null && _flowCtx$bookingConfi6 !== void 0 ? _flowCtx$bookingConfi6 : void 0,
|
|
1184
|
+
previousService: flowCtx.previousService
|
|
1172
1185
|
}));
|
|
1173
1186
|
},
|
|
1174
1187
|
runAddProductFlow: (product, opts) => runFlowRef.current(product, opts),
|
|
@@ -148,7 +148,7 @@ function runAfterNextPaint(task) {
|
|
|
148
148
|
* - 新建态:按 OS persist 开关走 createNew 或 restore → initBookingContext
|
|
149
149
|
* 须位于 SalesSdkSummaryProvider 内,以便 summaryProviderRef 已通过 useImperativeHandle 注入。
|
|
150
150
|
*/
|
|
151
|
-
function SalesSdkBootstrap({
|
|
151
|
+
function SalesSdkBootstrap({ autoRestoreOnInit, autoBootstrap, autoInitBookingContext, orderId, preloadedSalesDetail, initBookingContext, prepareModule, prepareCatalog, catalogKey, lifecycleOwner }) {
|
|
152
152
|
const sales = useContext(SalesSdkContext);
|
|
153
153
|
const cart = useSalesSdkCart();
|
|
154
154
|
useEffect(() => {
|
|
@@ -182,7 +182,7 @@ function SalesSdkBootstrap({ solution, autoRestoreOnInit, autoBootstrap, autoIni
|
|
|
182
182
|
}
|
|
183
183
|
}
|
|
184
184
|
}
|
|
185
|
-
if (cancelled || !autoInitBookingContext
|
|
185
|
+
if (cancelled || !autoInitBookingContext) return;
|
|
186
186
|
const bookingIds = collectBookingIdsFromTempOrder((_sales$bookingTicket$2 = (_sales$bookingTicket2 = sales.bookingTicket) === null || _sales$bookingTicket2 === void 0 || (_sales$bookingTicket3 = _sales$bookingTicket2.getTempOrder) === null || _sales$bookingTicket3 === void 0 ? void 0 : _sales$bookingTicket3.call(_sales$bookingTicket2)) !== null && _sales$bookingTicket$2 !== void 0 ? _sales$bookingTicket$2 : null);
|
|
187
187
|
yield initBookingContext(bookingIds.length ? bookingIds : void 0, { loadResources: !(autoBootstrap && orderId) });
|
|
188
188
|
} catch (e) {
|
|
@@ -209,7 +209,6 @@ function SalesSdkBootstrap({ solution, autoRestoreOnInit, autoBootstrap, autoIni
|
|
|
209
209
|
autoRestoreOnInit,
|
|
210
210
|
autoBootstrap,
|
|
211
211
|
autoInitBookingContext,
|
|
212
|
-
solution,
|
|
213
212
|
orderId,
|
|
214
213
|
preloadedSalesDetail,
|
|
215
214
|
initBookingContext,
|
|
@@ -648,7 +647,13 @@ const SalesSdkProvider = ({ osKey, solution = "bookingTicket", moduleAccess = "e
|
|
|
648
647
|
*/
|
|
649
648
|
const initBookingContext = useMemoizedFn(function() {
|
|
650
649
|
var _ref2 = _asyncToGenerator(function* (bookingIds, options) {
|
|
651
|
-
if (!
|
|
650
|
+
if (!bookingTicket) return;
|
|
651
|
+
if (String((otherParams === null || otherParams === void 0 ? void 0 : otherParams.platform) || "").trim().toLowerCase() === "h5") {
|
|
652
|
+
var _bookingTicket$loadBo;
|
|
653
|
+
yield (_bookingTicket$loadBo = bookingTicket.loadBookingConfig) === null || _bookingTicket$loadBo === void 0 ? void 0 : _bookingTicket$loadBo.call(bookingTicket, bookingConfigParams);
|
|
654
|
+
return;
|
|
655
|
+
}
|
|
656
|
+
if (!bookingTicket.initBookingContext) return;
|
|
652
657
|
yield bookingTicket.initBookingContext(buildInitBookingContextParams(bookingConfigParams, {
|
|
653
658
|
bookingIds,
|
|
654
659
|
loadResources: options === null || options === void 0 ? void 0 : options.loadResources
|
|
@@ -1340,7 +1345,6 @@ const SalesSdkProvider = ({ osKey, solution = "bookingTicket", moduleAccess = "e
|
|
|
1340
1345
|
onPromotionScanComplete: handlePromotionScanComplete,
|
|
1341
1346
|
promotionScanSuccessMessageKey: promotionItemIncreaseMessageKey ? void 0 : promotionScanSuccessMessageKey
|
|
1342
1347
|
}), /* @__PURE__ */ React.createElement(SalesSdkBootstrap, {
|
|
1343
|
-
solution,
|
|
1344
1348
|
autoRestoreOnInit,
|
|
1345
1349
|
autoBootstrap,
|
|
1346
1350
|
autoInitBookingContext,
|
|
@@ -5,6 +5,7 @@ import { buildInitBookingContextParams, collectBookingIdsFromTempOrder } from ".
|
|
|
5
5
|
import { buildBookingEditDrawerState, resolveBookingEditCustomerId } from "../bookingEditService/buildBookingEditDrawerState.js";
|
|
6
6
|
import { resolveIsMultiDayProduct } from "../utils/resolveIsMultiDayProduct.js";
|
|
7
7
|
import { isMultiDayQuotationExpanded } from "../utils/multiDayPriceCache.js";
|
|
8
|
+
import { resolvePreviousService } from "../utils/resolvePreviousService.js";
|
|
8
9
|
import { prepareCacheItemForBookingEdit } from "../bookingEditService/prepareCacheItemForBookingEdit.js";
|
|
9
10
|
import { useSalesSdk } from "../hooks/useSalesSdk.js";
|
|
10
11
|
import { useSyncExternalStoreCompat } from "../hooks/useSyncExternalStoreCompat.js";
|
|
@@ -17,11 +18,15 @@ import { locales } from "@pisell/utils";
|
|
|
17
18
|
/**
|
|
18
19
|
* 将 Host payload 的 cacheItem 补齐展示字段并写入 state。
|
|
19
20
|
*/
|
|
20
|
-
function normalizeCacheItemForDrawer(rawItem, bookingTicket, forceOpen) {
|
|
21
|
+
function normalizeCacheItemForDrawer(rawItem, bookingTicket, tempOrder, forceOpen) {
|
|
21
22
|
let item = rawItem;
|
|
22
23
|
if (isMultiDayQuotationExpanded(item)) item = _objectSpread2(_objectSpread2({}, item), {}, { new: 0 });
|
|
23
24
|
if (typeof bookingTicket.getProductExtend === "function") try {
|
|
24
|
-
|
|
25
|
+
var _bookingTicket$getBoo, _bookingTicket$getBoo2;
|
|
26
|
+
item = bookingTicket.getProductExtend(item, {
|
|
27
|
+
bookingConfig: (_bookingTicket$getBoo = (_bookingTicket$getBoo2 = bookingTicket.getBookingConfig) === null || _bookingTicket$getBoo2 === void 0 ? void 0 : _bookingTicket$getBoo2.call(bookingTicket)) !== null && _bookingTicket$getBoo !== void 0 ? _bookingTicket$getBoo : void 0,
|
|
28
|
+
previousService: resolvePreviousService(tempOrder)
|
|
29
|
+
});
|
|
25
30
|
} catch (e) {
|
|
26
31
|
console.warn("[SalesSdk] getProductExtend 失败,使用原始 cacheItem", e);
|
|
27
32
|
}
|
|
@@ -78,7 +83,7 @@ const BookingEditHostRenderer = () => {
|
|
|
78
83
|
var _ref = _asyncToGenerator(function* () {
|
|
79
84
|
yield ensureBookingContextForDrawer(bookingTicket, payload, tempOrder, bookingConfigParams);
|
|
80
85
|
if (cancelled) return;
|
|
81
|
-
const item = normalizeCacheItemForDrawer(payload.cacheItem, bookingTicket, payload.forceOpen);
|
|
86
|
+
const item = normalizeCacheItemForDrawer(payload.cacheItem, bookingTicket, tempOrder, payload.forceOpen);
|
|
82
87
|
if (item.autoClose && !payload.forceOpen) {
|
|
83
88
|
bridge.complete(item);
|
|
84
89
|
return;
|
|
@@ -90,7 +95,7 @@ const BookingEditHostRenderer = () => {
|
|
|
90
95
|
};
|
|
91
96
|
})()().catch((err) => {
|
|
92
97
|
console.warn("[SalesSdk] openBookingEdit 初始化资源上下文失败", err);
|
|
93
|
-
if (!cancelled) setCacheItem(normalizeCacheItemForDrawer(payload.cacheItem, bookingTicket, payload.forceOpen));
|
|
98
|
+
if (!cancelled) setCacheItem(normalizeCacheItemForDrawer(payload.cacheItem, bookingTicket, tempOrder, payload.forceOpen));
|
|
94
99
|
});
|
|
95
100
|
return () => {
|
|
96
101
|
cancelled = true;
|
|
@@ -176,10 +181,10 @@ const BookingEditHostRenderer = () => {
|
|
|
176
181
|
cacheItem === null || cacheItem === void 0 || (_cacheItem$_data = cacheItem._data) === null || _cacheItem$_data === void 0 || (_cacheItem$_data = _cacheItem$_data.resources) === null || _cacheItem$_data === void 0 ? void 0 : _cacheItem$_data.length
|
|
177
182
|
]);
|
|
178
183
|
const bookingState = useMemo(() => {
|
|
179
|
-
var _bookingTicket$
|
|
184
|
+
var _bookingTicket$getBoo3, _bookingTicket$getBoo4, _ref3, _payload$date2, _bookingTicket$getBoo5, _bookingTicket$getTem3, _bookingTicket$getTem4, _bookingTicket$getOrd, _bookingTicket$getOth;
|
|
180
185
|
if (!cacheItem) return null;
|
|
181
|
-
const bookingConfig = (_bookingTicket$
|
|
182
|
-
const date = (_ref3 = (_payload$date2 = payload === null || payload === void 0 ? void 0 : payload.date) !== null && _payload$date2 !== void 0 ? _payload$date2 : bookingTicket === null || bookingTicket === void 0 || (_bookingTicket$
|
|
186
|
+
const bookingConfig = (_bookingTicket$getBoo3 = bookingTicket === null || bookingTicket === void 0 || (_bookingTicket$getBoo4 = bookingTicket.getBookingConfig) === null || _bookingTicket$getBoo4 === void 0 ? void 0 : _bookingTicket$getBoo4.call(bookingTicket)) !== null && _bookingTicket$getBoo3 !== void 0 ? _bookingTicket$getBoo3 : null;
|
|
187
|
+
const date = (_ref3 = (_payload$date2 = payload === null || payload === void 0 ? void 0 : payload.date) !== null && _payload$date2 !== void 0 ? _payload$date2 : bookingTicket === null || bookingTicket === void 0 || (_bookingTicket$getBoo5 = bookingTicket.getBookingDate) === null || _bookingTicket$getBoo5 === void 0 ? void 0 : _bookingTicket$getBoo5.call(bookingTicket)) !== null && _ref3 !== void 0 ? _ref3 : dayjs().format("YYYY-MM-DD");
|
|
183
188
|
const liveTempOrder = (_bookingTicket$getTem3 = bookingTicket === null || bookingTicket === void 0 || (_bookingTicket$getTem4 = bookingTicket.getTempOrder) === null || _bookingTicket$getTem4 === void 0 ? void 0 : _bookingTicket$getTem4.call(bookingTicket)) !== null && _bookingTicket$getTem3 !== void 0 ? _bookingTicket$getTem3 : tempOrder;
|
|
184
189
|
return buildBookingEditDrawerState({
|
|
185
190
|
cacheItem,
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import "./hosts/createInstanceHostBridge.js";
|
|
2
|
+
import "./holderConfirm/createHolderConfirmBridge.js";
|
|
3
|
+
import "./giftSelect/createGiftSelectBridge.js";
|
|
4
|
+
import "./context/SalesSdkHostBridgesContext.js";
|
|
5
|
+
import "./utils/formatHolderOptions.js";
|
|
6
|
+
import "./utils/enrichCartLineHolderDisplay.js";
|
|
7
|
+
import "./context/SalesSdkHolderContext.js";
|
|
8
|
+
import "./utils/appendPromotionTags.js";
|
|
9
|
+
import "./context/SalesSdkUIHostsContext.js";
|
|
10
|
+
import "./utils/runAddProductFlow.js";
|
|
11
|
+
import "./components/showAddToCartToast.js";
|
|
12
|
+
import "./utils/resolveAddProductDebounceKey.js";
|
|
13
|
+
import "./utils/productSkuOptions.js";
|
|
14
|
+
import "./utils/identity.js";
|
|
15
|
+
import "./utils/resolveInCartQuantityForAddToast.js";
|
|
16
|
+
import "./utils/addProductWithFlowDebounced.js";
|
|
17
|
+
import "./utils/customerAuthGate.js";
|
|
18
|
+
import "./utils/bookingDate.js";
|
|
19
|
+
import "./utils/holderSubmitValidation.js";
|
|
20
|
+
import "./utils/removeOrderProducts.js";
|
|
21
|
+
import "./selectors.js";
|
|
22
|
+
import "./utils/enrich.js";
|
|
23
|
+
import "./giftSelect/createOpenGiftSelectHost.js";
|
|
24
|
+
import "./utils/ensureHoldersBeforeSubmit.js";
|
|
25
|
+
import "./hooks/useSalesSdk.js";
|
|
26
|
+
import "./bookingEditService/BookingEditServiceDrawer.js";
|
|
27
|
+
import "./hosts/BookingEditHostRenderer.js";
|
|
28
|
+
import "./hosts/CustomerAuthHostRenderer.js";
|
|
29
|
+
import "./hooks/useSalesSdkCart.js";
|
|
30
|
+
import "./hooks/useSalesSdkCustomer.js";
|
|
31
|
+
import "./normalProductDetail/NormalProductDetailHostRenderer.js";
|
|
32
|
+
import "./hosts/createOpenBookingEditHost.js";
|
|
33
|
+
import "./hosts/createOpenMultiDaySelectHost.js";
|
|
34
|
+
import "./hosts/createOpenHolderSelectHost.js";
|
|
35
|
+
import "./hosts/createOpenCustomerAuthHost.js";
|
|
36
|
+
import "./demo/hosts/legacyOpenProductDetail.js";
|
|
37
|
+
import "./hosts/createCompositeOpenProductDetailHost.js";
|
|
38
|
+
import "./normalProductDetail/createOpenNormalProductDetailHost.js";
|
|
39
|
+
import "./normalProductDetail/createOpenBookingSelectionFlowHost.js";
|
|
40
|
+
import "./giftSelect/GiftSelectModal.js";
|
|
41
|
+
import "./giftSelect/GiftSelectHostRenderer.js";
|
|
42
|
+
import "./context/SalesSdkProvider.js";
|
|
43
|
+
import "./context/SalesSdkDishContext.js";
|
|
44
|
+
import "./context/SalesSdkBookingContext.js";
|
|
45
|
+
import "./hooks/useSalesSdkSummary.js";
|
|
46
|
+
import "./hooks/useSalesSdkProducts.js";
|
|
47
|
+
import "./demo/index.js";
|
|
48
|
+
import "./hooks/useSalesSdkDish.js";
|
|
49
|
+
import "./hooks/useCurrentSalesSdkDish.js";
|
|
50
|
+
import "./hooks/useSyncOsModule.js";
|
|
51
|
+
export {};
|
|
@@ -31,4 +31,4 @@ function subscribeBookingDateChange(bookingTicket, callback) {
|
|
|
31
31
|
return typeof off === "function" ? off : () => {};
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
|
-
export { formatBookingDateTime, subscribeBookingDateChange };
|
|
34
|
+
export { BOOKING_CONTEXT_DATE_EVENT, formatBookingDateTime, subscribeBookingDateChange };
|
|
@@ -62,4 +62,4 @@ function normalizeCustomerAuthCustomer(value) {
|
|
|
62
62
|
return null;
|
|
63
63
|
}
|
|
64
64
|
//#endregion
|
|
65
|
-
export { isValidOrderCustomerId, normalizeCustomerAuthCustomer, resolveCustomerAuthCurrentCustomerId, shouldPromptCustomerAuthForProduct };
|
|
65
|
+
export { isHolderRequiredProduct, isKioskRuntime, isValidOrderCustomerId, normalizeCustomerAuthCustomer, resolveCustomerAuthCurrentCustomerId, shouldPromptCustomerAuthForProduct };
|
|
@@ -71,4 +71,4 @@ function buildHolderListRequestKey(params) {
|
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
//#endregion
|
|
74
|
-
export { buildHolderListRequestKey, buildHolderListRequestParams, enrichCartBookingHolderDisplay, resolveHolderDisplayConfig };
|
|
74
|
+
export { buildHolderListRequestKey, buildHolderListRequestParams, enrichCartBookingHolderDisplay, pickHolderIdFromBooking, resolveHolderDisplayConfig };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import dayjs from "dayjs";
|
|
2
|
+
//#region src/plus/salesSdk/utils/resolvePreviousService.ts
|
|
3
|
+
/**
|
|
4
|
+
* 取得下一预约计算开始时间时所需的“上一服务”。
|
|
5
|
+
*
|
|
6
|
+
* 对齐 info2:它会过滤自定义/普通商品后,通过 getLastServer 取 service.value[0]。
|
|
7
|
+
* SalesSdk 的 tempOrder.bookings 按加入顺序追加,因此从后向前取最后一条
|
|
8
|
+
* 时间完整的商品预约,转换为 OS BookingCalcContext 所需结构。
|
|
9
|
+
* `parent_id === 0` 是订单级 root booking,不对应商品行,需要跳过;
|
|
10
|
+
* 新建本地预约的 parent_id 可能尚未生成(null/undefined),仍属于有效候选。
|
|
11
|
+
*/
|
|
12
|
+
function resolvePreviousService(tempOrder) {
|
|
13
|
+
const bookings = Array.isArray(tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.bookings) ? tempOrder.bookings : [];
|
|
14
|
+
for (let index = bookings.length - 1; index >= 0; index -= 1) {
|
|
15
|
+
const booking = bookings[index];
|
|
16
|
+
if ((booking === null || booking === void 0 ? void 0 : booking.parent_id) != null && Number(booking.parent_id) === 0) continue;
|
|
17
|
+
if (!(booking === null || booking === void 0 ? void 0 : booking.start_date) || !(booking === null || booking === void 0 ? void 0 : booking.start_time) || !(booking === null || booking === void 0 ? void 0 : booking.end_date) || !(booking === null || booking === void 0 ? void 0 : booking.end_time)) continue;
|
|
18
|
+
const startDate = dayjs(`${booking.start_date} ${booking.start_time}`);
|
|
19
|
+
const endDate = dayjs(`${booking.end_date} ${booking.end_time}`);
|
|
20
|
+
if (!startDate.isValid() || !endDate.isValid()) continue;
|
|
21
|
+
return { _extend: {
|
|
22
|
+
startDate,
|
|
23
|
+
endDate
|
|
24
|
+
} };
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { resolvePreviousService };
|