@pisell/private-materials 3.3.45 → 3.3.47

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 (143) 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 +3 -3
  6. package/build/lowcode/view.js +3 -3
  7. package/es/businessModel/SalesModel/index.d.ts +1 -0
  8. package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
  9. package/es/components/appointmentBooking/components/Cart/Item/index.js +3 -0
  10. package/es/components/appointmentBooking/components/Content/index.d.ts +1 -0
  11. package/es/components/appointmentBooking/components/Content/index.js +7 -1
  12. package/es/components/appointmentBooking/components/Header/index.d.ts +1 -0
  13. package/es/components/appointmentBooking/components/Header/index.js +2 -2
  14. package/es/components/appointmentBooking/components/Resource/index.js +30 -12
  15. package/es/components/appointmentBooking/components/Services/index.js +5 -2
  16. package/es/components/appointmentBooking/components/TimeSlicing/index.js +7 -4
  17. package/es/components/appointmentBooking/components/Voucher/index.js +1 -0
  18. package/es/components/appointmentBooking/context.js +7 -3
  19. package/es/components/appointmentBooking/hooks.js +129 -68
  20. package/es/components/appointmentBooking/index.d.ts +1 -0
  21. package/es/components/appointmentBooking/utils.js +6 -1
  22. package/es/components/booking/addons/index.js +31 -26
  23. package/es/components/booking/components/footer/amount.js +2 -2
  24. package/es/components/booking/components/footer/index.d.ts +1 -0
  25. package/es/components/booking/components/footer/utils.d.ts +9 -0
  26. package/es/components/booking/components/footer/utils.js +32 -10
  27. package/es/components/booking/info/service/Lists.d.ts +1 -0
  28. package/es/components/booking/info/service/addService/index.d.ts +1 -0
  29. package/es/components/booking/info/service/addService/index.js +2 -2
  30. package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
  31. package/es/components/booking/info/service2/Lists.d.ts +1 -0
  32. package/es/components/booking/info/service2/utils.d.ts +4 -1
  33. package/es/components/booking/info/service2/utils.js +21 -2
  34. package/es/components/booking/info/utils.js +1 -1
  35. package/es/components/booking/info2/service/addService/index.js +9 -6
  36. package/es/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
  37. package/es/components/booking/info2/service/editService/index.js +56 -18
  38. package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
  39. package/es/components/booking/utils.d.ts +3 -2
  40. package/es/components/booking/utils.js +5 -0
  41. package/es/components/eftposPay/amount.d.ts +1 -1
  42. package/es/components/eftposPay/device.d.ts +1 -1
  43. package/es/components/eftposPay/hooks.d.ts +1 -1
  44. package/es/components/eftposPay/store/index.d.ts +2 -2
  45. package/es/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
  46. package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
  47. package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
  48. package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
  49. package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
  50. package/es/components/eventBooking/index.d.ts +1 -0
  51. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  52. package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  53. package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
  54. package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
  55. package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
  56. package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
  57. package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
  58. package/es/components/productExtension/index.d.ts +1 -0
  59. package/es/components/ruleSetting/index.d.ts +1 -0
  60. package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
  61. package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
  62. package/es/components/shoppingCart/index.d.ts +1 -0
  63. package/es/components/ticketBooking/components/addServiceVariant/addService.js +75 -26
  64. package/es/components/ticketBooking/components/notAvailable/index.d.ts +3 -0
  65. package/es/components/ticketBooking/components/notAvailable/index.js +39 -0
  66. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
  67. package/es/components/ticketBooking/index.d.ts +1 -0
  68. package/es/components/ticketBooking/index.js +1 -1
  69. package/es/components/ticketBooking/locales.d.ts +6 -0
  70. package/es/components/ticketBooking/locales.js +9 -3
  71. package/es/components/ticketBooking/serve.js +98 -92
  72. package/es/components/ticketBooking/utils/index.d.ts +1 -0
  73. package/es/components/ticketBooking/utils/index.js +33 -0
  74. package/es/components/wallet/hooks/useWalletCard.d.ts +1 -0
  75. package/lib/businessModel/SalesModel/index.d.ts +1 -0
  76. package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
  77. package/lib/components/appointmentBooking/components/Cart/Item/index.js +3 -0
  78. package/lib/components/appointmentBooking/components/Content/index.d.ts +1 -0
  79. package/lib/components/appointmentBooking/components/Content/index.js +3 -1
  80. package/lib/components/appointmentBooking/components/Header/index.d.ts +1 -0
  81. package/lib/components/appointmentBooking/components/Header/index.js +1 -1
  82. package/lib/components/appointmentBooking/components/Resource/index.js +15 -9
  83. package/lib/components/appointmentBooking/components/Services/index.js +3 -2
  84. package/lib/components/appointmentBooking/components/TimeSlicing/index.js +4 -3
  85. package/lib/components/appointmentBooking/components/Voucher/index.js +1 -0
  86. package/lib/components/appointmentBooking/context.js +7 -3
  87. package/lib/components/appointmentBooking/hooks.js +73 -12
  88. package/lib/components/appointmentBooking/index.d.ts +1 -0
  89. package/lib/components/appointmentBooking/utils.js +2 -0
  90. package/lib/components/booking/addons/index.js +27 -21
  91. package/lib/components/booking/components/footer/amount.js +1 -1
  92. package/lib/components/booking/components/footer/index.d.ts +1 -0
  93. package/lib/components/booking/components/footer/utils.d.ts +9 -0
  94. package/lib/components/booking/components/footer/utils.js +24 -7
  95. package/lib/components/booking/info/service/Lists.d.ts +1 -0
  96. package/lib/components/booking/info/service/addService/index.d.ts +1 -0
  97. package/lib/components/booking/info/service/addService/index.js +1 -1
  98. package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
  99. package/lib/components/booking/info/service2/Lists.d.ts +1 -0
  100. package/lib/components/booking/info/service2/utils.d.ts +4 -1
  101. package/lib/components/booking/info/service2/utils.js +21 -2
  102. package/lib/components/booking/info/utils.js +1 -1
  103. package/lib/components/booking/info2/service/addService/index.js +8 -5
  104. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +1 -0
  105. package/lib/components/booking/info2/service/editService/index.js +59 -23
  106. package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
  107. package/lib/components/booking/utils.d.ts +3 -2
  108. package/lib/components/booking/utils.js +6 -0
  109. package/lib/components/eftposPay/amount.d.ts +1 -1
  110. package/lib/components/eftposPay/device.d.ts +1 -1
  111. package/lib/components/eftposPay/hooks.d.ts +1 -1
  112. package/lib/components/eftposPay/store/index.d.ts +2 -2
  113. package/lib/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
  114. package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
  115. package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
  116. package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
  117. package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
  118. package/lib/components/eventBooking/index.d.ts +1 -0
  119. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
  120. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  121. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
  122. package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
  123. package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
  124. package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
  125. package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
  126. package/lib/components/productExtension/index.d.ts +1 -0
  127. package/lib/components/ruleSetting/index.d.ts +1 -0
  128. package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
  129. package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
  130. package/lib/components/shoppingCart/index.d.ts +1 -0
  131. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +74 -20
  132. package/lib/components/ticketBooking/components/notAvailable/index.d.ts +3 -0
  133. package/lib/components/ticketBooking/components/notAvailable/index.js +61 -0
  134. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
  135. package/lib/components/ticketBooking/index.d.ts +1 -0
  136. package/lib/components/ticketBooking/index.js +1 -1
  137. package/lib/components/ticketBooking/locales.d.ts +6 -0
  138. package/lib/components/ticketBooking/locales.js +9 -3
  139. package/lib/components/ticketBooking/serve.js +6 -2
  140. package/lib/components/ticketBooking/utils/index.d.ts +1 -0
  141. package/lib/components/ticketBooking/utils/index.js +33 -0
  142. package/lib/components/wallet/hooks/useWalletCard.d.ts +1 -0
  143. package/package.json +4 -4
