@pisell/private-materials 3.0.13 → 3.0.14

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.
Files changed (166) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +9 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +8 -8
  11. package/es/components/booking/components/addButton/index.d.ts +8 -8
  12. package/es/components/booking/components/addButton/index.js +1 -1
  13. package/es/components/booking/components/drawer/index.d.ts +1 -1
  14. package/es/components/booking/components/footer/FooterMenus/index.js +1 -1
  15. package/es/components/booking/components/footer/index.js +23 -21
  16. package/es/components/booking/components/footer/utils.js +4 -3
  17. package/es/components/booking/forms/forms.js +2 -1
  18. package/es/components/booking/info/client/index.js +0 -1
  19. package/es/components/booking/info/date/index.less +1 -1
  20. package/es/components/booking/info/index.js +10 -4
  21. package/es/components/booking/info/pet/index.js +5 -7
  22. package/es/components/booking/info/service/addService/index.js +27 -11
  23. package/es/components/booking/info/service/editService/index.js +8 -7
  24. package/es/components/booking/info/service/index.js +1 -1
  25. package/es/components/booking/info/service/index.less +3 -0
  26. package/es/components/booking/locales.d.ts +3 -0
  27. package/es/components/booking/locales.js +3 -0
  28. package/es/components/booking/model.d.ts +11 -0
  29. package/es/components/booking/utils.js +2 -1
  30. package/es/components/index.d.ts +2 -1
  31. package/es/components/index.js +2 -1
  32. package/es/components/productExtension/card/index.d.ts +10 -0
  33. package/es/components/productExtension/card/index.js +20 -0
  34. package/es/components/productExtension/card/index.less +34 -0
  35. package/es/components/productExtension/fields/Actor/Container/index.d.ts +12 -0
  36. package/es/components/productExtension/fields/Actor/Container/index.js +34 -0
  37. package/es/components/productExtension/fields/Actor/Container/index.less +19 -0
  38. package/es/components/productExtension/fields/Actor/CutOffTime/index.d.ts +10 -0
  39. package/es/components/productExtension/fields/Actor/CutOffTime/index.js +94 -0
  40. package/es/components/productExtension/fields/Actor/CutOffTime/index.less +32 -0
  41. package/es/components/productExtension/fields/Actor/CutOffTime/status.d.ts +0 -0
  42. package/es/components/productExtension/fields/Actor/CutOffTime/status.js +0 -0
  43. package/es/components/productExtension/fields/Actor/index.d.ts +5 -0
  44. package/es/components/productExtension/fields/Actor/index.js +23 -0
  45. package/es/components/productExtension/fields/Forms/index.d.ts +10 -0
  46. package/es/components/productExtension/fields/Forms/index.js +184 -0
  47. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +4 -0
  48. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.js +30 -0
  49. package/es/components/productExtension/fields/SelectProducts/ProductItem/index.less +69 -0
  50. package/es/components/productExtension/fields/SelectProducts/index.d.ts +10 -0
  51. package/es/components/productExtension/fields/SelectProducts/index.js +91 -0
  52. package/es/components/productExtension/fields/SelectProducts/index.less +30 -0
  53. package/es/components/productExtension/fields/SelectProducts/mock.d.ts +0 -0
  54. package/es/components/productExtension/fields/SelectProducts/mock.js +0 -0
  55. package/es/components/productExtension/fields/SelectProducts/server.d.ts +1 -0
  56. package/es/components/productExtension/fields/SelectProducts/server.js +29 -0
  57. package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +4 -0
  58. package/es/components/productExtension/fields/SelectResourcesTable/index.js +198 -0
  59. package/es/components/productExtension/fields/SelectResourcesTable/index.less +0 -0
  60. package/es/components/productExtension/fields/SelectResourcesTable/mock.d.ts +2681 -0
  61. package/es/components/productExtension/fields/SelectResourcesTable/mock.js +5072 -0
  62. package/es/components/productExtension/fields/SelectResourcesTable/server.d.ts +2 -0
  63. package/es/components/productExtension/fields/SelectResourcesTable/server.js +49 -0
  64. package/es/components/productExtension/fields/index.d.ts +1 -0
  65. package/es/components/productExtension/fields/index.js +33 -0
  66. package/es/components/productExtension/index.d.ts +7 -0
  67. package/es/components/productExtension/index.js +77 -0
  68. package/es/components/productExtension/index.less +0 -0
  69. package/es/components/productExtension/locales.d.ts +48 -0
  70. package/es/components/productExtension/locales.js +47 -0
  71. package/es/components/productExtension/server.d.ts +1 -0
  72. package/es/components/productExtension/server.js +29 -0
  73. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -1
  74. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.js +21 -5
  75. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +5 -2
  76. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +20 -5
  77. package/es/components/selectModal/index.d.ts +24 -0
  78. package/es/components/selectModal/index.js +108 -0
  79. package/es/components/selectModal/index.less +0 -0
  80. package/es/components/tabProduct/card/index.d.ts +2 -2
  81. package/es/components/tabProduct/card/index.js +3 -4
  82. package/es/components/tabProduct/index.d.ts +4 -2
  83. package/es/components/tabProduct/index.js +10 -9
  84. package/es/index.d.ts +1 -0
  85. package/es/index.js +2 -1
  86. package/es/utils/index.d.ts +22 -0
  87. package/es/utils/index.js +56 -0
  88. package/lib/components/booking/components/addButton/index.d.ts +8 -8
  89. package/lib/components/booking/components/addButton/index.js +1 -1
  90. package/lib/components/booking/components/drawer/index.d.ts +1 -1
  91. package/lib/components/booking/components/footer/FooterMenus/index.js +1 -1
  92. package/lib/components/booking/components/footer/index.js +3 -1
  93. package/lib/components/booking/components/footer/utils.js +4 -2
  94. package/lib/components/booking/forms/forms.js +1 -1
  95. package/lib/components/booking/info/client/index.js +0 -1
  96. package/lib/components/booking/info/date/index.less +1 -1
  97. package/lib/components/booking/info/index.js +7 -1
  98. package/lib/components/booking/info/pet/index.js +5 -7
  99. package/lib/components/booking/info/service/addService/index.js +25 -10
  100. package/lib/components/booking/info/service/editService/index.js +7 -5
  101. package/lib/components/booking/info/service/index.js +1 -1
  102. package/lib/components/booking/info/service/index.less +3 -0
  103. package/lib/components/booking/locales.d.ts +3 -0
  104. package/lib/components/booking/locales.js +3 -0
  105. package/lib/components/booking/model.d.ts +11 -0
  106. package/lib/components/booking/utils.js +2 -1
  107. package/lib/components/index.d.ts +2 -1
  108. package/lib/components/index.js +3 -0
  109. package/lib/components/productExtension/card/index.d.ts +10 -0
  110. package/lib/components/productExtension/card/index.js +57 -0
  111. package/lib/components/productExtension/card/index.less +34 -0
  112. package/lib/components/productExtension/fields/Actor/Container/index.d.ts +12 -0
  113. package/lib/components/productExtension/fields/Actor/Container/index.js +64 -0
  114. package/lib/components/productExtension/fields/Actor/Container/index.less +19 -0
  115. package/lib/components/productExtension/fields/Actor/CutOffTime/index.d.ts +10 -0
  116. package/lib/components/productExtension/fields/Actor/CutOffTime/index.js +128 -0
  117. package/lib/components/productExtension/fields/Actor/CutOffTime/index.less +32 -0
  118. package/lib/components/productExtension/fields/Actor/CutOffTime/status.d.ts +0 -0
  119. package/lib/components/productExtension/fields/Actor/CutOffTime/status.js +0 -0
  120. package/lib/components/productExtension/fields/Actor/index.d.ts +5 -0
  121. package/lib/components/productExtension/fields/Actor/index.js +56 -0
  122. package/lib/components/productExtension/fields/Forms/index.d.ts +10 -0
  123. package/lib/components/productExtension/fields/Forms/index.js +108 -0
  124. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +4 -0
  125. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.js +65 -0
  126. package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.less +69 -0
  127. package/lib/components/productExtension/fields/SelectProducts/index.d.ts +10 -0
  128. package/lib/components/productExtension/fields/SelectProducts/index.js +111 -0
  129. package/lib/components/productExtension/fields/SelectProducts/index.less +30 -0
  130. package/lib/components/productExtension/fields/SelectProducts/mock.d.ts +0 -0
  131. package/lib/components/productExtension/fields/SelectProducts/mock.js +0 -0
  132. package/lib/components/productExtension/fields/SelectProducts/server.d.ts +1 -0
  133. package/lib/components/productExtension/fields/SelectProducts/server.js +33 -0
  134. package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +4 -0
  135. package/lib/components/productExtension/fields/SelectResourcesTable/index.js +179 -0
  136. package/lib/components/productExtension/fields/SelectResourcesTable/index.less +0 -0
  137. package/lib/components/productExtension/fields/SelectResourcesTable/mock.d.ts +2681 -0
  138. package/lib/components/productExtension/fields/SelectResourcesTable/mock.js +12723 -0
  139. package/lib/components/productExtension/fields/SelectResourcesTable/server.d.ts +2 -0
  140. package/lib/components/productExtension/fields/SelectResourcesTable/server.js +39 -0
  141. package/lib/components/productExtension/fields/index.d.ts +1 -0
  142. package/lib/components/productExtension/fields/index.js +69 -0
  143. package/lib/components/productExtension/index.d.ts +7 -0
  144. package/lib/components/productExtension/index.js +108 -0
  145. package/lib/components/productExtension/index.less +0 -0
  146. package/lib/components/productExtension/locales.d.ts +48 -0
  147. package/lib/components/productExtension/locales.js +71 -0
  148. package/lib/components/productExtension/server.d.ts +1 -0
  149. package/lib/components/productExtension/server.js +33 -0
  150. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -1
  151. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.js +11 -6
  152. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +5 -2
  153. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +18 -4
  154. package/lib/components/selectModal/index.d.ts +24 -0
  155. package/lib/components/selectModal/index.js +133 -0
  156. package/lib/components/selectModal/index.less +0 -0
  157. package/lib/components/tabProduct/card/index.d.ts +2 -2
  158. package/lib/components/tabProduct/card/index.js +1 -2
  159. package/lib/components/tabProduct/index.d.ts +4 -2
  160. package/lib/components/tabProduct/index.js +7 -8
  161. package/lib/index.d.ts +1 -0
  162. package/lib/index.js +3 -0
  163. package/lib/utils/index.d.ts +22 -0
  164. package/lib/utils/index.js +59 -0
  165. package/lowcode/product-extension/meta.ts +120 -0
  166. package/package.json +1 -1
