@pisell/private-materials 3.0.162 → 3.0.164

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 (114) 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 +10 -10
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +11 -11
  11. package/es/components/booking/components/footer/index.js +34 -5
  12. package/es/components/booking/dashboard/index.d.ts +20 -0
  13. package/es/components/booking/dashboard/index.js +298 -0
  14. package/es/components/booking/dashboard/serve.d.ts +1 -0
  15. package/es/components/booking/dashboard/serve.js +27 -0
  16. package/es/components/booking/forms/forms.d.ts +1 -0
  17. package/es/components/booking/forms/forms.js +4 -2
  18. package/es/components/booking/forms/single/index.d.ts +1 -1
  19. package/es/components/booking/forms/single/index.js +4 -3
  20. package/es/components/booking/hooks/useClearCart.d.ts +3 -0
  21. package/es/components/booking/hooks/useClearCart.js +27 -0
  22. package/es/components/booking/hooks/useCreateBookingPageHeader.d.ts +6 -0
  23. package/es/components/booking/hooks/useCreateBookingPageHeader.js +21 -0
  24. package/es/components/booking/info/addServiceVariant/index.d.ts +7 -0
  25. package/es/components/booking/info/addServiceVariant/index.js +42 -0
  26. package/es/components/booking/info/client/index.js +1 -1
  27. package/es/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +1 -0
  28. package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +4 -2
  29. package/es/components/booking/info/clientVariant/vertical/index.js +6 -5
  30. package/es/components/booking/info/clientVariant/vertical/index.less +8 -0
  31. package/es/components/booking/info/index.less +19 -0
  32. package/es/components/booking/info/main.js +11 -5
  33. package/es/components/booking/info/pet/index.js +1 -1
  34. package/es/components/booking/info/service/addService/index.d.ts +9 -3
  35. package/es/components/booking/info/service/addService/index.js +82 -36
  36. package/es/components/booking/info/service/addService/index.less +27 -1
  37. package/es/components/booking/info/service/editService/index.js +11 -13
  38. package/es/components/booking/info/service/index.js +5 -2
  39. package/es/components/booking/info/service/index.less +18 -0
  40. package/es/components/booking/info/service/serviceItem/index.d.ts +3 -3
  41. package/es/components/booking/info/service/serviceItem/index.js +22 -8
  42. package/es/components/booking/info/service/serviceItem/index.less +8 -0
  43. package/es/components/booking/info/service/serviceList/index.js +20 -1
  44. package/es/components/booking/info2/index.js +9 -3
  45. package/es/components/booking/info2/service/addService/index.d.ts +8 -2
  46. package/es/components/booking/info2/service/addService/index.js +82 -36
  47. package/es/components/booking/info2/service/addTimeModal/index.js +1 -0
  48. package/es/components/booking/info2/service/editService/index.js +11 -4
  49. package/es/components/booking/info2/service/index.js +5 -2
  50. package/es/components/booking/info2/service/serviceItem/index.d.ts +1 -1
  51. package/es/components/booking/info2/service/serviceItem/index.js +16 -3
  52. package/es/components/booking/info2/service/serviceList/index.js +20 -1
  53. package/es/components/booking/info2/utilsByBooking.js +6 -2
  54. package/es/components/booking/locales.d.ts +60 -0
  55. package/es/components/booking/locales.js +63 -3
  56. package/es/components/booking/model.d.ts +2 -0
  57. package/es/components/booking/utils.d.ts +1 -1
  58. package/es/components/booking/utils.js +54 -51
  59. package/es/index.d.ts +2 -0
  60. package/es/index.js +3 -1
  61. package/lib/components/booking/components/footer/index.js +30 -5
  62. package/lib/components/booking/dashboard/index.d.ts +20 -0
  63. package/lib/components/booking/dashboard/index.js +279 -0
  64. package/lib/components/booking/dashboard/serve.d.ts +1 -0
  65. package/lib/components/booking/dashboard/serve.js +33 -0
  66. package/lib/components/booking/forms/forms.d.ts +1 -0
  67. package/lib/components/booking/forms/forms.js +5 -2
  68. package/lib/components/booking/forms/single/index.d.ts +1 -1
  69. package/lib/components/booking/forms/single/index.js +4 -2
  70. package/lib/components/booking/hooks/useClearCart.d.ts +3 -0
  71. package/lib/components/booking/hooks/useClearCart.js +62 -0
  72. package/lib/components/booking/hooks/useCreateBookingPageHeader.d.ts +6 -0
  73. package/lib/components/booking/hooks/useCreateBookingPageHeader.js +53 -0
  74. package/lib/components/booking/info/addServiceVariant/index.d.ts +7 -0
  75. package/lib/components/booking/info/addServiceVariant/index.js +70 -0
  76. package/lib/components/booking/info/client/index.js +1 -1
  77. package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +1 -0
  78. package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +4 -2
  79. package/lib/components/booking/info/clientVariant/vertical/index.js +88 -76
  80. package/lib/components/booking/info/clientVariant/vertical/index.less +8 -0
  81. package/lib/components/booking/info/index.less +19 -0
  82. package/lib/components/booking/info/main.js +9 -3
  83. package/lib/components/booking/info/pet/index.js +2 -1
  84. package/lib/components/booking/info/service/addService/index.d.ts +9 -3
  85. package/lib/components/booking/info/service/addService/index.js +66 -29
  86. package/lib/components/booking/info/service/addService/index.less +27 -1
  87. package/lib/components/booking/info/service/editService/index.js +9 -6
  88. package/lib/components/booking/info/service/index.js +4 -2
  89. package/lib/components/booking/info/service/index.less +18 -0
  90. package/lib/components/booking/info/service/serviceItem/index.d.ts +3 -3
  91. package/lib/components/booking/info/service/serviceItem/index.js +15 -1
  92. package/lib/components/booking/info/service/serviceItem/index.less +8 -0
  93. package/lib/components/booking/info/service/serviceList/index.js +18 -1
  94. package/lib/components/booking/info2/index.js +8 -2
  95. package/lib/components/booking/info2/service/addService/index.d.ts +8 -2
  96. package/lib/components/booking/info2/service/addService/index.js +66 -29
  97. package/lib/components/booking/info2/service/addTimeModal/index.js +1 -0
  98. package/lib/components/booking/info2/service/editService/index.js +7 -1
  99. package/lib/components/booking/info2/service/index.js +4 -2
  100. package/lib/components/booking/info2/service/serviceItem/index.d.ts +1 -1
  101. package/lib/components/booking/info2/service/serviceItem/index.js +14 -1
  102. package/lib/components/booking/info2/service/serviceList/index.js +18 -1
  103. package/lib/components/booking/info2/utilsByBooking.js +5 -1
  104. package/lib/components/booking/locales.d.ts +60 -0
  105. package/lib/components/booking/locales.js +63 -3
  106. package/lib/components/booking/model.d.ts +2 -0
  107. package/lib/components/booking/utils.d.ts +1 -1
  108. package/lib/components/booking/utils.js +57 -22
  109. package/lib/index.d.ts +2 -0
  110. package/lib/index.js +6 -0
  111. package/lowcode/booking-dashboard/meta.ts +137 -0
  112. package/lowcode/booking-vertical-add-service/meta.ts +124 -0
  113. package/lowcode/vertical-add-service/meta.ts +71 -0
  114. package/package.json +3 -3
