@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
@@ -61,59 +61,145 @@ var ContinueButton = () => {
61
61
  const [openEmptyHolder, setOpenEmptyHolder] = (0, import_react.useState)(false);
62
62
  const { setData, removeSessionStorage } = (0, import_Sales.useSales)();
63
63
  const context = (0, import_useEngineContext.default)();
64
- const { store } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
64
+ const { store, action, getStore } = ((_a = context.appHelper) == null ? void 0 : _a.utils) || {};
65
65
  const handleCheckout = async () => {
66
- var _a2;
67
- const value = (0, import_utils2.formatValues)(data);
68
- const result = await onCheckout(value);
69
- if (result == null ? void 0 : result.success) {
70
- removeSessionStorage();
71
- } else {
72
- (0, import_materials.PisellToast)({
73
- content: ((_a2 = result == null ? void 0 : result.err) == null ? void 0 : _a2.message) || ""
74
- });
75
- }
66
+ const params = (0, import_utils2.getFormParams)(data);
67
+ action == null ? void 0 : action({
68
+ type: "pisell1.goProductForm",
69
+ data: params,
70
+ callback: async (e) => {
71
+ var _a2;
72
+ const value = (0, import_utils2.formatValues)(data, false, {
73
+ relation_forms: e
74
+ });
75
+ const result = await onCheckout(value);
76
+ if (result == null ? void 0 : result.success) {
77
+ removeSessionStorage();
78
+ } else {
79
+ (0, import_materials.PisellToast)({
80
+ content: ((_a2 = result == null ? void 0 : result.err) == null ? void 0 : _a2.message) || ""
81
+ });
82
+ }
83
+ }
84
+ });
76
85
  };
77
- const getEventDetailBookingOptions = (0, import_ahooks.useRequest)(
78
- import_serve.getEventDetailBookingOptionsApi,
79
- {
80
- manual: true,
81
- onSuccess: (res) => {
86
+ const _getProductPrice = (0, import_ahooks.useRequest)(import_serve.getProductPrice, {
87
+ manual: true,
88
+ onSuccess: (res) => {
89
+ const list = res.data || [];
90
+ const productById = list.reduce((pre, cur) => {
91
+ pre[cur.id] = cur;
92
+ return pre;
93
+ }, {});
94
+ console.log("start update price");
95
+ const newCartItems = cartData.cartItems.map((item) => {
82
96
  var _a2;
83
- const list = ((_a2 = res.data) == null ? void 0 : _a2.list) || [];
84
- const productById = list.reduce((pre, cur) => {
85
- pre[cur.id] = cur;
86
- return pre;
87
- }, {});
88
- const newCartItems = cartData.cartItems.map((item) => {
89
- const { product } = item._originData || {};
90
- let newProduct = productById[product.product_id];
91
- item.price = newProduct.price;
92
- item.total = newProduct.price;
97
+ const { product } = item._originData || {};
98
+ let newProduct = productById[product.product_id];
99
+ let _totalPrice = Number(newProduct.price);
100
+ if (!(item == null ? void 0 : item._productDetail)) {
101
+ item.price = _totalPrice;
102
+ item.total = _totalPrice;
93
103
  return item;
94
- });
95
- setData({
96
- cartData: {
97
- ...cartData,
98
- cartItems: newCartItems
104
+ }
105
+ const { bundle = [], options } = item._productDetail;
106
+ if (product == null ? void 0 : product.product_variant_id) {
107
+ const { variant = [] } = newProduct;
108
+ const _variant = variant.find(
109
+ (v) => v.id === product.product_variant_id
110
+ );
111
+ if (_variant) {
112
+ _totalPrice = Number(_variant.price);
99
113
  }
100
- });
101
- }
114
+ } else if (
115
+ // 2. 套餐商品
116
+ Array.isArray(product == null ? void 0 : product.product_bundle) && product.product_bundle.length > 0
117
+ ) {
118
+ const { bundle_group = [] } = newProduct;
119
+ for (let i = 0; i < product.product_bundle.length; i++) {
120
+ const pbItem = product.product_bundle[i];
121
+ const { bundle_group_id, bundle_id, option } = pbItem;
122
+ const _originBundleItemInfo = bundle.find(
123
+ (bi) => bi.id === bundle_id
124
+ );
125
+ const _targetBundleGroup = bundle_group.find(
126
+ (bg) => bg.id === bundle_group_id
127
+ );
128
+ if ((_a2 = _targetBundleGroup == null ? void 0 : _targetBundleGroup.bundle_item) == null ? void 0 : _a2.length) {
129
+ let _newBundleItemInfo = _targetBundleGroup.bundle_item.find(
130
+ (bi) => bi.id === bundle_id
131
+ );
132
+ if ((_originBundleItemInfo == null ? void 0 : _originBundleItemInfo._bundle_product_id) === (_newBundleItemInfo == null ? void 0 : _newBundleItemInfo.bundle_product_id)) {
133
+ const {
134
+ price_type,
135
+ num = 0,
136
+ option: _originBundleItemOptions
137
+ } = _originBundleItemInfo;
138
+ const _bundleItemPrice = Number(_newBundleItemInfo.price);
139
+ if (price_type === "markup") {
140
+ _totalPrice += _bundleItemPrice * num;
141
+ } else if (price_type === "markdown") {
142
+ _totalPrice -= _bundleItemPrice * num;
143
+ } else {
144
+ _totalPrice += _bundleItemPrice * num;
145
+ }
146
+ if (Array.isArray(option) && (option == null ? void 0 : option.length) > 0) {
147
+ for (let j = 0; j < option.length; j++) {
148
+ const { option_group_item_id } = option[j];
149
+ const _originOptionItem = _originBundleItemOptions.find(
150
+ (op) => op.product_option_item_id === option_group_item_id
151
+ );
152
+ if (_originOptionItem) {
153
+ const { price, num: _optionNum = 0 } = _originOptionItem;
154
+ _totalPrice += Number(price) * _optionNum;
155
+ }
156
+ }
157
+ }
158
+ }
159
+ }
160
+ }
161
+ } else if (
162
+ // 3. 单规格商品
163
+ Array.isArray(product == null ? void 0 : product.product_option_item) && product.product_option_item.length > 0
164
+ ) {
165
+ for (let i = 0; i < product.product_option_item.length; i++) {
166
+ const { option_group_item_id } = product.product_option_item[i];
167
+ const _originOptionItem = options.find(
168
+ (op) => op.product_option_item_id === option_group_item_id
169
+ );
170
+ if (_originOptionItem) {
171
+ const { price, num = 0 } = _originOptionItem;
172
+ _totalPrice += Number(price) * num;
173
+ }
174
+ }
175
+ }
176
+ item.price = _totalPrice;
177
+ item.total = _totalPrice;
178
+ return item;
179
+ });
180
+ console.log("new cart data", newCartItems);
181
+ setData({
182
+ cartData: {
183
+ ...cartData,
184
+ cartItems: newCartItems
185
+ }
186
+ });
102
187
  }
103
- );
188
+ });
104
189
  const getCartItemProductsWithQuotation = async () => {
105
190
  var _a2, _b2;
106
191
  const ids = cartData.cartItems.map((item) => {
107
- const { product } = item._originData || {};
108
- return product == null ? void 0 : product.product_id;
192
+ const { product = {} } = item._originData || {};
193
+ const { product_id } = product;
194
+ return product_id;
109
195
  }).filter((id) => !!id);
110
- const customer = (_b2 = (_a2 = store == null ? void 0 : store.getState()) == null ? void 0 : _a2.global) == null ? void 0 : _b2.userInfo;
111
- getEventDetailBookingOptions.run({
196
+ const store2 = getStore();
197
+ const customer = (_b2 = (_a2 = store2 == null ? void 0 : store2.getState()) == null ? void 0 : _a2.global) == null ? void 0 : _b2.userInfo;
198
+ if (!(ids == null ? void 0 : ids.length)) return;
199
+ _getProductPrice.run({
112
200
  ids,
113
- num: 100,
114
- skip: 1,
115
- customer_id: customer == null ? void 0 : customer.id,
116
- open_quotation: 1
201
+ customer_id: customer == null ? void 0 : customer.id
202
+ // open_quotation: 1,
117
203
  });
118
204
  };
119
205
  const handleNextStep = async () => {
@@ -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;
@@ -37,9 +37,14 @@ var import_OpenCard = __toESM(require("../../OpenCard"));
37
37
  var import_materials = require("@pisell/materials");
38
38
  var import_utils = require("@pisell/utils");
39
39
  var import_Sales = require("../../../../Sales");
40
- var BookingOptions = () => {
40
+ var BookingOptions = (props) => {
41
41
  var _a, _b;
42
42
  const { detail, currentBookingOption, selectEventDetailBookingOptions } = (0, import_Sales.useEventDetail)();
43
+ const onChange = (value, item) => {
44
+ var _a2;
45
+ selectEventDetailBookingOptions(value);
46
+ (_a2 = props == null ? void 0 : props.onChangeBookingOption) == null ? void 0 : _a2.call(props, item);
47
+ };
43
48
  return /* @__PURE__ */ import_react.default.createElement(
44
49
  import_OpenCard.default,
45
50
  {
@@ -67,7 +72,7 @@ var BookingOptions = () => {
67
72
  }
68
73
  ));
69
74
  },
70
- onChange: (value) => selectEventDetailBookingOptions(value)
75
+ onChange
71
76
  }
72
77
  )
73
78
  );
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const Resource: (props: any) => JSX.Element;
3
2
  export default Resource;
@@ -42,12 +42,21 @@ var import_Resource = __toESM(require("./components/Resource"));
42
42
  var import_BookingOptions = __toESM(require("./components/BookingOptions"));
43
43
  var import_OrderProductModal = __toESM(require("../Provider/OrderProductModal/index"));
44
44
  var import_index = require("./index.less");
45
+ var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContext"));
45
46
  var BookingDetailModal = (props) => {
46
47
  var _a;
47
48
  const modalContentRef = (0, import_react.useRef)(null);
49
+ const context = (0, import_useEngineContext.default)();
50
+ const { utils } = context.appHelper || {};
48
51
  const tabsRef = (0, import_react.useRef)();
49
52
  const { open = false } = props;
50
- const { detail, onCloseEventDetail, onSelectEventDetail } = (0, import_Sales.useEventDetail)();
53
+ const {
54
+ detail,
55
+ onCloseEventDetail,
56
+ onSelectEventDetail,
57
+ selectEventDetailProductDetail,
58
+ checkBeforeSelectEventDetail
59
+ } = (0, import_Sales.useEventDetail)();
51
60
  const { addToCart, checkBeforeAddToCart, checkBeforeAddToCartResquest } = (0, import_Sales.useCart)();
52
61
  const [activeTab, setActiveTab] = (0, import_react.useState)("introduction");
53
62
  const [isScrolling, setIsScrolling] = (0, import_react.useState)(false);
@@ -175,34 +184,80 @@ var BookingDetailModal = (props) => {
175
184
  }
176
185
  };
177
186
  const content = () => {
178
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "booking-detail-modal-content", style: { height: (0, import_utils.isMobile)() ? "100%" : "calc(80vh - 146px)" } }, /* @__PURE__ */ import_react.default.createElement("div", { className: "anchor-wrapper" }, /* @__PURE__ */ import_react.default.createElement(
179
- import_materials.PisellAnchor,
187
+ return /* @__PURE__ */ import_react.default.createElement(
188
+ "div",
180
189
  {
181
- ref: tabsRef,
182
- options: anchorOptions,
183
- containerRef: modalContentRef,
184
- tab: activeTab,
185
- onChange: (key) => {
186
- handleTabChange(key);
187
- },
188
- onTabClick: () => {
189
- isUserClickRef.current = true;
190
+ className: "booking-detail-modal-content",
191
+ style: { height: (0, import_utils.isMobile)() ? "100%" : "calc(80vh - 146px)" }
192
+ },
193
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "anchor-wrapper" }, /* @__PURE__ */ import_react.default.createElement(
194
+ import_materials.PisellAnchor,
195
+ {
196
+ ref: tabsRef,
197
+ options: anchorOptions,
198
+ containerRef: modalContentRef,
199
+ tab: activeTab,
200
+ onChange: (key) => {
201
+ handleTabChange(key);
202
+ },
203
+ onTabClick: () => {
204
+ isUserClickRef.current = true;
205
+ }
190
206
  }
207
+ )),
208
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "content-wrapper", ref: modalContentRef }, /* @__PURE__ */ import_react.default.createElement("div", { "data-section": "introduction", className: "content-section" }, (images == null ? void 0 : images.length) > 0 ? /* @__PURE__ */ import_react.default.createElement(
209
+ import_materials.PisellImageCarousels,
210
+ {
211
+ dataSource: images,
212
+ width: "100%",
213
+ height: (0, import_utils.isMobile)() ? 300 : 400,
214
+ showArrows: !(0, import_utils.isMobile)(),
215
+ showDots: (images == null ? void 0 : images.length) > 1,
216
+ autoplay: (images == null ? void 0 : images.length) > 1,
217
+ loop: false
218
+ }
219
+ ) : null, /* @__PURE__ */ import_react.default.createElement(import_eventCard.default, { data: detail == null ? void 0 : detail.introduction })), /* @__PURE__ */ import_react.default.createElement("div", { "data-section": "schedule", className: "content-section" }, /* @__PURE__ */ import_react.default.createElement(import_Schedule.default, null)), /* @__PURE__ */ import_react.default.createElement("div", { "data-section": "resource", className: "content-section" }, /* @__PURE__ */ import_react.default.createElement(import_Resource.default, null)), /* @__PURE__ */ import_react.default.createElement("div", { "data-section": "booking_options", className: "content-section" }, /* @__PURE__ */ import_react.default.createElement(
220
+ import_BookingOptions.default,
221
+ {
222
+ onChangeBookingOption: checkToOpenProductDetailModal
223
+ }
224
+ )))
225
+ );
226
+ };
227
+ const checkToOpenProductDetailModal = (bookingOption) => {
228
+ var _a2;
229
+ console.log(">>>>>>>", bookingOption);
230
+ if (((_a2 = bookingOption == null ? void 0 : bookingOption._originData) == null ? void 0 : _a2.is_eject) !== 1) {
231
+ return;
232
+ }
233
+ utils == null ? void 0 : utils.action({
234
+ type: "pisell1.productDetail",
235
+ data: {
236
+ detail: { ...(bookingOption == null ? void 0 : bookingOption._originData) || {} },
237
+ isOS: false
238
+ },
239
+ callback: (data) => {
240
+ if (data == null ? void 0 : data.isCancel) {
241
+ return;
242
+ }
243
+ console.log("data>>>>>>", data);
244
+ const product = {
245
+ ...data,
246
+ options: (data == null ? void 0 : data.option) || []
247
+ };
248
+ delete product.option;
249
+ selectEventDetailProductDetail(product);
250
+ handleOk();
191
251
  }
192
- )), /* @__PURE__ */ import_react.default.createElement("div", { className: "content-wrapper", ref: modalContentRef }, /* @__PURE__ */ import_react.default.createElement("div", { "data-section": "introduction", className: "content-section" }, (images == null ? void 0 : images.length) > 0 ? /* @__PURE__ */ import_react.default.createElement(
193
- import_materials.PisellImageCarousels,
194
- {
195
- dataSource: images,
196
- width: "100%",
197
- height: (0, import_utils.isMobile)() ? 300 : 400,
198
- showArrows: !(0, import_utils.isMobile)(),
199
- showDots: (images == null ? void 0 : images.length) > 1,
200
- autoplay: (images == null ? void 0 : images.length) > 1,
201
- loop: false
202
- }
203
- ) : null, /* @__PURE__ */ import_react.default.createElement(import_eventCard.default, { data: detail == null ? void 0 : detail.introduction })), /* @__PURE__ */ import_react.default.createElement("div", { "data-section": "schedule", className: "content-section" }, /* @__PURE__ */ import_react.default.createElement(import_Schedule.default, null)), /* @__PURE__ */ import_react.default.createElement("div", { "data-section": "resource", className: "content-section" }, /* @__PURE__ */ import_react.default.createElement(import_Resource.default, null)), /* @__PURE__ */ import_react.default.createElement("div", { "data-section": "booking_options", className: "content-section" }, /* @__PURE__ */ import_react.default.createElement(import_BookingOptions.default, null))));
252
+ });
204
253
  };
