@pisell/private-materials 6.12.361 → 6.12.363
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +6 -6
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +6 -6
- package/es/components/bigSale/components/BookingFloatingPanel/useBookingPanelController.js +1 -0
- package/es/components/bigSale/components/ProductList/index.js +1 -0
- package/es/components/bigSale/components/TimeBar/index.js +1 -0
- package/es/components/bigSale/dialog.js +1 -0
- package/es/components/bigSale/hooks/useBigSaleContext.js +1 -0
- package/es/components/bigSale/hooks/useSelectFloorMapResourceForBigSale.js +1 -0
- package/es/components/bigSale/index.js +1 -0
- package/es/components/bigSale/templates/Kiosk/index.js +1 -0
- package/es/components/scanOrder/components/Check/index.js +95 -84
- package/es/components/scanOrder/locales.js +15 -0
- package/es/components/sharedSecondaryBigSale/SharedSecondaryBigSaleReceiver.js +1 -0
- package/es/index.js +2 -0
- package/es/plus/multiCurrencySettlement/index.js +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/index.js +17 -0
- package/es/plus/saasDevice/devicePasscodes/model.js +4 -4
- package/es/plus/saleDetail/Base.js +1 -0
- package/es/plus/saleDetail/components/Client/hooks/useClientSelectorProps.js +1 -0
- package/es/plus/saleDetail/components/DetailActions/PrintAction.js +1 -0
- package/es/plus/saleDetail/components/DetailActions/index.js +1 -0
- package/es/plus/saleDetail/components/SummaryFinancialSections/index.js +1 -0
- package/es/plus/saleDetail/index.js +1 -0
- package/es/plus/saleDetail/tmpl/B/components/Dish/index.js +1 -0
- package/es/plus/saleDetail/tmpl/B/index.js +1 -0
- package/es/plus/salesSdk/bookingEditService/BookingEditHolderField.js +66 -27
- package/es/plus/salesSdk/index.js +54 -0
- package/es/plus/salesSdk/utils/addProductWithFlowDebounced.js +1 -1
- package/es/plus/salesSdk/utils/bookingDate.js +1 -1
- package/es/plus/salesSdk/utils/enrichCartLineHolderDisplay.js +1 -1
- package/es/plus/skuOptionsSelection/utils/normalizeSelectorLayout.js +15 -0
- package/es/plus/skuOptionsSelection/utils/resolveCollectionLayout.js +2 -2
- package/es/plus/walletEditor/WalletEditor.js +19 -5
- package/es/plus/walletEditor/components/PassDisplayConfig/index.js +60 -0
- package/es/plus/walletEditor/components/PassDisplayConfig/index.less +27 -0
- package/es/plus/walletEditor/components/PassDisplayConfig/serve.js +18 -0
- package/es/plus/walletEditor/index.d.ts +1 -1
- package/es/plus/walletEditor/locales.js +40 -0
- package/es/plus/walletEditor/types.d.ts +8 -1
- package/es/plus/walletPassGallery/components/timelineSection/index.js +4 -4
- package/es/plus/walletPassGallery/index.js +11 -6
- package/es/pro/Login2.0/AuthModal.d.ts +1 -1
- package/es/pro/Login2.0/index.d.ts +2 -2
- package/es/pro/Login2.0/shared/types.d.ts +1 -1
- package/lib/components/scanOrder/components/Check/index.js +94 -83
- package/lib/components/scanOrder/locales.js +15 -0
- package/lib/plus/salesSdk/bookingEditService/BookingEditHolderField.js +65 -26
- package/lib/plus/skuOptionsSelection/utils/normalizeSelectorLayout.js +15 -0
- package/lib/plus/skuOptionsSelection/utils/resolveCollectionLayout.js +2 -2
- package/lib/plus/walletEditor/WalletEditor.js +19 -5
- package/lib/plus/walletEditor/components/PassDisplayConfig/index.js +62 -0
- package/lib/plus/walletEditor/components/PassDisplayConfig/index.less +27 -0
- package/lib/plus/walletEditor/components/PassDisplayConfig/serve.js +18 -0
- package/lib/plus/walletEditor/index.d.ts +1 -1
- package/lib/plus/walletEditor/locales.js +40 -0
- package/lib/plus/walletEditor/types.d.ts +8 -1
- package/lib/plus/walletPassGallery/index.js +11 -6
- package/package.json +3 -3
- package/es/private-materials/lowcode/authmodal/meta.d.ts +0 -1
|
@@ -42,7 +42,7 @@ const KEYS = {
|
|
|
42
42
|
const ARow = Row;
|
|
43
43
|
const ACol = Col;
|
|
44
44
|
const WalletPassGallery = (props) => {
|
|
45
|
-
var _context$appHelper, _context$appHelper2, _context$engine, _utils$translation, _getWalletDetail$data;
|
|
45
|
+
var _context$appHelper, _context$appHelper2, _utils$businessUtils, _utils$businessUtils$, _context$engine, _utils$translation, _getWalletDetail$data;
|
|
46
46
|
const { hideAddButton, hideTitle, customer, platform: platformProp } = props;
|
|
47
47
|
const [activeKey, setActiveKey] = useState("available");
|
|
48
48
|
const [currentItemId, setCurrentItemId] = useState(void 0);
|
|
@@ -53,6 +53,7 @@ const WalletPassGallery = (props) => {
|
|
|
53
53
|
const context = useEngineContext();
|
|
54
54
|
const utils = (context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {};
|
|
55
55
|
const { apiPrefix } = ((_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 ? void 0 : _context$appHelper2.constants) || { apiPrefix: "/h5" };
|
|
56
|
+
const includeFranchiseePasses = Boolean((_utils$businessUtils = utils.businessUtils) === null || _utils$businessUtils === void 0 || (_utils$businessUtils$ = _utils$businessUtils.getAppByModal) === null || _utils$businessUtils$ === void 0 ? void 0 : _utils$businessUtils$.call(_utils$businessUtils, "franchisor"));
|
|
56
57
|
const { isTerminal, isApp, interaction, action, isWebPos } = utils;
|
|
57
58
|
const isTerminalEnv = (typeof isTerminal === "function" ? isTerminal() : !!isTerminal) || (isApp === null || isApp === void 0 ? void 0 : isApp());
|
|
58
59
|
const platform = useMemo(() => {
|
|
@@ -69,7 +70,7 @@ const WalletPassGallery = (props) => {
|
|
|
69
70
|
const _searchParams = new URLSearchParams(window.location.search);
|
|
70
71
|
const walletId = _searchParams.get("id");
|
|
71
72
|
const holderId = _searchParams.get("holder_id");
|
|
72
|
-
const res = yield getWalletPassList(_objectSpread2({
|
|
73
|
+
const res = yield getWalletPassList(_objectSpread2(_objectSpread2({
|
|
73
74
|
available: 1,
|
|
74
75
|
num: 20,
|
|
75
76
|
skip: (d === null || d === void 0 ? void 0 : d.nextId) || 1,
|
|
@@ -83,7 +84,7 @@ const WalletPassGallery = (props) => {
|
|
|
83
84
|
],
|
|
84
85
|
customer_id: customer === null || customer === void 0 ? void 0 : customer.id,
|
|
85
86
|
limit_status: "enable"
|
|
86
|
-
}, isWebPos ? { with_franchisor_data: true } : {}), { apiPrefix });
|
|
87
|
+
}, isWebPos ? { with_franchisor_data: true } : {}), {}, { include_franchisee_passes: includeFranchiseePasses ? 1 : void 0 }), { apiPrefix });
|
|
87
88
|
return {
|
|
88
89
|
list: (res === null || res === void 0 ? void 0 : res.list) || [],
|
|
89
90
|
count: (res === null || res === void 0 ? void 0 : res.count) || 0,
|
|
@@ -106,7 +107,7 @@ const WalletPassGallery = (props) => {
|
|
|
106
107
|
const _searchParams = new URLSearchParams(window.location.search);
|
|
107
108
|
const walletId = _searchParams.get("id");
|
|
108
109
|
const holderId = _searchParams.get("holder_id");
|
|
109
|
-
const res = yield getWalletPassList(_objectSpread2({
|
|
110
|
+
const res = yield getWalletPassList(_objectSpread2(_objectSpread2({
|
|
110
111
|
available: 0,
|
|
111
112
|
num: 20,
|
|
112
113
|
skip: (d === null || d === void 0 ? void 0 : d.nextId) || 1,
|
|
@@ -120,7 +121,7 @@ const WalletPassGallery = (props) => {
|
|
|
120
121
|
],
|
|
121
122
|
customer_id: customer === null || customer === void 0 ? void 0 : customer.id,
|
|
122
123
|
limit_status: "enable"
|
|
123
|
-
}, isWebPos ? { with_franchisor_data: true } : {}), { apiPrefix });
|
|
124
|
+
}, isWebPos ? { with_franchisor_data: true } : {}), {}, { include_franchisee_passes: includeFranchiseePasses ? 1 : void 0 }), { apiPrefix });
|
|
124
125
|
return {
|
|
125
126
|
list: (res === null || res === void 0 ? void 0 : res.list) || [],
|
|
126
127
|
count: (res === null || res === void 0 ? void 0 : res.count) || 0,
|
|
@@ -199,7 +200,11 @@ const WalletPassGallery = (props) => {
|
|
|
199
200
|
}
|
|
200
201
|
}
|
|
201
202
|
});
|
|
202
|
-
}, [
|
|
203
|
+
}, [
|
|
204
|
+
customer,
|
|
205
|
+
apiPrefix,
|
|
206
|
+
includeFranchiseePasses
|
|
207
|
+
]);
|
|
203
208
|
useEffect(() => {
|
|
204
209
|
var _interaction$utils, _interaction$utils$mo;
|
|
205
210
|
interaction === null || interaction === void 0 || (_interaction$utils = interaction.utils) === null || _interaction$utils === void 0 || (_interaction$utils$mo = _interaction$utils.mountFunction) === null || _interaction$utils$mo === void 0 || _interaction$utils$mo.call(_interaction$utils, "customer", "new", () => {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthMethodType, VerificationMethod } from "./shared/types.js";
|
|
1
|
+
import { AuthMethodType, EmailAuthConfig, EmailRegistrationVerification, LoginFormData, OAuthConfig, PhoneAuthConfig, RegisterFormData, UIConfig, 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
|
|
4
|
+
import { AuthModal } from "./AuthModal.js";
|
|
@@ -226,4 +226,4 @@ interface RegisterFormData {
|
|
|
226
226
|
verification_token?: string;
|
|
227
227
|
}
|
|
228
228
|
//#endregion
|
|
229
|
-
export { AuthMethodType, EmailAuthConfig, LegalTermsConfig, LoginFormData, LoginMethodItem, OAuthConfig, PhoneAuthConfig, RegisterFormData, RegistrationMethodItem, UIConfig, VerificationMethod };
|
|
229
|
+
export { AuthMethodType, EmailAuthConfig, EmailRegistrationVerification, LegalTermsConfig, LoginFormData, LoginMethodItem, OAuthConfig, PhoneAuthConfig, RegisterFormData, RegistrationMethodItem, UIConfig, VerificationMethod };
|
|
@@ -16,6 +16,8 @@ function Check() {
|
|
|
16
16
|
const { viewModel, runModuleAction, refreshViewModel, tableName, entryMode, clearStepCache, entryContext } = require_context.useScanOrderContext();
|
|
17
17
|
const isAdditionalOrder = entryMode === "additional_order";
|
|
18
18
|
const [submitting, setSubmitting] = (0, react.useState)(false);
|
|
19
|
+
const submittingRef = (0, react.useRef)(false);
|
|
20
|
+
const menuUnavailableRef = (0, react.useRef)(false);
|
|
19
21
|
const [note, setNote] = (0, react.useState)((viewModel === null || viewModel === void 0 ? void 0 : viewModel.note) || "");
|
|
20
22
|
const [pickupRefOpen, setPickupRefOpen] = (0, react.useState)(false);
|
|
21
23
|
const [addOnConfirmOpen, setAddOnConfirmOpen] = (0, react.useState)(false);
|
|
@@ -53,9 +55,52 @@ function Check() {
|
|
|
53
55
|
const showSubmitFailedTip = (0, react.useCallback)((tip) => {
|
|
54
56
|
(0, _pisell_materials.PisellToast)({ content: String(tip || _pisell_utils.locales.getText("pisell2.scan.order.submit.failed") || "Submit order failed") });
|
|
55
57
|
}, []);
|
|
58
|
+
const handleMenuValidationFailure = (error) => {
|
|
59
|
+
if ((error === null || error === void 0 ? void 0 : error.code) === "SCAN_ORDER_MENU_UNAVAILABLE") {
|
|
60
|
+
if (menuUnavailableRef.current) return true;
|
|
61
|
+
menuUnavailableRef.current = true;
|
|
62
|
+
antd.Modal.info({
|
|
63
|
+
title: String(_pisell_utils.locales.getText("pisell2.scan.order.menu.unavailable.title") || "Ordering time has ended"),
|
|
64
|
+
content: String(_pisell_utils.locales.getText("pisell2.scan.order.menu.unavailable.description") || "Some items in your cart are no longer available to order at this time. Select Confirm to refresh the page and choose your items again."),
|
|
65
|
+
okText: String(_pisell_utils.locales.getText("pisell2.event.confirm") || "OK"),
|
|
66
|
+
maskClosable: false,
|
|
67
|
+
keyboard: false,
|
|
68
|
+
closable: false,
|
|
69
|
+
onOk: () => {
|
|
70
|
+
const url = new URL(window.location.href);
|
|
71
|
+
url.searchParams.delete("cacheId");
|
|
72
|
+
window.location.replace(url.toString());
|
|
73
|
+
}
|
|
74
|
+
});
|
|
75
|
+
return true;
|
|
76
|
+
}
|
|
77
|
+
if ((error === null || error === void 0 ? void 0 : error.code) === "SCAN_ORDER_MENU_VALIDATION_FAILED") {
|
|
78
|
+
showSubmitFailedTip(String(_pisell_utils.locales.getText("pisell2.scan.order.menu.validation.failed") || "Unable to check the ordering time. Please try again. Your cart has been kept."));
|
|
79
|
+
return true;
|
|
80
|
+
}
|
|
81
|
+
return false;
|
|
82
|
+
};
|
|
83
|
+
const runSubmitAction = function() {
|
|
84
|
+
var _ref = require_asyncToGenerator._asyncToGenerator(function* (action) {
|
|
85
|
+
if (submittingRef.current || menuUnavailableRef.current) return;
|
|
86
|
+
submittingRef.current = true;
|
|
87
|
+
setSubmitting(true);
|
|
88
|
+
try {
|
|
89
|
+
yield action();
|
|
90
|
+
} catch (error) {
|
|
91
|
+
console.error("[scanOrder] submit action failed", error);
|
|
92
|
+
if (!handleMenuValidationFailure(error)) showSubmitFailedTip(error === null || error === void 0 ? void 0 : error.message);
|
|
93
|
+
} finally {
|
|
94
|
+
submittingRef.current = false;
|
|
95
|
+
setSubmitting(false);
|
|
96
|
+
}
|
|
97
|
+
});
|
|
98
|
+
return function runSubmitAction(_x) {
|
|
99
|
+
return _ref.apply(this, arguments);
|
|
100
|
+
};
|
|
101
|
+
}();
|
|
56
102
|
const showInventoryInsufficientModal = (0, react.useCallback)((error) => {
|
|
57
103
|
var _error$data;
|
|
58
|
-
setSubmitting(false);
|
|
59
104
|
const productNames = (Array.isArray(error === null || error === void 0 || (_error$data = error.data) === null || _error$data === void 0 ? void 0 : _error$data.unavailable_products) ? error.data.unavailable_products : []).map((product) => String((product === null || product === void 0 ? void 0 : product.title) || (product === null || product === void 0 ? void 0 : product.product_id) || "").trim()).filter(Boolean);
|
|
60
105
|
const title = String(_pisell_utils.locales.getText("pisell2.scan.order.inventory.insufficient.title") || "Insufficient inventory");
|
|
61
106
|
const description = String(_pisell_utils.locales.getText("pisell2.scan.order.inventory.insufficient.description") || "The following items are out of stock or do not have enough inventory. Please adjust your cart and try again.");
|
|
@@ -69,24 +114,22 @@ function Check() {
|
|
|
69
114
|
});
|
|
70
115
|
}, []);
|
|
71
116
|
const doSubmit = function() {
|
|
72
|
-
var
|
|
117
|
+
var _ref3 = require_asyncToGenerator._asyncToGenerator(function* () {
|
|
73
118
|
if (((viewModel === null || viewModel === void 0 ? void 0 : viewModel.cartItems) || []).length === 0) {
|
|
74
119
|
showCheckStepEmptyCartTip();
|
|
75
|
-
setSubmitting(false);
|
|
76
120
|
return;
|
|
77
121
|
}
|
|
78
122
|
try {
|
|
79
123
|
var _res$data;
|
|
80
|
-
setSubmitting(true);
|
|
81
124
|
yield runModuleAction("updateTempOrderNote", note);
|
|
82
125
|
const res = yield runModuleAction("submitScanOrder");
|
|
83
126
|
console.log("submitScanOrder >>>>> ", res);
|
|
84
127
|
if ((res === null || res === void 0 ? void 0 : res.status) === false) {
|
|
128
|
+
if (handleMenuValidationFailure(res)) return;
|
|
85
129
|
if ((res === null || res === void 0 ? void 0 : res.code) === 6008) {
|
|
86
130
|
showInventoryInsufficientModal(res);
|
|
87
131
|
return;
|
|
88
132
|
}
|
|
89
|
-
setSubmitting(false);
|
|
90
133
|
showSubmitFailedTip(res === null || res === void 0 ? void 0 : res.message);
|
|
91
134
|
return;
|
|
92
135
|
}
|
|
@@ -104,7 +147,6 @@ function Check() {
|
|
|
104
147
|
}[channel] || channel;
|
|
105
148
|
if (shouldPayOnSubmit) {
|
|
106
149
|
var _res$data2, _viewModel$summary;
|
|
107
|
-
setSubmitting(false);
|
|
108
150
|
utils.action({
|
|
109
151
|
type: "pisell1.payment",
|
|
110
152
|
data: {
|
|
@@ -113,15 +155,15 @@ function Check() {
|
|
|
113
155
|
sale_channel: saleChannel
|
|
114
156
|
},
|
|
115
157
|
callback: function() {
|
|
116
|
-
var
|
|
158
|
+
var _ref2 = require_asyncToGenerator._asyncToGenerator(function* (_e) {
|
|
117
159
|
try {
|
|
118
160
|
yield runModuleAction("restoreOrder");
|
|
119
161
|
} catch (error) {
|
|
120
162
|
console.warn("[scanOrder] restoreOrder after payment failed", error);
|
|
121
163
|
}
|
|
122
164
|
});
|
|
123
|
-
return function callback(
|
|
124
|
-
return
|
|
165
|
+
return function callback(_x2) {
|
|
166
|
+
return _ref2.apply(this, arguments);
|
|
125
167
|
};
|
|
126
168
|
}()
|
|
127
169
|
});
|
|
@@ -145,96 +187,65 @@ function Check() {
|
|
|
145
187
|
yield refreshViewModel();
|
|
146
188
|
} catch (error) {
|
|
147
189
|
console.error("[scanOrder] submitScanOrder failed", error);
|
|
148
|
-
if ((error
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
} else if ((error === null || error === void 0 ? void 0 : error.code) === 670007 && (entryContext === null || entryContext === void 0 ? void 0 : entryContext.resource_id)) {
|
|
190
|
+
if (handleMenuValidationFailure(error)) return;
|
|
191
|
+
if ((error === null || error === void 0 ? void 0 : error.code) === 670005) showSubmitFailedTip(String(_pisell_utils.locales.getText("pisell2.scan.order.settled.cannot.add.tip") || ""));
|
|
192
|
+
else if ((error === null || error === void 0 ? void 0 : error.code) === 670007 && (entryContext === null || entryContext === void 0 ? void 0 : entryContext.resource_id)) {
|
|
152
193
|
const reservationResourceSelectType = yield runModuleAction("getReservationResourceSelectType");
|
|
153
194
|
const allowAddItems = yield runModuleAction("checkAllowAddItems");
|
|
154
195
|
const res = yield runModuleAction("syncAdditionalOrderFromResource", entryContext === null || entryContext === void 0 ? void 0 : entryContext.resource_id);
|
|
155
|
-
if (reservationResourceSelectType.resourceSelectType === "single" && (allowAddItems === null || allowAddItems === void 0 ? void 0 : allowAddItems.enabled) && (res === null || res === void 0 ? void 0 : res.matched))
|
|
156
|
-
|
|
157
|
-
setAddOnConfirmOpen(true);
|
|
158
|
-
} else {
|
|
159
|
-
setSubmitting(false);
|
|
160
|
-
showSubmitFailedTip(error === null || error === void 0 ? void 0 : error.message);
|
|
161
|
-
}
|
|
196
|
+
if (reservationResourceSelectType.resourceSelectType === "single" && (allowAddItems === null || allowAddItems === void 0 ? void 0 : allowAddItems.enabled) && (res === null || res === void 0 ? void 0 : res.matched)) setAddOnConfirmOpen(true);
|
|
197
|
+
else showSubmitFailedTip(error === null || error === void 0 ? void 0 : error.message);
|
|
162
198
|
} else if ((error === null || error === void 0 ? void 0 : error.code) === 6008) showInventoryInsufficientModal(error);
|
|
163
|
-
else
|
|
164
|
-
setSubmitting(false);
|
|
165
|
-
showSubmitFailedTip(error === null || error === void 0 ? void 0 : error.message);
|
|
166
|
-
}
|
|
199
|
+
else showSubmitFailedTip(error === null || error === void 0 ? void 0 : error.message);
|
|
167
200
|
}
|
|
168
201
|
});
|
|
169
202
|
return function doSubmit() {
|
|
170
|
-
return _ref2.apply(this, arguments);
|
|
171
|
-
};
|
|
172
|
-
}();
|
|
173
|
-
const handleSubmit = function() {
|
|
174
|
-
var _ref3 = require_asyncToGenerator._asyncToGenerator(function* () {
|
|
175
|
-
if (submitting) return;
|
|
176
|
-
if (((viewModel === null || viewModel === void 0 ? void 0 : viewModel.cartItems) || []).length === 0) {
|
|
177
|
-
showCheckStepEmptyCartTip();
|
|
178
|
-
return;
|
|
179
|
-
}
|
|
180
|
-
if (isAdditionalOrder) {
|
|
181
|
-
yield doSubmit();
|
|
182
|
-
return;
|
|
183
|
-
}
|
|
184
|
-
try {
|
|
185
|
-
setSubmitting(true);
|
|
186
|
-
const manualPickup = yield runModuleAction("checkManualPickupRef");
|
|
187
|
-
if (manualPickup === null || manualPickup === void 0 ? void 0 : manualPickup.enabled) {
|
|
188
|
-
setPickupRefOpen(true);
|
|
189
|
-
setSubmitting(false);
|
|
190
|
-
return;
|
|
191
|
-
}
|
|
192
|
-
} catch (error) {
|
|
193
|
-
console.error("[scanOrder] checkManualPickupRef failed", error);
|
|
194
|
-
antd.message.error((error === null || error === void 0 ? void 0 : error.message) || "Submit order failed");
|
|
195
|
-
setSubmitting(false);
|
|
196
|
-
return;
|
|
197
|
-
}
|
|
198
|
-
yield doSubmit();
|
|
199
|
-
});
|
|
200
|
-
return function handleSubmit() {
|
|
201
203
|
return _ref3.apply(this, arguments);
|
|
202
204
|
};
|
|
203
205
|
}();
|
|
204
|
-
const
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
206
|
+
const handleSubmit = () => runSubmitAction(require_asyncToGenerator._asyncToGenerator(function* () {
|
|
207
|
+
if (((viewModel === null || viewModel === void 0 ? void 0 : viewModel.cartItems) || []).length === 0) {
|
|
208
|
+
showCheckStepEmptyCartTip();
|
|
209
|
+
return;
|
|
210
|
+
}
|
|
211
|
+
if (isAdditionalOrder) {
|
|
212
|
+
yield doSubmit();
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
try {
|
|
216
|
+
const manualPickup = yield runModuleAction("checkManualPickupRef");
|
|
217
|
+
if (manualPickup === null || manualPickup === void 0 ? void 0 : manualPickup.enabled) {
|
|
218
|
+
setPickupRefOpen(true);
|
|
213
219
|
return;
|
|
214
220
|
}
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
}
|
|
221
|
+
} catch (error) {
|
|
222
|
+
console.error("[scanOrder] checkManualPickupRef failed", error);
|
|
223
|
+
antd.message.error((error === null || error === void 0 ? void 0 : error.message) || "Submit order failed");
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
yield doSubmit();
|
|
227
|
+
}));
|
|
228
|
+
const handlePickupRefConfirm = (value) => runSubmitAction(require_asyncToGenerator._asyncToGenerator(function* () {
|
|
229
|
+
try {
|
|
230
|
+
yield runModuleAction("setPickupRef", value);
|
|
231
|
+
} catch (error) {
|
|
232
|
+
console.error("[scanOrder] setPickupRef failed", error);
|
|
233
|
+
antd.message.error((error === null || error === void 0 ? void 0 : error.message) || "Submit order failed");
|
|
234
|
+
return;
|
|
235
|
+
}
|
|
236
|
+
setPickupRefOpen(false);
|
|
237
|
+
yield doSubmit();
|
|
238
|
+
}));
|
|
222
239
|
const handlePickupRefCancel = () => {
|
|
223
|
-
if (
|
|
240
|
+
if (submittingRef.current) return;
|
|
224
241
|
setPickupRefOpen(false);
|
|
225
242
|
};
|
|
226
|
-
const handleAddOnConfirm = function() {
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
yield doSubmit();
|
|
231
|
-
});
|
|
232
|
-
return function handleAddOnConfirm() {
|
|
233
|
-
return _ref5.apply(this, arguments);
|
|
234
|
-
};
|
|
235
|
-
}();
|
|
243
|
+
const handleAddOnConfirm = () => runSubmitAction(require_asyncToGenerator._asyncToGenerator(function* () {
|
|
244
|
+
setAddOnConfirmOpen(false);
|
|
245
|
+
yield doSubmit();
|
|
246
|
+
}));
|
|
236
247
|
const handleAddOnReturn = () => {
|
|
237
|
-
if (
|
|
248
|
+
if (submittingRef.current) return;
|
|
238
249
|
setAddOnConfirmOpen(false);
|
|
239
250
|
};
|
|
240
251
|
const noteContent = /* @__PURE__ */ react.default.createElement("div", { className: "pisell-scan-order-check-note" }, /* @__PURE__ */ react.default.createElement("div", { className: "pisell-scan-order-check-note-title" }, noteTitle), /* @__PURE__ */ react.default.createElement(antd.Input.TextArea, {
|
|
@@ -32,6 +32,9 @@ var locales_default = {
|
|
|
32
32
|
"pisell2.scan.order.check.cart.empty.tip": "Please go back to add products",
|
|
33
33
|
"pisell2.scan.order.submit.disabled.default": "Order submission is currently disabled.",
|
|
34
34
|
"pisell2.scan.order.submit.failed": "Failed to submit order",
|
|
35
|
+
"pisell2.scan.order.menu.unavailable.title": "Ordering time has ended",
|
|
36
|
+
"pisell2.scan.order.menu.unavailable.description": "Some items in your cart are no longer available to order at this time. Select Confirm to refresh the page and choose your items again.",
|
|
37
|
+
"pisell2.scan.order.menu.validation.failed": "Unable to check the ordering time. Please try again. Your cart has been kept.",
|
|
35
38
|
"pisell2.scan.order.multiple.orders.tip": "There are multiple active orders for this table. Please contact staff for add-on orders.",
|
|
36
39
|
"pisell2.scan.order.multiple.orders.confirm": "I Got It",
|
|
37
40
|
"pisell2.scan.order.settled.cannot.add.tip": "This order has already been settled and you cannot add more items. Please scan again to create a new order or contact staff.",
|
|
@@ -97,6 +100,9 @@ var locales_default = {
|
|
|
97
100
|
"pisell2.scan.order.check.cart.empty.tip": "请返回添加商品",
|
|
98
101
|
"pisell2.scan.order.submit.disabled.default": "当前暂不可下单",
|
|
99
102
|
"pisell2.scan.order.submit.failed": "订单提交失败",
|
|
103
|
+
"pisell2.scan.order.menu.unavailable.title": "已过可下单时间",
|
|
104
|
+
"pisell2.scan.order.menu.unavailable.description": "购物车中有商品已不在可下单时间内。点击确定后将刷新页面,请重新选择商品。",
|
|
105
|
+
"pisell2.scan.order.menu.validation.failed": "暂时无法校验商品的可下单时间,请重试。购物车已保留。",
|
|
100
106
|
"pisell2.scan.order.multiple.orders.tip": "当前桌台存在多个进行中的订单,请联系店员处理加餐。",
|
|
101
107
|
"pisell2.scan.order.multiple.orders.confirm": "我知道了",
|
|
102
108
|
"pisell2.scan.order.settled.cannot.add.tip": "当前订单已结账,无法继续加餐。请重新扫码创建新订单或联系店员。",
|
|
@@ -162,6 +168,9 @@ var locales_default = {
|
|
|
162
168
|
"pisell2.scan.order.check.cart.empty.tip": "請返回添加商品",
|
|
163
169
|
"pisell2.scan.order.submit.disabled.default": "當前暫不可下單",
|
|
164
170
|
"pisell2.scan.order.submit.failed": "訂單提交失敗",
|
|
171
|
+
"pisell2.scan.order.menu.unavailable.title": "已過可下單時間",
|
|
172
|
+
"pisell2.scan.order.menu.unavailable.description": "購物車中有商品已不在可下單時間內。點擊確定後將重新整理頁面,請重新選擇商品。",
|
|
173
|
+
"pisell2.scan.order.menu.validation.failed": "暫時無法核實商品的可下單時間,請重試。購物車已保留。",
|
|
165
174
|
"pisell2.scan.order.multiple.orders.tip": "當前桌台存在多個進行中的訂單,請聯繫店員處理加餐。",
|
|
166
175
|
"pisell2.scan.order.multiple.orders.confirm": "我知道了",
|
|
167
176
|
"pisell2.scan.order.settled.cannot.add.tip": "當前訂單已結賬,無法繼續加餐。請重新掃碼創建新訂單或聯繫店員。",
|
|
@@ -227,6 +236,9 @@ var locales_default = {
|
|
|
227
236
|
"pisell2.scan.order.check.cart.empty.tip": "商品を追加するには、前の画面に戻ってください",
|
|
228
237
|
"pisell2.scan.order.submit.disabled.default": "現在、注文を送信できません。",
|
|
229
238
|
"pisell2.scan.order.submit.failed": "注文の送信に失敗しました",
|
|
239
|
+
"pisell2.scan.order.menu.unavailable.title": "注文可能な時間を過ぎています",
|
|
240
|
+
"pisell2.scan.order.menu.unavailable.description": "カートに注文可能な時間を過ぎた商品があります。「確認」を押すとページが再読み込みされます。商品を選び直してください。",
|
|
241
|
+
"pisell2.scan.order.menu.validation.failed": "注文可能な時間を確認できませんでした。もう一度お試しください。カートの内容は保持されています。",
|
|
230
242
|
"pisell2.scan.order.multiple.orders.tip": "現在のテーブルには進行中の注文が複数あります。追加注文についてはスタッフにお問い合わせください。",
|
|
231
243
|
"pisell2.scan.order.multiple.orders.confirm": "了解しました",
|
|
232
244
|
"pisell2.scan.order.settled.cannot.add.tip": "現在の注文はすでに会計済みのため、追加注文できません。再度QRコードをスキャンして新しい注文を作成するか、スタッフにお問い合わせください。",
|
|
@@ -292,6 +304,9 @@ var locales_default = {
|
|
|
292
304
|
"pisell2.scan.order.check.cart.empty.tip": "Volte para adicionar produtos",
|
|
293
305
|
"pisell2.scan.order.submit.disabled.default": "No momento, não é possível enviar pedidos.",
|
|
294
306
|
"pisell2.scan.order.submit.failed": "Falha ao enviar o pedido",
|
|
307
|
+
"pisell2.scan.order.menu.unavailable.title": "O horário para pedidos terminou",
|
|
308
|
+
"pisell2.scan.order.menu.unavailable.description": "Alguns itens no carrinho não estão mais disponíveis para pedido neste horário. Selecione Confirmar para atualizar a página e escolher os itens novamente.",
|
|
309
|
+
"pisell2.scan.order.menu.validation.failed": "Não foi possível verificar o horário para pedidos. Tente novamente. Seu carrinho foi mantido.",
|
|
295
310
|
"pisell2.scan.order.multiple.orders.tip": "Há vários pedidos ativos nesta mesa. Entre em contato com a equipe para adicionar itens.",
|
|
296
311
|
"pisell2.scan.order.multiple.orders.confirm": "Entendi",
|
|
297
312
|
"pisell2.scan.order.settled.cannot.add.tip": "Este pedido já foi finalizado e não é possível adicionar mais itens. Escaneie novamente para criar um novo pedido ou entre em contato com a equipe.",
|
|
@@ -33,7 +33,7 @@ function hasHolderFormFields(formDataConfig) {
|
|
|
33
33
|
return Array.isArray(formDataConfig === null || formDataConfig === void 0 ? void 0 : formDataConfig.field) || Array.isArray(formDataConfig === null || formDataConfig === void 0 ? void 0 : formDataConfig.form_field);
|
|
34
34
|
}
|
|
35
35
|
const BookingEditHolderField = ({ state, cacheItem, required, value, onChange, getCurrentCacheItem, presentation = "modal" }) => {
|
|
36
|
-
var _context$appHelper, _currentCacheItem$_ex, _cacheItem$_extend, _inlinePet$formData, _state$pet, _state$pet6, _state$pet7, _state$pet8, _inlineState$pet2, _state$client2, _inlineState$
|
|
36
|
+
var _context$appHelper, _currentCacheItem$_ex, _cacheItem$_extend, _inlinePet$formData, _state$pet, _state$pet6, _state$pet7, _state$pet8, _inlineState$client, _inlineState$pet2, _state$client2, _inlineState$client6;
|
|
37
37
|
const bridges = require_SalesSdkHostBridgesContext.useSalesSdkHostBridges();
|
|
38
38
|
const platform = require_useEngineContext.usePlatform();
|
|
39
39
|
const context = require_useEngineContext.default();
|
|
@@ -124,6 +124,33 @@ const BookingEditHolderField = ({ state, cacheItem, required, value, onChange, g
|
|
|
124
124
|
const handleApply = (0, react.useCallback)((nextValues) => {
|
|
125
125
|
onChange === null || onChange === void 0 || onChange(nextValues);
|
|
126
126
|
}, [onChange]);
|
|
127
|
+
const defaultSelectionKey = JSON.stringify([inlineState === null || inlineState === void 0 || (_inlineState$client = inlineState.client) === null || _inlineState$client === void 0 || (_inlineState$client = _inlineState$client.value) === null || _inlineState$client === void 0 ? void 0 : _inlineState$client.id, currentHolderFormId]);
|
|
128
|
+
const defaultSelectionRef = (0, react.useRef)(null);
|
|
129
|
+
(0, react.useEffect)(() => {
|
|
130
|
+
var _ref4, _holder$id;
|
|
131
|
+
if (!isInline || !isRequired || maxSelectedCount !== 1) return;
|
|
132
|
+
if (defaultSelectionRef.current === defaultSelectionKey) return;
|
|
133
|
+
if (selectedValues.length) {
|
|
134
|
+
defaultSelectionRef.current = defaultSelectionKey;
|
|
135
|
+
return;
|
|
136
|
+
}
|
|
137
|
+
if (!Array.isArray(inlinePet.holders)) return;
|
|
138
|
+
if (inlinePet.holders.length !== 1) return;
|
|
139
|
+
const holder = inlinePet.holders[0];
|
|
140
|
+
const id = (_ref4 = (_holder$id = holder === null || holder === void 0 ? void 0 : holder.id) !== null && _holder$id !== void 0 ? _holder$id : holder === null || holder === void 0 ? void 0 : holder.form_record_id) !== null && _ref4 !== void 0 ? _ref4 : holder === null || holder === void 0 ? void 0 : holder.value;
|
|
141
|
+
if (id == null) return;
|
|
142
|
+
defaultSelectionRef.current = defaultSelectionKey;
|
|
143
|
+
setSelectedValues([id]);
|
|
144
|
+
handleApply([id]);
|
|
145
|
+
}, [
|
|
146
|
+
defaultSelectionKey,
|
|
147
|
+
handleApply,
|
|
148
|
+
inlinePet.holders,
|
|
149
|
+
isInline,
|
|
150
|
+
isRequired,
|
|
151
|
+
maxSelectedCount,
|
|
152
|
+
selectedValues
|
|
153
|
+
]);
|
|
127
154
|
const { formDataConfig, isMinorAndWaiver } = (0, react.useMemo)(() => {
|
|
128
155
|
var _inlineState$pet;
|
|
129
156
|
const productHolderFormData = inlineState === null || inlineState === void 0 || (_inlineState$pet = inlineState.pet) === null || _inlineState$pet === void 0 || (_inlineState$pet = _inlineState$pet.formData) === null || _inlineState$pet === void 0 ? void 0 : _inlineState$pet[0];
|
|
@@ -141,9 +168,9 @@ const BookingEditHolderField = ({ state, cacheItem, required, value, onChange, g
|
|
|
141
168
|
};
|
|
142
169
|
}, [inlineState === null || inlineState === void 0 || (_inlineState$pet2 = inlineState.pet) === null || _inlineState$pet2 === void 0 ? void 0 : _inlineState$pet2.formData]);
|
|
143
170
|
const refreshHoldersFromServer = (0, ahooks.useMemoizedFn)(require_asyncToGenerator._asyncToGenerator(function* () {
|
|
144
|
-
var _inlineState$
|
|
171
|
+
var _inlineState$client2;
|
|
145
172
|
const params = require_enrichCartLineHolderDisplay.buildHolderListRequestParams({
|
|
146
|
-
customerId: inlineState === null || inlineState === void 0 || (_inlineState$
|
|
173
|
+
customerId: inlineState === null || inlineState === void 0 || (_inlineState$client2 = inlineState.client) === null || _inlineState$client2 === void 0 || (_inlineState$client2 = _inlineState$client2.value) === null || _inlineState$client2 === void 0 ? void 0 : _inlineState$client2.id,
|
|
147
174
|
source: currentCacheItem
|
|
148
175
|
});
|
|
149
176
|
if (!params) return;
|
|
@@ -157,20 +184,23 @@ const BookingEditHolderField = ({ state, cacheItem, required, value, onChange, g
|
|
|
157
184
|
reloadHolderOptions();
|
|
158
185
|
return list;
|
|
159
186
|
}));
|
|
160
|
-
const
|
|
161
|
-
var
|
|
162
|
-
|
|
163
|
-
const id = (_ref4 = (_holder$id = holder === null || holder === void 0 ? void 0 : holder.id) !== null && _holder$id !== void 0 ? _holder$id : holder === null || holder === void 0 ? void 0 : holder.form_record_id) !== null && _ref4 !== void 0 ? _ref4 : holder === null || holder === void 0 ? void 0 : holder.value;
|
|
187
|
+
const applyCreatedHolderSelection = (0, ahooks.useMemoizedFn)((holder) => {
|
|
188
|
+
var _ref5, _holder$id2;
|
|
189
|
+
const id = (_ref5 = (_holder$id2 = holder === null || holder === void 0 ? void 0 : holder.id) !== null && _holder$id2 !== void 0 ? _holder$id2 : holder === null || holder === void 0 ? void 0 : holder.form_record_id) !== null && _ref5 !== void 0 ? _ref5 : holder === null || holder === void 0 ? void 0 : holder.value;
|
|
164
190
|
if (id == null || selectedValues.some((value) => String(value) === String(id))) return;
|
|
165
191
|
const nextValues = maxSelectedCount === 1 ? [id] : [...selectedValues.slice(0, Math.max(0, maxSelectedCount - 1)), id];
|
|
166
192
|
setSelectedValues(nextValues);
|
|
167
193
|
handleApply(nextValues);
|
|
168
194
|
});
|
|
195
|
+
const selectCreatedHolder = (0, ahooks.useMemoizedFn)((holder) => {
|
|
196
|
+
if (!isNormalProduct) return;
|
|
197
|
+
applyCreatedHolderSelection(holder);
|
|
198
|
+
});
|
|
169
199
|
const handleAddHolder = (0, ahooks.useMemoizedFn)(() => {
|
|
170
200
|
if (!action || !inlineState) return;
|
|
171
201
|
(function() {
|
|
172
|
-
var
|
|
173
|
-
var _inlineState$pet3, _waiverForm$form_id, _inlineState$
|
|
202
|
+
var _ref11 = require_asyncToGenerator._asyncToGenerator(function* () {
|
|
203
|
+
var _inlineState$pet3, _waiverForm$form_id, _inlineState$client3, _inlineState$pet4, _inlineState$client4;
|
|
174
204
|
let waiverForm = (_inlineState$pet3 = inlineState.pet) === null || _inlineState$pet3 === void 0 ? void 0 : _inlineState$pet3.waiverForm;
|
|
175
205
|
if (isMinorAndWaiver && !hasHolderFormFields(waiverForm)) {
|
|
176
206
|
waiverForm = yield require_waiverFormDetailCache.getCachedWaiverFormDetail(Number(isMinorAndWaiver), platform);
|
|
@@ -181,37 +211,45 @@ const BookingEditHolderField = ({ state, cacheItem, required, value, onChange, g
|
|
|
181
211
|
}
|
|
182
212
|
const resolvedActionFormDataConfig = require_productHolderConfig.ensureProductHolderFormId(isMinorAndWaiver ? require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, waiverForm), {}, {
|
|
183
213
|
form_id: (_waiverForm$form_id = waiverForm === null || waiverForm === void 0 ? void 0 : waiverForm.form_id) !== null && _waiverForm$form_id !== void 0 ? _waiverForm$form_id : Number(isMinorAndWaiver),
|
|
184
|
-
customer_id: (_inlineState$
|
|
214
|
+
customer_id: (_inlineState$client3 = inlineState.client) === null || _inlineState$client3 === void 0 || (_inlineState$client3 = _inlineState$client3.value) === null || _inlineState$client3 === void 0 ? void 0 : _inlineState$client3.id,
|
|
185
215
|
is_franchisor: formDataConfig === null || formDataConfig === void 0 ? void 0 : formDataConfig.is_franchisor
|
|
186
216
|
}) : require_objectSpread2._objectSpread2({}, formDataConfig || {}), currentCacheItem);
|
|
187
217
|
if (resolvedActionFormDataConfig.form_id === void 0 || resolvedActionFormDataConfig.form_id === null || resolvedActionFormDataConfig.form_id === "") {
|
|
188
218
|
antd.message.error(_pisell_utils.locales.getText("pisell-select-holder-form-unavailable"));
|
|
189
219
|
return;
|
|
190
220
|
}
|
|
221
|
+
const previousHolderIds = new Set((((_inlineState$pet4 = inlineState.pet) === null || _inlineState$pet4 === void 0 ? void 0 : _inlineState$pet4.holders) || []).map((holder) => {
|
|
222
|
+
var _ref6, _holder$id3;
|
|
223
|
+
return String((_ref6 = (_holder$id3 = holder.id) !== null && _holder$id3 !== void 0 ? _holder$id3 : holder.form_record_id) !== null && _ref6 !== void 0 ? _ref6 : holder.value);
|
|
224
|
+
}));
|
|
191
225
|
action({
|
|
192
226
|
type: "pisell1.goCustomFormAddData",
|
|
193
227
|
data: {
|
|
194
228
|
zIndex: 1101,
|
|
195
|
-
customerId: (_inlineState$
|
|
229
|
+
customerId: (_inlineState$client4 = inlineState.client) === null || _inlineState$client4 === void 0 || (_inlineState$client4 = _inlineState$client4.value) === null || _inlineState$client4 === void 0 ? void 0 : _inlineState$client4.id,
|
|
196
230
|
formDataConfig: resolvedActionFormDataConfig
|
|
197
231
|
},
|
|
198
232
|
callback: function() {
|
|
199
|
-
var
|
|
200
|
-
var _inlineState$
|
|
233
|
+
var _ref10 = require_asyncToGenerator._asyncToGenerator(function* (res) {
|
|
234
|
+
var _inlineState$client5, _inlineState$pet6;
|
|
201
235
|
const obj = {};
|
|
202
236
|
for (const item of Array.isArray(res) ? res : []) obj[item.key] = item.value;
|
|
203
237
|
if (isMinorAndWaiver) {
|
|
204
238
|
try {
|
|
205
239
|
const list = yield refreshHoldersFromServer();
|
|
240
|
+
if (isInline && !isNormalProduct) applyCreatedHolderSelection(list === null || list === void 0 ? void 0 : list.find((holder) => {
|
|
241
|
+
var _ref7, _holder$id4;
|
|
242
|
+
return !previousHolderIds.has(String((_ref7 = (_holder$id4 = holder.id) !== null && _holder$id4 !== void 0 ? _holder$id4 : holder.form_record_id) !== null && _ref7 !== void 0 ? _ref7 : holder.value));
|
|
243
|
+
}));
|
|
206
244
|
if (isNormalProduct) {
|
|
207
|
-
var _inlineState$
|
|
208
|
-
const previousIds = new Set((((_inlineState$
|
|
209
|
-
var
|
|
210
|
-
return String((
|
|
245
|
+
var _inlineState$pet5;
|
|
246
|
+
const previousIds = new Set((((_inlineState$pet5 = inlineState.pet) === null || _inlineState$pet5 === void 0 ? void 0 : _inlineState$pet5.holders) || []).map((holder) => {
|
|
247
|
+
var _ref8, _holder$id5;
|
|
248
|
+
return String((_ref8 = (_holder$id5 = holder.id) !== null && _holder$id5 !== void 0 ? _holder$id5 : holder.form_record_id) !== null && _ref8 !== void 0 ? _ref8 : holder.value);
|
|
211
249
|
}));
|
|
212
250
|
selectCreatedHolder(list === null || list === void 0 ? void 0 : list.find((holder) => {
|
|
213
|
-
var
|
|
214
|
-
return !previousIds.has(String((
|
|
251
|
+
var _ref9, _holder$id6;
|
|
252
|
+
return !previousIds.has(String((_ref9 = (_holder$id6 = holder.id) !== null && _holder$id6 !== void 0 ? _holder$id6 : holder.form_record_id) !== null && _ref9 !== void 0 ? _ref9 : holder.value));
|
|
215
253
|
}));
|
|
216
254
|
}
|
|
217
255
|
} catch (err) {
|
|
@@ -219,22 +257,23 @@ const BookingEditHolderField = ({ state, cacheItem, required, value, onChange, g
|
|
|
219
257
|
}
|
|
220
258
|
return;
|
|
221
259
|
}
|
|
222
|
-
if (require_utils$1.isWalkIn((_inlineState$
|
|
260
|
+
if (require_utils$1.isWalkIn((_inlineState$client5 = inlineState.client) === null || _inlineState$client5 === void 0 || (_inlineState$client5 = _inlineState$client5.value) === null || _inlineState$client5 === void 0 ? void 0 : _inlineState$client5.id)) return;
|
|
223
261
|
inlineDispatch({
|
|
224
262
|
type: "setPet",
|
|
225
|
-
payload: { holders: [obj, ...((_inlineState$
|
|
263
|
+
payload: { holders: [obj, ...((_inlineState$pet6 = inlineState.pet) === null || _inlineState$pet6 === void 0 ? void 0 : _inlineState$pet6.holders) || []] }
|
|
226
264
|
});
|
|
227
265
|
upsertHolderOptions([obj], currentCacheItem);
|
|
266
|
+
if (isInline && !isNormalProduct) applyCreatedHolderSelection(obj);
|
|
228
267
|
selectCreatedHolder(obj);
|
|
229
268
|
});
|
|
230
269
|
return function callback(_x) {
|
|
231
|
-
return
|
|
270
|
+
return _ref10.apply(this, arguments);
|
|
232
271
|
};
|
|
233
272
|
}()
|
|
234
273
|
});
|
|
235
274
|
});
|
|
236
275
|
return function run() {
|
|
237
|
-
return
|
|
276
|
+
return _ref11.apply(this, arguments);
|
|
238
277
|
};
|
|
239
278
|
})()().catch((error) => {
|
|
240
279
|
console.warn("[SalesSdk] open add holder form failed", error);
|
|
@@ -246,7 +285,7 @@ const BookingEditHolderField = ({ state, cacheItem, required, value, onChange, g
|
|
|
246
285
|
handleApply(nextValues);
|
|
247
286
|
}, [handleApply]);
|
|
248
287
|
const handleEdit = (0, react.useCallback)(function() {
|
|
249
|
-
var
|
|
288
|
+
var _ref12 = require_asyncToGenerator._asyncToGenerator(function* (event) {
|
|
250
289
|
var _latestCacheItem$_ext, _latestCacheItem$_ext2, _state$client;
|
|
251
290
|
event === null || event === void 0 || event.preventDefault();
|
|
252
291
|
const latestCacheItem = (getCurrentCacheItem === null || getCurrentCacheItem === void 0 ? void 0 : getCurrentCacheItem()) || cacheItem;
|
|
@@ -265,7 +304,7 @@ const BookingEditHolderField = ({ state, cacheItem, required, value, onChange, g
|
|
|
265
304
|
}
|
|
266
305
|
});
|
|
267
306
|
return function(_x2) {
|
|
268
|
-
return
|
|
307
|
+
return _ref12.apply(this, arguments);
|
|
269
308
|
};
|
|
270
309
|
}(), [
|
|
271
310
|
bridges.holder,
|
|
@@ -300,7 +339,7 @@ const BookingEditHolderField = ({ state, cacheItem, required, value, onChange, g
|
|
|
300
339
|
holders: inlineHolders,
|
|
301
340
|
productSource: currentCacheItem,
|
|
302
341
|
holderTitle: title,
|
|
303
|
-
customerId: inlineState === null || inlineState === void 0 || (_inlineState$
|
|
342
|
+
customerId: inlineState === null || inlineState === void 0 || (_inlineState$client6 = inlineState.client) === null || _inlineState$client6 === void 0 || (_inlineState$client6 = _inlineState$client6.value) === null || _inlineState$client6 === void 0 ? void 0 : _inlineState$client6.id,
|
|
304
343
|
initialValue: selectedValues,
|
|
305
344
|
maxSelectedCount,
|
|
306
345
|
onAddHolder: action ? handleAddHolder : void 0,
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
const require_objectSpread2 = require("../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
|
|
2
|
+
//#region src/plus/skuOptionsSelection/utils/normalizeSelectorLayout.ts
|
|
3
|
+
/** 商品选项的固定栅格默认在手机端使用单列,保留显式响应式配置。 */
|
|
4
|
+
const normalizeSelectorLayout = (layout) => {
|
|
5
|
+
var _colConfig$span, _colConfig$xs, _colConfig$sm;
|
|
6
|
+
if (!layout || layout.type !== "antdGrid" || layout.responsive) return layout || null;
|
|
7
|
+
const colConfig = layout.colConfig || {};
|
|
8
|
+
const span = (_colConfig$span = colConfig.span) !== null && _colConfig$span !== void 0 ? _colConfig$span : 24 / (layout.columns || 1);
|
|
9
|
+
return require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, layout), {}, { colConfig: require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, colConfig), {}, {
|
|
10
|
+
xs: (_colConfig$xs = colConfig.xs) !== null && _colConfig$xs !== void 0 ? _colConfig$xs : 24,
|
|
11
|
+
sm: (_colConfig$sm = colConfig.sm) !== null && _colConfig$sm !== void 0 ? _colConfig$sm : span
|
|
12
|
+
}) });
|
|
13
|
+
};
|
|
14
|
+
//#endregion
|
|
15
|
+
exports.normalizeSelectorLayout = normalizeSelectorLayout;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
const require_normalizeSelectorLayout = require("./normalizeSelectorLayout.js");
|
|
1
2
|
//#region src/plus/skuOptionsSelection/utils/resolveCollectionLayout.ts
|
|
2
3
|
function resolveCollectionLayout(collection, context, fallback) {
|
|
3
|
-
|
|
4
|
-
return typeof collection === "function" ? collection(context) : collection;
|
|
4
|
+
return require_normalizeSelectorLayout.normalizeSelectorLayout(!collection ? fallback : typeof collection === "function" ? collection(context) : collection) || fallback;
|
|
5
5
|
}
|
|
6
6
|
//#endregion
|
|
7
7
|
exports.resolveCollectionLayout = resolveCollectionLayout;
|