@pisell/private-materials 3.0.152-gray → 3.0.152

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 (186) 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 +142 -142
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +12 -12
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +11 -11
  11. package/es/components/booking/addons/model.d.ts +1 -2
  12. package/es/components/booking/components/footer/index.js +51 -36
  13. package/es/components/booking/components/footer/utils.js +35 -4
  14. package/es/components/booking/forms/forms.d.ts +0 -1
  15. package/es/components/booking/forms/forms.js +2 -4
  16. package/es/components/booking/forms/model.d.ts +1 -2
  17. package/es/components/booking/forms/single/index.d.ts +1 -1
  18. package/es/components/booking/forms/single/index.js +3 -4
  19. package/es/components/booking/index.js +1 -1
  20. package/es/components/booking/info/index.d.ts +4 -12
  21. package/es/components/booking/info/index.js +12 -123
  22. package/es/components/booking/info/index.less +0 -9
  23. package/es/components/booking/info/main.d.ts +12 -0
  24. package/es/components/booking/info/main.js +124 -0
  25. package/es/components/booking/info/model.js +0 -1
  26. package/es/components/booking/info/pet/index.js +1 -1
  27. package/es/components/booking/info/service/addService/index.d.ts +2 -8
  28. package/es/components/booking/info/service/addService/index.js +36 -82
  29. package/es/components/booking/info/service/addService/index.less +1 -27
  30. package/es/components/booking/info/service/addTimeModal/index.js +4 -4
  31. package/es/components/booking/info/service/editService/index.js +13 -11
  32. package/es/components/booking/info/utils.d.ts +1 -0
  33. package/es/components/booking/info/utils.js +7 -0
  34. package/es/components/booking/info2/index.d.ts +12 -0
  35. package/es/components/booking/{dashboard → info2}/index.js +196 -222
  36. package/es/components/booking/info2/serve.d.ts +6 -0
  37. package/es/components/booking/info2/serve.js +79 -0
  38. package/es/components/booking/info2/service/actions/index.d.ts +6 -0
  39. package/es/components/booking/info2/service/actions/index.js +86 -0
  40. package/es/components/booking/info2/service/addService/index.d.ts +6 -0
  41. package/es/components/booking/info2/service/addService/index.js +404 -0
  42. package/es/components/booking/info2/service/addService/mock.d.ts +214 -0
  43. package/es/components/booking/info2/service/addService/mock.js +332 -0
  44. package/es/components/booking/info2/service/addService/utils.d.ts +71 -0
  45. package/es/components/booking/info2/service/addService/utils.js +510 -0
  46. package/es/components/booking/info2/service/addTimeModal/index.d.ts +4 -0
  47. package/es/components/booking/info2/service/addTimeModal/index.js +681 -0
  48. package/es/components/booking/info2/service/addTimeModal/serve.d.ts +9 -0
  49. package/es/components/booking/{dashboard → info2/service/addTimeModal}/serve.js +51 -5
  50. package/es/components/booking/info2/service/addTimeModal/utils.d.ts +31 -0
  51. package/es/components/booking/info2/service/addTimeModal/utils.js +176 -0
  52. package/es/components/booking/info2/service/editService/Capacity/index.d.ts +4 -0
  53. package/es/components/booking/info2/service/editService/Capacity/index.js +121 -0
  54. package/es/components/booking/info2/service/editService/Capacity/index.less +1 -0
  55. package/es/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.d.ts +7 -0
  56. package/es/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +28 -0
  57. package/es/components/booking/info2/service/editService/Resources/index.d.ts +4 -0
  58. package/es/components/booking/info2/service/editService/Resources/index.js +233 -0
  59. package/es/components/booking/info2/service/editService/Resources/index.less +21 -0
  60. package/es/components/booking/info2/service/editService/index.d.ts +7 -0
  61. package/es/components/booking/info2/service/editService/index.js +617 -0
  62. package/es/components/booking/info2/service/editService/index.less +99 -0
  63. package/es/components/booking/info2/service/editService/utils.d.ts +11 -0
  64. package/es/components/booking/{info/addServiceVariant/index.js → info2/service/editService/utils.js} +30 -26
  65. package/es/components/booking/info2/service/index.d.ts +4 -0
  66. package/es/components/booking/info2/service/index.js +55 -0
  67. package/es/components/booking/info2/service/serviceItem/index.d.ts +4 -0
  68. package/es/components/booking/info2/service/serviceItem/index.js +176 -0
  69. package/es/components/booking/info2/service/serviceItem/index.less +125 -0
  70. package/es/components/booking/info2/service/serviceList/index.d.ts +6 -0
  71. package/es/components/booking/info2/service/serviceList/index.js +106 -0
  72. package/es/components/booking/info2/service/serviceList/index.less +0 -0
  73. package/es/components/booking/info2/utilsByBooking.d.ts +34 -0
  74. package/es/components/booking/info2/utilsByBooking.js +349 -0
  75. package/es/components/booking/locales.d.ts +3 -48
  76. package/es/components/booking/locales.js +9 -48
  77. package/es/components/booking/materiels/resources/index.d.ts +2 -2
  78. package/es/components/booking/materiels/resources/index.js +11 -11
  79. package/es/components/booking/mock.d.ts +1 -0
  80. package/es/components/booking/mock.js +66 -0
  81. package/es/components/booking/model.d.ts +0 -2
  82. package/es/components/booking/notes/index.d.ts +1 -1
  83. package/es/components/booking/notes/model.d.ts +1 -2
  84. package/es/components/booking/payments/model.d.ts +1 -2
  85. package/es/components/booking/utils.d.ts +1 -1
  86. package/es/components/booking/utils.js +51 -54
  87. package/es/components/index.d.ts +1 -1
  88. package/es/components/index.js +1 -1
  89. package/es/components/schedules/index.d.ts +1 -1
  90. package/es/components/schedules/model.d.ts +1 -2
  91. package/es/index.d.ts +1 -3
  92. package/es/index.js +2 -4
  93. package/lib/components/booking/addons/model.d.ts +1 -2
  94. package/lib/components/booking/components/footer/index.js +31 -8
  95. package/lib/components/booking/components/footer/utils.js +29 -4
  96. package/lib/components/booking/forms/forms.d.ts +0 -1
  97. package/lib/components/booking/forms/forms.js +2 -5
  98. package/lib/components/booking/forms/model.d.ts +1 -2
  99. package/lib/components/booking/forms/single/index.d.ts +1 -1
  100. package/lib/components/booking/forms/single/index.js +2 -4
  101. package/lib/components/booking/index.js +2 -2
  102. package/lib/components/booking/info/client/index.js +8 -1
  103. package/lib/components/booking/info/index.d.ts +4 -12
  104. package/lib/components/booking/info/index.js +14 -118
  105. package/lib/components/booking/info/index.less +0 -9
  106. package/lib/components/booking/info/main.d.ts +12 -0
  107. package/lib/components/booking/info/main.js +152 -0
  108. package/lib/components/booking/info/pet/index.js +1 -2
  109. package/lib/components/booking/info/service/addService/index.d.ts +2 -8
  110. package/lib/components/booking/info/service/addService/index.js +29 -66
  111. package/lib/components/booking/info/service/addService/index.less +1 -27
  112. package/lib/components/booking/info/service/addTimeModal/index.js +1 -0
  113. package/lib/components/booking/info/service/editService/index.js +6 -9
  114. package/lib/components/booking/info/utils.d.ts +1 -0
  115. package/lib/components/booking/info/utils.js +9 -0
  116. package/lib/components/booking/info2/index.d.ts +12 -0
  117. package/lib/components/booking/info2/index.js +202 -0
  118. package/lib/components/booking/info2/serve.d.ts +6 -0
  119. package/lib/components/booking/{dashboard → info2}/serve.js +25 -5
  120. package/lib/components/booking/info2/service/actions/index.d.ts +6 -0
  121. package/lib/components/booking/info2/service/actions/index.js +102 -0
  122. package/lib/components/booking/info2/service/addService/index.d.ts +6 -0
  123. package/lib/components/booking/info2/service/addService/index.js +356 -0
  124. package/lib/components/booking/info2/service/addService/mock.d.ts +214 -0
  125. package/lib/components/booking/info2/service/addService/mock.js +398 -0
  126. package/lib/components/booking/info2/service/addService/utils.d.ts +71 -0
  127. package/lib/components/booking/info2/service/addService/utils.js +377 -0
  128. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +4 -0
  129. package/lib/components/booking/info2/service/addTimeModal/index.js +558 -0
  130. package/lib/components/booking/info2/service/addTimeModal/serve.d.ts +9 -0
  131. package/lib/components/booking/info2/service/addTimeModal/serve.js +45 -0
  132. package/lib/components/booking/info2/service/addTimeModal/utils.d.ts +31 -0
  133. package/lib/components/booking/info2/service/addTimeModal/utils.js +157 -0
  134. package/lib/components/booking/info2/service/editService/Capacity/index.d.ts +4 -0
  135. package/lib/components/booking/info2/service/editService/Capacity/index.js +97 -0
  136. package/lib/components/booking/info2/service/editService/Capacity/index.less +1 -0
  137. package/lib/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.d.ts +7 -0
  138. package/lib/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +54 -0
  139. package/lib/components/booking/info2/service/editService/Resources/index.d.ts +4 -0
  140. package/lib/components/booking/info2/service/editService/Resources/index.js +212 -0
  141. package/lib/components/booking/info2/service/editService/Resources/index.less +21 -0
  142. package/lib/components/booking/info2/service/editService/index.d.ts +7 -0
  143. package/lib/components/booking/info2/service/editService/index.js +483 -0
  144. package/lib/components/booking/info2/service/editService/index.less +99 -0
  145. package/lib/components/booking/info2/service/editService/utils.d.ts +11 -0
  146. package/lib/components/booking/info2/service/editService/utils.js +0 -0
  147. package/lib/components/booking/info2/service/index.d.ts +4 -0
  148. package/lib/components/booking/info2/service/index.js +75 -0
  149. package/lib/components/booking/info2/service/serviceItem/index.d.ts +4 -0
  150. package/lib/components/booking/info2/service/serviceItem/index.js +184 -0
  151. package/lib/components/booking/info2/service/serviceItem/index.less +125 -0
  152. package/lib/components/booking/info2/service/serviceList/index.d.ts +6 -0
  153. package/lib/components/booking/info2/service/serviceList/index.js +130 -0
  154. package/lib/components/booking/info2/service/serviceList/index.less +0 -0
  155. package/lib/components/booking/info2/utilsByBooking.d.ts +34 -0
  156. package/lib/components/booking/info2/utilsByBooking.js +257 -0
  157. package/lib/components/booking/locales.d.ts +3 -48
  158. package/lib/components/booking/locales.js +3 -48
  159. package/lib/components/booking/materiels/resources/index.d.ts +2 -2
  160. package/lib/components/booking/mock.d.ts +1 -0
  161. package/lib/components/booking/mock.js +67 -2
  162. package/lib/components/booking/model.d.ts +0 -2
  163. package/lib/components/booking/notes/index.d.ts +1 -1
  164. package/lib/components/booking/notes/model.d.ts +1 -2
  165. package/lib/components/booking/payments/model.d.ts +1 -2
  166. package/lib/components/booking/utils.d.ts +1 -1
  167. package/lib/components/booking/utils.js +22 -57
  168. package/lib/components/eftposPay/tyro/index.js +3 -1
  169. package/lib/components/index.d.ts +1 -1
  170. package/lib/components/index.js +1 -1
  171. package/lib/components/schedules/index.d.ts +1 -1
  172. package/lib/components/schedules/model.d.ts +1 -2
  173. package/lib/index.d.ts +1 -3
  174. package/lib/index.js +1 -7
  175. package/package.json +2 -2
  176. package/es/components/booking/dashboard/index.d.ts +0 -10
  177. package/es/components/booking/dashboard/serve.d.ts +0 -1
  178. package/es/components/booking/info/addServiceVariant/index.d.ts +0 -7
  179. package/lib/components/booking/dashboard/index.d.ts +0 -10
  180. package/lib/components/booking/dashboard/index.js +0 -225
  181. package/lib/components/booking/dashboard/serve.d.ts +0 -1
  182. package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -7
  183. package/lib/components/booking/info/addServiceVariant/index.js +0 -58
  184. package/lowcode/booking-dashboard/meta.ts +0 -130
  185. package/lowcode/booking-vertical-add-service/meta.ts +0 -124
  186. package/lowcode/vertical-add-service/meta.ts +0 -71
