@pisell/private-materials 6.0.24 → 6.0.25

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 (661) 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 +162 -146
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +12 -27
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +18 -33
  11. package/es/businessModel/SalesModel/Sales/index.d.ts +24 -0
  12. package/es/businessModel/SalesModel/Sales/index.js +69 -0
  13. package/es/businessModel/SalesModel/hooks/index.d.ts +1 -0
  14. package/es/businessModel/SalesModel/hooks/index.js +7 -0
  15. package/es/businessModel/SalesModel/index.d.ts +4 -0
  16. package/es/businessModel/SalesModel/index.js +18 -0
  17. package/es/businessModel/index.d.ts +0 -0
  18. package/es/businessModel/index.js +0 -0
  19. package/es/components/Sales/Cart/index.d.ts +53 -0
  20. package/es/components/Sales/Cart/index.js +590 -0
  21. package/es/components/Sales/Cart/serve.d.ts +2 -0
  22. package/es/components/Sales/Cart/serve.js +11 -0
  23. package/es/components/Sales/Cart/types.d.ts +19 -0
  24. package/es/components/Sales/Cart/types.js +1 -0
  25. package/es/components/Sales/Checkout/index.d.ts +33 -0
  26. package/es/components/Sales/Checkout/index.js +152 -0
  27. package/es/components/Sales/Checkout/serve.d.ts +2 -0
  28. package/es/components/Sales/Checkout/serve.js +11 -0
  29. package/es/components/Sales/Checkout/utils.d.ts +27 -0
  30. package/es/components/Sales/Checkout/utils.js +104 -0
  31. package/es/components/Sales/Customer/index.d.ts +24 -0
  32. package/es/components/Sales/Customer/index.js +59 -0
  33. package/es/components/Sales/Event/Detail.d.ts +27 -0
  34. package/es/components/Sales/Event/Detail.js +246 -0
  35. package/es/components/Sales/Event/index.d.ts +30 -0
  36. package/es/components/Sales/Event/index.js +123 -0
  37. package/es/components/Sales/Event/serve.d.ts +26 -0
  38. package/es/components/Sales/Event/serve.js +33 -0
  39. package/es/components/Sales/Holder/index.d.ts +33 -0
  40. package/es/components/Sales/Holder/index.js +229 -0
  41. package/es/components/Sales/Holder/serve.d.ts +8 -0
  42. package/es/components/Sales/Holder/serve.js +20 -0
  43. package/es/components/Sales/Init/index.d.ts +24 -0
  44. package/es/components/Sales/Init/index.js +117 -0
  45. package/es/components/Sales/Init/serve.d.ts +3 -0
  46. package/es/components/Sales/Init/serve.js +11 -0
  47. package/es/components/Sales/Resource/index.d.ts +26 -0
  48. package/es/components/Sales/Resource/index.js +128 -0
  49. package/es/components/Sales/Resource/serve.d.ts +5 -0
  50. package/es/components/Sales/Resource/serve.js +8 -0
  51. package/es/components/Sales/Step/index.d.ts +37 -0
  52. package/es/components/Sales/Step/index.js +195 -0
  53. package/es/components/Sales/Summary/index.d.ts +25 -0
  54. package/es/components/Sales/Summary/index.js +50 -0
  55. package/es/components/Sales/Summary/serve.d.ts +0 -0
  56. package/es/components/Sales/Summary/serve.js +0 -0
  57. package/es/components/Sales/Summary/utils.d.ts +36 -0
  58. package/es/components/Sales/Summary/utils.js +63 -0
  59. package/es/components/Sales/hooks/index.d.ts +1 -0
  60. package/es/components/Sales/hooks/index.js +3 -0
  61. package/es/components/Sales/index.d.ts +20 -0
  62. package/es/components/Sales/index.js +26 -0
  63. package/es/components/Sales/utils/index.d.ts +1 -0
  64. package/es/components/Sales/utils/index.js +18 -0
  65. package/es/components/booking/components/customSelect/index.d.ts +1 -0
  66. package/es/components/booking/components/customSelect/index.js +6 -2
  67. package/es/components/booking/components/footer/AppointmentProductModal/index.d.ts +3 -0
  68. package/es/components/booking/components/footer/AppointmentProductModal/index.js +38 -0
  69. package/es/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
  70. package/es/components/booking/components/footer/amount.js +46 -22
  71. package/es/components/booking/components/footer/index.js +116 -79
  72. package/es/components/booking/components/footer/serve.d.ts +2 -0
  73. package/es/components/booking/components/footer/serve.js +44 -0
  74. package/es/components/booking/components/footer/utils.js +280 -35
  75. package/es/components/booking/info/Provider.d.ts +0 -0
  76. package/es/components/booking/info/Provider.js +54 -0
  77. package/es/components/booking/info/addServiceVariant/index.js +8 -1
  78. package/es/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +1 -0
  79. package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +14 -13
  80. package/es/components/booking/info/clientVariant/vertical/index.js +131 -15
  81. package/es/components/booking/info/dateRange/index.d.ts +4 -0
  82. package/es/components/booking/info/dateRange/index.js +98 -0
  83. package/es/components/booking/info/dateRange/index.less +21 -0
  84. package/es/components/booking/info/main.js +44 -28
  85. package/es/components/booking/info/model.js +3 -0
  86. package/es/components/booking/info/pet/ChangePetModal/index.d.ts +4 -0
  87. package/es/components/booking/info/pet/ChangePetModal/index.js +134 -0
  88. package/es/components/booking/info/pet/ChangePetModal/index.less +4 -0
  89. package/es/components/booking/info/pet/index.d.ts +1 -1
  90. package/es/components/booking/info/pet/index.js +93 -34
  91. package/es/components/booking/info/service/addService/index.d.ts +0 -1
  92. package/es/components/booking/info/service/addService/index.js +195 -104
  93. package/es/components/booking/info/service/addService/index.less +13 -3
  94. package/es/components/booking/info/service/addService/utils.d.ts +12 -2
  95. package/es/components/booking/info/service/addService/utils.js +103 -26
  96. package/es/components/booking/info/service/addTimeModal/index.d.ts +0 -1
  97. package/es/components/booking/info/service/editService/BookingList/index.d.ts +4 -0
  98. package/es/components/booking/info/service/editService/BookingList/index.js +39 -0
  99. package/es/components/booking/info/service/editService/EditTabs/index.d.ts +3 -0
  100. package/es/components/booking/info/service/editService/EditTabs/index.js +35 -0
  101. package/es/components/booking/info/service/editService/index.js +449 -141
  102. package/es/components/booking/info/service/editService/index.less +18 -13
  103. package/es/components/booking/info/service/serve.d.ts +10 -0
  104. package/es/components/booking/info/service/serve.js +28 -0
  105. package/es/components/booking/info/service/serviceManager/distributeDiscount.d.ts +11 -0
  106. package/es/components/booking/info/service/serviceManager/distributeDiscount.js +55 -0
  107. package/es/components/booking/info/service/serviceManager/index.d.ts +20 -0
  108. package/es/components/booking/info/service/serviceManager/index.js +281 -0
  109. package/es/components/booking/info/service/serviceManager/utils.d.ts +0 -0
  110. package/es/components/booking/info/service/serviceManager/utils.js +0 -0
  111. package/es/components/booking/info/service2/Group/utils.d.ts +14 -0
  112. package/es/components/booking/info/service2/Group/utils.js +146 -0
  113. package/es/components/booking/info/service2/Lists.d.ts +3 -0
  114. package/es/components/booking/info/service2/Lists.js +153 -0
  115. package/es/components/booking/info/service2/hooks/useSelectPet.d.ts +6 -0
  116. package/es/components/booking/info/service2/hooks/useSelectPet.js +54 -0
  117. package/es/components/booking/info/service2/index.d.ts +6 -0
  118. package/es/components/booking/info/service2/index.js +57 -0
  119. package/es/components/booking/info/service2/status.d.ts +31 -0
  120. package/es/components/booking/info/service2/status.js +78 -0
  121. package/es/components/booking/info/service2/utils.d.ts +240 -0
  122. package/es/components/booking/info/service2/utils.js +1077 -0
  123. package/es/components/booking/info/utils.d.ts +20 -0
  124. package/es/components/booking/info/utils.js +38 -1
  125. package/es/components/booking/info2/utilsByBooking.js +0 -1
  126. package/es/components/booking/locales.d.ts +66 -0
  127. package/es/components/booking/locales.js +81 -3
  128. package/es/components/booking/materiels/contacts/index.d.ts +1 -0
  129. package/es/components/booking/materiels/holder/index.d.ts +7 -0
  130. package/es/components/booking/materiels/holder/index.js +51 -0
  131. package/es/components/booking/model.d.ts +5 -1
  132. package/es/components/booking/model.js +4 -2
  133. package/es/components/booking/utils.d.ts +12 -3
  134. package/es/components/booking/utils.js +143 -26
  135. package/es/components/eftpos/hooks.d.ts +4 -4
  136. package/es/components/eftpos/index.d.ts +1 -0
  137. package/es/components/eftposPay/component/fail/failCustom.d.ts +0 -1
  138. package/es/components/eftposPay/component/fail/index.d.ts +0 -1
  139. package/es/components/eftposPay/component/fail/unknow.d.ts +0 -1
  140. package/es/components/eftposPay/component/step/index.d.ts +6 -6
  141. package/es/components/eftposPay/component/step/step.d.ts +4 -4
  142. package/es/components/eftposPay/hooks.d.ts +1 -1
  143. package/es/components/eftposPay/pay.d.ts +0 -1
  144. package/es/components/eftposPay/tyro/hooks.d.ts +2 -2
  145. package/es/components/eftposPay/windcave/helper.d.ts +1 -1
  146. package/es/components/eventBooking/assets/alert-circle.png +0 -0
  147. package/es/components/eventBooking/assets/calendar-heart.svg +5 -0
  148. package/es/components/eventBooking/assets/compass.svg +13 -0
  149. package/es/components/eventBooking/assets/image.svg +5 -0
  150. package/es/components/eventBooking/assets/phone.svg +5 -0
  151. package/es/components/eventBooking/assets/shopping-cart.svg +10 -0
  152. package/es/components/eventBooking/components/ErrorTip/index.d.ts +3 -0
  153. package/es/components/eventBooking/components/ErrorTip/index.js +14 -0
  154. package/es/components/eventBooking/components/ErrorTip/index.less +51 -0
  155. package/es/components/eventBooking/components/OpenCard/index.d.ts +4 -0
  156. package/es/components/eventBooking/components/OpenCard/index.js +65 -0
  157. package/es/components/eventBooking/components/OpenCard/index.less +52 -0
  158. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +3 -0
  159. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +274 -0
  160. package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.less +0 -0
  161. package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +3 -0
  162. package/es/components/eventBooking/components/Provider/Cart/Item/Total.js +46 -0
  163. package/es/components/eventBooking/components/Provider/Cart/Item/index.d.ts +3 -0
  164. package/es/components/eventBooking/components/Provider/Cart/Item/index.js +63 -0
  165. package/es/components/eventBooking/components/Provider/Cart/Item/index.less +87 -0
  166. package/es/components/eventBooking/components/Provider/Cart/index.d.ts +3 -0
  167. package/es/components/eventBooking/components/Provider/Cart/index.js +30 -0
  168. package/es/components/eventBooking/components/Provider/Cart/index.less +2 -0
  169. package/es/components/eventBooking/components/Provider/Content/index.d.ts +4 -0
  170. package/es/components/eventBooking/components/Provider/Content/index.js +65 -0
  171. package/es/components/eventBooking/components/Provider/Content/index.less +31 -0
  172. package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +3 -0
  173. package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.js +34 -0
  174. package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.less +17 -0
  175. package/es/components/eventBooking/components/Provider/Event/index.d.ts +3 -0
  176. package/es/components/eventBooking/components/Provider/Event/index.js +93 -0
  177. package/es/components/eventBooking/components/Provider/Event/index.less +20 -0
  178. package/es/components/eventBooking/components/Provider/Footer/index.d.ts +3 -0
  179. package/es/components/eventBooking/components/Provider/Footer/index.js +76 -0
  180. package/es/components/eventBooking/components/Provider/Footer/index.less +64 -0
  181. package/es/components/eventBooking/components/Provider/Header/index.d.ts +4 -0
  182. package/es/components/eventBooking/components/Provider/Header/index.js +75 -0
  183. package/es/components/eventBooking/components/Provider/Header/index.less +2 -0
  184. package/es/components/eventBooking/components/Provider/Information/index.d.ts +3 -0
  185. package/es/components/eventBooking/components/Provider/Information/index.js +178 -0
  186. package/es/components/eventBooking/components/Provider/Information/index.less +92 -0
  187. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +3 -0
  188. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.js +34 -0
  189. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.less +27 -0
  190. package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +3 -0
  191. package/es/components/eventBooking/components/Provider/OrderProductModal/index.js +27 -0
  192. package/es/components/eventBooking/components/Provider/OrderProductModal/index.less +32 -0
  193. package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +2 -0
  194. package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.js +31 -0
  195. package/es/components/eventBooking/components/Provider/Resource/index.d.ts +3 -0
  196. package/es/components/eventBooking/components/Provider/Resource/index.js +79 -0
  197. package/es/components/eventBooking/components/Provider/Resource/index.less +46 -0
  198. package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +3 -0
  199. package/es/components/eventBooking/components/Provider/SelectHolderModal.js +90 -0
  200. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +4 -0
  201. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.js +26 -0
  202. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.less +25 -0
  203. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +10 -0
  204. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.js +65 -0
  205. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.less +32 -0
  206. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +3 -0
  207. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.js +69 -0
  208. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.less +12 -0
  209. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +12 -0
  210. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.js +152 -0
  211. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.less +35 -0
  212. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +4 -0
  213. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.js +20 -0
  214. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.less +28 -0
  215. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +5 -0
  216. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.js +38 -0
  217. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.less +87 -0
  218. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +4 -0
  219. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.js +28 -0
  220. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.less +25 -0
  221. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/index.d.ts +4 -0
  222. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/index.js +269 -0
  223. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/index.less +119 -0
  224. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/state.d.ts +63 -0
  225. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/state.js +256 -0
  226. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/SelectDate/index.d.ts +4 -0
  227. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/SelectDate/index.js +173 -0
  228. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/SelectDate/index.less +4 -0
  229. package/es/components/eventBooking/components/bookingAvailabilityCalendar/index.d.ts +14 -0
  230. package/es/components/eventBooking/components/bookingAvailabilityCalendar/index.js +36 -0
  231. package/es/components/eventBooking/components/bookingAvailabilityCalendar/index.less +2 -0
  232. package/es/components/eventBooking/components/bookingAvailabilityCalendar/utils.d.ts +34 -0
  233. package/es/components/eventBooking/components/bookingAvailabilityCalendar/utils.js +70 -0
  234. package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +2 -0
  235. package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +38 -0
  236. package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +3 -0
  237. package/es/components/eventBooking/components/bookingDetailModal/components/Resource.js +33 -0
  238. package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +3 -0
  239. package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.js +30 -0
  240. package/es/components/eventBooking/components/bookingDetailModal/index.d.ts +7 -0
  241. package/es/components/eventBooking/components/bookingDetailModal/index.js +337 -0
  242. package/es/components/eventBooking/components/bookingDetailModal/index.less +82 -0
  243. package/es/components/eventBooking/components/bookingServiceList/index.d.ts +17 -0
  244. package/es/components/eventBooking/components/bookingServiceList/index.js +52 -0
  245. package/es/components/eventBooking/components/bookingServiceList/index.less +6 -0
  246. package/es/components/eventBooking/components/eventCard/index.d.ts +14 -0
  247. package/es/components/eventBooking/components/eventCard/index.js +116 -0
  248. package/es/components/eventBooking/components/eventCard/index.less +81 -0
  249. package/es/components/eventBooking/components/productCard/index.d.ts +16 -0
  250. package/es/components/eventBooking/components/productCard/index.js +79 -0
  251. package/es/components/eventBooking/components/productCard/index.less +60 -0
  252. package/es/components/eventBooking/components/progressBar/index.d.ts +16 -0
  253. package/es/components/eventBooking/components/progressBar/index.js +93 -0
  254. package/es/components/eventBooking/components/progressBar/index.less +15 -0
  255. package/es/components/eventBooking/components/resourceDisplay/index.d.ts +23 -0
  256. package/es/components/eventBooking/components/resourceDisplay/index.js +148 -0
  257. package/es/components/eventBooking/components/resourceDisplay/index.less +95 -0
  258. package/es/components/eventBooking/components/resourceUsability/index.d.ts +12 -0
  259. package/es/components/eventBooking/components/resourceUsability/index.js +44 -0
  260. package/es/components/eventBooking/components/resourceUsability/index.less +40 -0
  261. package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +10 -0
  262. package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.js +37 -0
  263. package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.less +58 -0
  264. package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +11 -0
  265. package/es/components/eventBooking/components/scheduleCalendar/calendarItem.js +127 -0
  266. package/es/components/eventBooking/components/scheduleCalendar/index.d.ts +13 -0
  267. package/es/components/eventBooking/components/scheduleCalendar/index.js +142 -0
  268. package/es/components/eventBooking/components/scheduleCalendar/index.less +222 -0
  269. package/es/components/eventBooking/components/selectHolder/index.d.ts +22 -0
  270. package/es/components/eventBooking/components/selectHolder/index.js +118 -0
  271. package/es/components/eventBooking/components/selectHolder/index.less +70 -0
  272. package/es/components/eventBooking/components/timeResourceSelector/index.d.ts +20 -0
  273. package/es/components/eventBooking/components/timeResourceSelector/index.js +168 -0
  274. package/es/components/eventBooking/components/timeResourceSelector/index.less +74 -0
  275. package/es/components/eventBooking/index.d.ts +4 -0
  276. package/es/components/eventBooking/index.js +58 -0
  277. package/es/components/eventBooking/index.less +22 -0
  278. package/es/components/eventBooking/locales.d.ts +216 -0
  279. package/es/components/eventBooking/locales.js +251 -0
  280. package/es/components/eventBooking/mock.d.ts +627 -0
  281. package/es/components/eventBooking/mock.js +1172 -0
  282. package/es/components/eventBooking/status.d.ts +21 -0
  283. package/es/components/eventBooking/status.js +51 -0
  284. package/es/components/eventBooking/type.d.ts +17 -0
  285. package/es/components/eventBooking/type.js +1 -0
  286. package/es/components/eventBooking/utils.d.ts +45 -0
  287. package/es/components/eventBooking/utils.js +99 -0
  288. package/es/components/login/index.d.ts +1 -0
  289. package/es/components/productExtension/index.d.ts +1 -0
  290. package/es/components/shoppingCart/Provider.d.ts +3 -0
  291. package/es/components/shoppingCart/Provider.js +86 -0
  292. package/es/components/shoppingCart/components/Cart/Product.d.ts +3 -0
  293. package/es/components/shoppingCart/components/Cart/Product.js +71 -0
  294. package/es/components/shoppingCart/components/Cart/index.d.ts +3 -0
  295. package/es/components/shoppingCart/components/Cart/index.js +73 -0
  296. package/es/components/shoppingCart/components/Cart/index.less +68 -0
  297. package/es/components/shoppingCart/components/Empty/index.d.ts +4 -0
  298. package/es/components/shoppingCart/components/Empty/index.js +15 -0
  299. package/es/components/shoppingCart/components/Empty/index.less +19 -0
  300. package/es/components/shoppingCart/components/Render/index.d.ts +4 -0
  301. package/es/components/shoppingCart/components/Render/index.js +70 -0
  302. package/es/components/shoppingCart/components/Render/index.less +2 -0
  303. package/es/components/shoppingCart/components/SelectHolderModal/index.d.ts +4 -0
  304. package/es/components/shoppingCart/components/SelectHolderModal/index.js +132 -0
  305. package/es/components/shoppingCart/components/SelectHolderModal/index.less +32 -0
  306. package/es/components/shoppingCart/hooks/useAddService.d.ts +2 -0
  307. package/es/components/shoppingCart/hooks/useAddService.js +23 -0
  308. package/es/components/shoppingCart/hooks/useClearCart.d.ts +2 -0
  309. package/es/components/shoppingCart/hooks/useClearCart.js +59 -0
  310. package/es/components/shoppingCart/hooks/useContext.d.ts +1 -0
  311. package/es/components/shoppingCart/hooks/useContext.js +5 -0
  312. package/es/components/shoppingCart/index.d.ts +4 -0
  313. package/es/components/shoppingCart/index.js +24 -0
  314. package/es/components/shoppingCart/locales.d.ts +33 -0
  315. package/es/components/shoppingCart/locales.js +38 -0
  316. package/es/components/shoppingCart/mock.d.ts +40 -0
  317. package/es/components/shoppingCart/mock.js +40 -0
  318. package/es/components/shoppingCart/status.d.ts +2 -0
  319. package/es/components/shoppingCart/status.js +22 -0
  320. package/es/components/shoppingCart/type.d.ts +40 -0
  321. package/es/components/shoppingCart/type.js +1 -0
  322. package/es/components/shoppingCart/utils.d.ts +63 -0
  323. package/es/components/shoppingCart/utils.js +116 -0
  324. package/es/components/tabProduct/tabs/index.less +13 -3
  325. package/es/components/taxSelect/index.d.ts +1 -0
  326. package/es/components/wallet/hooks/useWalletCard.d.ts +1 -0
  327. package/es/components/workSpaceList/server.d.ts +3 -3
  328. package/es/index.d.ts +13 -0
  329. package/es/index.js +14 -1
  330. package/lib/businessModel/SalesModel/Sales/index.d.ts +24 -0
  331. package/lib/businessModel/SalesModel/Sales/index.js +104 -0
  332. package/lib/businessModel/SalesModel/hooks/index.d.ts +1 -0
  333. package/lib/businessModel/SalesModel/hooks/index.js +34 -0
  334. package/lib/businessModel/SalesModel/index.d.ts +4 -0
  335. package/lib/businessModel/SalesModel/index.js +51 -0
  336. package/lib/businessModel/index.d.ts +0 -0
  337. package/lib/businessModel/index.js +0 -0
  338. package/lib/components/Sales/Cart/index.d.ts +53 -0
  339. package/lib/components/Sales/Cart/index.js +500 -0
  340. package/lib/components/Sales/Cart/serve.d.ts +2 -0
  341. package/lib/components/Sales/Cart/serve.js +37 -0
  342. package/lib/components/Sales/Cart/types.d.ts +19 -0
  343. package/lib/components/Sales/Cart/types.js +17 -0
  344. package/lib/components/Sales/Checkout/index.d.ts +33 -0
  345. package/lib/components/Sales/Checkout/index.js +130 -0
  346. package/lib/components/Sales/Checkout/serve.d.ts +2 -0
  347. package/lib/components/Sales/Checkout/serve.js +37 -0
  348. package/lib/components/Sales/Checkout/utils.d.ts +27 -0
  349. package/lib/components/Sales/Checkout/utils.js +88 -0
  350. package/lib/components/Sales/Customer/index.d.ts +24 -0
  351. package/lib/components/Sales/Customer/index.js +90 -0
  352. package/lib/components/Sales/Event/Detail.d.ts +27 -0
  353. package/lib/components/Sales/Event/Detail.js +224 -0
  354. package/lib/components/Sales/Event/index.d.ts +30 -0
  355. package/lib/components/Sales/Event/index.js +136 -0
  356. package/lib/components/Sales/Event/serve.d.ts +26 -0
  357. package/lib/components/Sales/Event/serve.js +54 -0
  358. package/lib/components/Sales/Holder/index.d.ts +33 -0
  359. package/lib/components/Sales/Holder/index.js +210 -0
  360. package/lib/components/Sales/Holder/serve.d.ts +8 -0
  361. package/lib/components/Sales/Holder/serve.js +37 -0
  362. package/lib/components/Sales/Init/index.d.ts +24 -0
  363. package/lib/components/Sales/Init/index.js +128 -0
  364. package/lib/components/Sales/Init/serve.d.ts +3 -0
  365. package/lib/components/Sales/Init/serve.js +34 -0
  366. package/lib/components/Sales/Resource/index.d.ts +26 -0
  367. package/lib/components/Sales/Resource/index.js +133 -0
  368. package/lib/components/Sales/Resource/serve.d.ts +5 -0
  369. package/lib/components/Sales/Resource/serve.js +32 -0
  370. package/lib/components/Sales/Step/index.d.ts +37 -0
  371. package/lib/components/Sales/Step/index.js +170 -0
  372. package/lib/components/Sales/Summary/index.d.ts +25 -0
  373. package/lib/components/Sales/Summary/index.js +83 -0
  374. package/lib/components/Sales/Summary/serve.d.ts +0 -0
  375. package/lib/components/Sales/Summary/serve.js +0 -0
  376. package/lib/components/Sales/Summary/utils.d.ts +36 -0
  377. package/lib/components/Sales/Summary/utils.js +80 -0
  378. package/lib/components/Sales/hooks/index.d.ts +1 -0
  379. package/lib/components/Sales/hooks/index.js +31 -0
  380. package/lib/components/Sales/index.d.ts +20 -0
  381. package/lib/components/Sales/index.js +79 -0
  382. package/lib/components/Sales/utils/index.d.ts +1 -0
  383. package/lib/components/Sales/utils/index.js +43 -0
  384. package/lib/components/booking/components/customSelect/index.d.ts +1 -0
  385. package/lib/components/booking/components/customSelect/index.js +6 -2
  386. package/lib/components/booking/components/footer/AppointmentProductModal/index.d.ts +3 -0
  387. package/lib/components/booking/components/footer/AppointmentProductModal/index.js +60 -0
  388. package/lib/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
  389. package/lib/components/booking/components/footer/amount.js +27 -8
  390. package/lib/components/booking/components/footer/index.js +48 -55
  391. package/lib/components/booking/components/footer/serve.d.ts +2 -0
  392. package/lib/components/booking/components/footer/serve.js +12 -0
  393. package/lib/components/booking/components/footer/utils.js +168 -37
  394. package/lib/components/booking/info/Provider.d.ts +0 -0
  395. package/lib/components/booking/info/Provider.js +0 -0
  396. package/lib/components/booking/info/addServiceVariant/index.js +5 -0
  397. package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +1 -0
  398. package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +8 -7
  399. package/lib/components/booking/info/clientVariant/vertical/index.js +96 -20
  400. package/lib/components/booking/info/dateRange/index.d.ts +4 -0
  401. package/lib/components/booking/info/dateRange/index.js +111 -0
  402. package/lib/components/booking/info/dateRange/index.less +21 -0
  403. package/lib/components/booking/info/main.js +33 -22
  404. package/lib/components/booking/info/model.js +3 -0
  405. package/lib/components/booking/info/pet/ChangePetModal/index.d.ts +4 -0
  406. package/lib/components/booking/info/pet/ChangePetModal/index.js +121 -0
  407. package/lib/components/booking/info/pet/ChangePetModal/index.less +4 -0
  408. package/lib/components/booking/info/pet/index.d.ts +1 -1
  409. package/lib/components/booking/info/pet/index.js +90 -44
  410. package/lib/components/booking/info/service/addService/index.d.ts +0 -1
  411. package/lib/components/booking/info/service/addService/index.js +131 -101
  412. package/lib/components/booking/info/service/addService/index.less +13 -3
  413. package/lib/components/booking/info/service/addService/utils.d.ts +12 -2
  414. package/lib/components/booking/info/service/addService/utils.js +57 -10
  415. package/lib/components/booking/info/service/addTimeModal/index.d.ts +0 -1
  416. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +4 -0
  417. package/lib/components/booking/info/service/editService/BookingList/index.js +55 -0
  418. package/lib/components/booking/info/service/editService/EditTabs/index.d.ts +3 -0
  419. package/lib/components/booking/info/service/editService/EditTabs/index.js +75 -0
  420. package/lib/components/booking/info/service/editService/index.js +446 -197
  421. package/lib/components/booking/info/service/editService/index.less +18 -13
  422. package/lib/components/booking/info/service/serve.d.ts +10 -0
  423. package/lib/components/booking/info/service/serve.js +7 -2
  424. package/lib/components/booking/info/service/serviceManager/distributeDiscount.d.ts +11 -0
  425. package/lib/components/booking/info/service/serviceManager/distributeDiscount.js +70 -0
  426. package/lib/components/booking/info/service/serviceManager/index.d.ts +20 -0
  427. package/lib/components/booking/info/service/serviceManager/index.js +211 -0
  428. package/lib/components/booking/info/service/serviceManager/utils.d.ts +0 -0
  429. package/lib/components/booking/info/service/serviceManager/utils.js +0 -0
  430. package/lib/components/booking/info/service2/Group/utils.d.ts +14 -0
  431. package/lib/components/booking/info/service2/Group/utils.js +142 -0
  432. package/lib/components/booking/info/service2/Lists.d.ts +3 -0
  433. package/lib/components/booking/info/service2/Lists.js +116 -0
  434. package/lib/components/booking/info/service2/hooks/useSelectPet.d.ts +6 -0
  435. package/lib/components/booking/info/service2/hooks/useSelectPet.js +49 -0
  436. package/lib/components/booking/info/service2/index.d.ts +6 -0
  437. package/lib/components/booking/info/service2/index.js +75 -0
  438. package/lib/components/booking/info/service2/status.d.ts +31 -0
  439. package/lib/components/booking/info/service2/status.js +81 -0
  440. package/lib/components/booking/info/service2/utils.d.ts +240 -0
  441. package/lib/components/booking/info/service2/utils.js +686 -0
  442. package/lib/components/booking/info/utils.d.ts +20 -0
  443. package/lib/components/booking/info/utils.js +42 -1
  444. package/lib/components/booking/locales.d.ts +66 -0
  445. package/lib/components/booking/locales.js +69 -3
  446. package/lib/components/booking/materiels/contacts/index.d.ts +1 -0
  447. package/lib/components/booking/materiels/holder/index.d.ts +7 -0
  448. package/lib/components/booking/materiels/holder/index.js +64 -0
  449. package/lib/components/booking/model.d.ts +5 -1
  450. package/lib/components/booking/model.js +4 -2
  451. package/lib/components/booking/utils.d.ts +12 -3
  452. package/lib/components/booking/utils.js +89 -18
  453. package/lib/components/eftpos/hooks.d.ts +4 -4
  454. package/lib/components/eftpos/index.d.ts +1 -0
  455. package/lib/components/eftposPay/component/fail/failCustom.d.ts +0 -1
  456. package/lib/components/eftposPay/component/fail/index.d.ts +0 -1
  457. package/lib/components/eftposPay/component/fail/unknow.d.ts +0 -1
  458. package/lib/components/eftposPay/component/step/index.d.ts +6 -6
  459. package/lib/components/eftposPay/component/step/step.d.ts +4 -4
  460. package/lib/components/eftposPay/hooks.d.ts +1 -1
  461. package/lib/components/eftposPay/pay.d.ts +0 -1
  462. package/lib/components/eftposPay/tyro/hooks.d.ts +2 -2
  463. package/lib/components/eftposPay/windcave/helper.d.ts +1 -1
  464. package/lib/components/eventBooking/assets/alert-circle.png +0 -0
  465. package/lib/components/eventBooking/assets/calendar-heart.svg +5 -0
  466. package/lib/components/eventBooking/assets/compass.svg +13 -0
  467. package/lib/components/eventBooking/assets/image.svg +5 -0
  468. package/lib/components/eventBooking/assets/phone.svg +5 -0
  469. package/lib/components/eventBooking/assets/shopping-cart.svg +10 -0
  470. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +3 -0
  471. package/lib/components/eventBooking/components/ErrorTip/index.js +30 -0
  472. package/lib/components/eventBooking/components/ErrorTip/index.less +51 -0
  473. package/lib/components/eventBooking/components/OpenCard/index.d.ts +4 -0
  474. package/lib/components/eventBooking/components/OpenCard/index.js +90 -0
  475. package/lib/components/eventBooking/components/OpenCard/index.less +52 -0
  476. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +3 -0
  477. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +158 -0
  478. package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.less +0 -0
  479. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +3 -0
  480. package/lib/components/eventBooking/components/Provider/Cart/Item/Total.js +82 -0
  481. package/lib/components/eventBooking/components/Provider/Cart/Item/index.d.ts +3 -0
  482. package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +92 -0
  483. package/lib/components/eventBooking/components/Provider/Cart/Item/index.less +87 -0
  484. package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +3 -0
  485. package/lib/components/eventBooking/components/Provider/Cart/index.js +59 -0
  486. package/lib/components/eventBooking/components/Provider/Cart/index.less +2 -0
  487. package/lib/components/eventBooking/components/Provider/Content/index.d.ts +4 -0
  488. package/lib/components/eventBooking/components/Provider/Content/index.js +90 -0
  489. package/lib/components/eventBooking/components/Provider/Content/index.less +31 -0
  490. package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +3 -0
  491. package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.js +60 -0
  492. package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.less +17 -0
  493. package/lib/components/eventBooking/components/Provider/Event/index.d.ts +3 -0
  494. package/lib/components/eventBooking/components/Provider/Event/index.js +100 -0
  495. package/lib/components/eventBooking/components/Provider/Event/index.less +20 -0
  496. package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +3 -0
  497. package/lib/components/eventBooking/components/Provider/Footer/index.js +87 -0
  498. package/lib/components/eventBooking/components/Provider/Footer/index.less +64 -0
  499. package/lib/components/eventBooking/components/Provider/Header/index.d.ts +4 -0
  500. package/lib/components/eventBooking/components/Provider/Header/index.js +80 -0
  501. package/lib/components/eventBooking/components/Provider/Header/index.less +2 -0
  502. package/lib/components/eventBooking/components/Provider/Information/index.d.ts +3 -0
  503. package/lib/components/eventBooking/components/Provider/Information/index.js +151 -0
  504. package/lib/components/eventBooking/components/Provider/Information/index.less +92 -0
  505. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +3 -0
  506. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.js +67 -0
  507. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.less +27 -0
  508. package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +3 -0
  509. package/lib/components/eventBooking/components/Provider/OrderProductModal/index.js +57 -0
  510. package/lib/components/eventBooking/components/Provider/OrderProductModal/index.less +32 -0
  511. package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +2 -0
  512. package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.js +62 -0
  513. package/lib/components/eventBooking/components/Provider/Resource/index.d.ts +3 -0
  514. package/lib/components/eventBooking/components/Provider/Resource/index.js +90 -0
  515. package/lib/components/eventBooking/components/Provider/Resource/index.less +46 -0
  516. package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +3 -0
  517. package/lib/components/eventBooking/components/Provider/SelectHolderModal.js +97 -0
  518. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +4 -0
  519. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.js +55 -0
  520. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.less +25 -0
  521. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +10 -0
  522. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.js +78 -0
  523. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.less +32 -0
  524. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +3 -0
  525. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.js +86 -0
  526. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.less +12 -0
  527. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +12 -0
  528. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.js +121 -0
  529. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.less +35 -0
  530. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +4 -0
  531. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.js +37 -0
  532. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.less +28 -0
  533. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +5 -0
  534. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.js +58 -0
  535. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.less +87 -0
  536. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +4 -0
  537. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.js +55 -0
  538. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.less +25 -0
  539. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/index.d.ts +4 -0
  540. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/index.js +196 -0
  541. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/index.less +119 -0
  542. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/state.d.ts +63 -0
  543. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/state.js +198 -0
  544. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/SelectDate/index.d.ts +4 -0
  545. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/SelectDate/index.js +122 -0
  546. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/SelectDate/index.less +4 -0
  547. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/index.d.ts +14 -0
  548. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/index.js +70 -0
  549. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/index.less +2 -0
  550. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/utils.d.ts +34 -0
  551. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/utils.js +70 -0
  552. package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +2 -0
  553. package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.js +75 -0
  554. package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +3 -0
  555. package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.js +66 -0
  556. package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +3 -0
  557. package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.js +69 -0
  558. package/lib/components/eventBooking/components/bookingDetailModal/index.d.ts +7 -0
  559. package/lib/components/eventBooking/components/bookingDetailModal/index.js +248 -0
  560. package/lib/components/eventBooking/components/bookingDetailModal/index.less +82 -0
  561. package/lib/components/eventBooking/components/bookingServiceList/index.d.ts +17 -0
  562. package/lib/components/eventBooking/components/bookingServiceList/index.js +79 -0
  563. package/lib/components/eventBooking/components/bookingServiceList/index.less +6 -0
  564. package/lib/components/eventBooking/components/eventCard/index.d.ts +14 -0
  565. package/lib/components/eventBooking/components/eventCard/index.js +124 -0
  566. package/lib/components/eventBooking/components/eventCard/index.less +81 -0
  567. package/lib/components/eventBooking/components/productCard/index.d.ts +16 -0
  568. package/lib/components/eventBooking/components/productCard/index.js +77 -0
  569. package/lib/components/eventBooking/components/productCard/index.less +60 -0
  570. package/lib/components/eventBooking/components/progressBar/index.d.ts +16 -0
  571. package/lib/components/eventBooking/components/progressBar/index.js +100 -0
  572. package/lib/components/eventBooking/components/progressBar/index.less +15 -0
  573. package/lib/components/eventBooking/components/resourceDisplay/index.d.ts +23 -0
  574. package/lib/components/eventBooking/components/resourceDisplay/index.js +116 -0
  575. package/lib/components/eventBooking/components/resourceDisplay/index.less +95 -0
  576. package/lib/components/eventBooking/components/resourceUsability/index.d.ts +12 -0
  577. package/lib/components/eventBooking/components/resourceUsability/index.js +76 -0
  578. package/lib/components/eventBooking/components/resourceUsability/index.less +40 -0
  579. package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +10 -0
  580. package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.js +73 -0
  581. package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.less +58 -0
  582. package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +11 -0
  583. package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.js +135 -0
  584. package/lib/components/eventBooking/components/scheduleCalendar/index.d.ts +13 -0
  585. package/lib/components/eventBooking/components/scheduleCalendar/index.js +125 -0
  586. package/lib/components/eventBooking/components/scheduleCalendar/index.less +222 -0
  587. package/lib/components/eventBooking/components/selectHolder/index.d.ts +22 -0
  588. package/lib/components/eventBooking/components/selectHolder/index.js +106 -0
  589. package/lib/components/eventBooking/components/selectHolder/index.less +70 -0
  590. package/lib/components/eventBooking/components/timeResourceSelector/index.d.ts +20 -0
  591. package/lib/components/eventBooking/components/timeResourceSelector/index.js +146 -0
  592. package/lib/components/eventBooking/components/timeResourceSelector/index.less +74 -0
  593. package/lib/components/eventBooking/index.d.ts +4 -0
  594. package/lib/components/eventBooking/index.js +78 -0
  595. package/lib/components/eventBooking/index.less +22 -0
  596. package/lib/components/eventBooking/locales.d.ts +216 -0
  597. package/lib/components/eventBooking/locales.js +239 -0
  598. package/lib/components/eventBooking/mock.d.ts +627 -0
  599. package/lib/components/eventBooking/mock.js +1352 -0
  600. package/lib/components/eventBooking/status.d.ts +21 -0
  601. package/lib/components/eventBooking/status.js +70 -0
  602. package/lib/components/eventBooking/type.d.ts +17 -0
  603. package/lib/components/eventBooking/type.js +17 -0
  604. package/lib/components/eventBooking/utils.d.ts +45 -0
  605. package/lib/components/eventBooking/utils.js +90 -0
  606. package/lib/components/login/index.d.ts +1 -0
  607. package/lib/components/productExtension/index.d.ts +1 -0
  608. package/lib/components/shoppingCart/Provider.d.ts +3 -0
  609. package/lib/components/shoppingCart/Provider.js +110 -0
  610. package/lib/components/shoppingCart/components/Cart/Product.d.ts +3 -0
  611. package/lib/components/shoppingCart/components/Cart/Product.js +72 -0
  612. package/lib/components/shoppingCart/components/Cart/index.d.ts +3 -0
  613. package/lib/components/shoppingCart/components/Cart/index.js +85 -0
  614. package/lib/components/shoppingCart/components/Cart/index.less +68 -0
  615. package/lib/components/shoppingCart/components/Empty/index.d.ts +4 -0
  616. package/lib/components/shoppingCart/components/Empty/index.js +43 -0
  617. package/lib/components/shoppingCart/components/Empty/index.less +19 -0
  618. package/lib/components/shoppingCart/components/Render/index.d.ts +4 -0
  619. package/lib/components/shoppingCart/components/Render/index.js +75 -0
  620. package/lib/components/shoppingCart/components/Render/index.less +2 -0
  621. package/lib/components/shoppingCart/components/SelectHolderModal/index.d.ts +4 -0
  622. package/lib/components/shoppingCart/components/SelectHolderModal/index.js +124 -0
  623. package/lib/components/shoppingCart/components/SelectHolderModal/index.less +32 -0
  624. package/lib/components/shoppingCart/hooks/useAddService.d.ts +2 -0
  625. package/lib/components/shoppingCart/hooks/useAddService.js +55 -0
  626. package/lib/components/shoppingCart/hooks/useClearCart.d.ts +2 -0
  627. package/lib/components/shoppingCart/hooks/useClearCart.js +66 -0
  628. package/lib/components/shoppingCart/hooks/useContext.d.ts +1 -0
  629. package/lib/components/shoppingCart/hooks/useContext.js +31 -0
  630. package/lib/components/shoppingCart/index.d.ts +4 -0
  631. package/lib/components/shoppingCart/index.js +60 -0
  632. package/lib/components/shoppingCart/locales.d.ts +33 -0
  633. package/lib/components/shoppingCart/locales.js +56 -0
  634. package/lib/components/shoppingCart/mock.d.ts +40 -0
  635. package/lib/components/shoppingCart/mock.js +76 -0
  636. package/lib/components/shoppingCart/status.d.ts +2 -0
  637. package/lib/components/shoppingCart/status.js +60 -0
  638. package/lib/components/shoppingCart/type.d.ts +40 -0
  639. package/lib/components/shoppingCart/type.js +17 -0
  640. package/lib/components/shoppingCart/utils.d.ts +63 -0
  641. package/lib/components/shoppingCart/utils.js +83 -0
  642. package/lib/components/tabProduct/tabs/index.less +13 -3
  643. package/lib/components/taxSelect/index.d.ts +1 -0
  644. package/lib/components/wallet/hooks/useWalletCard.d.ts +1 -0
  645. package/lib/components/workSpaceList/server.d.ts +3 -3
  646. package/lib/index.d.ts +13 -0
  647. package/lib/index.js +39 -0
  648. package/lowcode/event-booking/meta.ts +69 -0
  649. package/lowcode/event-booking-availability-calendar/meta.ts +53 -0
  650. package/lowcode/event-booking-detail-modal/meta.ts +39 -0
  651. package/lowcode/event-booking-service-list/meta.ts +77 -0
  652. package/lowcode/event-card/meta.ts +77 -0
  653. package/lowcode/event-product-card/meta.ts +79 -0
  654. package/lowcode/event-progress-bar/meta.ts +65 -0
  655. package/lowcode/event-resource-display/meta.ts +169 -0
  656. package/lowcode/event-resource-usability/meta.ts +67 -0
  657. package/lowcode/event-schedule-calendar/meta.ts +56 -0
  658. package/lowcode/event-select-holder/meta.ts +84 -0
  659. package/lowcode/event-time-resource-selector/meta.ts +69 -0
  660. package/lowcode/shopping-cart/meta.ts +98 -0
  661. package/package.json +3 -3
