@pisell/private-materials 6.12.337 → 6.12.342

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.
Files changed (65) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/meta.js +1 -1
  5. package/build/lowcode/preview.js +1 -1
  6. package/build/lowcode/render/default/view.js +3 -3
  7. package/build/lowcode/view.js +3 -3
  8. package/es/components/bigSale/components/BookingFloatingPanel/useBookingPanelController.js +0 -1
  9. package/es/components/bigSale/components/ProductList/index.js +49 -30
  10. package/es/components/bigSale/components/TimeBar/index.js +0 -1
  11. package/es/components/bigSale/dialog.js +0 -1
  12. package/es/components/bigSale/hooks/useBigSaleContext.js +0 -1
  13. package/es/components/bigSale/hooks/useSelectFloorMapResourceForBigSale.js +0 -1
  14. package/es/components/bigSale/index.js +0 -1
  15. package/es/components/bigSale/templates/Kiosk/index.js +0 -1
  16. package/es/components/list/List.js +17 -13
  17. package/es/components/list/types.d.ts +10 -0
  18. package/es/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.js +0 -1
  19. package/es/components/shoppingCart/hooks/usePromotionModal.js +10 -5
  20. package/es/components/shoppingCart/hooks/useSkuModal.js +5 -2
  21. package/es/components/shoppingCart/server.js +6 -4
  22. package/es/index.js +0 -2
  23. package/es/plus/multiCurrencySettlement/index.js +1 -1
  24. package/es/plus/pisellReservation/data/bookingToReservationTables.js +1 -1
  25. package/es/plus/pisellReservation/floorMap/floorPlanApi.js +1 -1
  26. package/es/plus/pisellReservation/floorMap/reservationMock.js +1 -1
  27. package/es/plus/saasDevice/devicePasscodes/model.js +4 -4
  28. package/es/plus/saleDetail/Base.js +0 -1
  29. package/es/plus/saleDetail/components/Client/hooks/useClientSelectorProps.js +0 -1
  30. package/es/plus/saleDetail/components/DetailActions/PrintAction.js +0 -1
  31. package/es/plus/saleDetail/components/DetailActions/index.js +0 -1
  32. package/es/plus/saleDetail/components/SummaryFinancialSections/index.js +0 -1
  33. package/es/plus/saleDetail/index.js +0 -1
  34. package/es/plus/saleDetail/tmpl/B/components/Dish/index.js +0 -1
  35. package/es/plus/saleDetail/tmpl/B/components/Forms/index.less +51 -0
  36. package/es/plus/saleDetail/tmpl/B/index.js +0 -1
  37. package/es/plus/salesSdk/context/SalesSdkCartContext.js +2 -2
  38. package/es/plus/salesSdk/context/SalesSdkProvider.js +7 -2
  39. package/es/plus/salesSdk/giftSelect/buildGiftOrderProducts.js +6 -5
  40. package/es/plus/salesSdk/giftSelect/createOpenGiftSelectHost.js +5 -3
  41. package/es/plus/salesSdk/utils/addProductWithFlowDebounced.js +1 -1
  42. package/es/plus/salesSdk/utils/bookingDate.js +1 -1
  43. package/es/plus/salesSdk/utils/enrichCartLineHolderDisplay.js +1 -1
  44. package/es/plus/walletPassGallery/components/timelineSection/index.js +4 -4
  45. package/es/private-materials/lowcode/authmodal/meta.d.ts +1 -0
  46. package/es/pro/Login2.0/AuthModal.d.ts +1 -1
  47. package/es/pro/Login2.0/index.d.ts +2 -2
  48. package/es/pro/Login2.0/shared/types.d.ts +1 -1
  49. package/lib/components/bigSale/components/ProductList/index.js +49 -29
  50. package/lib/components/list/List.js +17 -13
  51. package/lib/components/list/types.d.ts +10 -0
  52. package/lib/components/shoppingCart/hooks/usePromotionModal.js +10 -5
  53. package/lib/components/shoppingCart/hooks/useSkuModal.js +5 -2
  54. package/lib/components/shoppingCart/server.js +6 -4
  55. package/lib/plus/saleDetail/tmpl/B/components/Forms/index.less +51 -0
  56. package/lib/plus/salesSdk/context/SalesSdkCartContext.js +2 -2
  57. package/lib/plus/salesSdk/context/SalesSdkProvider.js +7 -2
  58. package/lib/plus/salesSdk/giftSelect/buildGiftOrderProducts.js +6 -5
  59. package/lib/plus/salesSdk/giftSelect/createOpenGiftSelectHost.js +5 -3
  60. package/lowcode/allergy-selection-modal/meta.ts +451 -0
  61. package/lowcode/huifu-kiosk-panel/meta.ts +351 -0
  62. package/lowcode/pos-permission/meta.ts +233 -0
  63. package/package.json +3 -3
  64. package/es/plus/pisellReservation/index.js +0 -17
  65. package/es/plus/salesSdk/index.js +0 -54
@@ -0,0 +1,51 @@
1
+ @forms-prefix: pisell-sale-detail-forms;
2
+
3
+ .pisell-sale-detail-forms-main {
4
+ padding: 8px 10px;
5
+ }
6
+
7
+ .@{forms-prefix} {
8
+ display: flex;
9
+ flex-direction: column;
10
+ gap: 8px;
11
+ width: 100%;
12
+ min-height: 0;
13
+ overflow: auto;
14
+
15
+ &__card {
16
+ padding: 12px;
17
+ border: 1px solid rgba(93, 112, 157, 0.72);
18
+ border-radius: 8px;
19
+ background: #080d18;
20
+ }
21
+
22
+ &__header {
23
+ display: flex;
24
+ align-items: center;
25
+ gap: 8px;
26
+ min-width: 0;
27
+ margin-bottom: 10px;
28
+ color: #f5f7ff;
29
+ }
30
+
31
+ &__booking-id {
32
+ flex: none;
33
+ font-size: 14px;
34
+ font-weight: 800;
35
+ }
36
+
37
+ &__resource {
38
+ overflow: hidden;
39
+ color: rgba(234, 240, 255, 0.72);
40
+ font-size: 13px;
41
+ text-overflow: ellipsis;
42
+ white-space: nowrap;
43
+ }
44
+
45
+ &__empty {
46
+ display: flex;
47
+ align-items: center;
48
+ justify-content: center;
49
+ min-height: 220px;
50
+ }
51
+ }
@@ -1,7 +1,6 @@
1
1
  import useEngineContext from "../../../../hooks/useEngineContext.js";
