@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
@@ -6,7 +6,7 @@ import React, { useMemo } from 'react';
6
6
  import { locales } from '@pisell/utils';
7
7
  import { Button } from '@pisell/materials';
8
8
  import useEngineContext from "../../../../../hooks/useEngineContext";
9
- import { useAppointmentBookingLogin, useAppointmentBookingAccount, useShopDiscount, useAppointmentBookingSetting } from "../../../hooks";
9
+ import { useAppointmentBookingLogin, useAppointmentBookingAccount, useAppointmentBookingSetting } from "../../../hooks";
10
10
  import { useAppointmentBookingContext } from "../../../context";
11
11
  import { checkLogin, checkHolder } from "../utils";
12
12
  import "./index.less";
@@ -22,17 +22,17 @@ var ContinueButton = function ContinueButton(_ref) {
22
22
  accountLists = _useAppointmentBookin2.accountLists,
23
23
  getHolders = _useAppointmentBookin2.getHolders,
24
24
  checkAccount = _useAppointmentBookin2.checkAccount;
25
- var shopDiscount = useShopDiscount();
26
- var _useAppointmentBookin3 = useAppointmentBookingContext(),
27
- currentStep = _useAppointmentBookin3.currentStep,
28
- carts = _useAppointmentBookin3.carts,
29
- appointmentBooking = _useAppointmentBookin3.appointmentBooking,
30
- setCarts = _useAppointmentBookin3.setCarts,
31
- loading = _useAppointmentBookin3.loading,
32
- setIsErrorHolder = _useAppointmentBookin3.setIsErrorHolder,
33
- isLastStep = _useAppointmentBookin3.isLastStep;
34
- var _useAppointmentBookin4 = useAppointmentBookingSetting(),
35
- isFormSubject = _useAppointmentBookin4.isFormSubject;
25
+ var _ref2 = useAppointmentBookingContext(),
26
+ currentStep = _ref2.currentStep,
27
+ carts = _ref2.carts,
28
+ appointmentBooking = _ref2.appointmentBooking,
29
+ setCarts = _ref2.setCarts,
30
+ loading = _ref2.loading,
31
+ setIsErrorHolder = _ref2.setIsErrorHolder,
32
+ isLastStep = _ref2.isLastStep;
33
+ var _useAppointmentBookin3 = useAppointmentBookingSetting(),
34
+ isFormSubject = _useAppointmentBookin3.isFormSubject,
35
+ isDateSelectedFirst = _useAppointmentBookin3.isDateSelectedFirst;
36
36
  var stepList = useMemo(function () {
37
37
  var _appointmentBooking$s;
38
38
  return 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;
@@ -46,6 +46,7 @@ var ContinueButton = function ContinueButton(_ref) {
46
46
  * @Date: 2025-04-28 11:41
47
47
  */
48
48
  var handleCheckAccount = function handleCheckAccount() {
49
+ if (isDateSelectedFirst) return false;
49
50
  var result = checkHolder({
50
51
  isFormSubject: isFormSubject,
51
52
  checkAccount: checkAccount,
@@ -66,7 +67,7 @@ var ContinueButton = function ContinueButton(_ref) {
66
67
  * @Date: 2025-04-28 17:09
67
68
  */
68
69
  var handleLoginCheck = /*#__PURE__*/function () {
69
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
70
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
70
71
  return _regeneratorRuntime().wrap(function _callee$(_context) {
71
72
  while (1) switch (_context.prev = _context.next) {
72
73
  case 0:
@@ -89,7 +90,7 @@ var ContinueButton = function ContinueButton(_ref) {
89
90
  }, _callee);
90
91
  }));
91
92
  return function handleLoginCheck() {
92
- return _ref2.apply(this, arguments);
93
+ return _ref3.apply(this, arguments);
93
94
  };
94
95
  }();
95
96
 
@@ -101,24 +102,45 @@ var ContinueButton = function ContinueButton(_ref) {
101
102
  * @Date: 2025-01-16 16:30
102
103
  */
103
104
  var handleContinue = /*#__PURE__*/function () {
104
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
105
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
106
+ var loginOk;
105
107
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
106
108
  while (1) switch (_context2.prev = _context2.next) {
107
109
  case 0:
108
110
  _context2.prev = 0;
109
- return _context2.abrupt("return", onNext && onNext());
111
+ if (!((currentStep === null || currentStep === void 0 ? void 0 : currentStep.index) + 2 >= (stepList === null || stepList === void 0 ? void 0 : stepList.length))) {
112
+ _context2.next = 9;
113
+ break;
114
+ }
115
+ _context2.next = 4;
116
+ return handleLoginCheck();
110
117
  case 4:
111
- _context2.prev = 4;
118
+ loginOk = _context2.sent;
119
+ if (loginOk) {
120
+ _context2.next = 7;
121
+ break;
122
+ }
123
+ return _context2.abrupt("return");
124
+ case 7:
125
+ if (!handleCheckAccount()) {
126
+ _context2.next = 9;
127
+ break;
128
+ }
129
+ return _context2.abrupt("return");
130
+ case 9:
131
+ return _context2.abrupt("return", onNext && onNext());
132
+ case 12:
133
+ _context2.prev = 12;
112
134
  _context2.t0 = _context2["catch"](0);
113
135
  console.log(_context2.t0, 'handleContinue_error');
114
- case 7:
136
+ case 15:
115
137
  case "end":
116
138
  return _context2.stop();
117
139
  }
118
- }, _callee2, null, [[0, 4]]);
140
+ }, _callee2, null, [[0, 12]]);
119
141
  }));
120
142
  return function handleContinue() {
121
- return _ref3.apply(this, arguments);
143
+ return _ref4.apply(this, arguments);
122
144
  };
123
145
  }();
124
146
 
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Total: ({ className, isFooter }: any) => JSX.Element;
4
3
  export default Total;
@@ -14,7 +14,7 @@ import ContinueButton from "../ContinueButton";
14
14
  import { useAppointmentBooking } from "../../../hooks";
15
15
  import { useAppointmentBookingContext } from "../../../context";
16
16
  import { useAppointmentBookingAccount, useAppointmentBookingResource, useAppointmentBookingSetting, useAppointmentBookingLogin, contextUtils } from "../../../hooks";
17
- import { formatHolder, formatCurrentUser, openForm, getMultiResources, updateCartResources } from "../../../utils";
17
+ import { formatHolder, formatCarts, formatCurrentUser, openForm } from "../../../utils";
18
18
  import VoucherCard from "../../Voucher";
19
19
  import Total from "./Total";
20
20
  import Deposit from "../../Deposit";
@@ -27,21 +27,22 @@ var CartItem = function CartItem(_ref) {
27
27
  var _ref2 = useAppointmentBookingContext(),
28
28
  carts = _ref2.carts,
29
29
  currentStep = _ref2.currentStep,
30
+ resources = _ref2.resources,
30
31
  setResourceOtherParams = _ref2.setResourceOtherParams,
31
32
  resourceOtherParams = _ref2.resourceOtherParams,
32
33
  summary = _ref2.summary,
33
- isLastStep = _ref2.isLastStep,
34
- currentSelectedResourcesRef = _ref2.currentSelectedResourcesRef,
35
- currentStepParams = _ref2.currentStepParams;
34
+ isLastStep = _ref2.isLastStep;
36
35
  var _useAppointmentBookin = useAppointmentBookingAccount(),
37
36
  accountLists = _useAppointmentBookin.accountLists,
38
37
  getHolders = _useAppointmentBookin.getHolders,
38
+ form_id = _useAppointmentBookin.form_id,
39
39
  addAccount = _useAppointmentBookin.addAccount;
40
40
  var _useAppointmentBookin2 = useAppointmentBookingResource(),
41
41
  getResourceList = _useAppointmentBookin2.getResourceList;
42
42
  var _useAppointmentBookin3 = useAppointmentBookingSetting(),
43
43
  isFormSubject = _useAppointmentBookin3.isFormSubject,
44
- bookingSubject = _useAppointmentBookin3.bookingSubject;
44
+ bookingSubject = _useAppointmentBookin3.bookingSubject,
45
+ isRetailTemplate = _useAppointmentBookin3.isRetailTemplate;
45
46
  var _useAppointmentBookin4 = useAppointmentBookingLogin(),
46
47
  isLogin = _useAppointmentBookin4.isLogin;
47
48
  var utils = contextUtils();
@@ -113,7 +114,7 @@ var CartItem = function CartItem(_ref) {
113
114
  } else {
114
115
  appointmentBooking.updateCart({
115
116
  _id: e === null || e === void 0 ? void 0 : e._id,
116
- resources: val ? updateCartResources(e, val) : []
117
+ resources: val ? [val] : []
117
118
  });
118
119
  }
119
120
  getResourceList();
@@ -198,28 +199,8 @@ var CartItem = function CartItem(_ref) {
198
199
  }
199
200
  };
200
201
  var products = useMemo(function () {
201
- var _currentSelectedResou;
202
- console.log(currentSelectedResourcesRef.current, carts, 'wh867865');
203
- if (!(carts !== null && carts !== void 0 && carts.length)) return [];
204
- if ((currentSelectedResourcesRef === null || currentSelectedResourcesRef === void 0 || (_currentSelectedResou = currentSelectedResourcesRef.current) === null || _currentSelectedResou === void 0 ? void 0 : _currentSelectedResou.length) > 0) {
205
- var newCarts = carts.map(function (item) {
206
- var _currentResourceData$;
207
- var currentResourceData = currentSelectedResourcesRef.current.find(function (resource) {
208
- return (resource === null || resource === void 0 ? void 0 : resource._id) === (item === null || item === void 0 ? void 0 : item._id);
209
- });
210
-
211
- // 可选资源列表
212
- var multiResources = getMultiResources(item, currentResourceData === null || currentResourceData === void 0 || (_currentResourceData$ = currentResourceData.currentSelectedResource) === null || _currentResourceData$ === void 0 ? void 0 : _currentResourceData$.resourceItem, currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.key);
213
- return _objectSpread(_objectSpread({}, item), {}, {
214
- isMultipleResource: true,
215
- multiResources: multiResources
216
- });
217
- });
218
- return newCarts;
219
- } else {
220
- return carts;
221
- }
222
- }, [carts, currentSelectedResourcesRef.current, currentStepParams === null || currentStepParams === void 0 ? void 0 : currentStepParams.key]);
202
+ return formatCarts(carts, resources, utils, accountLists);
203
+ }, [carts, resources, accountLists]);
223
204
  return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
