@pisell/private-materials 6.5.27 → 6.6.1

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 (338) 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 +2 -2
  6. package/build/lowcode/preview.js +146 -165
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +9 -9
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +9 -9
  11. package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
  12. package/es/components/appointmentBooking/components/Cart/Item/index.js +4 -2
  13. package/es/components/appointmentBooking/components/ConfirmInformation/index.js +273 -76
  14. package/es/components/appointmentBooking/components/ConfirmInformation/index.less +15 -0
  15. package/es/components/appointmentBooking/hooks.d.ts +1 -0
  16. package/es/components/appointmentBooking/hooks.js +30 -30
  17. package/es/components/appointmentBooking/locales.d.ts +3 -0
  18. package/es/components/appointmentBooking/locales.js +9 -6
  19. package/es/components/booking/components/actionButtons/index.js +34 -20
  20. package/es/components/booking/components/customSelect/index.js +1 -1
  21. package/es/components/booking/components/footer/amount.js +25 -8
  22. package/es/components/booking/components/footer/index.js +66 -33
  23. package/es/components/booking/components/footer/utils.d.ts +7 -0
  24. package/es/components/booking/components/footer/utils.js +126 -99
  25. package/es/components/booking/components/voucher/index.js +25 -9
  26. package/es/components/booking/dashboard/serve.js +1 -6
  27. package/es/components/booking/forms/footer.js +24 -10
  28. package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
  29. package/es/components/booking/forms/serve.js +2 -12
  30. package/es/components/booking/hooks/useQuotation.js +69 -21
  31. package/es/components/booking/info/client/index.js +28 -13
  32. package/es/components/booking/info/client/serve.js +2 -11
  33. package/es/components/booking/info/clientVariant/hooks/useClientFn.js +16 -10
  34. package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +10 -2
  35. package/es/components/booking/info/clientVariant/vertical/index.js +1 -1
  36. package/es/components/booking/info/hooks/useHolderConfig.d.ts +1 -0
  37. package/es/components/booking/info/hooks/useHolderConfig.js +9 -2
  38. package/es/components/booking/info/main.js +3 -2
  39. package/es/components/booking/info/model.js +5 -0
  40. package/es/components/booking/info/pet/serve.js +1 -6
  41. package/es/components/booking/info/service/Lists.d.ts +1 -1
  42. package/es/components/booking/info/service/Lists.js +10 -4
  43. package/es/components/booking/info/service/addTimeModal/serve.js +1 -11
  44. package/es/components/booking/info/service/serve.d.ts +14 -0
  45. package/es/components/booking/info/service/serve.js +25 -18
  46. package/es/components/booking/info/service2/Group/utils.js +2 -0
  47. package/es/components/booking/info/service2/utils.d.ts +1 -33
  48. package/es/components/booking/info/service2/utils.js +92 -56
  49. package/es/components/booking/info/utils.js +5 -0
  50. package/es/components/booking/info2/cartClientCard/index.js +49 -9
  51. package/es/components/booking/info2/index.js +3 -2
  52. package/es/components/booking/info2/serve.js +1 -6
  53. package/es/components/booking/info2/service/addService/index.js +146 -89
  54. package/es/components/booking/info2/service/addService/utils.d.ts +8 -0
  55. package/es/components/booking/info2/service/addService/utils.js +83 -14
  56. package/es/components/booking/info2/service/contactInfoMode/index.d.ts +2 -0
  57. package/es/components/booking/info2/service/contactInfoMode/index.js +94 -0
  58. package/es/components/booking/info2/service/editService/Holder/index.d.ts +12 -0
  59. package/es/components/booking/info2/service/editService/Holder/index.js +193 -0
  60. package/es/components/booking/info2/service/editService/Holder/index.less +63 -0
  61. package/es/components/booking/info2/service/editService/index.js +313 -57
  62. package/es/components/booking/info2/utilsByBooking.js +19 -14
  63. package/es/components/booking/locales.d.ts +36 -0
  64. package/es/components/booking/locales.js +48 -3
  65. package/es/components/booking/model.d.ts +4 -0
  66. package/es/components/booking/model.js +3 -0
  67. package/es/components/booking/utils/confirmHolderModal.d.ts +13 -0
  68. package/es/components/booking/utils/confirmHolderModal.js +318 -0
  69. package/es/components/booking/utils/confirmHolderModal.less +40 -0
  70. package/es/components/booking/utils/selectHolderModal.d.ts +24 -0
  71. package/es/components/booking/utils/selectHolderModal.js +407 -0
  72. package/es/components/booking/utils.d.ts +16 -7
  73. package/es/components/booking/utils.js +26 -37
  74. package/es/components/checkout/PaymentModal.js +61 -30
  75. package/es/components/checkout/components/CashPaymentModule/index.js +1 -7
  76. package/es/components/checkout/components/ScrollableList/index.js +0 -1
  77. package/es/components/checkout/locales.d.ts +3 -0
  78. package/es/components/checkout/locales.js +3 -0
  79. package/es/components/eftposPay/linkly/index.js +64 -2
  80. package/es/components/eftposPay/tyro/index.js +12 -0
  81. package/es/components/list/List.js +3 -0
  82. package/es/components/pay/toB/components/MX51/index.js +14 -44
  83. package/es/components/pay/toB/types/index.d.ts +0 -12
  84. package/es/components/pay/toB/types/index.js +0 -4
  85. package/es/components/pisellSelectCustomerModal/RightPanel/serve.js +1 -5
  86. package/es/components/shoppingCart/components/Cart/Product.js +6 -3
  87. package/es/components/shoppingCart/type.d.ts +1 -0
  88. package/es/components/ticketBooking/components/ProductDisplayAdapter/index.less +0 -12
  89. package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.d.ts +18 -0
  90. package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.js +119 -0
  91. package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.less +0 -0
  92. package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -2
  93. package/es/components/ticketBooking/components/addServiceVariant/addService.js +419 -794
  94. package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -2
  95. package/es/components/ticketBooking/components/addServiceVariant/index.js +4 -4
  96. package/es/components/ticketBooking/components/addServiceVariant/utils.js +1 -2
  97. package/es/components/ticketBooking/components/menuBar/index.js +109 -12
  98. package/es/components/ticketBooking/components/ticketBooking/index.d.ts +2 -4
  99. package/es/components/ticketBooking/components/ticketBooking/index.js +32 -61
  100. package/es/components/ticketBooking/components/ticketBooking/index.less +2 -1
  101. package/es/components/ticketBooking/components/timeBar/index.d.ts +0 -1
  102. package/es/components/ticketBooking/components/timeBar/index.js +1 -4
  103. package/es/components/ticketBooking/hooks/pisellos/useProducts.d.ts +0 -4
  104. package/es/components/ticketBooking/hooks/pisellos/useProducts.js +122 -170
  105. package/es/components/ticketBooking/index.d.ts +0 -1
  106. package/es/components/ticketBooking/index.js +0 -2
  107. package/es/components/ticketBooking/serve.js +17 -119
  108. package/es/components/ticketBooking/utils/index.d.ts +7 -1
  109. package/es/components/ticketBooking/utils/index.js +44 -28
  110. package/es/hooks/useEngineContext.d.ts +0 -1
  111. package/es/hooks/useEngineContext.js +0 -7
  112. package/es/index.d.ts +4 -0
  113. package/es/index.js +5 -1
  114. package/es/plus/clientCard/locales.js +3 -3
  115. package/es/plus/clinetSearch/index.js +28 -30
  116. package/es/plus/clinetSearch/locales.d.ts +3 -0
  117. package/es/plus/clinetSearch/locales.js +7 -4
  118. package/es/plus/clinetSearch/types.d.ts +12 -0
  119. package/es/plus/contactInfo/components/Avatar/index.d.ts +10 -0
  120. package/es/plus/contactInfo/components/Avatar/index.js +30 -0
  121. package/es/plus/contactInfo/components/SwipeAction/index.d.ts +46 -0
  122. package/es/plus/contactInfo/components/SwipeAction/index.js +360 -0
  123. package/es/plus/contactInfo/components/SwipeAction/index.less +74 -0
  124. package/es/plus/contactInfo/index.d.ts +6 -0
  125. package/es/plus/contactInfo/index.js +198 -0
  126. package/es/plus/contactInfo/index.less +621 -0
  127. package/es/plus/contactInfo/locales.d.ts +15 -0
  128. package/es/plus/contactInfo/locales.js +14 -0
  129. package/es/plus/contactInfo/types.d.ts +91 -0
  130. package/es/plus/contactInfo/types.js +1 -0
  131. package/es/plus/contactInfo/utils.d.ts +7 -0
  132. package/es/plus/contactInfo/utils.js +50 -0
  133. package/es/plus/contactInfoModal/ContactInfoContent.d.ts +3 -0
  134. package/es/plus/contactInfoModal/ContactInfoContent.js +74 -0
  135. package/es/plus/contactInfoModal/index.d.ts +41 -0
  136. package/es/plus/contactInfoModal/index.js +155 -0
  137. package/es/plus/contactInfoModal/index.less +19 -0
  138. package/es/plus/contactInfoModal/locales.d.ts +66 -0
  139. package/es/plus/contactInfoModal/locales.js +65 -0
  140. package/es/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +1 -1
  141. package/es/plus/productSelect/ProductCard/index.js +1 -1
  142. package/es/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
  143. package/es/plus/selectHolder/components/ErrorTip/index.js +14 -0
  144. package/es/plus/selectHolder/components/ErrorTip/index.less +51 -0
  145. package/es/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
  146. package/es/plus/selectHolder/components/HolderItem/index.js +77 -0
  147. package/es/plus/selectHolder/components/HolderItem/index.less +105 -0
  148. package/es/plus/selectHolder/components/HolderList/index.d.ts +30 -0
  149. package/es/plus/selectHolder/components/HolderList/index.js +43 -0
  150. package/es/plus/selectHolder/index.d.ts +7 -0
  151. package/es/plus/selectHolder/index.js +273 -0
  152. package/es/plus/selectHolder/index.less +137 -0
  153. package/es/plus/selectHolder/locales.d.ts +24 -0
  154. package/es/plus/selectHolder/locales.js +29 -0
  155. package/es/plus/selectHolder/types.d.ts +104 -0
  156. package/es/plus/selectHolder/types.js +1 -0
  157. package/es/plus/selectHolder/utils.d.ts +9 -0
  158. package/es/plus/selectHolder/utils.js +16 -0
  159. package/es/pro/comprehensiveSearch/components/searchSection/locales.js +3 -3
  160. package/es/pro/comprehensiveSearch/locales.js +1 -1
  161. package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
  162. package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.js +357 -0
  163. package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.less +8 -0
  164. package/es/pro/multiDayTimeSelect/index.d.ts +3 -0
  165. package/es/pro/multiDayTimeSelect/index.js +1 -0
  166. package/es/pro/multiDayTimeSelect/types.d.ts +28 -0
  167. package/es/pro/multiDayTimeSelect/types.js +1 -0
  168. package/es/pro/skuDetailModal/types.d.ts +1 -0
  169. package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -1
  170. package/lib/components/appointmentBooking/components/Cart/Item/index.js +6 -3
  171. package/lib/components/appointmentBooking/components/ConfirmInformation/index.js +156 -13
  172. package/lib/components/appointmentBooking/components/ConfirmInformation/index.less +15 -0
  173. package/lib/components/appointmentBooking/hooks.d.ts +1 -0
  174. package/lib/components/appointmentBooking/hooks.js +73 -35
  175. package/lib/components/appointmentBooking/locales.d.ts +3 -0
  176. package/lib/components/appointmentBooking/locales.js +6 -3
  177. package/lib/components/booking/components/actionButtons/index.js +11 -2
  178. package/lib/components/booking/components/customSelect/index.js +1 -1
  179. package/lib/components/booking/components/footer/amount.js +23 -6
  180. package/lib/components/booking/components/footer/index.js +26 -5
  181. package/lib/components/booking/components/footer/utils.d.ts +7 -0
  182. package/lib/components/booking/components/footer/utils.js +120 -82
  183. package/lib/components/booking/components/voucher/index.js +10 -1
  184. package/lib/components/booking/dashboard/serve.js +1 -6
  185. package/lib/components/booking/forms/footer.js +29 -11
  186. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
  187. package/lib/components/booking/forms/serve.js +2 -12
  188. package/lib/components/booking/hooks/useQuotation.js +45 -13
  189. package/lib/components/booking/info/client/index.js +14 -1
  190. package/lib/components/booking/info/client/serve.js +2 -13
  191. package/lib/components/booking/info/clientVariant/hooks/useClientFn.js +7 -2
  192. package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +11 -4
  193. package/lib/components/booking/info/clientVariant/vertical/index.js +34 -17
  194. package/lib/components/booking/info/hooks/useHolderConfig.d.ts +1 -0
  195. package/lib/components/booking/info/hooks/useHolderConfig.js +8 -3
  196. package/lib/components/booking/info/main.js +5 -4
  197. package/lib/components/booking/info/model.js +5 -0
  198. package/lib/components/booking/info/pet/serve.js +1 -6
  199. package/lib/components/booking/info/service/Lists.d.ts +1 -1
  200. package/lib/components/booking/info/service/Lists.js +5 -3
  201. package/lib/components/booking/info/service/addTimeModal/serve.js +1 -7
  202. package/lib/components/booking/info/service/serve.d.ts +14 -0
  203. package/lib/components/booking/info/service/serve.js +8 -17
  204. package/lib/components/booking/info/service2/Group/utils.js +2 -0
  205. package/lib/components/booking/info/service2/utils.d.ts +1 -33
  206. package/lib/components/booking/info/service2/utils.js +38 -29
  207. package/lib/components/booking/info/utils.js +4 -0
  208. package/lib/components/booking/info2/cartClientCard/index.js +34 -5
  209. package/lib/components/booking/info2/index.js +11 -5
  210. package/lib/components/booking/info2/serve.js +1 -6
  211. package/lib/components/booking/info2/service/addService/index.js +22 -3
  212. package/lib/components/booking/info2/service/addService/utils.d.ts +8 -0
  213. package/lib/components/booking/info2/service/addService/utils.js +48 -11
  214. package/lib/components/booking/info2/service/contactInfoMode/index.d.ts +2 -0
  215. package/lib/components/booking/info2/service/contactInfoMode/index.js +111 -0
  216. package/lib/components/booking/info2/service/editService/Holder/index.d.ts +12 -0
  217. package/lib/components/booking/info2/service/editService/Holder/index.js +199 -0
  218. package/lib/components/booking/info2/service/editService/Holder/index.less +63 -0
  219. package/lib/components/booking/info2/service/editService/index.js +254 -32
  220. package/lib/components/booking/info2/utilsByBooking.js +26 -19
  221. package/lib/components/booking/locales.d.ts +36 -0
  222. package/lib/components/booking/locales.js +42 -3
  223. package/lib/components/booking/model.d.ts +4 -0
  224. package/lib/components/booking/model.js +3 -0
  225. package/lib/components/booking/utils/confirmHolderModal.d.ts +13 -0
  226. package/lib/components/booking/utils/confirmHolderModal.js +253 -0
  227. package/lib/components/booking/utils/confirmHolderModal.less +40 -0
  228. package/lib/components/booking/utils/selectHolderModal.d.ts +24 -0
  229. package/lib/components/booking/utils/selectHolderModal.js +319 -0
  230. package/lib/components/booking/utils.d.ts +16 -7
  231. package/lib/components/booking/utils.js +18 -21
  232. package/lib/components/checkout/PaymentModal.js +41 -18
  233. package/lib/components/checkout/components/CashPaymentModule/index.js +1 -7
  234. package/lib/components/checkout/components/ScrollableList/index.js +0 -1
  235. package/lib/components/checkout/locales.d.ts +3 -0
  236. package/lib/components/checkout/locales.js +3 -0
  237. package/lib/components/eftposPay/linkly/index.js +31 -1
  238. package/lib/components/eftposPay/tyro/index.js +12 -0
  239. package/lib/components/list/List.js +3 -0
  240. package/lib/components/pay/toB/components/MX51/index.js +12 -37
  241. package/lib/components/pay/toB/types/index.d.ts +0 -12
  242. package/lib/components/pisellSelectCustomerModal/RightPanel/serve.js +1 -8
  243. package/lib/components/shoppingCart/components/Cart/Product.js +7 -3
  244. package/lib/components/shoppingCart/type.d.ts +1 -0
  245. package/lib/components/ticketBooking/components/ProductDisplayAdapter/index.less +0 -12
  246. package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.d.ts +18 -0
  247. package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.js +118 -0
  248. package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.less +0 -0
  249. package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +0 -2
  250. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +279 -313
  251. package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -2
  252. package/lib/components/ticketBooking/components/addServiceVariant/index.js +5 -3
  253. package/lib/components/ticketBooking/components/addServiceVariant/utils.js +1 -2
  254. package/lib/components/ticketBooking/components/menuBar/index.js +42 -6
  255. package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +2 -4
  256. package/lib/components/ticketBooking/components/ticketBooking/index.js +12 -49
  257. package/lib/components/ticketBooking/components/ticketBooking/index.less +2 -1
  258. package/lib/components/ticketBooking/components/timeBar/index.d.ts +0 -1
  259. package/lib/components/ticketBooking/components/timeBar/index.js +1 -3
  260. package/lib/components/ticketBooking/hooks/pisellos/useProducts.d.ts +0 -4
  261. package/lib/components/ticketBooking/hooks/pisellos/useProducts.js +69 -98
  262. package/lib/components/ticketBooking/index.d.ts +0 -1
  263. package/lib/components/ticketBooking/index.js +0 -2
  264. package/lib/components/ticketBooking/serve.js +15 -117
  265. package/lib/components/ticketBooking/utils/index.d.ts +7 -1
  266. package/lib/components/ticketBooking/utils/index.js +29 -23
  267. package/lib/hooks/useEngineContext.d.ts +0 -1
  268. package/lib/hooks/useEngineContext.js +2 -10
  269. package/lib/index.d.ts +4 -0
  270. package/lib/index.js +12 -0
  271. package/lib/plus/clientCard/locales.js +3 -3
  272. package/lib/plus/clinetSearch/index.js +17 -8
  273. package/lib/plus/clinetSearch/locales.d.ts +3 -0
  274. package/lib/plus/clinetSearch/locales.js +7 -4
  275. package/lib/plus/clinetSearch/types.d.ts +12 -0
  276. package/lib/plus/contactInfo/components/Avatar/index.d.ts +10 -0
  277. package/lib/plus/contactInfo/components/Avatar/index.js +56 -0
  278. package/lib/plus/contactInfo/components/SwipeAction/index.d.ts +46 -0
  279. package/lib/plus/contactInfo/components/SwipeAction/index.js +373 -0
  280. package/lib/plus/contactInfo/components/SwipeAction/index.less +74 -0
  281. package/lib/plus/contactInfo/index.d.ts +6 -0
  282. package/lib/plus/contactInfo/index.js +226 -0
  283. package/lib/plus/contactInfo/index.less +621 -0
  284. package/lib/plus/contactInfo/locales.d.ts +15 -0
  285. package/lib/plus/contactInfo/locales.js +38 -0
  286. package/lib/plus/contactInfo/types.d.ts +91 -0
  287. package/lib/plus/contactInfo/types.js +17 -0
  288. package/lib/plus/contactInfo/utils.d.ts +7 -0
  289. package/lib/plus/contactInfo/utils.js +64 -0
  290. package/lib/plus/contactInfoModal/ContactInfoContent.d.ts +3 -0
  291. package/lib/plus/contactInfoModal/ContactInfoContent.js +129 -0
  292. package/lib/plus/contactInfoModal/index.d.ts +41 -0
  293. package/lib/plus/contactInfoModal/index.js +139 -0
  294. package/lib/plus/contactInfoModal/index.less +19 -0
  295. package/lib/plus/contactInfoModal/locales.d.ts +66 -0
  296. package/lib/plus/contactInfoModal/locales.js +89 -0
  297. package/lib/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +1 -1
  298. package/lib/plus/productSelect/ProductCard/index.js +1 -1
  299. package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
  300. package/lib/plus/selectHolder/components/ErrorTip/index.js +30 -0
  301. package/lib/plus/selectHolder/components/ErrorTip/index.less +51 -0
  302. package/lib/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
  303. package/lib/plus/selectHolder/components/HolderItem/index.js +101 -0
  304. package/lib/plus/selectHolder/components/HolderItem/index.less +105 -0
  305. package/lib/plus/selectHolder/components/HolderList/index.d.ts +30 -0
  306. package/lib/plus/selectHolder/components/HolderList/index.js +63 -0
  307. package/lib/plus/selectHolder/index.d.ts +7 -0
  308. package/lib/plus/selectHolder/index.js +223 -0
  309. package/lib/plus/selectHolder/index.less +137 -0
  310. package/lib/plus/selectHolder/locales.d.ts +24 -0
  311. package/lib/plus/selectHolder/locales.js +47 -0
  312. package/lib/plus/selectHolder/types.d.ts +104 -0
  313. package/lib/plus/selectHolder/types.js +17 -0
  314. package/lib/plus/selectHolder/utils.d.ts +9 -0
  315. package/lib/plus/selectHolder/utils.js +34 -0
  316. package/lib/pro/comprehensiveSearch/components/searchSection/locales.js +3 -3
  317. package/lib/pro/comprehensiveSearch/locales.js +1 -1
  318. package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
  319. package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.js +304 -0
  320. package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.less +8 -0
  321. package/lib/pro/multiDayTimeSelect/index.d.ts +3 -0
  322. package/lib/{hooks/printer.js → pro/multiDayTimeSelect/index.js} +6 -31
  323. package/lib/pro/multiDayTimeSelect/types.d.ts +28 -0
  324. package/lib/pro/multiDayTimeSelect/types.js +17 -0
  325. package/lib/pro/skuDetailModal/types.d.ts +1 -0
  326. package/lowcode/contact-info/fragments/cardStyle.ts +68 -0
  327. package/lowcode/contact-info/fragments/nameStyle.ts +33 -0
  328. package/lowcode/contact-info/fragments/pisellAvatar.ts +103 -0
  329. package/lowcode/contact-info/fragments/textStyle.ts +33 -0
  330. package/lowcode/contact-info/meta.ts +199 -0
  331. package/lowcode/contact-info-modal/meta.ts +98 -0
  332. package/lowcode/event-select-holder/meta.ts +2 -2
  333. package/lowcode/select-holder/meta.ts +220 -0
  334. package/lowcode/select-holder/snippets.ts +41 -0
  335. package/package.json +13 -11
  336. package/es/hooks/printer.d.ts +0 -4
  337. package/es/hooks/printer.js +0 -35
  338. package/lib/hooks/printer.d.ts +0 -4
