@pisell/private-materials 3.3.33 → 3.3.35

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 (274) 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 +6 -6
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +8 -8
  11. package/es/components/Sales/Cart/index.js +26 -13
  12. package/es/components/Sales/Cart/types.d.ts +12 -0
  13. package/es/components/Sales/Cart/utils.d.ts +23 -0
  14. package/es/components/Sales/Cart/utils.js +161 -0
  15. package/es/components/Sales/Checkout/utils.d.ts +9 -1
  16. package/es/components/Sales/Checkout/utils.js +25 -3
  17. package/es/components/Sales/Event/Detail.d.ts +2 -0
  18. package/es/components/Sales/Event/Detail.js +56 -13
  19. package/es/components/Sales/Event/serve.d.ts +10 -0
  20. package/es/components/Sales/Event/serve.js +26 -1
  21. package/es/components/Sales/Summary/utils.js +1 -0
  22. package/es/components/appointmentBooking/components/Cart/ContinueButton/index.js +42 -20
  23. package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
  24. package/es/components/appointmentBooking/components/Cart/Item/index.js +10 -29
  25. package/es/components/appointmentBooking/components/Cart/index.d.ts +0 -1
  26. package/es/components/appointmentBooking/components/ConfirmInformation/index.js +156 -53
  27. package/es/components/appointmentBooking/components/ConfirmInformation/utils.d.ts +12 -0
  28. package/es/components/appointmentBooking/components/ConfirmInformation/utils.js +17 -0
  29. package/es/components/appointmentBooking/components/Content/index.js +28 -44
  30. package/es/components/appointmentBooking/components/Content/index.less +23 -1
  31. package/es/components/appointmentBooking/components/Deposit/index.d.ts +0 -1
  32. package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -1
  33. package/es/components/appointmentBooking/components/Footer/index.js +5 -5
  34. package/es/components/appointmentBooking/components/Form/index.js +161 -61
  35. package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  36. package/es/components/appointmentBooking/components/Header/index.js +47 -61
  37. package/es/components/appointmentBooking/components/Resource/index.js +102 -119
  38. package/es/components/appointmentBooking/components/Services/index.js +50 -25
  39. package/es/components/appointmentBooking/components/TimeSlicing/index.js +12 -5
  40. package/es/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
  41. package/es/components/appointmentBooking/context.js +3 -43
  42. package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -1
  43. package/es/components/appointmentBooking/deposit/index.d.ts +0 -1
  44. package/es/components/appointmentBooking/hooks.d.ts +3 -1
  45. package/es/components/appointmentBooking/hooks.js +215 -294
  46. package/es/components/appointmentBooking/utils.d.ts +2 -88
  47. package/es/components/appointmentBooking/utils.js +63 -325
  48. package/es/components/booking/addons/model.js +5 -5
  49. package/es/components/booking/components/TabProduct/index.d.ts +0 -1
  50. package/es/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
  51. package/es/components/booking/components/TabProduct/selectProductItem/index.js +4 -4
  52. package/es/components/booking/components/TabProduct/tabs/index.js +1 -5
  53. package/es/components/booking/components/browserSelect/index.js +1 -1
  54. package/es/components/booking/components/voucher/index.d.ts +0 -1
  55. package/es/components/booking/forms/model.js +5 -5
  56. package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  57. package/es/components/booking/forms/single/index.d.ts +0 -1
  58. package/es/components/booking/hooks/useClearCart.d.ts +0 -1
  59. package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
  60. package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
  61. package/es/components/booking/info/date/index.d.ts +0 -1
  62. package/es/components/booking/info/dateRange/index.d.ts +0 -1
  63. package/es/components/booking/info/service/actions/index.d.ts +0 -1
  64. package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
  65. package/es/components/booking/info/service/like/index.js +1 -1
  66. package/es/components/booking/info/service/serviceItem/index.d.ts +0 -1
  67. package/es/components/booking/info/service/serviceList/index.d.ts +0 -1
  68. package/es/components/booking/info/service2/Lists.d.ts +0 -1
  69. package/es/components/booking/info/utils.js +1 -1
  70. package/es/components/booking/info2/service/actions/index.d.ts +0 -1
  71. package/es/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
  72. package/es/components/booking/info2/service/serviceItem/index.d.ts +0 -1
  73. package/es/components/booking/info2/service/serviceList/index.d.ts +0 -1
  74. package/es/components/booking/materiels/duration/index.d.ts +0 -1
  75. package/es/components/booking/materiels/holder/index.d.ts +0 -1
  76. package/es/components/booking/materiels/startTime/index.d.ts +0 -1
  77. package/es/components/booking/materiels/startTime/index.js +1 -1
  78. package/es/components/booking/notes/NoteBlock/NoteItem/index.js +1 -1
  79. package/es/components/booking/notes/NoteBlock/index.js +11 -11
  80. package/es/components/booking/notes/model.js +5 -5
  81. package/es/components/booking/payments/model.js +5 -5
  82. package/es/components/booking/utils.d.ts +2 -2
  83. package/es/components/booking/utils.js +19 -11
  84. package/es/components/eftposPay/amount.d.ts +1 -1
  85. package/es/components/eftposPay/device.d.ts +1 -1
  86. package/es/components/eftposPay/hooks.d.ts +1 -1
  87. package/es/components/eftposPay/store/index.d.ts +3 -3
  88. package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  89. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +218 -73
  90. package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -1
  91. package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
  92. package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
  93. package/es/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
  94. package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
  95. package/es/components/eventBooking/components/Provider/Information/index.d.ts +0 -1
  96. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  97. package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
  98. package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
  99. package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
  100. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  101. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  102. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  103. package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +3 -2
  104. package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +7 -4
  105. package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
  106. package/es/components/eventBooking/components/bookingDetailModal/index.js +70 -13
  107. package/es/components/listComponent/index.js +5 -5
  108. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  109. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  110. package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
  111. package/es/components/pisellSelectCustomerModal/index.d.ts +0 -1
  112. package/es/components/productExtension/card/index.js +3 -3
  113. package/es/components/productExtension/fields/Actor/CutOffTime/index.js +1 -1
  114. package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
  115. package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
  116. package/es/components/productExtension/fields/Forms/index.js +12 -12
  117. package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.js +1 -1
  118. package/es/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
  119. package/es/components/productExtension/fields/SelectProducts/server.js +2 -2
  120. package/es/components/productExtension/fields/SelectResourcesTable/server.js +2 -2
  121. package/es/components/productExtension/index.d.ts +0 -1
  122. package/es/components/productExtension/server.js +2 -2
  123. package/es/components/productSelect/components/TabProduct/index.d.ts +0 -1
  124. package/es/components/productSelect/components/TabProduct/index.js +4 -2
  125. package/es/components/productSelect/components/productGroup/index.d.ts +0 -1
  126. package/es/components/ruleSetting/ruleBorder/index.js +1 -1
  127. package/es/components/schedules/calendar/index.js +4 -4
  128. package/es/components/schedules/calendar/serve.js +2 -2
  129. package/es/components/schedules/components/CurrentDay/index.js +5 -5
  130. package/es/components/schedules/components/CurrentDay/serve.js +2 -2
  131. package/es/components/schedules/components/DropdownSort/index.js +1 -1
  132. package/es/components/schedules/components/ResourceList/index.js +1 -1
  133. package/es/components/schedules/components/Search/index.js +5 -5
  134. package/es/components/schedules/model.js +5 -5
  135. package/es/components/schedules/openHours/index.js +1 -1
  136. package/es/components/schedules/openHours/serve.js +2 -2
  137. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.js +1 -1
  138. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.js +5 -5
  139. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.js +4 -4
  140. package/es/components/schedules/products/ProductDetailDrawer/index.js +3 -3
  141. package/es/components/schedules/products/serve.js +2 -2
  142. package/es/components/schedules/products/utils.js +5 -5
  143. package/es/components/schedules/resources/detail/detailContent.js +2 -2
  144. package/es/components/schedules/resources/detail/index.js +10 -10
  145. package/es/components/schedules/resources/list/index.js +2 -2
  146. package/es/components/schedules/resources/relationProduct/index.js +1 -1
  147. package/es/components/schedules/resources/serve.js +2 -2
  148. package/es/components/schedules/schedules/ScheduleDetailDrawer/index.js +9 -9
  149. package/es/components/schedules/utils.d.ts +1 -1
  150. package/es/components/schedules/utils.js +4 -4
  151. package/es/components/selectModal/index.js +2 -2
  152. package/es/components/shoppingCart/components/Cart/index.d.ts +0 -1
  153. package/es/components/shoppingCart/hooks/useAddService.d.ts +0 -1
  154. package/es/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
  155. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  156. package/es/components/ticketBooking/components/timeBar/index.d.ts +0 -1
  157. package/es/components/ticketBooking/index.d.ts +0 -1
  158. package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
  159. package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
  160. package/es/hooks/useComponents.js +1 -1
  161. package/es/utils/index.d.ts +1 -1
  162. package/lib/components/Sales/Cart/index.js +30 -18
  163. package/lib/components/Sales/Cart/types.d.ts +12 -0
  164. package/lib/components/Sales/Cart/utils.d.ts +23 -0
  165. package/lib/components/Sales/Cart/utils.js +149 -0
  166. package/lib/components/Sales/Checkout/utils.d.ts +9 -1
  167. package/lib/components/Sales/Checkout/utils.js +18 -4
  168. package/lib/components/Sales/Event/Detail.d.ts +2 -0
  169. package/lib/components/Sales/Event/Detail.js +34 -10
  170. package/lib/components/Sales/Event/serve.d.ts +10 -0
  171. package/lib/components/Sales/Event/serve.js +5 -2
  172. package/lib/components/Sales/Summary/utils.js +1 -0
  173. package/lib/components/appointmentBooking/components/Cart/ContinueButton/index.js +7 -2
  174. package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
  175. package/lib/components/appointmentBooking/components/Cart/Item/index.js +10 -34
  176. package/lib/components/appointmentBooking/components/Cart/index.d.ts +0 -1
  177. package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +43 -6
  178. package/lib/components/appointmentBooking/components/ConfirmInformation/utils.d.ts +12 -0
  179. package/lib/components/appointmentBooking/components/ConfirmInformation/utils.js +37 -0
  180. package/lib/components/appointmentBooking/components/Content/index.js +28 -42
  181. package/lib/components/appointmentBooking/components/Content/index.less +23 -1
  182. package/lib/components/appointmentBooking/components/Deposit/index.d.ts +0 -1
  183. package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -1
  184. package/lib/components/appointmentBooking/components/Form/index.js +98 -54
  185. package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  186. package/lib/components/appointmentBooking/components/Header/index.js +19 -36
  187. package/lib/components/appointmentBooking/components/Resource/index.js +59 -41
  188. package/lib/components/appointmentBooking/components/Services/index.js +18 -10
  189. package/lib/components/appointmentBooking/components/TimeSlicing/index.js +7 -1
  190. package/lib/components/appointmentBooking/components/Voucher/index.d.ts +0 -1
  191. package/lib/components/appointmentBooking/context.js +4 -48
  192. package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +0 -1
  193. package/lib/components/appointmentBooking/deposit/index.d.ts +0 -1
  194. package/lib/components/appointmentBooking/hooks.d.ts +3 -1
  195. package/lib/components/appointmentBooking/hooks.js +62 -142
  196. package/lib/components/appointmentBooking/utils.d.ts +2 -88
  197. package/lib/components/appointmentBooking/utils.js +51 -191
  198. package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
  199. package/lib/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
  200. package/lib/components/booking/components/voucher/index.d.ts +0 -1
  201. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  202. package/lib/components/booking/forms/single/index.d.ts +0 -1
  203. package/lib/components/booking/hooks/useClearCart.d.ts +0 -1
  204. package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
  205. package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
  206. package/lib/components/booking/info/date/index.d.ts +0 -1
  207. package/lib/components/booking/info/dateRange/index.d.ts +0 -1
  208. package/lib/components/booking/info/service/actions/index.d.ts +0 -1
  209. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
  210. package/lib/components/booking/info/service/serviceItem/index.d.ts +0 -1
  211. package/lib/components/booking/info/service/serviceList/index.d.ts +0 -1
  212. package/lib/components/booking/info/service2/Lists.d.ts +0 -1
  213. package/lib/components/booking/info/utils.js +1 -1
  214. package/lib/components/booking/info2/service/actions/index.d.ts +0 -1
  215. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +0 -1
  216. package/lib/components/booking/info2/service/serviceItem/index.d.ts +0 -1
  217. package/lib/components/booking/info2/service/serviceList/index.d.ts +0 -1
  218. package/lib/components/booking/materiels/duration/index.d.ts +0 -1
  219. package/lib/components/booking/materiels/holder/index.d.ts +0 -1
  220. package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
  221. package/lib/components/booking/utils.d.ts +2 -2
  222. package/lib/components/booking/utils.js +5 -1
  223. package/lib/components/eftposPay/amount.d.ts +1 -1
  224. package/lib/components/eftposPay/device.d.ts +1 -1
  225. package/lib/components/eftposPay/hooks.d.ts +1 -1
  226. package/lib/components/eftposPay/store/index.d.ts +3 -3
  227. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  228. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +128 -42
  229. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +0 -1
  230. package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
  231. package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
  232. package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
  233. package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
  234. package/lib/components/eventBooking/components/Provider/Information/index.d.ts +0 -1
  235. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  236. package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
  237. package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
  238. package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
  239. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  240. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  241. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  242. package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +3 -2
  243. package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +7 -2
  244. package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
  245. package/lib/components/eventBooking/components/bookingDetailModal/index.js +79 -24
  246. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  247. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  248. package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
  249. package/lib/components/pisellSelectCustomerModal/index.d.ts +0 -1
  250. package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
  251. package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
  252. package/lib/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
  253. package/lib/components/productExtension/index.d.ts +0 -1
  254. package/lib/components/productSelect/components/TabProduct/index.d.ts +0 -1
  255. package/lib/components/productSelect/components/TabProduct/index.js +6 -2
  256. package/lib/components/productSelect/components/productGroup/index.d.ts +0 -1
  257. package/lib/components/schedules/utils.d.ts +1 -1
  258. package/lib/components/schedules/utils.js +1 -1
  259. package/lib/components/shoppingCart/components/Cart/index.d.ts +0 -1
  260. package/lib/components/shoppingCart/hooks/useAddService.d.ts +0 -1
  261. package/lib/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
  262. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +0 -1
  263. package/lib/components/ticketBooking/components/timeBar/index.d.ts +0 -1
  264. package/lib/components/ticketBooking/index.d.ts +0 -1
  265. package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
  266. package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
  267. package/lib/utils/index.d.ts +1 -1
  268. package/package.json +1 -1
  269. package/es/components/eventBooking/components/Provider/SelectProduct/index.d.ts +0 -4
  270. package/es/components/eventBooking/components/Provider/SelectProduct/index.js +0 -77
  271. package/es/components/eventBooking/components/Provider/SelectProduct/index.less +0 -131
  272. package/lib/components/eventBooking/components/Provider/SelectProduct/index.d.ts +0 -4
  273. package/lib/components/eventBooking/components/Provider/SelectProduct/index.js +0 -69
  274. package/lib/components/eventBooking/components/Provider/SelectProduct/index.less +0 -131
