@pisell/private-materials 6.8.6 → 6.8.8

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 (382) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +2 -2
  6. package/build/lowcode/preview.js +7 -7
  7. package/build/lowcode/render/default/view.css +1 -1
  8. package/build/lowcode/render/default/view.js +7 -7
  9. package/build/lowcode/view.css +1 -1
  10. package/build/lowcode/view.js +7 -7
  11. package/es/components/appointmentBooking/components/Cart/Item/index.js +1 -0
  12. package/es/components/appointmentBooking/components/Voucher/index.js +16 -0
  13. package/es/components/booking/addons/model.d.ts +1 -10
  14. package/es/components/booking/components/actionButtons/index.js +34 -16
  15. package/es/components/booking/components/footer/amount.js +25 -8
  16. package/es/components/booking/components/footer/index.js +67 -35
  17. package/es/components/booking/components/footer/utils.d.ts +7 -0
  18. package/es/components/booking/components/footer/utils.js +66 -42
  19. package/es/components/booking/components/voucher/index.js +58 -14
  20. package/es/components/booking/forms/model.d.ts +1 -10
  21. package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  22. package/es/components/booking/hooks/useQuotation.js +69 -21
  23. package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  24. package/es/components/booking/info/hooks/useHolderConfig.d.ts +1 -0
  25. package/es/components/booking/info/hooks/useHolderConfig.js +9 -2
  26. package/es/components/booking/info/model.d.ts +1 -10
  27. package/es/components/booking/info/service/Lists.d.ts +1 -1
  28. package/es/components/booking/info/service/Lists.js +8 -2
  29. package/es/components/booking/info/service/serve.d.ts +14 -0
  30. package/es/components/booking/info/service/serve.js +21 -0
  31. package/es/components/booking/info/service2/Group/utils.js +2 -0
  32. package/es/components/booking/info/service2/utils.d.ts +1 -33
  33. package/es/components/booking/info/service2/utils.js +84 -36
  34. package/es/components/booking/info/utils.js +5 -0
  35. package/es/components/booking/info2/cartClientCard/index.js +23 -5
  36. package/es/components/booking/info2/service/addService/index.js +146 -88
  37. package/es/components/booking/info2/service/addService/utils.d.ts +8 -0
  38. package/es/components/booking/info2/service/addService/utils.js +78 -9
  39. package/es/components/booking/info2/service/editService/Holder/index.d.ts +12 -0
  40. package/es/components/booking/info2/service/editService/Holder/index.js +193 -0
  41. package/es/components/booking/info2/service/editService/Holder/index.less +63 -0
  42. package/es/components/booking/info2/service/editService/index.js +332 -76
  43. package/es/components/booking/info2/utilsByBooking.js +14 -5
  44. package/es/components/booking/locales.d.ts +30 -0
  45. package/es/components/booking/locales.js +39 -3
  46. package/es/components/booking/model.d.ts +1 -9
  47. package/es/components/booking/notes/model.d.ts +1 -10
  48. package/es/components/booking/payments/model.d.ts +1 -10
  49. package/es/components/booking/utils/confirmHolderModal.d.ts +13 -0
  50. package/es/components/booking/utils/confirmHolderModal.js +318 -0
  51. package/es/components/booking/utils/confirmHolderModal.less +40 -0
  52. package/es/components/booking/utils/selectHolderModal.d.ts +24 -0
  53. package/es/components/booking/utils/selectHolderModal.js +407 -0
  54. package/es/components/booking/utils.d.ts +11 -3
  55. package/es/components/booking/utils.js +24 -1
  56. package/es/components/checkout/PaymentModal.js +15 -10
  57. package/es/components/eftpos/hooks.d.ts +0 -1
  58. package/es/components/eftposPay/amount.d.ts +1 -1
  59. package/es/components/eftposPay/device.d.ts +1 -1
  60. package/es/components/eftposPay/store/index.d.ts +2 -2
  61. package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
  62. package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  63. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  64. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  65. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  66. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  67. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  68. package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  69. package/es/components/index.d.ts +1 -2
  70. package/es/components/index.js +1 -2
  71. package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  72. package/es/components/pay/toC/model.d.ts +1 -9
  73. package/es/components/schedules/model.d.ts +1 -9
  74. package/es/components/shoppingCart/components/Cart/Product.js +6 -3
  75. package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
  76. package/es/components/shoppingCart/type.d.ts +1 -0
  77. package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.d.ts +18 -0
  78. package/es/components/{wallet/Detail/serve.js → ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.js} +112 -57
  79. package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.less +0 -0
  80. package/es/components/ticketBooking/components/addServiceVariant/addService.js +29 -15
  81. package/es/components/ticketBooking/components/addServiceVariant/index.js +4 -0
  82. package/es/components/ticketBooking/components/ticketBooking/index.js +14 -11
  83. package/es/components/ticketBooking/utils/index.d.ts +10 -2
  84. package/es/components/ticketBooking/utils/index.js +37 -7
  85. package/es/components/walletList/index.d.ts +0 -24
  86. package/es/components/walletList/index.js +173 -41
  87. package/es/components/walletList/locales.d.ts +9 -0
  88. package/es/components/walletList/locales.js +12 -3
  89. package/es/components/walletList/serve.d.ts +19 -0
  90. package/es/components/walletList/serve.js +94 -5
  91. package/es/components/walletList/tempHolderSelector/index.d.ts +14 -0
  92. package/es/components/walletList/tempHolderSelector/index.js +196 -0
  93. package/es/components/walletList/tempHolderSelector/index.less +63 -0
  94. package/es/hooks/usePaymentLogger.d.ts +0 -1
  95. package/es/index.d.ts +2 -1
  96. package/es/index.js +2 -1
  97. package/es/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +0 -3
  98. package/es/plus/productSelect/index.js +1 -4
  99. package/es/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
  100. package/es/plus/selectHolder/components/ErrorTip/index.js +14 -0
  101. package/es/plus/selectHolder/components/ErrorTip/index.less +51 -0
  102. package/es/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
  103. package/es/plus/selectHolder/components/HolderItem/index.js +77 -0
  104. package/es/plus/selectHolder/components/HolderItem/index.less +105 -0
  105. package/es/plus/selectHolder/components/HolderList/index.d.ts +30 -0
  106. package/es/plus/selectHolder/components/HolderList/index.js +43 -0
  107. package/es/plus/selectHolder/index.d.ts +7 -0
  108. package/es/plus/selectHolder/index.js +273 -0
  109. package/es/plus/selectHolder/index.less +137 -0
  110. package/es/plus/selectHolder/locales.d.ts +24 -0
  111. package/es/plus/selectHolder/locales.js +29 -0
  112. package/es/plus/selectHolder/types.d.ts +104 -0
  113. package/es/plus/selectHolder/types.js +1 -0
  114. package/es/plus/selectHolder/utils.d.ts +9 -0
  115. package/es/plus/selectHolder/utils.js +16 -0
  116. package/es/plus/walletEditor/WalletEditor.js +60 -2
  117. package/es/plus/walletEditor/locales.d.ts +9 -0
  118. package/es/plus/walletEditor/locales.js +12 -3
  119. package/es/plus/walletPassGallery/components/passList/index.d.ts +1 -0
  120. package/es/plus/walletPassGallery/components/passList/index.js +17 -5
  121. package/es/plus/walletPassGallery/index.js +223 -41
  122. package/es/plus/walletPassGallery/locales.d.ts +15 -0
  123. package/es/plus/walletPassGallery/locales.js +29 -5
  124. package/es/plus/walletPassGallery/serve.d.ts +15 -1
  125. package/es/plus/walletPassGallery/serve.js +59 -2
  126. package/es/plus/walletPassGallery/utils.d.ts +48 -0
  127. package/es/plus/walletPassGallery/utils.js +342 -0
  128. package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
  129. package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.js +355 -0
  130. package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.less +8 -0
  131. package/es/pro/multiDayTimeSelect/index.d.ts +3 -0
  132. package/es/pro/multiDayTimeSelect/index.js +1 -0
  133. package/es/pro/multiDayTimeSelect/types.d.ts +28 -0
  134. package/es/pro/multiDayTimeSelect/types.js +1 -0
  135. package/es/pro/skuDetailModal/types.d.ts +1 -0
  136. package/lib/components/appointmentBooking/components/Cart/Item/index.js +1 -0
  137. package/lib/components/appointmentBooking/components/Voucher/index.js +17 -0
  138. package/lib/components/booking/addons/model.d.ts +1 -10
  139. package/lib/components/booking/components/actionButtons/index.js +11 -0
  140. package/lib/components/booking/components/footer/amount.js +23 -6
  141. package/lib/components/booking/components/footer/index.js +25 -4
  142. package/lib/components/booking/components/footer/utils.d.ts +7 -0
  143. package/lib/components/booking/components/footer/utils.js +41 -29
  144. package/lib/components/booking/components/voucher/index.js +48 -6
  145. package/lib/components/booking/forms/model.d.ts +1 -10
  146. package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
  147. package/lib/components/booking/hooks/useQuotation.js +45 -13
  148. package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
  149. package/lib/components/booking/info/hooks/useHolderConfig.d.ts +1 -0
  150. package/lib/components/booking/info/hooks/useHolderConfig.js +8 -3
  151. package/lib/components/booking/info/model.d.ts +1 -10
  152. package/lib/components/booking/info/service/Lists.d.ts +1 -1
  153. package/lib/components/booking/info/service/Lists.js +4 -2
  154. package/lib/components/booking/info/service/serve.d.ts +14 -0
  155. package/lib/components/booking/info/service/serve.js +5 -0
  156. package/lib/components/booking/info/service2/Group/utils.js +2 -0
  157. package/lib/components/booking/info/service2/utils.d.ts +1 -33
  158. package/lib/components/booking/info/service2/utils.js +32 -16
  159. package/lib/components/booking/info/utils.js +4 -0
  160. package/lib/components/booking/info2/cartClientCard/index.js +11 -0
  161. package/lib/components/booking/info2/service/addService/index.js +22 -2
  162. package/lib/components/booking/info2/service/addService/utils.d.ts +8 -0
  163. package/lib/components/booking/info2/service/addService/utils.js +47 -9
  164. package/lib/components/booking/info2/service/editService/Holder/index.d.ts +12 -0
  165. package/lib/components/booking/info2/service/editService/Holder/index.js +199 -0
  166. package/lib/components/booking/info2/service/editService/Holder/index.less +63 -0
  167. package/lib/components/booking/info2/service/editService/index.js +273 -38
  168. package/lib/components/booking/info2/utilsByBooking.js +19 -8
  169. package/lib/components/booking/locales.d.ts +30 -0
  170. package/lib/components/booking/locales.js +33 -3
  171. package/lib/components/booking/model.d.ts +1 -9
  172. package/lib/components/booking/notes/model.d.ts +1 -10
  173. package/lib/components/booking/payments/model.d.ts +1 -10
  174. package/lib/components/booking/utils/confirmHolderModal.d.ts +13 -0
  175. package/lib/components/booking/utils/confirmHolderModal.js +253 -0
  176. package/lib/components/booking/utils/confirmHolderModal.less +40 -0
  177. package/lib/components/booking/utils/selectHolderModal.d.ts +24 -0
  178. package/lib/components/booking/utils/selectHolderModal.js +319 -0
  179. package/lib/components/booking/utils.d.ts +11 -3
  180. package/lib/components/booking/utils.js +15 -0
  181. package/lib/components/checkout/PaymentModal.js +5 -2
  182. package/lib/components/eftpos/hooks.d.ts +0 -1
  183. package/lib/components/eftposPay/amount.d.ts +1 -1
  184. package/lib/components/eftposPay/device.d.ts +1 -1
  185. package/lib/components/eftposPay/store/index.d.ts +2 -2
  186. package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
  187. package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
  188. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
  189. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
  190. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
  191. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
  192. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
  193. package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
  194. package/lib/components/index.d.ts +1 -2
  195. package/lib/components/index.js +0 -3
  196. package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
  197. package/lib/components/pay/toC/model.d.ts +1 -9
  198. package/lib/components/schedules/model.d.ts +1 -9
  199. package/lib/components/shoppingCart/components/Cart/Product.js +7 -3
  200. package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
  201. package/lib/components/shoppingCart/type.d.ts +1 -0
  202. package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.d.ts +18 -0
  203. package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.js +118 -0
  204. package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.less +0 -0
  205. package/lib/components/ticketBooking/components/addServiceVariant/addService.js +23 -9
  206. package/lib/components/ticketBooking/components/addServiceVariant/index.js +4 -0
  207. package/lib/components/ticketBooking/components/ticketBooking/index.js +0 -16
  208. package/lib/components/ticketBooking/utils/index.d.ts +10 -2
  209. package/lib/components/ticketBooking/utils/index.js +31 -6
  210. package/lib/components/walletList/index.d.ts +0 -24
  211. package/lib/components/walletList/index.js +100 -4
  212. package/lib/components/walletList/locales.d.ts +9 -0
  213. package/lib/components/walletList/locales.js +12 -3
  214. package/lib/components/walletList/serve.d.ts +19 -0
  215. package/lib/components/walletList/serve.js +26 -3
  216. package/lib/components/walletList/tempHolderSelector/index.d.ts +14 -0
  217. package/lib/components/walletList/tempHolderSelector/index.js +166 -0
  218. package/lib/components/walletList/tempHolderSelector/index.less +63 -0
  219. package/lib/hooks/usePaymentLogger.d.ts +0 -1
  220. package/lib/index.d.ts +2 -1
  221. package/lib/index.js +6 -3
  222. package/lib/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +0 -3
  223. package/lib/plus/productSelect/index.js +1 -2
  224. package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
  225. package/lib/{components/wallet/PointCard/model.js → plus/selectHolder/components/ErrorTip/index.js} +10 -23
  226. package/lib/plus/selectHolder/components/ErrorTip/index.less +51 -0
  227. package/lib/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
  228. package/lib/plus/selectHolder/components/HolderItem/index.js +101 -0
  229. package/lib/plus/selectHolder/components/HolderItem/index.less +105 -0
  230. package/lib/plus/selectHolder/components/HolderList/index.d.ts +30 -0
  231. package/lib/{components/wallet/components/WalletBar → plus/selectHolder/components/HolderList}/index.js +29 -15
  232. package/lib/plus/selectHolder/index.d.ts +7 -0
  233. package/lib/plus/selectHolder/index.js +223 -0
  234. package/lib/plus/selectHolder/index.less +137 -0
  235. package/lib/plus/selectHolder/locales.d.ts +24 -0
  236. package/lib/{components/wallet/Voucher → plus/selectHolder}/locales.js +17 -14
  237. package/lib/plus/selectHolder/types.d.ts +104 -0
  238. package/lib/plus/selectHolder/types.js +17 -0
  239. package/lib/plus/selectHolder/utils.d.ts +9 -0
  240. package/lib/{components/wallet/RechargeableCard/serve.js → plus/selectHolder/utils.js} +11 -10
  241. package/lib/plus/walletEditor/WalletEditor.js +53 -0
  242. package/lib/plus/walletEditor/locales.d.ts +9 -0
  243. package/lib/plus/walletEditor/locales.js +12 -3
  244. package/lib/plus/walletPassGallery/components/passList/index.d.ts +1 -0
  245. package/lib/plus/walletPassGallery/components/passList/index.js +16 -4
  246. package/lib/plus/walletPassGallery/index.js +154 -27
  247. package/lib/plus/walletPassGallery/locales.d.ts +15 -0
  248. package/lib/plus/walletPassGallery/locales.js +32 -5
  249. package/lib/plus/walletPassGallery/serve.d.ts +15 -1
  250. package/lib/plus/walletPassGallery/serve.js +17 -5
  251. package/lib/plus/walletPassGallery/utils.d.ts +48 -0
  252. package/lib/plus/walletPassGallery/utils.js +287 -0
  253. package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
  254. package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.js +290 -0
  255. package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.less +8 -0
  256. package/lib/pro/multiDayTimeSelect/index.d.ts +3 -0
  257. package/lib/{components/wallet/components → pro/multiDayTimeSelect}/index.js +6 -16
  258. package/lib/pro/multiDayTimeSelect/types.d.ts +28 -0
  259. package/lib/pro/multiDayTimeSelect/types.js +17 -0
  260. package/lib/pro/skuDetailModal/types.d.ts +1 -0
  261. package/lowcode/event-select-holder/meta.ts +2 -2
  262. package/lowcode/select-holder/meta.ts +220 -0
  263. package/lowcode/select-holder/snippets.ts +41 -0
  264. package/package.json +3 -3
  265. package/es/components/wallet/Detail/index.d.ts +0 -42
  266. package/es/components/wallet/Detail/index.js +0 -1182
  267. package/es/components/wallet/Detail/index.less +0 -386
  268. package/es/components/wallet/Detail/locales.d.ts +0 -153
  269. package/es/components/wallet/Detail/locales.js +0 -170
  270. package/es/components/wallet/Detail/model.d.ts +0 -13
  271. package/es/components/wallet/Detail/model.js +0 -22
  272. package/es/components/wallet/Detail/serve.d.ts +0 -39
  273. package/es/components/wallet/DetailContext.d.ts +0 -25
  274. package/es/components/wallet/DetailContext.js +0 -162
  275. package/es/components/wallet/DiscountCard/index.d.ts +0 -3
  276. package/es/components/wallet/DiscountCard/index.js +0 -218
  277. package/es/components/wallet/DiscountCard/index.less +0 -9
  278. package/es/components/wallet/DiscountCard/model.d.ts +0 -14
  279. package/es/components/wallet/DiscountCard/model.js +0 -22
  280. package/es/components/wallet/PointCard/index.d.ts +0 -3
  281. package/es/components/wallet/PointCard/index.js +0 -169
  282. package/es/components/wallet/PointCard/index.less +0 -9
  283. package/es/components/wallet/PointCard/model.d.ts +0 -13
  284. package/es/components/wallet/PointCard/model.js +0 -22
  285. package/es/components/wallet/RechargeableCard/index.d.ts +0 -13
  286. package/es/components/wallet/RechargeableCard/index.js +0 -463
  287. package/es/components/wallet/RechargeableCard/index.less +0 -108
  288. package/es/components/wallet/RechargeableCard/model.d.ts +0 -29
  289. package/es/components/wallet/RechargeableCard/model.js +0 -28
  290. package/es/components/wallet/RechargeableCard/serve.d.ts +0 -23
  291. package/es/components/wallet/RechargeableCard/serve.js +0 -32
  292. package/es/components/wallet/Voucher/index.d.ts +0 -12
  293. package/es/components/wallet/Voucher/index.js +0 -131
  294. package/es/components/wallet/Voucher/index.less +0 -9
  295. package/es/components/wallet/Voucher/locales.d.ts +0 -21
  296. package/es/components/wallet/Voucher/locales.js +0 -20
  297. package/es/components/wallet/Voucher/model.d.ts +0 -13
  298. package/es/components/wallet/Voucher/model.js +0 -22
  299. package/es/components/wallet/carouselArrow.png +0 -0
  300. package/es/components/wallet/components/FooterButtons/index.d.ts +0 -18
  301. package/es/components/wallet/components/FooterButtons/index.js +0 -81
  302. package/es/components/wallet/components/FooterButtons/index.less +0 -91
  303. package/es/components/wallet/components/UsageRules/index.d.ts +0 -23
  304. package/es/components/wallet/components/UsageRules/index.js +0 -147
  305. package/es/components/wallet/components/UsageRules/index.less +0 -157
  306. package/es/components/wallet/components/WalletBar/index.d.ts +0 -8
  307. package/es/components/wallet/components/WalletBar/index.js +0 -19
  308. package/es/components/wallet/components/WalletBar/index.less +0 -36
  309. package/es/components/wallet/components/WalletCard.d.ts +0 -11
  310. package/es/components/wallet/components/WalletCard.js +0 -91
  311. package/es/components/wallet/components/index.d.ts +0 -3
  312. package/es/components/wallet/components/index.js +0 -4
  313. package/es/components/wallet/hooks/useWalletCard.d.ts +0 -34
  314. package/es/components/wallet/hooks/useWalletCard.js +0 -147
  315. package/es/components/wallet/index.d.ts +0 -10
  316. package/es/components/wallet/index.js +0 -807
  317. package/es/components/wallet/index.less +0 -151
  318. package/es/components/wallet/locales.d.ts +0 -132
  319. package/es/components/wallet/locales.js +0 -139
  320. package/es/components/wallet/model.d.ts +0 -37
  321. package/es/components/wallet/model.js +0 -86
  322. package/es/components/wallet/serve.d.ts +0 -150
  323. package/es/components/wallet/serve.js +0 -205
  324. package/es/components/wallet/utils/formatUtils.d.ts +0 -36
  325. package/es/components/wallet/utils/formatUtils.js +0 -73
  326. package/lib/components/wallet/Detail/index.d.ts +0 -42
  327. package/lib/components/wallet/Detail/index.js +0 -874
  328. package/lib/components/wallet/Detail/index.less +0 -386
  329. package/lib/components/wallet/Detail/locales.d.ts +0 -153
  330. package/lib/components/wallet/Detail/locales.js +0 -194
  331. package/lib/components/wallet/Detail/model.d.ts +0 -13
  332. package/lib/components/wallet/Detail/model.js +0 -43
  333. package/lib/components/wallet/Detail/serve.d.ts +0 -39
  334. package/lib/components/wallet/Detail/serve.js +0 -44
  335. package/lib/components/wallet/DetailContext.d.ts +0 -25
  336. package/lib/components/wallet/DetailContext.js +0 -118
  337. package/lib/components/wallet/DiscountCard/index.d.ts +0 -3
  338. package/lib/components/wallet/DiscountCard/index.js +0 -209
  339. package/lib/components/wallet/DiscountCard/index.less +0 -9
  340. package/lib/components/wallet/DiscountCard/model.d.ts +0 -14
  341. package/lib/components/wallet/DiscountCard/model.js +0 -43
  342. package/lib/components/wallet/PointCard/index.d.ts +0 -3
  343. package/lib/components/wallet/PointCard/index.js +0 -190
  344. package/lib/components/wallet/PointCard/index.less +0 -9
  345. package/lib/components/wallet/PointCard/model.d.ts +0 -13
  346. package/lib/components/wallet/RechargeableCard/index.d.ts +0 -13
  347. package/lib/components/wallet/RechargeableCard/index.js +0 -380
  348. package/lib/components/wallet/RechargeableCard/index.less +0 -108
  349. package/lib/components/wallet/RechargeableCard/model.d.ts +0 -29
  350. package/lib/components/wallet/RechargeableCard/model.js +0 -49
  351. package/lib/components/wallet/RechargeableCard/serve.d.ts +0 -23
  352. package/lib/components/wallet/Voucher/index.d.ts +0 -12
  353. package/lib/components/wallet/Voucher/index.js +0 -146
  354. package/lib/components/wallet/Voucher/index.less +0 -9
  355. package/lib/components/wallet/Voucher/locales.d.ts +0 -21
  356. package/lib/components/wallet/Voucher/model.d.ts +0 -13
  357. package/lib/components/wallet/Voucher/model.js +0 -43
  358. package/lib/components/wallet/carouselArrow.png +0 -0
  359. package/lib/components/wallet/components/FooterButtons/index.d.ts +0 -18
  360. package/lib/components/wallet/components/FooterButtons/index.js +0 -109
  361. package/lib/components/wallet/components/FooterButtons/index.less +0 -91
  362. package/lib/components/wallet/components/UsageRules/index.d.ts +0 -23
  363. package/lib/components/wallet/components/UsageRules/index.js +0 -113
  364. package/lib/components/wallet/components/UsageRules/index.less +0 -157
  365. package/lib/components/wallet/components/WalletBar/index.d.ts +0 -8
  366. package/lib/components/wallet/components/WalletBar/index.less +0 -36
  367. package/lib/components/wallet/components/WalletCard.d.ts +0 -11
  368. package/lib/components/wallet/components/WalletCard.js +0 -97
  369. package/lib/components/wallet/components/index.d.ts +0 -3
  370. package/lib/components/wallet/hooks/useWalletCard.d.ts +0 -34
  371. package/lib/components/wallet/hooks/useWalletCard.js +0 -111
  372. package/lib/components/wallet/index.d.ts +0 -10
  373. package/lib/components/wallet/index.js +0 -580
  374. package/lib/components/wallet/index.less +0 -151
  375. package/lib/components/wallet/locales.d.ts +0 -132
  376. package/lib/components/wallet/locales.js +0 -163
  377. package/lib/components/wallet/model.d.ts +0 -37
  378. package/lib/components/wallet/model.js +0 -91
  379. package/lib/components/wallet/serve.d.ts +0 -150
  380. package/lib/components/wallet/serve.js +0 -85
  381. package/lib/components/wallet/utils/formatUtils.d.ts +0 -36
  382. package/lib/components/wallet/utils/formatUtils.js +0 -73