@@ -63,16 +63,13 @@ var shopList = [
63
63
  6848,
64
64
  6305
65
65
  ];
66
- var Info = (props) => {
66
+ var Info = ({ onEdit }) => {
67
67
  var _a, _b, _c, _d;
68
- const { onEdit, drawerProps, renderMode } = props;
69
68
  const [search, setSearch] = (0, import_react.useState)("");
70
- let { state, dispatch } = (0, import_react.useContext)(import_model.Context);
69
+ const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
71
70
  const [loading, setLoading] = (0, import_react.useState)(false);
72
71
  const searchRef = (0, import_react.useRef)();
73
72
  const context = (0, import_useEngineContext.default)();
74
- state = state || (props == null ? void 0 : props.state);
75
- dispatch = dispatch || (props == null ? void 0 : props.dispatch);
76
73
  import_utils3.request.setRequest(context.appHelper.utils.request);
77
74
  const setDefaultService = async (list) => {
78
75
  if (state.renderType !== "eventBooking") {
@@ -123,7 +120,7 @@ var Info = (props) => {
123
120
  }
124
121
  });
125
122
  };
126
- const getServices = async (params) => {
123
+ const getServices = async () => {
127
124
  var _a2;
128
125
  setLoading(true);
129
126
  let data = await state.apis.getServices({
@@ -137,10 +134,8 @@ var Info = (props) => {
137
134
  with_count: ["bundleGroup", "optionGroup"],
138
135
  order_by_string: "sort:desc",
139
136
  status: "published",
140
- ...state.isBookingCreatePage ? { schedule_date: params == null ? void 0 : params.schedule_date } : {
141
- _config: {
142
- useCache: true
143
- }
137
+ _config: {
138
+ useCache: true
144
139
  }
145
140
  });
146
141
  setLoading(false);
@@ -216,9 +211,6 @@ var Info = (props) => {
216
211
  cacheItem._id = (_a2 = state.service.cacheItem) == null ? void 0 : _a2._id;
217
212
  cacheItem.new = 0;
218
213
  }
219
- if (renderMode === "current") {
220
- cacheItem.currentDefaultTime = state.date.value.format("HH:mm");
221
- }
222
214
  cacheItem._extend = (0, import_utils2.getProductExtend)({ cacheItem, state });
223
215
  if (state.renderType === "eventBooking") {
224
216
  cacheItem.autoClose = false;
@@ -276,24 +268,12 @@ var Info = (props) => {
276
268
  setSearch("");
277
269
  }
278
270
  }, [state.service.addModal]);
279
- const currentDate = (0, import_react.useMemo)(() => {
280
- return state.date.value.format("YYYY-MM-DD");
281
- }, [state.date.value]);
282
- console.log(currentDate, "currentDate");
283
- (0, import_react.useEffect)(() => {
284
- if (renderMode === "current") {
285
- getServices({ schedule_date: currentDate });
286
- }
287
- }, [renderMode, currentDate]);
288
271
  (0, import_react.useEffect)(() => {
289
272
  if (state.renderType === "eventBooking" && state.modalOpen) {
290
273
  getServices();
291
274
  }
292
275
  }, [state.renderType, state.modalOpen]);
293
276
  const addButton = (0, import_react.useMemo)(() => {
294
- if (state.isBookingCreatePage) {
295
- return /* @__PURE__ */ import_react.default.createElement("div", { style: { height: 20 } });
296
- }
297
277
  if (state.renderType === "eventBooking") {
298
278
  return isService ? /* @__PURE__ */ import_react.default.createElement("div", { style: { height: 20 } }) : /* @__PURE__ */ import_react.default.createElement(
299
279
  import_addButton.default,
@@ -322,49 +302,12 @@ var Info = (props) => {
322
302
  state.service.value,
323
303
  loading
324
304
  ]);
325
- const isRenderCurrent = (0, import_react.useMemo)(() => {
326
- return renderMode === "current";
327
- }, [renderMode]);
328
305
  return (0, import_react.useMemo)(() => {
329
306
  var _a2, _b2;
330
- const header = /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-header" }, /* @__PURE__ */ import_react.default.createElement(
331
- import_antd.Input,
332
- {
333
- ref: searchRef,
334
- prefix: /* @__PURE__ */ import_react.default.createElement(import_SearchLg.default, null),
335
- style: { marginTop: 16, height: 44 },
336
- placeholder: import_utils4.locales.getText("pisell2.text.search"),
337
- allowClear: true,
338
- value: search,
339
- onChange: (e) => {
340
- setSearch(e.target.value);
341
- }
342
- }
343
- ));
344
- const content = /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-body" }, /* @__PURE__ */ import_react.default.createElement(
345
- import_TabProduct.default,
346
- {
347
- list: renderList,
348
- amountSymbol: state.amountSymbol,
349
- onChange: handleSelectProduct,
350
- scrollDom: isRenderCurrent ? ".pisell-lowcode__booking-vertical-add-service-wrap" : ".booking-server-wrap .pisell-lowcode-drawer-body "
351
- }
352
- ));
353
- if (renderMode === "current") {
354
- return /* @__PURE__ */ import_react.default.createElement(
355
- "div",
356
- {
357
- className: "pisell-lowcode__booking-vertical-add-service-wrap",
358
- style: { width: "100%", height: "100%", overflow: "auto" }
359
- },
360
- header,
361
- content
362
- );
363
- }
364
307
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, ((_b2 = (_a2 = state.service) == null ? void 0 : _a2.cacheItem) == null ? void 0 : _b2.autoClose) && /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { loading: true, active: true, round: true }), addButton, /* @__PURE__ */ import_react.default.createElement(
365
308
  import_drawer.default,
366
309
  {
367
- open: state.service.addModal && !state.isBookingCreatePage,
310
+ open: state.service.addModal,
368
311
  title: import_utils4.locales.getText("pisell2.text.select-service"),
369
312
  rootClassName: "booking-server-wrap",
370
313
  onClose: () => {
@@ -376,10 +319,30 @@ var Info = (props) => {
376
319
  }
377
320
  });
378
321
  },
379
- header,
380
- ...drawerProps || {}
322
+ header: /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-header" }, /* @__PURE__ */ import_react.default.createElement(
323
+ import_antd.Input,
324
+ {
325
+ ref: searchRef,
326
+ prefix: /* @__PURE__ */ import_react.default.createElement(import_SearchLg.default, null),
327
+ style: { marginTop: 16, height: 44 },
328
+ placeholder: import_utils4.locales.getText("pisell2.text.search"),
329
+ allowClear: true,
330
+ value: search,
331
+ onChange: (e) => {
332
+ setSearch(e.target.value);
333
+ }
334
+ }
335
+ ))
381
336
  },
382
- content
337
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-body" }, /* @__PURE__ */ import_react.default.createElement(
338
+ import_TabProduct.default,
339
+ {
340
+ list: renderList,
341
+ amountSymbol: state.amountSymbol,
342
+ onChange: handleSelectProduct,
343
+ scrollDom: ".booking-server-wrap .pisell-lowcode-drawer-body"
344
+ }
345
+ ))
383
346
  ));