@@ -17,9 +17,9 @@ import { useState, useEffect, useMemo } from 'react';
17
17
  import { locales } from "@pisell/utils";
18
18
  import { usePisellOS } from "../../hooks/useEngineContext";
19
19
  import useEngineContext from "../../hooks/useEngineContext";
20
- import { sortResources, getCustomer, currentAppointmentBoard, currentRenderLists, getFormInsertBeforeKey, checkAndGoNext, checkAndMarkCartRenderError, formatCustomer, formatHolder } from "./utils";
20
+ import { sortResources, getCustomer, formatCartsResources, checkHasFormStep } from "./utils";
21
21
  import { useAppointmentBookingContext } from "./context";
22
- import { scrollToFirstErrorCard } from "./components/Resource/utils";
22
+ import { checkHolder } from "./components/Cart/utils";
23
23
  export var useAppointmentBooking = function useAppointmentBooking() {
24
24
  var pisellOS = usePisellOS();
25
25
  return pisellOS.getModule('appointmentBooking');
@@ -45,29 +45,14 @@ export var contextUtils = function contextUtils() {
45
45
  export var useAppointmentBookingStep = function useAppointmentBookingStep() {
46
46
  var _appointmentBooking$s;
47
47
  var pisellOS = usePisellOS();
48
- var _ref = useAppointmentBookingContext(),
49
- appointmentBooking = _ref.appointmentBooking,
50
- setCurrentStep = _ref.setCurrentStep,
51
- carts = _ref.carts,
52
- openPolicy = _ref.openPolicy,
53
- setCarts = _ref.setCarts,
54
- setLoading = _ref.setLoading,
55
- currentSelectedResourcesRef = _ref.currentSelectedResourcesRef,
56
- currentStepParams = _ref.currentStepParams,
57
- setIsErrorHolder = _ref.setIsErrorHolder;
58
- var stepList = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s = appointmentBooking.store) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.step) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.store) === null || _appointmentBooking$s === void 0 ? void 0 : _appointmentBooking$s.stepList) || [];
59
- var _useAppointmentBookin = useAppointmentBookingLogin(),
60
- isLogin = _useAppointmentBookin.isLogin,
61
- openLoginModal = _useAppointmentBookin.openLoginModal;
48
+ var _useAppointmentBookin = useAppointmentBookingContext(),
49
+ appointmentBooking = _useAppointmentBookin.appointmentBooking,
50
+ setCurrentStep = _useAppointmentBookin.setCurrentStep,
51
+ policyIdsRef = _useAppointmentBookin.policyIdsRef,
52
+ openPolicy = _useAppointmentBookin.openPolicy;
62
53
  var _useAppointmentBookin2 = useAppointmentBookingSetting(),
