@pisell/private-materials 6.2.25 → 6.2.26
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.js +1 -1
- package/build/lowcode/view.js +1 -1
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +1 -1
- package/es/components/booking/components/customSelect/index.js +1 -0
- package/es/components/booking/hooks/useClearCart.js +11 -8
- package/es/components/booking/info/client/index.js +3 -2
- package/es/components/booking/info/hooks/useInfoHolder.js +13 -14
- package/es/components/booking/info/service/Lists.js +37 -27
- package/es/components/booking/info/service/editService/constants.d.ts +1 -0
- package/es/components/booking/info/service/editService/constants.js +3 -0
- package/es/components/booking/info/service/editService/index.js +15 -10
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info/service2/utils.js +20 -21
- package/es/components/booking/info2/index.js +1 -0
- package/es/components/booking/info2/service/addService/utils.js +6 -3
- package/es/components/booking/info2/service/addTimeModal/index.js +3 -0
- package/es/components/booking/info2/service/editService/Resources/index.js +5 -0
- package/es/components/booking/info2/service/editService/index.js +265 -170
- package/es/components/booking/info2/service/index.js +22 -19
- package/es/components/booking/materiels/duration/index.js +9 -2
- package/es/components/booking/materiels/holder/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Cart/Product.js +51 -47
- package/es/components/shoppingCart/components/Cart/index.js +21 -18
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +171 -151
- package/es/components/ticketBooking/components/timeBar/index.js +77 -73
- package/es/components/ticketBooking/utils/index.d.ts +1 -1
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +1 -1
- package/lib/components/booking/components/customSelect/index.js +1 -0
- package/lib/components/booking/hooks/useClearCart.js +16 -13
- package/lib/components/booking/info/client/index.js +5 -4
- package/lib/components/booking/info/hooks/useInfoHolder.js +12 -13
- package/lib/components/booking/info/service/Lists.js +36 -24
- package/lib/components/booking/info/service/editService/constants.d.ts +1 -0
- package/lib/components/booking/info/service/editService/constants.js +31 -0
- package/lib/components/booking/info/service/editService/index.js +7 -1
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info/service2/utils.js +17 -17
- package/lib/components/booking/info2/service/addService/utils.js +4 -2
- package/lib/components/booking/info2/service/addTimeModal/index.js +3 -0
- package/lib/components/booking/info2/service/editService/Resources/index.js +2 -0
- package/lib/components/booking/info2/service/editService/index.js +138 -74
- package/lib/components/booking/info2/service/index.js +14 -10
- package/lib/components/booking/materiels/duration/index.js +7 -2
- package/lib/components/booking/materiels/holder/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Cart/Product.js +32 -28
- package/lib/components/shoppingCart/components/Cart/index.js +18 -15
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +140 -122
- package/lib/components/ticketBooking/components/timeBar/index.js +98 -94
- package/lib/components/ticketBooking/utils/index.d.ts +1 -1
- package/package.json +3 -3
- package/es/components/Sales/Cart/index.d.ts +0 -53
- package/es/components/booking/addons/index.d.ts +0 -17
- package/es/components/booking/components/actionButtons/index.d.ts +0 -29
- package/es/components/booking/components/clearCartModal/index.d.ts +0 -10
- package/es/components/booking/components/customiseItemModal/index.d.ts +0 -28
- package/es/components/booking/components/tabPane/index.d.ts +0 -4
- package/es/components/booking/components/voucher/index.d.ts +0 -3
- package/es/components/booking/dashboard/index.d.ts +0 -20
- package/es/components/booking/info/service/serviceItem/index.d.ts +0 -3
- package/es/components/booking/info2/cartClientCard/index.d.ts +0 -6
- package/es/components/booking/info2/cartClientCard/locales.d.ts +0 -21
- package/es/components/booking/info2/cartClientCard/types.d.ts +0 -13
- package/es/components/booking/info2/cartClientCard/utils.d.ts +0 -3
- package/es/components/booking/info2/service/editNormalService/index.d.ts +0 -3
- package/es/components/booking/info2/service/serviceItem/index.d.ts +0 -3
- package/es/components/booking/locales.d.ts +0 -903
- package/es/components/booking/notes/addNote/index.d.ts +0 -3
- package/es/components/shoppingCart/type.d.ts +0 -49
- package/es/components/ticketBooking/components/addServiceVariant/utils.d.ts +0 -8
- package/es/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.d.ts +0 -7
- package/es/components/ticketBooking/components/bookingDataPanel/bookingList/index.d.ts +0 -12
- package/es/components/ticketBooking/components/bookingDataPanel/bookingList/utils.d.ts +0 -6
- package/es/components/ticketBooking/components/bookingDataPanel/constants.d.ts +0 -22
- package/es/components/ticketBooking/components/bookingDataPanel/index.d.ts +0 -9
- package/es/components/ticketBooking/components/bookingDataPanel/pisellFloatingPanel/index.d.ts +0 -14
- package/es/components/ticketBooking/components/bookingDataPanel/serve.d.ts +0 -0
- package/es/components/ticketBooking/components/floatButtons/index.d.ts +0 -11
- package/es/components/ticketBooking/hooks/pisellos/bookingTicket.d.ts +0 -1
- package/es/components/ticketBooking/hooks/pisellos/index.d.ts +0 -3
- package/es/components/ticketBooking/hooks/pisellos/useCustomer.d.ts +0 -25
- package/es/components/ticketBooking/hooks/pisellos/useProducts.d.ts +0 -12
- package/es/components/ticketBooking/hooks/pisellos/useScanGlobalHandle.d.ts +0 -2
- package/es/components/ticketBooking/locales.d.ts +0 -177
- package/es/components/ticketBooking/serve.d.ts +0 -287
- package/es/hooks/useToast.d.ts +0 -2
- package/es/hooks/useTranslationOriginal.d.ts +0 -1
- package/es/index.d.ts +0 -51
- package/es/plus/clientCard/index.d.ts +0 -7
- package/es/plus/clientCard/line/index.d.ts +0 -9
- package/es/plus/clientCard/locales.d.ts +0 -18
- package/es/plus/clientCard/types.d.ts +0 -126
- package/es/plus/clientCard/utils.d.ts +0 -8
- package/es/plus/clientName/index.d.ts +0 -5
- package/es/plus/clientName/type.d.ts +0 -13
- package/es/plus/clientName/utils.d.ts +0 -2
- package/es/plus/clinetSearch/Add/BirthdayField/index.d.ts +0 -2
- package/es/plus/clinetSearch/Add/GenderField/index.d.ts +0 -2
- package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +0 -2
- package/es/plus/clinetSearch/Add/PhoneField/serve.d.ts +0 -2
- package/es/plus/clinetSearch/Add/index.d.ts +0 -18
- package/es/plus/clinetSearch/InfiniteScroll/InfiniteScroll.d.ts +0 -5
- package/es/plus/clinetSearch/InfiniteScroll/index.d.ts +0 -2
- package/es/plus/clinetSearch/InfiniteScroll/types.d.ts +0 -46
- package/es/plus/clinetSearch/index.d.ts +0 -18
- package/es/plus/clinetSearch/locales.d.ts +0 -102
- package/es/plus/clinetSearch/serve.d.ts +0 -1
- package/es/plus/clinetSearch/types.d.ts +0 -49
- package/es/plus/noteModal/AddTempModal.d.ts +0 -7
- package/es/plus/noteModal/index.d.ts +0 -4
- package/es/plus/noteModal/locales.d.ts +0 -33
- package/es/plus/noteModal/types.d.ts +0 -17
- package/es/pro/comprehensiveSearch/hooks/useNativeScanner.d.ts +0 -5
- package/es/pro/comprehensiveSearch/hooks/useTerminalPeripherals.d.ts +0 -9
- package/es/pro/comprehensiveSearch/index.d.ts +0 -9
- package/es/pro/comprehensiveSearch/locales.d.ts +0 -18
- package/es/pro/comprehensiveSearch/types.d.ts +0 -31
- package/es/pro/numberKeyboard/index.d.ts +0 -28
- package/es/pro/numberKeyboard/locales.d.ts +0 -12
- package/es/pro/pisellNumberSelector/example.d.ts +0 -3
- package/es/pro/pisellNumberSelector/index.d.ts +0 -26
- package/es/pro/pisellPhoneKeyboard/index.d.ts +0 -12
- package/es/pro/pisellPhoneKeyboard/locales.d.ts +0 -12
- package/es/pro/pisellPriceKeyboardModal/PisellPriceKeyboardModal.d.ts +0 -5
- package/es/pro/pisellPriceKeyboardModal/index.d.ts +0 -2
- package/es/pro/pisellPriceKeyboardModal/types.d.ts +0 -25
- package/es/pro/pisellPriceRadio/index.d.ts +0 -26
- package/es/pro/skuDetailModal/index.d.ts +0 -5
- package/es/pro/skuDetailModal/locales.d.ts +0 -48
- package/es/pro/skuDetailModal/types.d.ts +0 -347
- package/lib/components/Sales/Cart/index.d.ts +0 -53
- package/lib/components/booking/addons/index.d.ts +0 -17
- package/lib/components/booking/components/actionButtons/index.d.ts +0 -29
- package/lib/components/booking/components/clearCartModal/index.d.ts +0 -10
- package/lib/components/booking/components/customiseItemModal/index.d.ts +0 -28
- package/lib/components/booking/components/tabPane/index.d.ts +0 -4
- package/lib/components/booking/components/voucher/index.d.ts +0 -3
- package/lib/components/booking/dashboard/index.d.ts +0 -20
- package/lib/components/booking/info/service/serviceItem/index.d.ts +0 -3
- package/lib/components/booking/info2/cartClientCard/index.d.ts +0 -6
- package/lib/components/booking/info2/cartClientCard/locales.d.ts +0 -21
- package/lib/components/booking/info2/cartClientCard/types.d.ts +0 -13
- package/lib/components/booking/info2/cartClientCard/utils.d.ts +0 -3
- package/lib/components/booking/info2/service/editNormalService/index.d.ts +0 -3
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +0 -3
- package/lib/components/booking/locales.d.ts +0 -903
- package/lib/components/booking/notes/addNote/index.d.ts +0 -3
- package/lib/components/shoppingCart/type.d.ts +0 -49
- package/lib/components/ticketBooking/components/addServiceVariant/utils.d.ts +0 -8
- package/lib/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.d.ts +0 -7
- package/lib/components/ticketBooking/components/bookingDataPanel/bookingList/index.d.ts +0 -12
- package/lib/components/ticketBooking/components/bookingDataPanel/bookingList/utils.d.ts +0 -6
- package/lib/components/ticketBooking/components/bookingDataPanel/constants.d.ts +0 -22
- package/lib/components/ticketBooking/components/bookingDataPanel/index.d.ts +0 -9
- package/lib/components/ticketBooking/components/bookingDataPanel/pisellFloatingPanel/index.d.ts +0 -14
- package/lib/components/ticketBooking/components/bookingDataPanel/serve.d.ts +0 -0
- package/lib/components/ticketBooking/components/floatButtons/index.d.ts +0 -11
- package/lib/components/ticketBooking/hooks/pisellos/bookingTicket.d.ts +0 -1
- package/lib/components/ticketBooking/hooks/pisellos/index.d.ts +0 -3
- package/lib/components/ticketBooking/hooks/pisellos/useCustomer.d.ts +0 -25
- package/lib/components/ticketBooking/hooks/pisellos/useProducts.d.ts +0 -12
- package/lib/components/ticketBooking/hooks/pisellos/useScanGlobalHandle.d.ts +0 -2
- package/lib/components/ticketBooking/locales.d.ts +0 -177
- package/lib/components/ticketBooking/serve.d.ts +0 -287
- package/lib/hooks/useToast.d.ts +0 -2
- package/lib/hooks/useTranslationOriginal.d.ts +0 -1
- package/lib/index.d.ts +0 -51
- package/lib/plus/clientCard/index.d.ts +0 -7
- package/lib/plus/clientCard/line/index.d.ts +0 -9
- package/lib/plus/clientCard/locales.d.ts +0 -18
- package/lib/plus/clientCard/types.d.ts +0 -126
- package/lib/plus/clientCard/utils.d.ts +0 -8
- package/lib/plus/clientName/index.d.ts +0 -5
- package/lib/plus/clientName/type.d.ts +0 -13
- package/lib/plus/clientName/utils.d.ts +0 -2
- package/lib/plus/clinetSearch/Add/BirthdayField/index.d.ts +0 -2
- package/lib/plus/clinetSearch/Add/GenderField/index.d.ts +0 -2
- package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +0 -2
- package/lib/plus/clinetSearch/Add/PhoneField/serve.d.ts +0 -2
- package/lib/plus/clinetSearch/Add/index.d.ts +0 -18
- package/lib/plus/clinetSearch/InfiniteScroll/InfiniteScroll.d.ts +0 -5
- package/lib/plus/clinetSearch/InfiniteScroll/index.d.ts +0 -2
- package/lib/plus/clinetSearch/InfiniteScroll/types.d.ts +0 -46
- package/lib/plus/clinetSearch/index.d.ts +0 -18
- package/lib/plus/clinetSearch/locales.d.ts +0 -102
- package/lib/plus/clinetSearch/serve.d.ts +0 -1
- package/lib/plus/clinetSearch/types.d.ts +0 -49
- package/lib/plus/noteModal/AddTempModal.d.ts +0 -7
- package/lib/plus/noteModal/index.d.ts +0 -4
- package/lib/plus/noteModal/locales.d.ts +0 -33
- package/lib/plus/noteModal/types.d.ts +0 -17
- package/lib/pro/comprehensiveSearch/hooks/useNativeScanner.d.ts +0 -5
- package/lib/pro/comprehensiveSearch/hooks/useTerminalPeripherals.d.ts +0 -9
- package/lib/pro/comprehensiveSearch/index.d.ts +0 -9
- package/lib/pro/comprehensiveSearch/locales.d.ts +0 -18
- package/lib/pro/comprehensiveSearch/types.d.ts +0 -31
- package/lib/pro/numberKeyboard/index.d.ts +0 -28
- package/lib/pro/numberKeyboard/locales.d.ts +0 -12
- package/lib/pro/pisellNumberSelector/example.d.ts +0 -3
- package/lib/pro/pisellNumberSelector/index.d.ts +0 -26
- package/lib/pro/pisellPhoneKeyboard/index.d.ts +0 -12
- package/lib/pro/pisellPhoneKeyboard/locales.d.ts +0 -12
- package/lib/pro/pisellPriceKeyboardModal/PisellPriceKeyboardModal.d.ts +0 -5
- package/lib/pro/pisellPriceKeyboardModal/index.d.ts +0 -2
- package/lib/pro/pisellPriceKeyboardModal/types.d.ts +0 -25
- package/lib/pro/pisellPriceRadio/index.d.ts +0 -26
- package/lib/pro/skuDetailModal/index.d.ts +0 -5
- package/lib/pro/skuDetailModal/locales.d.ts +0 -48
- package/lib/pro/skuDetailModal/types.d.ts +0 -347
@@ -49,7 +49,7 @@ var import_dayjs = __toESM(require("dayjs"));
|
|
49
49
|
var import_pisellos = require("../../hooks/pisellos");
|
50
50
|
var import_utils7 = require("./utils");
|
51
51
|
var AddSerivce = (props) => {
|
52
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k
|
52
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
|
53
53
|
const { onEdit, state, dispatch, renderMode = "current" } = props;
|
54
54
|
const context = (0, import_useEngineContext.default)();
|
55
55
|
const notAvailableRef = (0, import_react.useRef)(null);
|
@@ -137,10 +137,148 @@ var AddSerivce = (props) => {
|
|
137
137
|
const isEject = (0, import_utils2.getIsEject)(item, type);
|
138
138
|
const isOnlySession = (0, import_utils2.getIsOnlySession)(item);
|
139
139
|
let lock = false;
|
140
|
+
let cacheValues = null;
|
140
141
|
if (isEject) {
|
141
142
|
setCurrentProduct(item);
|
142
143
|
} else {
|
143
144
|
setCurrentProduct(null);
|
145
|
+
if (!isSession) {
|
146
|
+
cacheValues = {
|
147
|
+
bundle: [],
|
148
|
+
key: item.id,
|
149
|
+
option: [],
|
150
|
+
product_id: item.id,
|
151
|
+
product_variant_id: 0,
|
152
|
+
quantity: 1,
|
153
|
+
rowKey: item.id,
|
154
|
+
session: null,
|
155
|
+
unique: "08974625397"
|
156
|
+
};
|
157
|
+
}
|
158
|
+
}
|
159
|
+
const callback = async (e, extension_type, detail) => {
|
160
|
+
var _a3, _b2, _c2, _d2, _e2, _f2;
|
161
|
+
setCurrentProduct(null);
|
162
|
+
if (lock) {
|
163
|
+
return;
|
164
|
+
}
|
165
|
+
lock = true;
|
166
|
+
setTimeout(() => {
|
167
|
+
lock = false;
|
168
|
+
}, 2e3);
|
169
|
+
if (!isBooking4) {
|
170
|
+
const data = await createBookingData({
|
171
|
+
product: { ...detail || item, _params: e }
|
172
|
+
});
|
173
|
+
createBooking({ booking: data });
|
174
|
+
return;
|
175
|
+
}
|
176
|
+
const _detail = detail || item;
|
177
|
+
const other = JSON.parse(JSON.stringify(e));
|
178
|
+
other.session = e.session;
|
179
|
+
let cacheItem = {
|
180
|
+
..._detail,
|
181
|
+
product_id: item.id,
|
182
|
+
_id: (0, import_utils.getUniqueId)(),
|
183
|
+
_key: e.key,
|
184
|
+
_extend: {
|
185
|
+
start_date: state.date.value,
|
186
|
+
quantity: (e == null ? void 0 : e.quantity) || 1,
|
187
|
+
price: _detail.price,
|
188
|
+
product_name: item.title,
|
189
|
+
other
|
190
|
+
},
|
191
|
+
new: 1
|
192
|
+
};
|
193
|
+
let _total = (0, import_utils2.getProductTotalPrice)(cacheItem);
|
194
|
+
cacheItem._extend.total = _total;
|
195
|
+
cacheItem._extend.origin_total = _total;
|
196
|
+
const _isEdit = !!state.service.cacheItem;
|
197
|
+
if (_isEdit) {
|
198
|
+
cacheItem._id = (_a3 = state.service.cacheItem) == null ? void 0 : _a3._id;
|
199
|
+
cacheItem.new = 0;
|
200
|
+
}
|
201
|
+
if (renderMode === "current") {
|
202
|
+
cacheItem.currentDefaultTime = state.date.value.format("HH:mm");
|
203
|
+
}
|
204
|
+
cacheItem = (0, import_utils3.getProductExtend)({
|
205
|
+
cacheItem,
|
206
|
+
state,
|
207
|
+
isDisabledTime: true
|
208
|
+
});
|
209
|
+
if (state.renderType === "eventBooking") {
|
210
|
+
cacheItem.autoClose = false;
|
211
|
+
}
|
212
|
+
if (cacheItem.autoClose) {
|
213
|
+
cacheItem.autoClose = false;
|
214
|
+
cacheItem._serviceKey = (0, import_utils6.genServiceKey)(cacheItem);
|
215
|
+
let { list: _list, quantity } = (0, import_utils6.addService)(
|
216
|
+
[...state.service.value],
|
217
|
+
cacheItem,
|
218
|
+
state
|
219
|
+
);
|
220
|
+
handleAddToast(cacheItem.title, quantity || 1);
|
221
|
+
(0, import_utils6.addServiceScroll)(e.rowKey, cacheItem);
|
222
|
+
try {
|
223
|
+
if (((_f2 = (_e2 = (_d2 = (_c2 = (_b2 = context.appHelper.utils.store) == null ? void 0 : _b2.getState) == null ? void 0 : _c2.call(_b2)) == null ? void 0 : _d2.global) == null ? void 0 : _e2.globalConfig) == null ? void 0 : _f2.id) === 2155) {
|
224
|
+
const val = _list == null ? void 0 : _list.map((s) => {
|
225
|
+
return {
|
226
|
+
product_id: s == null ? void 0 : s.product_id,
|
227
|
+
detailId: s == null ? void 0 : s.id,
|
228
|
+
detailProductId: s == null ? void 0 : s.product_id,
|
229
|
+
product_name: s == null ? void 0 : s.title,
|
230
|
+
price: s == null ? void 0 : s.price,
|
231
|
+
_id: s == null ? void 0 : s._id,
|
232
|
+
_key: s == null ? void 0 : s._key,
|
233
|
+
_serviceKey: s == null ? void 0 : s._serviceKey
|
234
|
+
};
|
235
|
+
});
|
236
|
+
const sendData = {
|
237
|
+
product_id: item == null ? void 0 : item.id,
|
238
|
+
detailId: _detail == null ? void 0 : _detail.id,
|
239
|
+
detailProductId: _detail == null ? void 0 : _detail.product_id,
|
240
|
+
product_name: item == null ? void 0 : item.title,
|
241
|
+
price: _detail == null ? void 0 : _detail.price,
|
242
|
+
serviceVal: val
|
243
|
+
};
|
244
|
+
(0, import_utils.sendWarningLog)({
|
245
|
+
title: "addService",
|
246
|
+
content: [
|
247
|
+
{ key: "添加数据", value: JSON.stringify(sendData) },
|
248
|
+
{
|
249
|
+
key: "日期",
|
250
|
+
value: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm:ss")
|
251
|
+
}
|
252
|
+
]
|
253
|
+
});
|
254
|
+
}
|
255
|
+
} catch (error) {
|
256
|
+
}
|
257
|
+
dispatch({
|
258
|
+
type: "setService",
|
259
|
+
payload: {
|
260
|
+
addModal: false,
|
261
|
+
value: _list,
|
262
|
+
edit: true,
|
263
|
+
changeService: false
|
264
|
+
}
|
265
|
+
});
|
266
|
+
} else {
|
267
|
+
dispatch({
|
268
|
+
type: "setService",
|
269
|
+
payload: {
|
270
|
+
editModal: true,
|
271
|
+
cacheItem,
|
272
|
+
addModal: !cacheItem.autoClose,
|
273
|
+
changeService: false
|
274
|
+
}
|
275
|
+
});
|
276
|
+
onEdit == null ? void 0 : onEdit(cacheItem);
|
277
|
+
}
|
278
|
+
};
|
279
|
+
if (cacheValues) {
|
280
|
+
callback(cacheValues, "", item);
|
281
|
+
return;
|
144
282
|
}
|
145
283
|
state.action({
|
146
284
|
type: "pisell1.handleOpenProductModal",
|
@@ -162,126 +300,7 @@ var AddSerivce = (props) => {
|
|
162
300
|
onCancel: () => {
|
163
301
|
setCurrentProduct(null);
|
164
302
|
},
|
165
|
-
callback
|
166
|
-
var _a3, _b2, _c2, _d2, _e2, _f2;
|
167
|
-
setCurrentProduct(null);
|
168
|
-
if (lock) {
|
169
|
-
return;
|
170
|
-
}
|
171
|
-
lock = true;
|
172
|
-
setTimeout(() => {
|
173
|
-
lock = false;
|
174
|
-
}, 2e3);
|
175
|
-
if (!isBooking4) {
|
176
|
-
const data = await createBookingData({
|
177
|
-
product: { ...detail || item, _params: e }
|
178
|
-
});
|
179
|
-
createBooking({ booking: data });
|
180
|
-
return;
|
181
|
-
}
|
182
|
-
const _detail = detail || item;
|
183
|
-
const other = JSON.parse(JSON.stringify(e));
|
184
|
-
other.session = e.session;
|
185
|
-
let cacheItem = {
|
186
|
-
..._detail,
|
187
|
-
product_id: item.id,
|
188
|
-
_id: (0, import_utils.getUniqueId)(),
|
189
|
-
_key: e.key,
|
190
|
-
_extend: {
|
191
|
-
start_date: state.date.value,
|
192
|
-
quantity: (e == null ? void 0 : e.quantity) || 1,
|
193
|
-
price: _detail.price,
|
194
|
-
product_name: item.title,
|
195
|
-
other
|
196
|
-
},
|
197
|
-
new: 1
|
198
|
-
};
|
199
|
-
let _total = (0, import_utils2.getProductTotalPrice)(cacheItem);
|
200
|
-
cacheItem._extend.total = _total;
|
201
|
-
cacheItem._extend.origin_total = _total;
|
202
|
-
const _isEdit = !!state.service.cacheItem;
|
203
|
-
if (_isEdit) {
|
204
|
-
cacheItem._id = (_a3 = state.service.cacheItem) == null ? void 0 : _a3._id;
|
205
|
-
cacheItem.new = 0;
|
206
|
-
}
|
207
|
-
if (renderMode === "current") {
|
208
|
-
cacheItem.currentDefaultTime = state.date.value.format("HH:mm");
|
209
|
-
}
|
210
|
-
cacheItem = (0, import_utils3.getProductExtend)({
|
211
|
-
cacheItem,
|
212
|
-
state,
|
213
|
-
isDisabledTime: true
|
214
|
-
});
|
215
|
-
if (state.renderType === "eventBooking") {
|
216
|
-
cacheItem.autoClose = false;
|
217
|
-
}
|
218
|
-
if (cacheItem.autoClose) {
|
219
|
-
cacheItem.autoClose = false;
|
220
|
-
cacheItem._serviceKey = (0, import_utils6.genServiceKey)(cacheItem);
|
221
|
-
let { list: _list, quantity } = (0, import_utils6.addService)(
|
222
|
-
[...state.service.value],
|
223
|
-
cacheItem,
|
224
|
-
state
|
225
|
-
);
|
226
|
-
handleAddToast(cacheItem.title, quantity || 1);
|
227
|
-
(0, import_utils6.addServiceScroll)(e.rowKey, cacheItem);
|
228
|
-
try {
|
229
|
-
if (((_f2 = (_e2 = (_d2 = (_c2 = (_b2 = context.appHelper.utils.store) == null ? void 0 : _b2.getState) == null ? void 0 : _c2.call(_b2)) == null ? void 0 : _d2.global) == null ? void 0 : _e2.globalConfig) == null ? void 0 : _f2.id) === 2155) {
|
230
|
-
const val = _list == null ? void 0 : _list.map((s) => {
|
231
|
-
return {
|
232
|
-
product_id: s == null ? void 0 : s.product_id,
|
233
|
-
detailId: s == null ? void 0 : s.id,
|
234
|
-
detailProductId: s == null ? void 0 : s.product_id,
|
235
|
-
product_name: s == null ? void 0 : s.title,
|
236
|
-
price: s == null ? void 0 : s.price,
|
237
|
-
_id: s == null ? void 0 : s._id,
|
238
|
-
_key: s == null ? void 0 : s._key,
|
239
|
-
_serviceKey: s == null ? void 0 : s._serviceKey
|
240
|
-
};
|
241
|
-
});
|
242
|
-
const sendData = {
|
243
|
-
product_id: item == null ? void 0 : item.id,
|
244
|
-
detailId: _detail == null ? void 0 : _detail.id,
|
245
|
-
detailProductId: _detail == null ? void 0 : _detail.product_id,
|
246
|
-
product_name: item == null ? void 0 : item.title,
|
247
|
-
price: _detail == null ? void 0 : _detail.price,
|
248
|
-
serviceVal: val
|
249
|
-
};
|
250
|
-
(0, import_utils.sendWarningLog)({
|
251
|
-
title: "addService",
|
252
|
-
content: [
|
253
|
-
{ key: "添加数据", value: JSON.stringify(sendData) },
|
254
|
-
{
|
255
|
-
key: "日期",
|
256
|
-
value: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm:ss")
|
257
|
-
}
|
258
|
-
]
|
259
|
-
});
|
260
|
-
}
|
261
|
-
} catch (error) {
|
262
|
-
}
|
263
|
-
dispatch({
|
264
|
-
type: "setService",
|
265
|
-
payload: {
|
266
|
-
addModal: false,
|
267
|
-
value: _list,
|
268
|
-
edit: true,
|
269
|
-
changeService: false
|
270
|
-
}
|
271
|
-
});
|
272
|
-
} else {
|
273
|
-
dispatch({
|
274
|
-
type: "setService",
|
275
|
-
payload: {
|
276
|
-
editModal: true,
|
277
|
-
cacheItem,
|
278
|
-
addModal: !cacheItem.autoClose,
|
279
|
-
changeService: false
|
280
|
-
}
|
281
|
-
});
|
282
|
-
onEdit == null ? void 0 : onEdit(cacheItem);
|
283
|
-
}
|
284
|
-
}
|
303
|
+
callback
|
285
304
|
});
|
286
305
|
}
|
287
306
|
);
|
@@ -338,7 +357,6 @@ var AddSerivce = (props) => {
|
|
338
357
|
}
|
339
358
|
return null;
|
340
359
|
}, [
|
341
|
-
(_m = (_l = state.service) == null ? void 0 : _l.cacheItem) == null ? void 0 : _m.autoClose,
|
342
360
|
state.service.addModal,
|
343
361
|
import_utils.locales,
|
344
362
|
renderList,
|
@@ -35,125 +35,129 @@ module.exports = __toCommonJS(timeBar_exports);
|
|
35
35
|
var import_react = __toESM(require("react"));
|
36
36
|
var import_icons = require("@ant-design/icons");
|
37
37
|
var import_materials = require("@pisell/materials");
|
38
|
+
var import_ahooks = require("ahooks");
|
38
39
|
var import_antd = require("antd");
|
39
40
|
var import_classnames = __toESM(require("classnames"));
|
40
41
|
var import_utils = require("@pisell/utils");
|
41
42
|
var import_index = require("./index.less");
|
42
43
|
var TimeBar = (props) => {
|
43
|
-
var _a, _b
|
44
|
+
var _a, _b;
|
44
45
|
const { globalState: state, setGlobalState, locale, onCreateClick } = props;
|
45
|
-
const _onClickNext = () => {
|
46
|
-
var _a2, _b2,
|
46
|
+
const _onClickNext = (0, import_ahooks.useMemoizedFn)(() => {
|
47
|
+
var _a2, _b2, _c, _d;
|
47
48
|
const currentTime = (_b2 = (_a2 = state.modalState) == null ? void 0 : _a2.date) == null ? void 0 : _b2.value;
|
48
49
|
const newTime = currentTime["add"](1, "day");
|
49
|
-
(
|
50
|
-
(
|
51
|
-
};
|
52
|
-
const _onClickPre = () => {
|
53
|
-
var _a2, _b2,
|
50
|
+
(_c = props.onDateChange) == null ? void 0 : _c.call(props, newTime, newTime.format("YYYY-MM-DD HH:mm:ss"));
|
51
|
+
(_d = props.setIntervalTime) == null ? void 0 : _d.call(props, false);
|
52
|
+
});
|
53
|
+
const _onClickPre = (0, import_ahooks.useMemoizedFn)(() => {
|
54
|
+
var _a2, _b2, _c, _d;
|
54
55
|
const currentTime = (_b2 = (_a2 = state.modalState) == null ? void 0 : _a2.date) == null ? void 0 : _b2.value;
|
55
56
|
const newTime = currentTime["subtract"](1, "day");
|
56
|
-
(
|
57
|
-
(
|
58
|
-
};
|
59
|
-
const _onClickToday = () => {
|
57
|
+
(_c = props.onDateChange) == null ? void 0 : _c.call(props, newTime, newTime.format("YYYY-MM-DD HH:mm:ss"));
|
58
|
+
(_d = props.setIntervalTime) == null ? void 0 : _d.call(props, false);
|
59
|
+
});
|
60
|
+
const _onClickToday = (0, import_ahooks.useMemoizedFn)(() => {
|
60
61
|
var _a2;
|
61
62
|
(_a2 = props.setIntervalTime) == null ? void 0 : _a2.call(props, true);
|
62
|
-
};
|
63
|
-
const _onClickNow = () => {
|
63
|
+
});
|
64
|
+
const _onClickNow = (0, import_ahooks.useMemoizedFn)(() => {
|
64
65
|
var _a2;
|
65
66
|
(_a2 = props.setIntervalTime) == null ? void 0 : _a2.call(props, true);
|
66
|
-
};
|
67
|
-
const _onDateTimeChange = (timeString) => {
|
68
|
-
var _a2, _b2,
|
67
|
+
});
|
68
|
+
const _onDateTimeChange = (0, import_ahooks.useMemoizedFn)((timeString) => {
|
69
|
+
var _a2, _b2, _c, _d;
|
69
70
|
const currentTime = (_b2 = (_a2 = state.modalState) == null ? void 0 : _a2.date) == null ? void 0 : _b2.value;
|
70
71
|
const [hours, minutes] = timeString.split(":").map(Number);
|
71
72
|
const newTime = currentTime.hour(hours).minute(minutes).second(0);
|
72
|
-
(
|
73
|
+
(_c = props.onDateTimeChange) == null ? void 0 : _c.call(props, newTime, newTime.format("YYYY-MM-DD HH:mm:ss"));
|
73
74
|
setGlobalState({
|
74
75
|
isTimeChange: true
|
75
76
|
});
|
76
|
-
(
|
77
|
-
};
|
78
|
-
return
|
79
|
-
|
80
|
-
{
|
81
|
-
|
82
|
-
onClick: _onClickPre,
|
83
|
-
size: "large"
|
84
|
-
}
|
85
|
-
), /* @__PURE__ */ import_react.default.createElement(
|
86
|
-
import_antd.Button,
|
87
|
-
{
|
88
|
-
onClick: _onClickToday,
|
89
|
-
size: "large",
|
90
|
-
style: state.intervalSetTime ? { background: "#000", color: "#fff" } : void 0
|
91
|
-
},
|
92
|
-
import_utils.locales.getText("pisell2.ticket-booking.today")
|
93
|
-
), /* @__PURE__ */ import_react.default.createElement(
|
94
|
-
"div",
|
95
|
-
{
|
96
|
-
className: (0, import_classnames.default)({
|
97
|
-
"booking-page-date-picker-select": state.isDateChange
|
98
|
-
}),
|
99
|
-
style: { width: 200, flexShrink: 0 }
|
100
|
-
},
|
101
|
-
/* @__PURE__ */ import_react.default.createElement(
|
102
|
-
import_materials.DatePicker,
|
77
|
+
(_d = props.setIntervalTime) == null ? void 0 : _d.call(props, false);
|
78
|
+
});
|
79
|
+
return (0, import_react.useMemo)(() => {
|
80
|
+
var _a2, _b2, _c, _d;
|
81
|
+
return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-ticket-booking-time-bar" }, /* @__PURE__ */ import_react.default.createElement(
|
82
|
+
import_antd.Button,
|
103
83
|
{
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
84
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_icons.LeftOutlined, null),
|
85
|
+
onClick: _onClickPre,
|
86
|
+
size: "large"
|
87
|
+
}
|
88
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
89
|
+
import_antd.Button,
|
90
|
+
{
|
91
|
+
onClick: _onClickToday,
|
108
92
|
size: "large",
|
109
|
-
style: {
|
93
|
+
style: state.intervalSetTime ? { background: "#000", color: "#fff" } : void 0
|
94
|
+
},
|
95
|
+
import_utils.locales.getText("pisell2.ticket-booking.today")
|
96
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
97
|
+
"div",
|
98
|
+
{
|
99
|
+
className: (0, import_classnames.default)({
|
100
|
+
"booking-page-date-picker-select": state.isDateChange
|
101
|
+
}),
|
102
|
+
style: { width: 200, flexShrink: 0 }
|
103
|
+
},
|
104
|
+
/* @__PURE__ */ import_react.default.createElement(
|
105
|
+
import_materials.DatePicker,
|
106
|
+
{
|
107
|
+
inputReadOnly: true,
|
108
|
+
value: (_b2 = (_a2 = state == null ? void 0 : state.modalState) == null ? void 0 : _a2.date) == null ? void 0 : _b2.value,
|
109
|
+
format: locale === "en" ? "dddd, DD MMM YYYY" : "YYYY年MM月DD日",
|
110
|
+
onChange: props == null ? void 0 : props.onDateChange,
|
111
|
+
size: "large",
|
112
|
+
style: { width: "100%" }
|
113
|
+
}
|
114
|
+
)
|
115
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
116
|
+
import_antd.Button,
|
117
|
+
{
|
118
|
+
icon: /* @__PURE__ */ import_react.default.createElement(import_icons.RightOutlined, null),
|
119
|
+
onClick: _onClickNext,
|
120
|
+
size: "large"
|
110
121
|
}
|
111
|
-
)
|
112
|
-
|
113
|
-
import_antd.Button,
|
114
|
-
{
|
115
|
-
icon: /* @__PURE__ */ import_react.default.createElement(import_icons.RightOutlined, null),
|
116
|
-
onClick: _onClickNext,
|
117
|
-
size: "large"
|
118
|
-
}
|
119
|
-
), /* @__PURE__ */ import_react.default.createElement(
|
120
|
-
"div",
|
121
|
-
{
|
122
|
-
className: (0, import_classnames.default)({
|
123
|
-
"booking-page-date-picker-select": state.isTimeChange
|
124
|
-
})
|
125
|
-
},
|
126
|
-
/* @__PURE__ */ import_react.default.createElement(
|
127
|
-
import_materials.SelectTime,
|
122
|
+
), /* @__PURE__ */ import_react.default.createElement(
|
123
|
+
"div",
|
128
124
|
{
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
125
|
+
className: (0, import_classnames.default)({
|
126
|
+
"booking-page-date-picker-select": state.isTimeChange
|
127
|
+
})
|
128
|
+
},
|
129
|
+
/* @__PURE__ */ import_react.default.createElement(
|
130
|
+
import_materials.SelectTime,
|
131
|
+
{
|
132
|
+
value: (_d = (_c = state == null ? void 0 : state.modalState) == null ? void 0 : _c.date) == null ? void 0 : _d.value.format("HH:mm"),
|
133
|
+
onChange: _onDateTimeChange,
|
134
|
+
popoverProps: {
|
135
|
+
style: { zoom: 0.8 }
|
136
|
+
},
|
137
|
+
timePickerProps: {},
|
138
|
+
timeProps: {},
|
139
|
+
slice: 5
|
140
|
+
}
|
141
|
+
)
|
142
|
+
), !state.bookingId && /* @__PURE__ */ import_react.default.createElement(
|
143
|
+
import_antd.Button,
|
144
|
+
{
|
145
|
+
onClick: _onClickNow,
|
146
|
+
size: "large",
|
147
|
+
style: state.intervalSetTime ? { background: "#000", color: "#fff" } : void 0
|
148
|
+
},
|
149
|
+
import_utils.locales.getText("pisell2.ticket-booking.now")
|
150
|
+
), !!state.bookingId && /* @__PURE__ */ import_react.default.createElement(
|
151
|
+
import_antd.Button,
|
152
|
+
{
|
153
|
+
onClick: () => {
|
154
|
+
onCreateClick();
|
133
155
|
},
|
134
|
-
|
135
|
-
|
136
|
-
slice: 5
|
137
|
-
}
|
138
|
-
)
|
139
|
-
), !state.bookingId && /* @__PURE__ */ import_react.default.createElement(
|
140
|
-
import_antd.Button,
|
141
|
-
{
|
142
|
-
onClick: _onClickNow,
|
143
|
-
size: "large",
|
144
|
-
style: state.intervalSetTime ? { background: "#000", color: "#fff" } : void 0
|
145
|
-
},
|
146
|
-
import_utils.locales.getText("pisell2.ticket-booking.now")
|
147
|
-
), !!state.bookingId && /* @__PURE__ */ import_react.default.createElement(
|
148
|
-
import_antd.Button,
|
149
|
-
{
|
150
|
-
onClick: () => {
|
151
|
-
onCreateClick();
|
156
|
+
size: "large",
|
157
|
+
type: "primary"
|
152
158
|
},
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
import_utils.locales.getText("pisell2.ticket-booking.create-new")
|
157
|
-
));
|
159
|
+
import_utils.locales.getText("pisell2.ticket-booking.create-new")
|
160
|
+
));
|
161
|
+
}, [(_b = (_a = state.modalState) == null ? void 0 : _a.date) == null ? void 0 : _b.value, state.intervalSetTime, state.isTimeChange, state.isDateChange, locale, state.bookingId]);
|
158
162
|
};
|
159
163
|
var timeBar_default = TimeBar;
|
@@ -40,7 +40,7 @@ declare type ScanData = {
|
|
40
40
|
};
|
41
41
|
};
|
42
42
|
export declare const formatScanCustomer: (data: ScanData) => {
|
43
|
-
searchType: "
|
43
|
+
searchType: "product" | "customer" | "wallet" | "walletPass" | "local_product";
|
44
44
|
data: any;
|
45
45
|
scanCode: string;
|
46
46
|
} | null;
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@pisell/private-materials",
|
3
|
-
"version": "6.2.
|
3
|
+
"version": "6.2.26",
|
4
4
|
"main": "./lib/index.js",
|
5
5
|
"module": "./es/index.js",
|
6
6
|
"types": "./lib/index.d.ts",
|
@@ -61,8 +61,8 @@
|
|
61
61
|
"styled-components": "^6.0.0-rc.3",
|
62
62
|
"@pisell/date-picker": "3.0.4",
|
63
63
|
"@pisell/icon": "0.0.11",
|
64
|
-
"@pisell/
|
65
|
-
"@pisell/
|
64
|
+
"@pisell/utils": "3.0.0",
|
65
|
+
"@pisell/materials": "6.2.26"
|
66
66
|
},
|
67
67
|
"peerDependencies": {
|
68
68
|
"react": "^18.0.0",
|
@@ -1,53 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import { TUpdateDisabledCartItem } from './types';
|
3
|
-
interface CartItem {
|
4
|
-
_id: string;
|
5
|
-
[key: string]: any;
|
6
|
-
}
|
7
|
-
interface CartData {
|
8
|
-
cartItems: CartItem[];
|
9
|
-
currentCartItem: CartItem | null;
|
10
|
-
}
|
11
|
-
interface CartContextType {
|
12
|
-
createCartItem: () => CartItem;
|
13
|
-
createCartItemFromEvent: (eventItem: any) => CartItem;
|
14
|
-
createCartItemFromHolder: (holderItem: any) => CartItem;
|
15
|
-
addToCart: () => void;
|
16
|
-
updateCartItem: (cartItem: CartItem) => CartItem;
|
17
|
-
deleteCartItem: (cartItem: CartItem) => void;
|
18
|
-
clickCartItem: (cartItem: CartItem) => void;
|
19
|
-
updateCurrentCartItem: (cartItem: Partial<CartItem>) => void;
|
20
|
-
clearCurrentCartItem: () => void;
|
21
|
-
currentCartItem: CartItem | null;
|
22
|
-
checkHolder: () => boolean;
|
23
|
-
cartData: CartData;
|
24
|
-
openCart: boolean;
|
25
|
-
onOpenCart: any;
|
26
|
-
onCloseCart: any;
|
27
|
-
deleteCartItemByHolder: (holder_id: number) => void;
|
28
|
-
addHolderToCartItem: (holderItem: any) => void;
|
29
|
-
cartDataHolderList: any;
|
30
|
-
addNoteToCartItem: (cartItem: CartItem) => void;
|
31
|
-
updateDisabledCartItem: TUpdateDisabledCartItem;
|
32
|
-
getWithoutCartItemsHolderNames: () => Array<string>;
|
33
|
-
checkBeforeAddToCartResquest: any;
|
34
|
-
checkBeforeAddToCart: () => Promise<{
|
35
|
-
result: boolean;
|
36
|
-
num: number;
|
37
|
-
}>;
|
38
|
-
}
|
39
|
-
interface CartProviderProps {
|
40
|
-
children: React.ReactNode;
|
41
|
-
}
|
42
|
-
export declare const CartContext: React.Context<CartContextType | undefined>;
|
43
|
-
export declare const CartProvider: React.FC<CartProviderProps>;
|
44
|
-
/**
|
45
|
-
* 使用步骤管理的Hook
|
46
|
-
* @throws {Error} 如果在StepProvider外部使用会抛出错误
|
47
|
-
* @returns {StepContextType} 步骤管理上下文
|
48
|
-
*/
|
49
|
-
export declare const useCart: () => CartContextType;
|
50
|
-
declare const _default: {
|
51
|
-
defaultState: CartData;
|
52
|
-
};
|
53
|
-
export default _default;
|
@@ -1,17 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* @title: 添加额外商品
|
3
|
-
* @description:
|
4
|
-
* @return {*}
|
5
|
-
* @Author: zhiwei.Wang
|
6
|
-
* @Date: 2024-01-30 16:33
|
7
|
-
*/
|
8
|
-
import './index.less';
|
9
|
-
export interface InfoProps {
|
10
|
-
title?: string;
|
11
|
-
style?: any;
|
12
|
-
globalState: any;
|
13
|
-
setGlobalState: any;
|
14
|
-
}
|
15
|
-
export declare const formatProducts: (values: any) => any;
|
16
|
-
declare const Addons: any;
|
17
|
-
export default Addons;
|
@@ -1,29 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import './index.less';
|
3
|
-
interface ActionButtonsProps {
|
4
|
-
/** booking 状态对象,包含 service、addons 等数据 */
|
5
|
-
state: {
|
6
|
-
service?: {
|
7
|
-
value?: any[];
|
8
|
-
};
|
9
|
-
addons?: {
|
10
|
-
value?: any[];
|
11
|
-
};
|
12
|
-
disabledEdit?: boolean;
|
13
|
-
channelDisabledEdit?: boolean;
|
14
|
-
shop_discount?: string;
|
15
|
-
bookingDetail?: {
|
16
|
-
[key: string]: any;
|
17
|
-
};
|
18
|
-
[key: string]: any;
|
19
|
-
};
|
20
|
-
/** dispatch 函数,用于触发状态更新 */
|
21
|
-
dispatch: (action: {
|
22
|
-
type: string;
|
23
|
-
payload?: any;
|
24
|
-
}) => void;
|
25
|
-
/** 是否禁用所有按钮 */
|
26
|
-
disabled?: boolean;
|
27
|
-
}
|
28
|
-
declare const ActionButtons: React.FC<ActionButtonsProps>;
|
29
|
-
export default ActionButtons;
|
@@ -1,10 +0,0 @@
|
|
1
|
-
import React from 'react';
|
2
|
-
import './index.less';
|
3
|
-
interface ClearCartModalProps {
|
4
|
-
visible: boolean;
|
5
|
-
onCancel: () => void;
|
6
|
-
onClearItemsOnly: () => void;
|
7
|
-
onClearAllAndReset: () => void;
|
8
|
-
}
|
9
|
-
declare const ClearCartModal: React.FC<ClearCartModalProps>;
|
10
|
-
export default ClearCartModal;
|