@pisell/private-materials 6.12.361 → 6.12.362
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/scanOrder/components/Check/index.js +95 -84
- package/es/components/scanOrder/locales.js +15 -0
- 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/index.js +11 -6
- package/lib/components/scanOrder/components/Check/index.js +94 -83
- package/lib/components/scanOrder/locales.js +15 -0
- 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
|
@@ -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", () => {
|
|
@@ -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.",
|
|
@@ -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;
|
|
@@ -11,6 +11,7 @@ const require_index$3 = require("./components/sortableWalletPassTypes/index.js")
|
|
|
11
11
|
const require_index$4 = require("./components/ValidityPeriodSelector/index.js");
|
|
12
12
|
const require_index$5 = require("./components/relationProduct/index.js");
|
|
13
13
|
const require_index$6 = require("./components/MobileWalletTemplate/index.js");
|
|
14
|
+
const require_index$7 = require("./components/PassDisplayConfig/index.js");
|
|
14
15
|
let react = require("react");
|
|
15
16
|
react = require_runtime.__toESM(react);
|
|
16
17
|
let antd = require("antd");
|
|
@@ -19,13 +20,14 @@ let _pisell_materials = require("@pisell/materials");
|
|
|
19
20
|
require("./WalletEditor.less");
|
|
20
21
|
//#region src/plus/walletEditor/WalletEditor.tsx
|
|
21
22
|
const WalletEditor = (0, react.forwardRef)((props, ref) => {
|
|
22
|
-
var _context$appHelper, _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4, _context$appHelper$ut5, _context$appHelper$ut6, _store$global;
|
|
23
|
+
var _context$appHelper, _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4, _context$appHelper$ut5, _context$appHelper$ut6, _store$global, _context$appHelper2, _context$appHelper2$g;
|
|
23
24
|
const { value, onChange, disabled = false, className, style } = props;
|
|
24
25
|
const context = require_useEngineContext.default();
|
|
25
26
|
if ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.utils) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.request) require_index.request.setRequest(context.appHelper.utils.request);
|
|
26
27
|
_pisell_utils.locales.init(require_locales.default, ((_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut = _context$appHelper$ut.storage) === null || _context$appHelper$ut === void 0 ? void 0 : _context$appHelper$ut.get("umi_locale")) || "en");
|
|
27
28
|
const amountSymbol = ((_context$appHelper$ut2 = (_context$appHelper$ut3 = context.appHelper.utils).getData) === null || _context$appHelper$ut2 === void 0 ? void 0 : _context$appHelper$ut2.call(_context$appHelper$ut3, "shop_symbol")) || "";
|
|
28
29
|
const shopName = ((_store$global = (((_context$appHelper$ut4 = (_context$appHelper$ut5 = context.appHelper.utils).getStore) === null || _context$appHelper$ut4 === void 0 || (_context$appHelper$ut4 = _context$appHelper$ut4.call(_context$appHelper$ut5)) === null || _context$appHelper$ut4 === void 0 || (_context$appHelper$ut6 = _context$appHelper$ut4.getState) === null || _context$appHelper$ut6 === void 0 ? void 0 : _context$appHelper$ut6.call(_context$appHelper$ut4)) || {}).global) === null || _store$global === void 0 || (_store$global = _store$global.shopDetail) === null || _store$global === void 0 ? void 0 : _store$global.name) || "";
|
|
30
|
+
const hasFranchisor = Boolean((_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 || (_context$appHelper2 = _context$appHelper2.utils) === null || _context$appHelper2 === void 0 || (_context$appHelper2 = _context$appHelper2.businessUtils) === null || _context$appHelper2 === void 0 || (_context$appHelper2$g = _context$appHelper2.getAppByModal) === null || _context$appHelper2$g === void 0 ? void 0 : _context$appHelper2$g.call(_context$appHelper2, "franchisor"));
|
|
29
31
|
const [sendConfigVisible, setSendConfigVisible] = (0, react.useState)(true);
|
|
30
32
|
const [previewVisible, setPreviewVisible] = (0, react.useState)(false);
|
|
31
33
|
const [form] = antd.Form.useForm();
|
|
@@ -120,7 +122,19 @@ const WalletEditor = (0, react.forwardRef)((props, ref) => {
|
|
|
120
122
|
}, /* @__PURE__ */ react.default.createElement(_pisell_materials.Translation, null)), /* @__PURE__ */ react.default.createElement(antd.Form.Item, {
|
|
121
123
|
label: _pisell_utils.locales.getText("validityPeriod"),
|
|
122
124
|
name: "valid_for"
|
|
123
|
-
}, /* @__PURE__ */ react.default.createElement(require_index$4.default, null)), /* @__PURE__ */ react.default.createElement(antd.Form.Item, {
|
|
125
|
+
}, /* @__PURE__ */ react.default.createElement(require_index$4.default, null)), hasFranchisor && /* @__PURE__ */ react.default.createElement(antd.Form.Item, {
|
|
126
|
+
label: _pisell_utils.locales.getText("passesShownInWallet"),
|
|
127
|
+
name: ["metadata", "pass_visibility"],
|
|
128
|
+
rules: [{ validator: function() {
|
|
129
|
+
var _ref2 = require_asyncToGenerator._asyncToGenerator(function* (_, value) {
|
|
130
|
+
var _value$shop_ids;
|
|
131
|
+
if ((value === null || value === void 0 ? void 0 : value.type) === "selected_franchisees" && !((_value$shop_ids = value.shop_ids) === null || _value$shop_ids === void 0 ? void 0 : _value$shop_ids.length)) throw new Error(_pisell_utils.locales.getText("passIssuerShopsRequired"));
|
|
132
|
+
});
|
|
133
|
+
return function validator(_x3, _x4) {
|
|
134
|
+
return _ref2.apply(this, arguments);
|
|
135
|
+
};
|
|
136
|
+
}() }]
|
|
137
|
+
}, /* @__PURE__ */ react.default.createElement(require_index$7.default, { disabled })), /* @__PURE__ */ react.default.createElement(antd.Form.Item, {
|
|
124
138
|
label: _pisell_utils.locales.getText("linkedPasses"),
|
|
125
139
|
name: "relation_id",
|
|
126
140
|
initialValue: []
|
|
@@ -129,7 +143,7 @@ const WalletEditor = (0, react.forwardRef)((props, ref) => {
|
|
|
129
143
|
name: ["metadata", "holder"],
|
|
130
144
|
initialValue: { type: "customer" },
|
|
131
145
|
rules: [{ validator: function() {
|
|
132
|
-
var
|
|
146
|
+
var _ref3 = require_asyncToGenerator._asyncToGenerator(function* (_, value) {
|
|
133
147
|
if ((value === null || value === void 0 ? void 0 : value.type) === "custom") {
|
|
134
148
|
var _value$custom, _holderSelectorRef$cu, _holderSelectorRef$cu2;
|
|
135
149
|
if (!(value === null || value === void 0 || (_value$custom = value.custom) === null || _value$custom === void 0 ? void 0 : _value$custom.custom_id)) return Promise.reject(new Error(_pisell_utils.locales.getText("pisell2.wallet-editor.holder.required")));
|
|
@@ -141,8 +155,8 @@ const WalletEditor = (0, react.forwardRef)((props, ref) => {
|
|
|
141
155
|
}
|
|
142
156
|
return Promise.resolve();
|
|
143
157
|
});
|
|
144
|
-
return function validator(
|
|
145
|
-
return
|
|
158
|
+
return function validator(_x5, _x6) {
|
|
159
|
+
return _ref3.apply(this, arguments);
|
|
146
160
|
};
|
|
147
161
|
}() }]
|
|
148
162
|
}, /* @__PURE__ */ react.default.createElement(HolderSelector, { ref: holderSelectorRef })), /* @__PURE__ */ react.default.createElement(antd.Form.Item, {
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
const require_runtime = require("../../../../_virtual/_rolldown/runtime.js");
|
|
2
|
+
const require_objectSpread2 = require("../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js");
|
|
3
|
+
const require_serve = require("./serve.js");
|
|
4
|
+
let react = require("react");
|
|
5
|
+
react = require_runtime.__toESM(react);
|
|
6
|
+
let antd = require("antd");
|
|
7
|
+
let _pisell_utils = require("@pisell/utils");
|
|
8
|
+
let ahooks = require("ahooks");
|
|
9
|
+
require("./index.less");
|
|
10
|
+
//#region src/plus/walletEditor/components/PassDisplayConfig/index.tsx
|
|
11
|
+
const PassDisplayConfig = ({ id, value = {
|
|
12
|
+
type: "self",
|
|
13
|
+
shop_ids: []
|
|
14
|
+
}, onChange, disabled = false }) => {
|
|
15
|
+
const { data: shops = [], loading, error, refresh } = (0, ahooks.useRequest)(require_serve.getFranchiseeShops, { ready: value.type === "selected_franchisees" });
|
|
16
|
+
return /* @__PURE__ */ react.default.createElement("div", {
|
|
17
|
+
id,
|
|
18
|
+
className: "wallet-pass-display-config"
|
|
19
|
+
}, /* @__PURE__ */ react.default.createElement("div", { className: "wallet-pass-display-config__label" }, _pisell_utils.locales.getText("showPassesIssuedBy")), /* @__PURE__ */ react.default.createElement("div", {
|
|
20
|
+
role: "radiogroup",
|
|
21
|
+
"aria-label": _pisell_utils.locales.getText("showPassesIssuedBy")
|
|
22
|
+
}, /* @__PURE__ */ react.default.createElement(antd.Radio.Group, {
|
|
23
|
+
className: "wallet-pass-display-config__scope",
|
|
24
|
+
value: value.type,
|
|
25
|
+
onChange: (event) => onChange === null || onChange === void 0 ? void 0 : onChange(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, value), {}, { type: event.target.value })),
|
|
26
|
+
disabled
|
|
27
|
+
}, /* @__PURE__ */ react.default.createElement(antd.Radio, {
|
|
28
|
+
value: "self",
|
|
29
|
+
className: "wallet-pass-display-config__option"
|
|
30
|
+
}, _pisell_utils.locales.getText("passIssuerCurrentShop")), /* @__PURE__ */ react.default.createElement(antd.Radio, {
|
|
31
|
+
value: "all_franchisees",
|
|
32
|
+
className: "wallet-pass-display-config__option"
|
|
33
|
+
}, _pisell_utils.locales.getText("passIssuerAllShops")), /* @__PURE__ */ react.default.createElement(antd.Radio, {
|
|
34
|
+
value: "selected_franchisees",
|
|
35
|
+
className: "wallet-pass-display-config__option"
|
|
36
|
+
}, _pisell_utils.locales.getText("passIssuerSpecifiedShops")))), value.type === "selected_franchisees" && /* @__PURE__ */ react.default.createElement("div", { className: "wallet-pass-display-config__shops" }, /* @__PURE__ */ react.default.createElement(antd.Select, {
|
|
37
|
+
className: "wallet-pass-display-config__shop-select",
|
|
38
|
+
mode: "multiple",
|
|
39
|
+
allowClear: true,
|
|
40
|
+
showSearch: true,
|
|
41
|
+
optionFilterProp: "name",
|
|
42
|
+
maxTagCount: "responsive",
|
|
43
|
+
placeholder: _pisell_utils.locales.getText("passIssuerSelectShops"),
|
|
44
|
+
"aria-label": _pisell_utils.locales.getText("passIssuerSelectShops"),
|
|
45
|
+
options: shops,
|
|
46
|
+
fieldNames: {
|
|
47
|
+
value: "source_shop_id",
|
|
48
|
+
label: "name"
|
|
49
|
+
},
|
|
50
|
+
loading,
|
|
51
|
+
notFoundContent: error && !loading ? /* @__PURE__ */ react.default.createElement(antd.Button, {
|
|
52
|
+
type: "link",
|
|
53
|
+
size: "small",
|
|
54
|
+
onClick: refresh
|
|
55
|
+
}, _pisell_utils.locales.getText("passIssuerLoadFailedRetry")) : void 0,
|
|
56
|
+
value: value.shop_ids,
|
|
57
|
+
onChange: (shop_ids) => onChange === null || onChange === void 0 ? void 0 : onChange(require_objectSpread2._objectSpread2(require_objectSpread2._objectSpread2({}, value), {}, { shop_ids })),
|
|
58
|
+
disabled
|
|
59
|
+
})));
|
|
60
|
+
};
|
|
61
|
+
//#endregion
|
|
62
|
+
exports.default = PassDisplayConfig;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
.wallet-pass-display-config {
|
|
2
|
+
&__label {
|
|
3
|
+
margin-bottom: 8px;
|
|
4
|
+
color: var(--Gray-600, #475467);
|
|
5
|
+
font-size: 14px;
|
|
6
|
+
line-height: 22px;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
[role='radiogroup'] .wallet-pass-display-config__scope {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: column;
|
|
12
|
+
gap: 8px;
|
|
13
|
+
|
|
14
|
+
.wallet-pass-display-config__option {
|
|
15
|
+
margin: 0;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
&__shops {
|
|
20
|
+
margin-top: 12px;
|
|
21
|
+
padding-left: 24px;
|
|
22
|
+
|
|
23
|
+
.wallet-pass-display-config__shop-select {
|
|
24
|
+
width: 100%;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
const require_asyncToGenerator = require("../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js");
|
|
2
|
+
const require_index = require("../../../../utils/index.js");
|
|
3
|
+
//#region src/plus/walletEditor/components/PassDisplayConfig/serve.ts
|
|
4
|
+
const getFranchiseeShops = function() {
|
|
5
|
+
var _ref = require_asyncToGenerator._asyncToGenerator(function* () {
|
|
6
|
+
const { data } = yield require_index.request.getRequest().get("/shop/franchisor/shop", {
|
|
7
|
+
skip: 1,
|
|
8
|
+
num: 199,
|
|
9
|
+
status: "approved"
|
|
10
|
+
}, { isShopApi: true });
|
|
11
|
+
return data.list;
|
|
12
|
+
});
|
|
13
|
+
return function getFranchiseeShops() {
|
|
14
|
+
return _ref.apply(this, arguments);
|
|
15
|
+
};
|
|
16
|
+
}();
|
|
17
|
+
//#endregion
|
|
18
|
+
exports.getFranchiseeShops = getFranchiseeShops;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { MultiLanguageTitle, SendConfig, ShowcaseWalletPassItem, ValidForConfig, WalletEditorProps, WalletEditorRef, WalletEditorValue, WalletMetadata, WalletPassType } from "./types.js";
|
|
1
|
+
import { MultiLanguageTitle, PassDisplayConfigValue, SendConfig, ShowcaseWalletPassItem, ValidForConfig, WalletEditorProps, WalletEditorRef, WalletEditorValue, WalletMetadata, WalletPassType } from "./types.js";
|
|
2
2
|
import { WalletEditor } from "./WalletEditor.js";
|