@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
|
@@ -13,7 +13,7 @@ import { buildHolderListRequestParams } from "../utils/enrichCartLineHolderDispl
|
|
|
13
13
|
import { useSalesSdkHolderOptional } from "../context/SalesSdkHolderContext.js";
|
|
14
14
|
import { SalesSdkSelectHolderModal } from "../components/SalesSdkSelectHolderModal.js";
|
|
15
15
|
import { useBookingEditPetState } from "./useBookingEditPetState.js";
|
|
16
|
-
import React, { useCallback, useEffect, useMemo, useState } from "react";
|
|
16
|
+
import React, { useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
17
17
|
import { Button, Col, Row, message } from "antd";
|
|
18
18
|
import { locales } from "@pisell/utils";
|
|
19
19
|
import { Iconfont } from "@pisell/materials";
|
|
@@ -31,7 +31,7 @@ function hasHolderFormFields(formDataConfig) {
|
|
|
31
31
|
return Array.isArray(formDataConfig === null || formDataConfig === void 0 ? void 0 : formDataConfig.field) || Array.isArray(formDataConfig === null || formDataConfig === void 0 ? void 0 : formDataConfig.form_field);
|
|
32
32
|
}
|
|
33
33
|
const BookingEditHolderField = ({ state, cacheItem, required, value, onChange, getCurrentCacheItem, presentation = "modal" }) => {
|
|
34
|
-
var _context$appHelper, _currentCacheItem$_ex, _cacheItem$_extend, _inlinePet$formData, _state$pet, _state$pet6, _state$pet7, _state$pet8, _inlineState$pet2, _state$client2, _inlineState$
|
|
34
|
+
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;
|
|
35
35
|
const bridges = useSalesSdkHostBridges();
|
|
36
36
|
const platform = usePlatform();
|
|
37
37
|
const context = useEngineContext();
|
|
@@ -122,6 +122,33 @@ const BookingEditHolderField = ({ state, cacheItem, required, value, onChange, g
|
|
|
122
122
|
const handleApply = useCallback((nextValues) => {
|
|
123
123
|
onChange === null || onChange === void 0 || onChange(nextValues);
|
|
124
124
|
}, [onChange]);
|
|
125
|
+
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]);
|
|
126
|
+
const defaultSelectionRef = useRef(null);
|
|
127
|
+
useEffect(() => {
|
|
128
|
+
var _ref4, _holder$id;
|
|
129
|
+
if (!isInline || !isRequired || maxSelectedCount !== 1) return;
|
|
130
|
+
if (defaultSelectionRef.current === defaultSelectionKey) return;
|
|
131
|
+
if (selectedValues.length) {
|
|
132
|
+
defaultSelectionRef.current = defaultSelectionKey;
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
if (!Array.isArray(inlinePet.holders)) return;
|
|
136
|
+
if (inlinePet.holders.length !== 1) return;
|
|
137
|
+
const holder = inlinePet.holders[0];
|
|
138
|
+
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;
|
|
139
|
+
if (id == null) return;
|
|
140
|
+
defaultSelectionRef.current = defaultSelectionKey;
|
|
141
|
+
setSelectedValues([id]);
|
|
142
|
+
handleApply([id]);
|
|
143
|
+
}, [
|
|
144
|
+
defaultSelectionKey,
|
|
145
|
+
handleApply,
|
|
146
|
+
inlinePet.holders,
|
|
147
|
+
isInline,
|
|
148
|
+
isRequired,
|
|
149
|
+
maxSelectedCount,
|
|
150
|
+
selectedValues
|
|
151
|
+
]);
|
|
125
152
|
const { formDataConfig, isMinorAndWaiver } = useMemo(() => {
|
|
126
153
|
var _inlineState$pet;
|
|
127
154
|
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];
|
|
@@ -139,9 +166,9 @@ const BookingEditHolderField = ({ state, cacheItem, required, value, onChange, g
|
|
|
139
166
|
};
|
|
140
167
|
}, [inlineState === null || inlineState === void 0 || (_inlineState$pet2 = inlineState.pet) === null || _inlineState$pet2 === void 0 ? void 0 : _inlineState$pet2.formData]);
|
|
141
168
|
const refreshHoldersFromServer = useMemoizedFn(_asyncToGenerator(function* () {
|
|
142
|
-
var _inlineState$
|
|
169
|
+
var _inlineState$client2;
|
|
143
170
|
const params = buildHolderListRequestParams({
|
|
144
|
-
customerId: inlineState === null || inlineState === void 0 || (_inlineState$
|
|
171
|
+
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,
|
|
145
172
|
source: currentCacheItem
|
|
146
173
|
});
|
|
147
174
|
if (!params) return;
|
|
@@ -155,20 +182,23 @@ const BookingEditHolderField = ({ state, cacheItem, required, value, onChange, g
|
|
|
155
182
|
reloadHolderOptions();
|
|
156
183
|
return list;
|
|
157
184
|
}));
|
|
158
|
-
const
|
|
159
|
-
var
|
|
160
|
-
|
|
161
|
-
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;
|
|
185
|
+
const applyCreatedHolderSelection = useMemoizedFn((holder) => {
|
|
186
|
+
var _ref5, _holder$id2;
|
|
187
|
+
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;
|
|
162
188
|
if (id == null || selectedValues.some((value) => String(value) === String(id))) return;
|
|
163
189
|
const nextValues = maxSelectedCount === 1 ? [id] : [...selectedValues.slice(0, Math.max(0, maxSelectedCount - 1)), id];
|
|
164
190
|
setSelectedValues(nextValues);
|
|
165
191
|
handleApply(nextValues);
|
|
166
192
|
});
|
|
193
|
+
const selectCreatedHolder = useMemoizedFn((holder) => {
|
|
194
|
+
if (!isNormalProduct) return;
|
|
195
|
+
applyCreatedHolderSelection(holder);
|
|
196
|
+
});
|
|
167
197
|
const handleAddHolder = useMemoizedFn(() => {
|
|
168
198
|
if (!action || !inlineState) return;
|
|
169
199
|
(function() {
|
|
170
|
-
var
|
|
171
|
-
var _inlineState$pet3, _waiverForm$form_id, _inlineState$
|
|
200
|
+
var _ref11 = _asyncToGenerator(function* () {
|
|
201
|
+
var _inlineState$pet3, _waiverForm$form_id, _inlineState$client3, _inlineState$pet4, _inlineState$client4;
|
|
172
202
|
let waiverForm = (_inlineState$pet3 = inlineState.pet) === null || _inlineState$pet3 === void 0 ? void 0 : _inlineState$pet3.waiverForm;
|
|
173
203
|
if (isMinorAndWaiver && !hasHolderFormFields(waiverForm)) {
|
|
174
204
|
waiverForm = yield getCachedWaiverFormDetail(Number(isMinorAndWaiver), platform);
|
|
@@ -179,37 +209,45 @@ const BookingEditHolderField = ({ state, cacheItem, required, value, onChange, g
|
|
|
179
209
|
}
|
|
180
210
|
const resolvedActionFormDataConfig = ensureProductHolderFormId(isMinorAndWaiver ? _objectSpread2(_objectSpread2({}, waiverForm), {}, {
|
|
181
211
|
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),
|
|
182
|
-
customer_id: (_inlineState$
|
|
212
|
+
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,
|
|
183
213
|
is_franchisor: formDataConfig === null || formDataConfig === void 0 ? void 0 : formDataConfig.is_franchisor
|
|
184
214
|
}) : _objectSpread2({}, formDataConfig || {}), currentCacheItem);
|
|
185
215
|
if (resolvedActionFormDataConfig.form_id === void 0 || resolvedActionFormDataConfig.form_id === null || resolvedActionFormDataConfig.form_id === "") {
|
|
186
216
|
message.error(locales.getText("pisell-select-holder-form-unavailable"));
|
|
187
217
|
return;
|
|
188
218
|
}
|
|
219
|
+
const previousHolderIds = new Set((((_inlineState$pet4 = inlineState.pet) === null || _inlineState$pet4 === void 0 ? void 0 : _inlineState$pet4.holders) || []).map((holder) => {
|
|
220
|
+
var _ref6, _holder$id3;
|
|
221
|
+
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);
|
|
222
|
+
}));
|
|
189
223
|
action({
|
|
190
224
|
type: "pisell1.goCustomFormAddData",
|
|
191
225
|
data: {
|
|
192
226
|
zIndex: 1101,
|
|
193
|
-
customerId: (_inlineState$
|
|
227
|
+
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,
|
|
194
228
|
formDataConfig: resolvedActionFormDataConfig
|
|
195
229
|
},
|
|
196
230
|
callback: function() {
|
|
197
|
-
var
|
|
198
|
-
var _inlineState$
|
|
231
|
+
var _ref10 = _asyncToGenerator(function* (res) {
|
|
232
|
+
var _inlineState$client5, _inlineState$pet6;
|
|
199
233
|
const obj = {};
|
|
200
234
|
for (const item of Array.isArray(res) ? res : []) obj[item.key] = item.value;
|
|
201
235
|
if (isMinorAndWaiver) {
|
|
202
236
|
try {
|
|
203
237
|
const list = yield refreshHoldersFromServer();
|
|
238
|
+
if (isInline && !isNormalProduct) applyCreatedHolderSelection(list === null || list === void 0 ? void 0 : list.find((holder) => {
|
|
239
|
+
var _ref7, _holder$id4;
|
|
240
|
+
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));
|
|
241
|
+
}));
|
|
204
242
|
if (isNormalProduct) {
|
|
205
|
-
var _inlineState$
|
|
206
|
-
const previousIds = new Set((((_inlineState$
|
|
207
|
-
var
|
|
208
|
-
return String((
|
|
243
|
+
var _inlineState$pet5;
|
|
244
|
+
const previousIds = new Set((((_inlineState$pet5 = inlineState.pet) === null || _inlineState$pet5 === void 0 ? void 0 : _inlineState$pet5.holders) || []).map((holder) => {
|
|
245
|
+
var _ref8, _holder$id5;
|
|
246
|
+
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);
|
|
209
247
|
}));
|
|
210
248
|
selectCreatedHolder(list === null || list === void 0 ? void 0 : list.find((holder) => {
|
|
211
|
-
var
|
|
212
|
-
return !previousIds.has(String((
|
|
249
|
+
var _ref9, _holder$id6;
|
|
250
|
+
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));
|
|
213
251
|
}));
|
|
214
252
|
}
|
|
215
253
|
} catch (err) {
|
|
@@ -217,22 +255,23 @@ const BookingEditHolderField = ({ state, cacheItem, required, value, onChange, g
|
|
|
217
255
|
}
|
|
218
256
|
return;
|
|
219
257
|
}
|
|
220
|
-
if (isWalkIn((_inlineState$
|
|
258
|
+
if (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;
|
|
221
259
|
inlineDispatch({
|
|
222
260
|
type: "setPet",
|
|
223
|
-
payload: { holders: [obj, ...((_inlineState$
|
|
261
|
+
payload: { holders: [obj, ...((_inlineState$pet6 = inlineState.pet) === null || _inlineState$pet6 === void 0 ? void 0 : _inlineState$pet6.holders) || []] }
|
|
224
262
|
});
|
|
225
263
|
upsertHolderOptions([obj], currentCacheItem);
|
|
264
|
+
if (isInline && !isNormalProduct) applyCreatedHolderSelection(obj);
|
|
226
265
|
selectCreatedHolder(obj);
|
|
227
266
|
});
|
|
228
267
|
return function callback(_x) {
|
|
229
|
-
return
|
|
268
|
+
return _ref10.apply(this, arguments);
|
|
230
269
|
};
|
|
231
270
|
}()
|
|
232
271
|
});
|
|
233
272
|
});
|
|
234
273
|
return function run() {
|
|
235
|
-
return
|
|
274
|
+
return _ref11.apply(this, arguments);
|
|
236
275
|
};
|
|
237
276
|
})()().catch((error) => {
|
|
238
277
|
console.warn("[SalesSdk] open add holder form failed", error);
|
|
@@ -244,7 +283,7 @@ const BookingEditHolderField = ({ state, cacheItem, required, value, onChange, g
|
|
|
244
283
|
handleApply(nextValues);
|
|
245
284
|
}, [handleApply]);
|
|
246
285
|
const handleEdit = useCallback(function() {
|
|
247
|
-
var
|
|
286
|
+
var _ref12 = _asyncToGenerator(function* (event) {
|
|
248
287
|
var _latestCacheItem$_ext, _latestCacheItem$_ext2, _state$client;
|
|
249
288
|
event === null || event === void 0 || event.preventDefault();
|
|
250
289
|
const latestCacheItem = (getCurrentCacheItem === null || getCurrentCacheItem === void 0 ? void 0 : getCurrentCacheItem()) || cacheItem;
|
|
@@ -263,7 +302,7 @@ const BookingEditHolderField = ({ state, cacheItem, required, value, onChange, g
|
|
|
263
302
|
}
|
|
264
303
|
});
|
|
265
304
|
return function(_x2) {
|
|
266
|
-
return
|
|
305
|
+
return _ref12.apply(this, arguments);
|
|
267
306
|
};
|
|
268
307
|
}(), [
|
|
269
308
|
bridges.holder,
|
|
@@ -298,7 +337,7 @@ const BookingEditHolderField = ({ state, cacheItem, required, value, onChange, g
|
|
|
298
337
|
holders: inlineHolders,
|
|
299
338
|
productSource: currentCacheItem,
|
|
300
339
|
holderTitle: title,
|
|
301
|
-
customerId: inlineState === null || inlineState === void 0 || (_inlineState$
|
|
340
|
+
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,
|
|
302
341
|
initialValue: selectedValues,
|
|
303
342
|
maxSelectedCount,
|
|
304
343
|
onAddHolder: action ? handleAddHolder : void 0,
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import "./hosts/createInstanceHostBridge.js";
|
|
2
|
+
import "./holderConfirm/createHolderConfirmBridge.js";
|
|
3
|
+
import "./giftSelect/createGiftSelectBridge.js";
|
|
4
|
+
import "./context/SalesSdkHostBridgesContext.js";
|
|
5
|
+
import "./utils/formatHolderOptions.js";
|
|
6
|
+
import "./utils/enrichCartLineHolderDisplay.js";
|
|
7
|
+
import "./context/SalesSdkHolderContext.js";
|
|
8
|
+
import "../multiCurrencySettlement/index.js";
|
|
9
|
+
import "./utils/customerAuthGate.js";
|
|
10
|
+
import "./context/SalesSdkBusinessAvailabilityContext.js";
|
|
11
|
+
import "./utils/appendPromotionTags.js";
|
|
12
|
+
import "./utils/productSkuOptions.js";
|
|
13
|
+
import "./context/SalesSdkUIHostsContext.js";
|
|
14
|
+
import "./utils/runAddProductFlow.js";
|
|
15
|
+
import "./components/showAddToCartToast.js";
|
|
16
|
+
import "./utils/resolveAddProductDebounceKey.js";
|
|
17
|
+
import "./utils/identity.js";
|
|
18
|
+
import "./utils/resolveInCartQuantityForAddToast.js";
|
|
19
|
+
import "./utils/addProductWithFlowDebounced.js";
|
|
20
|
+
import "./utils/bookingDate.js";
|
|
21
|
+
import "./utils/holderSubmitValidation.js";
|
|
22
|
+
import "./utils/removeOrderProducts.js";
|
|
23
|
+
import "./selectors.js";
|
|
24
|
+
import "./utils/enrich.js";
|
|
25
|
+
import "./giftSelect/createOpenGiftSelectHost.js";
|
|
26
|
+
import "./utils/ensureHoldersBeforeSubmit.js";
|
|
27
|
+
import "./hooks/useSalesSdk.js";
|
|
28
|
+
import "./bookingEditService/BookingEditServiceDrawer.js";
|
|
29
|
+
import "./hosts/BookingEditHostRenderer.js";
|
|
30
|
+
import "./hosts/CustomerAuthHostRenderer.js";
|
|
31
|
+
import "./hooks/useSalesSdkCart.js";
|
|
32
|
+
import "./hooks/useSalesSdkCustomer.js";
|
|
33
|
+
import "./normalProductDetail/NormalProductDetailHostRenderer.js";
|
|
34
|
+
import "./hosts/createOpenBookingEditHost.js";
|
|
35
|
+
import "./hosts/createOpenMultiDaySelectHost.js";
|
|
36
|
+
import "./hosts/createOpenHolderSelectHost.js";
|
|
37
|
+
import "./hosts/createOpenCustomerAuthHost.js";
|
|
38
|
+
import "./demo/hosts/legacyOpenProductDetail.js";
|
|
39
|
+
import "./hosts/createCompositeOpenProductDetailHost.js";
|
|
40
|
+
import "./normalProductDetail/createOpenNormalProductDetailHost.js";
|
|
41
|
+
import "./normalProductDetail/createOpenBookingSelectionFlowHost.js";
|
|
42
|
+
import "./giftSelect/GiftSelectModal.js";
|
|
43
|
+
import "./giftSelect/GiftSelectHostRenderer.js";
|
|
44
|
+
import "./allergy/AllergySelectionModal.js";
|
|
45
|
+
import "./context/SalesSdkProvider.js";
|
|
46
|
+
import "./context/SalesSdkDishContext.js";
|
|
47
|
+
import "./context/SalesSdkBookingContext.js";
|
|
48
|
+
import "./hooks/useSalesSdkSummary.js";
|
|
49
|
+
import "./hooks/useSalesSdkProducts.js";
|
|
50
|
+
import "./demo/index.js";
|
|
51
|
+
import "./hooks/useSalesSdkDish.js";
|
|
52
|
+
import "./hooks/useCurrentSalesSdkDish.js";
|
|
53
|
+
import "./hooks/useSyncOsModule.js";
|
|
54
|
+
export {};
|
|
@@ -31,4 +31,4 @@ function subscribeBookingDateChange(bookingTicket, callback) {
|
|
|
31
31
|
return typeof off === "function" ? off : () => {};
|
|
32
32
|
}
|
|
33
33
|
//#endregion
|
|
34
|
-
export { formatBookingDateTime, subscribeBookingDateChange };
|
|
34
|
+
export { BOOKING_CONTEXT_DATE_EVENT, formatBookingDateTime, subscribeBookingDateChange };
|
|
@@ -102,4 +102,4 @@ function buildHolderListRequestKey(params) {
|
|
|
102
102
|
});
|
|
103
103
|
}
|
|
104
104
|
//#endregion
|
|
105
|
-
export { buildHolderListRequestKey, buildHolderListRequestParams, enrichCartBookingHolderDisplay, enrichCartProductHolderDisplay, resolveHolderDisplayConfig };
|
|
105
|
+
export { buildHolderListRequestKey, buildHolderListRequestParams, enrichCartBookingHolderDisplay, enrichCartProductHolderDisplay, pickHolderIdFromBooking, resolveHolderDisplayConfig };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { _objectSpread2 } from "../../../_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 _objectSpread2(_objectSpread2({}, layout), {}, { colConfig: _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
|
+
export { normalizeSelectorLayout };
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { normalizeSelectorLayout } from "./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 normalizeSelectorLayout(!collection ? fallback : typeof collection === "function" ? collection(context) : collection) || fallback;
|
|
5
5
|
}
|
|
6
6
|
//#endregion
|
|
7
7
|
export { resolveCollectionLayout };
|
|
@@ -10,6 +10,7 @@ import SortableWalletPassTypes, { DEFAULT_WALLET_PASS_TYPES_CONFIG } from "./com
|
|
|
10
10
|
import ValidityPeriodSelector from "./components/ValidityPeriodSelector/index.js";
|
|
11
11
|
import RelationProduct from "./components/relationProduct/index.js";
|
|
12
12
|
import MobileWalletTemplate from "./components/MobileWalletTemplate/index.js";
|
|
13
|
+
import PassDisplayConfig from "./components/PassDisplayConfig/index.js";
|
|
13
14
|
import React, { forwardRef, useCallback, useEffect, useImperativeHandle, useMemo, useRef, useState } from "react";
|
|
14
15
|
import { Form, InputNumber, Radio } from "antd";
|
|
15
16
|
import { locales } from "@pisell/utils";
|
|
@@ -17,13 +18,14 @@ import { Icon, PisellModal, Translation, WalletCard } from "@pisell/materials";
|
|
|
17
18
|
import "./WalletEditor.less";
|
|
18
19
|
//#region src/plus/walletEditor/WalletEditor.tsx
|
|
19
20
|
const WalletEditor = forwardRef((props, ref) => {
|
|
20
|
-
var _context$appHelper, _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4, _context$appHelper$ut5, _context$appHelper$ut6, _store$global;
|
|
21
|
+
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;
|
|
21
22
|
const { value, onChange, disabled = false, className, style } = props;
|
|
22
23
|
const context = useEngineContext();
|
|
23
24
|
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) request.setRequest(context.appHelper.utils.request);
|
|
24
25
|
locales.init(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");
|
|
25
26
|
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")) || "";
|
|
26
27
|
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) || "";
|
|
28
|
+
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"));
|
|
27
29
|
const [sendConfigVisible, setSendConfigVisible] = useState(true);
|
|
28
30
|
const [previewVisible, setPreviewVisible] = useState(false);
|
|
29
31
|
const [form] = Form.useForm();
|
|
@@ -118,7 +120,19 @@ const WalletEditor = forwardRef((props, ref) => {
|
|
|
118
120
|
}, /* @__PURE__ */ React.createElement(Translation, null)), /* @__PURE__ */ React.createElement(Form.Item, {
|
|
119
121
|
label: locales.getText("validityPeriod"),
|
|
120
122
|
name: "valid_for"
|
|
121
|
-
}, /* @__PURE__ */ React.createElement(ValidityPeriodSelector, null)), /* @__PURE__ */ React.createElement(Form.Item, {
|
|
123
|
+
}, /* @__PURE__ */ React.createElement(ValidityPeriodSelector, null)), hasFranchisor && /* @__PURE__ */ React.createElement(Form.Item, {
|
|
124
|
+
label: locales.getText("passesShownInWallet"),
|
|
125
|
+
name: ["metadata", "pass_visibility"],
|
|
126
|
+
rules: [{ validator: function() {
|
|
127
|
+
var _ref2 = _asyncToGenerator(function* (_, value) {
|
|
128
|
+
var _value$shop_ids;
|
|
129
|
+
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(locales.getText("passIssuerShopsRequired"));
|
|
130
|
+
});
|
|
131
|
+
return function validator(_x3, _x4) {
|
|
132
|
+
return _ref2.apply(this, arguments);
|
|
133
|
+
};
|
|
134
|
+
}() }]
|
|
135
|
+
}, /* @__PURE__ */ React.createElement(PassDisplayConfig, { disabled })), /* @__PURE__ */ React.createElement(Form.Item, {
|
|
122
136
|
label: locales.getText("linkedPasses"),
|
|
123
137
|
name: "relation_id",
|
|
124
138
|
initialValue: []
|
|
@@ -127,7 +141,7 @@ const WalletEditor = forwardRef((props, ref) => {
|
|
|
127
141
|
name: ["metadata", "holder"],
|
|
128
142
|
initialValue: { type: "customer" },
|
|
129
143
|
rules: [{ validator: function() {
|
|
130
|
-
var
|
|
144
|
+
var _ref3 = _asyncToGenerator(function* (_, value) {
|
|
131
145
|
if ((value === null || value === void 0 ? void 0 : value.type) === "custom") {
|
|
132
146
|
var _value$custom, _holderSelectorRef$cu, _holderSelectorRef$cu2;
|
|
133
147
|
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(locales.getText("pisell2.wallet-editor.holder.required")));
|
|
@@ -139,8 +153,8 @@ const WalletEditor = forwardRef((props, ref) => {
|
|
|
139
153
|
}
|
|
140
154
|
return Promise.resolve();
|
|
141
155
|
});
|
|
142
|
-
return function validator(
|
|
143
|
-
return
|
|
156
|
+
return function validator(_x5, _x6) {
|
|
157
|
+
return _ref3.apply(this, arguments);
|
|
144
158
|
};
|
|
145
159
|
}() }]
|
|
146
160
|
}, /* @__PURE__ */ React.createElement(HolderSelector, { ref: holderSelectorRef })), /* @__PURE__ */ React.createElement(Form.Item, {
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { _objectSpread2 } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/objectSpread2.js";
|
|
2
|
+
import { getFranchiseeShops } from "./serve.js";
|
|
3
|
+
import React from "react";
|
|
4
|
+
import { Button, Radio, Select } from "antd";
|
|
5
|
+
import { locales } from "@pisell/utils";
|
|
6
|
+
import { useRequest } from "ahooks";
|
|
7
|
+
import "./index.less";
|
|
8
|
+
//#region src/plus/walletEditor/components/PassDisplayConfig/index.tsx
|
|
9
|
+
const PassDisplayConfig = ({ id, value = {
|
|
10
|
+
type: "self",
|
|
11
|
+
shop_ids: []
|
|
12
|
+
}, onChange, disabled = false }) => {
|
|
13
|
+
const { data: shops = [], loading, error, refresh } = useRequest(getFranchiseeShops, { ready: value.type === "selected_franchisees" });
|
|
14
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
15
|
+
id,
|
|
16
|
+
className: "wallet-pass-display-config"
|
|
17
|
+
}, /* @__PURE__ */ React.createElement("div", { className: "wallet-pass-display-config__label" }, locales.getText("showPassesIssuedBy")), /* @__PURE__ */ React.createElement("div", {
|
|
18
|
+
role: "radiogroup",
|
|
19
|
+
"aria-label": locales.getText("showPassesIssuedBy")
|
|
20
|
+
}, /* @__PURE__ */ React.createElement(Radio.Group, {
|
|
21
|
+
className: "wallet-pass-display-config__scope",
|
|
22
|
+
value: value.type,
|
|
23
|
+
onChange: (event) => onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, { type: event.target.value })),
|
|
24
|
+
disabled
|
|
25
|
+
}, /* @__PURE__ */ React.createElement(Radio, {
|
|
26
|
+
value: "self",
|
|
27
|
+
className: "wallet-pass-display-config__option"
|
|
28
|
+
}, locales.getText("passIssuerCurrentShop")), /* @__PURE__ */ React.createElement(Radio, {
|
|
29
|
+
value: "all_franchisees",
|
|
30
|
+
className: "wallet-pass-display-config__option"
|
|
31
|
+
}, locales.getText("passIssuerAllShops")), /* @__PURE__ */ React.createElement(Radio, {
|
|
32
|
+
value: "selected_franchisees",
|
|
33
|
+
className: "wallet-pass-display-config__option"
|
|
34
|
+
}, locales.getText("passIssuerSpecifiedShops")))), value.type === "selected_franchisees" && /* @__PURE__ */ React.createElement("div", { className: "wallet-pass-display-config__shops" }, /* @__PURE__ */ React.createElement(Select, {
|
|
35
|
+
className: "wallet-pass-display-config__shop-select",
|
|
36
|
+
mode: "multiple",
|
|
37
|
+
allowClear: true,
|
|
38
|
+
showSearch: true,
|
|
39
|
+
optionFilterProp: "name",
|
|
40
|
+
maxTagCount: "responsive",
|
|
41
|
+
placeholder: locales.getText("passIssuerSelectShops"),
|
|
42
|
+
"aria-label": locales.getText("passIssuerSelectShops"),
|
|
43
|
+
options: shops,
|
|
44
|
+
fieldNames: {
|
|
45
|
+
value: "source_shop_id",
|
|
46
|
+
label: "name"
|
|
47
|
+
},
|
|
48
|
+
loading,
|
|
49
|
+
notFoundContent: error && !loading ? /* @__PURE__ */ React.createElement(Button, {
|
|
50
|
+
type: "link",
|
|
51
|
+
size: "small",
|
|
52
|
+
onClick: refresh
|
|
53
|
+
}, locales.getText("passIssuerLoadFailedRetry")) : void 0,
|
|
54
|
+
value: value.shop_ids,
|
|
55
|
+
onChange: (shop_ids) => onChange === null || onChange === void 0 ? void 0 : onChange(_objectSpread2(_objectSpread2({}, value), {}, { shop_ids })),
|
|
56
|
+
disabled
|
|
57
|
+
})));
|
|
58
|
+
};
|
|
59
|
+
//#endregion
|
|
60
|
+
export { PassDisplayConfig as default };
|
|
@@ -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
|
+
import { _asyncToGenerator } from "../../../../_virtual/_@oxc-project_runtime@0.122.0/helpers/asyncToGenerator.js";
|
|
2
|
+
import { request } from "../../../../utils/index.js";
|
|
3
|
+
//#region src/plus/walletEditor/components/PassDisplayConfig/serve.ts
|
|
4
|
+
const getFranchiseeShops = function() {
|
|
5
|
+
var _ref = _asyncToGenerator(function* () {
|
|
6
|
+
const { data } = yield 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
|
+
export { 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";
|
|
@@ -3,6 +3,14 @@ var locales_default = {
|
|
|
3
3
|
en: {
|
|
4
4
|
walletName: "Wallet name",
|
|
5
5
|
validityPeriod: "Validity Period",
|
|
6
|
+
passesShownInWallet: "Passes shown in this Wallet:",
|
|
7
|
+
showPassesIssuedBy: "Show passes issued by:",
|
|
8
|
+
passIssuerCurrentShop: "Current store",
|
|
9
|
+
passIssuerAllShops: "All stores in the chain",
|
|
10
|
+
passIssuerSpecifiedShops: "Specified stores",
|
|
11
|
+
passIssuerSelectShops: "Select stores",
|
|
12
|
+
passIssuerShopsRequired: "Please select at least one store",
|
|
13
|
+
passIssuerLoadFailedRetry: "Failed to load stores. Click to retry.",
|
|
6
14
|
linkedPasses: "Linked passes",
|
|
7
15
|
linkedPassesDesc: "Select the passes that will be available in this Wallet.",
|
|
8
16
|
sort: "Sort",
|
|
@@ -54,6 +62,14 @@ var locales_default = {
|
|
|
54
62
|
"zh-CN": {
|
|
55
63
|
walletName: "钱包名称",
|
|
56
64
|
validityPeriod: "有效期",
|
|
65
|
+
passesShownInWallet: "此钱包中显示的卡券:",
|
|
66
|
+
showPassesIssuedBy: "显示由以下门店发放的卡券:",
|
|
67
|
+
passIssuerCurrentShop: "当前门店",
|
|
68
|
+
passIssuerAllShops: "连锁内所有门店",
|
|
69
|
+
passIssuerSpecifiedShops: "指定门店",
|
|
70
|
+
passIssuerSelectShops: "选择门店",
|
|
71
|
+
passIssuerShopsRequired: "请至少选择一个门店",
|
|
72
|
+
passIssuerLoadFailedRetry: "门店加载失败,点击重试",
|
|
57
73
|
linkedPasses: "包含的卡券",
|
|
58
74
|
linkedPassesDesc: "选择此 Wallet 中可展示与使用的卡券。",
|
|
59
75
|
sort: "排序",
|
|
@@ -105,6 +121,14 @@ var locales_default = {
|
|
|
105
121
|
"zh-HK": {
|
|
106
122
|
walletName: "錢包名稱",
|
|
107
123
|
validityPeriod: "有效期",
|
|
124
|
+
passesShownInWallet: "此錢包中顯示的卡券:",
|
|
125
|
+
showPassesIssuedBy: "顯示由以下門店發放的卡券:",
|
|
126
|
+
passIssuerCurrentShop: "目前門店",
|
|
127
|
+
passIssuerAllShops: "連鎖內所有門店",
|
|
128
|
+
passIssuerSpecifiedShops: "指定門店",
|
|
129
|
+
passIssuerSelectShops: "選擇門店",
|
|
130
|
+
passIssuerShopsRequired: "請至少選擇一個門店",
|
|
131
|
+
passIssuerLoadFailedRetry: "門店載入失敗,點擊重試",
|
|
108
132
|
linkedPasses: "包含的卡券",
|
|
109
133
|
linkedPassesDesc: "選擇此 Wallet 中可展示與使用的卡券。",
|
|
110
134
|
sort: "排序",
|
|
@@ -156,6 +180,14 @@ var locales_default = {
|
|
|
156
180
|
ja: {
|
|
157
181
|
walletName: "ウォレット名",
|
|
158
182
|
validityPeriod: "有効期間",
|
|
183
|
+
passesShownInWallet: "このウォレットに表示するパス:",
|
|
184
|
+
showPassesIssuedBy: "次の店舗が発行したパスを表示:",
|
|
185
|
+
passIssuerCurrentShop: "現在の店舗",
|
|
186
|
+
passIssuerAllShops: "チェーン内のすべての店舗",
|
|
187
|
+
passIssuerSpecifiedShops: "指定した店舗",
|
|
188
|
+
passIssuerSelectShops: "店舗を選択",
|
|
189
|
+
passIssuerShopsRequired: "店舗を1つ以上選択してください",
|
|
190
|
+
passIssuerLoadFailedRetry: "店舗を読み込めませんでした。クリックして再試行。",
|
|
159
191
|
linkedPasses: "リンクされたパス",
|
|
160
192
|
linkedPassesDesc: "このウォレットで利用可能なパスを選択します。",
|
|
161
193
|
sort: "並び替え",
|
|
@@ -207,6 +239,14 @@ var locales_default = {
|
|
|
207
239
|
pt: {
|
|
208
240
|
walletName: "Nome da carteira",
|
|
209
241
|
validityPeriod: "Período de Validade",
|
|
242
|
+
passesShownInWallet: "Passes exibidos nesta carteira:",
|
|
243
|
+
showPassesIssuedBy: "Mostrar passes emitidos por:",
|
|
244
|
+
passIssuerCurrentShop: "Loja atual",
|
|
245
|
+
passIssuerAllShops: "Todas as lojas da rede",
|
|
246
|
+
passIssuerSpecifiedShops: "Lojas específicas",
|
|
247
|
+
passIssuerSelectShops: "Selecionar lojas",
|
|
248
|
+
passIssuerShopsRequired: "Selecione pelo menos uma loja",
|
|
249
|
+
passIssuerLoadFailedRetry: "Falha ao carregar lojas. Clique para tentar novamente.",
|
|
210
250
|
linkedPasses: "Passes vinculados",
|
|
211
251
|
linkedPassesDesc: "Selecione os passes que estarão disponíveis nesta Carteira.",
|
|
212
252
|
sort: "Ordenar",
|
|
@@ -27,6 +27,12 @@ interface SendConfig {
|
|
|
27
27
|
type: string;
|
|
28
28
|
[key: string]: any;
|
|
29
29
|
}
|
|
30
|
+
/** 在原展示范围上追加子店卡券的配置。 */
|
|
31
|
+
interface PassDisplayConfigValue {
|
|
32
|
+
type: 'self' | 'all_franchisees' | 'selected_franchisees';
|
|
33
|
+
/** 仅 selected_franchisees 使用,其他模式忽略。 */
|
|
34
|
+
shop_ids?: number[];
|
|
35
|
+
}
|
|
30
36
|
interface WalletMetadata {
|
|
31
37
|
mobile_wallet_id?: string | number;
|
|
32
38
|
showcaseWalletPass?: string[];
|
|
@@ -35,6 +41,7 @@ interface WalletMetadata {
|
|
|
35
41
|
customerName?: string;
|
|
36
42
|
coverImage?: string;
|
|
37
43
|
send_config?: SendConfig;
|
|
44
|
+
pass_visibility?: PassDisplayConfigValue;
|
|
38
45
|
}
|
|
39
46
|
interface WalletEditorValue {
|
|
40
47
|
name?: MultiLanguageTitle;
|
|
@@ -56,4 +63,4 @@ interface WalletEditorProps {
|
|
|
56
63
|
style?: React.CSSProperties;
|
|
57
64
|
}
|
|
58
65
|
//#endregion
|
|
59
|
-
export { MultiLanguageTitle, SendConfig, ShowcaseWalletPassItem, ValidForConfig, WalletEditorProps, WalletEditorRef, WalletEditorValue, WalletMetadata, WalletPassType };
|
|
66
|
+
export { MultiLanguageTitle, PassDisplayConfigValue, SendConfig, ShowcaseWalletPassItem, ValidForConfig, WalletEditorProps, WalletEditorRef, WalletEditorValue, WalletMetadata, WalletPassType };
|
|
@@ -6,12 +6,12 @@ import React, { useCallback, useEffect, useMemo, useRef } from "react";
|
|
|
6
6
|
import { locales } from "@pisell/utils";
|
|
7
7
|
import { Button, PisellEmpty, PisellModal, PisellStatisticList, Skeleton, Timeline, usePisellConfig } from "@pisell/materials";
|
|
8
8
|
import { useRequest } from "ahooks";
|
|
9
|
-
import
|
|
10
|
-
import
|
|
9
|
+
import timezonePlugin from "dayjs/plugin/timezone";
|
|
10
|
+
import utcPlugin from "dayjs/plugin/utc";
|
|
11
11
|
import "./index.less";
|
|
12
12
|
//#region src/plus/walletPassGallery/components/timelineSection/index.tsx
|
|
13
|
-
dayjs.extend(
|
|
14
|
-
dayjs.extend(
|
|
13
|
+
dayjs.extend(timezonePlugin);
|
|
14
|
+
dayjs.extend(utcPlugin);
|
|
15
15
|
const stateTimeUnix = 1723255863;
|
|
16
16
|
const POLL_INTERVAL = 2e3;
|
|
17
17
|
const POLL_MAX_TIMES = 5;
|