@pisell/private-materials 6.6.25 → 6.6.26

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 (498) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +2 -2
  6. package/build/lowcode/render/default/view.css +1 -1
  7. package/build/lowcode/render/default/view.js +1 -1
  8. package/build/lowcode/view.css +1 -1
  9. package/build/lowcode/view.js +1 -1
  10. package/es/businessModel/SalesModel/index.d.ts +0 -1
  11. package/es/components/Sales/Cart/utils.d.ts +63 -0
  12. package/es/components/Sales/Summary/utils.d.ts +51 -0
  13. package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -1
  14. package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  15. package/es/components/appointmentBooking/components/Voucher/index.js +22 -7
  16. package/es/components/appointmentBooking/locales.d.ts +363 -0
  17. package/es/components/booking/addons/index.js +3 -2
  18. package/es/components/booking/components/footer/amount.js +1 -1
  19. package/es/components/booking/components/footer/index.js +7 -0
  20. package/es/components/booking/components/footer/utils.d.ts +1 -1
  21. package/es/components/booking/components/footer/utils.js +7 -5
  22. package/es/components/booking/components/voucher/index.js +6 -0
  23. package/es/components/booking/components/voucher/index.less +4 -1
  24. package/es/components/booking/components/voucherModal/index.less +1 -0
  25. package/es/components/booking/editBookingModal/utils.d.ts +12 -0
  26. package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
  27. package/es/components/booking/forms/serve.d.ts +18 -0
  28. package/es/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
  29. package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
  30. package/es/components/booking/info/client/serve.d.ts +2 -0
  31. package/es/components/booking/info/dateRange/index.d.ts +0 -1
  32. package/es/components/booking/info/hooks/useHolderConfig.d.ts +10 -0
  33. package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  34. package/es/components/booking/info/index.d.ts +0 -1
  35. package/es/components/booking/info/pet/serve.d.ts +1 -0
  36. package/es/components/booking/info/service/addTimeModal/serve.d.ts +5 -0
  37. package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
  38. package/es/components/booking/info/service/serve.d.ts +34 -0
  39. package/es/components/booking/info/service2/utils.d.ts +1 -1
  40. package/es/components/booking/info2/cartClientCard/locales.d.ts +21 -0
  41. package/es/components/booking/info2/cartClientCard/types.d.ts +18 -0
  42. package/es/components/booking/info2/cartClientCard/utils.d.ts +3 -0
  43. package/es/components/booking/info2/serve.d.ts +6 -0
  44. package/es/components/booking/info2/service/editService/index.js +33 -2
  45. package/es/components/booking/locales.d.ts +951 -0
  46. package/es/components/checkout/PaymentModal.js +42 -2
  47. package/es/components/checkout/components/AdditionalModule/locales.d.ts +36 -0
  48. package/es/components/checkout/components/PaymentResultToast/types.d.ts +59 -0
  49. package/es/components/checkout/components/PaymentResultToast/utils.d.ts +44 -0
  50. package/es/components/checkout/components/ScrollableList/index.d.ts +5 -0
  51. package/es/components/checkout/components/ScrollableList/types.d.ts +53 -0
  52. package/es/components/checkout/components/WalletPassModule/components/ConflictModal/index.d.ts +0 -1
  53. package/es/components/checkout/components/WalletPassModule/index.js +1 -0
  54. package/es/components/checkout/components/WalletPassModule/types.d.ts +134 -0
  55. package/es/components/checkout/components/WalletPassModule/utils.d.ts +1 -0
  56. package/es/components/checkout/components/WalletPassModule/utils.js +17 -3
  57. package/es/components/checkout/constants.d.ts +2 -0
  58. package/es/components/checkout/hooks/usePaymentLogger.d.ts +2 -0
  59. package/es/components/checkout/hooks/useWalletPass.d.ts +2 -2
  60. package/es/components/checkout/hooks/useWalletPass.js +322 -194
  61. package/es/components/checkout/locales.d.ts +513 -0
  62. package/es/components/checkout/styles.d.ts +67 -0
  63. package/es/components/checkout/types.d.ts +130 -0
  64. package/es/components/checkout/utils.d.ts +3 -0
  65. package/es/components/eftposPay/aggregatePayment/index.d.ts +3 -0
  66. package/es/components/eftposPay/aggregatePayment/types.d.ts +106 -0
  67. package/es/components/eftposPay/amount.d.ts +1 -1
  68. package/es/components/eftposPay/app.d.ts +0 -1
  69. package/es/components/eftposPay/component/fail/failCustom.js +1 -1
  70. package/es/components/eftposPay/const.d.ts +195 -0
  71. package/es/components/eftposPay/device.d.ts +1 -1
  72. package/es/components/eftposPay/hooks.d.ts +2 -2
  73. package/es/components/eftposPay/huifu/hooks.d.ts +25 -0
  74. package/es/components/eftposPay/huifu/types.d.ts +14 -0
  75. package/es/components/eftposPay/locales.d.ts +366 -0
  76. package/es/components/eftposPay/manufacturer.d.ts +8 -0
  77. package/es/components/eftposPay/payo/payment.d.ts +66 -0
  78. package/es/components/eftposPay/store/index.d.ts +362 -0
  79. package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  80. package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
  81. package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  82. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  83. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  84. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  85. package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
  86. package/es/components/list/components/ListItemSkeleton/ListItemSkeleton.d.ts +13 -0
  87. package/es/components/list/components/ListItemSkeleton/index.d.ts +2 -0
  88. package/es/components/list/components/ScrollLoader/ScrollLoader.d.ts +18 -0
  89. package/es/components/list/components/ScrollLoader/index.d.ts +2 -0
  90. package/es/components/list/components/Tab/Tab.d.ts +5 -0
  91. package/es/components/list/components/Tab/index.d.ts +2 -0
  92. package/es/components/list/components/Tab/types.d.ts +14 -0
  93. package/es/components/list/components/TabSkeleton/TabSkeleton.d.ts +11 -0
  94. package/es/components/list/components/TabSkeleton/index.d.ts +2 -0
  95. package/es/components/list/components/WaterfallList/WaterfallList.d.ts +33 -0
  96. package/es/components/list/components/WaterfallList/index.d.ts +2 -0
  97. package/es/components/list/hooks/index.d.ts +5 -0
  98. package/es/components/list/hooks/useDevice.d.ts +24 -0
  99. package/es/components/list/hooks/useListState.d.ts +43 -0
  100. package/es/components/list/hooks/useWaterfall.d.ts +34 -0
  101. package/es/components/list/locales.d.ts +66 -0
  102. package/es/components/list/types.d.ts +177 -0
  103. package/es/components/list/utils/getText.d.ts +53 -0
  104. package/es/components/list/utils/index.d.ts +4 -0
  105. package/es/components/pay/toB/components/CardGroup/index.d.ts +0 -1
  106. package/es/components/pay/toB/components/Content/utils.d.ts +16 -0
  107. package/es/components/pay/toB/hooks.d.ts +12 -0
  108. package/es/components/pay/toB/locales.d.ts +54 -0
  109. package/es/components/pay/toB/store/context.d.ts +3 -0
  110. package/es/components/pay/toB/store/index.d.ts +3 -0
  111. package/es/components/pay/toB/store/provider.d.ts +4 -0
  112. package/es/components/pay/toB/types/index.d.ts +61 -0
  113. package/es/components/pay/toB/types/storeTypes.d.ts +143 -0
  114. package/es/components/pay/toC/PaymentList/utils.d.ts +36 -0
  115. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/Content.d.ts +7 -0
  116. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +3 -0
  117. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +3 -0
  118. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +3 -0
  119. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  120. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
  121. package/es/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +5 -0
  122. package/es/components/pay/toC/PaymentMethods/WalletPass/index.js +166 -145
  123. package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
  124. package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +3 -3
  125. package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  126. package/es/components/pay/toC/WalletPassBlock/index.js +3 -1
  127. package/es/components/pay/toC/index.js +66 -27
  128. package/es/components/pay/toC/locales.d.ts +307 -0
  129. package/es/components/pay/toC/model.d.ts +1 -0
  130. package/es/components/pay/toC/serve.d.ts +18 -0
  131. package/es/components/pay/toC/serve.js +29 -1
  132. package/es/components/pay/toC/status.d.ts +13 -0
  133. package/es/components/pay/toC/utils.d.ts +2 -2
  134. package/es/components/pay/toC/utils.js +4 -0
  135. package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
  136. package/es/components/ruleSetting/locales.d.ts +48 -0
  137. package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
  138. package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
  139. package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
  140. package/es/components/shoppingCart/components/Render/index.d.ts +0 -1
  141. package/es/components/shoppingCart/locales.d.ts +36 -0
  142. package/es/components/shoppingCart/type.d.ts +50 -0
  143. package/es/components/subTotal/locales.d.ts +42 -0
  144. package/es/components/systemSettings/registry/components/docs/images/image-1.png +0 -0
  145. package/es/components/systemSettings/registry/components/docs/images/image-2.png +0 -0
  146. package/es/components/systemSettings/registry/components/docs/images/image-3.png +0 -0
  147. package/es/components/systemSettings/registry/components/docs/images/image-4.png +0 -0
  148. package/es/components/systemSettings/registry/components/docs/images/image-5.png +0 -0
  149. package/es/components/systemSettings/registry/components/docs/images/image-6.png +0 -0
  150. package/es/components/systemSettings/registry/components/docs/images/image-7.png +0 -0
  151. package/es/components/systemSettings/registry/components/docs/images/image-8.png +0 -0
  152. package/es/components/systemSettings/registry/components/docs/images/image.png +0 -0
  153. package/es/components/systemSettings/registry/locales.d.ts +272 -0
  154. package/es/components/systemSettings/registry/services.d.ts +77 -0
  155. package/es/components/systemSettings/registry/types.d.ts +126 -0
  156. package/es/components/systemSettings/registry/utils/typeValidation.d.ts +16 -0
  157. package/es/components/systemSettings/registry/utils/validators.d.ts +8 -0
  158. package/es/components/ticketBooking/components/ProductDisplayAdapter/types.d.ts +115 -0
  159. package/es/components/ticketBooking/components/addServiceVariant/addService.js +7 -4
  160. package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
  161. package/es/components/ticketBooking/components/bookingDataPanel/bookingList/utils.d.ts +6 -0
  162. package/es/components/ticketBooking/components/bookingDataPanel/serve.d.ts +0 -0
  163. package/es/components/ticketBooking/context/IsActiveContext.d.ts +26 -0
  164. package/es/components/ticketBooking/context/OsKeyContext.d.ts +26 -0
  165. package/es/components/ticketBooking/context/index.d.ts +2 -0
  166. package/es/components/ticketBooking/hooks/pisellos/useActiveExecute.d.ts +21 -0
  167. package/es/components/ticketBooking/hooks/pisellos/useCustomer.d.ts +25 -0
  168. package/es/components/ticketBooking/hooks/pisellos/useScanManager.d.ts +6 -0
  169. package/es/components/ticketBooking/locales.d.ts +198 -0
  170. package/es/components/ticketBooking/utils/index.d.ts +1 -1
  171. package/es/components/ticketBooking/utils/productCache.d.ts +75 -0
  172. package/es/components/wallet/utils.d.ts +48 -0
  173. package/es/components/walletList/locales.d.ts +27 -0
  174. package/es/components/workSpaceList/components/AppearanceEdit/constants.d.ts +8 -0
  175. package/es/components/workSpaceList/components/Card/constants.d.ts +2 -0
  176. package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
  177. package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
  178. package/es/hooks/useEngineContext.d.ts +3 -0
  179. package/es/hooks/useLogger.d.ts +2 -0
  180. package/es/hooks/useToast.d.ts +2 -0
  181. package/es/hooks/useTranslationOriginal.d.ts +1 -0
  182. package/es/hooks/useWindowSize.d.ts +5 -0
  183. package/es/plus/clientCard/locales.d.ts +18 -0
  184. package/es/plus/clientCard/types.d.ts +134 -0
  185. package/es/plus/clientCard/utils.d.ts +8 -0
  186. package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +0 -1
  187. package/es/plus/clinetSearch/InfiniteScroll/InfiniteScroll.d.ts +5 -0
  188. package/es/plus/clinetSearch/InfiniteScroll/index.d.ts +2 -0
  189. package/es/plus/clinetSearch/InfiniteScroll/types.d.ts +46 -0
  190. package/es/plus/clinetSearch/locales.d.ts +108 -0
  191. package/es/plus/clinetSearch/types.d.ts +70 -0
  192. package/es/plus/noteModal/locales.d.ts +33 -0
  193. package/es/plus/noteModal/types.d.ts +19 -0
  194. package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.d.ts +0 -1
  195. package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.d.ts +0 -1
  196. package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.d.ts +0 -1
  197. package/es/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.d.ts +0 -1
  198. package/es/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.d.ts +0 -1
  199. package/es/plus/productSelect/ProductCard/SkuCard/components/Action/index.d.ts +0 -1
  200. package/es/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
  201. package/es/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +7 -0
  202. package/es/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.d.ts +0 -1
  203. package/es/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
  204. package/es/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +6 -0
  205. package/es/plus/productSelect/ProductCard/SkuCard/components/Favorite/index.d.ts +0 -1
  206. package/es/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
  207. package/es/plus/productSelect/ProductCard/SkuCard/components/Promotions/index.d.ts +0 -1
  208. package/es/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +6 -0
  209. package/es/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
  210. package/es/plus/productSelect/ProductCard/SkuCard/components/SubTitle/index.d.ts +6 -0
  211. package/es/plus/productSelect/ProductCard/SkuCard/components/Tags/index.d.ts +0 -1
  212. package/es/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +6 -0
  213. package/es/plus/productSelect/ProductCard/SkuCard/components/Title/index.d.ts +6 -0
  214. package/es/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.d.ts +6 -0
  215. package/es/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.d.ts +3 -0
  216. package/es/plus/productSelect/ProductCard/SkuCard/index.d.ts +0 -1
  217. package/es/plus/productSelect/ProductCard/SkuCard/locales.d.ts +42 -0
  218. package/es/plus/productSelect/ProductCard/SkuCard/status.d.ts +162 -0
  219. package/es/plus/productSelect/ProductCard/SkuCard/type.d.ts +298 -0
  220. package/es/plus/productSelect/ProductCard/SkuCard/utils.d.ts +9 -0
  221. package/es/plus/productSelect/ProductList/gridComponents.d.ts +44 -0
  222. package/es/plus/productSelect/components/TabsStructure/TabsStructure.d.ts +30 -0
  223. package/es/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
  224. package/es/plus/selectHolder/locales.d.ts +24 -0
  225. package/es/plus/selectHolder/types.d.ts +104 -0
  226. package/es/plus/selectHolder/utils.d.ts +9 -0
  227. package/es/plus/walletEditor/locales.d.ts +135 -0
  228. package/es/plus/walletPassGallery/locales.d.ts +285 -0
  229. package/es/plus/walletPassGallery/utils.d.ts +48 -0
  230. package/es/pro/Login2.0/shared/types.d.ts +232 -0
  231. package/es/pro/NumberKeyboardPopover/types.d.ts +31 -0
  232. package/es/pro/comprehensiveSearch/components/searchSection/locales.d.ts +15 -0
  233. package/es/pro/comprehensiveSearch/hooks/useNativeScanner.d.ts +5 -0
  234. package/es/pro/comprehensiveSearch/hooks/useTerminalPeripherals.d.ts +9 -0
  235. package/es/pro/comprehensiveSearch/locales.d.ts +15 -0
  236. package/es/pro/comprehensiveSearch/types.d.ts +32 -0
  237. package/es/pro/multiDayTimeSelect/types.d.ts +28 -0
  238. package/es/pro/pisellPhoneKeyboard/locales.d.ts +12 -0
  239. package/es/pro/pisellPriceKeyboardModal/types.d.ts +25 -0
  240. package/es/pro/pisellPriceKeyboardPopover/index.d.ts +2 -0
  241. package/es/pro/pisellPriceKeyboardPopover/types.d.ts +33 -0
  242. package/es/pro/pisellSimplePriceKeyboardPopover/types.d.ts +33 -0
  243. package/es/pro/priceKeyboard/components/cashKeyboard/locales.d.ts +39 -0
  244. package/es/pro/priceKeyboard/components/cashKeyboard/types.d.ts +98 -0
  245. package/es/pro/priceKeyboard/components/discountKeyboard/locales.d.ts +42 -0
  246. package/es/pro/priceKeyboard/components/discountKeyboard/types.d.ts +17 -0
  247. package/es/pro/priceKeyboard/components/paymentKeyboard/locales.d.ts +45 -0
  248. package/es/pro/priceKeyboard/components/paymentKeyboard/types.d.ts +39 -0
  249. package/es/pro/priceKeyboard/components/shortcuts/index.d.ts +18 -0
  250. package/es/pro/priceKeyboard/hooks/rightItems.d.ts +0 -1
  251. package/es/pro/skuDetailModal/locales.d.ts +48 -0
  252. package/es/pro/skuDetailModal/types.d.ts +348 -0
  253. package/lib/businessModel/SalesModel/index.d.ts +0 -1
  254. package/lib/components/Sales/Cart/utils.d.ts +63 -0
  255. package/lib/components/Sales/Summary/utils.d.ts +51 -0
  256. package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -1
  257. package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
  258. package/lib/components/appointmentBooking/components/Voucher/index.js +10 -2
  259. package/lib/components/appointmentBooking/locales.d.ts +363 -0
  260. package/lib/components/booking/addons/index.js +3 -2
  261. package/lib/components/booking/components/footer/amount.js +1 -1
  262. package/lib/components/booking/components/footer/index.js +9 -0
  263. package/lib/components/booking/components/footer/utils.d.ts +1 -1
  264. package/lib/components/booking/components/footer/utils.js +5 -3
  265. package/lib/components/booking/components/voucher/index.js +6 -0
  266. package/lib/components/booking/components/voucher/index.less +4 -1
  267. package/lib/components/booking/components/voucherModal/index.less +1 -0
  268. package/lib/components/booking/editBookingModal/utils.d.ts +12 -0
  269. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -1
  270. package/lib/components/booking/forms/serve.d.ts +18 -0
  271. package/lib/components/booking/hooks/useIsBooking4Shop.d.ts +1 -0
  272. package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
  273. package/lib/components/booking/info/client/serve.d.ts +2 -0
  274. package/lib/components/booking/info/dateRange/index.d.ts +0 -1
  275. package/lib/components/booking/info/hooks/useHolderConfig.d.ts +10 -0
  276. package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
  277. package/lib/components/booking/info/index.d.ts +0 -1
  278. package/lib/components/booking/info/pet/serve.d.ts +1 -0
  279. package/lib/components/booking/info/service/addTimeModal/serve.d.ts +5 -0
  280. package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
  281. package/lib/components/booking/info/service/serve.d.ts +34 -0
  282. package/lib/components/booking/info/service2/utils.d.ts +1 -1
  283. package/lib/components/booking/info2/cartClientCard/locales.d.ts +21 -0
  284. package/lib/components/booking/info2/cartClientCard/types.d.ts +18 -0
  285. package/lib/components/booking/info2/cartClientCard/utils.d.ts +3 -0
  286. package/lib/components/booking/info2/serve.d.ts +6 -0
  287. package/lib/components/booking/info2/service/editService/index.js +48 -24
  288. package/lib/components/booking/locales.d.ts +951 -0
  289. package/lib/components/checkout/PaymentModal.js +24 -1
  290. package/lib/components/checkout/components/AdditionalModule/locales.d.ts +36 -0
  291. package/lib/components/checkout/components/PaymentResultToast/types.d.ts +59 -0
  292. package/lib/components/checkout/components/PaymentResultToast/utils.d.ts +44 -0
  293. package/lib/components/checkout/components/ScrollableList/index.d.ts +5 -0
  294. package/lib/components/checkout/components/ScrollableList/types.d.ts +53 -0
  295. package/lib/components/checkout/components/WalletPassModule/components/ConflictModal/index.d.ts +0 -1
  296. package/lib/components/checkout/components/WalletPassModule/index.js +1 -0
  297. package/lib/components/checkout/components/WalletPassModule/types.d.ts +134 -0
  298. package/lib/components/checkout/components/WalletPassModule/utils.d.ts +1 -0
  299. package/lib/components/checkout/components/WalletPassModule/utils.js +18 -2
  300. package/lib/components/checkout/constants.d.ts +2 -0
  301. package/lib/components/checkout/hooks/usePaymentLogger.d.ts +2 -0
  302. package/lib/components/checkout/hooks/useWalletPass.d.ts +2 -2
  303. package/lib/components/checkout/hooks/useWalletPass.js +160 -107
  304. package/lib/components/checkout/locales.d.ts +513 -0
  305. package/lib/components/checkout/styles.d.ts +67 -0
  306. package/lib/components/checkout/types.d.ts +130 -0
  307. package/lib/components/checkout/utils.d.ts +3 -0
  308. package/lib/components/eftposPay/aggregatePayment/index.d.ts +3 -0
  309. package/lib/components/eftposPay/aggregatePayment/types.d.ts +106 -0
  310. package/lib/components/eftposPay/amount.d.ts +1 -1
  311. package/lib/components/eftposPay/app.d.ts +0 -1
  312. package/lib/components/eftposPay/component/fail/failCustom.js +1 -1
  313. package/lib/components/eftposPay/const.d.ts +195 -0
  314. package/lib/components/eftposPay/device.d.ts +1 -1
  315. package/lib/components/eftposPay/hooks.d.ts +2 -2
  316. package/lib/components/eftposPay/huifu/hooks.d.ts +25 -0
  317. package/lib/components/eftposPay/huifu/types.d.ts +14 -0
  318. package/lib/components/eftposPay/locales.d.ts +366 -0
  319. package/lib/components/eftposPay/manufacturer.d.ts +8 -0
  320. package/lib/components/eftposPay/payo/payment.d.ts +66 -0
  321. package/lib/components/eftposPay/store/index.d.ts +362 -0
  322. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  323. package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
  324. package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
  325. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
  326. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  327. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  328. package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
  329. package/lib/components/list/components/ListItemSkeleton/ListItemSkeleton.d.ts +13 -0
  330. package/lib/components/list/components/ListItemSkeleton/index.d.ts +2 -0
  331. package/lib/components/list/components/ScrollLoader/ScrollLoader.d.ts +18 -0
  332. package/lib/components/list/components/ScrollLoader/index.d.ts +2 -0
  333. package/lib/components/list/components/Tab/Tab.d.ts +5 -0
  334. package/lib/components/list/components/Tab/index.d.ts +2 -0
  335. package/lib/components/list/components/Tab/types.d.ts +14 -0
  336. package/lib/components/list/components/TabSkeleton/TabSkeleton.d.ts +11 -0
  337. package/lib/components/list/components/TabSkeleton/index.d.ts +2 -0
  338. package/lib/components/list/components/WaterfallList/WaterfallList.d.ts +33 -0
  339. package/lib/components/list/components/WaterfallList/index.d.ts +2 -0
  340. package/lib/components/list/hooks/index.d.ts +5 -0
  341. package/lib/components/list/hooks/useDevice.d.ts +24 -0
  342. package/lib/components/list/hooks/useListState.d.ts +43 -0
  343. package/lib/components/list/hooks/useWaterfall.d.ts +34 -0
  344. package/lib/components/list/locales.d.ts +66 -0
  345. package/lib/components/list/types.d.ts +177 -0
  346. package/lib/components/list/utils/getText.d.ts +53 -0
  347. package/lib/components/list/utils/index.d.ts +4 -0
  348. package/lib/components/pay/toB/components/CardGroup/index.d.ts +0 -1
  349. package/lib/components/pay/toB/components/Content/utils.d.ts +16 -0
  350. package/lib/components/pay/toB/hooks.d.ts +12 -0
  351. package/lib/components/pay/toB/locales.d.ts +54 -0
  352. package/lib/components/pay/toB/store/context.d.ts +3 -0
  353. package/lib/components/pay/toB/store/index.d.ts +3 -0
  354. package/lib/components/pay/toB/store/provider.d.ts +4 -0
  355. package/lib/components/pay/toB/types/index.d.ts +61 -0
  356. package/lib/components/pay/toB/types/storeTypes.d.ts +143 -0
  357. package/lib/components/pay/toC/PaymentList/utils.d.ts +36 -0
  358. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/Content.d.ts +7 -0
  359. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +3 -0
  360. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +3 -0
  361. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +3 -0
  362. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
  363. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
  364. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.d.ts +5 -0
  365. package/lib/components/pay/toC/PaymentMethods/WalletPass/index.js +90 -103
  366. package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
  367. package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +2 -2
  368. package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
  369. package/lib/components/pay/toC/WalletPassBlock/index.js +3 -1
  370. package/lib/components/pay/toC/index.js +52 -11
  371. package/lib/components/pay/toC/locales.d.ts +307 -0
  372. package/lib/components/pay/toC/model.d.ts +1 -0
  373. package/lib/components/pay/toC/serve.d.ts +18 -0
  374. package/lib/components/pay/toC/serve.js +6 -0
  375. package/lib/components/pay/toC/status.d.ts +13 -0
  376. package/lib/components/pay/toC/utils.d.ts +2 -2
  377. package/lib/components/pay/toC/utils.js +4 -0
  378. package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
  379. package/lib/components/ruleSetting/locales.d.ts +48 -0
  380. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
  381. package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
  382. package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
  383. package/lib/components/shoppingCart/components/Render/index.d.ts +0 -1
  384. package/lib/components/shoppingCart/locales.d.ts +36 -0
  385. package/lib/components/shoppingCart/type.d.ts +50 -0
  386. package/lib/components/subTotal/locales.d.ts +42 -0
  387. package/lib/components/systemSettings/registry/components/docs/images/image-1.png +0 -0
  388. package/lib/components/systemSettings/registry/components/docs/images/image-2.png +0 -0
  389. package/lib/components/systemSettings/registry/components/docs/images/image-3.png +0 -0
  390. package/lib/components/systemSettings/registry/components/docs/images/image-4.png +0 -0
  391. package/lib/components/systemSettings/registry/components/docs/images/image-5.png +0 -0
  392. package/lib/components/systemSettings/registry/components/docs/images/image-6.png +0 -0
  393. package/lib/components/systemSettings/registry/components/docs/images/image-7.png +0 -0
  394. package/lib/components/systemSettings/registry/components/docs/images/image-8.png +0 -0
  395. package/lib/components/systemSettings/registry/components/docs/images/image.png +0 -0
  396. package/lib/components/systemSettings/registry/locales.d.ts +272 -0
  397. package/lib/components/systemSettings/registry/services.d.ts +77 -0
  398. package/lib/components/systemSettings/registry/types.d.ts +126 -0
  399. package/lib/components/systemSettings/registry/utils/typeValidation.d.ts +16 -0
  400. package/lib/components/systemSettings/registry/utils/validators.d.ts +8 -0
  401. package/lib/components/ticketBooking/components/ProductDisplayAdapter/types.d.ts +115 -0
  402. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +11 -7
  403. package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +0 -1
  404. package/lib/components/ticketBooking/components/bookingDataPanel/bookingList/utils.d.ts +6 -0
  405. package/lib/components/ticketBooking/components/bookingDataPanel/serve.d.ts +0 -0
  406. package/lib/components/ticketBooking/context/IsActiveContext.d.ts +26 -0
  407. package/lib/components/ticketBooking/context/OsKeyContext.d.ts +26 -0
  408. package/lib/components/ticketBooking/context/index.d.ts +2 -0
  409. package/lib/components/ticketBooking/hooks/pisellos/useActiveExecute.d.ts +21 -0
  410. package/lib/components/ticketBooking/hooks/pisellos/useCustomer.d.ts +25 -0
  411. package/lib/components/ticketBooking/hooks/pisellos/useScanManager.d.ts +6 -0
  412. package/lib/components/ticketBooking/locales.d.ts +198 -0
  413. package/lib/components/ticketBooking/utils/index.d.ts +1 -1
  414. package/lib/components/ticketBooking/utils/productCache.d.ts +75 -0
  415. package/lib/components/wallet/utils.d.ts +48 -0
  416. package/lib/components/walletList/locales.d.ts +27 -0
  417. package/lib/components/workSpaceList/components/AppearanceEdit/constants.d.ts +8 -0
  418. package/lib/components/workSpaceList/components/Card/constants.d.ts +2 -0
  419. package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
  420. package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
  421. package/lib/hooks/useEngineContext.d.ts +3 -0
  422. package/lib/hooks/useLogger.d.ts +2 -0
  423. package/lib/hooks/useToast.d.ts +2 -0
  424. package/lib/hooks/useTranslationOriginal.d.ts +1 -0
  425. package/lib/hooks/useWindowSize.d.ts +5 -0
  426. package/lib/plus/clientCard/locales.d.ts +18 -0
  427. package/lib/plus/clientCard/types.d.ts +134 -0
  428. package/lib/plus/clientCard/utils.d.ts +8 -0
  429. package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +0 -1
  430. package/lib/plus/clinetSearch/InfiniteScroll/InfiniteScroll.d.ts +5 -0
  431. package/lib/plus/clinetSearch/InfiniteScroll/index.d.ts +2 -0
  432. package/lib/plus/clinetSearch/InfiniteScroll/types.d.ts +46 -0
  433. package/lib/plus/clinetSearch/locales.d.ts +108 -0
  434. package/lib/plus/clinetSearch/types.d.ts +70 -0
  435. package/lib/plus/noteModal/locales.d.ts +33 -0
  436. package/lib/plus/noteModal/types.d.ts +19 -0
  437. package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA1/index.d.ts +0 -1
  438. package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA2/index.d.ts +0 -1
  439. package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA5/index.d.ts +0 -1
  440. package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardA9/index.d.ts +0 -1
  441. package/lib/plus/productSelect/ProductCard/SkuCard/SkuCardCustom/index.d.ts +0 -1
  442. package/lib/plus/productSelect/ProductCard/SkuCard/components/Action/index.d.ts +0 -1
  443. package/lib/plus/productSelect/ProductCard/SkuCard/components/Capacity/index.d.ts +1 -1
  444. package/lib/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.d.ts +7 -0
  445. package/lib/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.d.ts +0 -1
  446. package/lib/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.d.ts +1 -1
  447. package/lib/plus/productSelect/ProductCard/SkuCard/components/Duration/index.d.ts +6 -0
  448. package/lib/plus/productSelect/ProductCard/SkuCard/components/Favorite/index.d.ts +0 -1
  449. package/lib/plus/productSelect/ProductCard/SkuCard/components/MemberPrice/index.d.ts +1 -1
  450. package/lib/plus/productSelect/ProductCard/SkuCard/components/Promotions/index.d.ts +0 -1
  451. package/lib/plus/productSelect/ProductCard/SkuCard/components/Resource/index.d.ts +6 -0
  452. package/lib/plus/productSelect/ProductCard/SkuCard/components/Stock/index.d.ts +1 -1
  453. package/lib/plus/productSelect/ProductCard/SkuCard/components/SubTitle/index.d.ts +6 -0
  454. package/lib/plus/productSelect/ProductCard/SkuCard/components/Tags/index.d.ts +0 -1
  455. package/lib/plus/productSelect/ProductCard/SkuCard/components/Time/index.d.ts +6 -0
  456. package/lib/plus/productSelect/ProductCard/SkuCard/components/Title/index.d.ts +6 -0
  457. package/lib/plus/productSelect/ProductCard/SkuCard/components/TooltipTags/index.d.ts +6 -0
  458. package/lib/plus/productSelect/ProductCard/SkuCard/components/WarningLists/index.d.ts +3 -0
  459. package/lib/plus/productSelect/ProductCard/SkuCard/index.d.ts +0 -1
  460. package/lib/plus/productSelect/ProductCard/SkuCard/locales.d.ts +42 -0
  461. package/lib/plus/productSelect/ProductCard/SkuCard/status.d.ts +162 -0
  462. package/lib/plus/productSelect/ProductCard/SkuCard/type.d.ts +298 -0
  463. package/lib/plus/productSelect/ProductCard/SkuCard/utils.d.ts +9 -0
  464. package/lib/plus/productSelect/ProductList/gridComponents.d.ts +44 -0
  465. package/lib/plus/productSelect/components/TabsStructure/TabsStructure.d.ts +30 -0
  466. package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
  467. package/lib/plus/selectHolder/locales.d.ts +24 -0
  468. package/lib/plus/selectHolder/types.d.ts +104 -0
  469. package/lib/plus/selectHolder/utils.d.ts +9 -0
  470. package/lib/plus/walletEditor/locales.d.ts +135 -0
  471. package/lib/plus/walletPassGallery/locales.d.ts +285 -0
  472. package/lib/plus/walletPassGallery/utils.d.ts +48 -0
  473. package/lib/pro/Login2.0/shared/types.d.ts +232 -0
  474. package/lib/pro/NumberKeyboardPopover/types.d.ts +31 -0
  475. package/lib/pro/comprehensiveSearch/components/searchSection/locales.d.ts +15 -0
  476. package/lib/pro/comprehensiveSearch/hooks/useNativeScanner.d.ts +5 -0
  477. package/lib/pro/comprehensiveSearch/hooks/useTerminalPeripherals.d.ts +9 -0
  478. package/lib/pro/comprehensiveSearch/locales.d.ts +15 -0
  479. package/lib/pro/comprehensiveSearch/types.d.ts +32 -0
  480. package/lib/pro/multiDayTimeSelect/types.d.ts +28 -0
  481. package/lib/pro/pisellPhoneKeyboard/locales.d.ts +12 -0
  482. package/lib/pro/pisellPriceKeyboardModal/types.d.ts +25 -0
  483. package/lib/pro/pisellPriceKeyboardPopover/index.d.ts +2 -0
  484. package/lib/pro/pisellPriceKeyboardPopover/types.d.ts +33 -0
  485. package/lib/pro/pisellSimplePriceKeyboardPopover/types.d.ts +33 -0
  486. package/lib/pro/priceKeyboard/components/cashKeyboard/locales.d.ts +39 -0
  487. package/lib/pro/priceKeyboard/components/cashKeyboard/types.d.ts +98 -0
  488. package/lib/pro/priceKeyboard/components/discountKeyboard/locales.d.ts +42 -0
  489. package/lib/pro/priceKeyboard/components/discountKeyboard/types.d.ts +17 -0
  490. package/lib/pro/priceKeyboard/components/paymentKeyboard/locales.d.ts +45 -0
  491. package/lib/pro/priceKeyboard/components/paymentKeyboard/types.d.ts +39 -0
  492. package/lib/pro/priceKeyboard/components/shortcuts/index.d.ts +18 -0
  493. package/lib/pro/priceKeyboard/hooks/rightItems.d.ts +0 -1
  494. package/lib/pro/skuDetailModal/locales.d.ts +48 -0
  495. package/lib/pro/skuDetailModal/types.d.ts +348 -0
  496. package/lowcode/eco-cup-list/meta.ts +63 -0
  497. package/lowcode/eco-customer-list/meta.ts +63 -0
  498. package/package.json +2 -2
