@pisell/private-materials 6.12.407 → 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 +4 -4
- package/build/lowcode/view.js +4 -4
- package/es/components/bigSale/components/ProductList/index.js +179 -26
- package/es/components/bigSale/components/ProductListSettingsModal/index.js +5 -3
- package/es/components/bigSale/utils/productListPreferences.js +5 -2
- 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/extras/VenueExtraDetailModal.js +1 -1
- package/es/plus/pisellReservation/PisellReservation.js +1 -0
- package/es/plus/pisellReservation/components/ReservationNewReservationModal.js +29 -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/plus/pisellReservation/PisellReservation.js +1 -0
- package/lib/plus/pisellReservation/components/ReservationNewReservationModal.js +29 -1
- package/lib/pro/bookingProductDetailModal/index.js +7 -7
- package/package.json +3 -3
|
@@ -49,6 +49,42 @@ function getCurrentRoutePath() {
|
|
|
49
49
|
const { pathname, search, hash } = window.location;
|
|
50
50
|
return `${pathname}${search}${hash}`;
|
|
51
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
|
+
}
|
|
52
88
|
function resolvePhoneCartEntryQuantity(value) {
|
|
53
89
|
var _value$_extend$displa, _value$_extend;
|
|
54
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);
|
|
@@ -137,7 +173,7 @@ function shouldHideSingleKioskCategoryNavigation(navigation, items) {
|
|
|
137
173
|
* 商品列表只做“加载商品 + 触发加购”,加购决策交给 salesSdk。
|
|
138
174
|
*/
|
|
139
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 }) => {
|
|
140
|
-
var _engineContext$
|
|
176
|
+
var _engineContext$appHel2, _catalog$products, _sales$bookingTicket$, _sales$bookingTicket, _sales$bookingTicket$2, _productLoadParams$me, _sales$defaultProduct, _sales$tempOrder3;
|
|
141
177
|
const isControlledCatalog = catalog !== void 0;
|
|
142
178
|
const hasControlledActions = isControlledCatalog || quantityByProductId !== void 0 || !!onSelectProduct || !!onQuantityChange;
|
|
143
179
|
const scopeKey = catalog === null || catalog === void 0 ? void 0 : catalog.scopeKey;
|
|
@@ -148,7 +184,8 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
148
184
|
const usesV2ProductCard = variant === "phone" && productCardVersion === "v2";
|
|
149
185
|
const Toast = useToast();
|
|
150
186
|
const engineContext = useEngineContext();
|
|
151
|
-
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);
|
|
152
189
|
const addToCartToastApi = useMemo(() => addToCartToastIcon ? { success: (content) => {
|
|
153
190
|
Toast.show({
|
|
154
191
|
content,
|
|
@@ -239,8 +276,60 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
239
276
|
const [uncontrolledProductListPreferences, setUncontrolledProductListPreferences] = useState(() => readBigSaleProductListPreferences(preferencesKey, defaultProductListPreferences));
|
|
240
277
|
const [uncontrolledProductListPreferencesKey, setUncontrolledProductListPreferencesKey] = useState(preferencesKey);
|
|
241
278
|
const [uncontrolledProductListPreferencesOverride, setUncontrolledProductListPreferencesOverride] = useState(() => Boolean(readStoredBigSaleProductListPreferences(preferencesKey, defaultProductListPreferences)));
|
|
279
|
+
const productListPreferenceStorageLogRef = useRef();
|
|
280
|
+
const productListEntryLogRef = useRef();
|
|
242
281
|
const productListPreferences = controlledProductListPreferences || (uncontrolledProductListPreferencesKey === preferencesKey ? uncontrolledProductListPreferences : defaultProductListPreferences);
|
|
243
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
|
+
]);
|
|
244
333
|
const productListConfig = useBigSaleProductListConfig({
|
|
245
334
|
products: currentProducts,
|
|
246
335
|
scopeKey,
|
|
@@ -284,11 +373,44 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
284
373
|
setUncontrolledProductListPreferences(storedPreferences || defaultProductListPreferences);
|
|
285
374
|
setUncontrolledProductListPreferencesKey(preferencesKey);
|
|
286
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
|
+
}
|
|
287
402
|
}
|
|
288
403
|
}, [
|
|
404
|
+
businessCode,
|
|
289
405
|
controlledProductListPreferences,
|
|
290
406
|
defaultProductListPreferences,
|
|
291
|
-
|
|
407
|
+
logger,
|
|
408
|
+
mode,
|
|
409
|
+
osKey,
|
|
410
|
+
operator,
|
|
411
|
+
preferencesKey,
|
|
412
|
+
productListPreferencesChannel,
|
|
413
|
+
variant
|
|
292
414
|
]);
|
|
293
415
|
const productListLayoutLogRef = useRef();
|
|
294
416
|
useEffect(() => {
|
|
@@ -310,13 +432,13 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
310
432
|
if (productListLayoutLogRef.current === signature) return;
|
|
311
433
|
productListLayoutLogRef.current = signature;
|
|
312
434
|
try {
|
|
313
|
-
var _logger$
|
|
314
|
-
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, {
|
|
315
437
|
type: "info",
|
|
316
438
|
title: "[BigSaleProductList] 商品列表布局已解析",
|
|
317
439
|
metadata
|
|
318
440
|
});
|
|
319
|
-
} catch (
|
|
441
|
+
} catch (_unused7) {}
|
|
320
442
|
}, [
|
|
321
443
|
businessCode,
|
|
322
444
|
controlledProductListPreferences,
|
|
@@ -502,13 +624,13 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
502
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 : "");
|
|
503
625
|
const baselineQuantity = phoneCartProductEntries.filter((entry) => resolvePhoneCartProductId(entry.value) === productId).reduce((total, entry) => total + entry.quantity, 0);
|
|
504
626
|
try {
|
|
505
|
-
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;
|
|
506
628
|
if (!(yield businessAvailability.ensureCanShop())) return;
|
|
507
629
|
if (!sales.isReady) return;
|
|
508
630
|
if (requiredOrderId !== void 0 && Number((_sales$tempOrder4 = sales.tempOrder) === null || _sales$tempOrder4 === void 0 ? void 0 : _sales$tempOrder4.order_id) !== Number(requiredOrderId)) return;
|
|
509
631
|
const latestProduct = currentProducts.find((currentProduct) => currentProduct.id === product.id);
|
|
510
632
|
latestProduct && _objectSpread2(_objectSpread2({}, product), {}, { cartDetailValue: latestProduct.cartDetailValue });
|
|
511
|
-
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, {
|
|
512
634
|
type: "info",
|
|
513
635
|
title: "[BigSaleProductList] 用户点击商品卡片加入购物车",
|
|
514
636
|
metadata: {
|
|
@@ -1022,39 +1144,68 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
1022
1144
|
setSettingsOpen(false);
|
|
1023
1145
|
});
|
|
1024
1146
|
const handleSaveSettings = useMemoizedFn((preferences) => {
|
|
1025
|
-
writeBigSaleProductListPreferences(preferencesKey, preferences);
|
|
1147
|
+
const cacheWriteSucceeded = writeBigSaleProductListPreferences(preferencesKey, preferences);
|
|
1148
|
+
const persistedPreferences = cacheWriteSucceeded ? readStoredBigSaleProductListPreferences(preferencesKey, defaultProductListPreferences) : void 0;
|
|
1026
1149
|
setUncontrolledProductListPreferences(preferences);
|
|
1027
1150
|
setUncontrolledProductListPreferencesKey(preferencesKey);
|
|
1028
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
|
+
};
|
|
1029
1167
|
try {
|
|
1030
|
-
var _logger$
|
|
1031
|
-
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, {
|
|
1032
1170
|
type: "info",
|
|
1033
1171
|
title: "[BigSaleProductList] 商品列表布局设置已保存",
|
|
1034
|
-
metadata
|
|
1035
|
-
mode,
|
|
1036
|
-
businessCode: businessCode !== null && businessCode !== void 0 ? businessCode : null,
|
|
1037
|
-
variant: variant !== null && variant !== void 0 ? variant : null,
|
|
1038
|
-
pathname: getCurrentRoutePath(),
|
|
1039
|
-
columns: preferences.columns,
|
|
1040
|
-
cardLayoutDirection: preferences.layoutDirection,
|
|
1041
|
-
showImage: preferences.showImage,
|
|
1042
|
-
imageWidth: preferences.imageWidth,
|
|
1043
|
-
imageHeight: preferences.imageHeight
|
|
1044
|
-
}
|
|
1172
|
+
metadata
|
|
1045
1173
|
});
|
|
1046
|
-
} catch (
|
|
1174
|
+
} catch (_unused8) {}
|
|
1047
1175
|
onProductListPreferencesChange === null || onProductListPreferencesChange === void 0 || onProductListPreferencesChange(preferences);
|
|
1048
1176
|
setSettingsOpen(false);
|
|
1049
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
|
+
});
|
|
1050
1201
|
const handleResetSettings = useMemoizedFn(() => {
|
|
1051
1202
|
removeBigSaleProductListPreferences(preferencesKey);
|
|
1052
1203
|
setUncontrolledProductListPreferences(defaultProductListPreferences);
|
|
1053
1204
|
setUncontrolledProductListPreferencesKey(preferencesKey);
|
|
1054
1205
|
setUncontrolledProductListPreferencesOverride(false);
|
|
1055
1206
|
try {
|
|
1056
|
-
var _logger$
|
|
1057
|
-
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, {
|
|
1058
1209
|
type: "info",
|
|
1059
1210
|
title: "[BigSaleProductList] 商品列表布局设置已重置",
|
|
1060
1211
|
metadata: {
|
|
@@ -1066,7 +1217,7 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
1066
1217
|
cardLayoutDirection: defaultProductListPreferences.layoutDirection
|
|
1067
1218
|
}
|
|
1068
1219
|
});
|
|
1069
|
-
} catch (
|
|
1220
|
+
} catch (_unused10) {}
|
|
1070
1221
|
onProductListPreferencesReset === null || onProductListPreferencesReset === void 0 || onProductListPreferencesReset(defaultProductListPreferences);
|
|
1071
1222
|
setSettingsOpen(false);
|
|
1072
1223
|
});
|
|
@@ -1276,6 +1427,7 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
1276
1427
|
variant,
|
|
1277
1428
|
fullWidthActions: categoryNavigation === "sidebar",
|
|
1278
1429
|
onCancel: handleCloseSettings,
|
|
1430
|
+
onSaveAttempt: handleSettingsSaveAttempt,
|
|
1279
1431
|
onSave: handleSaveSettings,
|
|
1280
1432
|
onSaveAuto: handleResetSettings
|
|
1281
1433
|
}) : null), [
|
|
@@ -1293,6 +1445,7 @@ const BigSaleProductListInner = ({ renderContent, className, renderProductCard,
|
|
|
1293
1445
|
handleOpenSettings,
|
|
1294
1446
|
handleResetSettings,
|
|
1295
1447
|
handleSaveSettings,
|
|
1448
|
+
handleSettingsSaveAttempt,
|
|
1296
1449
|
defaultProductListPreferences,
|
|
1297
1450
|
purchaseDisabled,
|
|
1298
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);
|
|
@@ -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;
|
|
@@ -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"
|
|
@@ -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";
|
|
@@ -858,6 +858,7 @@ const PisellReservationCore = (props) => {
|
|
|
858
858
|
}), /* @__PURE__ */ React.createElement(PisellRecordBoard.ShellFrame, null, /* @__PURE__ */ React.createElement(PisellRecordBoard.GridLayout, null), /* @__PURE__ */ React.createElement(PisellRecordBoard.FloorMap, null), /* @__PURE__ */ React.createElement(PisellRecordBoard.Calendar, countryAwareCalendarSlotProps), /* @__PURE__ */ React.createElement(PisellRecordBoard.ResourceWall, null))), /* @__PURE__ */ React.createElement(ReservationNewReservationModal, {
|
|
859
859
|
ref: newReservationModalRef,
|
|
860
860
|
router,
|
|
861
|
+
businessCode: BIZ,
|
|
861
862
|
app
|
|
862
863
|
}), /* @__PURE__ */ React.createElement(ReservationBookingDetailModal, {
|
|
863
864
|
open: bookingDetailOpen,
|
|
@@ -9,9 +9,32 @@ import { useMemoizedFn } from "ahooks";
|
|
|
9
9
|
* 新建预约:引擎路由多选弹窗;仅单条路由时直接 history.push。
|
|
10
10
|
*/
|
|
11
11
|
/**
|
|
12
|
+
* 解析当前业务的 Sales2 新建页。
|
|
13
|
+
*
|
|
14
|
+
* 路由配置优先,支持 `/sales2/biz/:business_code` 这类动态段;旧店铺未下发
|
|
15
|
+
* sales2 路由时使用 POS 既有的规范地址作为兼容回退。
|
|
16
|
+
*/
|
|
17
|
+
function resolveBusinessSalesRoute(router, businessCode) {
|
|
18
|
+
const biz = typeof businessCode === "string" ? businessCode.trim() : "";
|
|
19
|
+
if (!biz) return void 0;
|
|
20
|
+
const encodedBiz = encodeURIComponent(biz);
|
|
21
|
+
const configuredRoute = (router && typeof router === "object" ? Object.values(router) : []).find((item) => {
|
|
22
|
+
if (!item || typeof item !== "object") return false;
|
|
23
|
+
const route = item;
|
|
24
|
+
return route.page_type === "proCode" && route.proCodeId === "sales2" && typeof route.router === "string" && route.router.trim() !== "";
|
|
25
|
+
});
|
|
26
|
+
const configuredPath = typeof (configuredRoute === null || configuredRoute === void 0 ? void 0 : configuredRoute.router) === "string" ? configuredRoute.router.trim() : "";
|
|
27
|
+
const [pathAndQuery, hash = ""] = (/:business_code\b/.test(configuredPath) ? configuredPath : `/sales2/biz/${encodedBiz}`).replace(/:business_code\b/g, encodedBiz).split("#", 2);
|
|
28
|
+
const [path, query = ""] = pathAndQuery.split("?", 2);
|
|
29
|
+
const params = new URLSearchParams(query);
|
|
30
|
+
const salesType = biz === "dine_in" ? "food" : biz === "party" ? "ticket" : biz;
|
|
31
|
+
params.set("type", salesType);
|
|
32
|
+
return `${path}?${params.toString()}${hash ? `#${hash}` : ""}`;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
12
35
|
* 受控弹窗内容在内部;通过 ref 暴露 `requestOpen` 供顶栏「新建」等调用。
|
|
13
36
|
*/
|
|
14
|
-
const ReservationNewReservationModal = forwardRef(function ReservationNewReservationModal({ router, app }, ref) {
|
|
37
|
+
const ReservationNewReservationModal = forwardRef(function ReservationNewReservationModal({ router, businessCode, app }, ref) {
|
|
15
38
|
const newReservationRoutes = useNewReservationRoutesFromEngine(router);
|
|
16
39
|
const [open, setOpen] = useState(false);
|
|
17
40
|
const handleRouteJump = useMemoizedFn((routePath) => {
|
|
@@ -21,6 +44,11 @@ const ReservationNewReservationModal = forwardRef(function ReservationNewReserva
|
|
|
21
44
|
app === null || app === void 0 || (_app$history = app.history) === null || _app$history === void 0 || (_app$history$push = _app$history.push) === null || _app$history$push === void 0 || _app$history$push.call(_app$history, routePath);
|
|
22
45
|
});
|
|
23
46
|
const requestOpen = useMemoizedFn(() => {
|
|
47
|
+
const businessSalesRoute = resolveBusinessSalesRoute(router, businessCode);
|
|
48
|
+
if (businessSalesRoute) {
|
|
49
|
+
handleRouteJump(businessSalesRoute);
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
24
52
|
if (newReservationRoutes.length === 1) {
|
|
25
53
|
handleRouteJump(newReservationRoutes[0].router);
|
|
26
54
|
return;
|
|
@@ -62,7 +62,7 @@ function BookingProductDetailModal(props) {
|
|
|
62
62
|
return ui ? session : /* @__PURE__ */ React.createElement(VenueBookingDesignProvider, { lang: props.locale || "en" }, session);
|
|
63
63
|
}
|
|
64
64
|
function DetailSession(props) {
|
|
65
|
-
var _props$configuration$, _props$skuOptions, _props$skuOptions2, _bookingActionAmount, _props$labels$confirm, _props$labels, _configurationFooter
|
|
65
|
+
var _props$configuration$, _props$skuOptions, _props$skuOptions2, _bookingActionAmount, _configurationFooter$, _props$labels$confirm, _props$labels, _configurationFooter$2, _skuPresentation$moda, _getAppearance, _skuPresentation$moda2, _props$skuOptions3, _props$skuOptions4, _props$skuOptions5;
|
|
66
66
|
const ui = useOptionalBookingUI();
|
|
67
67
|
const brandTokens = ui === null || ui === void 0 ? void 0 : ui.brandTokens;
|
|
68
68
|
const [plan] = useState(() => props.plan);
|
|
@@ -203,7 +203,7 @@ function DetailSession(props) {
|
|
|
203
203
|
busy
|
|
204
204
|
};
|
|
205
205
|
const footerContent = typeof props.footerContent === "function" ? props.footerContent(footerContext) : props.footerContent;
|
|
206
|
-
const configurationFooter =
|
|
206
|
+
const configurationFooter = step === "configuration" ? props.configurationFooter : void 0;
|
|
207
207
|
const actionLabel = step === "configuration" ? isTicket ? labels.next : labels.confirmConfiguration : labels.confirmBooking;
|
|
208
208
|
const error = invalid ? labels.invalidPlan : message || props.error;
|
|
209
209
|
const skuType = ((_props$skuOptions = props.skuOptions) === null || _props$skuOptions === void 0 ? void 0 : _props$skuOptions.type) || "flat";
|
|
@@ -232,7 +232,7 @@ function DetailSession(props) {
|
|
|
232
232
|
wide: true,
|
|
233
233
|
className: `${isTicket ? "reservation-modal" : "party-package-dialog"} pisell-booking-product-detail-modal ${props.className || ""}`,
|
|
234
234
|
bodyClassName: `${isTicket ? "reservation-content" : "package-config-body"} pisell-booking-product-detail-body`,
|
|
235
|
-
footerClassName: `${isTicket ? "booking-config-dialog-footer" : "package-config-footer"} pisell-booking-product-detail-footer${isTicket && step === "configuration" ? " pisell-booking-product-detail-options-footer" : ""}${configurationFooter ? " pisell-booking-product-detail-configuration-footer" : ""}`,
|
|
235
|
+
footerClassName: `${isTicket ? "booking-config-dialog-footer" : "package-config-footer"} pisell-booking-product-detail-footer${isTicket && step === "configuration" && !configurationFooter ? " pisell-booking-product-detail-options-footer" : ""}${!isTicket && configurationFooter ? " pisell-booking-product-detail-configuration-footer" : ""}`,
|
|
236
236
|
mobile: "fullscreen",
|
|
237
237
|
bodyRef: setScrollContainer,
|
|
238
238
|
portal,
|
|
@@ -241,9 +241,9 @@ function DetailSession(props) {
|
|
|
241
241
|
style: _objectSpread2(_objectSpread2({}, props.width ? { width: props.width } : {}), props.style),
|
|
242
242
|
intro: steps,
|
|
243
243
|
footer: isTicket ? /* @__PURE__ */ React.createElement(ConfigurationFooter, {
|
|
244
|
-
leading: step === "booking" ? footerContent : void 0,
|
|
245
|
-
label: step === "booking" ? translate(locale, "subtotal") : void 0,
|
|
246
|
-
amount: step === "booking" ? (_bookingActionAmount = props.bookingActionAmount) !== null && _bookingActionAmount !== void 0 ? _bookingActionAmount : "—" : null,
|
|
244
|
+
leading: step === "booking" || configurationFooter ? footerContent : void 0,
|
|
245
|
+
label: step === "booking" ? translate(locale, "subtotal") : configurationFooter === null || configurationFooter === void 0 ? void 0 : configurationFooter.label,
|
|
246
|
+
amount: step === "booking" ? (_bookingActionAmount = props.bookingActionAmount) !== null && _bookingActionAmount !== void 0 ? _bookingActionAmount : "—" : (_configurationFooter$ = configurationFooter === null || configurationFooter === void 0 ? void 0 : configurationFooter.amount) !== null && _configurationFooter$ !== void 0 ? _configurationFooter$ : null,
|
|
247
247
|
action: {
|
|
248
248
|
label: completed ? labels.working : actionLabel,
|
|
249
249
|
compactLabel: completed ? labels.working : step === "booking" ? (_props$labels$confirm = (_props$labels = props.labels) === null || _props$labels === void 0 ? void 0 : _props$labels.confirmBooking) !== null && _props$labels$confirm !== void 0 ? _props$labels$confirm : translate(locale, editing ? "saveTicketsCompact" : "addTicketsCompact") : actionLabel,
|
|
@@ -257,7 +257,7 @@ function DetailSession(props) {
|
|
|
257
257
|
}, error)
|
|
258
258
|
}) : configurationFooter ? /* @__PURE__ */ React.createElement(ConfigurationFooter, {
|
|
259
259
|
leading: footerContent,
|
|
260
|
-
label: (_configurationFooter$ = configurationFooter.label) !== null && _configurationFooter$ !== void 0 ? _configurationFooter$ : translate(locale, "subtotal"),
|
|
260
|
+
label: (_configurationFooter$2 = configurationFooter.label) !== null && _configurationFooter$2 !== void 0 ? _configurationFooter$2 : translate(locale, "subtotal"),
|
|
261
261
|
amount: configurationFooter.amount,
|
|
262
262
|
action: {
|
|
263
263
|
label: completed ? labels.working : actionLabel,
|