@pisell/private-materials 3.0.203 → 3.0.205

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
@@ -1,678 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/components/booking/info/service2/utils.ts
30
- var utils_exports = {};
31
- __export(utils_exports, {
32
- disabledDate: () => disabledDate,
33
- formItems: () => formItems,
34
- formatActiveKey: () => formatActiveKey,
35
- formatDateTime: () => formatDateTime,
36
- formatDayDate: () => formatDayDate,
37
- formatDayTime: () => formatDayTime,
38
- formatHolderLists: () => formatHolderLists,
39
- formatProducts: () => formatProducts,
40
- getAppointmentService: () => getAppointmentService,
41
- getDayProducts: () => getDayProducts,
42
- getErrorMessage: () => getErrorMessage,
43
- getPets: () => getPets,
44
- getResourceItem: () => getResourceItem,
45
- holderId: () => holderId,
46
- initDate: () => initDate,
47
- isBookingProduct: () => isBookingProduct,
48
- isDayBooking: () => isDayBooking,
49
- isDayBookingProduct: () => isDayBookingProduct,
50
- isHasDayAppointmentProduct: () => isHasDayAppointmentProduct,
51
- isOpenDeletePet: () => isOpenDeletePet,
52
- isTerminalDayBooking: () => isTerminalDayBooking,
53
- updateAppointmentServicePrice: () => updateAppointmentServicePrice,
54
- updateNormalBundlePrice: () => updateNormalBundlePrice,
55
- updateServicePrice: () => updateServicePrice,
56
- updateServices: () => updateServices
57
- });
58
- module.exports = __toCommonJS(utils_exports);
59
- var import_mock = require("../../mock");
60
- var import_utils = require("../../utils");
61
- var import_utils2 = require("@pisell/utils");
62
- var import_dayjs = __toESM(require("dayjs"));
63
- var import_status = require("./status");
64
- var import_serve = require("../service/serve");
65
- var import_locales = __toESM(require("../../locales"));
66
- var import_utils3 = require("./Group/utils");
67
- import_utils2.locales.init(import_locales.default, localStorage.getItem("umi_locale") || "en");
68
- var formatActiveKey = (lists, platform, isEdit) => {
69
- var _a;
70
- if (!(lists == null ? void 0 : lists.length))
71
- return [];
72
- if (lists.length === 1 && isEdit) {
73
- return [];
74
- }
75
- if (platform === "shop") {
76
- return [(_a = lists[lists.length - 1]) == null ? void 0 : _a.key];
77
- }
78
- return lists == null ? void 0 : lists.map((cart) => cart == null ? void 0 : cart.key);
79
- };
80
- var getResourceItem = (id, state) => {
81
- var _a;
82
- if (id === 0) {
83
- return (0, import_mock.getNoResource)();
84
- }
85
- return (_a = state.service.resources) == null ? void 0 : _a.find((d) => d.form_record_id === id);
86
- };
87
- var errorTypes = {
88
- product: import_utils2.locales.getText("pisell2.text.status.service-error-1"),
89
- time: import_utils2.locales.getText("pisell2.text.status.service-error-2"),
90
- maxLimit: import_utils2.locales.getText("pisell2.text.status.service-error-3"),
91
- limit: import_utils2.locales.getText("pisell2.text.status.service-error-3")
92
- };
93
- var getErrorMessage = (service, resourceItem, isDay) => {
94
- const errorList = (0, import_utils.getErrorList)(resourceItem, service, isDay);
95
- let errorMessage = "";
96
- if (!service.id) {
97
- return errorList[0].label;
98
- }
99
- if (errorList.length) {
100
- if (errorList.length > 1) {
101
- errorMessage = `${errorList.length} ${import_utils2.locales.getText(
102
- "pisell2.text.warnings"
103
- )}`;
104
- } else {
105
- errorMessage = (resourceItem == null ? void 0 : resourceItem.labelText) + " " + errorTypes[errorList[0].type];
106
- }
107
- }
108
- return errorMessage;
109
- };
110
- var formatHolderLists = (lists) => {
111
- const isOpenGroup = true;
112
- const _lists = lists == null ? void 0 : lists.map((item) => {
113
- return {
114
- ...item,
115
- id: (item == null ? void 0 : item.id) || (item == null ? void 0 : item.form_record_id),
116
- key: (item == null ? void 0 : item.id) || (item == null ? void 0 : item.form_record_id),
117
- label: import_utils2.locales.getText("pisell2.text.cart.of")(item == null ? void 0 : item.main_field)
118
- };
119
- });
120
- if (isOpenGroup) {
121
- const defaults = [
122
- {
123
- key: 0,
124
- id: 0,
125
- label: import_utils2.locales.getText("pisell2.text.open.items"),
126
- main_field: import_utils2.locales.getText("pisell2.text.open.items")
127
- }
128
- ];
129
- return defaults.concat(_lists);
130
- }
131
- return _lists;
132
- };
133
- var getHolderLists = (state) => {
134
- var _a, _b, _c, _d, _e, _f;
135
- const form_id = ((_d = (_c = (_b = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.basic) == null ? void 0 : _c.appointment_subject) == null ? void 0 : _d.form_id) || 0;
136
- const petLists = ((_f = (_e = state == null ? void 0 : state.pet) == null ? void 0 : _e.value) == null ? void 0 : _f[form_id]) || [];
137
- const _lists = formatHolderLists(petLists);
138
- return _lists;
139
- };
140
- var getHolderName = (state, id) => {
141
- const holderLists = getHolderLists(state);
142
- if (!holderLists.length || !id)
143
- return "";
144
- const resource = holderLists.find((d) => (d == null ? void 0 : d.id) === id);
145
- return resource == null ? void 0 : resource.main_field;
146
- };
147
- var isBookingProduct = (extension_type) => {
148
- return import_status.appointmentTypes.includes(extension_type);
149
- };
150
- var isDayBookingProduct = (item, state) => {
151
- return isBookingProduct(item == null ? void 0 : item.extension_type) && isDayBooking(state);
152
- };
153
- var updateServices = (state, currentItem, type, other) => {
154
- var _a;
155
- let products = ((_a = state == null ? void 0 : state.service) == null ? void 0 : _a.value) || [];
156
- const isGroup = (0, import_utils3.isGroupBooking)(currentItem._id);
157
- if (type === "delete") {
158
- let deleteIds = [];
159
- if (isGroup) {
160
- debugger;
161
- deleteIds = (0, import_utils3.getProductByGroupId)(currentItem._id, products);
162
- } else {
163
- deleteIds = [currentItem._id];
164
- }
165
- products = products == null ? void 0 : products.filter((item) => !deleteIds.includes(item == null ? void 0 : item._id));
166
- }
167
- if (type === "delete_holders") {
168
- products = products == null ? void 0 : products.filter((item) => {
169
- var _a2;
170
- return ((_a2 = item == null ? void 0 : item._extend) == null ? void 0 : _a2.holder_id) !== other;
171
- });
172
- }
173
- if (type === "update_holders") {
174
- products = products == null ? void 0 : products.map((item) => {
175
- var _a2;
176
- const ids = currentItem.map((d) => d._id);
177
- if (ids == null ? void 0 : ids.includes(item == null ? void 0 : item._id)) {
178
- let _extend = item._extend || {};
179
- if (Array.isArray(other)) {
180
- _extend.holder_id = (_a2 = other.find((other2) => (other2 == null ? void 0 : other2._id) === (item == null ? void 0 : item._id))) == null ? void 0 : _a2.holder_id;
181
- } else {
182
- _extend.holder_id = other;
183
- }
184
- return item;
185
- }
186
- return item;
187
- });
188
- } else {
189
- products = products == null ? void 0 : products.map((item) => {
190
- let updateIds = [];
191
- if (isGroup) {
192
- updateIds = (0, import_utils3.getProductByGroupId)(currentItem._id, products);
193
- } else {
194
- updateIds = [currentItem._id];
195
- }
196
- if (updateIds.includes(item._id)) {
197
- if (type === "like") {
198
- let _extend = item._extend || {};
199
- _extend.like_status = other == null ? void 0 : other.like_status;
200
- } else {
201
- item = {
202
- ...item,
203
- ...other
204
- };
205
- }
206
- return item;
207
- }
208
- return item;
209
- });
210
- }
211
- return products;
212
- };
213
- var formatBundle = (bundle) => {
214
- if (!(bundle == null ? void 0 : bundle.length))
215
- return [];
216
- return bundle.map((item) => {
217
- return {
218
- id: item == null ? void 0 : item.id,
219
- title: item == null ? void 0 : item.title,
220
- num: item == null ? void 0 : item.num,
221
- price: item == null ? void 0 : item.price,
222
- total: item == null ? void 0 : item.price,
223
- price_type: item == null ? void 0 : item.price_type,
224
- bundle_sum_price: item == null ? void 0 : item.bundle_sum_price,
225
- bundle_sum_type: item == null ? void 0 : item.bundle_sum_type,
226
- options: formatOptions(item == null ? void 0 : item.option)
227
- };
228
- });
229
- };
230
- var formatOptions = (options) => {
231
- if (!(options == null ? void 0 : options.length))
232
- return [];
233
- return options.map((item) => {
234
- return {
235
- id: item == null ? void 0 : item.id,
236
- name: item == null ? void 0 : item.name,
237
- num: item == null ? void 0 : item.num,
238
- price: item == null ? void 0 : item.price,
239
- total: item == null ? void 0 : item.price,
240
- origin_total: item == null ? void 0 : item.original_price
241
- };
242
- });
243
- };
244
- var formItems = (items) => {
245
- return items.map((d) => {
246
- return {
247
- ...d,
248
- start_date: d._extend.start_date,
249
- end_date: d._extend.end_date,
250
- num: d == null ? void 0 : d._extend.quantity,
251
- total: d._extend.total,
252
- origin_total: d._extend.origin_total
253
- };
254
- });
255
- };
256
- var formatProducts = (lists, state, isRenderGroup = true) => {
257
- if (!(lists == null ? void 0 : lists.length))
258
- return [];
259
- console.log(lists, "wh9879");
260
- const normalList = [];
261
- const groupList = [];
262
- const formItem = (item) => {
263
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r;
264
- const _isDayBookingProduct = isDayBookingProduct(item, state);
265
- const clientTitle = getHolderName(state, (_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.holder_id);
266
- const options = formatOptions((_c = (_b = item == null ? void 0 : item._extend) == null ? void 0 : _b.other) == null ? void 0 : _c.option);
267
- const bundle = formatBundle((_e = (_d = item == null ? void 0 : item._extend) == null ? void 0 : _d.other) == null ? void 0 : _e.bundle);
268
- const isNormalProduct = !import_status.appointmentTypes.includes(item == null ? void 0 : item.extension_type);
269
- let resourceItem = {};
270
- let errorMessage = "";
271
- if (_isDayBookingProduct) {
272
- resourceItem = getResourceItem((_f = item == null ? void 0 : item._extend) == null ? void 0 : _f.resource, state);
273
- errorMessage = getErrorMessage(item, resourceItem, isDayBooking(state));
274
- }
275
- return {
276
- id: item == null ? void 0 : item.id,
277
- _id: item == null ? void 0 : item._id,
278
- name: item == null ? void 0 : item.title,
279
- price: (_g = item == null ? void 0 : item._extend) == null ? void 0 : _g.price,
280
- total: (_h = item == null ? void 0 : item._extend) == null ? void 0 : _h.total,
281
- origin_total: (_i = item == null ? void 0 : item._extend) == null ? void 0 : _i.origin_total,
282
- num: item == null ? void 0 : item._extend.quantity,
283
- image: item == null ? void 0 : item.cover,
284
- isShowNote: true,
285
- note: item == null ? void 0 : item.note,
286
- like_status: (_j = item == null ? void 0 : item._extend) == null ? void 0 : _j.like_status,
287
- bundle,
288
- options,
289
- errorMessage,
290
- product_option_string: (_l = (_k = item == null ? void 0 : item._extend) == null ? void 0 : _k.other) == null ? void 0 : _l.product_option_string,
291
- discount_reason: (_m = item == null ? void 0 : item._extend) == null ? void 0 : _m.discount_reason,
292
- resource_id: isNormalProduct ? 0 : (_n = item == null ? void 0 : item._extend) == null ? void 0 : _n.resource,
293
- relation_form_name: isNormalProduct ? "" : (resourceItem == null ? void 0 : resourceItem.labelText) || item.relation_form_name,
294
- holder_title: clientTitle,
295
- start_date: !isNormalProduct ? (_o = item == null ? void 0 : item._extend) == null ? void 0 : _o.start_date : "",
296
- end_date: !isNormalProduct ? (_p = item == null ? void 0 : item._extend) == null ? void 0 : _p.end_date : "",
297
- holder_id: ((_q = item == null ? void 0 : item._extend) == null ? void 0 : _q.holder_id) || 0,
298
- isNormalProduct,
299
- locale: state.locale,
300
- symbol: state.amountSymbol,
301
- items: formItems(((_r = item == null ? void 0 : item._extend) == null ? void 0 : _r.items) || []),
302
- _origin: item
303
- };
304
- };
305
- lists.forEach((item) => {
306
- var _a;
307
- if (!((_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.groupId)) {
308
- normalList.push(formItem(item));
309
- } else {
310
- groupList.push(item);
311
- }
312
- });
313
- let groups = groupList.reduce((prev, item) => {
314
- var _a;
315
- const groupId = (_a = item == null ? void 0 : item._extend) == null ? void 0 : _a.groupId;
316
- if (!prev[groupId]) {
317
- prev[groupId] = [];
318
- }
319
- prev[groupId].push(item);
320
- return prev;
321
- }, {});
322
- if (isRenderGroup) {
323
- return Object.values(groups).map((d) => formItem((0, import_utils3.concatBookings)(d))).concat(normalList);
324
- } else {
325
- return lists == null ? void 0 : lists.map((item) => formItem(item));
326
- }
327
- };
328
- var disabledDate = (current, position, currentDate) => {
329
- if (!(0, import_dayjs.default)(currentDate).isValid())
330
- return;
331
- if (position === "start") {
332
- return false;
333
- }
334
- if (position === "end" && current.endOf("day") && currentDate) {
335
- const endDisabled = currentDate.add(8, "months").format("YYYY-MM-DD");
336
- return (0, import_dayjs.default)(endDisabled) < current.startOf("day") || current.startOf("day") <= currentDate;
337
- }
338
- return current && current <= currentDate;
339
- };
340
- var isDayBooking = (state) => {
341
- return (state == null ? void 0 : state.renderType) === "dayBooking";
342
- };
343
- var isTerminalDayBooking = (state) => {
344
- return state.isTerminalDayBookingPage;
345
- };
346
- var formatDayDate = (_extend) => {
347
- let startDate = (0, import_dayjs.default)(_extend == null ? void 0 : _extend.start_date).startOf("day");
348
- let endDate = (0, import_dayjs.default)(_extend == null ? void 0 : _extend.end_date).startOf("day");
349
- return {
350
- ..._extend,
351
- start_date: startDate,
352
- end_date: endDate
353
- };
354
- };
355
- var formatDayTime = ({ startDate, endDate }) => {
356
- const shopOpeningTime = localStorage.getItem("shopOpeningHours") || "00:00";
357
- let start_date = (0, import_dayjs.default)(startDate).format("YYYY-MM-DD");
358
- let end_date = (0, import_dayjs.default)(endDate).format("YYYY-MM-DD");
359
- const result = {
360
- startDateTime: (0, import_dayjs.default)(`${start_date}T${shopOpeningTime}:00`),
361
- // 结束日期根据营业日时间减去一分钟
362
- endDateTime: (0, import_dayjs.default)(`${end_date}T${shopOpeningTime}:00`).subtract(1, "minute")
363
- };
364
- return result;
365
- };
366
- var formatDateTime = (start_date, end_date) => {
367
- const _openingTime = (0, import_status.openingTime)();
368
- const startDate = `${start_date} ${_openingTime}`;
369
- let endDate = `${end_date} ${_openingTime}`;
370
- const date = {
371
- value: (0, import_dayjs.default)(startDate),
372
- end_date: (0, import_dayjs.default)(endDate).subtract(1, "minute")
373
- };
374
- return date;
375
- };
376
- var initDate = () => {
377
- const startDate = (0, import_dayjs.default)().format("YYYY-MM-DD");
378
- let endDate = (0, import_dayjs.default)().add(1, "days").format("YYYY-MM-DD");
379
- const date = formatDateTime(startDate, endDate);
380
- return date;
381
- };
382
- var isHasDayAppointmentProduct = (state) => {
383
- var _a, _b, _c, _d, _e, _f, _g;
384
- const form_id = ((_d = (_c = (_b = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.basic) == null ? void 0 : _c.appointment_subject) == null ? void 0 : _d.form_id) || 0;
385
- const services = ((_e = state.service) == null ? void 0 : _e.value) || [];
386
- const pets = ((_g = (_f = state.pet) == null ? void 0 : _f.value) == null ? void 0 : _g[form_id]) || [];
387
- const appointmentServices = services.filter((d) => import_status.appointmentTypes.includes(d.extension_type));
388
- if (!appointmentServices.length)
389
- return true;
390
- let _pets = pets == null ? void 0 : pets.map((d) => {
391
- const holderProducts = services.filter((d2) => {
392
- var _a2;
393
- return ((_a2 = d2._extend) == null ? void 0 : _a2.holder_id) == d2.form_record_id;
394
- });
395
- return {
396
- ...d,
397
- // 如果该购物车中没选择任何商品,则不需要验证,所以直接用1来填充
398
- // services: !holderProducts?.length ? [1] : holderProducts?.filter((d: any) => appointmentTypes.includes(d.extension_type))
399
- services: services.filter((item) => {
400
- var _a2;
401
- return ((_a2 = item._extend) == null ? void 0 : _a2.holder_id) == d.form_record_id && import_status.appointmentTypes.includes(item.extension_type);
402
- })
403
- };
404
- });
405
- _pets = _pets.filter((d) => !d.services.length);
406
- return _pets.length > 0;
407
- };
408
- var getDayProducts = (holderId2, lists, isTerminal) => {
409
- let _lists = lists || [];
410
- if (!holderId2 && !isTerminal) {
411
- _lists = _lists.filter((item) => !import_status.appointmentTypes.includes(item == null ? void 0 : item.extension_type));
412
- } else {
413
- _lists = _lists.filter((item) => {
414
- var _a;
415
- return !import_status.appointmentTypes.includes(item == null ? void 0 : item.extension_type) || import_status.appointmentTypes.includes(item == null ? void 0 : item.extension_type) && ((_a = item.duration) == null ? void 0 : _a.type) === "days";
416
- });
417
- }
418
- return _lists;
419
- };
420
- var getPets = (state) => {
421
- var _a, _b, _c, _d, _e, _f;
422
- const form_id = ((_d = (_c = (_b = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.basic) == null ? void 0 : _c.appointment_subject) == null ? void 0 : _d.form_id) || 0;
423
- const pets = ((_f = (_e = state == null ? void 0 : state.pet) == null ? void 0 : _e.value) == null ? void 0 : _f[form_id]) || [];
424
- return pets;
425
- };
426
- var getAppointmentService = (state) => {
427
- var _a;
428
- const services = ((_a = state.service) == null ? void 0 : _a.value) || [];
429
- let lists = services.filter((item) => import_status.appointmentTypes.includes(item.extension_type));
430
- return lists;
431
- };
432
- var isOpenDeletePet = (state, newVal) => {
433
- var _a, _b, _c, _d, _e, _f;
434
- const form_id = ((_d = (_c = (_b = (_a = state == null ? void 0 : state.bookingConfig) == null ? void 0 : _a.config) == null ? void 0 : _b.basic) == null ? void 0 : _c.appointment_subject) == null ? void 0 : _d.form_id) || 0;
435
- const oldPets = ((_f = (_e = state == null ? void 0 : state.pet) == null ? void 0 : _e.value) == null ? void 0 : _f[form_id]) || [];
436
- const newPets = (newVal == null ? void 0 : newVal[form_id]) || [];
437
- const deletePets = oldPets.filter((item) => !newPets.some((newItem) => newItem.form_record_id === item.form_record_id));
438
- const servicePets = deletePets.map((item) => {
439
- var _a2, _b2;
440
- return {
441
- ...item,
442
- services: (_b2 = (_a2 = state.service) == null ? void 0 : _a2.value) == null ? void 0 : _b2.filter((d) => {
443
- var _a3;
444
- return ((_a3 = d._extend) == null ? void 0 : _a3.holder_id) == item.form_record_id;
445
- })
446
- };
447
- });
448
- const lists = servicePets.filter((item) => {
449
- var _a2;
450
- return ((_a2 = item.services) == null ? void 0 : _a2.length) > 0;
451
- });
452
- return {
453
- ids: lists.map((item) => item.form_record_id),
454
- lists
455
- };
456
- };
457
- var holderId = (state) => {
458
- var _a;
459
- return Number(((_a = state == null ? void 0 : state.activeCartId) == null ? void 0 : _a[0]) || 0);
460
- };
461
- function calculateTotalPrice(data) {
462
- const _price = data == null ? void 0 : data.reduce(
463
- (total, item) => total + ((item == null ? void 0 : item.price) || (item == null ? void 0 : item.add_price)) * item.num,
464
- 0
465
- );
466
- return parseFloat(_price);
467
- }
468
- function updateSinglePrice(currentValue, single) {
469
- const _single = [];
470
- for (let index = 0; index < currentValue.length; index++) {
471
- const item = currentValue[index];
472
- const currentIndex = single.findIndex(
473
- (_single2) => _single2.id === item.id
474
- );
475
- if (currentIndex !== -1) {
476
- item.add_price = single[currentIndex].add_price;
477
- item.name = single[currentIndex].name;
478
- _single.push(item);
479
- }
480
- }
481
- return _single;
482
- }
483
- function updateBundlePrice(currentValue, [bundle, single]) {
484
- var _a;
485
- const _bundle = [];
486
- for (let index = 0; index < currentValue.length; index++) {
487
- const item = currentValue[index];
488
- const currentIndex = bundle.findIndex(
489
- (_bundle2) => _bundle2.id === item.id
490
- );
491
- if (currentIndex !== -1 && bundle[currentIndex]) {
492
- item.title = bundle[currentIndex].title;
493
- item.price_type = bundle[currentIndex].price_type;
494
- item._price = bundle[currentIndex].price;
495
- const bundle_sum_price = parseFloat(
496
- bundle[currentIndex].price_type === "markdown" ? bundle[currentIndex].price * -1 : bundle[currentIndex].price
497
- ).toFixed(2);
498
- item.price = bundle_sum_price;
499
- item.bundle_sum_price = bundle_sum_price;
500
- if ((_a = item == null ? void 0 : item.option) == null ? void 0 : _a.length) {
501
- const _option = JSON.parse(JSON.stringify(item.option));
502
- item.option = updateSinglePrice(_option, single);
503
- let optionPrice = 0;
504
- optionPrice = calculateTotalPrice(item.option);
505
- const bundle_sum_price2 = (parseFloat(
506
- bundle[currentIndex].price_type === "markdown" ? bundle[currentIndex].price * -1 : bundle[currentIndex].price
507
- ) + optionPrice).toFixed(2);
508
- item.price = bundle_sum_price2;
509
- item.bundle_sum_price = bundle_sum_price2;
510
- }
511
- _bundle.push(item);
512
- }
513
- }
514
- return _bundle;
515
- }
516
- function flatData(newPackageData) {
517
- var _a, _b, _c;
518
- let bundle = [];
519
- let single = [];
520
- for (const group of newPackageData) {
521
- if ((_a = group == null ? void 0 : group.bundle_item) == null ? void 0 : _a.length) {
522
- for (const item of group.bundle_item) {
523
- bundle.push(item);
524
- }
525
- }
526
- }
527
- for (const bundleItem of bundle) {
528
- if ((_b = bundleItem == null ? void 0 : bundleItem.option_group) == null ? void 0 : _b.length) {
529
- for (const group of bundleItem.option_group) {
530
- if ((_c = group == null ? void 0 : group.option_item) == null ? void 0 : _c.length) {
531
- for (const item of group.option_item) {
532
- single.push(item);
533
- }
534
- }
535
- }
536
- }
537
- }
538
- return [bundle, single];
539
- }
540
- function updateNormalBundlePrice(currentValue, newBundleData) {
541
- const _currentValue = JSON.parse(JSON.stringify(currentValue));
542
- const _flatData = flatData(newBundleData);
543
- const newValue = updateBundlePrice(_currentValue, _flatData);
544
- return newValue;
545
- }
546
- var normalServicePrice = async (ids, state) => {
547
- var _a, _b, _c, _d;
548
- const services = ((_a = state.service) == null ? void 0 : _a.value) || [];
549
- const customerId = ((_c = (_b = state == null ? void 0 : state.client) == null ? void 0 : _b.value) == null ? void 0 : _c.id) || 0;
550
- let data = await state.apis.getServices({
551
- skip: 1,
552
- num: 500,
553
- ids,
554
- customer_id: customerId,
555
- open_quotation: 1,
556
- open_bundle: 1,
557
- with: ["bundleGroup.bundleItem", "optionGroup.optionItem"],
558
- _config: { abort: true }
559
- });
560
- if (!((_d = data == null ? void 0 : data.list) == null ? void 0 : _d.length))
561
- return;
562
- const _lists = services.map((item) => {
563
- var _a2, _b2, _c2, _d2;
564
- let obj = { ...item };
565
- if (!import_status.appointmentTypes.includes(obj.extension_type)) {
566
- const product = data.list.find((p) => p.id === (item == null ? void 0 : item.product_id));
567
- let _extend = (obj == null ? void 0 : obj._extend) || {};
568
- const other = (_extend == null ? void 0 : _extend.other) || {};
569
- if (product) {
570
- if (((_a2 = product == null ? void 0 : product.variant) == null ? void 0 : _a2.length) && (other == null ? void 0 : other.product_variant_id)) {
571
- const _variant = (_b2 = product == null ? void 0 : product.variant) == null ? void 0 : _b2.find((v) => v.id === (other == null ? void 0 : other.product_variant_id));
572
- obj._extend.price = Number(_variant == null ? void 0 : _variant.price);
573
- obj._extend.other.price = Number(_variant == null ? void 0 : _variant.price);
574
- } else {
575
- obj._extend.price = Number(product == null ? void 0 : product.price);
576
- }
577
- if (((_c2 = other == null ? void 0 : other.bundle) == null ? void 0 : _c2.length) && ((_d2 = product == null ? void 0 : product.bundle_group) == null ? void 0 : _d2.length)) {
578
- let _bundle = updateNormalBundlePrice(other.bundle, product == null ? void 0 : product.bundle_group);
579
- obj._extend.other = {
580
- ...other,
581
- bundle: _bundle
582
- };
583
- }
584
- obj._extend.total = (0, import_utils.getProductTotalPrice)(obj);
585
- obj._extend.origin_total = (0, import_utils.getProductTotalPrice)(obj);
586
- }
587
- }
588
- return obj;
589
- });
590
- return _lists;
591
- };
592
- var updateAppointmentServicePrice = async (state, { start_date, end_date, product_id }) => {
593
- var _a, _b, _c, _d, _e, _f, _g, _h;
594
- const defaultReturn = {
595
- multiDayPrices: [],
596
- price: Number((_c = (_b = (_a = state == null ? void 0 : state.service) == null ? void 0 : _a.cacheItem) == null ? void 0 : _b._extend) == null ? void 0 : _c.price) || 0
597
- };
598
- try {
599
- const format = "YYYY-MM-DD";
600
- const customer_id = ((_e = (_d = state == null ? void 0 : state.client) == null ? void 0 : _d.value) == null ? void 0 : _e.id) || 1;
601
- const _product_id = product_id || ((_f = state.service.cacheItem) == null ? void 0 : _f.product_id) || 0;
602
- let multi_day_price = null;
603
- if (!product_id) {
604
- console.log("updateAppointmentServicePrice", product_id);
605
- return defaultReturn;
606
- }
607
- const startDate = (0, import_dayjs.default)(start_date).format(format);
608
- const endDate = (0, import_dayjs.default)(end_date).subtract(1, "days").format(format);
609
- const params = {
610
- customer_id,
611
- multi_day: { start: startDate, end: endDate }
612
- };
613
- const res = await (0, import_serve.postMultiDay)(_product_id, params);
614
- const _prices = ((_g = res == null ? void 0 : res.data) == null ? void 0 : _g.multi_day_price) || [];
615
- multi_day_price = _prices == null ? void 0 : _prices.map((p) => {
616
- var _a2, _b2;
617
- const startDate2 = (0, import_dayjs.default)((_a2 = p == null ? void 0 : p.multi_day) == null ? void 0 : _a2.start);
618
- const endDate2 = (0, import_dayjs.default)((_b2 = p == null ? void 0 : p.multi_day) == null ? void 0 : _b2.end).add(1, "day");
619
- let duration = (endDate2 == null ? void 0 : endDate2.diff(startDate2, "day")) || 1;
620
- return {
621
- total: Number(p == null ? void 0 : p.price),
622
- origin_total: Number(p == null ? void 0 : p.price),
623
- num: duration,
624
- quotation_id: (p == null ? void 0 : p.quotation_id) || 0,
625
- start_date: startDate2 == null ? void 0 : startDate2.format(format),
626
- end_date: endDate2 == null ? void 0 : endDate2.format(format)
627
- };
628
- });
629
- return {
630
- multiDayPrices: multi_day_price,
631
- price: Number((_h = res == null ? void 0 : res.data) == null ? void 0 : _h.price) || 0
632
- };
633
- } catch (error) {
634
- console.log("updateAppointmentServicePrice", error);
635
- }
636
- return defaultReturn;
637
- };
638
- var updateServicePrice = (state) => {
639
- var _a;
640
- let services = ((_a = state.service) == null ? void 0 : _a.value) || [];
641
- let normalServices = services == null ? void 0 : services.filter(
642
- (item) => !import_status.appointmentTypes.includes(item.extension_type)
643
- );
644
- let newNormalIds = normalServices == null ? void 0 : normalServices.map((item) => (item == null ? void 0 : item.product_id) || (item == null ? void 0 : item.id));
645
- newNormalIds = [...new Set(newNormalIds)];
646
- if (newNormalIds == null ? void 0 : newNormalIds.length) {
647
- return normalServicePrice(newNormalIds, state);
648
- }
649
- return [];
650
- };
651
- // Annotate the CommonJS export names for ESM import in node:
652
- 0 && (module.exports = {
653
- disabledDate,
654
- formItems,
655
- formatActiveKey,
656
- formatDateTime,
657
- formatDayDate,
658
- formatDayTime,
659
- formatHolderLists,
660
- formatProducts,
661
- getAppointmentService,
662
- getDayProducts,
663
- getErrorMessage,
664
- getPets,
665
- getResourceItem,
666
- holderId,
667
- initDate,
668
- isBookingProduct,
669
- isDayBooking,
670
- isDayBookingProduct,
671
- isHasDayAppointmentProduct,
672
- isOpenDeletePet,
673
- isTerminalDayBooking,
674
- updateAppointmentServicePrice,
675
- updateNormalBundlePrice,
676
- updateServicePrice,
677
- updateServices
678
- });
@@ -1,7 +0,0 @@
1
- import { SelectProps } from 'antd';
2
- import React from 'react';
3
- interface HolderProps extends SelectProps {
4
- selectProps?: SelectProps;
5
- }
6
- declare const Holder: (props: HolderProps) => React.JSX.Element;
7
- export default Holder;