@@ -19,12 +19,12 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
19
19
  function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
20
20
  function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
21
21
  import { useState, useEffect, useMemo, useRef } from 'react';
22
- import { useMemoizedFn } from 'ahooks';
22
+ import { useMemoizedFn, useUpdateEffect } from 'ahooks';
23
23
  import { uniqueByKey, locales } from '@pisell/utils';
24
24
  import { useToast } from '@pisell/materials';
25
25
  import dayjs from 'dayjs';
26
26
  import { usePisellOS } from "../../../hooks/useEngineContext";
27
- import { formatDiscountWalletData, formatMachineCodeServer2CardList, isSameContent } from "../components/WalletPassModule/utils";
27
+ import { formatDiscountWalletData, formatMachineCodeServer2CardList, getVoucherAvailableStatus, isSameContent } from "../components/WalletPassModule/utils";
28
28
  import usePaymentLogger from "./usePaymentLogger";
29
29
  import { isWalkIn } from "../../booking/utils";
30
30
  import { useActiveExecute } from "../../ticketBooking/hooks/pisellos";
@@ -36,21 +36,33 @@ import { useShopDiscountModule } from "../../ticketBooking/hooks/pisellos/useSho
36
36
  export var useWalletPass = function useWalletPass(props) {
37
37
  var onSelectChange = props.onSelectChange,
38
38
  customAmount = props.customAmount,
39
- clientId = props.clientId;
39
+ clientId = props.clientId,
40
+ totalAmount = props.totalAmount;
40
41
  var logger = usePaymentLogger();
41
42
  var _useActiveExecute = useActiveExecute(),
42
43
  executeIfActive = _useActiveExecute.executeIfActive;
43
44
 
44
- // 钱包推荐列表
45
+ // 钱包推荐列表(推荐选中的券)
45
46
  var _useState = useState([]),
46
47
  _useState2 = _slicedToArray(_useState, 2),
47
48
  walletRecommendList = _useState2[0],
48
49
  setWalletRecommendList = _useState2[1];
49
- // 用户识别码列表
50
+ // 用户识别码列表(全部券列表,包括可用和不可用)
50
51
  var _useState3 = useState([]),
51
52
  _useState4 = _slicedToArray(_useState3, 2),
52
53
  userIdentificationCodes = _useState4[0],
53
54
  setUserIdentificationCodes = _useState4[1];
55
+ // 可计算的券列表(transformList)
56
+ var _useState5 = useState([]),
57
+ _useState6 = _slicedToArray(_useState5, 2),
58
+ transformList = _useState6[0],
59
+ setTransformList = _useState6[1];
60
+ // 不适用的券列表(noApplicableVoucher)
61
+ var _useState7 = useState([]),
62
+ _useState8 = _slicedToArray(_useState7, 2),
63
+ noApplicableVoucher = _useState8[0],
64
+ setNoApplicableVoucher = _useState8[1];
65
+
54
66
  // 保存初始顺序的数组
55
67
  var initialOrderedDataRef = useRef([]);
56
68
 
@@ -60,31 +72,34 @@ export var useWalletPass = function useWalletPass(props) {
60
72
  // 跟踪执行过 handleConfirmEditAmount 的 data.id
61
73
  var confirmedEditAmountIdsRef = useRef([]);
62
74
 
63
- // 保存setTimeout的引用,用于清理
64
- var timeoutRef = useRef(null);
65
-
66
- // 搜索用户识别码列表
67
- var _useState5 = useState([]),
68
- _useState6 = _slicedToArray(_useState5, 2),
69
- searchIdentificationCodeList = _useState6[0],
70
- setSearchIdentificationCodeList = _useState6[1];
71
- var _useState7 = useState({}),
72
- _useState8 = _slicedToArray(_useState7, 2),
73
- orderInfo = _useState8[0],
74
- setOrderInfo = _useState8[1];
75
-
76
- // 当前选中的钱包
75
+ // 搜索用户识别码列表(addList)
77
76
  var _useState9 = useState([]),
78
77
  _useState10 = _slicedToArray(_useState9, 2),
79
- selectedWallet = _useState10[0],
80
- setSelectedWallet = _useState10[1];
78
+ searchIdentificationCodeList = _useState10[0],
79
+ setSearchIdentificationCodeList = _useState10[1];
80
+ var _useState11 = useState({}),
81
+ _useState12 = _slicedToArray(_useState11, 2),
82
+ orderInfo = _useState12[0],
83
+ setOrderInfo = _useState12[1];
84
+
85
+ // 当前选中的钱包(完整对象)
86
+ var _useState13 = useState([]),
87
+ _useState14 = _slicedToArray(_useState13, 2),
88
+ selectedWallet = _useState14[0],
89
+ setSelectedWallet = _useState14[1];
81
90
  var selectedWalletRef = useRef([]);
82
91
 
92
+ // 当前选中的券ID列表(按选中顺序)
93
+ var _useState15 = useState([]),
94
+ _useState16 = _slicedToArray(_useState15, 2),
95
+ selectedVoucherIds = _useState16[0],
96
+ setSelectedVoucherIds = _useState16[1];
97
+
83
98
  // 不可用的钱包数据
84
- var _useState11 = useState([]),
85
- _useState12 = _slicedToArray(_useState11, 2),
86
- disabledWalletData = _useState12[0],
87
- setDisabledWalletData = _useState12[1];
99
+ var _useState17 = useState([]),
100
+ _useState18 = _slicedToArray(_useState17, 2),
101
+ disabledWalletData = _useState18[0],
102
+ setDisabledWalletData = _useState18[1];
88
103
 
89
104
  // 设置钱包但不设置使用默认钱包
90
105
  var notSetWalletSelectRef = useRef(false);
@@ -92,7 +107,13 @@ export var useWalletPass = function useWalletPass(props) {
92
107
  // 是否显示最佳优惠
93
108
  var showBestToastRef = useRef(false);
94
109
 
95
- // 当前选中的钱包id
110
+ // 商品列表
111
+ var _useState19 = useState([]),
112
+ _useState20 = _slicedToArray(_useState19, 2),
113
+ products = _useState20[0],
114
+ setProducts = _useState20[1];
115
+
116
+ // 当前选中的钱包id(保留兼容性)
96
117
  var selectedWalletIds = useMemo(function () {
97
118
  return selectedWallet.map(function (item) {
98
119
  return item.id;
@@ -102,24 +123,30 @@ export var useWalletPass = function useWalletPass(props) {
102
123
  var Toast = useToast();
103
124
 
104
125
  // 加载状态
105
- var _useState13 = useState(false),
106
- _useState14 = _slicedToArray(_useState13, 2),
107
- loading = _useState14[0],
108
- setLoading = _useState14[1];
126
+ var _useState21 = useState(false),
127
+ _useState22 = _slicedToArray(_useState21, 2),
128
+ loading = _useState22[0],
129
+ setLoading = _useState22[1];
109
130
  // 错误信息
110
- var _useState15 = useState(null),
111
- _useState16 = _slicedToArray(_useState15, 2),
112
- error = _useState16[0],
113
- setError = _useState16[1];
114
- var _useState17 = useState([]),
115
- _useState18 = _slicedToArray(_useState17, 2),
116
- discountList = _useState18[0],
117
- setDiscountList = _useState18[1];
131
+ var _useState23 = useState(null),
132
+ _useState24 = _slicedToArray(_useState23, 2),
133
+ error = _useState24[0],
134
+ setError = _useState24[1];
135
+ var _useState25 = useState([]),
136
+ _useState26 = _slicedToArray(_useState25, 2),
137
+ discountList = _useState26[0],
138
+ setDiscountList = _useState26[1];
118
139
 
119
140
  // 获取checkout模块
120
141
  var checkoutModule = pisellos.getModule('checkout');
121
142
  var shopDiscount = useShopDiscountModule();
122
143
  var paymentModule = checkoutModule === null || checkoutModule === void 0 ? void 0 : checkoutModule.payment;
144
+
145
+ // 获取钱包计算器
146
+ var walletPassEvaluator = useMemo(function () {
147
+ var _paymentModule$window, _paymentModule$window2;
148
+ return paymentModule === null || paymentModule === void 0 || (_paymentModule$window = paymentModule.window) === null || _paymentModule$window === void 0 || (_paymentModule$window2 = _paymentModule$window.getWalletPassEvaluator) === null || _paymentModule$window2 === void 0 ? void 0 : _paymentModule$window2.call(_paymentModule$window);
149
+ }, []);
123
150
  var setWalletSelect = useMemoizedFn(function (data) {
124
151
  setSelectedWallet(data);
125
152
  selectedWalletRef.current = data;
@@ -276,15 +303,77 @@ export var useWalletPass = function useWalletPass(props) {
276
303
  orderedResult.push.apply(orderedResult, _toConsumableArray(newItems));
277
304
  return orderedResult;
278
305
  });
306
+
307
+ // 合并计算数据源:transformList + searchIdentificationCodeList(addList)
308
+ var allVouchersForCalculation = useMemo(function () {
309
+ return [].concat(_toConsumableArray(transformList || []), _toConsumableArray(searchIdentificationCodeList || []));
310
+ }, [transformList, searchIdentificationCodeList]);
311
+
312
+ // 根据选中的券ID获取选中的券对象列表(保持选中顺序)
313
+ var selectedVouchers = useMemo(function () {
314
+ return selectedVoucherIds.map(function (id) {
315
+ return allVouchersForCalculation.find(function (v) {
316
+ return v.id === id;
317
+ });
318
+ }).filter(Boolean);
319
+ }, [selectedVoucherIds, allVouchersForCalculation]);
320
+
321
+ // 前端计算展示列表和当前券的详细信息
322
+ var _useMemo = useMemo(function () {
323
+ if (!walletPassEvaluator || !allVouchersForCalculation.length || !totalAmount) {
324
+ return {
325
+ displayVouchers: [].concat(_toConsumableArray(transformList || []), _toConsumableArray(noApplicableVoucher || [])),
326
+ displayOtherVouchers: searchIdentificationCodeList || [],
327
+ selectedWithDetails: [],
328
+ totalDeduction: 0
329
+ };
330
+ }
331
+
332
+ // 有选中的券,重新计算(基于 transformList + searchIdentificationCodeList)
333
+ var result = walletPassEvaluator.recalculateVouchers(allVouchersForCalculation, selectedVouchers, totalAmount, products || []);
334
+
335
+ // 分离当前客户的券和其他客户的券(搜索添加的券)
336
+ var currentCustomerVouchers = [];
337
+ var otherCustomerVouchers = [];
338
+ result.allWithUpdatedStatus.forEach(function (voucher) {
339
+ // 判断是否是搜索添加的券
340
+ var isSearchVoucher = searchIdentificationCodeList.some(function (item) {
341
+ return item.id === voucher.id;
342
+ });
343
+ if (isSearchVoucher) {
344
+ otherCustomerVouchers.push(voucher);
345
+ } else {
346
+ currentCustomerVouchers.push(voucher);
347
+ }
348
+ });
349
+ return {
350
+ displayVouchers: [].concat(currentCustomerVouchers, _toConsumableArray(noApplicableVoucher || [])),
351
+ displayOtherVouchers: otherCustomerVouchers,
352
+ selectedWithDetails: result.selectedWithDetails,
353
+ totalDeduction: result.selectedWithDetails.reduce(function (sum, v) {
354
+ return sum + (v.actualDeduction || 0);
355
+ }, 0)
356
+ };
357
+ }, [selectedVouchers, allVouchersForCalculation, transformList, searchIdentificationCodeList, noApplicableVoucher, totalAmount, products]),
358
+ displayVouchers = _useMemo.displayVouchers,
359
+ displayOtherVouchers = _useMemo.displayOtherVouchers,
360
+ selectedWithDetails = _useMemo.selectedWithDetails,
361
+ totalDeduction = _useMemo.totalDeduction;
362
+
363
+ // 监听 selectedWithDetails 变化,自动通知外部
364
+ useUpdateEffect(function () {
365
+ notifySelectChange(selectedWithDetails);
366
+ setLoading(false);
367
+ }, [selectedWithDetails]);
279
368
  var data = useMemo(function () {
280
- // 使用初始顺序作为基础,保持原有顺序
281
- return formatMachineCodeServer2CardList(uniqueByKey(mergeDataWithInitialOrder([].concat(_toConsumableArray(selectedWallet), _toConsumableArray(userIdentificationCodes))), 'id'), selectedWalletIds);
282
- }, [userIdentificationCodes, selectedWalletIds, selectedWallet]);
369
+ // 使用前端计算后的数据
370
+ return formatMachineCodeServer2CardList(uniqueByKey(mergeDataWithInitialOrder([].concat(_toConsumableArray(selectedWallet), _toConsumableArray(displayVouchers), _toConsumableArray(displayOtherVouchers))), 'id'), selectedVoucherIds);
371
+ }, [displayVouchers, displayOtherVouchers, selectedVoucherIds, selectedWallet]);
283
372
 
284
- // 获取钱包推荐列表
285
- var fetchWalletRecommendList = useMemoizedFn( /*#__PURE__*/function () {
373
+ // 获取用户识别码列表
374
+ var fetchUserIdentificationCodes = useMemoizedFn( /*#__PURE__*/function () {
286
375
  var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
287
- var result;
376
+ var result, newData;
288
377
  return _regeneratorRuntime().wrap(function _callee$(_context) {
289
378
  while (1) switch (_context.prev = _context.next) {
290
379
  case 0:
@@ -292,66 +381,31 @@ export var useWalletPass = function useWalletPass(props) {
292
381
  setError(null);
293
382
  _context.prev = 2;
294
383
  _context.next = 5;
295
- return paymentModule.wallet.getWalletPassRecommendListAsync(params);
384
+ return paymentModule.wallet.getUserIdentificationCodeListAsync(params);
296
385
  case 5:
297
386
  result = _context.sent;
298
- setWalletRecommendList(result);
387
+ newData = uniqueByKey([].concat(_toConsumableArray(result), _toConsumableArray(selectedWalletRef.current)), 'id'); // const orderedData = mergeDataWithInitialOrder(newData);
388
+ setUserIdentificationCodes(newData);
299
389
  return _context.abrupt("return", result);
300
- case 10:
301
- _context.prev = 10;
390
+ case 11:
391
+ _context.prev = 11;
302
392
  _context.t0 = _context["catch"](2);
303
- setError(_context.t0 instanceof Error ? _context.t0.message : '获取钱包推荐列表失败');
393
+ setError(_context.t0 instanceof Error ? _context.t0.message : '获取用户识别码列表失败');
304
394
  throw _context.t0;
305
- case 14:
306
- _context.prev = 14;
395
+ case 15:
396
+ _context.prev = 15;
307
397
  setLoading(false);
308
- return _context.finish(14);
309
- case 17:
398
+ return _context.finish(15);
399
+ case 18:
310
400
  case "end":
311
401
  return _context.stop();
312
402
  }
313
- }, _callee, null, [[2, 10, 14, 17]]);
403
+ }, _callee, null, [[2, 11, 15, 18]]);
314
404
  }));
315
405
  return function (_x) {
316
406
  return _ref.apply(this, arguments);
317
407
  };
318
408
  }());
319
- // 获取用户识别码列表
320
- var fetchUserIdentificationCodes = useMemoizedFn( /*#__PURE__*/function () {
321
- var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
322
- var result, newData;
323
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
324
- while (1) switch (_context2.prev = _context2.next) {
325
- case 0:
326
- setLoading(true);
327
- setError(null);
328
- _context2.prev = 2;
329
- _context2.next = 5;
330
- return paymentModule.wallet.getUserIdentificationCodeListAsync(params);
331
- case 5:
332
- result = _context2.sent;
333
- newData = uniqueByKey([].concat(_toConsumableArray(result), _toConsumableArray(selectedWalletRef.current)), 'id'); // const orderedData = mergeDataWithInitialOrder(newData);
334
- setUserIdentificationCodes(newData);
335
- return _context2.abrupt("return", result);
336
- case 11:
337
- _context2.prev = 11;
338
- _context2.t0 = _context2["catch"](2);
339
- setError(_context2.t0 instanceof Error ? _context2.t0.message : '获取用户识别码列表失败');
340
- throw _context2.t0;
341
- case 15:
342
- _context2.prev = 15;
343
- setLoading(false);
344
- return _context2.finish(15);
345
- case 18:
346
- case "end":
347
- return _context2.stop();
348
- }
349
- }, _callee2, null, [[2, 11, 15, 18]]);
350
- }));
351
- return function (_x2) {
352
- return _ref2.apply(this, arguments);
353
- };
354
- }());
355
409
 
