@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
@@ -64,6 +64,20 @@ var tyro_default = ({
64
64
  const requestIdRef = (0, import_react.useRef)((custom == null ? void 0 : custom.requestId) || "");
65
65
  const unloadRef = (0, import_react.useRef)(false);
66
66
  const clearRef = (0, import_react.useRef)();
67
+ const isPrint = (key) => {
68
+ var _a, _b, _c, _d;
69
+ if ((_b = (_a = deviceRef.current) == null ? void 0 : _a.setting) == null ? void 0 : _b.receipts) {
70
+ return false;
71
+ }
72
+ const receiptList = (_d = (_c = deviceRef.current) == null ? void 0 : _c.setting) == null ? void 0 : _d.receiptList;
73
+ if (!Array.isArray(receiptList)) {
74
+ return true;
75
+ }
76
+ if (Array.isArray(receiptList) && receiptList.some((item) => item === key)) {
77
+ return true;
78
+ }
79
+ return false;
80
+ };
67
81
  (0, import_react.useEffect)(() => {
68
82
  listRef.current = (custom == null ? void 0 : custom.list) || [];
69
83
  }, [custom == null ? void 0 : custom.list]);
@@ -114,12 +128,16 @@ var tyro_default = ({
114
128
  );
115
129
  requestParams.current = {
116
130
  amount: new import_decimal.Decimal(amountRef.current || 0).mul(100).toFixed(0, import_decimal.Decimal.ROUND_HALF_UP),
117
- // 打印小票 true 打印到系统上 false 打印到pos机上
131
+ // 打印小票 true 打印到Pisell系统上 false 打印到pos机上
118
132
  integratedReceipt: !((_b = (_a = deviceRef.current) == null ? void 0 : _a.setting) == null ? void 0 : _b.receipts),
119
133
  integrationKey,
120
134
  transactionId: numRef.current,
121
135
  mid,
122
- tid
136
+ tid,
137
+ device: JSON.stringify(deviceRef.current),
138
+ isPrintMerchant: isPrint("merchant"),
139
+ isPrintCustomer: isPrint("customer"),
140
+ browserVersion: (0, import_helper.getBrowserVersion)()
123
141
  };
124
142
  dispatch(
125
143
  (0, import_store.updateCustom)({
@@ -186,7 +204,11 @@ var tyro_default = ({
186
204
  integrationKey,
187
205
  transactionId: numRef.current,
188
206
  mid,
189
- tid
207
+ tid,
208
+ device: JSON.stringify(deviceRef.current),
209
+ isPrintMerchant: isPrint("merchant"),
210
+ isPrintCustomer: isPrint("customer"),
211
+ browserVersion: (0, import_helper.getBrowserVersion)()
190
212
  };
191
213
  dispatch(
192
214
  (0, import_store.updateCustom)({
@@ -244,8 +266,14 @@ var tyro_default = ({
244
266
  console.log("商家小票 客户端是否打印小票 = ", signatureRequired);
245
267
  console.log("商家小票 小票内容 = \n", merchantReceipt);
246
268
  const receipt = [merchantReceipt].filter((item) => typeof item === "string").filter(Boolean);
247
- onChange("print", receipt);
248
269
  merchantReceiptRef.current = { signatureRequired, merchantReceipt };
270
+ if (signatureRequired) {
271
+ onChange("print", receipt);
272
+ return;
273
+ }
274
+ if (isPrint("merchant")) {
275
+ onChange("print", receipt);
276
+ }
249
277
  };
250
278
  const statusMessageCallbackImpl = (message) => {
251
279
  var _a;
@@ -377,11 +405,11 @@ var tyro_default = ({
377
405
  );
378
406
  dispatch(
379
407
  (0, import_store.updateCustom)({
380
- card_reader_surcharge: response.surchargeAmount || 0
408
+ card_reader_surcharge: response.surchargeAmount || 0,
409
+ receipt
381
410
  })
382
411
  );
383
412
  clearRef.current = setTimeout(() => {
384
- var _a2;
385
413
  const params = (0, import_helper.getPayParams)(
386
414
  {
387
415
  mode: modeRef.current,
@@ -391,21 +419,24 @@ var tyro_default = ({
391
419
  device: deviceRef.current,
392
420
  pay: payRef.current,
393
421
  custom: {
394
- card_reader_surcharge: response.surchargeAmount || 0
422
+ card_reader_surcharge: response.surchargeAmount || 0,
423
+ receipt
395
424
  }
396
425
  },
397
426
  "success"
398
427
  );
399
428
  onChange("success", {
400
429
  ...params,
401
- receipt: ((_a2 = deviceRef.current) == null ? void 0 : _a2.setting.receipts) ? [] : receipt
430
+ receipt: isPrint("customer") ? receipt : []
402
431
  });
403
432
  }, 1e3);
404
433
  return;
405
434
  } else {
406
435
  const current = ((_b = deviceRef.current) == null ? void 0 : _b.setting.receipts) ? [] : receipt;
407
436
  if (current.length > 0) {
408
- onChange("print", current);
437
+ if (isPrint("customer")) {
438
+ onChange("print", receipt);
439
+ }
409
440
  }
410
441
  }
411
442
  if (response.result === "UNKNOWN") {
@@ -9,7 +9,7 @@ import XhrTimer from './timer';
9
9
  * @Date: 2024-08-12 10:29
10
10
  */
11
11
  export declare const useFail: () => (res: {
12
- code?: `${PayStatus}`;
12
+ code?: "200" | "4004" | "701000" | "701001" | "701003" | "701004" | "701005" | "701006" | "701007" | "701008" | "701009" | "701010" | undefined;
13
13
  }, isMark?: boolean) => void;
14
14
  /**
15
15
  * @title: 轮询 check 接口
@@ -60,7 +60,7 @@ var windcave_default = ({
60
60
  symbolRef,
61
61
  amountRef,
62
62
  eftposRef,
63
- clientRef
63
+ dataRef
64
64
  } = (0, import_hooks.useStoreRef)();
65
65
  const dispatch = (0, import_store.useDispatch)();
66
66
  const fail = (0, import_helper2.useFail)();
@@ -89,13 +89,16 @@ var windcave_default = ({
89
89
  failRef.current = fail;
90
90
  }, [fail]);
91
91
  const [run, validateRef] = (0, import_helper2.useValidate)(api.check, Minute, (res) => {
92
+ let receipt = Array.isArray(res == null ? void 0 : res.receipt) ? res.receipt : [res.receipt];
93
+ receipt = receipt.filter((item) => typeof item === "string").filter(Boolean);
92
94
  dispatch(
93
95
  (0, import_store.updateCustom)({
94
96
  list: listRef.current.map((item) => ({
95
97
  ...item,
96
98
  status: "resolve"
97
99
  })),
98
- card_reader_surcharge: (res == null ? void 0 : res.card_reader_surcharge) || 0
100
+ card_reader_surcharge: (res == null ? void 0 : res.card_reader_surcharge) || 0,
101
+ receipt
99
102
  })
100
103
  );
101
104
  dispatch(
@@ -117,12 +120,12 @@ var windcave_default = ({
117
120
  device: deviceRef.current,
118
121
  pay: payRef.current,
119
122
  custom: {
120
- card_reader_surcharge: (res == null ? void 0 : res.card_reader_surcharge) || 0
123
+ card_reader_surcharge: (res == null ? void 0 : res.card_reader_surcharge) || 0,
124
+ receipt
121
125
  }
122
126
  },
123
127
  "success"
124
128
  );
125
- const receipt = Array.isArray(res.receipt) ? res.receipt : [res.receipt];
126
129
  onChange("success", {
127
130
  ...params,
128
131
  receipt: ((_b = (_a = deviceRef.current) == null ? void 0 : _a.setting) == null ? void 0 : _b.receipts) ? [] : receipt
@@ -165,7 +168,17 @@ var windcave_default = ({
165
168
  amount: payRef.current.total,
166
169
  card_reader_type: eftposRef.current,
167
170
  card_reader_id: (_a = deviceRef.current) == null ? void 0 : _a.id,
168
- number: numRef.current
171
+ number: numRef.current,
172
+ pay_param_base64: encodeURIComponent(
173
+ btoa(
174
+ encodeURIComponent(
175
+ JSON.stringify({
176
+ ...dataRef.current,
177
+ number: numRef.current
178
+ })
179
+ )
180
+ )
181
+ )
169
182
  },
170
183
  { signal: controllerRef.current.signal }
171
184
  ) : api.refund(
@@ -174,7 +187,17 @@ var windcave_default = ({
174
187
  amount: amountRef.current,
175
188
  card_reader_type: eftposRef.current,
176
189
  card_reader_id: (_b = deviceRef.current) == null ? void 0 : _b.id,
177
- number: numRef.current
190
+ number: numRef.current,
191
+ pay_param_base64: encodeURIComponent(
192
+ btoa(
193
+ encodeURIComponent(
194
+ JSON.stringify({
195
+ ...dataRef.current,
196
+ number: numRef.current
197
+ })
198
+ )
199
+ )
200
+ )
178
201
  },
179
202
  { signal: controllerRef.current.signal }
180
203
  );
@@ -1,3 +1,3 @@
1
1
  import "./index.less";
2
- declare const Schedules: any;
2
+ declare const Schedules: (props: any) => any;
3
3
  export default Schedules;
@@ -69,7 +69,7 @@ export interface FormState {
69
69
  };
70
70
  setGlobalState: Function | null;
71
71
  }
72
- export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
72
+ export declare const Provider: (ComponentUi: any) => (props: any) => any, Context: import("react").Context<{
73
73
  state: FormState;
74
74
  } & {
75
75
  dispatch: (params: {
package/lib/index.d.ts CHANGED
@@ -22,4 +22,3 @@ export { default as Eftpos } from './components/eftpos';
22
22
  export { default as EftposPay } from './components/eftposPay';
23
23
  export { default as BookingDashboard } from './components/booking/dashboard';
24
24
  export { default as PisellSelectCustomerModal } from './components/pisellSelectCustomerModal';
25
- export { default as ShoppingCart } from './components/shoppingCart';
package/lib/index.js CHANGED
@@ -48,7 +48,6 @@ __export(src_exports, {
48
48
  ProductExtension: () => import_productExtension.default,
49
49
  RuleSetting: () => import_ruleSetting.default,
50
50
  Schedules: () => import_schedules.default,
51
- ShoppingCart: () => import_shoppingCart.default,
52
51
  TaxSelect: () => import_taxSelect.default,
53
52
  ToCPay: () => import_toC.default,
54
53
  VerticalAddService: () => import_addServiceVariant.default,
@@ -81,7 +80,6 @@ var import_eftpos = __toESM(require("./components/eftpos"));
81
80
  var import_eftposPay = __toESM(require("./components/eftposPay"));
82
81
  var import_dashboard = __toESM(require("./components/booking/dashboard"));
83
82
  var import_pisellSelectCustomerModal = __toESM(require("./components/pisellSelectCustomerModal"));
84
- var import_shoppingCart = __toESM(require("./components/shoppingCart"));
85
83
  import_dayjs.default.extend(import_weekday.default);
86
84
  import_dayjs.default.extend(import_localeData.default);
87
85
  // Annotate the CommonJS export names for ESM import in node:
@@ -105,7 +103,6 @@ import_dayjs.default.extend(import_localeData.default);
105
103
  ProductExtension,
106
104
  RuleSetting,
107
105
  Schedules,
108
- ShoppingCart,
109
106
  TaxSelect,
110
107
  ToCPay,
111
108
  VerticalAddService,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pisell/private-materials",
3
- "version": "3.0.203",
3
+ "version": "3.0.205",
4
4
  "main": "./lib/index.js",
5
5
  "module": "./es/index.js",
6
6
  "types": "./lib/index.d.ts",
@@ -59,10 +59,10 @@
59
59
  "react-infinite-scroll-component": "^6.1.0",
60
60
  "rc-virtual-list": "^3.11.3",
61
61
  "decimal.js": "^10.4.3",
62
- "@pisell/materials": "3.0.62",
63
- "@pisell/date-picker": "3.0.1",
64
- "@pisell/utils": "1.0.42",
65
- "@pisell/icon": "0.0.11"
62
+ "@pisell/icon": "0.0.11",
63
+ "@pisell/materials": "3.0.59",
64
+ "@pisell/date-picker": "1.0.100",
65
+ "@pisell/utils": "1.0.42"
66
66
  },
67
67
  "peerDependencies": {
68
68
  "react": "^18.0.0",
@@ -1,3 +0,0 @@
1
- import React from 'react';
2
- declare const _default: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
3
- export default _default;
@@ -1,38 +0,0 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import React, { useState, forwardRef, useImperativeHandle } from 'react';
8
- import { locales } from '@pisell/utils';
9
- import { PisellModal } from '@pisell/materials';
10
- var AppointmentProductModal = function AppointmentProductModal(props, ref) {
11
- var _useState = useState(false),
12
- _useState2 = _slicedToArray(_useState, 2),
13
- open = _useState2[0],
14
- setOpen = _useState2[1];
15
- useImperativeHandle(ref, function () {
16
- return {
17
- open: function open() {
18
- setOpen(true);
19
- }
20
- };
21
- });
22
- return /*#__PURE__*/React.createElement(PisellModal.Information, {
23
- open: open,
24
- platform: "pc",
25
- title: locales.getText('pisell2.text.missing.reservation.title'),
26
- describe: locales.getText('pisell2.text.missing.reservation.content'),
27
- cancelText: locales.getText('pisell2.text.cancel'),
28
- okText: locales.getText('pisell2.text.confirm'),
29
- closable: true,
30
- onOk: function onOk() {
31
- return setOpen(false);
32
- },
33
- onCancel: function onCancel() {
34
- return setOpen(false);
35
- }
36
- });
37
- };
38
- export default /*#__PURE__*/forwardRef(AppointmentProductModal);
File without changes
@@ -1,54 +0,0 @@
1
- // 暂不使用
2
-
3
- // import React, { createContext, useContext, useRef, useState } from 'react';
4
- // import { FormState } from '../model';
5
- // import useEngineContext from '../../../hooks/useEngineContext';
6
-
7
- // import { request } from '../utils';
8
- // type BookingInfoContextType = FormState;
9
-
10
- // const BookingInfoContext = createContext<BookingInfoContextType | undefined>(
11
- // undefined
12
- // );
13
- // const defaultModules = {
14
- // client: 1,
15
- // date: 1,
16
- // service: 1,
17
- // holder: 1,
18
- // note: 1,
19
- // service2: 0,
20
- // };
21
- // export const BookingInfoProvider: React.FC<any> = (props) => {
22
- // const { style, globalState, modules = defaultModules, children } = props;
23
- // const context = useEngineContext();
24
- // request.setRequest(context.appHelper.utils.request);
25
-
26
- // return (
27
- // <BookingInfoContext.Provider
28
- // value={{
29
- // setGlobalState: props.setGlobalState,
30
- // ...globalState,
31
- // isTerminal: context?.appHelper?.utils?.isTerminal?.(),
32
- // isFranchisee:
33
- // context?.appHelper?.utils?.businessUtils?.getAppByModal?.(
34
- // 'franchisee'
35
- // ),
36
- // timezone:
37
- // context?.appHelper?.utils?.store?.getState()?.global?.globalConfig
38
- // ?.timezone,
39
- // modules,
40
- // style,
41
- // }}
42
- // >
43
- // {children}
44
- // </BookingInfoContext.Provider>
45
- // );
46
- // };
47
-
48
- // export const useBookingInfo = (): BookingInfoContextType => {
49
- // const context = useContext(BookingInfoContext);
50
- // if (!context) {
51
- // throw new Error();
52
- // }
53
- // return context;
54
- // };
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- import './index.less';
3
- export declare const disabledDate: (current: any, position: any, currentDate: any) => any;
4
- declare const DateRange: ({ state, dispatch, key }: any) => React.JSX.Element;
5
- export default DateRange;
@@ -1,98 +0,0 @@
1
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
2
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
3
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
4
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
5
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
6
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
7
- import React, { useEffect, useMemo, useState } from 'react';
8
- import { CalendarOutlined } from '@ant-design/icons';
9
- import classNames from 'classnames';
10
- import dayjs from 'dayjs';
11
- import { DatePicker, Page } from '@pisell/materials';
12
- import "./index.less";
13
-
14
- // 禁用之前的日期
15
- export var disabledDate = function disabledDate(current, position, currentDate) {
16
- if (position === 'start') {
17
- return false;
18
- }
19
- if (position === 'end' && current.endOf('day') && currentDate !== null && currentDate !== void 0 && currentDate[0]) {
20
- // 结束日期最大 = 开始日期 + 8个月
21
- var endDisabled = currentDate === null || currentDate === void 0 ? void 0 : currentDate[0].add(8, 'months').format('YYYY-MM-DD');
22
- return dayjs(endDisabled) < current.startOf('day') || current.startOf('day') <= (currentDate === null || currentDate === void 0 ? void 0 : currentDate[0]);
23
- }
24
- return current && current <= (currentDate === null || currentDate === void 0 ? void 0 : currentDate[0]);
25
- };
26
- var DateRange = function DateRange(_ref) {
27
- var state = _ref.state,
28
- dispatch = _ref.dispatch,
29
- key = _ref.key;
30
- var _useState = useState([]),
31
- _useState2 = _slicedToArray(_useState, 2),
32
- value = _useState2[0],
33
- setValue = _useState2[1];
34
- useEffect(function () {
35
- var _state$date, _state$date2;
36
- var lists = [(_state$date = state.date) === null || _state$date === void 0 ? void 0 : _state$date.value, (_state$date2 = state.date) === null || _state$date2 === void 0 ? void 0 : _state$date2.end_date];
37
- setValue(lists);
38
- console.log('lists', lists);
39
- }, [state.date]);
40
-
41
- /**
42
- * @title: 点击确定
43
- * @description:
44
- * @param {any} e
45
- * @return {*}
46
- * @Author: WangHan
47
- * @Date: 2024-12-12 15:39
48
- */
49
- var dateChange = function dateChange(e) {
50
- dispatch({
51
- type: 'setDate',
52
- payload: {
53
- value: e[0],
54
- end_date: e[1],
55
- edit: true
56
- }
57
- });
58
- };
59
-
60
- /**
61
- * @title: 格式化语言
62
- * @description:
63
- * @param {*} useMemo
64
- * @return {*}
65
- * @Author: WangHan
66
- * @Date: 2024-12-09 17:47
67
- */
68
- var formatLocale = useMemo(function () {
69
- var locale = state === null || state === void 0 ? void 0 : state.locale;
70
- var isEn = locale === 'en' || locale === 'en-US';
71
- var _format = isEn ? 'DD/MM/YYYY' : 'YYYY-MM-DD';
72
- return _format;
73
- }, [state === null || state === void 0 ? void 0 : state.locale, state.date]);
74
- return useMemo(function () {
75
- return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
76
- className: classNames('pisell-lowcode__booking-service-header-date-range', {
77
- 'pisell-lowcode__booking-service-header-date-range-terminal': state.isTerminalDayBookingPage
78
- })
79
- }, /*#__PURE__*/React.createElement(Page, null, /*#__PURE__*/React.createElement(DatePicker.RangePicker, {
80
- key: key,
81
- inputReadOnly: true,
82
- allowClear: false,
83
- size: "large",
84
- style: {
85
- width: '100%',
86
- padding: 0
87
- },
88
- suffixIcon: !state.disabledEdit ? /*#__PURE__*/React.createElement(CalendarOutlined, null) : null,
89
- disabledDate: disabledDate,
90
- value: [value[0], value[1]],
91
- onChange: dateChange,
92
- format: formatLocale,
93
- isHideCustomSelect: true,
94
- endDateDays: 1
95
- }))));
96
- }, [value, state.disabledEdit, state === null || state === void 0 ? void 0 : state.locale]);
97
- };
98
- export default DateRange;
@@ -1,21 +0,0 @@
1
- .pisell-lowcode__booking-service-header-date-range {
2
- flex: 1.1;
3
- margin-top: 16px;
4
-
5
- .pisell-date-range-picker > div > div {
6
- height: 44px !important;
7
- cursor: pointer !important;
8
- input {
9
- cursor: pointer;
10
- }
11
- }
12
-
13
- .anticon-calendar {
14
- font-size: 20px;
15
- color: #667085;
16
- }
17
- }
18
-
19
- .pisell-lowcode__booking-service-header-date-range-terminal {
20
- margin-top: 0;
21
- }
@@ -1,4 +0,0 @@
1
- import React from 'react';
2
- import './index.less';
3
- declare const _default: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<unknown>>;
4
- export default _default;
@@ -1,134 +0,0 @@
1
- function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
2
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
3
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
4
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
5
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return _typeof(key) === "symbol" ? key : String(key); }
6
- function _toPrimitive(input, hint) { if (_typeof(input) !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (_typeof(res) !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
7
- function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
8
- function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
9
- function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
10
- function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
11
- function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
12
- function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
13
- function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
14
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
15
- function _iterableToArrayLimit(arr, i) { var _i = null == arr ? null : "undefined" != typeof Symbol && arr[Symbol.iterator] || arr["@@iterator"]; if (null != _i) { var _s, _e, _x, _r, _arr = [], _n = !0, _d = !1; try { if (_x = (_i = _i.call(arr)).next, 0 === i) { if (Object(_i) !== _i) return; _n = !1; } else for (; !(_n = (_s = _x.call(_i)).done) && (_arr.push(_s.value), _arr.length !== i); _n = !0); } catch (err) { _d = !0, _e = err; } finally { try { if (!_n && null != _i.return && (_r = _i.return(), Object(_r) !== _r)) return; } finally { if (_d) throw _e; } } return _arr; } }
16
- function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
17
- import React, { useState, forwardRef, useImperativeHandle } from 'react';
18
- import { locales } from '@pisell/utils';
19
- import { PisellModal } from '@pisell/materials';
20
- import { appointmentTypes } from "../../service2/status";
21
- import "./index.less";
22
- var ChangePetModal = function ChangePetModal(props, ref) {
23
- var _useState = useState(false),
24
- _useState2 = _slicedToArray(_useState, 2),
25
- open = _useState2[0],
26
- setOpen = _useState2[1];
27
- var _useState3 = useState({}),
28
- _useState4 = _slicedToArray(_useState3, 2),
29
- params = _useState4[0],
30
- setParams = _useState4[1];
31
- useImperativeHandle(ref, function () {
32
- return {
33
- open: function open(e) {
34
- setParams(e);
35
- setOpen(true);
36
- }
37
- };
38
- });
39
-
40
- /**
41
- * @title: 确认之后的操作
42
- * @description:
43
- * @param {string} type
44
- * @return {*}
45
- * @Author: WangHan
46
- * @Date: 2024-12-12 22:56
47
- */
48
- var handleProduct = function handleProduct(type) {
49
- var ids = params.ids,
50
- service = params.service,
51
- dispatch = params.dispatch,
52
- setGlobalState = params.setGlobalState,
53
- state = params.state,
54
- source = params.source;
55
- var _service = _toConsumableArray(service || []);
56
-
57
- // 如果是更改客户信息,则删除所有的预约商品数据
58
- if (source === 'changeClient') {
59
- if (type === 'ok') {
60
- var _service2;
61
- _service = (_service2 = _service) === null || _service2 === void 0 ? void 0 : _service2.filter(function (item) {
62
- return !appointmentTypes.includes(item.extension_type);
63
- });
64
- } else {
65
- _service = [];
66
- }
67
- } else {
68
- // 更改表单信息
69
- if (type === 'ok') {
70
- var _service3;
71
- // 将商品放在open items中
72
- _service = (_service3 = _service) === null || _service3 === void 0 ? void 0 : _service3.map(function (item) {
73
- if (ids !== null && ids !== void 0 && ids.includes(item._extend.holder_id)) {
74
- return _objectSpread(_objectSpread({}, item), {}, {
75
- _extend: _objectSpread(_objectSpread({}, item._extend || {}), {}, {
76
- holder_id: 0
77
- })
78
- });
79
- }
80
- return item;
81
- });
82
-
83
- // 预约商品不能放在open items中, 所以过滤掉 holder_id为0 并且是预约商品的数据
84
- _service = _service.filter(function (item) {
85
- var _item$_extend;
86
- return !((item === null || item === void 0 ? void 0 : (_item$_extend = item._extend) === null || _item$_extend === void 0 ? void 0 : _item$_extend.holder_id) === 0 && appointmentTypes.includes(item.extension_type));
87
- });
88
- } else {
89
- // 将商品数据清空
90
- _service = _service.filter(function (item) {
91
- return !ids.includes(item._extend.holder_id);
92
- });
93
- }
94
- }
95
-
96
- // 更新服务商品列表
97
- if (dispatch) {
98
- dispatch({
99
- type: 'setService',
100
- payload: {
101
- value: _toConsumableArray(_service),
102
- edit: true
103
- }
104
- });
105
- } else {
106
- setGlobalState({
107
- service: _objectSpread(_objectSpread({}, state.service), {}, {
108
- edit: true,
109
- value: _toConsumableArray(_service)
110
- })
111
- });
112
- }
113
- setOpen(false);
114
- };
115
- return /*#__PURE__*/React.createElement(PisellModal.Information, {
116
- open: open,
117
- platform: "pc",
118
- width: 432,
119
- title: locales.getText('pisell2.text.change.pet.title'),
120
- describe: /*#__PURE__*/React.createElement("div", {
121
- className: "pisell2-change-pet-modal-content"
122
- }, /*#__PURE__*/React.createElement("span", null, locales.getText('pisell2.text.change.pet.content')), /*#__PURE__*/React.createElement("span", null, locales.getText('pisell2.text.change.pet.content1'))),
123
- cancelText: locales.getText('pisell2.text.change.pet.cancel'),
124
- okText: locales.getText('pisell2.text.change.pet.confirm'),
125
- closable: true,
126
- onOk: function onOk() {
127
- return handleProduct('ok');
128
- },
129
- onCancel: function onCancel() {
130
- return handleProduct('cancel');
131
- }
132
- });
133
- };
134
- export default /*#__PURE__*/forwardRef(ChangePetModal);
@@ -1,4 +0,0 @@
1
- .pisell2-change-pet-modal-content {
2
- display: flex;
3
- flex-direction: column;
4
- }
@@ -1,5 +0,0 @@
1
- import React from 'react';
2
- declare const BookingList: ({ items }: {
3
- items: any[];
4
- }) => React.JSX.Element;
5
- export default BookingList;