@pisell/private-materials 6.2.25 → 6.2.26

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 (212) 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/meta.js +1 -1
  5. package/build/lowcode/render/default/view.js +1 -1
  6. package/build/lowcode/view.js +1 -1
  7. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +1 -1
  8. package/es/components/booking/components/customSelect/index.js +1 -0
  9. package/es/components/booking/hooks/useClearCart.js +11 -8
  10. package/es/components/booking/info/client/index.js +3 -2
  11. package/es/components/booking/info/hooks/useInfoHolder.js +13 -14
  12. package/es/components/booking/info/service/Lists.js +37 -27
  13. package/es/components/booking/info/service/editService/constants.d.ts +1 -0
  14. package/es/components/booking/info/service/editService/constants.js +3 -0
  15. package/es/components/booking/info/service/editService/index.js +15 -10
  16. package/es/components/booking/info/service2/utils.d.ts +1 -1
  17. package/es/components/booking/info/service2/utils.js +20 -21
  18. package/es/components/booking/info2/index.js +1 -0
  19. package/es/components/booking/info2/service/addService/utils.js +6 -3
  20. package/es/components/booking/info2/service/addTimeModal/index.js +3 -0
  21. package/es/components/booking/info2/service/editService/Resources/index.js +5 -0
  22. package/es/components/booking/info2/service/editService/index.js +265 -170
  23. package/es/components/booking/info2/service/index.js +22 -19
  24. package/es/components/booking/materiels/duration/index.js +9 -2
  25. package/es/components/booking/materiels/holder/index.d.ts +0 -1
  26. package/es/components/shoppingCart/components/Cart/Product.js +51 -47
  27. package/es/components/shoppingCart/components/Cart/index.js +21 -18
  28. package/es/components/ticketBooking/components/addServiceVariant/addService.js +171 -151
  29. package/es/components/ticketBooking/components/timeBar/index.js +77 -73
  30. package/es/components/ticketBooking/utils/index.d.ts +1 -1
  31. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +1 -1
  32. package/lib/components/booking/components/customSelect/index.js +1 -0
  33. package/lib/components/booking/hooks/useClearCart.js +16 -13
  34. package/lib/components/booking/info/client/index.js +5 -4
  35. package/lib/components/booking/info/hooks/useInfoHolder.js +12 -13
  36. package/lib/components/booking/info/service/Lists.js +36 -24
  37. package/lib/components/booking/info/service/editService/constants.d.ts +1 -0
  38. package/lib/components/booking/info/service/editService/constants.js +31 -0
  39. package/lib/components/booking/info/service/editService/index.js +7 -1
  40. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  41. package/lib/components/booking/info/service2/utils.js +17 -17
  42. package/lib/components/booking/info2/service/addService/utils.js +4 -2
  43. package/lib/components/booking/info2/service/addTimeModal/index.js +3 -0
  44. package/lib/components/booking/info2/service/editService/Resources/index.js +2 -0
  45. package/lib/components/booking/info2/service/editService/index.js +138 -74
  46. package/lib/components/booking/info2/service/index.js +14 -10
  47. package/lib/components/booking/materiels/duration/index.js +7 -2
  48. package/lib/components/booking/materiels/holder/index.d.ts +0 -1
  49. package/lib/components/shoppingCart/components/Cart/Product.js +32 -28
  50. package/lib/components/shoppingCart/components/Cart/index.js +18 -15
  51. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +140 -122
  52. package/lib/components/ticketBooking/components/timeBar/index.js +98 -94
  53. package/lib/components/ticketBooking/utils/index.d.ts +1 -1
  54. package/package.json +3 -3
  55. package/es/components/Sales/Cart/index.d.ts +0 -53
  56. package/es/components/booking/addons/index.d.ts +0 -17
  57. package/es/components/booking/components/actionButtons/index.d.ts +0 -29
  58. package/es/components/booking/components/clearCartModal/index.d.ts +0 -10
  59. package/es/components/booking/components/customiseItemModal/index.d.ts +0 -28
  60. package/es/components/booking/components/tabPane/index.d.ts +0 -4
  61. package/es/components/booking/components/voucher/index.d.ts +0 -3
  62. package/es/components/booking/dashboard/index.d.ts +0 -20
  63. package/es/components/booking/info/service/serviceItem/index.d.ts +0 -3
  64. package/es/components/booking/info2/cartClientCard/index.d.ts +0 -6
  65. package/es/components/booking/info2/cartClientCard/locales.d.ts +0 -21
  66. package/es/components/booking/info2/cartClientCard/types.d.ts +0 -13
  67. package/es/components/booking/info2/cartClientCard/utils.d.ts +0 -3
  68. package/es/components/booking/info2/service/editNormalService/index.d.ts +0 -3
  69. package/es/components/booking/info2/service/serviceItem/index.d.ts +0 -3
  70. package/es/components/booking/locales.d.ts +0 -903
  71. package/es/components/booking/notes/addNote/index.d.ts +0 -3
  72. package/es/components/shoppingCart/type.d.ts +0 -49
  73. package/es/components/ticketBooking/components/addServiceVariant/utils.d.ts +0 -8
  74. package/es/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.d.ts +0 -7
  75. package/es/components/ticketBooking/components/bookingDataPanel/bookingList/index.d.ts +0 -12
  76. package/es/components/ticketBooking/components/bookingDataPanel/bookingList/utils.d.ts +0 -6
  77. package/es/components/ticketBooking/components/bookingDataPanel/constants.d.ts +0 -22
  78. package/es/components/ticketBooking/components/bookingDataPanel/index.d.ts +0 -9
  79. package/es/components/ticketBooking/components/bookingDataPanel/pisellFloatingPanel/index.d.ts +0 -14
  80. package/es/components/ticketBooking/components/bookingDataPanel/serve.d.ts +0 -0
  81. package/es/components/ticketBooking/components/floatButtons/index.d.ts +0 -11
  82. package/es/components/ticketBooking/hooks/pisellos/bookingTicket.d.ts +0 -1
  83. package/es/components/ticketBooking/hooks/pisellos/index.d.ts +0 -3
  84. package/es/components/ticketBooking/hooks/pisellos/useCustomer.d.ts +0 -25
  85. package/es/components/ticketBooking/hooks/pisellos/useProducts.d.ts +0 -12
  86. package/es/components/ticketBooking/hooks/pisellos/useScanGlobalHandle.d.ts +0 -2
  87. package/es/components/ticketBooking/locales.d.ts +0 -177
  88. package/es/components/ticketBooking/serve.d.ts +0 -287
  89. package/es/hooks/useToast.d.ts +0 -2
  90. package/es/hooks/useTranslationOriginal.d.ts +0 -1
  91. package/es/index.d.ts +0 -51
  92. package/es/plus/clientCard/index.d.ts +0 -7
  93. package/es/plus/clientCard/line/index.d.ts +0 -9
  94. package/es/plus/clientCard/locales.d.ts +0 -18
  95. package/es/plus/clientCard/types.d.ts +0 -126
  96. package/es/plus/clientCard/utils.d.ts +0 -8
  97. package/es/plus/clientName/index.d.ts +0 -5
  98. package/es/plus/clientName/type.d.ts +0 -13
  99. package/es/plus/clientName/utils.d.ts +0 -2
  100. package/es/plus/clinetSearch/Add/BirthdayField/index.d.ts +0 -2
  101. package/es/plus/clinetSearch/Add/GenderField/index.d.ts +0 -2
  102. package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +0 -2
  103. package/es/plus/clinetSearch/Add/PhoneField/serve.d.ts +0 -2
  104. package/es/plus/clinetSearch/Add/index.d.ts +0 -18
  105. package/es/plus/clinetSearch/InfiniteScroll/InfiniteScroll.d.ts +0 -5
  106. package/es/plus/clinetSearch/InfiniteScroll/index.d.ts +0 -2
  107. package/es/plus/clinetSearch/InfiniteScroll/types.d.ts +0 -46
  108. package/es/plus/clinetSearch/index.d.ts +0 -18
  109. package/es/plus/clinetSearch/locales.d.ts +0 -102
  110. package/es/plus/clinetSearch/serve.d.ts +0 -1
  111. package/es/plus/clinetSearch/types.d.ts +0 -49
  112. package/es/plus/noteModal/AddTempModal.d.ts +0 -7
  113. package/es/plus/noteModal/index.d.ts +0 -4
  114. package/es/plus/noteModal/locales.d.ts +0 -33
  115. package/es/plus/noteModal/types.d.ts +0 -17
  116. package/es/pro/comprehensiveSearch/hooks/useNativeScanner.d.ts +0 -5
  117. package/es/pro/comprehensiveSearch/hooks/useTerminalPeripherals.d.ts +0 -9
  118. package/es/pro/comprehensiveSearch/index.d.ts +0 -9
  119. package/es/pro/comprehensiveSearch/locales.d.ts +0 -18
  120. package/es/pro/comprehensiveSearch/types.d.ts +0 -31
  121. package/es/pro/numberKeyboard/index.d.ts +0 -28
  122. package/es/pro/numberKeyboard/locales.d.ts +0 -12
  123. package/es/pro/pisellNumberSelector/example.d.ts +0 -3
  124. package/es/pro/pisellNumberSelector/index.d.ts +0 -26
  125. package/es/pro/pisellPhoneKeyboard/index.d.ts +0 -12
  126. package/es/pro/pisellPhoneKeyboard/locales.d.ts +0 -12
  127. package/es/pro/pisellPriceKeyboardModal/PisellPriceKeyboardModal.d.ts +0 -5
  128. package/es/pro/pisellPriceKeyboardModal/index.d.ts +0 -2
  129. package/es/pro/pisellPriceKeyboardModal/types.d.ts +0 -25
  130. package/es/pro/pisellPriceRadio/index.d.ts +0 -26
  131. package/es/pro/skuDetailModal/index.d.ts +0 -5
  132. package/es/pro/skuDetailModal/locales.d.ts +0 -48
  133. package/es/pro/skuDetailModal/types.d.ts +0 -347
  134. package/lib/components/Sales/Cart/index.d.ts +0 -53
  135. package/lib/components/booking/addons/index.d.ts +0 -17
  136. package/lib/components/booking/components/actionButtons/index.d.ts +0 -29
  137. package/lib/components/booking/components/clearCartModal/index.d.ts +0 -10
  138. package/lib/components/booking/components/customiseItemModal/index.d.ts +0 -28
  139. package/lib/components/booking/components/tabPane/index.d.ts +0 -4
  140. package/lib/components/booking/components/voucher/index.d.ts +0 -3
  141. package/lib/components/booking/dashboard/index.d.ts +0 -20
  142. package/lib/components/booking/info/service/serviceItem/index.d.ts +0 -3
  143. package/lib/components/booking/info2/cartClientCard/index.d.ts +0 -6
  144. package/lib/components/booking/info2/cartClientCard/locales.d.ts +0 -21
  145. package/lib/components/booking/info2/cartClientCard/types.d.ts +0 -13
  146. package/lib/components/booking/info2/cartClientCard/utils.d.ts +0 -3
  147. package/lib/components/booking/info2/service/editNormalService/index.d.ts +0 -3
  148. package/lib/components/booking/info2/service/serviceItem/index.d.ts +0 -3
  149. package/lib/components/booking/locales.d.ts +0 -903
  150. package/lib/components/booking/notes/addNote/index.d.ts +0 -3
  151. package/lib/components/shoppingCart/type.d.ts +0 -49
  152. package/lib/components/ticketBooking/components/addServiceVariant/utils.d.ts +0 -8
  153. package/lib/components/ticketBooking/components/bookingDataPanel/bookingDashboard/index.d.ts +0 -7
  154. package/lib/components/ticketBooking/components/bookingDataPanel/bookingList/index.d.ts +0 -12
  155. package/lib/components/ticketBooking/components/bookingDataPanel/bookingList/utils.d.ts +0 -6
  156. package/lib/components/ticketBooking/components/bookingDataPanel/constants.d.ts +0 -22
  157. package/lib/components/ticketBooking/components/bookingDataPanel/index.d.ts +0 -9
  158. package/lib/components/ticketBooking/components/bookingDataPanel/pisellFloatingPanel/index.d.ts +0 -14
  159. package/lib/components/ticketBooking/components/bookingDataPanel/serve.d.ts +0 -0
  160. package/lib/components/ticketBooking/components/floatButtons/index.d.ts +0 -11
  161. package/lib/components/ticketBooking/hooks/pisellos/bookingTicket.d.ts +0 -1
  162. package/lib/components/ticketBooking/hooks/pisellos/index.d.ts +0 -3
  163. package/lib/components/ticketBooking/hooks/pisellos/useCustomer.d.ts +0 -25
  164. package/lib/components/ticketBooking/hooks/pisellos/useProducts.d.ts +0 -12
  165. package/lib/components/ticketBooking/hooks/pisellos/useScanGlobalHandle.d.ts +0 -2
  166. package/lib/components/ticketBooking/locales.d.ts +0 -177
  167. package/lib/components/ticketBooking/serve.d.ts +0 -287
  168. package/lib/hooks/useToast.d.ts +0 -2
  169. package/lib/hooks/useTranslationOriginal.d.ts +0 -1
  170. package/lib/index.d.ts +0 -51
  171. package/lib/plus/clientCard/index.d.ts +0 -7
  172. package/lib/plus/clientCard/line/index.d.ts +0 -9
  173. package/lib/plus/clientCard/locales.d.ts +0 -18
  174. package/lib/plus/clientCard/types.d.ts +0 -126
  175. package/lib/plus/clientCard/utils.d.ts +0 -8
  176. package/lib/plus/clientName/index.d.ts +0 -5
  177. package/lib/plus/clientName/type.d.ts +0 -13
  178. package/lib/plus/clientName/utils.d.ts +0 -2
  179. package/lib/plus/clinetSearch/Add/BirthdayField/index.d.ts +0 -2
  180. package/lib/plus/clinetSearch/Add/GenderField/index.d.ts +0 -2
  181. package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +0 -2
  182. package/lib/plus/clinetSearch/Add/PhoneField/serve.d.ts +0 -2
  183. package/lib/plus/clinetSearch/Add/index.d.ts +0 -18
  184. package/lib/plus/clinetSearch/InfiniteScroll/InfiniteScroll.d.ts +0 -5
  185. package/lib/plus/clinetSearch/InfiniteScroll/index.d.ts +0 -2
  186. package/lib/plus/clinetSearch/InfiniteScroll/types.d.ts +0 -46
  187. package/lib/plus/clinetSearch/index.d.ts +0 -18
  188. package/lib/plus/clinetSearch/locales.d.ts +0 -102
  189. package/lib/plus/clinetSearch/serve.d.ts +0 -1
  190. package/lib/plus/clinetSearch/types.d.ts +0 -49
  191. package/lib/plus/noteModal/AddTempModal.d.ts +0 -7
  192. package/lib/plus/noteModal/index.d.ts +0 -4
  193. package/lib/plus/noteModal/locales.d.ts +0 -33
  194. package/lib/plus/noteModal/types.d.ts +0 -17
  195. package/lib/pro/comprehensiveSearch/hooks/useNativeScanner.d.ts +0 -5
  196. package/lib/pro/comprehensiveSearch/hooks/useTerminalPeripherals.d.ts +0 -9
  197. package/lib/pro/comprehensiveSearch/index.d.ts +0 -9
  198. package/lib/pro/comprehensiveSearch/locales.d.ts +0 -18
  199. package/lib/pro/comprehensiveSearch/types.d.ts +0 -31
  200. package/lib/pro/numberKeyboard/index.d.ts +0 -28
  201. package/lib/pro/numberKeyboard/locales.d.ts +0 -12
  202. package/lib/pro/pisellNumberSelector/example.d.ts +0 -3
  203. package/lib/pro/pisellNumberSelector/index.d.ts +0 -26
  204. package/lib/pro/pisellPhoneKeyboard/index.d.ts +0 -12
  205. package/lib/pro/pisellPhoneKeyboard/locales.d.ts +0 -12
  206. package/lib/pro/pisellPriceKeyboardModal/PisellPriceKeyboardModal.d.ts +0 -5
  207. package/lib/pro/pisellPriceKeyboardModal/index.d.ts +0 -2
  208. package/lib/pro/pisellPriceKeyboardModal/types.d.ts +0 -25
  209. package/lib/pro/pisellPriceRadio/index.d.ts +0 -26
  210. package/lib/pro/skuDetailModal/index.d.ts +0 -5
  211. package/lib/pro/skuDetailModal/locales.d.ts +0 -48
  212. package/lib/pro/skuDetailModal/types.d.ts +0 -347
