@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.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +7 -7
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +7 -7
- package/es/components/appointmentBooking/components/Cart/Item/index.js +1 -0
- package/es/components/appointmentBooking/components/Voucher/index.js +16 -0
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/components/actionButtons/index.js +34 -16
- package/es/components/booking/components/footer/amount.js +25 -8
- package/es/components/booking/components/footer/index.js +67 -35
- package/es/components/booking/components/footer/utils.d.ts +7 -0
- package/es/components/booking/components/footer/utils.js +66 -42
- package/es/components/booking/components/voucher/index.js +58 -14
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/es/components/booking/hooks/useQuotation.js +69 -21
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/es/components/booking/info/hooks/useHolderConfig.d.ts +1 -0
- package/es/components/booking/info/hooks/useHolderConfig.js +9 -2
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/service/Lists.d.ts +1 -1
- package/es/components/booking/info/service/Lists.js +8 -2
- package/es/components/booking/info/service/serve.d.ts +14 -0
- package/es/components/booking/info/service/serve.js +21 -0
- package/es/components/booking/info/service2/Group/utils.js +2 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -33
- package/es/components/booking/info/service2/utils.js +84 -36
- package/es/components/booking/info/utils.js +5 -0
- package/es/components/booking/info2/cartClientCard/index.js +23 -5
- package/es/components/booking/info2/service/addService/index.js +146 -88
- package/es/components/booking/info2/service/addService/utils.d.ts +8 -0
- package/es/components/booking/info2/service/addService/utils.js +78 -9
- package/es/components/booking/info2/service/editService/Holder/index.d.ts +12 -0
- package/es/components/booking/info2/service/editService/Holder/index.js +193 -0
- package/es/components/booking/info2/service/editService/Holder/index.less +63 -0
- package/es/components/booking/info2/service/editService/index.js +332 -76
- package/es/components/booking/info2/utilsByBooking.js +14 -5
- package/es/components/booking/locales.d.ts +30 -0
- package/es/components/booking/locales.js +39 -3
- package/es/components/booking/model.d.ts +1 -9
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/booking/utils/confirmHolderModal.d.ts +13 -0
- package/es/components/booking/utils/confirmHolderModal.js +318 -0
- package/es/components/booking/utils/confirmHolderModal.less +40 -0
- package/es/components/booking/utils/selectHolderModal.d.ts +24 -0
- package/es/components/booking/utils/selectHolderModal.js +407 -0
- package/es/components/booking/utils.d.ts +11 -3
- package/es/components/booking/utils.js +24 -1
- package/es/components/checkout/PaymentModal.js +15 -10
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/store/index.d.ts +2 -2
- package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/es/components/index.d.ts +1 -2
- package/es/components/index.js +1 -2
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/model.d.ts +1 -9
- package/es/components/schedules/model.d.ts +1 -9
- package/es/components/shoppingCart/components/Cart/Product.js +6 -3
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/es/components/shoppingCart/type.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.d.ts +18 -0
- package/es/components/{wallet/Detail/serve.js → ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.js} +112 -57
- package/es/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.less +0 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +29 -15
- package/es/components/ticketBooking/components/addServiceVariant/index.js +4 -0
- package/es/components/ticketBooking/components/ticketBooking/index.js +14 -11
- package/es/components/ticketBooking/utils/index.d.ts +10 -2
- package/es/components/ticketBooking/utils/index.js +37 -7
- package/es/components/walletList/index.d.ts +0 -24
- package/es/components/walletList/index.js +173 -41
- package/es/components/walletList/locales.d.ts +9 -0
- package/es/components/walletList/locales.js +12 -3
- package/es/components/walletList/serve.d.ts +19 -0
- package/es/components/walletList/serve.js +94 -5
- package/es/components/walletList/tempHolderSelector/index.d.ts +14 -0
- package/es/components/walletList/tempHolderSelector/index.js +196 -0
- package/es/components/walletList/tempHolderSelector/index.less +63 -0
- package/es/hooks/usePaymentLogger.d.ts +0 -1
- package/es/index.d.ts +2 -1
- package/es/index.js +2 -1
- package/es/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +0 -3
- package/es/plus/productSelect/index.js +1 -4
- package/es/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
- package/es/plus/selectHolder/components/ErrorTip/index.js +14 -0
- package/es/plus/selectHolder/components/ErrorTip/index.less +51 -0
- package/es/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
- package/es/plus/selectHolder/components/HolderItem/index.js +77 -0
- package/es/plus/selectHolder/components/HolderItem/index.less +105 -0
- package/es/plus/selectHolder/components/HolderList/index.d.ts +30 -0
- package/es/plus/selectHolder/components/HolderList/index.js +43 -0
- package/es/plus/selectHolder/index.d.ts +7 -0
- package/es/plus/selectHolder/index.js +273 -0
- package/es/plus/selectHolder/index.less +137 -0
- package/es/plus/selectHolder/locales.d.ts +24 -0
- package/es/plus/selectHolder/locales.js +29 -0
- package/es/plus/selectHolder/types.d.ts +104 -0
- package/es/plus/selectHolder/types.js +1 -0
- package/es/plus/selectHolder/utils.d.ts +9 -0
- package/es/plus/selectHolder/utils.js +16 -0
- package/es/plus/walletEditor/WalletEditor.js +60 -2
- package/es/plus/walletEditor/locales.d.ts +9 -0
- package/es/plus/walletEditor/locales.js +12 -3
- package/es/plus/walletPassGallery/components/passList/index.d.ts +1 -0
- package/es/plus/walletPassGallery/components/passList/index.js +17 -5
- package/es/plus/walletPassGallery/index.js +223 -41
- package/es/plus/walletPassGallery/locales.d.ts +15 -0
- package/es/plus/walletPassGallery/locales.js +29 -5
- package/es/plus/walletPassGallery/serve.d.ts +15 -1
- package/es/plus/walletPassGallery/serve.js +59 -2
- package/es/plus/walletPassGallery/utils.d.ts +48 -0
- package/es/plus/walletPassGallery/utils.js +342 -0
- package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
- package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.js +355 -0
- package/es/pro/multiDayTimeSelect/MultiDayTimeSelect.less +8 -0
- package/es/pro/multiDayTimeSelect/index.d.ts +3 -0
- package/es/pro/multiDayTimeSelect/index.js +1 -0
- package/es/pro/multiDayTimeSelect/types.d.ts +28 -0
- package/es/pro/multiDayTimeSelect/types.js +1 -0
- package/es/pro/skuDetailModal/types.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.js +1 -0
- package/lib/components/appointmentBooking/components/Voucher/index.js +17 -0
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/components/actionButtons/index.js +11 -0
- package/lib/components/booking/components/footer/amount.js +23 -6
- package/lib/components/booking/components/footer/index.js +25 -4
- package/lib/components/booking/components/footer/utils.d.ts +7 -0
- package/lib/components/booking/components/footer/utils.js +41 -29
- package/lib/components/booking/components/voucher/index.js +48 -6
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/lib/components/booking/hooks/useQuotation.js +45 -13
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/lib/components/booking/info/hooks/useHolderConfig.d.ts +1 -0
- package/lib/components/booking/info/hooks/useHolderConfig.js +8 -3
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/service/Lists.d.ts +1 -1
- package/lib/components/booking/info/service/Lists.js +4 -2
- package/lib/components/booking/info/service/serve.d.ts +14 -0
- package/lib/components/booking/info/service/serve.js +5 -0
- package/lib/components/booking/info/service2/Group/utils.js +2 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -33
- package/lib/components/booking/info/service2/utils.js +32 -16
- package/lib/components/booking/info/utils.js +4 -0
- package/lib/components/booking/info2/cartClientCard/index.js +11 -0
- package/lib/components/booking/info2/service/addService/index.js +22 -2
- package/lib/components/booking/info2/service/addService/utils.d.ts +8 -0
- package/lib/components/booking/info2/service/addService/utils.js +47 -9
- package/lib/components/booking/info2/service/editService/Holder/index.d.ts +12 -0
- package/lib/components/booking/info2/service/editService/Holder/index.js +199 -0
- package/lib/components/booking/info2/service/editService/Holder/index.less +63 -0
- package/lib/components/booking/info2/service/editService/index.js +273 -38
- package/lib/components/booking/info2/utilsByBooking.js +19 -8
- package/lib/components/booking/locales.d.ts +30 -0
- package/lib/components/booking/locales.js +33 -3
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/booking/utils/confirmHolderModal.d.ts +13 -0
- package/lib/components/booking/utils/confirmHolderModal.js +253 -0
- package/lib/components/booking/utils/confirmHolderModal.less +40 -0
- package/lib/components/booking/utils/selectHolderModal.d.ts +24 -0
- package/lib/components/booking/utils/selectHolderModal.js +319 -0
- package/lib/components/booking/utils.d.ts +11 -3
- package/lib/components/booking/utils.js +15 -0
- package/lib/components/checkout/PaymentModal.js +5 -2
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/store/index.d.ts +2 -2
- package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/lib/components/index.d.ts +1 -2
- package/lib/components/index.js +0 -3
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/model.d.ts +1 -9
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/shoppingCart/components/Cart/Product.js +7 -3
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/lib/components/shoppingCart/type.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.d.ts +18 -0
- package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.js +118 -0
- package/lib/components/ticketBooking/components/addServiceVariant/MultiDayTimeSelectModal.less +0 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +23 -9
- package/lib/components/ticketBooking/components/addServiceVariant/index.js +4 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.js +0 -16
- package/lib/components/ticketBooking/utils/index.d.ts +10 -2
- package/lib/components/ticketBooking/utils/index.js +31 -6
- package/lib/components/walletList/index.d.ts +0 -24
- package/lib/components/walletList/index.js +100 -4
- package/lib/components/walletList/locales.d.ts +9 -0
- package/lib/components/walletList/locales.js +12 -3
- package/lib/components/walletList/serve.d.ts +19 -0
- package/lib/components/walletList/serve.js +26 -3
- package/lib/components/walletList/tempHolderSelector/index.d.ts +14 -0
- package/lib/components/walletList/tempHolderSelector/index.js +166 -0
- package/lib/components/walletList/tempHolderSelector/index.less +63 -0
- package/lib/hooks/usePaymentLogger.d.ts +0 -1
- package/lib/index.d.ts +2 -1
- package/lib/index.js +6 -3
- package/lib/plus/productSelect/ProductCard/SkuCard/components/CardWrapper/index.js +0 -3
- package/lib/plus/productSelect/index.js +1 -2
- package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +3 -0
- package/lib/{components/wallet/PointCard/model.js → plus/selectHolder/components/ErrorTip/index.js} +10 -23
- package/lib/plus/selectHolder/components/ErrorTip/index.less +51 -0
- package/lib/plus/selectHolder/components/HolderItem/index.d.ts +6 -0
- package/lib/plus/selectHolder/components/HolderItem/index.js +101 -0
- package/lib/plus/selectHolder/components/HolderItem/index.less +105 -0
- package/lib/plus/selectHolder/components/HolderList/index.d.ts +30 -0
- package/lib/{components/wallet/components/WalletBar → plus/selectHolder/components/HolderList}/index.js +29 -15
- package/lib/plus/selectHolder/index.d.ts +7 -0
- package/lib/plus/selectHolder/index.js +223 -0
- package/lib/plus/selectHolder/index.less +137 -0
- package/lib/plus/selectHolder/locales.d.ts +24 -0
- package/lib/{components/wallet/Voucher → plus/selectHolder}/locales.js +17 -14
- package/lib/plus/selectHolder/types.d.ts +104 -0
- package/lib/plus/selectHolder/types.js +17 -0
- package/lib/plus/selectHolder/utils.d.ts +9 -0
- package/lib/{components/wallet/RechargeableCard/serve.js → plus/selectHolder/utils.js} +11 -10
- package/lib/plus/walletEditor/WalletEditor.js +53 -0
- package/lib/plus/walletEditor/locales.d.ts +9 -0
- package/lib/plus/walletEditor/locales.js +12 -3
- package/lib/plus/walletPassGallery/components/passList/index.d.ts +1 -0
- package/lib/plus/walletPassGallery/components/passList/index.js +16 -4
- package/lib/plus/walletPassGallery/index.js +154 -27
- package/lib/plus/walletPassGallery/locales.d.ts +15 -0
- package/lib/plus/walletPassGallery/locales.js +32 -5
- package/lib/plus/walletPassGallery/serve.d.ts +15 -1
- package/lib/plus/walletPassGallery/serve.js +17 -5
- package/lib/plus/walletPassGallery/utils.d.ts +48 -0
- package/lib/plus/walletPassGallery/utils.js +287 -0
- package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.d.ts +9 -0
- package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.js +290 -0
- package/lib/pro/multiDayTimeSelect/MultiDayTimeSelect.less +8 -0
- package/lib/pro/multiDayTimeSelect/index.d.ts +3 -0
- package/lib/{components/wallet/components → pro/multiDayTimeSelect}/index.js +6 -16
- package/lib/pro/multiDayTimeSelect/types.d.ts +28 -0
- package/lib/pro/multiDayTimeSelect/types.js +17 -0
- package/lib/pro/skuDetailModal/types.d.ts +1 -0
- package/lowcode/event-select-holder/meta.ts +2 -2
- package/lowcode/select-holder/meta.ts +220 -0
- package/lowcode/select-holder/snippets.ts +41 -0
- package/package.json +3 -3
- package/es/components/wallet/Detail/index.d.ts +0 -42
- package/es/components/wallet/Detail/index.js +0 -1182
- package/es/components/wallet/Detail/index.less +0 -386
- package/es/components/wallet/Detail/locales.d.ts +0 -153
- package/es/components/wallet/Detail/locales.js +0 -170
- package/es/components/wallet/Detail/model.d.ts +0 -13
- package/es/components/wallet/Detail/model.js +0 -22
- package/es/components/wallet/Detail/serve.d.ts +0 -39
- package/es/components/wallet/DetailContext.d.ts +0 -25
- package/es/components/wallet/DetailContext.js +0 -162
- package/es/components/wallet/DiscountCard/index.d.ts +0 -3
- package/es/components/wallet/DiscountCard/index.js +0 -218
- package/es/components/wallet/DiscountCard/index.less +0 -9
- package/es/components/wallet/DiscountCard/model.d.ts +0 -14
- package/es/components/wallet/DiscountCard/model.js +0 -22
- package/es/components/wallet/PointCard/index.d.ts +0 -3
- package/es/components/wallet/PointCard/index.js +0 -169
- package/es/components/wallet/PointCard/index.less +0 -9
- package/es/components/wallet/PointCard/model.d.ts +0 -13
- package/es/components/wallet/PointCard/model.js +0 -22
- package/es/components/wallet/RechargeableCard/index.d.ts +0 -13
- package/es/components/wallet/RechargeableCard/index.js +0 -463
- package/es/components/wallet/RechargeableCard/index.less +0 -108
- package/es/components/wallet/RechargeableCard/model.d.ts +0 -29
- package/es/components/wallet/RechargeableCard/model.js +0 -28
- package/es/components/wallet/RechargeableCard/serve.d.ts +0 -23
- package/es/components/wallet/RechargeableCard/serve.js +0 -32
- package/es/components/wallet/Voucher/index.d.ts +0 -12
- package/es/components/wallet/Voucher/index.js +0 -131
- package/es/components/wallet/Voucher/index.less +0 -9
- package/es/components/wallet/Voucher/locales.d.ts +0 -21
- package/es/components/wallet/Voucher/locales.js +0 -20
- package/es/components/wallet/Voucher/model.d.ts +0 -13
- package/es/components/wallet/Voucher/model.js +0 -22
- package/es/components/wallet/carouselArrow.png +0 -0
- package/es/components/wallet/components/FooterButtons/index.d.ts +0 -18
- package/es/components/wallet/components/FooterButtons/index.js +0 -81
- package/es/components/wallet/components/FooterButtons/index.less +0 -91
- package/es/components/wallet/components/UsageRules/index.d.ts +0 -23
- package/es/components/wallet/components/UsageRules/index.js +0 -147
- package/es/components/wallet/components/UsageRules/index.less +0 -157
- package/es/components/wallet/components/WalletBar/index.d.ts +0 -8
- package/es/components/wallet/components/WalletBar/index.js +0 -19
- package/es/components/wallet/components/WalletBar/index.less +0 -36
- package/es/components/wallet/components/WalletCard.d.ts +0 -11
- package/es/components/wallet/components/WalletCard.js +0 -91
- package/es/components/wallet/components/index.d.ts +0 -3
- package/es/components/wallet/components/index.js +0 -4
- package/es/components/wallet/hooks/useWalletCard.d.ts +0 -34
- package/es/components/wallet/hooks/useWalletCard.js +0 -147
- package/es/components/wallet/index.d.ts +0 -10
- package/es/components/wallet/index.js +0 -807
- package/es/components/wallet/index.less +0 -151
- package/es/components/wallet/locales.d.ts +0 -132
- package/es/components/wallet/locales.js +0 -139
- package/es/components/wallet/model.d.ts +0 -37
- package/es/components/wallet/model.js +0 -86
- package/es/components/wallet/serve.d.ts +0 -150
- package/es/components/wallet/serve.js +0 -205
- package/es/components/wallet/utils/formatUtils.d.ts +0 -36
- package/es/components/wallet/utils/formatUtils.js +0 -73
- package/lib/components/wallet/Detail/index.d.ts +0 -42
- package/lib/components/wallet/Detail/index.js +0 -874
- package/lib/components/wallet/Detail/index.less +0 -386
- package/lib/components/wallet/Detail/locales.d.ts +0 -153
- package/lib/components/wallet/Detail/locales.js +0 -194
- package/lib/components/wallet/Detail/model.d.ts +0 -13
- package/lib/components/wallet/Detail/model.js +0 -43
- package/lib/components/wallet/Detail/serve.d.ts +0 -39
- package/lib/components/wallet/Detail/serve.js +0 -44
- package/lib/components/wallet/DetailContext.d.ts +0 -25
- package/lib/components/wallet/DetailContext.js +0 -118
- package/lib/components/wallet/DiscountCard/index.d.ts +0 -3
- package/lib/components/wallet/DiscountCard/index.js +0 -209
- package/lib/components/wallet/DiscountCard/index.less +0 -9
- package/lib/components/wallet/DiscountCard/model.d.ts +0 -14
- package/lib/components/wallet/DiscountCard/model.js +0 -43
- package/lib/components/wallet/PointCard/index.d.ts +0 -3
- package/lib/components/wallet/PointCard/index.js +0 -190
- package/lib/components/wallet/PointCard/index.less +0 -9
- package/lib/components/wallet/PointCard/model.d.ts +0 -13
- package/lib/components/wallet/RechargeableCard/index.d.ts +0 -13
- package/lib/components/wallet/RechargeableCard/index.js +0 -380
- package/lib/components/wallet/RechargeableCard/index.less +0 -108
- package/lib/components/wallet/RechargeableCard/model.d.ts +0 -29
- package/lib/components/wallet/RechargeableCard/model.js +0 -49
- package/lib/components/wallet/RechargeableCard/serve.d.ts +0 -23
- package/lib/components/wallet/Voucher/index.d.ts +0 -12
- package/lib/components/wallet/Voucher/index.js +0 -146
- package/lib/components/wallet/Voucher/index.less +0 -9
- package/lib/components/wallet/Voucher/locales.d.ts +0 -21
- package/lib/components/wallet/Voucher/model.d.ts +0 -13
- package/lib/components/wallet/Voucher/model.js +0 -43
- package/lib/components/wallet/carouselArrow.png +0 -0
- package/lib/components/wallet/components/FooterButtons/index.d.ts +0 -18
- package/lib/components/wallet/components/FooterButtons/index.js +0 -109
- package/lib/components/wallet/components/FooterButtons/index.less +0 -91
- package/lib/components/wallet/components/UsageRules/index.d.ts +0 -23
- package/lib/components/wallet/components/UsageRules/index.js +0 -113
- package/lib/components/wallet/components/UsageRules/index.less +0 -157
- package/lib/components/wallet/components/WalletBar/index.d.ts +0 -8
- package/lib/components/wallet/components/WalletBar/index.less +0 -36
- package/lib/components/wallet/components/WalletCard.d.ts +0 -11
- package/lib/components/wallet/components/WalletCard.js +0 -97
- package/lib/components/wallet/components/index.d.ts +0 -3
- package/lib/components/wallet/hooks/useWalletCard.d.ts +0 -34
- package/lib/components/wallet/hooks/useWalletCard.js +0 -111
- package/lib/components/wallet/index.d.ts +0 -10
- package/lib/components/wallet/index.js +0 -580
- package/lib/components/wallet/index.less +0 -151
- package/lib/components/wallet/locales.d.ts +0 -132
- package/lib/components/wallet/locales.js +0 -163
- package/lib/components/wallet/model.d.ts +0 -37
- package/lib/components/wallet/model.js +0 -91
- package/lib/components/wallet/serve.d.ts +0 -150
- package/lib/components/wallet/serve.js +0 -85
- package/lib/components/wallet/utils/formatUtils.d.ts +0 -36
- package/lib/components/wallet/utils/formatUtils.js +0 -73
|
@@ -1,1182 +0,0 @@
|
|
|
1
|
-
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
-
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
-
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
-
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
-
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
6
|
-
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
7
|
-
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
8
|
-
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
9
|
-
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; } }
|
|
10
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
11
|
-
import React, { useEffect, useMemo, useState, useRef, forwardRef, useImperativeHandle, useCallback, useLayoutEffect } from 'react';
|
|
12
|
-
import { usePisellConfig } from '@pisell/materials';
|
|
13
|
-
import dayjs from 'dayjs';
|
|
14
|
-
import XClose from '@pisell/icon/es/XClose';
|
|
15
|
-
import timezone from 'dayjs/plugin/timezone';
|
|
16
|
-
// import { isWx, isMobile, isSafari } from '@pisell/utils';
|
|
17
|
-
import { isMobile, isIos, locales } from '@pisell/utils';
|
|
18
|
-
import utc from 'dayjs/plugin/utc';
|
|
19
|
-
import { ButtonGroupPreview, PisellEmpty, Timeline, PisellAnchor, PisellModal, Typography, PisellStatisticList, Button, PisellToast, Skeleton } from '@pisell/materials';
|
|
20
|
-
import useEngineContext from "./../../../hooks/useEngineContext";
|
|
21
|
-
import localeTexts from "./locales";
|
|
22
|
-
import { getAssetList, getDetailApi } from "./serve";
|
|
23
|
-
import { request } from "./../../../utils";
|
|
24
|
-
import { WalletBar, FooterButtons, UsageRules } from "../components";
|
|
25
|
-
import { formatScheduleText } from "../utils";
|
|
26
|
-
import "./index.less";
|
|
27
|
-
var Text = Typography.Text;
|
|
28
|
-
|
|
29
|
-
// 为Web PKI API添加TypeScript声明
|
|
30
|
-
|
|
31
|
-
dayjs.extend(timezone);
|
|
32
|
-
dayjs.extend(utc);
|
|
33
|
-
var Detail = /*#__PURE__*/forwardRef(function (props, ref) {
|
|
34
|
-
var _context$appHelper, _utils$getStore, _dvaStore$core, _context$appHelper2, _store$getState, _utils$interaction, _utils$interaction$is, _detail$machinecode_c;
|
|
35
|
-
var _props$detail = props.detail,
|
|
36
|
-
detail = _props$detail === void 0 ? {} : _props$detail,
|
|
37
|
-
_props$buttonGroupLis = props.buttonGroupList,
|
|
38
|
-
buttonGroupList = _props$buttonGroupLis === void 0 ? [[]] : _props$buttonGroupLis,
|
|
39
|
-
className = props.className,
|
|
40
|
-
_props$showWalletBar = props.showWalletBar,
|
|
41
|
-
showWalletBar = _props$showWalletBar === void 0 ? false : _props$showWalletBar,
|
|
42
|
-
onBack = props.onBack;
|
|
43
|
-
|
|
44
|
-
// 直接从detail对象中解构这些属性可能是问题所在,它们可能不会正确传递
|
|
45
|
-
// 将它们作为独立属性来处理,避免嵌套解构导致的问题
|
|
46
|
-
var _detail$code = detail.code,
|
|
47
|
-
code = _detail$code === void 0 ? '' : _detail$code,
|
|
48
|
-
_detail$tag = detail.tag,
|
|
49
|
-
tag = _detail$tag === void 0 ? '' : _detail$tag,
|
|
50
|
-
_detail$product_title = detail.product_title,
|
|
51
|
-
product_title = _detail$product_title === void 0 ? '' : _detail$product_title,
|
|
52
|
-
_detail$encoded = detail.encoded,
|
|
53
|
-
encoded = _detail$encoded === void 0 ? '' : _detail$encoded,
|
|
54
|
-
balance = detail.balance,
|
|
55
|
-
_detail$expire_date = detail.expire_date,
|
|
56
|
-
expire_date = _detail$expire_date === void 0 ? '' : _detail$expire_date,
|
|
57
|
-
_detail$product = detail.product,
|
|
58
|
-
product = _detail$product === void 0 ? {} : _detail$product,
|
|
59
|
-
custom_schedule_snapshot = detail.custom_schedule_snapshot;
|
|
60
|
-
console.log(detail, 'detail22');
|
|
61
|
-
var _ref = product || {},
|
|
62
|
-
_ref$description = _ref.description,
|
|
63
|
-
description = _ref$description === void 0 ? '' : _ref$description,
|
|
64
|
-
_ref$extension_data = _ref.extension_data,
|
|
65
|
-
extension_data = _ref$extension_data === void 0 ? [] : _ref$extension_data,
|
|
66
|
-
_ref$customer_order_b = _ref.customer_order_behavior_count,
|
|
67
|
-
customer_order_behavior_count = _ref$customer_order_b === void 0 ? 0 : _ref$customer_order_b;
|
|
68
|
-
var context = useEngineContext();
|
|
69
|
-
|
|
70
|
-
// 单独存储从详情接口获取的字段
|
|
71
|
-
var _useState = useState([]),
|
|
72
|
-
_useState2 = _slicedToArray(_useState, 2),
|
|
73
|
-
extensionData = _useState2[0],
|
|
74
|
-
setExtensionData = _useState2[1];
|
|
75
|
-
var _useState3 = useState(0),
|
|
76
|
-
_useState4 = _slicedToArray(_useState3, 2),
|
|
77
|
-
customerOrderBehaviorCount = _useState4[0],
|
|
78
|
-
setCustomerOrderBehaviorCount = _useState4[1];
|
|
79
|
-
var _useState5 = useState(0),
|
|
80
|
-
_useState6 = _slicedToArray(_useState5, 2),
|
|
81
|
-
totalOrderBehaviorCount = _useState6[0],
|
|
82
|
-
setTotalOrderBehaviorCount = _useState6[1];
|
|
83
|
-
var _useState7 = useState(0),
|
|
84
|
-
_useState8 = _slicedToArray(_useState7, 2),
|
|
85
|
-
todayOrderBehaviorCount = _useState8[0],
|
|
86
|
-
setTodayOrderBehaviorCount = _useState8[1];
|
|
87
|
-
var _useState9 = useState(0),
|
|
88
|
-
_useState10 = _slicedToArray(_useState9, 2),
|
|
89
|
-
weekOrderBehaviorCount = _useState10[0],
|
|
90
|
-
setWeekOrderBehaviorCount = _useState10[1];
|
|
91
|
-
var _useState11 = useState(0),
|
|
92
|
-
_useState12 = _slicedToArray(_useState11, 2),
|
|
93
|
-
monthOrderBehaviorCount = _useState12[0],
|
|
94
|
-
setMonthOrderBehaviorCount = _useState12[1];
|
|
95
|
-
|
|
96
|
-
// 存储使用规则相关的状态
|
|
97
|
-
var _useState13 = useState(null),
|
|
98
|
-
_useState14 = _slicedToArray(_useState13, 2),
|
|
99
|
-
usageCreditsData = _useState14[0],
|
|
100
|
-
setUsageCreditsData = _useState14[1];
|
|
101
|
-
var _useState15 = useState(false),
|
|
102
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
103
|
-
shouldShowUsageRules = _useState16[0],
|
|
104
|
-
setShouldShowUsageRules = _useState16[1];
|
|
105
|
-
|
|
106
|
-
// Generate usage rules from real data
|
|
107
|
-
var generateUsageRules = function generateUsageRules(creditsData) {
|
|
108
|
-
if (!creditsData) return [];
|
|
109
|
-
var rules = [];
|
|
110
|
-
|
|
111
|
-
// Add daily limit if exists
|
|
112
|
-
if (creditsData.max_per_day > 0) {
|
|
113
|
-
rules.push({
|
|
114
|
-
type: 'daily',
|
|
115
|
-
limit: creditsData.max_per_day,
|
|
116
|
-
description: '',
|
|
117
|
-
// Will be filled by localized text
|
|
118
|
-
resetTime: '' // Will be filled by localized text
|
|
119
|
-
});
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// Add weekly limit if exists
|
|
123
|
-
if (creditsData.max_per_week > 0) {
|
|
124
|
-
rules.push({
|
|
125
|
-
type: 'weekly',
|
|
126
|
-
limit: creditsData.max_per_week,
|
|
127
|
-
description: '',
|
|
128
|
-
// Will be filled by localized text
|
|
129
|
-
resetTime: '' // Will be filled by localized text
|
|
130
|
-
});
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
// Add monthly limit if exists
|
|
134
|
-
if (creditsData.max_per_month > 0) {
|
|
135
|
-
rules.push({
|
|
136
|
-
type: 'monthly',
|
|
137
|
-
limit: creditsData.max_per_month,
|
|
138
|
-
description: '',
|
|
139
|
-
// Will be filled by localized text
|
|
140
|
-
resetTime: '' // Will be filled by localized text
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
return rules;
|
|
144
|
-
};
|
|
145
|
-
|
|
146
|
-
// Generate personal limit data
|
|
147
|
-
var generatePersonalLimit = function generatePersonalLimit(creditsData) {
|
|
148
|
-
var usedCount = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
149
|
-
totalOrderBehaviorCount: 0,
|
|
150
|
-
customerOrderBehaviorCount: 0
|
|
151
|
-
};
|
|
152
|
-
if (!creditsData) return undefined;
|
|
153
|
-
var totalCredits = creditsData.total_credits || 0;
|
|
154
|
-
var perUserLimit = creditsData.per_user_limit || 0;
|
|
155
|
-
|
|
156
|
-
// 使用 total_credits 和 per_user_limit 中的较小值且非 0 的值作为总数
|
|
157
|
-
// 如果 totalCredits 是 0,则使用 perUserLimit
|
|
158
|
-
var total = 0;
|
|
159
|
-
if (totalCredits > 0 && perUserLimit > 0) {
|
|
160
|
-
total = Math.min(totalCredits, perUserLimit);
|
|
161
|
-
} else {
|
|
162
|
-
total = Math.max(totalCredits, perUserLimit);
|
|
163
|
-
}
|
|
164
|
-
// const total = Math.min(totalCredits, perUserLimit);
|
|
165
|
-
// const remaining = Math.max(0, total - usedCount.totalOrderBehaviorCount); // Ensure remaining is not negative
|
|
166
|
-
// 单张卡剩余多少
|
|
167
|
-
var total_remaining = 0;
|
|
168
|
-
if (totalCredits > 0) {
|
|
169
|
-
total_remaining = totalCredits - usedCount.totalOrderBehaviorCount;
|
|
170
|
-
}
|
|
171
|
-
// 个人剩余多少
|
|
172
|
-
var perUser_remaining = 0;
|
|
173
|
-
if (perUserLimit > 0) {
|
|
174
|
-
perUser_remaining = perUserLimit - usedCount.customerOrderBehaviorCount;
|
|
175
|
-
}
|
|
176
|
-
var remaining = 0;
|
|
177
|
-
if (total_remaining > 0 && perUser_remaining > 0) {
|
|
178
|
-
remaining = Math.min(total_remaining, perUser_remaining);
|
|
179
|
-
} else {
|
|
180
|
-
// 如果有一个是 0,还需要看是否是因为配置是 0 才导致的 0
|
|
181
|
-
// 先看总次数是不是剩余 0,是因为什么剩余 0
|
|
182
|
-
if (total_remaining === 0) {
|
|
183
|
-
if (totalCredits === 0) {
|
|
184
|
-
// 代表不限制总使用次数
|
|
185
|
-
remaining = perUser_remaining;
|
|
186
|
-
} else {
|
|
187
|
-
// 代表限制总使用次数,但是总使用次数为 0,则 remaining 为 0
|
|
188
|
-
remaining = 0;
|
|
189
|
-
}
|
|
190
|
-
} else {
|
|
191
|
-
// 如果剩余总使用次数大于 0,个人使用次数为 0,则 remaining 为 0
|
|
192
|
-
if (perUser_remaining === 0) {
|
|
193
|
-
remaining = 0;
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
return {
|
|
198
|
-
total: total,
|
|
199
|
-
remaining: remaining,
|
|
200
|
-
note: '' // Will be filled by localized text
|
|
201
|
-
};
|
|
202
|
-
};
|
|
203
|
-
|
|
204
|
-
// 简化:直接计算
|
|
205
|
-
var usageRules = generateUsageRules(usageCreditsData);
|
|
206
|
-
// 取出所有最大的非 0 的数
|
|
207
|
-
var personalLimit = generatePersonalLimit(usageCreditsData, {
|
|
208
|
-
totalOrderBehaviorCount: totalOrderBehaviorCount,
|
|
209
|
-
customerOrderBehaviorCount: customerOrderBehaviorCount
|
|
210
|
-
});
|
|
211
|
-
var utils = (context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {};
|
|
212
|
-
var dvaStore = utils === null || utils === void 0 || (_utils$getStore = utils.getStore) === null || _utils$getStore === void 0 || (_utils$getStore = _utils$getStore.call(utils)) === null || _utils$getStore === void 0 ? void 0 : _utils$getStore.getState();
|
|
213
|
-
var _useState17 = useState([]),
|
|
214
|
-
_useState18 = _slicedToArray(_useState17, 2),
|
|
215
|
-
TimeLineData = _useState18[0],
|
|
216
|
-
setTimeLineData = _useState18[1];
|
|
217
|
-
var _useState19 = useState(false),
|
|
218
|
-
_useState20 = _slicedToArray(_useState19, 2),
|
|
219
|
-
isShowtimeLineDetail = _useState20[0],
|
|
220
|
-
setIsShowtimeLineDetail = _useState20[1];
|
|
221
|
-
var _useState21 = useState(true),
|
|
222
|
-
_useState22 = _slicedToArray(_useState21, 2),
|
|
223
|
-
isSpending = _useState22[0],
|
|
224
|
-
setIsSpending = _useState22[1];
|
|
225
|
-
var _useState23 = useState({}),
|
|
226
|
-
_useState24 = _slicedToArray(_useState23, 2),
|
|
227
|
-
timeLineDetail = _useState24[0],
|
|
228
|
-
setTimeLineDetail = _useState24[1];
|
|
229
|
-
var _useState25 = useState(false),
|
|
230
|
-
_useState26 = _slicedToArray(_useState25, 2),
|
|
231
|
-
wechatModalOpen = _useState26[0],
|
|
232
|
-
setWechatModalOpen = _useState26[1];
|
|
233
|
-
var _useState27 = useState(''),
|
|
234
|
-
_useState28 = _slicedToArray(_useState27, 2),
|
|
235
|
-
copyUrl = _useState28[0],
|
|
236
|
-
setCopyUrl = _useState28[1];
|
|
237
|
-
var _useState29 = useState(false),
|
|
238
|
-
_useState30 = _slicedToArray(_useState29, 2),
|
|
239
|
-
isLoading = _useState30[0],
|
|
240
|
-
setIsLoading = _useState30[1];
|
|
241
|
-
var _useState31 = useState(''),
|
|
242
|
-
_useState32 = _slicedToArray(_useState31, 2),
|
|
243
|
-
apple_wallet_url = _useState32[0],
|
|
244
|
-
setAppleWalletUrl = _useState32[1];
|
|
245
|
-
var _useState33 = useState(''),
|
|
246
|
-
_useState34 = _slicedToArray(_useState33, 2),
|
|
247
|
-
google_wallet_url = _useState34[0],
|
|
248
|
-
setGoogleWalletUrl = _useState34[1];
|
|
249
|
-
var stateTimeUnix = 1723255863; //2024.8.10 时间戳
|
|
250
|
-
|
|
251
|
-
var _useState35 = useState([]),
|
|
252
|
-
_useState36 = _slicedToArray(_useState35, 2),
|
|
253
|
-
listData = _useState36[0],
|
|
254
|
-
setListData = _useState36[1];
|
|
255
|
-
var modalContentRef = useRef(null);
|
|
256
|
-
var tabsRef = useRef();
|
|
257
|
-
var _useState37 = useState('detail'),
|
|
258
|
-
_useState38 = _slicedToArray(_useState37, 2),
|
|
259
|
-
activeTab = _useState38[0],
|
|
260
|
-
setActiveTab = _useState38[1];
|
|
261
|
-
var _useState39 = useState(false),
|
|
262
|
-
_useState40 = _slicedToArray(_useState39, 2),
|
|
263
|
-
isScrolling = _useState40[0],
|
|
264
|
-
setIsScrolling = _useState40[1];
|
|
265
|
-
var isUserClickRef = useRef(false);
|
|
266
|
-
var scrollTimeoutRef = useRef(null);
|
|
267
|
-
var _useState41 = useState(false),
|
|
268
|
-
_useState42 = _slicedToArray(_useState41, 2),
|
|
269
|
-
addWalletLoading = _useState42[0],
|
|
270
|
-
setAddWalletLoading = _useState42[1];
|
|
271
|
-
var _useState43 = useState(false),
|
|
272
|
-
_useState44 = _slicedToArray(_useState43, 2),
|
|
273
|
-
isAddingToWallet = _useState44[0],
|
|
274
|
-
setIsAddingToWallet = _useState44[1];
|
|
275
|
-
var anchorOptions = useMemo(function () {
|
|
276
|
-
// 始终包含detail选项
|
|
277
|
-
var options = [{
|
|
278
|
-
id: 'detail',
|
|
279
|
-
name: locales.getText('page.wallet.detail')
|
|
280
|
-
}];
|
|
281
|
-
|
|
282
|
-
// 仅在tag不等于product_discount_card时添加activityLog选项
|
|
283
|
-
if (tag !== 'product_discount_card') {
|
|
284
|
-
options.push({
|
|
285
|
-
id: 'activityLog',
|
|
286
|
-
name: locales.getText('page.wallet.activelog')
|
|
287
|
-
});
|
|
288
|
-
}
|
|
289
|
-
return options;
|
|
290
|
-
}, [tag] // 添加tag作为依赖项,当tag变化时重新计算
|
|
291
|
-
);
|
|
292
|
-
useImperativeHandle(ref, function () {
|
|
293
|
-
return {
|
|
294
|
-
addWalletCard: addWalletCard
|
|
295
|
-
};
|
|
296
|
-
});
|
|
297
|
-
var addWalletCard = function addWalletCard() {
|
|
298
|
-
if (isIos()) {
|
|
299
|
-
onAppleClick();
|
|
300
|
-
} else {
|
|
301
|
-
onGoogleClick();
|
|
302
|
-
}
|
|
303
|
-
};
|
|
304
|
-
var scheduleList = useMemo(function () {
|
|
305
|
-
return (custom_schedule_snapshot === null || custom_schedule_snapshot === void 0 ? void 0 : custom_schedule_snapshot.data) || [];
|
|
306
|
-
}, [custom_schedule_snapshot]);
|
|
307
|
-
useEffect(function () {
|
|
308
|
-
var detail = formatScheduleText(scheduleList, 'zh-CN');
|
|
309
|
-
var expireText = expire_date ? expire_date : locales.getText('page.wallet.expireDate');
|
|
310
|
-
if (scheduleList.length > 0) {
|
|
311
|
-
// 换行展示
|
|
312
|
-
var validityTexts = "";
|
|
313
|
-
var excludedText = "";
|
|
314
|
-
var includedText = "";
|
|
315
|
-
detail.forEach(function (item) {
|
|
316
|
-
if (item.validityTexts.length > 0) {
|
|
317
|
-
validityTexts = "".concat(validityTexts).concat(item.validityTexts.join('\n'), "\n");
|
|
318
|
-
}
|
|
319
|
-
if (item.excluded_date.length > 0) {
|
|
320
|
-
excludedText = "".concat(excludedText).concat(item.excluded_date.join('\n'), "\n");
|
|
321
|
-
}
|
|
322
|
-
if (item.included_date.length > 0) {
|
|
323
|
-
includedText = "".concat(includedText).concat(item.included_date.join('\n'), "\n");
|
|
324
|
-
}
|
|
325
|
-
});
|
|
326
|
-
expireText = /*#__PURE__*/React.createElement("span", {
|
|
327
|
-
className: "wallet-detail-expire-text"
|
|
328
|
-
}, validityTexts, excludedText && /*#__PURE__*/React.createElement("div", {
|
|
329
|
-
className: "wallet-detail-expire-text-title"
|
|
330
|
-
}, locales.getText('page.wallet.notValidDate')), excludedText, includedText && /*#__PURE__*/React.createElement("div", {
|
|
331
|
-
className: "wallet-detail-expire-text-title"
|
|
332
|
-
}, locales.getText('page.wallet.includedDate')), includedText);
|
|
333
|
-
}
|
|
334
|
-
var data = [{
|
|
335
|
-
label: locales.getText('page.wallet.cardName'),
|
|
336
|
-
value: product_title
|
|
337
|
-
}, {
|
|
338
|
-
label: locales.getText('page.wallet.carNumber'),
|
|
339
|
-
value: encoded,
|
|
340
|
-
isLink: false
|
|
341
|
-
}, {
|
|
342
|
-
label: locales.getText('page.wallet.validDate'),
|
|
343
|
-
value: expireText
|
|
344
|
-
}];
|
|
345
|
-
//折扣卡显示折扣字段 其他显示余额字段
|
|
346
|
-
if (tag === 'product_discount_card') {
|
|
347
|
-
var _detail$metadata;
|
|
348
|
-
var isFixedAmount = ((_detail$metadata = detail.metadata) === null || _detail$metadata === void 0 ? void 0 : _detail$metadata.discount_card_type) === 'fixed_amount';
|
|
349
|
-
data.splice(2, 0, {
|
|
350
|
-
label: locales.getText('page.wallet.discount'),
|
|
351
|
-
value: balance ? isFixedAmount ? "".concat(symbol).concat(Number(balance)) : "".concat(Number(balance), "%") : ''
|
|
352
|
-
});
|
|
353
|
-
} else if (tag === 'point_card') {
|
|
354
|
-
data.splice(2, 0, {
|
|
355
|
-
label: locales.getText('page.wallet.points'),
|
|
356
|
-
value: balance ? "".concat(Number(balance)) : ''
|
|
357
|
-
});
|
|
358
|
-
} else if (tag === 'good_pass') {
|
|
359
|
-
data.splice(2, 0, {
|
|
360
|
-
label: locales.getText('page.wallet.goodPass'),
|
|
361
|
-
value: balance ? "".concat(Number(balance)) : ''
|
|
362
|
-
});
|
|
363
|
-
} else {
|
|
364
|
-
data.splice(2, 0, {
|
|
365
|
-
label: locales.getText('page.wallet.balance'),
|
|
366
|
-
value: balance ? "".concat(symbol).concat(Number(balance)) : ''
|
|
367
|
-
});
|
|
368
|
-
}
|
|
369
|
-
setListData(data);
|
|
370
|
-
}, [detail]);
|
|
371
|
-
var _usePisellConfig = usePisellConfig(),
|
|
372
|
-
_usePisellConfig$symb = _usePisellConfig.symbol,
|
|
373
|
-
symbol = _usePisellConfig$symb === void 0 ? '$' : _usePisellConfig$symb;
|
|
374
|
-
|
|
375
|
-
// 注册多语言
|
|
376
|
-
locales.init(localeTexts, (dvaStore === null || dvaStore === void 0 || (_dvaStore$core = dvaStore.core) === null || _dvaStore$core === void 0 ? void 0 : _dvaStore$core.translateLocale) || 'en');
|
|
377
|
-
// 注册请求
|
|
378
|
-
request.setRequest(utils === null || utils === void 0 ? void 0 : utils.request);
|
|
379
|
-
var _ref2 = ((_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 ? void 0 : _context$appHelper2.utils) || {
|
|
380
|
-
store: {}
|
|
381
|
-
},
|
|
382
|
-
store = _ref2.store;
|
|
383
|
-
var platform = isMobile() ? 'h5' : 'pc';
|
|
384
|
-
var timezone = (store === null || store === void 0 || (_store$getState = store.getState) === null || _store$getState === void 0 || (_store$getState = _store$getState.call(store)) === null || _store$getState === void 0 || (_store$getState = _store$getState.global) === null || _store$getState === void 0 || (_store$getState = _store$getState.symbol) === null || _store$getState === void 0 ? void 0 : _store$getState.shop.timezone) || 'Asia/Shanghai';
|
|
385
|
-
var formatTimeLineDta = function formatTimeLineDta(data) {
|
|
386
|
-
if (data.length < 0) return [];
|
|
387
|
-
|
|
388
|
-
// 过滤掉积分卡的零额记录
|
|
389
|
-
var filteredData = data.filter(function (item) {
|
|
390
|
-
return !(item.tag === 'point_card' && (item.amount === '0' || parseFloat(item.amount || '0') === 0));
|
|
391
|
-
});
|
|
392
|
-
var formatData = filteredData.map(function (item) {
|
|
393
|
-
return {
|
|
394
|
-
children: assetActionEnum[(item === null || item === void 0 ? void 0 : item.action) || ''] ? timeTreeNode(item) : null
|
|
395
|
-
};
|
|
396
|
-
});
|
|
397
|
-
return formatData;
|
|
398
|
-
};
|
|
399
|
-
|
|
400
|
-
// 金额格式化通用函数
|
|
401
|
-
var formatCurrencyAmount = function formatCurrencyAmount() {
|
|
402
|
-
var amount = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
403
|
-
var isNegative = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
404
|
-
if (!amount) return '';
|
|
405
|
-
|
|
406
|
-
// 移除可能存在的负号
|
|
407
|
-
var absAmount = amount.startsWith('-') ? amount.substring(1) : amount;
|
|
408
|
-
|
|
409
|
-
// 根据isNegative参数决定是否添加负号
|
|
410
|
-
return isNegative ? "-".concat(!['point_card', 'good_pass'].includes(tag) ? symbol : '').concat(absAmount) : "".concat(!['point_card', 'good_pass'].includes(tag) ? symbol : '').concat(amount);
|
|
411
|
-
};
|
|
412
|
-
var getDetail = /*#__PURE__*/function () {
|
|
413
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
414
|
-
var _yield$getDetailApi, _yield$getDetailApi$a, apple_wallet_url, _yield$getDetailApi$g, google_wallet_url, _yield$getDetailApi$e, extension_data, _yield$getDetailApi$c, customer_order_behavior_count, _yield$getDetailApi$t, total_order_behavior_count, _yield$getDetailApi$t2, today_order_behavior_count, _yield$getDetailApi$w, week_order_behavior_count, _yield$getDetailApi$m, month_order_behavior_count, usageCreditsItem;
|
|
415
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
416
|
-
while (1) switch (_context.prev = _context.next) {
|
|
417
|
-
case 0:
|
|
418
|
-
_context.next = 2;
|
|
419
|
-
return getDetailApi({
|
|
420
|
-
id: detail.id || ''
|
|
421
|
-
});
|
|
422
|
-
case 2:
|
|
423
|
-
_yield$getDetailApi = _context.sent;
|
|
424
|
-
_yield$getDetailApi$a = _yield$getDetailApi.apple_wallet_url;
|
|
425
|
-
apple_wallet_url = _yield$getDetailApi$a === void 0 ? '' : _yield$getDetailApi$a;
|
|
426
|
-
_yield$getDetailApi$g = _yield$getDetailApi.google_wallet_url;
|
|
427
|
-
google_wallet_url = _yield$getDetailApi$g === void 0 ? '' : _yield$getDetailApi$g;
|
|
428
|
-
_yield$getDetailApi$e = _yield$getDetailApi.extension_data;
|
|
429
|
-
extension_data = _yield$getDetailApi$e === void 0 ? [] : _yield$getDetailApi$e;
|
|
430
|
-
_yield$getDetailApi$c = _yield$getDetailApi.customer_order_behavior_count;
|
|
431
|
-
customer_order_behavior_count = _yield$getDetailApi$c === void 0 ? 0 : _yield$getDetailApi$c;
|
|
432
|
-
_yield$getDetailApi$t = _yield$getDetailApi.total_order_behavior_count;
|
|
433
|
-
total_order_behavior_count = _yield$getDetailApi$t === void 0 ? 0 : _yield$getDetailApi$t;
|
|
434
|
-
_yield$getDetailApi$t2 = _yield$getDetailApi.today_order_behavior_count;
|
|
435
|
-
today_order_behavior_count = _yield$getDetailApi$t2 === void 0 ? 0 : _yield$getDetailApi$t2;
|
|
436
|
-
_yield$getDetailApi$w = _yield$getDetailApi.week_order_behavior_count;
|
|
437
|
-
week_order_behavior_count = _yield$getDetailApi$w === void 0 ? 0 : _yield$getDetailApi$w;
|
|
438
|
-
_yield$getDetailApi$m = _yield$getDetailApi.month_order_behavior_count;
|
|
439
|
-
month_order_behavior_count = _yield$getDetailApi$m === void 0 ? 0 : _yield$getDetailApi$m;
|
|
440
|
-
setAppleWalletUrl(apple_wallet_url);
|
|
441
|
-
setGoogleWalletUrl(google_wallet_url);
|
|
442
|
-
|
|
443
|
-
// 存储从详情接口获取的字段
|
|
444
|
-
setExtensionData(extension_data);
|
|
445
|
-
setCustomerOrderBehaviorCount(customer_order_behavior_count);
|
|
446
|
-
setTotalOrderBehaviorCount(total_order_behavior_count);
|
|
447
|
-
setTodayOrderBehaviorCount(today_order_behavior_count);
|
|
448
|
-
setWeekOrderBehaviorCount(week_order_behavior_count);
|
|
449
|
-
setMonthOrderBehaviorCount(month_order_behavior_count);
|
|
450
|
-
|
|
451
|
-
// 处理使用规则数据
|
|
452
|
-
if (Array.isArray(extension_data) && extension_data.length > 0) {
|
|
453
|
-
usageCreditsItem = extension_data.find(function (item) {
|
|
454
|
-
return item.field_key === 'usage_credits';
|
|
455
|
-
});
|
|
456
|
-
if (usageCreditsItem !== null && usageCreditsItem !== void 0 && usageCreditsItem.value) {
|
|
457
|
-
setUsageCreditsData(usageCreditsItem.value);
|
|
458
|
-
setShouldShowUsageRules(true);
|
|
459
|
-
} else {
|
|
460
|
-
setUsageCreditsData(null);
|
|
461
|
-
setShouldShowUsageRules(false);
|
|
462
|
-
}
|
|
463
|
-
} else {
|
|
464
|
-
setUsageCreditsData(null);
|
|
465
|
-
setShouldShowUsageRules(false);
|
|
466
|
-
}
|
|
467
|
-
case 28:
|
|
468
|
-
case "end":
|
|
469
|
-
return _context.stop();
|
|
470
|
-
}
|
|
471
|
-
}, _callee);
|
|
472
|
-
}));
|
|
473
|
-
return function getDetail() {
|
|
474
|
-
return _ref3.apply(this, arguments);
|
|
475
|
-
};
|
|
476
|
-
}();
|
|
477
|
-
|
|
478
|
-
// 当切换商品卡时,获取新的详情数据
|
|
479
|
-
useEffect(function () {
|
|
480
|
-
if (detail.id) {
|
|
481
|
-
getDetail();
|
|
482
|
-
}
|
|
483
|
-
}, [detail.id]);
|
|
484
|
-
var timeTreeNode = function timeTreeNode(data) {
|
|
485
|
-
var _data$action = data.action,
|
|
486
|
-
action = _data$action === void 0 ? '' : _data$action,
|
|
487
|
-
_data$created_at = data.created_at,
|
|
488
|
-
created_at = _data$created_at === void 0 ? '' : _data$created_at,
|
|
489
|
-
_data$amount = data.amount,
|
|
490
|
-
amount = _data$amount === void 0 ? '' : _data$amount,
|
|
491
|
-
_data$currency_symbol = data.currency_symbol,
|
|
492
|
-
currency_symbol = _data$currency_symbol === void 0 ? '' : _data$currency_symbol;
|
|
493
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
494
|
-
className: "wallet-detail-timeline-node"
|
|
495
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
496
|
-
className: "wallet-detail-timeline-node-left"
|
|
497
|
-
}, /*#__PURE__*/React.createElement("p", {
|
|
498
|
-
className: "wallet-detail-timeline-node-action"
|
|
499
|
-
}, action ? assetActionEnum[action] : ''), created_at && /*#__PURE__*/React.createElement("p", {
|
|
500
|
-
className: "wallet-detail-timeline-node-time"
|
|
501
|
-
}, created_at, (action === 'recharge' || action === 'order_expend') &&
|
|
502
|
-
/*#__PURE__*/
|
|
503
|
-
// @ts-ignore 忽略TypeScript错误,React类型定义问题
|
|
504
|
-
React.createElement("span", {
|
|
505
|
-
className: "wallet-detail-timeline-node-detail-link",
|
|
506
|
-
onClick: function onClick() {
|
|
507
|
-
setIsShowtimeLineDetail(true);
|
|
508
|
-
setIsSpending(action === 'order_expend');
|
|
509
|
-
setTimeLineDetail(data);
|
|
510
|
-
}
|
|
511
|
-
}, locales.getText('page.wallet.viewDetails')))), /*#__PURE__*/React.createElement("div", {
|
|
512
|
-
className: "wallet-detail-timeline-node-amount".concat(action === 'recharge' ? ' wallet-detail-timeline-node-amount-positive' : '').concat(action === 'order_expend' ? ' wallet-detail-timeline-node-amount-negative' : '')
|
|
513
|
-
}, amount && currency_symbol ? formatCurrencyAmount(amount, action === 'order_expend') : ''));
|
|
514
|
-
};
|
|
515
|
-
var getTimeTreeList = /*#__PURE__*/function () {
|
|
516
|
-
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
517
|
-
var _yield$getAssetList, _yield$getAssetList$l, list, filterList, i, _filterList$i, _filterList$i2, _filterList$i3, _filterList$i4;
|
|
518
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
519
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
520
|
-
case 0:
|
|
521
|
-
setIsLoading(true);
|
|
522
|
-
_context2.prev = 1;
|
|
523
|
-
_context2.next = 4;
|
|
524
|
-
return getAssetList({
|
|
525
|
-
num: '99',
|
|
526
|
-
skip: '1',
|
|
527
|
-
card_id: code,
|
|
528
|
-
sourceType: tag,
|
|
529
|
-
tag: tag,
|
|
530
|
-
business_object: 'customer'
|
|
531
|
-
});
|
|
532
|
-
case 4:
|
|
533
|
-
_yield$getAssetList = _context2.sent;
|
|
534
|
-
_yield$getAssetList$l = _yield$getAssetList.list;
|
|
535
|
-
list = _yield$getAssetList$l === void 0 ? [] : _yield$getAssetList$l;
|
|
536
|
-
//移除掉非指定action的记录
|
|
537
|
-
filterList = list.filter(function (item) {
|
|
538
|
-
return !!assetActionEnum[item.action || ''];
|
|
539
|
-
}); // 如果是消费订单 移除掉2024-8-10之前的数据
|
|
540
|
-
for (i = filterList.length - 1; i >= 0; i--) {
|
|
541
|
-
if (((_filterList$i = filterList[i]) === null || _filterList$i === void 0 ? void 0 : _filterList$i.action) === 'order_expend' && dayjs.tz((_filterList$i2 = filterList[i]) === null || _filterList$i2 === void 0 ? void 0 : _filterList$i2.created_at, timezone).unix() < stateTimeUnix) {
|
|
542
|
-
filterList.splice(i, 1); // 移除当前索引的元素
|
|
543
|
-
}
|
|
544
|
-
|
|
545
|
-
// 如果是积分卡 移除掉2024-8-10之前的数据
|
|
546
|
-
if (((_filterList$i3 = filterList[i]) === null || _filterList$i3 === void 0 ? void 0 : _filterList$i3.tag) === 'point_card' && dayjs.tz((_filterList$i4 = filterList[i]) === null || _filterList$i4 === void 0 ? void 0 : _filterList$i4.created_at, timezone).unix() < stateTimeUnix) {
|
|
547
|
-
filterList.splice(i, 1); // 移除当前索引的元素
|
|
548
|
-
}
|
|
549
|
-
}
|
|
550
|
-
setTimeLineData(formatTimeLineDta(filterList));
|
|
551
|
-
_context2.next = 15;
|
|
552
|
-
break;
|
|
553
|
-
case 12:
|
|
554
|
-
_context2.prev = 12;
|
|
555
|
-
_context2.t0 = _context2["catch"](1);
|
|
556
|
-
console.error('Failed to fetch asset list:', _context2.t0);
|
|
557
|
-
case 15:
|
|
558
|
-
_context2.prev = 15;
|
|
559
|
-
setIsLoading(false);
|
|
560
|
-
return _context2.finish(15);
|
|
561
|
-
case 18:
|
|
562
|
-
case "end":
|
|
563
|
-
return _context2.stop();
|
|
564
|
-
}
|
|
565
|
-
}, _callee2, null, [[1, 12, 15, 18]]);
|
|
566
|
-
}));
|
|
567
|
-
return function getTimeTreeList() {
|
|
568
|
-
return _ref4.apply(this, arguments);
|
|
569
|
-
};
|
|
570
|
-
}();
|
|
571
|
-
useEffect(function () {
|
|
572
|
-
if (code) {
|
|
573
|
-
getTimeTreeList();
|
|
574
|
-
}
|
|
575
|
-
}, [code]);
|
|
576
|
-
/**
|
|
577
|
-
* 添加钱包卡片的公共函数
|
|
578
|
-
* @param url 钱包卡片URL
|
|
579
|
-
* @param type 钱包类型('apple'或'google')
|
|
580
|
-
* @returns Promise<boolean> 是否添加成功
|
|
581
|
-
*/
|
|
582
|
-
var addWalletPass = /*#__PURE__*/function () {
|
|
583
|
-
var _ref5 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3(url, type) {
|
|
584
|
-
var response, passData, blob, downloadUrl, a;
|
|
585
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
586
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
587
|
-
case 0:
|
|
588
|
-
if (url) {
|
|
589
|
-
_context3.next = 3;
|
|
590
|
-
break;
|
|
591
|
-
}
|
|
592
|
-
PisellToast({
|
|
593
|
-
content: locales.getText('page.wallet.urlEmpty') || '钱包链接为空',
|
|
594
|
-
duration: 2
|
|
595
|
-
});
|
|
596
|
-
return _context3.abrupt("return", false);
|
|
597
|
-
case 3:
|
|
598
|
-
if (!isWechat()) {
|
|
599
|
-
_context3.next = 7;
|
|
600
|
-
break;
|
|
601
|
-
}
|
|
602
|
-
setWechatModalOpen(true);
|
|
603
|
-
setCopyUrl(url);
|
|
604
|
-
return _context3.abrupt("return", false);
|
|
605
|
-
case 7:
|
|
606
|
-
setAddWalletLoading(true);
|
|
607
|
-
_context3.prev = 8;
|
|
608
|
-
if (!(type === 'apple')) {
|
|
609
|
-
_context3.next = 27;
|
|
610
|
-
break;
|
|
611
|
-
}
|
|
612
|
-
_context3.next = 12;
|
|
613
|
-
return fetch(url);
|
|
614
|
-
case 12:
|
|
615
|
-
response = _context3.sent;
|
|
616
|
-
if (response.ok) {
|
|
617
|
-
_context3.next = 15;
|
|
618
|
-
break;
|
|
619
|
-
}
|
|
620
|
-
throw new Error("HTTP error! status: ".concat(response.status));
|
|
621
|
-
case 15:
|
|
622
|
-
_context3.next = 17;
|
|
623
|
-
return response.arrayBuffer();
|
|
624
|
-
case 17:
|
|
625
|
-
passData = _context3.sent;
|
|
626
|
-
blob = new Blob([passData], {
|
|
627
|
-
type: 'application/vnd.apple.pkpass'
|
|
628
|
-
});
|
|
629
|
-
downloadUrl = URL.createObjectURL(blob);
|
|
630
|
-
a = document.createElement('a');
|
|
631
|
-
a.href = downloadUrl;
|
|
632
|
-
a.download = 'pass.pkpass';
|
|
633
|
-
a.click();
|
|
634
|
-
URL.revokeObjectURL(downloadUrl); // 清理创建的URL
|
|
635
|
-
_context3.next = 28;
|
|
636
|
-
break;
|
|
637
|
-
case 27:
|
|
638
|
-
window.open(url);
|
|
639
|
-
case 28:
|
|
640
|
-
_context3.next = 34;
|
|
641
|
-
break;
|
|
642
|
-
case 30:
|
|
643
|
-
_context3.prev = 30;
|
|
644
|
-
_context3.t0 = _context3["catch"](8);
|
|
645
|
-
console.error('Failed to add wallet:', _context3.t0);
|
|
646
|
-
PisellToast({
|
|
647
|
-
content: locales.getText('page.wallet.error.addFailed'),
|
|
648
|
-
duration: 3
|
|
649
|
-
});
|
|
650
|
-
case 34:
|
|
651
|
-
_context3.prev = 34;
|
|
652
|
-
setAddWalletLoading(false);
|
|
653
|
-
return _context3.finish(34);
|
|
654
|
-
case 37:
|
|
655
|
-
case "end":
|
|
656
|
-
return _context3.stop();
|
|
657
|
-
}
|
|
658
|
-
}, _callee3, null, [[8, 30, 34, 37]]);
|
|
659
|
-
}));
|
|
660
|
-
return function addWalletPass(_x, _x2) {
|
|
661
|
-
return _ref5.apply(this, arguments);
|
|
662
|
-
};
|
|
663
|
-
}();
|
|
664
|
-
var onAppleClick = /*#__PURE__*/function () {
|
|
665
|
-
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
|
|
666
|
-
return _regeneratorRuntime().wrap(function _callee4$(_context4) {
|
|
667
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
668
|
-
case 0:
|
|
669
|
-
_context4.next = 2;
|
|
670
|
-
return addWalletPass(apple_wallet_url, 'apple');
|
|
671
|
-
case 2:
|
|
672
|
-
case "end":
|
|
673
|
-
return _context4.stop();
|
|
674
|
-
}
|
|
675
|
-
}, _callee4);
|
|
676
|
-
}));
|
|
677
|
-
return function onAppleClick() {
|
|
678
|
-
return _ref6.apply(this, arguments);
|
|
679
|
-
};
|
|
680
|
-
}();
|
|
681
|
-
var onGoogleClick = /*#__PURE__*/function () {
|
|
682
|
-
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5() {
|
|
683
|
-
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
684
|
-
while (1) switch (_context5.prev = _context5.next) {
|
|
685
|
-
case 0:
|
|
686
|
-
_context5.next = 2;
|
|
687
|
-
return addWalletPass(google_wallet_url, 'google');
|
|
688
|
-
case 2:
|
|
689
|
-
case "end":
|
|
690
|
-
return _context5.stop();
|
|
691
|
-
}
|
|
692
|
-
}, _callee5);
|
|
693
|
-
}));
|
|
694
|
-
return function onGoogleClick() {
|
|
695
|
-
return _ref7.apply(this, arguments);
|
|
696
|
-
};
|
|
697
|
-
}();
|
|
698
|
-
var isWechat = function isWechat() {
|
|
699
|
-
return /MicroMessenger/i.test(window.navigator.userAgent);
|
|
700
|
-
};
|
|
701
|
-
var httpCopyToClipboard = function httpCopyToClipboard(text) {
|
|
702
|
-
var textArea = document.createElement('textarea');
|
|
703
|
-
textArea.value = text;
|
|
704
|
-
textArea.style.position = 'fixed';
|
|
705
|
-
textArea.style.top = '-10000px';
|
|
706
|
-
textArea.style.left = '-10000px';
|
|
707
|
-
document.body.appendChild(textArea);
|
|
708
|
-
textArea.focus();
|
|
709
|
-
textArea.select();
|
|
710
|
-
document.execCommand('copy');
|
|
711
|
-
document.body.removeChild(textArea);
|
|
712
|
-
};
|
|
713
|
-
var copyToClipboard = function copyToClipboard(text) {
|
|
714
|
-
if (navigator.clipboard) {
|
|
715
|
-
return navigator.clipboard.writeText(text);
|
|
716
|
-
} else {
|
|
717
|
-
return httpCopyToClipboard(text);
|
|
718
|
-
}
|
|
719
|
-
};
|
|
720
|
-
var onCopyClick = function onCopyClick() {
|
|
721
|
-
copyToClipboard(copyUrl);
|
|
722
|
-
PisellToast({
|
|
723
|
-
content: locales.getText('page.wallet.copySuccess'),
|
|
724
|
-
duration: 2
|
|
725
|
-
});
|
|
726
|
-
setWechatModalOpen(false);
|
|
727
|
-
};
|
|
728
|
-
|
|
729
|
-
// 增加卡片内容区域的ref
|
|
730
|
-
var cardContentRef = useRef(null);
|
|
731
|
-
|
|
732
|
-
/**
|
|
733
|
-
* 处理tab切换
|
|
734
|
-
* @param key 切换的标签ID
|
|
735
|
-
*/
|
|
736
|
-
var handleTabChange = function handleTabChange(key) {
|
|
737
|
-
// 设置当前激活的标签
|
|
738
|
-
setActiveTab(typeof key === 'string' ? key : key.toString());
|
|
739
|
-
|
|
740
|
-
// 如果在H5环境下,需要进行滚动处理
|
|
741
|
-
if (platform === 'h5') {
|
|
742
|
-
setIsScrolling(true);
|
|
743
|
-
setTimeout(function () {
|
|
744
|
-
setIsScrolling(false);
|
|
745
|
-
}, 500);
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
// 只有在用户点击时才进行滚动处理
|
|
749
|
-
if (isUserClickRef.current) {
|
|
750
|
-
// 找到对应的section元素并滚动到该位置
|
|
751
|
-
var section = document.querySelector("[data-section=\"".concat(typeof key === 'string' ? key : key.toString(), "\"]"));
|
|
752
|
-
if (section && cardContentRef.current) {
|
|
753
|
-
// 获取section的顶部位置
|
|
754
|
-
var sectionTop = section.getBoundingClientRect().top;
|
|
755
|
-
// 获取content的顶部位置
|
|
756
|
-
var contentTop = cardContentRef.current.getBoundingClientRect().top;
|
|
757
|
-
// 计算要滚动的距离
|
|
758
|
-
var scrollTop = cardContentRef.current.scrollTop + (sectionTop - contentTop) - 50;
|
|
759
|
-
|
|
760
|
-
// 平滑滚动到目标位置
|
|
761
|
-
cardContentRef.current.scrollTo({
|
|
762
|
-
top: scrollTop,
|
|
763
|
-
behavior: 'smooth'
|
|
764
|
-
});
|
|
765
|
-
}
|
|
766
|
-
isUserClickRef.current = false;
|
|
767
|
-
}
|
|
768
|
-
};
|
|
769
|
-
|
|
770
|
-
// 防止滚动穿透的处理函数
|
|
771
|
-
var preventScrollPropagation = useCallback(function (e) {
|
|
772
|
-
if (!cardContentRef.current) return;
|
|
773
|
-
var scrollContainer = cardContentRef.current;
|
|
774
|
-
var isAtTop = scrollContainer.scrollTop <= 0;
|
|
775
|
-
var isAtBottom = scrollContainer.scrollHeight - scrollContainer.scrollTop <= scrollContainer.clientHeight + 1;
|
|
776
|
-
|
|
777
|
-
// 检查是否触摸事件
|
|
778
|
-
if ('touches' in e) {
|
|
779
|
-
// 触摸事件处理
|
|
780
|
-
var touchEvent = e;
|
|
781
|
-
if (isAtTop && touchEvent.touches[0].clientY > 0 || isAtBottom && touchEvent.touches[0].clientY < 0) {
|
|
782
|
-
// 在边界处阻止事件冒泡
|
|
783
|
-
e.stopPropagation();
|
|
784
|
-
}
|
|
785
|
-
} else {
|
|
786
|
-
// 滚轮事件处理
|
|
787
|
-
var wheelEvent = e;
|
|
788
|
-
if (isAtTop || isAtBottom) {
|
|
789
|
-
// 在边界处阻止事件冒泡和默认行为
|
|
790
|
-
wheelEvent.stopPropagation();
|
|
791
|
-
}
|
|
792
|
-
}
|
|
793
|
-
}, []);
|
|
794
|
-
|
|
795
|
-
// 添加触摸事件监听
|
|
796
|
-
useEffect(function () {
|
|
797
|
-
if (!cardContentRef.current || platform !== 'h5') return;
|
|
798
|
-
var scrollContainer = cardContentRef.current;
|
|
799
|
-
|
|
800
|
-
// 添加触摸事件监听器
|
|
801
|
-
var handleTouchMove = function handleTouchMove(e) {
|
|
802
|
-
preventScrollPropagation(e);
|
|
803
|
-
};
|
|
804
|
-
scrollContainer.addEventListener('touchmove', handleTouchMove, {
|
|
805
|
-
passive: false
|
|
806
|
-
});
|
|
807
|
-
return function () {
|
|
808
|
-
scrollContainer.removeEventListener('touchmove', handleTouchMove);
|
|
809
|
-
};
|
|
810
|
-
}, [platform, preventScrollPropagation]);
|
|
811
|
-
|
|
812
|
-
// 处理滚动监听 - 使用cardContentRef
|
|
813
|
-
useEffect(function () {
|
|
814
|
-
if (!cardContentRef.current) return;
|
|
815
|
-
|
|
816
|
-
// 添加一个变量跟踪是否正在滚动
|
|
817
|
-
var isCurrentlyScrolling = false;
|
|
818
|
-
// 添加一个变量存储最后一次滚动时间
|
|
819
|
-
var lastScrollTime = 0;
|
|
820
|
-
// 添加一个变量存储待更新的锚点ID
|
|
821
|
-
var pendingAnchorId = null;
|
|
822
|
-
var handleScroll = function handleScroll() {
|
|
823
|
-
// 如果是由用户点击锚点触发的滚动,不处理
|
|
824
|
-
if (isScrolling || isUserClickRef.current) return;
|
|
825
|
-
|
|
826
|
-
// 更新最后滚动时间
|
|
827
|
-
lastScrollTime = Date.now();
|
|
828
|
-
// 标记正在滚动
|
|
829
|
-
isCurrentlyScrolling = true;
|
|
830
|
-
|
|
831
|
-
// 清除之前的定时器
|
|
832
|
-
if (scrollTimeoutRef.current) {
|
|
833
|
-
clearTimeout(scrollTimeoutRef.current);
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
// 计算当前应该激活的锚点,但不立即更新UI
|
|
837
|
-
var container = cardContentRef.current;
|
|
838
|
-
if (!container) return;
|
|
839
|
-
var scrollTop = container.scrollTop;
|
|
840
|
-
var headerHeight = 56;
|
|
841
|
-
var containerHeight = container.clientHeight;
|
|
842
|
-
|
|
843
|
-
// 获取所有section的位置信息
|
|
844
|
-
var sectionPositions = anchorOptions.map(function (option) {
|
|
845
|
-
var element = document.getElementById(option.id) || document.querySelector("[data-section=\"".concat(option.id, "\"]"));
|
|
846
|
-
if (!element) return null;
|
|
847
|
-
|
|
848
|
-
// 使用offsetTop计算更准确
|
|
849
|
-
var elementOffsetTop = element.offsetTop;
|
|
850
|
-
var elementHeight = element.offsetHeight;
|
|
851
|
-
|
|
852
|
-
// 计算可见度
|
|
853
|
-
var isElementVisible = elementOffsetTop >= scrollTop && elementOffsetTop <= scrollTop + containerHeight || elementOffsetTop + elementHeight >= scrollTop && elementOffsetTop + elementHeight <= scrollTop + containerHeight || elementOffsetTop <= scrollTop && elementOffsetTop + elementHeight >= scrollTop + containerHeight;
|
|
854
|
-
return {
|
|
855
|
-
id: option.id,
|
|
856
|
-
offsetTop: elementOffsetTop,
|
|
857
|
-
height: elementHeight,
|
|
858
|
-
distanceFromViewportTop: Math.abs(elementOffsetTop - scrollTop - headerHeight),
|
|
859
|
-
isVisible: isElementVisible
|
|
860
|
-
};
|
|
861
|
-
}).filter(function (section) {
|
|
862
|
-
return section !== null;
|
|
863
|
-
});
|
|
864
|
-
|
|
865
|
-
// 找到最合适的section - 优先考虑可见的且距离视口顶部最近的
|
|
866
|
-
var visibleSections = sectionPositions.filter(function (section) {
|
|
867
|
-
return section.isVisible;
|
|
868
|
-
});
|
|
869
|
-
if (visibleSections.length === 0) return;
|
|
870
|
-
var bestSection = visibleSections.reduce(function (prev, current) {
|
|
871
|
-
return prev.distanceFromViewportTop < current.distanceFromViewportTop ? prev : current;
|
|
872
|
-
});
|
|
873
|
-
|
|
874
|
-
// 存储待更新的锚点ID,但不立即更新
|
|
875
|
-
if (bestSection && activeTab !== bestSection.id) {
|
|
876
|
-
pendingAnchorId = bestSection.id;
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
// 设置一个定时器,在滚动停止300ms后更新锚点
|
|
880
|
-
scrollTimeoutRef.current = setTimeout(function () {
|
|
881
|
-
// 检查自上次滚动以来是否已经过了300ms
|
|
882
|
-
var timeSinceLastScroll = Date.now() - lastScrollTime;
|
|
883
|
-
if (timeSinceLastScroll >= 300) {
|
|
884
|
-
// 滚动已停止300ms,可以更新锚点
|
|
885
|
-
isCurrentlyScrolling = false;
|
|
886
|
-
|
|
887
|
-
// 如果有待更新的锚点ID且不是当前激活的锚点,则更新
|
|
888
|
-
if (pendingAnchorId && activeTab !== pendingAnchorId && !isScrolling) {
|
|
889
|
-
setActiveTab(pendingAnchorId);
|
|
890
|
-
}
|
|
891
|
-
|
|
892
|
-
// 重置待更新的锚点ID
|
|
893
|
-
pendingAnchorId = null;
|
|
894
|
-
} else {
|
|
895
|
-
// 滚动停止时间不足300ms,继续等待
|
|
896
|
-
scrollTimeoutRef.current = setTimeout(function () {
|
|
897
|
-
isCurrentlyScrolling = false;
|
|
898
|
-
if (pendingAnchorId && activeTab !== pendingAnchorId && !isScrolling) {
|
|
899
|
-
setActiveTab(pendingAnchorId);
|
|
900
|
-
}
|
|
901
|
-
pendingAnchorId = null;
|
|
902
|
-
}, 300 - timeSinceLastScroll);
|
|
903
|
-
}
|
|
904
|
-
}, 300);
|
|
905
|
-
};
|
|
906
|
-
var container = cardContentRef.current;
|
|
907
|
-
container.addEventListener('scroll', handleScroll);
|
|
908
|
-
return function () {
|
|
909
|
-
container.removeEventListener('scroll', handleScroll);
|
|
910
|
-
if (scrollTimeoutRef.current) {
|
|
911
|
-
clearTimeout(scrollTimeoutRef.current);
|
|
912
|
-
}
|
|
913
|
-
};
|
|
914
|
-
}, [anchorOptions, activeTab, isScrolling]);
|
|
915
|
-
|
|
916
|
-
// 创建直接的后退处理函数,而不是在useEffect中设置
|
|
917
|
-
var handleBack = useCallback(function () {
|
|
918
|
-
// 简单地调用传入的onBack函数
|
|
919
|
-
if (onBack) {
|
|
920
|
-
onBack();
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
// 仍然保留重置滚动位置和状态的逻辑
|
|
924
|
-
setTimeout(function () {
|
|
925
|
-
if (cardContentRef.current) {
|
|
926
|
-
cardContentRef.current.scrollTop = 0;
|
|
927
|
-
}
|
|
928
|
-
setActiveTab('detail');
|
|
929
|
-
setIsScrolling(false);
|
|
930
|
-
}, 100);
|
|
931
|
-
}, [onBack]);
|
|
932
|
-
|
|
933
|
-
// 仍然保留enhancedOnBack设置,但修改逻辑避免冲突
|
|
934
|
-
useEffect(function () {
|
|
935
|
-
// 不需要任何操作,onBack会在需要时通过handleBack直接调用
|
|
936
|
-
}, [onBack, platform]);
|
|
937
|
-
|
|
938
|
-
// 添加ref用于获取容器元素
|
|
939
|
-
var detailWrapperRef = useRef(null);
|
|
940
|
-
var _useState45 = useState(undefined),
|
|
941
|
-
_useState46 = _slicedToArray(_useState45, 2),
|
|
942
|
-
contentHeight = _useState46[0],
|
|
943
|
-
setContentHeight = _useState46[1];
|
|
944
|
-
|
|
945
|
-
// 添加锚点导航ref
|
|
946
|
-
var anchorWrapperRef = useRef(null);
|
|
947
|
-
|
|
948
|
-
// 计算内容区域高度 - 使用useLayoutEffect确保在DOM渲染后立即计算
|
|
949
|
-
useLayoutEffect(function () {
|
|
950
|
-
var updateContentHeight = function updateContentHeight() {
|
|
951
|
-
if (detailWrapperRef.current) {
|
|
952
|
-
// 计算可视区域高度
|
|
953
|
-
var viewportHeight = window.innerHeight;
|
|
954
|
-
// 获取容器到视口顶部的距离
|
|
955
|
-
var containerTop = detailWrapperRef.current.getBoundingClientRect().top;
|
|
956
|
-
|
|
957
|
-
// 获取不参与滚动区域的参考元素
|
|
958
|
-
var detailHeaderEl = anchorWrapperRef.current;
|
|
959
|
-
|
|
960
|
-
// 计算不参与滚动区域的高度(锚点导航等)
|
|
961
|
-
var nonScrollableHeight = 0;
|
|
962
|
-
if (detailHeaderEl) {
|
|
963
|
-
// 获取实际高度
|
|
964
|
-
var headerHeight = detailHeaderEl.getBoundingClientRect().height;
|
|
965
|
-
// 添加额外间距
|
|
966
|
-
nonScrollableHeight = headerHeight + 8; // 减少额外间距以增加内容区高度
|
|
967
|
-
} else {
|
|
968
|
-
// 默认值60px
|
|
969
|
-
nonScrollableHeight = 60;
|
|
970
|
-
}
|
|
971
|
-
|
|
972
|
-
// 底部留白和底部按钮高度
|
|
973
|
-
var bottomPadding = 10; // 减少底部留白以增加内容区高度
|
|
974
|
-
|
|
975
|
-
// 移动端环境下,为底部按钮预留空间
|
|
976
|
-
var footerHeight = platform === 'h5' ? 80 : 0; // 底部按钮高度 + 边距
|
|
977
|
-
|
|
978
|
-
// 设置内容高度 = 视口高度 - 容器顶部位置 - 不滚动区域高度 - 底部留白 - 底部按钮高度
|
|
979
|
-
var calculatedHeight = viewportHeight - containerTop - nonScrollableHeight - bottomPadding - footerHeight;
|
|
980
|
-
|
|
981
|
-
// 确保最小高度为400px,以占满更多可用空间
|
|
982
|
-
var finalHeight = Math.max(Math.min(calculatedHeight, viewportHeight - 80), 400);
|
|
983
|
-
|
|
984
|
-
// 更新状态
|
|
985
|
-
setContentHeight(finalHeight);
|
|
986
|
-
} else {
|
|
987
|
-
setContentHeight(undefined);
|
|
988
|
-
}
|
|
989
|
-
};
|
|
990
|
-
|
|
991
|
-
// 初始化时计算一次,使用setTimeout确保DOM已经渲染完成
|
|
992
|
-
var timer = setTimeout(function () {
|
|
993
|
-
updateContentHeight();
|
|
994
|
-
// 第二次计算,确保准确性
|
|
995
|
-
setTimeout(updateContentHeight, 200);
|
|
996
|
-
}, 100);
|
|
997
|
-
|
|
998
|
-
// 窗口大小变化时重新计算
|
|
999
|
-
window.addEventListener('resize', updateContentHeight);
|
|
1000
|
-
|
|
1001
|
-
// 创建ResizeObserver来监听容器尺寸变化
|
|
1002
|
-
var resizeObserver = null;
|
|
1003
|
-
if (detailWrapperRef.current) {
|
|
1004
|
-
resizeObserver = new ResizeObserver(function () {
|
|
1005
|
-
updateContentHeight();
|
|
1006
|
-
});
|
|
1007
|
-
resizeObserver.observe(detailWrapperRef.current);
|
|
1008
|
-
}
|
|
1009
|
-
return function () {
|
|
1010
|
-
window.removeEventListener('resize', updateContentHeight);
|
|
1011
|
-
if (resizeObserver) {
|
|
1012
|
-
resizeObserver.disconnect();
|
|
1013
|
-
}
|
|
1014
|
-
clearTimeout(timer);
|
|
1015
|
-
};
|
|
1016
|
-
}, [platform]);
|
|
1017
|
-
|
|
1018
|
-
// assetActionEnum定义,在上次编辑中被意外删除
|
|
1019
|
-
var assetActionEnum = {
|
|
1020
|
-
recharge: tag === 'point_card' ? locales.getText('page.wallet.pointsEarned') : locales.getText('page.wallet.recharge'),
|
|
1021
|
-
order_expend: tag === 'point_card' ? locales.getText('page.wallet.pointsRedeemed') : locales.getText('page.wallet.spending'),
|
|
1022
|
-
order_refund: locales.getText('page.wallet.refund'),
|
|
1023
|
-
expire: locales.getText('page.wallet.expire')
|
|
1024
|
-
};
|
|
1025
|
-
|
|
1026
|
-
// 处理充值事件 - 与PC端充值按钮功能一致
|
|
1027
|
-
var handleRecharge = function handleRecharge() {
|
|
1028
|
-
// 触发充值事件
|
|
1029
|
-
if (props.buttonGroupList && props.buttonGroupList[0] && props.buttonGroupList[0][0]) {
|
|
1030
|
-
var rechargeButton = props.buttonGroupList[0][0];
|
|
1031
|
-
if (rechargeButton.buttonProps && rechargeButton.buttonProps.onClick) {
|
|
1032
|
-
rechargeButton.buttonProps.onClick();
|
|
1033
|
-
}
|
|
1034
|
-
}
|
|
1035
|
-
};
|
|
1036
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
1037
|
-
className: "wallet-detail".concat(platform === 'h5' ? ' wallet-detail-h5' : ' wallet-detail-pc', " ").concat(className || ''),
|
|
1038
|
-
ref: detailWrapperRef
|
|
1039
|
-
}, (platform === 'h5' || showWalletBar) && !(utils !== null && utils !== void 0 && (_utils$interaction = utils.interaction) !== null && _utils$interaction !== void 0 && (_utils$interaction = _utils$interaction.utils) !== null && _utils$interaction !== void 0 && (_utils$interaction$is = _utils$interaction.isAppEnv) !== null && _utils$interaction$is !== void 0 && _utils$interaction$is.call(_utils$interaction)) && /*#__PURE__*/React.createElement("div", {
|
|
1040
|
-
className: "wallet-detail-header"
|
|
1041
|
-
}, /*#__PURE__*/React.createElement(WalletBar, {
|
|
1042
|
-
setup: "detail",
|
|
1043
|
-
onBack: handleBack
|
|
1044
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
1045
|
-
className: "wallet-detail-content ".concat(platform === 'h5' ? 'wallet-detail-content-h5' : 'wallet-detail-content-pc'),
|
|
1046
|
-
ref: modalContentRef
|
|
1047
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
1048
|
-
className: "wallet-detail-card ".concat(platform === 'h5' ? 'wallet-detail-card-h5' : '')
|
|
1049
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
1050
|
-
className: "wallet-detail-card-header ".concat(platform === 'h5' ? 'wallet-detail-card-header-h5' : ''),
|
|
1051
|
-
ref: anchorWrapperRef
|
|
1052
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
1053
|
-
className: "wallet-detail-card-header-anchor"
|
|
1054
|
-
}, /*#__PURE__*/React.createElement(PisellAnchor, {
|
|
1055
|
-
ref: tabsRef,
|
|
1056
|
-
options: anchorOptions,
|
|
1057
|
-
tab: activeTab,
|
|
1058
|
-
containerRef: cardContentRef,
|
|
1059
|
-
onChange: function onChange(key) {
|
|
1060
|
-
handleTabChange(key);
|
|
1061
|
-
},
|
|
1062
|
-
onTabClick: function onTabClick() {
|
|
1063
|
-
isUserClickRef.current = true;
|
|
1064
|
-
},
|
|
1065
|
-
platform: platform
|
|
1066
|
-
}))), /*#__PURE__*/React.createElement("div", {
|
|
1067
|
-
className: "wallet-detail-card-content ".concat(platform === 'h5' ? 'wallet-detail-card-content-h5' : 'wallet-detail-card-content-pc', " wallet-detail-card-content-hide-scrollbar"),
|
|
1068
|
-
ref: cardContentRef
|
|
1069
|
-
}, /*#__PURE__*/React.createElement("section", {
|
|
1070
|
-
className: "wallet-detail-card-content-section",
|
|
1071
|
-
"data-section": "detail"
|
|
1072
|
-
}, /*#__PURE__*/React.createElement(Text, {
|
|
1073
|
-
className: "wallet-detail-card-content-section-title"
|
|
1074
|
-
}, locales.getText('page.wallet.details')), platform === 'pc' && /*#__PURE__*/React.createElement(ButtonGroupPreview, {
|
|
1075
|
-
buttonGroupList: buttonGroupList
|
|
1076
|
-
}), /*#__PURE__*/React.createElement(PisellStatisticList, {
|
|
1077
|
-
data: listData,
|
|
1078
|
-
labelColor: "#667085",
|
|
1079
|
-
valueColor: "#101828",
|
|
1080
|
-
backgroundColors: ['#fff'],
|
|
1081
|
-
isHasBorder: false
|
|
1082
|
-
}), description && /*#__PURE__*/React.createElement("div", {
|
|
1083
|
-
className: "wallet-detail-card-content-tip"
|
|
1084
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
1085
|
-
dangerouslySetInnerHTML: {
|
|
1086
|
-
__html: description
|
|
1087
|
-
}
|
|
1088
|
-
})), shouldShowUsageRules && /*#__PURE__*/React.createElement(UsageRules, {
|
|
1089
|
-
locales: locales,
|
|
1090
|
-
rules: usageRules,
|
|
1091
|
-
personalLimit: personalLimit
|
|
1092
|
-
})), /*#__PURE__*/React.createElement("section", {
|
|
1093
|
-
className: "wallet-detail-card-content-section wallet-detail-card-content-section-timeline",
|
|
1094
|
-
"data-section": "activityLog"
|
|
1095
|
-
}, tag !== 'product_discount_card' && /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
1096
|
-
className: "wallet-detail-card-content-section-subtitle"
|
|
1097
|
-
}, locales.getText('page.wallet.activelog')), isLoading ? /*#__PURE__*/React.createElement("div", {
|
|
1098
|
-
className: "wallet-detail-timeline-loading"
|
|
1099
|
-
}, /*#__PURE__*/React.createElement(Skeleton, {
|
|
1100
|
-
active: true,
|
|
1101
|
-
paragraph: {
|
|
1102
|
-
rows: 6
|
|
1103
|
-
},
|
|
1104
|
-
round: true
|
|
1105
|
-
})) : TimeLineData.length > 0 ? /*#__PURE__*/React.createElement(Timeline, {
|
|
1106
|
-
items: TimeLineData,
|
|
1107
|
-
className: "wallet-detail-timeline-list"
|
|
1108
|
-
}) : /*#__PURE__*/React.createElement("div", {
|
|
1109
|
-
className: "wallet-detail-card-content-section-empty"
|
|
1110
|
-
}, /*#__PURE__*/React.createElement(PisellEmpty, null))))))), platform === 'h5' && /*#__PURE__*/React.createElement(FooterButtons, {
|
|
1111
|
-
step: "detail",
|
|
1112
|
-
addWalletLoading: addWalletLoading,
|
|
1113
|
-
onAppleWalletClick: tag === 'gift_card' ? addWalletCard : undefined,
|
|
1114
|
-
onRechargeClick: tag === 'gift_card' && (detail === null || detail === void 0 || (_detail$machinecode_c = detail.machinecode_config) === null || _detail$machinecode_c === void 0 ? void 0 : _detail$machinecode_c.hide_recharge) === 0 ? handleRecharge : undefined,
|
|
1115
|
-
platform: platform,
|
|
1116
|
-
isIOS: isIos()
|
|
1117
|
-
}), /*#__PURE__*/React.createElement(PisellModal, {
|
|
1118
|
-
platform: platform === 'pc' ? 'pc' : 'h5',
|
|
1119
|
-
mobileModalHeight: "auto",
|
|
1120
|
-
cancelVisible: false,
|
|
1121
|
-
destroyOnClose: true,
|
|
1122
|
-
onCancel: function onCancel() {
|
|
1123
|
-
return setIsShowtimeLineDetail(false);
|
|
1124
|
-
},
|
|
1125
|
-
title: isSpending ? locales.getText('page.wallet.spendingDetails') : locales.getText('page.wallet.rechargeDetails'),
|
|
1126
|
-
open: isShowtimeLineDetail,
|
|
1127
|
-
footer: [/*#__PURE__*/React.createElement(Button, {
|
|
1128
|
-
type: "primary",
|
|
1129
|
-
block: true,
|
|
1130
|
-
size: "large",
|
|
1131
|
-
onClick: function onClick() {
|
|
1132
|
-
return setIsShowtimeLineDetail(false);
|
|
1133
|
-
}
|
|
1134
|
-
}, locales.getText('page.wallet.done'))]
|
|
1135
|
-
}, /*#__PURE__*/React.createElement(PisellStatisticList, {
|
|
1136
|
-
data: [{
|
|
1137
|
-
label: locales.getText('page.wallet.date'),
|
|
1138
|
-
value: timeLineDetail.created_at || ''
|
|
1139
|
-
}, {
|
|
1140
|
-
label: isSpending ? locales.getText('page.wallet.spending') : locales.getText('page.wallet.recharge'),
|
|
1141
|
-
value: formatCurrencyAmount((timeLineDetail === null || timeLineDetail === void 0 ? void 0 : timeLineDetail.amount) || '', isSpending)
|
|
1142
|
-
}, {
|
|
1143
|
-
label: locales.getText('page.wallet.viewOrder'),
|
|
1144
|
-
value: !!timeLineDetail.resource_code ? "#".concat(timeLineDetail.resource_code) : '',
|
|
1145
|
-
isLink: !!timeLineDetail.resource_code,
|
|
1146
|
-
link: "/order/details?id=".concat(timeLineDetail.resource_id)
|
|
1147
|
-
}],
|
|
1148
|
-
labelColor: "#101828",
|
|
1149
|
-
valueColor: "#101828",
|
|
1150
|
-
backgroundColors: ['#fff'],
|
|
1151
|
-
isHasBorder: false
|
|
1152
|
-
})), /*#__PURE__*/React.createElement(PisellModal, {
|
|
1153
|
-
platform: platform === 'pc' ? 'pc' : 'h5',
|
|
1154
|
-
mobileModalHeight: "auto",
|
|
1155
|
-
headerDivider: false,
|
|
1156
|
-
closable: true,
|
|
1157
|
-
maskClosable: true,
|
|
1158
|
-
onCancel: function onCancel() {
|
|
1159
|
-
setWechatModalOpen(false);
|
|
1160
|
-
},
|
|
1161
|
-
closeIcon: /*#__PURE__*/React.createElement(XClose, {
|
|
1162
|
-
size: 20,
|
|
1163
|
-
style: {
|
|
1164
|
-
fontSize: '24px'
|
|
1165
|
-
}
|
|
1166
|
-
}),
|
|
1167
|
-
open: wechatModalOpen
|
|
1168
|
-
// title={locales.getText('page.wallet.copyTitle')}
|
|
1169
|
-
,
|
|
1170
|
-
footer: [/*#__PURE__*/React.createElement(Button, {
|
|
1171
|
-
onClick: onCopyClick,
|
|
1172
|
-
block: true,
|
|
1173
|
-
type: "primary",
|
|
1174
|
-
size: "large"
|
|
1175
|
-
}, locales.getText('page.wallet.copyButton'))]
|
|
1176
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
1177
|
-
className: "wallet-detail-copyTitle"
|
|
1178
|
-
}, locales.getText('page.wallet.copyTitle')), /*#__PURE__*/React.createElement("div", {
|
|
1179
|
-
className: "wallet-detail-copyText"
|
|
1180
|
-
}, locales.getText('page.wallet.copyText'))));
|
|
1181
|
-
});
|
|
1182
|
-
export default Detail;
|