224
205
  className: "appointment-cart-item-wrap ".concat(isMobile() ? 'appointment-cart-mobile-item-wrap' : '')
225
206
  }, /*#__PURE__*/React.createElement("div", {
@@ -230,7 +211,7 @@ var CartItem = function CartItem(_ref) {
230
211
  hideAddBtn: false,
231
212
  holders: holders,
232
213
  disabledEdit: isLastStep,
233
- isShowChangeResource: currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 || (_currentStep$step = _currentStep$step.key) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.startsWith('select-resource'),
214
+ isShowChangeResource: (currentStep === null || currentStep === void 0 || (_currentStep$step = currentStep.step) === null || _currentStep$step === void 0 ? void 0 : _currentStep$step.key) === 'select-resource',
234
215
  isShowDelete: (currentStep === null || currentStep === void 0 || (_currentStep$step2 = currentStep.step) === null || _currentStep$step2 === void 0 ? void 0 : _currentStep$step2.key) === 'select-service',
235
216
  isShowPackageNote: false,
236
217
  isShowChangeHolder: isLastStep ? false : isFormSubject && isLogin,
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Cart: ({ open, onCancel, onNext }: any) => JSX.Element;
4
3
  export default Cart;
@@ -1,44 +1,33 @@
1
1
  function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
- function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
3
2
  function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
3
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
4
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
5
  function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
6
  function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
7
+ function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
8
8
  function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
9
9
  function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
10
- import React, { forwardRef, useImperativeHandle } from 'react';
10
+ import React, { forwardRef, useImperativeHandle, useEffect } from 'react';
11
11
  import { locales, isMobile } from '@pisell/utils';
12
12
  import useEngineContext from "../../../../hooks/useEngineContext";
13
13
  import { useAppointmentBookingContext } from "../../context";
14
- import { contextUtils, useShopDiscount } from "../../hooks";
14
+ import { contextUtils, useAppointmentBookingSetting } from "../../hooks";
15
15
  import CartItem from "../Cart/Item";
16
16
  import { Toast } from "../../utils";
17
+ import { getFormParams } from "./utils";
17
18
  import "./index.less";
18
19
  var ConfirmInformation = /*#__PURE__*/forwardRef(function (props, ref) {
19
20
  var _context$appHelper;
20
21
  var context = useEngineContext();
21
22
  var config = (context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 || (_context$appHelper = _context$appHelper.constants) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.config) || {};
22
23
  var utils = contextUtils();
23
- var _useAppointmentBookin = useAppointmentBookingContext(),
24
- appointmentBooking = _useAppointmentBookin.appointmentBooking,
25
- summary = _useAppointmentBookin.summary,
26
- isAgreeDepositPolicy = _useAppointmentBookin.isAgreeDepositPolicy,
27
- setLoading = _useAppointmentBookin.setLoading;
28
- var shopDiscount = useShopDiscount();
29
-
30
- /**
31
- * @title: 清空数据
32
- * @description:
33
- * @return {*}
34
- * @Author: WangHan
35
- * @Date: 2025-04-16 17:55
36
- */
37
- var clearData = function clearData() {
38
- var _shopDiscount$destroy;
39
- appointmentBooking.destroy();
40
- shopDiscount === null || shopDiscount === void 0 || (_shopDiscount$destroy = shopDiscount.destroy) === null || _shopDiscount$destroy === void 0 || _shopDiscount$destroy.call(shopDiscount);
41
- };
24
+ var _ref = useAppointmentBookingContext(),
25
+ appointmentBooking = _ref.appointmentBooking,
26
+ summary = _ref.summary,
27
+ isAgreeDepositPolicy = _ref.isAgreeDepositPolicy,
28
+ setLoading = _ref.setLoading;
29
+ var _useAppointmentBookin = useAppointmentBookingSetting(),
30
+ isRetailTemplate = _useAppointmentBookin.isRetailTemplate;
42
31
 
43
32
  /**
44
33
  * @title: 支付成功回调
@@ -55,6 +44,86 @@ var ConfirmInformation = /*#__PURE__*/forwardRef(function (props, ref) {
55
44
  utils === null || utils === void 0 || (_utils$history = utils.history) === null || _utils$history === void 0 || _utils$history.replace(url);
56
45
  setLoading(false);
57
46
  };
47
+ useEffect(function () {
48
+ // 零售模版
49
+ if (isRetailTemplate) {
50
+ handleForm();
51
+ }
52
+ }, [isRetailTemplate]);
53
+
54
+ /**
55
+ * @title: 处理零售模版表单
56
+ * @description:
57
+ * @return {*}
58
+ * @Author: WangHan
59
+ * @Date: 2025-05-28 15:42
60
+ */
61
+ var handleForm = /*#__PURE__*/function () {
62
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(isSubmit) {
63
+ var _utils$action;
64
+ var carts, key, isRetailFormSubmit, _callback, params;
65
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
66
+ while (1) switch (_context2.prev = _context2.next) {
67
+ case 0:
68
+ _context2.next = 2;
69
+ return appointmentBooking.getCart();
70
+ case 2:
71
+ carts = _context2.sent;
72
+ // 零售模版是否填写过表单
73
+ key = 'isRetailFormSubmit';
74
+ isRetailFormSubmit = appointmentBooking.getOtherData(key);
75
+ _callback = function callback() {
76
+ // 如果下单按钮触发,则拉起支付
77
+ if (isSubmit) {
78
+ onCheckout();
79
+ }
80
+ }; // 如果已经填写过表单则不再次触发
81
+ if (!isRetailFormSubmit) {
82
+ _context2.next = 8;
83
+ break;
84
+ }
85
+ return _context2.abrupt("return", _callback());
86
+ case 8:
87
+ params = getFormParams(carts);
88
+ utils === null || utils === void 0 || (_utils$action = utils.action) === null || _utils$action === void 0 || _utils$action.call(utils, {
89
+ type: 'pisell1.goProductForm',
90
+ data: params,
91
+ callback: function () {
92
+ var _callback2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) {
93
+ var _carts$;
94
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
95
+ while (1) switch (_context.prev = _context.next) {
96
+ case 0:
97
+ _context.next = 2;
98
+ return appointmentBooking.updateCart({
99
+ _id: carts === null || carts === void 0 || (_carts$ = carts[0]) === null || _carts$ === void 0 ? void 0 : _carts$._id,
100
+ relationForms: e
101
+ });
102
+ case 2:
103
+ appointmentBooking.setOtherData(key, true);
104
+ _callback();
105
+ case 4:
106
+ case "end":
107
+ return _context.stop();
108
+ }
109
+ }, _callee);
110
+ }));
111
+ function callback(_x2) {
112
+ return _callback2.apply(this, arguments);
113
+ }
114
+ return callback;
115
+ }()
116
+ });
117
+ case 10:
118
+ case "end":
119
+ return _context2.stop();
120
+ }
121
+ }, _callee2);
122
+ }));
123
+ return function handleForm(_x) {
124
+ return _ref2.apply(this, arguments);
125
+ };
126
+ }();
58
127
 
