@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,10 +17,10 @@ import React, { useMemo, useState } from 'react';
17
17
  import { locales } from '@pisell/utils';
18
18
  import { Button, PisellToast } from '@pisell/materials';
19
19
  import { useCart, useHolder, useStep, useCheckout, useSales, useCustomer } from "../../../../../Sales";
20
- import { formatValues } from "../../../../../Sales/Checkout/utils";
20
+ import { formatValues, getFormParams } from "../../../../../Sales/Checkout/utils";
21
21
  import OrderProductModal from "../../OrderProductModal/index";
22
22
  import EmptyHolderModal from "../../EmptyHolderModal";
23
- import { getEventDetailBookingOptionsApi } from "../../../../../Sales/Event/serve";
23
+ import { getProductPrice } from "../../../../../Sales/Event/serve";
24
24
  import { useRequest } from 'ahooks';
25
25
  import useEngineContext from "../../../../../../hooks/useEngineContext";
26
26
  import "./index.less";
@@ -67,7 +67,9 @@ var ContinueButton = function ContinueButton() {
67
67
  removeSessionStorage = _useSales2.removeSessionStorage;
68
68
  var context = useEngineContext();
69
69
  var _ref = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
70
- store = _ref.store;
70
+ store = _ref.store,
71
+ action = _ref.action,
72
+ getStore = _ref.getStore;
71
73
 
72
74
  /**
73
75
  * @title: 下单
@@ -77,29 +79,53 @@ var ContinueButton = function ContinueButton() {
77
79
  * @Date: 2025-02-10 17:54
78
80
  */
79
81
  var handleCheckout = /*#__PURE__*/function () {
80
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
81
- var value, result, _result$err;
82
- return _regeneratorRuntime().wrap(function _callee$(_context) {
83
- while (1) switch (_context.prev = _context.next) {
82
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
83
+ var params;
84
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
85
+ while (1) switch (_context2.prev = _context2.next) {
84
86
  case 0:
85
- value = formatValues(data); // 如果检测成功,则直接下单
86
- _context.next = 3;
87
- return onCheckout(value);
88
- case 3:
89
- result = _context.sent;
90
- // 清空数据
91
- if (result !== null && result !== void 0 && result.success) {
92
- removeSessionStorage();
93
- } else {
94
- PisellToast({
95
- content: (result === null || result === void 0 || (_result$err = result.err) === null || _result$err === void 0 ? void 0 : _result$err.message) || ''
96
- });
97
- }
98
- case 5:
87
+ params = getFormParams(data);
88
+ action === null || action === void 0 || action({
89
+ type: 'pisell1.goProductForm',
90
+ data: params,
91
+ callback: function () {
92
+ var _callback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(e) {
93
+ var value, result, _result$err;
94
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
95
+ while (1) switch (_context.prev = _context.next) {
96
+ case 0:
97
+ value = formatValues(data, false, {
98
+ relation_forms: e
99
+ }); // 如果检测成功,则直接下单
100
+ _context.next = 3;
101
+ return onCheckout(value);
102
+ case 3:
103
+ result = _context.sent;
104
+ // 清空数据
105
+ if (result !== null && result !== void 0 && result.success) {
106
+ removeSessionStorage();
107
+ } else {
108
+ PisellToast({
109
+ content: (result === null || result === void 0 || (_result$err = result.err) === null || _result$err === void 0 ? void 0 : _result$err.message) || ''
110
+ });
111
+ }
112
+ case 5:
113
+ case "end":
114
+ return _context.stop();
115
+ }
116
+ }, _callee);
117
+ }));
118
+ function callback(_x) {
119
+ return _callback.apply(this, arguments);
120
+ }
121
+ return callback;
122
+ }()
123
+ });
124
+ case 2:
99
125
  case "end":
100
- return _context.stop();
126
+ return _context2.stop();
101
127
  }
102
- }, _callee);
128
+ }, _callee2);
103
129
  }));