@@ -49,7 +49,7 @@ var import_dayjs = __toESM(require("dayjs"));
49
49
  var import_pisellos = require("../../hooks/pisellos");
50
50
  var import_utils7 = require("./utils");
51
51
  var AddSerivce = (props) => {
52
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
52
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
53
53
  const { onEdit, state, dispatch, renderMode = "current" } = props;
54
54
  const context = (0, import_useEngineContext.default)();
55
55
  const notAvailableRef = (0, import_react.useRef)(null);
@@ -137,10 +137,148 @@ var AddSerivce = (props) => {
137
137
  const isEject = (0, import_utils2.getIsEject)(item, type);
138
138
  const isOnlySession = (0, import_utils2.getIsOnlySession)(item);
139
139
  let lock = false;
140
+ let cacheValues = null;
140
141
  if (isEject) {
141
142
  setCurrentProduct(item);
142
143
  } else {
143
144
  setCurrentProduct(null);
145
+ if (!isSession) {
146
+ cacheValues = {
147
+ bundle: [],
148
+ key: item.id,
149
+ option: [],
150
+ product_id: item.id,
151
+ product_variant_id: 0,
152
+ quantity: 1,
153
+ rowKey: item.id,
154
+ session: null,
155
+ unique: "08974625397"
156
+ };
157
+ }
158
+ }
159
+ const callback = async (e, extension_type, detail) => {
160
+ var _a3, _b2, _c2, _d2, _e2, _f2;
161
+ setCurrentProduct(null);
162
+ if (lock) {
163
+ return;
164
+ }
165
+ lock = true;
166
+ setTimeout(() => {
167
+ lock = false;
168
+ }, 2e3);
169
+ if (!isBooking4) {
170
+ const data = await createBookingData({
171
+ product: { ...detail || item, _params: e }
172
+ });
173
+ createBooking({ booking: data });
174
+ return;
175
+ }
176
+ const _detail = detail || item;
177
+ const other = JSON.parse(JSON.stringify(e));
178
+ other.session = e.session;
179
+ let cacheItem = {
180
+ ..._detail,
181
+ product_id: item.id,
182
+ _id: (0, import_utils.getUniqueId)(),
183
+ _key: e.key,
184
+ _extend: {
185
+ start_date: state.date.value,
186
+ quantity: (e == null ? void 0 : e.quantity) || 1,
187
+ price: _detail.price,
188
+ product_name: item.title,
189
+ other
190
+ },
191
+ new: 1
192
+ };
193
+ let _total = (0, import_utils2.getProductTotalPrice)(cacheItem);
194
+ cacheItem._extend.total = _total;
195
+ cacheItem._extend.origin_total = _total;
196
+ const _isEdit = !!state.service.cacheItem;
197
+ if (_isEdit) {
198
+ cacheItem._id = (_a3 = state.service.cacheItem) == null ? void 0 : _a3._id;
199
+ cacheItem.new = 0;
200
+ }
201
+ if (renderMode === "current") {
202
+ cacheItem.currentDefaultTime = state.date.value.format("HH:mm");
203
+ }
204
+ cacheItem = (0, import_utils3.getProductExtend)({
205
+ cacheItem,
206
+ state,
207
+ isDisabledTime: true
208
+ });
209
+ if (state.renderType === "eventBooking") {
210
+ cacheItem.autoClose = false;
211
+ }
212
+ if (cacheItem.autoClose) {
213
+ cacheItem.autoClose = false;
214
+ cacheItem._serviceKey = (0, import_utils6.genServiceKey)(cacheItem);
215
+ let { list: _list, quantity } = (0, import_utils6.addService)(
216
+ [...state.service.value],
217
+ cacheItem,
218
+ state
219
+ );
220
+ handleAddToast(cacheItem.title, quantity || 1);
221
+ (0, import_utils6.addServiceScroll)(e.rowKey, cacheItem);
222
+ try {
223
+ if (((_f2 = (_e2 = (_d2 = (_c2 = (_b2 = context.appHelper.utils.store) == null ? void 0 : _b2.getState) == null ? void 0 : _c2.call(_b2)) == null ? void 0 : _d2.global) == null ? void 0 : _e2.globalConfig) == null ? void 0 : _f2.id) === 2155) {
224
+ const val = _list == null ? void 0 : _list.map((s) => {
225
+ return {
226
+ product_id: s == null ? void 0 : s.product_id,
227
+ detailId: s == null ? void 0 : s.id,
228
+ detailProductId: s == null ? void 0 : s.product_id,
229
+ product_name: s == null ? void 0 : s.title,
230
+ price: s == null ? void 0 : s.price,
231
+ _id: s == null ? void 0 : s._id,
232
+ _key: s == null ? void 0 : s._key,
233
+ _serviceKey: s == null ? void 0 : s._serviceKey
234
+ };
235
+ });
236
+ const sendData = {
237
+ product_id: item == null ? void 0 : item.id,
238
+ detailId: _detail == null ? void 0 : _detail.id,
239
+ detailProductId: _detail == null ? void 0 : _detail.product_id,
240
+ product_name: item == null ? void 0 : item.title,
241
+ price: _detail == null ? void 0 : _detail.price,
242
+ serviceVal: val
243
+ };
244
+ (0, import_utils.sendWarningLog)({
245
+ title: "addService",
246
+ content: [
247
+ { key: "添加数据", value: JSON.stringify(sendData) },
248
+ {
249
+ key: "日期",
250
+ value: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm:ss")
251
+ }
252
+ ]
253
+ });
254
+ }
255
+ } catch (error) {
256
+ }
257
+ dispatch({
258
+ type: "setService",
259
+ payload: {
260
+ addModal: false,
261
+ value: _list,
262
+ edit: true,
263
+ changeService: false
264
+ }
265
+ });
266
+ } else {
267
+ dispatch({
268
+ type: "setService",
269
+ payload: {
270
+ editModal: true,
271
+ cacheItem,
272
+ addModal: !cacheItem.autoClose,
273
+ changeService: false
274
+ }
275
+ });
276
+ onEdit == null ? void 0 : onEdit(cacheItem);
277
+ }
278
+ };
279
+ if (cacheValues) {
280
+ callback(cacheValues, "", item);
281
+ return;
144
282
  }
145
283
  state.action({
146
284
  type: "pisell1.handleOpenProductModal",
@@ -162,126 +300,7 @@ var AddSerivce = (props) => {
162
300
  onCancel: () => {
163
301
  setCurrentProduct(null);
164
302
  },
165
- callback: async (e, extension_type, detail) => {
166
- var _a3, _b2, _c2, _d2, _e2, _f2;
167
- setCurrentProduct(null);
168
- if (lock) {
169
- return;
170
- }
171
- lock = true;
172
- setTimeout(() => {
173
- lock = false;
174
- }, 2e3);
175
- if (!isBooking4) {
176
- const data = await createBookingData({
177
- product: { ...detail || item, _params: e }
178
- });
179
- createBooking({ booking: data });
180
- return;
181
- }
182
- const _detail = detail || item;
183
- const other = JSON.parse(JSON.stringify(e));
184
- other.session = e.session;
185
- let cacheItem = {
186
- ..._detail,
187
- product_id: item.id,
188
- _id: (0, import_utils.getUniqueId)(),
189
- _key: e.key,
190
- _extend: {
191
- start_date: state.date.value,
192
- quantity: (e == null ? void 0 : e.quantity) || 1,
193
- price: _detail.price,
194
- product_name: item.title,
195
- other
196
- },
197
- new: 1
198
- };
199
- let _total = (0, import_utils2.getProductTotalPrice)(cacheItem);
200
- cacheItem._extend.total = _total;
201
- cacheItem._extend.origin_total = _total;
202
- const _isEdit = !!state.service.cacheItem;
203
- if (_isEdit) {
204
- cacheItem._id = (_a3 = state.service.cacheItem) == null ? void 0 : _a3._id;
205
- cacheItem.new = 0;
206
- }
207
- if (renderMode === "current") {
208
- cacheItem.currentDefaultTime = state.date.value.format("HH:mm");
209
- }
210
- cacheItem = (0, import_utils3.getProductExtend)({
211
- cacheItem,
212
- state,
213
- isDisabledTime: true
214
- });
215
- if (state.renderType === "eventBooking") {
216
- cacheItem.autoClose = false;
217
- }
218
- if (cacheItem.autoClose) {
219
- cacheItem.autoClose = false;
220
- cacheItem._serviceKey = (0, import_utils6.genServiceKey)(cacheItem);
221
- let { list: _list, quantity } = (0, import_utils6.addService)(
222
- [...state.service.value],
223
- cacheItem,
224
- state
225
- );
226
- handleAddToast(cacheItem.title, quantity || 1);
227
- (0, import_utils6.addServiceScroll)(e.rowKey, cacheItem);
228
- try {
229
- if (((_f2 = (_e2 = (_d2 = (_c2 = (_b2 = context.appHelper.utils.store) == null ? void 0 : _b2.getState) == null ? void 0 : _c2.call(_b2)) == null ? void 0 : _d2.global) == null ? void 0 : _e2.globalConfig) == null ? void 0 : _f2.id) === 2155) {
230
- const val = _list == null ? void 0 : _list.map((s) => {
231
- return {
232
- product_id: s == null ? void 0 : s.product_id,
233
- detailId: s == null ? void 0 : s.id,
234
- detailProductId: s == null ? void 0 : s.product_id,
235
- product_name: s == null ? void 0 : s.title,
236
- price: s == null ? void 0 : s.price,
237
- _id: s == null ? void 0 : s._id,
238
- _key: s == null ? void 0 : s._key,
239
- _serviceKey: s == null ? void 0 : s._serviceKey
240
- };
241
- });
242
- const sendData = {
243
- product_id: item == null ? void 0 : item.id,
244
- detailId: _detail == null ? void 0 : _detail.id,
245
- detailProductId: _detail == null ? void 0 : _detail.product_id,
246
- product_name: item == null ? void 0 : item.title,
247
- price: _detail == null ? void 0 : _detail.price,
248
- serviceVal: val
249
- };
250
- (0, import_utils.sendWarningLog)({
251
- title: "addService",
252
- content: [
253
- { key: "添加数据", value: JSON.stringify(sendData) },
254
- {
255
- key: "日期",
256
- value: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm:ss")
257
- }
258
- ]
259
- });
260
- }
261
- } catch (error) {
262
- }
263
- dispatch({
264
- type: "setService",
265
- payload: {
266
- addModal: false,
267
- value: _list,
268
- edit: true,
269
- changeService: false
270
- }
271
- });
272
- } else {
273
- dispatch({
274
- type: "setService",
275
- payload: {
276
- editModal: true,
277
- cacheItem,
278
- addModal: !cacheItem.autoClose,
279
- changeService: false
280
- }
281
- });
282
- onEdit == null ? void 0 : onEdit(cacheItem);
283
- }
284
- }
303
+ callback
285
304
  });
286
305
  }
287
306
  );
@@ -338,7 +357,6 @@ var AddSerivce = (props) => {
338
357
  }
339
358
  return null;
340
359
  }, [
341
- (_m = (_l = state.service) == null ? void 0 : _l.cacheItem) == null ? void 0 : _m.autoClose,
342
360
  state.service.addModal,
343
361
  import_utils.locales,
344
362
  renderList,
@@ -35,125 +35,129 @@ module.exports = __toCommonJS(timeBar_exports);
35
35
  var import_react = __toESM(require("react"));
36
36
  var import_icons = require("@ant-design/icons");
37
37
  var import_materials = require("@pisell/materials");
38
+ var import_ahooks = require("ahooks");
38
39
  var import_antd = require("antd");
39
40
  var import_classnames = __toESM(require("classnames"));
40
41
  var import_utils = require("@pisell/utils");
41
42
  var import_index = require("./index.less");
42
43
  var TimeBar = (props) => {
43
- var _a, _b, _c, _d;
44
+ var _a, _b;
44
45
  const { globalState: state, setGlobalState, locale, onCreateClick } = props;
45
- const _onClickNext = () => {
46
- var _a2, _b2, _c2, _d2;
46
+ const _onClickNext = (0, import_ahooks.useMemoizedFn)(() => {
47
+ var _a2, _b2, _c, _d;
47
48
  const currentTime = (_b2 = (_a2 = state.modalState) == null ? void 0 : _a2.date) == null ? void 0 : _b2.value;
48
49
  const newTime = currentTime["add"](1, "day");
49
- (_c2 = props.onDateChange) == null ? void 0 : _c2.call(props, newTime, newTime.format("YYYY-MM-DD HH:mm:ss"));
50
- (_d2 = props.setIntervalTime) == null ? void 0 : _d2.call(props, false);
51
- };
52
- const _onClickPre = () => {
53
- var _a2, _b2, _c2, _d2;
50
+ (_c = props.onDateChange) == null ? void 0 : _c.call(props, newTime, newTime.format("YYYY-MM-DD HH:mm:ss"));
51
+ (_d = props.setIntervalTime) == null ? void 0 : _d.call(props, false);
52
+ });
53
+ const _onClickPre = (0, import_ahooks.useMemoizedFn)(() => {
54
+ var _a2, _b2, _c, _d;
54
55
  const currentTime = (_b2 = (_a2 = state.modalState) == null ? void 0 : _a2.date) == null ? void 0 : _b2.value;
55
56
  const newTime = currentTime["subtract"](1, "day");
56
- (_c2 = props.onDateChange) == null ? void 0 : _c2.call(props, newTime, newTime.format("YYYY-MM-DD HH:mm:ss"));
57
- (_d2 = props.setIntervalTime) == null ? void 0 : _d2.call(props, false);
58
- };
59
- const _onClickToday = () => {
57
+ (_c = props.onDateChange) == null ? void 0 : _c.call(props, newTime, newTime.format("YYYY-MM-DD HH:mm:ss"));
58
+ (_d = props.setIntervalTime) == null ? void 0 : _d.call(props, false);
59
+ });
60
+ const _onClickToday = (0, import_ahooks.useMemoizedFn)(() => {
60
61
  var _a2;
61
62
  (_a2 = props.setIntervalTime) == null ? void 0 : _a2.call(props, true);
62
- };
63
- const _onClickNow = () => {
63
+ });
64
+ const _onClickNow = (0, import_ahooks.useMemoizedFn)(() => {
64
65
  var _a2;
65
66
  (_a2 = props.setIntervalTime) == null ? void 0 : _a2.call(props, true);
66
- };
67
- const _onDateTimeChange = (timeString) => {
68
- var _a2, _b2, _c2, _d2;
67
+ });
68
+ const _onDateTimeChange = (0, import_ahooks.useMemoizedFn)((timeString) => {
69
+ var _a2, _b2, _c, _d;
69
70
  const currentTime = (_b2 = (_a2 = state.modalState) == null ? void 0 : _a2.date) == null ? void 0 : _b2.value;
70
71
  const [hours, minutes] = timeString.split(":").map(Number);
71
72
  const newTime = currentTime.hour(hours).minute(minutes).second(0);
72
- (_c2 = props.onDateTimeChange) == null ? void 0 : _c2.call(props, newTime, newTime.format("YYYY-MM-DD HH:mm:ss"));
73
+ (_c = props.onDateTimeChange) == null ? void 0 : _c.call(props, newTime, newTime.format("YYYY-MM-DD HH:mm:ss"));
73
74
  setGlobalState({
74
75
  isTimeChange: true
75
76
  });
76
- (_d2 = props.setIntervalTime) == null ? void 0 : _d2.call(props, false);
77
- };
78
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-ticket-booking-time-bar" }, /* @__PURE__ */ import_react.default.createElement(
79
- import_antd.Button,
80
- {
81
- icon: /* @__PURE__ */ import_react.default.createElement(import_icons.LeftOutlined, null),
82
- onClick: _onClickPre,
83
- size: "large"
84
- }
85
- ), /* @__PURE__ */ import_react.default.createElement(
86
- import_antd.Button,
87
- {
88
- onClick: _onClickToday,
89
- size: "large",
90
- style: state.intervalSetTime ? { background: "#000", color: "#fff" } : void 0
91
- },
92
- import_utils.locales.getText("pisell2.ticket-booking.today")
93
- ), /* @__PURE__ */ import_react.default.createElement(
94
- "div",
95
- {
96
- className: (0, import_classnames.default)({
97
- "booking-page-date-picker-select": state.isDateChange
98
- }),
99
- style: { width: 200, flexShrink: 0 }
100
- },
101
- /* @__PURE__ */ import_react.default.createElement(
102
- import_materials.DatePicker,
77
+ (_d = props.setIntervalTime) == null ? void 0 : _d.call(props, false);
78
+ });
79
+ return (0, import_react.useMemo)(() => {
80
+ var _a2, _b2, _c, _d;
81
+ return /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-ticket-booking-time-bar" }, /* @__PURE__ */ import_react.default.createElement(
82
+ import_antd.Button,
103
83
  {
104
- inputReadOnly: true,
105
- value: (_b = (_a = state == null ? void 0 : state.modalState) == null ? void 0 : _a.date) == null ? void 0 : _b.value,
106
- format: locale === "en" ? "dddd, DD MMM YYYY" : "YYYY年MM月DD日",
107
- onChange: props == null ? void 0 : props.onDateChange,
84
+ icon: /* @__PURE__ */ import_react.default.createElement(import_icons.LeftOutlined, null),
85
+ onClick: _onClickPre,
86
+ size: "large"
87
+ }
88
+ ), /* @__PURE__ */ import_react.default.createElement(
89
+ import_antd.Button,
90
+ {
91
+ onClick: _onClickToday,
108
92
  size: "large",
109
- style: { width: "100%" }
93
+ style: state.intervalSetTime ? { background: "#000", color: "#fff" } : void 0
94
+ },
95
+ import_utils.locales.getText("pisell2.ticket-booking.today")
96
+ ), /* @__PURE__ */ import_react.default.createElement(
97
+ "div",
98
+ {
99
+ className: (0, import_classnames.default)({
100
+ "booking-page-date-picker-select": state.isDateChange
101
+ }),
102
+ style: { width: 200, flexShrink: 0 }
103
+ },
104
+ /* @__PURE__ */ import_react.default.createElement(
105
+ import_materials.DatePicker,
106
+ {
107
+ inputReadOnly: true,
108
+ value: (_b2 = (_a2 = state == null ? void 0 : state.modalState) == null ? void 0 : _a2.date) == null ? void 0 : _b2.value,
109
+ format: locale === "en" ? "dddd, DD MMM YYYY" : "YYYY年MM月DD日",
110
+ onChange: props == null ? void 0 : props.onDateChange,
111
+ size: "large",
112
+ style: { width: "100%" }
113
+ }
114
+ )
115
+ ), /* @__PURE__ */ import_react.default.createElement(
116
+ import_antd.Button,
117
+ {
118
+ icon: /* @__PURE__ */ import_react.default.createElement(import_icons.RightOutlined, null),
119
+ onClick: _onClickNext,
120
+ size: "large"
110
121
  }
111
- )
112
- ), /* @__PURE__ */ import_react.default.createElement(
113
- import_antd.Button,
114
- {
115
- icon: /* @__PURE__ */ import_react.default.createElement(import_icons.RightOutlined, null),
116
- onClick: _onClickNext,
117
- size: "large"
118
- }
119
- ), /* @__PURE__ */ import_react.default.createElement(
120
- "div",
121
- {
122
- className: (0, import_classnames.default)({
123
- "booking-page-date-picker-select": state.isTimeChange
124
- })
125
- },
126
- /* @__PURE__ */ import_react.default.createElement(
127
- import_materials.SelectTime,
122
+ ), /* @__PURE__ */ import_react.default.createElement(
123
+ "div",
128
124
  {
129
- value: (_d = (_c = state == null ? void 0 : state.modalState) == null ? void 0 : _c.date) == null ? void 0 : _d.value.format("HH:mm"),
130
- onChange: _onDateTimeChange,
131
- popoverProps: {
132
- style: { zoom: 0.8 }
125
+ className: (0, import_classnames.default)({
126
+ "booking-page-date-picker-select": state.isTimeChange
127
+ })
128
+ },
129
+ /* @__PURE__ */ import_react.default.createElement(
130
+ import_materials.SelectTime,
131
+ {
132
+ value: (_d = (_c = state == null ? void 0 : state.modalState) == null ? void 0 : _c.date) == null ? void 0 : _d.value.format("HH:mm"),
133
+ onChange: _onDateTimeChange,
134
+ popoverProps: {
135
+ style: { zoom: 0.8 }
136
+ },
137
+ timePickerProps: {},
138
+ timeProps: {},
139
+ slice: 5
140
+ }
141
+ )
142
+ ), !state.bookingId && /* @__PURE__ */ import_react.default.createElement(
143
+ import_antd.Button,
144
+ {
145
+ onClick: _onClickNow,
146
+ size: "large",
147
+ style: state.intervalSetTime ? { background: "#000", color: "#fff" } : void 0
148
+ },
149
+ import_utils.locales.getText("pisell2.ticket-booking.now")
150
+ ), !!state.bookingId && /* @__PURE__ */ import_react.default.createElement(
151
+ import_antd.Button,
152
+ {
153
+ onClick: () => {
154
+ onCreateClick();
133
155
  },
134
- timePickerProps: {},
135
- timeProps: {},
136
- slice: 5
137
- }
138
- )
139
- ), !state.bookingId && /* @__PURE__ */ import_react.default.createElement(
140
- import_antd.Button,
141
- {
142
- onClick: _onClickNow,
143
- size: "large",
144
- style: state.intervalSetTime ? { background: "#000", color: "#fff" } : void 0
145
- },
146
- import_utils.locales.getText("pisell2.ticket-booking.now")
147
- ), !!state.bookingId && /* @__PURE__ */ import_react.default.createElement(
148
- import_antd.Button,
149
- {
150
- onClick: () => {
151
- onCreateClick();
156
+ size: "large",
157
+ type: "primary"
152
158
  },
153
- size: "large",
154
- type: "primary"
155
- },
156
- import_utils.locales.getText("pisell2.ticket-booking.create-new")
157
- ));
159
+ import_utils.locales.getText("pisell2.ticket-booking.create-new")
160
+ ));
161
+ }, [(_b = (_a = state.modalState) == null ? void 0 : _a.date) == null ? void 0 : _b.value, state.intervalSetTime, state.isTimeChange, state.isDateChange, locale, state.bookingId]);
158
162
  };