59
128
  /**
60
129
  * @title: 执行结算操作
@@ -64,30 +133,64 @@ var ConfirmInformation = /*#__PURE__*/forwardRef(function (props, ref) {
64
133
  * @Date: 2025-05-08 17:32
65
134
  */
66
135
  var handleNext = /*#__PURE__*/function () {
67
- var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
136
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
68
137
  var _deposit$protocols;
69
- var deposit, _yield$appointmentBoo, data, _ref2, is_deposit, deposit_amount, total_amount, order_id, _total, freeResult;
70
- return _regeneratorRuntime().wrap(function _callee$(_context) {
71
- while (1) switch (_context.prev = _context.next) {
138
+ var deposit;
139
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
140
+ while (1) switch (_context3.prev = _context3.next) {
72
141
  case 0:
73
142
  deposit = summary.deposit; // 如果未同意定金政策,则提示
74
143
  if (!(deposit !== null && deposit !== void 0 && deposit.hasDeposit && (deposit === null || deposit === void 0 || (_deposit$protocols = deposit.protocols) === null || _deposit$protocols === void 0 ? void 0 : _deposit$protocols.length) > 0 && !isAgreeDepositPolicy)) {
75
- _context.next = 3;
144
+ _context3.next = 3;
76
145
  break;
77
146
  }
78
- return _context.abrupt("return", Toast(locales.getText('pisell2.appointment.deposit.agree.policy')));
147
+ return _context3.abrupt("return", Toast(locales.getText('pisell2.appointment.deposit.agree.policy')));
79
148
  case 3:
149
+ if (!isRetailTemplate) {
150
+ _context3.next = 6;
151
+ break;
152
+ }
153
+ handleForm(true);
154
+ return _context3.abrupt("return");
155
+ case 6:
156
+ // 预约下单
157
+ onCheckout();
158
+ case 7:
159
+ case "end":
160
+ return _context3.stop();
161
+ }
162
+ }, _callee3);
163
+ }));
164
+ return function handleNext() {
165
+ return _ref3.apply(this, arguments);
166
+ };
167
+ }();
168
+
169
+ /**
170
+ * @title: 结算
171
+ * @description:
172
+ * @return {*}
173
+ * @Author: WangHan
174
+ * @Date: 2025-05-28 15:48
175
+ */
176
+ var onCheckout = /*#__PURE__*/function () {
177
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
178
+ var deposit, _yield$appointmentBoo, data, _ref5, is_deposit, deposit_amount, total_amount, order_id, _total, freeResult;
179
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
180
+ while (1) switch (_context4.prev = _context4.next) {
181
+ case 0:
80
182
  setLoading(true);
81
- _context.prev = 4;
82
- _context.next = 7;
183
+ _context4.prev = 1;
184
+ deposit = summary.deposit;
185
+ _context4.next = 5;
83
186
  return appointmentBooking.submitOrder();
84
- case 7:
85
- _yield$appointmentBoo = _context.sent;
187
+ case 5:
188
+ _yield$appointmentBoo = _context4.sent;
86
189
  data = _yield$appointmentBoo.data;
87
- _ref2 = data || {}, is_deposit = _ref2.is_deposit, deposit_amount = _ref2.deposit_amount, total_amount = _ref2.total_amount, order_id = _ref2.order_id; // 如果有定金,则支付定金金额,否则订单金额
190
+ _ref5 = data || {}, is_deposit = _ref5.is_deposit, deposit_amount = _ref5.deposit_amount, total_amount = _ref5.total_amount, order_id = _ref5.order_id; // 如果有定金,则支付定金金额,否则订单金额
88
191
  _total = is_deposit ? deposit_amount : total_amount;
89
192
  if (!(_total > 0)) {
90
- _context.next = 16;
193
+ _context4.next = 14;
91
194
  break;
92
195
  }
93
196
  // 拉起支付弹窗
@@ -101,44 +204,44 @@ var ConfirmInformation = /*#__PURE__*/forwardRef(function (props, ref) {
101
204
  setTimeout(function () {
102
205
  setLoading(false);
103
206
  }, 200);
104
- _context.next = 24;
207
+ _context4.next = 22;
105
208
  break;
106
- case 16:
209
+ case 14:
107
210
  if (!(deposit !== null && deposit !== void 0 && deposit.hasDeposit)) {
108
- _context.next = 19;
211
+ _context4.next = 17;
109
212
  break;
110
213
  }
111
214
  goPaymentFinish(order_id, _total);
112
- return _context.abrupt("return");
113
- case 19:
114
- _context.next = 21;
215
+ return _context4.abrupt("return");
216
+ case 17:
217
+ _context4.next = 19;
115
218
  return appointmentBooking.getFreeProduct(order_id);
116
- case 21:
117
- freeResult = _context.sent;
219
+ case 19:
220
+ freeResult = _context4.sent;
118
221
  console.log(freeResult, 'freeResult');
119
222
  if (freeResult !== null && freeResult !== void 0 && freeResult.status) {
120
223
  goPaymentFinish(order_id, total_amount);
121
224
  } else {
122
225
  Toast(freeResult === null || freeResult === void 0 ? void 0 : freeResult.message);
123
226
  }
124
- case 24:
125
- _context.next = 30;
227
+ case 22:
228
+ _context4.next = 28;
126
229
  break;
127
- case 26:
128
- _context.prev = 26;
129
- _context.t0 = _context["catch"](4);
130
- Toast((_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.message) || '');
230
+ case 24:
231
+ _context4.prev = 24;
232
+ _context4.t0 = _context4["catch"](1);
233
+ Toast((_context4.t0 === null || _context4.t0 === void 0 ? void 0 : _context4.t0.message) || '');
131
234
  setTimeout(function () {
132
235
  setLoading(false);
133
236
  }, 50);
134
- case 30:
237
+ case 28:
135
238
  case "end":
136
- return _context.stop();
239
+ return _context4.stop();
137
240
  }
138
- }, _callee, null, [[4, 26]]);
241
+ }, _callee4, null, [[1, 24]]);
139
242
  }));
140
- return function handleNext() {
141
- return _ref.apply(this, arguments);
243
+ return function onCheckout() {
244
+ return _ref4.apply(this, arguments);
142
245
  };
143
246
  }();
144
247
  useImperativeHandle(ref, function () {
@@ -0,0 +1,12 @@
1
+ /**
2
+ * @title: 获取拉开表单弹窗参数
3
+ * @description:
4
+ * @param {any} state
5
+ * @return {*}
6
+ * @Author: WangHan
7
+ * @Date: 2025-05-28 15:40
8
+ */
9
+ export declare const getFormParams: (carts: any[]) => {
10
+ product_id: any[];
11
+ appointment_type: string;
12
+ };
@@ -0,0 +1,17 @@
1
+ /**
2
+ * @title: 获取拉开表单弹窗参数
3
+ * @description:
4
+ * @param {any} state
5
+ * @return {*}
6
+ * @Author: WangHan
7
+ * @Date: 2025-05-28 15:40
8
+ */
9
+ export var getFormParams = function getFormParams(carts) {
10
+ var product_id = (carts || []).map(function (item) {
11
+ return item.id;
12
+ });
13
+ return {
14
+ product_id: product_id,
15
+ appointment_type: "virtual"
16
+ };
17
+ };