@@ -7,14 +7,14 @@
7
7
  */
8
8
  import React from "react";
9
9
  import "./index.less";
10
- interface AddButtonProps {
11
- onClick: () => void;
12
- title: string;
13
- subTitle: string;
14
- showSub: boolean;
15
- style: any;
16
- disabled: boolean;
17
- loading: any;
10
+ export interface AddButtonProps {
11
+ onClick?: () => void;
12
+ title?: string;
13
+ subTitle?: string;
14
+ showSub?: boolean;
15
+ style?: React.CSSProperties;
16
+ disabled?: boolean;
17
+ loading?: boolean;
18
18
  }
19
19
  declare const AddButton: React.FC<AddButtonProps>;
20
20
  export default AddButton;
@@ -26,7 +26,7 @@ var AddButton = function AddButton(_ref) {
26
26
  if (disabled) {
27
27
  message.warning(locales.getText("pisell2.text.please-select-the-customer-first"));
28
28
  } else {
29
- onClick();
29
+ onClick === null || onClick === void 0 ? void 0 : onClick();
30
30
  }
31
31
  };
32
32
 
@@ -1,7 +1,7 @@
1
1
  import React from "react";
2
2
  import { DrawerProps } from "antd";
3
3
  import "./index.less";
4
- interface PisellDrawerProps extends DrawerProps {
4
+ export interface PisellDrawerProps extends DrawerProps {
5
5
  header?: React.ReactNode;
6
6
  titleNoWrap?: boolean;
7
7
  }
@@ -7,7 +7,7 @@ var FooterMenus = function FooterMenus(_ref) {
7
7
  dispatch = _ref.dispatch;
8
8
  var items = useMemo(function () {
9
9
  var list = [];
10
- if (state.bookingId) {
10
+ if (state.bookingId && state.renderType !== 'eventBooking') {
11
11
  list.push({
12
12
  label: locales.getText("pisell2.text.rebook"),
13
13
  key: "rebook"
@@ -259,7 +259,7 @@ var Footer = function Footer(props) {
259
259
  */
260
260
  var handleSave = /*#__PURE__*/function () {
261
261
  var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(_ref4) {
262
- var type, _setLoading, saveOtherValue, _state$onSave, callbackData, values, api;
262
+ var type, _setLoading, editApi, createApi, saveOtherValue, _state$onSave, callbackData, values, api;
263
263
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
264
264
  while (1) switch (_context4.prev = _context4.next) {
265
265
  case 0:
@@ -267,60 +267,62 @@ var Footer = function Footer(props) {
267
267
  // 区分loading, 是点击的checkout 还是save
268
268
  _setLoading = type === "checkout" ? setCheckoutLoading : setLoading;
269
269
  _setLoading(true);
270
+ editApi = state.renderType === 'eventBooking' ? state.apis.editEventBooking : state.apis.editBooking;
271
+ createApi = state.renderType === 'eventBooking' ? state.apis.createEventBooking : state.apis.createBooking;
270
272
  saveOtherValue = {};
271
273
  if (!(type === "save")) {
272
- _context4.next = 11;
274
+ _context4.next = 13;
273
275
  break;
274
276
  }
275
- _context4.next = 7;
277
+ _context4.next = 9;
276
278
  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);
277
- case 7:
279
+ case 9:
278
280
  _context4.t0 = _context4.sent;
279
281
  if (_context4.t0) {
280
- _context4.next = 10;
282
+ _context4.next = 12;
281
283
  break;
282
284
  }
283
285
  _context4.t0 = {};
284
- case 10:
286
+ case 12:
285
287
  saveOtherValue = _context4.t0;
286
- case 11:
287
- _context4.prev = 11;
288
+ case 13:
289
+ _context4.prev = 13;
288
290
  callbackData = null; // 格式化提交的参数
289
291
  values = formatValues(_objectSpread(_objectSpread({}, state), saveOtherValue)); // 区分是新增还是编辑
290
- api = state.bookingId ? state.apis.editBooking : state.apis.createBooking; // 如果有addons改动, 则先保存
292
+ api = state.bookingId ? editApi : createApi; // 如果有addons改动, 则先保存
291
293
  if (!addonsEdit) {
292
- _context4.next = 18;
294
+ _context4.next = 20;
293
295
  break;
294
296
  }
295
- _context4.next = 18;
297
+ _context4.next = 20;
296
298
  return handleSaveAddons();
297
- case 18:
299
+ case 20:
298
300
  if (!infoEdit) {
299
- _context4.next = 23;
301
+ _context4.next = 25;
300
302
  break;
301
303
  }
302
- _context4.next = 21;
304
+ _context4.next = 23;
303
305
  return api(values);
304
- case 21:
306
+ case 23:
305
307
  callbackData = _context4.sent;
306
308
  message.success(locales.getText(state.bookingId ? "pisell2.text.appointment-updated" : "pisell2.text.created-successfully"));
307
- case 23:
309
+ case 25:
308
310
  // 回调关闭弹窗
309
311
  state === null || state === void 0 ? void 0 : state.callback(callbackData);
310
312
  _setLoading(false);
311
313
 
312
314
  // return数据 checkout时需要
313
315
  return _context4.abrupt("return", callbackData);
314
- case 28:
315
- _context4.prev = 28;
316
- _context4.t1 = _context4["catch"](11);
316
+ case 30:
317
+ _context4.prev = 30;
318
+ _context4.t1 = _context4["catch"](13);
317
319
  console.log(_context4.t1);
318
320
  _setLoading(false);
319
- case 32:
321
+ case 34:
320
322
  case "end":
321
323
  return _context4.stop();
322
324
  }
323
- }, _callee4, null, [[11, 28]]);
325
+ }, _callee4, null, [[13, 30]]);
324
326
  }));
325
327
  return function handleSave(_x3) {
326
328
  return _ref5.apply(this, arguments);
@@ -26,13 +26,14 @@ var formatCustomer = function formatCustomer(data) {
26
26
  };
27
27
  var formatBookings = function formatBookings(data) {
28
28
  var list = data.service.value;
29
+ var eventOtherParams = data.eventOtherParams;
29
30
  var bookings = [];
30
31
  bookings = list.map(function (item) {
31
32
  var start_date = item._extend.startDate.format('YYYY-MM-DD');
32
33
  var start_time = item._extend.startDate.format("HH:mm");
33
34
  var end_date = item._extend.endDate.format('YYYY-MM-DD');
34
35
  var end_time = item._extend.endDate.format("HH:mm");
35
- return {
36
+ return _objectSpread({
36
37
  "product": {
37
38
  "num": item._extend.quantity,
38
39
  "price": item.price,
@@ -60,7 +61,7 @@ var formatBookings = function formatBookings(data) {
60
61
  "start_date": start_date,
61
62
  "duration": flexibleObj.getValue(item._extend.duration),
62
63
  "number": item._extend.number || 1
63
- };
64
+ }, eventOtherParams || {});
64
65
  });
65
66
  return bookings;
66
67
  };
@@ -86,7 +87,7 @@ var formatHolder = function formatHolder(data, values) {
86
87
  // https://menutech.w.eolink.com/home/api-studio/inside/K2bI3n465fe7244b3dbd6679d87caedfbb0636bf8c29eda/api/2778666/detail/53001549?spaceKey=menutech
87
88
  export var formatValues = function formatValues(state) {
88
89
  var values = {
89
- type: "appointment_booking",
90
+ type: state.renderType === 'eventBooking' ? "event_booking_v2" : "appointment_booking",
90
91
  platform: "shop",
91
92
  sales_channel: "my_pisel",
92
93
  bookings: [],
@@ -31,7 +31,8 @@ import "./index.less";
31
31
  */
32
32
  var Forms = Provider(function (props) {
33
33
  var forms = props.forms,
34
- value = props.value,
34
+ _props$value = props.value,
35
+ value = _props$value === void 0 ? [] : _props$value,
35
36
  modalOpen = props.modalOpen,
36
37
  onChange = props.onChange,
37
38
  action = props.action,
@@ -141,7 +141,6 @@ var Info = function Info() {
141
141
  return item.name || (item.display_name || "").trim() || (item.nickname || "").trim() || "";
142
142
  }, [locales.localeMap]);
143
143
  var handleSelectClient = function handleSelectClient(value) {
144
- console.log("valuevalue", value);
145
144
  var _value = (value === null || value === void 0 ? void 0 : value[value.length - 1]) || walkInData;
146
145
  if (_value.loading) {
147
146
  return;
@@ -1,5 +1,5 @@
1
1
  .pisell-lowcode__booking-body-select-date {
2
- padding: 24px 0;
2
+ padding: 24px 0 8px;
3
3
  font-weight: 550;
4
4
 
5
5
  .pisell-lowcode-picker-input>input {
@@ -73,12 +73,18 @@ var Info = Provider(function (props) {
73
73
  }
74
74
  });
75
75
  };
76
- return /*#__PURE__*/React.createElement(React.Fragment, null, !!modal.state.setGlobalState ? /*#__PURE__*/React.createElement(TabPane, {
77
- style: style,
78
- header: globalState !== null && globalState !== void 0 && globalState.bookingId ? /*#__PURE__*/React.createElement(Header, {
76
+ var header = useMemo(function () {
77
+ if ((globalState === null || globalState === void 0 ? void 0 : globalState.renderType) === 'eventBooking') {
78
+ return locales.getText("pisell2.text.enroll");
79
+ }
80
+ return globalState !== null && globalState !== void 0 && globalState.bookingId ? /*#__PURE__*/React.createElement(Header, {
79
81
  state: modal.state,
80
82
  dispatch: modal.dispatch
81
- }) : locales.getText("pisell2.text.new-appointment"),
83
+ }) : locales.getText("pisell2.text.new-appointment");
84
+ }, [globalState === null || globalState === void 0 ? void 0 : globalState.bookingId, modal.state, modal.dispatch, globalState === null || globalState === void 0 ? void 0 : globalState.renderType]);
85
+ return /*#__PURE__*/React.createElement(React.Fragment, null, !!modal.state.setGlobalState ? /*#__PURE__*/React.createElement(TabPane, {
86
+ style: style,
87
+ header: header,
82
88
  footer: /*#__PURE__*/React.createElement(Footer, {
83
89
  state: modal.state,
84
90
  dispatch: modal.dispatch,
@@ -28,7 +28,7 @@ import FormsCom from "../../forms/forms";
28
28
  import { changeFormValues } from "../../forms/format";
29
29
  import { isWalkIn } from "../../utils";
30
30
  var Pet = function Pet() {
31
- var _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$pet, _state$client$value2, _state$client8, _state$client8$value, _state$client9;
31
+ var _state$bookingConfig2, _state$bookingConfig3, _state$bookingConfig4, _state$client$value2, _state$client8, _state$client8$value, _state$client9;
32
32
  var _useState = useState(false),
33
33
  _useState2 = _slicedToArray(_useState, 2),
34
34
  loading = _useState2[0],
@@ -136,7 +136,6 @@ var Pet = function Pet() {
136
136
  return _ref2.apply(this, arguments);
137
137
  };
138
138
  }();
139
- console.log("values", (_state$pet = state.pet) === null || _state$pet === void 0 ? void 0 : _state$pet.value);
140
139
 
141
140
  /**
142
141
  * @title: 获取预约主体表单
@@ -167,7 +166,7 @@ var Pet = function Pet() {
167
166
  _context2.prev = 5;
168
167
  _context2.next = 8;
169
168
  return state.apis.getForms({
170
- relation_type: "appointment_booking",
169
+ relation_type: state.renderType === 'eventBooking' ? "event_booking_v2" : "appointment_booking",
171
170
  relation_id: ((_state$bookingDetail = state.bookingDetail) === null || _state$bookingDetail === void 0 ? void 0 : (_state$bookingDetail$ = _state$bookingDetail.bookings) === null || _state$bookingDetail$ === void 0 ? void 0 : _state$bookingDetail$.id) || 0
172
171
  // _config: { useCache: true },
173
172
  });
@@ -300,11 +299,11 @@ var Pet = function Pet() {
300
299
 
301
300
  // 当客户id 发生改变时, 检测当前表单是否是该客户的, 如果不是则移除
302
301
  useEffect(function () {
303
- var _state$pet2, _state$client7, _state$client7$value, _state$pet3;
302
+ var _state$pet, _state$client7, _state$client7$value, _state$pet2;
304
303
  var changeFormValuesData = changeFormValues({
305
- values: ((_state$pet2 = state.pet) === null || _state$pet2 === void 0 ? void 0 : _state$pet2.value) || {},
304
+ values: ((_state$pet = state.pet) === null || _state$pet === void 0 ? void 0 : _state$pet.value) || {},
306
305
  clientId: (_state$client7 = state.client) === null || _state$client7 === void 0 ? void 0 : (_state$client7$value = _state$client7.value) === null || _state$client7$value === void 0 ? void 0 : _state$client7$value.id,
307
- forms: ((_state$pet3 = state.pet) === null || _state$pet3 === void 0 ? void 0 : _state$pet3.formData) || []
306
+ forms: ((_state$pet2 = state.pet) === null || _state$pet2 === void 0 ? void 0 : _state$pet2.formData) || []
308
307
  });
309
308
  dispatch({
310
309
  type: "setPet",
@@ -326,7 +325,6 @@ var Pet = function Pet() {
326
325
  getForms(true);
327
326
  }
328
327
  }, [state.bookingId, state.bookingDetail, params.form_id, params.type, (_state$client8 = state.client) === null || _state$client8 === void 0 ? void 0 : (_state$client8$value = _state$client8.value) === null || _state$client8$value === void 0 ? void 0 : _state$client8$value.id]);
329
- console.log("state.pet.formData", state.pet.formData);
330
328
  return /*#__PURE__*/React.createElement("div", {
331
329
  className: "pisell-lowcode__booking-pet-wraps"
332
330
  }, /*#__PURE__*/React.createElement(FormsCom, {
@@ -34,6 +34,7 @@ var Info = function Info() {
34
34
  dispatch = _useContext.dispatch;
35
35
  var getServices = /*#__PURE__*/function () {
36
36
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
37
+ var _state$eventOtherPara;
37
38
  var data;
38
39
  return _regeneratorRuntime().wrap(function _callee$(_context) {
39
40
  while (1) switch (_context.prev = _context.next) {
@@ -42,12 +43,13 @@ var Info = function Info() {
42
43
  return state.apis.getServices({
43
44
  skip: 1,
44
45
  num: 500,
45
- extension_type: ["product_appointment"],
46
+ extension_type: state.renderType === "eventBooking" ? undefined : ["product_appointment"],
46
47
  with: ["category"],
47
48
  // include_formula: "no",
48
49
  // include_bundle: "no",
49
50
  // include_option: "no",
50
51
  // include_variant: "no",
52
+ ids: state.renderType === "eventBooking" ? (_state$eventOtherPara = state.eventOtherParams) === null || _state$eventOtherPara === void 0 ? void 0 : _state$eventOtherPara.productIds : undefined,
51
53
  open_quotation: 1,
52
54
  with_schedule: 0
53
55
  });
@@ -114,7 +116,6 @@ var Info = function Info() {
114
116
  return isIncludes(item.title);
115
117
  } : undefined);
116
118
  }, [search, (_state$service2 = state.service) === null || _state$service2 === void 0 ? void 0 : _state$service2.services]);
117
- console.log("renderList", renderList);
118
119
  var isService = useMemo(function () {
119
120
  return state.service.value.length > 0;
120
121
  }, [state.service.value]);
@@ -133,16 +134,31 @@ var Info = function Info() {
133
134
  var showAddButton = useMemo(function () {
134
135
  return !state.disabledEdit && !state.channelDisabledEdit;
135
136
  }, [state.disabledEdit, state.channelDisabledEdit]);
136
- return /*#__PURE__*/React.createElement(React.Fragment, null, showAddButton ? /*#__PURE__*/React.createElement(AddButton, {
137
- showSub: isService,
138
- title: locales.getText("pisell2.text.add-a-service"),
139
- subTitle: locales.getText("pisell2.text.add-another-service"),
140
- onClick: handleSelectService
141
- }) : /*#__PURE__*/React.createElement("div", {
142
- style: {
143
- height: 20
137
+ var addButton = useMemo(function () {
138
+ if (state.renderType === "eventBooking") {
139
+ return isService ? /*#__PURE__*/React.createElement("div", {
140
+ style: {
141
+ height: 20
142
+ }
143
+ }) : /*#__PURE__*/React.createElement(AddButton, {
144
+ showSub: false,
145
+ title: locales.getText("pisell2.text.add-a-service"),
146
+ subTitle: locales.getText("pisell2.text.add-another-service"),
147
+ onClick: handleSelectService
148
+ });
144
149
  }
145
- }), /*#__PURE__*/React.createElement(Drawer, {
150
+ return showAddButton ? /*#__PURE__*/React.createElement(AddButton, {
151
+ showSub: isService,
152
+ title: locales.getText("pisell2.text.add-a-service"),
153
+ subTitle: locales.getText("pisell2.text.add-another-service"),
154
+ onClick: handleSelectService
155
+ }) : /*#__PURE__*/React.createElement("div", {
156
+ style: {
157
+ height: 20
158
+ }
159
+ });
160
+ }, [state.renderType, showAddButton, isService, state.service.value]);
161
+ return /*#__PURE__*/React.createElement(React.Fragment, null, addButton, /*#__PURE__*/React.createElement(Drawer, {
146
162
  open: state.service.addModal,
147
163
  title: locales.getText("pisell2.text.select-service"),
148
164
  rootClassName: "booking-server-wrap",
@@ -420,9 +420,10 @@ var Info = function Info() {
420
420
  if (state.service.editModal) {
421
421
  var cacheItem = state.service.cacheItem;
422
422
  form.setFieldsValue(getServerItemExtend(state, cacheItem, timeObj));
423
-
424
- // 获取资源列表
425
- getResources();
423
+ if (state.renderType !== 'eventBooking') {
424
+ // 获取资源列表
425
+ getResources();
426
+ }
426
427
  } else {
427
428
  form.resetFields();
428
429
  }
@@ -464,10 +465,10 @@ var Info = function Info() {
464
465
  * @Date: 2024-01-09 14:07
465
466
  */
466
467
  useUpdateEffect(function () {
467
- if (useStartTime && useDuration) {
468
+ if (useStartTime && useDuration && state.renderType !== 'eventBooking') {
468
469
  getResources();
469
470
  }
470
- }, [useStartTime, useDuration]);
471
+ }, [useStartTime, useDuration, state.renderType]);
471
472
 
472
473
  /**
473
474
  * @title: 打开弹窗时 设置数据
@@ -601,7 +602,7 @@ var Info = function Info() {
601
602
  name: "discount_reason"
602
603
  }, /*#__PURE__*/React.createElement(Input.TextArea, {
603
604
  size: "large"
604
- }))) : null, /*#__PURE__*/React.createElement(Col, {
605
+ }))) : null, state.renderType !== 'eventBooking' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(Col, {
605
606
  span: 12
606
607
  }, /*#__PURE__*/React.createElement(Form.Item, {
607
608
  label: locales.getText("pisell2.text.start_time"),
@@ -659,7 +660,7 @@ var Info = function Info() {
659
660
  }, /*#__PURE__*/React.createElement(InputNumber, null)), /*#__PURE__*/React.createElement(Form.Item, {
660
661
  hidden: true,
661
662
  name: "like_status"
662
- }, /*#__PURE__*/React.createElement(Input, null)))), errorList.map(function (d, i) {
663
+ }, /*#__PURE__*/React.createElement(Input, null))))), state.renderType !== 'eventBooking' && errorList.map(function (d, i) {
663
664
  return /*#__PURE__*/React.createElement(Alert, {
664
665
  key: d.type,
665
666
  message: d.label,
@@ -107,7 +107,7 @@ var Info = function Info() {
107
107
  }
108
108
  }, d.id ? /*#__PURE__*/React.createElement("div", {
109
109
  className: "pisell-lowcode__booking-service-item-title"
110
- }, d.title) : null, d._extend ? /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
110
+ }, d.title) : null, d._extend ? /*#__PURE__*/React.createElement(React.Fragment, null, state.renderType !== 'eventBooking' && /*#__PURE__*/React.createElement("div", {
111
111
  className: "pisell-lowcode__booking-service-item-date"
112
112
  }, getServiceTime(d, state.date.value)), /*#__PURE__*/React.createElement("div", {
113
113
  className: "pisell-lowcode__booking-service-item-technician"
@@ -1,3 +1,6 @@
1
+ .pisell-lowcode__booking-service-wrap {
2
+ margin-top: 16px;
3
+ }
1
4
  .pisell-lowcode__booking-service-item {
2
5
  width: 100%;
3
6
  border-radius: 8px;
@@ -40,6 +40,7 @@ declare const _default: {
40
40
  'pisell2.text.add-notes': string;
41
41
  'pisell2.text.notes': string;
42
42
  'pisell2.text.new-appointment': string;
43
+ 'pisell2.text.enroll': string;
43
44
  'pisell2.text.add-products-successfully': string;
44
45
  'pisell2.text.add': string;
45
46
  'pisell2.text.created-successfully': string;
@@ -168,6 +169,7 @@ declare const _default: {
168
169
  'pisell2.text.add-notes': string;
169
170
  'pisell2.text.notes': string;
170
171
  'pisell2.text.new-appointment': string;
172
+ 'pisell2.text.enroll': string;
171
173
  'pisell2.text.add-products-successfully': string;
172
174
  'pisell2.text.refund': string;
173
175
  'pisell2.text.refund-amount': string;
@@ -291,6 +293,7 @@ declare const _default: {
291
293
  'pisell2.text.add-notes': string;
292
294
  'pisell2.text.notes': string;
293
295
  'pisell2.text.new-appointment': string;
296
+ 'pisell2.text.enroll': string;
294
297
  'pisell2.text.add-products-successfully': string;
295
298
  'pisell2.text.add': string;
296
299
  'pisell2.text.created-successfully': string;
@@ -40,6 +40,7 @@ export default {
40
40
  'pisell2.text.add-notes': 'Add Notes',
41
41
  'pisell2.text.notes': 'Notes',
42
42
  'pisell2.text.new-appointment': 'New appointment',
43
+ 'pisell2.text.enroll': 'Enroll',
43
44
  'pisell2.text.add-products-successfully': 'Add products successfully',
44
45
  'pisell2.text.add': 'Add',
45
46
  'pisell2.text.created-successfully': 'Appointment created',
@@ -183,6 +184,7 @@ export default {
183
184
  'pisell2.text.add-notes': '添加备注',
184
185
  'pisell2.text.notes': '备注',
185
186
  'pisell2.text.new-appointment': '新预约',
187
+ 'pisell2.text.enroll': '报名',
186
188
  'pisell2.text.add-products-successfully': '添加商品成功',
187
189
  'pisell2.text.refund': '退款',
188
190
  'pisell2.text.refund-amount': '退款金额',
@@ -326,6 +328,7 @@ export default {
326
328
  'pisell2.text.add-notes': '添加備注',
327
329
  'pisell2.text.notes': '備注',
328
330
  'pisell2.text.new-appointment': '新預約',
331
+ 'pisell2.text.enroll': '报名',
329
332
  'pisell2.text.add-products-successfully': '添加商品成功',
330
333
  //
331
334
  'pisell2.text.add': '添加',
@@ -70,6 +70,17 @@ export interface FormState {
70
70
  bookingId: string | number;
71
71
  bookingDetail: any;
72
72
  channelDisabledEdit: boolean;
73
+ renderType?: 'eventBooking';
74
+ eventOtherParams?: {
75
+ relation_id: number;
76
+ number: number;
77
+ registration_type: 'single' | 'all' | 'extra_include';
78
+ start_date: string;
79
+ start_time: string;
80
+ end_date: string;
81
+ end_time: string;
82
+ productIds: number[];
83
+ };
73
84
  }
74
85
  export declare const walkInData: {
75
86
  id: number;
@@ -443,6 +443,7 @@ export var deleteCacheParams = function deleteCacheParams() {
443
443
  * @Date: 2024-01-26 14:09
444
444
  */
445
445
  export var getServerItemExtend = function getServerItemExtend(state, cacheItem, timeObj) {
446
+ var _cacheItem$duration;
446
447
  // 编辑直接返回原数据
447
448
  if (!cacheItem.new && cacheItem._extend.endDate) {
448
449
  return cacheItem._extend;
@@ -453,7 +454,7 @@ export var getServerItemExtend = function getServerItemExtend(state, cacheItem,
453
454
 
454
455
  // 下一个商品的扩展参数
455
456
  var _extend = {
456
- duration: findNextDuration(cacheItem.duration, timeObj.durationSlicesBasedOnTime, cacheItem.duration.value)
457
+ duration: findNextDuration(cacheItem.duration, timeObj.durationSlicesBasedOnTime, cacheItem === null || cacheItem === void 0 ? void 0 : (_cacheItem$duration = cacheItem.duration) === null || _cacheItem$duration === void 0 ? void 0 : _cacheItem$duration.value)
457
458
  };
458
459
 
459
460
  // 如果有上一个商品, 将上一个商品的某些参数 设置到新商品上
@@ -5,4 +5,5 @@ import BookingNotes from './booking/notes';
5
5
  import BookingAddons from './booking/addons';
6
6
  import BookingForms from './booking/forms';
7
7
  import Schedules from './schedules';
8
- export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules };
8
+ import ProductExtension from './productExtension';
9
+ export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension };
@@ -5,4 +5,5 @@ import BookingNotes from "./booking/notes";
5
5
  import BookingAddons from "./booking/addons";
6
6
  import BookingForms from "./booking/forms";
7
7
  import Schedules from "./schedules";
8
- export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules };
8
+ import ProductExtension from "./productExtension";
9
+ export { Login, BookingInfo, Booking, BookingNotes, BookingAddons, BookingForms, Schedules, ProductExtension };
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ import "./index.less";
3
+ interface LmCardProps extends React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement> {
4
+ header: React.ReactNode;
5
+ headerClassName: string;
6
+ extra: React.ReactNode;
7
+ hidden?: boolean;
8
+ }
9
+ declare const LmCard: React.FC<Partial<LmCardProps>>;
10
+ export default LmCard;
@@ -0,0 +1,20 @@
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 _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; }
3
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
4
+ 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); }
5
+ import React from "react";
6
+ import classNames from "classnames";
7
+ import "./index.less";
8
+ var LmCard = function LmCard(props) {
9
+ return /*#__PURE__*/React.createElement("div", {
10
+ className: classNames("pisell_card", props.className, _defineProperty({}, "pisell_card-hidden", props.hidden)),
11
+ style: props.style
12
+ }, props.header ? /*#__PURE__*/React.createElement("div", {
13
+ className: "pisell_card-header"
14
+ }, /*#__PURE__*/React.createElement("div", {
15
+ className: classNames("pisell_card-title", props.headerClassName)
16
+ }, props.header), props.extra) : null, /*#__PURE__*/React.createElement("div", {
17
+ className: classNames("pisell_card-content")
18
+ }, props.children));
19
+ };
20
+ export default LmCard;
@@ -0,0 +1,34 @@
1
+ .pisell_card {
2
+ width: 100%;
3
+ background: #ffffff;
4
+ opacity: 1;
5
+ border-radius: 12px;
6
+ padding: 20px;
7
+ box-sizing: border-box;
8
+ margin-bottom: 20px;
9
+ // overflow: hidden;
10
+
11
+ &.pisell_card-hidden {
12
+ height: 0;
13
+ width: 0;
14
+ overflow: hidden;
15
+ padding: 0;
16
+ margin: 0
17
+ }
18
+
19
+ .pisell_card-header {
20
+ display: flex;
21
+ align-items: center;
22
+ justify-content: space-between;
23
+ margin-bottom: 20px;
24
+
25
+ .pisell_card-title {
26
+ height: 28px;
27
+ font-size: 16px;
28
+ // font-weight: 650;
29
+ line-height: 28px;
30
+ color: #252a2d;
31
+ font-weight: bold;
32
+ }
33
+ }
34
+ }
@@ -0,0 +1,12 @@
1
+ import React, { ReactElement } from "react";
2
+ import "./index.less";
3
+ interface ContainerProps {
4
+ title: string;
5
+ children: any;
6
+ desc: string | ReactElement;
7
+ isMargin: boolean;
8
+ hint: string | ReactElement;
9
+ hintProps: object;
10
+ }
11
+ declare const Container: React.FC<Partial<ContainerProps>>;
12
+ export default Container;
@@ -0,0 +1,34 @@
1
+ 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
+ import React from "react";
3
+ import { Tooltip } from "antd";
4
+ import { QuestionCircleOutlined } from "@ant-design/icons";
5
+ import "./index.less";
6
+ var Container = function Container(_ref) {
7
+ var title = _ref.title,
8
+ children = _ref.children,
9
+ desc = _ref.desc,
10
+ _ref$isMargin = _ref.isMargin,
11
+ isMargin = _ref$isMargin === void 0 ? false : _ref$isMargin,
12
+ hint = _ref.hint,
13
+ hintProps = _ref.hintProps;
14
+ return /*#__PURE__*/React.createElement("div", {
15
+ className: "pisell2_product-extension-container"
16
+ }, /*#__PURE__*/React.createElement("div", {
17
+ className: "pisell2_product-extension-container-title-wrap"
18
+ }, /*#__PURE__*/React.createElement("div", {
19
+ className: "pisell2_product-extension-container-title"
20
+ }, title), hint ? /*#__PURE__*/React.createElement(Tooltip, _extends({
21
+ title: hint
22
+ }, hintProps), /*#__PURE__*/React.createElement(QuestionCircleOutlined, {
23
+ style: {
24
+ marginLeft: 4,
25
+ cursor: "pointer"
26
+ }
27
+ })) : null), children, /*#__PURE__*/React.createElement("div", {
28
+ className: "pisell2_product-extension-container-desc",
29
+ style: {
30
+ marginBottom: isMargin ? "15px" : ""
31
+ }
32
+ }, desc));
33
+ };
34
+ export default Container;