159
163
  var timeBar_default = TimeBar;
@@ -40,7 +40,7 @@ declare type ScanData = {
40
40
  };
41
41
  };
42
42
  export declare const formatScanCustomer: (data: ScanData) => {
43
- searchType: "customer" | "product" | "wallet" | "walletPass" | "local_product";
43
+ searchType: "product" | "customer" | "wallet" | "walletPass" | "local_product";
44
44
  data: any;
45
45
  scanCode: string;
46
46
  } | null;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "6.2.25",
3
+ "version": "6.2.26",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -61,8 +61,8 @@
61
61
  "styled-components": "^6.0.0-rc.3",
62
62
  "@pisell/date-picker": "3.0.4",
63
63
  "@pisell/icon": "0.0.11",
64
- "@pisell/materials": "6.2.25",
65
- "@pisell/utils": "3.0.0"
64
+ "@pisell/utils": "3.0.0",
65
+ "@pisell/materials": "6.2.26"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "react": "^18.0.0",
@@ -1,53 +0,0 @@
1
- import React from 'react';
2
- import { TUpdateDisabledCartItem } from './types';
3
- interface CartItem {
4
- _id: string;
5
- [key: string]: any;
6
- }
7
- interface CartData {
8
- cartItems: CartItem[];
9
- currentCartItem: CartItem | null;
10
- }
11
- interface CartContextType {
12
- createCartItem: () => CartItem;
13
- createCartItemFromEvent: (eventItem: any) => CartItem;
14
- createCartItemFromHolder: (holderItem: any) => CartItem;
15
- addToCart: () => void;
16
- updateCartItem: (cartItem: CartItem) => CartItem;
17
- deleteCartItem: (cartItem: CartItem) => void;
18
- clickCartItem: (cartItem: CartItem) => void;
19
- updateCurrentCartItem: (cartItem: Partial<CartItem>) => void;
20
- clearCurrentCartItem: () => void;
21
- currentCartItem: CartItem | null;
22
- checkHolder: () => boolean;
23
- cartData: CartData;
24
- openCart: boolean;
25
- onOpenCart: any;
26
- onCloseCart: any;
27
- deleteCartItemByHolder: (holder_id: number) => void;
28
- addHolderToCartItem: (holderItem: any) => void;
29
- cartDataHolderList: any;
30
- addNoteToCartItem: (cartItem: CartItem) => void;
31
- updateDisabledCartItem: TUpdateDisabledCartItem;
32
- getWithoutCartItemsHolderNames: () => Array<string>;
33
- checkBeforeAddToCartResquest: any;
34
- checkBeforeAddToCart: () => Promise<{
35
- result: boolean;
36
- num: number;
37
- }>;
38
- }
39
- interface CartProviderProps {
40
- children: React.ReactNode;
41
- }
42
- export declare const CartContext: React.Context<CartContextType | undefined>;
43
- export declare const CartProvider: React.FC<CartProviderProps>;
44
- /**
45
- * 使用步骤管理的Hook
46
- * @throws {Error} 如果在StepProvider外部使用会抛出错误
47
- * @returns {StepContextType} 步骤管理上下文
48
- */
49
- export declare const useCart: () => CartContextType;
50
- declare const _default: {
51
- defaultState: CartData;
52
- };
53
- export default _default;
@@ -1,17 +0,0 @@
1
- /**
2
- * @title: 添加额外商品
3
- * @description:
4
- * @return {*}
5
- * @Author: zhiwei.Wang
6
- * @Date: 2024-01-30 16:33
7
- */
8
- import './index.less';
9
- export interface InfoProps {
10
- title?: string;
11
- style?: any;
12
- globalState: any;
13
- setGlobalState: any;
14
- }
15
- export declare const formatProducts: (values: any) => any;
16
- declare const Addons: any;
17
- export default Addons;
@@ -1,29 +0,0 @@
1
- import React from 'react';
2
- import './index.less';
3
- interface ActionButtonsProps {
4
- /** booking 状态对象,包含 service、addons 等数据 */
5
- state: {
6
- service?: {
7
- value?: any[];
8
- };
9
- addons?: {
10
- value?: any[];
11
- };
12
- disabledEdit?: boolean;
13
- channelDisabledEdit?: boolean;
14
- shop_discount?: string;
15
- bookingDetail?: {
16
- [key: string]: any;
17
- };
18
- [key: string]: any;
19
- };
20
- /** dispatch 函数,用于触发状态更新 */
21
- dispatch: (action: {
22
- type: string;
23
- payload?: any;
24
- }) => void;
25
- /** 是否禁用所有按钮 */
26
- disabled?: boolean;
27
- }
28
- declare const ActionButtons: React.FC<ActionButtonsProps>;
29
- export default ActionButtons;
@@ -1,10 +0,0 @@
1
- import React from 'react';
2
- import './index.less';
3
- interface ClearCartModalProps {
4
- visible: boolean;
5
- onCancel: () => void;
6
- onClearItemsOnly: () => void;
7
- onClearAllAndReset: () => void;
8
- }
9
- declare const ClearCartModal: React.FC<ClearCartModalProps>;
10
- export default ClearCartModal;