@pisell/private-materials 3.0.203 → 3.0.204

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 (292) 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 +142 -142
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +27 -12
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +33 -18
  11. package/es/components/booking/components/customSelect/index.d.ts +0 -1
  12. package/es/components/booking/components/customSelect/index.js +2 -6
  13. package/es/components/booking/components/footer/amount.js +22 -46
  14. package/es/components/booking/components/footer/index.js +40 -84
  15. package/es/components/booking/components/footer/utils.js +35 -266
  16. package/es/components/booking/forms/model.d.ts +1 -1
  17. package/es/components/booking/info/addServiceVariant/index.js +1 -8
  18. package/es/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +0 -1
  19. package/es/components/booking/info/clientVariant/vertical/SelectDrawer.js +13 -14
  20. package/es/components/booking/info/clientVariant/vertical/index.js +9 -124
  21. package/es/components/booking/info/main.js +15 -28
  22. package/es/components/booking/info/model.js +0 -3
  23. package/es/components/booking/info/pet/index.js +5 -54
  24. package/es/components/booking/info/service/addService/index.js +96 -187
  25. package/es/components/booking/info/service/addService/index.less +3 -13
  26. package/es/components/booking/info/service/addService/utils.d.ts +2 -12
  27. package/es/components/booking/info/service/addService/utils.js +26 -103
  28. package/es/components/booking/info/service/editService/index.js +132 -435
  29. package/es/components/booking/info/service/editService/index.less +13 -18
  30. package/es/components/booking/info/service/serve.d.ts +0 -10
  31. package/es/components/booking/info/service/serve.js +0 -28
  32. package/es/components/booking/info/utils.d.ts +0 -20
  33. package/es/components/booking/info/utils.js +0 -37
  34. package/es/components/booking/locales.d.ts +0 -66
  35. package/es/components/booking/locales.js +3 -81
  36. package/es/components/booking/model.d.ts +1 -5
  37. package/es/components/booking/model.js +2 -4
  38. package/es/components/booking/notes/index.d.ts +1 -1
  39. package/es/components/booking/notes/model.d.ts +1 -1
  40. package/es/components/booking/payments/model.d.ts +1 -1
  41. package/es/components/booking/utils.d.ts +3 -12
  42. package/es/components/booking/utils.js +26 -143
  43. package/es/components/eftpos/form/index.js +12 -6
  44. package/es/components/eftpos/group/index.d.ts +1 -2
  45. package/es/components/eftpos/group/index.js +1 -2
  46. package/es/components/eftpos/hooks.d.ts +4 -4
  47. package/es/components/eftpos/index.js +2 -2
  48. package/es/components/eftpos/receipt/index.d.ts +24 -0
  49. package/es/components/eftpos/receipt/index.js +96 -0
  50. package/es/components/eftposPay/app.d.ts +11 -0
  51. package/es/components/eftposPay/app.js +173 -0
  52. package/es/components/eftposPay/component/fail/failCustom.js +1 -0
  53. package/es/components/eftposPay/component/fail/index.js +1 -0
  54. package/es/components/eftposPay/component/manual/index.js +4 -1
  55. package/es/components/eftposPay/component/step/index.d.ts +6 -6
  56. package/es/components/eftposPay/component/step/step.d.ts +4 -4
  57. package/es/components/eftposPay/const.d.ts +27 -1
  58. package/es/components/eftposPay/const.js +22 -0
  59. package/es/components/eftposPay/device.d.ts +1 -1
  60. package/es/components/eftposPay/device.js +2 -2
  61. package/es/components/eftposPay/helper.d.ts +6 -0
  62. package/es/components/eftposPay/helper.js +24 -4
  63. package/es/components/eftposPay/hooks.d.ts +2 -1
  64. package/es/components/eftposPay/hooks.js +22 -16
  65. package/es/components/eftposPay/index.d.ts +1 -1
  66. package/es/components/eftposPay/index.js +130 -179
  67. package/es/components/eftposPay/locales.d.ts +15 -0
  68. package/es/components/eftposPay/locales.js +15 -0
  69. package/es/components/eftposPay/payo/config.js +20 -8
  70. package/es/components/eftposPay/store/index.d.ts +1 -1
  71. package/es/components/eftposPay/tip.d.ts +10 -0
  72. package/es/components/eftposPay/tip.js +177 -0
  73. package/es/components/eftposPay/tip.less +9 -0
  74. package/es/components/eftposPay/tyro/hooks.d.ts +2 -2
  75. package/es/components/eftposPay/tyro/index.js +55 -22
  76. package/es/components/eftposPay/windcave/helper.d.ts +1 -1
  77. package/es/components/eftposPay/windcave/windcave.js +17 -6
  78. package/es/components/schedules/index.d.ts +1 -1
  79. package/es/components/schedules/model.d.ts +1 -1
  80. package/es/index.d.ts +0 -1
  81. package/es/index.js +1 -2
  82. package/lib/components/booking/components/customSelect/index.d.ts +0 -1
  83. package/lib/components/booking/components/customSelect/index.js +2 -6
  84. package/lib/components/booking/components/footer/amount.js +8 -27
  85. package/lib/components/booking/components/footer/index.js +4 -25
  86. package/lib/components/booking/components/footer/utils.js +35 -161
  87. package/lib/components/booking/forms/model.d.ts +1 -1
  88. package/lib/components/booking/info/addServiceVariant/index.js +0 -5
  89. package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.d.ts +0 -1
  90. package/lib/components/booking/info/clientVariant/vertical/SelectDrawer.js +7 -8
  91. package/lib/components/booking/info/clientVariant/vertical/index.js +11 -87
  92. package/lib/components/booking/info/main.js +9 -17
  93. package/lib/components/booking/info/model.js +0 -3
  94. package/lib/components/booking/info/pet/index.js +25 -61
  95. package/lib/components/booking/info/service/addService/index.js +84 -115
  96. package/lib/components/booking/info/service/addService/index.less +3 -13
  97. package/lib/components/booking/info/service/addService/utils.d.ts +2 -12
  98. package/lib/components/booking/info/service/addService/utils.js +10 -58
  99. package/lib/components/booking/info/service/editService/index.js +182 -425
  100. package/lib/components/booking/info/service/editService/index.less +13 -18
  101. package/lib/components/booking/info/service/serve.d.ts +0 -10
  102. package/lib/components/booking/info/service/serve.js +2 -7
  103. package/lib/components/booking/info/utils.d.ts +0 -20
  104. package/lib/components/booking/info/utils.js +0 -41
  105. package/lib/components/booking/locales.d.ts +0 -66
  106. package/lib/components/booking/locales.js +3 -69
  107. package/lib/components/booking/model.d.ts +1 -5
  108. package/lib/components/booking/model.js +2 -4
  109. package/lib/components/booking/notes/index.d.ts +1 -1
  110. package/lib/components/booking/notes/model.d.ts +1 -1
  111. package/lib/components/booking/payments/model.d.ts +1 -1
  112. package/lib/components/booking/utils.d.ts +3 -12
  113. package/lib/components/booking/utils.js +18 -89
  114. package/lib/components/eftpos/form/index.js +12 -6
  115. package/lib/components/eftpos/group/index.d.ts +1 -2
  116. package/lib/components/eftpos/group/index.js +0 -1
  117. package/lib/components/eftpos/hooks.d.ts +4 -4
  118. package/lib/components/eftpos/index.js +2 -2
  119. package/lib/components/eftpos/receipt/index.d.ts +24 -0
  120. package/lib/components/eftpos/receipt/index.js +88 -0
  121. package/lib/components/eftposPay/app.d.ts +11 -0
  122. package/lib/components/eftposPay/app.js +166 -0
  123. package/lib/components/eftposPay/component/fail/failCustom.js +1 -1
  124. package/lib/components/eftposPay/component/fail/index.js +1 -1
  125. package/lib/components/eftposPay/component/manual/index.js +19 -5
  126. package/lib/components/eftposPay/component/step/index.d.ts +6 -6
  127. package/lib/components/eftposPay/component/step/step.d.ts +4 -4
  128. package/lib/components/eftposPay/const.d.ts +27 -1
  129. package/lib/components/eftposPay/const.js +18 -0
  130. package/lib/components/eftposPay/device.d.ts +1 -1
  131. package/lib/components/eftposPay/device.js +2 -2
  132. package/lib/components/eftposPay/helper.d.ts +6 -0
  133. package/lib/components/eftposPay/helper.js +29 -4
  134. package/lib/components/eftposPay/hooks.d.ts +2 -1
  135. package/lib/components/eftposPay/hooks.js +8 -2
  136. package/lib/components/eftposPay/index.d.ts +1 -1
  137. package/lib/components/eftposPay/index.js +106 -144
  138. package/lib/components/eftposPay/locales.d.ts +15 -0
  139. package/lib/components/eftposPay/locales.js +15 -0
  140. package/lib/components/eftposPay/payo/config.js +33 -9
  141. package/lib/components/eftposPay/store/index.d.ts +1 -1
  142. package/lib/components/eftposPay/tip.d.ts +10 -0
  143. package/lib/components/eftposPay/tip.js +159 -0
  144. package/lib/components/eftposPay/tip.less +9 -0
  145. package/lib/components/eftposPay/tyro/hooks.d.ts +2 -2
  146. package/lib/components/eftposPay/tyro/index.js +40 -9
  147. package/lib/components/eftposPay/windcave/helper.d.ts +1 -1
  148. package/lib/components/eftposPay/windcave/windcave.js +29 -6
  149. package/lib/components/schedules/index.d.ts +1 -1
  150. package/lib/components/schedules/model.d.ts +1 -1
  151. package/lib/index.d.ts +0 -1
  152. package/lib/index.js +0 -3
  153. package/package.json +5 -5
  154. package/es/components/booking/components/footer/AppointmentProductModal/index.d.ts +0 -3
  155. package/es/components/booking/components/footer/AppointmentProductModal/index.js +0 -38
  156. package/es/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
  157. package/es/components/booking/info/Provider.d.ts +0 -0
  158. package/es/components/booking/info/Provider.js +0 -54
  159. package/es/components/booking/info/dateRange/index.d.ts +0 -5
  160. package/es/components/booking/info/dateRange/index.js +0 -98
  161. package/es/components/booking/info/dateRange/index.less +0 -21
  162. package/es/components/booking/info/pet/ChangePetModal/index.d.ts +0 -4
  163. package/es/components/booking/info/pet/ChangePetModal/index.js +0 -134
  164. package/es/components/booking/info/pet/ChangePetModal/index.less +0 -4
  165. package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -5
  166. package/es/components/booking/info/service/editService/BookingList/index.js +0 -39
  167. package/es/components/booking/info/service/editService/EditTabs/index.d.ts +0 -3
  168. package/es/components/booking/info/service/editService/EditTabs/index.js +0 -35
  169. package/es/components/booking/info/service/serviceManager/distributeDiscount.d.ts +0 -11
  170. package/es/components/booking/info/service/serviceManager/distributeDiscount.js +0 -55
  171. package/es/components/booking/info/service/serviceManager/index.d.ts +0 -20
  172. package/es/components/booking/info/service/serviceManager/index.js +0 -277
  173. package/es/components/booking/info/service/serviceManager/utils.d.ts +0 -0
  174. package/es/components/booking/info/service/serviceManager/utils.js +0 -0
  175. package/es/components/booking/info/service2/Group/utils.d.ts +0 -14
  176. package/es/components/booking/info/service2/Group/utils.js +0 -146
  177. package/es/components/booking/info/service2/Lists.d.ts +0 -3
  178. package/es/components/booking/info/service2/Lists.js +0 -152
  179. package/es/components/booking/info/service2/hooks/useSelectPet.d.ts +0 -6
  180. package/es/components/booking/info/service2/hooks/useSelectPet.js +0 -54
  181. package/es/components/booking/info/service2/index.d.ts +0 -6
  182. package/es/components/booking/info/service2/index.js +0 -57
  183. package/es/components/booking/info/service2/status.d.ts +0 -31
  184. package/es/components/booking/info/service2/status.js +0 -78
  185. package/es/components/booking/info/service2/utils.d.ts +0 -237
  186. package/es/components/booking/info/service2/utils.js +0 -1064
  187. package/es/components/booking/materiels/holder/index.d.ts +0 -7
  188. package/es/components/booking/materiels/holder/index.js +0 -51
  189. package/es/components/shoppingCart/Provider.d.ts +0 -3
  190. package/es/components/shoppingCart/Provider.js +0 -86
  191. package/es/components/shoppingCart/components/Cart/Product.d.ts +0 -4
  192. package/es/components/shoppingCart/components/Cart/Product.js +0 -68
  193. package/es/components/shoppingCart/components/Cart/index.d.ts +0 -4
  194. package/es/components/shoppingCart/components/Cart/index.js +0 -72
  195. package/es/components/shoppingCart/components/Cart/index.less +0 -68
  196. package/es/components/shoppingCart/components/Empty/index.d.ts +0 -4
  197. package/es/components/shoppingCart/components/Empty/index.js +0 -14
  198. package/es/components/shoppingCart/components/Empty/index.less +0 -19
  199. package/es/components/shoppingCart/components/Render/index.d.ts +0 -4
  200. package/es/components/shoppingCart/components/Render/index.js +0 -69
  201. package/es/components/shoppingCart/components/Render/index.less +0 -2
  202. package/es/components/shoppingCart/components/SelectHolderModal/index.d.ts +0 -4
  203. package/es/components/shoppingCart/components/SelectHolderModal/index.js +0 -132
  204. package/es/components/shoppingCart/components/SelectHolderModal/index.less +0 -32
  205. package/es/components/shoppingCart/hooks/useAddService.d.ts +0 -3
  206. package/es/components/shoppingCart/hooks/useAddService.js +0 -23
  207. package/es/components/shoppingCart/hooks/useClearCart.d.ts +0 -3
  208. package/es/components/shoppingCart/hooks/useClearCart.js +0 -59
  209. package/es/components/shoppingCart/hooks/useContext.d.ts +0 -1
  210. package/es/components/shoppingCart/hooks/useContext.js +0 -5
  211. package/es/components/shoppingCart/index.d.ts +0 -4
  212. package/es/components/shoppingCart/index.js +0 -24
  213. package/es/components/shoppingCart/locales.d.ts +0 -33
  214. package/es/components/shoppingCart/locales.js +0 -38
  215. package/es/components/shoppingCart/mock.d.ts +0 -40
  216. package/es/components/shoppingCart/mock.js +0 -40
  217. package/es/components/shoppingCart/status.d.ts +0 -2
  218. package/es/components/shoppingCart/status.js +0 -22
  219. package/es/components/shoppingCart/type.d.ts +0 -39
  220. package/es/components/shoppingCart/type.js +0 -1
  221. package/es/components/shoppingCart/utils.d.ts +0 -63
  222. package/es/components/shoppingCart/utils.js +0 -116
  223. package/lib/components/booking/components/footer/AppointmentProductModal/index.d.ts +0 -3
  224. package/lib/components/booking/components/footer/AppointmentProductModal/index.js +0 -60
  225. package/lib/components/booking/components/footer/AppointmentProductModal/index.less +0 -0
  226. package/lib/components/booking/info/Provider.d.ts +0 -0
  227. package/lib/components/booking/info/Provider.js +0 -0
  228. package/lib/components/booking/info/dateRange/index.d.ts +0 -5
  229. package/lib/components/booking/info/dateRange/index.js +0 -111
  230. package/lib/components/booking/info/dateRange/index.less +0 -21
  231. package/lib/components/booking/info/pet/ChangePetModal/index.d.ts +0 -4
  232. package/lib/components/booking/info/pet/ChangePetModal/index.js +0 -121
  233. package/lib/components/booking/info/pet/ChangePetModal/index.less +0 -4
  234. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -5
  235. package/lib/components/booking/info/service/editService/BookingList/index.js +0 -55
  236. package/lib/components/booking/info/service/editService/EditTabs/index.d.ts +0 -3
  237. package/lib/components/booking/info/service/editService/EditTabs/index.js +0 -75
  238. package/lib/components/booking/info/service/serviceManager/distributeDiscount.d.ts +0 -11
  239. package/lib/components/booking/info/service/serviceManager/distributeDiscount.js +0 -70
  240. package/lib/components/booking/info/service/serviceManager/index.d.ts +0 -20
  241. package/lib/components/booking/info/service/serviceManager/index.js +0 -207
  242. package/lib/components/booking/info/service/serviceManager/utils.d.ts +0 -0
  243. package/lib/components/booking/info/service/serviceManager/utils.js +0 -0
  244. package/lib/components/booking/info/service2/Group/utils.d.ts +0 -14
  245. package/lib/components/booking/info/service2/Group/utils.js +0 -142
  246. package/lib/components/booking/info/service2/Lists.d.ts +0 -3
  247. package/lib/components/booking/info/service2/Lists.js +0 -115
  248. package/lib/components/booking/info/service2/hooks/useSelectPet.d.ts +0 -6
  249. package/lib/components/booking/info/service2/hooks/useSelectPet.js +0 -50
  250. package/lib/components/booking/info/service2/index.d.ts +0 -6
  251. package/lib/components/booking/info/service2/index.js +0 -75
  252. package/lib/components/booking/info/service2/status.d.ts +0 -31
  253. package/lib/components/booking/info/service2/status.js +0 -81
  254. package/lib/components/booking/info/service2/utils.d.ts +0 -237
  255. package/lib/components/booking/info/service2/utils.js +0 -678
  256. package/lib/components/booking/materiels/holder/index.d.ts +0 -7
  257. package/lib/components/booking/materiels/holder/index.js +0 -65
  258. package/lib/components/shoppingCart/Provider.d.ts +0 -3
  259. package/lib/components/shoppingCart/Provider.js +0 -110
  260. package/lib/components/shoppingCart/components/Cart/Product.d.ts +0 -4
  261. package/lib/components/shoppingCart/components/Cart/Product.js +0 -73
  262. package/lib/components/shoppingCart/components/Cart/index.d.ts +0 -4
  263. package/lib/components/shoppingCart/components/Cart/index.js +0 -77
  264. package/lib/components/shoppingCart/components/Cart/index.less +0 -68
  265. package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -4
  266. package/lib/components/shoppingCart/components/Empty/index.js +0 -43
  267. package/lib/components/shoppingCart/components/Empty/index.less +0 -19
  268. package/lib/components/shoppingCart/components/Render/index.d.ts +0 -4
  269. package/lib/components/shoppingCart/components/Render/index.js +0 -75
  270. package/lib/components/shoppingCart/components/Render/index.less +0 -2
  271. package/lib/components/shoppingCart/components/SelectHolderModal/index.d.ts +0 -4
  272. package/lib/components/shoppingCart/components/SelectHolderModal/index.js +0 -124
  273. package/lib/components/shoppingCart/components/SelectHolderModal/index.less +0 -32
  274. package/lib/components/shoppingCart/hooks/useAddService.d.ts +0 -3
  275. package/lib/components/shoppingCart/hooks/useAddService.js +0 -55
  276. package/lib/components/shoppingCart/hooks/useClearCart.d.ts +0 -3
  277. package/lib/components/shoppingCart/hooks/useClearCart.js +0 -66
  278. package/lib/components/shoppingCart/hooks/useContext.d.ts +0 -1
  279. package/lib/components/shoppingCart/hooks/useContext.js +0 -31
  280. package/lib/components/shoppingCart/index.d.ts +0 -4
  281. package/lib/components/shoppingCart/index.js +0 -60
  282. package/lib/components/shoppingCart/locales.d.ts +0 -33
  283. package/lib/components/shoppingCart/locales.js +0 -56
  284. package/lib/components/shoppingCart/mock.d.ts +0 -40
  285. package/lib/components/shoppingCart/mock.js +0 -76
  286. package/lib/components/shoppingCart/status.d.ts +0 -2
  287. package/lib/components/shoppingCart/status.js +0 -60
  288. package/lib/components/shoppingCart/type.d.ts +0 -39
  289. package/lib/components/shoppingCart/type.js +0 -17
  290. package/lib/components/shoppingCart/utils.d.ts +0 -63
  291. package/lib/components/shoppingCart/utils.js +0 -86
  292. package/lowcode/shopping-cart/meta.ts +0 -98