63
- isFormSubject = _useAppointmentBookin2.isFormSubject;
64
- var _useAppointmentBookin3 = useAppointmentBookingAccount(),
65
- accountLists = _useAppointmentBookin3.accountLists,
66
- getHolders = _useAppointmentBookin3.getHolders,
67
- checkAccount = _useAppointmentBookin3.checkAccount;
68
- var _useAppointmentBookin4 = useAppointmentBookingResource(),
69
- getResourceList = _useAppointmentBookin4.getResourceList;
70
- var utils = contextUtils();
54
+ isRetailTemplate = _useAppointmentBookin2.isRetailTemplate;
55
+ var stepList = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s = appointmentBooking.store) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.step) === null || _appointmentBooking$s === void 0 || (_appointmentBooking$s = _appointmentBooking$s.store) === null || _appointmentBooking$s === void 0 ? void 0 : _appointmentBooking$s.stepList) || [];
71
56
 
72
57
  // 判断是否是最后一步
73
58
  var getCurrentAndLastStep = function getCurrentAndLastStep() {
@@ -77,7 +62,7 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
77
62
  useEffect(function () {
78
63
  getCurrentAndLastStep();
79
64
  pisellOS.effects.on('appointmentBooking_step:changed', /*#__PURE__*/function () {
80
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {
65
+ var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(res) {
81
66
  return _regeneratorRuntime().wrap(function _callee$(_context) {
82
67
  while (1) switch (_context.prev = _context.next) {
83
68
  case 0:
@@ -91,7 +76,7 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
91
76
  }, _callee);
92
77
  }));
93
78
  return function (_x) {
94
- return _ref2.apply(this, arguments);
79
+ return _ref.apply(this, arguments);
95
80
  };
96
81
  }());
97
82
  }, []);
@@ -139,145 +124,35 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
139
124
 
140
125
  // 下一步
141
126
  var nextStep = function nextStep() {
142
- var _nextStep$key;
143
- var stepList = (currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.stepLists) || [];
144
- var currentKey = currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.key;
145
- if (currentKey !== null && currentKey !== void 0 && currentKey.startsWith('select-resource')) {
146
- var _currentSelectedResou, _currentSelectedResou2;
147
- // 1. 检测购物车中是否选择了资源
148
- var _checkAndMarkCartRend = checkAndMarkCartRenderError((currentSelectedResourcesRef === null || currentSelectedResourcesRef === void 0 ? void 0 : currentSelectedResourcesRef.current) || [], appointmentBooking, utils),
149
- hasError = _checkAndMarkCartRend.hasError,
150
- updatedCartList = _checkAndMarkCartRend.updatedCartList;
151
- if (hasError) {
152
- // setCarts(updatedCartList)
153
- scrollToFirstErrorCard();
154
- return;
155
- }
156
-
157
- // 2. 插入表单步骤
158
- currentSelectedResourcesRef === null || currentSelectedResourcesRef === void 0 || (_currentSelectedResou = currentSelectedResourcesRef.current) === null || _currentSelectedResou === void 0 || _currentSelectedResou.forEach(function (cart) {
159
- var _selectedResource$ren, _selectedResource$ren2;
160
- var selectedResource = cart === null || cart === void 0 ? void 0 : cart.currentSelectedResource;
161
- var resourceItem = (selectedResource === null || selectedResource === void 0 ? void 0 : selectedResource.resourceItem) || {};
162
- var formId = selectedResource === null || selectedResource === void 0 || (_selectedResource$ren = selectedResource.renderItem) === null || _selectedResource$ren === void 0 ? void 0 : _selectedResource$ren.resource_form_id;
163
- var policyId = selectedResource === null || selectedResource === void 0 || (_selectedResource$ren2 = selectedResource.renderItem) === null || _selectedResource$ren2 === void 0 ? void 0 : _selectedResource$ren2.policy_id;
164
- var formKey = "fill-form_@".concat(resourceItem === null || resourceItem === void 0 ? void 0 : resourceItem.form_id, "-").concat(resourceItem === null || resourceItem === void 0 ? void 0 : resourceItem.code, "-").concat(cart === null || cart === void 0 ? void 0 : cart._id, "-").concat(formId, "-").concat(policyId);
165
-
166
- // 如果有表单id则插入表单步骤
167
- if (formId) {
168
- var description = locales.getText('pisell2.appointment.fill-form');
169
- var beforeKey = getFormInsertBeforeKey(currentKey, stepList);
170
- appointmentBooking.addStep({
171
- key: formKey,
172
- description: description
173
- }, beforeKey);
174
- } else {
175
- appointmentBooking.removeStep(formKey);
176
- }
177
- });
178
-
179
- // 3. 插入下一个资源步骤
180
- var selectedResource = currentSelectedResourcesRef === null || currentSelectedResourcesRef === void 0 || (_currentSelectedResou2 = currentSelectedResourcesRef.current) === null || _currentSelectedResou2 === void 0 || (_currentSelectedResou2 = _currentSelectedResou2[0]) === null || _currentSelectedResou2 === void 0 ? void 0 : _currentSelectedResou2.currentSelectedResource;
181
- if (selectedResource) {
182
- var _selectedResource$res;
183
- var originRenderLists = (selectedResource === null || selectedResource === void 0 || (_selectedResource$res = selectedResource.resourceItem) === null || _selectedResource$res === void 0 ? void 0 : _selectedResource$res.originRenderLists) || [];
184
- var currentResourceIndex = originRenderLists === null || originRenderLists === void 0 ? void 0 : originRenderLists.findIndex(function (item) {
185
- var _selectedResource$ren3;
186
- return item.id === (selectedResource === null || selectedResource === void 0 || (_selectedResource$ren3 = selectedResource.renderItem) === null || _selectedResource$ren3 === void 0 ? void 0 : _selectedResource$ren3.form_id);
187
- });
188
- var nextResource = originRenderLists === null || originRenderLists === void 0 ? void 0 : originRenderLists[currentResourceIndex + 1];
189
- var resourceKey = "select-resource_@".concat(nextResource === null || nextResource === void 0 ? void 0 : nextResource.form_id, "-").concat(nextResource === null || nextResource === void 0 ? void 0 : nextResource.code);
190
-
191
- // 如果有下一个资源数据,则插入下一个资源步骤
192
- if (nextResource) {
193
- var _stepList;
194
- var beforeKey = (_stepList = stepList[stepList.length - 2]) === null || _stepList === void 0 ? void 0 : _stepList.key;
195
- appointmentBooking.addStep({
196
- key: resourceKey,
197
- description: ''
198
- }, beforeKey);
199
- } else {
200
- appointmentBooking.removeStep(resourceKey);
201
- }
202
- }
127
+ var _appointmentBooking$s2;
128
+ if (isRetailTemplate) {
129
+ return appointmentBooking.next();
203
130
  }
204
-
205
- // 4. 检测是否登录和打开协议弹窗
206
- var nextStep = stepList[(currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.index) + 1];
207
- if (nextStep !== null && nextStep !== void 0 && (_nextStep$key = nextStep.key) !== null && _nextStep$key !== void 0 && _nextStep$key.startsWith('select-resource_') || (nextStep === null || nextStep === void 0 ? void 0 : nextStep.key) === 'confirm-information') {
208
- var _currentSelectedResou3;
209
- var _selectedResource = (_currentSelectedResou3 = currentSelectedResourcesRef.current) === null || _currentSelectedResou3 === void 0 || (_currentSelectedResou3 = _currentSelectedResou3[0]) === null || _currentSelectedResou3 === void 0 ? void 0 : _currentSelectedResou3.currentSelectedResource;
210
- var renderItem = (_selectedResource === null || _selectedResource === void 0 ? void 0 : _selectedResource.renderItem) || {};
211
-
212
- // 监测holder数据
213
- var checkHolder = function checkHolder() {
214
- setLoading(false);
215
- var _checkAndGoNext = checkAndGoNext(isFormSubject, checkAccount, carts),
216
- hasError = _checkAndGoNext.hasError,
217
- updatedCartList = _checkAndGoNext.updatedCartList;
218
- if (hasError) {
219
- setIsErrorHolder(hasError);
220
- setCarts(updatedCartList);
221
- return;
222
- }
223
- if (!!(renderItem !== null && renderItem !== void 0 && renderItem.policy_id)) {
224
- openPolicy({
225
- id: renderItem === null || renderItem === void 0 ? void 0 : renderItem.policy_id
226
- }, function () {
227
- return appointmentBooking.next();
228
- });
229
- } else {
230
- return appointmentBooking.next();
231
- }
232
- };
233
-
234
- // 检测是否登录
235
- var checkLogin = function checkLogin() {
236
- // 如果没有登录,则验证登录
237
- if (!isLogin) {
238
- return openLoginModal({
239
- callback: function callback(status) {
240
- if (status === 'success') {
241
- if (!isFormSubject) {
242
- var _utils$storage;
243
- var user = JSON.parse((utils === null || utils === void 0 || (_utils$storage = utils.storage) === null || _utils$storage === void 0 ? void 0 : _utils$storage.get('customer')) || '{}');
244
- var currentUser = formatCustomer(user);
245
- var meAccount = accountLists === null || accountLists === void 0 ? void 0 : accountLists.find(function (d) {
246
- return !(d !== null && d !== void 0 && d.isGuest);
247
- });
248
- appointmentBooking.setLoginAccount(meAccount === null || meAccount === void 0 ? void 0 : meAccount.id, currentUser);
249
- } else {
250
- getHolders();
251
- }
252
-
253
- // 继续后续流程
254
- checkHolder();
255
- }
256
- }
257
- });
258
- } else {
259
- return checkHolder();
260
- }
261
- };
262
-
263
- // 如果下一步不是确认信息,则打开协议弹窗
264
- if ((nextStep === null || nextStep === void 0 ? void 0 : nextStep.key) !== 'confirm-information') {
265
- if (!(renderItem !== null && renderItem !== void 0 && renderItem.policy_id)) {
266
- return appointmentBooking.next();
267
- }
268
- return openPolicy({
269
- id: renderItem === null || renderItem === void 0 ? void 0 : renderItem.policy_id
270
- }, function () {
271
- // 触发购物车数据发生改变,重新得出当前的资源
272
- var cartItem = carts === null || carts === void 0 ? void 0 : carts[0];
273
- appointmentBooking.updateCart(_objectSpread({
274
- _id: cartItem === null || cartItem === void 0 ? void 0 : cartItem._id
275
- }, cartItem));
276
- appointmentBooking.next();
277
- });
278
- } else {
279
- // 如果下一步是确认信息,则检测是否需要登录和检测holder数据
280
- return checkLogin();
131
+ var currentStep = appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.getCurrentStep();
132
+ var stepList = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s2 = appointmentBooking.store) === null || _appointmentBooking$s2 === void 0 || (_appointmentBooking$s2 = _appointmentBooking$s2.step) === null || _appointmentBooking$s2 === void 0 || (_appointmentBooking$s2 = _appointmentBooking$s2.store) === null || _appointmentBooking$s2 === void 0 ? void 0 : _appointmentBooking$s2.stepList) || [];
133
+
134
+ // 倒数第二步
135
+ if ((currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) + 2 === (stepList === null || stepList === void 0 ? void 0 : stepList.length)) {
136
+ var _policyIdsRef$current;
137
+ // 如果没有同意资源上挂接的协议,则打开协议弹窗
138
+ if (policyIdsRef !== null && policyIdsRef !== void 0 && (_policyIdsRef$current = policyIdsRef.current) !== null && _policyIdsRef$current !== void 0 && _policyIdsRef$current.length) {
139
+ // 依次弹出所有协议
140
+ var idx = 0;
141
+ var showNextPolicy = function showNextPolicy() {
142
+ if (idx < policyIdsRef.current.length) {
143
+ openPolicy({
144
+ id: policyIdsRef.current[idx]
145
+ }, function () {
146
+ idx++;
147
+ showNextPolicy();
148
+ });
149
+ } else {
150
+ // 全部同意后,进入下一步
151
+ appointmentBooking.next();
152
+ }
153
+ };
154
+ showNextPolicy();
155
+ return;
281
156
  }
282
157
  }
283
158
  appointmentBooking.next();
@@ -300,17 +175,17 @@ export var useAppointmentBookingStep = function useAppointmentBookingStep() {
300
175
  * @Date: 2025-04-15 11:12
301
176
  */
302
177
  export var useAppointmentBookingProduct = function useAppointmentBookingProduct() {
303
- var _ref3 = useAppointmentBookingContext(),
304
- appointmentBooking = _ref3.appointmentBooking;
305
- var _ref4 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {},
306
- productModuleParams = _ref4.productModuleParams;
307
- var _ref5 = productModuleParams || {},
308
- bookingProcess = _ref5.bookingProcess;
178
+ var _ref2 = useAppointmentBookingContext(),
179
+ appointmentBooking = _ref2.appointmentBooking;
180
+ var _ref3 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {},
181
+ productModuleParams = _ref3.productModuleParams;
182
+ var _ref4 = productModuleParams || {},
183
+ bookingProcess = _ref4.bookingProcess;
309
184
 
310
185
  // 获取商品列表
311
186
  var getProducts = /*#__PURE__*/function () {
312
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
313
- var _dates$, dates, _ref7, _productModuleParams, _productList, _ref8, productModuleParams, productList;
187
+ var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
188
+ var _dates$, dates, _ref6, _productModuleParams, _productList, _ref7, productModuleParams, productList;
314
189
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
315
190
  while (1) switch (_context2.prev = _context2.next) {
316
191
  case 0:
@@ -328,7 +203,7 @@ export var useAppointmentBookingProduct = function useAppointmentBookingProduct(
328
203
  }
329
204
  return _context2.abrupt("return");
330
205
  case 6:
331
- _ref7 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {}, _productModuleParams = _ref7.productModuleParams;
206
+ _ref6 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {}, _productModuleParams = _ref6.productModuleParams;
332
207
  _context2.next = 9;
333
208
  return appointmentBooking.loadProductByScheduleDate(_objectSpread({
334
209
  date: (_dates$ = dates[0]) === null || _dates$ === void 0 ? void 0 : _dates$.date
@@ -338,7 +213,7 @@ export var useAppointmentBookingProduct = function useAppointmentBookingProduct(
338
213
  return _context2.abrupt("return", _productList);
339
214
  case 11:
340
215
  // 先选商品
341
- _ref8 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {}, productModuleParams = _ref8.productModuleParams;
216
+ _ref7 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {}, productModuleParams = _ref7.productModuleParams;
342
217
  _context2.next = 14;
343
218
  return appointmentBooking.loadProducts(productModuleParams);
344
219
  case 14:
@@ -351,13 +226,13 @@ export var useAppointmentBookingProduct = function useAppointmentBookingProduct(
351
226
  }, _callee2);
352
227
  }));
353
228
  return function getProducts() {
354
- return _ref6.apply(this, arguments);
229
+ return _ref5.apply(this, arguments);
355
230
  };
356
231
  }();
357
232
 
358
233
  // 检测商品类型
359
234
  var checkProductType = /*#__PURE__*/function () {
360
- var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(productId) {
235
+ var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(productId) {
361
236
  var result;
362
237
  return _regeneratorRuntime().wrap(function _callee3$(_context3) {
363
238
  while (1) switch (_context3.prev = _context3.next) {
@@ -374,7 +249,7 @@ export var useAppointmentBookingProduct = function useAppointmentBookingProduct(
374
249
  }, _callee3);
375
250
  }));
376
251
  return function checkProductType(_x2) {
377
- return _ref9.apply(this, arguments);
252
+ return _ref8.apply(this, arguments);
378
253
  };
379
254
  }();
380
255
  return {
@@ -394,51 +269,32 @@ export var useAppointmentBookingCart = function useAppointmentBookingCart() {
394
269
  var _appointmentBooking$o;
395
270
  var pisellOS = usePisellOS();
396
271
  var utils = contextUtils();
397
- var _ref10 = useAppointmentBookingContext(),
398
- appointmentBooking = _ref10.appointmentBooking,
399
- isErrorHolder = _ref10.isErrorHolder,
400
- setCarts = _ref10.setCarts,
401
- setSummary = _ref10.setSummary,
402
- setIsAgreeDepositPolicy = _ref10.setIsAgreeDepositPolicy;
403
- var _ref11 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o = appointmentBooking.otherParams) === null || _appointmentBooking$o === void 0 ? void 0 : _appointmentBooking$o.productModuleParams) || {},
404
- bookingSubject = _ref11.bookingSubject;
272
+ var _useAppointmentBookin3 = useAppointmentBookingContext(),
273
+ appointmentBooking = _useAppointmentBookin3.appointmentBooking,
274
+ setCarts = _useAppointmentBookin3.setCarts,
275
+ setSummary = _useAppointmentBookin3.setSummary,
276
+ setIsAgreeDepositPolicy = _useAppointmentBookin3.setIsAgreeDepositPolicy;
277
+ var _ref9 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o = appointmentBooking.otherParams) === null || _appointmentBooking$o === void 0 ? void 0 : _appointmentBooking$o.productModuleParams) || {},
278
+ bookingSubject = _ref9.bookingSubject;
405
279
  var getCartAndSummary = /*#__PURE__*/function () {
406
- var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
407
- var _utils$storage2;
408
- var locale, symbol, carts, accountLists, newCarts, summary;
280
+ var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
281
+ var carts, newCarts, summary;
409
282
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
410
283
  while (1) switch (_context4.prev = _context4.next) {
411
284
  case 0:
412
- locale = (utils === null || utils === void 0 || (_utils$storage2 = utils.storage) === null || _utils$storage2 === void 0 ? void 0 : _utils$storage2.get('umi_locale')) || 'en-US';
413
- symbol = (utils === null || utils === void 0 ? void 0 : utils.getSymbolic()) || '$';
414
- _context4.next = 4;
285
+ _context4.next = 2;
415
286
  return appointmentBooking.getCart();
416
- case 4:
287
+ case 2:
417
288
  carts = _context4.sent;
418
- _context4.next = 7;
419
- return appointmentBooking.getAccounts();
420
- case 7:
421
- accountLists = _context4.sent;
422
289
  newCarts = carts === null || carts === void 0 ? void 0 : carts.map(function (item) {
423
- var _item$duration;
424
290
  return _objectSpread(_objectSpread({}, item), {}, {
425
- addHolderButtonText: utils === null || utils === void 0 ? void 0 : utils.translation(bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.form_name),
426
- format: ['HH:mm', 'HH:mm'],
427
- show_time: true,
428
- duration_type: (item === null || item === void 0 || (_item$duration = item.duration) === null || _item$duration === void 0 ? void 0 : _item$duration.type) || 'minutes',
429
- locale: locale,
430
- symbol: symbol,
431
- holders: formatHolder(accountLists),
432
- allowClearHolder: true,
433
- allowClearResource: true,
434
- isErrorHolder: isErrorHolder || false,
435
- isMultipleResource: true
291
+ addHolderButtonText: utils === null || utils === void 0 ? void 0 : utils.translation(bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.form_name)
436
292
  });
437
293
  });
438
294
  setCarts(newCarts || []);
439
- _context4.next = 12;
295
+ _context4.next = 7;
440
296
  return appointmentBooking.getSummary();
441
- case 12:
297
+ case 7:
442
298
  summary = _context4.sent;
443
299
  setSummary(summary || {});
444
300
 
@@ -446,14 +302,14 @@ export var useAppointmentBookingCart = function useAppointmentBookingCart() {
446
302
  if (!carts.length) {
447
303
  setIsAgreeDepositPolicy(false);
448
304
  }
449
- case 15:
305
+ case 10:
450
306
  case "end":
451
307
  return _context4.stop();
452
308
  }
453
309
  }, _callee4);
454
310
  }));
455
311
  return function getCartAndSummary() {
456
- return _ref12.apply(this, arguments);
312
+ return _ref10.apply(this, arguments);
457
313
  };
458
314
  }();
459
315
  useEffect(function () {
@@ -484,8 +340,8 @@ export var useAppointmentBookingLogin = function useAppointmentBookingLogin() {
484
340
  var utils = contextUtils();
485
341
  var isLogin = !!(utils !== null && utils !== void 0 && (_utils$token = utils.token) !== null && _utils$token !== void 0 && (_utils$token$get = _utils$token.get) !== null && _utils$token$get !== void 0 && _utils$token$get.call(_utils$token));
486
342
  var openLoginModal = function openLoginModal(params) {
487
- var _ref14 = params || {},
488
- callback = _ref14.callback;
343
+ var _ref12 = params || {},
344
+ callback = _ref12.callback;
489
345
  utils.action({
490
346
  type: 'pisell1.login',
491
347
  data: {
@@ -516,13 +372,13 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
516
372
  _useState2 = _slicedToArray(_useState, 2),
517
373
  accountLists = _useState2[0],
518
374
  setAccountLists = _useState2[1];
519
- var _ref15 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o2 = appointmentBooking.otherParams) === null || _appointmentBooking$o2 === void 0 ? void 0 : _appointmentBooking$o2.productModuleParams) || {},
520
- bookingSubject = _ref15.bookingSubject;
375
+ var _ref13 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o2 = appointmentBooking.otherParams) === null || _appointmentBooking$o2 === void 0 ? void 0 : _appointmentBooking$o2.productModuleParams) || {},
376
+ bookingSubject = _ref13.bookingSubject;
521
377
  var form_id = bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.form_id;
522
378
 
523
379
  // 获取账户列表数据
524
380
  var getAccountLists = /*#__PURE__*/function () {
525
- var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
381
+ var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
526
382
  var data;
527
383
  return _regeneratorRuntime().wrap(function _callee6$(_context6) {
528
384
  while (1) switch (_context6.prev = _context6.next) {
@@ -539,13 +395,13 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
539
395
  }, _callee6);
540
396
  }));
541
397
  return function getAccountLists() {
542
- return _ref16.apply(this, arguments);
398
+ return _ref14.apply(this, arguments);
543
399
  };
544
400
  }();
545
401
  useEffect(function () {
546
402
  getAccountLists();
547
403
  pisellOS.effects.on('appointmentBooking_accountList:changed', /*#__PURE__*/function () {
548
- var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(res) {
404
+ var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(res) {
549
405
  return _regeneratorRuntime().wrap(function _callee7$(_context7) {
550
406
  while (1) switch (_context7.prev = _context7.next) {
551
407
  case 0:
@@ -560,14 +416,14 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
560
416
  }, _callee7);
561
417
  }));
562
418
  return function (_x3) {
563
- return _ref17.apply(this, arguments);
419
+ return _ref15.apply(this, arguments);
564
420
  };
565
421
  }());
566
422
  }, []);
567
423
 
568
424
  // 获取表单数据
569
425
  var getHolders = /*#__PURE__*/function () {
570
- var _ref18 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
426
+ var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8() {
571
427
  var _utils$getStore$getSt;
572
428
  var shop_id, customer, params, data, newData;
573
429
  return _regeneratorRuntime().wrap(function _callee8$(_context8) {
@@ -607,13 +463,13 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
607
463
  }, _callee8);
608
464
  }));
609
465
  return function getHolders() {
610
- return _ref18.apply(this, arguments);
466
+ return _ref16.apply(this, arguments);
611
467
  };
612
468
  }();