@@ -46,6 +46,8 @@ __export(utils_exports, {
46
46
  handleChangeHolder: () => handleChangeHolder,
47
47
  holderId: () => holderId,
48
48
  initDate: () => initDate,
49
+ isAllNormalProduct: () => isAllNormalProduct,
50
+ isAllNormalProductByState: () => isAllNormalProductByState,
49
51
  isAppointmentProduct: () => isAppointmentProduct,
50
52
  isBookingProduct: () => isBookingProduct,
51
53
  isDayBooking: () => isDayBooking,
@@ -53,6 +55,7 @@ __export(utils_exports, {
53
55
  isDaysBooking: () => isDaysBooking,
54
56
  isEventBooking: () => isEventBooking,
55
57
  isHasDayAppointmentProduct: () => isHasDayAppointmentProduct,
58
+ isNormalProductByDurationSchedule: () => isNormalProductByDurationSchedule,
56
59
  isOpenDeletePet: () => isOpenDeletePet,
57
60
  isTerminalDayBooking: () => isTerminalDayBooking,
58
61
  updateAppointmentServicePrice: () => updateAppointmentServicePrice,
@@ -440,6 +443,16 @@ var getIsSubjectRequire = (state) => {
440
443
  var _a, _b, _c, _d, _e, _f, _g;
441
444
  return ((_d = (_c = (_b = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.basic) == null ? void 0 : _c.appointment_subject) == null ? void 0 : _d.type) === "form" && ((_g = (_f = (_e = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _e.config) == null ? void 0 : _f.basic) == null ? void 0 : _g.subject_require) === "require";
442
445
  };
446
+ var isNormalProductByDurationSchedule = (item) => {
447
+ var _a, _b;
448
+ return !(item == null ? void 0 : item.duration) && !((_a = item == null ? void 0 : item.schedules) == null ? void 0 : _a.length) && !((_b = item["schedule.ids"]) == null ? void 0 : _b.length);
449
+ };
450
+ var isAllNormalProduct = (items) => {
451
+ return items.every((item) => isNormalProductByDurationSchedule(item));
452
+ };
453
+ var isAllNormalProductByState = (state) => {
454
+ return isAllNormalProduct(state.service.value);
455
+ };
443
456
  var getGeneralParams = (item, state, isParallelResource) => {
444
457
  var _a, _b, _c, _d, _e, _f, _g;
445
458
  const { pet, service } = state;
@@ -489,12 +502,14 @@ var getGeneralParams = (item, state, isParallelResource) => {
489
502
  }
490
503
  ];
491
504
  }
505
+ const isNormalProduct = isNormalProductByDurationSchedule(item);
492
506
  return {
493
507
  format: ["HH:mm", "HH:mm"],
494
508
  show_time: true,
495
509
  duration_type: "minutes",
496
510
  // 当前可选择holder列表
497
511
  holders: formatHolders(holders),
512
+ isShowChangeHolder: !isNormalProduct,
498
513
  isShowAction: (0, import_utils4.isShowAddTime)(state, item),
499
514
  actionText: import_utils2.locales.getText("page.booking.text.add-time"),
500
515
  isMultipleResource: true,
@@ -502,8 +517,8 @@ var getGeneralParams = (item, state, isParallelResource) => {
502
517
  isErrorHolder: getIsSubjectRequire(state),
503
518
  addHolderButtonText: ((_c = (_b = formData == null ? void 0 : formData[0]) == null ? void 0 : _b.form) == null ? void 0 : _c.title) || "",
504
519
  holder_id: (_d = item == null ? void 0 : item._extend) == null ? void 0 : _d.holder_id,
505
- start_date: (_e = item == null ? void 0 : item._extend) == null ? void 0 : _e.startDate,
506
- end_date: ((_f = item == null ? void 0 : item._extend) == null ? void 0 : _f.endDate) || ((_g = item == null ? void 0 : item._extend) == null ? void 0 : _g.end_date),
520
+ start_date: !isNormalProduct ? (_e = item == null ? void 0 : item._extend) == null ? void 0 : _e.startDate : "",
521
+ end_date: !isNormalProduct ? ((_f = item == null ? void 0 : item._extend) == null ? void 0 : _f.endDate) || ((_g = item == null ? void 0 : item._extend) == null ? void 0 : _g.end_date) : "",
507
522
  ...parallelResourceOtherParams
508
523
  };
509
524
  };
@@ -528,6 +543,7 @@ var formatProducts = (lists, state, isRenderGroup = true, isGeneral, isParallelR
528
543
  errorMessage = getErrorMessage(item, resourceItem, isDayBooking(state));
529
544
  }
530
545
  const generalParams = isGeneral ? getGeneralParams(item, state, !!isParallelResource) : {};
546
+ console.log(isNormalProduct, "isNormalProduct");
531
547
  return {
532
548
  id: item == null ? void 0 : item.id,
533
549
  _id: item == null ? void 0 : item._id,
@@ -961,6 +977,8 @@ var updateServicePrice = (state) => {
961
977
  handleChangeHolder,
962
978
  holderId,
963
979
  initDate,
980
+ isAllNormalProduct,
981
+ isAllNormalProductByState,
964
982
  isAppointmentProduct,
965
983
  isBookingProduct,
966
984
  isDayBooking,
@@ -968,6 +986,7 @@ var updateServicePrice = (state) => {
968
986
  isDaysBooking,
969
987
  isEventBooking,
970
988
  isHasDayAppointmentProduct,
989
+ isNormalProductByDurationSchedule,
971
990
  isOpenDeletePet,
972
991
  isTerminalDayBooking,
973
992
  updateAppointmentServicePrice,
@@ -104,7 +104,7 @@ var isBooking4Shop = (shopId, renderType) => {
104
104
  if (renderType === "eventBooking") {
105
105
  return false;
106
106
  }
107
- const booking4Shops = [8390, 1350, 1401, 3013, 7154, 7572, 7007, 8119, 7320, 7362, 6497, 6087, 6303, 6726, 8191, 6812, 6813, 6814, 7651, 8586, 8581, 9, 2155, 8030, 1749, 8194, 2327, 6813, 8609, 8610, 8782, 1285, 6124, 8727, 5538];
107
+ const booking4Shops = [8390, 1350, 1401, 3013, 7154, 7572, 7007, 8119, 7320, 7362, 6497, 6087, 6303, 6726, 8191, 6812, 6813, 6814, 7651, 8586, 8581, 9, 2155, 8030, 1749, 8194, 2327, 6813, 8609, 8610, 8782, 1285, 6124, 8727, 5538, 6988];
108
108
  return booking4Shops.includes(shopId);
109
109
  };
110
110
  function generateDateRange(start, end) {
@@ -47,6 +47,7 @@ var import_utils2 = require("./utils");
47
47
  var import_utils3 = require("../../../utils");
48
48
  var import_utils4 = require("@pisell/utils");
49
49
  var import_ahooks = require("ahooks");
50
+ var import_utils5 = require("../../../info/service2/utils");
50
51
  var shopList = [
51
52
  2886,
52
53
  4422,
@@ -188,7 +189,7 @@ var Info = (props) => {
188
189
  const handleSelectProduct = (item, type) => {
189
190
  var _a2, _b2;
190
191
  const isSession = (0, import_utils3.isSessionProduct)(item);
191
- const isEject = type === "detail" || item.bundle_group_count > 0 || isSession;
192
+ const isEject = (0, import_utils3.getIsEject)(item, type);
192
193
  let lock = false;
193
194
  state.action({
194
195
  type: "pisell1.handleOpenProductModal",
@@ -196,10 +197,11 @@ var Info = (props) => {
196
197
  id: item.id,
197
198
  date: state.date.value.format("YYYY-MM-DD"),
198
199
  showConfig: {
199
- option: false,
200
+ option: true,
200
201
  session: isSession,
201
- variant: false,
202
- package: true
202
+ variant: true,
203
+ package: true,
204
+ number: (0, import_utils5.isNormalProductByDurationSchedule)(item)
203
205
  },
204
206
  is_eject: isEject ? 1 : 0,
205
207
  isOS: isSession,
@@ -224,13 +226,14 @@ var Info = (props) => {
224
226
  _key: e.key,
225
227
  _extend: {
226
228
  start_date: state.date.value,
227
- quantity: 1,
229
+ quantity: (e == null ? void 0 : e.quantity) || 1,
228
230
  price: _detail.price,
229
231
  product_name: item.title,
230
232
  other
231
233
  },
232
234
  new: 1
233
235
  };
236
+ console.log(cacheItem, "cacheItem", e);
234
237
  let _total = (0, import_utils3.getProductTotalPrice)(cacheItem);
235
238
  cacheItem._extend.total = _total;
236
239
  cacheItem._extend.origin_total = _total;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import '../../../info/service/addTimeModal/index.less';
2
3
  declare const AddTimeModal: () => JSX.Element;
3
4
  export default AddTimeModal;
@@ -50,9 +50,10 @@ var import_utilsByBooking = require("../../utilsByBooking");
50
50
  var import_utils4 = require("../addService/utils");
51
51
  var import_materials = require("@pisell/materials");
52
52
  var import_utils5 = require("../../../info/utils");
53
+ var import_utils6 = require("../../../info/service2/utils");
53
54
  var submitLock = false;
54
55
  var Info = (_, ref) => {
55
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E;
56
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A, _B, _C, _D, _E, _F;
56
57
  const [form] = import_antd.Form.useForm();
57
58
  const useTotal = import_antd.Form.useWatch("total", form);
58
59
  const useResource = import_antd.Form.useWatch("resource", form);
@@ -61,6 +62,10 @@ var Info = (_, ref) => {
61
62
  const { state, dispatch } = (0, import_react.useContext)(import_model.Context);
62
63
  const resourcesRef = (0, import_react.useRef)(null);
63
64
  const isChangeTotal = (0, import_react.useRef)(false);
65
+ const isNormalProduct = (0, import_react.useMemo)(() => {
66
+ var _a2, _b2;
67
+ return ((_a2 = state == null ? void 0 : state.service) == null ? void 0 : _a2.cacheItem) && (0, import_utils6.isNormalProductByDurationSchedule)((_b2 = state == null ? void 0 : state.service) == null ? void 0 : _b2.cacheItem);
68
+ }, [(_a = state == null ? void 0 : state.service) == null ? void 0 : _a.cacheItem]);
64
69
  const getCurrentCacheItem = (_cacheItem) => {
65
70
  let values = form.getFieldsValue();
66
71
  let _item = _cacheItem || state.service.cacheItem;
@@ -89,7 +94,7 @@ var Info = (_, ref) => {
89
94
  state.service.cacheItem,
90
95
  useStartTime,
91
96
  useResource,
92
- (_c = (_b = (_a = state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.basic) == null ? void 0 : _c.service_time
97
+ (_d = (_c = (_b = state.bookingConfig) == null ? void 0 : _b.config) == null ? void 0 : _c.basic) == null ? void 0 : _d.service_time
93
98
  ]);
94
99
  const flexibleOption = (0, import_react.useMemo)(() => {
95
100
  return (0, import_utils4.getFlexibleOption)({
@@ -155,7 +160,7 @@ var Info = (_, ref) => {
155
160
  const onFinish = (values) => {
156
161
  var _a2;
157
162
  let isSuccess = (_a2 = resourcesRef.current) == null ? void 0 : _a2.check();
158
- if (!isSuccess) {
163
+ if (isShowTimeAndResource && !isSuccess) {
159
164
  return;
160
165
  }
161
166
  if (submitLock) {
@@ -225,7 +230,7 @@ var Info = (_, ref) => {
225
230
  let oPrice = Number(((_a2 = state.service.cacheItem) == null ? void 0 : _a2._extend.origin_total) || 0);
226
231
  let cPrice = Number(useTotal || 0);
227
232
  return cPrice !== oPrice;
228
- }, [useTotal, (_e = (_d = state.service.cacheItem) == null ? void 0 : _d._extend) == null ? void 0 : _e.origin_total]);
233
+ }, [useTotal, (_f = (_e = state.service.cacheItem) == null ? void 0 : _e._extend) == null ? void 0 : _f.origin_total]);
229
234
  const getResources = () => {
230
235
  let res = (0, import_utils4.formatResources)({
231
236
  cacheItem: getCurrentCacheItem(),
@@ -288,18 +293,18 @@ var Info = (_, ref) => {
288
293
  }, [state.service.editModal, state.isBookingCreatePage]);
289
294
  (0, import_react.useEffect)(() => {
290
295
  getDiscount();
291
- }, [useTotal, (_g = (_f = state.service.cacheItem) == null ? void 0 : _f._extend) == null ? void 0 : _g.origin_total]);
296
+ }, [useTotal, (_h = (_g = state.service.cacheItem) == null ? void 0 : _g._extend) == null ? void 0 : _h.origin_total]);
292
297
  const isDiscount = (0, import_react.useMemo)(() => {
293
298
  var _a2, _b2, _c2;
294
299
  if (!((_a2 = state.service) == null ? void 0 : _a2.cacheItem)) {
295
300
  return false;
296
301
  }
297
302
  return useTotal != ((_c2 = (_b2 = state.service) == null ? void 0 : _b2.cacheItem) == null ? void 0 : _c2._extend.origin_total);
298
- }, [useTotal, (_i = (_h = state.service) == null ? void 0 : _h.cacheItem) == null ? void 0 : _i._extend.origin_total]);
303
+ }, [useTotal, (_j = (_i = state.service) == null ? void 0 : _i.cacheItem) == null ? void 0 : _j._extend.origin_total]);
299
304
  const bundles = (0, import_react.useMemo)(() => {
300
305
  var _a2, _b2, _c2, _d2;
301
306
  return ((_d2 = (_c2 = (_b2 = (_a2 = state.service) == null ? void 0 : _a2.cacheItem) == null ? void 0 : _b2._extend) == null ? void 0 : _c2.other) == null ? void 0 : _d2.bundle) || [];
302
- }, [(_m = (_l = (_k = (_j = state.service) == null ? void 0 : _j.cacheItem) == null ? void 0 : _k._extend) == null ? void 0 : _l.other) == null ? void 0 : _m.bundle]);
307
+ }, [(_n = (_m = (_l = (_k = state.service) == null ? void 0 : _k.cacheItem) == null ? void 0 : _l._extend) == null ? void 0 : _m.other) == null ? void 0 : _n.bundle]);
303
308
  const handleEdit = (e) => {
304
309
  var _a2, _b2, _c2, _d2, _e2;
305
310
  const item = state.service.cacheItem;
@@ -319,14 +324,16 @@ var Info = (_, ref) => {
319
324
  id: item.id,
320
325
  date: state.date.value.format("YYYY-MM-DD"),
321
326
  showConfig: {
322
- option: false,
327
+ option: true,
323
328
  session: isSession,
324
- variant: false,
325
- package: true
329
+ variant: true,
330
+ package: true,
331
+ number: (0, import_utils6.isNormalProductByDurationSchedule)(item)
326
332
  },
327
333
  isOS: isSession,
328
334
  customer_id: (_e2 = (_d2 = state.client) == null ? void 0 : _d2.value) == null ? void 0 : _e2.id,
329
335
  value: {
336
+ quantity: item._extend.quantity,
330
337
  ...item._extend.other,
331
338
  ...sessionValue
332
339
  }
@@ -346,6 +353,7 @@ var Info = (_, ref) => {
346
353
  ...item._extend,
347
354
  // 将当前表单的值覆盖进去
348
355
  ...values,
356
+ quantity: (e2 == null ? void 0 : e2.quantity) || (values == null ? void 0 : values.quantity) || 1,
349
357
  // 覆盖选择的规格和套餐
350
358
  other
351
359
  },
@@ -378,7 +386,8 @@ var Info = (_, ref) => {
378
386
  });
379
387
  form.setFieldsValue({
380
388
  total: _total,
381
- capacity: (_a3 = cacheItem._extend) == null ? void 0 : _a3.capacity
389
+ capacity: (_a3 = cacheItem._extend) == null ? void 0 : _a3.capacity,
390
+ quantity: (e2 == null ? void 0 : e2.quantity) || (values == null ? void 0 : values.quantity) || 1
382
391
  });
383
392
  }
384
393
  });
@@ -406,15 +415,20 @@ var Info = (_, ref) => {
406
415
  const handleTotalChange = (number) => {
407
416
  isChangeTotal.current = true;
408
417
  };
409
- console.log("state.service.value", state.service.value);
410
- const SelectTime = (_n = window.BaseMaterials) == null ? void 0 : _n.SelectTime;
418
+ const isShowTimeAndResource = (0, import_react.useMemo)(() => {
419
+ if (state.renderType !== "eventBooking" && !isNormalProduct) {
420
+ return true;
421
+ }
422
+ return false;
423
+ }, [state.renderType, isNormalProduct]);
424
+ const SelectTime = (_o = window.BaseMaterials) == null ? void 0 : _o.SelectTime;
411
425
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
412
426
  import_drawer.default,
413
427
  {
414
428
  titleNoWrap: true,
415
429
  zIndex: state.service.changeService ? 999 : 1e3,
416
430
  forceRender: true,
417
- open: state.service.editModal && !((_o = state.service.cacheItem) == null ? void 0 : _o.autoClose),
431
+ open: state.service.editModal && !((_p = state.service.cacheItem) == null ? void 0 : _p.autoClose),
418
432
  title: import_utils.locales.getText("pisell2.text.edit-service"),
419
433
  onClose: () => {
420
434
  dispatch({
@@ -427,7 +441,7 @@ var Info = (_, ref) => {
427
441
  });
428
442
  }
429
443
  },
430
- /* @__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" }, ((_r = (_q = (_p = state.service) == null ? void 0 : _p.cacheItem) == null ? void 0 : _q._extend) == null ? void 0 : _r.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(
444
+ /* @__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" }, ((_s = (_r = (_q = state.service) == null ? void 0 : _q.cacheItem) == null ? void 0 : _r._extend) == null ? void 0 : _s.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(
431
445
  import_collapsibleList.default,
432
446
  {
433
447
  style: { marginTop: bundles.length ? "8px" : 0 },
@@ -440,9 +454,9 @@ var Info = (_, ref) => {
440
454
  label: import_utils.locales.getText("pisell2.text.price"),
441
455
  name: "total",
442
456
  rules: [{ required: true }],
443
- extra: useTotal !== ((_t = (_s = state.service.cacheItem) == null ? void 0 : _s._extend) == null ? void 0 : _t.origin_total) && import_utils.locales.getText("page.booking.text.price-extra")(
457
+ extra: useTotal !== ((_u = (_t = state.service.cacheItem) == null ? void 0 : _t._extend) == null ? void 0 : _u.origin_total) && import_utils.locales.getText("page.booking.text.price-extra")(
444
458
  (0, import_utils.formatAmount)(
445
- (_v = (_u = state.service.cacheItem) == null ? void 0 : _u._extend) == null ? void 0 : _v.origin_total,
459
+ (_w = (_v = state.service.cacheItem) == null ? void 0 : _v._extend) == null ? void 0 : _w.origin_total,
446
460
  2,
447
461
  state.amountSymbol
448
462
  ),
@@ -458,8 +472,8 @@ var Info = (_, ref) => {
458
472
  prefix: state.amountSymbol,
459
473
  onChange: handleTotalChange,
460
474
  disabled: state.channelDisabledEdit,
461
- originValue: ((_x = (_w = state.service.cacheItem) == null ? void 0 : _w._extend) == null ? void 0 : _x.origin_total) || 0,
462
- placeholder: ((_z = (_y = state.service.cacheItem) == null ? void 0 : _y._extend) == null ? void 0 : _z.origin_total) || "0"
475
+ originValue: ((_y = (_x = state.service.cacheItem) == null ? void 0 : _x._extend) == null ? void 0 : _y.origin_total) || 0,
476
+ placeholder: ((_A = (_z = state.service.cacheItem) == null ? void 0 : _z._extend) == null ? void 0 : _A.origin_total) || "0"
463
477
  }
464
478
  )
465
479
  )), isReason ? /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 24 }, /* @__PURE__ */ import_react.default.createElement(
@@ -469,7 +483,7 @@ var Info = (_, ref) => {
469
483
  name: "discount_reason"
470
484
  },
471
485
  /* @__PURE__ */ import_react.default.createElement(import_antd.Input.TextArea, { size: "large" })
472
- )) : null, state.renderType !== "eventBooking" && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 12 }, /* @__PURE__ */ import_react.default.createElement(
486
+ )) : null, isShowTimeAndResource && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 12 }, /* @__PURE__ */ import_react.default.createElement(
473
487
  import_antd.Form.Item,
474
488
  {
475
489
  label: import_utils.locales.getText("pisell2.text.start_time"),
@@ -479,7 +493,7 @@ var Info = (_, ref) => {
479
493
  SelectTime ? /* @__PURE__ */ import_react.default.createElement(
480
494
  SelectTime,
481
495
  {
482
- slice: (_D = (_C = (_B = (_A = state.bookingConfig) == null ? void 0 : _A.config) == null ? void 0 : _B.basic) == null ? void 0 : _C.service_time) == null ? void 0 : _D.value,
496
+ slice: (_E = (_D = (_C = (_B = state.bookingConfig) == null ? void 0 : _B.config) == null ? void 0 : _C.basic) == null ? void 0 : _D.service_time) == null ? void 0 : _E.value,
483
497
  timePickerProps: {
484
498
  style: { width: "100%" }
485
499
  },
@@ -512,7 +526,29 @@ var Info = (_, ref) => {
512
526
  state,
513
527
  cacheItem: state.service.cacheItem
514
528
  }
515
- )), /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { hidden: true, name: "quantity" }, /* @__PURE__ */ import_react.default.createElement(import_antd.InputNumber, null))))), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-body-edit-footer" }, /* @__PURE__ */ import_react.default.createElement(
529
+ )), /* @__PURE__ */ import_react.default.createElement(import_antd.Form.Item, { hidden: true, name: "quantity" }, /* @__PURE__ */ import_react.default.createElement(import_antd.InputNumber, null))), isNormalProduct && /* @__PURE__ */ import_react.default.createElement(import_antd.Col, { span: 24 }, /* @__PURE__ */ import_react.default.createElement(
530
+ import_antd.Form.Item,
531
+ {
532
+ label: import_utils.locales.getText("pisell2.text.quantity"),
533
+ name: "quantity",
534
+ rules: [{ required: true }]
535
+ },
536
+ /* @__PURE__ */ import_react.default.createElement(
537
+ import_antd.InputNumber,
538
+ {
539
+ size: "large",
540
+ style: { width: "100%" },
541
+ min: 1,
542
+ max: 999999,
543
+ formatter: (value) => {
544
+ if (value !== void 0) {
545
+ return Math.floor(value);
546
+ }
547
+ return value;
548
+ }
549
+ }
550
+ )
551
+ )))), /* @__PURE__ */ import_react.default.createElement("div", { className: "pisell-lowcode__booking-service-body-edit-footer" }, /* @__PURE__ */ import_react.default.createElement(
516
552
  "div",
517
553
  {
518
554
  className: "pisell-lowcode__booking-service-delete-wrap",
@@ -524,7 +560,7 @@ var Info = (_, ref) => {
524
560
  {
525
561
  type: "primary",
526
562
  className: "pisell-lowcode__booking-service-body-edit-footer-apple",
527
- disabled: !((_E = state.service.resourcesOrigin) == null ? void 0 : _E.length),
563
+ disabled: !((_F = state.service.resourcesOrigin) == null ? void 0 : _F.length),
528
564
  onClick: () => {
529
565
  form.submit();
530
566
  }
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const ServiceList: ({ onEdit }: {
3
4
  onEdit: any;
@@ -141,6 +141,7 @@ export declare const deleteCacheParams: () => void;
141
141
  */
142
142
  export declare const getDays: (cacheItem: any, type: 'minutes' | 'days') => any;
143
143
  export declare const isSessionProduct: (cacheItem: any) => boolean;
144
+ export declare const getIsEject: (item: any, type: 'select' | 'detail') => boolean;
144
145
  /**
145
146
  * @title: 创建一个服务商品
146
147
  * @description:
@@ -163,10 +164,10 @@ export declare const getProductTotalPrice: (item: any) => number;
163
164
  export declare const getDuration: (duration: number | {
164
165
  type: string;
165
166
  value: number;
166
- }) => number | "flexible" | {
167
+ }) => number | {
167
168
  type: string;
168
169
  value: number;
169
- };
170
+ } | "flexible";
170
171
  export declare const isWalkIn: (customer_id?: number | string) => boolean;
171
172
  export declare const getIsEdit: (state: any) => boolean;
172
173
  export {};
@@ -43,6 +43,7 @@ __export(utils_exports, {
43
43
  getEndDate: () => getEndDate,
44
44
  getErrorList: () => getErrorList,
45
45
  getIsEdit: () => getIsEdit,
46
+ getIsEject: () => getIsEject,
46
47
  getLastServer: () => getLastServer,
47
48
  getNowTime: () => getNowTime,
48
49
  getProductTotalPrice: () => getProductTotalPrice,
@@ -523,6 +524,10 @@ var getDays = (cacheItem, type) => {
523
524
  var isSessionProduct = (cacheItem) => {
524
525
  return ["session_product", "session_ticket"].includes(cacheItem.extension_type);
525
526
  };
527
+ var getIsEject = (item, type) => {
528
+ const isSession = isSessionProduct(item);
529
+ return type === "detail" || item.bundle_group_count > 0 || item.option_group_count > 0 || item.is_variant > 0 || isSession;
530
+ };
526
531
  var getServerItemExtend = (state, cacheItem, timeObj) => {
527
532
  if (!cacheItem.new && cacheItem._extend.endDate) {
528
533
  return cacheItem._extend;
@@ -681,6 +686,7 @@ var getIsEdit = (state) => {
681
686
  getEndDate,
682
687
  getErrorList,
683
688
  getIsEdit,
689
+ getIsEject,
684
690
  getLastServer,
685
691
  getNowTime,
686
692
  getProductTotalPrice,
@@ -9,7 +9,7 @@ import { PosProps } from './const';
9
9
  */
10
10
  declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
11
11
  className?: string | undefined;
12
- onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
12
+ onChange?: ((status: "page" | "success" | "fail" | "print" | "mark_tx_processed", params?: string | {
13
13
  [keys: string]: unknown;
14
14
  } | undefined, other?: any) => void) | undefined;
15
15
  onClose: () => void;
@@ -11,7 +11,7 @@ import './device.less';
11
11
  declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
12
12
  api: PayProps['api'];
13
13
  className?: string | undefined;
14
- onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
14
+ onChange?: ((status: "page" | "success" | "fail" | "print" | "mark_tx_processed", params?: string | {
15
15
  [keys: string]: unknown;
16
16
  } | undefined, other?: any) => void) | undefined;
17
17
  onClose: () => void;
@@ -19,7 +19,7 @@ export declare const useStoreRef: <T extends {
19
19
  readonly netRef: React.MutableRefObject<boolean | undefined>;
20
20
  readonly symbolRef: React.MutableRefObject<string>;
21
21
  readonly amountRef: React.MutableRefObject<string | number>;
22
- readonly eftposRef: React.MutableRefObject<"stripe" | "payo" | "tyro" | "windcave">;
22
+ readonly eftposRef: React.MutableRefObject<"payo" | "tyro" | "windcave" | "stripe">;
23
23
  readonly clientRef: React.MutableRefObject<ClientEnum>;
24
24
  readonly dataRef: React.MutableRefObject<import("./store").State>;
25
25
  };
@@ -295,9 +295,9 @@ export declare const backUpFree: (payload: Partial<State>) => {
295
295
  name?: string | undefined;
296
296
  symbol?: string | undefined;
297
297
  amount?: string | number | undefined;
298
- mode?: "refund" | "pay" | "fullPay" | "query" | undefined;
298
+ mode?: "pay" | "fullPay" | "refund" | "query" | undefined;
299
299
  order_id?: string | number | undefined;
300
- eftpos?: "stripe" | "payo" | "tyro" | "windcave" | undefined;
300
+ eftpos?: "payo" | "tyro" | "windcave" | "stripe" | undefined;
301
301
  action?: "amount" | "deviceList" | "pay" | undefined;
302
302
  key?: number | undefined;
303
303
  step?: number | undefined;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Layout: () => JSX.Element;
3
4
  export default Layout;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Header: () => JSX.Element;
3
4
  export default Header;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const SelectHolderModal: (props: any) => JSX.Element;
2
3
  export default SelectHolderModal;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const Resource: (props: any) => JSX.Element;
2
3
  export default Resource;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const Schedule: () => JSX.Element;
2
3
  export default Schedule;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const EventBooking: () => JSX.Element;
3
4
  export default EventBooking;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.module.less';
2
3
  declare const StripePayment: () => JSX.Element;
3
4
  export default StripePayment;
@@ -1,2 +1,3 @@
1
+ /// <reference types="react" />
1
2
  declare const PhoneField: ({ value, onChange }: any) => JSX.Element;
2
3
  export default PhoneField;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  interface AddClientProps {
3
4
  onChange: (value: any) => void;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  interface RightPanelProps {
3
4
  value: any;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  declare const Actor: ({ name }: {
2
3
  name: string;
3
4
  }) => JSX.Element;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  interface valueType {
3
4
  }
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const SelectResourcesTable: ({ value, onChange }: any) => JSX.Element;
3
4
  export default SelectResourcesTable;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import "./index.less";
2
3
  interface ProductExtensionProps {
3
4
  onDataChange: any;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import "./index.less";
2
3
  interface RuleSettingProps {
3
4
  value: any;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Empty: (props: any) => JSX.Element;
3
4
  export default Empty;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import './index.less';
2
3
  declare const Content: () => JSX.Element;
3
4
  export default Content;
@@ -1,3 +1,4 @@
1
+ /// <reference types="react" />
1
2
  import { shoppingCartProps } from './type';
2
3
  declare const shoppingCart: ({ onCard, onAction, onChange, onAddProduct, onActiveKey, ...props }: shoppingCartProps) => JSX.Element;
3
4
  export default shoppingCart;