@@ -24,22 +24,18 @@ import Drawer from "../../../components/drawer";
24
24
  import TabProduct from "../../../components/TabProduct";
25
25
  import { Context } from "../../model";
26
26
  import AddButton from "../../../components/addButton";
27
- import { Input, Skeleton, Row, Col } from 'antd';
27
+ import { Input, Skeleton } from 'antd';
28
28
  import "./index.less";
29
29
  import useEngineContext from "../../../../../hooks/useEngineContext";
30
30
  import { getProductDetail } from "../serve";
31
31
  import { getIsBundleOrCombination } from "../../utils";
32
- import DateRange from "../../dateRange";
33
- import { formatProductListByCategory, request } from "../../../utils";
34
- import { isDayBooking, getDayProducts, holderId } from "../../service2/utils";
35
- import { inputDateCol, appointmentTypes } from "../../service2/status";
32
+ import { getProductExtend } from "./utils";
33
+ import { formatProductListByCategory, getProductTotalPrice, request } from "../../../utils";
36
34
  import { locales, getUniqueId } from '@pisell/utils';
37
35
  import { useMemoizedFn, useUpdateEffect } from 'ahooks';
38
- import debounce from 'lodash/debounce';
39
- import { useService } from "../serviceManager";
40
36
  var shopList = [2886, 4422, 5538, 6930, 6814, 6813, 6812, 6087, 6303, 6080, 6978, 7386, 6848, 6305];
