@pisell/private-materials 3.0.160 → 3.0.162-gray
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 +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +10 -10
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +11 -11
- package/es/components/booking/addons/model.d.ts +2 -1
- package/es/components/booking/components/footer/index.js +34 -5
- package/es/components/booking/components/footer/utils.js +4 -1
- package/es/components/booking/dashboard/index.d.ts +20 -0
- package/es/components/booking/dashboard/index.js +298 -0
- package/es/components/booking/dashboard/serve.d.ts +1 -0
- package/es/components/booking/dashboard/serve.js +27 -0
- package/es/components/booking/forms/forms.d.ts +1 -0
- package/es/components/booking/forms/forms.js +4 -2
- package/es/components/booking/forms/model.d.ts +2 -1
- package/es/components/booking/forms/single/index.d.ts +1 -1
- package/es/components/booking/forms/single/index.js +4 -3
- package/es/components/booking/hooks/useClearCart.d.ts +3 -0
- package/es/components/booking/hooks/useClearCart.js +27 -0
- package/es/components/booking/hooks/useCreateBookingPageHeader.d.ts +6 -0
- package/es/components/booking/hooks/useCreateBookingPageHeader.js +21 -0
- package/es/components/booking/info/addServiceVariant/index.d.ts +7 -0
- package/es/components/booking/info/addServiceVariant/index.js +42 -0
- package/es/components/booking/info/client/index.js +1 -1
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +1 -0
- package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +4 -2
- package/es/components/booking/info/clientVariant/vertical/index.js +6 -5
- package/es/components/booking/info/clientVariant/vertical/index.less +8 -0
- package/es/components/booking/info/index.less +19 -0
- package/es/components/booking/info/main.js +11 -5
- package/es/components/booking/info/pet/index.js +1 -1
- package/es/components/booking/info/service/addService/index.d.ts +9 -3
- package/es/components/booking/info/service/addService/index.js +82 -36
- package/es/components/booking/info/service/addService/index.less +27 -1
- package/es/components/booking/info/service/editService/index.js +25 -41
- package/es/components/booking/info/service/index.js +5 -2
- package/es/components/booking/info/service/index.less +18 -0
- package/es/components/booking/info/service/serviceItem/index.d.ts +3 -3
- package/es/components/booking/info/service/serviceItem/index.js +22 -8
- package/es/components/booking/info/service/serviceItem/index.less +8 -0
- package/es/components/booking/info/service/serviceList/index.js +20 -1
- package/es/components/booking/info2/index.js +9 -3
- package/es/components/booking/info2/service/addService/index.d.ts +8 -2
- package/es/components/booking/info2/service/addService/index.js +82 -36
- package/es/components/booking/info2/service/addTimeModal/index.js +1 -0
- package/es/components/booking/info2/service/editService/index.js +11 -4
- package/es/components/booking/info2/service/index.js +5 -2
- package/es/components/booking/info2/service/serviceItem/index.d.ts +1 -1
- package/es/components/booking/info2/service/serviceItem/index.js +16 -3
- package/es/components/booking/info2/service/serviceList/index.js +20 -1
- package/es/components/booking/info2/utilsByBooking.js +6 -2
- package/es/components/booking/locales.d.ts +63 -0
- package/es/components/booking/locales.js +72 -3
- package/es/components/booking/model.d.ts +2 -0
- package/es/components/booking/notes/index.d.ts +1 -1
- package/es/components/booking/notes/model.d.ts +2 -1
- package/es/components/booking/payments/model.d.ts +2 -1
- package/es/components/booking/utils.d.ts +1 -1
- package/es/components/booking/utils.js +54 -51
- package/es/components/schedules/index.d.ts +1 -1
- package/es/components/schedules/model.d.ts +2 -1
- package/es/index.d.ts +2 -0
- package/es/index.js +3 -1
- package/lib/components/booking/addons/model.d.ts +2 -1
- package/lib/components/booking/components/footer/index.js +30 -5
- package/lib/components/booking/components/footer/utils.js +2 -1
- package/lib/components/booking/dashboard/index.d.ts +20 -0
- package/lib/components/booking/dashboard/index.js +279 -0
- package/lib/components/booking/dashboard/serve.d.ts +1 -0
- package/lib/components/booking/dashboard/serve.js +33 -0
- package/lib/components/booking/forms/forms.d.ts +1 -0
- package/lib/components/booking/forms/forms.js +5 -2
- package/lib/components/booking/forms/model.d.ts +2 -1
- package/lib/components/booking/forms/single/index.d.ts +1 -1
- package/lib/components/booking/forms/single/index.js +4 -2
- package/lib/components/booking/hooks/useClearCart.d.ts +3 -0
- package/lib/components/booking/hooks/useClearCart.js +62 -0
- package/lib/components/booking/hooks/useCreateBookingPageHeader.d.ts +6 -0
- package/lib/components/booking/hooks/useCreateBookingPageHeader.js +53 -0
- package/lib/components/booking/info/addServiceVariant/index.d.ts +7 -0
- package/lib/components/booking/info/addServiceVariant/index.js +70 -0
- package/lib/components/booking/info/client/index.js +1 -1
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +4 -2
- package/lib/components/booking/info/clientVariant/vertical/index.js +88 -76
- package/lib/components/booking/info/clientVariant/vertical/index.less +8 -0
- package/lib/components/booking/info/index.less +19 -0
- package/lib/components/booking/info/main.js +9 -3
- package/lib/components/booking/info/pet/index.js +2 -1
- package/lib/components/booking/info/service/addService/index.d.ts +9 -3
- package/lib/components/booking/info/service/addService/index.js +66 -29
- package/lib/components/booking/info/service/addService/index.less +27 -1
- package/lib/components/booking/info/service/editService/index.js +30 -38
- package/lib/components/booking/info/service/index.js +4 -2
- package/lib/components/booking/info/service/index.less +18 -0
- package/lib/components/booking/info/service/serviceItem/index.d.ts +3 -3
- package/lib/components/booking/info/service/serviceItem/index.js +15 -1
- package/lib/components/booking/info/service/serviceItem/index.less +8 -0
- package/lib/components/booking/info/service/serviceList/index.js +18 -1
- package/lib/components/booking/info2/index.js +8 -2
- package/lib/components/booking/info2/service/addService/index.d.ts +8 -2
- package/lib/components/booking/info2/service/addService/index.js +66 -29
- package/lib/components/booking/info2/service/addTimeModal/index.js +1 -0
- package/lib/components/booking/info2/service/editService/index.js +7 -1
- package/lib/components/booking/info2/service/index.js +4 -2
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +1 -1
- package/lib/components/booking/info2/service/serviceItem/index.js +14 -1
- package/lib/components/booking/info2/service/serviceList/index.js +18 -1
- package/lib/components/booking/info2/utilsByBooking.js +5 -1
- package/lib/components/booking/locales.d.ts +63 -0
- package/lib/components/booking/locales.js +66 -3
- package/lib/components/booking/model.d.ts +2 -0
- package/lib/components/booking/notes/index.d.ts +1 -1
- package/lib/components/booking/notes/model.d.ts +2 -1
- package/lib/components/booking/payments/model.d.ts +2 -1
- package/lib/components/booking/utils.d.ts +1 -1
- package/lib/components/booking/utils.js +57 -22
- package/lib/components/schedules/index.d.ts +1 -1
- package/lib/components/schedules/model.d.ts +2 -1
- package/lib/index.d.ts +2 -0
- package/lib/index.js +6 -0
- package/lowcode/booking-dashboard/meta.ts +137 -0
- package/lowcode/booking-vertical-add-service/meta.ts +124 -0
- package/lowcode/vertical-add-service/meta.ts +71 -0
- package/package.json +3 -3
|
@@ -34,9 +34,10 @@ import { getErrorList, getServiceTimes, deleteCacheParams, getProductTotalPrice
|
|
|
34
34
|
import Like from "../like";
|
|
35
35
|
import { getNoResource } from "../../../mock";
|
|
36
36
|
import { formatResources, getDurationProps, getFlexibleOption, getTimeObj } from "../addService/utils";
|
|
37
|
+
import { PisellAdjustPriceInputNumber, Page } from '@pisell/materials';
|
|
37
38
|
var submitLock = false;
|
|
38
39
|
var Info = function Info(_, ref) {
|
|
39
|
-
var _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$service$cacheI4, _state$service$cacheI5, _state$service$cacheI7, _state$service$cacheI8, _state$service$cacheI9, _state$service3, _state$service3$cache, _state$service5, _state$service5$cache, _state$service5$cache2, _state$service5$cache3, _state$date, _state$date$value, _state$date$value$for, _window$BaseMaterials, _state$service$
|
|
40
|
+
var _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$service$cacheI4, _state$service$cacheI5, _state$service$cacheI7, _state$service$cacheI8, _state$service$cacheI9, _state$service3, _state$service3$cache, _state$service5, _state$service5$cache, _state$service5$cache2, _state$service5$cache3, _state$date, _state$date$value, _state$date$value$for, _window$BaseMaterials, _state$service$cacheI19, _state$service7, _state$service7$cache, _state$service7$cache2, _state$service$cacheI20, _state$service$cacheI21, _state$bookingConfig9, _state$bookingConfig10, _state$bookingConfig11, _state$bookingConfig12;
|
|
40
41
|
var _Form$useForm = Form.useForm(),
|
|
41
42
|
_Form$useForm2 = _slicedToArray(_Form$useForm, 1),
|
|
42
43
|
form = _Form$useForm2[0];
|
|
@@ -155,7 +156,7 @@ var Info = function Info(_, ref) {
|
|
|
155
156
|
* @Date: 2024-01-09 13:38
|
|
156
157
|
*/
|
|
157
158
|
var getResources = /*#__PURE__*/function () {
|
|
158
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(cacheItem) {
|
|
159
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(cacheItem, open) {
|
|
159
160
|
var _list, _cacheItem, autoClose;
|
|
160
161
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
161
162
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -189,7 +190,7 @@ var Info = function Info(_, ref) {
|
|
|
189
190
|
}, 200);
|
|
190
191
|
} else {
|
|
191
192
|
setTimeout(function () {
|
|
192
|
-
if (selectOpen === undefined) {
|
|
193
|
+
if (selectOpen === undefined || open) {
|
|
193
194
|
setSelectOpen(true);
|
|
194
195
|
}
|
|
195
196
|
}, 500);
|
|
@@ -206,7 +207,7 @@ var Info = function Info(_, ref) {
|
|
|
206
207
|
}
|
|
207
208
|
}, _callee, null, [[1, 11]]);
|
|
208
209
|
}));
|
|
209
|
-
return function getResources(_x2) {
|
|
210
|
+
return function getResources(_x2, _x3) {
|
|
210
211
|
return _ref.apply(this, arguments);
|
|
211
212
|
};
|
|
212
213
|
}();
|
|
@@ -401,13 +402,13 @@ var Info = function Info(_, ref) {
|
|
|
401
402
|
}
|
|
402
403
|
});
|
|
403
404
|
});
|
|
404
|
-
var setEditData = useMemoizedFn(function (_cacheItem) {
|
|
405
|
+
var setEditData = useMemoizedFn(function (_cacheItem, open) {
|
|
405
406
|
var cacheItem = _cacheItem || state.service.cacheItem;
|
|
406
407
|
var values = cacheItem._extend;
|
|
407
408
|
form.setFieldsValue(values);
|
|
408
409
|
if (state.renderType !== 'eventBooking') {
|
|
409
410
|
// 获取资源列表
|
|
410
|
-
getResources(
|
|
411
|
+
getResources(cacheItem, open);
|
|
411
412
|
}
|
|
412
413
|
});
|
|
413
414
|
|
|
@@ -456,13 +457,11 @@ var Info = function Info(_, ref) {
|
|
|
456
457
|
}
|
|
457
458
|
}, [useStartTime, useDuration, state.renderType, state.service.resourcesOrigin, (_state$service$cacheI7 = state.service.cacheItem) === null || _state$service$cacheI7 === void 0 ? void 0 : _state$service$cacheI7.autoClose]);
|
|
458
459
|
useEffect(function () {
|
|
459
|
-
//
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
// }
|
|
465
|
-
}, [state.service.editModal]);
|
|
460
|
+
// 预约创建页面并且打开了编辑弹窗
|
|
461
|
+
if (state.isBookingCreatePage && state.service.editModal) {
|
|
462
|
+
setEditData(null, true);
|
|
463
|
+
}
|
|
464
|
+
}, [state.service.editModal, state.isBookingCreatePage]);
|
|
466
465
|
|
|
467
466
|
/**
|
|
468
467
|
* @title: 资源 时间 发生变化时, 重新计算错误信息
|
|
@@ -661,7 +660,7 @@ var Info = function Info(_, ref) {
|
|
|
661
660
|
});
|
|
662
661
|
var SelectTime = (_window$BaseMaterials = window.BaseMaterials) === null || _window$BaseMaterials === void 0 ? void 0 : _window$BaseMaterials.SelectTime;
|
|
663
662
|
return useMemo(function () {
|
|
664
|
-
var _state$service$cacheI10, _state$service6, _state$service6$cache, _state$service6$cache2, _state$service$cacheI11, _state$service$cacheI12, _state$service$cacheI13, _state$service$cacheI14, _state$bookingConfig5, _state$bookingConfig6, _state$bookingConfig7, _state$bookingConfig8;
|
|
663
|
+
var _state$service$cacheI10, _state$service6, _state$service6$cache, _state$service6$cache2, _state$service$cacheI11, _state$service$cacheI12, _state$service$cacheI13, _state$service$cacheI14, _state$service$cacheI15, _state$service$cacheI16, _state$service$cacheI17, _state$service$cacheI18, _state$bookingConfig5, _state$bookingConfig6, _state$bookingConfig7, _state$bookingConfig8;
|
|
665
664
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Drawer
|
|
666
665
|
//通过zIndex的方式控制 添加商品 和 编辑服务弹窗的上下层级
|
|
667
666
|
, {
|
|
@@ -682,7 +681,7 @@ var Info = function Info(_, ref) {
|
|
|
682
681
|
}
|
|
683
682
|
}, /*#__PURE__*/React.createElement("div", {
|
|
684
683
|
className: "pisell-lowcode__booking-service-body-edit"
|
|
685
|
-
}, /*#__PURE__*/React.createElement(Form, {
|
|
684
|
+
}, /*#__PURE__*/React.createElement(Page, null, /*#__PURE__*/React.createElement(Form, {
|
|
686
685
|
layout: "vertical",
|
|
687
686
|
form: form,
|
|
688
687
|
onFinish: onFinish
|
|
@@ -703,7 +702,7 @@ var Info = function Info(_, ref) {
|
|
|
703
702
|
className: "current-service-info-name"
|
|
704
703
|
}, ((_state$service6 = state.service) === null || _state$service6 === void 0 ? void 0 : (_state$service6$cache = _state$service6.cacheItem) === null || _state$service6$cache === void 0 ? void 0 : (_state$service6$cache2 = _state$service6$cache._extend) === null || _state$service6$cache2 === void 0 ? void 0 : _state$service6$cache2.product_name) || '-'), /*#__PURE__*/React.createElement(Button, {
|
|
705
704
|
onClick: handleEdit
|
|
706
|
-
}, locales.getText('pisell2.text.edit')), /*#__PURE__*/React.createElement(Button, {
|
|
705
|
+
}, locales.getText('pisell2.text.edit')), !state.isBookingCreatePage && /*#__PURE__*/React.createElement(Button, {
|
|
707
706
|
onClick: handleChange
|
|
708
707
|
}, locales.getText('pisell2.text.change'))), /*#__PURE__*/React.createElement(CollapsibleList, {
|
|
709
708
|
style: {
|
|
@@ -714,39 +713,24 @@ var Info = function Info(_, ref) {
|
|
|
714
713
|
return renderBundles(item, state.amountSymbol);
|
|
715
714
|
}
|
|
716
715
|
})))), /*#__PURE__*/React.createElement(Col, {
|
|
717
|
-
span:
|
|
716
|
+
span: 24
|
|
718
717
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
719
718
|
label: locales.getText('pisell2.text.price'),
|
|
720
719
|
name: "total",
|
|
721
720
|
rules: [{
|
|
722
721
|
required: true
|
|
723
|
-
}]
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
prefix: state.amountSymbol,
|
|
727
|
-
size: "large",
|
|
728
|
-
precision: 2,
|
|
722
|
+
}],
|
|
723
|
+
extra: useTotal !== ((_state$service$cacheI11 = state.service.cacheItem) === null || _state$service$cacheI11 === void 0 ? void 0 : (_state$service$cacheI12 = _state$service$cacheI11._extend) === null || _state$service$cacheI12 === void 0 ? void 0 : _state$service$cacheI12.origin_total) && locales.getText('page.booking.text.price-extra')(formatAmount((_state$service$cacheI13 = state.service.cacheItem) === null || _state$service$cacheI13 === void 0 ? void 0 : (_state$service$cacheI14 = _state$service$cacheI13._extend) === null || _state$service$cacheI14 === void 0 ? void 0 : _state$service$cacheI14.origin_total, 2, state.amountSymbol), formatAmount(useTotal, 2, state.amountSymbol))
|
|
724
|
+
}, /*#__PURE__*/React.createElement(PisellAdjustPriceInputNumber, {
|
|
729
725
|
style: {
|
|
730
726
|
width: '100%'
|
|
731
727
|
},
|
|
732
728
|
min: 0,
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
}))), /*#__PURE__*/React.createElement(Col, {
|
|
736
|
-
span: 12
|
|
737
|
-
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
738
|
-
label: locales.getText('pisell2.text.discount'),
|
|
739
|
-
name: "discount"
|
|
740
|
-
}, /*#__PURE__*/React.createElement(Select, {
|
|
729
|
+
precision: 2,
|
|
730
|
+
prefix: state.amountSymbol,
|
|
741
731
|
disabled: state.channelDisabledEdit,
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
allowClear: isDiscount,
|
|
745
|
-
onChange: function onChange(e) {
|
|
746
|
-
form.setFieldsValue({
|
|
747
|
-
total: state.service.cacheItem._extend.origin_total
|
|
748
|
-
});
|
|
749
|
-
}
|
|
732
|
+
originValue: ((_state$service$cacheI15 = state.service.cacheItem) === null || _state$service$cacheI15 === void 0 ? void 0 : (_state$service$cacheI16 = _state$service$cacheI15._extend) === null || _state$service$cacheI16 === void 0 ? void 0 : _state$service$cacheI16.origin_total) || 0,
|
|
733
|
+
placeholder: ((_state$service$cacheI17 = state.service.cacheItem) === null || _state$service$cacheI17 === void 0 ? void 0 : (_state$service$cacheI18 = _state$service$cacheI17._extend) === null || _state$service$cacheI18 === void 0 ? void 0 : _state$service$cacheI18.origin_total) || '0'
|
|
750
734
|
}))), isReason ? /*#__PURE__*/React.createElement(Col, {
|
|
751
735
|
span: 24
|
|
752
736
|
}, /*#__PURE__*/React.createElement(Form.Item, {
|
|
@@ -824,7 +808,7 @@ var Info = function Info(_, ref) {
|
|
|
824
808
|
}, /*#__PURE__*/React.createElement(InputNumber, null)), /*#__PURE__*/React.createElement(Form.Item, {
|
|
825
809
|
hidden: true,
|
|
826
810
|
name: "like_status"
|
|
827
|
-
}, /*#__PURE__*/React.createElement(Input, null))))), state.renderType !== 'eventBooking' && errorList.map(function (d, i) {
|
|
811
|
+
}, /*#__PURE__*/React.createElement(Input, null)))))), state.renderType !== 'eventBooking' && errorList.map(function (d, i) {
|
|
828
812
|
return /*#__PURE__*/React.createElement(Alert, {
|
|
829
813
|
key: d.type,
|
|
830
814
|
message: d.label,
|
|
@@ -849,6 +833,6 @@ var Info = function Info(_, ref) {
|
|
|
849
833
|
form.submit();
|
|
850
834
|
}
|
|
851
835
|
}, locales.getText('pisell2.text.apply'))))));
|
|
852
|
-
}, [state.service.changeService, state.service.editModal, (_state$service$
|
|
836
|
+
}, [state.service.changeService, state.service.editModal, (_state$service$cacheI19 = state.service.cacheItem) === null || _state$service$cacheI19 === void 0 ? void 0 : _state$service$cacheI19.autoClose, locales, (_state$service7 = state.service) === null || _state$service7 === void 0 ? void 0 : (_state$service7$cache = _state$service7.cacheItem) === null || _state$service7$cache === void 0 ? void 0 : (_state$service7$cache2 = _state$service7$cache._extend) === null || _state$service7$cache2 === void 0 ? void 0 : _state$service7$cache2.product_name, bundles, state.amountSymbol, state.channelDisabledEdit, (_state$service$cacheI20 = state.service.cacheItem) === null || _state$service$cacheI20 === void 0 ? void 0 : (_state$service$cacheI21 = _state$service$cacheI20._extend) === null || _state$service$cacheI21 === void 0 ? void 0 : _state$service$cacheI21.origin_total, isDiscount, isReason, state.renderType, (_state$bookingConfig9 = state.bookingConfig) === null || _state$bookingConfig9 === void 0 ? void 0 : (_state$bookingConfig10 = _state$bookingConfig9.config) === null || _state$bookingConfig10 === void 0 ? void 0 : (_state$bookingConfig11 = _state$bookingConfig10.basic) === null || _state$bookingConfig11 === void 0 ? void 0 : (_state$bookingConfig12 = _state$bookingConfig11.service_time) === null || _state$bookingConfig12 === void 0 ? void 0 : _state$bookingConfig12.value, SelectTime, durationProps, timeObj, useResource, useLikeStatus, resourceLoading, selectOpen, state.service.resources, errorList, useTotal]);
|
|
853
837
|
};
|
|
854
838
|
export default /*#__PURE__*/forwardRef(Info);
|
|
@@ -5,10 +5,12 @@ import EditService from "./editService";
|
|
|
5
5
|
import "./index.less";
|
|
6
6
|
import ServiceList from "./serviceList";
|
|
7
7
|
import AddTimeModal from "./addTimeModal";
|
|
8
|
+
import useClearCart from "../../hooks/useClearCart";
|
|
8
9
|
var Service = function Service() {
|
|
9
10
|
var _state$bookingConfig2, _state$bookingConfig3;
|
|
10
11
|
var _useContext = useContext(Context),
|
|
11
|
-
state = _useContext.state
|
|
12
|
+
state = _useContext.state,
|
|
13
|
+
dispatch = _useContext.dispatch;
|
|
12
14
|
var detailRef = useRef();
|
|
13
15
|
useEffect(function () {
|
|
14
16
|
document.body.id = 'body';
|
|
@@ -42,9 +44,10 @@ var Service = function Service() {
|
|
|
42
44
|
(_detailRef$current = detailRef.current) === null || _detailRef$current === void 0 ? void 0 : (_detailRef$current$in = _detailRef$current.init) === null || _detailRef$current$in === void 0 ? void 0 : _detailRef$current$in.call(_detailRef$current, cacheItem);
|
|
43
45
|
}, 100);
|
|
44
46
|
};
|
|
47
|
+
var clearCart = useClearCart(state, dispatch);
|
|
45
48
|
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
46
49
|
className: "pisell-lowcode__booking-service-wrap"
|
|
47
|
-
}, /*#__PURE__*/React.createElement(ServiceList, {
|
|
50
|
+
}, clearCart, /*#__PURE__*/React.createElement(ServiceList, {
|
|
48
51
|
onEdit: handleEdit
|
|
49
52
|
}), /*#__PURE__*/React.createElement(AddService, {
|
|
50
53
|
onEdit: handleEdit
|
|
@@ -1,3 +1,21 @@
|
|
|
1
1
|
.pisell-lowcode__booking-service-wrap {
|
|
2
2
|
margin-top: 16px;
|
|
3
|
+
.pisell-lowcode__booking-service-clear-btn {
|
|
4
|
+
cursor: pointer;
|
|
5
|
+
margin-top: -12px;
|
|
6
|
+
color: var(--Blue-700, #175CD3);
|
|
7
|
+
font-weight: 600;
|
|
8
|
+
line-height: 24px; /* 150% */
|
|
9
|
+
display: flex;
|
|
10
|
+
align-items: center;
|
|
11
|
+
margin-bottom: 4px;
|
|
12
|
+
padding: 12px 0;
|
|
13
|
+
.anticon {
|
|
14
|
+
font-size: 18px;
|
|
15
|
+
margin-right: 6px;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
.pisell-lowcode__booking-service-clear-btn-disabled {
|
|
19
|
+
color: #98A2B3
|
|
20
|
+
}
|
|
3
21
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from
|
|
2
|
-
import
|
|
3
|
-
declare const ServiceItem: ({ d, handleEditService, state, handleLike, resourceItem, errorMessage, }: any) => React.JSX.Element;
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
declare const ServiceItem: ({ d, handleEditService, state, handleLike, resourceItem, errorMessage, handleDeleteService, }: any) => React.JSX.Element;
|
|
4
4
|
export default ServiceItem;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import React, { useMemo } from
|
|
1
|
+
import React, { useMemo } from 'react';
|
|
2
2
|
import Like from "../like";
|
|
3
3
|
import { getServiceTime } from "../../../utils";
|
|
4
|
-
import { formatAmount, locales } from
|
|
4
|
+
import { formatAmount, locales } from '@pisell/utils';
|
|
5
5
|
import CollapsibleList from "../../../components/collapsibleList";
|
|
6
6
|
import { renderBundles } from "../../../components/collapsibleList/utils";
|
|
7
|
-
import { Alert } from
|
|
7
|
+
import { Alert, Button } from 'antd';
|
|
8
8
|
import Actions from "../actions";
|
|
9
9
|
import "./index.less";
|
|
10
|
+
import { Iconfont } from '@pisell/materials';
|
|
10
11
|
var ServiceItem = function ServiceItem(_ref) {
|
|
11
12
|
var _d$_extend3, _d$_extend4, _d$_extend5, _d$_extend5$other, _d$_extend6, _d$_extend6$other, _d$_extend7, _d$_extend8, _d$_extend9, _d$_extend$relation_d;
|
|
12
13
|
var d = _ref.d,
|
|
@@ -14,7 +15,9 @@ var ServiceItem = function ServiceItem(_ref) {
|
|
|
14
15
|
state = _ref.state,
|
|
15
16
|
handleLike = _ref.handleLike,
|
|
16
17
|
resourceItem = _ref.resourceItem,
|
|
17
|
-
errorMessage = _ref.errorMessage
|
|
18
|
+
errorMessage = _ref.errorMessage,
|
|
19
|
+
handleDeleteService = _ref.handleDeleteService;
|
|
20
|
+
console.log(d, 'dddddd');
|
|
18
21
|
var resourceName = (resourceItem === null || resourceItem === void 0 ? void 0 : resourceItem.labelText) || d.relation_form_name;
|
|
19
22
|
var isDiscount = useMemo(function () {
|
|
20
23
|
var _d$_extend, _d$_extend2;
|
|
@@ -26,9 +29,20 @@ var ServiceItem = function ServiceItem(_ref) {
|
|
|
26
29
|
onClick: function onClick() {
|
|
27
30
|
handleEditService(d);
|
|
28
31
|
}
|
|
29
|
-
},
|
|
32
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
33
|
+
className: "pisell-lowcode__booking-service-item-delete",
|
|
34
|
+
onClick: function onClick(e) {
|
|
35
|
+
e.stopPropagation();
|
|
36
|
+
handleDeleteService(d);
|
|
37
|
+
}
|
|
38
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
39
|
+
type: "text",
|
|
40
|
+
icon: /*#__PURE__*/React.createElement(Iconfont, {
|
|
41
|
+
type: "pisell2-trash-01"
|
|
42
|
+
})
|
|
43
|
+
})), d.id ? /*#__PURE__*/React.createElement("div", {
|
|
30
44
|
className: "pisell-lowcode__booking-service-item-title"
|
|
31
|
-
}, d.title) : null, d._extend ? /*#__PURE__*/React.createElement(React.Fragment, null, state.renderType !==
|
|
45
|
+
}, d.title) : null, d._extend ? /*#__PURE__*/React.createElement(React.Fragment, null, state.renderType !== 'eventBooking' && /*#__PURE__*/React.createElement("div", {
|
|
32
46
|
className: "pisell-lowcode__booking-service-item-date"
|
|
33
47
|
}, getServiceTime(d, state.date.value)), /*#__PURE__*/React.createElement("div", {
|
|
34
48
|
className: "pisell-lowcode__booking-service-item-technician"
|
|
@@ -54,11 +68,11 @@ var ServiceItem = function ServiceItem(_ref) {
|
|
|
54
68
|
className: "pisell-lowcode__booking-service-item-original-price"
|
|
55
69
|
}, formatAmount(d._extend.origin_total, 2, state.amountSymbol)) : null)) : null, isDiscount && (_d$_extend8 = d._extend) !== null && _d$_extend8 !== void 0 && _d$_extend8.discount_reason ? /*#__PURE__*/React.createElement("div", {
|
|
56
70
|
className: "pisell-lowcode__booking-service-item-discount-reason"
|
|
57
|
-
}, /*#__PURE__*/React.createElement("span", null, locales.getText(
|
|
71
|
+
}, /*#__PURE__*/React.createElement("span", null, locales.getText('pisell2.text.discount-reason'), ":"), ' ', (_d$_extend9 = d._extend) === null || _d$_extend9 === void 0 ? void 0 : _d$_extend9.discount_reason) : null, (_d$_extend$relation_d = d._extend.relation_details) !== null && _d$_extend$relation_d !== void 0 && _d$_extend$relation_d.length ? /*#__PURE__*/React.createElement("div", {
|
|
58
72
|
className: "pisell-lowcode__booking-service-item-relation-details"
|
|
59
73
|
}, /*#__PURE__*/React.createElement("div", {
|
|
60
74
|
className: "pisell-lowcode__booking-service-item-title"
|
|
61
|
-
}, locales.getText(
|
|
75
|
+
}, locales.getText('page.booking.text.sales')), d._extend.relation_details.map(function (item, index) {
|
|
62
76
|
return /*#__PURE__*/React.createElement("div", {
|
|
63
77
|
className: "pisell-lowcode__booking-service-item-relation-detail",
|
|
64
78
|
key: item.id
|
|
@@ -94,6 +94,14 @@
|
|
|
94
94
|
margin: 0 -20px -16px;
|
|
95
95
|
border-radius: 0 0 8px 8px;
|
|
96
96
|
}
|
|
97
|
+
|
|
98
|
+
.pisell-lowcode__booking-service-item-delete {
|
|
99
|
+
position: absolute;
|
|
100
|
+
padding: 10px;
|
|
101
|
+
top: 0;
|
|
102
|
+
right: 0;
|
|
103
|
+
cursor: pointer;
|
|
104
|
+
}
|
|
97
105
|
}
|
|
98
106
|
|
|
99
107
|
.pisell-lowcode__booking-service-item-relation-details {
|
|
@@ -45,6 +45,24 @@ var ServiceList = function ServiceList(_ref) {
|
|
|
45
45
|
new: 0
|
|
46
46
|
}));
|
|
47
47
|
};
|
|
48
|
+
var handleDeleteService = function handleDeleteService(item) {
|
|
49
|
+
if (state.disabledEdit || state.disableEventBookingEdit || state.channelDisabledEdit) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
var _list = _toConsumableArray(state.service.value);
|
|
53
|
+
_list = _list.filter(function (d) {
|
|
54
|
+
return d._id !== item._id;
|
|
55
|
+
});
|
|
56
|
+
dispatch({
|
|
57
|
+
type: 'setService',
|
|
58
|
+
payload: {
|
|
59
|
+
editModal: false,
|
|
60
|
+
value: _list,
|
|
61
|
+
edit: true,
|
|
62
|
+
cacheItem: null
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
};
|
|
48
66
|
var getResourceItem = useCallback(function (id) {
|
|
49
67
|
if (id === 0) {
|
|
50
68
|
return getNoResource();
|
|
@@ -103,7 +121,8 @@ var ServiceList = function ServiceList(_ref) {
|
|
|
103
121
|
d: d,
|
|
104
122
|
handleEditService: handleEditService,
|
|
105
123
|
state: state,
|
|
106
|
-
handleLike: handleLike
|
|
124
|
+
handleLike: handleLike,
|
|
125
|
+
handleDeleteService: handleDeleteService
|
|
107
126
|
});
|
|
108
127
|
}));
|
|
109
128
|
};
|
|
@@ -28,6 +28,8 @@ import useEngineContext from "../../../hooks/useEngineContext";
|
|
|
28
28
|
import Notes from "../info/notes";
|
|
29
29
|
import "../info/index.less";
|
|
30
30
|
import { Skeleton } from "antd";
|
|
31
|
+
import classNames from "classnames";
|
|
32
|
+
import useCreateBookingPageHeader from "../hooks/useCreateBookingPageHeader";
|
|
31
33
|
var defaultModules = {
|
|
32
34
|
client: 1,
|
|
33
35
|
date: 1,
|
|
@@ -37,7 +39,7 @@ var defaultModules = {
|
|
|
37
39
|
};
|
|
38
40
|
locales.init(localeTexts, localStorage.getItem('umi_locale') || 'en');
|
|
39
41
|
var Info = Provider(function (props) {
|
|
40
|
-
var _modal$state2, _modal$state2$booking, _modal$state2$booking2, _modal$state2$booking3, _modal$state4, _modal$state4$notes, _modal$state6, _modal$state6$date, _modal$state6$date$va, _context$appHelper4, _context$appHelper4$u, _modal$state7, _React$createElement;
|
|
42
|
+
var _modal$state2, _modal$state2$booking, _modal$state2$booking2, _modal$state2$booking3, _modal$state4, _modal$state4$notes, _modal$state6, _modal$state6$date, _modal$state6$date$va, _context$appHelper4, _context$appHelper4$u, _classNames, _modal$state7, _React$createElement;
|
|
41
43
|
// return <Payments {...props} />;
|
|
42
44
|
var style = props.style,
|
|
43
45
|
globalState = props.globalState,
|
|
@@ -51,6 +53,10 @@ var Info = Provider(function (props) {
|
|
|
51
53
|
var _modal$state, _modal$state$bookingC, _modal$state$bookingC2, _modal$state$bookingC3;
|
|
52
54
|
return ((_modal$state = modal.state) === null || _modal$state === void 0 ? void 0 : (_modal$state$bookingC = _modal$state.bookingConfig) === null || _modal$state$bookingC === void 0 ? void 0 : (_modal$state$bookingC2 = _modal$state$bookingC.config) === null || _modal$state$bookingC2 === void 0 ? void 0 : (_modal$state$bookingC3 = _modal$state$bookingC2.basic) === null || _modal$state$bookingC3 === void 0 ? void 0 : _modal$state$bookingC3.appointment_subject) || {};
|
|
53
55
|
}, [(_modal$state2 = modal.state) === null || _modal$state2 === void 0 ? void 0 : (_modal$state2$booking = _modal$state2.bookingConfig) === null || _modal$state2$booking === void 0 ? void 0 : (_modal$state2$booking2 = _modal$state2$booking.config) === null || _modal$state2$booking2 === void 0 ? void 0 : (_modal$state2$booking3 = _modal$state2$booking2.basic) === null || _modal$state2$booking3 === void 0 ? void 0 : _modal$state2$booking3.appointment_subject]);
|
|
56
|
+
var _useCreateBookingPage = useCreateBookingPageHeader(globalState),
|
|
57
|
+
createHeader = _useCreateBookingPage.createHeader,
|
|
58
|
+
isBookingCreatePage = _useCreateBookingPage.isBookingCreatePage,
|
|
59
|
+
isBookingCreatePageCreateMode = _useCreateBookingPage.isBookingCreatePageCreateMode;
|
|
54
60
|
useEffect(function () {
|
|
55
61
|
document.body.id = 'body';
|
|
56
62
|
// 注入函数到页面的state内
|
|
@@ -210,9 +216,9 @@ var Info = Provider(function (props) {
|
|
|
210
216
|
})
|
|
211
217
|
}, _defineProperty(_React$createElement, "style", {
|
|
212
218
|
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'
|
|
213
|
-
}), _defineProperty(_React$createElement, "bodyClassName",
|
|
219
|
+
}), _defineProperty(_React$createElement, "bodyClassName", classNames('booking-info-warp', (_classNames = {}, _defineProperty(_classNames, 'create-booking-page-info-wrap', isBookingCreatePage), _defineProperty(_classNames, 'create-booking-page-info-wrap-create', isBookingCreatePageCreateMode), _classNames))), _React$createElement), /*#__PURE__*/React.createElement("div", {
|
|
214
220
|
className: "booking-info"
|
|
215
|
-
}, modules.client ? /*#__PURE__*/React.createElement(Client, null) : null, modules.holder && !((_modal$state7 = modal.state) !== null && _modal$state7 !== void 0 && _modal$state7.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, /*#__PURE__*/React.createElement(Skeleton, {
|
|
221
|
+
}, createHeader, modules.client ? /*#__PURE__*/React.createElement(Client, null) : null, modules.holder && !((_modal$state7 = modal.state) !== null && _modal$state7 !== void 0 && _modal$state7.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, /*#__PURE__*/React.createElement(Skeleton, {
|
|
216
222
|
loading: globalState.loading,
|
|
217
223
|
round: true,
|
|
218
224
|
active: true,
|
|
@@ -1,6 +1,12 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { PisellDrawerProps } from '../../../components/drawer';
|
|
2
3
|
import '../../../info/service/addService/index.less';
|
|
3
|
-
|
|
4
|
+
interface AddServiceProps {
|
|
4
5
|
onEdit: any;
|
|
5
|
-
|
|
6
|
+
dispatch?: any;
|
|
7
|
+
state?: any;
|
|
8
|
+
drawerProps?: PisellDrawerProps;
|
|
9
|
+
renderMode?: 'current' | 'drawer';
|
|
10
|
+
}
|
|
11
|
+
declare const Info: (props: AddServiceProps) => React.JSX.Element;
|
|
6
12
|
export default Info;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
2
|
+
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
2
3
|
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return exports; }; var exports = {}, Op = Object.prototype, hasOwn = Op.hasOwnProperty, defineProperty = Object.defineProperty || function (obj, key, desc) { obj[key] = desc.value; }, $Symbol = "function" == typeof Symbol ? Symbol : {}, iteratorSymbol = $Symbol.iterator || "@@iterator", asyncIteratorSymbol = $Symbol.asyncIterator || "@@asyncIterator", toStringTagSymbol = $Symbol.toStringTag || "@@toStringTag"; function define(obj, key, value) { return Object.defineProperty(obj, key, { value: value, enumerable: !0, configurable: !0, writable: !0 }), obj[key]; } try { define({}, ""); } catch (err) { define = function define(obj, key, value) { return obj[key] = value; }; } function wrap(innerFn, outerFn, self, tryLocsList) { var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator, generator = Object.create(protoGenerator.prototype), context = new Context(tryLocsList || []); return defineProperty(generator, "_invoke", { value: makeInvokeMethod(innerFn, self, context) }), generator; } function tryCatch(fn, obj, arg) { try { return { type: "normal", arg: fn.call(obj, arg) }; } catch (err) { return { type: "throw", arg: err }; } } exports.wrap = wrap; var ContinueSentinel = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var IteratorPrototype = {}; define(IteratorPrototype, iteratorSymbol, function () { return this; }); var getProto = Object.getPrototypeOf, NativeIteratorPrototype = getProto && getProto(getProto(values([]))); NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype); var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype); function defineIteratorMethods(prototype) { ["next", "throw", "return"].forEach(function (method) { define(prototype, method, function (arg) { return this._invoke(method, arg); }); }); } function AsyncIterator(generator, PromiseImpl) { function invoke(method, arg, resolve, reject) { var record = tryCatch(generator[method], generator, arg); if ("throw" !== record.type) { var result = record.arg, value = result.value; return value && "object" == _typeof(value) && hasOwn.call(value, "__await") ? PromiseImpl.resolve(value.__await).then(function (value) { invoke("next", value, resolve, reject); }, function (err) { invoke("throw", err, resolve, reject); }) : PromiseImpl.resolve(value).then(function (unwrapped) { result.value = unwrapped, resolve(result); }, function (error) { return invoke("throw", error, resolve, reject); }); } reject(record.arg); } var previousPromise; defineProperty(this, "_invoke", { value: function value(method, arg) { function callInvokeWithMethodAndArg() { return new PromiseImpl(function (resolve, reject) { invoke(method, arg, resolve, reject); }); } return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(innerFn, self, context) { var state = "suspendedStart"; return function (method, arg) { if ("executing" === state) throw new Error("Generator is already running"); if ("completed" === state) { if ("throw" === method) throw arg; return doneResult(); } for (context.method = method, context.arg = arg;;) { var delegate = context.delegate; if (delegate) { var delegateResult = maybeInvokeDelegate(delegate, context); if (delegateResult) { if (delegateResult === ContinueSentinel) continue; return delegateResult; } } if ("next" === context.method) context.sent = context._sent = context.arg;else if ("throw" === context.method) { if ("suspendedStart" === state) throw state = "completed", context.arg; context.dispatchException(context.arg); } else "return" === context.method && context.abrupt("return", context.arg); state = "executing"; var record = tryCatch(innerFn, self, context); if ("normal" === record.type) { if (state = context.done ? "completed" : "suspendedYield", record.arg === ContinueSentinel) continue; return { value: record.arg, done: context.done }; } "throw" === record.type && (state = "completed", context.method = "throw", context.arg = record.arg); } }; } function maybeInvokeDelegate(delegate, context) { var methodName = context.method, method = delegate.iterator[methodName]; if (undefined === method) return context.delegate = null, "throw" === methodName && delegate.iterator.return && (context.method = "return", context.arg = undefined, maybeInvokeDelegate(delegate, context), "throw" === context.method) || "return" !== methodName && (context.method = "throw", context.arg = new TypeError("The iterator does not provide a '" + methodName + "' method")), ContinueSentinel; var record = tryCatch(method, delegate.iterator, context.arg); if ("throw" === record.type) return context.method = "throw", context.arg = record.arg, context.delegate = null, ContinueSentinel; var info = record.arg; return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, "return" !== context.method && (context.method = "next", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = "throw", context.arg = new TypeError("iterator result is not an object"), context.delegate = null, ContinueSentinel); } function pushTryEntry(locs) { var entry = { tryLoc: locs[0] }; 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry); } function resetTryEntry(entry) { var record = entry.completion || {}; record.type = "normal", delete record.arg, entry.completion = record; } function Context(tryLocsList) { this.tryEntries = [{ tryLoc: "root" }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0); } function values(iterable) { if (iterable) { var iteratorMethod = iterable[iteratorSymbol]; if (iteratorMethod) return iteratorMethod.call(iterable); if ("function" == typeof iterable.next) return iterable; if (!isNaN(iterable.length)) { var i = -1, next = function next() { for (; ++i < iterable.length;) if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next; return next.value = undefined, next.done = !0, next; }; return next.next = next; } } return { next: doneResult }; } function doneResult() { return { value: undefined, done: !0 }; } return GeneratorFunction.prototype = GeneratorFunctionPrototype, defineProperty(Gp, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), defineProperty(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, "GeneratorFunction"), exports.isGeneratorFunction = function (genFun) { var ctor = "function" == typeof genFun && genFun.constructor; return !!ctor && (ctor === GeneratorFunction || "GeneratorFunction" === (ctor.displayName || ctor.name)); }, exports.mark = function (genFun) { return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, "GeneratorFunction")), genFun.prototype = Object.create(Gp), genFun; }, exports.awrap = function (arg) { return { __await: arg }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () { return this; }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) { void 0 === PromiseImpl && (PromiseImpl = Promise); var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl); return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) { return result.done ? result.value : iter.next(); }); }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, "Generator"), define(Gp, iteratorSymbol, function () { return this; }), define(Gp, "toString", function () { return "[object Generator]"; }), exports.keys = function (val) { var object = Object(val), keys = []; for (var key in object) keys.push(key); return keys.reverse(), function next() { for (; keys.length;) { var key = keys.pop(); if (key in object) return next.value = key, next.done = !1, next; } return next.done = !0, next; }; }, exports.values = values, Context.prototype = { constructor: Context, reset: function reset(skipTempReset) { if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = "next", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) "t" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined); }, stop: function stop() { this.done = !0; var rootRecord = this.tryEntries[0].completion; if ("throw" === rootRecord.type) throw rootRecord.arg; return this.rval; }, dispatchException: function dispatchException(exception) { if (this.done) throw exception; var context = this; function handle(loc, caught) { return record.type = "throw", record.arg = exception, context.next = loc, caught && (context.method = "next", context.arg = undefined), !!caught; } for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i], record = entry.completion; if ("root" === entry.tryLoc) return handle("end"); if (entry.tryLoc <= this.prev) { var hasCatch = hasOwn.call(entry, "catchLoc"), hasFinally = hasOwn.call(entry, "finallyLoc"); if (hasCatch && hasFinally) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } else if (hasCatch) { if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0); } else { if (!hasFinally) throw new Error("try statement without catch or finally"); if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc); } } } }, abrupt: function abrupt(type, arg) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc <= this.prev && hasOwn.call(entry, "finallyLoc") && this.prev < entry.finallyLoc) { var finallyEntry = entry; break; } } finallyEntry && ("break" === type || "continue" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null); var record = finallyEntry ? finallyEntry.completion : {}; return record.type = type, record.arg = arg, finallyEntry ? (this.method = "next", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record); }, complete: function complete(record, afterLoc) { if ("throw" === record.type) throw record.arg; return "break" === record.type || "continue" === record.type ? this.next = record.arg : "return" === record.type ? (this.rval = this.arg = record.arg, this.method = "return", this.next = "end") : "normal" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel; }, finish: function finish(finallyLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel; } }, catch: function _catch(tryLoc) { for (var i = this.tryEntries.length - 1; i >= 0; --i) { var entry = this.tryEntries[i]; if (entry.tryLoc === tryLoc) { var record = entry.completion; if ("throw" === record.type) { var thrown = record.arg; resetTryEntry(entry); } return thrown; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(iterable, resultName, nextLoc) { return this.delegate = { iterator: values(iterable), resultName: resultName, nextLoc: nextLoc }, "next" === this.method && (this.arg = undefined), ContinueSentinel; } }, exports; }
|
|
3
4
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
4
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
@@ -33,9 +34,11 @@ import { formatProductListByCategory, getProductTotalPrice, request } from "../.
|
|
|
33
34
|
import { locales, getUniqueId } from '@pisell/utils';
|
|
34
35
|
import { useUpdateEffect } from 'ahooks';
|
|
35
36
|
var shopList = [2886, 4422, 5538, 6930, 6814, 6813, 6812, 6087, 6303, 6080, 6978, 7386, 6848, 6305];
|
|
36
|
-
var Info = function Info(
|
|
37
|
+
var Info = function Info(props) {
|
|
37
38
|
var _state$service2, _state$service4, _state$service5, _state$service5$cache;
|
|
38
|
-
var onEdit =
|
|
39
|
+
var onEdit = props.onEdit,
|
|
40
|
+
drawerProps = props.drawerProps,
|
|
41
|
+
renderMode = props.renderMode;
|
|
39
42
|
var _useState = useState(''),
|
|
40
43
|
_useState2 = _slicedToArray(_useState, 2),
|
|
41
44
|
search = _useState2[0],
|
|
@@ -49,6 +52,8 @@ var Info = function Info(_ref) {
|
|
|
49
52
|
setLoading = _useState4[1];
|
|
50
53
|
var searchRef = useRef();
|
|
51
54
|
var context = useEngineContext();
|
|
55
|
+
state = state || (props === null || props === void 0 ? void 0 : props.state);
|
|
56
|
+
dispatch = dispatch || (props === null || props === void 0 ? void 0 : props.dispatch);
|
|
52
57
|
request.setRequest(context.appHelper.utils.request);
|
|
53
58
|
|
|
54
59
|
/**
|
|
@@ -60,7 +65,7 @@ var Info = function Info(_ref) {
|
|
|
60
65
|
* @Date: 2024-05-14 13:55
|
|
61
66
|
*/
|
|
62
67
|
var setDefaultService = /*#__PURE__*/function () {
|
|
63
|
-
var
|
|
68
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(list) {
|
|
64
69
|
var _list, product, detail, isBundleOrCombination, _item;
|
|
65
70
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
66
71
|
while (1) switch (_context.prev = _context.next) {
|
|
@@ -140,11 +145,11 @@ var Info = function Info(_ref) {
|
|
|
140
145
|
}, _callee);
|
|
141
146
|
}));
|
|
142
147
|
return function setDefaultService(_x2) {
|
|
143
|
-
return
|
|
148
|
+
return _ref.apply(this, arguments);
|
|
144
149
|
};
|
|
145
150
|
}();
|
|
146
151
|
var getServices = /*#__PURE__*/function () {
|
|
147
|
-
var
|
|
152
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
|
|
148
153
|
var _state$eventOtherPara;
|
|
149
154
|
var data;
|
|
150
155
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
@@ -152,7 +157,7 @@ var Info = function Info(_ref) {
|
|
|
152
157
|
case 0:
|
|
153
158
|
setLoading(true);
|
|
154
159
|
_context2.next = 3;
|
|
155
|
-
return state.apis.getServices({
|
|
160
|
+
return state.apis.getServices(_objectSpread({
|
|
156
161
|
skip: 1,
|
|
157
162
|
num: 500,
|
|
158
163
|
extension_type: state.renderType === 'eventBooking' ? undefined : ['product_appointment', 'appointment_ticket', 'service_product'],
|
|
@@ -162,11 +167,14 @@ var Info = function Info(_ref) {
|
|
|
162
167
|
with_schedule: 1,
|
|
163
168
|
with_count: ['bundleGroup', 'optionGroup'],
|
|
164
169
|
order_by_string: 'sort:desc',
|
|
165
|
-
status: 'published'
|
|
170
|
+
status: 'published'
|
|
171
|
+
}, state.isBookingCreatePage ? {
|
|
172
|
+
schedule_date: params === null || params === void 0 ? void 0 : params.schedule_date
|
|
173
|
+
} : {
|
|
166
174
|
_config: {
|
|
167
175
|
useCache: true
|
|
168
176
|
}
|
|
169
|
-
});
|
|
177
|
+
}));
|
|
170
178
|
case 3:
|
|
171
179
|
data = _context2.sent;
|
|
172
180
|
setLoading(false);
|
|
@@ -187,8 +195,8 @@ var Info = function Info(_ref) {
|
|
|
187
195
|
}
|
|
188
196
|
}, _callee2);
|
|
189
197
|
}));
|
|
190
|
-
return function getServices() {
|
|
191
|
-
return
|
|
198
|
+
return function getServices(_x3) {
|
|
199
|
+
return _ref2.apply(this, arguments);
|
|
192
200
|
};
|
|
193
201
|
}();
|
|
194
202
|
var handleSelectService = function handleSelectService() {
|
|
@@ -257,6 +265,11 @@ var Info = function Info(_ref) {
|
|
|
257
265
|
cacheItem._id = (_state$service$cacheI = state.service.cacheItem) === null || _state$service$cacheI === void 0 ? void 0 : _state$service$cacheI._id;
|
|
258
266
|
cacheItem.new = 0;
|
|
259
267
|
}
|
|
268
|
+
// 渲染到当前位置模式时,默认无资源 时间默认取顶部设置的时间
|
|
269
|
+
if (renderMode === 'current') {
|
|
270
|
+
// cacheItem._extend.resource = 0;
|
|
271
|
+
cacheItem.currentDefaultTime = state.date.value.format('HH:mm');
|
|
272
|
+
}
|
|
260
273
|
cacheItem = getProductExtend({
|
|
261
274
|
cacheItem: cacheItem,
|
|
262
275
|
state: state
|
|
@@ -328,12 +341,29 @@ var Info = function Info(_ref) {
|
|
|
328
341
|
setSearch('');
|
|
329
342
|
}
|
|
330
343
|
}, [state.service.addModal]);
|
|
344
|
+
var currentDate = useMemo(function () {
|
|
345
|
+
return state.date.value.format('YYYY-MM-DD');
|
|
346
|
+
}, [state.date.value]);
|
|
347
|
+
useEffect(function () {
|
|
348
|
+
if (renderMode === 'current') {
|
|
349
|
+
getServices({
|
|
350
|
+
schedule_date: currentDate
|
|
351
|
+
});
|
|
352
|
+
}
|
|
353
|
+
}, [renderMode, currentDate]);
|
|
331
354
|
useEffect(function () {
|
|
332
355
|
if (state.renderType === 'eventBooking' && state.modalOpen) {
|
|
333
356
|
getServices();
|
|
334
357
|
}
|
|
335
358
|
}, [state.renderType, state.modalOpen]);
|
|
336
359
|
var addButton = useMemo(function () {
|
|
360
|
+
if (state.isBookingCreatePage) {
|
|
361
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
362
|
+
style: {
|
|
363
|
+
height: 20
|
|
364
|
+
}
|
|
365
|
+
});
|
|
366
|
+
}
|
|
337
367
|
if (state.renderType === 'eventBooking') {
|
|
338
368
|
return isService ? /*#__PURE__*/React.createElement("div", {
|
|
339
369
|
style: {
|
|
@@ -358,12 +388,50 @@ var Info = function Info(_ref) {
|
|
|
358
388
|
}
|
|
359
389
|
});
|
|
360
390
|
}, [state.renderType, showAddButton, isService, state.service.value, loading]);
|
|
391
|
+
var isRenderCurrent = useMemo(function () {
|
|
392
|
+
return renderMode === 'current';
|
|
393
|
+
}, [renderMode]);
|
|
394
|
+
var header = /*#__PURE__*/React.createElement("div", {
|
|
395
|
+
className: "pisell-lowcode__booking-service-header"
|
|
396
|
+
}, /*#__PURE__*/React.createElement(Input, {
|
|
397
|
+
ref: searchRef,
|
|
398
|
+
prefix: /*#__PURE__*/React.createElement(SearchLg, null),
|
|
399
|
+
style: {
|
|
400
|
+
marginTop: 16,
|
|
401
|
+
height: 44
|
|
402
|
+
},
|
|
403
|
+
placeholder: locales.getText('pisell2.text.search'),
|
|
404
|
+
allowClear: true,
|
|
405
|
+
value: search,
|
|
406
|
+
onChange: function onChange(e) {
|
|
407
|
+
setSearch(e.target.value);
|
|
408
|
+
}
|
|
409
|
+
}));
|
|
410
|
+
var content = /*#__PURE__*/React.createElement("div", {
|
|
411
|
+
className: "pisell-lowcode__booking-service-body"
|
|
412
|
+
}, /*#__PURE__*/React.createElement(TabProduct, {
|
|
413
|
+
list: renderList,
|
|
414
|
+
amountSymbol: state.amountSymbol,
|
|
415
|
+
onChange: handleSelectProduct,
|
|
416
|
+
scrollDom: isRenderCurrent ? '.pisell-lowcode__booking-vertical-add-service-wrap' : '.booking-server-wrap .pisell-lowcode-drawer-body '
|
|
417
|
+
}));
|
|
418
|
+
if (isRenderCurrent) {
|
|
419
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
420
|
+
className: "pisell-lowcode__booking-vertical-add-service-wrap",
|
|
421
|
+
style: {
|
|
422
|
+
width: '100%',
|
|
423
|
+
height: '100%',
|
|
424
|
+
overflow: 'auto'
|
|
425
|
+
}
|
|
426
|
+
}, header, content);
|
|
427
|
+
}
|
|
361
428
|
return /*#__PURE__*/React.createElement(React.Fragment, null, ((_state$service5 = state.service) === null || _state$service5 === void 0 ? void 0 : (_state$service5$cache = _state$service5.cacheItem) === null || _state$service5$cache === void 0 ? void 0 : _state$service5$cache.autoClose) && /*#__PURE__*/React.createElement(Skeleton, {
|
|
362
429
|
loading: true,
|
|
363
430
|
active: true,
|
|
364
431
|
round: true
|
|
365
|
-
}), addButton, /*#__PURE__*/React.createElement(Drawer, {
|
|
366
|
-
|
|
432
|
+
}), addButton, /*#__PURE__*/React.createElement(Drawer, _extends({
|
|
433
|
+
titleNoWrap: true,
|
|
434
|
+
open: state.service.addModal && !state.isBookingCreatePage,
|
|
367
435
|
title: locales.getText('pisell2.text.select-service'),
|
|
368
436
|
rootClassName: "booking-server-wrap",
|
|
369
437
|
onClose: function onClose() {
|
|
@@ -375,29 +443,7 @@ var Info = function Info(_ref) {
|
|
|
375
443
|
}
|
|
376
444
|
});
|
|
377
445
|
},
|
|
378
|
-
header:
|
|
379
|
-
|
|
380
|
-
}, /*#__PURE__*/React.createElement(Input, {
|
|
381
|
-
ref: searchRef,
|
|
382
|
-
prefix: /*#__PURE__*/React.createElement(SearchLg, null),
|
|
383
|
-
style: {
|
|
384
|
-
marginTop: 16,
|
|
385
|
-
height: 44
|
|
386
|
-
},
|
|
387
|
-
placeholder: locales.getText('pisell2.text.search'),
|
|
388
|
-
allowClear: true,
|
|
389
|
-
value: search,
|
|
390
|
-
onChange: function onChange(e) {
|
|
391
|
-
setSearch(e.target.value);
|
|
392
|
-
}
|
|
393
|
-
}))
|
|
394
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
395
|
-
className: "pisell-lowcode__booking-service-body"
|
|
396
|
-
}, /*#__PURE__*/React.createElement(TabProduct, {
|
|
397
|
-
list: renderList,
|
|
398
|
-
amountSymbol: state.amountSymbol,
|
|
399
|
-
onChange: handleSelectProduct,
|
|
400
|
-
scrollDom: ".booking-server-wrap .pisell-lowcode-drawer-body"
|
|
401
|
-
}))));
|
|
446
|
+
header: header
|
|
447
|
+
}, drawerProps || {}), content));
|
|
402
448
|
};
|
|
403
449
|
export default Info;
|