613
469
 
614
470
  // 添加账户
615
471
  var addAccount = /*#__PURE__*/function () {
616
- var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(val, type) {
472
+ var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(val, type) {
617
473
  var customer, result;
618
474
  return _regeneratorRuntime().wrap(function _callee9$(_context9) {
619
475
  while (1) switch (_context9.prev = _context9.next) {
@@ -634,7 +490,7 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
634
490
  }, _callee9);
635
491
  }));
636
492
  return function addAccount(_x4, _x5) {
637
- return _ref19.apply(this, arguments);
493
+ return _ref17.apply(this, arguments);
638
494
  };
639
495
  }();
640
496
 
@@ -659,12 +515,14 @@ export var useAppointmentBookingAccount = function useAppointmentBookingAccount(
659
515
  * @Date: 2025-04-15 11:29
660
516
  */
661
517
  export var useAppointmentBookingResource = function useAppointmentBookingResource() {
662
- var _ref20 = useAppointmentBookingContext(),
663
- appointmentBooking = _ref20.appointmentBooking,
664
- setResources = _ref20.setResources,
665
- setTimes = _ref20.setTimes;
666
- var _ref21 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {},
667
- resourceSort = _ref21.resourceSort;
518
+ var _useAppointmentBookin4 = useAppointmentBookingContext(),
519
+ appointmentBooking = _useAppointmentBookin4.appointmentBooking,
520
+ setResources = _useAppointmentBookin4.setResources,
521
+ setTimes = _useAppointmentBookin4.setTimes,
522
+ setResourceOtherParams = _useAppointmentBookin4.setResourceOtherParams,
523
+ resourceOtherParams = _useAppointmentBookin4.resourceOtherParams;
524
+ var _ref18 = (appointmentBooking === null || appointmentBooking === void 0 ? void 0 : appointmentBooking.otherParams) || {},
525
+ resourceSort = _ref18.resourceSort;
668
526
 
669
527
  // 设置资源列表
670
528
  var getResourceList = function getResourceList() {
@@ -688,7 +546,7 @@ export var useAppointmentBookingResource = function useAppointmentBookingResourc
688
546
 
689
547
  // 设置时间切片
690
548
  var getResourceTimeSlot = /*#__PURE__*/function () {
691
- var _ref22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(index) {
549
+ var _ref19 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(index) {
692
550
  var _getResourceList, resourceCodes, code, data;
693
551
  return _regeneratorRuntime().wrap(function _callee10$(_context10) {
694
552
  while (1) switch (_context10.prev = _context10.next) {
@@ -707,12 +565,45 @@ export var useAppointmentBookingResource = function useAppointmentBookingResourc
707
565
  }, _callee10);
708
566
  }));
709
567
  return function getResourceTimeSlot(_x6) {
710
- return _ref22.apply(this, arguments);
568
+ return _ref19.apply(this, arguments);
569
+ };
570
+ }();
571
+
572
+ // 获取自动分配
573
+ var autoSelectAllProductResources = /*#__PURE__*/function () {
574
+ var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(index) {
575
+ var _getResourceList2, resourceCodes, code, data, res;
576
+ return _regeneratorRuntime().wrap(function _callee11$(_context11) {
577
+ while (1) switch (_context11.prev = _context11.next) {
578
+ case 0:
579
+ _getResourceList2 = getResourceList(), resourceCodes = _getResourceList2.resourceCodes;
580
+ code = resourceCodes === null || resourceCodes === void 0 ? void 0 : resourceCodes[index || 0]; // 获取时间切片
581
+ _context11.next = 4;
582
+ return appointmentBooking.getTimeSlotByAllResources(code);
583
+ case 4:
584
+ data = _context11.sent;
585
+ _context11.next = 7;
586
+ return appointmentBooking.autoSelectAllProductResources(code);
587
+ case 7:
588
+ res = _context11.sent;
589
+ setResourceOtherParams(_objectSpread(_objectSpread(_objectSpread({}, resourceOtherParams), res), {}, {
590
+ resourceCodes: resourceCodes
591
+ }));
592
+ return _context11.abrupt("return", res);
593
+ case 10:
594
+ case "end":
595
+ return _context11.stop();
596
+ }
597
+ }, _callee11);
598
+ }));
599
+ return function autoSelectAllProductResources(_x7) {
600
+ return _ref20.apply(this, arguments);
711
601
  };
712
602
  }();
713
603
  return {
714
604
  getResourceTimeSlot: getResourceTimeSlot,
715
- getResourceList: getResourceList
605
+ getResourceList: getResourceList,
606
+ autoSelectAllProductResources: autoSelectAllProductResources
716
607
  };
717
608
  };
