@pisell/private-materials 3.0.152-gray → 3.0.153
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 +142 -142
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +12 -12
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +11 -11
- package/es/components/booking/addons/model.d.ts +1 -2
- package/es/components/booking/components/footer/index.js +51 -36
- package/es/components/booking/components/footer/utils.js +35 -4
- package/es/components/booking/forms/forms.d.ts +0 -1
- package/es/components/booking/forms/forms.js +2 -4
- package/es/components/booking/forms/model.d.ts +1 -2
- package/es/components/booking/forms/single/index.d.ts +1 -1
- package/es/components/booking/forms/single/index.js +3 -4
- package/es/components/booking/index.js +1 -1
- package/es/components/booking/info/index.d.ts +4 -12
- package/es/components/booking/info/index.js +12 -123
- package/es/components/booking/info/index.less +0 -9
- package/es/components/booking/info/main.d.ts +12 -0
- package/es/components/booking/info/main.js +124 -0
- package/es/components/booking/info/model.js +0 -1
- package/es/components/booking/info/pet/index.js +1 -1
- package/es/components/booking/info/service/addService/index.d.ts +2 -8
- package/es/components/booking/info/service/addService/index.js +36 -82
- package/es/components/booking/info/service/addService/index.less +1 -27
- package/es/components/booking/info/service/addTimeModal/index.js +4 -4
- package/es/components/booking/info/service/editService/index.js +13 -11
- package/es/components/booking/info/utils.d.ts +1 -0
- package/es/components/booking/info/utils.js +7 -0
- package/es/components/booking/info2/index.d.ts +12 -0
- package/es/components/booking/{dashboard → info2}/index.js +196 -222
- package/es/components/booking/info2/serve.d.ts +6 -0
- package/es/components/booking/info2/serve.js +79 -0
- package/es/components/booking/info2/service/actions/index.d.ts +6 -0
- package/es/components/booking/info2/service/actions/index.js +86 -0
- package/es/components/booking/info2/service/addService/index.d.ts +6 -0
- package/es/components/booking/info2/service/addService/index.js +403 -0
- package/es/components/booking/info2/service/addService/mock.d.ts +214 -0
- package/es/components/booking/info2/service/addService/mock.js +332 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +71 -0
- package/es/components/booking/info2/service/addService/utils.js +510 -0
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +4 -0
- package/es/components/booking/info2/service/addTimeModal/index.js +681 -0
- package/es/components/booking/info2/service/addTimeModal/serve.d.ts +9 -0
- package/es/components/booking/{dashboard → info2/service/addTimeModal}/serve.js +51 -5
- package/es/components/booking/info2/service/addTimeModal/utils.d.ts +31 -0
- package/es/components/booking/info2/service/addTimeModal/utils.js +176 -0
- package/es/components/booking/info2/service/editService/Capacity/index.d.ts +4 -0
- package/es/components/booking/info2/service/editService/Capacity/index.js +121 -0
- package/es/components/booking/info2/service/editService/Capacity/index.less +1 -0
- package/es/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.d.ts +7 -0
- package/es/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +28 -0
- package/es/components/booking/info2/service/editService/Resources/index.d.ts +4 -0
- package/es/components/booking/info2/service/editService/Resources/index.js +233 -0
- package/es/components/booking/info2/service/editService/Resources/index.less +21 -0
- package/es/components/booking/info2/service/editService/index.d.ts +7 -0
- package/es/components/booking/info2/service/editService/index.js +617 -0
- package/es/components/booking/info2/service/editService/index.less +99 -0
- package/es/components/booking/info2/service/editService/utils.d.ts +11 -0
- package/es/components/booking/{info/addServiceVariant/index.js → info2/service/editService/utils.js} +30 -26
- package/es/components/booking/info2/service/index.d.ts +4 -0
- package/es/components/booking/info2/service/index.js +55 -0
- package/es/components/booking/info2/service/serviceItem/index.d.ts +4 -0
- package/es/components/booking/info2/service/serviceItem/index.js +176 -0
- package/es/components/booking/info2/service/serviceItem/index.less +125 -0
- package/es/components/booking/info2/service/serviceList/index.d.ts +6 -0
- package/es/components/booking/info2/service/serviceList/index.js +106 -0
- package/es/components/booking/info2/service/serviceList/index.less +0 -0
- package/es/components/booking/info2/utilsByBooking.d.ts +34 -0
- package/es/components/booking/info2/utilsByBooking.js +349 -0
- package/es/components/booking/locales.d.ts +3 -48
- package/es/components/booking/locales.js +9 -48
- package/es/components/booking/materiels/resources/index.d.ts +2 -2
- package/es/components/booking/materiels/resources/index.js +11 -11
- package/es/components/booking/mock.d.ts +1 -0
- package/es/components/booking/mock.js +66 -0
- package/es/components/booking/model.d.ts +0 -2
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +1 -2
- package/es/components/booking/payments/model.d.ts +1 -2
- package/es/components/booking/utils.d.ts +1 -1
- package/es/components/booking/utils.js +51 -54
- package/es/components/index.d.ts +1 -1
- package/es/components/index.js +1 -1
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +1 -2
- package/es/index.d.ts +1 -3
- package/es/index.js +2 -4
- package/lib/components/booking/addons/model.d.ts +1 -2
- package/lib/components/booking/components/footer/index.js +31 -8
- package/lib/components/booking/components/footer/utils.js +29 -4
- package/lib/components/booking/forms/forms.d.ts +0 -1
- package/lib/components/booking/forms/forms.js +2 -5
- package/lib/components/booking/forms/model.d.ts +1 -2
- package/lib/components/booking/forms/single/index.d.ts +1 -1
- package/lib/components/booking/forms/single/index.js +2 -4
- package/lib/components/booking/index.js +2 -2
- package/lib/components/booking/info/client/index.js +8 -1
- package/lib/components/booking/info/index.d.ts +4 -12
- package/lib/components/booking/info/index.js +14 -118
- package/lib/components/booking/info/index.less +0 -9
- package/lib/components/booking/info/main.d.ts +12 -0
- package/lib/components/booking/info/main.js +152 -0
- package/lib/components/booking/info/pet/index.js +1 -2
- package/lib/components/booking/info/service/addService/index.d.ts +2 -8
- package/lib/components/booking/info/service/addService/index.js +29 -66
- package/lib/components/booking/info/service/addService/index.less +1 -27
- package/lib/components/booking/info/service/addTimeModal/index.js +1 -0
- package/lib/components/booking/info/service/editService/index.js +6 -9
- package/lib/components/booking/info/utils.d.ts +1 -0
- package/lib/components/booking/info/utils.js +9 -0
- package/lib/components/booking/info2/index.d.ts +12 -0
- package/lib/components/booking/info2/index.js +202 -0
- package/lib/components/booking/info2/serve.d.ts +6 -0
- package/lib/components/booking/{dashboard → info2}/serve.js +25 -5
- package/lib/components/booking/info2/service/actions/index.d.ts +6 -0
- package/lib/components/booking/info2/service/actions/index.js +102 -0
- package/lib/components/booking/info2/service/addService/index.d.ts +6 -0
- package/lib/components/booking/info2/service/addService/index.js +355 -0
- package/lib/components/booking/info2/service/addService/mock.d.ts +214 -0
- package/lib/components/booking/info2/service/addService/mock.js +398 -0
- package/lib/components/booking/info2/service/addService/utils.d.ts +71 -0
- package/lib/components/booking/info2/service/addService/utils.js +377 -0
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +4 -0
- package/lib/components/booking/info2/service/addTimeModal/index.js +558 -0
- package/lib/components/booking/info2/service/addTimeModal/serve.d.ts +9 -0
- package/lib/components/booking/info2/service/addTimeModal/serve.js +45 -0
- package/lib/components/booking/info2/service/addTimeModal/utils.d.ts +31 -0
- package/lib/components/booking/info2/service/addTimeModal/utils.js +157 -0
- package/lib/components/booking/info2/service/editService/Capacity/index.d.ts +4 -0
- package/lib/components/booking/info2/service/editService/Capacity/index.js +97 -0
- package/lib/components/booking/info2/service/editService/Capacity/index.less +1 -0
- package/lib/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.d.ts +7 -0
- package/lib/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +54 -0
- package/lib/components/booking/info2/service/editService/Resources/index.d.ts +4 -0
- package/lib/components/booking/info2/service/editService/Resources/index.js +212 -0
- package/lib/components/booking/info2/service/editService/Resources/index.less +21 -0
- package/lib/components/booking/info2/service/editService/index.d.ts +7 -0
- package/lib/components/booking/info2/service/editService/index.js +483 -0
- package/lib/components/booking/info2/service/editService/index.less +99 -0
- package/lib/components/booking/info2/service/editService/utils.d.ts +11 -0
- package/lib/components/booking/info2/service/editService/utils.js +0 -0
- package/lib/components/booking/info2/service/index.d.ts +4 -0
- package/lib/components/booking/info2/service/index.js +75 -0
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +4 -0
- package/lib/components/booking/info2/service/serviceItem/index.js +184 -0
- package/lib/components/booking/info2/service/serviceItem/index.less +125 -0
- package/lib/components/booking/info2/service/serviceList/index.d.ts +6 -0
- package/lib/components/booking/info2/service/serviceList/index.js +130 -0
- package/lib/components/booking/info2/service/serviceList/index.less +0 -0
- package/lib/components/booking/info2/utilsByBooking.d.ts +34 -0
- package/lib/components/booking/info2/utilsByBooking.js +257 -0
- package/lib/components/booking/locales.d.ts +3 -48
- package/lib/components/booking/locales.js +3 -48
- package/lib/components/booking/materiels/resources/index.d.ts +2 -2
- package/lib/components/booking/mock.d.ts +1 -0
- package/lib/components/booking/mock.js +67 -2
- package/lib/components/booking/model.d.ts +0 -2
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +1 -2
- package/lib/components/booking/payments/model.d.ts +1 -2
- package/lib/components/booking/utils.d.ts +1 -1
- package/lib/components/booking/utils.js +22 -57
- package/lib/components/eftposPay/tyro/index.js +3 -1
- package/lib/components/index.d.ts +1 -1
- package/lib/components/index.js +1 -1
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +1 -2
- package/lib/index.d.ts +1 -3
- package/lib/index.js +1 -7
- package/package.json +3 -3
- package/es/components/booking/dashboard/index.d.ts +0 -10
- package/es/components/booking/dashboard/serve.d.ts +0 -1
- package/es/components/booking/info/addServiceVariant/index.d.ts +0 -7
- package/lib/components/booking/dashboard/index.d.ts +0 -10
- package/lib/components/booking/dashboard/index.js +0 -225
- package/lib/components/booking/dashboard/serve.d.ts +0 -1
- package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -7
- package/lib/components/booking/info/addServiceVariant/index.js +0 -58
- package/lowcode/booking-dashboard/meta.ts +0 -130
- package/lowcode/booking-vertical-add-service/meta.ts +0 -124
- package/lowcode/vertical-add-service/meta.ts +0 -71
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -31,7 +31,8 @@ import "./index.less";
|
|
|
31
31
|
import useEngineContext from "../../../../hooks/useEngineContext";
|
|
32
32
|
import { DownOutlined } from '@ant-design/icons';
|
|
33
33
|
import { eventBookingCheck } from "./serve";
|
|
34
|
-
|
|
34
|
+
import { createBookings, editBookings } from "../../info2/serve";
|
|
35
|
+
import { isBooking4Shop } from "../../info/utils";
|
|
35
36
|
/**
|
|
36
37
|
* @title: 底部
|
|
37
38
|
* @description:
|
|
@@ -238,7 +239,7 @@ var Footer = function Footer(props) {
|
|
|
238
239
|
key: 'booking_checkout',
|
|
239
240
|
data: {
|
|
240
241
|
order_id: order_id,
|
|
241
|
-
callbackType:
|
|
242
|
+
callbackType: 'pisell2'
|
|
242
243
|
}
|
|
243
244
|
}));
|
|
244
245
|
case 2:
|
|
@@ -339,6 +340,19 @@ var Footer = function Footer(props) {
|
|
|
339
340
|
return _ref3.apply(this, arguments);
|
|
340
341
|
};
|
|
341
342
|
}();
|
|
343
|
+
var getApis = function getApis() {
|
|
344
|
+
var _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4, _context$appHelper$ut5, _context$appHelper$ut6;
|
|
345
|
+
if (isBooking4Shop((_context$appHelper$ut2 = context.appHelper.utils.store) === null || _context$appHelper$ut2 === void 0 ? void 0 : (_context$appHelper$ut3 = _context$appHelper$ut2.getState) === null || _context$appHelper$ut3 === void 0 ? void 0 : (_context$appHelper$ut4 = _context$appHelper$ut3.call(_context$appHelper$ut2)) === null || _context$appHelper$ut4 === void 0 ? void 0 : (_context$appHelper$ut5 = _context$appHelper$ut4.global) === null || _context$appHelper$ut5 === void 0 ? void 0 : (_context$appHelper$ut6 = _context$appHelper$ut5.globalConfig) === null || _context$appHelper$ut6 === void 0 ? void 0 : _context$appHelper$ut6.id, state.renderType)) {
|
|
346
|
+
return {
|
|
347
|
+
editBooking: editBookings,
|
|
348
|
+
createBooking: createBookings
|
|
349
|
+
};
|
|
350
|
+
}
|
|
351
|
+
return {
|
|
352
|
+
editBooking: state.apis.editBooking,
|
|
353
|
+
createBooking: state.apis.createBooking
|
|
354
|
+
};
|
|
355
|
+
};
|
|
342
356
|
|
|
343
357
|
/**
|
|
344
358
|
* @title: 保存info
|
|
@@ -350,7 +364,7 @@ var Footer = function Footer(props) {
|
|
|
350
364
|
*/
|
|
351
365
|
var handleSave = /*#__PURE__*/function () {
|
|
352
366
|
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref4) {
|
|
353
|
-
var type, _ref4$messageShow, messageShow, _setLoading, editApi, createApi, saveOtherValue, _state$onSave, callbackData, values, api, _yield$eventBookingCh, data, confirmed;
|
|
367
|
+
var type, _ref4$messageShow, messageShow, _setLoading, _getApis, createBooking, editBooking, editApi, createApi, saveOtherValue, _state$onSave, callbackData, values, api, _yield$eventBookingCh, data, confirmed;
|
|
354
368
|
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
355
369
|
while (1) switch (_context4.prev = _context4.next) {
|
|
356
370
|
case 0:
|
|
@@ -358,43 +372,44 @@ var Footer = function Footer(props) {
|
|
|
358
372
|
// 区分loading, 是点击的checkout 还是save
|
|
359
373
|
_setLoading = type === 'checkout' ? setCheckoutLoading : setLoading;
|
|
360
374
|
_setLoading(true);
|
|
361
|
-
|
|
362
|
-
|
|
375
|
+
_getApis = getApis(), createBooking = _getApis.createBooking, editBooking = _getApis.editBooking;
|
|
376
|
+
editApi = state.renderType === 'eventBooking' ? state.apis.editEventBooking : editBooking;
|
|
377
|
+
createApi = state.renderType === 'eventBooking' ? state.apis.createEventBooking : createBooking;
|
|
363
378
|
saveOtherValue = {};
|
|
364
379
|
if (!(type === 'save')) {
|
|
365
|
-
_context4.next =
|
|
380
|
+
_context4.next = 14;
|
|
366
381
|
break;
|
|
367
382
|
}
|
|
368
|
-
_context4.next =
|
|
383
|
+
_context4.next = 10;
|
|
369
384
|
return state === null || state === void 0 ? void 0 : (_state$onSave = state.onSave) === null || _state$onSave === void 0 ? void 0 : _state$onSave.call(state, state.client);
|
|
370
|
-
case
|
|
385
|
+
case 10:
|
|
371
386
|
_context4.t0 = _context4.sent;
|
|
372
387
|
if (_context4.t0) {
|
|
373
|
-
_context4.next =
|
|
388
|
+
_context4.next = 13;
|
|
374
389
|
break;
|
|
375
390
|
}
|
|
376
391
|
_context4.t0 = {};
|
|
377
|
-
case 12:
|
|
378
|
-
saveOtherValue = _context4.t0;
|
|
379
392
|
case 13:
|
|
380
|
-
|
|
393
|
+
saveOtherValue = _context4.t0;
|
|
394
|
+
case 14:
|
|
395
|
+
_context4.prev = 14;
|
|
381
396
|
callbackData = null; // 格式化提交的参数
|
|
382
397
|
values = formatValues(_objectSpread(_objectSpread({}, state), saveOtherValue)); // 区分是新增还是编辑
|
|
383
398
|
api = state.bookingId ? editApi : createApi; // 活动预约新建时校验重复
|
|
384
399
|
if (!(!state.bookingId && state.renderType === 'eventBooking')) {
|
|
385
|
-
_context4.next =
|
|
400
|
+
_context4.next = 30;
|
|
386
401
|
break;
|
|
387
402
|
}
|
|
388
|
-
_context4.next =
|
|
403
|
+
_context4.next = 21;
|
|
389
404
|
return eventBookingCheck(values);
|
|
390
|
-
case
|
|
405
|
+
case 21:
|
|
391
406
|
_yield$eventBookingCh = _context4.sent;
|
|
392
407
|
data = _yield$eventBookingCh.data;
|
|
393
408
|
if (!data.list.length) {
|
|
394
|
-
_context4.next =
|
|
409
|
+
_context4.next = 30;
|
|
395
410
|
break;
|
|
396
411
|
}
|
|
397
|
-
_context4.next =
|
|
412
|
+
_context4.next = 26;
|
|
398
413
|
return modal.confirm({
|
|
399
414
|
icon: null,
|
|
400
415
|
title: locales.getText('page.event.booking.text.duplicate-enrollment'),
|
|
@@ -406,53 +421,53 @@ var Footer = function Footer(props) {
|
|
|
406
421
|
width: 480,
|
|
407
422
|
okText: locales.getText('page.event.booking.text.duplicate-enrollment-confirm')
|
|
408
423
|
});
|
|
409
|
-
case
|
|
424
|
+
case 26:
|
|
410
425
|
confirmed = _context4.sent;
|
|
411
426
|
if (confirmed) {
|
|
412
|
-
_context4.next =
|
|
427
|
+
_context4.next = 30;
|
|
413
428
|
break;
|
|
414
429
|
}
|
|
415
430
|
_setLoading(false);
|
|
416
431
|
return _context4.abrupt("return");
|
|
417
|
-
case
|
|
432
|
+
case 30:
|
|
418
433
|
if (!addonsEdit) {
|
|
419
|
-
_context4.next =
|
|
434
|
+
_context4.next = 33;
|
|
420
435
|
break;
|
|
421
436
|
}
|
|
422
|
-
_context4.next =
|
|
437
|
+
_context4.next = 33;
|
|
423
438
|
return handleSaveAddons();
|
|
424
|
-
case
|
|
439
|
+
case 33:
|
|
425
440
|
if (!infoEdit) {
|
|
426
|
-
_context4.next =
|
|
441
|
+
_context4.next = 38;
|
|
427
442
|
break;
|
|
428
443
|
}
|
|
429
|
-
_context4.next =
|
|
430
|
-
return api(values);
|
|
431
|
-
case
|
|
444
|
+
_context4.next = 36;
|
|
445
|
+
return api(values, state.bookingId);
|
|
446
|
+
case 36:
|
|
432
447
|
callbackData = _context4.sent;
|
|
433
448
|
if (messageShow) {
|
|
434
449
|
message.success(locales.getText(state.bookingId ? 'pisell2.text.appointment-updated' : 'pisell2.text.created-successfully'));
|
|
435
450
|
}
|
|
436
|
-
case
|
|
451
|
+
case 38:
|
|
437
452
|
// 回调关闭弹窗
|
|
438
453
|
state === null || state === void 0 ? void 0 : state.callback(callbackData);
|
|
439
454
|
_setLoading(false);
|
|
440
455
|
|
|
441
456
|
// return数据 checkout时需要
|
|
442
457
|
return _context4.abrupt("return", callbackData || values);
|
|
443
|
-
case
|
|
444
|
-
_context4.prev =
|
|
445
|
-
_context4.t1 = _context4["catch"](
|
|
458
|
+
case 43:
|
|
459
|
+
_context4.prev = 43;
|
|
460
|
+
_context4.t1 = _context4["catch"](14);
|
|
446
461
|
console.log(_context4.t1);
|
|
447
462
|
if ((_context4.t1 === null || _context4.t1 === void 0 ? void 0 : _context4.t1.code) === 70101) {
|
|
448
463
|
message.error(_context4.t1 === null || _context4.t1 === void 0 ? void 0 : _context4.t1.message);
|
|
449
464
|
}
|
|
450
465
|
_setLoading(false);
|
|
451
|
-
case
|
|
466
|
+
case 48:
|
|
452
467
|
case "end":
|
|
453
468
|
return _context4.stop();
|
|
454
469
|
}
|
|
455
|
-
}, _callee4, null, [[
|
|
470
|
+
}, _callee4, null, [[14, 43]]);
|
|
456
471
|
}));
|
|
457
472
|
return function handleSave(_x3) {
|
|
458
473
|
return _ref5.apply(this, arguments);
|
|
@@ -891,7 +906,7 @@ var Footer = function Footer(props) {
|
|
|
891
906
|
}
|
|
892
907
|
if (transaction_habit_selection.button_rows == 1) {
|
|
893
908
|
if (state.appointment_status !== 'cancelled') {
|
|
894
|
-
if (!state.disabledEdit
|
|
909
|
+
if (!state.disabledEdit) {
|
|
895
910
|
arr.push(actionMap.sale);
|
|
896
911
|
}
|
|
897
912
|
}
|
|
@@ -1032,7 +1047,7 @@ var Footer = function Footer(props) {
|
|
|
1032
1047
|
if (!state.bookingDetail) {
|
|
1033
1048
|
return true;
|
|
1034
1049
|
}
|
|
1035
|
-
if (!((_state$addons3 = state.addons) !== null && _state$addons3 !== void 0 && _state$addons3.load) && state.renderType !== 'eventBooking'
|
|
1050
|
+
if (!((_state$addons3 = state.addons) !== null && _state$addons3 !== void 0 && _state$addons3.load) && state.renderType !== 'eventBooking') {
|
|
1036
1051
|
return true;
|
|
1037
1052
|
}
|
|
1038
1053
|
}
|
|
@@ -1182,7 +1197,7 @@ var Footer = function Footer(props) {
|
|
|
1182
1197
|
style: {
|
|
1183
1198
|
marginTop: 12
|
|
1184
1199
|
}
|
|
1185
|
-
}, state.appointment_status !== 'cancelled'
|
|
1200
|
+
}, state.appointment_status !== 'cancelled' ? /*#__PURE__*/React.createElement(Button, {
|
|
1186
1201
|
onClick: function onClick() {
|
|
1187
1202
|
return handleSale();
|
|
1188
1203
|
},
|
|
@@ -6,6 +6,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
6
6
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
7
|
import { flexibleObj, isNowTime, getNowTime } from "../../utils";
|
|
8
8
|
import { isWalkIn } from "../../utils";
|
|
9
|
+
import { getSumCapacity } from "../../info2/utilsByBooking";
|
|
9
10
|
var formatNote = function formatNote(data) {
|
|
10
11
|
var _data$notes;
|
|
11
12
|
return ((_data$notes = data.notes) === null || _data$notes === void 0 ? void 0 : _data$notes.orderNote) || "";
|
|
@@ -91,6 +92,30 @@ var formatRelationDetails = function formatRelationDetails(list) {
|
|
|
91
92
|
};
|
|
92
93
|
});
|
|
93
94
|
};
|
|
95
|
+
var formatResource = function formatResource(service) {
|
|
96
|
+
if (!service._extend.resource) {
|
|
97
|
+
return undefined;
|
|
98
|
+
}
|
|
99
|
+
try {
|
|
100
|
+
return Object.values(service._extend.resource).reduce(function (pre, cur) {
|
|
101
|
+
pre = pre.concat(cur.map(function (d) {
|
|
102
|
+
return {
|
|
103
|
+
form_id: d.form_id,
|
|
104
|
+
relation_type: d.relation_type || 'form',
|
|
105
|
+
relation_id: d.relation_id || 0,
|
|
106
|
+
capacity: getSumCapacity({
|
|
107
|
+
cacheItem: service
|
|
108
|
+
}),
|
|
109
|
+
like_status: d.like_status,
|
|
110
|
+
metadata: d.metadata
|
|
111
|
+
};
|
|
112
|
+
}));
|
|
113
|
+
return pre;
|
|
114
|
+
}, []);
|
|
115
|
+
} catch (err) {
|
|
116
|
+
return undefined;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
94
119
|
|
|
95
120
|
/**
|
|
96
121
|
* @title: 预约商品信息
|
|
@@ -135,11 +160,11 @@ var formatBookings = function formatBookings(data) {
|
|
|
135
160
|
},
|
|
136
161
|
"relation_products": formatRelationDetails(item._extend.relation_details),
|
|
137
162
|
'id': item.booking_id || 0,
|
|
138
|
-
"relation_id": item._extend.relation_id,
|
|
163
|
+
"relation_id": item._extend.relation_id || 0,
|
|
139
164
|
"like_status": item._extend.like_status || 'common',
|
|
140
|
-
"relation_type": item._extend.relation_type,
|
|
165
|
+
"relation_type": item._extend.relation_type || '',
|
|
141
166
|
"is_all": false,
|
|
142
|
-
"schedule_id": item._extend.schedule_id,
|
|
167
|
+
"schedule_id": item._extend.schedule_id || 0,
|
|
143
168
|
"end_time": end_time,
|
|
144
169
|
"sub_type": getSubType(item),
|
|
145
170
|
"select_date": start_date,
|
|
@@ -147,7 +172,13 @@ var formatBookings = function formatBookings(data) {
|
|
|
147
172
|
"end_date": end_date,
|
|
148
173
|
"start_date": start_date,
|
|
149
174
|
"duration": flexibleObj.getValue(item._extend.duration),
|
|
150
|
-
"number": item._extend.
|
|
175
|
+
"number": item._extend.capacity ? getSumCapacity({
|
|
176
|
+
cacheItem: item
|
|
177
|
+
}) : 1,
|
|
178
|
+
"resources": formatResource(item),
|
|
179
|
+
"metadata": item._extend.capacity ? {
|
|
180
|
+
capacity: item._extend.capacity
|
|
181
|
+
} : undefined
|
|
151
182
|
}, eventOtherParams || {});
|
|
152
183
|
});
|
|
153
184
|
return bookings;
|
|
@@ -43,8 +43,7 @@ var Forms = Provider(function (props) {
|
|
|
43
43
|
addCallback = props.addCallback,
|
|
44
44
|
client = props.client,
|
|
45
45
|
loading = props.loading,
|
|
46
|
-
addButtonProps = props.addButtonProps
|
|
47
|
-
drawerProps = props.drawerProps;
|
|
46
|
+
addButtonProps = props.addButtonProps;
|
|
48
47
|
|
|
49
48
|
// 新增数据
|
|
50
49
|
var onAction = useMemoizedFn( /*#__PURE__*/function () {
|
|
@@ -172,7 +171,6 @@ var Forms = Provider(function (props) {
|
|
|
172
171
|
onChange: function onChange(val) {
|
|
173
172
|
onValueChange(d, val);
|
|
174
173
|
},
|
|
175
|
-
drawerProps: drawerProps,
|
|
176
174
|
onAdd: function onAdd() {
|
|
177
175
|
onAction(d, true);
|
|
178
176
|
},
|
|
@@ -196,6 +194,6 @@ var Forms = Provider(function (props) {
|
|
|
196
194
|
optionRender: optionRender
|
|
197
195
|
})));
|
|
198
196
|
}));
|
|
199
|
-
}, [forms, hideTitle, modalOpen, value, loading, client === null || client === void 0 ? void 0 : client.id, addButtonProps, customSelectProps, optionRender
|
|
197
|
+
}, [forms, hideTitle, modalOpen, value, loading, client === null || client === void 0 ? void 0 : client.id, addButtonProps, customSelectProps, optionRender]);
|
|
200
198
|
});
|
|
201
199
|
export default Forms;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => (props: any) =>
|
|
2
|
+
export declare const Provider: (ComponentUi: any) => (props: any) => JSX.Element, Context: import("react").Context<{
|
|
4
3
|
state: FormState;
|
|
5
4
|
} & {
|
|
6
5
|
dispatch: (params: {
|
|
@@ -7,5 +7,5 @@ import "./index.less";
|
|
|
7
7
|
* @Author: zhiwei.Wang
|
|
8
8
|
* @Date: 2024-01-30 17:06
|
|
9
9
|
*/
|
|
10
|
-
declare const Single: ({ value, onChange, form, mode, optionRender, loading, customSelectProps, onAdd, addButtonProps, modalOpen, watch,
|
|
10
|
+
declare const Single: ({ value, onChange, form, mode, optionRender, loading, customSelectProps, onAdd, addButtonProps, modalOpen, watch, }: any) => React.JSX.Element;
|
|
11
11
|
export default Single;
|
|
@@ -41,8 +41,7 @@ var Single = function Single(_ref) {
|
|
|
41
41
|
onAdd = _ref.onAdd,
|
|
42
42
|
addButtonProps = _ref.addButtonProps,
|
|
43
43
|
modalOpen = _ref.modalOpen,
|
|
44
|
-
watch = _ref.watch
|
|
45
|
-
drawerProps = _ref.drawerProps;
|
|
44
|
+
watch = _ref.watch;
|
|
46
45
|
// const primaryField = useMemo(() => {
|
|
47
46
|
// return field.field[0]?.key || "";
|
|
48
47
|
// }, [field]);
|
|
@@ -235,10 +234,10 @@ var Single = function Single(_ref) {
|
|
|
235
234
|
},
|
|
236
235
|
name: ((_form$form3 = form.form) === null || _form$form3 === void 0 ? void 0 : _form$form3.title) || "-",
|
|
237
236
|
addButtonProps: _addButtonProps,
|
|
238
|
-
drawerProps:
|
|
237
|
+
drawerProps: {
|
|
239
238
|
title: "".concat(locales.getText("pisell2.text.select"), " ").concat(((_form$form4 = form.form) === null || _form$form4 === void 0 ? void 0 : _form$form4.title) || "-"),
|
|
240
239
|
destroyOnClose: true
|
|
241
|
-
},
|
|
240
|
+
},
|
|
242
241
|
optionRender: _optionRender,
|
|
243
242
|
rowKey: "form_record_id"
|
|
244
243
|
}, customSelectProps || {})));
|
|
@@ -6,7 +6,7 @@ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _ty
|
|
|
6
6
|
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
7
|
import React, { useEffect, useContext } from 'react';
|
|
8
8
|
import { Provider, Context } from "./model";
|
|
9
|
-
import Info from "./info";
|
|
9
|
+
import Info from "./info/main";
|
|
10
10
|
import Notes from "./notes";
|
|
11
11
|
import Addons from "./addons";
|
|
12
12
|
import Forms from "./forms";
|
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
callback: any;
|
|
6
|
-
setGlobalState: any;
|
|
7
|
-
modules: any;
|
|
8
|
-
slot: any;
|
|
9
|
-
setState: any;
|
|
10
|
-
}
|
|
11
|
-
declare const Info: any;
|
|
12
|
-
export default Info;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InfoProps } from './main';
|
|
3
|
+
declare const APP: (props: InfoProps) => React.JSX.Element;
|
|
4
|
+
export default APP;
|
|
@@ -1,125 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
-
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
|
|
6
|
-
function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
|
|
7
|
-
import React, { useContext, useEffect, useMemo } from "react";
|
|
8
|
-
import { Provider, Context } from "./model";
|
|
9
|
-
import Client from "./client";
|
|
10
|
-
import Service from "./service";
|
|
11
|
-
import Pet from "./pet";
|
|
12
|
-
import DateCom from "./date";
|
|
13
|
-
import Footer from "../components/footer";
|
|
14
|
-
import TabPane from "../components/tabPane";
|
|
15
|
-
import AddNote from "../notes/addNote";
|
|
16
|
-
import Header from "./header";
|
|
17
|
-
import localeTexts from "../locales";
|
|
18
|
-
import { locales } from "@pisell/utils";
|
|
19
|
-
import { findNextDuration, flexibleObj, formatResource, getErrorList, sliceDayIntoFiveMinutes, request } from "../utils";
|
|
20
|
-
import { updateServiceDate } from "./date";
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import Info2 from "../info2";
|
|
3
|
+
import Info1 from "./main";
|
|
21
4
|
import useEngineContext from "../../../hooks/useEngineContext";
|
|
22
|
-
import
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var defaultModules = {
|
|
26
|
-
client: 1,
|
|
27
|
-
date: 1,
|
|
28
|
-
service: 1,
|
|
29
|
-
holder: 1,
|
|
30
|
-
note: 1
|
|
31
|
-
};
|
|
32
|
-
locales.init(localeTexts, localStorage.getItem("umi_locale") || "en");
|
|
33
|
-
var Info = Provider(function (props) {
|
|
34
|
-
var _modal$state2, _modal$state2$booking, _modal$state2$booking2, _modal$state2$booking3, _modal$state4, _modal$state4$notes, _context$appHelper4, _context$appHelper4$u, _modal$state5, _React$createElement;
|
|
35
|
-
// return <Payments {...props} />;
|
|
36
|
-
var style = props.style,
|
|
37
|
-
globalState = props.globalState,
|
|
38
|
-
_props$modules = props.modules,
|
|
39
|
-
modules = _props$modules === void 0 ? defaultModules : _props$modules,
|
|
40
|
-
slot = props.slot;
|
|
41
|
-
var modal = useContext(Context);
|
|
5
|
+
import { isBooking4Shop } from "./utils";
|
|
6
|
+
var APP = function APP(props) {
|
|
7
|
+
var _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4, _context$appHelper$ut5, _props$globalState;
|
|
42
8
|
var context = useEngineContext();
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
document.body.id = "body";
|
|
50
|
-
// 注入函数到页面的state内
|
|
51
|
-
if (props.setState) {
|
|
52
|
-
props.setState({
|
|
53
|
-
bookingFunctions: {
|
|
54
|
-
formatResource: formatResource,
|
|
55
|
-
getErrorList: getErrorList,
|
|
56
|
-
sliceDayIntoFiveMinutes: sliceDayIntoFiveMinutes,
|
|
57
|
-
findNextDuration: findNextDuration,
|
|
58
|
-
flexibleObj: flexibleObj,
|
|
59
|
-
updateServiceDate: updateServiceDate
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
}, []);
|
|
64
|
-
useEffect(function () {
|
|
65
|
-
var _context$appHelper, _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper2, _context$appHelper2$u, _context$appHelper2$u2, _context$appHelper3, _context$appHelper3$u, _context$appHelper3$u2, _context$appHelper3$u3, _context$appHelper3$u4, _context$appHelper3$u5;
|
|
66
|
-
var isFranchisee = context === null || context === void 0 ? void 0 : (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : (_context$appHelper$ut = _context$appHelper.utils) === null || _context$appHelper$ut === void 0 ? void 0 : (_context$appHelper$ut2 = _context$appHelper$ut.businessUtils) === null || _context$appHelper$ut2 === void 0 ? void 0 : (_context$appHelper$ut3 = _context$appHelper$ut2.getAppByModal) === null || _context$appHelper$ut3 === void 0 ? void 0 : _context$appHelper$ut3.call(_context$appHelper$ut2, "franchisee");
|
|
67
|
-
modal.dispatch({
|
|
68
|
-
type: "setState",
|
|
69
|
-
payload: _objectSpread(_objectSpread({
|
|
70
|
-
setGlobalState: props.setGlobalState
|
|
71
|
-
}, globalState), {}, {
|
|
72
|
-
isTerminal: context === null || context === void 0 ? void 0 : (_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 ? void 0 : (_context$appHelper2$u = _context$appHelper2.utils) === null || _context$appHelper2$u === void 0 ? void 0 : (_context$appHelper2$u2 = _context$appHelper2$u.isTerminal) === null || _context$appHelper2$u2 === void 0 ? void 0 : _context$appHelper2$u2.call(_context$appHelper2$u),
|
|
73
|
-
isFranchisee: isFranchisee,
|
|
74
|
-
timezone: context === null || context === void 0 ? void 0 : (_context$appHelper3 = context.appHelper) === null || _context$appHelper3 === void 0 ? void 0 : (_context$appHelper3$u = _context$appHelper3.utils) === null || _context$appHelper3$u === void 0 ? void 0 : (_context$appHelper3$u2 = _context$appHelper3$u.store) === null || _context$appHelper3$u2 === void 0 ? void 0 : (_context$appHelper3$u3 = _context$appHelper3$u2.getState()) === null || _context$appHelper3$u3 === void 0 ? void 0 : (_context$appHelper3$u4 = _context$appHelper3$u3.global) === null || _context$appHelper3$u4 === void 0 ? void 0 : (_context$appHelper3$u5 = _context$appHelper3$u4.globalConfig) === null || _context$appHelper3$u5 === void 0 ? void 0 : _context$appHelper3$u5.timezone
|
|
75
|
-
})
|
|
76
|
-
});
|
|
77
|
-
}, [JSON.stringify(globalState)]);
|
|
78
|
-
var addNote = function addNote(e) {
|
|
79
|
-
modal.dispatch({
|
|
80
|
-
type: "setNotes",
|
|
81
|
-
payload: {
|
|
82
|
-
orderNote: e,
|
|
83
|
-
edit: true
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
};
|
|
87
|
-
var header = useMemo(function () {
|
|
88
|
-
if ((globalState === null || globalState === void 0 ? void 0 : globalState.renderType) === "eventBooking") {
|
|
89
|
-
return locales.getText("pisell2.text.enroll.detail");
|
|
90
|
-
}
|
|
91
|
-
return globalState !== null && globalState !== void 0 && globalState.bookingId ? /*#__PURE__*/React.createElement(Header, {
|
|
92
|
-
state: modal.state,
|
|
93
|
-
dispatch: modal.dispatch
|
|
94
|
-
}) : /*#__PURE__*/React.createElement("div", {
|
|
95
|
-
className: "",
|
|
96
|
-
style: {
|
|
97
|
-
height: 0
|
|
98
|
-
}
|
|
99
|
-
});
|
|
100
|
-
}, [globalState === null || globalState === void 0 ? void 0 : globalState.bookingId, modal.state, modal.dispatch, globalState === null || globalState === void 0 ? void 0 : globalState.renderType]);
|
|
101
|
-
var notes = useMemo(function () {
|
|
102
|
-
var _modal$state3, _modal$state3$notes;
|
|
103
|
-
if (!modules.note) {
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
106
|
-
return globalState !== null && globalState !== void 0 && globalState.bookingId ? globalState.renderType === "eventBooking" ? /*#__PURE__*/React.createElement(Notes, null) : null : /*#__PURE__*/React.createElement(AddNote, {
|
|
107
|
-
value: (_modal$state3 = modal.state) === null || _modal$state3 === void 0 ? void 0 : (_modal$state3$notes = _modal$state3.notes) === null || _modal$state3$notes === void 0 ? void 0 : _modal$state3$notes.orderNote,
|
|
108
|
-
onChange: addNote
|
|
109
|
-
});
|
|
110
|
-
}, [modules.note, globalState === null || globalState === void 0 ? void 0 : globalState.bookingId, globalState.render, (_modal$state4 = modal.state) === null || _modal$state4 === void 0 ? void 0 : (_modal$state4$notes = _modal$state4.notes) === null || _modal$state4$notes === void 0 ? void 0 : _modal$state4$notes.orderNote]);
|
|
111
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, !!modal.state.setGlobalState ? /*#__PURE__*/React.createElement(TabPane, (_React$createElement = {
|
|
112
|
-
style: style,
|
|
113
|
-
header: header,
|
|
114
|
-
footer: /*#__PURE__*/React.createElement(Footer, {
|
|
115
|
-
state: modal.state,
|
|
116
|
-
dispatch: modal.dispatch,
|
|
117
|
-
source: "info"
|
|
118
|
-
})
|
|
119
|
-
}, _defineProperty(_React$createElement, "style", {
|
|
120
|
-
height: context !== null && context !== void 0 && (_context$appHelper4 = context.appHelper) !== null && _context$appHelper4 !== void 0 && (_context$appHelper4$u = _context$appHelper4.utils) !== null && _context$appHelper4$u !== void 0 && _context$appHelper4$u.isMobile ? "100%" : "100vh"
|
|
121
|
-
}), _defineProperty(_React$createElement, "bodyClassName", classNames('booking-info-warp', _defineProperty({}, 'create-booking-page-info-wrap', modal.state.isBookingCreatePage))), _React$createElement), /*#__PURE__*/React.createElement("div", {
|
|
122
|
-
className: "booking-info"
|
|
123
|
-
}, modules.client ? /*#__PURE__*/React.createElement(Client, null) : null, modules.holder && !((_modal$state5 = modal.state) !== null && _modal$state5 !== void 0 && _modal$state5.disabledEdit) ? /*#__PURE__*/React.createElement(React.Fragment, null, params.type === "form" ? /*#__PURE__*/React.createElement(Pet, null) : null) : null, modules.date ? /*#__PURE__*/React.createElement(DateCom, null) : null, modules.service ? /*#__PURE__*/React.createElement(React.Fragment, null, modal.state.date.value ? /*#__PURE__*/React.createElement(Service, null) : null) : null, notes, slot ? slot : null)) : null);
|
|
124
|
-
});
|
|
125
|
-
export default Info;
|
|
9
|
+
if (isBooking4Shop((_context$appHelper$ut = context.appHelper.utils.store) === null || _context$appHelper$ut === void 0 ? void 0 : (_context$appHelper$ut2 = _context$appHelper$ut.getState) === null || _context$appHelper$ut2 === void 0 ? void 0 : (_context$appHelper$ut3 = _context$appHelper$ut2.call(_context$appHelper$ut)) === null || _context$appHelper$ut3 === void 0 ? void 0 : (_context$appHelper$ut4 = _context$appHelper$ut3.global) === null || _context$appHelper$ut4 === void 0 ? void 0 : (_context$appHelper$ut5 = _context$appHelper$ut4.globalConfig) === null || _context$appHelper$ut5 === void 0 ? void 0 : _context$appHelper$ut5.id, props === null || props === void 0 ? void 0 : (_props$globalState = props.globalState) === null || _props$globalState === void 0 ? void 0 : _props$globalState.renderType)) {
|
|
10
|
+
return /*#__PURE__*/React.createElement(Info2, props);
|
|
11
|
+
}
|
|
12
|
+
return /*#__PURE__*/React.createElement(Info1, props);
|
|
13
|
+
};
|
|
14
|
+
export default APP;
|
|
@@ -15,13 +15,4 @@
|
|
|
15
15
|
// height: 42px;
|
|
16
16
|
// background: #069456;
|
|
17
17
|
// }
|
|
18
|
-
}
|
|
19
|
-
#create-booking-page-info-wrap {
|
|
20
|
-
.pisell-lowcode__booking-tab-pane-footer {
|
|
21
|
-
padding: 12px 16px !important;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
.create-booking-page-info-wrap {
|
|
25
|
-
position: initial !important;
|
|
26
|
-
padding: 0 16px !important;
|
|
27
18
|
}
|