@pisell/private-materials 6.12.408 → 6.12.410
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 +12 -12
- package/build/lowcode/view.js +12 -12
- package/es/components/bigSale/components/ProductList/index.js +179 -26
- package/es/components/bigSale/components/ProductListSettingsModal/index.js +5 -3
- package/es/components/bigSale/templates/Kiosk/payment/index.js +16 -0
- package/es/components/bigSale/utils/productListPreferences.js +5 -2
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +9 -3
- package/es/components/checkout/components/PaymentOptionsModule/index.js +10 -2
- package/es/components/vendingMachine/README.md +1 -1
- package/es/components/venueBookingSales/BookingComposer.js +44 -8
- package/es/components/venueBookingSales/VenueBookingShared.js +1 -1
- package/es/components/venueBookingSales/VenueExitButton.js +22 -11
- package/es/components/venueBookingSales/availability/BookingSelectionPanel.js +12 -1
- package/es/components/venueBookingSales/checkout/VenueBookingHolderStep.js +6 -1
- package/es/components/venueBookingSales/checkout/useVenueReviewAccess.js +111 -0
- package/es/components/venueBookingSales/extras/VenueExtraDetailModal.js +1 -1
- package/es/components/venueBookingSales/useVenueBookingSteps.js +60 -11
- 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/templates/Kiosk/payment/index.js +16 -0
- package/lib/components/bigSale/utils/productListPreferences.js +5 -2
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +9 -3
- package/lib/components/checkout/components/PaymentOptionsModule/index.js +10 -2
- package/lib/components/vendingMachine/README.md +1 -1
- package/lib/components/venueBookingSales/BookingComposer.js +43 -7
- package/lib/components/venueBookingSales/VenueBookingShared.js +1 -1
- package/lib/components/venueBookingSales/VenueExitButton.js +21 -10
- package/lib/components/venueBookingSales/availability/BookingSelectionPanel.js +12 -1
- package/lib/components/venueBookingSales/checkout/VenueBookingHolderStep.js +6 -1
- package/lib/components/venueBookingSales/checkout/useVenueReviewAccess.js +112 -0
- package/lib/components/venueBookingSales/extras/VenueExtraDetailModal.js +1 -1
- package/lib/components/venueBookingSales/useVenueBookingSteps.js +60 -11
- package/lib/pro/bookingProductDetailModal/index.js +7 -7
- package/package.json +2 -2
|
@@ -50,6 +50,42 @@ function getCurrentRoutePath() {
|
|
|
50
50
|
const { pathname, search, hash } = window.location;
|
|
51
51
|
return `${pathname}${search}${hash}`;
|
|
52
52
|
}
|
|
53
|
+
function getOperatorMetadata(user) {
|
|
54
|
+
var _user$id, _user$email, _user$pos_id;
|
|
55
|
+
if (!user || typeof user !== "object") return null;
|
|
56
|
+
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;
|
|
57
|
+
const operator = {
|
|
58
|
+
id: (_user$id = user.id) !== null && _user$id !== void 0 ? _user$id : null,
|
|
59
|
+
name,
|
|
60
|
+
email: (_user$email = user.email) !== null && _user$email !== void 0 ? _user$email : null,
|
|
61
|
+
posId: (_user$pos_id = user.pos_id) !== null && _user$pos_id !== void 0 ? _user$pos_id : null
|
|
62
|
+
};
|
|
63
|
+
return Object.values(operator).some(Boolean) ? operator : null;
|
|
64
|
+
}
|
|
65
|
+
function getCurrentOperatorMetadata(engineContext) {
|
|
66
|
+
var _engineContext$appHel;
|
|
67
|
+
const utils = engineContext === null || engineContext === void 0 || (_engineContext$appHel = engineContext.appHelper) === null || _engineContext$appHel === void 0 ? void 0 : _engineContext$appHel.utils;
|
|
68
|
+
const candidates = [];
|
|
69
|
+
if (typeof (utils === null || utils === void 0 ? void 0 : utils.getData) === "function") try {
|
|
70
|
+
candidates.push(utils.getData("account"), utils.getData("customer"));
|
|
71
|
+
} catch (_unused) {}
|
|
72
|
+
let appStorage;
|
|
73
|
+
if (typeof (utils === null || utils === void 0 ? void 0 : utils.getApp) === "function") try {
|
|
74
|
+
var _utils$getApp;
|
|
75
|
+
appStorage = (_utils$getApp = utils.getApp()) === null || _utils$getApp === void 0 ? void 0 : _utils$getApp.storage;
|
|
76
|
+
} catch (_unused2) {}
|
|
77
|
+
[utils === null || utils === void 0 ? void 0 : utils.storage, appStorage].forEach((storage) => {
|
|
78
|
+
if (typeof (storage === null || storage === void 0 ? void 0 : storage.get) !== "function") return;
|
|
79
|
+
try {
|
|
80
|
+
candidates.push(storage.get("account"), storage.get("customer"));
|
|
81
|
+
} catch (_unused3) {}
|
|
82
|
+
});
|
|
83
|
+
for (const candidate of candidates) try {
|
|
84
|
+
const operator = getOperatorMetadata(typeof candidate === "string" ? JSON.parse(candidate) : candidate);
|
|
85
|
+
if (operator) return operator;
|
|
86
|
+
} catch (_unused4) {}
|
|
87
|
+
return null;
|
|
88
|
+
}
|
|
53
89
|
function resolvePhoneCartEntryQuantity(value) {
|
|
54
90
|
var _value$_extend$displa, _value$_extend;
|
|
55
91
|
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 +174,7 @@ function shouldHideSingleKioskCategoryNavigation(navigation, items) {
|
|
|
138
174
|
* 商品列表只做“加载商品 + 触发加购”,加购决策交给 salesSdk。
|
|
139
175
|
*/
|
|
140
176
|
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$
|
|
177
|
+
var _engineContext$appHel2, _catalog$products, _sales$bookingTicket$, _sales$bookingTicket, _sales$bookingTicket$2, _productLoadParams$me, _sales$defaultProduct, _sales$tempOrder3;
|
|
142
178
|
const isControlledCatalog = catalog !== void 0;
|
|
143
179
|
const hasControlledActions = isControlledCatalog || quantityByProductId !== void 0 || !!onSelectProduct || !!onQuantityChange;
|
|
144
180
|
const scopeKey = catalog === null || catalog === void 0 ? void 0 : catalog.scopeKey;
|
|
@@ -149,7 +185,8 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
149
185
|
const usesV2ProductCard = variant === "phone" && productCardVersion === "v2";
|
|
150
186
|
const Toast = useToast();
|
|
151
187
|
const engineContext = useEngineContext();
|
|
152
|
-
const getEngineData = engineContext === null || engineContext === void 0 || (_engineContext$
|
|
188
|
+
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;
|
|
189
|
+
const operator = getCurrentOperatorMetadata(engineContext);
|
|
153
190
|
const addToCartToastApi = useMemo(() => addToCartToastIcon ? { success: (content) => {
|
|
154
191
|
Toast.show({
|
|
155
192
|
content,
|
|
@@ -240,8 +277,60 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
240
277
|
const [uncontrolledProductListPreferences, setUncontrolledProductListPreferences] = useState(() => readBigSaleProductListPreferences(preferencesKey, defaultProductListPreferences));
|
|
241
278
|
const [uncontrolledProductListPreferencesKey, setUncontrolledProductListPreferencesKey] = useState(preferencesKey);
|
|
242
279
|
const [uncontrolledProductListPreferencesOverride, setUncontrolledProductListPreferencesOverride] = useState(() => Boolean(readStoredBigSaleProductListPreferences(preferencesKey, defaultProductListPreferences)));
|
|
280
|
+
const productListPreferenceStorageLogRef = useRef();
|
|
281
|
+
const productListEntryLogRef = useRef();
|
|
243
282
|
const productListPreferences = controlledProductListPreferences || (uncontrolledProductListPreferencesKey === preferencesKey ? uncontrolledProductListPreferences : defaultProductListPreferences);
|
|
244
283
|
const productListPreferencesOverride = controlledProductListPreferences !== void 0 ? controlledProductListPreferencesOverride !== false : uncontrolledProductListPreferencesOverride;
|
|
284
|
+
useEffect(() => {
|
|
285
|
+
const metadata = {
|
|
286
|
+
eventVersion: 1,
|
|
287
|
+
action: "enter-sales-page",
|
|
288
|
+
mode,
|
|
289
|
+
businessCode: businessCode !== null && businessCode !== void 0 ? businessCode : null,
|
|
290
|
+
osKey: osKey !== null && osKey !== void 0 ? osKey : null,
|
|
291
|
+
channel: productListPreferencesChannel !== null && productListPreferencesChannel !== void 0 ? productListPreferencesChannel : null,
|
|
292
|
+
scopeKey: scopeKey !== null && scopeKey !== void 0 ? scopeKey : null,
|
|
293
|
+
variant: variant !== null && variant !== void 0 ? variant : null,
|
|
294
|
+
pathname: getCurrentRoutePath(),
|
|
295
|
+
operator,
|
|
296
|
+
storageKey: preferencesKey,
|
|
297
|
+
productListPreferencesSource: controlledProductListPreferences ? "controlled" : productListPreferencesOverride ? "local-storage" : "auto",
|
|
298
|
+
productListPreferences,
|
|
299
|
+
catalogProductCount: currentProducts.length
|
|
300
|
+
};
|
|
301
|
+
const entrySignature = JSON.stringify({
|
|
302
|
+
mode,
|
|
303
|
+
businessCode: businessCode !== null && businessCode !== void 0 ? businessCode : null,
|
|
304
|
+
osKey: osKey !== null && osKey !== void 0 ? osKey : null,
|
|
305
|
+
channel: productListPreferencesChannel !== null && productListPreferencesChannel !== void 0 ? productListPreferencesChannel : null,
|
|
306
|
+
scopeKey: scopeKey !== null && scopeKey !== void 0 ? scopeKey : null,
|
|
307
|
+
pathname: metadata.pathname
|
|
308
|
+
});
|
|
309
|
+
if (productListEntryLogRef.current === entrySignature) return;
|
|
310
|
+
productListEntryLogRef.current = entrySignature;
|
|
311
|
+
try {
|
|
312
|
+
var _logger$addLog;
|
|
313
|
+
logger === null || logger === void 0 || (_logger$addLog = logger.addLog) === null || _logger$addLog === void 0 || _logger$addLog.call(logger, {
|
|
314
|
+
type: "info",
|
|
315
|
+
title: "[BigSaleProductList] 商品列表进入销售页",
|
|
316
|
+
metadata
|
|
317
|
+
});
|
|
318
|
+
} catch (_unused5) {}
|
|
319
|
+
}, [
|
|
320
|
+
businessCode,
|
|
321
|
+
controlledProductListPreferences,
|
|
322
|
+
currentProducts.length,
|
|
323
|
+
logger,
|
|
324
|
+
mode,
|
|
325
|
+
operator,
|
|
326
|
+
osKey,
|
|
327
|
+
preferencesKey,
|
|
328
|
+
productListPreferences,
|
|
329
|
+
productListPreferencesChannel,
|
|
330
|
+
productListPreferencesOverride,
|
|
331
|
+
scopeKey,
|
|
332
|
+
variant
|
|
333
|
+
]);
|
|
245
334
|
const productListConfig = useBigSaleProductListConfig({
|
|
246
335
|
products: currentProducts,
|
|
247
336
|
scopeKey,
|
|
@@ -285,11 +374,44 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
285
374
|
setUncontrolledProductListPreferences(storedPreferences || defaultProductListPreferences);
|
|
286
375
|
setUncontrolledProductListPreferencesKey(preferencesKey);
|
|
287
376
|
setUncontrolledProductListPreferencesOverride(Boolean(storedPreferences));
|
|
377
|
+
const metadata = {
|
|
378
|
+
eventVersion: 1,
|
|
379
|
+
mode,
|
|
380
|
+
businessCode: businessCode !== null && businessCode !== void 0 ? businessCode : null,
|
|
381
|
+
osKey: osKey !== null && osKey !== void 0 ? osKey : null,
|
|
382
|
+
channel: productListPreferencesChannel !== null && productListPreferencesChannel !== void 0 ? productListPreferencesChannel : null,
|
|
383
|
+
operator,
|
|
384
|
+
variant: variant !== null && variant !== void 0 ? variant : null,
|
|
385
|
+
pathname: getCurrentRoutePath(),
|
|
386
|
+
storageKey: preferencesKey,
|
|
387
|
+
cacheHit: Boolean(storedPreferences),
|
|
388
|
+
storedPreferences: storedPreferences !== null && storedPreferences !== void 0 ? storedPreferences : null,
|
|
389
|
+
fallbackPreferences: defaultProductListPreferences
|
|
390
|
+
};
|
|
391
|
+
const signature = JSON.stringify(metadata);
|
|
392
|
+
if (productListPreferenceStorageLogRef.current !== signature) {
|
|
393
|
+
productListPreferenceStorageLogRef.current = signature;
|
|
394
|
+
try {
|
|
395
|
+
var _logger$addLog2;
|
|
396
|
+
logger === null || logger === void 0 || (_logger$addLog2 = logger.addLog) === null || _logger$addLog2 === void 0 || _logger$addLog2.call(logger, {
|
|
397
|
+
type: "info",
|
|
398
|
+
title: "[BigSaleProductList] 商品卡配置本地缓存读取",
|
|
399
|
+
metadata
|
|
400
|
+
});
|
|
401
|
+
} catch (_unused6) {}
|
|
402
|
+
}
|
|
288
403
|
}
|
|
289
404
|
}, [
|
|
405
|
+
businessCode,
|
|
290
406
|
controlledProductListPreferences,
|
|
291
407
|
defaultProductListPreferences,
|
|
292
|
-
|
|
408
|
+
logger,
|
|
409
|
+
mode,
|
|
410
|
+
osKey,
|
|
411
|
+
operator,
|
|
412
|
+
preferencesKey,
|
|
413
|
+
productListPreferencesChannel,
|
|
414
|
+
variant
|
|
293
415
|
]);
|
|
294
416
|
const productListLayoutLogRef = useRef();
|
|
295
417
|
useEffect(() => {
|
|
@@ -311,13 +433,13 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
311
433
|
if (productListLayoutLogRef.current === signature) return;
|
|
312
434
|
productListLayoutLogRef.current = signature;
|
|
313
435
|
try {
|
|
314
|
-
var _logger$
|
|
315
|
-
logger === null || logger === void 0 || (_logger$
|
|
436
|
+
var _logger$addLog3;
|
|
437
|
+
logger === null || logger === void 0 || (_logger$addLog3 = logger.addLog) === null || _logger$addLog3 === void 0 || _logger$addLog3.call(logger, {
|
|
316
438
|
type: "info",
|
|
317
439
|
title: "[BigSaleProductList] 商品列表布局已解析",
|
|
318
440
|
metadata
|
|
319
441
|
});
|
|
320
|
-
} catch (
|
|
442
|
+
} catch (_unused7) {}
|
|
321
443
|
}, [
|
|
322
444
|
businessCode,
|
|
323
445
|
controlledProductListPreferences,
|
|
@@ -503,13 +625,13 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
503
625
|
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
626
|
const baselineQuantity = phoneCartProductEntries.filter((entry) => resolvePhoneCartProductId(entry.value) === productId).reduce((total, entry) => total + entry.quantity, 0);
|
|
505
627
|
try {
|
|
506
|
-
var _sales$tempOrder4, _logger$
|
|
628
|
+
var _sales$tempOrder4, _logger$addLog4, _cart$items$length, _cart$items, _cart$bookings$length, _cart$bookings, _ref7, _sales$tempOrder$orde, _sales$tempOrder5;
|
|
507
629
|
if (!(yield businessAvailability.ensureCanShop())) return;
|
|
508
630
|
if (!sales.isReady) return;
|
|
509
631
|
if (requiredOrderId !== void 0 && Number((_sales$tempOrder4 = sales.tempOrder) === null || _sales$tempOrder4 === void 0 ? void 0 : _sales$tempOrder4.order_id) !== Number(requiredOrderId)) return;
|
|
510
632
|
const latestProduct = currentProducts.find((currentProduct) => currentProduct.id === product.id);
|
|
511
633
|
latestProduct && _objectSpread2(_objectSpread2({}, product), {}, { cartDetailValue: latestProduct.cartDetailValue });
|
|
512
|
-
logger === null || logger === void 0 || (_logger$
|
|
634
|
+
logger === null || logger === void 0 || (_logger$addLog4 = logger.addLog) === null || _logger$addLog4 === void 0 || _logger$addLog4.call(logger, {
|
|
513
635
|
type: "info",
|
|
514
636
|
title: "[BigSaleProductList] 用户点击商品卡片加入购物车",
|
|
515
637
|
metadata: {
|
|
@@ -1023,39 +1145,68 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
1023
1145
|
setSettingsOpen(false);
|
|
1024
1146
|
});
|
|
1025
1147
|
const handleSaveSettings = useMemoizedFn((preferences) => {
|
|
1026
|
-
writeBigSaleProductListPreferences(preferencesKey, preferences);
|
|
1148
|
+
const cacheWriteSucceeded = writeBigSaleProductListPreferences(preferencesKey, preferences);
|
|
1149
|
+
const persistedPreferences = cacheWriteSucceeded ? readStoredBigSaleProductListPreferences(preferencesKey, defaultProductListPreferences) : void 0;
|
|
1027
1150
|
setUncontrolledProductListPreferences(preferences);
|
|
1028
1151
|
setUncontrolledProductListPreferencesKey(preferencesKey);
|
|
1029
1152
|
setUncontrolledProductListPreferencesOverride(true);
|
|
1153
|
+
const metadata = {
|
|
1154
|
+
eventVersion: 1,
|
|
1155
|
+
action: "save-completed",
|
|
1156
|
+
mode,
|
|
1157
|
+
businessCode: businessCode !== null && businessCode !== void 0 ? businessCode : null,
|
|
1158
|
+
osKey: osKey !== null && osKey !== void 0 ? osKey : null,
|
|
1159
|
+
channel: productListPreferencesChannel !== null && productListPreferencesChannel !== void 0 ? productListPreferencesChannel : null,
|
|
1160
|
+
operator,
|
|
1161
|
+
variant: variant !== null && variant !== void 0 ? variant : null,
|
|
1162
|
+
pathname: getCurrentRoutePath(),
|
|
1163
|
+
storageKey: preferencesKey,
|
|
1164
|
+
cacheWriteSucceeded,
|
|
1165
|
+
persistedPreferences: persistedPreferences !== null && persistedPreferences !== void 0 ? persistedPreferences : null,
|
|
1166
|
+
preferences
|
|
1167
|
+
};
|
|
1030
1168
|
try {
|
|
1031
|
-
var _logger$
|
|
1032
|
-
logger === null || logger === void 0 || (_logger$
|
|
1169
|
+
var _logger$addLog5;
|
|
1170
|
+
logger === null || logger === void 0 || (_logger$addLog5 = logger.addLog) === null || _logger$addLog5 === void 0 || _logger$addLog5.call(logger, {
|
|
1033
1171
|
type: "info",
|
|
1034
1172
|
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
|
-
}
|
|
1173
|
+
metadata
|
|
1046
1174
|
});
|
|
1047
|
-
} catch (
|
|
1175
|
+
} catch (_unused8) {}
|
|
1048
1176
|
onProductListPreferencesChange === null || onProductListPreferencesChange === void 0 || onProductListPreferencesChange(preferences);
|
|
1049
1177
|
setSettingsOpen(false);
|
|
1050
1178
|
});
|
|
1179
|
+
const handleSettingsSaveAttempt = useMemoizedFn((preferences) => {
|
|
1180
|
+
const metadata = {
|
|
1181
|
+
eventVersion: 1,
|
|
1182
|
+
action: "save-clicked",
|
|
1183
|
+
mode,
|
|
1184
|
+
businessCode: businessCode !== null && businessCode !== void 0 ? businessCode : null,
|
|
1185
|
+
osKey: osKey !== null && osKey !== void 0 ? osKey : null,
|
|
1186
|
+
channel: productListPreferencesChannel !== null && productListPreferencesChannel !== void 0 ? productListPreferencesChannel : null,
|
|
1187
|
+
variant: variant !== null && variant !== void 0 ? variant : null,
|
|
1188
|
+
pathname: getCurrentRoutePath(),
|
|
1189
|
+
storageKey: preferencesKey,
|
|
1190
|
+
operator,
|
|
1191
|
+
preferences
|
|
1192
|
+
};
|
|
1193
|
+
try {
|
|
1194
|
+
var _logger$addLog6;
|
|
1195
|
+
logger === null || logger === void 0 || (_logger$addLog6 = logger.addLog) === null || _logger$addLog6 === void 0 || _logger$addLog6.call(logger, {
|
|
1196
|
+
type: "info",
|
|
1197
|
+
title: "[BigSaleProductList] 商品卡配置弹窗点击保存",
|
|
1198
|
+
metadata
|
|
1199
|
+
});
|
|
1200
|
+
} catch (_unused9) {}
|
|
1201
|
+
});
|
|
1051
1202
|
const handleResetSettings = useMemoizedFn(() => {
|
|
1052
1203
|
removeBigSaleProductListPreferences(preferencesKey);
|
|
1053
1204
|
setUncontrolledProductListPreferences(defaultProductListPreferences);
|
|
1054
1205
|
setUncontrolledProductListPreferencesKey(preferencesKey);
|
|
1055
1206
|
setUncontrolledProductListPreferencesOverride(false);
|
|
1056
1207
|
try {
|
|
1057
|
-
var _logger$
|
|
1058
|
-
logger === null || logger === void 0 || (_logger$
|
|
1208
|
+
var _logger$addLog7;
|
|
1209
|
+
logger === null || logger === void 0 || (_logger$addLog7 = logger.addLog) === null || _logger$addLog7 === void 0 || _logger$addLog7.call(logger, {
|
|
1059
1210
|
type: "info",
|
|
1060
1211
|
title: "[BigSaleProductList] 商品列表布局设置已重置",
|
|
1061
1212
|
metadata: {
|
|
@@ -1067,7 +1218,7 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
1067
1218
|
cardLayoutDirection: defaultProductListPreferences.layoutDirection
|
|
1068
1219
|
}
|
|
1069
1220
|
});
|
|
1070
|
-
} catch (
|
|
1221
|
+
} catch (_unused10) {}
|
|
1071
1222
|
onProductListPreferencesReset === null || onProductListPreferencesReset === void 0 || onProductListPreferencesReset(defaultProductListPreferences);
|
|
1072
1223
|
setSettingsOpen(false);
|
|
1073
1224
|
});
|
|
@@ -1277,6 +1428,7 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
1277
1428
|
variant,
|
|
1278
1429
|
fullWidthActions: categoryNavigation === "sidebar",
|
|
1279
1430
|
onCancel: handleCloseSettings,
|
|
1431
|
+
onSaveAttempt: handleSettingsSaveAttempt,
|
|
1280
1432
|
onSave: handleSaveSettings,
|
|
1281
1433
|
onSaveAuto: handleResetSettings
|
|
1282
1434
|
}) : null), [
|
|
@@ -1294,6 +1446,7 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
1294
1446
|
handleOpenSettings,
|
|
1295
1447
|
handleResetSettings,
|
|
1296
1448
|
handleSaveSettings,
|
|
1449
|
+
handleSettingsSaveAttempt,
|
|
1297
1450
|
defaultProductListPreferences,
|
|
1298
1451
|
purchaseDisabled,
|
|
1299
1452
|
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);
|
|
@@ -36,6 +36,8 @@ function KioskPaymentPage({ context, checkoutPreparation, channel, onBack, onPai
|
|
|
36
36
|
const normalizedChannel = String(channel || "").trim().toLowerCase();
|
|
37
37
|
const toast = useToast();
|
|
38
38
|
const runtimeRef = useRef(null);
|
|
39
|
+
const paymentOptionsRef = useRef(null);
|
|
40
|
+
const autoPaymentAttemptedRef = useRef(false);
|
|
39
41
|
const preparationRef = useRef(checkoutPreparation);
|
|
40
42
|
const mountedRef = useRef(true);
|
|
41
43
|
const stateRef = useRef(hasUnresolvedDevicePayment(baseSales) ? "uncertain" : "idle");
|
|
@@ -139,6 +141,7 @@ function KioskPaymentPage({ context, checkoutPreparation, channel, onBack, onPai
|
|
|
139
141
|
if (stateRef.current !== "idle" || !runtimeRef.current) return;
|
|
140
142
|
const method = methods.find((item) => String(item.id) === String(selected.id));
|
|
141
143
|
if (!method) return;
|
|
144
|
+
autoPaymentAttemptedRef.current = true;
|
|
142
145
|
transition("paying");
|
|
143
146
|
try {
|
|
144
147
|
var _utils$businessUtils2, _utils$businessUtils3;
|
|
@@ -176,6 +179,17 @@ function KioskPaymentPage({ context, checkoutPreparation, channel, onBack, onPai
|
|
|
176
179
|
return _ref2.apply(this, arguments);
|
|
177
180
|
};
|
|
178
181
|
}());
|
|
182
|
+
useEffect(() => {
|
|
183
|
+
if (!["vending", "kiosk"].includes(normalizedChannel) || !ready || amount === void 0 || amount <= 0 || methods.length !== 1 || state !== "idle" || autoPaymentAttemptedRef.current || !paymentOptionsRef.current) return;
|
|
184
|
+
autoPaymentAttemptedRef.current = true;
|
|
185
|
+
paymentOptionsRef.current.activateSinglePaymentMethod();
|
|
186
|
+
}, [
|
|
187
|
+
normalizedChannel,
|
|
188
|
+
ready,
|
|
189
|
+
amount,
|
|
190
|
+
methods,
|
|
191
|
+
state
|
|
192
|
+
]);
|
|
179
193
|
const retrySync = useMemoizedFn(_asyncToGenerator(function* () {
|
|
180
194
|
if (stateRef.current !== "sync-failed" || !retryRef.current) return;
|
|
181
195
|
const retry = retryRef.current;
|
|
@@ -203,6 +217,7 @@ function KioskPaymentPage({ context, checkoutPreparation, channel, onBack, onPai
|
|
|
203
217
|
const beginAuthorization = useMemoizedFn((_source) => {
|
|
204
218
|
var _globalThis$crypto, _globalThis$crypto$ra;
|
|
205
219
|
if (stateRef.current !== "idle") return null;
|
|
220
|
+
autoPaymentAttemptedRef.current = true;
|
|
206
221
|
if (!authorizationAvailableRef.current) {
|
|
207
222
|
toast.fail(locales.getText("pisell2.checkout.self-service.empty"));
|
|
208
223
|
return null;
|
|
@@ -316,6 +331,7 @@ function KioskPaymentPage({ context, checkoutPreparation, channel, onBack, onPai
|
|
|
316
331
|
}
|
|
317
332
|
}
|
|
318
333
|
}, /* @__PURE__ */ React.createElement(PaymentOptionsModule, {
|
|
334
|
+
ref: paymentOptionsRef,
|
|
319
335
|
appearance: "self-service",
|
|
320
336
|
orderInfo: { remainingAmount: String(amount !== null && amount !== void 0 ? amount : 0) },
|
|
321
337
|
paymentMethods: methods,
|
|
@@ -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;
|
|
@@ -13,7 +13,7 @@ import { Iconfont } from "@pisell/materials";
|
|
|
13
13
|
import classNames from "classnames";
|
|
14
14
|
import "./index.less";
|
|
15
15
|
//#region src/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.tsx
|
|
16
|
-
const PaymentMethodItem = ({ appearance = "default", method, amountSymbol, customAmount, disabled = false, onClick, getText, size = "default", surchargeDisplay, directCustomPayment = false, beginKioskPaymentActivity, currentBaseSales })
|
|
16
|
+
const PaymentMethodItem = React.forwardRef(function PaymentMethodItem({ appearance = "default", method, amountSymbol, customAmount, disabled = false, onClick, getText, size = "default", surchargeDisplay, directCustomPayment = false, beginKioskPaymentActivity, currentBaseSales }, ref) {
|
|
17
17
|
var _context$appHelper;
|
|
18
18
|
const context = useEngineContext();
|
|
19
19
|
const { getData, getApp } = (context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {};
|
|
@@ -162,6 +162,12 @@ const PaymentMethodItem = ({ appearance = "default", method, amountSymbol, custo
|
|
|
162
162
|
return _ref.apply(this, arguments);
|
|
163
163
|
};
|
|
164
164
|
}();
|
|
165
|
+
const activate = () => {
|
|
166
|
+
if (disabled) return;
|
|
167
|
+
if (appearance === "self-service" && isEftpos) submitCurrentAmount();
|
|
168
|
+
else showKeyboard();
|
|
169
|
+
};
|
|
170
|
+
React.useImperativeHandle(ref, () => ({ activate }));
|
|
165
171
|
const renderLeftContent = () => /* @__PURE__ */ React.createElement("div", { className: classNames("payment-options-module-payment-method-left") }, appearance === "self-service" ? renderPaymentIcon(method) : /* @__PURE__ */ React.createElement("div", { className: classNames("payment-options-module-icon-container") }, renderPaymentIcon(method)), /* @__PURE__ */ React.createElement("div", { className: classNames("payment-options-module-payment-info") }, /* @__PURE__ */ React.createElement("div", { className: classNames("payment-options-module-payment-info-inner") }, /* @__PURE__ */ React.createElement("div", { className: classNames("payment-options-module-payment-name") }, method.name), /* @__PURE__ */ React.createElement("div", { className: classNames("payment-options-module-payment-info-inner-surcharge") }, !!(displaySurchargeConfig === null || displaySurchargeConfig === void 0 ? void 0 : displaySurchargeConfig.is_surcharge) && calculateSurcharge(displaySurchargeConfig) !== 0 && /* @__PURE__ */ React.createElement("div", { className: classNames("payment-options-module-surcharge-text") }, (getText === null || getText === void 0 ? void 0 : getText("pisell2.payment-options.surcharge-label", "Surcharge")) || "Surcharge", ":", formatAmount(calculateSurcharge(displaySurchargeConfig), 2, amountSymbol)), false))));
|
|
166
172
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement("button", {
|
|
167
173
|
className: classNames("payment-options-module-payment-method-item", {
|
|
@@ -169,7 +175,7 @@ const PaymentMethodItem = ({ appearance = "default", method, amountSymbol, custo
|
|
|
169
175
|
"payment-options-module-disabled": disabled
|
|
170
176
|
}),
|
|
171
177
|
style: appearance === "self-service" ? void 0 : { height: size === "large" ? "82px" : "62px" },
|
|
172
|
-
onClick:
|
|
178
|
+
onClick: activate,
|
|
173
179
|
type: "button",
|
|
174
180
|
disabled
|
|
175
181
|
}, renderLeftContent(), appearance === "self-service" ? /* @__PURE__ */ React.createElement("span", {
|
|
@@ -221,6 +227,6 @@ const PaymentMethodItem = ({ appearance = "default", method, amountSymbol, custo
|
|
|
221
227
|
}
|
|
222
228
|
}
|
|
223
229
|
}));
|
|
224
|
-
};
|
|
230
|
+
});
|
|
225
231
|
//#endregion
|
|
226
232
|
export { PaymentMethodItem as default };
|
|
@@ -10,7 +10,7 @@ import classNames from "classnames";
|
|
|
10
10
|
import { useDebounceFn } from "ahooks";
|
|
11
11
|
import "./index.less";
|
|
12
12
|
//#region src/components/checkout/components/PaymentOptionsModule/index.tsx
|
|
13
|
-
function PaymentOptionsModule({ appearance = "default", amountSymbol, orderInfo, onClick, paymentMethods = [], customAmount, title, disabled = false, showCashPayment = false, channel = "pos", columnCount, sciSurchargeDisplayMap = {}, directCustomPayment = false, isModalOpen = false, paymentMethodsReady = false, autoTriggerSinglePaymentOption = false, beginKioskPaymentActivity, currentBaseSales }) {
|
|
13
|
+
const PaymentOptionsModule = React.forwardRef(function PaymentOptionsModule({ appearance = "default", amountSymbol, orderInfo, onClick, paymentMethods = [], customAmount, title, disabled = false, showCashPayment = false, channel = "pos", columnCount, sciSurchargeDisplayMap = {}, directCustomPayment = false, isModalOpen = false, paymentMethodsReady = false, autoTriggerSinglePaymentOption = false, beginKioskPaymentActivity, currentBaseSales }, ref) {
|
|
14
14
|
var _context$appHelper, _context$appHelper$ge, _context$appHelper$ge2, _context$appHelper$ut;
|
|
15
15
|
const context = useEngineContext();
|
|
16
16
|
useInitLocalesOnce(locales_default, ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 || (_context$appHelper$ge = _context$appHelper.getApp) === null || _context$appHelper$ge === void 0 || (_context$appHelper$ge = _context$appHelper$ge.call(_context$appHelper)) === null || _context$appHelper$ge === void 0 || (_context$appHelper$ge = _context$appHelper$ge.locales) === null || _context$appHelper$ge === void 0 || (_context$appHelper$ge2 = _context$appHelper$ge.getLocale) === null || _context$appHelper$ge2 === void 0 ? void 0 : _context$appHelper$ge2.call(_context$appHelper$ge)) || ((_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut = _context$appHelper$ut.storage) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.get("umi_locale")) || "en");
|
|
@@ -24,6 +24,13 @@ function PaymentOptionsModule({ appearance = "default", amountSymbol, orderInfo,
|
|
|
24
24
|
const normalizedChannel = String(channel || "pos").trim().toLowerCase();
|
|
25
25
|
const resolvedColumnCount = columnCount !== null && columnCount !== void 0 ? columnCount : showCashPayment ? 1 : 2;
|
|
26
26
|
const filteredPaymentMethods = React.useMemo(() => filterPaymentMethodsForChannel(paymentMethods, normalizedChannel), [normalizedChannel, paymentMethods]);
|
|
27
|
+
const singleMethodRef = React.useRef(null);
|
|
28
|
+
React.useImperativeHandle(ref, () => ({ activateSinglePaymentMethod: () => {
|
|
29
|
+
if (!disabled && filteredPaymentMethods.length === 1) {
|
|
30
|
+
var _singleMethodRef$curr;
|
|
31
|
+
(_singleMethodRef$curr = singleMethodRef.current) === null || _singleMethodRef$curr === void 0 || _singleMethodRef$curr.activate();
|
|
32
|
+
}
|
|
33
|
+
} }));
|
|
27
34
|
const { run: handlePaymentClick } = useDebounceFn((method) => {
|
|
28
35
|
if (disabled) return;
|
|
29
36
|
if (typeof onClick === "function") onClick(method);
|
|
@@ -59,6 +66,7 @@ function PaymentOptionsModule({ appearance = "default", amountSymbol, orderInfo,
|
|
|
59
66
|
paymentMethodsReady
|
|
60
67
|
]);
|
|
61
68
|
const methodItems = filteredPaymentMethods.map((method) => /* @__PURE__ */ React.createElement(PaymentMethodItem, {
|
|
69
|
+
ref: filteredPaymentMethods.length === 1 ? singleMethodRef : void 0,
|
|
62
70
|
appearance,
|
|
63
71
|
size: filteredPaymentMethods.length === 2 ? "large" : "default",
|
|
64
72
|
key: method.id,
|
|
@@ -90,6 +98,6 @@ function PaymentOptionsModule({ appearance = "default", amountSymbol, orderInfo,
|
|
|
90
98
|
paddingBottom: 8
|
|
91
99
|
}
|
|
92
100
|
}, methodItems)));
|
|
93
|
-
}
|
|
101
|
+
});
|
|
94
102
|
//#endregion
|
|
95
103
|
export { PaymentOptionsModule as default };
|
|
@@ -78,7 +78,7 @@ Home 的 Redeem Socks 入口打开独立 `RedeemPage`,展示扫码指引、扫
|
|
|
78
78
|
- 购物车在 Order 的通用 `onBeforeCartCommit` 入口校验原始规则算出的草稿,不维护另一套订单合并规则;库存异常时允许减少/删除,禁止增加。未注入扩展的业务沿用既有库存与销售规则。
|
|
79
79
|
- 普通与 0 元结账都经过 SalesSdk `prepareCheckout`。本次准备凭据携带不可变 `checkoutSnapshot` 并校验提交前购物车是否变化;正常支付完成或确认完成的 0 元订单再通过 `onPaidCheckout` 交给宿主。库存请求与设备规则不写入 Kiosk 模板。
|
|
80
80
|
- 设备端购物车与支付页共用 `resolveKioskPresentation` 的 `self-service` 外观。Kiosk/Vending 待付金额大于 0 时进入 Kiosk 自身的 `payment` 页面,由 `Kiosk/payment` 负责控制,不经过 SalesSdk `openCheckout`、宿主 PaymentModalPlugin 或 PaymentModal。H5、PC 和 POS 继续使用既有支付入口;设备页的外观不再跨 SDK/宿主透传。
|
|
81
|
-
- 独立页复用公共 `PaymentMethodRuntime`、pending 支付生命周期和 BaseSales 订单 API,直接使用当前购物车/钱包。支付方式按实际 `channel` 和宿主终端偏好筛选,Vending
|
|
81
|
+
- 独立页复用公共 `PaymentMethodRuntime`、pending 支付生命周期和 BaseSales 订单 API,直接使用当前购物车/钱包。支付方式按实际 `channel` 和宿主终端偏好筛选,Vending 排除标准及自定义现金方式,也不开钱箱。Vending 与 Kiosk 支付页在方式加载及筛选完成、待付金额大于 0 且只有一种可用方式时,自动执行一次该支付卡片的操作;取消、失败或部分支付后不再次自动触发,可手动重试,退出后重新进入支付页可再次自动触发。付款结果待确认时锁定操作,已收款后的失败只重试订单同步。Kiosk 自定义支付的自动和手动入口均请求主屏授权并等候结果,不在本机直接记为已付。
|
|
82
82
|
- 仅 Vending 支付页优先复用首页初始化销售模块时已准备的支付方式;读取的是 BaseSales 当前镜像,由其原有配置变更事件更新。镜像缺失/为空时保留异步加载兜底,宿主显示偏好、排序及禁用现金规则仍每次应用。普通 Kiosk 保留原有支付方式加载路径。设备配置缓存及其失效由宿主管理,结账库存刷新和设备状态预检保持实时执行。
|
|
83
83
|
- 付款页面期间锁住销售扫码并暂停屏保,返回购物车保留原订单与券;只有明确足额支付并同步成功后,才冻结订单及原 checkoutSnapshot,再进入现有成功/出货交接。0 元仍使用原有直接确认流程,不进入支付方式页。
|
|
84
84
|
- 隐藏零元金额和显示 Confirm 由 Vending 平台决定,不依赖 `renderCatalog` 是否存在;自定义列表本身不改变其它 Kiosk/H5/PC 的金额展示规则。
|
|
@@ -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";
|