@pisell/private-materials 3.2.22 → 3.2.23

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 (237) 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 +13 -13
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +7 -7
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +8 -8
  11. package/es/components/appointmentBooking/assets/guests.svg +1 -0
  12. package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +83 -104
  13. package/es/components/appointmentBooking/components/Cart/Item/Total.js +1 -0
  14. package/es/components/appointmentBooking/components/Cart/Item/index.js +32 -18
  15. package/es/components/appointmentBooking/components/Cart/Item/index.less +7 -4
  16. package/es/components/appointmentBooking/components/Content/index.d.ts +0 -1
  17. package/es/components/appointmentBooking/components/Content/index.js +11 -11
  18. package/es/components/appointmentBooking/components/Date/index.d.ts +0 -1
  19. package/es/components/appointmentBooking/components/Date/index.js +49 -32
  20. package/es/components/appointmentBooking/components/Date/index.less +5 -0
  21. package/es/components/appointmentBooking/components/Guest/index.js +8 -21
  22. package/es/components/appointmentBooking/components/Header/index.d.ts +0 -1
  23. package/es/components/appointmentBooking/components/Header/index.js +44 -7
  24. package/es/components/appointmentBooking/components/Resource/index.d.ts +1 -1
  25. package/es/components/appointmentBooking/components/Resource/index.js +28 -20
  26. package/es/components/appointmentBooking/components/Resource/index.less +5 -0
  27. package/es/components/appointmentBooking/components/Services/index.js +20 -9
  28. package/es/components/appointmentBooking/components/TimeSlicing/index.js +47 -32
  29. package/es/components/appointmentBooking/components/TimeSlicing/index.less +4 -0
  30. package/es/components/appointmentBooking/components/Voucher/index.js +28 -18
  31. package/es/components/appointmentBooking/context.d.ts +2 -0
  32. package/es/components/appointmentBooking/context.js +7 -1
  33. package/es/components/appointmentBooking/hooks.d.ts +45 -9
  34. package/es/components/appointmentBooking/hooks.js +158 -121
  35. package/es/components/appointmentBooking/index.d.ts +0 -1
  36. package/es/components/appointmentBooking/index.js +12 -7
  37. package/es/components/appointmentBooking/locales.d.ts +30 -0
  38. package/es/components/appointmentBooking/locales.js +30 -0
  39. package/es/components/appointmentBooking/utils.d.ts +19 -0
  40. package/es/components/appointmentBooking/utils.js +68 -1
  41. package/es/components/booking/components/footer/utils.js +15 -15
  42. package/es/components/booking/components/voucher/index.d.ts +1 -1
  43. package/es/components/booking/components/voucher/index.js +28 -27
  44. package/es/components/booking/deposit/index.d.ts +0 -1
  45. package/es/components/booking/forms/single/index.d.ts +0 -1
  46. package/es/components/booking/hooks/useClearCart.d.ts +1 -0
  47. package/es/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
  48. package/es/components/booking/hooks/useIsBooking4Shop.js +10 -0
  49. package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
  50. package/es/components/booking/info/dateRange/index.d.ts +1 -0
  51. package/es/components/booking/info/header/index.d.ts +0 -1
  52. package/es/components/booking/info/index.d.ts +0 -1
  53. package/es/components/booking/info/service/addService/index.d.ts +0 -1
  54. package/es/components/booking/info/service/addTimeModal/index.d.ts +0 -1
  55. package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
  56. package/es/components/booking/info/service/serviceItem/index.d.ts +1 -0
  57. package/es/components/booking/info/service2/utils.d.ts +1 -1
  58. package/es/components/booking/info2/service/addService/index.d.ts +0 -1
  59. package/es/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
  60. package/es/components/booking/info2/service/serviceItem/index.d.ts +1 -0
  61. package/es/components/booking/materiels/contacts/index.d.ts +0 -1
  62. package/es/components/booking/utils.d.ts +2 -2
  63. package/es/components/eftpos/form/index.d.ts +0 -1
  64. package/es/components/eftpos/hooks.d.ts +0 -1
  65. package/es/components/eftpos/index.d.ts +0 -1
  66. package/es/components/eftpos/pos.d.ts +0 -1
  67. package/es/components/eftpos/surcharge/index.d.ts +0 -1
  68. package/es/components/eftposPay/amount.d.ts +1 -1
  69. package/es/components/eftposPay/app.d.ts +0 -1
  70. package/es/components/eftposPay/component/fail/failCustom.d.ts +0 -1
  71. package/es/components/eftposPay/component/fail/index.d.ts +0 -1
  72. package/es/components/eftposPay/component/fail/network.d.ts +0 -1
  73. package/es/components/eftposPay/component/fail/unknow.d.ts +0 -1
  74. package/es/components/eftposPay/component/manual/index.d.ts +0 -1
  75. package/es/components/eftposPay/component/signature/index.d.ts +0 -1
  76. package/es/components/eftposPay/device.d.ts +1 -1
  77. package/es/components/eftposPay/hooks.d.ts +1 -1
  78. package/es/components/eftposPay/index.d.ts +0 -1
  79. package/es/components/eftposPay/pay.d.ts +0 -1
  80. package/es/components/eftposPay/store/index.d.ts +3 -3
  81. package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  82. package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
  83. package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
  84. package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
  85. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
  86. package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
  87. package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
  88. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
  89. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  90. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  91. package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +0 -1
  92. package/es/components/eventBooking/index.d.ts +0 -1
  93. package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +0 -1
  94. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  95. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
  96. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  97. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
  98. package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  99. package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
  100. package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
  101. package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
  102. package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
  103. package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
  104. package/es/components/schedules/components/ScheduleList/index.d.ts +0 -1
  105. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +0 -1
  106. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +0 -1
  107. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +0 -1
  108. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
  109. package/es/components/schedules/products/ProductDetailDrawer/index.d.ts +0 -1
  110. package/es/components/schedules/products/index.d.ts +0 -1
  111. package/es/components/schedules/resources/index.d.ts +0 -1
  112. package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
  113. package/es/components/schedules/schedules/AllSchedules/index.d.ts +0 -1
  114. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +0 -1
  115. package/es/components/schedules/schedules/index.d.ts +0 -1
  116. package/es/components/shoppingCart/components/Cart/Product.js +3 -0
  117. package/es/components/shoppingCart/components/Cart/index.d.ts +1 -0
  118. package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
  119. package/es/components/shoppingCart/hooks/useAddService.d.ts +1 -0
  120. package/es/components/shoppingCart/hooks/useClearCart.js +4 -3
  121. package/es/components/shoppingCart/type.d.ts +1 -0
  122. package/es/components/taxSelect/index.d.ts +0 -1
  123. package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
  124. package/lib/components/appointmentBooking/assets/guests.svg +1 -0
  125. package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +37 -27
  126. package/lib/components/appointmentBooking/components/Cart/Item/Total.js +1 -0
  127. package/lib/components/appointmentBooking/components/Cart/Item/index.js +23 -11
  128. package/lib/components/appointmentBooking/components/Cart/Item/index.less +7 -4
  129. package/lib/components/appointmentBooking/components/Content/index.d.ts +0 -1
  130. package/lib/components/appointmentBooking/components/Content/index.js +3 -5
  131. package/lib/components/appointmentBooking/components/Date/index.d.ts +0 -1
  132. package/lib/components/appointmentBooking/components/Date/index.js +53 -47
  133. package/lib/components/appointmentBooking/components/Date/index.less +5 -0
  134. package/lib/components/appointmentBooking/components/Guest/index.js +6 -5
  135. package/lib/components/appointmentBooking/components/Header/index.d.ts +0 -1
  136. package/lib/components/appointmentBooking/components/Header/index.js +25 -3
  137. package/lib/components/appointmentBooking/components/Resource/index.d.ts +1 -1
  138. package/lib/components/appointmentBooking/components/Resource/index.js +16 -17
  139. package/lib/components/appointmentBooking/components/Resource/index.less +5 -0
  140. package/lib/components/appointmentBooking/components/Services/index.js +21 -2
  141. package/lib/components/appointmentBooking/components/TimeSlicing/index.js +23 -21
  142. package/lib/components/appointmentBooking/components/TimeSlicing/index.less +4 -0
  143. package/lib/components/appointmentBooking/components/Voucher/index.js +28 -16
  144. package/lib/components/appointmentBooking/context.d.ts +2 -0
  145. package/lib/components/appointmentBooking/context.js +4 -1
  146. package/lib/components/appointmentBooking/hooks.d.ts +45 -9
  147. package/lib/components/appointmentBooking/hooks.js +28 -41
  148. package/lib/components/appointmentBooking/index.d.ts +0 -1
  149. package/lib/components/appointmentBooking/index.js +11 -7
  150. package/lib/components/appointmentBooking/locales.d.ts +30 -0
  151. package/lib/components/appointmentBooking/locales.js +30 -0
  152. package/lib/components/appointmentBooking/utils.d.ts +19 -0
  153. package/lib/components/appointmentBooking/utils.js +39 -1
  154. package/lib/components/booking/components/footer/utils.js +1 -15
  155. package/lib/components/booking/components/voucher/index.d.ts +1 -1
  156. package/lib/components/booking/components/voucher/index.js +28 -17
  157. package/lib/components/booking/deposit/index.d.ts +0 -1
  158. package/lib/components/booking/forms/single/index.d.ts +0 -1
  159. package/lib/components/booking/hooks/useClearCart.d.ts +1 -0
  160. package/lib/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
  161. package/lib/components/booking/hooks/useIsBooking4Shop.js +51 -0
  162. package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
  163. package/lib/components/booking/info/dateRange/index.d.ts +1 -0
  164. package/lib/components/booking/info/header/index.d.ts +0 -1
  165. package/lib/components/booking/info/index.d.ts +0 -1
  166. package/lib/components/booking/info/service/addService/index.d.ts +0 -1
  167. package/lib/components/booking/info/service/addTimeModal/index.d.ts +0 -1
  168. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
  169. package/lib/components/booking/info/service/serviceItem/index.d.ts +1 -0
  170. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  171. package/lib/components/booking/info2/service/addService/index.d.ts +0 -1
  172. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
  173. package/lib/components/booking/info2/service/serviceItem/index.d.ts +1 -0
  174. package/lib/components/booking/materiels/contacts/index.d.ts +0 -1
  175. package/lib/components/booking/utils.d.ts +2 -2
  176. package/lib/components/eftpos/form/index.d.ts +0 -1
  177. package/lib/components/eftpos/hooks.d.ts +0 -1
  178. package/lib/components/eftpos/index.d.ts +0 -1
  179. package/lib/components/eftpos/pos.d.ts +0 -1
  180. package/lib/components/eftpos/surcharge/index.d.ts +0 -1
  181. package/lib/components/eftposPay/amount.d.ts +1 -1
  182. package/lib/components/eftposPay/app.d.ts +0 -1
  183. package/lib/components/eftposPay/component/fail/failCustom.d.ts +0 -1
  184. package/lib/components/eftposPay/component/fail/index.d.ts +0 -1
  185. package/lib/components/eftposPay/component/fail/network.d.ts +0 -1
  186. package/lib/components/eftposPay/component/fail/unknow.d.ts +0 -1
  187. package/lib/components/eftposPay/component/manual/index.d.ts +0 -1
  188. package/lib/components/eftposPay/component/signature/index.d.ts +0 -1
  189. package/lib/components/eftposPay/device.d.ts +1 -1
  190. package/lib/components/eftposPay/hooks.d.ts +1 -1
  191. package/lib/components/eftposPay/index.d.ts +0 -1
  192. package/lib/components/eftposPay/pay.d.ts +0 -1
  193. package/lib/components/eftposPay/store/index.d.ts +3 -3
  194. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
  195. package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
  196. package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
  197. package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
  198. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
  199. package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
  200. package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
  201. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
  202. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
  203. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
  204. package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +0 -1
  205. package/lib/components/eventBooking/index.d.ts +0 -1
  206. package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +0 -1
  207. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +0 -1
  208. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +0 -1
  209. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  210. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
  211. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
  212. package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
  213. package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
  214. package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
  215. package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
  216. package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +0 -1
  217. package/lib/components/schedules/components/ScheduleList/index.d.ts +0 -1
  218. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +0 -1
  219. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +0 -1
  220. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +0 -1
  221. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
  222. package/lib/components/schedules/products/ProductDetailDrawer/index.d.ts +0 -1
  223. package/lib/components/schedules/products/index.d.ts +0 -1
  224. package/lib/components/schedules/resources/index.d.ts +0 -1
  225. package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
  226. package/lib/components/schedules/schedules/AllSchedules/index.d.ts +0 -1
  227. package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +0 -1
  228. package/lib/components/schedules/schedules/index.d.ts +0 -1
  229. package/lib/components/shoppingCart/components/Cart/Product.js +1 -0
  230. package/lib/components/shoppingCart/components/Cart/index.d.ts +1 -0
  231. package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
  232. package/lib/components/shoppingCart/hooks/useAddService.d.ts +1 -0
  233. package/lib/components/shoppingCart/hooks/useClearCart.js +3 -2
  234. package/lib/components/shoppingCart/type.d.ts +1 -0
  235. package/lib/components/taxSelect/index.d.ts +0 -1
  236. package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
  237. package/package.json +4 -4