@@ -50,6 +50,9 @@ var import_pisellos = require("../../hooks/pisellos");
50
50
  var import_utils7 = require("./utils");
51
51
  var import_materials = require("@pisell/materials");
52
52
  var import_IsActiveContext = require("../../context/IsActiveContext");
53
+ var import_utils8 = require("../../../booking/info/service2/Group/utils");
54
+ var import_MultiDayTimeSelectModal = __toESM(require("./MultiDayTimeSelectModal"));
55
+ var import_selectHolderModal = require("../../../booking/utils/selectHolderModal");
53
56
  var productListLayout = {
54
57
  grid: true,
55
58
  config: "12:12"
@@ -63,20 +66,16 @@ var productListSetting = {
63
66
  isStock: 0
64
67
  };
65
68
  var AddSerivce = (props) => {
66
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
69
+ var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l;
67
70
  const {
68
71
  onEdit,
69
72
  state,
70
73
  dispatch,
71
74
  renderMode = "current",
72
- onPrerenderComplete,
73
- onGetProductsReady,
74
75
  productDisplayConfig
75
76
  } = props;
76
77
  const context = (0, import_useEngineContext.default)();
77
- const platform = (0, import_useEngineContext.usePlatform)();
78
78
  const notAvailableRef = (0, import_react.useRef)(null);
79
- const isLoadedServiceRef = (0, import_react.useRef)(false);
80
79
  import_utils2.request.setRequest(context.appHelper.utils.request);
81
80
  const isActive = (0, import_IsActiveContext.useIsActive)();
82
81
  const Toast = (0, import_materials.useToast)();
@@ -93,31 +92,12 @@ var AddSerivce = (props) => {
93
92
  );
94
93
  const [currentProduct, setCurrentProduct] = (0, import_react.useState)(null);
95
94
  const [firstLoading, setFirstLoading] = (0, import_react.useState)(true);
95
+ const [multiDayModalOpen, setMultiDayModalOpen] = (0, import_react.useState)(false);
96
+ const [multiDayModalLoading, setMultiDayModalLoading] = (0, import_react.useState)(false);
97
+ const [pendingMultiDayData, setPendingMultiDayData] = (0, import_react.useState)(null);
96
98
  const stateRef = (0, import_react.useRef)(state);
97
99
  stateRef.current = state;
98
- const prerenderCompletedRef = (0, import_react.useRef)(false);
99
- const latestServiceValueRef = (0, import_react.useRef)(((_j = state == null ? void 0 : state.service) == null ? void 0 : _j.value) || []);
100
- const lastOperationTimeRef = (0, import_react.useRef)(0);
101
- const isInFastClickMode = () => {
102
- const now = Date.now();
103
- return now - lastOperationTimeRef.current < 2e3;
104
- };
105
- const getCurrentServiceValue = () => {
106
- var _a2, _b2, _c2;
107
- if (isInFastClickMode()) {
108
- return latestServiceValueRef.current || ((_b2 = (_a2 = stateRef.current) == null ? void 0 : _a2.service) == null ? void 0 : _b2.value) || [];
109
- } else {
110
- const stateValue = ((_c2 = state == null ? void 0 : state.service) == null ? void 0 : _c2.value) || [];
111
- latestServiceValueRef.current = null;
112
- return stateValue;
113
- }
114
- };
115
- const { getProducts, products, loading, getScheduleTimePoints } = (0, import_pisellos.useProducts)(notAvailableRef);
116
- (0, import_react.useEffect)(() => {
117
- if (onGetProductsReady && getProducts) {
118
- onGetProductsReady(getProducts);
119
- }
120
- }, []);
100
+ const { getProducts, products, loading } = (0, import_pisellos.useProducts)(notAvailableRef);
121
101
  (0, import_react.useEffect)(() => {
122
102
  const timer = setTimeout(() => {
123
103
  setFirstLoading(false);
@@ -134,12 +114,6 @@ var AddSerivce = (props) => {
134
114
  debounceTimersRef.current = {};
135
115
  };
136
116
  }, []);
137
- (0, import_react.useEffect)(() => {
138
- if (!loading && !prerenderCompletedRef.current) {
139
- onPrerenderComplete == null ? void 0 : onPrerenderComplete();
140
- prerenderCompletedRef.current = true;
141
- }
142
- }, [loading]);
143
117
  (0, import_react.useEffect)(() => {
144
118
  const handler = (event) => {
145
119
  var _a2;
@@ -159,37 +133,31 @@ var AddSerivce = (props) => {
159
133
  const menuList = (0, import_react.useMemo)(() => {
160
134
  var _a2, _b2, _c2;
161
135
  return ((_c2 = (_b2 = (_a2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a2.config) == null ? void 0 : _b2.menu_list_tab) == null ? void 0 : _c2.menu_list) || [];
162
- }, [(_k = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _k.config]);
136
+ }, [(_j = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _j.config]);
163
137
  const customerId = (0, import_react.useMemo)(() => {
164
138
  var _a2, _b2;
165
139
  return ((_b2 = (_a2 = state.client) == null ? void 0 : _a2.value) == null ? void 0 : _b2.id) || void 0;
166
- }, [(_m = (_l = state.client) == null ? void 0 : _l.value) == null ? void 0 : _m.id]);
140
+ }, [(_l = (_k = state.client) == null ? void 0 : _k.value) == null ? void 0 : _l.id]);
167
141
  const scanAddService = (0, import_ahooks.useMemoizedFn)((list, code) => {
168
- let newService = [...stateRef.current.service.value || []];
142
+ let newService = [...state.service.value];
169
143
  list.forEach((item) => {
170
144
  if ((0, import_utils7.isBundle)(item) || (0, import_utils7.isOption)(item)) {
171
145
  handleSelectProduct(item);
172
146
  return;
173
147
  }
174
148
  const values = (0, import_utils7.genValues)(item, code);
175
- let cacheItem = (0, import_utils7.createCacheItem)(item, values, stateRef.current);
149
+ let cacheItem = (0, import_utils7.createCacheItem)(item, values, state);
176
150
  cacheItem._serviceKey = (0, import_utils6.genServiceKey)(cacheItem);
151
+ cacheItem._holderKey = (0, import_utils6.genHolderKey)(cacheItem);
177
152
  cacheItem.autoClose = false;
178
153
  let { list: _list, quantity } = (0, import_utils6.addService)(
179
154
  [...newService],
180
155
  cacheItem,
181
- stateRef.current
156
+ state
182
157
  );
183
158
  handleAddToast(cacheItem.title, quantity);
184
159
  newService = _list;
185
160
  });
186
- stateRef.current = {
187
- ...stateRef.current,
188
- service: {
189
- ...stateRef.current.service,
190
- value: newService
191
- }
192
- };
193
161
  dispatch({
194
162
  type: "setService",
195
163
  payload: {
@@ -221,7 +189,6 @@ var AddSerivce = (props) => {
221
189
  delete clickCountRef.current[productId];
222
190
  delete debounceTimersRef.current[productId];
223
191
  originalCallback(finalCacheValues, "", item, true);
224
- lastOperationTimeRef.current = Date.now();
225
192
  }
226
193
  );
227
194
  const debouncedExecuteCacheValues = (0, import_ahooks.useMemoizedFn)(
@@ -229,306 +196,303 @@ var AddSerivce = (props) => {
229
196
  if (debounceTimersRef.current[productId]) {
230
197
  clearTimeout(debounceTimersRef.current[productId]);
231
198
  }
232
- const debounceTime = Number(localStorage.getItem("pisell_service_add_debounce_time")) || 0;
233
199
  debounceTimersRef.current[productId] = setTimeout(() => {
234
200
  executeCacheValues(productId, cacheValues, item, callback);
235
- }, debounceTime);
201
+ }, 0);
236
202
  }
237
203
  );
238
- const checkResourceAvailability = (0, import_ahooks.useMemoizedFn)((item) => {
239
- var _a2;
240
- if (!(0, import_utils4.isNormalProductByDurationSchedule)(item)) {
241
- if (!Array.isArray((_a2 = state.service) == null ? void 0 : _a2.resourcesOrigin) || !state.service.resourcesOrigin.length) {
242
- dispatch({
243
- type: "setService",
244
- payload: {
245
- ...stateRef.current.service,
246
- reloadResourceModal: true
247
- }
248
- });
249
- return false;
250
- }
251
- }
252
- return true;
253
- });
254
- const createCacheItemFromParams = (0, import_ahooks.useMemoizedFn)((item, params, detail) => {
255
- var _a2;
256
- const _detail = detail || item;
257
- const other = JSON.parse(JSON.stringify(params));
258
- other.session = params.session;
204
+ const processAddService = (0, import_ahooks.useMemoizedFn)(async (item, _detail, e, notShowToast, startDate, endDate) => {
205
+ var _a2, _b2, _c2, _d2, _e2, _f2, _g2, _h2, _i2, _j2, _k2, _l2, _m, _n, _o, _p;
206
+ const other = JSON.parse(JSON.stringify(e));
207
+ other.session = e.session;
259
208
  let cacheItem = {
260
209
  ..._detail,
261
210
  product_id: item.id,
262
211
  _id: (0, import_utils.getUniqueId)(),
263
- _key: params.key,
212
+ _key: e.key,
264
213
  _extend: {
265
- start_date: state.date.value,
266
- quantity: (params == null ? void 0 : params.quantity) || 1,
214
+ start_date: startDate,
215
+ quantity: (e == null ? void 0 : e.quantity) || 1,
267
216
  price: _detail.price,
268
217
  product_name: item.title,
269
- other
218
+ other,
219
+ end_date: endDate
270
220
  },
271
221
  new: 1
272
222
  };
273
223
  let _total = (0, import_utils2.getProductTotalPrice)(cacheItem);
274
224
  cacheItem._extend.total = _total;
275
225
  cacheItem._extend.origin_total = _total;
276
- const _isEdit = !!state.service.cacheItem;
226
+ const _isEdit = !!stateRef.current.service.cacheItem;
277
227
  if (_isEdit) {
278
- cacheItem._id = (_a2 = state.service.cacheItem) == null ? void 0 : _a2._id;
228
+ cacheItem._id = (_a2 = stateRef.current.service.cacheItem) == null ? void 0 : _a2._id;
279
229
  cacheItem.new = 0;
280
230
  }
281
231
  if (renderMode === "current") {
282
- cacheItem.currentDefaultTime = state.date.value.format("HH:mm");
232
+ cacheItem.currentDefaultTime = stateRef.current.date.value.format("HH:mm");
283
233
  }
284
- const isNormalProduct = (0, import_utils4.isNormalProductByDurationSchedule)(item);
285
- cacheItem = isNormalProduct ? { ...cacheItem, autoClose: true } : (0, import_utils3.getProductExtend)({
234
+ cacheItem = (0, import_utils3.getProductExtend)({
286
235
  cacheItem,
287
- state,
236
+ state: stateRef.current,
288
237
  isDisabledTime: true
289
238
  });
290
- if (state.renderType === "eventBooking") {
291
- cacheItem.autoClose = false;
292
- }
293
- return cacheItem;
294
- });
295
- const getProductKey = (0, import_ahooks.useMemoizedFn)((item, cacheItem) => {
296
- return cacheItem._serviceKey || `${item.id}_${cacheItem._key}`;
297
- });
298
- const getServiceQuantity = (0, import_ahooks.useMemoizedFn)((cacheItem) => {
299
- var _a2, _b2;
300
- const existingService = (_a2 = stateRef.current.service.value) == null ? void 0 : _a2.find(
301
- (val) => (0, import_utils6.isSameProduct)(val, cacheItem)
302
- );
303
- return ((_b2 = existingService == null ? void 0 : existingService._extend) == null ? void 0 : _b2.quantity) || 0;
304
- });
305
- const processAutoCloseService = (0, import_ahooks.useMemoizedFn)((cacheItem, item, detail, notShowToast) => {
306
- console.time("processAutoCloseService2");
307
- cacheItem.autoClose = false;
308
- cacheItem._serviceKey = (0, import_utils6.genServiceKey)(cacheItem);
309
- const productKey = getProductKey(item, cacheItem);
310
- if (pendingCacheValuesRef.current[productKey]) {
311
- clickCountRef.current[productKey] = (clickCountRef.current[productKey] || 1) + 1;
312
- } else {
313
- pendingCacheValuesRef.current[productKey] = { cacheItem, item, detail, notShowToast };
314
- clickCountRef.current[productKey] = 1;
315
- }
316
- if (!notShowToast) {
317
- const originalQuantity = getServiceQuantity(cacheItem);
318
- const currentClickCount = clickCountRef.current[productKey] || 1;
319
- const totalQuantity = originalQuantity + currentClickCount;
320
- handleAddToast(cacheItem.title, totalQuantity);
321
- }
322
- if (debounceTimersRef.current[productKey]) {
323
- clearTimeout(debounceTimersRef.current[productKey]);
324
- }
325
- const debounceTime = Number(localStorage.getItem("pisell_service_add_debounce_time")) || 0;
326
- debounceTimersRef.current[productKey] = setTimeout(() => {
327
- executeServiceDispatch(productKey);
328
- }, debounceTime);
329
- console.timeEnd("processAutoCloseService2");
330
- });
331
- const executeServiceDispatch = (0, import_ahooks.useMemoizedFn)((productKey) => {
332
- console.time("executeServiceDispatch");
333
- console.time("executeServiceDispatch1");
334
- const pendingData = pendingCacheValuesRef.current[productKey];
335
- if (!pendingData) return;
336
- const { cacheItem, item, detail } = pendingData;
337
- const clickCount = clickCountRef.current[productKey] || 1;
338
- const finalCacheItem = {
339
- ...cacheItem,
340
- _extend: {
341
- ...cacheItem._extend,
342
- quantity: clickCount
239
+ const isMultiDay = (0, import_utils3.isMultiDayProduct)(cacheItem);
240
+ const getMultiDayCacheItem = async (isConcatBookings) => {
241
+ cacheItem = await (0, import_utils3.getMultiDay)({
242
+ start_date: cacheItem._extend.start_date,
243
+ end_date: cacheItem._extend.end_date,
244
+ state: stateRef.current,
245
+ cacheItem
246
+ });
247
+ cacheItem = (0, import_utils8.createBookingItemsByGroup)(cacheItem);
248
+ if (isConcatBookings) {
249
+ cacheItem = (0, import_utils8.concatBookings)(cacheItem);
343
250
  }
344
251
  };
345
- console.timeEnd("executeServiceDispatch1");
346
- console.time("executeServiceDispatch addService");
347
- let { list: _list, quantity } = (0, import_utils6.addService)(
348
- [...stateRef.current.service.value || []],
349
- finalCacheItem,
350
- stateRef.current
351
- );
352
- console.timeEnd("executeServiceDispatch addService");
353
- console.time("executeServiceDispatch2");
354
- window.dispatchEvent(
355
- new CustomEvent("onAddNewService", {
356
- detail: {
357
- cacheItem: finalCacheItem
252
+ if (!(0, import_utils4.isNormalProductByDurationSchedule)(cacheItem) && (!cacheItem._extend.holder_id || !cacheItem._extend.holder_id.length) && !(0, import_utils2.isWalkIn)((_c2 = (_b2 = state.client) == null ? void 0 : _b2.value) == null ? void 0 : _c2.id) && ((_g2 = (_f2 = (_e2 = (_d2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _d2.config) == null ? void 0 : _e2.basic) == null ? void 0 : _f2.appointment_subject) == null ? void 0 : _g2.show_hold_on_add_cart) !== 0) {
253
+ const res = await handleAddHolder(cacheItem);
254
+ if (res && res.length > 0) {
255
+ cacheItem._extend.holder_id = res;
256
+ } else {
257
+ if (((_j2 = (_i2 = (_h2 = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _h2.config) == null ? void 0 : _i2.basic) == null ? void 0 : _j2.subject_require) === "require") {
258
+ return;
358
259
  }
359
- })
360
- );
361
- console.timeEnd("executeServiceDispatch2");
362
- console.time("executeServiceDispatch3");
363
- logServiceForSpecificShop(item, detail, _list);
364
- stateRef.current = {
365
- ...stateRef.current,
366
- service: {
367
- ...stateRef.current.service,
368
- value: _list
369
260
  }
370
- };
371
- dispatch({
372
- type: "setService",
373
- payload: {
374
- addModal: false,
375
- value: _list,
376
- edit: true,
377
- changeService: false
261
+ }
262
+ if (stateRef.current.renderType === "eventBooking") {
263
+ cacheItem.autoClose = false;
264
+ }
265
+ if (cacheItem.autoClose) {
266
+ cacheItem.autoClose = false;
267
+ cacheItem._serviceKey = (0, import_utils6.genServiceKey)(cacheItem);
268
+ if (isMultiDay) {
269
+ await getMultiDayCacheItem();
378
270
  }
379
- });
380
- console.timeEnd("executeServiceDispatch3");
381
- console.timeEnd("executeServiceDispatch");
382
- delete pendingCacheValuesRef.current[productKey];
383
- delete clickCountRef.current[productKey];
384
- delete debounceTimersRef.current[productKey];
385
- });
386
- const processManualEditService = (0, import_ahooks.useMemoizedFn)((cacheItem) => {
387
- var _a2;
388
- (_a2 = window.openBookingEditModal) == null ? void 0 : _a2.call(window);
389
- dispatch({
390
- type: "setService",
391
- payload: {
392
- editModal: true,
271
+ let { list: _list, quantity } = (0, import_utils6.addService)(
272
+ [...stateRef.current.service.value],
393
273
  cacheItem,
394
- addModal: !cacheItem.autoClose,
395
- changeService: false
274
+ stateRef.current,
275
+ isMultiDay
276
+ );
277
+ if (!notShowToast) {
278
+ handleAddToast(cacheItem.title, quantity || 1);
396
279
  }
397
- });
398
- onEdit == null ? void 0 : onEdit(cacheItem);
399
- });
400
- const logServiceForSpecificShop = (0, import_ahooks.useMemoizedFn)((item, detail, _list) => {
401
- var _a2, _b2, _c2, _d2, _e2;
402
- try {
403
- if (((_e2 = (_d2 = (_c2 = (_b2 = (_a2 = context.appHelper.utils.store) == null ? void 0 : _a2.getState) == null ? void 0 : _b2.call(_a2)) == null ? void 0 : _c2.global) == null ? void 0 : _d2.globalConfig) == null ? void 0 : _e2.id) === 2155) {
404
- const val = _list == null ? void 0 : _list.map((s) => {
405
- return {
406
- product_id: s == null ? void 0 : s.product_id,
407
- detailId: s == null ? void 0 : s.id,
408
- detailProductId: s == null ? void 0 : s.product_id,
409
- product_name: s == null ? void 0 : s.title,
410
- price: s == null ? void 0 : s.price,
411
- _id: s == null ? void 0 : s._id,
412
- _key: s == null ? void 0 : s._key,
413
- _serviceKey: s == null ? void 0 : s._serviceKey
280
+ window.dispatchEvent(
281
+ new CustomEvent("onAddNewService", {
282
+ detail: {
283
+ cacheItem
284
+ }
285
+ })
286
+ );
287
+ try {
288
+ if (((_o = (_n = (_m = (_l2 = (_k2 = context.appHelper.utils.store) == null ? void 0 : _k2.getState) == null ? void 0 : _l2.call(_k2)) == null ? void 0 : _m.global) == null ? void 0 : _n.globalConfig) == null ? void 0 : _o.id) === 2155) {
289
+ const val = _list == null ? void 0 : _list.map((s) => {
290
+ return {
291
+ product_id: s == null ? void 0 : s.product_id,
292
+ detailId: s == null ? void 0 : s.id,
293
+ detailProductId: s == null ? void 0 : s.product_id,
294
+ product_name: s == null ? void 0 : s.title,
295
+ price: s == null ? void 0 : s.price,
296
+ _id: s == null ? void 0 : s._id,
297
+ _key: s == null ? void 0 : s._key,
298
+ _serviceKey: s == null ? void 0 : s._serviceKey
299
+ };
300
+ });
301
+ const sendData = {
302
+ product_id: item == null ? void 0 : item.id,
303
+ detailId: _detail == null ? void 0 : _detail.id,
304
+ detailProductId: _detail == null ? void 0 : _detail.product_id,
305
+ product_name: item == null ? void 0 : item.title,
306
+ price: _detail == null ? void 0 : _detail.price,
307
+ serviceVal: val
414
308
  };
415
- });
416
- const sendData = {
417
- product_id: item == null ? void 0 : item.id,
418
- detailId: detail == null ? void 0 : detail.id,
419
- detailProductId: detail == null ? void 0 : detail.product_id,
420
- product_name: item == null ? void 0 : item.title,
421
- price: detail == null ? void 0 : detail.price,
422
- serviceVal: val
423
- };
424
- (0, import_utils.sendWarningLog)({
425
- title: "addService",
426
- content: [
427
- { key: "添加数据", value: JSON.stringify(sendData) },
428
- {
429
- key: "日期",
430
- value: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm:ss")
431
- }
432
- ]
433
- });
309
+ (0, import_utils.sendWarningLog)({
310
+ title: "addService",
311
+ content: [
312
+ { key: "添加数据", value: JSON.stringify(sendData) },
313
+ {
314
+ key: "日期",
315
+ value: (0, import_dayjs.default)().format("YYYY-MM-DD HH:mm:ss")
316
+ }
317
+ ]
318
+ });
319
+ }
320
+ } catch (error) {
434
321
  }
435
- } catch (error) {
436
- }
437
- });
438
- const handleBookingCreation = (0, import_ahooks.useMemoizedFn)(async (item, params, detail) => {
439
- const data = await createBookingData({
440
- product: { ...detail || item, _params: params }
441
- });
442
- createBooking({ booking: data });
443
- });
444
- const handleBooking4Service = (0, import_ahooks.useMemoizedFn)((item, params, detail, notShowToast) => {
445
- const cacheItem = createCacheItemFromParams(item, params, detail);
446
- if (cacheItem.autoClose) {
447
- processAutoCloseService(cacheItem, item, detail, notShowToast);
322
+ dispatch({
323
+ type: "setService",
324
+ payload: {
325
+ addModal: false,
326
+ value: _list,
327
+ edit: true,
328
+ changeService: false
329
+ }
330
+ });
448
331
  } else {
449
- processManualEditService(cacheItem);
332
+ (_p = window.openBookingEditModal) == null ? void 0 : _p.call(window);
333
+ if (isMultiDay) {
334
+ await getMultiDayCacheItem(true);
335
+ }
336
+ dispatch({
337
+ type: "setService",
338
+ payload: {
339
+ editModal: true,
340
+ cacheItem,
341
+ addModal: !cacheItem.autoClose,
342
+ changeService: false
343
+ }
344
+ });
345
+ onEdit == null ? void 0 : onEdit(cacheItem);
450
346
  }
451
347
  });
452
- const handleDirectAddService = (0, import_ahooks.useMemoizedFn)(async (item) => {
453
- console.log(item, "handleSelectProduct33", "_list_list");
454
- if (!isBooking4) {
455
- await handleBookingCreation(item, item.cartDetailValue);
456
- return;
457
- }
458
- console.time("createCacheItemFromParams");
459
- const cacheItem = createCacheItemFromParams(item, item.cartDetailValue);
460
- console.timeEnd("createCacheItemFromParams");
461
- if (cacheItem.autoClose) {
462
- console.time("processAutoCloseService");
463
- processAutoCloseService(cacheItem, item, item, false);
464
- console.timeEnd("processAutoCloseService");
465
- } else {
466
- processManualEditService(cacheItem);
348
+ const handleMultiDayConfirm = (0, import_ahooks.useMemoizedFn)(async (startDate, endDate, duration) => {
349
+ if (!pendingMultiDayData) return;
350
+ setMultiDayModalLoading(true);
351
+ try {
352
+ const { item, detail, e, notShowToast } = pendingMultiDayData;
353
+ await processAddService(item, detail, e, notShowToast, startDate, endDate);
354
+ setPendingMultiDayData(null);
355
+ setMultiDayModalOpen(false);
356
+ } catch (error) {
357
+ console.error("添加跨日商品失败:", error);
358
+ } finally {
359
+ setMultiDayModalLoading(false);
467
360
  }
468
361
  });
469
- const createProductModalCallback = (0, import_ahooks.useMemoizedFn)((item) => {
470
- return async (e, extension_type, detail, notShowToast) => {
471
- setCurrentProduct(null);
472
- if (!isBooking4) {
473
- await handleBookingCreation(item, e, detail);
474
- return;
475
- }
476
- handleBooking4Service(item, e, detail, notShowToast);
477
- };
362
+ const handleMultiDayCancel = (0, import_ahooks.useMemoizedFn)(() => {
363
+ setMultiDayModalOpen(false);
364
+ setPendingMultiDayData(null);
478
365
  });
479
- const openProductModal = (0, import_ahooks.useMemoizedFn)((item, type = "select") => {
480
- const isSession = (0, import_utils2.isSessionProduct)(item);
481
- const isOnlySession = (0, import_utils2.getIsOnlySession)(item);
482
- const isEject = (0, import_utils2.getIsEject)(item, type);
483
- state.action({
484
- type: "pisell1.handleOpenProductModal",
485
- data: {
486
- id: item.id,
487
- date: state.date.value.format("YYYY-MM-DD"),
488
- productDetail: item,
489
- showConfig: {
490
- option: true,
491
- session: isSession,
492
- variant: true,
493
- package: true,
494
- number: (0, import_utils6.getIsShowNumber)(item, state)
495
- },
496
- isOnlySession,
497
- is_eject: isEject ? 1 : 0,
498
- customer_id: customerId,
499
- isOS: isSession
500
- },
501
- onCancel: () => {
502
- setCurrentProduct(null);
503
- },
504
- callback: createProductModalCallback(item)
366
+ const handleAddHolder = (0, import_ahooks.useMemoizedFn)(async (cacheItem) => {
367
+ var _a2, _b2, _c2;
368
+ const holderConfig = ((_b2 = (_a2 = stateRef.current) == null ? void 0 : _a2.bookingConfig) == null ? void 0 : _b2.holder) || {};
369
+ const currentMaxSelectedCount = (holderConfig == null ? void 0 : holderConfig.maxSelectedCount) || ((_c2 = cacheItem == null ? void 0 : cacheItem._extend) == null ? void 0 : _c2.quantity) || 1;
370
+ const result = await (0, import_selectHolderModal.selectHolderModal)({
371
+ state: stateRef.current,
372
+ dispatch,
373
+ maxSelectedCount: currentMaxSelectedCount
505
374
  });
375
+ return result;
506
376
  });
507
377
  const handleSelectProduct = (0, import_ahooks.useMemoizedFn)(
508
- async (item, type = "select") => {
509
- console.time("handleSelectProduct2");
510
- console.log(item, "handleSelectProduct");
511
- console.time("checkResourceAvailability");
512
- if (!checkResourceAvailability(item)) {
513
- return;
378
+ (item, type = "select") => {
379
+ var _a2, _b2, _c2, _d2;
380
+ if (!(0, import_utils4.isNormalProductByDurationSchedule)(item)) {
381
+ if (!Array.isArray((_a2 = state.service) == null ? void 0 : _a2.resourcesOrigin) || !state.service.resourcesOrigin.length) {
382
+ dispatch({
383
+ type: "setService",
384
+ payload: {
385
+ ...stateRef.current.service,
386
+ reloadResourceModal: true
387
+ }
388
+ });
389
+ return;
390
+ }
514
391
  }
515
- console.timeEnd("checkResourceAvailability");
516
- if (!item.isOpenDetailModal && item.cartDetailValue) {
517
- await handleDirectAddService(item);
392
+ const isSession = (0, import_utils2.isSessionProduct)(item);
393
+ const isEject = (0, import_utils2.getIsEject)(item, type);
394
+ const isOnlySession = (0, import_utils2.getIsOnlySession)(item);
395
+ let lock = false;
396
+ let cacheValues = null;
397
+ if (isEject) {
398
+ setCurrentProduct(item);
399
+ } else {
400
+ setCurrentProduct(null);
401
+ if ((item == null ? void 0 : item.extension_type) === "normal") {
402
+ cacheValues = {
403
+ bundle: [],
404
+ key: item.id,
405
+ option: [],
406
+ product_id: item.id,
407
+ product_variant_id: 0,
408
+ quantity: 1,
409
+ rowKey: item.id,
410
+ session: null,
411
+ unique: "08974625397",
412
+ _originalItem: item
413
+ // 保存原始商品信息
414
+ };
415
+ }
416
+ }
417
+ const callback = async (e, extension_type, detail, notShowToast) => {
418
+ debugger;
419
+ setCurrentProduct(null);
420
+ if (lock) {
421
+ return;
422
+ }
423
+ lock = true;
424
+ setTimeout(() => {
425
+ lock = false;
426
+ }, 2e3);
427
+ if (!isBooking4) {
428
+ const data = await createBookingData({
429
+ product: { ...detail || item, _params: e }
430
+ });
431
+ createBooking({ booking: data });
432
+ return;
433
+ }
434
+ const _detail = detail || item;
435
+ const isMultiDay = (0, import_utils3.isMultiDayProduct)(_detail || item);
436
+ if (isMultiDay) {
437
+ setPendingMultiDayData({
438
+ item,
439
+ detail: _detail,
440
+ e,
441
+ notShowToast
442
+ });
443
+ setMultiDayModalOpen(true);
444
+ return;
445
+ }
446
+ await processAddService(item, _detail, e, notShowToast, state.date.value);
447
+ };
448
+ if (cacheValues) {
449
+ const productId = item.id.toString();
450
+ if (pendingCacheValuesRef.current[productId]) {
451
+ clickCountRef.current[productId] = (clickCountRef.current[productId] || 1) + 1;
452
+ } else {
453
+ pendingCacheValuesRef.current[productId] = cacheValues;
454
+ clickCountRef.current[productId] = 1;
455
+ }
456
+ const cacheItem = (0, import_utils6.createSimpleCacheItem)(item, cacheValues, state);
457
+ const detail = (_b2 = stateRef.current.service.value) == null ? void 0 : _b2.find(
458
+ (val) => (0, import_utils6.isSameProduct)(val, cacheItem)
459
+ );
460
+ const originalQuantity = ((_c2 = detail == null ? void 0 : detail._extend) == null ? void 0 : _c2.quantity) || 0;
461
+ (_d2 = Toast == null ? void 0 : Toast.success) == null ? void 0 : _d2.call(
462
+ Toast,
463
+ /* @__PURE__ */ import_react.default.createElement("div", { className: "add-toast-wrap" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "add-toast-title" }, item.title), /* @__PURE__ */ import_react.default.createElement("div", { className: "add-toast-quantity" }, import_utils.locales.getText("pisell2.ticket-booking.in-cart")(
464
+ (clickCountRef.current[productId] || 1) + originalQuantity
465
+ )))
466
+ );
467
+ debouncedExecuteCacheValues(productId, cacheValues, item, callback);
518
468
  return;
519
469
  }
520
- openProductModal(item, type);
470
+ state.action({
471
+ type: "pisell1.handleOpenProductModal",
472
+ data: {
473
+ id: item.id,
474
+ date: state.date.value.format("YYYY-MM-DD"),
475
+ showConfig: {
476
+ option: true,
477
+ session: isSession,
478
+ variant: true,
479
+ package: true,
480
+ number: (0, import_utils6.getIsShowNumber)(item, state)
481
+ },
482
+ isOnlySession,
483
+ is_eject: isEject ? 1 : 0,
484
+ customer_id: customerId,
485
+ isOS: isSession
486
+ },
487
+ onCancel: () => {
488
+ setCurrentProduct(null);
489
+ },
490
+ callback
491
+ });
521
492
  }
522
493
  );
523
494
  const renderList = (0, import_react.useMemo)(() => {
524
495
  let _list = products || [];
525
- if ((0, import_utils4.isDaysBooking)(state)) {
526
- if (!(0, import_utils4.holderId)(state)) {
527
- _list = _list.filter(
528
- (item) => (0, import_utils4.isNormalProductByDurationSchedule)(item)
529
- );
530
- }
531
- }
532
496
  return _list;
533
497
  }, [products, state == null ? void 0 : state.activeCartId]);
534
498
  const currentDate = (0, import_react.useMemo)(() => {
@@ -538,20 +502,7 @@ var AddSerivce = (props) => {
538
502
  return state.date.value.format("YYYY-MM-DD HH:mm:ss");
539
503
  }, [state.date.value]);
540
504
  (0, import_react.useEffect)(() => {
541
- if (renderMode === "current" && state.bookingConfig && platform !== "shop") {
542
- getProducts({
543
- schedule_date: currentDate,
544
- customer_id: customerId,
545
- menu_list_ids: menuList,
546
- schedule_datetime: currentDatetime
547
- });
548
- getScheduleTimePoints({
549
- menu_list_ids: menuList
550
- });
551
- }
552
- }, [renderMode, customerId, menuList]);
553
- (0, import_react.useEffect)(() => {
554
- if (renderMode === "current" && state.bookingConfig && platform === "shop") {
505
+ if (renderMode === "current" && state.bookingConfig) {
555
506
  getProducts({
556
507
  schedule_date: currentDate,
557
508
  customer_id: customerId,
@@ -576,6 +527,7 @@ var AddSerivce = (props) => {
576
527
  return resolvedConfig;
577
528
  }, [productDisplayConfig]);
578
529
  return (0, import_react.useMemo)(() => {
530
+ var _a2;
579
531
  if (renderMode === "current") {
580
532
  return /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement(
581
533
  import_ProductDisplayAdapter.default,
@@ -586,7 +538,18 @@ var AddSerivce = (props) => {
586
538
  currentProductId: currentProduct == null ? void 0 : currentProduct.id,
587
539
  onSelectProduct: handleSelectProduct
588
540
  }
589
- ), /* @__PURE__ */ import_react.default.createElement(import_notAvailable.default, { ref: notAvailableRef }));
541
+ ), /* @__PURE__ */ import_react.default.createElement(import_notAvailable.default, { ref: notAvailableRef }), /* @__PURE__ */ import_react.default.createElement(
542
+ import_MultiDayTimeSelectModal.default,
543
+ {
544
+ open: multiDayModalOpen,
545
+ productName: (_a2 = pendingMultiDayData == null ? void 0 : pendingMultiDayData.item) == null ? void 0 : _a2.title,
546
+ locale: state == null ? void 0 : state.locale,
547
+ defaultStartDate: state.date.value,
548
+ loading: multiDayModalLoading,
549
+ onConfirm: handleMultiDayConfirm,
550
+ onCancel: handleMultiDayCancel
551
+ }
552
+ ), /* @__PURE__ */ import_react.default.createElement(import_selectHolderModal.SelectHolderModal, null));
590
553
  }
591
554
  return null;
592
555
  }, [
@@ -601,7 +564,10 @@ var AddSerivce = (props) => {
601
564
  loading,
602
565
  currentProduct,
603
566
  isBooking4,
604
- finalDisplayConfig
567
+ finalDisplayConfig,
568
+ multiDayModalOpen,
569
+ pendingMultiDayData,
570
+ multiDayModalLoading
605
571
  ]);
606
572
  };
607
573
  var addService_default = AddSerivce;