@@ -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 {
@@ -60,6 +60,22 @@ var ServiceList = ({ onEdit }) => {
60
60
  });
61
61
  onEdit == null ? void 0 : onEdit({ ...item, new: 0 });
62
62
  };
63
+ const handleDeleteService = (item) => {
64
+ if (state.disabledEdit || state.disableEventBookingEdit || state.channelDisabledEdit) {
65
+ return;
66
+ }
67
+ let _list = [...state.service.value];
68
+ _list = _list.filter((d) => d._id !== item._id);
69
+ dispatch({
70
+ type: "setService",
71
+ payload: {
72
+ editModal: false,
73
+ value: _list,
74
+ edit: true,
75
+ cacheItem: null
76
+ }
77
+ });
78
+ };
63
79
  const getResourceItem = (0, import_react.useCallback)(
64
80
  (id) => {
65
81
  if (id === 0) {
@@ -123,7 +139,8 @@ var ServiceList = ({ onEdit }) => {
123
139
  d,
124
140
  handleEditService,
125
141
  state,
126
- handleLike
142
+ handleLike,
143
+ handleDeleteService
127
144
  }
128
145
  );
129
146
  }));
@@ -53,6 +53,8 @@ var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext")
53
53
  var import_notes = __toESM(require("../info/notes"));
54
54
  var import_info = require("../info/index.less");
55
55
  var import_antd = require("antd");