@@ -36,14 +36,12 @@ var import_react = __toESM(require("react"));
36
36
  var import_antd = require("antd");
37
37
  var import_materials = require("@pisell/materials");
38
38
  var import_utils = require("@pisell/utils");
39
- var import_hooks = require("../../hooks");
40
39
  var import_context = require("../../context");
40
+ var import_hooks = require("../../hooks");
41
41
  var import_utils2 = require("../../utils");
42
42
  var import_index = require("./index.less");
43
43
  var Guest = () => {
44
44
  const [openOption, setOpenOption] = (0, import_react.useState)(false);
45
- const [holderItem, setHolderItem] = (0, import_react.useState)(null);
46
- const [removeOpen, setRemoveOpen] = (0, import_react.useState)(false);
47
45
  const { carts, appointmentBooking } = (0, import_context.useAppointmentBookingContext)();
48
46
  const { accountLists } = (0, import_hooks.useAppointmentBookingAccount)();
49
47
  const lists = (0, import_react.useMemo)(() => {
@@ -80,7 +78,6 @@ var Guest = () => {
80
78
  {
81
79
  size: "large",
82
80
  onClick: () => {
83
- setHolderItem(item);
84
81
  setOpenOption(true);
85
82
  }
86
83
  },
@@ -93,7 +90,6 @@ var Guest = () => {
93
90
  menu: {
94
91
  items: _options,
95
92
  onClick: (e) => {
96
- setHolderItem(item);
97
93
  handleClick(e, item);
98
94
  }
99
95
  },
@@ -104,6 +100,11 @@ var Guest = () => {
104
100
  );
105
101
  };
106
102
  const handleAddGuest = () => {
103
+ if (accountLists.length >= 6) {
104
+ return (0, import_materials.PisellToast)({
105
+ content: import_utils.locales.getText("pisell2.appointment.max.guest")
106
+ });
107
+ }
107
108
  const guest = {
108
109
  id: (0, import_utils.getUniqueId)(),
109
110
  username: `Guest${accountLists.length + 1}`,
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Header: () => JSX.Element;
4
3
  export default Header;
@@ -33,13 +33,35 @@ __export(Header_exports, {
33
33
  });
34
34
  module.exports = __toCommonJS(Header_exports);
35
35
  var import_react = __toESM(require("react"));
36
+ var import_utils = require("@pisell/utils");
36
37
  var import_progressBar = __toESM(require("../../../eventBooking/components/progressBar"));
37
38
  var import_context = require("../../context");
38
39
  var import_index = require("./index.less");
39
40
  var Header = () => {
40
41
  var _a, _b;
41
- const { currentStep, appointmentBooking } = (0, import_context.useAppointmentBookingContext)();
42
+ const { currentStep, appointmentBooking, resources } = (0, import_context.useAppointmentBookingContext)();
43
+ const stepName = (0, import_react.useMemo)(() => {
44
+ var _a2, _b2, _c, _d, _e;
45
+ const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
46
+ if (key === "select-resource") {
47
+ const name = ((_d = (_c = (_b2 = resources == null ? void 0 : resources[0]) == null ? void 0 : _b2.resources) == null ? void 0 : _c[0]) == null ? void 0 : _d.title) || "";
48
+ return import_utils.locales.getText("pisell2.event.select.category")(name);
49
+ }
50
+ return (_e = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _e.description;
51
+ }, [(_a = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a.key, resources]);
42
52
  const handleBack = () => {
53
+ var _a2;
54
+ const key = (_a2 = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a2.key;
55
+ const types = {
56
+ "select-time": "time",
57
+ "select-resource": "resource"
58
+ };
59
+ if (types[key]) {
60
+ appointmentBooking.deleteCartItemInfo(types[key]);
61
+ }
62
+ if (key === "select-date") {
63
+ appointmentBooking.clearDateRange();
64
+ }
43
65
  appointmentBooking.back();
44
66
  };
45
67
  const handleClose = () => {
@@ -48,8 +70,8 @@ var Header = () => {
48
70
  return /* @__PURE__ */ import_react.default.createElement(
49
71
  import_progressBar.default,
50
72
  {
51
- title: (_a = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _a.title,
52
- description: (_b = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _b.description,
73
+ title: (_b = currentStep == null ? void 0 : currentStep.step) == null ? void 0 : _b.title,
74
+ description: stepName,
53
75
  showBack: (currentStep == null ? void 0 : currentStep.index) > 0,
54
76
  onBack: () => handleBack(),
55
77
  onClose: () => handleClose()
@@ -1,3 +1,3 @@
1
1
  import './index.less';
2
- declare const Resource: ({ onChange }: any) => JSX.Element;
2
+ declare const Resource: () => JSX.Element;
3
3
  export default Resource;
@@ -38,32 +38,32 @@ var import_resourceDisplay = __toESM(require("../../../eventBooking/components/r
38
38
  var import_materials = require("@pisell/materials");
39
39
  var import_hooks = require("../../hooks");
40
40
  var import_context = require("../../context");
41
+ var import_guests = __toESM(require("../../assets/guests.svg"));
41
42
  var import_utils = require("@pisell/utils");
42
43
  var import_index = require("./index.less");
43
- var Resource = ({ onChange }) => {
44
+ var Resource = () => {
44
45
  const [selectedResource, setSelectedResource] = (0, import_react.useState)(0);
45
46
  const { appointmentBooking, resources, carts, resourceOtherParams } = (0, import_context.useAppointmentBookingContext)();
46
- const {
47
- getResourceList,
48
- getResourceTimeSlot,
49
- autoSelectAllProductResources
50
- } = (0, import_hooks.useAppointmentBookingResource)();
47
+ const { getResourceList, autoSelectAllProductResources } = (0, import_hooks.useAppointmentBookingResource)();
51
48
  console.log(resources, carts, appointmentBooking, "lists, products");
52
49
  (0, import_react.useEffect)(() => {
50
+ var _a, _b, _c;
53
51
  const _resources = getResourceList();
54
- autoSelectAllProductResources("resources");
52
+ const code = (_c = (_b = (_a = _resources == null ? void 0 : _resources[0]) == null ? void 0 : _a.resources) == null ? void 0 : _b[0]) == null ? void 0 : _c.code;
53
+ autoSelectAllProductResources(code);
55
54
  }, []);
56
55
  (0, import_react.useEffect)(() => {
57
56
  var _a;
58
- console.log(resourceOtherParams == null ? void 0 : resourceOtherParams.errorList, "errorListerrorListerrorList");
59
57
  if (((_a = resourceOtherParams == null ? void 0 : resourceOtherParams.errorList) == null ? void 0 : _a.length) > 0) {
60
- return;
58
+ return (0, import_materials.PisellToast)({
59
+ content: import_utils.locales.getText("pisell2.appointment.no.available.time")
60
+ });
61
61
  }
62
62
  }, [resourceOtherParams == null ? void 0 : resourceOtherParams.errorList]);
63
63
  const anyResource = [
64
64
  {
65
65
  id: 0,
66
- image: "https://cdn-partners-api.fresha.com/employee-avatars/processed/399178/medium/3b77991b-0ee2-4d0f-9d6f-a7501b39afcd-tempImageHYe20U.jpg",
66
+ image: import_guests.default,
67
67
  title: "Any professional",
68
68
  subtitle: "for maximum availability"
69
69
  }
@@ -71,7 +71,6 @@ var Resource = ({ onChange }) => {
71
71
  const currentResource = (0, import_react.useMemo)(() => {
72
72
  var _a, _b;
73
73
  if (resources.length && carts.length) {
74
- console.log(resources, carts, "lists, products");
75
74
  if (carts.length === 1) {
76
75
  return (_b = (_a = resources[0]) == null ? void 0 : _a.resources) == null ? void 0 : _b[0];
77
76
  } else {
@@ -88,12 +87,11 @@ var Resource = ({ onChange }) => {
88
87
  const onClick = (e) => {
89
88
  var _a;
90
89
  setSelectedResource(e.id);
91
- console.log(currentResource, e, "whcurrentResourcecurrentResource");
90
+ console.log(currentResource, e, carts, "whcurrentResourcecurrentResource");
92
91
  if (e.id) {
93
- getResourceTimeSlot({
94
- product: (_a = resources == null ? void 0 : resources[0]) == null ? void 0 : _a.product,
95
- resources: currentResource == null ? void 0 : currentResource.renderList,
96
- currentResourceId: e.id
92
+ return appointmentBooking.updateCart({
93
+ _id: (_a = carts == null ? void 0 : carts[0]) == null ? void 0 : _a._id,
94
+ resources: [e]
97
95
  });
98
96
  }
99
97
  };
@@ -111,7 +109,8 @@ var Resource = ({ onChange }) => {
111
109
  dataSource: item,
112
110
  direction: "vertical",
113
111
  children: !(item == null ? void 0 : item.image) ? (_a = item == null ? void 0 : item.title) == null ? void 0 : _a.charAt(0).toUpperCase() : null,
114
- selected: selectedResource === (item == null ? void 0 : item.id)
112
+ selected: selectedResource === (item == null ? void 0 : item.id),
113
+ className: !item.id ? "appointment-resource-guest-card" : ""
115
114
  }
116
115
  );
117
116
  },
@@ -3,4 +3,9 @@
3
3
  .pisell-lowcode-card {
4
4
  min-height: 166px !important;
5
5
  }
6
+
7
+ .appointment-resource-guest-card .pisell-lowcode-avatar-image img {
8
+ width: 50%;
9
+ height: 50%;
10
+ }
6
11
  }
@@ -33,22 +33,36 @@ __export(Services_exports, {
33
33
  });
34
34
  module.exports = __toCommonJS(Services_exports);
35
35
  var import_react = __toESM(require("react"));
36
+ var import_antd = require("antd");
36
37
  var import_SearchLg = __toESM(require("@pisell/icon/es/SearchLg"));
37
38
  var import_utils = require("@pisell/utils");
38
39
  var import_materials = require("@pisell/materials");
39
- var import_antd = require("antd");
40
40
  var import_TabProduct = __toESM(require("../../../booking/components/TabProduct"));
41
41
  var import_utils2 = require("../../../booking/utils");
42
42
  var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
43
43
  var import_context = require("../../context");
44
+ var import_hooks = require("../../hooks");
45
+ var import_utils3 = require("../../utils");
44
46
  var import_index = require("./index.less");
45
47
  var Services = () => {
46
48
  const searchRef = (0, import_react.useRef)();
47
49
  const [search, setSearch] = (0, import_react.useState)("");
48
50
  const context = (0, import_useEngineContext.default)();
49
51
  const { utils } = context.appHelper || {};
50
- const { appointmentBooking, products, setProducts } = (0, import_context.useAppointmentBookingContext)();
52
+ const appointmentBooking = (0, import_hooks.useAppointmentBooking)();
53
+ const { products, setProducts } = (0, import_context.useAppointmentBookingContext)();
54
+ const { accountLists } = (0, import_hooks.useAppointmentBookingAccount)();
55
+ const accountRef = (0, import_react.useRef)(accountLists);
56
+ const currentUser = (0, import_utils3.formatCurrentUser)();
51
57
  (0, import_react.useEffect)(() => {
58
+ console.log(accountLists, accountRef, "wh978896786");
59
+ }, [accountLists, accountRef]);
60
+ (0, import_react.useEffect)(() => {
61
+ var _a;
62
+ console.log(accountRef.current, currentUser, "accountRef");
63
+ if (!((_a = accountRef.current) == null ? void 0 : _a.length) && currentUser) {
64
+ appointmentBooking.addAccount([currentUser]);
65
+ }
52
66
  const { productModuleParams } = appointmentBooking.otherParams || {};
53
67
  appointmentBooking.loadProducts(productModuleParams).then((res) => {
54
68
  setProducts(res || []);
@@ -65,6 +79,11 @@ var Services = () => {
65
79
  const resources = ((_b = (_a = data == null ? void 0 : data.origin) == null ? void 0 : _a.product_resource) == null ? void 0 : _b.resources) || [];
66
80
  const activeStatus = resources.find((item2) => item2.status === 1);
67
81
  if (!activeStatus) {
82
+ return (0, import_materials.PisellToast)({
83
+ content: import_utils.locales.getText(
84
+ "pisell2.appointment.no.available.service"
85
+ )
86
+ });
68
87
  }
69
88
  const product = {
70
89
  ...data,
@@ -34,34 +34,31 @@ __export(TimeSlicing_exports, {
34
34
  module.exports = __toCommonJS(TimeSlicing_exports);
35
35
  var import_react = __toESM(require("react"));
36
36
  var import_materials = require("@pisell/materials");
37
+ var import_utils = require("@pisell/utils");
37
38
  var import_context = require("../../context");
38
39
  var import_index = require("./index.less");
39
40
  var Resource = ({ params }) => {
40
41
  const [selectedResource, setSelectedResource] = (0, import_react.useState)("");
41
- const { times, resources, appointmentBooking, carts } = (0, import_context.useAppointmentBookingContext)();
42
+ const { times, resources, appointmentBooking, carts, setSelectedTime } = (0, import_context.useAppointmentBookingContext)();
42
43
  console.log(params, resources, times, "wh8765");
44
+ const getAutoSelect = async (val) => {
45
+ setSelectedTime(val);
46
+ const { errorList } = await appointmentBooking.autoSelectAllProductResources("sites", val);
47
+ const result = await appointmentBooking.submitTimeSlot(val);
48
+ console.log(errorList, result, "wh9896788");
49
+ };
50
+ (0, import_react.useEffect)(() => {
51
+ var _a;
52
+ if ((times == null ? void 0 : times.length) > 0) {
53
+ setSelectedResource((_a = times == null ? void 0 : times[0]) == null ? void 0 : _a.start_time);
54
+ getAutoSelect(times == null ? void 0 : times[0]);
55
+ }
56
+ }, [times]);
43
57
  const onClick = async (e) => {
44
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
45
58
  setSelectedResource(e == null ? void 0 : e.start_time);
46
- const data = await appointmentBooking.autoSelectResource({
47
- resourceProductData: resources == null ? void 0 : resources[0],
48
- resources: (_c = (_b = (_a = resources == null ? void 0 : resources[0]) == null ? void 0 : _a.resources) == null ? void 0 : _b[1]) == null ? void 0 : _c.renderList,
49
- timeSlots: e
50
- });
51
- if (data) {
52
- const _resources = [
53
- (_g = (_f = (_e = (_d = resources == null ? void 0 : resources[0]) == null ? void 0 : _d.resources) == null ? void 0 : _e[0]) == null ? void 0 : _f.renderList) == null ? void 0 : _g[0],
54
- (_k = (_j = (_i = (_h = resources == null ? void 0 : resources[0]) == null ? void 0 : _h.resources) == null ? void 0 : _i[1]) == null ? void 0 : _j.renderList) == null ? void 0 : _k[0]
55
- ];
56
- const aa = await appointmentBooking.submitTimeSlot({
57
- resourceProductData: resources == null ? void 0 : resources[0],
58
- selectedResources: _resources,
59
- timeSlots: e
60
- });
61
- console.log(data, _resources, aa, "wh9879676");
62
- }
59
+ getAutoSelect(e);
63
60
  };
64
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-time-slicing-wrap" }, times.map((item, index) => {
61
+ return (times == null ? void 0 : times.length) > 0 ? /* @__PURE__ */ import_react.default.createElement("div", { className: "appointment-time-slicing-wrap" }, times.map((item, index) => {
65
62
  return /* @__PURE__ */ import_react.default.createElement(
66
63
  "div",
67
64
  {
@@ -72,6 +69,11 @@ var Resource = ({ params }) => {
72
69
  /* @__PURE__ */ import_react.default.createElement("span", null, item == null ? void 0 : item.start_time),
73
70
  /* @__PURE__ */ import_react.default.createElement(import_materials.Iconfont, { type: "pisell2-chevron-right", className: `icon` })
74
71
  );
75
- }));
72
+ })) : /* @__PURE__ */ import_react.default.createElement(
73
+ import_materials.PisellEmpty,
74
+ {
75
+ description: import_utils.locales.getText("pisell2.appointment.booking.empty.time")
76
+ }
77
+ );
76
78
  };
77
79
  var TimeSlicing_default = Resource;
@@ -18,6 +18,10 @@
18
18
 
19
19
  &:hover {
20
20
  background-color: #f1f1f1;
21
+ cursor: pointer;
22
+ }
23
+ &.active {
24
+ background-color: #f1f1f1;
21
25
  }
22
26
  }
23
27
  }
@@ -42,6 +42,7 @@ var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContex
42
42
  var import_materials = require("@pisell/materials");
43
43
  var import_icons = require("@ant-design/icons");
44
44
  var import_hooks = require("../../hooks");
45
+ var import_utils2 = require("../../utils");
45
46
  var import_voucher = require("../../../booking/components/voucher/index.less");
46
47
  var import_index = require("./index.less");
47
48
  var ShopDiscountHooks = {
@@ -65,6 +66,8 @@ var VoucherCard = (props) => {
65
66
  const [code, setCode] = (0, import_react.useState)("");
66
67
  const [discountList, setDisCountList] = (0, import_react.useState)([]);
67
68
  const productRef = (0, import_react.useRef)(products);
69
+ const { openLoginModal } = (0, import_hooks.useAppointmentBookingLogin)();
70
+ const { accountLists } = (0, import_hooks.useAppointmentBookingAccount)();
68
71
  const cart = (_b = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _b.cart;
69
72
  const isUserLoggedIn = (0, import_react.useMemo)(() => {
70
73
  var _a2, _b2;
@@ -79,29 +82,30 @@ var VoucherCard = (props) => {
79
82
  });
80
83
  }, [discountList]);
81
84
  (0, import_react.useEffect)(() => {
82
- const shopDiscount2 = pisellos.getModule("shopDiscount");
83
- shopDiscount2.setCustomer(currentUser);
84
- }, [currentUser.id]);
85
+ if (isUserLoggedIn) {
86
+ const shopDiscount2 = pisellos.getModule("shopDiscount");
87
+ shopDiscount2.setCustomer(currentUser);
88
+ }
89
+ }, [currentUser.id, isUserLoggedIn]);
85
90
  (0, import_react.useEffect)(() => {
86
91
  shopDiscount.setProductList(products);
87
92
  }, [products]);
88
- (0, import_react.useEffect)(() => {
89
- if (productRef.current === products) {
90
- return;
91
- }
92
- const val = shopDiscount.calcDiscount(products);
93
- console.log("input: ", products);
94
- console.log("output: ", val);
95
- productRef.current = val.productList;
93
+ const onCartChange = () => {
94
+ const products2 = cart == null ? void 0 : cart.getItems();
95
+ const val = shopDiscount.calcDiscount(products2);
96
96
  cart == null ? void 0 : cart.batchSetItems(val.productList);
97
- }, [products]);
97
+ };
98
98
  (0, import_react.useEffect)(() => {
99
+ const val = shopDiscount.getDiscountList();
100
+ setDisCountList(val);
99
101
  pisellos.effects.on(
100
102
  ShopDiscountHooks.onLoadPrepareCalcResult,
101
103
  (result) => {
102
104
  cart == null ? void 0 : cart.batchSetItems(result.productList);
103
105
  }
104
106
  );
107
+ pisellos.effects.on("appointmentBooking_cart:onAddItem", onCartChange);
108
+ pisellos.effects.on("appointmentBooking_cart:onRemoveItem", onCartChange);
105
109
  pisellos.effects.on(
106
110
  ShopDiscountHooks.onDiscountListChange,
107
111
  (discount) => {
@@ -127,11 +131,17 @@ var VoucherCard = (props) => {
127
131
  className: "login-btn",
128
132
  onClick: () => {
129
133
  if (!action) return;
130
- action({
131
- type: "pisell1.login",
132
- data: {},
134
+ openLoginModal({
133
135
  callback: (status) => {
136
+ var _a2, _b2, _c;
137
+ const user = (_c = (_b2 = (_a2 = utils.store) == null ? void 0 : _a2.getState()) == null ? void 0 : _b2.global) == null ? void 0 : _c.userInfo;
138
+ const currentUser2 = (0, import_utils2.formatCustomer)(user);
139
+ const meAccount = accountLists == null ? void 0 : accountLists.find((d) => !(d == null ? void 0 : d.isGuest));
134
140
  if (status === "success") {
141
+ appointmentBooking.setLoginAccount(
142
+ meAccount == null ? void 0 : meAccount.id,
143
+ currentUser2
144
+ );
135
145
  }
136
146
  }
137
147
  });
@@ -178,7 +188,9 @@ var VoucherCard = (props) => {
178
188
  discountId: val.id,
179
189
  isSelected: val.isSelected
180
190
  });
181
- (_b2 = (_a2 = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a2.cart) == null ? void 0 : _b2.batchSetItems(detail.productList);
191
+ (_b2 = (_a2 = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a2.cart) == null ? void 0 : _b2.batchSetItems(
192
+ detail.productList
193
+ );
182
194
  }
183
195
  }
184
196
  ) : null,
@@ -19,6 +19,8 @@ interface AppointmentBookingContextType {
19
19
  symbolic?: any;
20
20
  resourceOtherParams?: any;
21
21
  setResourceOtherParams: (val: any) => void;
22
+ selectedTime: any;
23
+ setSelectedTime: (val: any) => void;
22
24
  }
23
25
  export declare const AppointmentBookingProvider: ({ children, }: {
24
26
  children: ReactNode;
@@ -52,6 +52,7 @@ var AppointmentBookingProvider = ({
52
52
  const [isLastStep, setIsLastStep] = (0, import_react.useState)(false);
53
53
  const [carts, setCarts] = (0, import_react.useState)([]);
54
54
  const [resourceOtherParams, setResourceOtherParams] = (0, import_react.useState)({});
55
+ const [selectedTime, setSelectedTime] = (0, import_react.useState)(null);
55
56
  const { appHelper } = (0, import_useEngineContext.default)();
56
57
  const symbolic = (_a = appHelper == null ? void 0 : appHelper.utils) == null ? void 0 : _a.getSymbolic();
57
58
  console.log(3234234, times, resources);
@@ -74,7 +75,9 @@ var AppointmentBookingProvider = ({
74
75
  appHelper,
75
76
  symbolic,
76
77
  resourceOtherParams,
77
- setResourceOtherParams
78
+ setResourceOtherParams,
79
+ selectedTime,
80
+ setSelectedTime
78
81
  };
79
82
  return /* @__PURE__ */ import_react.default.createElement(AppointmentBookingContext.Provider, { value }, children);
80
83
  };
@@ -1,25 +1,61 @@
1
1
  export declare const useAppointmentBooking: () => any;
2
2
  export declare const useShopDiscount: () => any;
3
+ /**
4
+ * @title: 监听步骤发生变化
5
+ * @description:
6
+ * @return {*}
7
+ * @Author: WangHan
8
+ * @Date: 2025-04-15 11:11
9
+ */
3
10
  export declare const useAppointmentBookingStep: () => void;
11
+ /**
12
+ * @title: 获取商品数据
13
+ * @description:
14
+ * @return {*}
15
+ * @Author: WangHan
16
+ * @Date: 2025-04-15 11:12
17
+ */
4
18
  export declare const useAppointmentBookingProduct: () => void;
5
- export declare const useAppointmentBookingCart: () => {
6
- cart: any;
7
- };
19
+ /**
20
+ * @title: 更新购物车数据
21
+ * @description:
22
+ * @return {*}
23
+ * @Author: WangHan
24
+ * @Date: 2025-04-15 11:12
25
+ */
26
+ export declare const useAppointmentBookingCart: () => void;
27
+ /**
28
+ * @title: 获取登录状态
29
+ * @description:
30
+ * @return {*}
31
+ * @Author: WangHan
32
+ * @Date: 2025-04-15 11:14
33
+ */
8
34
  export declare const useAppointmentBookingLogin: () => {
9
35
  isLogin: boolean;
10
36
  openLoginModal: (params: {
11
37
  callback: any;
12
38
  }) => void;
13
39
  };
40
+ /**
41
+ * @title: 获取账户
42
+ * @description:
43
+ * @return {*}
44
+ * @Author: WangHan
45
+ * @Date: 2025-04-15 11:15
46
+ */
14
47
  export declare const useAppointmentBookingAccount: () => {
15
- currentUser: {
16
- id: any;
17
- username: string;
18
- };
19
48
  accountLists: any;
20
49
  };
50
+ /**
51
+ * @title: 获取资源数据
52
+ * @description:
53
+ * @return {*}
54
+ * @Author: WangHan
55
+ * @Date: 2025-04-15 11:29
56
+ */
21
57
  export declare const useAppointmentBookingResource: () => {
22
58
  getResourceTimeSlot: (params: any) => Promise<void>;
23
- getResourceList: () => Promise<any>;
24
- autoSelectAllProductResources: (code: string) => Promise<void>;
59
+ getResourceList: () => any;
60
+ autoSelectAllProductResources: (code: string) => Promise<any>;
25
61
  };
@@ -39,11 +39,10 @@ __export(hooks_exports, {
39
39
  useShopDiscount: () => useShopDiscount
40
40
  });
41
41
  module.exports = __toCommonJS(hooks_exports);
42
+ var import_react = require("react");
42
43
  var import_useEngineContext = require("../../hooks/useEngineContext");
43
44
  var import_useEngineContext2 = __toESM(require("../../hooks/useEngineContext"));
44
- var import_utils = require("@pisell/utils");
45
- var import_utils2 = require("./utils");
46
- var import_react = require("react");
45
+ var import_utils = require("./utils");
47
46
  var import_context = require("./context");
48
47
  var useAppointmentBooking = () => {
49
48
  const pisellOS = (0, import_useEngineContext.usePisellOS)();
@@ -76,33 +75,29 @@ var useAppointmentBookingProduct = () => {
76
75
  const { productModuleParams } = appointmentBooking.otherParams;
77
76
  (0, import_react.useEffect)(() => {
78
77
  appointmentBooking.loadProducts(productModuleParams).then((res) => {
79
- console.log(res, "loadProductsloadProducts");
80
78
  setProducts(res || []);
81
79
  });
82
80
  }, []);
83
81
  };
84
82
  var useAppointmentBookingCart = () => {
85
- var _a, _b;
86
83
  const pisellOS = (0, import_useEngineContext.usePisellOS)();
87
84
  const { appointmentBooking, setCarts, setSummary } = (0, import_context.useAppointmentBookingContext)();
88
- const cart = (_b = (_a = appointmentBooking == null ? void 0 : appointmentBooking.store) == null ? void 0 : _a.cart) == null ? void 0 : _b.store;
85
+ const getCartAndSummary = async () => {
86
+ const carts = await appointmentBooking.getCart();
87
+ setCarts(carts || []);
88
+ const summary = await appointmentBooking.getSummary();
89
+ setSummary(summary || {});
90
+ console.log(carts, summary, "appointmentBooking_cart:changed");
91
+ };
89
92
  (0, import_react.useEffect)(() => {
90
- var _a2;
93
+ getCartAndSummary();
91
94
  pisellOS.effects.on(
92
95
  "appointmentBooking_cart:changed",
93
- async (res) => {
94
- const carts = await appointmentBooking.getCart();
95
- setCarts(carts || []);
96
- const summary = await appointmentBooking.getSummary();
97
- setSummary(summary || {});
98
- console.log(carts, summary, "appointmentBooking_cart:changed");
96
+ async () => {
97
+ getCartAndSummary();
99
98
  }
100
99
  );
101
- (_a2 = appointmentBooking == null ? void 0 : appointmentBooking.getCart) == null ? void 0 : _a2.call(appointmentBooking).then((data) => {
102
- setCarts(data || []);
103
- });
104
100
  }, []);
105
- return { cart };
106
101
  };
107
102
  var useAppointmentBookingLogin = () => {
108
103
  var _a, _b;
@@ -113,71 +108,63 @@ var useAppointmentBookingLogin = () => {
113
108
  const { callback } = params || {};
114
109
  utils.action({
115
110
  type: "pisell1.login",
116
- data: {},
111
+ data: {
112
+ type: "plugin"
113
+ },
117
114
  callback
118
115
  });
119
116
  };
120
117
  return { isLogin, openLoginModal };
121
118
  };
122
119
  var useAppointmentBookingAccount = () => {
123
- var _a, _b;
124
120
  const pisellOS = (0, import_useEngineContext.usePisellOS)();
125
- const context = (0, import_useEngineContext2.default)();
126
- const utils = context.appHelper.utils || {};
127
121
  const appointmentBooking = useAppointmentBooking();
128
122
  const [accountLists, setAccountLists] = (0, import_react.useState)([]);
129
- let userInfo = (_b = (_a = utils.getStore().getState()) == null ? void 0 : _a.global) == null ? void 0 : _b.userInfo;
130
- const localUserInfo = JSON.parse(utils.storage.get("customer") || "{}");
131
- userInfo = (userInfo == null ? void 0 : userInfo.id) ? userInfo : localUserInfo;
132
- let currentUserName = `${userInfo == null ? void 0 : userInfo.first_name} ${userInfo == null ? void 0 : userInfo.last_name}`;
133
- currentUserName = (currentUserName == null ? void 0 : currentUserName.trim()) || (userInfo == null ? void 0 : userInfo.nickname) || "Me";
134
- const currentUser = {
135
- id: (userInfo == null ? void 0 : userInfo.id) || (0, import_utils.getUniqueId)(),
136
- username: currentUserName
123
+ const getAccountLists = async () => {
124
+ var _a, _b, _c;
125
+ const data = await appointmentBooking.getAccounts();
126
+ setAccountLists(data || []);
127
+ console.log("currentUser4455777", appointmentBooking, (_c = (_b = (_a = appointmentBooking.store) == null ? void 0 : _a.accountList) == null ? void 0 : _b.store) == null ? void 0 : _c.accountList, data);
137
128
  };
138
129
  (0, import_react.useEffect)(() => {
139
130
  pisellOS.effects.on(
140
131
  "appointmentBooking_accountList:changed",
141
132
  async (res) => {
142
133
  if (res.path === "accounts") {
143
- appointmentBooking.getAccounts().then((data) => {
144
- setAccountLists(data || []);
145
- });
134
+ getAccountLists();
146
135
  }
147
136
  }
148
137
  );
149
- appointmentBooking.getAccounts().then((data) => {
150
- setAccountLists(data || []);
151
- });
138
+ getAccountLists();
152
139
  }, []);
153
- return { currentUser, accountLists };
140
+ return { accountLists };
154
141
  };
155
142
  var useAppointmentBookingResource = () => {
156
143
  const { appointmentBooking, setResources, setTimes, setResourceOtherParams, resourceOtherParams } = (0, import_context.useAppointmentBookingContext)();
157
144
  const { resourceSort } = (appointmentBooking == null ? void 0 : appointmentBooking.otherParams) || {};
158
- console.log(appointmentBooking, "appointmentBooking22");
159
145
  const getResourceTimeSlot = async (params) => {
160
- const data = await appointmentBooking.getResourceTimeSlot(params);
146
+ const data = await appointmentBooking.getTimeSlotByAllResources(params);
161
147
  setTimes(data || []);
162
148
  };
163
- const getResourceList = async () => {
149
+ const getResourceList = () => {
164
150
  let resources = appointmentBooking.getResourcesList();
165
151
  resources = resources.map((item) => {
166
152
  return {
167
153
  ...item,
168
- resources: (0, import_utils2.sortResources)((item == null ? void 0 : item.resources) || [], resourceSort)
154
+ resources: (0, import_utils.sortResources)((item == null ? void 0 : item.resources) || [], resourceSort)
169
155
  };
170
156
  });
171
157
  setResources(resources || []);
158
+ console.log(resources, "resourcesresources");
172
159
  return resources;
173
160
  };
174
161
  const autoSelectAllProductResources = async (code) => {
175
162
  let res = await appointmentBooking.autoSelectAllProductResources(code);
176
- console.log(res, "autoSelectAllProductResources");
177
163
  setResourceOtherParams({
178
164
  ...resourceOtherParams,
179
165
  ...res
180
166
  });
167
+ return res;
181
168
  };
182
169
  return { getResourceTimeSlot, getResourceList, autoSelectAllProductResources };
183
170
  };
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const AppointmentBooking: () => JSX.Element;
4
3
  export default AppointmentBooking;