@pisell/private-materials 3.0.151 → 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 (136) 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 +12 -12
  11. package/es/components/booking/components/footer/index.js +48 -33
  12. package/es/components/booking/components/footer/utils.js +35 -4
  13. package/es/components/booking/index.js +1 -1
  14. package/es/components/booking/info/index.d.ts +4 -12
  15. package/es/components/booking/info/index.js +12 -122
  16. package/es/components/booking/info/main.d.ts +12 -0
  17. package/es/components/booking/info/main.js +124 -0
  18. package/es/components/booking/info/model.js +0 -1
  19. package/es/components/booking/info/service/addTimeModal/index.js +4 -4
  20. package/es/components/booking/info/utils.d.ts +1 -0
  21. package/es/components/booking/info/utils.js +7 -0
  22. package/es/components/booking/info2/index.d.ts +12 -0
  23. package/es/components/booking/info2/index.js +216 -0
  24. package/es/components/booking/info2/serve.d.ts +6 -0
  25. package/es/components/booking/info2/serve.js +79 -0
  26. package/es/components/booking/info2/service/actions/index.d.ts +6 -0
  27. package/es/components/booking/info2/service/actions/index.js +86 -0
  28. package/es/components/booking/info2/service/addService/index.d.ts +6 -0
  29. package/es/components/booking/info2/service/addService/index.js +404 -0
  30. package/es/components/booking/info2/service/addService/mock.d.ts +214 -0
  31. package/es/components/booking/info2/service/addService/mock.js +332 -0
  32. package/es/components/booking/info2/service/addService/utils.d.ts +71 -0
  33. package/es/components/booking/info2/service/addService/utils.js +510 -0
  34. package/es/components/booking/info2/service/addTimeModal/index.d.ts +4 -0
  35. package/es/components/booking/info2/service/addTimeModal/index.js +681 -0
  36. package/es/components/booking/info2/service/addTimeModal/serve.d.ts +9 -0
  37. package/es/components/booking/info2/service/addTimeModal/serve.js +73 -0
  38. package/es/components/booking/info2/service/addTimeModal/utils.d.ts +31 -0
  39. package/es/components/booking/info2/service/addTimeModal/utils.js +176 -0
  40. package/es/components/booking/info2/service/editService/Capacity/index.d.ts +4 -0
  41. package/es/components/booking/info2/service/editService/Capacity/index.js +121 -0
  42. package/es/components/booking/info2/service/editService/Capacity/index.less +1 -0
  43. package/es/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.d.ts +7 -0
  44. package/es/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +28 -0
  45. package/es/components/booking/info2/service/editService/Resources/index.d.ts +4 -0
  46. package/es/components/booking/info2/service/editService/Resources/index.js +233 -0
  47. package/es/components/booking/info2/service/editService/Resources/index.less +21 -0
  48. package/es/components/booking/info2/service/editService/index.d.ts +7 -0
  49. package/es/components/booking/info2/service/editService/index.js +617 -0
  50. package/es/components/booking/info2/service/editService/index.less +99 -0
  51. package/es/components/booking/info2/service/editService/utils.d.ts +11 -0
  52. package/es/components/booking/info2/service/editService/utils.js +37 -0
  53. package/es/components/booking/info2/service/index.d.ts +4 -0
  54. package/es/components/booking/info2/service/index.js +55 -0
  55. package/es/components/booking/info2/service/serviceItem/index.d.ts +4 -0
  56. package/es/components/booking/info2/service/serviceItem/index.js +176 -0
  57. package/es/components/booking/info2/service/serviceItem/index.less +125 -0
  58. package/es/components/booking/info2/service/serviceList/index.d.ts +6 -0
  59. package/es/components/booking/info2/service/serviceList/index.js +106 -0
  60. package/es/components/booking/info2/service/serviceList/index.less +0 -0
  61. package/es/components/booking/info2/utilsByBooking.d.ts +34 -0
  62. package/es/components/booking/info2/utilsByBooking.js +349 -0
  63. package/es/components/booking/locales.d.ts +3 -0
  64. package/es/components/booking/locales.js +12 -3
  65. package/es/components/booking/materiels/resources/index.d.ts +2 -2
  66. package/es/components/booking/materiels/resources/index.js +11 -11
  67. package/es/components/booking/mock.d.ts +1 -0
  68. package/es/components/booking/mock.js +66 -0
  69. package/es/components/booking/notes/index.d.ts +1 -1
  70. package/es/components/index.d.ts +1 -1
  71. package/es/components/index.js +1 -1
  72. package/es/index.d.ts +1 -1
  73. package/es/index.js +1 -1
  74. package/lib/components/booking/components/footer/index.js +28 -5
  75. package/lib/components/booking/components/footer/utils.js +29 -4
  76. package/lib/components/booking/index.js +2 -2
  77. package/lib/components/booking/info/index.d.ts +4 -12
  78. package/lib/components/booking/info/index.js +14 -115
  79. package/lib/components/booking/info/main.d.ts +12 -0
  80. package/lib/components/booking/info/main.js +152 -0
  81. package/lib/components/booking/info/service/addTimeModal/index.js +1 -0
  82. package/lib/components/booking/info/utils.d.ts +1 -0
  83. package/lib/components/booking/info/utils.js +9 -0
  84. package/lib/components/booking/info2/index.d.ts +12 -0
  85. package/lib/components/booking/info2/index.js +202 -0
  86. package/lib/components/booking/info2/serve.d.ts +6 -0
  87. package/lib/components/booking/info2/serve.js +53 -0
  88. package/lib/components/booking/info2/service/actions/index.d.ts +6 -0
  89. package/lib/components/booking/info2/service/actions/index.js +102 -0
  90. package/lib/components/booking/info2/service/addService/index.d.ts +6 -0
  91. package/lib/components/booking/info2/service/addService/index.js +356 -0
  92. package/lib/components/booking/info2/service/addService/mock.d.ts +214 -0
  93. package/lib/components/booking/info2/service/addService/mock.js +398 -0
  94. package/lib/components/booking/info2/service/addService/utils.d.ts +71 -0
  95. package/lib/components/booking/info2/service/addService/utils.js +377 -0
  96. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +4 -0
  97. package/lib/components/booking/info2/service/addTimeModal/index.js +558 -0
  98. package/lib/components/booking/info2/service/addTimeModal/serve.d.ts +9 -0
  99. package/lib/components/booking/info2/service/addTimeModal/serve.js +45 -0
  100. package/lib/components/booking/info2/service/addTimeModal/utils.d.ts +31 -0
  101. package/lib/components/booking/info2/service/addTimeModal/utils.js +157 -0
  102. package/lib/components/booking/info2/service/editService/Capacity/index.d.ts +4 -0
  103. package/lib/components/booking/info2/service/editService/Capacity/index.js +97 -0
  104. package/lib/components/booking/info2/service/editService/Capacity/index.less +1 -0
  105. package/lib/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.d.ts +7 -0
  106. package/lib/components/booking/info2/service/editService/Resources/MaxLengthSelect/index.js +54 -0
  107. package/lib/components/booking/info2/service/editService/Resources/index.d.ts +4 -0
  108. package/lib/components/booking/info2/service/editService/Resources/index.js +212 -0
  109. package/lib/components/booking/info2/service/editService/Resources/index.less +21 -0
  110. package/lib/components/booking/info2/service/editService/index.d.ts +7 -0
  111. package/lib/components/booking/info2/service/editService/index.js +483 -0
  112. package/lib/components/booking/info2/service/editService/index.less +99 -0
  113. package/lib/components/booking/info2/service/editService/utils.d.ts +11 -0
  114. package/lib/components/booking/info2/service/editService/utils.js +0 -0
  115. package/lib/components/booking/info2/service/index.d.ts +4 -0
  116. package/lib/components/booking/info2/service/index.js +75 -0
  117. package/lib/components/booking/info2/service/serviceItem/index.d.ts +4 -0
  118. package/lib/components/booking/info2/service/serviceItem/index.js +184 -0
  119. package/lib/components/booking/info2/service/serviceItem/index.less +125 -0
  120. package/lib/components/booking/info2/service/serviceList/index.d.ts +6 -0
  121. package/lib/components/booking/info2/service/serviceList/index.js +130 -0
  122. package/lib/components/booking/info2/service/serviceList/index.less +0 -0
  123. package/lib/components/booking/info2/utilsByBooking.d.ts +34 -0
  124. package/lib/components/booking/info2/utilsByBooking.js +257 -0
  125. package/lib/components/booking/locales.d.ts +3 -0
  126. package/lib/components/booking/locales.js +6 -3
  127. package/lib/components/booking/materiels/resources/index.d.ts +2 -2
  128. package/lib/components/booking/mock.d.ts +1 -0
  129. package/lib/components/booking/mock.js +67 -2
  130. package/lib/components/booking/notes/index.d.ts +1 -1
  131. package/lib/components/eftposPay/tyro/index.js +3 -1
  132. package/lib/components/index.d.ts +1 -1
  133. package/lib/components/index.js +1 -1
  134. package/lib/index.d.ts +1 -1
  135. package/lib/index.js +1 -1
  136. package/package.json +3 -3