@@ -0,0 +1,1077 @@
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 _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
3
+ function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
4
+ function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
5
+ function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
6
+ 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; }
7
+ 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); } }
8
+ 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); }); }; }
9
+ function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
10
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
11
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
12
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
13
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
14
+ function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
15
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
16
+ 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; }
17
+ 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; }
18
+ 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; }
19
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
20
+ 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); }
21
+ import { getNoResource } from "../../mock";
22
+ import { getErrorList, getProductTotalPrice } from "../../utils";
23
+ import { locales } from "@pisell/utils";
24
+ import dayjs from 'dayjs';
25
+ import { appointmentTypes, openingTime } from "./status";
26
+ import { postMultiDay } from "../service/serve";
27
+ import localeTexts from "../../locales";
28
+ import { concatBookings, isGroupBooking, getProductByGroupId } from "./Group/utils";
29
+ locales.init(localeTexts, localStorage.getItem('umi_locale') || 'en');
30
+ export var formatActiveKey = function formatActiveKey(lists, platform, isEdit) {
31
+ if (!(lists !== null && lists !== void 0 && lists.length)) return [];
32
+
33
+ // 编辑时,必须有两个holder, 避免闪动问题
34
+ if (lists.length === 1 && isEdit) {
35
+ return [];
36
+ }
37
+ // 管理端默认打开最后一个holder
38
+ if (platform === 'shop') {
39
+ var _lists2;
40
+ return [(_lists2 = lists[lists.length - 1]) === null || _lists2 === void 0 ? void 0 : _lists2.key];
41
+ }
42
+
43
+ // 其他端默认打开所有
44
+ return lists === null || lists === void 0 ? void 0 : lists.map(function (cart) {
45
+ return cart === null || cart === void 0 ? void 0 : cart.key;
46
+ });
47
+ };
48
+
49
+ /**
50
+ * @title: 获取资源名称
51
+ * @description:
52
+ * @param {any} id
53
+ * @param {any} state
54
+ * @return {*}
55
+ * @Author: WangHan
56
+ * @Date: 2024-11-29 18:02
57
+ */
58
+ export var getResourceItem = function getResourceItem(id, state) {
59
+ var _state$service$resour;
60
+ if (id === 0) {
61
+ return getNoResource();
62
+ }
63
+ return (_state$service$resour = state.service.resources) === null || _state$service$resour === void 0 ? void 0 : _state$service$resour.find(function (d) {
64
+ return d.form_record_id === id;
65
+ });
66
+ };
67
+ var errorTypes = {
68
+ product: locales.getText('pisell2.text.status.service-error-1'),
69
+ time: locales.getText('pisell2.text.status.service-error-2'),
70
+ maxLimit: locales.getText('pisell2.text.status.service-error-3'),
71
+ limit: locales.getText('pisell2.text.status.service-error-3')
72
+ };
73
+
74
+ /**
75
+ * @title: 错误提示
76
+ * @description:
77
+ * @param {any} service
78
+ * @param {any} resourceItem
79
+ * @return {*}
80
+ * @Author: WangHan
81
+ * @Date: 2024-11-29 18:41
82
+ */
83
+ export var getErrorMessage = function getErrorMessage(service, resourceItem, isDay) {
84
+ var errorList = getErrorList(resourceItem, service, isDay);
85
+ var errorMessage = '';
86
+ if (!service.id) {
87
+ return errorList[0].label;
88
+ }
89
+ if (errorList.length) {
90
+ if (errorList.length > 1) {
91
+ errorMessage = "".concat(errorList.length, " ").concat(locales.getText('pisell2.text.warnings'));
92
+ } else {
93
+ errorMessage = (resourceItem === null || resourceItem === void 0 ? void 0 : resourceItem.labelText) + ' ' + errorTypes[errorList[0].type];
94
+ }
95
+ }
96
+ return errorMessage;
97
+ };
98
+
99
+ /**
100
+ * @title: 格式化主体列表
101
+ * @description:
102
+ * @param {any} lists
103
+ * @param {boolean} isOpenGroup
104
+ * @return {*}
105
+ * @Author: WangHan
106
+ * @Date: 2024-12-04 11:27
107
+ */
108
+ export var formatHolderLists = function formatHolderLists(lists) {
109
+ var isOpenGroup = true;
110
+ var _lists = lists === null || lists === void 0 ? void 0 : lists.map(function (item) {
111
+ return _objectSpread(_objectSpread({}, item), {}, {
112
+ id: (item === null || item === void 0 ? void 0 : item.id) || (item === null || item === void 0 ? void 0 : item.form_record_id),
113
+ key: (item === null || item === void 0 ? void 0 : item.id) || (item === null || item === void 0 ? void 0 : item.form_record_id),
114
+ label: locales.getText('pisell2.text.cart.of')(item === null || item === void 0 ? void 0 : item.main_field)
115
+ });
116
+ });
117
+
118
+ // 开启了分组并且是管理端,则增加open items分组
119
+ if (isOpenGroup) {
120
+ var defaults = [{
121
+ key: 0,
122
+ id: 0,
123
+ label: locales.getText('pisell2.text.open.items'),
124
+ main_field: locales.getText('pisell2.text.open.items')
125
+ }];
126
+ return defaults.concat(_lists);
127
+ }
128
+ return _lists;
129
+ };
130
+
131
+ /**
132
+ * @title: pets数据加 open items
133
+ * @description:
134
+ * @param {any} state
135
+ * @return {*}
136
+ * @Author: WangHan
137
+ * @Date: 2024-12-03 11:40
138
+ */
139
+ var getHolderLists = function getHolderLists(state) {
140
+ var _state$bookingConfig, _state$pet;
141
+ var form_id = (state === null || state === void 0 || (_state$bookingConfig = state.bookingConfig) === null || _state$bookingConfig === void 0 || (_state$bookingConfig = _state$bookingConfig.config) === null || _state$bookingConfig === void 0 || (_state$bookingConfig = _state$bookingConfig.basic) === null || _state$bookingConfig === void 0 || (_state$bookingConfig = _state$bookingConfig.appointment_subject) === null || _state$bookingConfig === void 0 ? void 0 : _state$bookingConfig.form_id) || 0;
142
+ var petLists = (state === null || state === void 0 || (_state$pet = state.pet) === null || _state$pet === void 0 || (_state$pet = _state$pet.value) === null || _state$pet === void 0 ? void 0 : _state$pet[form_id]) || [];
143
+ var _lists = formatHolderLists(petLists);
144
+ return _lists;
145
+ };
146
+
147
+ /**
148
+ * @title: 获取pet名称
149
+ * @description:
150
+ * @param {any} state
151
+ * @param {number} id
152
+ * @return {*}
153
+ * @Author: WangHan
154
+ * @Date: 2024-12-03 11:42
155
+ */
156
+ var getHolderName = function getHolderName(state, id) {
157
+ var holderLists = getHolderLists(state);
158
+ if (!holderLists.length || !id) return '';
159
+ var resource = holderLists.find(function (d) {
160
+ return (d === null || d === void 0 ? void 0 : d.id) === id;
161
+ });
162
+ return resource === null || resource === void 0 ? void 0 : resource.main_field;
163
+ };
164
+ export var isBookingProduct = function isBookingProduct(extension_type, bol) {
165
+ return appointmentTypes.includes(extension_type) || bol;
166
+ };
167
+
168
+ /**
169
+ * @title: 是否是预约商品
170
+ * @description:
171
+ * @return {*}
172
+ * @Author: WangHan
173
+ * @Date: 2024-12-06 11:24
174
+ */
175
+ export var isDayBookingProduct = function isDayBookingProduct(item, state) {
176
+ return isBookingProduct(item === null || item === void 0 ? void 0 : item.extension_type) && state.renderType === 'dayBooking';
177
+ };
178
+
179
+ /**
180
+ * @title: 更新商品数据
181
+ * @description:
182
+ * @param {any} state
183
+ * @param {string} type
184
+ * @param {any} _id // 商品id
185
+ * @param {any} other
186
+ * @return {*}
187
+ * @Author: WangHan
188
+ * @Date: 2025-01-03 15:00
189
+ */
190
+ export var updateServices = function updateServices(state, currentItem, type, other) {
191
+ var _state$service;
192
+ var products = (state === null || state === void 0 || (_state$service = state.service) === null || _state$service === void 0 ? void 0 : _state$service.value) || [];
193
+ // currentItem 可能是单个 也可能是数组
194
+ var isGroup = isGroupBooking(currentItem._id);
195
+ // 删除
196
+ if (type === 'delete') {
197
+ var _products;
198
+ var deleteIds = [];
199
+ if (isGroup) {
200
+ // 删除分组
201
+ deleteIds = getProductByGroupId(currentItem._id, products);
202
+ } else {
203
+ // 删除单个
204
+ deleteIds = [currentItem._id];
205
+ }
206
+ products = (_products = products) === null || _products === void 0 ? void 0 : _products.filter(function (item) {
207
+ return !deleteIds.includes(item === null || item === void 0 ? void 0 : item._id);
208
+ });
209
+ }
210
+
211
+ // 删除购物车
212
+ if (type === 'delete_holders') {
213
+ var _products2;
214
+ products = (_products2 = products) === null || _products2 === void 0 ? void 0 : _products2.filter(function (item) {
215
+ var _item$_extend;
216
+ return (item === null || item === void 0 || (_item$_extend = item._extend) === null || _item$_extend === void 0 ? void 0 : _item$_extend.holder_id) !== other;
217
+ });
218
+ }
219
+
220
+ // 更新商品的holder_id
221
+ if (type === 'update_holders') {
222
+ var _products3;
223
+ products = (_products3 = products) === null || _products3 === void 0 ? void 0 : _products3.map(function (item) {
224
+ var ids = currentItem.map(function (d) {
225
+ return d._id;
226
+ });
227
+ if (ids !== null && ids !== void 0 && ids.includes(item === null || item === void 0 ? void 0 : item._id)) {
228
+ var _extend = item._extend || {};
229
+ // 数组的话则是批量更新
230
+ if (Array.isArray(other)) {
231
+ var _other$find;
232
+ _extend.holder_id = (_other$find = other.find(function (other) {
233
+ return (other === null || other === void 0 ? void 0 : other._id) === (item === null || item === void 0 ? void 0 : item._id);
234
+ })) === null || _other$find === void 0 ? void 0 : _other$find.holder_id;
235
+ } else {
236
+ _extend.holder_id = other;
237
+ }
238
+ return item;
239
+ }
240
+ return item;
241
+ });
242
+ } else {
243
+ var _products4;
244
+ // 更新数据
245
+ products = (_products4 = products) === null || _products4 === void 0 ? void 0 : _products4.map(function (item) {
246
+ var updateIds = [];
247
+ if (isGroup) {
248
+ // 更新分组
249
+ updateIds = getProductByGroupId(currentItem._id, products);
250
+ } else {
251
+ // 更新单个
252
+ updateIds = [currentItem._id];
253
+ }
254
+ if (updateIds.includes(item._id)) {
255
+ if (type === 'like') {
256
+ var _extend = item._extend || {};
257
+ _extend.like_status = other === null || other === void 0 ? void 0 : other.like_status;
258
+ } else {
259
+ item = _objectSpread(_objectSpread({}, item), other);
260
+ }
261
+ return item;
262
+ }
263
+ return item;
264
+ });
265
+ }
266
+ return products;
267
+ };
268
+
269
+ /**
270
+ * @title: 格式化套餐
271
+ * @description:
272
+ * @param {any} bundle
273
+ * @return {*}
274
+ * @Author: WangHan
275
+ * @Date: 2025-01-03 00:03
276
+ */
277
+ var formatBundle = function formatBundle(bundle) {
278
+ if (!(bundle !== null && bundle !== void 0 && bundle.length)) return [];
279
+ return bundle.map(function (item) {
280
+ return {
281
+ id: item === null || item === void 0 ? void 0 : item.id,
282
+ title: item === null || item === void 0 ? void 0 : item.title,
283
+ num: item === null || item === void 0 ? void 0 : item.num,
284
+ price: item === null || item === void 0 ? void 0 : item.price,
285
+ total: item === null || item === void 0 ? void 0 : item.price,
286
+ price_type: item === null || item === void 0 ? void 0 : item.price_type,
287
+ bundle_sum_price: item === null || item === void 0 ? void 0 : item.bundle_sum_price,
288
+ bundle_sum_type: item === null || item === void 0 ? void 0 : item.bundle_sum_type,
289
+ options: formatOptions(item === null || item === void 0 ? void 0 : item.option)
290
+ };
291
+ });
292
+ };
293
+
294
+ /**
295
+ * @title: 格式化单规格
296
+ * @description:
297
+ * @param {any} options
298
+ * @return {*}
299
+ * @Author: WangHan
300
+ * @Date: 2025-01-02 23:58
301
+ */
302
+ var formatOptions = function formatOptions(options) {
303
+ if (!(options !== null && options !== void 0 && options.length)) return [];
304
+ return options.map(function (item) {
305
+ return {
306
+ id: item === null || item === void 0 ? void 0 : item.id,
307
+ name: item === null || item === void 0 ? void 0 : item.name,
308
+ num: item === null || item === void 0 ? void 0 : item.num,
309
+ price: item === null || item === void 0 ? void 0 : item.price,
310
+ total: item === null || item === void 0 ? void 0 : item.price,
311
+ origin_total: item === null || item === void 0 ? void 0 : item.original_price
312
+ };
313
+ });
314
+ };
315
+ export var formItems = function formItems(items) {
316
+ return items.map(function (d) {
317
+ return _objectSpread(_objectSpread({}, d), {}, {
318
+ start_date: d._extend.start_date,
319
+ end_date: d._extend.end_date,
320
+ num: d === null || d === void 0 ? void 0 : d._extend.quantity,
321
+ total: d._extend.total,
322
+ origin_total: d._extend.origin_total
323
+ });
324
+ });
325
+ };
326
+
327
+ /**
328
+ * @title: 格式化商品数据
329
+ * @description:
330
+ * @param {any} lists
331
+ * @return {*}
332
+ * @Author: WangHan
333
+ * @Date: 2024-11-29 17:36
334
+ */
335
+ export var formatProducts = function formatProducts(lists, state) {
336
+ var isRenderGroup = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
337
+ if (!(lists !== null && lists !== void 0 && lists.length)) return [];
338
+ var normalList = [];
339
+ var groupList = [];
340
+ var formItem = function formItem(item) {
341
+ var _item$_extend2, _item$_extend3, _item$_extend4, _item$_extend6, _item$_extend7, _item$_extend8, _item$_extend9, _item$_extend10, _item$_extend11, _item$_extend12, _resourceItem, _item$_extend13, _item$_extend14, _item$_extend15, _item$_extend16;
342
+ var _isDayBookingProduct = isDayBookingProduct(item, state);
343
+ var clientTitle = getHolderName(state, item === null || item === void 0 || (_item$_extend2 = item._extend) === null || _item$_extend2 === void 0 ? void 0 : _item$_extend2.holder_id);
344
+ var options = formatOptions(item === null || item === void 0 || (_item$_extend3 = item._extend) === null || _item$_extend3 === void 0 || (_item$_extend3 = _item$_extend3.other) === null || _item$_extend3 === void 0 ? void 0 : _item$_extend3.option);
345
+ var bundle = formatBundle(item === null || item === void 0 || (_item$_extend4 = item._extend) === null || _item$_extend4 === void 0 || (_item$_extend4 = _item$_extend4.other) === null || _item$_extend4 === void 0 ? void 0 : _item$_extend4.bundle);
346
+ // 是否是普通商品
347
+ var isNormalProduct = !appointmentTypes.includes(item === null || item === void 0 ? void 0 : item.extension_type) || (state === null || state === void 0 ? void 0 : state.renderType) === 'eventBooking';
348
+ var resourceItem = {};
349
+ var errorMessage = '';
350
+ if (_isDayBookingProduct) {
351
+ var _item$_extend5;
352
+ resourceItem = getResourceItem(item === null || item === void 0 || (_item$_extend5 = item._extend) === null || _item$_extend5 === void 0 ? void 0 : _item$_extend5.resource, state);
353
+ errorMessage = getErrorMessage(item, resourceItem, isDayBooking(state));
354
+ }
355
+ return {
356
+ id: item === null || item === void 0 ? void 0 : item.id,
357
+ _id: item === null || item === void 0 ? void 0 : item._id,
358
+ name: item === null || item === void 0 ? void 0 : item.title,
359
+ price: item === null || item === void 0 || (_item$_extend6 = item._extend) === null || _item$_extend6 === void 0 ? void 0 : _item$_extend6.price,
360
+ total: item === null || item === void 0 || (_item$_extend7 = item._extend) === null || _item$_extend7 === void 0 ? void 0 : _item$_extend7.total,
361
+ origin_total: item === null || item === void 0 || (_item$_extend8 = item._extend) === null || _item$_extend8 === void 0 ? void 0 : _item$_extend8.origin_total,
362
+ num: item === null || item === void 0 ? void 0 : item._extend.quantity,
363
+ image: item === null || item === void 0 ? void 0 : item.cover,
364
+ isShowNote: true,
365
+ note: item === null || item === void 0 ? void 0 : item.note,
366
+ like_status: item === null || item === void 0 || (_item$_extend9 = item._extend) === null || _item$_extend9 === void 0 ? void 0 : _item$_extend9.like_status,
367
+ bundle: bundle,
368
+ options: options,
369
+ errorMessage: errorMessage,
370
+ product_option_string: item === null || item === void 0 || (_item$_extend10 = item._extend) === null || _item$_extend10 === void 0 || (_item$_extend10 = _item$_extend10.other) === null || _item$_extend10 === void 0 ? void 0 : _item$_extend10.product_option_string,
371
+ discount_reason: item === null || item === void 0 || (_item$_extend11 = item._extend) === null || _item$_extend11 === void 0 ? void 0 : _item$_extend11.discount_reason,
372
+ resource_id: isNormalProduct ? 0 : item === null || item === void 0 || (_item$_extend12 = item._extend) === null || _item$_extend12 === void 0 ? void 0 : _item$_extend12.resource,
373
+ relation_form_name: isNormalProduct ? '' : ((_resourceItem = resourceItem) === null || _resourceItem === void 0 ? void 0 : _resourceItem.labelText) || item.relation_form_name,
374
+ holder_title: clientTitle,
375
+ start_date: !isNormalProduct ? item === null || item === void 0 || (_item$_extend13 = item._extend) === null || _item$_extend13 === void 0 ? void 0 : _item$_extend13.start_date : '',
376
+ end_date: !isNormalProduct ? item === null || item === void 0 || (_item$_extend14 = item._extend) === null || _item$_extend14 === void 0 ? void 0 : _item$_extend14.end_date : '',
377
+ holder_id: (item === null || item === void 0 || (_item$_extend15 = item._extend) === null || _item$_extend15 === void 0 ? void 0 : _item$_extend15.holder_id) || 0,
378
+ isNormalProduct: isNormalProduct,
379
+ locale: state.locale,
380
+ symbol: state.amountSymbol,
381
+ items: isEventBooking(state) ? [] : formItems((item === null || item === void 0 || (_item$_extend16 = item._extend) === null || _item$_extend16 === void 0 ? void 0 : _item$_extend16.items) || []),
382
+ _origin: item
383
+ };
384
+ };
385
+
386
+ // 将商品分为组商品和非组商品
387
+ lists.forEach(function (item) {
388
+ var _item$_extend17;
389
+ if (!(item !== null && item !== void 0 && (_item$_extend17 = item._extend) !== null && _item$_extend17 !== void 0 && _item$_extend17.groupId)) {
390
+ normalList.push(formItem(item));
391
+ } else {
392
+ groupList.push(item);
393
+ }
394
+ });
395
+
396
+ // 根据item._extend.groupId 进行分组
397
+ var groups = groupList.reduce(function (prev, item) {
398
+ var _item$_extend18;
399
+ var groupId = item === null || item === void 0 || (_item$_extend18 = item._extend) === null || _item$_extend18 === void 0 ? void 0 : _item$_extend18.groupId;
400
+ if (!prev[groupId]) {
401
+ prev[groupId] = [];
402
+ }
403
+ prev[groupId].push(item);
404
+ return prev;
405
+ }, {});
406
+ if (isRenderGroup) {
407
+ return Object.values(groups).map(function (d) {
408
+ return formItem(concatBookings(d));
409
+ }).concat(normalList);
410
+ } else {
411
+ return lists === null || lists === void 0 ? void 0 : lists.map(function (item) {
412
+ return formItem(item);
413
+ });
414
+ }
415
+ };
416
+
417
+ /**
418
+ * @title: 禁用日期
419
+ * @description:
420
+ * @param {any} current
421
+ * @param {string} position
422
+ * @param {any} startDate
423
+ * @return {*}
424
+ * @Author: WangHan
425
+ * @Date: 2024-12-03 17:51
426
+ */
427
+ export var disabledDate = function disabledDate(current, position, currentDate) {
428
+ if (!dayjs(currentDate).isValid()) return;
429
+ if (position === 'start') {
430
+ return false;
431
+ }
432
+ if (position === 'end' && current.endOf('day') && currentDate) {
433
+ // 结束日期最大 = 开始日期 + 8个月
434
+ var endDisabled = currentDate.add(8, 'months').format('YYYY-MM-DD');
435
+ return dayjs(endDisabled) < current.startOf('day') || current.startOf('day') <= currentDate;
436
+ }
437
+ return current && current <= currentDate;
438
+ };
439
+
440
+ /**
441
+ * @title: 是否是跨日预约
442
+ * @description:
443
+ * @param {any} state
444
+ * @return {*}
445
+ * @Author: WangHan
446
+ * @Date: 2024-12-04 09:49
447
+ */
448
+ export var isDayBooking = function isDayBooking(state) {
449
+ return (state === null || state === void 0 ? void 0 : state.renderType) === 'dayBooking' || (state === null || state === void 0 ? void 0 : state.renderType) === 'eventBooking';
450
+ };
451
+ export var isDaysBooking = function isDaysBooking(state) {
452
+ return (state === null || state === void 0 ? void 0 : state.renderType) === 'dayBooking';
453
+ };
454
+ export var isEventBooking = function isEventBooking(state) {
455
+ return state.renderType === 'eventBooking';
456
+ };
457
+ export var isAppointmentProduct = function isAppointmentProduct(item) {
458
+ return appointmentTypes.includes(item.extension_type);
459
+ };
460
+ /**
461
+ * @title: 是否是terminal上的跨日预约
462
+ * @description:
463
+ * @param {any} state
464
+ * @return {*}
465
+ * @Author: WangHan
466
+ * @Date: 2024-12-04 15:31
467
+ */
468
+ export var isTerminalDayBooking = function isTerminalDayBooking(state) {
469
+ return state.isTerminalDayBookingPage;
470
+ };
471
+ export var formatDayDate = function formatDayDate(_extend) {
472
+ // 默认选择的日期
473
+ var startDate = dayjs(_extend === null || _extend === void 0 ? void 0 : _extend.start_date).startOf('day');
474
+ var endDate = dayjs(_extend === null || _extend === void 0 ? void 0 : _extend.end_date).startOf('day');
475
+ return _objectSpread(_objectSpread({}, _extend), {}, {
476
+ start_date: startDate,
477
+ end_date: endDate
478
+ });
479
+ };
480
+
481
+ /**
482
+ * @title: 根据营业日时间格式化时间
483
+ * @description:
484
+ * @param {any} state
485
+ * @return {*}
486
+ * @Author: WangHan
487
+ * @Date: 2024-12-04 12:07
488
+ */
489
+ export var formatDayTime = function formatDayTime(_ref) {
490
+ var startDate = _ref.startDate,
491
+ endDate = _ref.endDate;
492
+ // 营业日时间
493
+ var shopOpeningTime = localStorage.getItem('shopOpeningHours') || '00:00';
494
+
495
+ // 默认选择的日期
496
+ var start_date = dayjs(startDate).format('YYYY-MM-DD');
497
+ var end_date = dayjs(endDate).format('YYYY-MM-DD');
498
+
499
+ // 更新后的日期
500
+ var result = {
501
+ startDateTime: dayjs("".concat(start_date, "T").concat(shopOpeningTime, ":00")),
502
+ // 结束日期根据营业日时间减去一分钟
503
+ endDateTime: dayjs("".concat(end_date, "T").concat(shopOpeningTime, ":00")).subtract(1, 'minute')
504
+ };
505
+ return result;
506
+ };
507
+ export var formatDateTime = function formatDateTime(start_date, end_date) {
508
+ var _openingTime = openingTime();
509
+
510
+ // 开始时间 + 营业日时间
511
+ var startDate = "".concat(start_date, " ").concat(_openingTime);
512
+ var endDate = "".concat(end_date, " ").concat(_openingTime);
513
+ var date = {
514
+ value: dayjs(startDate),
515
+ end_date: dayjs(endDate).subtract(1, 'minute')
516
+ };
517
+ return date;
518
+ };
519
+
520
+ /**
521
+ * @title: 初始化日期
522
+ * @description:
523
+ * @return {*}
524
+ * @Author: WangHan
525
+ * @Date: 2024-12-06 17:24
526
+ */
527
+ export var initDate = function initDate() {
528
+ var startDate = dayjs().format('YYYY-MM-DD');
529
+ var endDate = dayjs().add(1, 'days').format('YYYY-MM-DD');
530
+ var date = formatDateTime(startDate, endDate);
531
+ return date;
532
+ };
533
+
534
+ /**
535
+ * @title: 是否有预约商品
536
+ * @description:
537
+ * @return {*}
538
+ * @Author: WangHan
539
+ * @Date: 2024-12-12 15:47
540
+ */
541
+ export var isHasDayAppointmentProduct = function isHasDayAppointmentProduct(state) {
542
+ var _state$bookingConfig2, _state$service2, _state$pet2;
543
+ var form_id = (state === null || state === void 0 || (_state$bookingConfig2 = state.bookingConfig) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.config) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.basic) === null || _state$bookingConfig2 === void 0 || (_state$bookingConfig2 = _state$bookingConfig2.appointment_subject) === null || _state$bookingConfig2 === void 0 ? void 0 : _state$bookingConfig2.form_id) || 0;
544
+ var services = ((_state$service2 = state.service) === null || _state$service2 === void 0 ? void 0 : _state$service2.value) || [];
545
+ var pets = ((_state$pet2 = state.pet) === null || _state$pet2 === void 0 || (_state$pet2 = _state$pet2.value) === null || _state$pet2 === void 0 ? void 0 : _state$pet2[form_id]) || [];
546
+
547
+ // 没选择表单,则直接提示
548
+ if (!pets.length) return true;
549
+ var checkType = function checkType(extension_type) {
550
+ if (isEventBooking(state)) {
551
+ return true;
552
+ }
553
+ return appointmentTypes.includes(extension_type);
554
+ };
555
+
556
+ // 没有任何一个预约商品则提示
557
+ var appointmentServices = services.filter(function (d) {
558
+ return checkType(d.extension_type);
559
+ });
560
+ if (!appointmentServices.length) return true;
561
+ var _pets = pets === null || pets === void 0 ? void 0 : pets.map(function (d) {
562
+ // const holderProducts = services.filter((d: any) => d._extend?.holder_id == d.form_record_id)
563
+
564
+ return _objectSpread(_objectSpread({}, d), {}, {
565
+ // 如果该购物车中没选择任何商品,则不需要验证,所以直接用1来填充
566
+ // services: !holderProducts?.length ? [1] : holderProducts?.filter((d: any) => appointmentTypes.includes(d.extension_type))
567
+ services: services.filter(function (item) {
568
+ var _item$_extend19;
569
+ return ((_item$_extend19 = item._extend) === null || _item$_extend19 === void 0 ? void 0 : _item$_extend19.holder_id) == d.form_record_id && checkType(item.extension_type);
570
+ })
571
+ });
572
+ });
573
+ _pets = _pets.filter(function (d) {
574
+ return !d.services.length;
575
+ });
576
+ return _pets.length > 0;
577
+ };
578
+
579
+ /**
580
+ * @title: 过滤出如果是预约商品,则只获取跨日的预约商品
581
+ * @description:
582
+ * @param {any} lists
583
+ * @return {*}
584
+ * @Author: WangHan
585
+ * @Date: 2024-12-13 16:44
586
+ */
587
+ export var getDayProducts = function getDayProducts(holderId, lists, isTerminal) {
588
+ var _lists = lists || [];
589
+
590
+ // 普通商品列表, terminal进入页面直接获取了商品列表数据,所以选择了表单之后不会再次触发该方法
591
+ if (!holderId && !isTerminal) {
592
+ _lists = _lists.filter(function (item) {
593
+ return !appointmentTypes.includes(item === null || item === void 0 ? void 0 : item.extension_type);
594
+ });
595
+ } else {
596
+ // 普通商品 + 跨日预约商品列表
597
+ _lists = _lists.filter(function (item) {
598
+ var _item$duration;
599
+ return !appointmentTypes.includes(item === null || item === void 0 ? void 0 : item.extension_type) || appointmentTypes.includes(item === null || item === void 0 ? void 0 : item.extension_type) && ((_item$duration = item.duration) === null || _item$duration === void 0 ? void 0 : _item$duration.type) === 'days';
600
+ });
601
+ }
602
+ return _lists;
603
+ };
604
+
605
+ /**
606
+ * @title: 格式化表单数据
607
+ * @description:
608
+ * @param {any} state
609
+ * @return {*}
610
+ * @Author: WangHan
611
+ * @Date: 2024-12-30 22:19
612
+ */
613
+ export var getPets = function getPets(state) {
614
+ var _state$bookingConfig3, _state$pet3;
615
+ var form_id = (state === null || state === void 0 || (_state$bookingConfig3 = state.bookingConfig) === null || _state$bookingConfig3 === void 0 || (_state$bookingConfig3 = _state$bookingConfig3.config) === null || _state$bookingConfig3 === void 0 || (_state$bookingConfig3 = _state$bookingConfig3.basic) === null || _state$bookingConfig3 === void 0 || (_state$bookingConfig3 = _state$bookingConfig3.appointment_subject) === null || _state$bookingConfig3 === void 0 ? void 0 : _state$bookingConfig3.form_id) || 0;
616
+ var pets = (state === null || state === void 0 || (_state$pet3 = state.pet) === null || _state$pet3 === void 0 || (_state$pet3 = _state$pet3.value) === null || _state$pet3 === void 0 ? void 0 : _state$pet3[form_id]) || [];
617
+ return pets;
618
+ };
619
+
620
+ /**
621
+ * @title: 得出预约商品
622
+ * @description:
623
+ * @param {any} state
624
+ * @return {*}
625
+ * @Author: WangHan
626
+ * @Date: 2024-12-30 22:26
627
+ */
628
+ export var getAppointmentService = function getAppointmentService(state) {
629
+ var _state$service3;
630
+ var services = ((_state$service3 = state.service) === null || _state$service3 === void 0 ? void 0 : _state$service3.value) || [];
631
+ var lists = services.filter(function (item) {
632
+ return appointmentTypes.includes(item.extension_type);
633
+ });
634
+ return lists;
635
+ };
636
+
637
+ /**
638
+ * @title: 判断是否打开删除宠物弹窗
639
+ * @description:
640
+ * @param {any} state
641
+ * @param {any} newVal
642
+ * @return {*}
643
+ * @Author: WangHan
644
+ * @Date: 2024-12-16 16:12
645
+ */
646
+ export var isOpenDeletePet = function isOpenDeletePet(state, newVal) {
647
+ var _state$bookingConfig4, _state$pet4;
648
+ var form_id = (state === null || state === void 0 || (_state$bookingConfig4 = state.bookingConfig) === null || _state$bookingConfig4 === void 0 || (_state$bookingConfig4 = _state$bookingConfig4.config) === null || _state$bookingConfig4 === void 0 || (_state$bookingConfig4 = _state$bookingConfig4.basic) === null || _state$bookingConfig4 === void 0 || (_state$bookingConfig4 = _state$bookingConfig4.appointment_subject) === null || _state$bookingConfig4 === void 0 ? void 0 : _state$bookingConfig4.form_id) || 0;
649
+ var oldPets = (state === null || state === void 0 || (_state$pet4 = state.pet) === null || _state$pet4 === void 0 || (_state$pet4 = _state$pet4.value) === null || _state$pet4 === void 0 ? void 0 : _state$pet4[form_id]) || [];
650
+ var newPets = (newVal === null || newVal === void 0 ? void 0 : newVal[form_id]) || [];
651
+
652
+ // 被删除的表单
653
+ var deletePets = oldPets.filter(function (item) {
654
+ return !newPets.some(function (newItem) {
655
+ return newItem.form_record_id === item.form_record_id;
656
+ });
657
+ });
658
+
659
+ // 被删除的表单中是否有预约商品
660
+ var servicePets = deletePets.map(function (item) {
661
+ var _state$service4;
662
+ return _objectSpread(_objectSpread({}, item), {}, {
663
+ services: (_state$service4 = state.service) === null || _state$service4 === void 0 || (_state$service4 = _state$service4.value) === null || _state$service4 === void 0 ? void 0 : _state$service4.filter(function (d) {
664
+ var _d$_extend;
665
+ return ((_d$_extend = d._extend) === null || _d$_extend === void 0 ? void 0 : _d$_extend.holder_id) == item.form_record_id;
666
+ })
667
+ });
668
+ });
669
+
670
+ // 查找被删除的表单中是否有对应的商品数据
671
+ var lists = servicePets.filter(function (item) {
672
+ var _item$services;
673
+ return ((_item$services = item.services) === null || _item$services === void 0 ? void 0 : _item$services.length) > 0;
674
+ });
675
+ return {
676
+ ids: lists.map(function (item) {
677
+ return item.form_record_id;
678
+ }),
679
+ lists: lists
680
+ };
681
+ };
682
+
683
+ /**
684
+ * @title: 当前选中的表单id
685
+ * @description:
686
+ * @param {any} state
687
+ * @return {*}
688
+ * @Author: WangHan
689
+ * @Date: 2024-12-17 14:40
690
+ */
691
+ export var holderId = function holderId(state) {
692
+ var _state$activeCartId;
693
+ return Number((state === null || state === void 0 || (_state$activeCartId = state.activeCartId) === null || _state$activeCartId === void 0 ? void 0 : _state$activeCartId[0]) || 0);
694
+ };
695
+
696
+ /**
697
+ * @title: 计算总价
698
+ * @description:
699
+ * @param {any} data
700
+ * @return {*}
701
+ * @Author: WangHan
702
+ * @Date: 2024-12-31 15:18
703
+ */
704
+ function calculateTotalPrice(data) {
705
+ var _price = data === null || data === void 0 ? void 0 : data.reduce(function (total, item) {
706
+ return total + ((item === null || item === void 0 ? void 0 : item.price) || (item === null || item === void 0 ? void 0 : item.add_price)) * item.num;
707
+ }, 0);
708
+ return parseFloat(_price);
709
+ }
710
+
711
+ /**
712
+ * @title: 更新单规格价格
713
+ * @description:
714
+ * @param {any} currentValue
715
+ * @param {any} single
716
+ * @return {*}
717
+ * @Author: WangHan
718
+ * @Date: 2024-12-31 15:18
719
+ */
720
+ function updateSinglePrice(currentValue, single) {
721
+ var _single = [];
722
+ var _loop = function _loop() {
723
+ var item = currentValue[index];
724
+ var currentIndex = single.findIndex(function (_single) {
725
+ return _single.id === item.id;
726
+ });
727
+ if (currentIndex !== -1) {
728
+ item.add_price = single[currentIndex].add_price;
729
+ item.name = single[currentIndex].name;
730
+ _single.push(item);
731
+ }
732
+ };
733
+ for (var index = 0; index < currentValue.length; index++) {
734
+ _loop();
735
+ }
736
+ return _single;
737
+ }
738
+
739
+ /**
740
+ * @title: 更新套餐价格
741
+ * @description:
742
+ * @param {any} currentValue
743
+ * @param {any} param2
744
+ * @return {*}
745
+ * @Author: WangHan
746
+ * @Date: 2024-12-31 15:17
747
+ */
748
+ function updateBundlePrice(currentValue, _ref2) {
749
+ var _ref3 = _slicedToArray(_ref2, 2),
750
+ bundle = _ref3[0],
751
+ single = _ref3[1];
752
+ var _bundle = [];
753
+ var _loop2 = function _loop2() {
754
+ var item = currentValue[index];
755
+ var currentIndex = bundle.findIndex(function (_bundle) {
756
+ return _bundle.id === item.id;
757
+ });
758
+ if (currentIndex !== -1 && bundle[currentIndex]) {
759
+ var _item$option;
760
+ // currentValue.splice(index, 1);
761
+ item.title = bundle[currentIndex].title;
762
+ item.price_type = bundle[currentIndex].price_type;
763
+ item._price = bundle[currentIndex].price;
764
+ var bundle_sum_price = parseFloat(bundle[currentIndex].price_type === 'markdown' ? bundle[currentIndex].price * -1 : bundle[currentIndex].price).toFixed(2);
765
+ item.price = bundle_sum_price;
766
+ item.bundle_sum_price = bundle_sum_price;
767
+ // 如果有单规格
768
+ if (item !== null && item !== void 0 && (_item$option = item.option) !== null && _item$option !== void 0 && _item$option.length) {
769
+ var _option = JSON.parse(JSON.stringify(item.option));
770
+ item.option = updateSinglePrice(_option, single);
771
+ var optionPrice = 0;
772
+ optionPrice = calculateTotalPrice(item.option);
773
+ var _bundle_sum_price = (parseFloat(bundle[currentIndex].price_type === 'markdown' ? bundle[currentIndex].price * -1 : bundle[currentIndex].price) + optionPrice).toFixed(2);
774
+ item.price = _bundle_sum_price;
775
+ item.bundle_sum_price = _bundle_sum_price;
776
+ }
777
+ _bundle.push(item);
778
+ }
779
+ };
780
+ for (var index = 0; index < currentValue.length; index++) {
781
+ _loop2();
782
+ }
783
+ return _bundle;
784
+ }
785
+
786
+ /**
787
+ * @title: 平铺套餐数据
788
+ * @description:
789
+ * @param {any} newPackageData
790
+ * @return {*}
791
+ * @Author: WangHan
792
+ * @Date: 2024-12-31 15:17
793
+ */
794
+ function flatData(newPackageData) {
795
+ var bundle = [];
796
+ var single = [];
797
+ // 获取所有的套餐
798
+ var _iterator = _createForOfIteratorHelper(newPackageData),
799
+ _step;
800
+ try {
801
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
802
+ var _group$bundle_item;
803
+ var _group = _step.value;
804
+ if (_group !== null && _group !== void 0 && (_group$bundle_item = _group.bundle_item) !== null && _group$bundle_item !== void 0 && _group$bundle_item.length) {
805
+ var _iterator4 = _createForOfIteratorHelper(_group.bundle_item),
806
+ _step4;
807
+ try {
808
+ for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {
809
+ var _item = _step4.value;
810
+ bundle.push(_item);
811
+ }
812
+ } catch (err) {
813
+ _iterator4.e(err);
814
+ } finally {
815
+ _iterator4.f();
816
+ }
817
+ }
818
+ }
819
+
820
+ // 获取到所有的规格
821
+ } catch (err) {
822
+ _iterator.e(err);
823
+ } finally {
824
+ _iterator.f();
825
+ }
826
+ for (var _i = 0, _bundle2 = bundle; _i < _bundle2.length; _i++) {
827
+ var _bundleItem$option_gr;
828
+ var bundleItem = _bundle2[_i];
829
+ if (bundleItem !== null && bundleItem !== void 0 && (_bundleItem$option_gr = bundleItem.option_group) !== null && _bundleItem$option_gr !== void 0 && _bundleItem$option_gr.length) {
830
+ var _iterator2 = _createForOfIteratorHelper(bundleItem.option_group),
831
+ _step2;
832
+ try {
833
+ for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {
834
+ var _group$option_item;
835
+ var group = _step2.value;
836
+ if (group !== null && group !== void 0 && (_group$option_item = group.option_item) !== null && _group$option_item !== void 0 && _group$option_item.length) {
837
+ var _iterator3 = _createForOfIteratorHelper(group.option_item),
838
+ _step3;
839
+ try {
840
+ for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {
841
+ var item = _step3.value;
842
+ single.push(item);
843
+ }
844
+ } catch (err) {
845
+ _iterator3.e(err);
846
+ } finally {
847
+ _iterator3.f();
848
+ }
849
+ }
850
+ }
851
+ } catch (err) {
852
+ _iterator2.e(err);
853
+ } finally {
854
+ _iterator2.f();
855
+ }
856
+ }
857
+ }
858
+ return [bundle, single];
859
+ }
860
+
861
+ /**
862
+ * @title: 更新套餐的价格
863
+ * @description:
864
+ * @param {any} currentValue
865
+ * @param {any} newBundleData
866
+ * @return {*}
867
+ * @Author: WangHan
868
+ * @Date: 2024-12-31 15:16
869
+ */
870
+ export function updateNormalBundlePrice(currentValue, newBundleData) {
871
+ var _currentValue = JSON.parse(JSON.stringify(currentValue));
872
+ var _flatData = flatData(newBundleData);
873
+ var newValue = updateBundlePrice(_currentValue, _flatData);
874
+ return newValue;
875
+ }
876
+
877
+ /**
878
+ * @title: 更新普通商品价格
879
+ * @description:
880
+ * @param {any} ids
881
+ * @param {any} state
882
+ * @return {*}
883
+ * @Author: WangHan
884
+ * @Date: 2024-12-31 15:15
885
+ */
886
+ var normalServicePrice = /*#__PURE__*/function () {
887
+ var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(ids, state) {
888
+ var _state$service5, _state$client, _data$list;
889
+ var services, customerId, data, _lists;
890
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
891
+ while (1) switch (_context.prev = _context.next) {
892
+ case 0:
893
+ services = ((_state$service5 = state.service) === null || _state$service5 === void 0 ? void 0 : _state$service5.value) || [];
894
+ customerId = (state === null || state === void 0 || (_state$client = state.client) === null || _state$client === void 0 || (_state$client = _state$client.value) === null || _state$client === void 0 ? void 0 : _state$client.id) || 0;
895
+ _context.next = 4;
896
+ return state.apis.getServices({
897
+ skip: 1,
898
+ num: 500,
899
+ ids: ids,
900
+ customer_id: customerId,
901
+ open_quotation: 1,
902
+ open_bundle: 1,
903
+ with: ['bundleGroup.bundleItem', 'optionGroup.optionItem'],
904
+ _config: {
905
+ abort: true
906
+ }
907
+ });
908
+ case 4:
909
+ data = _context.sent;
910
+ if (data !== null && data !== void 0 && (_data$list = data.list) !== null && _data$list !== void 0 && _data$list.length) {
911
+ _context.next = 7;
912
+ break;
913
+ }
914
+ return _context.abrupt("return");
915
+ case 7:
916
+ _lists = services.map(function (item) {
917
+ var obj = _objectSpread({}, item);
918
+ if (!appointmentTypes.includes(obj.extension_type)) {
919
+ // 在商品列表中根据商品id找到对应的商品数据
920
+ var product = data.list.find(function (p) {
921
+ return p.id === (item === null || item === void 0 ? void 0 : item.product_id);
922
+ });
923
+ var _extend = (obj === null || obj === void 0 ? void 0 : obj._extend) || {};
924
+ var other = (_extend === null || _extend === void 0 ? void 0 : _extend.other) || {};
925
+ if (product) {
926
+ var _product$variant, _other$bundle, _product$bundle_group;
927
+ // 如果有多规格的话则更新价格为多规格的价格
928
+ if (product !== null && product !== void 0 && (_product$variant = product.variant) !== null && _product$variant !== void 0 && _product$variant.length && other !== null && other !== void 0 && other.product_variant_id) {
929
+ var _product$variant2;
930
+ var _variant = product === null || product === void 0 || (_product$variant2 = product.variant) === null || _product$variant2 === void 0 ? void 0 : _product$variant2.find(function (v) {
931
+ return v.id === (other === null || other === void 0 ? void 0 : other.product_variant_id);
932
+ });
933
+ obj._extend.price = Number(_variant === null || _variant === void 0 ? void 0 : _variant.price);
934
+ obj._extend.other.price = Number(_variant === null || _variant === void 0 ? void 0 : _variant.price);
935
+ } else {
936
+ obj._extend.price = Number(product === null || product === void 0 ? void 0 : product.price);
937
+ }
938
+
939
+ // 更新套餐的价格
940
+ if (other !== null && other !== void 0 && (_other$bundle = other.bundle) !== null && _other$bundle !== void 0 && _other$bundle.length && product !== null && product !== void 0 && (_product$bundle_group = product.bundle_group) !== null && _product$bundle_group !== void 0 && _product$bundle_group.length) {
941
+ var _bundle = updateNormalBundlePrice(other.bundle, product === null || product === void 0 ? void 0 : product.bundle_group);
942
+ obj._extend.other = _objectSpread(_objectSpread({}, other), {}, {
943
+ bundle: _bundle
944
+ });
945
+ }
946
+
947
+ // 更新总计
948
+ obj._extend.total = getProductTotalPrice(obj);
949
+ obj._extend.origin_total = getProductTotalPrice(obj);
950
+ }
951
+ }
952
+ return obj;
953
+ });
954
+ return _context.abrupt("return", _lists);
955
+ case 9:
956
+ case "end":
957
+ return _context.stop();
958
+ }
959
+ }, _callee);
960
+ }));
961
+ return function normalServicePrice(_x, _x2) {
962
+ return _ref4.apply(this, arguments);
963
+ };
964
+ }();
965
+
966
+ /**
967
+ * @title: 更新预约商品报价单
968
+ * @description:
969
+ * @param {any} state
970
+ * @param {any} cacheItem
971
+ * @return {*}
972
+ * @Author: WangHan
973
+ * @Date: 2024-12-25 16:41
974
+ */
975
+ export var updateAppointmentServicePrice = /*#__PURE__*/function () {
976
+ var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(state, _ref5) {
977
+ var _state$service6;
978
+ var start_date, end_date, product_id, defaultReturn, _state$client2, _state$service$cacheI, _res$data, _res$data2, format, customer_id, _product_id, multi_day_price, startDate, endDate, params, res, _prices;
979
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
980
+ while (1) switch (_context2.prev = _context2.next) {
981
+ case 0:
982
+ start_date = _ref5.start_date, end_date = _ref5.end_date, product_id = _ref5.product_id;
983
+ defaultReturn = {
984
+ multiDayPrices: [],
985
+ price: Number(state === null || state === void 0 || (_state$service6 = state.service) === null || _state$service6 === void 0 || (_state$service6 = _state$service6.cacheItem) === null || _state$service6 === void 0 || (_state$service6 = _state$service6._extend) === null || _state$service6 === void 0 ? void 0 : _state$service6.price) || 0
986
+ };
987
+ _context2.prev = 2;
988
+ format = 'YYYY-MM-DD';
989
+ customer_id = (state === null || state === void 0 || (_state$client2 = state.client) === null || _state$client2 === void 0 || (_state$client2 = _state$client2.value) === null || _state$client2 === void 0 ? void 0 : _state$client2.id) || 1;
990
+ _product_id = product_id || ((_state$service$cacheI = state.service.cacheItem) === null || _state$service$cacheI === void 0 ? void 0 : _state$service$cacheI.product_id) || 0;
991
+ multi_day_price = null;
992
+ if (product_id) {
993
+ _context2.next = 10;
994
+ break;
995
+ }
996
+ console.log('updateAppointmentServicePrice', product_id);
997
+ return _context2.abrupt("return", defaultReturn);
998
+ case 10:
999
+ startDate = dayjs(start_date).format(format);
1000
+ endDate = dayjs(end_date).subtract(1, 'days').format(format);
1001
+ params = {
1002
+ customer_id: customer_id,
1003
+ multi_day: {
1004
+ start: startDate,
1005
+ end: endDate
1006
+ }
1007
+ };
1008
+ _context2.next = 15;
1009
+ return postMultiDay(_product_id, params);
1010
+ case 15:
1011
+ res = _context2.sent;
1012
+ _prices = (res === null || res === void 0 || (_res$data = res.data) === null || _res$data === void 0 ? void 0 : _res$data.multi_day_price) || []; // 如果接口返回的有报价单,则分割商品数据
1013
+ multi_day_price = _prices === null || _prices === void 0 ? void 0 : _prices.map(function (p) {
1014
+ var _p$multi_day, _p$multi_day2;
1015
+ var startDate = dayjs(p === null || p === void 0 || (_p$multi_day = p.multi_day) === null || _p$multi_day === void 0 ? void 0 : _p$multi_day.start);
1016
+ // 将返回的结束日期+1天,(前端计算得出的两个日期之间的天数是按照中间的间隔来计算的,而后端返回的报价单的日期是按照当天来计算的)
1017
+ var endDate = dayjs(p === null || p === void 0 || (_p$multi_day2 = p.multi_day) === null || _p$multi_day2 === void 0 ? void 0 : _p$multi_day2.end).add(1, 'day');
1018
+ var duration = (endDate === null || endDate === void 0 ? void 0 : endDate.diff(startDate, 'day')) || 1;
1019
+ return {
1020
+ total: Number(p === null || p === void 0 ? void 0 : p.price),
1021
+ origin_total: Number(p === null || p === void 0 ? void 0 : p.price),
1022
+ num: duration,
1023
+ quotation_id: (p === null || p === void 0 ? void 0 : p.quotation_id) || 0,
1024
+ start_date: startDate === null || startDate === void 0 ? void 0 : startDate.format(format),
1025
+ end_date: endDate === null || endDate === void 0 ? void 0 : endDate.format(format)
1026
+ };
1027
+ });
1028
+ return _context2.abrupt("return", {
1029
+ multiDayPrices: multi_day_price,
1030
+ price: Number(res === null || res === void 0 || (_res$data2 = res.data) === null || _res$data2 === void 0 ? void 0 : _res$data2.price) || 0
1031
+ });
1032
+ case 21:
1033
+ _context2.prev = 21;
1034
+ _context2.t0 = _context2["catch"](2);
1035
+ console.log('updateAppointmentServicePrice', _context2.t0);
1036
+ case 24:
1037
+ return _context2.abrupt("return", defaultReturn);
1038
+ case 25:
1039
+ case "end":
1040
+ return _context2.stop();
1041
+ }
1042
+ }, _callee2, null, [[2, 21]]);
1043
+ }));
1044
+ return function updateAppointmentServicePrice(_x3, _x4) {
1045
+ return _ref6.apply(this, arguments);
1046
+ };
1047
+ }();
1048
+
1049
+ /**
1050
+ * @title: 更新普通商品报价单价格
1051
+ * @description:
1052
+ * @param {any} state
1053
+ * @return {*}
1054
+ * @Author: WangHan
1055
+ * @Date: 2024-12-24 11:32
1056
+ */
1057
+ export var updateServicePrice = function updateServicePrice(state) {
1058
+ var _state$service7, _newNormalIds;
1059
+ var services = ((_state$service7 = state.service) === null || _state$service7 === void 0 ? void 0 : _state$service7.value) || [];
1060
+
1061
+ // 普通商品
1062
+ var normalServices = services === null || services === void 0 ? void 0 : services.filter(function (item) {
1063
+ return isEventBooking(state) ? true : !appointmentTypes.includes(item.extension_type);
1064
+ });
1065
+
1066
+ // 普通商品ids去重
1067
+ var newNormalIds = normalServices === null || normalServices === void 0 ? void 0 : normalServices.map(function (item) {
1068
+ return (item === null || item === void 0 ? void 0 : item.product_id) || (item === null || item === void 0 ? void 0 : item.id);
1069
+ });
1070
+
1071
+ // ids去重
1072
+ newNormalIds = _toConsumableArray(new Set(newNormalIds));
1073
+ if ((_newNormalIds = newNormalIds) !== null && _newNormalIds !== void 0 && _newNormalIds.length) {
1074
+ return normalServicePrice(newNormalIds, state);
1075
+ }
1076
+ return [];
1077
+ };