56
+ var import_classnames = __toESM(require("classnames"));
57
+ var import_useCreateBookingPageHeader = __toESM(require("../hooks/useCreateBookingPageHeader"));
56
58
  var defaultModules = {
57
59
  client: 1,
58
60
  date: 1,
@@ -71,6 +73,7 @@ var Info = (0, import_model.Provider)((props) => {
71
73
  var _a2, _b2, _c2, _d2;
72
74
  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) || {};
73
75
  }, [(_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]);
76
+ const { createHeader, isBookingCreatePage, isBookingCreatePageCreateMode } = (0, import_useCreateBookingPageHeader.default)(globalState);
74
77
  (0, import_react.useEffect)(() => {
75
78
  document.body.id = "body";
76
79
  if (props.setState) {
@@ -195,9 +198,12 @@ var Info = (0, import_model.Provider)((props) => {
195
198
  style: {
196
199
  height: ((_k = (_j = context == null ? void 0 : context.appHelper) == null ? void 0 : _j.utils) == null ? void 0 : _k.isMobile) ? "100%" : "100vh"
197
200
  },
198
- bodyClassName: "booking-info-warp"
201
+ bodyClassName: (0, import_classnames.default)("booking-info-warp", {
202
+ ["create-booking-page-info-wrap"]: isBookingCreatePage,
203
+ ["create-booking-page-info-wrap-create"]: isBookingCreatePageCreateMode
204
+ })
199
205
  },
200
- /* @__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, /* @__PURE__ */ import_react.default.createElement(
206
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-info" }, createHeader, 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, /* @__PURE__ */ import_react.default.createElement(
201
207
  import_antd.Skeleton,
202
208
  {
203
209
  loading: globalState.loading,
@@ -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
- declare const Info: ({ onEdit }: {
4
+ interface AddServiceProps {
4
5
  onEdit: any;
5
- }) => React.JSX.Element;
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;
@@ -63,13 +63,16 @@ var shopList = [
63
63
  6848,
64
64
  6305
65
65
  ];
66
- var Info = ({ onEdit }) => {
66
+ var Info = (props) => {
67
67
  var _a, _b, _c, _d;
68
+ const { onEdit, drawerProps, renderMode } = props;
68
69
  const [search, setSearch] = (0, import_react.useState)("");
69
- const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
70
+ let { state, dispatch } = (0, import_react.useContext)(import_model.Context);
70
71
  const [loading, setLoading] = (0, import_react.useState)(false);
71
72
  const searchRef = (0, import_react.useRef)();
72
73
  const context = (0, import_useEngineContext.default)();
74
+ state = state || (props == null ? void 0 : props.state);
75
+ dispatch = dispatch || (props == null ? void 0 : props.dispatch);
73
76
  import_utils3.request.setRequest(context.appHelper.utils.request);
74
77
  const setDefaultService = async (list) => {
75
78
  if (state.renderType !== "eventBooking") {
@@ -120,7 +123,7 @@ var Info = ({ onEdit }) => {
120
123
  }
121
124
  });
122
125
  };
123
- const getServices = async () => {
126
+ const getServices = async (params) => {
124
127
  var _a2;
125
128
  setLoading(true);
126
129
  let data = await state.apis.getServices({
@@ -134,8 +137,10 @@ var Info = ({ onEdit }) => {
134
137
  with_count: ["bundleGroup", "optionGroup"],
135
138
  order_by_string: "sort:desc",
136
139
  status: "published",
137
- _config: {
138
- useCache: true
140
+ ...state.isBookingCreatePage ? { schedule_date: params == null ? void 0 : params.schedule_date } : {
141
+ _config: {
142
+ useCache: true
143
+ }
139
144
  }
140
145
  });
141
146
  setLoading(false);
@@ -210,6 +215,9 @@ var Info = ({ onEdit }) => {
210
215
  cacheItem._id = (_a2 = state.service.cacheItem) == null ? void 0 : _a2._id;
211
216
  cacheItem.new = 0;
212
217
  }
218
+ if (renderMode === "current") {
219
+ cacheItem.currentDefaultTime = state.date.value.format("HH:mm");
220
+ }
213
221
  cacheItem = (0, import_utils2.getProductExtend)({ cacheItem, state });
214
222
  if (state.renderType === "eventBooking") {
215
223
  cacheItem.autoClose = false;
@@ -277,12 +285,23 @@ var Info = ({ onEdit }) => {
277
285
  setSearch("");
278
286
  }
279
287
  }, [state.service.addModal]);
288
+ const currentDate = (0, import_react.useMemo)(() => {
289
+ return state.date.value.format("YYYY-MM-DD");
290
+ }, [state.date.value]);
291
+ (0, import_react.useEffect)(() => {
292
+ if (renderMode === "current") {
293
+ getServices({ schedule_date: currentDate });
294
+ }
295
+ }, [renderMode, currentDate]);
280
296
  (0, import_react.useEffect)(() => {
281
297
  if (state.renderType === "eventBooking" && state.modalOpen) {
282
298
  getServices();
283
299
  }
284
300
  }, [state.renderType, state.modalOpen]);
285
301
  const addButton = (0, import_react.useMemo)(() => {
302
+ if (state.isBookingCreatePage) {
303
+ return /* @__PURE__ */ import_react.default.createElement("div", { style: { height: 20 } });
304
+ }
286
305
  if (state.renderType === "eventBooking") {
287
306
  return isService ? /* @__PURE__ */ import_react.default.createElement("div", { style: { height: 20 } }) : /* @__PURE__ */ import_react.default.createElement(
288
307
  import_addButton.default,
@@ -311,10 +330,48 @@ var Info = ({ onEdit }) => {
311
330
  state.service.value,
312
331
  loading
313
332
  ]);
333
+ const isRenderCurrent = (0, import_react.useMemo)(() => {
334
+ return renderMode === "current";
335
+ }, [renderMode]);
336
+ const header = /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-header" }, /* @__PURE__ */ import_react.default.createElement(
337
+ import_antd.Input,
338
+ {
339
+ ref: searchRef,
340
+ prefix: /* @__PURE__ */ import_react.default.createElement(import_SearchLg.default, null),
341
+ style: { marginTop: 16, height: 44 },
342
+ placeholder: import_utils4.locales.getText("pisell2.text.search"),
343
+ allowClear: true,
344
+ value: search,
345
+ onChange: (e) => {
346
+ setSearch(e.target.value);
347
+ }
348
+ }
349
+ ));
350
+ const content = /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-body" }, /* @__PURE__ */ import_react.default.createElement(
351
+ import_TabProduct.default,
352
+ {
353
+ list: renderList,
354
+ amountSymbol: state.amountSymbol,
355
+ onChange: handleSelectProduct,
356
+ scrollDom: isRenderCurrent ? ".pisell-lowcode__booking-vertical-add-service-wrap" : ".booking-server-wrap .pisell-lowcode-drawer-body "
357
+ }
358
+ ));
359
+ if (isRenderCurrent) {
360
+ return /* @__PURE__ */ import_react.default.createElement(
361
+ "div",
362
+ {
363
+ className: "pisell-lowcode__booking-vertical-add-service-wrap",
364
+ style: { width: "100%", height: "100%", overflow: "auto" }
365
+ },
366
+ header,
367
+ content
368
+ );
369
+ }
314
370
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, ((_d = (_c = state.service) == null ? void 0 : _c.cacheItem) == null ? void 0 : _d.autoClose) && /* @__PURE__ */ import_react.default.createElement(import_antd.Skeleton, { loading: true, active: true, round: true }), addButton, /* @__PURE__ */ import_react.default.createElement(
315
371
  import_drawer.default,
316
372
  {
317
- open: state.service.addModal,
373
+ titleNoWrap: true,
374
+ open: state.service.addModal && !state.isBookingCreatePage,
318
375
  title: import_utils4.locales.getText("pisell2.text.select-service"),
319
376
  rootClassName: "booking-server-wrap",
320
377
  onClose: () => {
@@ -326,30 +383,10 @@ var Info = ({ onEdit }) => {
326
383
  }
327
384
  });
328
385
  },
329
- header: /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-header" }, /* @__PURE__ */ import_react.default.createElement(
330
- import_antd.Input,
331
- {
332
- ref: searchRef,
333
- prefix: /* @__PURE__ */ import_react.default.createElement(import_SearchLg.default, null),
334
- style: { marginTop: 16, height: 44 },
335
- placeholder: import_utils4.locales.getText("pisell2.text.search"),
336
- allowClear: true,
337
- value: search,
338
- onChange: (e) => {
339
- setSearch(e.target.value);
340
- }
341
- }
342
- ))
386
+ header,
387
+ ...drawerProps || {}
343
388
  },
344
- /* @__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: ".booking-server-wrap .pisell-lowcode-drawer-body"
351
- }
352
- ))
389
+ content
353
390
  ));
354
391
  };
355
392
  var addService_default = Info;
@@ -451,6 +451,7 @@ var AddTimeModal = () => {
451
451
  return /* @__PURE__ */ import_react.default.createElement(
452
452
  import_drawer.default,
453
453
  {
454
+ titleNoWrap: true,
454
455
  open: state.service.addTimeModal,
455
456
  title: import_utils.locales.getText("page.booking.text.add-time"),
456
457
  rootClassName: "booking-server-wrap",
@@ -262,6 +262,11 @@ var Info = (_, ref) => {
262
262
  state.renderType,
263
263
  state.service.resourcesOrigin
264
264
  ]);
265
+ (0, import_react.useEffect)(() => {
266
+ if (state.isBookingCreatePage && state.service.editModal) {
267
+ setEditData(null);
268
+ }
269
+ }, [state.service.editModal, state.isBookingCreatePage]);
265
270
  (0, import_react.useEffect)(() => {
266
271
  getDiscount();
267
272
  }, [useTotal, (_i = (_h = state.service.cacheItem) == null ? void 0 : _h._extend) == null ? void 0 : _i.origin_total]);
@@ -347,6 +352,7 @@ var Info = (_, ref) => {
347
352
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
348
353
  import_drawer.default,
349
354
  {
355
+ titleNoWrap: true,
350
356
  zIndex: state.service.changeService ? 999 : 1e3,
351
357
  forceRender: true,
352
358
  open: state.service.editModal && !((_q = state.service.cacheItem) == null ? void 0 : _q.autoClose),
@@ -362,7 +368,7 @@ var Info = (_, ref) => {
362
368
  });
363
369
  }
364
370
  },
365
- /* @__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" }, ((_t = (_s = (_r = state.service) == null ? void 0 : _r.cacheItem) == null ? void 0 : _s._extend) == null ? void 0 : _t.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(
371
+ /* @__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" }, ((_t = (_s = (_r = state.service) == null ? void 0 : _r.cacheItem) == null ? void 0 : _s._extend) == null ? void 0 : _t.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(
366
372
  import_collapsibleList.default,
367
373
  {
368
374
  style: { marginTop: bundles.length ? "8px" : 0 },
@@ -39,9 +39,10 @@ var import_editService = __toESM(require("./editService"));
39
39
  var import_service = require("../../info/service/index.less");
40
40
  var import_serviceList = __toESM(require("./serviceList"));
41
41
  var import_addTimeModal = __toESM(require("./addTimeModal"));
42
+ var import_useClearCart = __toESM(require("../../hooks/useClearCart"));
42
43
  var Service = () => {
43
44
  var _a, _b;
44
- const { state } = (0, import_react.useContext)(import_model.Context);
45
+ const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
45
46
  const detailRef = (0, import_react.useRef)();
46
47
  (0, import_react.useEffect)(() => {
47
48
  document.body.id = "body";
@@ -70,6 +71,7 @@ var Service = () => {
70
71
  (_b2 = (_a2 = detailRef.current) == null ? void 0 : _a2.init) == null ? void 0 : _b2.call(_a2, cacheItem);
71
72
  }, 100);
72
73
  };
73
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-wrap" }, /* @__PURE__ */ import_react.default.createElement(import_serviceList.default, { onEdit: handleEdit }), /* @__PURE__ */ import_react.default.createElement(import_addService.default, { onEdit: handleEdit })), /* @__PURE__ */ import_react.default.createElement(import_editService.default, { ref: detailRef }), showAddTimeModal && /* @__PURE__ */ import_react.default.createElement(import_addTimeModal.default, null));
74
+ const clearCart = (0, import_useClearCart.default)(state, dispatch);
75
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-wrap" }, clearCart, /* @__PURE__ */ import_react.default.createElement(import_serviceList.default, { onEdit: handleEdit }), /* @__PURE__ */ import_react.default.createElement(import_addService.default, { onEdit: handleEdit })), /* @__PURE__ */ import_react.default.createElement(import_editService.default, { ref: detailRef }), showAddTimeModal && /* @__PURE__ */ import_react.default.createElement(import_addTimeModal.default, null));
74
76
  };
75
77
  var service_default = import_react.default.memo(Service);
@@ -1,4 +1,4 @@
1
1
  import React from 'react';
2
2
  import './index.less';
3
- declare const ServiceItem: ({ d, handleEditService, state, handleLike, errorMessage, }: any) => React.JSX.Element;
3
+ declare const ServiceItem: ({ d, handleEditService, state, handleLike, errorMessage, handleDeleteService, }: any) => React.JSX.Element;
4
4
  export default ServiceItem;
@@ -41,6 +41,7 @@ var import_utils3 = require("../../../components/collapsibleList/utils");
41
41
  var import_antd = require("antd");
42
42
  var import_actions = __toESM(require("../actions"));
43
43
  var import_index = require("./index.less");
44
+ var import_materials = require("@pisell/materials");
44
45
  var getName = (name, locale) => {
45
46
  return name[locale] || name["original"] || name["en"] || "";
46
47
  };
@@ -70,7 +71,8 @@ var ServiceItem = ({
70
71
  handleEditService,
71
72
  state,
72
73
  handleLike,
73
- errorMessage
74
+ errorMessage,
75
+ handleDeleteService
74
76
  }) => {
75
77
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j;
76
78
  const isDiscount = (0, import_react.useMemo)(() => {
@@ -145,6 +147,17 @@ var ServiceItem = ({
145
147
  handleEditService(d);
146
148
  }
147
149
  },
150
+ /* @__PURE__ */ import_react.default.createElement(
151
+ "div",
152
+ {
153
+ className: "pisell-lowcode__booking-service-item-delete",
154
+ onClick: (e) => {
155
+ e.stopPropagation();
156
+ handleDeleteService(d);
157
+ }
158
+ },
159
+ /* @__PURE__ */ import_react.default.createElement(import_antd.Button, { type: "text", icon: /* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-trash-01" }) })
160
+ ),
148
161
  d.id ? /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-item-title" }, d.title) : null,
149
162
  d._extend && state.renderType !== "eventBooking" ? /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-item-date" }, (0, import_utils.getServiceTime)(d, state.date.value)), renderResources) : null,
150
163
  (((_d = (_c = d._extend) == null ? void 0 : _c.other) == null ? void 0 : _d.bundle) || []).length ? /* @__PURE__ */ import_react.default.createElement(
@@ -57,6 +57,22 @@ var ServiceList = ({ onEdit }) => {
57
57
  });
58
58
  onEdit == null ? void 0 : onEdit(cacheItem);
59
59
  };
60
+ const handleDeleteService = (item) => {
61
+ if (state.disabledEdit || state.disableEventBookingEdit || state.channelDisabledEdit) {
62
+ return;
63
+ }
64
+ let _list = [...state.service.value];
65
+ _list = _list.filter((d) => d._id !== item._id);
66
+ dispatch({
67
+ type: "setService",
68
+ payload: {
69
+ editModal: false,
70
+ value: _list,
71
+ edit: true,
72
+ cacheItem: null
73
+ }
74
+ });
75
+ };
60
76
  const getErrorMessage = (0, import_react.useCallback)((service) => {
61
77
  let errorList = [];
62
78
  const list = Object.values(service._extend.resource || []);
@@ -122,7 +138,8 @@ var ServiceList = ({ onEdit }) => {
122
138
  d,
123
139
  handleEditService,
124
140
  state,
125
- handleLike
141
+ handleLike,
142
+ handleDeleteService
126
143
  }
127
144
  );
128
145
  }));
@@ -223,7 +223,11 @@ var getServiceStartTimeAndEndTime = (state, cacheItem, timeObj) => {
223
223
  if (findNextSliceProps.date && findNextSliceProps.date !== "00:00") {
224
224
  _extend.start_time = findNextSliceProps.date;
225
225
  } else {
226
- _extend.start_time = (0, import_dayjs.default)().format("HH:mm");
226
+ if (cacheItem.currentDefaultTime) {
227
+ _extend.start_time = cacheItem.currentDefaultTime;
228
+ } else {
229
+ _extend.start_time = (0, import_dayjs.default)().format("HH:mm");
230
+ }
227
231
  }
228
232
  }
229
233
  _extend = {
@@ -196,6 +196,26 @@ declare const _default: {
196
196
  'page.booking.text.please-choose-an-option-2': string;
197
197
  'page.booking.text.resource.min-length-error': (x: number, y: string) => string;
198
198
  'page.booking.text.price-extra': (origin: string, current: string) => string;
199
+ 'pisell2.booking.dashboard.groups-on-site-now': string;
200
+ 'pisell2.booking.dashboard.groups-on-site-now-tip': string;
201
+ 'pisell2.booking.dashboard.people-on-site-now': string;
202
+ 'pisell2.booking.dashboard.people-on-site-now-tip': string;
203
+ 'pisell2.booking.dashboard.total-visitors-today': string;
204
+ 'pisell2.booking.dashboard.total-visitors-today-tip': string;
205
+ 'pisell2.booking.dashboard.ongoing-visitors': string;
206
+ 'pisell2.booking.dashboard.ongoing-visitors-tip': string;
207
+ 'pisell2.booking.dashboard.upcoming-visitors': string;
208
+ 'pisell2.booking.dashboard.upcoming-visitors-tip': string;
209
+ 'pisell2.booking.dashboard.overdue-visitors': string;
210
+ 'pisell2.booking.dashboard.overdue-visitors-tip': string;
211
+ 'pisell2.booking.dashboard.completed-visitors': string;
212
+ 'pisell2.booking.dashboard.completed-visitors-tip': string;
213
+ 'pisell2.booking.dashboard.departed-visitors': string;
214
+ 'pisell2.booking.dashboard.departed-visitors-tip': string;
215
+ 'pisell2.booking.dashboard.default': string;
216
+ 'pisell2.booking.info.text.clear-cart': string;
217
+ 'pisell2.booking.info.text.clear-all': string;
218
+ 'pisell2.booking.info.text.create-new': string;
199
219
  };
200
220
  'zh-CN': {
201
221
  'pisell2.text.refunded-amount': string;
@@ -394,6 +414,26 @@ declare const _default: {
394
414
  'page.booking.text.please-choose-an-option-2': string;
395
415
  'page.booking.text.resource.min-length-error': (x: number, y: string) => string;
396
416
  'page.booking.text.price-extra': (origin: string, current: string) => string;
417
+ 'pisell2.booking.dashboard.groups-on-site-now': string;
418
+ 'pisell2.booking.dashboard.groups-on-site-now-tip': string;
419
+ 'pisell2.booking.dashboard.people-on-site-now': string;
420
+ 'pisell2.booking.dashboard.people-on-site-now-tip': string;
421
+ 'pisell2.booking.dashboard.total-visitors-today': string;
422
+ 'pisell2.booking.dashboard.total-visitors-today-tip': string;
423
+ 'pisell2.booking.dashboard.ongoing-visitors': string;
424
+ 'pisell2.booking.dashboard.ongoing-visitors-tip': string;
425
+ 'pisell2.booking.dashboard.upcoming-visitors': string;
426
+ 'pisell2.booking.dashboard.upcoming-visitors-tip': string;
427
+ 'pisell2.booking.dashboard.overdue-visitors': string;
428
+ 'pisell2.booking.dashboard.overdue-visitors-tip': string;
429
+ 'pisell2.booking.dashboard.completed-visitors': string;
430
+ 'pisell2.booking.dashboard.completed-visitors-tip': string;
431
+ 'pisell2.booking.dashboard.departed-visitors': string;
432
+ 'pisell2.booking.dashboard.departed-visitors-tip': string;
433
+ 'pisell2.booking.dashboard.default': string;
434
+ 'pisell2.booking.info.text.clear-cart': string;
435
+ 'pisell2.booking.info.text.clear-all': string;
436
+ 'pisell2.booking.info.text.create-new': string;
397
437
  };
398
438
  'zh-HK': {
399
439
  'pisell2.text.refunded-amount': string;
@@ -592,6 +632,26 @@ declare const _default: {
592
632
  'page.booking.text.please-choose-an-option-2': string;
593
633
  'page.booking.text.resource.min-length-error': (x: number, y: string) => string;
594
634
  'page.booking.text.price-extra': (origin: string, current: string) => string;
635
+ 'pisell2.booking.dashboard.groups-on-site-now': string;
636
+ 'pisell2.booking.dashboard.groups-on-site-now-tip': string;
637
+ 'pisell2.booking.dashboard.people-on-site-now': string;
638
+ 'pisell2.booking.dashboard.people-on-site-now-tip': string;
639
+ 'pisell2.booking.dashboard.total-visitors-today': string;
640
+ 'pisell2.booking.dashboard.total-visitors-today-tip': string;
641
+ 'pisell2.booking.dashboard.ongoing-visitors': string;
642
+ 'pisell2.booking.dashboard.ongoing-visitors-tip': string;
643
+ 'pisell2.booking.dashboard.upcoming-visitors': string;
644
+ 'pisell2.booking.dashboard.upcoming-visitors-tip': string;
645
+ 'pisell2.booking.dashboard.overdue-visitors': string;
646
+ 'pisell2.booking.dashboard.overdue-visitors-tip': string;
647
+ 'pisell2.booking.dashboard.completed-visitors': string;
648
+ 'pisell2.booking.dashboard.completed-visitors-tip': string;
649
+ 'pisell2.booking.dashboard.departed-visitors': string;
650
+ 'pisell2.booking.dashboard.departed-visitors-tip': string;
651
+ 'pisell2.booking.dashboard.default': string;
652
+ 'pisell2.booking.info.text.clear-cart': string;
653
+ 'pisell2.booking.info.text.clear-all': string;
654
+ 'pisell2.booking.info.text.create-new': string;
595
655
  };
596
656
  };
597
657
  export default _default;
@@ -251,7 +251,27 @@ var locales_default = {
251
251
  "page.booking.text.please-choose-an-option-1": "Refund: Cancel the appointment and process a refund.",
252
252
  "page.booking.text.please-choose-an-option-2": "Cancel only: Cancel the appointment without processing a refund. (You can still process a refund after cancellation if needed)",
253
253
  "page.booking.text.resource.min-length-error": (x, y) => `Select at least ${x} ${y}`,
254
- "page.booking.text.price-extra": (origin, current) => `Original price of the item:${origin},Current price of the item:${current}`
254
+ "page.booking.text.price-extra": (origin, current) => `Original price of the item:${origin},Current price of the item:${current}`,
255
+ "pisell2.booking.dashboard.groups-on-site-now": "Groups on-site now",
256
+ "pisell2.booking.dashboard.groups-on-site-now-tip": "Tip: Total number of groups who have checked in and are currently on-site",
257
+ "pisell2.booking.dashboard.people-on-site-now": "People on-site now",
258
+ "pisell2.booking.dashboard.people-on-site-now-tip": "Tip: Total number of people who have checked in and are currently on-site",
259
+ "pisell2.booking.dashboard.total-visitors-today": "Total visitors today",
260
+ "pisell2.booking.dashboard.total-visitors-today-tip": "Tip: Total number of visitors today, regardless of check-in status",
261
+ "pisell2.booking.dashboard.ongoing-visitors": "Ongoing visitors",
262
+ "pisell2.booking.dashboard.ongoing-visitors-tip": "Tip: Total number of visitors who have passed the start time, regardless of check-in status",
263
+ "pisell2.booking.dashboard.upcoming-visitors": "Upcoming visitors",
264
+ "pisell2.booking.dashboard.upcoming-visitors-tip": "Tip: Total number of visitors expected to arrive in the near future",
265
+ "pisell2.booking.dashboard.overdue-visitors": "Overdue visitors",
266
+ "pisell2.booking.dashboard.overdue-visitors-tip": "Tip: Total number of visitors whose playtime has expired but have not yet left the venue",
267
+ "pisell2.booking.dashboard.completed-visitors": "Completed visitors",
268
+ "pisell2.booking.dashboard.completed-visitors-tip": "Tip: Total number of visitors whose playtime has ended, regardless of whether they have left the venue",
269
+ "pisell2.booking.dashboard.departed-visitors": "Departed visitors",
270
+ "pisell2.booking.dashboard.departed-visitors-tip": "Tip: Total number of visitors who checked in and have left the venue today",
271
+ "pisell2.booking.dashboard.default": "Default",
272
+ "pisell2.booking.info.text.clear-cart": "Clear cart",
273
+ "pisell2.booking.info.text.clear-all": "Clear all",
274
+ "pisell2.booking.info.text.create-new": "Create new"
255
275
  },
256
276
  "zh-CN": {
257
277
  "pisell2.text.refunded-amount": "已退金额",
@@ -475,7 +495,27 @@ var locales_default = {
475
495
  "page.booking.text.please-choose-an-option-1": "退款:取消预约,同时处理退款。",
476
496
  "page.booking.text.please-choose-an-option-2": "仅取消:仅取消预约,但不进行退款处理。(您仍然可以在取消后再进行退款操作)",
477
497
  "page.booking.text.resource.min-length-error": (x, y) => `至少选择${x}项${y}`,
478
- "page.booking.text.price-extra": (origin, current) => `商品原价:${origin},商品现价:${current}`
498
+ "page.booking.text.price-extra": (origin, current) => `商品原价:${origin},商品现价:${current}`,
499
+ "pisell2.booking.dashboard.groups-on-site-now": "当前在场团体",
500
+ "pisell2.booking.dashboard.groups-on-site-now-tip": "提示:已检票并在场内的团体总数",
501
+ "pisell2.booking.dashboard.people-on-site-now": "当前在场人数",
502
+ "pisell2.booking.dashboard.people-on-site-now-tip": "提示:已检票并在场内的总人数",
503
+ "pisell2.booking.dashboard.total-visitors-today": "今日游客总数",
504
+ "pisell2.booking.dashboard.total-visitors-today-tip": "提示:今日的游客总人数,无论是否检票入场",
505
+ "pisell2.booking.dashboard.ongoing-visitors": "进行中的游客",
506
+ "pisell2.booking.dashboard.ongoing-visitors-tip": "提示:已过开始时间的游客总数,无论是否检票",
507
+ "pisell2.booking.dashboard.upcoming-visitors": "即将到达的游客",
508
+ "pisell2.booking.dashboard.upcoming-visitors-tip": "提示:预计将在未来到场的游客总人数",
509
+ "pisell2.booking.dashboard.overdue-visitors": "超时的游客",
510
+ "pisell2.booking.dashboard.overdue-visitors-tip": "提示:游玩时间已过,但尚未离场的游客总人数",
511
+ "pisell2.booking.dashboard.completed-visitors": "已完成的游客",
512
+ "pisell2.booking.dashboard.completed-visitors-tip": "提示:游玩时长已结束的游客总人数,无论是否离场",
513
+ "pisell2.booking.dashboard.departed-visitors": "已离场的游客",
514
+ "pisell2.booking.dashboard.departed-visitors-tip": "提示:今日已检票并离场的游客总人数",
515
+ "pisell2.booking.dashboard.default": "默认",
516
+ "pisell2.booking.info.text.clear-cart": "清空购物车",
517
+ "pisell2.booking.info.text.clear-all": "清空",
518
+ "pisell2.booking.info.text.create-new": "新建"
479
519
  },
480
520
  "zh-HK": {
481
521
  "pisell2.text.refunded-amount": "已退金額",
@@ -699,6 +739,26 @@ var locales_default = {
699
739
  "page.booking.text.please-choose-an-option-1": "退款:取消預約,同時處理退款。",
700
740
  "page.booking.text.please-choose-an-option-2": "僅取消:僅取消預約,但不進行退款處理。(您仍然可以在取消後再進行退款操作)",
701
741
  "page.booking.text.resource.min-length-error": (x, y) => `至少選擇${x}項${y}`,
702
- "page.booking.text.price-extra": (origin, current) => `商品原價:${origin},商品現價:${current}`
742
+ "page.booking.text.price-extra": (origin, current) => `商品原價:${origin},商品現價:${current}`,
743
+ "pisell2.booking.dashboard.groups-on-site-now": "當前在場團體",
744
+ "pisell2.booking.dashboard.groups-on-site-now-tip": "提示:已檢票並在場內的團體總數",
745
+ "pisell2.booking.dashboard.people-on-site-now": "當前在場人數",
746
+ "pisell2.booking.dashboard.people-on-site-now-tip": "提示:已檢票並在場內的總人數",
747
+ "pisell2.booking.dashboard.total-visitors-today": "今日遊客總數",
748
+ "pisell2.booking.dashboard.total-visitors-today-tip": "提示:今日的遊客總人數,無論是否檢票入場",
749
+ "pisell2.booking.dashboard.ongoing-visitors": "進行中的遊客",
750
+ "pisell2.booking.dashboard.ongoing-visitors-tip": "提示:已過開始時間的遊客總數,無論是否檢票",
751
+ "pisell2.booking.dashboard.upcoming-visitors": "即將到達的遊客",
752
+ "pisell2.booking.dashboard.upcoming-visitors-tip": "提示:預計將在未來到場的遊客總人數",
753
+ "pisell2.booking.dashboard.overdue-visitors": "超時的遊客",
754
+ "pisell2.booking.dashboard.overdue-visitors-tip": "提示:遊玩時間已過,但尚未離場的遊客總人數",
755
+ "pisell2.booking.dashboard.completed-visitors": "已完成的遊客",
756
+ "pisell2.booking.dashboard.completed-visitors-tip": "提示:遊玩時長已結束的遊客總人數,無論是否離場",
757
+ "pisell2.booking.dashboard.departed-visitors": "已離場的遊客",
758
+ "pisell2.booking.dashboard.departed-visitors-tip": "提示:今日已檢票並離場的遊客總人數",
759
+ "pisell2.booking.dashboard.default": "默认",
760
+ "pisell2.booking.info.text.clear-cart": "清空購物車",
761
+ "pisell2.booking.info.text.clear-all": "清空",
762
+ "pisell2.booking.info.text.create-new": "新建"
703
763
  }
704
764
  };
@@ -93,6 +93,8 @@ export interface FormState {
93
93
  disableEventBookingEdit?: boolean;
94
94
  /** 关闭自动打开选择服务弹窗 */
95
95
  closeAutoOpenService?: boolean;
96
+ /** 是否terminal创建booking页面 */
97
+ isBookingCreatePage?: boolean;
96
98
  loading: boolean;
97
99
  }
98
100
  export declare const walkInData: {
@@ -62,7 +62,7 @@ export declare const getServeStartTime: (start_time: string) => string;
62
62
  * @Date: 2024-04-26 14:04
63
63
  */
64
64
  export declare const getServiceTime: (item: any, currentDate: any) => string;
65
- export declare const findNextSlice: ({ timeSlices, index, date }: {
65
+ export declare const findNextSlice: ({ timeSlices, index, date, }: {
66
66
  timeSlices: any[];
67
67
  index?: number | undefined;
68
68
  date?: string | undefined;