2
2
  import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.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";
@@ -1958,7 +1958,7 @@ const SalesSdkCartProvider = ({ children, normalProductDetailConfig, deferHolder
1958
1958
  */
1959
1959
  const selectGiftForItem = useMemoizedFn(function() {
1960
1960
  var _ref43 = _asyncToGenerator(function* (target) {
1961
- var _mainItem$metadata, _mainItem$metadata2, _giftInfo$giftOptions, _promotion$strategyMe, _mainItem$giftData, _mainItem$giftData2;
1961
+ var _mainItem$metadata, _mainItem$metadata2, _giftInfo$giftOptions, _promotion$strategyMe, _mainItem$giftData, _mainItem$giftData2, _engineContext$appHel;
1962
1962
  if (!bookingTicket) throw new Error("[SalesSdk] Cart: bookingTicket 未初始化");
1963
1963
  const mainItem = resolveEditCartLineTarget(target, snapshot.items);
1964
1964
  const promotion = (_mainItem$metadata = mainItem.metadata) === null || _mainItem$metadata === void 0 ? void 0 : _mainItem$metadata._promotion;
@@ -1981,7 +1981,7 @@ const SalesSdkCartProvider = ({ children, normalProductDetailConfig, deferHolder
1981
1981
  };
1982
1982
  const choices = yield hostBridges.giftSelect.request(ctx);
1983
1983
  if (!(choices === null || choices === void 0 ? void 0 : choices.length)) return;
1984
- yield replaceStrategyGiftsForMainItem(bookingTicket, mainItem, choices);
1984
+ yield replaceStrategyGiftsForMainItem(bookingTicket, mainItem, choices, engineContext === null || engineContext === void 0 || (_engineContext$appHel = engineContext.appHelper) === null || _engineContext$appHel === void 0 || (_engineContext$appHel = _engineContext$appHel.constants) === null || _engineContext$appHel === void 0 ? void 0 : _engineContext$appHel.apiPrefix);
1985
1985
  yield syncCartAfterMutation();
1986
1986
  });
1987
1987
  return function(_x41) {
@@ -243,7 +243,7 @@ function SalesSdkBootstrap({ bootstrapKey, onSettled, autoRestoreOnInit, autoBoo
243
243
  return null;
244
244
  }
245
245
  const SalesSdkProvider = ({ osKey, enableMultiCurrencySettlement = false, solution = "bookingTicket", moduleAccess = "ensure", lifecycleOwner = "provider", businessCode, bookingConfigParams, autoInitBookingContext = true, otherParams, deferHolderAuthOnClose = false, enableCustomerAuthHost = false, shouldMergeProductLines, rulesHooks, orderId, preloadedSalesDetail, autoBootstrap = true, autoRestoreOnInit = true, restoreOrderAfterPaidCheckout = true, destroyOnUnmount = true, uiHosts, awaitAllergyConfirmation, normalProductDetailConfig, mergeBookingLinesForDisplay = true, legacyOpenProductDetail, enableTempOrderSync = false, enableTempOrderPersist = false, syncDetailOnOrderChange = false, isActive = true, preserveProductCatalogOnInactiveCustomerClear = false, enableGlobalScanListener = false, suppressCartIneligibleScanToast = false, promotionScanSuccessMessageKey, promotionItemIncreaseMessageKey, defaultProductLoadParams, children }) => {
246
- var _context$appHelper, _osKey$replace;
246
+ var _context$appHelper, _osKey$replace, _context$appHelper3;
247
247
  const context = useEngineContext();
248
248
  const utils = (context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {};
249
249
  const Toast = useToast();
@@ -1472,7 +1472,11 @@ const SalesSdkProvider = ({ osKey, enableMultiCurrencySettlement = false, soluti
1472
1472
  bookingTicket.setPromotionEvaluator((_utils$promotionEvalu = utils === null || utils === void 0 ? void 0 : utils.promotionEvaluator) !== null && _utils$promotionEvalu !== void 0 ? _utils$promotionEvalu : null);
1473
1473
  }
1474
1474
  if (typeof bookingTicket.setGiftSelectResolver === "function") {
1475
- const resolver = createOpenGiftSelectHost(hostBridges.giftSelect, () => bookingTicketRef.current, { getUiHosts: () => uiHostsValue });
1475
+ var _context$appHelper2;
1476
+ const resolver = createOpenGiftSelectHost(hostBridges.giftSelect, () => bookingTicketRef.current, {
1477
+ getUiHosts: () => uiHostsValue,
1478
+ apiPrefix: context === null || context === void 0 || (_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 || (_context$appHelper2 = _context$appHelper2.constants) === null || _context$appHelper2 === void 0 ? void 0 : _context$appHelper2.apiPrefix
1479
+ });
1476
1480
  bookingTicket.setGiftSelectResolver(resolver);
1477
1481
  }
1478
1482
  return () => {
@@ -1482,6 +1486,7 @@ const SalesSdkProvider = ({ osKey, enableMultiCurrencySettlement = false, soluti
1482
1486
  }, [
1483
1487
  bookingTicket,
1484
1488
  utils === null || utils === void 0 ? void 0 : utils.promotionEvaluator,
1489
+ context === null || context === void 0 || (_context$appHelper3 = context.appHelper) === null || _context$appHelper3 === void 0 || (_context$appHelper3 = _context$appHelper3.constants) === null || _context$appHelper3 === void 0 ? void 0 : _context$appHelper3.apiPrefix,
1485
1490
  hostBridges.giftSelect,
1486
1491
  uiHostsValue
1487
1492
  ]);
@@ -239,11 +239,11 @@ function collectMissingProductIds(choices, productMap) {
239
239
  * @example
240
240
  * const map = await fetchGiftProductMap([{ product_id: 1, product_variant_id: 0, quantity: 1 }]);
241
241
  */
242
- function fetchGiftProductMap(_x) {
242
+ function fetchGiftProductMap(_x, _x2) {
243
243
  return _fetchGiftProductMap.apply(this, arguments);
244
244
  }
245
245
  function _fetchGiftProductMap() {
246
- _fetchGiftProductMap = _asyncToGenerator(function* (productIds) {
246
+ _fetchGiftProductMap = _asyncToGenerator(function* (productIds, apiPrefix) {
247
247
  const ids = Array.from(new Set(productIds.filter((id) => Number.isFinite(id) && id > 0)));
248
248
  if (!ids.length) return /* @__PURE__ */ new Map();
249
249
  const map = /* @__PURE__ */ new Map();
@@ -256,7 +256,8 @@ function _fetchGiftProductMap() {
256
256
  if (!missingIds.length) return map;
257
257
  ((yield getProducts({
258
258
  ids: missingIds,
259
- isGift: true
259
+ isGift: true,
260
+ apiPrefix
260
261
  })) || []).forEach((p) => {
261
262
  const id = resolveProductId(p);
262
263
  if (!id) return;
@@ -274,7 +275,7 @@ function _fetchGiftProductMap() {
274
275
  * @example
275
276
  * const lines = await buildGiftOrderProductsFromChoices(choices, ctx, (ids) => ticket.getProductByIds(ids));
276
277
  */
277
- function buildGiftOrderProductsFromChoices(_x2, _x3, _x4) {
278
+ function buildGiftOrderProductsFromChoices(_x3, _x4, _x5) {
278
279
  return _buildGiftOrderProductsFromChoices.apply(this, arguments);
279
280
  }
280
281
  function _buildGiftOrderProductsFromChoices() {
@@ -296,7 +297,7 @@ function _buildGiftOrderProductsFromChoices() {
296
297
  }
297
298
  missingIds = collectMissingProductIds(choices, productMap);
298
299
  if (missingIds.length) try {
299
- (yield fetchGiftProductMap(missingIds)).forEach((product, id) => {
300
+ (yield fetchGiftProductMap(missingIds, options === null || options === void 0 ? void 0 : options.apiPrefix)).forEach((product, id) => {
300
301
  if (!productMap.has(id)) productMap.set(id, product);
301
302
  });
302
303
  } catch (error) {
@@ -91,7 +91,7 @@ function createOpenGiftSelectHost(bridge, getBookingTicket, options) {
91
91
  const option = ctx.giftOptions[0];
92
92
  const products = yield (_bookingTicket$getPro = bookingTicket.getProductByIds) === null || _bookingTicket$getPro === void 0 ? void 0 : _bookingTicket$getPro.call(bookingTicket, [Number(option.product_id)]);
93
93
  let product = products === null || products === void 0 ? void 0 : products[0];
94
- if (!product) product = (yield fetchGiftProductMap([Number(option.product_id)])).get(Number(option.product_id));
94
+ if (!product) product = (yield fetchGiftProductMap([Number(option.product_id)], options === null || options === void 0 ? void 0 : options.apiPrefix)).get(Number(option.product_id));
95
95
  if (isBookingGiftCandidate(product)) {
96
96
  var _options$getUiHosts;
97
97
  const choice = yield resolveSingleBookingGiftChoice(product, option, ctx, bookingTicket, options === null || options === void 0 || (_options$getUiHosts = options.getUiHosts) === null || _options$getUiHosts === void 0 ? void 0 : _options$getUiHosts.call(options));
@@ -114,6 +114,7 @@ function createOpenGiftSelectHost(bridge, getBookingTicket, options) {
114
114
  if (!choices) return null;
115
115
  return buildGiftOrderProductsFromChoices(choices, ctx, {
116
116
  bookingTicket,
117
+ apiPrefix: options === null || options === void 0 ? void 0 : options.apiPrefix,
117
118
  fallbackFetcher: (ids) => {
118
119
  var _bookingTicket$getPro2, _bookingTicket$getPro3;
119
120
  return (_bookingTicket$getPro2 = (_bookingTicket$getPro3 = bookingTicket.getProductByIds) === null || _bookingTicket$getPro3 === void 0 ? void 0 : _bookingTicket$getPro3.call(bookingTicket, ids)) !== null && _bookingTicket$getPro2 !== void 0 ? _bookingTicket$getPro2 : Promise.resolve([]);
@@ -132,11 +133,11 @@ function createOpenGiftSelectHost(bridge, getBookingTicket, options) {
132
133
  * @example
133
134
  * await replaceStrategyGiftsForMainItem(bookingTicket, mainItem, choices);
134
135
  */
135
- function replaceStrategyGiftsForMainItem(_x7, _x8, _x9) {
136
+ function replaceStrategyGiftsForMainItem(_x7, _x8, _x9, _x10) {
136
137
  return _replaceStrategyGiftsForMainItem.apply(this, arguments);
137
138
  }
138
139
  function _replaceStrategyGiftsForMainItem() {
139
- _replaceStrategyGiftsForMainItem = _asyncToGenerator(function* (bookingTicket, mainItem, choices) {
140
+ _replaceStrategyGiftsForMainItem = _asyncToGenerator(function* (bookingTicket, mainItem, choices, apiPrefix) {
140
141
  var _mainItem$metadata, _mainItem$metadata2, _giftInfo$giftOptions, _promotion$strategyMe, _bookingTicket$getTem3;
141
142
  const sourceUid = (_mainItem$metadata = mainItem.metadata) === null || _mainItem$metadata === void 0 ? void 0 : _mainItem$metadata.unique_identification_number;
142
143
  const promotion = (_mainItem$metadata2 = mainItem.metadata) === null || _mainItem$metadata2 === void 0 ? void 0 : _mainItem$metadata2._promotion;
@@ -162,6 +163,7 @@ function _replaceStrategyGiftsForMainItem() {
162
163
  });
163
164
  const newGifts = yield buildGiftOrderProductsFromChoices(choices, ctx, {
164
165
  bookingTicket,
166
+ apiPrefix,
165
167
  fallbackFetcher: (ids) => {
166
168
  var _bookingTicket$getPro4, _bookingTicket$getPro5;
167
169
  return (_bookingTicket$getPro4 = (_bookingTicket$getPro5 = bookingTicket.getProductByIds) === null || _bookingTicket$getPro5 === void 0 ? void 0 : _bookingTicket$getPro5.call(bookingTicket, ids)) !== null && _bookingTicket$getPro4 !== void 0 ? _bookingTicket$getPro4 : Promise.resolve([]);
@@ -402,4 +402,4 @@ function createAddProductWithFlowDebounced(deps) {
402
402
  };
403
403
  }
404
404
  //#endregion
405
- export { createAddProductWithFlowDebounced, shouldBypassAddProductDebounce };
405
+ export { createAddProductWithFlowDebounced };
@@ -31,4 +31,4 @@ function subscribeBookingDateChange(bookingTicket, callback) {
31
31
  return typeof off === "function" ? off : () => {};
32
32
  }
33
33
  //#endregion
34
- export { BOOKING_CONTEXT_DATE_EVENT, formatBookingDateTime, subscribeBookingDateChange };
34
+ export { formatBookingDateTime, subscribeBookingDateChange };
@@ -102,4 +102,4 @@ function buildHolderListRequestKey(params) {
102
102
  });
103
103
  }
104
104
  //#endregion
105
- export { buildHolderListRequestKey, buildHolderListRequestParams, enrichCartBookingHolderDisplay, enrichCartProductHolderDisplay, pickHolderIdFromBooking, resolveHolderDisplayConfig };
105
+ export { buildHolderListRequestKey, buildHolderListRequestParams, enrichCartBookingHolderDisplay, enrichCartProductHolderDisplay, resolveHolderDisplayConfig };
@@ -6,12 +6,12 @@ import React, { useCallback, useEffect, useMemo, useRef } from "react";
6
6
  import { locales } from "@pisell/utils";
7
7
  import { Button, PisellEmpty, PisellModal, PisellStatisticList, Skeleton, Timeline, usePisellConfig } from "@pisell/materials";
8
8
  import { useRequest } from "ahooks";
9
- import timezonePlugin from "dayjs/plugin/timezone";
10
- import utcPlugin from "dayjs/plugin/utc";
9
+ import timezone from "dayjs/plugin/timezone";
10
+ import utc from "dayjs/plugin/utc";
11
11
  import "./index.less";
12
12
  //#region src/plus/walletPassGallery/components/timelineSection/index.tsx
13
- dayjs.extend(timezonePlugin);
14
- dayjs.extend(utcPlugin);
13
+ dayjs.extend(timezone);
14
+ dayjs.extend(utc);
15
15
  const stateTimeUnix = 1723255863;
16
16
  const POLL_INTERVAL = 2e3;
17
17
  const POLL_MAX_TIMES = 5;
@@ -0,0 +1 @@
1
+ export { };
@@ -14,4 +14,4 @@ interface AuthModalProps {
14
14
  */
15
15
  declare const AuthModal: React.FC<AuthModalProps>;
16
16
  //#endregion
17
- export { AuthModal };
17
+ export { AuthModal, AuthModalProps };
@@ -1,4 +1,4 @@
1
- import { AuthMethodType, EmailAuthConfig, EmailRegistrationVerification, LoginFormData, OAuthConfig, PhoneAuthConfig, RegisterFormData, UIConfig, VerificationMethod } from "./shared/types.js";
1
+ import { AuthMethodType, VerificationMethod } from "./shared/types.js";
2
2
  import { Login2, Login2Config, Login2Events, Login2Props } from "./Login2.js";
3
3
  import { Register2, Register2Config, Register2Events, Register2Props } from "./Register2.js";
4
- import { AuthModal } from "./AuthModal.js";
4
+ 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, EmailRegistrationVerification, LegalTermsConfig, LoginFormData, LoginMethodItem, OAuthConfig, PhoneAuthConfig, RegisterFormData, RegistrationMethodItem, UIConfig, VerificationMethod };
229
+ export { AuthMethodType, EmailAuthConfig, LegalTermsConfig, LoginFormData, LoginMethodItem, OAuthConfig, PhoneAuthConfig, RegisterFormData, RegistrationMethodItem, UIConfig, VerificationMethod };
@@ -15,6 +15,7 @@ const require_utils$1 = require("../../../ticketBooking/components/ProductDispla
15
15
  const require_SalesSdkBusinessAvailabilityContext = require("../../../../plus/salesSdk/context/SalesSdkBusinessAvailabilityContext.js");
16
16
  const require_showAddToCartToast = require("../../../../plus/salesSdk/components/showAddToCartToast.js");
17
17
  const require_mergeBookingsForDisplay = require("../../../../plus/salesSdk/utils/mergeBookingsForDisplay.js");
18
+ const require_useSalesSdkGlobalScanHandler = require("../../../../plus/salesSdk/hooks/useSalesSdkGlobalScanHandler.js");
18
19
  const require_productListPreferences = require("../../utils/productListPreferences.js");
19
20
  const require_useBigSaleProductListConfig = require("../../hooks/useBigSaleProductListConfig.js");
20
21
  const require_index$2 = require("../../locales/index.js");
@@ -146,6 +147,7 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
146
147
  ]);
147
148
  const locale = require_useLocale.default();
148
149
  const businessAvailability = require_SalesSdkBusinessAvailabilityContext.useSalesSdkBusinessAvailability();
150
+ const { handleGlobalScanCode } = require_useSalesSdkGlobalScanHandler.default({ businessCode });
149
151
  const purchaseDisabled = businessAvailability.enabled && (businessAvailability.loading || businessAvailability.status !== "open");
150
152
  const logger = require_useLogger.default();
151
153
  const { sales, products, cart, customer } = context;
@@ -171,6 +173,23 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
171
173
  /** Kiosk 搜索打开时的分类快照,不受 Tabbar 关闭搜索时内部 onChange 影响。 */
172
174
  const kioskSearchCategoryTabRef = (0, react.useRef)(void 0);
173
175
  const [settingsOpen, setSettingsOpen] = (0, react.useState)(false);
176
+ /**
177
+ * 商品分类搜索层打开时,PisellFind 会成为扫码焦点栈顶。
178
+ * 收到商品码后由 List 先关闭该层,再在这里直连既有全局扫码执行器,
179
+ * 使商品进入购物车而不是停留在「按条码文本搜索商品目录」的空结果页。
180
+ */
181
+ const handleTabbarScannerData = (0, ahooks.useMemoizedFn)(function() {
182
+ var _ref3 = require_asyncToGenerator._asyncToGenerator(function* (payload) {
183
+ var _payload$data;
184
+ const code = payload === null || payload === void 0 || (_payload$data = payload.data) === null || _payload$data === void 0 ? void 0 : _payload$data.trim();
185
+ if (!isActive || !code || businessAvailability.isCheckoutStarted()) return;
186
+ if (!(yield businessAvailability.ensureCanShop())) return;
187
+ yield handleGlobalScanCode(code);
188
+ });
189
+ return function(_x) {
190
+ return _ref3.apply(this, arguments);
191
+ };
192
+ }());
174
193
  const preferencesKey = (0, react.useMemo)(() => require_productListPreferences.buildBigSaleProductListPreferencesKey({
175
194
  osKey,
176
195
  mode,
@@ -318,13 +337,13 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
318
337
  * handleSelectProduct(productItem);
319
338
  */
320
339
  const handleSelectProduct = (0, ahooks.useMemoizedFn)(function() {
321
- var _ref5 = require_asyncToGenerator._asyncToGenerator(function* (product) {
322
- var _ref3, _product$id;
340
+ var _ref6 = require_asyncToGenerator._asyncToGenerator(function* (product) {
341
+ var _ref4, _product$id;
323
342
  const handlesKioskToastAfterResult = productCardVersion === "v2" && !usesV2ProductCard;
324
- 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 : "");
343
+ const productId = String((_ref4 = (_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 && _ref4 !== void 0 ? _ref4 : "");
325
344
  const baselineQuantity = phoneCartProductEntries.filter((entry) => resolvePhoneCartProductId(entry.value) === productId).reduce((total, entry) => total + entry.quantity, 0);
326
345
  try {
327
- var _sales$tempOrder4, _logger$addLog, _ref4, _sales$tempOrder$orde, _sales$tempOrder5;
346
+ var _sales$tempOrder4, _logger$addLog, _ref5, _sales$tempOrder$orde, _sales$tempOrder5;
328
347
  if (!(yield businessAvailability.ensureCanShop())) return;
329
348
  if (!sales.isReady) return;
330
349
  if (requiredOrderId !== void 0 && Number((_sales$tempOrder4 = sales.tempOrder) === null || _sales$tempOrder4 === void 0 ? void 0 : _sales$tempOrder4.order_id) !== Number(requiredOrderId)) return;
@@ -336,7 +355,7 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
336
355
  metadata: {
337
356
  product_id: productId,
338
357
  product_title: resolvePhoneProductTitle(product),
339
- order_id: (_ref4 = (_sales$tempOrder$orde = (_sales$tempOrder5 = sales.tempOrder) === null || _sales$tempOrder5 === void 0 ? void 0 : _sales$tempOrder5.order_id) !== null && _sales$tempOrder$orde !== void 0 ? _sales$tempOrder$orde : requiredOrderId) !== null && _ref4 !== void 0 ? _ref4 : null
358
+ order_id: (_ref5 = (_sales$tempOrder$orde = (_sales$tempOrder5 = sales.tempOrder) === null || _sales$tempOrder5 === void 0 ? void 0 : _sales$tempOrder5.order_id) !== null && _sales$tempOrder$orde !== void 0 ? _sales$tempOrder$orde : requiredOrderId) !== null && _ref5 !== void 0 ? _ref5 : null
340
359
  }
341
360
  });
342
361
  const result = yield cart.addProductWithFlow(product, {
@@ -350,8 +369,8 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
350
369
  if (!require_index$1.showVirtualSettlementErrorToast(error, Toast)) console.error(error);
351
370
  }
352
371
  });
353
- return function(_x) {
354
- return _ref5.apply(this, arguments);
372
+ return function(_x2) {
373
+ return _ref6.apply(this, arguments);
355
374
  };
356
375
  }());
357
376
  const phoneCartProductEntries = (0, react.useMemo)(() => {
@@ -365,8 +384,8 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
365
384
  const productUid = resolvePhoneCartLineUid(booking === null || booking === void 0 || (_booking$_extend = booking._extend) === null || _booking$_extend === void 0 ? void 0 : _booking$_extend.product);
366
385
  if (productUid) bookingProductUids.add(productUid);
367
386
  ((booking === null || booking === void 0 || (_booking$_extend2 = booking._extend) === null || _booking$_extend2 === void 0 ? void 0 : _booking$_extend2.mergedFrom) || []).forEach((source) => {
368
- var _ref6, _source$booking$produ, _source$booking, _source$booking2;
369
- 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);
387
+ var _ref7, _source$booking$produ, _source$booking, _source$booking2;
388
+ const sourceUid = (_ref7 = (_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 && _ref7 !== void 0 ? _ref7 : resolvePhoneCartLineUid(source === null || source === void 0 ? void 0 : source.product);
370
389
  if (sourceUid !== void 0 && sourceUid !== null && sourceUid !== "") bookingProductUids.add(String(sourceUid));
371
390
  });
372
391
  });
@@ -380,10 +399,10 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
380
399
  quantity: resolvePhoneCartEntryQuantity(item)
381
400
  }));
382
401
  displayBookings.forEach((booking) => {
383
- var _booking$_extend3, _ref7, _booking$_extend$disp, _booking$_extend4, _product$_extend, _product$product_id;
402
+ var _booking$_extend3, _ref8, _booking$_extend$disp, _booking$_extend4, _product$_extend, _product$product_id;
384
403
  const product = booking === null || booking === void 0 || (_booking$_extend3 = booking._extend) === null || _booking$_extend3 === void 0 ? void 0 : _booking$_extend3.product;
385
404
  if (!product || (product === null || product === void 0 ? void 0 : product._isGiftPromotion)) return;
386
- 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;
405
+ const displayQuantity = (_ref8 = (_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 && _ref8 !== void 0 ? _ref8 : product === null || product === void 0 ? void 0 : product.num;
387
406
  const displayValue = require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, product), {}, {
388
407
  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,
389
408
  num: displayQuantity
@@ -427,9 +446,9 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
427
446
  show();
428
447
  });
429
448
  const addPhoneProductWithToast = (0, ahooks.useMemoizedFn)(function() {
430
- var _ref9 = require_asyncToGenerator._asyncToGenerator(function* (product, quantity, type = "select", delayUntilModalClosed = false) {
431
- var _ref8, _product$id2;
432
- 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 : "");
449
+ var _ref10 = require_asyncToGenerator._asyncToGenerator(function* (product, quantity, type = "select", delayUntilModalClosed = false) {
450
+ var _ref9, _product$id2;
451
+ const productId = String((_ref9 = (_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 && _ref9 !== void 0 ? _ref9 : "");
433
452
  const currentQuantity = phoneCartProductEntries.filter((entry) => resolvePhoneCartProductId(entry.value) === productId).reduce((total, entry) => total + entry.quantity, 0);
434
453
  const result = yield cart.addProductWithFlow(product, {
435
454
  type,
@@ -439,8 +458,8 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
439
458
  if (result.status === "added") showPhoneProductAddedToast(product, resolveAddedProductQuantity(result.products, productId, currentQuantity + quantity), delayUntilModalClosed);
440
459
  return result;
441
460
  });
442
- return function(_x2, _x3) {
443
- return _ref9.apply(this, arguments);
461
+ return function(_x3, _x4) {
462
+ return _ref10.apply(this, arguments);
444
463
  };
445
464
  }());
446
465
  /**
@@ -451,11 +470,11 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
451
470
  * 这样不会为了“判断商品类型”预先渲染抽屉,同时保留异常商品数据的兜底能力。
452
471
  */
453
472
  const addPhoneQuantityProductWithToast = (0, ahooks.useMemoizedFn)(function() {
454
- var _ref11 = require_asyncToGenerator._asyncToGenerator(function* (product, quantity) {
455
- var _ref10, _product$id3;
473
+ var _ref12 = require_asyncToGenerator._asyncToGenerator(function* (product, quantity) {
474
+ var _ref11, _product$id3;
456
475
  if (!(yield businessAvailability.ensureCanShop())) return;
457
476
  if (!require_utils.isNormalProductByDurationSchedule(product)) return addPhoneProductWithToast(product, quantity);
458
- 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 : "");
477
+ const productId = String((_ref11 = (_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 && _ref11 !== void 0 ? _ref11 : "");
459
478
  const result = yield cart.addProduct(product, {
460
479
  type: "select",
461
480
  quantity
@@ -466,12 +485,12 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
466
485
  }
467
486
  return addPhoneProductWithToast(product, quantity);
468
487
  });
469
- return function(_x4, _x5) {
470
- return _ref11.apply(this, arguments);
488
+ return function(_x5, _x6) {
489
+ return _ref12.apply(this, arguments);
471
490
  };
472
491
  }());
473
492
  const handlePhoneProductCardChange = (0, ahooks.useMemoizedFn)(function() {
474
- var _ref12 = require_asyncToGenerator._asyncToGenerator(function* (nextValue, _intent, meta) {
493
+ var _ref13 = require_asyncToGenerator._asyncToGenerator(function* (nextValue, _intent, meta) {
475
494
  var _product$id4;
476
495
  const product = meta === null || meta === void 0 ? void 0 : meta.product;
477
496
  if (!product) return;
@@ -526,8 +545,8 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
526
545
  if (!require_index$1.showVirtualSettlementErrorToast(error, Toast)) console.error(error);
527
546
  }
528
547
  });
529
- return function(_x6, _x7, _x8) {
530
- return _ref12.apply(this, arguments);
548
+ return function(_x7, _x8, _x9) {
549
+ return _ref13.apply(this, arguments);
531
550
  };
532
551
  }());
533
552
  const { data: listData, listProps: configuredListProps, skuCardAllConfig } = productListConfig;
@@ -702,9 +721,9 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
702
721
  setActiveTab([]);
703
722
  });
704
723
  const handleKioskSearchClose = (0, ahooks.useMemoizedFn)(() => {
705
- var _ref13, _kioskSearchCategoryT;
724
+ var _ref14, _kioskSearchCategoryT;
706
725
  cancelPendingCategoryTransition();
707
- const categoryTabBeforeSearch = (_ref13 = (_kioskSearchCategoryT = kioskSearchCategoryTabRef.current) !== null && _kioskSearchCategoryT !== void 0 ? _kioskSearchCategoryT : lastCategoryTabRef.current) !== null && _ref13 !== void 0 ? _ref13 : defaultActiveTab;
726
+ const categoryTabBeforeSearch = (_ref14 = (_kioskSearchCategoryT = kioskSearchCategoryTabRef.current) !== null && _kioskSearchCategoryT !== void 0 ? _kioskSearchCategoryT : lastCategoryTabRef.current) !== null && _ref14 !== void 0 ? _ref14 : defaultActiveTab;
708
727
  kioskSearchCategoryTabRef.current = void 0;
709
728
  lastCategoryTabRef.current = categoryTabBeforeSearch;
710
729
  setKeyword("");
@@ -766,10 +785,10 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
766
785
  * Choose a price 阶段按详情 Quantity 再次校验。
767
786
  */
768
787
  const resolveSettlementPriceRows = (0, ahooks.useMemoizedFn)((item) => {
769
- var _ref14, _ref15, _cart$tempOrder, _sales$bookingTicket3, _sales$bookingTicket4, _ref16, _customer$selected$id, _customer$selected, _tempOrder$customer, _sales$bookingTicket5, _sales$bookingTicket6, _getEngineData, _getEngineData2, _getEngineData3;
788
+ var _ref15, _ref16, _cart$tempOrder, _sales$bookingTicket3, _sales$bookingTicket4, _ref17, _customer$selected$id, _customer$selected, _tempOrder$customer, _sales$bookingTicket5, _sales$bookingTicket6, _getEngineData, _getEngineData2, _getEngineData3;
770
789
  if (!sales.enableMultiCurrencySettlement) return [];
771
- const tempOrder = (_ref14 = (_ref15 = (_cart$tempOrder = cart.tempOrder) !== null && _cart$tempOrder !== void 0 ? _cart$tempOrder : sales.tempOrder) !== null && _ref15 !== void 0 ? _ref15 : (_sales$bookingTicket3 = sales.bookingTicket) === null || _sales$bookingTicket3 === void 0 || (_sales$bookingTicket4 = _sales$bookingTicket3.getTempOrder) === null || _sales$bookingTicket4 === void 0 ? void 0 : _sales$bookingTicket4.call(_sales$bookingTicket3)) !== null && _ref14 !== void 0 ? _ref14 : null;
772
- const customerId = (_ref16 = (_customer$selected$id = (_customer$selected = customer.selected) === null || _customer$selected === void 0 ? void 0 : _customer$selected.id) !== null && _customer$selected$id !== void 0 ? _customer$selected$id : tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.customer_id) !== null && _ref16 !== void 0 ? _ref16 : tempOrder === null || tempOrder === void 0 || (_tempOrder$customer = tempOrder.customer) === null || _tempOrder$customer === void 0 ? void 0 : _tempOrder$customer.id;
790
+ const tempOrder = (_ref15 = (_ref16 = (_cart$tempOrder = cart.tempOrder) !== null && _cart$tempOrder !== void 0 ? _cart$tempOrder : sales.tempOrder) !== null && _ref16 !== void 0 ? _ref16 : (_sales$bookingTicket3 = sales.bookingTicket) === null || _sales$bookingTicket3 === void 0 || (_sales$bookingTicket4 = _sales$bookingTicket3.getTempOrder) === null || _sales$bookingTicket4 === void 0 ? void 0 : _sales$bookingTicket4.call(_sales$bookingTicket3)) !== null && _ref15 !== void 0 ? _ref15 : null;
791
+ const customerId = (_ref17 = (_customer$selected$id = (_customer$selected = customer.selected) === null || _customer$selected === void 0 ? void 0 : _customer$selected.id) !== null && _customer$selected$id !== void 0 ? _customer$selected$id : tempOrder === null || tempOrder === void 0 ? void 0 : tempOrder.customer_id) !== null && _ref17 !== void 0 ? _ref17 : tempOrder === null || tempOrder === void 0 || (_tempOrder$customer = tempOrder.customer) === null || _tempOrder$customer === void 0 ? void 0 : _tempOrder$customer.id;
773
792
  return require_index$1.buildSettlementPriceRows({
774
793
  product: item,
775
794
  assets: ((_sales$bookingTicket5 = sales.bookingTicket) === null || _sales$bookingTicket5 === void 0 || (_sales$bookingTicket6 = _sales$bookingTicket5.getVirtualCurrencyList) === null || _sales$bookingTicket6 === void 0 ? void 0 : _sales$bookingTicket6.call(_sales$bookingTicket5)) || [],
@@ -850,6 +869,7 @@ const BigSaleProductListInner = ({ isActive = true, osKey, productListPreference
850
869
  deferActiveTabChange: usesDeferredCategoryMotion,
851
870
  syncAnchorOnScroll: categoryDisplayMode === "continuous" && (!Array.isArray(activeTab) || activeTab.length > 0),
852
871
  onTabSearch: setKeyword,
872
+ onTabbarScannerData: handleTabbarScannerData,
853
873
  onActiveTabChange: handleActiveTabChange,
854
874
  loading: listShowsLoading
855
875
  }, listProps), {}, {
@@ -88,6 +88,7 @@ const List = (props, ref) => {
88
88
  const containerRef = (0, react.useRef)(null);
89
89
  const tabbarRef = (0, react.useRef)(null);
90
90
  const template1tabbarRef = (0, react.useRef)(null);
91
+ const onTabbarScannerData = props.onTabbarScannerData;
91
92
  const headerRef = (0, react.useRef)(null);
92
93
  const visibleActiveTabRef = (0, react.useRef)(activeTab);
93
94
  visibleActiveTabRef.current = activeTab;
@@ -95,20 +96,23 @@ const List = (props, ref) => {
95
96
  * BigSale 的分类 Tabbar 搜索弹层复用 ComprehensiveSearch 输入栏。
96
97
  * 保持 PisellFind 默认的实时搜索模式:不展示搜索按钮,输入变化仍由 Lookup 内部防抖触发。
97
98
  */
98
- const tabbarSearchProps = (0, react.useMemo)(() => ({
99
- enableScanner: true,
100
- inputRender: (ctx) => /* @__PURE__ */ react.default.createElement(require_index.default, {
101
- ctx,
102
- showSearchButton: false,
103
- searchSectionProps: {
104
- className: "pisell-list-tabbar-search-section",
105
- style: {
106
- flex: 1,
107
- minWidth: 0
108
- }
99
+ const tabbarSearchProps = (0, react.useMemo)(() => require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({ enableScanner: true }, onTabbarScannerData ? { onScannerData: (payload) => {
100
+ var _ref, _ref$closeSearchMode;
101
+ const data = payload === null || payload === void 0 ? void 0 : payload.data;
102
+ if (typeof data !== "string" || data.length === 0) return;
103
+ (_ref = tabbarRef.current || template1tabbarRef.current) === null || _ref === void 0 || (_ref$closeSearchMode = _ref.closeSearchMode) === null || _ref$closeSearchMode === void 0 || _ref$closeSearchMode.call(_ref);
104
+ onTabbarScannerData(payload);
105
+ } } : {}), {}, { inputRender: (ctx) => /* @__PURE__ */ react.default.createElement(require_index.default, {
106
+ ctx,
107
+ showSearchButton: false,
108
+ searchSectionProps: {
109
+ className: "pisell-list-tabbar-search-section",
110
+ style: {
111
+ flex: 1,
112
+ minWidth: 0
109
113
  }
110
- })
111
- }), []);
114
+ }
115
+ }) }), [onTabbarScannerData]);
112
116
  const matchesFieldValue = (fieldValue, targetValue) => {
113
117
  if (Array.isArray(fieldValue)) return fieldValue.includes(targetValue);
114
118
  return fieldValue === targetValue;
@@ -167,6 +167,16 @@ interface ListProps<TItem extends BaseListItem = BaseListItem> {
167
167
  };
168
168
  renderSearch?: () => ReactNode;
169
169
  onTabSearch?: (val: string) => void;
170
+ /**
171
+ * 分类 Tabbar 搜索层收到硬件扫码后的业务接管入口。
172
+ *
173
+ * List 会先关闭搜索层并释放扫码焦点,再调用此回调;适用于扫码应直接
174
+ * 进入商品加购链路、而不是把条码当作目录关键字搜索的销售页。
175
+ */
176
+ onTabbarScannerData?: (payload: {
177
+ code: string;
178
+ data: string;
179
+ }) => void;
170
180
  onActiveTabChange?: (tab: ListTabValue, source?: ListActiveTabChangeSource) => void;
171
181
  }
172
182
  interface TabItem {
@@ -25,9 +25,10 @@ const FALLBACK_RESPONSIVE_INFO = {
25
25
  };
26
26
  const useFallbackResponsive = () => FALLBACK_RESPONSIVE_INFO;
27
27
  const usePromotionModal = (options) => {
28
- var _context$appHelper, _context$appHelper$ge, _responsive$hooks;
28
+ var _context$appHelper, _context$appHelper2, _context$appHelper2$g, _responsive$hooks;
29
29
  const context = require_useEngineContext.default();
30
- const app = context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 || (_context$appHelper$ge = _context$appHelper.getApp) === null || _context$appHelper$ge === void 0 ? void 0 : _context$appHelper$ge.call(_context$appHelper);
30
+ const apiPrefix = (context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.constants) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.apiPrefix) || "/shop";
31
+ const app = context === null || context === void 0 || (_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 || (_context$appHelper2 = _context$appHelper2.utils) === null || _context$appHelper2 === void 0 || (_context$appHelper2$g = _context$appHelper2.getApp) === null || _context$appHelper2$g === void 0 ? void 0 : _context$appHelper2$g.call(_context$appHelper2);
31
32
  const responsive = app === null || app === void 0 ? void 0 : app.responsive;
32
33
  const responsiveInfo = (typeof (responsive === null || responsive === void 0 || (_responsive$hooks = responsive.hooks) === null || _responsive$hooks === void 0 ? void 0 : _responsive$hooks.useResponsive) === "function" ? responsive.hooks.useResponsive : useFallbackResponsive)() || FALLBACK_RESPONSIVE_INFO;
33
34
  const currentVariant = responsiveInfo.currentBreakpoint || responsiveInfo.deviceType || "desktop";
@@ -78,7 +79,10 @@ const usePromotionModal = (options) => {
78
79
  suppressProductSelectSkuOpenRef.current = false;
79
80
  });
80
81
  }, [currentItem, selected]);
81
- const { SkuModal } = require_useSkuModal.useSkuModal({ onConfirm: handleSkuConfirmCallback });
82
+ const { SkuModal } = require_useSkuModal.useSkuModal({
83
+ onConfirm: handleSkuConfirmCallback,
84
+ apiPrefix
85
+ });
82
86
  /**
83
87
  * @description: 获取商品列表请求
84
88
  * @return {*}
@@ -115,11 +119,12 @@ const usePromotionModal = (options) => {
115
119
  getProductsRequest.run({
116
120
  ids: (item === null || item === void 0 || (_item$products2 = item.products) === null || _item$products2 === void 0 ? void 0 : _item$products2.map((option) => option.product_id)) || [],
117
121
  isGift: !!(item === null || item === void 0 ? void 0 : item.isGift),
118
- schedule_date: date
122
+ schedule_date: date,
123
+ apiPrefix
119
124
  });
120
125
  }
121
126
  setOpen(true);
122
- }, [getProductsRequest]);
127
+ }, [getProductsRequest, apiPrefix]);
123
128
  /**
124
129
  * @description: 关闭营销弹窗
125
130
  * @param {*} useCallback
@@ -57,8 +57,11 @@ const useSkuModal = (options) => {
57
57
  setSkuValue((product === null || product === void 0 ? void 0 : product._skuValue) || require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, defaultSkuValue), {}, { product_id: (_ref = (_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 && _ref !== void 0 ? _ref : 0 }));
58
58
  setEditingSku(Boolean(product === null || product === void 0 ? void 0 : product._skuValue));
59
59
  setSkuModalOpen(true);
60
- getProductDetailRequest.run({ id: product === null || product === void 0 ? void 0 : product.id });
61
- }, [getProductDetailRequest]);
60
+ getProductDetailRequest.run({
61
+ id: product === null || product === void 0 ? void 0 : product.id,
62
+ apiPrefix: options === null || options === void 0 ? void 0 : options.apiPrefix
63
+ });
64
+ }, [getProductDetailRequest, options === null || options === void 0 ? void 0 : options.apiPrefix]);
62
65
  /**
63
66
  * @description: 关闭 SKU 选择弹窗
64
67
  */
@@ -4,7 +4,7 @@ const require_index = require("../../utils/index.js");
4
4
  //#region src/components/shoppingCart/server.ts
5
5
  const getProducts = function() {
6
6
  var _ref = require_asyncToGenerator._asyncToGenerator(function* (params) {
7
- const { ids, isGift = false, schedule_date } = params;
7
+ const { ids, isGift = false, schedule_date, apiPrefix = "/shop" } = params;
8
8
  const queryParams = {
9
9
  skip: 1,
10
10
  num: (ids === null || ids === void 0 ? void 0 : ids.length) || 100,
@@ -38,7 +38,7 @@ const getProducts = function() {
38
38
  "variantGroup.variantItem"
39
39
  ]
40
40
  };
41
- let { data } = yield require_index.request.getRequest().post("/shop/product/query", queryParams, {
41
+ let { data } = yield require_index.request.getRequest().post(`${apiPrefix.replace(/\/+$/, "")}/product/query`, queryParams, {
42
42
  fullResult: true,
43
43
  useCache: true
44
44
  });
@@ -86,9 +86,11 @@ const getProducts = function() {
86
86
  }();
87
87
  const getProductDetail = function() {
88
88
  var _ref2 = require_asyncToGenerator._asyncToGenerator(function* (params) {
89
- const { id, is_eject = 1 } = params;
89
+ const { id, is_eject = 1, apiPrefix = "/shop" } = params;
90
+ const prefix = apiPrefix.replace(/\/+$/, "");
91
+ const detailPath = prefix === "/h5" ? "show" : "query";
90
92
  const queryParams = { is_eject };
91
- let { data } = yield require_index.request.getRequest().get(`/shop/product/query/${id}`, queryParams, {
93
+ let { data } = yield require_index.request.getRequest().get(`${prefix}/product/${detailPath}/${id}`, queryParams, {
92
94
  fullResult: true,
93
95
  useCache: true
94
96
  });