@@ -46,6 +46,8 @@ var import_index = require("./index.less");
46
46
  var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
47
47
  var import_icons = require("@ant-design/icons");
48
48
  var import_serve = require("./serve");
49
+ var import_serve2 = require("../../info2/serve");
50
+ var import_utils3 = require("../../info/utils");
49
51
  var Footer = (props) => {
50
52
  var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
51
53
  const { state, buttons, dispatch, source } = props;
@@ -225,6 +227,22 @@ var Footer = (props) => {
225
227
  console.log("state.bookingId && state.addons.edit", err);
226
228
  }
227
229
  };
230
+ const getApis = () => {
231
+ var _a2, _b2, _c2, _d2, _e2;
232
+ if ((0, import_utils3.isBooking4Shop)(
233
+ (_e2 = (_d2 = (_c2 = (_b2 = (_a2 = context.appHelper.utils.store) == null ? void 0 : _a2.getState) == null ? void 0 : _b2.call(_a2)) == null ? void 0 : _c2.global) == null ? void 0 : _d2.globalConfig) == null ? void 0 : _e2.id,
234
+ state.renderType
235
+ )) {
236
+ return {
237
+ editBooking: import_serve2.editBookings,
238
+ createBooking: import_serve2.createBookings
239
+ };
240
+ }
241
+ return {
242
+ editBooking: state.apis.editBooking,
243
+ createBooking: state.apis.createBooking
244
+ };
245
+ };
228
246
  const handleSave = async ({
229
247
  type,
230
248
  messageShow = true
@@ -232,8 +250,9 @@ var Footer = (props) => {
232
250
  var _a2;
233
251
  let _setLoading = type === "checkout" ? setCheckoutLoading : setLoading;
234
252
  _setLoading(true);
235
- const editApi = state.renderType === "eventBooking" ? state.apis.editEventBooking : state.apis.editBooking;
236
- const createApi = state.renderType === "eventBooking" ? state.apis.createEventBooking : state.apis.createBooking;
253
+ const { createBooking, editBooking } = getApis();
254
+ const editApi = state.renderType === "eventBooking" ? state.apis.editEventBooking : editBooking;
255
+ const createApi = state.renderType === "eventBooking" ? state.apis.createEventBooking : createBooking;
237
256
  let saveOtherValue = {};
238
257
  if (type === "save") {
239
258
  saveOtherValue = await ((_a2 = state == null ? void 0 : state.onSave) == null ? void 0 : _a2.call(state, state.client)) || {};
@@ -250,13 +269,17 @@ var Footer = (props) => {
250
269
  title: import_utils.locales.getText(
251
270
  "page.event.booking.text.duplicate-enrollment"
252
271
  ),
253
- content: import_utils.locales.getText("page.event.booking.text.duplicate-enrollment-content")({
272
+ content: import_utils.locales.getText(
273
+ "page.event.booking.text.duplicate-enrollment-content"
274
+ )({
254
275
  customerName: data.customer_name,
255
276
  title: data.title,
256
277
  list: data.list
257
278
  }),
258
279
  width: 480,
259
- okText: import_utils.locales.getText("page.event.booking.text.duplicate-enrollment-confirm")
280
+ okText: import_utils.locales.getText(
281
+ "page.event.booking.text.duplicate-enrollment-confirm"
282
+ )
260
283
  });
261
284
  if (!confirmed) {
262
285
  _setLoading(false);
@@ -268,7 +291,7 @@ var Footer = (props) => {
268
291
  await handleSaveAddons();
269
292
  }
270
293
  if (infoEdit) {
271
- callbackData = await api(values);
294
+ callbackData = await api(values, state.bookingId);
272
295
  if (messageShow) {
273
296
  import_antd.message.success(
274
297
  import_utils.locales.getText(
@@ -26,6 +26,7 @@ __export(utils_exports, {
26
26
  module.exports = __toCommonJS(utils_exports);
27
27
  var import_utils = require("../../utils");
28
28
  var import_utils2 = require("../../utils");
29
+ var import_utilsByBooking = require("../../info2/utilsByBooking");
29
30
  var formatNote = (data) => {
30
31
  var _a;
31
32
  return ((_a = data.notes) == null ? void 0 : _a.orderNote) || "";
@@ -92,6 +93,26 @@ var formatRelationDetails = (list) => {
92
93
  };
93
94
  });
94
95
  };
96
+ var formatResource = (service) => {
97
+ if (!service._extend.resource) {
98
+ return void 0;
99
+ }
100
+ try {
101
+ return Object.values(service._extend.resource).reduce((pre, cur) => {
102
+ pre = pre.concat(cur.map((d) => ({
103
+ form_id: d.form_id,
104
+ relation_type: d.relation_type || "form",
105
+ relation_id: d.relation_id || 0,
106
+ capacity: (0, import_utilsByBooking.getSumCapacity)({ cacheItem: service }),
107
+ like_status: d.like_status,
108
+ metadata: d.metadata
109
+ })));
110
+ return pre;
111
+ }, []);
112
+ } catch (err) {
113
+ return void 0;
114
+ }
115
+ };
95
116
  var formatBookings = (data) => {
96
117
  const list = data.service.value;
97
118
  const eventOtherParams = data.eventOtherParams;
@@ -126,11 +147,11 @@ var formatBookings = (data) => {
126
147
  },
127
148
  "relation_products": formatRelationDetails(item._extend.relation_details),
128
149
  "id": item.booking_id || 0,
129
- "relation_id": item._extend.relation_id,
150
+ "relation_id": item._extend.relation_id || 0,
130
151
  "like_status": item._extend.like_status || "common",
131
- "relation_type": item._extend.relation_type,
152
+ "relation_type": item._extend.relation_type || "",
132
153
  "is_all": false,
133
- "schedule_id": item._extend.schedule_id,
154
+ "schedule_id": item._extend.schedule_id || 0,
134
155
  "end_time": end_time,
135
156
  "sub_type": getSubType(item),
136
157
  "select_date": start_date,
@@ -138,7 +159,11 @@ var formatBookings = (data) => {
138
159
  "end_date": end_date,
139
160
  "start_date": start_date,
140
161
  "duration": import_utils.flexibleObj.getValue(item._extend.duration),
141
- "number": item._extend.number || 1,
162
+ "number": item._extend.capacity ? (0, import_utilsByBooking.getSumCapacity)({ cacheItem: item }) : 1,
163
+ "resources": formatResource(item),
164
+ "metadata": item._extend.capacity ? {
165
+ capacity: item._extend.capacity
166
+ } : void 0,
142
167
  ...eventOtherParams || {}
143
168
  };
144
169
  });
@@ -34,7 +34,7 @@ __export(booking_exports, {
34
34
  module.exports = __toCommonJS(booking_exports);
35
35
  var import_react = __toESM(require("react"));
36
36
  var import_model = require("./model");
37
- var import_info = __toESM(require("./info"));
37
+ var import_main = __toESM(require("./info/main"));
38
38
  var import_notes = __toESM(require("./notes"));
39
39
  var import_addons = __toESM(require("./addons"));
40
40
  var import_forms = __toESM(require("./forms"));
@@ -50,6 +50,6 @@ var Booking = (0, import_model.Provider)(() => {
50
50
  }
51
51
  });
52
52
  };
53
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "" }, /* @__PURE__ */ import_react.default.createElement(import_info.default, { globalState: state, setGlobalState: setState }), /* @__PURE__ */ import_react.default.createElement(import_notes.default, { globalState: state, setGlobalState: setState }), /* @__PURE__ */ import_react.default.createElement(import_addons.default, { globalState: state, setGlobalState: setState }), /* @__PURE__ */ import_react.default.createElement(import_forms.default, { globalState: state, setGlobalState: setState }));
53
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "" }, /* @__PURE__ */ import_react.default.createElement(import_main.default, { globalState: state, setGlobalState: setState }), /* @__PURE__ */ import_react.default.createElement(import_notes.default, { globalState: state, setGlobalState: setState }), /* @__PURE__ */ import_react.default.createElement(import_addons.default, { globalState: state, setGlobalState: setState }), /* @__PURE__ */ import_react.default.createElement(import_forms.default, { globalState: state, setGlobalState: setState }));
54
54
  });
55
55
  var booking_default = Booking;
@@ -1,12 +1,4 @@
1
- import "./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;
1
+ import React from 'react';
2
+ import { InfoProps } from './main';
3
+ declare const APP: (props: InfoProps) => React.JSX.Element;
4
+ export default APP;
@@ -33,120 +33,19 @@ __export(info_exports, {
33
33
  });
34
34
  module.exports = __toCommonJS(info_exports);
35
35
  var import_react = __toESM(require("react"));
36
- var import_model = require("./model");
37
- var import_client = __toESM(require("./client"));
38
- var import_service = __toESM(require("./service"));
39
- var import_pet = __toESM(require("./pet"));
40
- var import_date = __toESM(require("./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("./header"));
45
- var import_locales = __toESM(require("../locales"));
46
- var import_utils = require("@pisell/utils");
47
- var import_utils2 = require("../utils");
48
- var import_date2 = require("./date");
36
+ var import_info2 = __toESM(require("../info2"));
37
+ var import_main = __toESM(require("./main"));
49
38
  var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
50
- var import_notes = __toESM(require("./notes"));
51
- var import_index = require("./index.less");
52
- var defaultModules = {
53
- client: 1,
54
- date: 1,
55
- service: 1,
56
- holder: 1,
57
- note: 1
58
- };
59
- import_utils.locales.init(import_locales.default, localStorage.getItem("umi_locale") || "en");
60
- var Info = (0, import_model.Provider)((props) => {
61
- var _a, _b, _c, _d, _e, _f, _g, _h, _i;
62
- const { style, globalState, modules = defaultModules, slot } = props;
63
- const modal = (0, import_react.useContext)(import_model.Context);
39
+ var import_utils = require("./utils");
40
+ var APP = (props) => {
41
+ var _a, _b, _c, _d, _e, _f;
64
42
  const context = (0, import_useEngineContext.default)();
65
- import_utils2.request.setRequest(context.appHelper.utils.request);
66
- const params = (0, import_react.useMemo)(() => {
67
- var _a2, _b2, _c2, _d2;
68
- 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) || {};
69
- }, [(_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]);
70
- (0, import_react.useEffect)(() => {
71
- document.body.id = "body";
72
- if (props.setState) {
73
- props.setState({
74
- bookingFunctions: {
75
- formatResource: import_utils2.formatResource,
76
- getErrorList: import_utils2.getErrorList,
77
- sliceDayIntoFiveMinutes: import_utils2.sliceDayIntoFiveMinutes,
78
- findNextDuration: import_utils2.findNextDuration,
79
- flexibleObj: import_utils2.flexibleObj,
80
- updateServiceDate: import_date2.updateServiceDate
81
- }
82
- });
83
- }
84
- }, []);
85
- (0, import_react.useEffect)(() => {
86
- var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j, _k, _l, _m;
87
- 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");
88
- modal.dispatch({
89
- type: "setState",
90
- payload: {
91
- setGlobalState: props.setGlobalState,
92
- ...globalState,
93
- 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),
94
- isFranchisee,
95
- timezone: (_m = (_l = (_k = (_j = (_i2 = (_h2 = context == null ? void 0 : context.appHelper) == null ? void 0 : _h2.utils) == null ? void 0 : _i2.store) == null ? void 0 : _j.getState()) == null ? void 0 : _k.global) == null ? void 0 : _l.globalConfig) == null ? void 0 : _m.timezone
96
- }
97
- });
98
- }, [JSON.stringify(globalState)]);
99
- const addNote = (e) => {
100
- modal.dispatch({
101
- type: "setNotes",
102
- payload: {
103
- orderNote: e,
104
- edit: true
105
- }
106
- });
107
- };
108
- const header = (0, import_react.useMemo)(() => {
109
- if ((globalState == null ? void 0 : globalState.renderType) === "eventBooking") {
110
- return import_utils.locales.getText("pisell2.text.enroll.detail");
111
- }
112
- 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 } });
113
- }, [
114
- globalState == null ? void 0 : globalState.bookingId,
115
- modal.state,
116
- modal.dispatch,
117
- globalState == null ? void 0 : globalState.renderType
118
- ]);
119
- const notes = (0, import_react.useMemo)(() => {
120
- var _a2, _b2;
121
- if (!modules.note) {
122
- return null;
123
- }
124
- 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 });
125
- }, [
126
- modules.note,
127
- globalState == null ? void 0 : globalState.bookingId,
128
- globalState.render,
129
- (_f = (_e = modal.state) == null ? void 0 : _e.notes) == null ? void 0 : _f.orderNote
130
- ]);
131
- return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, !!modal.state.setGlobalState ? /* @__PURE__ */ import_react.default.createElement(
132
- import_tabPane.default,
133
- {
134
- style,
135
- header,
136
- footer: /* @__PURE__ */ import_react.default.createElement(
137
- import_footer.default,
138
- {
139
- state: modal.state,
140
- dispatch: modal.dispatch,
141
- source: "info"
142
- }
143
- ),
144
- style: {
145
- height: ((_h = (_g = context == null ? void 0 : context.appHelper) == null ? void 0 : _g.utils) == null ? void 0 : _h.isMobile) ? "100%" : "100vh"
146
- },
147
- bodyClassName: "booking-info-warp"
148
- },
149
- /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-info" }, modules.client ? /* @__PURE__ */ import_react.default.createElement(import_client.default, null) : null, modules.holder && !((_i = modal.state) == null ? void 0 : _i.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)
150
- ) : null);
151
- });
152
- var info_default = Info;
43
+ if ((0, import_utils.isBooking4Shop)(
44
+ (_e = (_d = (_c = (_b = (_a = context.appHelper.utils.store) == null ? void 0 : _a.getState) == null ? void 0 : _b.call(_a)) == null ? void 0 : _c.global) == null ? void 0 : _d.globalConfig) == null ? void 0 : _e.id,
45
+ (_f = props == null ? void 0 : props.globalState) == null ? void 0 : _f.renderType
46
+ )) {
47
+ return /* @__PURE__ */ import_react.default.createElement(import_info2.default, { ...props });
48
+ }
49
+ return /* @__PURE__ */ import_react.default.createElement(import_main.default, { ...props });
50
+ };
51
+ var info_default = APP;
@@ -0,0 +1,12 @@
1
+ import './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,152 @@
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/info/main.tsx
30
+ var main_exports = {};
31
+ __export(main_exports, {
32
+ default: () => main_default
33
+ });
34
+ module.exports = __toCommonJS(main_exports);
35
+ var import_react = __toESM(require("react"));
36
+ var import_model = require("./model");
37
+ var import_client = __toESM(require("./client"));
38
+ var import_service = __toESM(require("./service"));
39
+ var import_pet = __toESM(require("./pet"));
40
+ var import_date = __toESM(require("./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("./header"));
45
+ var import_locales = __toESM(require("../locales"));
46
+ var import_utils = require("@pisell/utils");
47
+ var import_utils2 = require("../utils");
48
+ var import_date2 = require("./date");
49
+ var import_useEngineContext = __toESM(require("../../../hooks/useEngineContext"));
50
+ var import_notes = __toESM(require("./notes"));
51
+ var import_index = require("./index.less");
52
+ var defaultModules = {
53
+ client: 1,
54
+ date: 1,
55
+ service: 1,
56
+ holder: 1,
57
+ note: 1
58
+ };
59
+ import_utils.locales.init(import_locales.default, localStorage.getItem("umi_locale") || "en");
60
+ var Info = (0, import_model.Provider)((props) => {
61
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i;
62
+ const { style, globalState, modules = defaultModules, slot } = props;
63
+ const modal = (0, import_react.useContext)(import_model.Context);
64
+ const context = (0, import_useEngineContext.default)();
65
+ import_utils2.request.setRequest(context.appHelper.utils.request);
66
+ const params = (0, import_react.useMemo)(() => {
67
+ var _a2, _b2, _c2, _d2;
68
+ 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) || {};
69
+ }, [(_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]);
70
+ (0, import_react.useEffect)(() => {
71
+ document.body.id = "body";
72
+ if (props.setState) {
73
+ props.setState({
74
+ bookingFunctions: {
75
+ formatResource: import_utils2.formatResource,
76
+ getErrorList: import_utils2.getErrorList,
77
+ sliceDayIntoFiveMinutes: import_utils2.sliceDayIntoFiveMinutes,
78
+ findNextDuration: import_utils2.findNextDuration,
79
+ flexibleObj: import_utils2.flexibleObj,
80
+ updateServiceDate: import_date2.updateServiceDate
81
+ }
82
+ });
83
+ }
84
+ }, []);
85
+ (0, import_react.useEffect)(() => {
86
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j, _k, _l, _m;
87
+ 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");
88
+ modal.dispatch({
89
+ type: "setState",
90
+ payload: {
91
+ setGlobalState: props.setGlobalState,
92
+ ...globalState,
93
+ 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),
94
+ isFranchisee,
95
+ timezone: (_m = (_l = (_k = (_j = (_i2 = (_h2 = context == null ? void 0 : context.appHelper) == null ? void 0 : _h2.utils) == null ? void 0 : _i2.store) == null ? void 0 : _j.getState()) == null ? void 0 : _k.global) == null ? void 0 : _l.globalConfig) == null ? void 0 : _m.timezone
96
+ }
97
+ });
98
+ }, [JSON.stringify(globalState)]);
99
+ const addNote = (e) => {
100
+ modal.dispatch({
101
+ type: "setNotes",
102
+ payload: {
103
+ orderNote: e,
104
+ edit: true
105
+ }
106
+ });
107
+ };
108
+ const header = (0, import_react.useMemo)(() => {
109
+ if ((globalState == null ? void 0 : globalState.renderType) === "eventBooking") {
110
+ return import_utils.locales.getText("pisell2.text.enroll.detail");
111
+ }
112
+ 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 } });
113
+ }, [
114
+ globalState == null ? void 0 : globalState.bookingId,
115
+ modal.state,
116
+ modal.dispatch,
117
+ globalState == null ? void 0 : globalState.renderType
118
+ ]);
119
+ const notes = (0, import_react.useMemo)(() => {
120
+ var _a2, _b2;
121
+ if (!modules.note) {
122
+ return null;
123
+ }
124
+ 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 });
125
+ }, [
126
+ modules.note,
127
+ globalState == null ? void 0 : globalState.bookingId,
128
+ globalState.render,
129
+ (_f = (_e = modal.state) == null ? void 0 : _e.notes) == null ? void 0 : _f.orderNote
130
+ ]);
131
+ return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, !!modal.state.setGlobalState ? /* @__PURE__ */ import_react.default.createElement(
132
+ import_tabPane.default,
133
+ {
134
+ style,
135
+ header,
136
+ footer: /* @__PURE__ */ import_react.default.createElement(
137
+ import_footer.default,
138
+ {
139
+ state: modal.state,
140
+ dispatch: modal.dispatch,
141
+ source: "info"
142
+ }
143
+ ),
144
+ style: {
145
+ height: ((_h = (_g = context == null ? void 0 : context.appHelper) == null ? void 0 : _g.utils) == null ? void 0 : _h.isMobile) ? "100%" : "100vh"
146
+ },
147
+ bodyClassName: "booking-info-warp"
148
+ },
149
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-info" }, modules.client ? /* @__PURE__ */ import_react.default.createElement(import_client.default, null) : null, modules.holder && !((_i = modal.state) == null ? void 0 : _i.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)
150
+ ) : null);
151
+ });
152
+ var main_default = Info;
@@ -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"],
@@ -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;