@pisell/private-materials 6.12.175 → 6.12.177
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/preview.css +1 -1
- package/build/lowcode/preview.js +1 -1
- package/build/lowcode/render/default/view.js +21 -21
- package/build/lowcode/view.js +21 -21
- package/es/components/appointmentBooking/deposit/index.d.ts +2 -1
- package/es/components/appointmentBooking/index.d.ts +2 -1
- package/es/components/bigSale/components/BookingFloatingPanel/useBookingPanelController.js +0 -1
- 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 -1
- package/es/components/bigSale/templates/Kiosk/index.js +104 -48
- package/es/components/booking/deposit/index.d.ts +3 -1
- package/es/components/booking/info/addServiceVariant/index.d.ts +3 -1
- package/es/components/booking/info/index.d.ts +2 -1
- package/es/components/booking/materiels/contacts/index.d.ts +2 -1
- package/es/components/booking/materiels/duration/index.d.ts +2 -1
- package/es/components/booking/materiels/startTime/index.d.ts +2 -1
- package/es/components/ecocup/cupList/index.d.ts +2 -1
- package/es/components/ecocup/customerList/index.d.ts +2 -2
- package/es/components/eftpos/index.d.ts +2 -1
- package/es/components/eftposPay/index.d.ts +2 -1
- package/es/components/eventBooking/index.d.ts +2 -1
- package/es/components/kioskSale/index.d.ts +2 -2
- package/es/components/kioskSale/index.js +1 -1
- package/es/components/kioskSkuDetail/index.d.ts +1 -1
- package/es/components/login/index.d.ts +2 -1
- package/es/components/pisellSelectCustomerModal/index.d.ts +2 -1
- package/es/components/productExtension/index.d.ts +2 -1
- package/es/components/ruleSetting/index.d.ts +2 -1
- package/es/components/scanOrder/index.d.ts +2 -2
- package/es/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.js +0 -1
- package/es/components/sharedSecondaryBigSale/index.d.ts +2 -2
- package/es/components/shoppingCart/index.d.ts +2 -1
- package/es/components/subTotal/index.d.ts +1 -1
- package/es/components/taxSelect/index.d.ts +2 -1
- package/es/components/ticketBooking/index.d.ts +1 -1
- package/es/components/venueBooking/index.d.ts +2 -2
- package/es/components/walletList/index.d.ts +2 -1
- package/es/index.js +0 -2
- package/es/plus/orderList/index.d.ts +1 -1
- package/es/plus/pisellProResourcePickerModal/PisellFloorMapPaletteViewAllModal.d.ts +1 -1
- package/es/plus/pisellProResourcePickerModal/PisellProResourcePickerModal.d.ts +2 -2
- package/es/plus/pisellReservation/components/SelectFloorMapResourceDialog.d.ts +1 -1
- package/es/plus/pisellReservation/data/bookingToReservationTables.js +1 -1
- package/es/plus/pisellReservation/floorMap/floorPlanApi.js +1 -1
- package/es/plus/pisellReservation/floorMap/reservationMock.js +1 -1
- package/es/plus/pisellReservation/floorRoomCard/FloorRoomCardFromData.d.ts +1 -1
- package/es/plus/pisellReservation/floorRoomCard/ReservationFloorRoomCard.d.ts +1 -1
- package/es/plus/pisellReservation/floorRoomCard/mapFloorRoomCardViewProps.d.ts +1 -0
- package/es/plus/pisellReservation/floorRoomCard/views/RoomCardHeaderView.d.ts +1 -0
- package/es/plus/pisellSalesManagement/index.d.ts +1 -1
- package/es/plus/pisellTopology/PisellTopology.d.ts +2 -2
- package/es/plus/pisellTopology/TopologyDeviceCard.d.ts +1 -1
- package/es/plus/productSelect/ProductCard/SkuCard/index.d.ts +7 -5
- package/es/plus/saasCreateOrganization/index.d.ts +2 -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/PromotionWalletPanels/index.d.ts +1 -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/bookingEditService/BookingEditHolderField.js +6 -6
- package/es/plus/salesSdk/components/SalesSdkConfirmHolderModal.js +2 -4
- package/es/plus/salesSdk/context/SalesSdkCartContext.js +28 -21
- package/es/plus/salesSdk/context/SalesSdkHolderContext.js +104 -22
- package/es/plus/salesSdk/context/SalesSdkProvider.js +3 -12
- package/es/plus/salesSdk/hosts/ConfirmHolderHostRenderer.js +14 -5
- package/es/plus/salesSdk/normalProductDetail/NormalProductDetailHostRenderer.js +5 -2
- package/es/plus/salesSdk/types.d.ts +16 -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 +2 -5
- package/es/plus/salesSdk/utils/enrichCacheItemBeforeAdd.js +1 -1
- package/es/plus/salesSdk/utils/enrichCartLineHolderDisplay.js +1 -1
- package/es/plus/salesSdk/utils/ensureCustomerAuthBeforeAdd.js +6 -6
- package/es/plus/salesSdk/utils/holderSubmitValidation.js +3 -4
- package/es/plus/salesSdk/utils/productHolderConfig.js +3 -17
- package/es/plus/salesSdk/utils/runAddProductFlow.js +14 -5
- package/es/plus/walletPassGallery/components/passDetail/index.d.ts +2 -1
- package/es/plus/walletPassGallery/index.d.ts +2 -1
- package/es/private-materials/lowcode/authmodal/meta.d.ts +1 -0
- package/es/pro/Login2.0/AuthModal.d.ts +1 -1
- package/es/pro/Login2.0/index.d.ts +1 -2
- package/es/pro/Login2.0/shared/types.d.ts +1 -1
- package/es/pro/Selector/Item.d.ts +1 -1
- package/es/pro/numberKeyboard/index.d.ts +1 -1
- package/es/pro/pisellPhoneKeyboard/index.d.ts +2 -1
- package/es/pro/skuDetailModal/components/weighing/index.d.ts +2 -1
- package/es/pro/skuDetailModal/flow/modules/holder/index.js +4 -1
- package/lib/components/appointmentBooking/deposit/index.d.ts +2 -2
- package/lib/components/appointmentBooking/index.d.ts +2 -2
- package/lib/components/bigSale/index.js +1 -0
- package/lib/components/bigSale/templates/Kiosk/index.js +104 -47
- package/lib/components/booking/deposit/index.d.ts +3 -2
- package/lib/components/booking/info/addServiceVariant/index.d.ts +3 -2
- package/lib/components/booking/info/index.d.ts +2 -2
- package/lib/components/booking/materiels/contacts/index.d.ts +2 -2
- package/lib/components/booking/materiels/duration/index.d.ts +2 -2
- package/lib/components/booking/materiels/startTime/index.d.ts +2 -2
- package/lib/components/ecocup/cupList/index.d.ts +2 -2
- package/lib/components/ecocup/customerList/index.d.ts +2 -2
- package/lib/components/eftpos/index.d.ts +2 -2
- package/lib/components/eftposPay/index.d.ts +2 -2
- package/lib/components/eventBooking/index.d.ts +2 -2
- package/lib/components/kioskSale/index.d.ts +2 -2
- package/lib/components/kioskSale/index.js +1 -1
- package/lib/components/kioskSkuDetail/index.d.ts +1 -1
- package/lib/components/login/index.d.ts +2 -2
- package/lib/components/pisellSelectCustomerModal/index.d.ts +2 -2
- package/lib/components/productExtension/index.d.ts +2 -2
- package/lib/components/ruleSetting/index.d.ts +2 -2
- package/lib/components/scanOrder/index.d.ts +2 -2
- package/lib/components/sharedSecondaryBigSale/index.d.ts +2 -2
- package/lib/components/shoppingCart/index.d.ts +2 -2
- package/lib/components/subTotal/index.d.ts +1 -1
- package/lib/components/taxSelect/index.d.ts +2 -2
- package/lib/components/ticketBooking/index.d.ts +1 -1
- package/lib/components/venueBooking/index.d.ts +2 -2
- package/lib/components/walletList/index.d.ts +2 -2
- package/lib/plus/orderList/index.d.ts +1 -1
- package/lib/plus/pisellProResourcePickerModal/PisellFloorMapPaletteViewAllModal.d.ts +1 -1
- package/lib/plus/pisellProResourcePickerModal/PisellProResourcePickerModal.d.ts +2 -2
- package/lib/plus/pisellReservation/components/SelectFloorMapResourceDialog.d.ts +1 -1
- package/lib/plus/pisellReservation/floorRoomCard/FloorRoomCardFromData.d.ts +1 -1
- package/lib/plus/pisellReservation/floorRoomCard/ReservationFloorRoomCard.d.ts +1 -1
- package/lib/plus/pisellReservation/floorRoomCard/mapFloorRoomCardViewProps.d.ts +1 -0
- package/lib/plus/pisellReservation/floorRoomCard/views/RoomCardHeaderView.d.ts +1 -0
- package/lib/plus/pisellSalesManagement/index.d.ts +1 -1
- package/lib/plus/pisellTopology/PisellTopology.d.ts +2 -2
- package/lib/plus/pisellTopology/TopologyDeviceCard.d.ts +1 -1
- package/lib/plus/productSelect/ProductCard/SkuCard/index.d.ts +7 -6
- package/lib/plus/saasCreateOrganization/index.d.ts +2 -2
- package/lib/plus/saleDetail/components/PromotionWalletPanels/index.d.ts +1 -1
- package/lib/plus/salesSdk/bookingEditService/BookingEditHolderField.js +5 -5
- package/lib/plus/salesSdk/components/SalesSdkConfirmHolderModal.js +2 -4
- package/lib/plus/salesSdk/context/SalesSdkCartContext.js +28 -21
- package/lib/plus/salesSdk/context/SalesSdkHolderContext.js +104 -22
- package/lib/plus/salesSdk/context/SalesSdkProvider.js +3 -12
- package/lib/plus/salesSdk/hosts/ConfirmHolderHostRenderer.js +14 -5
- package/lib/plus/salesSdk/normalProductDetail/NormalProductDetailHostRenderer.js +5 -2
- package/lib/plus/salesSdk/types.d.ts +16 -1
- package/lib/plus/salesSdk/utils/customerAuthGate.js +1 -4
- package/lib/plus/salesSdk/utils/enrichCacheItemBeforeAdd.js +1 -1
- package/lib/plus/salesSdk/utils/ensureCustomerAuthBeforeAdd.js +6 -6
- package/lib/plus/salesSdk/utils/holderSubmitValidation.js +3 -4
- package/lib/plus/salesSdk/utils/productHolderConfig.js +3 -17
- package/lib/plus/salesSdk/utils/runAddProductFlow.js +14 -5
- package/lib/plus/walletPassGallery/components/passDetail/index.d.ts +2 -2
- package/lib/plus/walletPassGallery/index.d.ts +2 -2
- package/lib/pro/Selector/Item.d.ts +1 -1
- package/lib/pro/numberKeyboard/index.d.ts +1 -1
- package/lib/pro/pisellPhoneKeyboard/index.d.ts +2 -2
- package/lib/pro/skuDetailModal/components/weighing/index.d.ts +2 -2
- package/lib/pro/skuDetailModal/flow/modules/holder/index.js +4 -1
- package/package.json +4 -4
- package/es/plus/pisellReservation/index.js +0 -17
- package/es/plus/salesSdk/index.js +0 -51
|
@@ -11,6 +11,11 @@ import { buildHolderListRequestKey, buildHolderListRequestParams, resolveHolderD
|
|
|
11
11
|
import React, { createContext, useContext, useEffect, useMemo, useRef, useState } from "react";
|
|
12
12
|
import { useMemoizedFn } from "ahooks";
|
|
13
13
|
//#region src/plus/salesSdk/context/SalesSdkHolderContext.tsx
|
|
14
|
+
const HOLDER_ACCESS_ALLOWED = {
|
|
15
|
+
allowed: true,
|
|
16
|
+
loginOpened: false,
|
|
17
|
+
loginClosed: false
|
|
18
|
+
};
|
|
14
19
|
const SalesSdkHolderContext = createContext(null);
|
|
15
20
|
SalesSdkHolderContext.displayName = "SalesSdkHolderContext";
|
|
16
21
|
const EMPTY_HOLDER_OPTIONS = [];
|
|
@@ -108,31 +113,49 @@ const SalesSdkHolderProvider = ({ children }) => {
|
|
|
108
113
|
}
|
|
109
114
|
return true;
|
|
110
115
|
}));
|
|
111
|
-
const ensureHolderRequestAccess = useMemoizedFn(() => {
|
|
116
|
+
const ensureHolderRequestAccess = useMemoizedFn((options) => {
|
|
112
117
|
const normalizedPlatform = String(platform || "").trim().toLowerCase();
|
|
113
|
-
if (normalizedPlatform !== "pc" && normalizedPlatform !== "h5") return Promise.resolve(
|
|
118
|
+
if (normalizedPlatform !== "pc" && normalizedPlatform !== "h5") return Promise.resolve(HOLDER_ACCESS_ALLOWED);
|
|
114
119
|
const currentCustomerId = resolveHolderCustomerId(bookingTicket);
|
|
115
120
|
const loggedIn = isLoggedIn();
|
|
116
|
-
if (
|
|
121
|
+
if (!isUnboundHolderCustomerId(currentCustomerId) && (loggedIn || (options === null || options === void 0 ? void 0 : options.allowBoundCustomerAccess) === true)) return Promise.resolve(HOLDER_ACCESS_ALLOWED);
|
|
117
122
|
if (holderAccessPromiseRef.current) return holderAccessPromiseRef.current;
|
|
118
|
-
const accessPromise = loggedIn ? syncAuthenticatedHolderCustomer()
|
|
123
|
+
const accessPromise = loggedIn ? syncAuthenticatedHolderCustomer().then((allowed) => ({
|
|
124
|
+
allowed,
|
|
125
|
+
loginOpened: false,
|
|
126
|
+
loginClosed: false
|
|
127
|
+
})) : new Promise((resolve) => {
|
|
119
128
|
let settled = false;
|
|
120
|
-
const finish = (
|
|
129
|
+
const finish = (result) => {
|
|
121
130
|
if (settled) return;
|
|
122
131
|
settled = true;
|
|
123
|
-
resolve(
|
|
132
|
+
resolve(result);
|
|
124
133
|
};
|
|
125
134
|
if (!openLoginModal({ callback: (status) => {
|
|
126
135
|
if (settled) return;
|
|
127
136
|
if (status !== "success") {
|
|
128
|
-
finish(
|
|
137
|
+
finish({
|
|
138
|
+
allowed: false,
|
|
139
|
+
loginOpened: true,
|
|
140
|
+
loginClosed: true
|
|
141
|
+
});
|
|
129
142
|
return;
|
|
130
143
|
}
|
|
131
144
|
settled = true;
|
|
132
|
-
syncAuthenticatedHolderCustomer().then(
|
|
145
|
+
syncAuthenticatedHolderCustomer().then((allowed) => {
|
|
146
|
+
resolve({
|
|
147
|
+
allowed,
|
|
148
|
+
loginOpened: true,
|
|
149
|
+
loginClosed: false
|
|
150
|
+
});
|
|
151
|
+
});
|
|
133
152
|
} })) {
|
|
134
153
|
console.warn("[SalesSdk] holder request blocked: login modal is unavailable");
|
|
135
|
-
finish(
|
|
154
|
+
finish({
|
|
155
|
+
allowed: false,
|
|
156
|
+
loginOpened: false,
|
|
157
|
+
loginClosed: false
|
|
158
|
+
});
|
|
136
159
|
}
|
|
137
160
|
});
|
|
138
161
|
holderAccessPromiseRef.current = accessPromise;
|
|
@@ -184,14 +207,30 @@ const SalesSdkHolderProvider = ({ children }) => {
|
|
|
184
207
|
}, {});
|
|
185
208
|
});
|
|
186
209
|
});
|
|
187
|
-
const
|
|
188
|
-
var _ref = _asyncToGenerator(function* (source) {
|
|
210
|
+
const prepareHolderOptionsForSource = useMemoizedFn(function() {
|
|
211
|
+
var _ref = _asyncToGenerator(function* (source, options) {
|
|
189
212
|
const holderConfig = resolveEffectiveHolderConfig(source, bookingConfig);
|
|
190
|
-
if (!holderConfig.enabled || holderConfig.formId === void 0) return
|
|
191
|
-
|
|
213
|
+
if (!holderConfig.enabled || holderConfig.formId === void 0) return {
|
|
214
|
+
options: EMPTY_HOLDER_OPTIONS,
|
|
215
|
+
accessAllowed: true,
|
|
216
|
+
loginOpened: false,
|
|
217
|
+
loginClosed: false
|
|
218
|
+
};
|
|
219
|
+
const access = yield ensureHolderRequestAccess(options);
|
|
220
|
+
if (!access.allowed) return {
|
|
221
|
+
options: EMPTY_HOLDER_OPTIONS,
|
|
222
|
+
accessAllowed: false,
|
|
223
|
+
loginOpened: access.loginOpened,
|
|
224
|
+
loginClosed: access.loginClosed
|
|
225
|
+
};
|
|
192
226
|
const params = resolveRequestParams(source);
|
|
193
227
|
const requestKey = buildHolderListRequestKey(params);
|
|
194
|
-
if (!params || !requestKey) return
|
|
228
|
+
if (!params || !requestKey) return {
|
|
229
|
+
options: EMPTY_HOLDER_OPTIONS,
|
|
230
|
+
accessAllowed: true,
|
|
231
|
+
loginOpened: access.loginOpened,
|
|
232
|
+
loginClosed: access.loginClosed
|
|
233
|
+
};
|
|
195
234
|
const cached = mergeHolderOptionsStable(optimisticHolderOptionsByKey[requestKey] || EMPTY_HOLDER_OPTIONS, serverHolderOptionsByKey[requestKey] || EMPTY_HOLDER_OPTIONS);
|
|
196
235
|
if (cached.length) {
|
|
197
236
|
setHolderOptionsRequestKey(requestKey);
|
|
@@ -208,9 +247,19 @@ const SalesSdkHolderProvider = ({ children }) => {
|
|
|
208
247
|
setLoading(loadingKeysRef.current.size > 0);
|
|
209
248
|
});
|
|
210
249
|
}
|
|
211
|
-
return
|
|
250
|
+
return {
|
|
251
|
+
options: cached,
|
|
252
|
+
accessAllowed: true,
|
|
253
|
+
loginOpened: access.loginOpened,
|
|
254
|
+
loginClosed: access.loginClosed
|
|
255
|
+
};
|
|
212
256
|
}
|
|
213
|
-
if (loadingKeysRef.current.has(requestKey)) return
|
|
257
|
+
if (loadingKeysRef.current.has(requestKey)) return {
|
|
258
|
+
options: cached,
|
|
259
|
+
accessAllowed: true,
|
|
260
|
+
loginOpened: access.loginOpened,
|
|
261
|
+
loginClosed: access.loginClosed
|
|
262
|
+
};
|
|
214
263
|
loadingKeysRef.current.add(requestKey);
|
|
215
264
|
setLoading(true);
|
|
216
265
|
try {
|
|
@@ -218,20 +267,38 @@ const SalesSdkHolderProvider = ({ children }) => {
|
|
|
218
267
|
const fromServer = formatHolderOptions(Array.isArray(data === null || data === void 0 ? void 0 : data.list) ? data.list : []);
|
|
219
268
|
setServerHolderOptionsByKey((prev) => _objectSpread2(_objectSpread2({}, prev), {}, { [requestKey]: fromServer }));
|
|
220
269
|
setHolderOptionsRequestKey(requestKey);
|
|
221
|
-
return
|
|
270
|
+
return {
|
|
271
|
+
options: mergeHolderOptionsStable(optimisticHolderOptionsByKey[requestKey] || EMPTY_HOLDER_OPTIONS, fromServer),
|
|
272
|
+
accessAllowed: true,
|
|
273
|
+
loginOpened: access.loginOpened,
|
|
274
|
+
loginClosed: access.loginClosed
|
|
275
|
+
};
|
|
222
276
|
} catch (err) {
|
|
223
277
|
console.warn("[SalesSdk] load holderOptions failed", err);
|
|
224
278
|
setHolderOptionsRequestKey(null);
|
|
225
|
-
return
|
|
279
|
+
return {
|
|
280
|
+
options: EMPTY_HOLDER_OPTIONS,
|
|
281
|
+
accessAllowed: true,
|
|
282
|
+
loginOpened: access.loginOpened,
|
|
283
|
+
loginClosed: access.loginClosed
|
|
284
|
+
};
|
|
226
285
|
} finally {
|
|
227
286
|
loadingKeysRef.current.delete(requestKey);
|
|
228
287
|
setLoading(loadingKeysRef.current.size > 0);
|
|
229
288
|
}
|
|
230
289
|
});
|
|
231
|
-
return function(_x) {
|
|
290
|
+
return function(_x, _x2) {
|
|
232
291
|
return _ref.apply(this, arguments);
|
|
233
292
|
};
|
|
234
293
|
}());
|
|
294
|
+
const ensureHolderOptionsForSource = useMemoizedFn(function() {
|
|
295
|
+
var _ref2 = _asyncToGenerator(function* (source) {
|
|
296
|
+
return (yield prepareHolderOptionsForSource(source)).options;
|
|
297
|
+
});
|
|
298
|
+
return function(_x3) {
|
|
299
|
+
return _ref2.apply(this, arguments);
|
|
300
|
+
};
|
|
301
|
+
}());
|
|
235
302
|
useEffect(() => {
|
|
236
303
|
return registerHolderOptionsSyncBridge({
|
|
237
304
|
upsertHolderOptions,
|
|
@@ -249,7 +316,7 @@ const SalesSdkHolderProvider = ({ children }) => {
|
|
|
249
316
|
let cancelled = false;
|
|
250
317
|
collectHolderSources(bookingTicket, bookingConfig).forEach((source) => {
|
|
251
318
|
_asyncToGenerator(function* () {
|
|
252
|
-
if (!(yield ensureHolderRequestAccess()) || cancelled) return;
|
|
319
|
+
if (!(yield ensureHolderRequestAccess()).allowed || cancelled) return;
|
|
253
320
|
const params = resolveRequestParams(source);
|
|
254
321
|
const requestKey = buildHolderListRequestKey(params);
|
|
255
322
|
if (!params || !requestKey) return;
|
|
@@ -305,6 +372,7 @@ const SalesSdkHolderProvider = ({ children }) => {
|
|
|
305
372
|
getHolderOptionsForSource,
|
|
306
373
|
getHolderOptionsRequestKeyForSource,
|
|
307
374
|
ensureHolderOptionsForSource,
|
|
375
|
+
prepareHolderOptionsForSource,
|
|
308
376
|
reload,
|
|
309
377
|
upsertHolderOptions
|
|
310
378
|
}), [
|
|
@@ -315,6 +383,7 @@ const SalesSdkHolderProvider = ({ children }) => {
|
|
|
315
383
|
getHolderOptionsForSource,
|
|
316
384
|
getHolderOptionsRequestKeyForSource,
|
|
317
385
|
ensureHolderOptionsForSource,
|
|
386
|
+
prepareHolderOptionsForSource,
|
|
318
387
|
reload,
|
|
319
388
|
upsertHolderOptions
|
|
320
389
|
]);
|
|
@@ -333,11 +402,24 @@ function useSalesSdkHolderOptional() {
|
|
|
333
402
|
getHolderOptionsForSource: () => EMPTY_HOLDER_OPTIONS,
|
|
334
403
|
getHolderOptionsRequestKeyForSource: () => null,
|
|
335
404
|
ensureHolderOptionsForSource: function() {
|
|
336
|
-
var
|
|
405
|
+
var _ref3 = _asyncToGenerator(function* () {
|
|
337
406
|
return EMPTY_HOLDER_OPTIONS;
|
|
338
407
|
});
|
|
339
408
|
return function ensureHolderOptionsForSource() {
|
|
340
|
-
return
|
|
409
|
+
return _ref3.apply(this, arguments);
|
|
410
|
+
};
|
|
411
|
+
}(),
|
|
412
|
+
prepareHolderOptionsForSource: function() {
|
|
413
|
+
var _ref4 = _asyncToGenerator(function* () {
|
|
414
|
+
return {
|
|
415
|
+
options: EMPTY_HOLDER_OPTIONS,
|
|
416
|
+
accessAllowed: true,
|
|
417
|
+
loginOpened: false,
|
|
418
|
+
loginClosed: false
|
|
419
|
+
};
|
|
420
|
+
});
|
|
421
|
+
return function prepareHolderOptionsForSource() {
|
|
422
|
+
return _ref4.apply(this, arguments);
|
|
341
423
|
};
|
|
342
424
|
}(),
|
|
343
425
|
reload: () => void 0,
|
|
@@ -219,7 +219,7 @@ function SalesSdkBootstrap({ autoRestoreOnInit, autoBootstrap, autoInitBookingCo
|
|
|
219
219
|
]);
|
|
220
220
|
return null;
|
|
221
221
|
}
|
|
222
|
-
const SalesSdkProvider = ({ osKey, solution = "bookingTicket", moduleAccess = "ensure", lifecycleOwner = "provider", businessCode, bookingConfigParams, autoInitBookingContext = true, otherParams, shouldMergeProductLines, rulesHooks, orderId, preloadedSalesDetail, autoBootstrap = true, autoRestoreOnInit = true, restoreOrderAfterPaidCheckout = true, destroyOnUnmount = true, uiHosts, normalProductDetailConfig, mergeBookingLinesForDisplay = true, legacyOpenProductDetail, enableTempOrderSync = false, enableTempOrderPersist = false, syncDetailOnOrderChange = false, isActive = true, preserveProductCatalogOnInactiveCustomerClear = false, enableGlobalScanListener = false, promotionScanSuccessMessageKey, promotionItemIncreaseMessageKey, defaultProductLoadParams, children }) => {
|
|
222
|
+
const SalesSdkProvider = ({ osKey, solution = "bookingTicket", moduleAccess = "ensure", lifecycleOwner = "provider", businessCode, bookingConfigParams, autoInitBookingContext = true, otherParams, deferHolderAuthOnClose = false, shouldMergeProductLines, rulesHooks, orderId, preloadedSalesDetail, autoBootstrap = true, autoRestoreOnInit = true, restoreOrderAfterPaidCheckout = true, destroyOnUnmount = true, uiHosts, normalProductDetailConfig, mergeBookingLinesForDisplay = true, legacyOpenProductDetail, enableTempOrderSync = false, enableTempOrderPersist = false, syncDetailOnOrderChange = false, isActive = true, preserveProductCatalogOnInactiveCustomerClear = false, enableGlobalScanListener = false, promotionScanSuccessMessageKey, promotionItemIncreaseMessageKey, defaultProductLoadParams, children }) => {
|
|
223
223
|
var _context$appHelper, _osKey$replace;
|
|
224
224
|
const context = useEngineContext();
|
|
225
225
|
const utils = (context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {};
|
|
@@ -231,17 +231,7 @@ const SalesSdkProvider = ({ osKey, solution = "bookingTicket", moduleAccess = "e
|
|
|
231
231
|
engineChannel: channel,
|
|
232
232
|
platform: otherParams === null || otherParams === void 0 ? void 0 : otherParams.platform
|
|
233
233
|
});
|
|
234
|
-
const shouldEnableCustomerAuthModule =
|
|
235
|
-
otherParams === null || otherParams === void 0 ? void 0 : otherParams.platform,
|
|
236
|
-
otherParams === null || otherParams === void 0 ? void 0 : otherParams.channel,
|
|
237
|
-
channel,
|
|
238
|
-
productLoadChannel
|
|
239
|
-
].some((value) => String(value || "").trim().toLowerCase() === "kiosk"), [
|
|
240
|
-
channel,
|
|
241
|
-
otherParams === null || otherParams === void 0 ? void 0 : otherParams.channel,
|
|
242
|
-
otherParams === null || otherParams === void 0 ? void 0 : otherParams.platform,
|
|
243
|
-
productLoadChannel
|
|
244
|
-
]);
|
|
234
|
+
const shouldEnableCustomerAuthModule = deferHolderAuthOnClose;
|
|
245
235
|
const [promotionScanItemIncreaseRevision, setPromotionScanItemIncreaseRevision] = useState(0);
|
|
246
236
|
/** 加车 enrich 早于 BookingEdit 抽屉,须提前注入 HTTP 客户端供跨日报价等 serve 使用 */
|
|
247
237
|
useEffect(() => {
|
|
@@ -1335,6 +1325,7 @@ const SalesSdkProvider = ({ osKey, solution = "bookingTicket", moduleAccess = "e
|
|
|
1335
1325
|
isActive,
|
|
1336
1326
|
preserveCatalogOnInactiveCustomerClear: preserveProductCatalogOnInactiveCustomerClear
|
|
1337
1327
|
}, /* @__PURE__ */ React.createElement(SalesSdkSummaryProvider, { ref: summaryProviderRef }, /* @__PURE__ */ React.createElement(SalesSdkCartProvider, {
|
|
1328
|
+
deferHolderAuthOnClose,
|
|
1338
1329
|
shouldMergeProductLines,
|
|
1339
1330
|
mergeBookingLinesForDisplay
|
|
1340
1331
|
}, /* @__PURE__ */ React.createElement(SalesSdkGlobalScanSubscriber, {
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { _asyncToGenerator } from "../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
|
|
2
2
|
import { useSalesSdkHostBridges } from "../context/SalesSdkHostBridgesContext.js";
|
|
3
|
+
import { isProductHolderRequired } from "../utils/productHolderConfig.js";
|
|
3
4
|
import { useSalesSdkHolderOptional } from "../context/SalesSdkHolderContext.js";
|
|
4
5
|
import { useSalesSdkUIHosts } from "../context/SalesSdkUIHostsContext.js";
|
|
5
6
|
import { assignHolderToCartLineWithFeedback } from "../utils/assignHolderToCartLine.js";
|
|
@@ -28,14 +29,16 @@ const ConfirmHolderHostRenderer = () => {
|
|
|
28
29
|
const ctx = pending === null || pending === void 0 ? void 0 : pending.ctx;
|
|
29
30
|
const open = Boolean((pending === null || pending === void 0 ? void 0 : pending.open) && ctx);
|
|
30
31
|
const snapshotLineKeys = (_ctx$snapshotLineKeys = ctx === null || ctx === void 0 ? void 0 : ctx.snapshotLineKeys) !== null && _ctx$snapshotLineKeys !== void 0 ? _ctx$snapshotLineKeys : [];
|
|
31
|
-
const
|
|
32
|
-
if (!open || !bookingTicket) return
|
|
33
|
-
return
|
|
32
|
+
const liveUnassignedLines = useMemo(() => {
|
|
33
|
+
if (!open || !bookingTicket) return [];
|
|
34
|
+
return collectUnassignedHolderLines(bookingTicket);
|
|
34
35
|
}, [
|
|
35
36
|
bookingTicket,
|
|
36
37
|
open,
|
|
37
38
|
refreshKey
|
|
38
39
|
]);
|
|
40
|
+
const liveUnassignedCount = useMemo(() => calculateUnassignedHolderCount(liveUnassignedLines), [liveUnassignedLines]);
|
|
41
|
+
const canSkip = liveUnassignedLines.length > 0 && !liveUnassignedLines.some((line) => isProductHolderRequired(line.cacheItem));
|
|
39
42
|
const lines = useMemo(() => {
|
|
40
43
|
if (!open || !bookingTicket || !snapshotLineKeys.length) return [];
|
|
41
44
|
return buildHolderConfirmDisplayLines({
|
|
@@ -85,8 +88,14 @@ const ConfirmHolderHostRenderer = () => {
|
|
|
85
88
|
holderConfirm.complete();
|
|
86
89
|
}, [holderConfirm, liveUnassignedCount]);
|
|
87
90
|
const handleSkip = useCallback(() => {
|
|
91
|
+
if (!canSkip) {
|
|
92
|
+
PisellToast({ content: locales.getText("pisell2.text.press-card-assign-holder") });
|
|
93
|
+
setRefreshKey((key) => key + 1);
|
|
94
|
+
holderConfirm.refresh();
|
|
95
|
+
return;
|
|
96
|
+
}
|
|
88
97
|
holderConfirm.complete();
|
|
89
|
-
}, [holderConfirm]);
|
|
98
|
+
}, [canSkip, holderConfirm]);
|
|
90
99
|
const handleDismissConfirmed = useCallback(() => {
|
|
91
100
|
holderConfirm.cancel();
|
|
92
101
|
}, [holderConfirm]);
|
|
@@ -95,7 +104,7 @@ const ConfirmHolderHostRenderer = () => {
|
|
|
95
104
|
open,
|
|
96
105
|
lines,
|
|
97
106
|
liveUnassignedCount,
|
|
98
|
-
|
|
107
|
+
canSkip,
|
|
99
108
|
onAssign: handleAssign,
|
|
100
109
|
onConfirm: handleConfirm,
|
|
101
110
|
onSkip: handleSkip,
|
|
@@ -217,6 +217,7 @@ const NormalProductDetailHostRenderer = ({ defaultSkuDetailConfig }) => {
|
|
|
217
217
|
var _ref17 = _asyncToGenerator(function* () {
|
|
218
218
|
var _bookingTicket$getBoo3, _bookingTicket$getBoo4;
|
|
219
219
|
const payload = capturedPending.payload;
|
|
220
|
+
const deferHolderUntilSubmit = payload.mode === "create" ? payload.requiresDetailPayload.deferHolderUntilSubmit === true : payload.mode === "booking-create" ? payload.requiresBookingEditPayload.deferHolderUntilSubmit === true : false;
|
|
220
221
|
let openArgs;
|
|
221
222
|
let bookingConfig = (_bookingTicket$getBoo3 = bookingTicket === null || bookingTicket === void 0 || (_bookingTicket$getBoo4 = bookingTicket.getBookingConfig) === null || _bookingTicket$getBoo4 === void 0 ? void 0 : _bookingTicket$getBoo4.call(bookingTicket)) !== null && _bookingTicket$getBoo3 !== void 0 ? _bookingTicket$getBoo3 : null;
|
|
222
223
|
let bookingState = null;
|
|
@@ -333,7 +334,8 @@ const NormalProductDetailHostRenderer = ({ defaultSkuDetailConfig }) => {
|
|
|
333
334
|
const refreshHolderContextFromHydratedProduct = function() {
|
|
334
335
|
var _ref6 = _asyncToGenerator(function* ({ productData }) {
|
|
335
336
|
holderSource = productData;
|
|
336
|
-
|
|
337
|
+
if (deferHolderUntilSubmit) holderOptions = getHolderOptionsForSource(productData);
|
|
338
|
+
else try {
|
|
337
339
|
holderOptions = yield ensureHolderOptionsForSource(productData);
|
|
338
340
|
} catch (error) {
|
|
339
341
|
console.warn("[SalesSdk] 水合后 Holder 字典加载失败,沿用当前分源缓存", error);
|
|
@@ -347,7 +349,7 @@ const NormalProductDetailHostRenderer = ({ defaultSkuDetailConfig }) => {
|
|
|
347
349
|
} catch (error) {
|
|
348
350
|
console.warn("[SalesSdk] 水合后预约配置加载失败,沿用当前 isFranchisee", error);
|
|
349
351
|
}
|
|
350
|
-
if (bookingState) bookingState = _objectSpread2(_objectSpread2({}, bookingState), {}, {
|
|
352
|
+
if (bookingState) bookingState = _objectSpread2(_objectSpread2(_objectSpread2({}, bookingState), deferHolderUntilSubmit ? { deferHolderUntilSubmit: true } : {}), {}, {
|
|
351
353
|
isFranchisee: hydratedIsFranchisee,
|
|
352
354
|
otherParams: hydratedOtherParams,
|
|
353
355
|
pet: _objectSpread2(_objectSpread2({}, bookingState.pet || {}), {}, { holders: holderOptions })
|
|
@@ -568,6 +570,7 @@ const NormalProductDetailHostRenderer = ({ defaultSkuDetailConfig }) => {
|
|
|
568
570
|
};
|
|
569
571
|
}
|
|
570
572
|
if (!isCurrentPending()) return;
|
|
573
|
+
if (bookingState && deferHolderUntilSubmit) bookingState = _objectSpread2(_objectSpread2({}, bookingState), {}, { deferHolderUntilSubmit: true });
|
|
571
574
|
setPreparedOpen({
|
|
572
575
|
pending: capturedPending,
|
|
573
576
|
openArgs,
|
|
@@ -1324,6 +1324,8 @@ interface SalesSdkAddProductRequiresDetailPayload {
|
|
|
1324
1324
|
initialQuantity?: number;
|
|
1325
1325
|
/** @internal 本次详情 Flow 的 Holder 初始选择。 */
|
|
1326
1326
|
initialHolderIds?: Array<number | string>;
|
|
1327
|
+
/** @internal 登录被关闭后,仅把 Holder 必填延后到提交前校验。 */
|
|
1328
|
+
deferHolderUntilSubmit?: boolean;
|
|
1327
1329
|
}
|
|
1328
1330
|
/**
|
|
1329
1331
|
* `requiresBookingEdit` 时 UI 打开资源 / 时间编辑抽屉所需 payload。
|
|
@@ -1334,6 +1336,8 @@ interface SalesSdkRequiresBookingEditPayload {
|
|
|
1334
1336
|
date: string | null;
|
|
1335
1337
|
/** @internal 仅供加车前 Selection Flow 初始化 Holder 草稿。 */
|
|
1336
1338
|
initialHolderIds?: Array<number | string>;
|
|
1339
|
+
/** @internal 登录被关闭后,仅把 Holder 必填延后到提交前校验。 */
|
|
1340
|
+
deferHolderUntilSubmit?: boolean;
|
|
1337
1341
|
/**
|
|
1338
1342
|
* 已加车行「编辑资源」:强制打开抽屉,忽略 cacheItem.autoClose。
|
|
1339
1343
|
* 加车链路(requiresBookingEdit)不传此字段;autoClose=true 时自动 confirm 跳过抽屉。
|
|
@@ -1529,7 +1533,8 @@ interface SalesSdkConfirmDetailInput {
|
|
|
1529
1533
|
quantity?: number;
|
|
1530
1534
|
notShowToast?: boolean; /** Holder 弹窗的初始选中项;最终仍以用户确认结果为准 */
|
|
1531
1535
|
initialHolderIds?: Array<number | string>; /** 跨日弹窗确认后的区间(规格弹窗之后注入) */
|
|
1532
|
-
multiDayRange?: SalesSdkMultiDaySelectResult;
|
|
1536
|
+
multiDayRange?: SalesSdkMultiDaySelectResult; /** @internal 当前确认延后 Holder 到提交前补录。 */
|
|
1537
|
+
deferHolderUntilSubmit?: boolean;
|
|
1533
1538
|
};
|
|
1534
1539
|
}
|
|
1535
1540
|
/**
|
|
@@ -1639,6 +1644,11 @@ interface SalesSdkAddProductWithFlowOptions {
|
|
|
1639
1644
|
* @internal 由 createAddProductWithFlowDebounced 注入,业务调用方勿传。
|
|
1640
1645
|
*/
|
|
1641
1646
|
preparedCacheItem?: any;
|
|
1647
|
+
/**
|
|
1648
|
+
* 当前商品 Flow 已关闭登录;详情/加购阶段延后 Holder,提交前仍按原配置校验。
|
|
1649
|
+
* @internal 由 Kiosk 模板登录门禁注入,业务调用方勿传。
|
|
1650
|
+
*/
|
|
1651
|
+
deferHolderUntilSubmit?: boolean;
|
|
1642
1652
|
}
|
|
1643
1653
|
/**
|
|
1644
1654
|
* 资源不可用原因(与 OS `BookingContext.ResourceUnavailableReason` 一比一对齐)。
|
|
@@ -1701,6 +1711,11 @@ interface SalesSdkProviderProps {
|
|
|
1701
1711
|
autoInitBookingContext?: boolean;
|
|
1702
1712
|
/** 透传给 OS 注册时的 otherParams(platform / type / channel / dineInConfig 等) */
|
|
1703
1713
|
otherParams?: Record<string, any>;
|
|
1714
|
+
/**
|
|
1715
|
+
* Kiosk 模板专用:用户关闭商品 Holder 登录后继续详情/加购,并延后到提交前补录。
|
|
1716
|
+
* @internal 由 BigSale 根据 resolvedTemplate 注入。
|
|
1717
|
+
*/
|
|
1718
|
+
deferHolderAuthOnClose?: boolean;
|
|
1704
1719
|
/**
|
|
1705
1720
|
* 运行时商品行合并策略;返回 false 时快速加购不做防抖合并,OS 始终新增商品行,
|
|
1706
1721
|
* 预约商品也保持独立展示。默认合并。
|
|
@@ -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 };
|
|
@@ -14,15 +14,12 @@ function isTruthyRequired(value) {
|
|
|
14
14
|
function normalizeText(value) {
|
|
15
15
|
return value == null ? "" : String(value).trim().toLowerCase();
|
|
16
16
|
}
|
|
17
|
-
function isKioskRuntime(params) {
|
|
18
|
-
return normalizeText(params.platform) === "kiosk" || normalizeText(params.channel) === "kiosk";
|
|
19
|
-
}
|
|
20
17
|
function isHolderRequiredProduct(product) {
|
|
21
18
|
const holderConfig = product === null || product === void 0 ? void 0 : product.holder_config;
|
|
22
19
|
return normalizeText(holderConfig === null || holderConfig === void 0 ? void 0 : holderConfig.status) === "enable" && isTruthyRequired(holderConfig === null || holderConfig === void 0 ? void 0 : holderConfig.required);
|
|
23
20
|
}
|
|
24
21
|
function shouldPromptCustomerAuthForProduct(params) {
|
|
25
|
-
return
|
|
22
|
+
return params.enabled === true && isHolderRequiredProduct(params.product) && !isValidOrderCustomerId(params.currentCustomerId);
|
|
26
23
|
}
|
|
27
24
|
function normalizeCustomerAuthCustomer(value) {
|
|
28
25
|
if (!value || typeof value !== "object") return null;
|
|
@@ -62,4 +59,4 @@ function normalizeCustomerAuthCustomer(value) {
|
|
|
62
59
|
return null;
|
|
63
60
|
}
|
|
64
61
|
//#endregion
|
|
65
|
-
export {
|
|
62
|
+
export { isValidOrderCustomerId, normalizeCustomerAuthCustomer, resolveCustomerAuthCurrentCustomerId, shouldPromptCustomerAuthForProduct };
|
|
@@ -20,7 +20,7 @@ function _enrichCacheItemBeforeAdd() {
|
|
|
20
20
|
const customerId = resolveAddFlowCustomerId(input.tempOrder, input.customerId);
|
|
21
21
|
const holderSource = (_input$catalogItem2 = input.catalogItem) !== null && _input$catalogItem2 !== void 0 ? _input$catalogItem2 : cacheItem;
|
|
22
22
|
const effectiveHolderConfig = resolveEffectiveHolderConfig(holderSource, input.bookingConfig);
|
|
23
|
-
if (shouldPromptHolderOnAddCart({
|
|
23
|
+
if (!input.deferHolderUntilSubmit && shouldPromptHolderOnAddCart({
|
|
24
24
|
cacheItem,
|
|
25
25
|
bookingConfig: input.bookingConfig,
|
|
26
26
|
productSource: holderSource,
|
|
@@ -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 };
|
|
@@ -6,10 +6,10 @@ function ensureCustomerAuthBeforeAdd(_x) {
|
|
|
6
6
|
}
|
|
7
7
|
function _ensureCustomerAuthBeforeAdd() {
|
|
8
8
|
_ensureCustomerAuthBeforeAdd = _asyncToGenerator(function* (params) {
|
|
9
|
-
if (!shouldPromptCustomerAuthForProduct(params)) return
|
|
9
|
+
if (!shouldPromptCustomerAuthForProduct(params)) return { status: "ready" };
|
|
10
10
|
if (!params.openCustomerAuth) {
|
|
11
11
|
console.warn("[SalesSdk] Kiosk holder-required product needs customer auth, but openCustomerAuth is unavailable");
|
|
12
|
-
return
|
|
12
|
+
return { status: "fallback" };
|
|
13
13
|
}
|
|
14
14
|
try {
|
|
15
15
|
const result = yield params.openCustomerAuth({
|
|
@@ -17,16 +17,16 @@ function _ensureCustomerAuthBeforeAdd() {
|
|
|
17
17
|
product: params.product,
|
|
18
18
|
currentCustomerId: params.currentCustomerId
|
|
19
19
|
});
|
|
20
|
-
if (!(result === null || result === void 0 ? void 0 : result.customer)) return
|
|
20
|
+
if (!(result === null || result === void 0 ? void 0 : result.customer)) return { status: "deferred" };
|
|
21
21
|
if (typeof params.setOrderCustomer !== "function") {
|
|
22
22
|
console.warn("[SalesSdk] Customer auth succeeded, but setOrderCustomer is unavailable");
|
|
23
|
-
return
|
|
23
|
+
return { status: "fallback" };
|
|
24
24
|
}
|
|
25
25
|
yield params.setOrderCustomer(result.customer);
|
|
26
|
-
return
|
|
26
|
+
return { status: "ready" };
|
|
27
27
|
} catch (error) {
|
|
28
28
|
console.warn("[SalesSdk] Customer auth before add failed", error);
|
|
29
|
-
return
|
|
29
|
+
return { status: "fallback" };
|
|
30
30
|
}
|
|
31
31
|
});
|
|
32
32
|
return _ensureCustomerAuthBeforeAdd.apply(this, arguments);
|
|
@@ -104,9 +104,8 @@ function collectUnassignedHolderLines(bookingTicket) {
|
|
|
104
104
|
const orderLine = (_bookingView$_extend = bookingView._extend) === null || _bookingView$_extend === void 0 ? void 0 : _bookingView$_extend.product;
|
|
105
105
|
if (!orderLine) return;
|
|
106
106
|
const sourceProduct = (_catalog$find = catalog.find((p) => String(p.id) === String(orderLine.product_id))) !== null && _catalog$find !== void 0 ? _catalog$find : null;
|
|
107
|
-
const
|
|
108
|
-
|
|
109
|
-
if (!(effectiveHolderConfig.source === "product" ? effectiveHolderConfig.required : effectiveHolderConfig.enabled)) return;
|
|
107
|
+
const effectiveHolderConfig = resolveEffectiveHolderConfig((_ref = sourceProduct !== null && sourceProduct !== void 0 ? sourceProduct : orderLine) !== null && _ref !== void 0 ? _ref : bookingView, bookingConfig);
|
|
108
|
+
if (!effectiveHolderConfig.enabled) return;
|
|
110
109
|
const cacheItem = buildCacheItemFromOrderLine({
|
|
111
110
|
product: orderLine,
|
|
112
111
|
booking: bookingView,
|
|
@@ -115,7 +114,7 @@ function collectUnassignedHolderLines(bookingTicket) {
|
|
|
115
114
|
if (isNormalProductByDurationSchedule(cacheItem)) return;
|
|
116
115
|
if (hasHolderAssigned(cacheItem)) return;
|
|
117
116
|
rawLines.push({
|
|
118
|
-
cacheItem: _objectSpread2(_objectSpread2({}, cacheItem), isProductHolderRequired(cacheItem) ? {} : { holder_config:
|
|
117
|
+
cacheItem: _objectSpread2(_objectSpread2({}, cacheItem), isProductHolderRequired(cacheItem) ? {} : { holder_config: effectiveHolderConfig.raw }),
|
|
119
118
|
booking: bookingView,
|
|
120
119
|
orderLine
|
|
121
120
|
});
|
|
@@ -30,26 +30,12 @@ function resolveProductHolderConfig(source) {
|
|
|
30
30
|
}, formId !== void 0 && formId !== null && formId !== "" ? { formId } : {}), {}, { raw });
|
|
31
31
|
}
|
|
32
32
|
/**
|
|
33
|
-
* 统一解析 Holder
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
* 这样既允许新商品单独关闭店铺级 Holder,也能继续兼容尚未迁移的旧预约商品。
|
|
33
|
+
* 统一解析 Holder 配置:保留旧函数签名以减少调用方改动,
|
|
34
|
+
* 启用与必填判断不再回退 bookingConfig。
|
|
37
35
|
*/
|
|
38
|
-
function resolveEffectiveHolderConfig(source,
|
|
39
|
-
var _bookingConfig$config;
|
|
36
|
+
function resolveEffectiveHolderConfig(source, _bookingConfig) {
|
|
40
37
|
const productConfig = resolveProductHolderConfig(source);
|
|
41
38
|
if (productConfig.raw) return _objectSpread2(_objectSpread2({}, productConfig), {}, { source: "product" });
|
|
42
|
-
const basicConfig = bookingConfig === null || bookingConfig === void 0 || (_bookingConfig$config = bookingConfig.config) === null || _bookingConfig$config === void 0 ? void 0 : _bookingConfig$config.basic;
|
|
43
|
-
const appointmentSubject = basicConfig === null || basicConfig === void 0 ? void 0 : basicConfig.appointment_subject;
|
|
44
|
-
const legacyEnabled = (appointmentSubject === null || appointmentSubject === void 0 ? void 0 : appointmentSubject.type) === "form" && (appointmentSubject === null || appointmentSubject === void 0 ? void 0 : appointmentSubject.show_hold_on_add_cart) !== 0;
|
|
45
|
-
const legacyFormId = appointmentSubject === null || appointmentSubject === void 0 ? void 0 : appointmentSubject.form_id;
|
|
46
|
-
if (appointmentSubject) return _objectSpread2(_objectSpread2({
|
|
47
|
-
enabled: legacyEnabled,
|
|
48
|
-
required: legacyEnabled && (basicConfig === null || basicConfig === void 0 ? void 0 : basicConfig.subject_require) === "require"
|
|
49
|
-
}, legacyFormId !== void 0 && legacyFormId !== null && legacyFormId !== "" ? { formId: legacyFormId } : {}), {}, {
|
|
50
|
-
raw: null,
|
|
51
|
-
source: "legacy"
|
|
52
|
-
});
|
|
53
39
|
return {
|
|
54
40
|
enabled: false,
|
|
55
41
|
required: false,
|
|
@@ -40,7 +40,8 @@ function _openBookingEditAfterEnrich() {
|
|
|
40
40
|
cacheItem,
|
|
41
41
|
catalogProduct: catalogProduct !== null && catalogProduct !== void 0 ? catalogProduct : payload.catalogProduct,
|
|
42
42
|
customerId: drawerCustomerId,
|
|
43
|
-
initialHolderIds: flowOptions.initialHolderIds
|
|
43
|
+
initialHolderIds: flowOptions.initialHolderIds,
|
|
44
|
+
deferHolderUntilSubmit: flowOptions.deferHolderUntilSubmit
|
|
44
45
|
}));
|
|
45
46
|
if (selectionResult.status === "cancelled") return { status: "cancelled" };
|
|
46
47
|
if (selectionResult.status === "committed") {
|
|
@@ -63,6 +64,7 @@ function _openBookingEditAfterEnrich() {
|
|
|
63
64
|
customerId: (_flowOptions$customer2 = flowOptions.customerId) !== null && _flowOptions$customer2 !== void 0 ? _flowOptions$customer2 : payload.customerId,
|
|
64
65
|
initialHolderIds: flowOptions.initialHolderIds,
|
|
65
66
|
holderOptions: flowOptions.holderOptions,
|
|
67
|
+
deferHolderUntilSubmit: flowOptions.deferHolderUntilSubmit,
|
|
66
68
|
date: payload.date,
|
|
67
69
|
locale: flowOptions.locale,
|
|
68
70
|
mode: "drawer"
|
|
@@ -102,6 +104,7 @@ function _openBookingEditAfterEnrich() {
|
|
|
102
104
|
customerId: (_flowOptions$customer3 = flowOptions.customerId) !== null && _flowOptions$customer3 !== void 0 ? _flowOptions$customer3 : payload.customerId,
|
|
103
105
|
initialHolderIds: flowOptions.initialHolderIds,
|
|
104
106
|
holderOptions: flowOptions.holderOptions,
|
|
107
|
+
deferHolderUntilSubmit: flowOptions.deferHolderUntilSubmit,
|
|
105
108
|
date: payload.date,
|
|
106
109
|
locale: flowOptions.locale,
|
|
107
110
|
mode: "drawer"
|
|
@@ -110,12 +113,16 @@ function _openBookingEditAfterEnrich() {
|
|
|
110
113
|
const openEdit = hosts === null || hosts === void 0 ? void 0 : hosts.openBookingEdit;
|
|
111
114
|
if (!openEdit) return {
|
|
112
115
|
status: "requiresBookingEdit",
|
|
113
|
-
payload: _objectSpread2(_objectSpread2({}, payload), {}, {
|
|
116
|
+
payload: _objectSpread2(_objectSpread2({}, payload), {}, {
|
|
117
|
+
cacheItem: enriched.cacheItem,
|
|
118
|
+
deferHolderUntilSubmit: flowOptions.deferHolderUntilSubmit
|
|
119
|
+
})
|
|
114
120
|
};
|
|
115
121
|
const edited = yield openEdit(_objectSpread2(_objectSpread2({}, payload), {}, {
|
|
116
122
|
cacheItem: enriched.cacheItem,
|
|
117
123
|
catalogProduct: catalogProduct !== null && catalogProduct !== void 0 ? catalogProduct : payload.catalogProduct,
|
|
118
|
-
customerId: drawerCustomerId
|
|
124
|
+
customerId: drawerCustomerId,
|
|
125
|
+
deferHolderUntilSubmit: flowOptions.deferHolderUntilSubmit
|
|
119
126
|
}));
|
|
120
127
|
if (!edited) return { status: "cancelled" };
|
|
121
128
|
const { products } = yield cart.confirmBookingEdit({
|
|
@@ -149,7 +156,8 @@ function _runAddProductFlow() {
|
|
|
149
156
|
if (!openDetail) return result;
|
|
150
157
|
const detailResult = yield openDetail(_objectSpread2(_objectSpread2({}, result.payload), {}, {
|
|
151
158
|
initialQuantity: (_flowOptions$quantity = flowOptions.quantity) !== null && _flowOptions$quantity !== void 0 ? _flowOptions$quantity : result.payload.initialQuantity,
|
|
152
|
-
initialHolderIds: (_flowOptions$initialH = flowOptions.initialHolderIds) !== null && _flowOptions$initialH !== void 0 ? _flowOptions$initialH : result.payload.initialHolderIds
|
|
159
|
+
initialHolderIds: (_flowOptions$initialH = flowOptions.initialHolderIds) !== null && _flowOptions$initialH !== void 0 ? _flowOptions$initialH : result.payload.initialHolderIds,
|
|
160
|
+
deferHolderUntilSubmit: flowOptions.deferHolderUntilSubmit
|
|
153
161
|
}));
|
|
154
162
|
if (!detailResult) return { status: "cancelled" };
|
|
155
163
|
if (detailResult._committedProducts) {
|
|
@@ -189,7 +197,8 @@ function _runAddProductFlow() {
|
|
|
189
197
|
options: flowOptions
|
|
190
198
|
}),
|
|
191
199
|
initialHolderIds: flowOptions.initialHolderIds,
|
|
192
|
-
multiDayRange: multiDayRange || void 0
|
|
200
|
+
multiDayRange: multiDayRange || void 0,
|
|
201
|
+
deferHolderUntilSubmit: flowOptions.deferHolderUntilSubmit
|
|
193
202
|
}
|
|
194
203
|
};
|
|
195
204
|
result = yield cart.confirmDetail(confirmInput);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
//#region src/plus/walletPassGallery/components/passDetail/index.d.ts
|
|
2
3
|
interface PassDetailProps {
|
|
3
4
|
dataSource?: any | null;
|
|
@@ -7,6 +8,6 @@ interface PassDetailProps {
|
|
|
7
8
|
showTimeLine?: boolean;
|
|
8
9
|
onListRefresh?: () => void;
|
|
9
10
|
}
|
|
10
|
-
declare const PassDetail: (props: PassDetailProps) => JSX.Element | null;
|
|
11
|
+
declare const PassDetail: (props: PassDetailProps) => React.JSX.Element | null;
|
|
11
12
|
//#endregion
|
|
12
13
|
export { PassDetail };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import React from "react";
|
|
1
2
|
//#region src/plus/walletPassGallery/index.d.ts
|
|
2
3
|
interface WalletPassGalleryProps {
|
|
3
4
|
hideTitle: boolean;
|
|
@@ -6,6 +7,6 @@ interface WalletPassGalleryProps {
|
|
|
6
7
|
platform?: 'pc' | 'h5';
|
|
7
8
|
[key: string]: any;
|
|
8
9
|
}
|
|
9
|
-
declare const WalletPassGallery: (props: WalletPassGalleryProps) => JSX.Element;
|
|
10
|
+
declare const WalletPassGallery: (props: WalletPassGalleryProps) => React.JSX.Element;
|
|
10
11
|
//#endregion
|
|
11
12
|
export { WalletPassGallery };
|
|
@@ -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";
|