356
410
  // 获取缓存数据
357
411
  var getCachedWalletRecommendList = useMemoizedFn(function () {
@@ -383,51 +437,110 @@ export var useWalletPass = function useWalletPass(props) {
383
437
  var handleSearchIdentificationCodeCompleted = useMemoizedFn(function (data) {
384
438
  var currentSearchResults = data.currentSearchResults,
385
439
  cachedSearchResults = data.cachedSearchResults;
440
+ // 使用 walletPassEvaluator.searchVoucherFormat 格式化搜索结果
441
+ var formattedResults = currentSearchResults;
442
+ if (walletPassEvaluator && currentSearchResults.length > 0 && totalAmount) {
443
+ formattedResults = walletPassEvaluator.searchVoucherFormat({
444
+ vouchers: currentSearchResults,
445
+ orderTotalAmount: totalAmount,
446
+ products: products || []
447
+ });
448
+ }
449
+
450
+ // 格式化缓存的搜索结果(如果存在)
451
+ var formattedCachedResults = cachedSearchResults || [];
452
+ if (walletPassEvaluator && cachedSearchResults && cachedSearchResults.length > 0 && totalAmount) {
453
+ formattedCachedResults = walletPassEvaluator.searchVoucherFormat({
454
+ vouchers: cachedSearchResults,
455
+ orderTotalAmount: totalAmount,
456
+ products: products || []
457
+ });
458
+ }
459
+
460
+ // 合并缓存的搜索结果和当前搜索结果,并去重
461
+ var mergedSearchResults = uniqueByKey([].concat(_toConsumableArray(formattedCachedResults || []), _toConsumableArray(formattedResults)), 'id');
386
462
  var isAvailableData = [];
387
463
  var isDisabledData = [];
388
- if (currentSearchResults.length > 0) {
389
- currentSearchResults.forEach(function (item) {
390
- if (!!item.unified_available_status) {
464
+ if (formattedResults.length > 0) {
465
+ formattedResults.forEach(function (item) {
466
+ if (getVoucherAvailableStatus(item)) {
391
467
  isAvailableData.push(item);
392
468
  } else {
393
469
  isDisabledData.push(item);
394
470
  }
395
471
  });
396
472
  }
473
+ var availableData = mergedSearchResults.filter(function (item) {
474
+ return getVoucherAvailableStatus(item);
475
+ });
476
+ // 更新不可用钱包数据(需要包含所有搜索结果中的不可用数据)
477
+ var allDisabledData = mergedSearchResults.filter(function (item) {
478
+ return !getVoucherAvailableStatus(item);
479
+ });
480
+ setDisabledWalletData(allDisabledData);
397
481
 
398
- // 更新不可用钱包数据
399
- setDisabledWalletData(isDisabledData);
482
+ // 如果只有一个可用券,自动选中
400
483
  var newValues = _toConsumableArray(selectedWalletRef.current);
401
484
  if (isAvailableData.length === 1) {
402
485
  newValues = [].concat(_toConsumableArray(selectedWalletRef.current), isAvailableData);
403
486
  }
404
- setSearchIdentificationCodeList(cachedSearchResults);
487
+
488
+ // 更新搜索结果列表(合并缓存和当前搜索结果,使用去重后的数据)
489
+ setSearchIdentificationCodeList(availableData);
490
+ setNoApplicableVoucher(allDisabledData);
405
491
  setWalletSelect(newValues);
406
- handleFetchUserIdentificationCodes(newValues.map(function (item) {
492
+
493
+ // 更新选中的券ID列表(会触发 useMemo 重新计算 selectedWithDetails)
494
+ setSelectedVoucherIds(newValues.map(function (item) {
407
495
  return item.id;
408
496
  }));
497
+
498
+ // useUpdateEffect 会自动在 selectedWithDetails 更新后通知外部
409
499
  });
410
500
  var onOrderCreated = useMemoizedFn(function () {
501
+ var _paymentModule$wallet, _paymentModule$wallet2;
411
502
  var orderInfo = checkoutModule.getOrderOriginalData();
412
503
  setOrderInfo(orderInfo);
504
+
505
+ // 从缓存获取初始化数据(包含新的数据结构)
413
506
  var recommendList = getCachedWalletRecommendList();
414
507
  var userIdentificationCodes = getCachedUserIdentificationCodes();
508
+
509
+ // 获取 transformList 和 noApplicableVoucher(从 paymentModule 的缓存中)
510
+ // 这些数据在 initializeWalletDataAsync 中已经计算并缓存
511
+ var walletInitData = (paymentModule === null || paymentModule === void 0 || (_paymentModule$wallet = paymentModule.wallet) === null || _paymentModule$wallet === void 0 || (_paymentModule$wallet2 = _paymentModule$wallet.getStoredWalletInitData) === null || _paymentModule$wallet2 === void 0 ? void 0 : _paymentModule$wallet2.call(_paymentModule$wallet)) || {};
512
+ var transformListData = walletInitData.transformList || userIdentificationCodes;
513
+ var noApplicableVoucherData = walletInitData.noApplicableVoucher || [];
514
+ var productsData = walletInitData.products || [];
415
515
  var initialData = [].concat(_toConsumableArray(recommendList), _toConsumableArray(userIdentificationCodes));
416
516
 
417
517
  // 设置钱包推荐列表
418
518
  setWalletRecommendList(recommendList);
419
- // 设置用户识别码列表
420
- setUserIdentificationCodes(initialData);
519
+ // 设置用户识别码列表(全部券)
520
+ setUserIdentificationCodes(userIdentificationCodes);
521
+ // 设置可计算的券列表
522
+ setTransformList(transformListData);
523
+ // 设置不适用的券列表
524
+ setNoApplicableVoucher(noApplicableVoucherData);
525
+ // 设置产品列表
526
+ setProducts(productsData);
421
527
  // 设置初始顺序
422
528
  initialOrderedDataRef.current = initialData;
529
+
423
530
  // 设置默认选中钱包
424
531
  if (!notSetWalletSelectRef.current) {
425
532
  setWalletSelect(recommendList);
533
+ // 设置默认选中的券ID
534
+ setSelectedVoucherIds(recommendList.map(function (item) {
535
+ return item.id;
536
+ }));
426
537
  var _select = paymentModule.wallet.formatWalletPassList2PreparePayments(recommendList).map(function (item) {
427
538
  return {
428
539
  code: item.tag,
429
540
  voucher_id: item.voucher_id,
430
- amount: item.amount || 0
541
+ amount: item.amount || 0,
542
+ wallet_pass_usage_unit: item.wallet_pass_usage_unit,
543
+ wallet_pass_use_value: item.wallet_pass_use_value
431
544
  };
432
545
  });
433
546
  logger === null || logger === void 0 || logger.addLog({
@@ -439,6 +552,7 @@ export var useWalletPass = function useWalletPass(props) {
439
552
  onSelectChange === null || onSelectChange === void 0 || onSelectChange(_select);
440
553
  } else {
441
554
  setWalletSelect([]);
555
+ setSelectedVoucherIds([]);
442
556
  notSetWalletSelectRef.current = false;
443
557
  onSelectChange === null || onSelectChange === void 0 || onSelectChange([]);
444
558
  }
@@ -485,27 +599,27 @@ export var useWalletPass = function useWalletPass(props) {
485
599
  setLoading(false);
486
600
  });
487
601
  var handlePaymentStarted = useMemoizedFn( /*#__PURE__*/function () {
488
- var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(params) {
489
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
490
- while (1) switch (_context3.prev = _context3.next) {
602
+ var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(params) {
603
+ return _regeneratorRuntime().wrap(function _callee2$(_context2) {
604
+ while (1) switch (_context2.prev = _context2.next) {
491
605
  case 0:
492
- if (!(params.paymentMethodCode !== 'VOUCHER_BATCH')) {
493
- _context3.next = 4;
606
+ if (!(params.paymentMethodCode !== 'VOUCHER_BATCH' && Number(customAmount || 0) > 0)) {
607
+ _context2.next = 4;
494
608
  break;
495
609
  }
496
610
  notSetWalletSelectRef.current = true;
497
- _context3.next = 4;
611
+ _context2.next = 4;
498
612
  return checkoutModule.initWalletData({
499
613
  order_wait_pay_amount: Number(customAmount)
500
614
  });
501
615
  case 4:
502
616
  case "end":
503
- return _context3.stop();
617
+ return _context2.stop();
504
618
  }
505
- }, _callee3);
619
+ }, _callee2);
506
620
  }));
507
- return function (_x3) {
508
- return _ref3.apply(this, arguments);
621
+ return function (_x2) {
622
+ return _ref2.apply(this, arguments);
509
623
  };
510
624
  }());
511
625
 
@@ -557,16 +671,6 @@ export var useWalletPass = function useWalletPass(props) {
557
671
  };
558
672
  }, [paymentModule]);
559
673
 
560
- // 组件卸载时清理定时器
561
- useEffect(function () {
562
- return function () {
563
- if (timeoutRef.current) {
564
- clearTimeout(timeoutRef.current);
565
- timeoutRef.current = null;
566
- }
567
- };
568
- }, []);
569
-
570
674
  // 所有列表 包含推荐列表、用户识别码列表、搜索用户识别码列表
571
675
  var allList = useMemo(function () {
572
676
  var reversedSearchData = _toConsumableArray(searchIdentificationCodeList).reverse();
@@ -582,31 +686,27 @@ export var useWalletPass = function useWalletPass(props) {
582
686
  });
583
687
  });
584
688
 
585
- // 处理获取用户识别码
586
- var handleFetchUserIdentificationCodes = useMemoizedFn(function (value, walletRecommendList) {
587
- var val = uniqueByKey(walletRecommendList || allList, 'id').filter(function (item) {
588
- return value.includes(item.id);
589
- });
590
- var prepare_payments = paymentModule.wallet.formatWalletPassList2PreparePayments(val);
689
+ // 纯粹的通知函数,将选中的券详情通知给外部
690
+ var notifySelectChange = useMemoizedFn(function (selectedDetails) {
691
+ var prepare_payments = paymentModule.wallet.formatWalletPassList2PreparePayments(selectedDetails);
591
692
  var select = prepare_payments.map(function (item) {
592
693
  return {
593
694
  voucher_id: item.voucher_id,
594
695
  amount: item.amount,
595
- code: item.tag
696
+ code: item.tag,
697
+ wallet_pass_usage_unit: item.wallet_pass_usage_unit,
698
+ wallet_pass_use_value: item.wallet_pass_use_value
596
699
  };
597
700
  });
598
701
  logger === null || logger === void 0 || logger.addLog({
599
702
  type: 'info',
600
- title: 'useWalletPass_handleFetchUserIdentificationCodes onSelectChange 开始调用',
601
- metadata: {}
703
+ title: 'useWalletPass_notifySelectChange 通知外部选择变化',
704
+ metadata: {
705
+ selectedDetails: selectedDetails,
706
+ select: select
707
+ }
602
708
  });
603
709
  onSelectChange === null || onSelectChange === void 0 || onSelectChange(select);
604
- fetchUserIdentificationCodes({
605
- prepare_payments: prepare_payments,
606
- available: 2,
607
- filter_prepare_wallet_pass: 1,
608
- other_exact_codes: getOtherExactCodes()
609
- });
610
710
  });
611
711
  var handleSearchIdentificationCode = useMemoizedFn(function (value) {
612
712
  return paymentModule.wallet.searchIdentificationCodeAsync({
@@ -615,13 +715,46 @@ export var useWalletPass = function useWalletPass(props) {
615
715
  });
616
716
  });
617
717
 
618
- // 处理选中钱包
718
+ // 处理选中钱包(只更新选中ID,触发前端重新计算)
619
719
  var handleSelectWallet = useMemoizedFn(function (value) {
620
- var val = userIdentificationCodes.filter(function (item) {
720
+ setLoading(true);
721
+
722
+ // 1. 找出被取消选中的券ID
723
+ var deselectedIds = selectedVoucherIds.filter(function (id) {
724
+ return !value.includes(id);
725
+ });
726
+
727
+ // 2. 如果有被取消选中的券,检查是否需要重置 edit_current_amount
728
+ if (deselectedIds.length > 0) {
729
+ // 找出这些券中有 edit_current_amount 的
730
+ var needResetIds = deselectedIds.filter(function (id) {
731
+ var voucher = allVouchersForCalculation.find(function (v) {
732
+ return v.id === id;
733
+ });
734
+ return (voucher === null || voucher === void 0 ? void 0 : voucher.edit_current_amount) !== undefined;
735
+ });
736
+
737
+ // 重置这些券的 edit_current_amount
738
+ if (needResetIds.length > 0) {
739
+ updateWalletDataById(needResetIds, {
740
+ edit_current_amount: undefined
741
+ });
742
+
743
+ // 从 confirmedEditAmountIdsRef 中移除这些ID
744
+ confirmedEditAmountIdsRef.current = confirmedEditAmountIdsRef.current.filter(function (id) {
745
+ return !needResetIds.includes(id);
746
+ });
747
+ }
748
+ }
749
+
750
+ // 3. 更新选中的券ID列表(会触发 useMemo 重新计算 selectedWithDetails)
751
+ setSelectedVoucherIds(value);
752
+
753
+ // 4. 同时更新 selectedWallet 用于兼容现有逻辑
754
+ var val = allVouchersForCalculation.filter(function (item) {
621
755
  return value.includes(item.id);
622
756
  });
623
757
  setWalletSelect(val);
624
- handleFetchUserIdentificationCodes(value);
625
758
  });
626
759
 
627
760
  // 获取过期钱包id
@@ -644,12 +777,15 @@ export var useWalletPass = function useWalletPass(props) {
644
777
 
645
778
  // 清除所有选中的钱包
646
779
  var clearAllSelectedWallet = useMemoizedFn(function () {
647
- logger === null || logger === void 0 || logger.addLog({
648
- type: 'info',
649
- title: 'useWalletPass_clearAllSelectedWallet onSelectChange 开始调用',
650
- metadata: {}
651
- });
652
- onSelectChange === null || onSelectChange === void 0 || onSelectChange([]);
780
+ // 1. 重置所有已编辑过金额的券
781
+ if (confirmedEditAmountIdsRef.current.length > 0) {
782
+ updateWalletDataById(confirmedEditAmountIdsRef.current, {
783
+ edit_current_amount: undefined
784
+ });
785
+ // 清空已编辑的券ID列表
786
+ confirmedEditAmountIdsRef.current = [];
787
+ }
788
+
653
789
  // 如果没有选中钱包,则不处理
654
790
  if (selectedWalletIds.length === 0 && selectedDiscountList.length === 0) {
655
791
  return;
@@ -672,8 +808,19 @@ export var useWalletPass = function useWalletPass(props) {
672
808
  pisellos === null || pisellos === void 0 || (_pisellos$effects = pisellos.effects) === null || _pisellos$effects === void 0 || _pisellos$effects.emit('shopDiscount:onSelectedDiscountListChange', detail);
673
809
  return;
674
810
  }
811
+
812
+ // 清空选中的钱包
675
813
  setWalletSelect([]);
676
- handleFetchUserIdentificationCodes([]);
814
+ setSelectedVoucherIds([]);
815
+
816
+ // 清空时立即通知外部(不等待 useUpdateEffect)
817
+ logger === null || logger === void 0 || logger.addLog({
818
+ type: 'info',
819
+ title: 'useWalletPass_clearAllSelectedWallet 立即通知外部清空',
820
+ metadata: {}
821
+ });
822
+ onSelectChange === null || onSelectChange === void 0 || onSelectChange([]);
823
+ setLoading(false);
677
824
  });
678
825
 
679
826
  // 判断当前选择是否已是最优选择
@@ -728,12 +875,14 @@ export var useWalletPass = function useWalletPass(props) {
728
875
  Toast === null || Toast === void 0 || Toast.info(locales.getText('wallet-pass-module-already-best-combination'));
729
876
  } else {
730
877
  var _select2 = searchIdentificationCodeList.filter(function (item) {
731
- return item.unified_available_status;
878
+ return getVoucherAvailableStatus(item);
732
879
  });
733
880
  setWalletSelect(_select2);
734
- handleFetchUserIdentificationCodes(_select2.map(function (item) {
881
+ // 更新选中的券ID列表(会触发 useMemo 重新计算 selectedWithDetails)
882
+ setSelectedVoucherIds(_select2.map(function (item) {
735
883
  return item.id;
736
- }), _select2);
884
+ }));
885
+ // useUpdateEffect 会自动在 selectedWithDetails 更新后通知外部
737
886
  if (_select2.length) {
738
887
  Toast === null || Toast === void 0 || Toast.success(locales.getText('wallet-pass-module-best-combination-selected'));
739
888
  }
@@ -762,11 +911,14 @@ export var useWalletPass = function useWalletPass(props) {
762
911
  if (hasGoodPass && !isBestDiscount) return;
763
912
  // 重置为最优选择并显示Toast提示
764
913
  setWalletSelect(newWalletRecommendList);
765
- handleFetchUserIdentificationCodes(newWalletRecommendList.map(function (item) {
914
+ // 更新选中的券ID列表(会触发 useMemo 重新计算 selectedWithDetails)
915
+ setSelectedVoucherIds(newWalletRecommendList.map(function (item) {
766
916
  return item.id;
767
- }), newWalletRecommendList);
917
+ }));
918
+ // useUpdateEffect 会自动在 selectedWithDetails 更新后通知外部
768
919
  Toast === null || Toast === void 0 || Toast.success(locales.getText('wallet-pass-module-best-combination-selected'));
769
920
  }
921
+ setLoading(false);
770
922
  });
771
923
  var handleSelectDiscount = useMemoizedFn(function (value, option) {
772
924
  var _detail$discountList, _pisellos$effects2;
@@ -811,6 +963,10 @@ export var useWalletPass = function useWalletPass(props) {
811
963
  var newUserIdentificationCodes = updateArrayItemById(userIdentificationCodes, targetId, updateData);
812
964
  setUserIdentificationCodes(newUserIdentificationCodes);
813
965
 
966
+ // 更新transformList中对应ID的数据(用于前端计算)
967
+ var newTransformList = updateArrayItemById(transformList, targetId, updateData);
968
+ setTransformList(newTransformList);
969
+
814
970
  // 更新searchIdentificationCodeList中对应ID的数据
815
971
  var newSearchIdentificationCodeList = updateArrayItemById(searchIdentificationCodeList, targetId, updateData);
816
972
  setSearchIdentificationCodeList(newSearchIdentificationCodeList);
@@ -821,6 +977,7 @@ export var useWalletPass = function useWalletPass(props) {
821
977
  return {
822
978
  newWalletRecommendList: newWalletRecommendList,
823
979
  newUserIdentificationCodes: newUserIdentificationCodes,
980
+ newTransformList: newTransformList,
824
981
  newSearchIdentificationCodeList: newSearchIdentificationCodeList,
825
982
  newSelectedWallet: newSelectedWallet
826
983
  };
@@ -828,70 +985,42 @@ export var useWalletPass = function useWalletPass(props) {
828
985
  var handleConfirmEditAmount = useMemoizedFn(function (value, id, data) {
829
986
  // 如果金额为0,直接触发 handleSelectWallet 把当前id过滤掉
830
987
  if (value === 0) {
831
- var filteredIds = selectedWalletIds.filter(function (walletId) {
988
+ var filteredIds = selectedVoucherIds.filter(function (walletId) {
832
989
  return walletId !== data.id;
833
990
  });
834
991
  handleSelectWallet(filteredIds);
835
992
  return;
836
993
  }
994
+ setLoading(true);
837
995
 
838
996
  // 将执行过的 data.id 添加到跟踪数组中(避免重复)
839
997
  if (!confirmedEditAmountIdsRef.current.includes(data.id)) {
840
998
  confirmedEditAmountIdsRef.current.push(data.id);
841
999
  }
842
1000
 
843
- // 使用通用函数更新所有相关状态
1001
+ // 使用通用函数更新所有相关状态(包括 transformList 和 searchIdentificationCodeList)
1002
+ // 这会触发 useMemo 重新计算 selectedWithDetails
844
1003
  updateWalletDataById(data.id, {
845
1004
  edit_current_amount: value
846
1005
  });
847
1006
 
848
- // 清理之前的定时器
849
- if (timeoutRef.current) {
850
- clearTimeout(timeoutRef.current);
851
- }
852
-
853
- // 设置新的定时器并保存引用
854
- timeoutRef.current = setTimeout(function () {
855
- handleFetchUserIdentificationCodes(selectedWalletIds);
856
- timeoutRef.current = null; // 执行完成后清空引用
857
- });
1007
+ // useUpdateEffect 会自动在 selectedWithDetails 更新后通知外部
1008
+ // walletPassEvaluator.recalculateVouchers 会识别 edit_current_amount 字段
858
1009
  });
859
1010
  var handleBeforeEditAmount = useMemoizedFn( /*#__PURE__*/function () {
860
- var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4(value, index, data) {
861
- var result, resultItem;
862
- return _regeneratorRuntime().wrap(function _callee4$(_context4) {
863
- while (1) switch (_context4.prev = _context4.next) {
1011
+ var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(value, index, data) {
1012
+ return _regeneratorRuntime().wrap(function _callee3$(_context3) {
1013
+ while (1) switch (_context3.prev = _context3.next) {
864
1014
  case 0:
865
- _context4.next = 2;
866
- return paymentModule.wallet.searchIdentificationCodeAsync({
867
- code: data.code,
868
- prepare_payments: paymentModule.wallet.formatWalletPassList2PreparePayments(selectedWalletRef.current.filter(function (item) {
869
- return item.id !== data.id;
870
- }))
871
- }, {
872
- noCache: true
873
- });
874
- case 2:
875
- result = _context4.sent;
876
- // 如果result中有数据,使用result中的数据更新状态
877
- if (result.data && result.data.length > 0) {
878
- resultItem = result.data.find(function (item) {
879
- return item.id === data.id;
880
- });
881
- if (resultItem) {
882
- // 使用通用函数更新所有相关状态
883
- updateWalletDataById(data.id, resultItem);
884
- }
885
- }
886
- return _context4.abrupt("return", true);
887
- case 5:
1015
+ return _context3.abrupt("return", true);
1016
+ case 1:
888
1017
  case "end":
889
- return _context4.stop();
1018
+ return _context3.stop();
890
1019
  }
891
- }, _callee4);
1020
+ }, _callee3);
892
1021
  }));
893
- return function (_x4, _x5, _x6) {
894
- return _ref4.apply(this, arguments);
1022
+ return function (_x3, _x4, _x5) {
1023
+ return _ref3.apply(this, arguments);
895
1024
  };
896
1025
  }());
897
1026
  return {
@@ -915,7 +1044,6 @@ export var useWalletPass = function useWalletPass(props) {
915
1044
  selectedDiscountList: selectedDiscountList,
916
1045
  handleSelectDiscount: handleSelectDiscount,
917
1046
  customerName: customerName,
918
- fetchWalletRecommendList: fetchWalletRecommendList,
919
1047
  fetchUserIdentificationCodes: fetchUserIdentificationCodes,
920
1048
  getCachedWalletRecommendList: getCachedWalletRecommendList,
921
1049
  getCachedUserIdentificationCodes: getCachedUserIdentificationCodes,