@pisell/private-materials 6.12.161 → 6.12.162
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/BookingFloatingPanel/useBookingPanelController.js +0 -1
- package/es/components/bigSale/components/ProductList/index.js +30 -19
- package/es/components/bigSale/components/TimeBar/index.js +0 -1
- package/es/components/bigSale/dialog.js +0 -1
- package/es/components/bigSale/hooks/useBigSaleContext.js +0 -1
- package/es/components/bigSale/hooks/useSelectFloorMapResourceForBigSale.js +0 -1
- package/es/components/bigSale/index.js +1 -2
- package/es/components/bigSale/templates/Kiosk/index.js +0 -1
- package/es/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.js +0 -1
- package/es/index.js +0 -2
- package/es/plus/pisellReservation/data/bookingToReservationTables.js +1 -1
- package/es/plus/pisellReservation/floorMap/floorPlanApi.js +1 -1
- package/es/plus/pisellReservation/floorMap/reservationMock.js +1 -1
- package/es/plus/saleDetail/Base.js +0 -1
- package/es/plus/saleDetail/components/Client/hooks/useClientSelectorProps.js +0 -1
- package/es/plus/saleDetail/components/DetailActions/index.js +0 -1
- package/es/plus/saleDetail/components/SummaryFinancialSections/index.js +0 -1
- package/es/plus/saleDetail/index.js +0 -1
- package/es/plus/saleDetail/tmpl/B/components/Dish/index.js +0 -1
- package/es/plus/saleDetail/tmpl/B/index.js +0 -1
- package/es/plus/salesSdk/utils/addProductWithFlowDebounced.js +1 -1
- package/es/plus/salesSdk/utils/bookingDate.js +1 -1
- package/es/plus/salesSdk/utils/customerAuthGate.js +1 -1
- package/es/plus/salesSdk/utils/enrichCartLineHolderDisplay.js +1 -1
- package/es/plus/salesSdk/utils/runAddProductFlow.js +8 -4
- package/es/private-materials/lowcode/authmodal/meta.d.ts +1 -0
- package/es/pro/Login2.0/AuthModal.d.ts +1 -1
- package/es/pro/Login2.0/index.d.ts +1 -2
- package/es/pro/Login2.0/shared/types.d.ts +1 -1
- package/es/pro/skuDetailModal/index.js +4 -4
- package/lib/components/bigSale/components/ProductList/index.js +30 -19
- package/lib/components/bigSale/index.js +1 -1
- package/lib/plus/salesSdk/utils/runAddProductFlow.js +8 -4
- package/lib/pro/skuDetailModal/index.js +4 -4
- package/package.json +3 -3
- package/es/plus/pisellReservation/index.js +0 -17
- package/es/plus/salesSdk/index.js +0 -51
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import useEngineContext from "../../../../hooks/useEngineContext.js";
|
|
2
2
|
import { subscribeBookingDateChange } from "../../../../plus/salesSdk/utils/bookingDate.js";
|
|
3
|
-
import "../../../../plus/salesSdk/index.js";
|
|
4
3
|
import dayjs from "dayjs";
|
|
5
4
|
import { useCallback, useEffect, useState } from "react";
|
|
6
5
|
//#region src/components/bigSale/components/BookingFloatingPanel/useBookingPanelController.ts
|
|
@@ -6,6 +6,7 @@ import useInitLocalesOnce from "../../../../hooks/useInitLocalesOnce.js";
|
|
|
6
6
|
import ProductCard$1 from "../../../../plus/productSelect/ProductCard/index.js";
|
|
7
7
|
import ProductCardV2 from "../../../../plus/productSelect/ProductCard/ProductCardV2.js";
|
|
8
8
|
import useLocale from "../../../../hooks/useLocale.js";
|
|
9
|
+
import useLogger from "../../../../hooks/useLogger.js";
|
|
9
10
|
import List_default from "../../../list/List.js";
|
|
10
11
|
import { generateProductTabs } from "../../../ticketBooking/components/ProductDisplayAdapter/utils.js";
|
|
11
12
|
import { showAddToCartToast } from "../../../../plus/salesSdk/components/showAddToCartToast.js";
|
|
@@ -133,6 +134,7 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
|
|
|
133
134
|
addToCartToastOptions === null || addToCartToastOptions === void 0 ? void 0 : addToCartToastOptions.duration
|
|
134
135
|
]);
|
|
135
136
|
const locale = useLocale();
|
|
137
|
+
const logger = useLogger();
|
|
136
138
|
const { sales, products, cart } = context;
|
|
137
139
|
const { load } = products;
|
|
138
140
|
const [keyword, setKeyword] = useState("");
|
|
@@ -300,17 +302,26 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
|
|
|
300
302
|
* handleSelectProduct(productItem);
|
|
301
303
|
*/
|
|
302
304
|
const handleSelectProduct = useMemoizedFn(function() {
|
|
303
|
-
var
|
|
305
|
+
var _ref5 = _asyncToGenerator(function* (product) {
|
|
304
306
|
var _ref3, _product$id;
|
|
305
307
|
const handlesKioskToastAfterResult = productCardVersion === "v2" && !usesV2ProductCard;
|
|
306
308
|
const productId = String((_ref3 = (_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 && _ref3 !== void 0 ? _ref3 : "");
|
|
307
309
|
const baselineQuantity = phoneCartProductEntries.filter((entry) => resolvePhoneCartProductId(entry.value) === productId).reduce((total, entry) => total + entry.quantity, 0);
|
|
308
310
|
try {
|
|
309
|
-
var _sales$tempOrder3;
|
|
311
|
+
var _sales$tempOrder3, _logger$addLog, _ref4, _sales$tempOrder$orde, _sales$tempOrder4;
|
|
310
312
|
if (!sales.isReady) return;
|
|
311
313
|
if (requiredOrderId !== void 0 && Number((_sales$tempOrder3 = sales.tempOrder) === null || _sales$tempOrder3 === void 0 ? void 0 : _sales$tempOrder3.order_id) !== Number(requiredOrderId)) return;
|
|
312
314
|
const latestProduct = currentProducts.find((currentProduct) => currentProduct.id === product.id);
|
|
313
315
|
latestProduct && _objectSpread2(_objectSpread2({}, product), {}, { cartDetailValue: latestProduct.cartDetailValue });
|
|
316
|
+
logger === null || logger === void 0 || (_logger$addLog = logger.addLog) === null || _logger$addLog === void 0 || _logger$addLog.call(logger, {
|
|
317
|
+
type: "info",
|
|
318
|
+
title: "[BigSaleProductList] 用户点击商品卡片加入购物车",
|
|
319
|
+
metadata: {
|
|
320
|
+
product_id: productId,
|
|
321
|
+
product_title: resolvePhoneProductTitle(product),
|
|
322
|
+
order_id: (_ref4 = (_sales$tempOrder$orde = (_sales$tempOrder4 = sales.tempOrder) === null || _sales$tempOrder4 === void 0 ? void 0 : _sales$tempOrder4.order_id) !== null && _sales$tempOrder$orde !== void 0 ? _sales$tempOrder$orde : requiredOrderId) !== null && _ref4 !== void 0 ? _ref4 : null
|
|
323
|
+
}
|
|
324
|
+
});
|
|
314
325
|
const result = yield cart.addProductWithFlow(product, {
|
|
315
326
|
quantity: 1,
|
|
316
327
|
notShowToast: handlesKioskToastAfterResult
|
|
@@ -322,7 +333,7 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
|
|
|
322
333
|
}
|
|
323
334
|
});
|
|
324
335
|
return function(_x) {
|
|
325
|
-
return
|
|
336
|
+
return _ref5.apply(this, arguments);
|
|
326
337
|
};
|
|
327
338
|
}());
|
|
328
339
|
const phoneCartProductEntries = useMemo(() => {
|
|
@@ -336,8 +347,8 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
|
|
|
336
347
|
const productUid = resolvePhoneCartLineUid(booking === null || booking === void 0 || (_booking$_extend = booking._extend) === null || _booking$_extend === void 0 ? void 0 : _booking$_extend.product);
|
|
337
348
|
if (productUid) bookingProductUids.add(productUid);
|
|
338
349
|
((booking === null || booking === void 0 || (_booking$_extend2 = booking._extend) === null || _booking$_extend2 === void 0 ? void 0 : _booking$_extend2.mergedFrom) || []).forEach((source) => {
|
|
339
|
-
var
|
|
340
|
-
const sourceUid = (
|
|
350
|
+
var _ref6, _source$booking$produ, _source$booking, _source$booking2;
|
|
351
|
+
const sourceUid = (_ref6 = (_source$booking$produ = source === null || source === void 0 || (_source$booking = source.booking) === null || _source$booking === void 0 ? void 0 : _source$booking.product_uid) !== null && _source$booking$produ !== void 0 ? _source$booking$produ : source === null || source === void 0 || (_source$booking2 = source.booking) === null || _source$booking2 === void 0 || (_source$booking2 = _source$booking2.metadata) === null || _source$booking2 === void 0 ? void 0 : _source$booking2.product_uid) !== null && _ref6 !== void 0 ? _ref6 : resolvePhoneCartLineUid(source === null || source === void 0 ? void 0 : source.product);
|
|
341
352
|
if (sourceUid !== void 0 && sourceUid !== null && sourceUid !== "") bookingProductUids.add(String(sourceUid));
|
|
342
353
|
});
|
|
343
354
|
});
|
|
@@ -351,10 +362,10 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
|
|
|
351
362
|
quantity: resolvePhoneCartEntryQuantity(item)
|
|
352
363
|
}));
|
|
353
364
|
displayBookings.forEach((booking) => {
|
|
354
|
-
var _booking$_extend3,
|
|
365
|
+
var _booking$_extend3, _ref7, _booking$_extend$disp, _booking$_extend4, _product$_extend, _product$product_id;
|
|
355
366
|
const product = booking === null || booking === void 0 || (_booking$_extend3 = booking._extend) === null || _booking$_extend3 === void 0 ? void 0 : _booking$_extend3.product;
|
|
356
367
|
if (!product || (product === null || product === void 0 ? void 0 : product._isGiftPromotion)) return;
|
|
357
|
-
const displayQuantity = (
|
|
368
|
+
const displayQuantity = (_ref7 = (_booking$_extend$disp = booking === null || booking === void 0 || (_booking$_extend4 = booking._extend) === null || _booking$_extend4 === void 0 ? void 0 : _booking$_extend4.displayQuantity) !== null && _booking$_extend$disp !== void 0 ? _booking$_extend$disp : product === null || product === void 0 || (_product$_extend = product._extend) === null || _product$_extend === void 0 ? void 0 : _product$_extend.displayQuantity) !== null && _ref7 !== void 0 ? _ref7 : product === null || product === void 0 ? void 0 : product.num;
|
|
358
369
|
const displayValue = _objectSpread2(_objectSpread2({}, product), {}, {
|
|
359
370
|
product_id: (_product$product_id = product === null || product === void 0 ? void 0 : product.product_id) !== null && _product$product_id !== void 0 ? _product$product_id : product === null || product === void 0 ? void 0 : product.id,
|
|
360
371
|
num: displayQuantity
|
|
@@ -398,9 +409,9 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
|
|
|
398
409
|
show();
|
|
399
410
|
});
|
|
400
411
|
const addPhoneProductWithToast = useMemoizedFn(function() {
|
|
401
|
-
var
|
|
402
|
-
var
|
|
403
|
-
const productId = String((
|
|
412
|
+
var _ref9 = _asyncToGenerator(function* (product, quantity, type = "select", delayUntilModalClosed = false) {
|
|
413
|
+
var _ref8, _product$id2;
|
|
414
|
+
const productId = String((_ref8 = (_product$id2 = product === null || product === void 0 ? void 0 : product.id) !== null && _product$id2 !== void 0 ? _product$id2 : product === null || product === void 0 ? void 0 : product.product_id) !== null && _ref8 !== void 0 ? _ref8 : "");
|
|
404
415
|
const currentQuantity = phoneCartProductEntries.filter((entry) => resolvePhoneCartProductId(entry.value) === productId).reduce((total, entry) => total + entry.quantity, 0);
|
|
405
416
|
const result = yield cart.addProductWithFlow(product, {
|
|
406
417
|
type,
|
|
@@ -411,7 +422,7 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
|
|
|
411
422
|
return result;
|
|
412
423
|
});
|
|
413
424
|
return function(_x2, _x3) {
|
|
414
|
-
return
|
|
425
|
+
return _ref9.apply(this, arguments);
|
|
415
426
|
};
|
|
416
427
|
}());
|
|
417
428
|
/**
|
|
@@ -422,10 +433,10 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
|
|
|
422
433
|
* 这样不会为了“判断商品类型”预先渲染抽屉,同时保留异常商品数据的兜底能力。
|
|
423
434
|
*/
|
|
424
435
|
const addPhoneQuantityProductWithToast = useMemoizedFn(function() {
|
|
425
|
-
var
|
|
426
|
-
var
|
|
436
|
+
var _ref11 = _asyncToGenerator(function* (product, quantity) {
|
|
437
|
+
var _ref10, _product$id3;
|
|
427
438
|
if (!isNormalProductByDurationSchedule(product)) return addPhoneProductWithToast(product, quantity);
|
|
428
|
-
const productId = String((
|
|
439
|
+
const productId = String((_ref10 = (_product$id3 = product === null || product === void 0 ? void 0 : product.id) !== null && _product$id3 !== void 0 ? _product$id3 : product === null || product === void 0 ? void 0 : product.product_id) !== null && _ref10 !== void 0 ? _ref10 : "");
|
|
429
440
|
const result = yield cart.addProduct(product, {
|
|
430
441
|
type: "select",
|
|
431
442
|
quantity
|
|
@@ -437,11 +448,11 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
|
|
|
437
448
|
return addPhoneProductWithToast(product, quantity);
|
|
438
449
|
});
|
|
439
450
|
return function(_x4, _x5) {
|
|
440
|
-
return
|
|
451
|
+
return _ref11.apply(this, arguments);
|
|
441
452
|
};
|
|
442
453
|
}());
|
|
443
454
|
const handlePhoneProductCardChange = useMemoizedFn(function() {
|
|
444
|
-
var
|
|
455
|
+
var _ref12 = _asyncToGenerator(function* (nextValue, _intent, meta) {
|
|
445
456
|
var _product$id4;
|
|
446
457
|
const product = meta === null || meta === void 0 ? void 0 : meta.product;
|
|
447
458
|
if (!product) return;
|
|
@@ -496,7 +507,7 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
|
|
|
496
507
|
}
|
|
497
508
|
});
|
|
498
509
|
return function(_x6, _x7, _x8) {
|
|
499
|
-
return
|
|
510
|
+
return _ref12.apply(this, arguments);
|
|
500
511
|
};
|
|
501
512
|
}());
|
|
502
513
|
const { data: listData, listProps: configuredListProps, skuCardAllConfig } = productListConfig;
|
|
@@ -671,9 +682,9 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
|
|
|
671
682
|
setActiveTab([]);
|
|
672
683
|
});
|
|
673
684
|
const handleKioskSearchClose = useMemoizedFn(() => {
|
|
674
|
-
var
|
|
685
|
+
var _ref13, _kioskSearchCategoryT;
|
|
675
686
|
cancelPendingCategoryTransition();
|
|
676
|
-
const categoryTabBeforeSearch = (
|
|
687
|
+
const categoryTabBeforeSearch = (_ref13 = (_kioskSearchCategoryT = kioskSearchCategoryTabRef.current) !== null && _kioskSearchCategoryT !== void 0 ? _kioskSearchCategoryT : lastCategoryTabRef.current) !== null && _ref13 !== void 0 ? _ref13 : defaultActiveTab;
|
|
677
688
|
kioskSearchCategoryTabRef.current = void 0;
|
|
678
689
|
lastCategoryTabRef.current = categoryTabBeforeSearch;
|
|
679
690
|
setKeyword("");
|
|
@@ -4,7 +4,6 @@ import withResponsive from "../../../../responsive/withResponsive.js";
|
|
|
4
4
|
import useInitLocalesOnce from "../../../../hooks/useInitLocalesOnce.js";
|
|
5
5
|
import { subscribeBookingDateChange } from "../../../../plus/salesSdk/utils/bookingDate.js";
|
|
6
6
|
import { useSalesSdkBookingContext } from "../../../../plus/salesSdk/context/SalesSdkBookingContext.js";
|
|
7
|
-
import "../../../../plus/salesSdk/index.js";
|
|
8
7
|
import locales_default from "../../locales/index.js";
|
|
9
8
|
import dayjs from "dayjs";
|
|
10
9
|
import React, { forwardRef, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
@@ -5,7 +5,6 @@ import { buildInitBookingContextParams, collectBookingIdsFromTempOrder } from ".
|
|
|
5
5
|
import { useSalesSdk } from "../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
6
6
|
import { useSalesSdkCart } from "../../plus/salesSdk/hooks/useSalesSdkCart.js";
|
|
7
7
|
import { SalesSdkPrepareOrderSwitchContext, SalesSdkRootRefreshContext } from "../../plus/salesSdk/context/SalesSdkProvider.js";
|
|
8
|
-
import "../../plus/salesSdk/index.js";
|
|
9
8
|
import { seedDineInReservationToCart } from "../../plus/pisellReservation/utils/seedDineInReservationToCart.js";
|
|
10
9
|
import BigSale from "./index.js";
|
|
11
10
|
import dayjs from "dayjs";
|
|
@@ -4,7 +4,6 @@ import { useSalesSdkCustomer } from "../../../plus/salesSdk/hooks/useSalesSdkCus
|
|
|
4
4
|
import { useSalesSdkBookingContext } from "../../../plus/salesSdk/context/SalesSdkBookingContext.js";
|
|
5
5
|
import { useSalesSdkSummary } from "../../../plus/salesSdk/hooks/useSalesSdkSummary.js";
|
|
6
6
|
import { useSalesSdkProducts } from "../../../plus/salesSdk/hooks/useSalesSdkProducts.js";
|
|
7
|
-
import "../../../plus/salesSdk/index.js";
|
|
8
7
|
import { useMemo } from "react";
|
|
9
8
|
//#region src/components/bigSale/hooks/useBigSaleContext.ts
|
|
10
9
|
/**
|
|
@@ -3,7 +3,6 @@ import useEngineContext from "../../../hooks/useEngineContext.js";
|
|
|
3
3
|
import { buildInitBookingContextParams, collectBookingIdsFromTempOrder } from "../../../plus/salesSdk/utils/buildDefaultLoadProductsParams.js";
|
|
4
4
|
import { useSalesSdkUIHosts } from "../../../plus/salesSdk/context/SalesSdkUIHostsContext.js";
|
|
5
5
|
import { SalesSdkRootRefreshContext } from "../../../plus/salesSdk/context/SalesSdkProvider.js";
|
|
6
|
-
import "../../../plus/salesSdk/index.js";
|
|
7
6
|
import { resolveOrderIdForHostActions } from "../../../plus/pisellReservation/components/bookingDetailModal/bookingDetailHostActions.js";
|
|
8
7
|
import { usePicoCodingOpenData } from "../../../plus/pisellReservation/hooks/usePicoCodingOpenData.js";
|
|
9
8
|
import { seedDineInReservationToCart } from "../../../plus/pisellReservation/utils/seedDineInReservationToCart.js";
|
|
@@ -8,7 +8,6 @@ import { useSalesSdk } from "../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
|
8
8
|
import { useSalesSdkCustomer } from "../../plus/salesSdk/hooks/useSalesSdkCustomer.js";
|
|
9
9
|
import { SalesSdkProvider } from "../../plus/salesSdk/context/SalesSdkProvider.js";
|
|
10
10
|
import { SalesSdkBookingContextProvider } from "../../plus/salesSdk/context/SalesSdkBookingContext.js";
|
|
11
|
-
import "../../plus/salesSdk/index.js";
|
|
12
11
|
import { ResponsiveBigSaleBase } from "./Base.js";
|
|
13
12
|
import { isBigSaleProductSelectionFlowScene, resolveBigSaleSelectionFlowConfig } from "./selectionFlowConfig.js";
|
|
14
13
|
import dayjs from "dayjs";
|
|
@@ -73,7 +72,7 @@ const BigSale = ({ osKey = DEFAULT_OS_KEY, osModuleName, selectionFlowScene, lif
|
|
|
73
72
|
return resolvedTemplate === "kiosk" ? _objectSpread2(_objectSpread2({}, selectionFlowConfig), {}, {
|
|
74
73
|
initializeFullBookingContext: false,
|
|
75
74
|
variant: "phone",
|
|
76
|
-
selectorColumns:
|
|
75
|
+
selectorColumns: (selectionFlowConfig === null || selectionFlowConfig === void 0 ? void 0 : selectionFlowConfig.presentationPlatform) === "kiosk" ? 2 : 1,
|
|
77
76
|
isShowProductSummary: true,
|
|
78
77
|
isShowCollapsibleSections: true,
|
|
79
78
|
isShowMobileWeighing: true,
|
|
@@ -6,7 +6,6 @@ import useSalesUserLogin, { isRequireLoginChannel } from "../../../../hooks/useS
|
|
|
6
6
|
import { resolvePaymentResultToastV2ViewModel } from "../../../checkout/components/PaymentResultToastV2/resolve.js";
|
|
7
7
|
import PaymentResultToastV2_default from "../../../checkout/components/PaymentResultToastV2/index.js";
|
|
8
8
|
import { useSalesSdk } from "../../../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
9
|
-
import "../../../../plus/salesSdk/index.js";
|
|
10
9
|
import { usePickSaleDetailContext } from "../../hooks/usePickSaleDetailContext.js";
|
|
11
10
|
import { resolveBigSaleAutoProductListPreferences } from "../../utils/productListPreferences.js";
|
|
12
11
|
import { resolveBigSaleProductDisplayConfig } from "../../hooks/useBigSaleProductListConfig.js";
|
|
@@ -2,7 +2,6 @@ import { _asyncToGenerator } from "../../_virtual/_@oxc-project_runtime@0.122.0/
|
|
|
2
2
|
import useEngineContext from "../../hooks/useEngineContext.js";
|
|
3
3
|
import { useSalesSdk } from "../../plus/salesSdk/hooks/useSalesSdk.js";
|
|
4
4
|
import { getTempOrderSyncPayload, shouldApplySharedTempOrderPayload } from "../../plus/salesSdk/tempOrderSync.js";
|
|
5
|
-
import "../../plus/salesSdk/index.js";
|
|
6
5
|
import { useEffect, useRef } from "react";
|
|
7
6
|
import { useMemoizedFn } from "ahooks";
|
|
8
7
|
//#region src/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.tsx
|
package/es/index.js
CHANGED
|
@@ -85,7 +85,6 @@ import { useSalesSdkProducts } from "./plus/salesSdk/hooks/useSalesSdkProducts.j
|
|
|
85
85
|
import SalesSdkDemo from "./plus/salesSdk/demo/index.js";
|
|
86
86
|
import { useSalesSdkDish } from "./plus/salesSdk/hooks/useSalesSdkDish.js";
|
|
87
87
|
import { useSyncOsModule } from "./plus/salesSdk/hooks/useSyncOsModule.js";
|
|
88
|
-
import "./plus/salesSdk/index.js";
|
|
89
88
|
import BigSaleRightActionPanel from "./components/BigSaleRightActionPanel/index.js";
|
|
90
89
|
import { resolveBigSaleSelectionFlowConfig } from "./components/bigSale/selectionFlowConfig.js";
|
|
91
90
|
import BigSale from "./components/bigSale/index.js";
|
|
@@ -138,7 +137,6 @@ import PisellVenueControlPage from "./plus/pisellReservation/PisellVenueControlP
|
|
|
138
137
|
import PisellVenueWallPage from "./plus/pisellReservation/PisellVenueWallPage.js";
|
|
139
138
|
import PisellReservationTablePage from "./plus/pisellReservation/PisellReservationTablePage.js";
|
|
140
139
|
import SelectFloorMapResourceDialog from "./plus/pisellReservation/components/SelectFloorMapResourceDialog.js";
|
|
141
|
-
import "./plus/pisellReservation/index.js";
|
|
142
140
|
import { PisellTopology, PisellTopologyCore } from "./plus/pisellTopology/PisellTopology.js";
|
|
143
141
|
import cupProject_default from "./components/ecocup/cupProject/index.js";
|
|
144
142
|
import CupList from "./components/ecocup/cupList/index.js";
|
|
@@ -259,4 +259,4 @@ function bookingListToReservationTableRows(bookings) {
|
|
|
259
259
|
return rows;
|
|
260
260
|
}
|
|
261
261
|
//#endregion
|
|
262
|
-
export { applyHostResourceShellToBaseRow, bookingListToReservationTableRows, customerBrief, extractResourceRecordIds, filterBookingsByResourceIds,
|
|
262
|
+
export { applyHostResourceShellToBaseRow, bookingListToReservationTableRows, customerBrief, extractResourceRecordIds, filterBookingsByResourceIds, hostBookingUiPatchFromRecord, mergeBookingsForResourceRecord };
|
|
@@ -78,4 +78,4 @@ function toastFloorPlanLoadError(err) {
|
|
|
78
78
|
PisellToast({ content: err instanceof Error ? err.message : String(err) });
|
|
79
79
|
}
|
|
80
80
|
//#endregion
|
|
81
|
-
export { PISELL_RESERVATION_FLOOR_PLAN_CODE,
|
|
81
|
+
export { PISELL_RESERVATION_FLOOR_PLAN_CODE, ensureShopFloorPlanByCode, saveViewConfigToShopFloorPlan, shopLayoutToSceneElements$1 as shopLayoutToSceneElements, toastFloorPlanLoadError, toastFloorPlanSaveError, unsubscribeShopFloorPlanCodeQuery };
|
|
@@ -927,4 +927,4 @@ function getReservationDataSourceFormColumns() {
|
|
|
927
927
|
];
|
|
928
928
|
}
|
|
929
929
|
//#endregion
|
|
930
|
-
export { RESERVATION_BOUND_ROUND_TABLE_ELEMENT_KIND, RESERVATION_BOUND_TABLE_ELEMENT_KIND, applyReservationFloorMapLiveLabels,
|
|
930
|
+
export { RESERVATION_BOUND_ROUND_TABLE_ELEMENT_KIND, RESERVATION_BOUND_TABLE_ELEMENT_KIND, applyReservationFloorMapLiveLabels, defaultReservationTableRows, getDefaultReservationFloorMapConfig, getReservationDataSourceFormColumns, getReservationFloorMapShellConfig, mergeFloorMapElementKindCategoriesWithDefaults, mergeFloorMapElementKindsWithDefaults };
|
|
@@ -11,7 +11,6 @@ import { useSalesSdkCart } from "../salesSdk/hooks/useSalesSdkCart.js";
|
|
|
11
11
|
import { useSalesSdkCustomer } from "../salesSdk/hooks/useSalesSdkCustomer.js";
|
|
12
12
|
import { useSalesSdkBookingContext } from "../salesSdk/context/SalesSdkBookingContext.js";
|
|
13
13
|
import { useSalesSdkSummary } from "../salesSdk/hooks/useSalesSdkSummary.js";
|
|
14
|
-
import "../salesSdk/index.js";
|
|
15
14
|
import locales_default from "./locales.js";
|
|
16
15
|
import locales_default$1 from "./components/LineItem/locales.js";
|
|
17
16
|
import { SaleOrderActionBoundary } from "./actions/index.js";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
2
2
|
import useEngineContext from "../../../../../hooks/useEngineContext.js";
|
|
3
3
|
import { useSalesSdkBookingContext } from "../../../../salesSdk/context/SalesSdkBookingContext.js";
|
|
4
|
-
import "../../../../salesSdk/index.js";
|
|
5
4
|
import { useMemo } from "react";
|
|
6
5
|
import { useMemoizedFn } from "ahooks";
|
|
7
6
|
//#region src/plus/saleDetail/components/Client/hooks/useClientSelectorProps.ts
|
|
@@ -9,7 +9,6 @@ import { useSalesSdk } from "../../../salesSdk/hooks/useSalesSdk.js";
|
|
|
9
9
|
import { useSalesSdkCart } from "../../../salesSdk/hooks/useSalesSdkCart.js";
|
|
10
10
|
import { useSalesSdkGlobalScanActivity } from "../../../salesSdk/context/SalesSdkGlobalScanActivityContext.js";
|
|
11
11
|
import { useSalesSdkSummary } from "../../../salesSdk/hooks/useSalesSdkSummary.js";
|
|
12
|
-
import "../../../salesSdk/index.js";
|
|
13
12
|
import { getNumericAmount, getSalesHostModule, resolveSaleDetailOrderIdFromSales, resolveSaleDetailOrderIdFromSalesResult, shouldCloseDialogAfterCheckout, updateLocalOrder } from "./utils.js";
|
|
14
13
|
import { getRemotePrintActions, getWristbandList } from "../../serve.js";
|
|
15
14
|
import { deriveSaleOrderSubmitState } from "../../actions/state.js";
|
|
@@ -3,7 +3,6 @@ import { resolvePaymentMethodName, usePaymentMethodNameMap } from "../../../pise
|
|
|
3
3
|
import { useSalesSdk } from "../../../salesSdk/hooks/useSalesSdk.js";
|
|
4
4
|
import { useSalesSdkCart } from "../../../salesSdk/hooks/useSalesSdkCart.js";
|
|
5
5
|
import { useSalesSdkSummary } from "../../../salesSdk/hooks/useSalesSdkSummary.js";
|
|
6
|
-
import "../../../salesSdk/index.js";
|
|
7
6
|
import React, { memo, useMemo } from "react";
|
|
8
7
|
import { formatAmount, locales } from "@pisell/utils";
|
|
9
8
|
import Decimal from "decimal.js";
|
|
@@ -4,7 +4,6 @@ import { useSalesSdk } from "../salesSdk/hooks/useSalesSdk.js";
|
|
|
4
4
|
import { SalesSdkProvider } from "../salesSdk/context/SalesSdkProvider.js";
|
|
5
5
|
import { SalesSdkDishProvider } from "../salesSdk/context/SalesSdkDishContext.js";
|
|
6
6
|
import { SalesSdkBookingContextProvider } from "../salesSdk/context/SalesSdkBookingContext.js";
|
|
7
|
-
import "../salesSdk/index.js";
|
|
8
7
|
import Base_default from "./Base.js";
|
|
9
8
|
import React, { forwardRef, useImperativeHandle } from "react";
|
|
10
9
|
//#region src/plus/saleDetail/index.tsx
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import useStableInstanceId from "../../../../../../hooks/useStableInstanceId.js";
|
|
2
2
|
import { useSalesSdkDish } from "../../../../../salesSdk/hooks/useSalesSdkDish.js";
|
|
3
3
|
import { useCurrentSalesSdkDish } from "../../../../../salesSdk/hooks/useCurrentSalesSdkDish.js";
|
|
4
|
-
import "../../../../../salesSdk/index.js";
|
|
5
4
|
import { SaleDetailStatusOverview } from "../shared/StatusOverview.js";
|
|
6
5
|
import { DishGroupView } from "./DishGroupView.js";
|
|
7
6
|
import dayjs from "dayjs";
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
2
2
|
import useEngineContext from "../../../../hooks/useEngineContext.js";
|
|
3
3
|
import { useCurrentSalesSdkDish } from "../../../salesSdk/hooks/useCurrentSalesSdkDish.js";
|
|
4
|
-
import "../../../salesSdk/index.js";
|
|
5
4
|
import { getInternalNotesByScheduleEvent } from "../../serve.js";
|
|
6
5
|
import { TEMPLATE_B_PAY_ACTIONS, TEMPLATE_B_SUMMARY_ACTIONS } from "../../components/DetailActions/configs/index.js";
|
|
7
6
|
import { DetailActions } from "../../components/DetailActions/index.js";
|
|
@@ -31,4 +31,4 @@ function subscribeBookingDateChange(bookingTicket, callback) {
|
|
|
31
31
|
return typeof off === "function" ? off : () => {};
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
|
-
export {
|
|
34
|
+
export { formatBookingDateTime, subscribeBookingDateChange };
|
|
@@ -62,4 +62,4 @@ function normalizeCustomerAuthCustomer(value) {
|
|
|
62
62
|
return null;
|
|
63
63
|
}
|
|
64
64
|
//#endregion
|
|
65
|
-
export {
|
|
65
|
+
export { isValidOrderCustomerId, normalizeCustomerAuthCustomer, resolveCustomerAuthCurrentCustomerId, shouldPromptCustomerAuthForProduct };
|
|
@@ -71,4 +71,4 @@ function buildHolderListRequestKey(params) {
|
|
|
71
71
|
});
|
|
72
72
|
}
|
|
73
73
|
//#endregion
|
|
74
|
-
export { buildHolderListRequestKey, buildHolderListRequestParams, enrichCartBookingHolderDisplay,
|
|
74
|
+
export { buildHolderListRequestKey, buildHolderListRequestParams, enrichCartBookingHolderDisplay, resolveHolderDisplayConfig };
|
|
@@ -152,10 +152,14 @@ function _runAddProductFlow() {
|
|
|
152
152
|
initialHolderIds: (_flowOptions$initialH = flowOptions.initialHolderIds) !== null && _flowOptions$initialH !== void 0 ? _flowOptions$initialH : result.payload.initialHolderIds
|
|
153
153
|
}));
|
|
154
154
|
if (!detailResult) return { status: "cancelled" };
|
|
155
|
-
if (detailResult._committedProducts)
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
155
|
+
if (detailResult._committedProducts) {
|
|
156
|
+
var _flowOptions$onBookin2;
|
|
157
|
+
yield (_flowOptions$onBookin2 = flowOptions.onBookingSelectionCommitted) === null || _flowOptions$onBookin2 === void 0 ? void 0 : _flowOptions$onBookin2.call(flowOptions);
|
|
158
|
+
return {
|
|
159
|
+
status: "added",
|
|
160
|
+
products: detailResult._committedProducts
|
|
161
|
+
};
|
|
162
|
+
}
|
|
159
163
|
const catalog = (_result$payload$produ = (_result$payload = result.payload) === null || _result$payload === void 0 ? void 0 : _result$payload.productData) !== null && _result$payload$produ !== void 0 ? _result$payload$produ : product;
|
|
160
164
|
const detailExtend = (_detailResult$detail = detailResult.detail) === null || _detailResult$detail === void 0 ? void 0 : _detailResult$detail._extend;
|
|
161
165
|
const hasFlowSelectedMultiDayRange = resolveIsMultiDayProduct(detailResult.detail, catalog, product) && (detailExtend === null || detailExtend === void 0 ? void 0 : detailExtend.start_date) && (detailExtend === null || detailExtend === void 0 ? void 0 : detailExtend.end_date);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { AuthMethodType, EmailAuthConfig, EmailRegistrationVerification, LoginFormData, OAuthConfig, PhoneAuthConfig, RegisterFormData, UIConfig, VerificationMethod } from "./shared/types.js";
|
|
2
1
|
import { Login2, Login2Config, Login2Events, Login2Props } from "./Login2.js";
|
|
3
2
|
import { Register2, Register2Config, Register2Events, Register2Props } from "./Register2.js";
|
|
4
|
-
import { AuthModal } from "./AuthModal.js";
|
|
3
|
+
import { AuthModal, AuthModalProps } from "./AuthModal.js";
|
|
@@ -226,4 +226,4 @@ interface RegisterFormData {
|
|
|
226
226
|
verification_token?: string;
|
|
227
227
|
}
|
|
228
228
|
//#endregion
|
|
229
|
-
export { AuthMethodType, EmailAuthConfig,
|
|
229
|
+
export { AuthMethodType, EmailAuthConfig, LegalTermsConfig, LoginFormData, LoginMethodItem, OAuthConfig, PhoneAuthConfig, RegisterFormData, RegistrationMethodItem, UIConfig };
|
|
@@ -1673,7 +1673,7 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, variant }, ref) => {
|
|
|
1673
1673
|
}, isMobile && (skuDetailConfig === null || skuDetailConfig === void 0 ? void 0 : skuDetailConfig.isShowProductSummary) ? showProductDetailsCollapsible ? /* @__PURE__ */ React.createElement(SkuDetailCollapsibleSection, {
|
|
1674
1674
|
key: `details-${selectionFlowInstanceKey}`,
|
|
1675
1675
|
title: locales.getText("pisell2.text.sku.detail.modal.section.details"),
|
|
1676
|
-
defaultExpanded:
|
|
1676
|
+
defaultExpanded: isKioskPlatform
|
|
1677
1677
|
}, renderProductDetails()) : renderProductSummary() : null, shouldRenderMobileWeighing ? /* @__PURE__ */ React.createElement("div", { className: "sku-detail-mobile-weighing" }, renderWeighingSection()) : null, /* @__PURE__ */ React.createElement(PisellSelectionFlow, {
|
|
1678
1678
|
key: selectionFlowInstanceKey,
|
|
1679
1679
|
ref: selectionFlowRef,
|
|
@@ -1758,7 +1758,7 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, variant }, ref) => {
|
|
|
1758
1758
|
key: `details-${selectionFlowInstanceKey}`,
|
|
1759
1759
|
className: "sku-detail-collapsible-section--product-details",
|
|
1760
1760
|
title: locales.getText("pisell2.text.sku.detail.modal.section.details"),
|
|
1761
|
-
defaultExpanded:
|
|
1761
|
+
defaultExpanded: isKioskPlatform
|
|
1762
1762
|
}, renderProductDetails()) : mobileProductDetails, shouldRenderMobileWeighing ? /* @__PURE__ */ React.createElement("div", { className: "sku-detail-mobile-weighing" }, renderWeighingSection()) : null, shouldRenderSkuSelection ? /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(SKUOptionsSelection, {
|
|
1763
1763
|
ref: skuOptionsSelectionRef,
|
|
1764
1764
|
dataSource: productData,
|
|
@@ -1821,8 +1821,8 @@ const SkuDetailModal = ({ onConfirm, onRemove, onClose, variant }, ref) => {
|
|
|
1821
1821
|
footer: variant === "phone" ? leftContent({ showTop: false }) : null,
|
|
1822
1822
|
closable: false,
|
|
1823
1823
|
destroyOnClose: true,
|
|
1824
|
-
style: { maxHeight: variant === "phone" ? "99dvh" : void 0 },
|
|
1825
|
-
height: variant === "phone" ? "auto" : void 0,
|
|
1824
|
+
style: { maxHeight: isKioskPlatform ? "100%" : variant === "phone" ? "99dvh" : void 0 },
|
|
1825
|
+
height: isKioskPlatform ? "100%" : variant === "phone" ? "auto" : void 0,
|
|
1826
1826
|
styles: isKioskPlatform ? { content: { height: "100%" } } : void 0,
|
|
1827
1827
|
width: variant === "phone" ? "100%" : "80%",
|
|
1828
1828
|
className: classNames({
|
|
@@ -7,6 +7,7 @@ const require_useInitLocalesOnce = require("../../../../hooks/useInitLocalesOnce
|
|
|
7
7
|
const require_index = require("../../../../plus/productSelect/ProductCard/index.js");
|
|
8
8
|
const require_ProductCardV2 = require("../../../../plus/productSelect/ProductCard/ProductCardV2.js");
|
|
9
9
|
const require_useLocale = require("../../../../hooks/useLocale.js");
|
|
10
|
+
const require_useLogger = require("../../../../hooks/useLogger.js");
|
|
10
11
|
const require_List = require("../../../list/List.js");
|
|
11
12
|
const require_utils$1 = require("../../../ticketBooking/components/ProductDisplayAdapter/utils.js");
|
|
12
13
|
const require_showAddToCartToast = require("../../../../plus/salesSdk/components/showAddToCartToast.js");
|
|
@@ -136,6 +137,7 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
|
|
|
136
137
|
addToCartToastOptions === null || addToCartToastOptions === void 0 ? void 0 : addToCartToastOptions.duration
|
|
137
138
|
]);
|
|
138
139
|
const locale = require_useLocale.default();
|
|
140
|
+
const logger = require_useLogger.default();
|
|
139
141
|
const { sales, products, cart } = context;
|
|
140
142
|
const { load } = products;
|
|
141
143
|
const [keyword, setKeyword] = (0, react.useState)("");
|
|
@@ -303,17 +305,26 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
|
|
|
303
305
|
* handleSelectProduct(productItem);
|
|
304
306
|
*/
|
|
305
307
|
const handleSelectProduct = (0, ahooks.useMemoizedFn)(function() {
|
|
306
|
-
var
|
|
308
|
+
var _ref5 = require_asyncToGenerator._asyncToGenerator(function* (product) {
|
|
307
309
|
var _ref3, _product$id;
|
|
308
310
|
const handlesKioskToastAfterResult = productCardVersion === "v2" && !usesV2ProductCard;
|
|
309
311
|
const productId = String((_ref3 = (_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 && _ref3 !== void 0 ? _ref3 : "");
|
|
310
312
|
const baselineQuantity = phoneCartProductEntries.filter((entry) => resolvePhoneCartProductId(entry.value) === productId).reduce((total, entry) => total + entry.quantity, 0);
|
|
311
313
|
try {
|
|
312
|
-
var _sales$tempOrder3;
|
|
314
|
+
var _sales$tempOrder3, _logger$addLog, _ref4, _sales$tempOrder$orde, _sales$tempOrder4;
|
|
313
315
|
if (!sales.isReady) return;
|
|
314
316
|
if (requiredOrderId !== void 0 && Number((_sales$tempOrder3 = sales.tempOrder) === null || _sales$tempOrder3 === void 0 ? void 0 : _sales$tempOrder3.order_id) !== Number(requiredOrderId)) return;
|
|
315
317
|
const latestProduct = currentProducts.find((currentProduct) => currentProduct.id === product.id);
|
|
316
318
|
latestProduct && require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, product), {}, { cartDetailValue: latestProduct.cartDetailValue });
|
|
319
|
+
logger === null || logger === void 0 || (_logger$addLog = logger.addLog) === null || _logger$addLog === void 0 || _logger$addLog.call(logger, {
|
|
320
|
+
type: "info",
|
|
321
|
+
title: "[BigSaleProductList] 用户点击商品卡片加入购物车",
|
|
322
|
+
metadata: {
|
|
323
|
+
product_id: productId,
|
|
324
|
+
product_title: resolvePhoneProductTitle(product),
|
|
325
|
+
order_id: (_ref4 = (_sales$tempOrder$orde = (_sales$tempOrder4 = sales.tempOrder) === null || _sales$tempOrder4 === void 0 ? void 0 : _sales$tempOrder4.order_id) !== null && _sales$tempOrder$orde !== void 0 ? _sales$tempOrder$orde : requiredOrderId) !== null && _ref4 !== void 0 ? _ref4 : null
|
|
326
|
+
}
|
|
327
|
+
});
|
|
317
328
|
const result = yield cart.addProductWithFlow(product, {
|
|
318
329
|
quantity: 1,
|
|
319
330
|
notShowToast: handlesKioskToastAfterResult
|
|
@@ -325,7 +336,7 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
|
|
|
325
336
|
}
|
|
326
337
|
});
|
|
327
338
|
return function(_x) {
|
|
328
|
-
return
|
|
339
|
+
return _ref5.apply(this, arguments);
|
|
329
340
|
};
|
|
330
341
|
}());
|
|
331
342
|
const phoneCartProductEntries = (0, react.useMemo)(() => {
|
|
@@ -339,8 +350,8 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
|
|
|
339
350
|
const productUid = resolvePhoneCartLineUid(booking === null || booking === void 0 || (_booking$_extend = booking._extend) === null || _booking$_extend === void 0 ? void 0 : _booking$_extend.product);
|
|
340
351
|
if (productUid) bookingProductUids.add(productUid);
|
|
341
352
|
((booking === null || booking === void 0 || (_booking$_extend2 = booking._extend) === null || _booking$_extend2 === void 0 ? void 0 : _booking$_extend2.mergedFrom) || []).forEach((source) => {
|
|
342
|
-
var
|
|
343
|
-
const sourceUid = (
|
|
353
|
+
var _ref6, _source$booking$produ, _source$booking, _source$booking2;
|
|
354
|
+
const sourceUid = (_ref6 = (_source$booking$produ = source === null || source === void 0 || (_source$booking = source.booking) === null || _source$booking === void 0 ? void 0 : _source$booking.product_uid) !== null && _source$booking$produ !== void 0 ? _source$booking$produ : source === null || source === void 0 || (_source$booking2 = source.booking) === null || _source$booking2 === void 0 || (_source$booking2 = _source$booking2.metadata) === null || _source$booking2 === void 0 ? void 0 : _source$booking2.product_uid) !== null && _ref6 !== void 0 ? _ref6 : resolvePhoneCartLineUid(source === null || source === void 0 ? void 0 : source.product);
|
|
344
355
|
if (sourceUid !== void 0 && sourceUid !== null && sourceUid !== "") bookingProductUids.add(String(sourceUid));
|
|
345
356
|
});
|
|
346
357
|
});
|
|
@@ -354,10 +365,10 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
|
|
|
354
365
|
quantity: resolvePhoneCartEntryQuantity(item)
|
|
355
366
|
}));
|
|
356
367
|
displayBookings.forEach((booking) => {
|
|
357
|
-
var _booking$_extend3,
|
|
368
|
+
var _booking$_extend3, _ref7, _booking$_extend$disp, _booking$_extend4, _product$_extend, _product$product_id;
|
|
358
369
|
const product = booking === null || booking === void 0 || (_booking$_extend3 = booking._extend) === null || _booking$_extend3 === void 0 ? void 0 : _booking$_extend3.product;
|
|
359
370
|
if (!product || (product === null || product === void 0 ? void 0 : product._isGiftPromotion)) return;
|
|
360
|
-
const displayQuantity = (
|
|
371
|
+
const displayQuantity = (_ref7 = (_booking$_extend$disp = booking === null || booking === void 0 || (_booking$_extend4 = booking._extend) === null || _booking$_extend4 === void 0 ? void 0 : _booking$_extend4.displayQuantity) !== null && _booking$_extend$disp !== void 0 ? _booking$_extend$disp : product === null || product === void 0 || (_product$_extend = product._extend) === null || _product$_extend === void 0 ? void 0 : _product$_extend.displayQuantity) !== null && _ref7 !== void 0 ? _ref7 : product === null || product === void 0 ? void 0 : product.num;
|
|
361
372
|
const displayValue = require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, product), {}, {
|
|
362
373
|
product_id: (_product$product_id = product === null || product === void 0 ? void 0 : product.product_id) !== null && _product$product_id !== void 0 ? _product$product_id : product === null || product === void 0 ? void 0 : product.id,
|
|
363
374
|
num: displayQuantity
|
|
@@ -401,9 +412,9 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
|
|
|
401
412
|
show();
|
|
402
413
|
});
|
|
403
414
|
const addPhoneProductWithToast = (0, ahooks.useMemoizedFn)(function() {
|
|
404
|
-
var
|
|
405
|
-
var
|
|
406
|
-
const productId = String((
|
|
415
|
+
var _ref9 = require_asyncToGenerator._asyncToGenerator(function* (product, quantity, type = "select", delayUntilModalClosed = false) {
|
|
416
|
+
var _ref8, _product$id2;
|
|
417
|
+
const productId = String((_ref8 = (_product$id2 = product === null || product === void 0 ? void 0 : product.id) !== null && _product$id2 !== void 0 ? _product$id2 : product === null || product === void 0 ? void 0 : product.product_id) !== null && _ref8 !== void 0 ? _ref8 : "");
|
|
407
418
|
const currentQuantity = phoneCartProductEntries.filter((entry) => resolvePhoneCartProductId(entry.value) === productId).reduce((total, entry) => total + entry.quantity, 0);
|
|
408
419
|
const result = yield cart.addProductWithFlow(product, {
|
|
409
420
|
type,
|
|
@@ -414,7 +425,7 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
|
|
|
414
425
|
return result;
|
|
415
426
|
});
|
|
416
427
|
return function(_x2, _x3) {
|
|
417
|
-
return
|
|
428
|
+
return _ref9.apply(this, arguments);
|
|
418
429
|
};
|
|
419
430
|
}());
|
|
420
431
|
/**
|
|
@@ -425,10 +436,10 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
|
|
|
425
436
|
* 这样不会为了“判断商品类型”预先渲染抽屉,同时保留异常商品数据的兜底能力。
|
|
426
437
|
*/
|
|
427
438
|
const addPhoneQuantityProductWithToast = (0, ahooks.useMemoizedFn)(function() {
|
|
428
|
-
var
|
|
429
|
-
var
|
|
439
|
+
var _ref11 = require_asyncToGenerator._asyncToGenerator(function* (product, quantity) {
|
|
440
|
+
var _ref10, _product$id3;
|
|
430
441
|
if (!require_utils.isNormalProductByDurationSchedule(product)) return addPhoneProductWithToast(product, quantity);
|
|
431
|
-
const productId = String((
|
|
442
|
+
const productId = String((_ref10 = (_product$id3 = product === null || product === void 0 ? void 0 : product.id) !== null && _product$id3 !== void 0 ? _product$id3 : product === null || product === void 0 ? void 0 : product.product_id) !== null && _ref10 !== void 0 ? _ref10 : "");
|
|
432
443
|
const result = yield cart.addProduct(product, {
|
|
433
444
|
type: "select",
|
|
434
445
|
quantity
|
|
@@ -440,11 +451,11 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
|
|
|
440
451
|
return addPhoneProductWithToast(product, quantity);
|
|
441
452
|
});
|
|
442
453
|
return function(_x4, _x5) {
|
|
443
|
-
return
|
|
454
|
+
return _ref11.apply(this, arguments);
|
|
444
455
|
};
|
|
445
456
|
}());
|
|
446
457
|
const handlePhoneProductCardChange = (0, ahooks.useMemoizedFn)(function() {
|
|
447
|
-
var
|
|
458
|
+
var _ref12 = require_asyncToGenerator._asyncToGenerator(function* (nextValue, _intent, meta) {
|
|
448
459
|
var _product$id4;
|
|
449
460
|
const product = meta === null || meta === void 0 ? void 0 : meta.product;
|
|
450
461
|
if (!product) return;
|
|
@@ -499,7 +510,7 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
|
|
|
499
510
|
}
|
|
500
511
|
});
|
|
501
512
|
return function(_x6, _x7, _x8) {
|
|
502
|
-
return
|
|
513
|
+
return _ref12.apply(this, arguments);
|
|
503
514
|
};
|
|
504
515
|
}());
|
|
505
516
|
const { data: listData, listProps: configuredListProps, skuCardAllConfig } = productListConfig;
|
|
@@ -674,9 +685,9 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
|
|
|
674
685
|
setActiveTab([]);
|
|
675
686
|
});
|
|
676
687
|
const handleKioskSearchClose = (0, ahooks.useMemoizedFn)(() => {
|
|
677
|
-
var
|
|
688
|
+
var _ref13, _kioskSearchCategoryT;
|
|
678
689
|
cancelPendingCategoryTransition();
|
|
679
|
-
const categoryTabBeforeSearch = (
|
|
690
|
+
const categoryTabBeforeSearch = (_ref13 = (_kioskSearchCategoryT = kioskSearchCategoryTabRef.current) !== null && _kioskSearchCategoryT !== void 0 ? _kioskSearchCategoryT : lastCategoryTabRef.current) !== null && _ref13 !== void 0 ? _ref13 : defaultActiveTab;
|
|
680
691
|
kioskSearchCategoryTabRef.current = void 0;
|
|
681
692
|
lastCategoryTabRef.current = categoryTabBeforeSearch;
|
|
682
693
|
setKeyword("");
|