@pisell/private-materials 6.12.223 → 6.12.225
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/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +10 -10
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +10 -10
- package/es/components/bigSale/Base.js +2 -1
- package/es/components/bigSale/components/KioskCartCapsule/index.js +9 -7
- package/es/components/bigSale/components/KioskCartCapsule/index.less +14 -7
- package/es/components/bigSale/components/KioskCartCapsule/viewModel.js +2 -1
- package/es/components/bigSale/index.js +2 -0
- package/es/components/bigSale/templates/Kiosk/index.js +33 -33
- package/es/components/bigSale/templates/Kiosk/index.less +11 -2
- package/es/components/bigSale/templates/Kiosk/layout.js +23 -11
- package/es/components/bigSale/templates/index.js +3 -1
- package/es/components/bigSale/types.d.ts +3 -0
- package/es/components/kioskSale/resolveKioskPresentation.d.ts +4 -0
- package/es/components/kioskSale/resolveKioskPresentation.js +5 -1
- package/es/plus/salesSdk/allergy/AllergySelectionModal.less +1 -1
- package/lib/components/bigSale/Base.js +2 -1
- package/lib/components/bigSale/components/KioskCartCapsule/index.js +9 -7
- package/lib/components/bigSale/components/KioskCartCapsule/index.less +14 -7
- package/lib/components/bigSale/components/KioskCartCapsule/viewModel.js +2 -1
- package/lib/components/bigSale/index.js +2 -0
- package/lib/components/bigSale/templates/Kiosk/index.js +32 -32
- package/lib/components/bigSale/templates/Kiosk/index.less +11 -2
- package/lib/components/bigSale/templates/Kiosk/layout.js +24 -10
- package/lib/components/bigSale/templates/index.js +3 -1
- package/lib/components/bigSale/types.d.ts +3 -0
- package/lib/components/kioskSale/resolveKioskPresentation.d.ts +4 -0
- package/lib/components/kioskSale/resolveKioskPresentation.js +5 -1
- package/lib/plus/salesSdk/allergy/AllergySelectionModal.less +1 -1
- package/package.json +3 -3
|
@@ -9,7 +9,7 @@ const DEFAULT_MODE = "ticket";
|
|
|
9
9
|
/**
|
|
10
10
|
* BigSaleBase 位于 SalesSdkProvider 内部,负责把 SDK 数据分发给商品列表和 SaleDetailBase。
|
|
11
11
|
*/
|
|
12
|
-
function BigSaleBase({ isActive = true, osKey, saleDetailHeaderSlot, rightActionBarClose, overlaySlot, className, style, mode = DEFAULT_MODE, tmpl, template = "standard", variant = "desktop", productLoadParams, businessCode, bookingConfigParams, hideSelectFloorMapResourceAction, productDisplayConfig, productCatalogSessionKey, productCatalogReady, saleDetailTemplate, saleDetailModuleConfig, autoCreate = true, orderId, locale, saleDetailWrapperProps, cartProductsPerRow, showClient, onOrderComplete, externalActionRequest, onExternalActionAccepted, onExternalPaymentSettled }) {
|
|
12
|
+
function BigSaleBase({ isActive = true, osKey, saleDetailHeaderSlot, rightActionBarClose, overlaySlot, className, style, mode = DEFAULT_MODE, tmpl, template = "standard", variant = "desktop", productLoadParams, businessCode, bookingConfigParams, hideSelectFloorMapResourceAction, productDisplayConfig, productCatalogSessionKey, productCatalogReady, kioskShellLayout, saleDetailTemplate, saleDetailModuleConfig, autoCreate = true, orderId, locale, saleDetailWrapperProps, cartProductsPerRow, showClient, onOrderComplete, externalActionRequest, onExternalActionAccepted, onExternalPaymentSettled }) {
|
|
13
13
|
var _context$booking$getB, _context$booking, _context$booking$getB2;
|
|
14
14
|
const context = useBigSaleContext();
|
|
15
15
|
const currentTemplate = tmpl || template || "standard";
|
|
@@ -63,6 +63,7 @@ function BigSaleBase({ isActive = true, osKey, saleDetailHeaderSlot, rightAction
|
|
|
63
63
|
productDisplayConfig,
|
|
64
64
|
productCatalogSessionKey,
|
|
65
65
|
productCatalogReady,
|
|
66
|
+
kioskShellLayout,
|
|
66
67
|
saleDetailTemplate,
|
|
67
68
|
saleDetailModuleConfig: resolvedSaleDetailModuleConfig,
|
|
68
69
|
orderId,
|
|
@@ -7,7 +7,7 @@ import classNames from "classnames";
|
|
|
7
7
|
import { ArrowLeftOutlined, CheckOutlined, EditOutlined, PercentageOutlined, ShoppingCartOutlined } from "@ant-design/icons";
|
|
8
8
|
import "./index.less";
|
|
9
9
|
//#region src/components/bigSale/components/KioskCartCapsule/index.tsx
|
|
10
|
-
function KioskCartCapsule({ backDisabled = false, checkoutLoading = false, context, isCartActive, isPromotionVisible = false, locale, onAddNote, onBack, onCheckout, onTogglePromotion, onToggleCart, presentation = "floating", promotionAppliedCount = 0 }) {
|
|
10
|
+
function KioskCartCapsule({ backDisabled = false, catalogPrimaryAction = "toggle-cart", checkoutLoading = false, context, isCartActive, isPromotionVisible = false, locale, onAddNote, onBack, onCheckout, onTogglePromotion, onToggleCart, presentation = "floating", promotionAppliedCount = 0, showCatalogCartAction = true, showCatalogNoteAction = false }) {
|
|
11
11
|
const cartView = useMemo(() => {
|
|
12
12
|
var _ref, _ref2, _context$cart$items$l, _context$cart$items, _context$cart$booking, _context$cart$booking2, _tempOrder$note;
|
|
13
13
|
const tempOrder = resolveSaleDetailTempOrder(context.sales, context.cart);
|
|
@@ -34,17 +34,19 @@ function KioskCartCapsule({ backDisabled = false, checkoutLoading = false, conte
|
|
|
34
34
|
context.summary.summary,
|
|
35
35
|
locale
|
|
36
36
|
]);
|
|
37
|
-
const
|
|
37
|
+
const isCatalogCheckoutAction = !isCartActive && catalogPrimaryAction === "checkout";
|
|
38
|
+
const isCheckoutPending = checkoutLoading && (isCartActive || isCatalogCheckoutAction);
|
|
39
|
+
const primaryActionText = locales.getText(isCartActive || isCatalogCheckoutAction ? "pisell2.big-sale.kiosk.checkout" : "pisell2.big-sale.kiosk.next");
|
|
38
40
|
const { isSidebarPresentation, normalizedPromotionAppliedCount, shouldShowNoteButton, shouldShowPromotionBadge, shouldShowPromotionButton, shouldShowTotal } = resolveKioskCartCapsuleViewModel({
|
|
39
41
|
isCartActive,
|
|
40
42
|
isPromotionVisible,
|
|
41
43
|
onAddNote,
|
|
42
44
|
onTogglePromotion,
|
|
43
45
|
presentation,
|
|
44
|
-
promotionAppliedCount
|
|
46
|
+
promotionAppliedCount,
|
|
47
|
+
showCatalogNoteAction
|
|
45
48
|
});
|
|
46
49
|
const promotionActionText = locales.getText("pisell2.big-sale.kiosk.promotions");
|
|
47
|
-
const isCheckoutPending = isCartActive && checkoutLoading;
|
|
48
50
|
return /* @__PURE__ */ React.createElement("div", { className: classNames("pisell-kiosk-cart-capsule", {
|
|
49
51
|
"pisell-kiosk-cart-capsule--cart": isCartActive,
|
|
50
52
|
"pisell-kiosk-cart-capsule--catalog": !isCartActive,
|
|
@@ -80,7 +82,7 @@ function KioskCartCapsule({ backDisabled = false, checkoutLoading = false, conte
|
|
|
80
82
|
}, /* @__PURE__ */ React.createElement(PercentageOutlined, null), /* @__PURE__ */ React.createElement("span", { className: "pisell-kiosk-cart-capsule__promotion-label" }, promotionActionText), shouldShowPromotionBadge ? /* @__PURE__ */ React.createElement("span", {
|
|
81
83
|
"aria-hidden": "true",
|
|
82
84
|
className: "pisell-kiosk-cart-capsule__promotion-badge"
|
|
83
|
-
}, normalizedPromotionAppliedCount > 99 ? "99+" : normalizedPromotionAppliedCount) : null) : null, !isCartActive ? /* @__PURE__ */ React.createElement("button", {
|
|
85
|
+
}, normalizedPromotionAppliedCount > 99 ? "99+" : normalizedPromotionAppliedCount) : null) : null, !isCartActive && showCatalogCartAction ? /* @__PURE__ */ React.createElement("button", {
|
|
84
86
|
"aria-label": locales.getText("pisell2.big-sale.kiosk.open-cart"),
|
|
85
87
|
className: "pisell-kiosk-cart-capsule__cart-button",
|
|
86
88
|
disabled: !cartView.hasItems,
|
|
@@ -92,13 +94,13 @@ function KioskCartCapsule({ backDisabled = false, checkoutLoading = false, conte
|
|
|
92
94
|
}, cartView.itemCount)), /* @__PURE__ */ React.createElement("span", { className: "pisell-kiosk-cart-capsule__label" }, locales.getText("pisell2.big-sale.kiosk.cart"))) : null, /* @__PURE__ */ React.createElement("button", {
|
|
93
95
|
"aria-label": primaryActionText,
|
|
94
96
|
className: classNames("pisell-kiosk-cart-capsule__checkout-button", {
|
|
95
|
-
"pisell-kiosk-cart-capsule__checkout-button--next": !isCartActive,
|
|
97
|
+
"pisell-kiosk-cart-capsule__checkout-button--next": !isCartActive && !isCatalogCheckoutAction,
|
|
96
98
|
"pisell-kiosk-cart-capsule__checkout-button--loading": isCheckoutPending
|
|
97
99
|
}),
|
|
98
100
|
"aria-busy": isCheckoutPending || void 0,
|
|
99
101
|
disabled: !cartView.hasItems || isCheckoutPending,
|
|
100
102
|
type: "button",
|
|
101
|
-
onClick: isCartActive ? onCheckout : onToggleCart
|
|
103
|
+
onClick: isCartActive || isCatalogCheckoutAction ? onCheckout : onToggleCart
|
|
102
104
|
}, /* @__PURE__ */ React.createElement("span", { className: "pisell-kiosk-cart-capsule__checkout-content" }, isCheckoutPending ? /* @__PURE__ */ React.createElement("span", {
|
|
103
105
|
"aria-hidden": "true",
|
|
104
106
|
className: "pisell-kiosk-cart-capsule__checkout-spinner"
|
|
@@ -417,7 +417,8 @@
|
|
|
417
417
|
}
|
|
418
418
|
|
|
419
419
|
@media (max-width: 720px) {
|
|
420
|
-
.pisell-kiosk-
|
|
420
|
+
.pisell-kiosk-sale[data-kiosk-shell='single-screen']
|
|
421
|
+
.pisell-kiosk-cart-capsule--floating.pisell-kiosk-cart-capsule--catalog {
|
|
421
422
|
gap: 8px;
|
|
422
423
|
padding: 6px 14px;
|
|
423
424
|
|
|
@@ -492,7 +493,8 @@
|
|
|
492
493
|
}
|
|
493
494
|
|
|
494
495
|
@media (max-width: 560px) {
|
|
495
|
-
.pisell-kiosk-
|
|
496
|
+
.pisell-kiosk-sale[data-kiosk-shell='single-screen']
|
|
497
|
+
.pisell-kiosk-cart-capsule--floating.pisell-kiosk-cart-capsule--cart {
|
|
496
498
|
gap: 8px;
|
|
497
499
|
padding: 6px 14px;
|
|
498
500
|
|
|
@@ -527,7 +529,8 @@
|
|
|
527
529
|
}
|
|
528
530
|
|
|
529
531
|
@media (max-width: 390px) {
|
|
530
|
-
.pisell-kiosk-
|
|
532
|
+
.pisell-kiosk-sale[data-kiosk-shell='single-screen']
|
|
533
|
+
.pisell-kiosk-cart-capsule {
|
|
531
534
|
&__back-button {
|
|
532
535
|
width: 48px;
|
|
533
536
|
justify-content: center;
|
|
@@ -539,7 +542,8 @@
|
|
|
539
542
|
}
|
|
540
543
|
}
|
|
541
544
|
|
|
542
|
-
.pisell-kiosk-
|
|
545
|
+
.pisell-kiosk-sale[data-kiosk-shell='single-screen']
|
|
546
|
+
.pisell-kiosk-cart-capsule--catalog {
|
|
543
547
|
.pisell-kiosk-cart-capsule {
|
|
544
548
|
&__back-button {
|
|
545
549
|
width: auto;
|
|
@@ -554,13 +558,15 @@
|
|
|
554
558
|
}
|
|
555
559
|
|
|
556
560
|
@media (max-width: 340px) {
|
|
557
|
-
.pisell-kiosk-
|
|
561
|
+
.pisell-kiosk-sale[data-kiosk-shell='single-screen']
|
|
562
|
+
.pisell-kiosk-cart-capsule {
|
|
558
563
|
gap: 4px;
|
|
559
564
|
padding-right: 6px;
|
|
560
565
|
padding-left: 6px;
|
|
561
566
|
}
|
|
562
567
|
|
|
563
|
-
.pisell-kiosk-
|
|
568
|
+
.pisell-kiosk-sale[data-kiosk-shell='single-screen']
|
|
569
|
+
.pisell-kiosk-cart-capsule--cart {
|
|
564
570
|
.pisell-kiosk-cart-capsule {
|
|
565
571
|
&__note-button {
|
|
566
572
|
width: 48px;
|
|
@@ -575,7 +581,8 @@
|
|
|
575
581
|
}
|
|
576
582
|
}
|
|
577
583
|
|
|
578
|
-
.pisell-kiosk-sale[data-
|
|
584
|
+
.pisell-kiosk-sale[data-kiosk-shell='single-screen']
|
|
585
|
+
.pisell-kiosk-cart-capsule--floating {
|
|
579
586
|
&__back-button,
|
|
580
587
|
&__promotion-button,
|
|
581
588
|
&__note-button {
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
function resolveKioskCartCapsuleViewModel(options) {
|
|
3
3
|
const normalizedPromotionAppliedCount = Number.isFinite(options.promotionAppliedCount) ? Math.max(0, Math.floor(options.promotionAppliedCount)) : 0;
|
|
4
4
|
const isSidebarPresentation = options.presentation === "sidebar";
|
|
5
|
+
const shouldShowCatalogNoteAction = Boolean(options.showCatalogNoteAction) && !options.isCartActive;
|
|
5
6
|
const shouldShowPromotionBadge = !options.isPromotionVisible && normalizedPromotionAppliedCount > 0;
|
|
6
7
|
return {
|
|
7
8
|
isSidebarPresentation,
|
|
8
9
|
normalizedPromotionAppliedCount,
|
|
9
10
|
shouldShowTotal: !options.isCartActive || isSidebarPresentation,
|
|
10
|
-
shouldShowNoteButton: Boolean(options.onAddNote) && (options.isCartActive || isSidebarPresentation),
|
|
11
|
+
shouldShowNoteButton: Boolean(options.onAddNote) && (options.isCartActive || isSidebarPresentation || shouldShowCatalogNoteAction),
|
|
11
12
|
shouldShowPromotionButton: Boolean(options.onTogglePromotion) && (options.isCartActive || isSidebarPresentation),
|
|
12
13
|
shouldShowPromotionBadge
|
|
13
14
|
};
|
|
@@ -78,6 +78,7 @@ const BigSale = ({ osKey = DEFAULT_OS_KEY, enableMultiCurrencySettlement = false
|
|
|
78
78
|
variant
|
|
79
79
|
]);
|
|
80
80
|
const resolvedVariant = resolvedTemplate === "kiosk" ? kioskPresentation.variant || variant : variant;
|
|
81
|
+
const resolvedKioskShellLayout = resolvedTemplate === "kiosk" ? kioskPresentation.kioskShellLayout : void 0;
|
|
81
82
|
const resolvedNormalProductDetailConfig = useMemo(() => {
|
|
82
83
|
var _selectionFlowConfig$;
|
|
83
84
|
const selectionFlowConfig = _objectSpread2(_objectSpread2({}, resolveBigSaleSelectionFlowConfig(selectionFlowScene, normalProductDetailConfig)), {}, { enableMultiCurrencySettlement });
|
|
@@ -172,6 +173,7 @@ const BigSale = ({ osKey = DEFAULT_OS_KEY, enableMultiCurrencySettlement = false
|
|
|
172
173
|
osKey,
|
|
173
174
|
mode,
|
|
174
175
|
variant: resolvedVariant,
|
|
176
|
+
kioskShellLayout: resolvedKioskShellLayout,
|
|
175
177
|
template: resolvedTemplate,
|
|
176
178
|
productLoadParams,
|
|
177
179
|
productDisplayConfig,
|
|
@@ -23,7 +23,7 @@ import Base_default from "../../../../plus/saleDetail/Base.js";
|
|
|
23
23
|
import locales_default from "../../locales/index.js";
|
|
24
24
|
import { BigSaleProductList } from "../../components/ProductList/index.js";
|
|
25
25
|
import KioskCartCapsule from "../../components/KioskCartCapsule/index.js";
|
|
26
|
-
import { resolveKioskLayoutState, resolveKioskPromotionRevealTarget } from "./layout.js";
|
|
26
|
+
import { normalizeKioskNavigableView, resolveKioskLayoutState, resolveKioskProductListPreferencesChannel, resolveKioskPromotionRevealTarget } from "./layout.js";
|
|
27
27
|
import { isH5ZeroAmountValue, isKioskPlatformZeroAmountCheckout, resolveKioskNoPaymentResultViewModel, resolveKioskNoPaymentSubmitParams, resolveKioskSubmittedPayableAmount, shouldSubmitKioskOrderBeforeCheckout, toFiniteKioskAmount, validateKioskNoPaymentSubmitResult } from "./zeroAmountCheckout.js";
|
|
28
28
|
import { openKioskCheckoutCustomerAuth, resolveKioskCheckoutCustomerAuthRequest } from "./checkoutCustomerAuth.js";
|
|
29
29
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
@@ -224,7 +224,7 @@ function createKioskLoginContinuationHandler(options) {
|
|
|
224
224
|
});
|
|
225
225
|
};
|
|
226
226
|
}
|
|
227
|
-
function KioskBigSaleTemplate({ isActive = true, osKey, context, mode, variant, productLoadParams, businessCode, productDisplayConfig, productCatalogSessionKey, orderId, saleDetailModuleConfig, locale, onOrderComplete }) {
|
|
227
|
+
function KioskBigSaleTemplate({ isActive = true, osKey, productListPreferencesChannel, context, mode, variant, kioskShellLayout = "single-screen", productLoadParams, businessCode, productDisplayConfig, productCatalogSessionKey, orderId, saleDetailModuleConfig, locale, onOrderComplete }) {
|
|
228
228
|
var _context$sales$bookin, _engineContext$appHel, _utils$getApp, _engineContext$appHel2;
|
|
229
229
|
locales.init(locales_default, locale || "en");
|
|
230
230
|
const engineContext = useEngineContext();
|
|
@@ -239,7 +239,7 @@ function KioskBigSaleTemplate({ isActive = true, osKey, context, mode, variant,
|
|
|
239
239
|
const shouldUseConsumerPayment = hostChannel === "pc" || hostChannel === "h5";
|
|
240
240
|
const shouldRequireLogin = isRequireLoginChannel(hostChannel);
|
|
241
241
|
const { isLoggedIn, openLoginModal } = useSalesUserLogin();
|
|
242
|
-
const [view, setView] = useState(() => readKioskSessionView(context.sales.bookingTicket));
|
|
242
|
+
const [view, setView] = useState(() => normalizeKioskNavigableView(kioskShellLayout, readKioskSessionView(context.sales.bookingTicket)));
|
|
243
243
|
const [isCatalogPromotionVisible, setIsCatalogPromotionVisible] = useState(false);
|
|
244
244
|
const [isCartPromotionVisible, setIsCartPromotionVisible] = useState(true);
|
|
245
245
|
const [isCatalogProductListScrolling, setIsCatalogProductListScrolling] = useState(false);
|
|
@@ -285,10 +285,12 @@ function KioskBigSaleTemplate({ isActive = true, osKey, context, mode, variant,
|
|
|
285
285
|
modalClassName: "pisell-kiosk-modal pisell-kiosk-note-modal"
|
|
286
286
|
});
|
|
287
287
|
const setNavigableView = (nextView) => {
|
|
288
|
-
|
|
289
|
-
|
|
288
|
+
const normalizedView = normalizeKioskNavigableView(kioskShellLayout, nextView);
|
|
289
|
+
persistKioskSessionView(context.sales.bookingTicket, normalizedView);
|
|
290
|
+
setView(normalizedView);
|
|
290
291
|
};
|
|
291
|
-
const layoutState = resolveKioskLayoutState(
|
|
292
|
+
const layoutState = resolveKioskLayoutState(kioskShellLayout, view);
|
|
293
|
+
const resolvedProductListPreferencesChannel = resolveKioskProductListPreferencesChannel(kioskShellLayout, productListPreferencesChannel);
|
|
292
294
|
const requestRemoveItemConfirmation = useCallback(() => new Promise((resolve) => {
|
|
293
295
|
var _removeItemConfirmRes;
|
|
294
296
|
(_removeItemConfirmRes = removeItemConfirmResolverRef.current) === null || _removeItemConfirmRes === void 0 || _removeItemConfirmRes.call(removeItemConfirmResolverRef, false);
|
|
@@ -328,13 +330,14 @@ function KioskBigSaleTemplate({ isActive = true, osKey, context, mode, variant,
|
|
|
328
330
|
if (!bookingTicket || context.sales.status !== "ready" || !context.sales.tempOrder) return;
|
|
329
331
|
if (restoredSessionHandleRef.current === bookingTicket) return;
|
|
330
332
|
restoredSessionHandleRef.current = bookingTicket;
|
|
331
|
-
const restoredView = resolveRestoredKioskSessionView(bookingTicket);
|
|
333
|
+
const restoredView = normalizeKioskNavigableView(kioskShellLayout, resolveRestoredKioskSessionView(bookingTicket));
|
|
332
334
|
persistKioskSessionView(bookingTicket, restoredView);
|
|
333
335
|
setView(restoredView);
|
|
334
336
|
}, [
|
|
335
337
|
context.sales.bookingTicket,
|
|
336
338
|
context.sales.status,
|
|
337
|
-
context.sales.tempOrder
|
|
339
|
+
context.sales.tempOrder,
|
|
340
|
+
kioskShellLayout
|
|
338
341
|
]);
|
|
339
342
|
const defaultProductListPreferences = useMemo(() => {
|
|
340
343
|
const autoPreferences = resolveBigSaleAutoProductListPreferences({
|
|
@@ -413,14 +416,14 @@ function KioskBigSaleTemplate({ isActive = true, osKey, context, mode, variant,
|
|
|
413
416
|
const previousRevision = previousPromotionItemIncreaseRevisionRef.current;
|
|
414
417
|
previousPromotionItemIncreaseRevisionRef.current = nextRevision;
|
|
415
418
|
if (nextRevision !== previousRevision && isActive) {
|
|
416
|
-
const target = resolveKioskPromotionRevealTarget(
|
|
419
|
+
const target = resolveKioskPromotionRevealTarget(kioskShellLayout, view);
|
|
417
420
|
if (target === "catalog") setIsCatalogPromotionVisible(true);
|
|
418
421
|
else if (target === "cart") setIsCartPromotionVisible(true);
|
|
419
422
|
}
|
|
420
423
|
}, [
|
|
421
424
|
context.sales.promotionScanItemIncreaseRevision,
|
|
422
425
|
isActive,
|
|
423
|
-
|
|
426
|
+
kioskShellLayout,
|
|
424
427
|
view
|
|
425
428
|
]);
|
|
426
429
|
const catalogPromotionSlot = useMemo(() => layoutState.showCatalogPromotion ? /* @__PURE__ */ React.createElement("div", { className: "pisell-kiosk-sale__catalog-promotions" }, /* @__PURE__ */ React.createElement(Base_default, {
|
|
@@ -516,12 +519,17 @@ function KioskBigSaleTemplate({ isActive = true, osKey, context, mode, variant,
|
|
|
516
519
|
}, 0);
|
|
517
520
|
};
|
|
518
521
|
const handleCapsuleBack = () => {
|
|
519
|
-
if (layoutState.
|
|
522
|
+
if (layoutState.isPcWideSidebar || view === "catalog") {
|
|
520
523
|
setIsExitConfirmOpen(true);
|
|
521
524
|
return;
|
|
522
525
|
}
|
|
523
526
|
setNavigableView("catalog");
|
|
524
527
|
};
|
|
528
|
+
const handleFloatingCartToggle = () => {
|
|
529
|
+
const nextView = view === "cart" ? "catalog" : "cart";
|
|
530
|
+
if (nextView === "cart") setIsCartPromotionVisible(true);
|
|
531
|
+
setNavigableView(nextView);
|
|
532
|
+
};
|
|
525
533
|
const showCheckoutFailure = (failureReason) => {
|
|
526
534
|
var _ref2, _context$sales$tempOr, _context$sales$bookin2, _context$sales$bookin3, _ref3, _ref4, _resolveVirtualSettle;
|
|
527
535
|
const tempOrder = (_ref2 = (_context$sales$tempOr = context.sales.tempOrder) !== null && _context$sales$tempOr !== void 0 ? _context$sales$tempOr : (_context$sales$bookin2 = context.sales.bookingTicket) === null || _context$sales$bookin2 === void 0 || (_context$sales$bookin3 = _context$sales$bookin2.getTempOrder) === null || _context$sales$bookin3 === void 0 ? void 0 : _context$sales$bookin3.call(_context$sales$bookin2)) !== null && _ref2 !== void 0 ? _ref2 : null;
|
|
@@ -859,18 +867,20 @@ function KioskBigSaleTemplate({ isActive = true, osKey, context, mode, variant,
|
|
|
859
867
|
}]];
|
|
860
868
|
return /* @__PURE__ */ React.createElement("section", {
|
|
861
869
|
className: "pisell-kiosk-sale",
|
|
862
|
-
"data-catalog-promotion":
|
|
870
|
+
"data-catalog-promotion": layoutState.showCatalogPromotion && isCatalogPromotionVisible ? "visible" : "hidden",
|
|
863
871
|
"data-catalog-scrolling": view === "catalog" && isCatalogProductListScrolling ? "true" : "false",
|
|
872
|
+
"data-kiosk-shell": kioskShellLayout,
|
|
864
873
|
"data-variant": variant,
|
|
865
874
|
"data-view": view
|
|
866
875
|
}, /* @__PURE__ */ React.createElement("div", { className: "pisell-kiosk-sale__content" }, layoutState.showCatalog ? /* @__PURE__ */ React.createElement("div", {
|
|
867
|
-
"aria-hidden": !layoutState.
|
|
876
|
+
"aria-hidden": !layoutState.isPcWideSidebar && view !== "catalog",
|
|
868
877
|
className: "pisell-kiosk-sale__catalog"
|
|
869
878
|
}, /* @__PURE__ */ React.createElement(BigSaleProductList, {
|
|
870
879
|
addToCartToastIcon: variant === "phone" ? KIOSK_PHONE_ADD_TO_CART_TOAST_ICON : void 0,
|
|
871
880
|
addToCartToastOptions: variant === "phone" ? KIOSK_PHONE_ADD_TO_CART_TOAST_OPTIONS : void 0,
|
|
872
|
-
isActive: isActive && (layoutState.
|
|
881
|
+
isActive: isActive && (layoutState.isPcWideSidebar || view === "catalog"),
|
|
873
882
|
osKey,
|
|
883
|
+
productListPreferencesChannel: resolvedProductListPreferencesChannel,
|
|
874
884
|
mode,
|
|
875
885
|
context,
|
|
876
886
|
businessCode,
|
|
@@ -890,29 +900,23 @@ function KioskBigSaleTemplate({ isActive = true, osKey, context, mode, variant,
|
|
|
890
900
|
showActiveCategoryTitle: catalogVariant !== "phone",
|
|
891
901
|
showSettings: true,
|
|
892
902
|
variant: catalogVariant
|
|
893
|
-
})) : null, layoutState.showCart ? /* @__PURE__ */ React.createElement("section", {
|
|
903
|
+
})) : null, layoutState.showCart ? /* @__PURE__ */ React.createElement("section", {
|
|
904
|
+
"aria-label": locales.getText("pisell2.big-sale.kiosk.your-order"),
|
|
905
|
+
className: "pisell-kiosk-sale__screen pisell-kiosk-sale__cart-screen"
|
|
906
|
+
}, /* @__PURE__ */ React.createElement("header", { className: "pisell-kiosk-sale__cart-header" }, /* @__PURE__ */ React.createElement("h1", null, locales.getText("pisell2.big-sale.kiosk.your-order"), " ", "(", cartItemCount, ")")), /* @__PURE__ */ React.createElement("div", { className: "pisell-kiosk-sale__cart-body" }, /* @__PURE__ */ React.createElement(Base_default, {
|
|
894
907
|
context: saleDetailContext,
|
|
895
908
|
mobilePresentation: "inline",
|
|
896
909
|
moduleConfig: kioskSaleDetailModuleConfig,
|
|
897
910
|
renderType: "current",
|
|
898
911
|
template: "A",
|
|
899
912
|
variant
|
|
900
|
-
})), layoutState.
|
|
901
|
-
presentation: "sidebar",
|
|
902
|
-
context,
|
|
903
|
-
isCartActive: true,
|
|
904
|
-
isPromotionVisible: isCartPromotionVisible,
|
|
905
|
-
promotionAppliedCount: selectedCustomerVoucherCount,
|
|
906
|
-
onAddNote: openOrderNoteModal,
|
|
907
|
-
onBack: handleCapsuleBack,
|
|
908
|
-
checkoutLoading: isCheckoutLoading,
|
|
909
|
-
onCheckout: handleCheckout,
|
|
910
|
-
onTogglePromotion: () => setIsCartPromotionVisible((visible) => !visible),
|
|
911
|
-
onToggleCart: () => setNavigableView("cart")
|
|
912
|
-
}) : null) : null), view === "cart" && isCheckoutLoading ? /* @__PURE__ */ React.createElement("div", { className: "pisell-kiosk-sale__checkout-loading" }, /* @__PURE__ */ React.createElement(Spin, { size: "large" })) : null, catalogPromotionSlot, layoutState.showFloatingCapsule ? /* @__PURE__ */ React.createElement(KioskCartCapsule, {
|
|
913
|
+
}))) : null), view === "cart" && isCheckoutLoading ? /* @__PURE__ */ React.createElement("div", { className: "pisell-kiosk-sale__checkout-loading" }, /* @__PURE__ */ React.createElement(Spin, { size: "large" })) : null, catalogPromotionSlot, layoutState.showFloatingCapsule ? /* @__PURE__ */ React.createElement(KioskCartCapsule, {
|
|
913
914
|
presentation: "floating",
|
|
914
915
|
context,
|
|
915
916
|
isCartActive: layoutState.cartIsActive,
|
|
917
|
+
catalogPrimaryAction: layoutState.catalogPrimaryAction,
|
|
918
|
+
showCatalogCartAction: !layoutState.isPcWideSidebar,
|
|
919
|
+
showCatalogNoteAction: layoutState.isPcWideSidebar,
|
|
916
920
|
isPromotionVisible: isCartPromotionVisible,
|
|
917
921
|
locale,
|
|
918
922
|
promotionAppliedCount: selectedCustomerVoucherCount,
|
|
@@ -921,11 +925,7 @@ function KioskBigSaleTemplate({ isActive = true, osKey, context, mode, variant,
|
|
|
921
925
|
checkoutLoading: isCheckoutLoading,
|
|
922
926
|
onCheckout: handleCheckout,
|
|
923
927
|
onTogglePromotion: isVirtualSettlementOrder ? void 0 : () => setIsCartPromotionVisible((visible) => !visible),
|
|
924
|
-
onToggleCart:
|
|
925
|
-
const nextView = view === "cart" ? "catalog" : "cart";
|
|
926
|
-
if (nextView === "cart") setIsCartPromotionVisible(true);
|
|
927
|
-
setNavigableView(nextView);
|
|
928
|
-
}
|
|
928
|
+
onToggleCart: handleFloatingCartToggle
|
|
929
929
|
}) : null, orderNoteModal, /* @__PURE__ */ React.createElement(Modal, {
|
|
930
930
|
centered: true,
|
|
931
931
|
closable: false,
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
);
|
|
13
13
|
|
|
14
14
|
position: relative;
|
|
15
|
+
box-sizing: border-box;
|
|
15
16
|
width: 100%;
|
|
16
17
|
height: 100%;
|
|
17
18
|
min-height: 0;
|
|
@@ -302,7 +303,7 @@
|
|
|
302
303
|
|
|
303
304
|
// 手机版商品列表滚动时,底部 catalog 胶囊与顶部搜索框同时让出可视区域。
|
|
304
305
|
// 只改变视觉和点击状态,不删除原来的底部预留空间;滚动停止后可无跳动恢复。
|
|
305
|
-
.pisell-kiosk-sale[data-
|
|
306
|
+
.pisell-kiosk-sale[data-kiosk-shell='single-screen'][data-view='catalog'][data-catalog-scrolling='true']
|
|
306
307
|
.pisell-kiosk-cart-capsule--catalog {
|
|
307
308
|
opacity: 0;
|
|
308
309
|
pointer-events: none;
|
|
@@ -379,7 +380,15 @@
|
|
|
379
380
|
min-height: 0;
|
|
380
381
|
}
|
|
381
382
|
|
|
382
|
-
.pisell-kiosk-sale[data-
|
|
383
|
+
.pisell-kiosk-sale[data-kiosk-shell='pc-wide-sidebar'] {
|
|
384
|
+
max-width: 1200px;
|
|
385
|
+
margin-right: auto;
|
|
386
|
+
margin-left: auto;
|
|
387
|
+
|
|
388
|
+
.pisell-kiosk-sale__content {
|
|
389
|
+
height: calc(100% - var(--pisell-kiosk-cart-capsule-reserved-space));
|
|
390
|
+
}
|
|
391
|
+
|
|
383
392
|
.pisell-kiosk-sale__catalog .list-content-vertical {
|
|
384
393
|
padding-bottom: 0;
|
|
385
394
|
}
|
|
@@ -1,20 +1,32 @@
|
|
|
1
1
|
//#region src/components/bigSale/templates/Kiosk/layout.ts
|
|
2
|
-
function resolveKioskLayoutState(
|
|
3
|
-
const
|
|
2
|
+
function resolveKioskLayoutState(shellLayout, view) {
|
|
3
|
+
const isPcWideSidebar = shellLayout === "pc-wide-sidebar";
|
|
4
4
|
const isNavigableView = view === "catalog" || view === "cart";
|
|
5
5
|
return {
|
|
6
|
-
|
|
6
|
+
isPcWideSidebar,
|
|
7
7
|
showCatalog: isNavigableView,
|
|
8
|
-
showCart:
|
|
9
|
-
showCatalogPromotion: !
|
|
10
|
-
showFloatingCapsule:
|
|
11
|
-
|
|
12
|
-
|
|
8
|
+
showCart: isPcWideSidebar ? isNavigableView : view === "cart",
|
|
9
|
+
showCatalogPromotion: !isPcWideSidebar && view === "catalog",
|
|
10
|
+
showFloatingCapsule: isNavigableView,
|
|
11
|
+
cartIsActive: !isPcWideSidebar && view === "cart",
|
|
12
|
+
catalogPrimaryAction: isPcWideSidebar ? "checkout" : "toggle-cart"
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
function resolveKioskPromotionRevealTarget(
|
|
15
|
+
function resolveKioskPromotionRevealTarget(shellLayout, view) {
|
|
16
16
|
if (view !== "catalog" && view !== "cart") return null;
|
|
17
|
-
return
|
|
17
|
+
return shellLayout === "pc-wide-sidebar" ? "cart" : view;
|
|
18
|
+
}
|
|
19
|
+
/** PC 的购物车常驻在右栏,不再恢复或持久化全屏 cart 视图。 */
|
|
20
|
+
function normalizeKioskNavigableView(shellLayout, view) {
|
|
21
|
+
return shellLayout === "pc-wide-sidebar" ? "catalog" : view;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* PC 新版 H5 内容布局使用独立偏好 key,避免旧 desktop 配置回流或污染 H5。
|
|
25
|
+
* H5 / 实体 Kiosk 返回 undefined,继续沿用升级前的存储 key。
|
|
26
|
+
*/
|
|
27
|
+
function resolveKioskProductListPreferencesChannel(shellLayout, channel) {
|
|
28
|
+
if (shellLayout !== "pc-wide-sidebar") return void 0;
|
|
29
|
+
return `${String(channel || "").trim() || "pos"}:kiosk-pc-phone`;
|
|
18
30
|
}
|
|
19
31
|
//#endregion
|
|
20
|
-
export { resolveKioskLayoutState, resolveKioskPromotionRevealTarget };
|
|
32
|
+
export { normalizeKioskNavigableView, resolveKioskLayoutState, resolveKioskProductListPreferencesChannel, resolveKioskPromotionRevealTarget };
|
|
@@ -7,7 +7,7 @@ import React from "react";
|
|
|
7
7
|
/**
|
|
8
8
|
* BigSale 模板渲染器:Base 负责外层容器与数据组装,模板只负责区域组合。
|
|
9
9
|
*/
|
|
10
|
-
function BigSaleTemplateRenderer({ tmpl = "standard", isActive = true, osKey, productListPreferencesChannel, context, mode, variant, productLoadParams, businessCode, bookingConfigParams, hideSelectFloorMapResourceAction, productDisplayConfig, productCatalogSessionKey, productCatalogReady, saleDetailTemplate, saleDetailModuleConfig, orderId, locale, saleDetailWrapperProps, saleDetailHeaderSlot, rightActionBarClose, onOrderComplete, externalActionRequest, onExternalActionAccepted, onExternalPaymentSettled }) {
|
|
10
|
+
function BigSaleTemplateRenderer({ tmpl = "standard", isActive = true, osKey, productListPreferencesChannel, context, mode, variant, productLoadParams, businessCode, bookingConfigParams, hideSelectFloorMapResourceAction, productDisplayConfig, productCatalogSessionKey, productCatalogReady, kioskShellLayout, saleDetailTemplate, saleDetailModuleConfig, orderId, locale, saleDetailWrapperProps, saleDetailHeaderSlot, rightActionBarClose, onOrderComplete, externalActionRequest, onExternalActionAccepted, onExternalPaymentSettled }) {
|
|
11
11
|
switch (tmpl) {
|
|
12
12
|
case "HDLKiosk": return /* @__PURE__ */ React.createElement(HDLKioskBigSaleTemplate, {
|
|
13
13
|
isActive,
|
|
@@ -24,6 +24,7 @@ function BigSaleTemplateRenderer({ tmpl = "standard", isActive = true, osKey, pr
|
|
|
24
24
|
case "kiosk": return /* @__PURE__ */ React.createElement(KioskBigSaleTemplate, {
|
|
25
25
|
isActive,
|
|
26
26
|
osKey,
|
|
27
|
+
productListPreferencesChannel,
|
|
27
28
|
context,
|
|
28
29
|
mode,
|
|
29
30
|
variant,
|
|
@@ -34,6 +35,7 @@ function BigSaleTemplateRenderer({ tmpl = "standard", isActive = true, osKey, pr
|
|
|
34
35
|
productDisplayConfig,
|
|
35
36
|
productCatalogSessionKey,
|
|
36
37
|
productCatalogReady,
|
|
38
|
+
kioskShellLayout,
|
|
37
39
|
saleDetailTemplate,
|
|
38
40
|
saleDetailModuleConfig,
|
|
39
41
|
orderId,
|
|
@@ -4,6 +4,7 @@ import { BaseResponsiveProps } from "../../responsive/type.js";
|
|
|
4
4
|
import { ILoadProductsParams, SalesSdkCartContextValue, SalesSdkContextValue, SalesSdkCustomerContextValue, SalesSdkProductsContextValue, SalesSdkProviderProps, SalesSdkSummaryContextValue } from "../../plus/salesSdk/types.js";
|
|
5
5
|
import { SalesSdkBookingContextValue } from "../../plus/salesSdk/context/SalesSdkBookingContext.js";
|
|
6
6
|
import { SaleDetailModuleConfig, SaleDetailOrderCompletePayload, SaleDetailTemplate, SaleOrderExternalPaymentResult } from "../../plus/saleDetail/types.js";
|
|
7
|
+
import { KioskShellLayout } from "../kioskSale/resolveKioskPresentation.js";
|
|
7
8
|
import { BigSaleSelectionFlowScene } from "./selectionFlowConfig.js";
|
|
8
9
|
import React from "react";
|
|
9
10
|
|
|
@@ -55,6 +56,8 @@ interface BigSaleBaseProps extends BaseResponsiveProps {
|
|
|
55
56
|
productCatalogSessionKey?: string;
|
|
56
57
|
/** 当前业务的商品目录配置是否已就绪;false 时只渲染 UI,不发商品请求。 */
|
|
57
58
|
productCatalogReady?: boolean;
|
|
59
|
+
/** Kiosk 模板的页面外壳布局;只影响容器结构,不改变内容 variant。 */
|
|
60
|
+
kioskShellLayout?: KioskShellLayout;
|
|
58
61
|
saleDetailTemplate?: SaleDetailTemplate;
|
|
59
62
|
saleDetailModuleConfig?: SaleDetailModuleConfig;
|
|
60
63
|
autoCreate?: boolean;
|
|
@@ -17,8 +17,9 @@ function resolveKioskPresentation(platform, requestedVariant) {
|
|
|
17
17
|
switch (normalizedPlatform) {
|
|
18
18
|
case "pc": return {
|
|
19
19
|
platform: "pc",
|
|
20
|
-
variant: "
|
|
20
|
+
variant: "phone",
|
|
21
21
|
productDetailVariant: "desktop",
|
|
22
|
+
kioskShellLayout: "pc-wide-sidebar",
|
|
22
23
|
productDetailPresentationPlatform: "default",
|
|
23
24
|
mergeBookingLinesForDisplay: true,
|
|
24
25
|
enableCustomerAuthHost: false
|
|
@@ -27,6 +28,7 @@ function resolveKioskPresentation(platform, requestedVariant) {
|
|
|
27
28
|
platform: "h5",
|
|
28
29
|
variant: "phone",
|
|
29
30
|
productDetailVariant: "phone",
|
|
31
|
+
kioskShellLayout: "single-screen",
|
|
30
32
|
productDetailPresentationPlatform: "default",
|
|
31
33
|
mergeBookingLinesForDisplay: true,
|
|
32
34
|
enableCustomerAuthHost: false
|
|
@@ -35,6 +37,7 @@ function resolveKioskPresentation(platform, requestedVariant) {
|
|
|
35
37
|
platform: "kiosk",
|
|
36
38
|
variant: "phone",
|
|
37
39
|
productDetailVariant: "phone",
|
|
40
|
+
kioskShellLayout: "single-screen",
|
|
38
41
|
productDetailPresentationPlatform: "kiosk",
|
|
39
42
|
mergeBookingLinesForDisplay: false,
|
|
40
43
|
enableCustomerAuthHost: true
|
|
@@ -42,6 +45,7 @@ function resolveKioskPresentation(platform, requestedVariant) {
|
|
|
42
45
|
default: return {
|
|
43
46
|
variant: normalizedVariant,
|
|
44
47
|
productDetailVariant: normalizedVariant,
|
|
48
|
+
kioskShellLayout: "single-screen",
|
|
45
49
|
productDetailPresentationPlatform: "kiosk",
|
|
46
50
|
mergeBookingLinesForDisplay: false,
|
|
47
51
|
enableCustomerAuthHost: true
|
|
@@ -12,7 +12,7 @@ const DEFAULT_MODE = "ticket";
|
|
|
12
12
|
/**
|
|
13
13
|
* BigSaleBase 位于 SalesSdkProvider 内部,负责把 SDK 数据分发给商品列表和 SaleDetailBase。
|
|
14
14
|
*/
|
|
15
|
-
function BigSaleBase({ isActive = true, osKey, saleDetailHeaderSlot, rightActionBarClose, overlaySlot, className, style, mode = DEFAULT_MODE, tmpl, template = "standard", variant = "desktop", productLoadParams, businessCode, bookingConfigParams, hideSelectFloorMapResourceAction, productDisplayConfig, productCatalogSessionKey, productCatalogReady, saleDetailTemplate, saleDetailModuleConfig, autoCreate = true, orderId, locale, saleDetailWrapperProps, cartProductsPerRow, showClient, onOrderComplete, externalActionRequest, onExternalActionAccepted, onExternalPaymentSettled }) {
|
|
15
|
+
function BigSaleBase({ isActive = true, osKey, saleDetailHeaderSlot, rightActionBarClose, overlaySlot, className, style, mode = DEFAULT_MODE, tmpl, template = "standard", variant = "desktop", productLoadParams, businessCode, bookingConfigParams, hideSelectFloorMapResourceAction, productDisplayConfig, productCatalogSessionKey, productCatalogReady, kioskShellLayout, saleDetailTemplate, saleDetailModuleConfig, autoCreate = true, orderId, locale, saleDetailWrapperProps, cartProductsPerRow, showClient, onOrderComplete, externalActionRequest, onExternalActionAccepted, onExternalPaymentSettled }) {
|
|
16
16
|
var _context$booking$getB, _context$booking, _context$booking$getB2;
|
|
17
17
|
const context = require_useBigSaleContext.useBigSaleContext();
|
|
18
18
|
const currentTemplate = tmpl || template || "standard";
|
|
@@ -66,6 +66,7 @@ function BigSaleBase({ isActive = true, osKey, saleDetailHeaderSlot, rightAction
|
|
|
66
66
|
productDisplayConfig,
|
|
67
67
|
productCatalogSessionKey,
|
|
68
68
|
productCatalogReady,
|
|
69
|
+
kioskShellLayout,
|
|
69
70
|
saleDetailTemplate,
|
|
70
71
|
saleDetailModuleConfig: resolvedSaleDetailModuleConfig,
|
|
71
72
|
orderId,
|
|
@@ -10,7 +10,7 @@ classnames = require_runtime.__toESM(classnames);
|
|
|
10
10
|
let _ant_design_icons = require("@ant-design/icons");
|
|
11
11
|
require("./index.less");
|
|
12
12
|
//#region src/components/bigSale/components/KioskCartCapsule/index.tsx
|
|
13
|
-
function KioskCartCapsule({ backDisabled = false, checkoutLoading = false, context, isCartActive, isPromotionVisible = false, locale, onAddNote, onBack, onCheckout, onTogglePromotion, onToggleCart, presentation = "floating", promotionAppliedCount = 0 }) {
|
|
13
|
+
function KioskCartCapsule({ backDisabled = false, catalogPrimaryAction = "toggle-cart", checkoutLoading = false, context, isCartActive, isPromotionVisible = false, locale, onAddNote, onBack, onCheckout, onTogglePromotion, onToggleCart, presentation = "floating", promotionAppliedCount = 0, showCatalogCartAction = true, showCatalogNoteAction = false }) {
|
|
14
14
|
const cartView = (0, react.useMemo)(() => {
|
|
15
15
|
var _ref, _ref2, _context$cart$items$l, _context$cart$items, _context$cart$booking, _context$cart$booking2, _tempOrder$note;
|
|
16
16
|
const tempOrder = require_utils.resolveSaleDetailTempOrder(context.sales, context.cart);
|
|
@@ -37,17 +37,19 @@ function KioskCartCapsule({ backDisabled = false, checkoutLoading = false, conte
|
|
|
37
37
|
context.summary.summary,
|
|
38
38
|
locale
|
|
39
39
|
]);
|
|
40
|
-
const
|
|
40
|
+
const isCatalogCheckoutAction = !isCartActive && catalogPrimaryAction === "checkout";
|
|
41
|
+
const isCheckoutPending = checkoutLoading && (isCartActive || isCatalogCheckoutAction);
|
|
42
|
+
const primaryActionText = _pisell_utils.locales.getText(isCartActive || isCatalogCheckoutAction ? "pisell2.big-sale.kiosk.checkout" : "pisell2.big-sale.kiosk.next");
|
|
41
43
|
const { isSidebarPresentation, normalizedPromotionAppliedCount, shouldShowNoteButton, shouldShowPromotionBadge, shouldShowPromotionButton, shouldShowTotal } = require_viewModel.resolveKioskCartCapsuleViewModel({
|
|
42
44
|
isCartActive,
|
|
43
45
|
isPromotionVisible,
|
|
44
46
|
onAddNote,
|
|
45
47
|
onTogglePromotion,
|
|
46
48
|
presentation,
|
|
47
|
-
promotionAppliedCount
|
|
49
|
+
promotionAppliedCount,
|
|
50
|
+
showCatalogNoteAction
|
|
48
51
|
});
|
|
49
52
|
const promotionActionText = _pisell_utils.locales.getText("pisell2.big-sale.kiosk.promotions");
|
|
50
|
-
const isCheckoutPending = isCartActive && checkoutLoading;
|
|
51
53
|
return /* @__PURE__ */ react.default.createElement("div", { className: (0, classnames.default)("pisell-kiosk-cart-capsule", {
|
|
52
54
|
"pisell-kiosk-cart-capsule--cart": isCartActive,
|
|
53
55
|
"pisell-kiosk-cart-capsule--catalog": !isCartActive,
|
|
@@ -83,7 +85,7 @@ function KioskCartCapsule({ backDisabled = false, checkoutLoading = false, conte
|
|
|
83
85
|
}, /* @__PURE__ */ react.default.createElement(_ant_design_icons.PercentageOutlined, null), /* @__PURE__ */ react.default.createElement("span", { className: "pisell-kiosk-cart-capsule__promotion-label" }, promotionActionText), shouldShowPromotionBadge ? /* @__PURE__ */ react.default.createElement("span", {
|
|
84
86
|
"aria-hidden": "true",
|
|
85
87
|
className: "pisell-kiosk-cart-capsule__promotion-badge"
|
|
86
|
-
}, normalizedPromotionAppliedCount > 99 ? "99+" : normalizedPromotionAppliedCount) : null) : null, !isCartActive ? /* @__PURE__ */ react.default.createElement("button", {
|
|
88
|
+
}, normalizedPromotionAppliedCount > 99 ? "99+" : normalizedPromotionAppliedCount) : null) : null, !isCartActive && showCatalogCartAction ? /* @__PURE__ */ react.default.createElement("button", {
|
|
87
89
|
"aria-label": _pisell_utils.locales.getText("pisell2.big-sale.kiosk.open-cart"),
|
|
88
90
|
className: "pisell-kiosk-cart-capsule__cart-button",
|
|
89
91
|
disabled: !cartView.hasItems,
|
|
@@ -95,13 +97,13 @@ function KioskCartCapsule({ backDisabled = false, checkoutLoading = false, conte
|
|
|
95
97
|
}, cartView.itemCount)), /* @__PURE__ */ react.default.createElement("span", { className: "pisell-kiosk-cart-capsule__label" }, _pisell_utils.locales.getText("pisell2.big-sale.kiosk.cart"))) : null, /* @__PURE__ */ react.default.createElement("button", {
|
|
96
98
|
"aria-label": primaryActionText,
|
|
97
99
|
className: (0, classnames.default)("pisell-kiosk-cart-capsule__checkout-button", {
|
|
98
|
-
"pisell-kiosk-cart-capsule__checkout-button--next": !isCartActive,
|
|
100
|
+
"pisell-kiosk-cart-capsule__checkout-button--next": !isCartActive && !isCatalogCheckoutAction,
|
|
99
101
|
"pisell-kiosk-cart-capsule__checkout-button--loading": isCheckoutPending
|
|
100
102
|
}),
|
|
101
103
|
"aria-busy": isCheckoutPending || void 0,
|
|
102
104
|
disabled: !cartView.hasItems || isCheckoutPending,
|
|
103
105
|
type: "button",
|
|
104
|
-
onClick: isCartActive ? onCheckout : onToggleCart
|
|
106
|
+
onClick: isCartActive || isCatalogCheckoutAction ? onCheckout : onToggleCart
|
|
105
107
|
}, /* @__PURE__ */ react.default.createElement("span", { className: "pisell-kiosk-cart-capsule__checkout-content" }, isCheckoutPending ? /* @__PURE__ */ react.default.createElement("span", {
|
|
106
108
|
"aria-hidden": "true",
|
|
107
109
|
className: "pisell-kiosk-cart-capsule__checkout-spinner"
|