104
130
  return function handleCheckout() {
105
131
  return _ref2.apply(this, arguments);
@@ -109,23 +135,130 @@ var ContinueButton = function ContinueButton() {
109
135
  /**
110
136
  * 登录后根据返回商品价格更新cartItem price
111
137
  */
112
- var getEventDetailBookingOptions = useRequest(getEventDetailBookingOptionsApi, {
138
+ var _getProductPrice = useRequest(getProductPrice, {
113
139
  manual: true,
114
140
  onSuccess: function onSuccess(res) {
115
- var _res$data;
116
- var list = ((_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.list) || [];
141
+ var list = res.data || [];
117
142
  var productById = list.reduce(function (pre, cur) {
118
143
  pre[cur.id] = cur;
119
144
  return pre;
120
145
  }, {});
146
+ console.log('start update price');
121
147
  var newCartItems = cartData.cartItems.map(function (item) {
122
148
  var _ref3 = item._originData || {},
123
149
  product = _ref3.product;
124
150
  var newProduct = productById[product.product_id];
125
- item.price = newProduct.price;
126
- item.total = newProduct.price;
151
+ // 目前默认按单件商品计算
152
+ var _totalPrice = Number(newProduct.price);
153
+ if (!(item !== null && item !== void 0 && item._productDetail)) {
154
+ // 没有 _productDetail 说明可能是普通商品 则直接替换价格
155
+ item.price = _totalPrice;
156
+ item.total = _totalPrice;
157
+ return item;
158
+ }
159
+
160
+ // 从 cartItem 中获取bundleItem原始信息
161
+ var _item$_productDetail = item._productDetail,
162
+ _item$_productDetail$ = _item$_productDetail.bundle,
163
+ bundle = _item$_productDetail$ === void 0 ? [] : _item$_productDetail$,
164
+ options = _item$_productDetail.options;
165
+
166
+ // 1. 组合规格商品
167
+ if (product !== null && product !== void 0 && product.product_variant_id) {
168
+ var _newProduct$variant = newProduct.variant,
169
+ variant = _newProduct$variant === void 0 ? [] : _newProduct$variant;
170
+ var _variant = variant.find(function (v) {
171
+ return v.id === product.product_variant_id;
172
+ });
173
+ if (_variant) {
174
+ _totalPrice = Number(_variant.price);
175
+ }
176
+ } else if (
177
+ // 2. 套餐商品
178
+ Array.isArray(product === null || product === void 0 ? void 0 : product.product_bundle) && product.product_bundle.length > 0) {
179
+ // 登录后的最新商品分组信息
180
+ var _newProduct$bundle_gr = newProduct.bundle_group,
181
+ bundle_group = _newProduct$bundle_gr === void 0 ? [] : _newProduct$bundle_gr;
182
+ var _loop = function _loop() {
183
+ var _targetBundleGroup$bu;
184
+ var pbItem = product.product_bundle[i];
185
+ var bundle_group_id = pbItem.bundle_group_id,
186
+ bundle_id = pbItem.bundle_id,
187
+ option = pbItem.option;
188
+ // 最初绑定的bundle的基本信息,主要是获取 price_type 用于计算最新价格
189
+ var _originBundleItemInfo = bundle.find(function (bi) {
190
+ return bi.id === bundle_id;
191
+ });
192
+ var _targetBundleGroup = bundle_group.find(function (bg) {
193
+ return bg.id === bundle_group_id;
194
+ });
195
+ // 如果匹配到bundle group items, 则继续定位 item
196
+ if (_targetBundleGroup !== null && _targetBundleGroup !== void 0 && (_targetBundleGroup$bu = _targetBundleGroup.bundle_item) !== null && _targetBundleGroup$bu !== void 0 && _targetBundleGroup$bu.length) {
197
+ var _newBundleItemInfo = _targetBundleGroup.bundle_item.find(function (bi) {
198
+ return bi.id === bundle_id;
199
+ });
200
+ // 比对原始bundle_item中的商品id和最新bundle_item中的商品id
201
+ if ((_originBundleItemInfo === null || _originBundleItemInfo === void 0 ? void 0 : _originBundleItemInfo._bundle_product_id) === (_newBundleItemInfo === null || _newBundleItemInfo === void 0 ? void 0 : _newBundleItemInfo.bundle_product_id)) {
202
+ var price_type = _originBundleItemInfo.price_type,
203
+ _originBundleItemInfo2 = _originBundleItemInfo.num,
204
+ num = _originBundleItemInfo2 === void 0 ? 0 : _originBundleItemInfo2,
205
+ _originBundleItemOptions = _originBundleItemInfo.option;
206
+ var _bundleItemPrice = Number(_newBundleItemInfo.price);
207
+ if (price_type === 'markup') {
208
+ _totalPrice += _bundleItemPrice * num;
209
+ } else if (price_type === 'markdown') {
210
+ _totalPrice -= _bundleItemPrice * num;
211
+ } else {
212
+ _totalPrice += _bundleItemPrice * num;
213
+ }
214
+ // 如果该套餐商品子商品为单规格商品
215
+ if (Array.isArray(option) && (option === null || option === void 0 ? void 0 : option.length) > 0) {
216
+ var _loop2 = function _loop2() {
217
+ var option_group_item_id = option[j].option_group_item_id;
218
+ var _originOptionItem = _originBundleItemOptions.find(function (op) {
219
+ return op.product_option_item_id === option_group_item_id;
220
+ });
221
+ if (_originOptionItem) {
222
+ var price = _originOptionItem.price,
223
+ _originOptionItem$num = _originOptionItem.num,
224
+ _optionNum = _originOptionItem$num === void 0 ? 0 : _originOptionItem$num;
225
+ _totalPrice += Number(price) * _optionNum;
226
+ }
227
+ };
228
+ for (var j = 0; j < option.length; j++) {
229
+ _loop2();
230
+ }
231
+ }
232
+ }
233
+ }
234
+ };
235
+ for (var i = 0; i < product.product_bundle.length; i++) {
236
+ _loop();
237
+ }
238
+ } else if (
239
+ // 3. 单规格商品
240
+ Array.isArray(product === null || product === void 0 ? void 0 : product.product_option_item) && product.product_option_item.length > 0) {
241
+ var _loop3 = function _loop3() {
242
+ var option_group_item_id = product.product_option_item[_i].option_group_item_id;
243
+ var _originOptionItem = options.find(function (op) {
244
+ return op.product_option_item_id === option_group_item_id;
245
+ });
246
+ if (_originOptionItem) {
247
+ var price = _originOptionItem.price,
248
+ _originOptionItem$num2 = _originOptionItem.num,
249
+ num = _originOptionItem$num2 === void 0 ? 0 : _originOptionItem$num2;
250
+ _totalPrice += Number(price) * num;
251
+ }
252
+ };
253
+ for (var _i = 0; _i < product.product_option_item.length; _i++) {
254
+ _loop3();
255
+ }
256
+ }
257
+ item.price = _totalPrice;
258
+ item.total = _totalPrice;
127
259
  return item;
128
260
  });
261
+ console.log('new cart data', newCartItems);
129
262
  setData({
130
263
  cartData: _objectSpread(_objectSpread({}, cartData), {}, {
131
264
  cartItems: newCartItems
@@ -133,33 +266,45 @@ var ContinueButton = function ContinueButton() {
133
266
  });
134
267
  }
135
268
  });
269
+
270
+ /**
271
+ * 登录后重新获取应用报价单后的价格
272
+ * 过滤掉组规格商品
273
+ */
136
274
  var getCartItemProductsWithQuotation = /*#__PURE__*/function () {
137
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
275
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
138
276
  var _store$getState;
139
- var ids, customer;
140
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
141
- while (1) switch (_context2.prev = _context2.next) {
277
+ var ids, store, customer;
278
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
279
+ while (1) switch (_context3.prev = _context3.next) {
142
280
  case 0:
143
281
  ids = cartData.cartItems.map(function (item) {
144
282
  var _ref5 = item._originData || {},
145
- product = _ref5.product;
146
- return product === null || product === void 0 ? void 0 : product.product_id;
283
+ _ref5$product = _ref5.product,
284
+ product = _ref5$product === void 0 ? {} : _ref5$product;
285
+ var product_id = product.product_id;
286
+ return product_id;
147
287
  }).filter(function (id) {
148
288
  return !!id;
149
289
  });
290
+ store = getStore();
150
291
  customer = store === null || store === void 0 || (_store$getState = store.getState()) === null || _store$getState === void 0 || (_store$getState = _store$getState.global) === null || _store$getState === void 0 ? void 0 : _store$getState.userInfo;
151
- getEventDetailBookingOptions.run({
292
+ if (ids !== null && ids !== void 0 && ids.length) {
293
+ _context3.next = 5;
294
+ break;
295
+ }
296
+ return _context3.abrupt("return");
297
+ case 5:
298
+ _getProductPrice.run({
152
299
  ids: ids,
153
- num: 100,
154
- skip: 1,
155
- customer_id: customer === null || customer === void 0 ? void 0 : customer.id,
156
- open_quotation: 1
300
+ customer_id: customer === null || customer === void 0 ? void 0 : customer.id
301
+ // open_quotation: 1,
157
302
  });
158
- case 3:
303
+ case 6:
159
304
  case "end":
160
- return _context2.stop();
305
+ return _context3.stop();
161
306
  }
162
- }, _callee2);
307
+ }, _callee3);
163
308
  }));
164
309
  return function getCartItemProductsWithQuotation() {
165
310
  return _ref4.apply(this, arguments);
@@ -174,26 +319,26 @@ var ContinueButton = function ContinueButton() {
174
319
  * @Date: 2025-02-08 18:57
175
320
  */
176
321
  var handleNextStep = /*#__PURE__*/function () {
177
- var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
178
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
179
- while (1) switch (_context3.prev = _context3.next) {
322
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
323
+ return _regeneratorRuntime().wrap(function _callee4$(_context4) {
324
+ while (1) switch (_context4.prev = _context4.next) {
180
325
  case 0:
181
326
  onCloseCart();
182
327
  setOpenEmptyHolder(false);
183
328
 
184
329
  // 如果当前是确认信息页面,则到结算页面
185
330
  if (!isLastStep) {
186
- _context3.next = 4;
331
+ _context4.next = 4;
187
332
  break;
188
333
  }
189
- return _context3.abrupt("return", handleCheckout());
334
+ return _context4.abrupt("return", handleCheckout());
190
335
  case 4:
191
336
  nextStep();
192
337
  case 5:
193
338
  case "end":
194
- return _context3.stop();
339
+ return _context4.stop();
195
340
  }
196
- }, _callee3);
341
+ }, _callee4);
197
342
  }));
198
343
  return function handleNextStep() {
199
344
  return _ref6.apply(this, arguments);
@@ -231,67 +376,67 @@ var ContinueButton = function ContinueButton() {
231
376
  * @Date: 2025-01-16 16:30
232
377
  */
233
378
  var handleContinue = /*#__PURE__*/function () {
234
- var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
379
+ var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6() {
235
380
  var value, checkRes, emptyHolders;
236
- return _regeneratorRuntime().wrap(function _callee5$(_context5) {
237
- while (1) switch (_context5.prev = _context5.next) {
381
+ return _regeneratorRuntime().wrap(function _callee6$(_context6) {
382
+ while (1) switch (_context6.prev = _context6.next) {
238
383
  case 0:
239
384
  if (!isLastStep) {
240
- _context5.next = 14;
385
+ _context6.next = 14;
241
386
  break;
242
387
  }
243
388
  value = formatValues(data); // 检测商品是否可以下单
244
- _context5.next = 4;
389
+ _context6.next = 4;
245
390
  return onCheckBeforeBooking(value);
246
391
  case 4:
247
- checkRes = _context5.sent;
392
+ checkRes = _context6.sent;
248
393
  if (!((checkRes === null || checkRes === void 0 ? void 0 : checkRes.result) === false)) {
249
- _context5.next = 9;
394
+ _context6.next = 9;
250
395
  break;
251
396
  }
252
397
  setCheckedNumber(checkRes === null || checkRes === void 0 ? void 0 : checkRes.num);
253
398
  setOpenCheckout(true);
254
- return _context5.abrupt("return");
399
+ return _context6.abrupt("return");
255
400
  case 9:
256
401
  // 验证holder是否为空
257
402
  emptyHolders = getWithoutCartItemsHolderNames();
258
403
  if (!((emptyHolders === null || emptyHolders === void 0 ? void 0 : emptyHolders.length) > 0)) {
259
- _context5.next = 12;
404
+ _context6.next = 12;
260
405
  break;
261
406
  }
262
- return _context5.abrupt("return", setOpenEmptyHolder(true));
407
+ return _context6.abrupt("return", setOpenEmptyHolder(true));
263
408
  case 12:
264
409
  // 关闭购物车弹窗
265
410
  onCloseCart();
266
- return _context5.abrupt("return", handleCheckout());
411
+ return _context6.abrupt("return", handleCheckout());
267
412
  case 14:
268
413
  if (isLogin()) {
269
- _context5.next = 17;
414
+ _context6.next = 17;
270
415
  break;
271
416
  }
272
417
  onCloseCart();
273
- return _context5.abrupt("return", openLoginModal({
418
+ return _context6.abrupt("return", openLoginModal({
274
419
  callback: function () {
275
- var _callback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(status) {
276
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
277
- while (1) switch (_context4.prev = _context4.next) {
420
+ var _callback2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(status) {
421
+ return _regeneratorRuntime().wrap(function _callee5$(_context5) {
422
+ while (1) switch (_context5.prev = _context5.next) {
278
423
  case 0:
279
424
  if (!(status === 'success')) {
280
- _context4.next = 4;
425
+ _context5.next = 4;
281
426
  break;
282
427
  }
283
- _context4.next = 3;
428
+ _context5.next = 3;
284
429
  return getCartItemProductsWithQuotation();
285
430
  case 3:
286
431
  handleHolder();
287
432
  case 4:
288
433
  case "end":
289
- return _context4.stop();
434
+ return _context5.stop();
290
435
  }
291
- }, _callee4);
436
+ }, _callee5);
292
437
  }));
293
- function callback(_x) {
294
- return _callback.apply(this, arguments);
438
+ function callback(_x2) {
439
+ return _callback2.apply(this, arguments);
295
440
  }
296
441
  return callback;
297
442
  }()
@@ -300,9 +445,9 @@ var ContinueButton = function ContinueButton() {
300
445
  handleHolder();
301
446
  case 18:
302
447
  case "end":
303
- return _context5.stop();
448
+ return _context6.stop();
304
449
  }
305
- }, _callee5);
450
+ }, _callee6);
306
451
  }));
307
452
  return function handleContinue() {
308
453
  return _ref7.apply(this, arguments);
@@ -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;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Layout: () => JSX.Element;
4
3
  export default Layout;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const EmptyHolderModal: (props: any) => JSX.Element;
4
3
  export default EmptyHolderModal;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Footer: () => JSX.Element;
4
3
  export default Footer;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Header: () => JSX.Element;
4
3
  export default Header;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Information: () => JSX.Element;
4
3
  export default Information;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const InformationOptionsModal: (props: any) => JSX.Element;
4
3
  export default InformationOptionsModal;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const OrderProductModal: (props: any) => JSX.Element;
4
3
  export default OrderProductModal;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const RemoveOptionConfirmModal: (props: any) => JSX.Element;
3
2
  export default RemoveOptionConfirmModal;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const SelectHolderModal: (props: any) => JSX.Element;
3
2
  export default SelectHolderModal;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare type CallToBookProps = {
3
2
  show: boolean;
4
3
  type: string;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const WeekItem: (props: any) => JSX.Element;
4
3
  export default WeekItem;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare type CalenDateWeekProps = {
4
3
  currentDate: string;
@@ -1,3 +1,4 @@
1
- /// <reference types="react" />
2
- declare const BookingOptions: () => JSX.Element;
1
+ declare const BookingOptions: (props: {
2
+ onChangeBookingOption?: ((bookingOption: any) => void) | undefined;
3
+ }) => JSX.Element;
3
4
  export default BookingOptions;
@@ -3,12 +3,17 @@ import OpenCard from "../../OpenCard";
3
3
  import { PisellCheckboxGroup, PisellText } from '@pisell/materials';
4
4
  import { locales } from '@pisell/utils';
5
5
  import { useEventDetail } from "../../../../Sales";
6
- var BookingOptions = function BookingOptions() {
6
+ var BookingOptions = function BookingOptions(props) {
7
7
  var _detail$bookingOption, _detail$bookingOption2;
8
8
  var _useEventDetail = useEventDetail(),
9
9
  detail = _useEventDetail.detail,
10
10
  currentBookingOption = _useEventDetail.currentBookingOption,
11
11
  selectEventDetailBookingOptions = _useEventDetail.selectEventDetailBookingOptions;
12
+ var onChange = function onChange(value, item) {
13
+ var _props$onChangeBookin;
14
+ selectEventDetailBookingOptions(value);
15
+ props === null || props === void 0 || (_props$onChangeBookin = props.onChangeBookingOption) === null || _props$onChangeBookin === void 0 || _props$onChangeBookin.call(props, item);
16
+ };
12
17
  return /*#__PURE__*/React.createElement(OpenCard, {
13
18
  title: locales.getText('pisell2.event.booking.options'),
14
19
  showBorder: true,
@@ -30,9 +35,7 @@ var BookingOptions = function BookingOptions() {
30
35
  className: "price"
31
36
  }));
32
37
  },
33
- onChange: function onChange(value) {
34
- return selectEventDetailBookingOptions(value);
35
- }
38
+ onChange: onChange
36
39
  }));
37
40
  };
38
41
  export default BookingOptions;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const Resource: (props: any) => JSX.Element;
3
2
  export default Resource;