@pisell/private-materials 6.2.25 → 6.2.27
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/index.js +1 -1
- package/build/lowcode/meta.js +1 -1
- package/build/lowcode/preview.js +143 -159
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +8 -8
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- 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/components/customiseItemModal/index.js +5 -1
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/es/components/booking/forms/table/index.d.ts +0 -1
- package/es/components/booking/hooks/useClearCart.js +11 -8
- package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/es/components/booking/info/client/index.js +3 -2
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.js +13 -14
- package/es/components/booking/info/index.d.ts +0 -1
- package/es/components/booking/info/service/Lists.js +37 -27
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- 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/service/like/index.d.ts +0 -1
- package/es/components/booking/info/service2/utils.js +29 -21
- package/es/components/booking/info2/index.js +1 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- 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/info2/utilsByBooking.js +2 -1
- package/es/components/booking/materiels/duration/index.js +9 -2
- package/es/components/booking/materiels/holder/index.d.ts +0 -1
- package/es/components/booking/materiels/startTime/index.d.ts +0 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftpos/deviceList/index.d.ts +0 -1
- package/es/components/eftpos/form/index.d.ts +0 -1
- package/es/components/eftpos/group/index.d.ts +0 -1
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftpos/icon/apiKey.d.ts +0 -1
- package/es/components/eftpos/icon/device.d.ts +0 -1
- package/es/components/eftpos/receipt/index.d.ts +0 -1
- package/es/components/eftpos/surcharge/index.d.ts +0 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/app.d.ts +0 -1
- package/es/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/es/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/es/components/eftposPay/component/step/index.d.ts +0 -1
- package/es/components/eftposPay/component/step/step.d.ts +0 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/store/index.d.ts +5 -5
- package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
- package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/es/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/es/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/es/components/schedules/products/index.d.ts +0 -1
- package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Cart/Product.js +77 -51
- package/es/components/shoppingCart/components/Cart/index.js +21 -18
- package/es/components/shoppingCart/components/Cart/index.less +14 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +171 -151
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/es/components/ticketBooking/components/addServiceVariant/utils.js +4 -3
- package/es/components/ticketBooking/components/timeBar/index.js +77 -73
- package/es/components/ticketBooking/index.less +1 -1
- package/es/components/ticketBooking/utils/index.js +13 -8
- package/es/plus/clientName/index.d.ts +0 -1
- package/es/pro/pisellNumberSelector/index.less +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/components/customiseItemModal/index.js +7 -1
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/lib/components/booking/forms/table/index.d.ts +0 -1
- package/lib/components/booking/hooks/useClearCart.js +16 -13
- package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/lib/components/booking/info/client/index.js +5 -4
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.js +12 -13
- package/lib/components/booking/info/index.d.ts +0 -1
- package/lib/components/booking/info/service/Lists.js +36 -24
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- 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/service/like/index.d.ts +0 -1
- package/lib/components/booking/info/service2/utils.js +26 -17
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- 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/info2/utilsByBooking.js +2 -1
- package/lib/components/booking/materiels/duration/index.js +7 -2
- package/lib/components/booking/materiels/holder/index.d.ts +0 -1
- package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftpos/deviceList/index.d.ts +0 -1
- package/lib/components/eftpos/form/index.d.ts +0 -1
- package/lib/components/eftpos/group/index.d.ts +0 -1
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftpos/icon/apiKey.d.ts +0 -1
- package/lib/components/eftpos/icon/device.d.ts +0 -1
- package/lib/components/eftpos/receipt/index.d.ts +0 -1
- package/lib/components/eftpos/surcharge/index.d.ts +0 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/app.d.ts +0 -1
- package/lib/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/lib/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/lib/components/eftposPay/component/step/index.d.ts +0 -1
- package/lib/components/eftposPay/component/step/step.d.ts +0 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/store/index.d.ts +5 -5
- package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +0 -1
- package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/lib/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/lib/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/lib/components/schedules/products/index.d.ts +0 -1
- package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Cart/Product.js +58 -31
- package/lib/components/shoppingCart/components/Cart/index.js +18 -15
- package/lib/components/shoppingCart/components/Cart/index.less +14 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +140 -122
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/addServiceVariant/utils.js +2 -1
- package/lib/components/ticketBooking/components/timeBar/index.js +98 -94
- package/lib/components/ticketBooking/index.less +1 -1
- package/lib/components/ticketBooking/utils/index.js +4 -4
- package/lib/plus/clientName/index.d.ts +0 -1
- package/lib/pro/pisellNumberSelector/index.less +1 -1
- package/package.json +4 -4
@@ -34,7 +34,7 @@ import dayjs from 'dayjs';
|
|
34
34
|
import { useProducts } from "../../hooks/pisellos";
|
35
35
|
import { createCacheItem, genValues, isBundle, isOption, setHandleSetService } from "./utils";
|
36
36
|
var AddSerivce = function AddSerivce(props) {
|
37
|
-
var _context$appHelper, _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _state$bookingConfig2, _state$client2
|
37
|
+
var _context$appHelper, _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _state$bookingConfig2, _state$client2;
|
38
38
|
var onEdit = props.onEdit,
|
39
39
|
state = props.state,
|
40
40
|
dispatch = props.dispatch,
|
@@ -221,10 +221,178 @@ var AddSerivce = function AddSerivce(props) {
|
|
221
221
|
var isEject = getIsEject(item, type);
|
222
222
|
var isOnlySession = getIsOnlySession(item);
|
223
223
|
var lock = false;
|
224
|
+
// 对于不需要打开弹窗的商品, 直接模拟数据, 不走弹窗
|
225
|
+
var cacheValues = null;
|
224
226
|
if (isEject) {
|
225
227
|
setCurrentProduct(item);
|
226
228
|
} else {
|
227
229
|
setCurrentProduct(null);
|
230
|
+
if (!isSession) {
|
231
|
+
cacheValues = {
|
232
|
+
bundle: [],
|
233
|
+
key: item.id,
|
234
|
+
option: [],
|
235
|
+
product_id: item.id,
|
236
|
+
product_variant_id: 0,
|
237
|
+
quantity: 1,
|
238
|
+
rowKey: item.id,
|
239
|
+
session: null,
|
240
|
+
unique: '08974625397'
|
241
|
+
};
|
242
|
+
}
|
243
|
+
}
|
244
|
+
var callback = /*#__PURE__*/function () {
|
245
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e, extension_type, detail) {
|
246
|
+
var data, _detail, other, cacheItem, _total, _isEdit, _state$service$cacheI, _addService2, _list, quantity, _context$appHelper$ut4, _context$appHelper$ut5, val, sendData;
|
247
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
248
|
+
while (1) switch (_context.prev = _context.next) {
|
249
|
+
case 0:
|
250
|
+
setCurrentProduct(null);
|
251
|
+
// 防止选择商品弹窗多次触发callback
|
252
|
+
if (!lock) {
|
253
|
+
_context.next = 3;
|
254
|
+
break;
|
255
|
+
}
|
256
|
+
return _context.abrupt("return");
|
257
|
+
case 3:
|
258
|
+
lock = true;
|
259
|
+
|
260
|
+
// 2秒后解除
|
261
|
+
setTimeout(function () {
|
262
|
+
lock = false;
|
263
|
+
}, 2000);
|
264
|
+
if (isBooking4) {
|
265
|
+
_context.next = 11;
|
266
|
+
break;
|
267
|
+
}
|
268
|
+
_context.next = 8;
|
269
|
+
return createBookingData({
|
270
|
+
product: _objectSpread(_objectSpread({}, detail || item), {}, {
|
271
|
+
_params: e
|
272
|
+
})
|
273
|
+
});
|
274
|
+
case 8:
|
275
|
+
data = _context.sent;
|
276
|
+
// 创建预约
|
277
|
+
createBooking({
|
278
|
+
booking: data
|
279
|
+
});
|
280
|
+
return _context.abrupt("return");
|
281
|
+
case 11:
|
282
|
+
// info2 addService 逻辑
|
283
|
+
_detail = detail || item;
|
284
|
+
other = JSON.parse(JSON.stringify(e));
|
285
|
+
other.session = e.session;
|
286
|
+
cacheItem = _objectSpread(_objectSpread({}, _detail), {}, {
|
287
|
+
product_id: item.id,
|
288
|
+
_id: getUniqueId(),
|
289
|
+
_key: e.key,
|
290
|
+
_extend: {
|
291
|
+
start_date: state.date.value,
|
292
|
+
quantity: (e === null || e === void 0 ? void 0 : e.quantity) || 1,
|
293
|
+
price: _detail.price,
|
294
|
+
product_name: item.title,
|
295
|
+
other: other
|
296
|
+
},
|
297
|
+
new: 1
|
298
|
+
});
|
299
|
+
_total = getProductTotalPrice(cacheItem); // 用于折扣 可修改
|
300
|
+
cacheItem._extend.total = _total;
|
301
|
+
// 用于储存原价
|
302
|
+
cacheItem._extend.origin_total = _total;
|
303
|
+
_isEdit = !!state.service.cacheItem;
|
304
|
+
if (_isEdit) {
|
305
|
+
cacheItem._id = (_state$service$cacheI = state.service.cacheItem) === null || _state$service$cacheI === void 0 ? void 0 : _state$service$cacheI._id;
|
306
|
+
cacheItem.new = 0;
|
307
|
+
}
|
308
|
+
// 渲染到当前位置模式时,默认无资源 时间默认取顶部设置的时间
|
309
|
+
if (renderMode === 'current') {
|
310
|
+
// cacheItem._extend.resource = 0;
|
311
|
+
cacheItem.currentDefaultTime = state.date.value.format('HH:mm');
|
312
|
+
}
|
313
|
+
cacheItem = getProductExtend({
|
314
|
+
cacheItem: cacheItem,
|
315
|
+
state: state,
|
316
|
+
isDisabledTime: true
|
317
|
+
});
|
318
|
+
if (state.renderType === 'eventBooking') {
|
319
|
+
cacheItem.autoClose = false;
|
320
|
+
}
|
321
|
+
if (cacheItem.autoClose) {
|
322
|
+
cacheItem.autoClose = false;
|
323
|
+
cacheItem._serviceKey = genServiceKey(cacheItem);
|
324
|
+
_addService2 = addService(_toConsumableArray(state.service.value), cacheItem, state), _list = _addService2.list, quantity = _addService2.quantity;
|
325
|
+
handleAddToast(cacheItem.title, quantity || 1);
|
326
|
+
addServiceScroll(e.rowKey, cacheItem);
|
327
|
+
try {
|
328
|
+
if (((_context$appHelper$ut4 = context.appHelper.utils.store) === null || _context$appHelper$ut4 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut4.getState) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.call(_context$appHelper$ut4)) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.global) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.globalConfig) === null || _context$appHelper$ut5 === void 0 ? void 0 : _context$appHelper$ut5.id) === 2155) {
|
329
|
+
val = _list === null || _list === void 0 ? void 0 : _list.map(function (s) {
|
330
|
+
return {
|
331
|
+
product_id: s === null || s === void 0 ? void 0 : s.product_id,
|
332
|
+
detailId: s === null || s === void 0 ? void 0 : s.id,
|
333
|
+
detailProductId: s === null || s === void 0 ? void 0 : s.product_id,
|
334
|
+
product_name: s === null || s === void 0 ? void 0 : s.title,
|
335
|
+
price: s === null || s === void 0 ? void 0 : s.price,
|
336
|
+
_id: s === null || s === void 0 ? void 0 : s._id,
|
337
|
+
_key: s === null || s === void 0 ? void 0 : s._key,
|
338
|
+
_serviceKey: s === null || s === void 0 ? void 0 : s._serviceKey
|
339
|
+
};
|
340
|
+
});
|
341
|
+
sendData = {
|
342
|
+
product_id: item === null || item === void 0 ? void 0 : item.id,
|
343
|
+
detailId: _detail === null || _detail === void 0 ? void 0 : _detail.id,
|
344
|
+
detailProductId: _detail === null || _detail === void 0 ? void 0 : _detail.product_id,
|
345
|
+
product_name: item === null || item === void 0 ? void 0 : item.title,
|
346
|
+
price: _detail === null || _detail === void 0 ? void 0 : _detail.price,
|
347
|
+
serviceVal: val
|
348
|
+
};
|
349
|
+
sendWarningLog({
|
350
|
+
title: 'addService',
|
351
|
+
content: [{
|
352
|
+
key: '添加数据',
|
353
|
+
value: JSON.stringify(sendData)
|
354
|
+
}, {
|
355
|
+
key: '日期',
|
356
|
+
value: dayjs().format('YYYY-MM-DD HH:mm:ss')
|
357
|
+
}]
|
358
|
+
});
|
359
|
+
}
|
360
|
+
} catch (error) {}
|
361
|
+
dispatch({
|
362
|
+
type: 'setService',
|
363
|
+
payload: {
|
364
|
+
addModal: false,
|
365
|
+
value: _list,
|
366
|
+
edit: true,
|
367
|
+
changeService: false
|
368
|
+
}
|
369
|
+
});
|
370
|
+
} else {
|
371
|
+
dispatch({
|
372
|
+
type: 'setService',
|
373
|
+
payload: {
|
374
|
+
editModal: true,
|
375
|
+
cacheItem: cacheItem,
|
376
|
+
addModal: !cacheItem.autoClose,
|
377
|
+
changeService: false
|
378
|
+
}
|
379
|
+
});
|
380
|
+
onEdit === null || onEdit === void 0 || onEdit(cacheItem);
|
381
|
+
}
|
382
|
+
case 24:
|
383
|
+
case "end":
|
384
|
+
return _context.stop();
|
385
|
+
}
|
386
|
+
}, _callee);
|
387
|
+
}));
|
388
|
+
return function callback(_x, _x2, _x3) {
|
389
|
+
return _ref.apply(this, arguments);
|
390
|
+
};
|
391
|
+
}();
|
392
|
+
// 如果不需要打开弹窗, 直接添加数据
|
393
|
+
if (cacheValues) {
|
394
|
+
callback(cacheValues, '', item);
|
395
|
+
return;
|
228
396
|
}
|
229
397
|
state.action({
|
230
398
|
type: 'pisell1.handleOpenProductModal',
|
@@ -246,155 +414,7 @@ var AddSerivce = function AddSerivce(props) {
|
|
246
414
|
onCancel: function onCancel() {
|
247
415
|
setCurrentProduct(null);
|
248
416
|
},
|
249
|
-
callback:
|
250
|
-
var _callback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e, extension_type, detail) {
|
251
|
-
var data, _detail, other, cacheItem, _total, _isEdit, _state$service$cacheI, _addService2, _list, quantity, _context$appHelper$ut4, _context$appHelper$ut5, val, sendData;
|
252
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
253
|
-
while (1) switch (_context.prev = _context.next) {
|
254
|
-
case 0:
|
255
|
-
setCurrentProduct(null);
|
256
|
-
// 防止选择商品弹窗多次触发callback
|
257
|
-
if (!lock) {
|
258
|
-
_context.next = 3;
|
259
|
-
break;
|
260
|
-
}
|
261
|
-
return _context.abrupt("return");
|
262
|
-
case 3:
|
263
|
-
lock = true;
|
264
|
-
|
265
|
-
// 2秒后解除
|
266
|
-
setTimeout(function () {
|
267
|
-
lock = false;
|
268
|
-
}, 2000);
|
269
|
-
if (isBooking4) {
|
270
|
-
_context.next = 11;
|
271
|
-
break;
|
272
|
-
}
|
273
|
-
_context.next = 8;
|
274
|
-
return createBookingData({
|
275
|
-
product: _objectSpread(_objectSpread({}, detail || item), {}, {
|
276
|
-
_params: e
|
277
|
-
})
|
278
|
-
});
|
279
|
-
case 8:
|
280
|
-
data = _context.sent;
|
281
|
-
// 创建预约
|
282
|
-
createBooking({
|
283
|
-
booking: data
|
284
|
-
});
|
285
|
-
return _context.abrupt("return");
|
286
|
-
case 11:
|
287
|
-
// info2 addService 逻辑
|
288
|
-
_detail = detail || item;
|
289
|
-
other = JSON.parse(JSON.stringify(e));
|
290
|
-
other.session = e.session;
|
291
|
-
cacheItem = _objectSpread(_objectSpread({}, _detail), {}, {
|
292
|
-
product_id: item.id,
|
293
|
-
_id: getUniqueId(),
|
294
|
-
_key: e.key,
|
295
|
-
_extend: {
|
296
|
-
start_date: state.date.value,
|
297
|
-
quantity: (e === null || e === void 0 ? void 0 : e.quantity) || 1,
|
298
|
-
price: _detail.price,
|
299
|
-
product_name: item.title,
|
300
|
-
other: other
|
301
|
-
},
|
302
|
-
new: 1
|
303
|
-
});
|
304
|
-
_total = getProductTotalPrice(cacheItem); // 用于折扣 可修改
|
305
|
-
cacheItem._extend.total = _total;
|
306
|
-
// 用于储存原价
|
307
|
-
cacheItem._extend.origin_total = _total;
|
308
|
-
_isEdit = !!state.service.cacheItem;
|
309
|
-
if (_isEdit) {
|
310
|
-
cacheItem._id = (_state$service$cacheI = state.service.cacheItem) === null || _state$service$cacheI === void 0 ? void 0 : _state$service$cacheI._id;
|
311
|
-
cacheItem.new = 0;
|
312
|
-
}
|
313
|
-
// 渲染到当前位置模式时,默认无资源 时间默认取顶部设置的时间
|
314
|
-
if (renderMode === 'current') {
|
315
|
-
// cacheItem._extend.resource = 0;
|
316
|
-
cacheItem.currentDefaultTime = state.date.value.format('HH:mm');
|
317
|
-
}
|
318
|
-
cacheItem = getProductExtend({
|
319
|
-
cacheItem: cacheItem,
|
320
|
-
state: state,
|
321
|
-
isDisabledTime: true
|
322
|
-
});
|
323
|
-
if (state.renderType === 'eventBooking') {
|
324
|
-
cacheItem.autoClose = false;
|
325
|
-
}
|
326
|
-
if (cacheItem.autoClose) {
|
327
|
-
cacheItem.autoClose = false;
|
328
|
-
cacheItem._serviceKey = genServiceKey(cacheItem);
|
329
|
-
_addService2 = addService(_toConsumableArray(state.service.value), cacheItem, state), _list = _addService2.list, quantity = _addService2.quantity;
|
330
|
-
handleAddToast(cacheItem.title, quantity || 1);
|
331
|
-
addServiceScroll(e.rowKey, cacheItem);
|
332
|
-
try {
|
333
|
-
if (((_context$appHelper$ut4 = context.appHelper.utils.store) === null || _context$appHelper$ut4 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut4.getState) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.call(_context$appHelper$ut4)) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.global) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut5 = _context$appHelper$ut5.globalConfig) === null || _context$appHelper$ut5 === void 0 ? void 0 : _context$appHelper$ut5.id) === 2155) {
|
334
|
-
val = _list === null || _list === void 0 ? void 0 : _list.map(function (s) {
|
335
|
-
return {
|
336
|
-
product_id: s === null || s === void 0 ? void 0 : s.product_id,
|
337
|
-
detailId: s === null || s === void 0 ? void 0 : s.id,
|
338
|
-
detailProductId: s === null || s === void 0 ? void 0 : s.product_id,
|
339
|
-
product_name: s === null || s === void 0 ? void 0 : s.title,
|
340
|
-
price: s === null || s === void 0 ? void 0 : s.price,
|
341
|
-
_id: s === null || s === void 0 ? void 0 : s._id,
|
342
|
-
_key: s === null || s === void 0 ? void 0 : s._key,
|
343
|
-
_serviceKey: s === null || s === void 0 ? void 0 : s._serviceKey
|
344
|
-
};
|
345
|
-
});
|
346
|
-
sendData = {
|
347
|
-
product_id: item === null || item === void 0 ? void 0 : item.id,
|
348
|
-
detailId: _detail === null || _detail === void 0 ? void 0 : _detail.id,
|
349
|
-
detailProductId: _detail === null || _detail === void 0 ? void 0 : _detail.product_id,
|
350
|
-
product_name: item === null || item === void 0 ? void 0 : item.title,
|
351
|
-
price: _detail === null || _detail === void 0 ? void 0 : _detail.price,
|
352
|
-
serviceVal: val
|
353
|
-
};
|
354
|
-
sendWarningLog({
|
355
|
-
title: 'addService',
|
356
|
-
content: [{
|
357
|
-
key: '添加数据',
|
358
|
-
value: JSON.stringify(sendData)
|
359
|
-
}, {
|
360
|
-
key: '日期',
|
361
|
-
value: dayjs().format('YYYY-MM-DD HH:mm:ss')
|
362
|
-
}]
|
363
|
-
});
|
364
|
-
}
|
365
|
-
} catch (error) {}
|
366
|
-
dispatch({
|
367
|
-
type: 'setService',
|
368
|
-
payload: {
|
369
|
-
addModal: false,
|
370
|
-
value: _list,
|
371
|
-
edit: true,
|
372
|
-
changeService: false
|
373
|
-
}
|
374
|
-
});
|
375
|
-
} else {
|
376
|
-
dispatch({
|
377
|
-
type: 'setService',
|
378
|
-
payload: {
|
379
|
-
editModal: true,
|
380
|
-
cacheItem: cacheItem,
|
381
|
-
addModal: !cacheItem.autoClose,
|
382
|
-
changeService: false
|
383
|
-
}
|
384
|
-
});
|
385
|
-
onEdit === null || onEdit === void 0 || onEdit(cacheItem);
|
386
|
-
}
|
387
|
-
case 24:
|
388
|
-
case "end":
|
389
|
-
return _context.stop();
|
390
|
-
}
|
391
|
-
}, _callee);
|
392
|
-
}));
|
393
|
-
function callback(_x, _x2, _x3) {
|
394
|
-
return _callback.apply(this, arguments);
|
395
|
-
}
|
396
|
-
return callback;
|
397
|
-
}()
|
417
|
+
callback: callback
|
398
418
|
});
|
399
419
|
});
|
400
420
|
var renderList = useMemo(function () {
|
@@ -451,6 +471,6 @@ var AddSerivce = function AddSerivce(props) {
|
|
451
471
|
}));
|
452
472
|
}
|
453
473
|
return null;
|
454
|
-
}, [
|
474
|
+
}, [state.service.addModal, locales, renderList, state.amountSymbol, state.renderType, state === null || state === void 0 ? void 0 : state.activeCartId, holderId(state), loading, currentProduct, isBooking4]);
|
455
475
|
};
|
456
476
|
export default AddSerivce;
|
@@ -148,7 +148,8 @@ export var isVariant = function isVariant(item) {
|
|
148
148
|
|
149
149
|
// 单规格
|
150
150
|
export var isOption = function isOption(item) {
|
151
|
-
|
151
|
+
var _item$option_group;
|
152
|
+
return (item === null || item === void 0 ? void 0 : item.option_group_count) > 0 || (item === null || item === void 0 || (_item$option_group = item.option_group) === null || _item$option_group === void 0 ? void 0 : _item$option_group.length) > 0;
|
152
153
|
};
|
153
154
|
|
154
155
|
// 套餐
|
@@ -156,7 +157,7 @@ export var isBundle = function isBundle(item) {
|
|
156
157
|
return (item === null || item === void 0 ? void 0 : item.bundle_group_count) > 0;
|
157
158
|
};
|
158
159
|
export var genValues = function genValues(item, code) {
|
159
|
-
var _item$variant_group, _item$
|
160
|
+
var _item$variant_group, _item$option_group2;
|
160
161
|
var params = {
|
161
162
|
bundle: [],
|
162
163
|
option: [],
|
@@ -168,7 +169,7 @@ export var genValues = function genValues(item, code) {
|
|
168
169
|
rowKey: "",
|
169
170
|
session: null
|
170
171
|
};
|
171
|
-
if (item !== null && item !== void 0 && (_item$variant_group = item.variant_group) !== null && _item$variant_group !== void 0 && _item$variant_group.length || item !== null && item !== void 0 && (_item$
|
172
|
+
if (item !== null && item !== void 0 && (_item$variant_group = item.variant_group) !== null && _item$variant_group !== void 0 && _item$variant_group.length || item !== null && item !== void 0 && (_item$option_group2 = item.option_group) !== null && _item$option_group2 !== void 0 && _item$option_group2.length) {
|
172
173
|
var variantItem = item.variant.find(function (item) {
|
173
174
|
return item.code === code || item.barcode === code;
|
174
175
|
});
|
@@ -4,44 +4,45 @@ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o =
|
|
4
4
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
5
5
|
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
6
6
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
7
|
-
import React from 'react';
|
7
|
+
import React, { useMemo } from 'react';
|
8
8
|
import { LeftOutlined, RightOutlined } from '@ant-design/icons';
|
9
9
|
import { DatePicker, SelectTime } from '@pisell/materials';
|
10
|
+
import { useMemoizedFn } from "ahooks";
|
10
11
|
import { Button } from 'antd';
|
11
12
|
import classNames from 'classnames';
|
12
13
|
import { locales } from '@pisell/utils';
|
13
14
|
import "./index.less";
|
14
15
|
var TimeBar = function TimeBar(props) {
|
15
|
-
var _state$
|
16
|
+
var _state$modalState6;
|
16
17
|
var state = props.globalState,
|
17
18
|
setGlobalState = props.setGlobalState,
|
18
19
|
locale = props.locale,
|
19
20
|
onCreateClick = props.onCreateClick;
|
20
|
-
var _onClickNext = function
|
21
|
+
var _onClickNext = useMemoizedFn(function () {
|
21
22
|
var _state$modalState, _props$onDateChange, _props$setIntervalTim;
|
22
23
|
var currentTime = (_state$modalState = state.modalState) === null || _state$modalState === void 0 || (_state$modalState = _state$modalState.date) === null || _state$modalState === void 0 ? void 0 : _state$modalState.value;
|
23
24
|
var newTime = currentTime['add'](1, 'day');
|
24
25
|
(_props$onDateChange = props.onDateChange) === null || _props$onDateChange === void 0 || _props$onDateChange.call(props, newTime, newTime.format('YYYY-MM-DD HH:mm:ss'));
|
25
26
|
(_props$setIntervalTim = props.setIntervalTime) === null || _props$setIntervalTim === void 0 || _props$setIntervalTim.call(props, false);
|
26
|
-
};
|
27
|
-
var _onClickPre = function
|
27
|
+
});
|
28
|
+
var _onClickPre = useMemoizedFn(function () {
|
28
29
|
var _state$modalState2, _props$onDateChange2, _props$setIntervalTim2;
|
29
30
|
var currentTime = (_state$modalState2 = state.modalState) === null || _state$modalState2 === void 0 || (_state$modalState2 = _state$modalState2.date) === null || _state$modalState2 === void 0 ? void 0 : _state$modalState2.value;
|
30
31
|
var newTime = currentTime['subtract'](1, 'day');
|
31
32
|
(_props$onDateChange2 = props.onDateChange) === null || _props$onDateChange2 === void 0 || _props$onDateChange2.call(props, newTime, newTime.format('YYYY-MM-DD HH:mm:ss'));
|
32
33
|
(_props$setIntervalTim2 = props.setIntervalTime) === null || _props$setIntervalTim2 === void 0 || _props$setIntervalTim2.call(props, false);
|
33
|
-
};
|
34
|
-
var _onClickToday = function
|
34
|
+
});
|
35
|
+
var _onClickToday = useMemoizedFn(function () {
|
35
36
|
var _props$setIntervalTim3;
|
36
37
|
(_props$setIntervalTim3 = props.setIntervalTime) === null || _props$setIntervalTim3 === void 0 || _props$setIntervalTim3.call(props, true);
|
37
|
-
};
|
38
|
-
var _onClickNow = function
|
38
|
+
});
|
39
|
+
var _onClickNow = useMemoizedFn(function () {
|
39
40
|
var _props$setIntervalTim4;
|
40
41
|
(_props$setIntervalTim4 = props.setIntervalTime) === null || _props$setIntervalTim4 === void 0 || _props$setIntervalTim4.call(props, true);
|
41
|
-
};
|
42
|
+
});
|
42
43
|
|
43
44
|
// 时间选择变更事件
|
44
|
-
var _onDateTimeChange = function
|
45
|
+
var _onDateTimeChange = useMemoizedFn(function (timeString) {
|
45
46
|
var _state$modalState3, _props$onDateTimeChan, _props$setIntervalTim5;
|
46
47
|
var currentTime = (_state$modalState3 = state.modalState) === null || _state$modalState3 === void 0 || (_state$modalState3 = _state$modalState3.date) === null || _state$modalState3 === void 0 ? void 0 : _state$modalState3.value;
|
47
48
|
var _timeString$split$map = timeString.split(':').map(Number),
|
@@ -54,69 +55,72 @@ var TimeBar = function TimeBar(props) {
|
|
54
55
|
isTimeChange: true
|
55
56
|
});
|
56
57
|
(_props$setIntervalTim5 = props.setIntervalTime) === null || _props$setIntervalTim5 === void 0 || _props$setIntervalTim5.call(props, false);
|
57
|
-
};
|
58
|
-
return
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
flexShrink: 0
|
78
|
-
}
|
79
|
-
}, /*#__PURE__*/React.createElement(DatePicker, {
|
80
|
-
inputReadOnly: true,
|
81
|
-
value: state === null || state === void 0 || (_state$modalState4 = state.modalState) === null || _state$modalState4 === void 0 || (_state$modalState4 = _state$modalState4.date) === null || _state$modalState4 === void 0 ? void 0 : _state$modalState4.value,
|
82
|
-
format: locale === 'en' ? 'dddd, DD MMM YYYY' : 'YYYY年MM月DD日',
|
83
|
-
onChange: props === null || props === void 0 ? void 0 : props.onDateChange,
|
84
|
-
size: "large",
|
85
|
-
style: {
|
86
|
-
width: '100%'
|
87
|
-
}
|
88
|
-
})), /*#__PURE__*/React.createElement(Button, {
|
89
|
-
icon: /*#__PURE__*/React.createElement(RightOutlined, null),
|
90
|
-
onClick: _onClickNext,
|
91
|
-
size: "large"
|
92
|
-
}), /*#__PURE__*/React.createElement("div", {
|
93
|
-
className: classNames({
|
94
|
-
'booking-page-date-picker-select': state.isTimeChange
|
95
|
-
})
|
96
|
-
}, /*#__PURE__*/React.createElement(SelectTime, {
|
97
|
-
value: state === null || state === void 0 || (_state$modalState5 = state.modalState) === null || _state$modalState5 === void 0 || (_state$modalState5 = _state$modalState5.date) === null || _state$modalState5 === void 0 ? void 0 : _state$modalState5.value.format('HH:mm'),
|
98
|
-
onChange: _onDateTimeChange,
|
99
|
-
popoverProps: {
|
58
|
+
});
|
59
|
+
return useMemo(function () {
|
60
|
+
var _state$modalState4, _state$modalState5;
|
61
|
+
return /*#__PURE__*/React.createElement("div", {
|
62
|
+
className: "pisell-ticket-booking-time-bar"
|
63
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
64
|
+
icon: /*#__PURE__*/React.createElement(LeftOutlined, null),
|
65
|
+
onClick: _onClickPre,
|
66
|
+
size: "large"
|
67
|
+
}), /*#__PURE__*/React.createElement(Button, {
|
68
|
+
onClick: _onClickToday,
|
69
|
+
size: "large",
|
70
|
+
style: state.intervalSetTime ? {
|
71
|
+
background: '#000',
|
72
|
+
color: '#fff'
|
73
|
+
} : undefined
|
74
|
+
}, locales.getText('pisell2.ticket-booking.today')), /*#__PURE__*/React.createElement("div", {
|
75
|
+
className: classNames({
|
76
|
+
'booking-page-date-picker-select': state.isDateChange
|
77
|
+
}),
|
100
78
|
style: {
|
101
|
-
|
79
|
+
width: 200,
|
80
|
+
flexShrink: 0
|
102
81
|
}
|
103
|
-
},
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
|
116
|
-
|
117
|
-
|
118
|
-
|
119
|
-
|
120
|
-
|
82
|
+
}, /*#__PURE__*/React.createElement(DatePicker, {
|
83
|
+
inputReadOnly: true,
|
84
|
+
value: state === null || state === void 0 || (_state$modalState4 = state.modalState) === null || _state$modalState4 === void 0 || (_state$modalState4 = _state$modalState4.date) === null || _state$modalState4 === void 0 ? void 0 : _state$modalState4.value,
|
85
|
+
format: locale === 'en' ? 'dddd, DD MMM YYYY' : 'YYYY年MM月DD日',
|
86
|
+
onChange: props === null || props === void 0 ? void 0 : props.onDateChange,
|
87
|
+
size: "large",
|
88
|
+
style: {
|
89
|
+
width: '100%'
|
90
|
+
}
|
91
|
+
})), /*#__PURE__*/React.createElement(Button, {
|
92
|
+
icon: /*#__PURE__*/React.createElement(RightOutlined, null),
|
93
|
+
onClick: _onClickNext,
|
94
|
+
size: "large"
|
95
|
+
}), /*#__PURE__*/React.createElement("div", {
|
96
|
+
className: classNames({
|
97
|
+
'booking-page-date-picker-select': state.isTimeChange
|
98
|
+
})
|
99
|
+
}, /*#__PURE__*/React.createElement(SelectTime, {
|
100
|
+
value: state === null || state === void 0 || (_state$modalState5 = state.modalState) === null || _state$modalState5 === void 0 || (_state$modalState5 = _state$modalState5.date) === null || _state$modalState5 === void 0 ? void 0 : _state$modalState5.value.format('HH:mm'),
|
101
|
+
onChange: _onDateTimeChange,
|
102
|
+
popoverProps: {
|
103
|
+
style: {
|
104
|
+
zoom: 0.8
|
105
|
+
}
|
106
|
+
},
|
107
|
+
timePickerProps: {},
|
108
|
+
timeProps: {},
|
109
|
+
slice: 5
|
110
|
+
})), !state.bookingId && /*#__PURE__*/React.createElement(Button, {
|
111
|
+
onClick: _onClickNow,
|
112
|
+
size: "large",
|
113
|
+
style: state.intervalSetTime ? {
|
114
|
+
background: '#000',
|
115
|
+
color: '#fff'
|
116
|
+
} : undefined
|
117
|
+
}, locales.getText('pisell2.ticket-booking.now')), !!state.bookingId && /*#__PURE__*/React.createElement(Button, {
|
118
|
+
onClick: function onClick() {
|
119
|
+
onCreateClick();
|
120
|
+
},
|
121
|
+
size: "large",
|
122
|
+
type: "primary"
|
123
|
+
}, locales.getText('pisell2.ticket-booking.create-new')));
|
124
|
+
}, [(_state$modalState6 = state.modalState) === null || _state$modalState6 === void 0 || (_state$modalState6 = _state$modalState6.date) === null || _state$modalState6 === void 0 ? void 0 : _state$modalState6.value, state.intervalSetTime, state.isTimeChange, state.isDateChange, locale, state.bookingId]);
|
121
125
|
};
|
122
126
|
export default TimeBar;
|
@@ -257,10 +257,13 @@ export var getIsParallelResourcesBooking = function getIsParallelResourcesBookin
|
|
257
257
|
export var formatScanCustomer = function formatScanCustomer(data) {
|
258
258
|
var result = data.result,
|
259
259
|
scanCode = data.scanCode;
|
260
|
-
var
|
261
|
-
|
262
|
-
|
263
|
-
|
260
|
+
var _ref2 = result || {},
|
261
|
+
response = _ref2.response,
|
262
|
+
searchType = _ref2.searchType;
|
263
|
+
var _ref3 = response || {},
|
264
|
+
customerData = _ref3.data,
|
265
|
+
_ref3$code = _ref3.code,
|
266
|
+
code = _ref3$code === void 0 ? 200 : _ref3$code;
|
264
267
|
if (code !== 200) {
|
265
268
|
return null;
|
266
269
|
}
|
@@ -281,10 +284,12 @@ export var formatScanCustomer = function formatScanCustomer(data) {
|
|
281
284
|
export var formatScanGlobal = function formatScanGlobal(data) {
|
282
285
|
var result = data.result,
|
283
286
|
scanCode = data.scanCode;
|
284
|
-
var
|
285
|
-
|
286
|
-
|
287
|
-
|
287
|
+
var _ref4 = result || {},
|
288
|
+
response = _ref4.response,
|
289
|
+
searchType = _ref4.searchType;
|
290
|
+
var _ref5 = response || {},
|
291
|
+
resultData = _ref5.data,
|
292
|
+
code = _ref5.code;
|
288
293
|
if (code !== 200 && searchType !== 'local_product') {
|
289
294
|
return null;
|
290
295
|
}
|
@@ -83,7 +83,7 @@ var DepositModal = (props) => {
|
|
83
83
|
closable: true,
|
84
84
|
bodyStyle: { padding: "24px", minHeight: "300px" },
|
85
85
|
destroyOnClose: true,
|
86
|
-
title: (item == null ? void 0 : item.title) || (policy == null ? void 0 : policy.title) ||
|
86
|
+
title: (item == null ? void 0 : item.title) || (policy == null ? void 0 : policy.title) || void 0,
|
87
87
|
onCancel,
|
88
88
|
mobileModalHeight: "auto",
|
89
89
|
className: "policy-modal-wrap",
|
@@ -78,6 +78,7 @@ var CustomSelect = (props, ref) => {
|
|
78
78
|
handleOpenModal: propsHandleOpenModal,
|
79
79
|
handleDayChange
|
80
80
|
} = props;
|
81
|
+
console.log("custom select");
|
81
82
|
const searchRef = (0, import_react.useRef)();
|
82
83
|
const [_value, set_value] = (0, import_react.useState)([]);
|
83
84
|
const [search, setSearch] = (0, import_react.useState)("");
|