384
347
  }, [
385
348
  (_d = (_c = state.service) == null ? void 0 : _c.cacheItem) == null ? void 0 : _d.autoClose,
@@ -3,33 +3,7 @@
3
3
  // border-bottom: 1px solid var(--gray-300, #D0D5DD);
4
4
  }
5
5
 
6
+
6
7
  .pisell-lowcode__booking-service-body {
7
8
  background: var(--gray-50, #F9FAFB);
8
- }
9
-
10
- .pisell-lowcode__booking-vertical-add-service-wrap {
11
- &::-webkit-scrollbar {
12
- display: none !important;
13
- }
14
- .pisell-lowcode__booking-service-header {
15
- background-color: #fff;
16
- top: 0;
17
- position: sticky;
18
- z-index: 2;
19
- padding: 16px !important;
20
- margin: 0;
21
- .pisell-lowcode-input-affix-wrapper {
22
- margin: 0 !important;
23
- }
24
- }
25
- .booking-category-list {
26
- padding: 0 16px !important;
27
- }
28
- .pisell-lowcode__booking-service-body {
29
- .booking-tab-product {
30
- .booking-tabs-wrap {
31
- top: 76px !important;
32
- }
33
- }
34
- }
35
9
  }
@@ -186,6 +186,7 @@ var AddTimeModal = () => {
186
186
  skip: 1,
187
187
  num: 500,
188
188
  open_quotation: 1,
189
+ status: "published",
189
190
  schedule_date: state.date.value.format("YYYY-MM-DD"),
190
191
  customer_id: (0, import_utils3.isWalkIn)((_b2 = (_a2 = state.client) == null ? void 0 : _a2.value) == null ? void 0 : _b2.id) ? void 0 : (_d2 = (_c2 = state.client) == null ? void 0 : _c2.value) == null ? void 0 : _d2.id,
191
192
  extension_type: ["product_add_time"],
@@ -117,7 +117,7 @@ var Info = (_, ref) => {
117
117
  } catch (err) {
118
118
  }
119
119
  }, [useDuration, flexibleOption]);
