@pisell/private-materials 6.12.408 → 6.12.409
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.js +3 -3
- package/build/lowcode/view.js +3 -3
- package/es/components/bigSale/components/BookingFloatingPanel/useBookingPanelController.js +0 -1
- package/es/components/bigSale/components/ProductList/index.js +179 -27
- package/es/components/bigSale/components/ProductListSettingsModal/index.js +5 -3
- package/es/components/bigSale/components/TimeBar/index.js +0 -1
- package/es/components/bigSale/dialog.js +0 -1
- package/es/components/bigSale/hooks/useBigSaleContext.js +0 -1
- package/es/components/bigSale/hooks/useSelectFloorMapResourceForBigSale.js +0 -1
- package/es/components/bigSale/index.js +0 -1
- package/es/components/bigSale/templates/Kiosk/index.js +0 -1
- package/es/components/bigSale/utils/productListPreferences.js +5 -2
- package/es/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.js +0 -1
- package/es/components/venueBookingSales/BookingComposer.js +44 -8
- package/es/components/venueBookingSales/VenueBookingShared.js +1 -1
- package/es/components/venueBookingSales/availability/BookingSelectionPanel.js +12 -1
- package/es/components/venueBookingSales/checkout/useVenueBookingCheckout.js +0 -1
- package/es/components/venueBookingSales/extras/VenueExtraDetailModal.js +1 -1
- package/es/index.js +0 -2
- package/es/plus/multiCurrencySettlement/index.js +1 -1
- 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/saleDetail/Base.js +0 -1
- package/es/plus/saleDetail/components/Client/hooks/useClientSelectorProps.js +0 -1
- package/es/plus/saleDetail/components/DetailActions/PrintAction.js +0 -1
- package/es/plus/saleDetail/components/DetailActions/index.js +0 -1
- package/es/plus/saleDetail/components/SummaryFinancialSections/index.js +0 -1
- package/es/plus/saleDetail/index.js +0 -1
- package/es/plus/saleDetail/tmpl/B/components/Dish/index.js +0 -1
- package/es/plus/saleDetail/tmpl/B/index.js +0 -1
- package/es/plus/salesSdk/utils/addProductWithFlowDebounced.js +1 -1
- package/es/plus/salesSdk/utils/bookingDate.js +1 -1
- package/es/plus/salesSdk/utils/enrichCartLineHolderDisplay.js +1 -1
- package/es/private-materials/lowcode/authmodal/meta.d.ts +1 -0
- package/es/pro/Login2.0/AuthModal.d.ts +1 -1
- package/es/pro/Login2.0/index.d.ts +2 -2
- package/es/pro/Login2.0/shared/types.d.ts +1 -1
- package/es/pro/bookingProductDetailModal/index.js +7 -7
- package/lib/components/bigSale/components/ProductList/index.js +179 -26
- package/lib/components/bigSale/components/ProductListSettingsModal/index.js +5 -3
- package/lib/components/bigSale/utils/productListPreferences.js +5 -2
- package/lib/components/venueBookingSales/BookingComposer.js +43 -7
- package/lib/components/venueBookingSales/VenueBookingShared.js +1 -1
- package/lib/components/venueBookingSales/availability/BookingSelectionPanel.js +12 -1
- package/lib/components/venueBookingSales/extras/VenueExtraDetailModal.js +1 -1
- package/lib/pro/bookingProductDetailModal/index.js +7 -7
- package/package.json +2 -2
- package/es/plus/pisellReservation/index.js +0 -17
- package/es/plus/salesSdk/index.js +0 -54
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import useEngineContext from "../../../../hooks/useEngineContext.js";
|
|
2
2
|
import { subscribeBookingDateChange } from "../../../../plus/salesSdk/utils/bookingDate.js";
|
|
3
|
-
import "../../../../plus/salesSdk/index.js";
|
|
4
3
|
import dayjs from "dayjs";
|
|
5
4
|
import { useCallback, useEffect, useState } from "react";
|
|
6
5
|
//#region src/components/bigSale/components/BookingFloatingPanel/useBookingPanelController.ts
|
|
@@ -20,7 +20,6 @@ import { showAddToCartToast } from "../../../../plus/salesSdk/components/showAdd
|
|
|
20
20
|
import { mergeBookingsForDisplay } from "../../../../plus/salesSdk/utils/mergeBookingsForDisplay.js";
|
|
21
21
|
import useSalesSdkGlobalScanHandler from "../../../../plus/salesSdk/hooks/useSalesSdkGlobalScanHandler.js";
|
|
22
22
|
import { useSalesSdkGlobalScanActivity } from "../../../../plus/salesSdk/context/SalesSdkGlobalScanActivityContext.js";
|
|
23
|
-
import "../../../../plus/salesSdk/index.js";
|
|
24
23
|
import { buildBigSaleProductListPreferencesKey, readBigSaleProductListPreferences, readStoredBigSaleProductListPreferences, removeBigSaleProductListPreferences, resolveBigSaleAutoProductListPreferences, writeBigSaleProductListPreferences } from "../../utils/productListPreferences.js";
|
|
25
24
|
import { resolveBigSaleProductDisplayConfig, useBigSaleProductListConfig } from "../../hooks/useBigSaleProductListConfig.js";
|
|
26
25
|
import { showSalesGuardErrorToast } from "../../../../plus/salesSdk/utils/salesGuard.js";
|
|
@@ -50,6 +49,42 @@ function getCurrentRoutePath() {
|
|
|
50
49
|
const { pathname, search, hash } = window.location;
|
|
51
50
|
return `${pathname}${search}${hash}`;
|
|
52
51
|
}
|
|
52
|
+
function getOperatorMetadata(user) {
|
|
53
|
+
var _user$id, _user$email, _user$pos_id;
|
|
54
|
+
if (!user || typeof user !== "object") return null;
|
|
55
|
+
const name = [user.staff_first_name, user.staff_last_name].filter(Boolean).join(" ").trim() || [user.first_name, user.last_name].filter(Boolean).join(" ").trim() || null;
|
|
56
|
+
const operator = {
|
|
57
|
+
id: (_user$id = user.id) !== null && _user$id !== void 0 ? _user$id : null,
|
|
58
|
+
name,
|
|
59
|
+
email: (_user$email = user.email) !== null && _user$email !== void 0 ? _user$email : null,
|
|
60
|
+
posId: (_user$pos_id = user.pos_id) !== null && _user$pos_id !== void 0 ? _user$pos_id : null
|
|
61
|
+
};
|
|
62
|
+
return Object.values(operator).some(Boolean) ? operator : null;
|
|
63
|
+
}
|
|
64
|
+
function getCurrentOperatorMetadata(engineContext) {
|
|
65
|
+
var _engineContext$appHel;
|
|
66
|
+
const utils = engineContext === null || engineContext === void 0 || (_engineContext$appHel = engineContext.appHelper) === null || _engineContext$appHel === void 0 ? void 0 : _engineContext$appHel.utils;
|
|
67
|
+
const candidates = [];
|
|
68
|
+
if (typeof (utils === null || utils === void 0 ? void 0 : utils.getData) === "function") try {
|
|
69
|
+
candidates.push(utils.getData("account"), utils.getData("customer"));
|
|
70
|
+
} catch (_unused) {}
|
|
71
|
+
let appStorage;
|
|
72
|
+
if (typeof (utils === null || utils === void 0 ? void 0 : utils.getApp) === "function") try {
|
|
73
|
+
var _utils$getApp;
|
|
74
|
+
appStorage = (_utils$getApp = utils.getApp()) === null || _utils$getApp === void 0 ? void 0 : _utils$getApp.storage;
|
|
75
|
+
} catch (_unused2) {}
|
|
76
|
+
[utils === null || utils === void 0 ? void 0 : utils.storage, appStorage].forEach((storage) => {
|
|
77
|
+
if (typeof (storage === null || storage === void 0 ? void 0 : storage.get) !== "function") return;
|
|
78
|
+
try {
|
|
79
|
+
candidates.push(storage.get("account"), storage.get("customer"));
|
|
80
|
+
} catch (_unused3) {}
|
|
81
|
+
});
|
|
82
|
+
for (const candidate of candidates) try {
|
|
83
|
+
const operator = getOperatorMetadata(typeof candidate === "string" ? JSON.parse(candidate) : candidate);
|
|
84
|
+
if (operator) return operator;
|
|
85
|
+
} catch (_unused4) {}
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
53
88
|
function resolvePhoneCartEntryQuantity(value) {
|
|
54
89
|
var _value$_extend$displa, _value$_extend;
|
|
55
90
|
const quantity = Number((_value$_extend$displa = value === null || value === void 0 || (_value$_extend = value._extend) === null || _value$_extend === void 0 ? void 0 : _value$_extend.displayQuantity) !== null && _value$_extend$displa !== void 0 ? _value$_extend$displa : value === null || value === void 0 ? void 0 : value.num);
|
|
@@ -138,7 +173,7 @@ function shouldHideSingleKioskCategoryNavigation(navigation, items) {
|
|
|
138
173
|
* 商品列表只做“加载商品 + 触发加购”,加购决策交给 salesSdk。
|
|
139
174
|
*/
|
|
140
175
|
const BigSaleProductListInner = ({ renderContent, className, renderProductCard, catalog, quantityByProductId, onSelectProduct, onQuantityChange, getProductPresentation, isActive = true, catalogPreparation, osKey, productListPreferencesChannel, mode, context, businessCode, productLoadParams, productDisplayConfig, productCatalogSessionKey, requiredOrderId, categoryResetKey, revealProductRequest, productListPreferences: controlledProductListPreferences, productListPreferencesOverride: controlledProductListPreferencesOverride, defaultProductListPreferences: controlledDefaultProductListPreferences, onProductListPreferencesChange, onProductListPreferencesReset, variant, categoryNavigation = "tabbar", defaultCategorySelection = "first", allCategoryLabel, hideSingleCategoryNavigation = false, categoryDisplayMode = "switch", persistentSearch = false, onScrollActivityChange, showActiveCategoryTitle = false, productListHeaderSlot, productSelectionTrigger = "pointerUp", productCardVersion = "v1", addToCartToastIcon, addToCartToastOptions, showSettings = true }) => {
|
|
141
|
-
var _engineContext$
|
|
176
|
+
var _engineContext$appHel2, _catalog$products, _sales$bookingTicket$, _sales$bookingTicket, _sales$bookingTicket$2, _productLoadParams$me, _sales$defaultProduct, _sales$tempOrder3;
|
|
142
177
|
const isControlledCatalog = catalog !== void 0;
|
|
143
178
|
const hasControlledActions = isControlledCatalog || quantityByProductId !== void 0 || !!onSelectProduct || !!onQuantityChange;
|
|
144
179
|
const scopeKey = catalog === null || catalog === void 0 ? void 0 : catalog.scopeKey;
|
|
@@ -149,7 +184,8 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
149
184
|
const usesV2ProductCard = variant === "phone" && productCardVersion === "v2";
|
|
150
185
|
const Toast = useToast();
|
|
151
186
|
const engineContext = useEngineContext();
|
|
152
|
-
const getEngineData = engineContext === null || engineContext === void 0 || (_engineContext$
|
|
187
|
+
const getEngineData = engineContext === null || engineContext === void 0 || (_engineContext$appHel2 = engineContext.appHelper) === null || _engineContext$appHel2 === void 0 || (_engineContext$appHel2 = _engineContext$appHel2.utils) === null || _engineContext$appHel2 === void 0 ? void 0 : _engineContext$appHel2.getData;
|
|
188
|
+
const operator = getCurrentOperatorMetadata(engineContext);
|
|
153
189
|
const addToCartToastApi = useMemo(() => addToCartToastIcon ? { success: (content) => {
|
|
154
190
|
Toast.show({
|
|
155
191
|
content,
|
|
@@ -240,8 +276,60 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
240
276
|
const [uncontrolledProductListPreferences, setUncontrolledProductListPreferences] = useState(() => readBigSaleProductListPreferences(preferencesKey, defaultProductListPreferences));
|
|
241
277
|
const [uncontrolledProductListPreferencesKey, setUncontrolledProductListPreferencesKey] = useState(preferencesKey);
|
|
242
278
|
const [uncontrolledProductListPreferencesOverride, setUncontrolledProductListPreferencesOverride] = useState(() => Boolean(readStoredBigSaleProductListPreferences(preferencesKey, defaultProductListPreferences)));
|
|
279
|
+
const productListPreferenceStorageLogRef = useRef();
|
|
280
|
+
const productListEntryLogRef = useRef();
|
|
243
281
|
const productListPreferences = controlledProductListPreferences || (uncontrolledProductListPreferencesKey === preferencesKey ? uncontrolledProductListPreferences : defaultProductListPreferences);
|
|
244
282
|
const productListPreferencesOverride = controlledProductListPreferences !== void 0 ? controlledProductListPreferencesOverride !== false : uncontrolledProductListPreferencesOverride;
|
|
283
|
+
useEffect(() => {
|
|
284
|
+
const metadata = {
|
|
285
|
+
eventVersion: 1,
|
|
286
|
+
action: "enter-sales-page",
|
|
287
|
+
mode,
|
|
288
|
+
businessCode: businessCode !== null && businessCode !== void 0 ? businessCode : null,
|
|
289
|
+
osKey: osKey !== null && osKey !== void 0 ? osKey : null,
|
|
290
|
+
channel: productListPreferencesChannel !== null && productListPreferencesChannel !== void 0 ? productListPreferencesChannel : null,
|
|
291
|
+
scopeKey: scopeKey !== null && scopeKey !== void 0 ? scopeKey : null,
|
|
292
|
+
variant: variant !== null && variant !== void 0 ? variant : null,
|
|
293
|
+
pathname: getCurrentRoutePath(),
|
|
294
|
+
operator,
|
|
295
|
+
storageKey: preferencesKey,
|
|
296
|
+
productListPreferencesSource: controlledProductListPreferences ? "controlled" : productListPreferencesOverride ? "local-storage" : "auto",
|
|
297
|
+
productListPreferences,
|
|
298
|
+
catalogProductCount: currentProducts.length
|
|
299
|
+
};
|
|
300
|
+
const entrySignature = JSON.stringify({
|
|
301
|
+
mode,
|
|
302
|
+
businessCode: businessCode !== null && businessCode !== void 0 ? businessCode : null,
|
|
303
|
+
osKey: osKey !== null && osKey !== void 0 ? osKey : null,
|
|
304
|
+
channel: productListPreferencesChannel !== null && productListPreferencesChannel !== void 0 ? productListPreferencesChannel : null,
|
|
305
|
+
scopeKey: scopeKey !== null && scopeKey !== void 0 ? scopeKey : null,
|
|
306
|
+
pathname: metadata.pathname
|
|
307
|
+
});
|
|
308
|
+
if (productListEntryLogRef.current === entrySignature) return;
|
|
309
|
+
productListEntryLogRef.current = entrySignature;
|
|
310
|
+
try {
|
|
311
|
+
var _logger$addLog;
|
|
312
|
+
logger === null || logger === void 0 || (_logger$addLog = logger.addLog) === null || _logger$addLog === void 0 || _logger$addLog.call(logger, {
|
|
313
|
+
type: "info",
|
|
314
|
+
title: "[BigSaleProductList] 商品列表进入销售页",
|
|
315
|
+
metadata
|
|
316
|
+
});
|
|
317
|
+
} catch (_unused5) {}
|
|
318
|
+
}, [
|
|
319
|
+
businessCode,
|
|
320
|
+
controlledProductListPreferences,
|
|
321
|
+
currentProducts.length,
|
|
322
|
+
logger,
|
|
323
|
+
mode,
|
|
324
|
+
operator,
|
|
325
|
+
osKey,
|
|
326
|
+
preferencesKey,
|
|
327
|
+
productListPreferences,
|
|
328
|
+
productListPreferencesChannel,
|
|
329
|
+
productListPreferencesOverride,
|
|
330
|
+
scopeKey,
|
|
331
|
+
variant
|
|
332
|
+
]);
|
|
245
333
|
const productListConfig = useBigSaleProductListConfig({
|
|
246
334
|
products: currentProducts,
|
|
247
335
|
scopeKey,
|
|
@@ -285,11 +373,44 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
285
373
|
setUncontrolledProductListPreferences(storedPreferences || defaultProductListPreferences);
|
|
286
374
|
setUncontrolledProductListPreferencesKey(preferencesKey);
|
|
287
375
|
setUncontrolledProductListPreferencesOverride(Boolean(storedPreferences));
|
|
376
|
+
const metadata = {
|
|
377
|
+
eventVersion: 1,
|
|
378
|
+
mode,
|
|
379
|
+
businessCode: businessCode !== null && businessCode !== void 0 ? businessCode : null,
|
|
380
|
+
osKey: osKey !== null && osKey !== void 0 ? osKey : null,
|
|
381
|
+
channel: productListPreferencesChannel !== null && productListPreferencesChannel !== void 0 ? productListPreferencesChannel : null,
|
|
382
|
+
operator,
|
|
383
|
+
variant: variant !== null && variant !== void 0 ? variant : null,
|
|
384
|
+
pathname: getCurrentRoutePath(),
|
|
385
|
+
storageKey: preferencesKey,
|
|
386
|
+
cacheHit: Boolean(storedPreferences),
|
|
387
|
+
storedPreferences: storedPreferences !== null && storedPreferences !== void 0 ? storedPreferences : null,
|
|
388
|
+
fallbackPreferences: defaultProductListPreferences
|
|
389
|
+
};
|
|
390
|
+
const signature = JSON.stringify(metadata);
|
|
391
|
+
if (productListPreferenceStorageLogRef.current !== signature) {
|
|
392
|
+
productListPreferenceStorageLogRef.current = signature;
|
|
393
|
+
try {
|
|
394
|
+
var _logger$addLog2;
|
|
395
|
+
logger === null || logger === void 0 || (_logger$addLog2 = logger.addLog) === null || _logger$addLog2 === void 0 || _logger$addLog2.call(logger, {
|
|
396
|
+
type: "info",
|
|
397
|
+
title: "[BigSaleProductList] 商品卡配置本地缓存读取",
|
|
398
|
+
metadata
|
|
399
|
+
});
|
|
400
|
+
} catch (_unused6) {}
|
|
401
|
+
}
|
|
288
402
|
}
|
|
289
403
|
}, [
|
|
404
|
+
businessCode,
|
|
290
405
|
controlledProductListPreferences,
|
|
291
406
|
defaultProductListPreferences,
|
|
292
|
-
|
|
407
|
+
logger,
|
|
408
|
+
mode,
|
|
409
|
+
osKey,
|
|
410
|
+
operator,
|
|
411
|
+
preferencesKey,
|
|
412
|
+
productListPreferencesChannel,
|
|
413
|
+
variant
|
|
293
414
|
]);
|
|
294
415
|
const productListLayoutLogRef = useRef();
|
|
295
416
|
useEffect(() => {
|
|
@@ -311,13 +432,13 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
311
432
|
if (productListLayoutLogRef.current === signature) return;
|
|
312
433
|
productListLayoutLogRef.current = signature;
|
|
313
434
|
try {
|
|
314
|
-
var _logger$
|
|
315
|
-
logger === null || logger === void 0 || (_logger$
|
|
435
|
+
var _logger$addLog3;
|
|
436
|
+
logger === null || logger === void 0 || (_logger$addLog3 = logger.addLog) === null || _logger$addLog3 === void 0 || _logger$addLog3.call(logger, {
|
|
316
437
|
type: "info",
|
|
317
438
|
title: "[BigSaleProductList] 商品列表布局已解析",
|
|
318
439
|
metadata
|
|
319
440
|
});
|
|
320
|
-
} catch (
|
|
441
|
+
} catch (_unused7) {}
|
|
321
442
|
}, [
|
|
322
443
|
businessCode,
|
|
323
444
|
controlledProductListPreferences,
|
|
@@ -503,13 +624,13 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
503
624
|
const productId = String((_ref6 = (_product$id = product === null || product === void 0 ? void 0 : product.id) !== null && _product$id !== void 0 ? _product$id : product === null || product === void 0 ? void 0 : product.product_id) !== null && _ref6 !== void 0 ? _ref6 : "");
|
|
504
625
|
const baselineQuantity = phoneCartProductEntries.filter((entry) => resolvePhoneCartProductId(entry.value) === productId).reduce((total, entry) => total + entry.quantity, 0);
|
|
505
626
|
try {
|
|
506
|
-
var _sales$tempOrder4, _logger$
|
|
627
|
+
var _sales$tempOrder4, _logger$addLog4, _cart$items$length, _cart$items, _cart$bookings$length, _cart$bookings, _ref7, _sales$tempOrder$orde, _sales$tempOrder5;
|
|
507
628
|
if (!(yield businessAvailability.ensureCanShop())) return;
|
|
508
629
|
if (!sales.isReady) return;
|
|
509
630
|
if (requiredOrderId !== void 0 && Number((_sales$tempOrder4 = sales.tempOrder) === null || _sales$tempOrder4 === void 0 ? void 0 : _sales$tempOrder4.order_id) !== Number(requiredOrderId)) return;
|
|
510
631
|
const latestProduct = currentProducts.find((currentProduct) => currentProduct.id === product.id);
|
|
511
632
|
latestProduct && _objectSpread2(_objectSpread2({}, product), {}, { cartDetailValue: latestProduct.cartDetailValue });
|
|
512
|
-
logger === null || logger === void 0 || (_logger$
|
|
633
|
+
logger === null || logger === void 0 || (_logger$addLog4 = logger.addLog) === null || _logger$addLog4 === void 0 || _logger$addLog4.call(logger, {
|
|
513
634
|
type: "info",
|
|
514
635
|
title: "[BigSaleProductList] 用户点击商品卡片加入购物车",
|
|
515
636
|
metadata: {
|
|
@@ -1023,39 +1144,68 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
1023
1144
|
setSettingsOpen(false);
|
|
1024
1145
|
});
|
|
1025
1146
|
const handleSaveSettings = useMemoizedFn((preferences) => {
|
|
1026
|
-
writeBigSaleProductListPreferences(preferencesKey, preferences);
|
|
1147
|
+
const cacheWriteSucceeded = writeBigSaleProductListPreferences(preferencesKey, preferences);
|
|
1148
|
+
const persistedPreferences = cacheWriteSucceeded ? readStoredBigSaleProductListPreferences(preferencesKey, defaultProductListPreferences) : void 0;
|
|
1027
1149
|
setUncontrolledProductListPreferences(preferences);
|
|
1028
1150
|
setUncontrolledProductListPreferencesKey(preferencesKey);
|
|
1029
1151
|
setUncontrolledProductListPreferencesOverride(true);
|
|
1152
|
+
const metadata = {
|
|
1153
|
+
eventVersion: 1,
|
|
1154
|
+
action: "save-completed",
|
|
1155
|
+
mode,
|
|
1156
|
+
businessCode: businessCode !== null && businessCode !== void 0 ? businessCode : null,
|
|
1157
|
+
osKey: osKey !== null && osKey !== void 0 ? osKey : null,
|
|
1158
|
+
channel: productListPreferencesChannel !== null && productListPreferencesChannel !== void 0 ? productListPreferencesChannel : null,
|
|
1159
|
+
operator,
|
|
1160
|
+
variant: variant !== null && variant !== void 0 ? variant : null,
|
|
1161
|
+
pathname: getCurrentRoutePath(),
|
|
1162
|
+
storageKey: preferencesKey,
|
|
1163
|
+
cacheWriteSucceeded,
|
|
1164
|
+
persistedPreferences: persistedPreferences !== null && persistedPreferences !== void 0 ? persistedPreferences : null,
|
|
1165
|
+
preferences
|
|
1166
|
+
};
|
|
1030
1167
|
try {
|
|
1031
|
-
var _logger$
|
|
1032
|
-
logger === null || logger === void 0 || (_logger$
|
|
1168
|
+
var _logger$addLog5;
|
|
1169
|
+
logger === null || logger === void 0 || (_logger$addLog5 = logger.addLog) === null || _logger$addLog5 === void 0 || _logger$addLog5.call(logger, {
|
|
1033
1170
|
type: "info",
|
|
1034
1171
|
title: "[BigSaleProductList] 商品列表布局设置已保存",
|
|
1035
|
-
metadata
|
|
1036
|
-
mode,
|
|
1037
|
-
businessCode: businessCode !== null && businessCode !== void 0 ? businessCode : null,
|
|
1038
|
-
variant: variant !== null && variant !== void 0 ? variant : null,
|
|
1039
|
-
pathname: getCurrentRoutePath(),
|
|
1040
|
-
columns: preferences.columns,
|
|
1041
|
-
cardLayoutDirection: preferences.layoutDirection,
|
|
1042
|
-
showImage: preferences.showImage,
|
|
1043
|
-
imageWidth: preferences.imageWidth,
|
|
1044
|
-
imageHeight: preferences.imageHeight
|
|
1045
|
-
}
|
|
1172
|
+
metadata
|
|
1046
1173
|
});
|
|
1047
|
-
} catch (
|
|
1174
|
+
} catch (_unused8) {}
|
|
1048
1175
|
onProductListPreferencesChange === null || onProductListPreferencesChange === void 0 || onProductListPreferencesChange(preferences);
|
|
1049
1176
|
setSettingsOpen(false);
|
|
1050
1177
|
});
|
|
1178
|
+
const handleSettingsSaveAttempt = useMemoizedFn((preferences) => {
|
|
1179
|
+
const metadata = {
|
|
1180
|
+
eventVersion: 1,
|
|
1181
|
+
action: "save-clicked",
|
|
1182
|
+
mode,
|
|
1183
|
+
businessCode: businessCode !== null && businessCode !== void 0 ? businessCode : null,
|
|
1184
|
+
osKey: osKey !== null && osKey !== void 0 ? osKey : null,
|
|
1185
|
+
channel: productListPreferencesChannel !== null && productListPreferencesChannel !== void 0 ? productListPreferencesChannel : null,
|
|
1186
|
+
variant: variant !== null && variant !== void 0 ? variant : null,
|
|
1187
|
+
pathname: getCurrentRoutePath(),
|
|
1188
|
+
storageKey: preferencesKey,
|
|
1189
|
+
operator,
|
|
1190
|
+
preferences
|
|
1191
|
+
};
|
|
1192
|
+
try {
|
|
1193
|
+
var _logger$addLog6;
|
|
1194
|
+
logger === null || logger === void 0 || (_logger$addLog6 = logger.addLog) === null || _logger$addLog6 === void 0 || _logger$addLog6.call(logger, {
|
|
1195
|
+
type: "info",
|
|
1196
|
+
title: "[BigSaleProductList] 商品卡配置弹窗点击保存",
|
|
1197
|
+
metadata
|
|
1198
|
+
});
|
|
1199
|
+
} catch (_unused9) {}
|
|
1200
|
+
});
|
|
1051
1201
|
const handleResetSettings = useMemoizedFn(() => {
|
|
1052
1202
|
removeBigSaleProductListPreferences(preferencesKey);
|
|
1053
1203
|
setUncontrolledProductListPreferences(defaultProductListPreferences);
|
|
1054
1204
|
setUncontrolledProductListPreferencesKey(preferencesKey);
|
|
1055
1205
|
setUncontrolledProductListPreferencesOverride(false);
|
|
1056
1206
|
try {
|
|
1057
|
-
var _logger$
|
|
1058
|
-
logger === null || logger === void 0 || (_logger$
|
|
1207
|
+
var _logger$addLog7;
|
|
1208
|
+
logger === null || logger === void 0 || (_logger$addLog7 = logger.addLog) === null || _logger$addLog7 === void 0 || _logger$addLog7.call(logger, {
|
|
1059
1209
|
type: "info",
|
|
1060
1210
|
title: "[BigSaleProductList] 商品列表布局设置已重置",
|
|
1061
1211
|
metadata: {
|
|
@@ -1067,7 +1217,7 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
1067
1217
|
cardLayoutDirection: defaultProductListPreferences.layoutDirection
|
|
1068
1218
|
}
|
|
1069
1219
|
});
|
|
1070
|
-
} catch (
|
|
1220
|
+
} catch (_unused10) {}
|
|
1071
1221
|
onProductListPreferencesReset === null || onProductListPreferencesReset === void 0 || onProductListPreferencesReset(defaultProductListPreferences);
|
|
1072
1222
|
setSettingsOpen(false);
|
|
1073
1223
|
});
|
|
@@ -1277,6 +1427,7 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
1277
1427
|
variant,
|
|
1278
1428
|
fullWidthActions: categoryNavigation === "sidebar",
|
|
1279
1429
|
onCancel: handleCloseSettings,
|
|
1430
|
+
onSaveAttempt: handleSettingsSaveAttempt,
|
|
1280
1431
|
onSave: handleSaveSettings,
|
|
1281
1432
|
onSaveAuto: handleResetSettings
|
|
1282
1433
|
}) : null), [
|
|
@@ -1294,6 +1445,7 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
1294
1445
|
handleOpenSettings,
|
|
1295
1446
|
handleResetSettings,
|
|
1296
1447
|
handleSaveSettings,
|
|
1448
|
+
handleSettingsSaveAttempt,
|
|
1297
1449
|
defaultProductListPreferences,
|
|
1298
1450
|
purchaseDisabled,
|
|
1299
1451
|
listData,
|
|
@@ -15,7 +15,7 @@ function getPlatformByVariant(variant) {
|
|
|
15
15
|
/**
|
|
16
16
|
* Big Sale 商品卡片设置弹窗,只负责编辑当前页面本地偏好。
|
|
17
17
|
*/
|
|
18
|
-
const BigSaleProductListSettingsModal = ({ open, preferences, autoPreferences, isAutoMode, variant, fullWidthActions = false, onCancel, onSave, onSaveAuto }) => {
|
|
18
|
+
const BigSaleProductListSettingsModal = ({ open, preferences, autoPreferences, isAutoMode, variant, fullWidthActions = false, onCancel, onSaveAttempt, onSave, onSaveAuto }) => {
|
|
19
19
|
const [form] = Form.useForm();
|
|
20
20
|
const isPhoneVariant = variant === "phone";
|
|
21
21
|
const [preferenceMode, setPreferenceMode] = useState(isAutoMode ? "auto" : "custom");
|
|
@@ -44,7 +44,7 @@ const BigSaleProductListSettingsModal = ({ open, preferences, autoPreferences, i
|
|
|
44
44
|
return;
|
|
45
45
|
}
|
|
46
46
|
const values = yield form.validateFields();
|
|
47
|
-
|
|
47
|
+
const nextPreferences = {
|
|
48
48
|
columns: values.columns,
|
|
49
49
|
layoutDirection: values.layoutDirection,
|
|
50
50
|
showImage: values.showImage,
|
|
@@ -56,7 +56,9 @@ const BigSaleProductListSettingsModal = ({ open, preferences, autoPreferences, i
|
|
|
56
56
|
imageHeight: values.imageHeight,
|
|
57
57
|
imageObjectFit: values.imageObjectFit,
|
|
58
58
|
saleDetailWidth: values.saleDetailWidth
|
|
59
|
-
}
|
|
59
|
+
};
|
|
60
|
+
onSaveAttempt === null || onSaveAttempt === void 0 || onSaveAttempt(nextPreferences);
|
|
61
|
+
onSave(nextPreferences);
|
|
60
62
|
});
|
|
61
63
|
return function handleSave() {
|
|
62
64
|
return _ref.apply(this, arguments);
|
|
@@ -5,7 +5,6 @@ import useInitLocalesOnce from "../../../../hooks/useInitLocalesOnce.js";
|
|
|
5
5
|
import { subscribeBookingDateChange } from "../../../../plus/salesSdk/utils/bookingDate.js";
|
|
6
6
|
import { setBookingTimeSelectionIntent } from "../../../../plus/salesSdk/utils/bookingTimeSelection.js";
|
|
7
7
|
import { useSalesSdkBookingContext } from "../../../../plus/salesSdk/context/SalesSdkBookingContext.js";
|
|
8
|
-
import "../../../../plus/salesSdk/index.js";
|
|
9
8
|
import locales_default from "../../locales/index.js";
|
|
10
9
|
import { getPosWeekStartsOn, resolvePosCountryCode } from "../../../../utils/posDateLocale.js";
|
|
11
10
|
import dayjs from "dayjs";
|
|
@@ -6,7 +6,6 @@ import { buildInitBookingContextParams, collectBookingIdsFromTempOrder } from ".
|
|
|
6
6
|
import { useSalesSdk } from "../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
7
7
|
import { useSalesSdkCart } from "../../plus/salesSdk/hooks/useSalesSdkCart.js";
|
|
8
8
|
import { SalesSdkPrepareOrderSwitchContext, SalesSdkRootRefreshContext } from "../../plus/salesSdk/context/SalesSdkProvider.js";
|
|
9
|
-
import "../../plus/salesSdk/index.js";
|
|
10
9
|
import { isPersistedBigSaleOrderId } from "./utils/orderIdentity.js";
|
|
11
10
|
import { seedDineInReservationToCart } from "../../plus/pisellReservation/utils/seedDineInReservationToCart.js";
|
|
12
11
|
import BigSale from "./index.js";
|
|
@@ -4,7 +4,6 @@ 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";
|
|
8
7
|
import { useMemo } from "react";
|
|
9
8
|
//#region src/components/bigSale/hooks/useBigSaleContext.ts
|
|
10
9
|
/**
|
|
@@ -3,7 +3,6 @@ import { _asyncToGenerator } from "../../../_virtual/_@oxc-project_runtime@0.122
|
|
|
3
3
|
import { buildInitBookingContextParams, collectBookingIdsFromTempOrder } from "../../../plus/salesSdk/utils/buildDefaultLoadProductsParams.js";
|
|
4
4
|
import { useSalesSdkUIHosts } from "../../../plus/salesSdk/context/SalesSdkUIHostsContext.js";
|
|
5
5
|
import { SalesSdkRootRefreshContext } from "../../../plus/salesSdk/context/SalesSdkProvider.js";
|
|
6
|
-
import "../../../plus/salesSdk/index.js";
|
|
7
6
|
import { isPersistedBigSaleOrderId } from "../utils/orderIdentity.js";
|
|
8
7
|
import { resolveOrderIdForHostActions } from "../../../plus/pisellReservation/components/bookingDetailModal/bookingDetailHostActions.js";
|
|
9
8
|
import { usePicoCodingOpenData } from "../../../plus/pisellReservation/hooks/usePicoCodingOpenData.js";
|
|
@@ -8,7 +8,6 @@ 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";
|
|
12
11
|
import { resolveKioskPlatformSource, resolveKioskPresentation } from "../kioskSale/resolveKioskPresentation.js";
|
|
13
12
|
import { resolveCustomerDetailAppearance } from "../../pro/skuDetailModal/customerDetailPolicy.js";
|
|
14
13
|
import { ResponsiveBigSaleBase } from "./Base.js";
|
|
@@ -13,7 +13,6 @@ import { useSalesSdkBusinessAvailability } from "../../../../plus/salesSdk/conte
|
|
|
13
13
|
import { collectUnassignedHolderLines } from "../../../../plus/salesSdk/utils/holderSubmitValidation.js";
|
|
14
14
|
import { isFulfillmentTimingBooking } from "../../../../plus/salesSdk/utils/fulfillmentTimingBooking.js";
|
|
15
15
|
import { useSalesSdkGlobalScanActivity } from "../../../../plus/salesSdk/context/SalesSdkGlobalScanActivityContext.js";
|
|
16
|
-
import "../../../../plus/salesSdk/index.js";
|
|
17
16
|
import { usePickSaleDetailContext } from "../../hooks/usePickSaleDetailContext.js";
|
|
18
17
|
import { resolveBigSaleAutoProductListPreferences } from "../../utils/productListPreferences.js";
|
|
19
18
|
import { resolveBigSaleProductDisplayConfig } from "../../hooks/useBigSaleProductListConfig.js";
|
|
@@ -266,11 +266,14 @@ function readBigSaleProductListPreferences(key, defaultPreferences = DEFAULT_BIG
|
|
|
266
266
|
return readStoredBigSaleProductListPreferences(key, normalizedDefault) || normalizedDefault;
|
|
267
267
|
}
|
|
268
268
|
function writeBigSaleProductListPreferences(key, preferences) {
|
|
269
|
-
if (typeof localStorage === "undefined") return;
|
|
269
|
+
if (typeof localStorage === "undefined") return false;
|
|
270
270
|
const normalized = normalizePreferences(preferences, void 0, true);
|
|
271
271
|
try {
|
|
272
272
|
localStorage.setItem(key, JSON.stringify(normalized || DEFAULT_BIG_SALE_PRODUCT_LIST_PREFERENCES));
|
|
273
|
-
|
|
273
|
+
return true;
|
|
274
|
+
} catch (_unused2) {
|
|
275
|
+
return false;
|
|
276
|
+
}
|
|
274
277
|
}
|
|
275
278
|
function removeBigSaleProductListPreferences(key) {
|
|
276
279
|
if (typeof localStorage === "undefined") return;
|
|
@@ -2,7 +2,6 @@ import useEngineContext from "../../hooks/useEngineContext.js";
|
|
|
2
2
|
import { _asyncToGenerator } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
|
|
3
3
|
import { useSalesSdk } from "../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
4
4
|
import { TEMP_ORDER_SYNC_REQUEST_MESSAGE_TYPE, getTempOrderSyncPayload, shouldApplySharedTempOrderPayload } from "../../plus/salesSdk/tempOrderSync.js";
|
|
5
|
-
import "../../plus/salesSdk/index.js";
|
|
6
5
|
import { useEffect, useRef, useState } from "react";
|
|
7
6
|
//#region src/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.tsx
|
|
8
7
|
function createRequestId() {
|
|
@@ -1,23 +1,51 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
2
|
+
import { isSkuFlagSet } from "../../plus/skuOptionsSelection/utils/skuSemantics.js";
|
|
3
|
+
import { validateBookingProductConfiguration } from "../../pro/bookingProductDetailModal/prepare.js";
|
|
2
4
|
import NumericStepper from "../../pro/NumericStepper/index.js";
|
|
3
5
|
import { formatTempOrderSettlementAmount } from "../../plus/multiCurrencySettlement/index.js";
|
|
6
|
+
import { useOptionalBookingUI } from "../../plus/venueBookingDesign/context.js";
|
|
4
7
|
import { Button as Button$1 } from "../../plus/venueBookingDesign/shared/Controls.js";
|
|
5
8
|
import { localizedText } from "./presentation.js";
|
|
6
9
|
import BookingProductDetailModal from "../../pro/bookingProductDetailModal/index.js";
|
|
7
10
|
import BookingSelectionPanel from "./availability/BookingSelectionPanel.js";
|
|
8
11
|
import { useBookingComposer } from "./useBookingComposer.js";
|
|
9
12
|
import VenueProductIntro from "./VenueProductIntro.js";
|
|
10
|
-
import
|
|
13
|
+
import { usePartyConfigurationPrice } from "./usePartyConfigurationPrice.js";
|
|
14
|
+
import React, { useMemo } from "react";
|
|
11
15
|
import { Alert } from "antd";
|
|
12
16
|
import Decimal from "decimal.js";
|
|
13
17
|
//#region src/components/venueBookingSales/BookingComposer.tsx
|
|
14
18
|
/** Existing reservation view; page compositions can consume the same model independently. */
|
|
15
19
|
function BookingComposer(props) {
|
|
16
|
-
var _props$skuOptions;
|
|
20
|
+
var _draft$plan, _props$skuOptions$con, _props$skuOptions, _draft$plan2, _props$skuOptions2;
|
|
17
21
|
const { mode, draft, locale } = props;
|
|
18
22
|
const text = (en, zh) => locale === "zh" ? zh : en;
|
|
19
23
|
const model = useBookingComposer(props);
|
|
24
|
+
const bookingUI = useOptionalBookingUI();
|
|
20
25
|
const { configuration, setConfiguration, quantity, setQuantity, quote, error, working, revision, commit } = model;
|
|
26
|
+
const configurationDetail = mode === "tickets" && ((_draft$plan = draft.plan) === null || _draft$plan === void 0 ? void 0 : _draft$plan.hasConfiguration) ? draft.plan.productDetail : void 0;
|
|
27
|
+
const overSold = isSkuFlagSet((_props$skuOptions$con = (_props$skuOptions = props.skuOptions) === null || _props$skuOptions === void 0 || (_props$skuOptions = _props$skuOptions.config) === null || _props$skuOptions === void 0 ? void 0 : _props$skuOptions.overSold) !== null && _props$skuOptions$con !== void 0 ? _props$skuOptions$con : draft.detail.over_sold);
|
|
28
|
+
const configurationComplete = useMemo(() => Boolean(configurationDetail && validateBookingProductConfiguration(configurationDetail, configuration.skuValue, {
|
|
29
|
+
requiredOptionValidation: props.requiredOptionValidation,
|
|
30
|
+
overSold
|
|
31
|
+
})), [
|
|
32
|
+
configurationDetail,
|
|
33
|
+
configuration.skuValue,
|
|
34
|
+
props.requiredOptionValidation,
|
|
35
|
+
overSold
|
|
36
|
+
]);
|
|
37
|
+
const configurationEstimate = usePartyConfigurationPrice({
|
|
38
|
+
enabled: configurationComplete,
|
|
39
|
+
openId: (_draft$plan2 = draft.plan) === null || _draft$plan2 === void 0 ? void 0 : _draft$plan2.openId,
|
|
40
|
+
scopeKey: props.scopeKey,
|
|
41
|
+
productDetail: configurationDetail,
|
|
42
|
+
skuValue: configuration.skuValue,
|
|
43
|
+
quantity,
|
|
44
|
+
overSold,
|
|
45
|
+
timeZone: bookingUI === null || bookingUI === void 0 ? void 0 : bookingUI.timeZone,
|
|
46
|
+
customerId: props.customerId,
|
|
47
|
+
os: props.priceSource
|
|
48
|
+
});
|
|
21
49
|
const formatAmount = props.formatAmount || ((value) => {
|
|
22
50
|
var _props$context$sales$, _props$context$sales$2, _props$context$sales$3;
|
|
23
51
|
return formatTempOrderSettlementAmount((_props$context$sales$ = (_props$context$sales$2 = props.context.sales.bookingTicket) === null || _props$context$sales$2 === void 0 || (_props$context$sales$3 = _props$context$sales$2.getTempOrder) === null || _props$context$sales$3 === void 0 ? void 0 : _props$context$sales$3.call(_props$context$sales$2)) !== null && _props$context$sales$ !== void 0 ? _props$context$sales$ : props.context.cart.tempOrder, value);
|
|
@@ -25,6 +53,7 @@ function BookingComposer(props) {
|
|
|
25
53
|
const catalogAmount = draft.catalogStartingAmount;
|
|
26
54
|
const startingAmount = mode === "tickets" && catalogAmount !== void 0 && catalogAmount !== null && String(catalogAmount).trim() !== "" && Number.isFinite(Number(catalogAmount)) ? formatAmount(new Decimal(catalogAmount).times(quantity).toString()) : void 0;
|
|
27
55
|
const quoteAmount = quote ? formatAmount(quote.compositeLineTotal) : startingAmount !== void 0 ? draft.catalogPriceQualifier === "from" ? locale === "zh" ? `${startingAmount} 起` : `From ${startingAmount}` : startingAmount : "—";
|
|
56
|
+
const configurationAmount = configurationComplete && configurationEstimate.status === "ready" ? formatAmount(configurationEstimate.subtotal) : startingAmount !== void 0 ? locale === "zh" ? `${startingAmount} 起` : `From ${startingAmount}` : "—";
|
|
28
57
|
const booking = (scrollContainer) => /* @__PURE__ */ React.createElement(BookingSelectionPanel, _objectSpread2(_objectSpread2({ ref: model.panelRef }, model.bookingProps), {}, {
|
|
29
58
|
scrollContainer,
|
|
30
59
|
renderDatePicker: props.renderDatePicker,
|
|
@@ -33,22 +62,22 @@ function BookingComposer(props) {
|
|
|
33
62
|
return (scrollContainer === null || scrollContainer === void 0 || (_scrollContainer$clos = scrollContainer.closest("[role=\"dialog\"]")) === null || _scrollContainer$clos === void 0 ? void 0 : _scrollContainer$clos.querySelector(".booking-config-actions .booking-primary-action")) || null;
|
|
34
63
|
}
|
|
35
64
|
}));
|
|
36
|
-
const quantityControl = mode === "tickets" && !draft.lineUid ? /* @__PURE__ */ React.createElement("div", { className: "reservation-quantity" }, /* @__PURE__ */ React.createElement("span", null, text("Number", "数量")), /* @__PURE__ */ React.createElement(NumericStepper, {
|
|
65
|
+
const quantityControl = (busy = false) => mode === "tickets" && !draft.lineUid ? /* @__PURE__ */ React.createElement("div", { className: "reservation-quantity" }, /* @__PURE__ */ React.createElement("span", null, text("Number", "数量")), /* @__PURE__ */ React.createElement(NumericStepper, {
|
|
37
66
|
className: "booking-ticket-quantity",
|
|
38
67
|
variant: "capsule",
|
|
39
68
|
min: 1,
|
|
40
69
|
step: 1,
|
|
41
70
|
value: quantity,
|
|
42
|
-
disabled: working || props.disabled,
|
|
71
|
+
disabled: busy || working || props.disabled,
|
|
43
72
|
commitInputOnClose: false,
|
|
44
73
|
selectAllInputOnOpen: true,
|
|
45
74
|
clearSelectedInputOnDelete: true,
|
|
46
75
|
ignoreEmptyInputConfirm: true,
|
|
47
76
|
onChange: (value) => {
|
|
48
|
-
if (!working && !props.disabled && Number.isSafeInteger(value) && value >= 1) setQuantity(value);
|
|
77
|
+
if (!busy && !working && !props.disabled && Number.isSafeInteger(value) && value >= 1) setQuantity(value);
|
|
49
78
|
}
|
|
50
79
|
})) : null;
|
|
51
|
-
const footer = /* @__PURE__ */ React.createElement("div", { className: "venue-booking-sales__booking-footer" }, quantityControl, /* @__PURE__ */ React.createElement("div", {
|
|
80
|
+
const footer = /* @__PURE__ */ React.createElement("div", { className: "venue-booking-sales__booking-footer" }, quantityControl(), /* @__PURE__ */ React.createElement("div", {
|
|
52
81
|
className: mode === "tickets" ? "reservation-subtotal" : "party-total",
|
|
53
82
|
"aria-live": "polite"
|
|
54
83
|
}, /* @__PURE__ */ React.createElement("span", null, text("Subtotal", "小计")), /* @__PURE__ */ React.createElement("strong", null, quoteAmount)));
|
|
@@ -65,7 +94,7 @@ function BookingComposer(props) {
|
|
|
65
94
|
}),
|
|
66
95
|
configuration,
|
|
67
96
|
onConfigurationChange: setConfiguration,
|
|
68
|
-
skuOptions: _objectSpread2(_objectSpread2({}, props.skuOptions), {}, { priceFormatter: ((_props$
|
|
97
|
+
skuOptions: _objectSpread2(_objectSpread2({}, props.skuOptions), {}, { priceFormatter: ((_props$skuOptions2 = props.skuOptions) === null || _props$skuOptions2 === void 0 ? void 0 : _props$skuOptions2.priceFormatter) || ((value) => String(formatAmount(value))) }),
|
|
69
98
|
requiredOptionValidation: props.requiredOptionValidation,
|
|
70
99
|
onCancel: model.cancel,
|
|
71
100
|
locale,
|
|
@@ -73,7 +102,14 @@ function BookingComposer(props) {
|
|
|
73
102
|
selectionRevision: revision,
|
|
74
103
|
error,
|
|
75
104
|
renderBooking: ({ scrollContainer }) => booking(scrollContainer),
|
|
76
|
-
footerContent: ({
|
|
105
|
+
footerContent: ({ busy }) => quantityControl(busy),
|
|
106
|
+
configurationFooter: {
|
|
107
|
+
label: text("Estimated subtotal", "预计小计"),
|
|
108
|
+
amount: /* @__PURE__ */ React.createElement("span", {
|
|
109
|
+
role: "status",
|
|
110
|
+
"aria-live": "polite"
|
|
111
|
+
}, configurationAmount)
|
|
112
|
+
},
|
|
77
113
|
bookingActionAmount: quoteAmount,
|
|
78
114
|
bookingReady: model.bookingReady,
|
|
79
115
|
onConfirm: commit
|
|
@@ -15,10 +15,10 @@ import BookingProductDetailModal from "../../pro/bookingProductDetailModal/index
|
|
|
15
15
|
import { bookingReasonLabel } from "./availability/labels.js";
|
|
16
16
|
import { prepareBookingProduct } from "./availability/prepareProduct.js";
|
|
17
17
|
import VenueProductIntro from "./VenueProductIntro.js";
|
|
18
|
+
import { usePartyConfigurationPrice } from "./usePartyConfigurationPrice.js";
|
|
18
19
|
import { isVenueExtraSellable } from "./extraCatalogAvailability.js";
|
|
19
20
|
import { getVenueExtraHolderSource } from "./extras/holder.js";
|
|
20
21
|
import { venueProductLineUid } from "./orderBindings.js";
|
|
21
|
-
import { usePartyConfigurationPrice } from "./usePartyConfigurationPrice.js";
|
|
22
22
|
import VenueExtraDetailModal from "./extras/VenueExtraDetailModal.js";
|
|
23
23
|
import { createVenueCatalogCardRenderer, extrasCardConfig, extrasPreferences, mainCardConfig, mainPreferences } from "./catalogPresentation.js";
|
|
24
24
|
import { groupVenueOrderBindings, venueBundleContents } from "./orderDisplayGroups.js";
|
|
@@ -31,6 +31,7 @@ const BookingSelectionPanel = forwardRef((props, ref) => {
|
|
|
31
31
|
const [dateError, setDateError] = useState(false);
|
|
32
32
|
const rootRef = useRef(null);
|
|
33
33
|
const resourcesRef = useRef(null);
|
|
34
|
+
const resolvedResourceTimeRef = useRef();
|
|
34
35
|
const timeRef = useRef(null);
|
|
35
36
|
const dateDetailsRef = useRef(null);
|
|
36
37
|
const mounted = useRef(true);
|
|
@@ -125,6 +126,16 @@ const BookingSelectionPanel = forwardRef((props, ref) => {
|
|
|
125
126
|
const timeGroups = groupBookingTimes(state.times, (state.partySize || 0) * state.bookingCount);
|
|
126
127
|
const currentTime = state.times.find((candidate) => sameBookingTime(candidate, state.candidate));
|
|
127
128
|
const selectedTime = currentTime && selectable(currentTime, (state.partySize || 0) * state.bookingCount) ? state.candidate : void 0;
|
|
129
|
+
const resourceTimeKey = selectedTime ? `${state.contextId || ""}:${bookingTimeIntervalKey(selectedTime)}` : void 0;
|
|
130
|
+
const resourcesResolved = !!resourceTimeKey && !dateChanging && (state.status === "selecting" || state.status === "ready" || resolvedResourceTimeRef.current === resourceTimeKey);
|
|
131
|
+
useEffect(() => {
|
|
132
|
+
if (!resourceTimeKey || dateChanging) resolvedResourceTimeRef.current = void 0;
|
|
133
|
+
else if (state.status === "selecting" || state.status === "ready") resolvedResourceTimeRef.current = resourceTimeKey;
|
|
134
|
+
}, [
|
|
135
|
+
resourceTimeKey,
|
|
136
|
+
state.status,
|
|
137
|
+
dateChanging
|
|
138
|
+
]);
|
|
128
139
|
const timeValue = state.status === "loading" || dateChanging ? t("timeLoading") : state.status === "error" ? t("timeLoadFailed") : selectedTime ? `${candidateClock(selectedTime.bookingStartAt || selectedTime.startAt, selectedTime.startTime)}–${candidateClock(selectedTime.bookingEndAt || selectedTime.endAt, selectedTime.endTime)}` : t(timeGroups.some(({ candidate }) => selectable(candidate, (state.partySize || 0) * state.bookingCount)) ? "timeNotSelected" : "timeUnavailable");
|
|
129
140
|
const localTimePending = props.mode === "party" && !state.times.length && (state.status === "idle" || state.status === "loading" || dateChanging);
|
|
130
141
|
const localTimeFailure = props.mode === "party" && !state.times.length && state.status === "error" && !state.requiresOrderReconciliation;
|
|
@@ -266,7 +277,7 @@ const BookingSelectionPanel = forwardRef((props, ref) => {
|
|
|
266
277
|
].includes(code));
|
|
267
278
|
const showFailure = !busy && (state.status === "error" || state.status === "blocked" || state.requiresOrderReconciliation || failureCodes.length > 0);
|
|
268
279
|
const reasonLabels = showFailure ? Array.from(new Set(failureCodes.map(reason))) : [];
|
|
269
|
-
const showResources = props.mode === "party" || visibleGroups(state).length > 0 || !state.resourceGroups.length && Object.keys(configured).length > 0;
|
|
280
|
+
const showResources = props.mode === "party" || resourcesResolved && (visibleGroups(state).length > 0 || !state.resourceGroups.length && Object.keys(configured).length > 0);
|
|
270
281
|
const statusPanel = /* @__PURE__ */ React.createElement(React.Fragment, null, (showFailure || dateError) && /* @__PURE__ */ React.createElement("div", {
|
|
271
282
|
className: "venue-booking-availability__status",
|
|
272
283
|
role: "alert"
|
|
@@ -7,7 +7,6 @@ import { useSalesSdkHostBridges } from "../../../plus/salesSdk/context/SalesSdkH
|
|
|
7
7
|
import { isVirtualSettlementTempOrder } from "../../../plus/multiCurrencySettlement/index.js";
|
|
8
8
|
import { freePayApi } from "../../Sales/Checkout/serve.js";
|
|
9
9
|
import { useSalesSdkBusinessAvailability } from "../../../plus/salesSdk/context/SalesSdkBusinessAvailabilityContext.js";
|
|
10
|
-
import "../../../plus/salesSdk/index.js";
|
|
11
10
|
import { isSalesOrderSubmitSuccess } from "../../../plus/saleDetail/components/DetailActions/utils.js";
|
|
12
11
|
import { isH5ZeroAmountValue, resolveKioskSubmittedPayableAmount, toFiniteKioskAmount } from "../../bigSale/templates/Kiosk/zeroAmountCheckout.js";
|
|
13
12
|
import { resolveKioskDeferredSubmission } from "../../bigSale/templates/Kiosk/deferredCheckout.js";
|
|
@@ -9,9 +9,9 @@ import SKUOptionsSelection from "../../../plus/skuOptionsSelection/index.js";
|
|
|
9
9
|
import immersive from "../../../pro/skuDetailModal/appearances/immersive/index.js";
|
|
10
10
|
import { resolveEffectiveHolderConfig } from "../../../plus/salesSdk/utils/productHolderConfig.js";
|
|
11
11
|
import { descriptionText, localizedText } from "../presentation.js";
|
|
12
|
+
import { usePartyConfigurationPrice } from "../usePartyConfigurationPrice.js";
|
|
12
13
|
import { getVenueExtraHolderSource } from "./holder.js";
|
|
13
14
|
import { confirmationErrorMessage } from "../checkout/errorMessage.js";
|
|
14
|
-
import { usePartyConfigurationPrice } from "../usePartyConfigurationPrice.js";
|
|
15
15
|
import { VenueExtraHolderField } from "./VenueExtraHolderField.js";
|
|
16
16
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
17
17
|
import { ConfigProvider } from "antd";
|