41
37
  var Info = function Info(props) {
42
- var _state$client2, _state$client2$value, _state$service2, _state2, _state$service5, _state$service7, _state$service7$cache, _state3;
38
+ var _state$service3, _state$service6, _state$service8, _state$service8$cache;
43
39
  var onEdit = props.onEdit,
44
40
  drawerProps = props.drawerProps,
45
41
  renderMode = props.renderMode;
@@ -55,80 +51,10 @@ var Info = function Info(props) {
55
51
  loading = _useState4[0],
56
52
  setLoading = _useState4[1];
57
53
  var searchRef = useRef();
58
- // 头部高度
59
- var headerRef = useRef(null);
60
- var _useState5 = useState(0),
61
- _useState6 = _slicedToArray(_useState5, 2),
62
- headerHeight = _useState6[0],
63
- setHeaderHeight = _useState6[1];
64
54
  var context = useEngineContext();
65
55
  state = state || (props === null || props === void 0 ? void 0 : props.state);
66
56
  dispatch = dispatch || (props === null || props === void 0 ? void 0 : props.dispatch);
67
57
  request.setRequest(context.appHelper.utils.request);
68
- var _useService = useService({
69
- renderMode: renderMode,
70
- onEdit: onEdit,
71
- state: state,
72
- dispatch: dispatch
73
- }),
74
- createBookingData = _useService.createBookingData,
75
- createBooking = _useService.createBooking;
76
- /**
77
- * @title: 是否是跨日预约
78
- * @description:
79
- * @param {*} useMemo
80
- * @return {*}
81
- * @Author: WangHan
82
- * @Date: 2024-12-09 15:46
83
- */
84
- var isDay = useMemo(function () {
85
- return isDayBooking(state);
86
- }, [state.renderType]);
87
-
88
- /**
89
- * @title: 监听元素高度变化的函数
90
- * @description:
91
- * @return {*}
92
- * @Author: WangHan
93
- * @Date: 2024-12-10 17:13
94
- */
95
- var handleResize = function handleResize() {
96
- if (headerRef !== null && headerRef !== void 0 && headerRef.current) {
97
- var _headerRef$current;
98
- setHeaderHeight((_headerRef$current = headerRef.current) === null || _headerRef$current === void 0 ? void 0 : _headerRef$current.offsetHeight);
99
- }
100
- };
101
-
102
- // 使用防抖的监听函数
103
- var debouncedHandleResize = debounce(handleResize, 100);
104
- useEffect(function () {
105
- if (isDay && state.isTerminalDayBookingPage) {
106
- // 初始化时设置一次高度
107
- handleResize();
108
-
109
- // 添加窗口大小变化的监听器
110
- window.addEventListener('resize', debouncedHandleResize);
111
- }
112
-
113
- // 清理函数
114
- return function () {
115
- window.removeEventListener('resize', debouncedHandleResize);
116
- };
117
- }, [debouncedHandleResize]);
118
-
119
- /**
120
- * @title: 客户id
121
- * @description:
122
- * @param {*} useMemo
123
- * @return {*}
124
- * @Author: WangHan
125
- * @Date: 2024-12-24 10:33
126
- */
127
- var customerId = useMemo(function () {
128
- var _state$client, _state$client$value;
129
- if (!isDay) return undefined;
130
- return ((_state$client = state.client) === null || _state$client === void 0 ? void 0 : (_state$client$value = _state$client.value) === null || _state$client$value === void 0 ? void 0 : _state$client$value.id) || 1;
131
- }, [(_state$client2 = state.client) === null || _state$client2 === void 0 ? void 0 : (_state$client2$value = _state$client2.value) === null || _state$client2$value === void 0 ? void 0 : _state$client2$value.id, isDay]);
132
58
 
133
59
  /**
134
60
  * @title: 如果商品只有一个, 则自动设置默认商品
@@ -173,8 +99,7 @@ var Info = function Info(props) {
173
99
  product = list[0];
174
100
  _context.next = 13;
175
101
  return getProductDetail(product.id, {
176
- schedule_date: state.date.value.format('YYYY-MM-DD'),
177
- customer_id: customerId
102
+ schedule_date: state.date.value.format('YYYY-MM-DD')
178
103
  });
179
104
  case 13:
180
105
  detail = _context.sent;
@@ -195,7 +120,7 @@ var Info = function Info(props) {
195
120
  _extend: {
196
121
  start_date: state.date.value,
197
122
  startDate: state.date.value,
198
- endDate: isDay ? state.date.end_date : state.date.value,
123
+ endDate: state.date.value,
199
124
  start_time: '00:00:00',
200
125
  duration: 10,
201
126
  quantity: 1,
@@ -226,7 +151,7 @@ var Info = function Info(props) {
226
151
  var getServices = /*#__PURE__*/function () {
227
152
  var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
228
153
  var _state$eventOtherPara, _state$eventOtherPara2, _state$eventOtherPara3;
229
- var dayParams, data, lists, _state, id;
154
+ var data;
230
155
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
231
156
  while (1) switch (_context2.prev = _context2.next) {
232
157
  case 0:
@@ -245,13 +170,8 @@ var Info = function Info(props) {
245
170
  setLoading(false);
246
171
  return _context2.abrupt("return");
247
172
  case 5:
248
- dayParams = {}; // 跨日预约
249
- if (isDay) {
250
- dayParams.extension_type = ['normal', 'product_appointment'];
251
- dayParams.customer_id = customerId;
252
- }
253
- _context2.next = 9;
254
- return state.apis.getServices(_objectSpread(_objectSpread({
173
+ _context2.next = 7;
174
+ return state.apis.getServices(_objectSpread({
255
175
  skip: 1,
256
176
  num: 500,
257
177
  extension_type: state.renderType === 'eventBooking' ? undefined : ['product_appointment', 'appointment_ticket'],
@@ -268,27 +188,22 @@ var Info = function Info(props) {
268
188
  _config: {
269
189
  useCache: true
270
190
  }
271
- }), dayParams));
272
- case 9:
191
+ }));
192
+ case 7:
273
193
  data = _context2.sent;
274
194
  setLoading(false);
275
- lists = (data === null || data === void 0 ? void 0 : data.list) || []; // 跨日预约过滤商品列表
276
- if (isDay) {
277
- id = holderId(state);
278
- lists = getDayProducts(id, lists, (_state = state) === null || _state === void 0 ? void 0 : _state.isTerminalDayBookingPage);
279
- }
280
195
 
281
196
  // 只有自动获取列表的时候才设置商品, 手动点击添加按钮的时候不设置
282
197
  if (!state.service.addModal) {
283
- setDefaultService(lists);
198
+ setDefaultService(data === null || data === void 0 ? void 0 : data.list);
284
199
  }
285
200
  dispatch({
286
201
  type: 'setService',
287
202
  payload: {
288
- services: lists
203
+ services: (data === null || data === void 0 ? void 0 : data.list) || []
289
204
  }
290
205
  });
291
- case 15:
206
+ case 11:
292
207
  case "end":
293
208
  return _context2.stop();
294
209
  }
@@ -315,94 +230,112 @@ var Info = function Info(props) {
315
230
  var handleSelectProduct = useMemoizedFn(function (item, type) {
316
231
  // 是否有单规格 组合规格 套餐, 如果没有不需要打开弹窗
317
232
  var isEject = type === 'detail' || item.bundle_group_count > 0;
318
-
319
- // 跨日预约开启单规格 组合规格 套餐
320
- if (isDay) {
321
- isEject = type === 'detail' || item.bundle_group_count > 0 || item.option_group_count > 0 || item.is_variant > 0;
322
- }
233
+ var lock = false;
323
234
  state.action({
324
235
  type: 'pisell1.handleOpenProductModal',
325
236
  data: {
326
237
  id: item.id,
327
238
  date: state.date.value.format('YYYY-MM-DD'),
328
239
  showConfig: {
329
- option: isDay ? true : false,
240
+ option: false,
330
241
  session: false,
331
- variant: isDay ? true : false,
242
+ variant: false,
332
243
  package: true
333
244
  },
334
- is_eject: isEject ? 1 : 0,
335
- customer_id: customerId
245
+ is_eject: isEject ? 1 : 0
336
246
  },
337
- callback: function () {
338
- var _callback = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(e) {
339
- var data;
340
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
341
- while (1) switch (_context3.prev = _context3.next) {
342
- case 0:
343
- _context3.next = 2;
344
- return createBookingData({
345
- product: _objectSpread(_objectSpread({}, item), {}, {
346
- _params: e
347
- })
348
- });
349
- case 2:
350
- data = _context3.sent;
351
- // 创建预约
352
- createBooking({
353
- booking: data
354
- });
355
- case 4:
356
- case "end":
357
- return _context3.stop();
358
- }
359
- }, _callee3);
360
- }));
361
- function callback(_x4) {
362
- return _callback.apply(this, arguments);
247
+ callback: function callback(e) {
248
+ // 防止选择商品弹窗多次触发callback
249
+ if (lock) {
250
+ return;
363
251
  }
364
- return callback;
365
- }()
366
- });
367
- });
368
- var renderList = useMemo(function () {
369
- var _state$service;
370
- var _list = ((_state$service = state.service) === null || _state$service === void 0 ? void 0 : _state$service.services) || [];
252
+ lock = true;
371
253
 
372
- // 跨日预约
373
- if (isDay) {
374
- // 公共购物车下过滤掉预约商品
375
- if (!holderId(state)) {
376
- _list = _list.filter(function (item) {
377
- return !appointmentTypes.includes(item.extension_type);
254
+ // 2秒后解除
255
+ setTimeout(function () {
256
+ lock = false;
257
+ }, 2000);
258
+ var cacheItem = _objectSpread(_objectSpread({}, item), {}, {
259
+ product_id: item.id,
260
+ _id: getUniqueId(),
261
+ _key: e.key,
262
+ _extend: {
263
+ start_date: state.date.value,
264
+ quantity: 1,
265
+ price: item.price,
266
+ product_name: item.title,
267
+ other: JSON.parse(JSON.stringify(e))
268
+ },
269
+ new: 1
270
+ });
271
+ var _total = getProductTotalPrice(cacheItem);
272
+ // 用于折扣 可修改
273
+ cacheItem._extend.total = _total;
274
+ // 用于储存原价
275
+ cacheItem._extend.origin_total = _total;
276
+ var _isEdit = !!state.service.cacheItem;
277
+ if (_isEdit) {
278
+ var _state$service$cacheI;
279
+ cacheItem._id = (_state$service$cacheI = state.service.cacheItem) === null || _state$service$cacheI === void 0 ? void 0 : _state$service$cacheI._id;
280
+ cacheItem.new = 0;
281
+ }
282
+ // 渲染到当前位置模式时,默认无资源 时间默认取顶部设置的时间
283
+ if (renderMode === 'current') {
284
+ // cacheItem._extend.resource = 0;
285
+ cacheItem.currentDefaultTime = state.date.value.format('HH:mm');
286
+ }
287
+ cacheItem._extend = getProductExtend({
288
+ cacheItem: cacheItem,
289
+ state: state
290
+ });
291
+ if (state.renderType === 'eventBooking') {
292
+ cacheItem.autoClose = false;
293
+ } else {
294
+ var _state$service;
295
+ cacheItem.autoClose = !_isEdit && (cacheItem._extend.resource || cacheItem._extend.resource === 0 || (((_state$service = state.service) === null || _state$service === void 0 ? void 0 : _state$service.resourcesOrigin) || []).length === 1);
296
+ }
297
+ dispatch({
298
+ type: 'setService',
299
+ payload: {
300
+ editModal: true,
301
+ cacheItem: cacheItem,
302
+ addModal: !cacheItem.autoClose,
303
+ changeService: false
304
+ }
378
305
  });
306
+ onEdit === null || onEdit === void 0 ? void 0 : onEdit(cacheItem);
379
307
  }
380
- }
308
+ });
309
+ });
310
+ var renderList = useMemo(function () {
311
+ var _state$service2;
312
+ var _list = ((_state$service2 = state.service) === null || _state$service2 === void 0 ? void 0 : _state$service2.services) || [];
381
313
  var isIncludes = function isIncludes(str) {
382
314
  return str.toLowerCase().indexOf(search.toLowerCase()) !== -1;
383
315
  };
384
316
  return formatProductListByCategory(_list, search ? function (item) {
385
317
  return isIncludes(item.title);
386
318
  } : undefined);
387
- }, [search, (_state$service2 = state.service) === null || _state$service2 === void 0 ? void 0 : _state$service2.services, (_state2 = state) === null || _state2 === void 0 ? void 0 : _state2.activeCartId]);
319
+ }, [search, (_state$service3 = state.service) === null || _state$service3 === void 0 ? void 0 : _state$service3.services]);
320
+ console.log('state.service.renderList', renderList);
388
321
  var isService = useMemo(function () {
389
- var _state$service3, _state$service3$value;
390
- return ((_state$service3 = state.service) === null || _state$service3 === void 0 ? void 0 : (_state$service3$value = _state$service3.value) === null || _state$service3$value === void 0 ? void 0 : _state$service3$value.length) > 0;
322
+ var _state$service4, _state$service4$value;
323
+ return ((_state$service4 = state.service) === null || _state$service4 === void 0 ? void 0 : (_state$service4$value = _state$service4.value) === null || _state$service4$value === void 0 ? void 0 : _state$service4$value.length) > 0;
391
324
  }, [state.service.value]);
392
325
  useEffect(function () {
393
- var _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4, _context$appHelper$ut5, _state$service4, _state$service4$value;
326
+ var _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4, _context$appHelper$ut5, _state$service5, _state$service5$value;
394
327
  // Salonip 不要这个
395
328
  if (shopList.includes((_context$appHelper$ut = context.appHelper.utils.store) === null || _context$appHelper$ut === void 0 ? void 0 : (_context$appHelper$ut2 = _context$appHelper$ut.getState) === null || _context$appHelper$ut2 === void 0 ? void 0 : (_context$appHelper$ut3 = _context$appHelper$ut2.call(_context$appHelper$ut)) === null || _context$appHelper$ut3 === void 0 ? void 0 : (_context$appHelper$ut4 = _context$appHelper$ut3.global) === null || _context$appHelper$ut4 === void 0 ? void 0 : (_context$appHelper$ut5 = _context$appHelper$ut4.globalConfig) === null || _context$appHelper$ut5 === void 0 ? void 0 : _context$appHelper$ut5.id) || state.closeAutoOpenService) {
396
329
  return;
397
330
  }
398
331
 
399
332
  // 如果弹窗打开,并且是创建, 则自动打开选择服务的弹窗
400
- if (state.modalOpen && !state.bookingId && state.renderType !== 'eventBooking' && ((_state$service4 = state.service) === null || _state$service4 === void 0 ? void 0 : (_state$service4$value = _state$service4.value) === null || _state$service4$value === void 0 ? void 0 : _state$service4$value.length) === 0) {
333
+ if (state.modalOpen && !state.bookingId && state.renderType !== 'eventBooking' && ((_state$service5 = state.service) === null || _state$service5 === void 0 ? void 0 : (_state$service5$value = _state$service5.value) === null || _state$service5$value === void 0 ? void 0 : _state$service5$value.length) === 0) {
401
334
  setTimeout(function () {
402
335
  handleSelectService();
403
336
  }, 10);
404
337
  }
405
- }, [state.modalOpen, state.bookingId, (_state$service5 = state.service) === null || _state$service5 === void 0 ? void 0 : _state$service5.value]);
338
+ }, [state.modalOpen, state.bookingId, (_state$service6 = state.service) === null || _state$service6 === void 0 ? void 0 : _state$service6.value]);
406
339
  var showAddButton = useMemo(function () {
407
340
  return !state.disabledEdit && !state.channelDisabledEdit;
408
341
  }, [state.disabledEdit, state.channelDisabledEdit]);
@@ -429,10 +362,6 @@ var Info = function Info(props) {
429
362
  }
430
363
  }, [state.renderType, state.modalOpen]);