120
- const getResources = async (cacheItem, open) => {
120
+ const getResources = async (cacheItem) => {
121
121
  console.log("getResources2");
122
122
  try {
123
123
  let _list = state.service.resourcesOrigin || [];
@@ -142,7 +142,7 @@ var Info = (_, ref) => {
142
142
  }, 200);
143
143
  } else {
144
144
  setTimeout(() => {
145
- if (selectOpen === void 0 || open) {
145
+ if (selectOpen === void 0) {
146
146
  setSelectOpen(true);
147
147
  }
148
148
  }, 500);
@@ -265,12 +265,12 @@ var Info = (_, ref) => {
265
265
  }
266
266
  });
267
267
  });
268
- const setEditData = (0, import_ahooks.useMemoizedFn)((_cacheItem, open) => {
268
+ const setEditData = (0, import_ahooks.useMemoizedFn)((_cacheItem) => {
269
269
  let cacheItem = _cacheItem || state.service.cacheItem;
270
270
  let values = cacheItem._extend;
271
271
  form.setFieldsValue(values);
272
272
  if (state.renderType !== "eventBooking") {
273
- getResources(cacheItem, open);
273
+ getResources(_cacheItem);
274
274
  }
275
275
  });
276
276
  const isReason = (0, import_react.useMemo)(() => {
@@ -297,10 +297,7 @@ var Info = (_, ref) => {
297
297
  (_f = state.service.cacheItem) == null ? void 0 : _f.autoClose
298
298
  ]);
299
299
  (0, import_react.useEffect)(() => {
300
- if (state.isBookingCreatePage && state.service.editModal) {
301
- setEditData(null, true);
302
- }
303
- }, [state.service.editModal, state.isBookingCreatePage]);
300
+ }, [state.service.editModal]);
304
301
  (0, import_react.useEffect)(() => {
305
302
  getErrorMsg();
306
303
  }, [useResource, useStartTime, useDuration]);
@@ -436,7 +433,7 @@ var Info = (_, ref) => {
436
433
  });