718
609
 
@@ -724,73 +615,101 @@ export var useAppointmentBookingResource = function useAppointmentBookingResourc
724
615
  * @Date: 2025-04-21 11:47
725
616
  */
726
617
  export var useIsSkipResourceStep = function useIsSkipResourceStep() {
727
- var _ref23 = useAppointmentBookingContext(),
728
- currentStepParams = _ref23.currentStepParams;
729
- var _useAppointmentBookin5 = useAppointmentBookingResource(),
730
- getResourceList = _useAppointmentBookin5.getResourceList;
731
- var _useAppointmentBookin6 = useAppointmentBookingSetting(),
732
- isFormSubject = _useAppointmentBookin6.isFormSubject;
618
+ var _appointmentBooking$s3;
619
+ var _useAppointmentBookin5 = useAppointmentBookingContext(),
620
+ currentStep = _useAppointmentBookin5.currentStep,
621
+ setCarts = _useAppointmentBookin5.setCarts,
622
+ setPolicyIds = _useAppointmentBookin5.setPolicyIds;
623
+ var _useAppointmentBookin6 = useAppointmentBookingResource(),
624
+ getResourceList = _useAppointmentBookin6.getResourceList,
625
+ autoSelectAllProductResources = _useAppointmentBookin6.autoSelectAllProductResources;
626
+ var _useAppointmentBookin7 = useAppointmentBookingSetting(),
627
+ isFormSubject = _useAppointmentBookin7.isFormSubject;
733
628
  var appointmentBooking = useAppointmentBooking();
734
- var _useAppointmentBookin7 = useAppointmentBookingStep(),
735
- nextStep = _useAppointmentBookin7.nextStep;
629
+ var stepList = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$s3 = appointmentBooking.store) === null || _appointmentBooking$s3 === void 0 || (_appointmentBooking$s3 = _appointmentBooking$s3.step) === null || _appointmentBooking$s3 === void 0 || (_appointmentBooking$s3 = _appointmentBooking$s3.store) === null || _appointmentBooking$s3 === void 0 ? void 0 : _appointmentBooking$s3.stepList) || [];
630
+ var _useAppointmentBookin8 = useAppointmentBookingLogin(),
631
+ isLogin = _useAppointmentBookin8.isLogin,
632
+ openLoginModal = _useAppointmentBookin8.openLoginModal;
633
+ var _useAppointmentBookin9 = useAppointmentBookingAccount(),
634
+ getHolders = _useAppointmentBookin9.getHolders,
635
+ checkAccount = _useAppointmentBookin9.checkAccount;
636
+ var _useAppointmentBookin10 = useAppointmentBookingStep(),
637
+ nextStep = _useAppointmentBookin10.nextStep;
638
+ var utils = contextUtils();
736
639
  var checkSkipResourceStep = /*#__PURE__*/function () {
737
- var _ref24 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11() {
738
- var _getResourceList2, resources, accountLists, _currentAppointmentBo, isSystem, isSkip, form_code, renderLists, _isSkip;
739
- return _regeneratorRuntime().wrap(function _callee11$(_context11) {
740
- while (1) switch (_context11.prev = _context11.next) {
640
+ var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(isSkipUpdateFormStep) {
641
+ var accountLists, carts, _res$errorList, _resources$, res, _getResourceList3, resources, resultCarts;
642
+ return _regeneratorRuntime().wrap(function _callee12$(_context12) {
643
+ while (1) switch (_context12.prev = _context12.next) {
741
644
  case 0:
742
- _context11.prev = 0;
743
- _getResourceList2 = getResourceList(), resources = _getResourceList2.resources;
744
- _context11.next = 4;
645
+ _context12.prev = 0;
646
+ _context12.next = 3;
745
647
  return appointmentBooking.getAccounts();
746
- case 4:
747
- accountLists = _context11.sent;
748
- _currentAppointmentBo = currentAppointmentBoard(currentStepParams.key, resources, appointmentBooking), isSystem = _currentAppointmentBo.isSystem, isSkip = _currentAppointmentBo.isSkip, form_code = _currentAppointmentBo.form_code; // 客户不可选择资源,系统自动分派
749
- if (!isSystem) {
750
- _context11.next = 9;
751
- break;
752
- }
753
- nextStep();
754
- return _context11.abrupt("return", true);
755
- case 9:
648
+ case 3:
649
+ accountLists = _context12.sent;
650
+ _context12.next = 6;
651
+ return appointmentBooking.getCart();
652
+ case 6:
653
+ carts = _context12.sent;
756
654
  if (!((accountLists === null || accountLists === void 0 ? void 0 : accountLists.length) === 1 || isFormSubject)) {
757
- _context11.next = 19;
655
+ _context12.next = 20;
758
656
  break;
759
657
  }
760
- renderLists = currentRenderLists(resources, form_code);
761
- _isSkip = false;
762
- if ((renderLists === null || renderLists === void 0 ? void 0 : renderLists.length) === 1) {
763
- _isSkip = isSkip || false;
764
- } else {
765
- _isSkip = false;
766
- }
767
-
768
- // 如果跳过资源选择步骤,则执行跳过的逻辑
769
- if (!_isSkip) {
770
- _context11.next = 16;
658
+ _context12.next = 10;
659
+ return autoSelectAllProductResources();
660
+ case 10:
661
+ res = _context12.sent;
662
+ _getResourceList3 = getResourceList(), resources = _getResourceList3.resources; // 如果分配成功,并且只有一个资源则跳过资源选择步骤,默认选中该资源
663
+ if (!(!(res !== null && res !== void 0 && (_res$errorList = res.errorList) !== null && _res$errorList !== void 0 && _res$errorList.length) && (resources === null || resources === void 0 || (_resources$ = resources[0]) === null || _resources$ === void 0 || (_resources$ = _resources$.resources) === null || _resources$ === void 0 || (_resources$ = _resources$[0]) === null || _resources$ === void 0 || (_resources$ = _resources$.renderList) === null || _resources$ === void 0 ? void 0 : _resources$.length) === 1)) {
664
+ _context12.next = 17;
771
665
  break;
772
666
  }
773
- nextStep();
774
- return _context11.abrupt("return", true);
775
- case 16:
776
- return _context11.abrupt("return", _isSkip);
777
- case 19:
778
- return _context11.abrupt("return", false);
667
+ if (!isSkipUpdateFormStep) {
668
+ resultCarts = formatCartsResources(carts, resources, setPolicyIds); // 如果当前资源有表单,则添加表单步骤,否则删除表单步骤
669
+ checkHasFormStep({
670
+ nextStep: nextStep,
671
+ isSkip: true,
672
+ openLoginModal: openLoginModal,
673
+ utils: utils,
674
+ accountLists: accountLists,
675
+ getHolders: getHolders,
676
+ checkHolder: checkHolder,
677
+ setCarts: setCarts,
678
+ checkAccount: checkAccount,
679
+ carts: carts,
680
+ isFormSubject: isFormSubject,
681
+ hasResourceFormId: (resultCarts === null || resultCarts === void 0 ? void 0 : resultCarts.length) > 0,
682
+ currentStep: currentStep,
683
+ stepList: stepList,
684
+ appointmentBooking: appointmentBooking,
685
+ locales: locales,
686
+ isLogin: isLogin
687
+ });
688
+ }
689
+ return _context12.abrupt("return", true);
690
+ case 17:
691
+ return _context12.abrupt("return", false);
692
+ case 18:
693
+ _context12.next = 21;
694
+ break;
779
695
  case 20:
780
- _context11.next = 25;
696
+ return _context12.abrupt("return", false);
697
+ case 21:
698
+ _context12.next = 27;
781
699
  break;
782
- case 22:
783
- _context11.prev = 22;
784
- _context11.t0 = _context11["catch"](0);
785
- return _context11.abrupt("return", false);
786
- case 25:
700
+ case 23:
701
+ _context12.prev = 23;
702
+ _context12.t0 = _context12["catch"](0);
703
+ console.log(_context12.t0, 'checkSkipResourceStep33');
704
+ return _context12.abrupt("return", false);
705
+ case 27:
787
706
  case "end":
788
- return _context11.stop();
707
+ return _context12.stop();
789
708
  }
790
- }, _callee11, null, [[0, 22]]);
709
+ }, _callee12, null, [[0, 23]]);
791
710
  }));
792
- return function checkSkipResourceStep() {
793
- return _ref24.apply(this, arguments);
711
+ return function checkSkipResourceStep(_x8) {
712
+ return _ref21.apply(this, arguments);
794
713
  };
795
714
  }();
796
715
  return {
@@ -806,15 +725,15 @@ export var useIsSkipResourceStep = function useIsSkipResourceStep() {
806
725
  * @Date: 2025-04-24 18:15
807
726
  */
808
727
  export var useAppointmentBookingSetting = function useAppointmentBookingSetting() {
809
- var _appointmentBooking$o3;
728
+ var _appointmentBooking$o3, _appointmentBooking$o4;
810
729
  var utils = contextUtils();
811
- var _ref25 = useAppointmentBookingContext(),
812
- appointmentBooking = _ref25.appointmentBooking;
813
- var _ref26 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o3 = appointmentBooking.otherParams) === null || _appointmentBooking$o3 === void 0 ? void 0 : _appointmentBooking$o3.productModuleParams) || {},
814
- bookingProcess = _ref26.bookingProcess,
815
- bookingSubject = _ref26.bookingSubject,
816
- customPageId = _ref26.customPageId,
817
- channel = _ref26.channel;
730
+ var _ref22 = useAppointmentBookingContext(),
731
+ appointmentBooking = _ref22.appointmentBooking;
732
+ var _ref23 = (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o3 = appointmentBooking.otherParams) === null || _appointmentBooking$o3 === void 0 ? void 0 : _appointmentBooking$o3.productModuleParams) || {},
733
+ bookingProcess = _ref23.bookingProcess,
734
+ bookingSubject = _ref23.bookingSubject,
735
+ customPageId = _ref23.customPageId,
736
+ channel = _ref23.channel;
818
737
 
819
738
  // 设置缓存
820
739
  var setOtherData = function setOtherData(key, val) {
@@ -833,6 +752,8 @@ export var useAppointmentBookingSetting = function useAppointmentBookingSetting(
833
752
  isDateSelectedFirst: bookingProcess === 'date_first',
834
753
  // 主体是否是表单
835
754
  isFormSubject: (bookingSubject === null || bookingSubject === void 0 ? void 0 : bookingSubject.type) === 'form',
755
+ // 是否是零售模版
756
+ isRetailTemplate: (appointmentBooking === null || appointmentBooking === void 0 || (_appointmentBooking$o4 = appointmentBooking.otherParams) === null || _appointmentBooking$o4 === void 0 ? void 0 : _appointmentBooking$o4.isRetailTemplate) || false,
836
757
  customPageId: customPageId,
837
758
  channel: channel,
838
759
  bookingSubject: bookingSubject,