431
364
  var addButton = useMemo(function () {
432
- // 跨日预约不显示添加服务按钮
433
- if (isDay) {
434
- return;
435
- }
436
365
  if (state.isBookingCreatePage) {
437
366
  return /*#__PURE__*/React.createElement("div", {
438
367
  style: {
@@ -467,31 +396,11 @@ var Info = function Info(props) {
467
396
  var isRenderCurrent = useMemo(function () {
468
397
  return renderMode === 'current';
469
398
  }, [renderMode]);
470
-
471
- /**
472
- * @title: 日期宽度
473
- * @description:
474
- * @param {*} useMemo
475
- * @return {*}
476
- * @Author: WangHan
477
- * @Date: 2024-12-09 15:46
478
- */
479
- var colSpan = useMemo(function () {
480
- var isTerminal = state.isTerminalDayBookingPage;
481
- var showDate = !!(isDay && holderId(state));
482
- return inputDateCol(showDate, isTerminal);
483
- }, [state.isTerminalDayBookingPage, isDay, holderId(state)]);
484
399
  return useMemo(function () {
485
- var _state$service6, _state$service6$cache;
400
+ var _state$service7, _state$service7$cache;
486
401
  var header = /*#__PURE__*/React.createElement("div", {
487
- className: 'pisell-lowcode__booking-service-header',
488
- ref: headerRef
489
- }, /*#__PURE__*/React.createElement(Row, {
490
- gutter: [16, 16]
491
- }, isDay && holderId(state) ? /*#__PURE__*/React.createElement(Col, colSpan.date, /*#__PURE__*/React.createElement(DateRange, {
492
- state: state,
493
- dispatch: dispatch
494
- })) : null, /*#__PURE__*/React.createElement(Col, colSpan.input, /*#__PURE__*/React.createElement(Input, {
402
+ className: 'pisell-lowcode__booking-service-header'
403
+ }, /*#__PURE__*/React.createElement(Input, {
495
404
  ref: searchRef,
496
405
  prefix: /*#__PURE__*/React.createElement(SearchLg, null),
497
406
  style: {
@@ -504,9 +413,9 @@ var Info = function Info(props) {
504
413
  onChange: function onChange(e) {
505
414
  setSearch(e.target.value);
506
415
  }
507
- }))));
416
+ }));
508
417
  var content = /*#__PURE__*/React.createElement("div", {
509
- className: isDay && headerHeight > 76 ? 'pisell-lowcode__booking-service-date-body' : 'pisell-lowcode__booking-service-body'
418
+ className: 'pisell-lowcode__booking-service-body'
510
419
  }, /*#__PURE__*/React.createElement(TabProduct, {
511
420
  list: renderList,
512
421
  amountSymbol: state.amountSymbol,
@@ -523,14 +432,14 @@ var Info = function Info(props) {
523
432
  }
524
433
  }, header, content);
525
434
  }
526
- return /*#__PURE__*/React.createElement(React.Fragment, null, ((_state$service6 = state.service) === null || _state$service6 === void 0 ? void 0 : (_state$service6$cache = _state$service6.cacheItem) === null || _state$service6$cache === void 0 ? void 0 : _state$service6$cache.autoClose) && /*#__PURE__*/React.createElement(Skeleton, {
435
+ return /*#__PURE__*/React.createElement(React.Fragment, null, ((_state$service7 = state.service) === null || _state$service7 === void 0 ? void 0 : (_state$service7$cache = _state$service7.cacheItem) === null || _state$service7$cache === void 0 ? void 0 : _state$service7$cache.autoClose) && /*#__PURE__*/React.createElement(Skeleton, {
527
436
  loading: true,
528
437
  active: true,
529
438
  round: true
530
439
  }), addButton, /*#__PURE__*/React.createElement(Drawer, _extends({
531
440
  titleNoWrap: true,
532
- open: state.service.addModal && !state.isBookingCreatePage && !state.isTerminalDayBookingPage,
533
- title: isDay ? locales.getText('pisell2.text.select.items') : locales.getText('pisell2.text.select-service'),
441
+ open: state.service.addModal && !state.isBookingCreatePage,
442
+ title: locales.getText('pisell2.text.select-service'),
534
443
  rootClassName: "booking-server-wrap",
535
444
  onClose: function onClose() {
536
445
  dispatch({
@@ -543,6 +452,6 @@ var Info = function Info(props) {
543
452
  },
544
453
  header: header
545
454
  }, drawerProps || {}), content));
546
- }, [(_state$service7 = state.service) === null || _state$service7 === void 0 ? void 0 : (_state$service7$cache = _state$service7.cacheItem) === null || _state$service7$cache === void 0 ? void 0 : _state$service7$cache.autoClose, addButton, state.service.addModal, locales, search, renderList, state.amountSymbol, state.renderType, (_state3 = state) === null || _state3 === void 0 ? void 0 : _state3.activeCartId, headerHeight, holderId(state)]);
455
+ }, [(_state$service8 = state.service) === null || _state$service8 === void 0 ? void 0 : (_state$service8$cache = _state$service8.cacheItem) === null || _state$service8$cache === void 0 ? void 0 : _state$service8$cache.autoClose, addButton, state.service.addModal, locales, search, renderList, state.amountSymbol]);
547
456
  };
548
457
  export default Info;
@@ -3,9 +3,8 @@
3
3
  // border-bottom: 1px solid var(--gray-300, #D0D5DD);
4
4
  }
5
5
 
6
- .pisell-lowcode__booking-service-body,
7
- .pisell-lowcode__booking-service-date-body {
8
- background: var(--gray-50, #f9fafb);
6
+ .pisell-lowcode__booking-service-body {
7
+ background: var(--gray-50, #F9FAFB);
9
8
  }
10
9
 
11
10
  .pisell-lowcode__booking-vertical-add-service-wrap {
@@ -26,7 +25,6 @@
26
25
  .booking-category-list {
27
26
  padding: 0 16px !important;
28
27
  }
29
-
30
28
  .pisell-lowcode__booking-service-body {
31
29
  .booking-tab-product {
32
30
  .booking-tabs-wrap {
@@ -34,12 +32,4 @@
34
32
  }
35
33
  }
36
34
  }
37
-
38
- .pisell-lowcode__booking-service-date-body {
39
- .booking-tab-product {
40
- .booking-tabs-wrap {
41
- top: 136px !important;
42
- }
43
- }
44
- }
45
- }
35
+ }
@@ -1,4 +1,4 @@
1
- import dayjs from 'dayjs';
1
+ import dayjs from "dayjs";
2
2
  export declare const getDurationProps: ({ cacheItem, useStartTime, currentResource, slice, }: any) => {
3
3
  startDate: dayjs.Dayjs;
4
4
  usableTime: any;
@@ -48,7 +48,7 @@ export declare const getTimeObj: ({ cacheItem, useStartTime, currentResource, st
48
48
  * @Author: zhiwei.Wang
49
49
  * @Date: 2024-01-09 13:38
50
50
  */
51
- export declare const formatResources: ({ cacheItem, resourcesOrigin, isDay }: any) => any[];
51
+ export declare const formatResources: ({ cacheItem, resourcesOrigin }: any) => any[];
52
52
  export declare const checkCacheItemResource: ({ cacheItem, resources }: any) => any;
53
53
  /**
54
54
  * @title: 预生成服务的 extend
@@ -59,13 +59,3 @@ export declare const checkCacheItemResource: ({ cacheItem, resources }: any) =>
59
59
  * @Date: 2024-06-01 13:25
60
60
  */
61
61
  export declare const getProductExtend: ({ cacheItem, state }: any) => any;
62
- /**
63
- * @title: 获取资源标题
64
- * @description:
65
- * @param {any} param1
66
- * @return {*}
67
- * @Author: WangHan
68
- * @Date: 2024-12-09 15:53
69
- */
70
- export declare const getResourceTitle: ({ state, id }: any) => any;
71
- export declare const getMultiDay: ({ start_date, end_date, state, cacheItem, }: any) => Promise<any>;