205
254
  const handleOk = async () => {
255
+ console.log(">>>>>>>", detail);
256
+ const result = checkBeforeSelectEventDetail();
257
+ if (!result) {
258
+ checkToOpenProductDetailModal(detail == null ? void 0 : detail.selectedProduct);
259
+ return;
260
+ }
206
261
  onSelectEventDetail();
207
262
  const checkRes = await checkBeforeAddToCart();
208
263
  if ((checkRes == null ? void 0 : checkRes.result) === false) {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const SetupForm: ({ onReady, amount, order_id, payment_method, scene, }: any) => JSX.Element;
4
3
  export default SetupForm;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { WalletPassDataType } from '../../../PaymentMethods/WalletPass/serve';
3
2
  import './index.less';
4
3
  interface WalletUseListProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  interface CustomerListProps {
4
3
  value: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { PopoverProps } from 'antd';
3
2
  import { CustomerCardProps } from './CustomerCard';
4
3
  import './index.less';
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  declare const Actor: ({ name }: {
3
2
  name: string;
4
3
  }) => JSX.Element;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  export interface InfoProps {
3
2
  relation_id: any;
4
3
  action: any;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  interface valueType {
4
3
  }
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import "./index.less";
3
2
  interface ProductExtensionProps {
4
3
  onDataChange: any;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const TabProduct: (props: any) => JSX.Element;
3
2
  export default TabProduct;
@@ -58,7 +58,9 @@ var TabProduct = (props) => {
58
58
  (0, import_react.useEffect)(() => {
59
59
  if (list == null ? void 0 : list.length) {
60
60
  setCurrentGroupId(list[0].id);
61
- handleObserver();
61
+ requestAnimationFrame(() => {
62
+ handleObserver();
63
+ });
62
64
  }
63
65
  }, [list]);
64
66
  const handleObserver = (0, import_ahooks.useMemoizedFn)(() => {
@@ -142,7 +144,9 @@ var TabProduct = (props) => {
142
144
  tab: currentGroupId,
143
145
  onChange: (e) => {
144
146
  var _a;
145
- let comWrapper = document.querySelector(".pisell-product-select-wrapper");
147
+ let comWrapper = document.querySelector(
148
+ ".pisell-product-select-wrapper"
149
+ );
146
150
  let categoryDom = document.querySelector(
147
151
  ".pisell-product-select-tabs-wrapper"
148
152
  );
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  export interface ProductCardConfig {
4
3
  showImg: boolean;
@@ -17,6 +17,6 @@ declare let modal: Omit<ModalStaticFunctions, "warn">;
17
17
  export declare const setModal: (m: Omit<ModalStaticFunctions, "warn">) => void;
18
18
  export declare const saveConfirm: () => Promise<{
19
19
  destroy: () => void;
20
- update: (configUpdate: import("antd/es/modal/interface").ModalFuncProps | ((prevConfig: import("antd/es/modal/interface").ModalFuncProps) => import("antd/es/modal/interface").ModalFuncProps)) => void;
20
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
21
21
  }>;
22
22
  export { modal };
@@ -27,8 +27,8 @@ __export(utils_exports, {
27
27
  module.exports = __toCommonJS(utils_exports);
28
28
  var import_utils = require("@pisell/utils");
29
29
  var Request = class {
30
- request = {};
31
30
  constructor() {
31
+ this.request = {};
32
32
  }
33
33
  setRequest(val) {
34
34
  this.request = val;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const Cart: () => JSX.Element;
4
3
  export default Cart;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const useAddService: (id?: number, type?: string) => JSX.Element | null;
3
2
  export default useAddService;
@@ -1,3 +1,2 @@
1
- /// <reference types="react" />
2
1
  declare const useClearCart: (key?: number | undefined) => JSX.Element | null;
3
2
  export default useClearCart;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  declare const TicketBooking: () => JSX.Element;
4
3
  export default TicketBooking;
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import type { Dayjs } from 'dayjs';
3
2
  import './index.less';
4
3
  interface ITimeBarProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './index.less';
3
2
  interface TicketBookingProps {
4
3
  productExtensionType: string[];
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import { Modal as AntModal, ModalFuncProps as AntModalFuncProps, ModalProps as AntModalProps } from 'antd';
3
2
  import './index.less';
4
3
  interface ModalProps extends AntModalProps {
@@ -1,4 +1,3 @@
1
- /// <reference types="react" />
2
1
  import './../../index.less';
3
2
  declare const Search: () => JSX.Element;
4
3
  export default Search;
@@ -18,6 +18,6 @@ declare let modal: Omit<ModalStaticFunctions, 'warn'>;
18
18
  export declare const setModal: (m: Omit<ModalStaticFunctions, 'warn'>) => void;
19
19
  export declare const saveConfirm: () => Promise<{
20
20
  destroy: () => void;
21
- update: (configUpdate: import("antd/es/modal/interface").ModalFuncProps | ((prevConfig: import("antd/es/modal/interface").ModalFuncProps) => import("antd/es/modal/interface").ModalFuncProps)) => void;
21
+ update: (configUpdate: import("antd").ModalFuncProps | ((prevConfig: import("antd").ModalFuncProps) => import("antd").ModalFuncProps)) => void;
22
22
  }>;
23
23
  export { modal };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "3.3.33",
3
+ "version": "3.3.35",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import './index.less';
3
- declare const SelectProduct: React.FC;
4
- export default SelectProduct;