@pisell/private-materials 6.12.313 → 6.12.314
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 +3 -3
- package/build/lowcode/view.js +3 -3
- package/es/components/bigSale/index.js +1 -1
- package/es/components/bigSale/templates/Kiosk/index.js +17 -16
- package/es/components/kioskSale/index.js +1 -1
- package/es/plus/salesSdk/context/SalesSdkCartContext.js +2 -1
- package/es/plus/salesSdk/types.d.ts +1 -0
- package/es/plus/salesSdk/utils/editCartLineBooking.js +1 -0
- package/lib/components/bigSale/index.js +1 -1
- package/lib/components/bigSale/templates/Kiosk/index.js +17 -16
- package/lib/components/kioskSale/index.js +1 -1
- package/lib/plus/salesSdk/context/SalesSdkCartContext.js +2 -1
- package/lib/plus/salesSdk/types.d.ts +1 -0
- package/lib/plus/salesSdk/utils/editCartLineBooking.js +1 -0
- package/package.json +3 -3
|
@@ -117,7 +117,7 @@ const BigSale = ({ osKey = DEFAULT_OS_KEY, enableMultiCurrencySettlement = false
|
|
|
117
117
|
variant
|
|
118
118
|
]);
|
|
119
119
|
const isPosProductSelectionFlow = resolvedTemplate !== "kiosk" && isProductSelectionFlow;
|
|
120
|
-
const fulfillmentOtherParams = useMemo(() => _objectSpread2(_objectSpread2({}, otherParams), {}, { enablePickupTiming: resolvedTemplate !== "HDLKiosk" }), [otherParams, resolvedTemplate]);
|
|
120
|
+
const fulfillmentOtherParams = useMemo(() => _objectSpread2(_objectSpread2({ enforceSingleBookingStartDate: false }, otherParams), {}, { enablePickupTiming: resolvedTemplate !== "HDLKiosk" }), [otherParams, resolvedTemplate]);
|
|
121
121
|
const resolvedSaleDetailModuleConfig = useMemo(() => isPosProductSelectionFlow ? _objectSpread2(_objectSpread2({}, saleDetailModuleConfig), {}, { cartItems: _objectSpread2(_objectSpread2({}, saleDetailModuleConfig === null || saleDetailModuleConfig === void 0 ? void 0 : saleDetailModuleConfig.cartItems), {}, { bookingQuantityMode: "editable" }) }) : saleDetailModuleConfig, [isPosProductSelectionFlow, saleDetailModuleConfig]);
|
|
122
122
|
const runtimeRef = useRef({
|
|
123
123
|
date: void 0,
|
|
@@ -244,6 +244,7 @@ function KioskBigSaleTemplate({ isActive = true, osKey, productListPreferencesCh
|
|
|
244
244
|
const app = (_utils$getApp = utils.getApp) === null || _utils$getApp === void 0 ? void 0 : _utils$getApp.call(utils);
|
|
245
245
|
const hostChannel = String((engineContext === null || engineContext === void 0 || (_engineContext$appHel2 = engineContext.appHelper) === null || _engineContext$appHel2 === void 0 || (_engineContext$appHel2 = _engineContext$appHel2.constants) === null || _engineContext$appHel2 === void 0 || (_engineContext$appHel2 = _engineContext$appHel2.config) === null || _engineContext$appHel2 === void 0 ? void 0 : _engineContext$appHel2.channel) || "").trim().toLowerCase();
|
|
246
246
|
const shouldUseConsumerPayment = hostChannel === "pc" || hostChannel === "h5";
|
|
247
|
+
const shouldUseFulfillmentCheckout = shouldUseConsumerPayment || platform === "kiosk";
|
|
247
248
|
const shouldRequireLogin = isRequireLoginChannel(hostChannel);
|
|
248
249
|
const { isLoggedIn, openLoginModal } = useSalesUserLogin();
|
|
249
250
|
const [view, setView] = useState(() => normalizeKioskNavigableView(kioskShellLayout, readKioskSessionView(context.sales.bookingTicket)));
|
|
@@ -264,8 +265,8 @@ function KioskBigSaleTemplate({ isActive = true, osKey, productListPreferencesCh
|
|
|
264
265
|
const fulfillmentOpeningRef = useRef(false);
|
|
265
266
|
const fulfillmentCheckout = useKioskFulfillmentCheckout({
|
|
266
267
|
context,
|
|
267
|
-
enabled:
|
|
268
|
-
scopeKey: `${osKey || ""}:${businessCode || ""}:${hostChannel}`,
|
|
268
|
+
enabled: shouldUseFulfillmentCheckout,
|
|
269
|
+
scopeKey: `${osKey || ""}:${businessCode || ""}:${hostChannel}:${platform}`,
|
|
269
270
|
isActive,
|
|
270
271
|
mobile: hostChannel === "h5"
|
|
271
272
|
});
|
|
@@ -417,7 +418,7 @@ function KioskBigSaleTemplate({ isActive = true, osKey, productListPreferencesCh
|
|
|
417
418
|
...((_saleDetailModuleConf = saleDetailModuleConfig === null || saleDetailModuleConfig === void 0 ? void 0 : saleDetailModuleConfig.hidden) !== null && _saleDetailModuleConf !== void 0 ? _saleDetailModuleConf : []).filter((moduleKey) => !KIOSK_REQUIRED_MODULES.has(moduleKey))
|
|
418
419
|
])],
|
|
419
420
|
cartItems: _objectSpread2(_objectSpread2({}, saleDetailModuleConfig === null || saleDetailModuleConfig === void 0 ? void 0 : saleDetailModuleConfig.cartItems), {}, {
|
|
420
|
-
beforeContent:
|
|
421
|
+
beforeContent: shouldUseFulfillmentCheckout ? saleDetailModuleConfig === null || saleDetailModuleConfig === void 0 || (_saleDetailModuleConf2 = saleDetailModuleConfig.cartItems) === null || _saleDetailModuleConf2 === void 0 ? void 0 : _saleDetailModuleConf2.beforeContent : /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(KioskPickupTiming, {
|
|
421
422
|
key: `${osKey || ""}:${businessCode || ""}:${hostChannel}:${String(((_context$sales$tempOr = context.sales.tempOrder) === null || _context$sales$tempOr === void 0 || (_context$sales$tempOr = _context$sales$tempOr._extend) === null || _context$sales$tempOr === void 0 ? void 0 : _context$sales$tempOr.localId) || ((_context$sales$tempOr2 = context.sales.tempOrder) === null || _context$sales$tempOr2 === void 0 ? void 0 : _context$sales$tempOr2.external_sale_number) || ((_context$sales$tempOr3 = context.sales.tempOrder) === null || _context$sales$tempOr3 === void 0 ? void 0 : _context$sales$tempOr3.order_id) || orderId || "draft")}`,
|
|
422
423
|
context,
|
|
423
424
|
mobile: variant === "phone",
|
|
@@ -463,7 +464,7 @@ function KioskBigSaleTemplate({ isActive = true, osKey, productListPreferencesCh
|
|
|
463
464
|
orderId,
|
|
464
465
|
osKey,
|
|
465
466
|
pickupTimingError,
|
|
466
|
-
|
|
467
|
+
shouldUseFulfillmentCheckout,
|
|
467
468
|
saleDetailModuleConfig,
|
|
468
469
|
requestRemoveItemConfirmation,
|
|
469
470
|
variant
|
|
@@ -645,7 +646,7 @@ function KioskBigSaleTemplate({ isActive = true, osKey, productListPreferencesCh
|
|
|
645
646
|
};
|
|
646
647
|
const performCheckout = function() {
|
|
647
648
|
var _ref22 = _asyncToGenerator(function* () {
|
|
648
|
-
if (checkoutOpeningRef.current || !
|
|
649
|
+
if (checkoutOpeningRef.current || !shouldUseFulfillmentCheckout && isPickupTimingPending || cartItemCount === 0) return;
|
|
649
650
|
checkoutOpeningRef.current = true;
|
|
650
651
|
const openingScope = fulfillmentCheckout.captureScope();
|
|
651
652
|
const isCurrentCheckoutRequest = () => {
|
|
@@ -669,15 +670,15 @@ function KioskBigSaleTemplate({ isActive = true, osKey, productListPreferencesCh
|
|
|
669
670
|
setPickupTimingError(void 0);
|
|
670
671
|
try {
|
|
671
672
|
var _context$sales$bookin4, _context$sales$bookin5;
|
|
672
|
-
if (
|
|
673
|
+
if (shouldUseFulfillmentCheckout && !(yield fulfillmentCheckout.request(true))) {
|
|
673
674
|
setNavigableView("cart");
|
|
674
675
|
return;
|
|
675
676
|
}
|
|
676
|
-
if (
|
|
677
|
+
if (shouldUseFulfillmentCheckout && !fulfillmentCheckout.isCurrent(openingScope)) return;
|
|
677
678
|
yield context.cart.waitForCartConsistency();
|
|
678
|
-
if (
|
|
679
|
+
if (shouldUseFulfillmentCheckout && !fulfillmentCheckout.isCurrent(openingScope)) return;
|
|
679
680
|
yield (_context$sales$bookin4 = context.sales.bookingTicket) === null || _context$sales$bookin4 === void 0 || (_context$sales$bookin5 = _context$sales$bookin4.preparePickupTimingForCheckout) === null || _context$sales$bookin5 === void 0 ? void 0 : _context$sales$bookin5.call(_context$sales$bookin4);
|
|
680
|
-
if (
|
|
681
|
+
if (shouldUseFulfillmentCheckout && !fulfillmentCheckout.isCurrent(openingScope)) return;
|
|
681
682
|
context.cart.refreshCartSnapshot();
|
|
682
683
|
if (!isCurrentCheckoutRequest()) return;
|
|
683
684
|
} catch (reason) {
|
|
@@ -940,7 +941,7 @@ function KioskBigSaleTemplate({ isActive = true, osKey, productListPreferencesCh
|
|
|
940
941
|
const beginCheckoutWithFulfillment = function() {
|
|
941
942
|
var _ref25 = _asyncToGenerator(function* () {
|
|
942
943
|
if (!(yield businessAvailability.ensureCanShop())) return;
|
|
943
|
-
if (!
|
|
944
|
+
if (!shouldUseFulfillmentCheckout) {
|
|
944
945
|
continueCheckout();
|
|
945
946
|
return;
|
|
946
947
|
}
|
|
@@ -996,9 +997,9 @@ function KioskBigSaleTemplate({ isActive = true, osKey, productListPreferencesCh
|
|
|
996
997
|
openCustomerAuth: (payload) => salesHostBridges.customerAuth.request(payload),
|
|
997
998
|
setOrderCustomer: (_context$sales$bookin31 = context.sales.bookingTicket) === null || _context$sales$bookin31 === void 0 || (_context$sales$bookin31 = _context$sales$bookin31.setOrderCustomer) === null || _context$sales$bookin31 === void 0 ? void 0 : _context$sales$bookin31.bind(context.sales.bookingTicket),
|
|
998
999
|
loadDiscountConfig: () => context.cart.loadDiscountConfig(),
|
|
999
|
-
isActive: () => isActiveRef.current && (!
|
|
1000
|
+
isActive: () => isActiveRef.current && (!shouldUseFulfillmentCheckout || fulfillmentCheckout.isCurrent(openingScope))
|
|
1000
1001
|
}).then((canProceed) => {
|
|
1001
|
-
if (canProceed && isActiveRef.current && (!
|
|
1002
|
+
if (canProceed && isActiveRef.current && (!shouldUseFulfillmentCheckout || fulfillmentCheckout.isCurrent(openingScope))) return beginCheckoutWithFulfillment();
|
|
1002
1003
|
}).catch((error) => {
|
|
1003
1004
|
console.warn("[KioskBigSale] Login2 登录后同步下单客户失败", error);
|
|
1004
1005
|
}).finally(() => {
|
|
@@ -1015,7 +1016,7 @@ function KioskBigSaleTemplate({ isActive = true, osKey, productListPreferencesCh
|
|
|
1015
1016
|
},
|
|
1016
1017
|
callback: createKioskLoginContinuationHandler({
|
|
1017
1018
|
continueCheckout: beginCheckoutWithFulfillment,
|
|
1018
|
-
isActive: () => isActiveRef.current && (!
|
|
1019
|
+
isActive: () => isActiveRef.current && (!shouldUseFulfillmentCheckout || fulfillmentCheckout.isCurrent(openingScope)),
|
|
1019
1020
|
syncAuthenticatedOrderCustomer: () => syncKioskAuthenticatedOrderCustomer({
|
|
1020
1021
|
bookingTicket: context.sales.bookingTicket,
|
|
1021
1022
|
loadDiscountConfig: () => context.cart.loadDiscountConfig()
|
|
@@ -1147,8 +1148,8 @@ function KioskBigSaleTemplate({ isActive = true, osKey, productListPreferencesCh
|
|
|
1147
1148
|
})) : null, layoutState.showCart ? /* @__PURE__ */ React.createElement("section", {
|
|
1148
1149
|
"aria-label": locales.getText("pisell2.big-sale.kiosk.your-order"),
|
|
1149
1150
|
className: "pisell-kiosk-sale__screen pisell-kiosk-sale__cart-screen",
|
|
1150
|
-
"data-fulfillment": !
|
|
1151
|
-
},
|
|
1151
|
+
"data-fulfillment": !shouldUseFulfillmentCheckout && isPickupTimingVisible ? "true" : "false"
|
|
1152
|
+
}, shouldUseFulfillmentCheckout || !isPickupTimingVisible ? /* @__PURE__ */ React.createElement("header", { className: "pisell-kiosk-sale__cart-header" }, /* @__PURE__ */ React.createElement("h1", null, locales.getText("pisell2.big-sale.kiosk.your-order"), " ", "(", cartItemCount, ")")) : null, /* @__PURE__ */ React.createElement("div", { className: "pisell-kiosk-sale__cart-body" }, shouldUseFulfillmentCheckout && pickupTimingError ? /* @__PURE__ */ React.createElement(Alert, {
|
|
1152
1153
|
type: "error",
|
|
1153
1154
|
showIcon: true,
|
|
1154
1155
|
message: pickupTimingError,
|
|
@@ -1176,7 +1177,7 @@ function KioskBigSaleTemplate({ isActive = true, osKey, productListPreferencesCh
|
|
|
1176
1177
|
promotionAppliedCount: selectedCustomerVoucherCount,
|
|
1177
1178
|
onAddNote: openOrderNoteModal,
|
|
1178
1179
|
onBack: handleCapsuleBack,
|
|
1179
|
-
checkoutLoading: isCheckoutLoading || !
|
|
1180
|
+
checkoutLoading: isCheckoutLoading || !shouldUseFulfillmentCheckout && view === "cart" && isPickupTimingPending,
|
|
1180
1181
|
checkoutDisabled: shoppingBlocked,
|
|
1181
1182
|
onCheckout: handleCheckout,
|
|
1182
1183
|
onTogglePromotion: isVirtualSettlementOrder ? void 0 : handleToggleFloatingPromotion,
|
|
@@ -63,7 +63,7 @@ function KioskSale(props) {
|
|
|
63
63
|
const { menu_list_ids: _ignoredMenuListIds } = productLoadParams;
|
|
64
64
|
return _objectWithoutProperties(productLoadParams, _excluded2);
|
|
65
65
|
}, [productLoadParams]);
|
|
66
|
-
const resolvedOtherParams = useMemo(() => _objectSpread2(_objectSpread2(_objectSpread2({}, otherParams || {}), channel ? { channel } : {}), {}, { enableBusinessAvailability: Boolean(kioskPresentation.platform) }, kioskPresentation.platform ? { platform: kioskPresentation.platform } : {}), [
|
|
66
|
+
const resolvedOtherParams = useMemo(() => _objectSpread2(_objectSpread2(_objectSpread2({}, otherParams || {}), {}, { enforceSingleBookingStartDate: true }, channel ? { channel } : {}), {}, { enableBusinessAvailability: Boolean(kioskPresentation.platform) }, kioskPresentation.platform ? { platform: kioskPresentation.platform } : {}), [
|
|
67
67
|
channel,
|
|
68
68
|
kioskPresentation.platform,
|
|
69
69
|
otherParams
|
|
@@ -983,7 +983,8 @@ const SalesSdkCartProvider = ({ children, normalProductDetailConfig, deferHolder
|
|
|
983
983
|
}
|
|
984
984
|
return products;
|
|
985
985
|
}
|
|
986
|
-
|
|
986
|
+
let products = yield bookingTicket.addProductToOrder(productToAdd, booking, Object.keys(addOptions).length > 0 ? addOptions : void 0);
|
|
987
|
+
if (booking && bookingTicket.removeBookingProductsOutsideStartDate) products = yield bookingTicket.removeBookingProductsOutsideStartDate(booking.start_date);
|
|
987
988
|
const deferredConsistencyRefresh = scheduleDeferredAddConsistencyRefresh();
|
|
988
989
|
refreshCartSnapshot(deferredConsistencyRefresh.refreshVersion);
|
|
989
990
|
yield deferredConsistencyRefresh.promise;
|
|
@@ -1028,6 +1028,7 @@ interface BookingTicketHandle extends PickupTimingHandle {
|
|
|
1028
1028
|
setSalesNote?: (input: SalesSdkSetSalesNoteInput) => Promise<SalesSdkSalesNote>;
|
|
1029
1029
|
removeSalesNote?: (uuid: string) => Promise<void>;
|
|
1030
1030
|
getOrderProducts: () => ScanOrderOrderProduct[];
|
|
1031
|
+
removeBookingProductsOutsideStartDate?: (startDate: unknown) => Promise<ScanOrderOrderProduct[]>;
|
|
1031
1032
|
getDiscountList: () => any[];
|
|
1032
1033
|
getOriginalDiscountList?: () => any[];
|
|
1033
1034
|
replaceDiscountStoreLists?: (params: {
|
|
@@ -581,6 +581,7 @@ function _editCartLineBooking() {
|
|
|
581
581
|
}, allowBookingReprice ? { allow_booking_reprice: true } : {}));
|
|
582
582
|
}
|
|
583
583
|
commitLifecycle === null || commitLifecycle === void 0 || commitLifecycle.beforeCommit();
|
|
584
|
+
if (bookingTicket.removeBookingProductsOutsideStartDate) yield bookingTicket.removeBookingProductsOutsideStartDate(bookingPatch === null || bookingPatch === void 0 ? void 0 : bookingPatch.start_date);
|
|
584
585
|
products = input.syncQuantityByRows ? yield input.syncQuantityByRows({
|
|
585
586
|
sources: targets,
|
|
586
587
|
targetQuantity,
|
|
@@ -119,7 +119,7 @@ const BigSale = ({ osKey = DEFAULT_OS_KEY, enableMultiCurrencySettlement = false
|
|
|
119
119
|
variant
|
|
120
120
|
]);
|
|
121
121
|
const isPosProductSelectionFlow = resolvedTemplate !== "kiosk" && isProductSelectionFlow;
|
|
122
|
-
const fulfillmentOtherParams = (0, react.useMemo)(() => require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, otherParams), {}, { enablePickupTiming: resolvedTemplate !== "HDLKiosk" }), [otherParams, resolvedTemplate]);
|
|
122
|
+
const fulfillmentOtherParams = (0, react.useMemo)(() => require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({ enforceSingleBookingStartDate: false }, otherParams), {}, { enablePickupTiming: resolvedTemplate !== "HDLKiosk" }), [otherParams, resolvedTemplate]);
|
|
123
123
|
const resolvedSaleDetailModuleConfig = (0, react.useMemo)(() => isPosProductSelectionFlow ? require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, saleDetailModuleConfig), {}, { cartItems: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, saleDetailModuleConfig === null || saleDetailModuleConfig === void 0 ? void 0 : saleDetailModuleConfig.cartItems), {}, { bookingQuantityMode: "editable" }) }) : saleDetailModuleConfig, [isPosProductSelectionFlow, saleDetailModuleConfig]);
|
|
124
124
|
const runtimeRef = (0, react.useRef)({
|
|
125
125
|
date: void 0,
|
|
@@ -245,6 +245,7 @@ function KioskBigSaleTemplate({ isActive = true, osKey, productListPreferencesCh
|
|
|
245
245
|
const app = (_utils$getApp = utils.getApp) === null || _utils$getApp === void 0 ? void 0 : _utils$getApp.call(utils);
|
|
246
246
|
const hostChannel = String((engineContext === null || engineContext === void 0 || (_engineContext$appHel2 = engineContext.appHelper) === null || _engineContext$appHel2 === void 0 || (_engineContext$appHel2 = _engineContext$appHel2.constants) === null || _engineContext$appHel2 === void 0 || (_engineContext$appHel2 = _engineContext$appHel2.config) === null || _engineContext$appHel2 === void 0 ? void 0 : _engineContext$appHel2.channel) || "").trim().toLowerCase();
|
|
247
247
|
const shouldUseConsumerPayment = hostChannel === "pc" || hostChannel === "h5";
|
|
248
|
+
const shouldUseFulfillmentCheckout = shouldUseConsumerPayment || platform === "kiosk";
|
|
248
249
|
const shouldRequireLogin = require_useSalesUserLogin.isRequireLoginChannel(hostChannel);
|
|
249
250
|
const { isLoggedIn, openLoginModal } = require_useSalesUserLogin.default();
|
|
250
251
|
const [view, setView] = (0, react.useState)(() => require_layout.normalizeKioskNavigableView(kioskShellLayout, readKioskSessionView(context.sales.bookingTicket)));
|
|
@@ -265,8 +266,8 @@ function KioskBigSaleTemplate({ isActive = true, osKey, productListPreferencesCh
|
|
|
265
266
|
const fulfillmentOpeningRef = (0, react.useRef)(false);
|
|
266
267
|
const fulfillmentCheckout = require_useKioskFulfillmentCheckout.default({
|
|
267
268
|
context,
|
|
268
|
-
enabled:
|
|
269
|
-
scopeKey: `${osKey || ""}:${businessCode || ""}:${hostChannel}`,
|
|
269
|
+
enabled: shouldUseFulfillmentCheckout,
|
|
270
|
+
scopeKey: `${osKey || ""}:${businessCode || ""}:${hostChannel}:${platform}`,
|
|
270
271
|
isActive,
|
|
271
272
|
mobile: hostChannel === "h5"
|
|
272
273
|
});
|
|
@@ -418,7 +419,7 @@ function KioskBigSaleTemplate({ isActive = true, osKey, productListPreferencesCh
|
|
|
418
419
|
...((_saleDetailModuleConf = saleDetailModuleConfig === null || saleDetailModuleConfig === void 0 ? void 0 : saleDetailModuleConfig.hidden) !== null && _saleDetailModuleConf !== void 0 ? _saleDetailModuleConf : []).filter((moduleKey) => !KIOSK_REQUIRED_MODULES.has(moduleKey))
|
|
419
420
|
])],
|
|
420
421
|
cartItems: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, saleDetailModuleConfig === null || saleDetailModuleConfig === void 0 ? void 0 : saleDetailModuleConfig.cartItems), {}, {
|
|
421
|
-
beforeContent:
|
|
422
|
+
beforeContent: shouldUseFulfillmentCheckout ? saleDetailModuleConfig === null || saleDetailModuleConfig === void 0 || (_saleDetailModuleConf2 = saleDetailModuleConfig.cartItems) === null || _saleDetailModuleConf2 === void 0 ? void 0 : _saleDetailModuleConf2.beforeContent : /* @__PURE__ */ react.default.createElement(react.default.Fragment, null, /* @__PURE__ */ react.default.createElement(require_KioskPickupTiming.default, {
|
|
422
423
|
key: `${osKey || ""}:${businessCode || ""}:${hostChannel}:${String(((_context$sales$tempOr = context.sales.tempOrder) === null || _context$sales$tempOr === void 0 || (_context$sales$tempOr = _context$sales$tempOr._extend) === null || _context$sales$tempOr === void 0 ? void 0 : _context$sales$tempOr.localId) || ((_context$sales$tempOr2 = context.sales.tempOrder) === null || _context$sales$tempOr2 === void 0 ? void 0 : _context$sales$tempOr2.external_sale_number) || ((_context$sales$tempOr3 = context.sales.tempOrder) === null || _context$sales$tempOr3 === void 0 ? void 0 : _context$sales$tempOr3.order_id) || orderId || "draft")}`,
|
|
423
424
|
context,
|
|
424
425
|
mobile: variant === "phone",
|
|
@@ -464,7 +465,7 @@ function KioskBigSaleTemplate({ isActive = true, osKey, productListPreferencesCh
|
|
|
464
465
|
orderId,
|
|
465
466
|
osKey,
|
|
466
467
|
pickupTimingError,
|
|
467
|
-
|
|
468
|
+
shouldUseFulfillmentCheckout,
|
|
468
469
|
saleDetailModuleConfig,
|
|
469
470
|
requestRemoveItemConfirmation,
|
|
470
471
|
variant
|
|
@@ -646,7 +647,7 @@ function KioskBigSaleTemplate({ isActive = true, osKey, productListPreferencesCh
|
|
|
646
647
|
};
|
|
647
648
|
const performCheckout = function() {
|
|
648
649
|
var _ref22 = require_asyncToGenerator._asyncToGenerator(function* () {
|
|
649
|
-
if (checkoutOpeningRef.current || !
|
|
650
|
+
if (checkoutOpeningRef.current || !shouldUseFulfillmentCheckout && isPickupTimingPending || cartItemCount === 0) return;
|
|
650
651
|
checkoutOpeningRef.current = true;
|
|
651
652
|
const openingScope = fulfillmentCheckout.captureScope();
|
|
652
653
|
const isCurrentCheckoutRequest = () => {
|
|
@@ -670,15 +671,15 @@ function KioskBigSaleTemplate({ isActive = true, osKey, productListPreferencesCh
|
|
|
670
671
|
setPickupTimingError(void 0);
|
|
671
672
|
try {
|
|
672
673
|
var _context$sales$bookin4, _context$sales$bookin5;
|
|
673
|
-
if (
|
|
674
|
+
if (shouldUseFulfillmentCheckout && !(yield fulfillmentCheckout.request(true))) {
|
|
674
675
|
setNavigableView("cart");
|
|
675
676
|
return;
|
|
676
677
|
}
|
|
677
|
-
if (
|
|
678
|
+
if (shouldUseFulfillmentCheckout && !fulfillmentCheckout.isCurrent(openingScope)) return;
|
|
678
679
|
yield context.cart.waitForCartConsistency();
|
|
679
|
-
if (
|
|
680
|
+
if (shouldUseFulfillmentCheckout && !fulfillmentCheckout.isCurrent(openingScope)) return;
|
|
680
681
|
yield (_context$sales$bookin4 = context.sales.bookingTicket) === null || _context$sales$bookin4 === void 0 || (_context$sales$bookin5 = _context$sales$bookin4.preparePickupTimingForCheckout) === null || _context$sales$bookin5 === void 0 ? void 0 : _context$sales$bookin5.call(_context$sales$bookin4);
|
|
681
|
-
if (
|
|
682
|
+
if (shouldUseFulfillmentCheckout && !fulfillmentCheckout.isCurrent(openingScope)) return;
|
|
682
683
|
context.cart.refreshCartSnapshot();
|
|
683
684
|
if (!isCurrentCheckoutRequest()) return;
|
|
684
685
|
} catch (reason) {
|
|
@@ -941,7 +942,7 @@ function KioskBigSaleTemplate({ isActive = true, osKey, productListPreferencesCh
|
|
|
941
942
|
const beginCheckoutWithFulfillment = function() {
|
|
942
943
|
var _ref25 = require_asyncToGenerator._asyncToGenerator(function* () {
|
|
943
944
|
if (!(yield businessAvailability.ensureCanShop())) return;
|
|
944
|
-
if (!
|
|
945
|
+
if (!shouldUseFulfillmentCheckout) {
|
|
945
946
|
continueCheckout();
|
|
946
947
|
return;
|
|
947
948
|
}
|
|
@@ -997,9 +998,9 @@ function KioskBigSaleTemplate({ isActive = true, osKey, productListPreferencesCh
|
|
|
997
998
|
openCustomerAuth: (payload) => salesHostBridges.customerAuth.request(payload),
|
|
998
999
|
setOrderCustomer: (_context$sales$bookin31 = context.sales.bookingTicket) === null || _context$sales$bookin31 === void 0 || (_context$sales$bookin31 = _context$sales$bookin31.setOrderCustomer) === null || _context$sales$bookin31 === void 0 ? void 0 : _context$sales$bookin31.bind(context.sales.bookingTicket),
|
|
999
1000
|
loadDiscountConfig: () => context.cart.loadDiscountConfig(),
|
|
1000
|
-
isActive: () => isActiveRef.current && (!
|
|
1001
|
+
isActive: () => isActiveRef.current && (!shouldUseFulfillmentCheckout || fulfillmentCheckout.isCurrent(openingScope))
|
|
1001
1002
|
}).then((canProceed) => {
|
|
1002
|
-
if (canProceed && isActiveRef.current && (!
|
|
1003
|
+
if (canProceed && isActiveRef.current && (!shouldUseFulfillmentCheckout || fulfillmentCheckout.isCurrent(openingScope))) return beginCheckoutWithFulfillment();
|
|
1003
1004
|
}).catch((error) => {
|
|
1004
1005
|
console.warn("[KioskBigSale] Login2 登录后同步下单客户失败", error);
|
|
1005
1006
|
}).finally(() => {
|
|
@@ -1016,7 +1017,7 @@ function KioskBigSaleTemplate({ isActive = true, osKey, productListPreferencesCh
|
|
|
1016
1017
|
},
|
|
1017
1018
|
callback: createKioskLoginContinuationHandler({
|
|
1018
1019
|
continueCheckout: beginCheckoutWithFulfillment,
|
|
1019
|
-
isActive: () => isActiveRef.current && (!
|
|
1020
|
+
isActive: () => isActiveRef.current && (!shouldUseFulfillmentCheckout || fulfillmentCheckout.isCurrent(openingScope)),
|
|
1020
1021
|
syncAuthenticatedOrderCustomer: () => syncKioskAuthenticatedOrderCustomer({
|
|
1021
1022
|
bookingTicket: context.sales.bookingTicket,
|
|
1022
1023
|
loadDiscountConfig: () => context.cart.loadDiscountConfig()
|
|
@@ -1148,8 +1149,8 @@ function KioskBigSaleTemplate({ isActive = true, osKey, productListPreferencesCh
|
|
|
1148
1149
|
})) : null, layoutState.showCart ? /* @__PURE__ */ react.default.createElement("section", {
|
|
1149
1150
|
"aria-label": _pisell_utils.locales.getText("pisell2.big-sale.kiosk.your-order"),
|
|
1150
1151
|
className: "pisell-kiosk-sale__screen pisell-kiosk-sale__cart-screen",
|
|
1151
|
-
"data-fulfillment": !
|
|
1152
|
-
},
|
|
1152
|
+
"data-fulfillment": !shouldUseFulfillmentCheckout && isPickupTimingVisible ? "true" : "false"
|
|
1153
|
+
}, shouldUseFulfillmentCheckout || !isPickupTimingVisible ? /* @__PURE__ */ react.default.createElement("header", { className: "pisell-kiosk-sale__cart-header" }, /* @__PURE__ */ react.default.createElement("h1", null, _pisell_utils.locales.getText("pisell2.big-sale.kiosk.your-order"), " ", "(", cartItemCount, ")")) : null, /* @__PURE__ */ react.default.createElement("div", { className: "pisell-kiosk-sale__cart-body" }, shouldUseFulfillmentCheckout && pickupTimingError ? /* @__PURE__ */ react.default.createElement(antd.Alert, {
|
|
1153
1154
|
type: "error",
|
|
1154
1155
|
showIcon: true,
|
|
1155
1156
|
message: pickupTimingError,
|
|
@@ -1177,7 +1178,7 @@ function KioskBigSaleTemplate({ isActive = true, osKey, productListPreferencesCh
|
|
|
1177
1178
|
promotionAppliedCount: selectedCustomerVoucherCount,
|
|
1178
1179
|
onAddNote: openOrderNoteModal,
|
|
1179
1180
|
onBack: handleCapsuleBack,
|
|
1180
|
-
checkoutLoading: isCheckoutLoading || !
|
|
1181
|
+
checkoutLoading: isCheckoutLoading || !shouldUseFulfillmentCheckout && view === "cart" && isPickupTimingPending,
|
|
1181
1182
|
checkoutDisabled: shoppingBlocked,
|
|
1182
1183
|
onCheckout: handleCheckout,
|
|
1183
1184
|
onTogglePromotion: isVirtualSettlementOrder ? void 0 : handleToggleFloatingPromotion,
|
|
@@ -65,7 +65,7 @@ function KioskSale(props) {
|
|
|
65
65
|
const { menu_list_ids: _ignoredMenuListIds } = productLoadParams;
|
|
66
66
|
return require_objectWithoutProperties._objectWithoutProperties(productLoadParams, _excluded2);
|
|
67
67
|
}, [productLoadParams]);
|
|
68
|
-
const resolvedOtherParams = (0, react.useMemo)(() => require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, otherParams || {}), channel ? { channel } : {}), {}, { enableBusinessAvailability: Boolean(kioskPresentation.platform) }, kioskPresentation.platform ? { platform: kioskPresentation.platform } : {}), [
|
|
68
|
+
const resolvedOtherParams = (0, react.useMemo)(() => require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, otherParams || {}), {}, { enforceSingleBookingStartDate: true }, channel ? { channel } : {}), {}, { enableBusinessAvailability: Boolean(kioskPresentation.platform) }, kioskPresentation.platform ? { platform: kioskPresentation.platform } : {}), [
|
|
69
69
|
channel,
|
|
70
70
|
kioskPresentation.platform,
|
|
71
71
|
otherParams
|
|
@@ -986,7 +986,8 @@ const SalesSdkCartProvider = ({ children, normalProductDetailConfig, deferHolder
|
|
|
986
986
|
}
|
|
987
987
|
return products;
|
|
988
988
|
}
|
|
989
|
-
|
|
989
|
+
let products = yield bookingTicket.addProductToOrder(productToAdd, booking, Object.keys(addOptions).length > 0 ? addOptions : void 0);
|
|
990
|
+
if (booking && bookingTicket.removeBookingProductsOutsideStartDate) products = yield bookingTicket.removeBookingProductsOutsideStartDate(booking.start_date);
|
|
990
991
|
const deferredConsistencyRefresh = scheduleDeferredAddConsistencyRefresh();
|
|
991
992
|
refreshCartSnapshot(deferredConsistencyRefresh.refreshVersion);
|
|
992
993
|
yield deferredConsistencyRefresh.promise;
|
|
@@ -1028,6 +1028,7 @@ interface BookingTicketHandle extends PickupTimingHandle {
|
|
|
1028
1028
|
setSalesNote?: (input: SalesSdkSetSalesNoteInput) => Promise<SalesSdkSalesNote>;
|
|
1029
1029
|
removeSalesNote?: (uuid: string) => Promise<void>;
|
|
1030
1030
|
getOrderProducts: () => ScanOrderOrderProduct[];
|
|
1031
|
+
removeBookingProductsOutsideStartDate?: (startDate: unknown) => Promise<ScanOrderOrderProduct[]>;
|
|
1031
1032
|
getDiscountList: () => any[];
|
|
1032
1033
|
getOriginalDiscountList?: () => any[];
|
|
1033
1034
|
replaceDiscountStoreLists?: (params: {
|
|
@@ -583,6 +583,7 @@ function _editCartLineBooking() {
|
|
|
583
583
|
}, allowBookingReprice ? { allow_booking_reprice: true } : {}));
|
|
584
584
|
}
|
|
585
585
|
commitLifecycle === null || commitLifecycle === void 0 || commitLifecycle.beforeCommit();
|
|
586
|
+
if (bookingTicket.removeBookingProductsOutsideStartDate) yield bookingTicket.removeBookingProductsOutsideStartDate(bookingPatch === null || bookingPatch === void 0 ? void 0 : bookingPatch.start_date);
|
|
586
587
|
products = input.syncQuantityByRows ? yield input.syncQuantityByRows({
|
|
587
588
|
sources: targets,
|
|
588
589
|
targetQuantity,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@pisell/private-materials",
|
|
3
|
-
"version": "6.12.
|
|
3
|
+
"version": "6.12.314",
|
|
4
4
|
"main": "./lib/index.js",
|
|
5
5
|
"module": "./es/index.js",
|
|
6
6
|
"types": "./lib/index.d.ts",
|
|
@@ -73,9 +73,9 @@
|
|
|
73
73
|
"use-sync-external-store": "^1.6.0",
|
|
74
74
|
"@pisell/pi-payment-sdk": "0.0.3",
|
|
75
75
|
"@pisell/utils": "3.0.7",
|
|
76
|
-
"@pisell/date-picker": "3.0.12",
|
|
77
76
|
"@pisell/icon": "0.0.11",
|
|
78
|
-
"@pisell/materials": "6.12.79"
|
|
77
|
+
"@pisell/materials": "6.12.79",
|
|
78
|
+
"@pisell/date-picker": "3.0.12"
|
|
79
79
|
},
|
|
80
80
|
"peerDependencies": {
|
|
81
81
|
"react": "^18.0.0",
|