437
434
  }
438
435
  },
439
- /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-body-edit" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form, { layout: "vertical", form, onFinish }, /* @__PURE__ */ import_react.default.createElement(import_antd.Row, { style: { width: "100%" }, gutter: [16, 0] }, /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 24 }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "product_name" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info-name-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info-name" }, ((_d2 = (_c2 = (_b2 = state.service) == null ? void 0 : _b2.cacheItem) == null ? void 0 : _c2._extend) == null ? void 0 : _d2.product_name) || "-"), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: handleEdit }, import_utils.locales.getText("pisell2.text.edit")), !state.isBookingCreatePage && /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: handleChange }, import_utils.locales.getText("pisell2.text.change"))), /* @__PURE__ */ import_react.default.createElement(
436
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-body-edit" }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form, { layout: "vertical", form, onFinish }, /* @__PURE__ */ import_react.default.createElement(import_antd.Row, { style: { width: "100%" }, gutter: [16, 0] }, /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 24 }, /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { name: "product_name" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info-name-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "current-service-info-name" }, ((_d2 = (_c2 = (_b2 = state.service) == null ? void 0 : _b2.cacheItem) == null ? void 0 : _c2._extend) == null ? void 0 : _d2.product_name) || "-"), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: handleEdit }, import_utils.locales.getText("pisell2.text.edit")), /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { onClick: handleChange }, import_utils.locales.getText("pisell2.text.change"))), /* @__PURE__ */ import_react.default.createElement(
440
437
  import_collapsibleList.default,
441
438
  {
442
439
  style: { marginTop: bundles.length ? "8px" : 0 },
@@ -21,3 +21,4 @@ export declare const isInterval: (time1: number, time2: number, interval?: numbe
21
21
  * @Date: 2024-08-13 19:36
22
22
  */
23
23
  export declare const formatServiceListByTime: (list: any[]) => any[];
24
+ export declare const isBooking4Shop: (shopId: number, renderType?: string) => boolean;
@@ -21,6 +21,7 @@ var utils_exports = {};
21
21
  __export(utils_exports, {
22
22
  formatServiceListByTime: () => formatServiceListByTime,
23
23
  getIsBundleOrCombination: () => getIsBundleOrCombination,
24
+ isBooking4Shop: () => isBooking4Shop,
24
25
  isInterval: () => isInterval,
25
26
  moveItemToFront: () => moveItemToFront,
26
27
  uniqueByField: () => uniqueByField
@@ -78,10 +79,18 @@ var formatServiceListByTime = (list) => {
78
79
  return list;
79
80
  }
80
81
  };
82
+ var isBooking4Shop = (shopId, renderType) => {
83
+ if (renderType === "eventBooking") {
84
+ return false;
85
+ }
86
+ const booking4Shops = [1350, 1401, 3013, 7154];
87
+ return booking4Shops.includes(shopId);
88
+ };
81
89
  // Annotate the CommonJS export names for ESM import in node:
82
90
  0 && (module.exports = {
83
91
  formatServiceListByTime,
84
92
  getIsBundleOrCombination,
93
+ isBooking4Shop,
85
94
  isInterval,
86
95
  moveItemToFront,
87
96
  uniqueByField
@@ -0,0 +1,12 @@
1
+ import '../info/index.less';
2
+ export interface InfoProps {
3
+ style: any;
4
+ globalState: any;
5
+ callback: any;
6
+ setGlobalState: any;
7
+ modules: any;
8
+ slot: any;
9
+ setState: any;
10
+ }
11
+ declare const Info: any;
12
+ export default Info;
@@ -0,0 +1,202 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/booking/info2/index.tsx
30
+ var info2_exports = {};
31
+ __export(info2_exports, {
32
+ default: () => info2_default
33
+ });
34
+ module.exports = __toCommonJS(info2_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_model = require("../info/model");
37
+ var import_client = __toESM(require("../info/client"));
38
+ var import_service = __toESM(require("./service"));
39
+ var import_pet = __toESM(require("../info/pet"));
40
+ var import_date = __toESM(require("../info/date"));
41
+ var import_footer = __toESM(require("../components/footer"));
42
+ var import_tabPane = __toESM(require("../components/tabPane"));
43
+ var import_addNote = __toESM(require("../notes/addNote"));
44
+ var import_header = __toESM(require("../info/header"));
45
+ var import_locales = __toESM(require("../locales"));
46
+ var import_utils = require("@pisell/utils");
47
+ var import_utils2 = require("../utils");
48
+ var import_utilsByBooking = require("./utilsByBooking");
49
+ var import_utilsByBooking2 = require("./utilsByBooking");
50
+ var import_serve = require("./serve");
51
+ var import_date2 = require("../info/date");
52
+ var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
53
+ var import_notes = __toESM(require("../info/notes"));
54
+ var import_info = require("../info/index.less");
55
+ var defaultModules = {
56
+ client: 1,
57
+ date: 1,
58
+ service: 1,
59
+ holder: 1,
60
+ note: 1
61
+ };
62
+ import_utils.locales.init(import_locales.default, localStorage.getItem("umi_locale") || "en");
63
+ var Info = (0, import_model.Provider)((props) => {
64
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
65
+ const { style, globalState, modules = defaultModules, slot } = props;
66
+ const modal = (0, import_react.useContext)(import_model.Context);
67
+ const context = (0, import_useEngineContext.default)();
68
+ import_utils2.request.setRequest(context.appHelper.utils.request);
69
+ const params = (0, import_react.useMemo)(() => {
70
+ var _a2, _b2, _c2, _d2;
71
+ return ((_d2 = (_c2 = (_b2 = (_a2 = modal.state) == null ? void 0 : _a2.bookingConfig) == null ? void 0 : _b2.config) == null ? void 0 : _c2.basic) == null ? void 0 : _d2.appointment_subject) || {};
72
+ }, [(_d = (_c = (_b = (_a = modal.state) == null ? void 0 : _a.bookingConfig) == null ? void 0 : _b.config) == null ? void 0 : _c.basic) == null ? void 0 : _d.appointment_subject]);
73
+ (0, import_react.useEffect)(() => {
74
+ document.body.id = "body";
75
+ if (props.setState) {
76
+ props.setState({
77
+ bookingFunctions: {
78
+ formatResource: import_utilsByBooking.formatResource,
79
+ getErrorList: import_utilsByBooking2.getErrorList,
80
+ sliceDayIntoFiveMinutes: import_utils2.sliceDayIntoFiveMinutes,
81
+ findNextDuration: import_utils2.findNextDuration,
82
+ flexibleObj: import_utils2.flexibleObj,
83
+ updateServiceDate: import_date2.updateServiceDate
84
+ }
85
+ });
86
+ }
87
+ }, []);
88
+ (0, import_react.useEffect)(() => {
89
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m;
90
+ const isFranchisee = (_d2 = (_c2 = (_b2 = (_a2 = context == null ? void 0 : context.appHelper) == null ? void 0 : _a2.utils) == null ? void 0 : _b2.businessUtils) == null ? void 0 : _c2.getAppByModal) == null ? void 0 : _d2.call(_c2, "franchisee");
91
+ modal.dispatch({
92
+ type: "setState",
93
+ payload: {
94
+ setGlobalState: props.setGlobalState,
95
+ ...globalState,
96
+ isTerminal: (_g2 = (_f2 = (_e2 = context == null ? void 0 : context.appHelper) == null ? void 0 : _e2.utils) == null ? void 0 : _f2.isTerminal) == null ? void 0 : _g2.call(_f2),
97
+ isFranchisee,
98
+ timezone: (_m = (_l2 = (_k2 = (_j2 = (_i2 = (_h2 = context == null ? void 0 : context.appHelper) == null ? void 0 : _h2.utils) == null ? void 0 : _i2.store) == null ? void 0 : _j2.getState()) == null ? void 0 : _k2.global) == null ? void 0 : _l2.globalConfig) == null ? void 0 : _m.timezone
99
+ }
100
+ });
101
+ }, [globalState]);
102
+ const addNote = (e) => {
103
+ modal.dispatch({
104
+ type: "setNotes",
105
+ payload: {
106
+ orderNote: e,
107
+ edit: true
108
+ }
109
+ });
110
+ };
111
+ const header = (0, import_react.useMemo)(() => {
112
+ if ((globalState == null ? void 0 : globalState.renderType) === "eventBooking") {
113
+ return import_utils.locales.getText("pisell2.text.enroll.detail");
114
+ }
115
+ return (globalState == null ? void 0 : globalState.bookingId) ? /* @__PURE__ */ import_react.default.createElement(import_header.default, { state: modal.state, dispatch: modal.dispatch }) : /* @__PURE__ */ import_react.default.createElement("div", { className: "", style: { height: 0 } });
116
+ }, [
117
+ globalState == null ? void 0 : globalState.bookingId,
118
+ modal.state,
119
+ modal.dispatch,
120
+ globalState == null ? void 0 : globalState.renderType
121
+ ]);
122
+ const notes = (0, import_react.useMemo)(() => {
123
+ var _a2, _b2;
124
+ if (!modules.note) {
125
+ return null;
126
+ }
127
+ return (globalState == null ? void 0 : globalState.bookingId) ? globalState.renderType === "eventBooking" ? /* @__PURE__ */ import_react.default.createElement(import_notes.default, null) : null : /* @__PURE__ */ import_react.default.createElement(import_addNote.default, { value: (_b2 = (_a2 = modal.state) == null ? void 0 : _a2.notes) == null ? void 0 : _b2.orderNote, onChange: addNote });
128
+ }, [
129
+ modules.note,
130
+ globalState == null ? void 0 : globalState.bookingId,
131
+ globalState.render,
132
+ (_f = (_e = modal.state) == null ? void 0 : _e.notes) == null ? void 0 : _f.orderNote
133
+ ]);
134
+ const currentDate = (0, import_react.useMemo)(() => {
135
+ var _a2, _b2;
136
+ if ((_b2 = (_a2 = modal.state) == null ? void 0 : _a2.date) == null ? void 0 : _b2.value) {
137
+ return modal.state.date.value.format("YYYY-MM-DD");
138
+ }
139
+ return null;
140
+ }, [(_i = (_h = (_g = modal.state) == null ? void 0 : _g.date) == null ? void 0 : _h.value) == null ? void 0 : _i.format("YYYY-MM-DD")]);
141
+ const getResourcesData = async () => {
142
+ let bookingResourceList = localStorage.getItem("bookingResourceList");
143
+ let timeoutNumber = 0;
144
+ if (bookingResourceList) {
145
+ bookingResourceList = JSON.parse(bookingResourceList);
146
+ if ((bookingResourceList == null ? void 0 : bookingResourceList.date) === currentDate) {
147
+ timeoutNumber = 200;
148
+ modal.dispatch({
149
+ type: "setService",
150
+ payload: {
151
+ resourcesOrigin: bookingResourceList.list || [],
152
+ resourcesOriginMap: bookingResourceList.listMap
153
+ }
154
+ });
155
+ }
156
+ }
157
+ try {
158
+ setTimeout(async () => {
159
+ let data = await (0, import_serve.getResourceList)({
160
+ date: currentDate
161
+ });
162
+ data.date = currentDate;
163
+ localStorage.setItem("bookingResourceList", JSON.stringify(data));
164
+ modal.dispatch({
165
+ type: "setService",
166
+ payload: {
167
+ resourcesOrigin: data.list || [],
168
+ resourcesOriginMap: data.listMap
169
+ }
170
+ });
171
+ }, timeoutNumber);
172
+ } catch (err) {
173
+ console.log(err, "err");
174
+ }
175
+ };
176
+ (0, import_react.useEffect)(() => {
177
+ if (currentDate) {
178
+ getResourcesData();
179
+ }
180
+ }, [currentDate]);
181
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, !!modal.state.setGlobalState ? /* @__PURE__ */ import_react.default.createElement(
182
+ import_tabPane.default,
183
+ {
184
+ style,
185
+ header,
186
+ footer: /* @__PURE__ */ import_react.default.createElement(
187
+ import_footer.default,
188
+ {
189
+ state: modal.state,
190
+ dispatch: modal.dispatch,
191
+ source: "info"
192
+ }
193
+ ),
194
+ style: {
195
+ height: ((_k = (_j = context == null ? void 0 : context.appHelper) == null ? void 0 : _j.utils) == null ? void 0 : _k.isMobile) ? "100%" : "100vh"
196
+ },
197
+ bodyClassName: "booking-info-warp"
198
+ },
199
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-info" }, modules.client ? /* @__PURE__ */ import_react.default.createElement(import_client.default, null) : null, modules.holder && !((_l = modal.state) == null ? void 0 : _l.disabledEdit) ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, params.type === "form" ? /* @__PURE__ */ import_react.default.createElement(import_pet.default, null) : null) : null, modules.date ? /* @__PURE__ */ import_react.default.createElement(import_date.default, null) : null, modules.service ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, modal.state.date.value ? /* @__PURE__ */ import_react.default.createElement(import_service.default, null) : null) : null, notes, slot ? slot : null)
200
+ ) : null);
201
+ });
202
+ var info2_default = Info;
@@ -0,0 +1,6 @@
1
+ export declare const getResourceList: (params: any) => Promise<{
2
+ list: any;
3
+ listMap: any;
4
+ }>;
5
+ export declare const createBookings: (params: any) => Promise<any>;
6
+ export declare const editBookings: (params: any, id?: number) => Promise<any>;
@@ -16,18 +16,38 @@ var __copyProps = (to, from, except, desc) => {
16
16
  };
17
17
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
18
18
 
19
- // src/components/booking/dashboard/serve.ts
19
+ // src/components/booking/info2/serve.ts
20
20
  var serve_exports = {};
21
21
  __export(serve_exports, {
22
- getBookingList: () => getBookingList
22
+ createBookings: () => createBookings,
23
+ editBookings: () => editBookings,
24
+ getResourceList: () => getResourceList
23
25
  });
24
26
  module.exports = __toCommonJS(serve_exports);
25
27
  var import_utils = require("../utils");
26
- var getBookingList = async (params) => {
27
- let { data } = await import_utils.request.getRequest().get(`/shop/schedule/booking`, params);
28
+ var import_mock = require("../mock");
29
+ var getResourceList = async (params) => {
30
+ let { data } = await import_utils.request.getRequest().get(`/shop/schedule/resource/list`, params);
31
+ const resourceList = (data || {}).concat([(0, import_mock.getNoResource2)({})]);
32
+ return {
33
+ list: resourceList,
34
+ listMap: resourceList.reduce((prev, item) => {
35
+ prev[item.id] = item;
36
+ return prev;
37
+ }, {})
38
+ };
39
+ };
40
+ var createBookings = async (params) => {
41
+ let { data } = await import_utils.request.getRequest().post(`/shop/v1.1/order/appointment`, params);
42
+ return data;
43
+ };
44
+ var editBookings = async (params, id) => {
45
+ let { data } = await import_utils.request.getRequest().put(`/shop/v1.1/order/appointment/${id}`, params);
28
46
  return data;
29
47
  };
30
48
  // Annotate the CommonJS export names for ESM import in node:
31
49
  0 && (module.exports = {
32
- getBookingList
50
+ createBookings,
51
+ editBookings,
52
+ getResourceList
33
53
  });
@@ -0,0 +1,6 @@
1
+ import React from 'react';
2
+ import '../../../info/service/actions/index.less';
3
+ declare const Actions: ({ currentService }: {
4
+ currentService: any;
5
+ }) => React.JSX.Element;
6
+ export default Actions;
@@ -0,0 +1,102 @@
1
+ var __create = Object.create;
2
+ var __defProp = Object.defineProperty;
3
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
+ var __getOwnPropNames = Object.getOwnPropertyNames;
5
+ var __getProtoOf = Object.getPrototypeOf;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __export = (target, all) => {
8
+ for (var name in all)
9
+ __defProp(target, name, { get: all[name], enumerable: true });
10
+ };
11
+ var __copyProps = (to, from, except, desc) => {
12
+ if (from && typeof from === "object" || typeof from === "function") {
13
+ for (let key of __getOwnPropNames(from))
14
+ if (!__hasOwnProp.call(to, key) && key !== except)
15
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
+ }
17
+ return to;
18
+ };
19
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
+ // If the importer is in node compatibility mode or this is not an ESM
21
+ // file that has been converted to a CommonJS file using a Babel-
22
+ // compatible transform (i.e. "__esModule" has not been set), then set
23
+ // "default" to the CommonJS "module.exports" for node compatibility.
24
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
+ mod
26
+ ));
27
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
+
29
+ // src/components/booking/info2/service/actions/index.tsx
30
+ var actions_exports = {};
31
+ __export(actions_exports, {
32
+ default: () => actions_default
33
+ });
34
+ module.exports = __toCommonJS(actions_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_model = require("../../../info/model");
37
+ var import_antd = require("antd");
38
+ var import_utils = require("../../../utils");
39
+ var import_utils2 = require("../addTimeModal/utils");
40
+ var import_utils3 = require("../../service/addService/utils");
41
+ var import_actions = require("../../../info/service/actions/index.less");
42
+ var import_utils4 = require("@pisell/utils");
43
+ var Actions = ({ currentService }) => {
44
+ var _a, _b;
45
+ const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
46
+ const appointment_card = (0, import_react.useMemo)(() => {
47
+ var _a2, _b2, _c;
48
+ return ((_c = (_b2 = (_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.information_tab) == null ? void 0 : _c.appointment_card) || {
49
+ quick_time: 1
50
+ };
51
+ }, [(_b = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.information_tab]);
52
+ const onAddTime = () => {
53
+ let cacheItem = (0, import_utils3.getProductExtend)({
54
+ cacheItem: { ...currentService, new: 0 },
55
+ state
56
+ });
57
+ dispatch({
58
+ type: "setService",
59
+ payload: {
60
+ addTimeModal: true,
61
+ cacheItem
62
+ }
63
+ });
64
+ };
65
+ const addTimeProducts = (0, import_react.useMemo)(() => {
66
+ return (state.addTimeProducts || []).some(
67
+ (item) => (0, import_utils2.isUsableProduct)(item.add_time, currentService)
68
+ );
69
+ }, [state.addTimeProducts, currentService]);
70
+ const showAddTimeButton = (0, import_react.useMemo)(() => {
71
+ if (state.renderType === "eventBooking") {
72
+ return false;
73
+ }
74
+ if (state.disabledEdit) {
75
+ return false;
76
+ }
77
+ if (appointment_card.quick_time !== 1) {
78
+ return false;
79
+ }
80
+ if ((0, import_utils.getIsEdit)(state)) {
81
+ return false;
82
+ }
83
+ if (!addTimeProducts) {
84
+ return false;
85
+ }
86
+ return true;
87
+ }, [state, appointment_card.quick_time, addTimeProducts]);
88
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "actions-wrap" }, showAddTimeButton && /* @__PURE__ */ import_react.default.createElement(
89
+ import_antd.Button,
90
+ {
91
+ className: "action-item",
92
+ size: "large",
93
+ onClick: (e) => {
94
+ e.preventDefault();
95
+ e.stopPropagation();
96
+ onAddTime();
97
+ }
98
+ },
99
+ import_utils4.locales.getText("page.booking.text.add-time")
100
+ ));
101
+ };
102
+ var actions_default = Actions;