@@ -1,874 +0,0 @@
1
- var __create = Object.create;
2
- var __defProp = Object.defineProperty;
3
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
- var __getOwnPropNames = Object.getOwnPropertyNames;
5
- var __getProtoOf = Object.getPrototypeOf;
6
- var __hasOwnProp = Object.prototype.hasOwnProperty;
7
- var __export = (target, all) => {
8
- for (var name in all)
9
- __defProp(target, name, { get: all[name], enumerable: true });
10
- };
11
- var __copyProps = (to, from, except, desc) => {
12
- if (from && typeof from === "object" || typeof from === "function") {
13
- for (let key of __getOwnPropNames(from))
14
- if (!__hasOwnProp.call(to, key) && key !== except)
15
- __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
20
- // If the importer is in node compatibility mode or this is not an ESM
21
- // file that has been converted to a CommonJS file using a Babel-
22
- // compatible transform (i.e. "__esModule" has not been set), then set
23
- // "default" to the CommonJS "module.exports" for node compatibility.
24
- isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
25
- mod
26
- ));
27
- var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
28
-
29
- // src/components/wallet/Detail/index.tsx
30
- var Detail_exports = {};
31
- __export(Detail_exports, {
32
- default: () => Detail_default
33
- });
34
- module.exports = __toCommonJS(Detail_exports);
35
- var import_react = __toESM(require("react"));
36
- var import_materials = require("@pisell/materials");
37
- var import_dayjs = __toESM(require("dayjs"));
38
- var import_XClose = __toESM(require("@pisell/icon/es/XClose"));
39
- var import_timezone = __toESM(require("dayjs/plugin/timezone"));
40
- var import_utils = require("@pisell/utils");
41
- var import_utc = __toESM(require("dayjs/plugin/utc"));
42
- var import_materials2 = require("@pisell/materials");
43
- var import_useEngineContext = __toESM(require("./../../../hooks/useEngineContext"));
44
- var import_locales = __toESM(require("./locales"));
45
- var import_serve = require("./serve");
46
- var import_utils2 = require("./../../../utils");
47
- var import_components = require("../components");
48
- var import_utils3 = require("../utils");
49
- var import_index = require("./index.less");
50
- var { Text } = import_materials2.Typography;
51
- import_dayjs.default.extend(import_timezone.default);
52
- import_dayjs.default.extend(import_utc.default);
53
- var Detail = (0, import_react.forwardRef)((props, ref) => {
54
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m;
55
- const {
56
- detail = {},
57
- buttonGroupList = [[]],
58
- className,
59
- showWalletBar = false,
60
- onBack
61
- } = props;
62
- const {
63
- code = "",
64
- tag = "",
65
- product_title = "",
66
- encoded = "",
67
- balance,
68
- expire_date = "",
69
- product = {},
70
- custom_schedule_snapshot
71
- } = detail;
72
- console.log(detail, "detail22");
73
- const {
74
- description = "",
75
- extension_data = [],
76
- customer_order_behavior_count = 0
77
- } = product || {};
78
- const context = (0, import_useEngineContext.default)();
79
- const [extensionData, setExtensionData] = (0, import_react.useState)([]);
80
- const [customerOrderBehaviorCount, setCustomerOrderBehaviorCount] = (0, import_react.useState)(0);
81
- const [totalOrderBehaviorCount, setTotalOrderBehaviorCount] = (0, import_react.useState)(0);
82
- const [todayOrderBehaviorCount, setTodayOrderBehaviorCount] = (0, import_react.useState)(0);
83
- const [weekOrderBehaviorCount, setWeekOrderBehaviorCount] = (0, import_react.useState)(0);
84
- const [monthOrderBehaviorCount, setMonthOrderBehaviorCount] = (0, import_react.useState)(0);
85
- const [usageCreditsData, setUsageCreditsData] = (0, import_react.useState)(null);
86
- const [shouldShowUsageRules, setShouldShowUsageRules] = (0, import_react.useState)(false);
87
- const generateUsageRules = (creditsData) => {
88
- if (!creditsData) return [];
89
- const rules = [];
90
- if (creditsData.max_per_day > 0) {
91
- rules.push({
92
- type: "daily",
93
- limit: creditsData.max_per_day,
94
- description: "",
95
- // Will be filled by localized text
96
- resetTime: ""
97
- // Will be filled by localized text
98
- });
99
- }
100
- if (creditsData.max_per_week > 0) {
101
- rules.push({
102
- type: "weekly",
103
- limit: creditsData.max_per_week,
104
- description: "",
105
- // Will be filled by localized text
106
- resetTime: ""
107
- // Will be filled by localized text
108
- });
109
- }
110
- if (creditsData.max_per_month > 0) {
111
- rules.push({
112
- type: "monthly",
113
- limit: creditsData.max_per_month,
114
- description: "",
115
- // Will be filled by localized text
116
- resetTime: ""
117
- // Will be filled by localized text
118
- });
119
- }
120
- return rules;
121
- };
122
- const generatePersonalLimit = (creditsData, usedCount = { totalOrderBehaviorCount: 0, customerOrderBehaviorCount: 0 }) => {
123
- if (!creditsData) return void 0;
124
- const totalCredits = creditsData.total_credits || 0;
125
- const perUserLimit = creditsData.per_user_limit || 0;
126
- let total = 0;
127
- if (totalCredits > 0 && perUserLimit > 0) {
128
- total = Math.min(totalCredits, perUserLimit);
129
- } else {
130
- total = Math.max(totalCredits, perUserLimit);
131
- }
132
- let total_remaining = 0;
133
- if (totalCredits > 0) {
134
- total_remaining = totalCredits - usedCount.totalOrderBehaviorCount;
135
- }
136
- let perUser_remaining = 0;
137
- if (perUserLimit > 0) {
138
- perUser_remaining = perUserLimit - usedCount.customerOrderBehaviorCount;
139
- }
140
- let remaining = 0;
141
- if (total_remaining > 0 && perUser_remaining > 0) {
142
- remaining = Math.min(total_remaining, perUser_remaining);
143
- } else {
144
- if (total_remaining === 0) {
145
- if (totalCredits === 0) {
146
- remaining = perUser_remaining;
147
- } else {
148
- remaining = 0;
149
- }
150
- } else {
151
- if (perUser_remaining === 0) {
152
- remaining = 0;
153
- }
154
- }
155
- }
156
- return {
157
- total,
158
- remaining,
159
- note: ""
160
- // Will be filled by localized text
161
- };
162
- };
163
- const usageRules = generateUsageRules(usageCreditsData);
164
- const personalLimit = generatePersonalLimit(usageCreditsData, {
165
- totalOrderBehaviorCount,
166
- customerOrderBehaviorCount
167
- });
168
- const utils = ((_a = context == null ? void 0 : context.appHelper) == null ? void 0 : _a.utils) || {};
169
- const dvaStore = (_c = (_b = utils == null ? void 0 : utils.getStore) == null ? void 0 : _b.call(utils)) == null ? void 0 : _c.getState();
170
- const [TimeLineData, setTimeLineData] = (0, import_react.useState)([]);
171
- const [isShowtimeLineDetail, setIsShowtimeLineDetail] = (0, import_react.useState)(false);
172
- const [isSpending, setIsSpending] = (0, import_react.useState)(true);
173
- const [timeLineDetail, setTimeLineDetail] = (0, import_react.useState)({});
174
- const [wechatModalOpen, setWechatModalOpen] = (0, import_react.useState)(false);
175
- const [copyUrl, setCopyUrl] = (0, import_react.useState)("");
176
- const [isLoading, setIsLoading] = (0, import_react.useState)(false);
177
- const [apple_wallet_url, setAppleWalletUrl] = (0, import_react.useState)("");
178
- const [google_wallet_url, setGoogleWalletUrl] = (0, import_react.useState)("");
179
- const stateTimeUnix = 1723255863;
180
- const [listData, setListData] = (0, import_react.useState)([]);
181
- const modalContentRef = (0, import_react.useRef)(null);
182
- const tabsRef = (0, import_react.useRef)();
183
- const [activeTab, setActiveTab] = (0, import_react.useState)("detail");
184
- const [isScrolling, setIsScrolling] = (0, import_react.useState)(false);
185
- const isUserClickRef = (0, import_react.useRef)(false);
186
- const scrollTimeoutRef = (0, import_react.useRef)(null);
187
- const [addWalletLoading, setAddWalletLoading] = (0, import_react.useState)(false);
188
- const [isAddingToWallet, setIsAddingToWallet] = (0, import_react.useState)(false);
189
- const anchorOptions = (0, import_react.useMemo)(
190
- () => {
191
- const options = [
192
- {
193
- id: "detail",
194
- name: import_utils.locales.getText("page.wallet.detail")
195
- }
196
- ];
197
- if (tag !== "product_discount_card") {
198
- options.push({
199
- id: "activityLog",
200
- name: import_utils.locales.getText("page.wallet.activelog")
201
- });
202
- }
203
- return options;
204
- },
205
- [tag]
206
- // 添加tag作为依赖项,当tag变化时重新计算
207
- );
208
- (0, import_react.useImperativeHandle)(ref, () => ({
209
- addWalletCard
210
- }));
211
- const addWalletCard = () => {
212
- if ((0, import_utils.isIos)()) {
213
- onAppleClick();
214
- } else {
215
- onGoogleClick();
216
- }
217
- };
218
- const scheduleList = (0, import_react.useMemo)(() => {
219
- return (custom_schedule_snapshot == null ? void 0 : custom_schedule_snapshot.data) || [];
220
- }, [custom_schedule_snapshot]);
221
- (0, import_react.useEffect)(() => {
222
- var _a2;
223
- const detail2 = (0, import_utils3.formatScheduleText)(scheduleList, "zh-CN");
224
- let expireText = expire_date ? expire_date : import_utils.locales.getText("page.wallet.expireDate");
225
- if (scheduleList.length > 0) {
226
- let validityTexts = "";
227
- let excludedText = "";
228
- let includedText = "";
229
- detail2.forEach((item) => {
230
- if (item.validityTexts.length > 0) {
231
- validityTexts = `${validityTexts}${item.validityTexts.join("\n")}
232
- `;
233
- }
234
- if (item.excluded_date.length > 0) {
235
- excludedText = `${excludedText}${item.excluded_date.join("\n")}
236
- `;
237
- }
238
- if (item.included_date.length > 0) {
239
- includedText = `${includedText}${item.included_date.join("\n")}
240
- `;
241
- }
242
- });
243
- expireText = /* @__PURE__ */ import_react.default.createElement("span", { className: "wallet-detail-expire-text" }, validityTexts, excludedText && /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-detail-expire-text-title" }, import_utils.locales.getText("page.wallet.notValidDate")), excludedText, includedText && /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-detail-expire-text-title" }, import_utils.locales.getText("page.wallet.includedDate")), includedText);
244
- }
245
- let data = [
246
- {
247
- label: import_utils.locales.getText("page.wallet.cardName"),
248
- value: product_title
249
- },
250
- {
251
- label: import_utils.locales.getText("page.wallet.carNumber"),
252
- value: encoded,
253
- isLink: false
254
- },
255
- {
256
- label: import_utils.locales.getText("page.wallet.validDate"),
257
- value: expireText
258
- }
259
- ];
260
- if (tag === "product_discount_card") {
261
- const isFixedAmount = ((_a2 = detail2.metadata) == null ? void 0 : _a2.discount_card_type) === "fixed_amount";
262
- data.splice(2, 0, {
263
- label: import_utils.locales.getText("page.wallet.discount"),
264
- value: balance ? isFixedAmount ? `${symbol}${Number(balance)}` : `${Number(balance)}%` : ""
265
- });
266
- } else if (tag === "point_card") {
267
- data.splice(2, 0, {
268
- label: import_utils.locales.getText("page.wallet.points"),
269
- value: balance ? `${Number(balance)}` : ""
270
- });
271
- } else if (tag === "good_pass") {
272
- data.splice(2, 0, {
273
- label: import_utils.locales.getText("page.wallet.goodPass"),
274
- value: balance ? `${Number(balance)}` : ""
275
- });
276
- } else {
277
- data.splice(2, 0, {
278
- label: import_utils.locales.getText("page.wallet.balance"),
279
- value: balance ? `${symbol}${Number(balance)}` : ""
280
- });
281
- }
282
- setListData(data);
283
- }, [detail]);
284
- const { symbol = "$" } = (0, import_materials.usePisellConfig)();
285
- import_utils.locales.init(import_locales.default, ((_d = dvaStore == null ? void 0 : dvaStore.core) == null ? void 0 : _d.translateLocale) || "en");
286
- import_utils2.request.setRequest(utils == null ? void 0 : utils.request);
287
- const { store } = ((_e = context.appHelper) == null ? void 0 : _e.utils) || { store: {} };
288
- const platform = (0, import_utils.isMobile)() ? "h5" : "pc";
289
- const timezone2 = ((_i = (_h = (_g = (_f = store == null ? void 0 : store.getState) == null ? void 0 : _f.call(store)) == null ? void 0 : _g.global) == null ? void 0 : _h.symbol) == null ? void 0 : _i.shop.timezone) || "Asia/Shanghai";
290
- const formatTimeLineDta = (data) => {
291
- if (data.length < 0) return [];
292
- const filteredData = data.filter(
293
- (item) => !(item.tag === "point_card" && (item.amount === "0" || parseFloat(item.amount || "0") === 0))
294
- );
295
- const formatData = filteredData.map((item) => {
296
- return {
297
- children: assetActionEnum[(item == null ? void 0 : item.action) || ""] ? timeTreeNode(item) : null
298
- };
299
- });
300
- return formatData;
301
- };
302
- const formatCurrencyAmount = (amount = "", isNegative = false) => {
303
- if (!amount) return "";
304
- const absAmount = amount.startsWith("-") ? amount.substring(1) : amount;
305
- return isNegative ? `-${!["point_card", "good_pass"].includes(tag) ? symbol : ""}${absAmount}` : `${!["point_card", "good_pass"].includes(tag) ? symbol : ""}${amount}`;
306
- };
307
- const getDetail = async () => {
308
- const {
309
- apple_wallet_url: apple_wallet_url2 = "",
310
- google_wallet_url: google_wallet_url2 = "",
311
- extension_data: extension_data2 = [],
312
- customer_order_behavior_count: customer_order_behavior_count2 = 0,
313
- total_order_behavior_count = 0,
314
- today_order_behavior_count = 0,
315
- week_order_behavior_count = 0,
316
- month_order_behavior_count = 0
317
- } = await (0, import_serve.getDetailApi)({ id: detail.id || "" });
318
- setAppleWalletUrl(apple_wallet_url2);
319
- setGoogleWalletUrl(google_wallet_url2);
320
- setExtensionData(extension_data2);
321
- setCustomerOrderBehaviorCount(customer_order_behavior_count2);
322
- setTotalOrderBehaviorCount(total_order_behavior_count);
323
- setTodayOrderBehaviorCount(today_order_behavior_count);
324
- setWeekOrderBehaviorCount(week_order_behavior_count);
325
- setMonthOrderBehaviorCount(month_order_behavior_count);
326
- if (Array.isArray(extension_data2) && extension_data2.length > 0) {
327
- const usageCreditsItem = extension_data2.find(
328
- (item) => item.field_key === "usage_credits"
329
- );
330
- if (usageCreditsItem == null ? void 0 : usageCreditsItem.value) {
331
- setUsageCreditsData(usageCreditsItem.value);
332
- setShouldShowUsageRules(true);
333
- } else {
334
- setUsageCreditsData(null);
335
- setShouldShowUsageRules(false);
336
- }
337
- } else {
338
- setUsageCreditsData(null);
339
- setShouldShowUsageRules(false);
340
- }
341
- };
342
- (0, import_react.useEffect)(() => {
343
- if (detail.id) {
344
- getDetail();
345
- }
346
- }, [detail.id]);
347
- const timeTreeNode = (data) => {
348
- const {
349
- action = "",
350
- created_at = "",
351
- amount = "",
352
- currency_symbol = ""
353
- } = data;
354
- return /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-detail-timeline-node" }, /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-detail-timeline-node-left" }, /* @__PURE__ */ import_react.default.createElement("p", { className: "wallet-detail-timeline-node-action" }, action ? assetActionEnum[action] : ""), created_at && /* @__PURE__ */ import_react.default.createElement("p", { className: "wallet-detail-timeline-node-time" }, created_at, (action === "recharge" || action === "order_expend") && // @ts-ignore 忽略TypeScript错误,React类型定义问题
355
- /* @__PURE__ */ import_react.default.createElement(
356
- "span",
357
- {
358
- className: "wallet-detail-timeline-node-detail-link",
359
- onClick: () => {
360
- setIsShowtimeLineDetail(true);
361
- setIsSpending(action === "order_expend");
362
- setTimeLineDetail(data);
363
- }
364
- },
365
- import_utils.locales.getText("page.wallet.viewDetails")
366
- ))), /* @__PURE__ */ import_react.default.createElement(
367
- "div",
368
- {
369
- className: `wallet-detail-timeline-node-amount${action === "recharge" ? " wallet-detail-timeline-node-amount-positive" : ""}${action === "order_expend" ? " wallet-detail-timeline-node-amount-negative" : ""}`
370
- },
371
- amount && currency_symbol ? formatCurrencyAmount(amount, action === "order_expend") : ""
372
- ));
373
- };
374
- const getTimeTreeList = async () => {
375
- var _a2, _b2, _c2, _d2;
376
- setIsLoading(true);
377
- try {
378
- const { list = [] } = await (0, import_serve.getAssetList)({
379
- num: "99",
380
- skip: "1",
381
- card_id: code,
382
- sourceType: tag,
383
- tag,
384
- business_object: "customer"
385
- });
386
- let filterList = list.filter(
387
- (item) => !!assetActionEnum[item.action || ""]
388
- );
389
- for (let i = filterList.length - 1; i >= 0; i--) {
390
- if (((_a2 = filterList[i]) == null ? void 0 : _a2.action) === "order_expend" && import_dayjs.default.tz((_b2 = filterList[i]) == null ? void 0 : _b2.created_at, timezone2).unix() < stateTimeUnix) {
391
- filterList.splice(i, 1);
392
- }
393
- if (((_c2 = filterList[i]) == null ? void 0 : _c2.tag) === "point_card" && import_dayjs.default.tz((_d2 = filterList[i]) == null ? void 0 : _d2.created_at, timezone2).unix() < stateTimeUnix) {
394
- filterList.splice(i, 1);
395
- }
396
- }
397
- setTimeLineData(formatTimeLineDta(filterList));
398
- } catch (error) {
399
- console.error("Failed to fetch asset list:", error);
400
- } finally {
401
- setIsLoading(false);
402
- }
403
- };
404
- (0, import_react.useEffect)(() => {
405
- if (code) {
406
- getTimeTreeList();
407
- }
408
- }, [code]);
409
- const addWalletPass = async (url, type) => {
410
- if (!url) {
411
- (0, import_materials2.PisellToast)({
412
- content: import_utils.locales.getText("page.wallet.urlEmpty") || "钱包链接为空",
413
- duration: 2
414
- });
415
- return false;
416
- }
417
- if (isWechat()) {
418
- setWechatModalOpen(true);
419
- setCopyUrl(url);
420
- return false;
421
- }
422
- setAddWalletLoading(true);
423
- try {
424
- if (type === "apple") {
425
- const response = await fetch(url);
426
- if (!response.ok) {
427
- throw new Error(`HTTP error! status: ${response.status}`);
428
- }
429
- const passData = await response.arrayBuffer();
430
- const blob = new Blob([passData], {
431
- type: "application/vnd.apple.pkpass"
432
- });
433
- const downloadUrl = URL.createObjectURL(blob);
434
- const a = document.createElement("a");
435
- a.href = downloadUrl;
436
- a.download = "pass.pkpass";
437
- a.click();
438
- URL.revokeObjectURL(downloadUrl);
439
- } else {
440
- window.open(url);
441
- }
442
- } catch (error) {
443
- console.error("Failed to add wallet:", error);
444
- (0, import_materials2.PisellToast)({
445
- content: import_utils.locales.getText("page.wallet.error.addFailed"),
446
- duration: 3
447
- });
448
- } finally {
449
- setAddWalletLoading(false);
450
- }
451
- };
452
- const onAppleClick = async () => {
453
- await addWalletPass(apple_wallet_url, "apple");
454
- };
455
- const onGoogleClick = async () => {
456
- await addWalletPass(google_wallet_url, "google");
457
- };
458
- const isWechat = () => {
459
- return /MicroMessenger/i.test(window.navigator.userAgent);
460
- };
461
- const httpCopyToClipboard = (text) => {
462
- const textArea = document.createElement("textarea");
463
- textArea.value = text;
464
- textArea.style.position = "fixed";
465
- textArea.style.top = "-10000px";
466
- textArea.style.left = "-10000px";
467
- document.body.appendChild(textArea);
468
- textArea.focus();
469
- textArea.select();
470
- document.execCommand("copy");
471
- document.body.removeChild(textArea);
472
- };
473
- const copyToClipboard = (text) => {
474
- if (navigator.clipboard) {
475
- return navigator.clipboard.writeText(text);
476
- } else {
477
- return httpCopyToClipboard(text);
478
- }
479
- };
480
- const onCopyClick = () => {
481
- copyToClipboard(copyUrl);
482
- (0, import_materials2.PisellToast)({
483
- content: import_utils.locales.getText("page.wallet.copySuccess"),
484
- duration: 2
485
- });
486
- setWechatModalOpen(false);
487
- };
488
- const cardContentRef = (0, import_react.useRef)(null);
489
- const handleTabChange = (key) => {
490
- setActiveTab(typeof key === "string" ? key : key.toString());
491
- if (platform === "h5") {
492
- setIsScrolling(true);
493
- setTimeout(() => {
494
- setIsScrolling(false);
495
- }, 500);
496
- }
497
- if (isUserClickRef.current) {
498
- const section = document.querySelector(
499
- `[data-section="${typeof key === "string" ? key : key.toString()}"]`
500
- );
501
- if (section && cardContentRef.current) {
502
- const sectionTop = section.getBoundingClientRect().top;
503
- const contentTop = cardContentRef.current.getBoundingClientRect().top;
504
- const scrollTop = cardContentRef.current.scrollTop + (sectionTop - contentTop) - 50;
505
- cardContentRef.current.scrollTo({
506
- top: scrollTop,
507
- behavior: "smooth"
508
- });
509
- }
510
- isUserClickRef.current = false;
511
- }
512
- };
513
- const preventScrollPropagation = (0, import_react.useCallback)(
514
- (e) => {
515
- if (!cardContentRef.current) return;
516
- const scrollContainer = cardContentRef.current;
517
- const isAtTop = scrollContainer.scrollTop <= 0;
518
- const isAtBottom = scrollContainer.scrollHeight - scrollContainer.scrollTop <= scrollContainer.clientHeight + 1;
519
- if ("touches" in e) {
520
- const touchEvent = e;
521
- if (isAtTop && touchEvent.touches[0].clientY > 0 || isAtBottom && touchEvent.touches[0].clientY < 0) {
522
- e.stopPropagation();
523
- }
524
- } else {
525
- const wheelEvent = e;
526
- if (isAtTop || isAtBottom) {
527
- wheelEvent.stopPropagation();
528
- }
529
- }
530
- },
531
- []
532
- );
533
- (0, import_react.useEffect)(() => {
534
- if (!cardContentRef.current || platform !== "h5") return;
535
- const scrollContainer = cardContentRef.current;
536
- const handleTouchMove = (e) => {
537
- preventScrollPropagation(e);
538
- };
539
- scrollContainer.addEventListener("touchmove", handleTouchMove, {
540
- passive: false
541
- });
542
- return () => {
543
- scrollContainer.removeEventListener("touchmove", handleTouchMove);
544
- };
545
- }, [platform, preventScrollPropagation]);
546
- (0, import_react.useEffect)(() => {
547
- if (!cardContentRef.current) return;
548
- let isCurrentlyScrolling = false;
549
- let lastScrollTime = 0;
550
- let pendingAnchorId = null;
551
- const handleScroll = () => {
552
- if (isScrolling || isUserClickRef.current) return;
553
- lastScrollTime = Date.now();
554
- isCurrentlyScrolling = true;
555
- if (scrollTimeoutRef.current) {
556
- clearTimeout(scrollTimeoutRef.current);
557
- }
558
- const container2 = cardContentRef.current;
559
- if (!container2) return;
560
- const scrollTop = container2.scrollTop;
561
- const headerHeight = 56;
562
- const containerHeight = container2.clientHeight;
563
- const sectionPositions = anchorOptions.map((option) => {
564
- const element = document.getElementById(option.id) || document.querySelector(`[data-section="${option.id}"]`);
565
- if (!element) return null;
566
- const elementOffsetTop = element.offsetTop;
567
- const elementHeight = element.offsetHeight;
568
- const isElementVisible = elementOffsetTop >= scrollTop && elementOffsetTop <= scrollTop + containerHeight || elementOffsetTop + elementHeight >= scrollTop && elementOffsetTop + elementHeight <= scrollTop + containerHeight || elementOffsetTop <= scrollTop && elementOffsetTop + elementHeight >= scrollTop + containerHeight;
569
- return {
570
- id: option.id,
571
- offsetTop: elementOffsetTop,
572
- height: elementHeight,
573
- distanceFromViewportTop: Math.abs(
574
- elementOffsetTop - scrollTop - headerHeight
575
- ),
576
- isVisible: isElementVisible
577
- };
578
- }).filter(
579
- (section) => section !== null
580
- );
581
- const visibleSections = sectionPositions.filter(
582
- (section) => section.isVisible
583
- );
584
- if (visibleSections.length === 0) return;
585
- const bestSection = visibleSections.reduce(
586
- (prev, current) => prev.distanceFromViewportTop < current.distanceFromViewportTop ? prev : current
587
- );
588
- if (bestSection && activeTab !== bestSection.id) {
589
- pendingAnchorId = bestSection.id;
590
- }
591
- scrollTimeoutRef.current = setTimeout(() => {
592
- const timeSinceLastScroll = Date.now() - lastScrollTime;
593
- if (timeSinceLastScroll >= 300) {
594
- isCurrentlyScrolling = false;
595
- if (pendingAnchorId && activeTab !== pendingAnchorId && !isScrolling) {
596
- setActiveTab(pendingAnchorId);
597
- }
598
- pendingAnchorId = null;
599
- } else {
600
- scrollTimeoutRef.current = setTimeout(() => {
601
- isCurrentlyScrolling = false;
602
- if (pendingAnchorId && activeTab !== pendingAnchorId && !isScrolling) {
603
- setActiveTab(pendingAnchorId);
604
- }
605
- pendingAnchorId = null;
606
- }, 300 - timeSinceLastScroll);
607
- }
608
- }, 300);
609
- };
610
- const container = cardContentRef.current;
611
- container.addEventListener("scroll", handleScroll);
612
- return () => {
613
- container.removeEventListener("scroll", handleScroll);
614
- if (scrollTimeoutRef.current) {
615
- clearTimeout(scrollTimeoutRef.current);
616
- }
617
- };
618
- }, [anchorOptions, activeTab, isScrolling]);
619
- const handleBack = (0, import_react.useCallback)(() => {
620
- if (onBack) {
621
- onBack();
622
- }
623
- setTimeout(() => {
624
- if (cardContentRef.current) {
625
- cardContentRef.current.scrollTop = 0;
626
- }
627
- setActiveTab("detail");
628
- setIsScrolling(false);
629
- }, 100);
630
- }, [onBack]);
631
- (0, import_react.useEffect)(() => {
632
- }, [onBack, platform]);
633
- const detailWrapperRef = (0, import_react.useRef)(null);
634
- const [contentHeight, setContentHeight] = (0, import_react.useState)(
635
- void 0
636
- );
637
- const anchorWrapperRef = (0, import_react.useRef)(null);
638
- (0, import_react.useLayoutEffect)(() => {
639
- const updateContentHeight = () => {
640
- if (detailWrapperRef.current) {
641
- const viewportHeight = window.innerHeight;
642
- const containerTop = detailWrapperRef.current.getBoundingClientRect().top;
643
- const detailHeaderEl = anchorWrapperRef.current;
644
- let nonScrollableHeight = 0;
645
- if (detailHeaderEl) {
646
- const headerHeight = detailHeaderEl.getBoundingClientRect().height;
647
- nonScrollableHeight = headerHeight + 8;
648
- } else {
649
- nonScrollableHeight = 60;
650
- }
651
- const bottomPadding = 10;
652
- const footerHeight = platform === "h5" ? 80 : 0;
653
- const calculatedHeight = viewportHeight - containerTop - nonScrollableHeight - bottomPadding - footerHeight;
654
- const finalHeight = Math.max(
655
- Math.min(calculatedHeight, viewportHeight - 80),
656
- 400
657
- );
658
- setContentHeight(finalHeight);
659
- } else {
660
- setContentHeight(void 0);
661
- }
662
- };
663
- const timer = setTimeout(() => {
664
- updateContentHeight();
665
- setTimeout(updateContentHeight, 200);
666
- }, 100);
667
- window.addEventListener("resize", updateContentHeight);
668
- let resizeObserver = null;
669
- if (detailWrapperRef.current) {
670
- resizeObserver = new ResizeObserver(() => {
671
- updateContentHeight();
672
- });
673
- resizeObserver.observe(detailWrapperRef.current);
674
- }
675
- return () => {
676
- window.removeEventListener("resize", updateContentHeight);
677
- if (resizeObserver) {
678
- resizeObserver.disconnect();
679
- }
680
- clearTimeout(timer);
681
- };
682
- }, [platform]);
683
- const assetActionEnum = {
684
- recharge: tag === "point_card" ? import_utils.locales.getText("page.wallet.pointsEarned") : import_utils.locales.getText("page.wallet.recharge"),
685
- order_expend: tag === "point_card" ? import_utils.locales.getText("page.wallet.pointsRedeemed") : import_utils.locales.getText("page.wallet.spending"),
686
- order_refund: import_utils.locales.getText("page.wallet.refund"),
687
- expire: import_utils.locales.getText("page.wallet.expire")
688
- };
689
- const handleRecharge = () => {
690
- if (props.buttonGroupList && props.buttonGroupList[0] && props.buttonGroupList[0][0]) {
691
- const rechargeButton = props.buttonGroupList[0][0];
692
- if (rechargeButton.buttonProps && rechargeButton.buttonProps.onClick) {
693
- rechargeButton.buttonProps.onClick();
694
- }
695
- }
696
- };
697
- return /* @__PURE__ */ import_react.default.createElement(
698
- "div",
699
- {
700
- className: `wallet-detail${platform === "h5" ? " wallet-detail-h5" : " wallet-detail-pc"} ${className || ""}`,
701
- ref: detailWrapperRef
702
- },
703
- (platform === "h5" || showWalletBar) && !((_l = (_k = (_j = utils == null ? void 0 : utils.interaction) == null ? void 0 : _j.utils) == null ? void 0 : _k.isAppEnv) == null ? void 0 : _l.call(_k)) && /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-detail-header" }, /* @__PURE__ */ import_react.default.createElement(import_components.WalletBar, { setup: "detail", onBack: handleBack })),
704
- /* @__PURE__ */ import_react.default.createElement(
705
- "div",
706
- {
707
- className: `wallet-detail-content ${platform === "h5" ? "wallet-detail-content-h5" : "wallet-detail-content-pc"}`,
708
- ref: modalContentRef
709
- },
710
- /* @__PURE__ */ import_react.default.createElement(
711
- "div",
712
- {
713
- className: `wallet-detail-card ${platform === "h5" ? "wallet-detail-card-h5" : ""}`
714
- },
715
- /* @__PURE__ */ import_react.default.createElement(
716
- "div",
717
- {
718
- className: `wallet-detail-card-header ${platform === "h5" ? "wallet-detail-card-header-h5" : ""}`,
719
- ref: anchorWrapperRef
720
- },
721
- /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-detail-card-header-anchor" }, /* @__PURE__ */ import_react.default.createElement(
722
- import_materials2.PisellAnchor,
723
- {
724
- ref: tabsRef,
725
- options: anchorOptions,
726
- tab: activeTab,
727
- containerRef: cardContentRef,
728
- onChange: (key) => {
729
- handleTabChange(key);
730
- },
731
- onTabClick: () => {
732
- isUserClickRef.current = true;
733
- },
734
- platform
735
- }
736
- ))
737
- ),
738
- /* @__PURE__ */ import_react.default.createElement(
739
- "div",
740
- {
741
- className: `wallet-detail-card-content ${platform === "h5" ? "wallet-detail-card-content-h5" : "wallet-detail-card-content-pc"} wallet-detail-card-content-hide-scrollbar`,
742
- ref: cardContentRef
743
- },
744
- /* @__PURE__ */ import_react.default.createElement(
745
- "section",
746
- {
747
- className: "wallet-detail-card-content-section",
748
- "data-section": "detail"
749
- },
750
- /* @__PURE__ */ import_react.default.createElement(Text, { className: "wallet-detail-card-content-section-title" }, import_utils.locales.getText("page.wallet.details")),
751
- platform === "pc" && /* @__PURE__ */ import_react.default.createElement(import_materials2.ButtonGroupPreview, { buttonGroupList }),
752
- /* @__PURE__ */ import_react.default.createElement(
753
- import_materials2.PisellStatisticList,
754
- {
755
- data: listData,
756
- labelColor: "#667085",
757
- valueColor: "#101828",
758
- backgroundColors: ["#fff"],
759
- isHasBorder: false
760
- }
761
- ),
762
- description && /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-detail-card-content-tip" }, /* @__PURE__ */ import_react.default.createElement("div", { dangerouslySetInnerHTML: { __html: description } })),
763
- shouldShowUsageRules && /* @__PURE__ */ import_react.default.createElement(
764
- import_components.UsageRules,
765
- {
766
- locales: import_utils.locales,
767
- rules: usageRules,
768
- personalLimit
769
- }
770
- )
771
- ),
772
- /* @__PURE__ */ import_react.default.createElement(
773
- "section",
774
- {
775
- className: "wallet-detail-card-content-section wallet-detail-card-content-section-timeline",
776
- "data-section": "activityLog"
777
- },
778
- tag !== "product_discount_card" && /* @__PURE__ */ import_react.default.createElement(import_react.default.Fragment, null, /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-detail-card-content-section-subtitle" }, import_utils.locales.getText("page.wallet.activelog")), isLoading ? /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-detail-timeline-loading" }, /* @__PURE__ */ import_react.default.createElement(import_materials2.Skeleton, { active: true, paragraph: { rows: 6 }, round: true })) : TimeLineData.length > 0 ? /* @__PURE__ */ import_react.default.createElement(
779
- import_materials2.Timeline,
780
- {
781
- items: TimeLineData,
782
- className: "wallet-detail-timeline-list"
783
- }
784
- ) : /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-detail-card-content-section-empty" }, /* @__PURE__ */ import_react.default.createElement(import_materials2.PisellEmpty, null)))
785
- )
786
- )
787
- )
788
- ),
789
- platform === "h5" && /* @__PURE__ */ import_react.default.createElement(
790
- import_components.FooterButtons,
791
- {
792
- step: "detail",
793
- addWalletLoading,
794
- onAppleWalletClick: tag === "gift_card" ? addWalletCard : void 0,
795
- onRechargeClick: tag === "gift_card" && ((_m = detail == null ? void 0 : detail.machinecode_config) == null ? void 0 : _m.hide_recharge) === 0 ? handleRecharge : void 0,
796
- platform,
797
- isIOS: (0, import_utils.isIos)()
798
- }
799
- ),
800
- /* @__PURE__ */ import_react.default.createElement(
801
- import_materials2.PisellModal,
802
- {
803
- platform: platform === "pc" ? "pc" : "h5",
804
- mobileModalHeight: "auto",
805
- cancelVisible: false,
806
- destroyOnClose: true,
807
- onCancel: () => setIsShowtimeLineDetail(false),
808
- title: isSpending ? import_utils.locales.getText("page.wallet.spendingDetails") : import_utils.locales.getText("page.wallet.rechargeDetails"),
809
- open: isShowtimeLineDetail,
810
- footer: [
811
- /* @__PURE__ */ import_react.default.createElement(
812
- import_materials2.Button,
813
- {
814
- type: "primary",
815
- block: true,
816
- size: "large",
817
- onClick: () => setIsShowtimeLineDetail(false)
818
- },
819
- import_utils.locales.getText("page.wallet.done")
820
- )
821
- ]
822
- },
823
- /* @__PURE__ */ import_react.default.createElement(
824
- import_materials2.PisellStatisticList,
825
- {
826
- data: [
827
- {
828
- label: import_utils.locales.getText("page.wallet.date"),
829
- value: timeLineDetail.created_at || ""
830
- },
831
- {
832
- label: isSpending ? import_utils.locales.getText("page.wallet.spending") : import_utils.locales.getText("page.wallet.recharge"),
833
- value: formatCurrencyAmount(
834
- (timeLineDetail == null ? void 0 : timeLineDetail.amount) || "",
835
- isSpending
836
- )
837
- },
838
- {
839
- label: import_utils.locales.getText("page.wallet.viewOrder"),
840
- value: !!timeLineDetail.resource_code ? `#${timeLineDetail.resource_code}` : "",
841
- isLink: !!timeLineDetail.resource_code,
842
- link: `/order/details?id=${timeLineDetail.resource_id}`
843
- }
844
- ],
845
- labelColor: "#101828",
846
- valueColor: "#101828",
847
- backgroundColors: ["#fff"],
848
- isHasBorder: false
849
- }
850
- )
851
- ),
852
- /* @__PURE__ */ import_react.default.createElement(
853
- import_materials2.PisellModal,
854
- {
855
- platform: platform === "pc" ? "pc" : "h5",
856
- mobileModalHeight: "auto",
857
- headerDivider: false,
858
- closable: true,
859
- maskClosable: true,
860
- onCancel: () => {
861
- setWechatModalOpen(false);
862
- },
863
- closeIcon: /* @__PURE__ */ import_react.default.createElement(import_XClose.default, { size: 20, style: { fontSize: "24px" } }),
864
- open: wechatModalOpen,
865
- footer: [
866
- /* @__PURE__ */ import_react.default.createElement(import_materials2.Button, { onClick: onCopyClick, block: true, type: "primary", size: "large" }, import_utils.locales.getText("page.wallet.copyButton"))
867
- ]
868
- },
869
- /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-detail-copyTitle" }, import_utils.locales.getText("page.wallet.copyTitle")),
870
- /* @__PURE__ */ import_react.default.createElement("div", { className: "wallet-detail-copyText" }, import_utils.locales.getText("page.wallet.copyText"))
871
- )
872
- );
873
- });
874
- var Detail_default = Detail;