@pisell/private-materials 6.8.7 → 6.8.9
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 +19 -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/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 +10 -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/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 +4 -4
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.d.ts +0 -61
- 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/pay/toC/PaymentMethods/MWCreditCard/tds2.d.ts +0 -61
- 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,807 +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 _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
3
|
-
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."); }
|
|
4
|
-
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); }
|
|
5
|
-
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; }
|
|
6
|
-
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; } }
|
|
7
|
-
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
8
|
-
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; }
|
|
9
|
-
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); } }
|
|
10
|
-
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); }); }; }
|
|
11
|
-
import React, { useEffect, useContext, useMemo } from 'react';
|
|
12
|
-
import { Context, Provider } from "./model";
|
|
13
|
-
import { Button, Tabs, Badge, Typography, PisellInformationEntry, PisellModal, Menu, PisellToast, PisellWalletPassCard } from '@pisell/materials';
|
|
14
|
-
import { locales } from '@pisell/utils';
|
|
15
|
-
var Title = Typography.Title;
|
|
16
|
-
import { PlusOutlined, RightOutlined } from '@ant-design/icons';
|
|
17
|
-
import { getWalletList, customer, unbindList } from "./serve";
|
|
18
|
-
import localeTexts from "./locales";
|
|
19
|
-
import { request } from "./../../utils";
|
|
20
|
-
import useEngineContext from "./../../hooks/useEngineContext";
|
|
21
|
-
import RechargeableCard from "./RechargeableCard";
|
|
22
|
-
import DiscountCard from "./DiscountCard";
|
|
23
|
-
import PointCard from "./PointCard";
|
|
24
|
-
import Voucher from "./Voucher/index";
|
|
25
|
-
import WalletBar from "./components/WalletBar";
|
|
26
|
-
import "./index.less";
|
|
27
|
-
import { DetailProvider, useDetail } from "./DetailContext";
|
|
28
|
-
|
|
29
|
-
// 添加新的导出
|
|
30
|
-
export { default as WalletCard } from "./components/WalletCard";
|
|
31
|
-
export * from "./utils/formatUtils";
|
|
32
|
-
export * from "./hooks/useWalletCard";
|
|
33
|
-
export * from "./serve";
|
|
34
|
-
export * from "./model";
|
|
35
|
-
export { DetailProvider, useDetail };
|
|
36
|
-
var Wallet = Provider(function () {
|
|
37
|
-
var _context$appHelper, _utils$getStore, _dvaStore$core;
|
|
38
|
-
var _useContext = useContext(Context),
|
|
39
|
-
global_wallet = _useContext.global_wallet,
|
|
40
|
-
dispatch = _useContext.dispatch;
|
|
41
|
-
var _global_wallet$list = global_wallet.list,
|
|
42
|
-
list = _global_wallet$list === void 0 ? {} : _global_wallet$list,
|
|
43
|
-
currentId = global_wallet.currentId,
|
|
44
|
-
setup = global_wallet.setup,
|
|
45
|
-
currentTag = global_wallet.currentTag,
|
|
46
|
-
addWalletCode = global_wallet.addWalletCode,
|
|
47
|
-
_global_wallet$search = global_wallet.searchList,
|
|
48
|
-
searchList = _global_wallet$search === void 0 ? [] : _global_wallet$search,
|
|
49
|
-
_global_wallet$curren = global_wallet.currentSearchListItemCode,
|
|
50
|
-
currentSearchListItemCode = _global_wallet$curren === void 0 ? '' : _global_wallet$curren,
|
|
51
|
-
_global_wallet$addMod = global_wallet.addModalOpen,
|
|
52
|
-
addModalOpen = _global_wallet$addMod === void 0 ? false : _global_wallet$addMod,
|
|
53
|
-
_global_wallet$curren2 = global_wallet.currentDetail,
|
|
54
|
-
currentDetail = _global_wallet$curren2 === void 0 ? {} : _global_wallet$curren2;
|
|
55
|
-
var context = useEngineContext();
|
|
56
|
-
var utils = (context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {};
|
|
57
|
-
var platform = useMemo(function () {
|
|
58
|
-
if (utils.isMobile) {
|
|
59
|
-
return utils.isMobile() ? 'h5' : 'pc';
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
// 备选方案
|
|
63
|
-
if (typeof window !== 'undefined') {
|
|
64
|
-
return window.innerWidth <= 768 ? 'h5' : 'pc';
|
|
65
|
-
}
|
|
66
|
-
return 'pc'; // 默认为PC
|
|
67
|
-
}, [utils]);
|
|
68
|
-
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();
|
|
69
|
-
locales.init(localeTexts, (dvaStore === null || dvaStore === void 0 || (_dvaStore$core = dvaStore.core) === null || _dvaStore$core === void 0 ? void 0 : _dvaStore$core.translateLocale) || 'en');
|
|
70
|
-
request.setRequest(utils === null || utils === void 0 ? void 0 : utils.request);
|
|
71
|
-
useEffect(function () {
|
|
72
|
-
document.body.id = 'body';
|
|
73
|
-
getList({
|
|
74
|
-
num: 999,
|
|
75
|
-
skip: 1,
|
|
76
|
-
with: ['customScheduleSnapshot']
|
|
77
|
-
});
|
|
78
|
-
}, []);
|
|
79
|
-
var transformData = function transformData(data) {
|
|
80
|
-
var result = {};
|
|
81
|
-
data === null || data === void 0 || data.forEach(function (item) {
|
|
82
|
-
var tag = item.tag,
|
|
83
|
-
par_value = item.par_value;
|
|
84
|
-
if (!tag) {
|
|
85
|
-
console.warn('[transformData] Missing tag in item', item);
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
if (!result[tag]) {
|
|
89
|
-
result[tag] = [];
|
|
90
|
-
}
|
|
91
|
-
if (tag === 'product_discount_card') {
|
|
92
|
-
var numericVal = parseFloat(par_value || '0');
|
|
93
|
-
if (isNaN(numericVal) || numericVal <= 0) {
|
|
94
|
-
return;
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
if (tag === 'good_pass') {
|
|
98
|
-
if (!result['product_voucher']) {
|
|
99
|
-
result['product_voucher'] = [];
|
|
100
|
-
}
|
|
101
|
-
result['product_voucher'].push(item);
|
|
102
|
-
}
|
|
103
|
-
result[tag].push(item);
|
|
104
|
-
});
|
|
105
|
-
return result;
|
|
106
|
-
};
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* 获取钱包列表
|
|
110
|
-
* @param params 请求参数
|
|
111
|
-
*/
|
|
112
|
-
var getList = /*#__PURE__*/function () {
|
|
113
|
-
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params, addWalletCode) {
|
|
114
|
-
var _ref2, _ref2$list, _list, formatData, _addWalletItem$, _addWalletItem$2, addWalletItem, giftCards, _giftCards$;
|
|
115
|
-
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
116
|
-
while (1) switch (_context.prev = _context.next) {
|
|
117
|
-
case 0:
|
|
118
|
-
_context.prev = 0;
|
|
119
|
-
_context.next = 3;
|
|
120
|
-
return getWalletList(params);
|
|
121
|
-
case 3:
|
|
122
|
-
_context.t0 = _context.sent;
|
|
123
|
-
if (_context.t0) {
|
|
124
|
-
_context.next = 6;
|
|
125
|
-
break;
|
|
126
|
-
}
|
|
127
|
-
_context.t0 = {};
|
|
128
|
-
case 6:
|
|
129
|
-
_ref2 = _context.t0;
|
|
130
|
-
_ref2$list = _ref2.list;
|
|
131
|
-
_list = _ref2$list === void 0 ? [] : _ref2$list;
|
|
132
|
-
formatData = transformData(_list);
|
|
133
|
-
dispatch({
|
|
134
|
-
type: 'setState',
|
|
135
|
-
payload: formatData
|
|
136
|
-
});
|
|
137
|
-
if (!addWalletCode) {
|
|
138
|
-
_context.next = 15;
|
|
139
|
-
break;
|
|
140
|
-
}
|
|
141
|
-
addWalletItem = _list.filter(function (item) {
|
|
142
|
-
return item.code === addWalletCode || item.encoded === addWalletCode;
|
|
143
|
-
}); // 如果添加了礼品卡,则设置当前ID
|
|
144
|
-
dispatch({
|
|
145
|
-
type: 'setState',
|
|
146
|
-
payload: {
|
|
147
|
-
currentTag: ((_addWalletItem$ = addWalletItem[0]) === null || _addWalletItem$ === void 0 ? void 0 : _addWalletItem$.tag) || '',
|
|
148
|
-
currentId: ((_addWalletItem$2 = addWalletItem[0]) === null || _addWalletItem$2 === void 0 ? void 0 : _addWalletItem$2.id) || '',
|
|
149
|
-
currentDetail: addWalletItem[0],
|
|
150
|
-
addWalletCode: ''
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
return _context.abrupt("return");
|
|
154
|
-
case 15:
|
|
155
|
-
// 如果有礼品卡,设置第一个为当前选中
|
|
156
|
-
giftCards = formatData['gift_card']; // 如果礼品卡存在,并且没有当前ID,则设置第一个为当前选中
|
|
157
|
-
if (giftCards && giftCards.length && !currentId) {
|
|
158
|
-
dispatch({
|
|
159
|
-
type: 'setState',
|
|
160
|
-
payload: {
|
|
161
|
-
currentTag: 'gift_card',
|
|
162
|
-
currentId: ((_giftCards$ = giftCards[0]) === null || _giftCards$ === void 0 ? void 0 : _giftCards$.id) || '',
|
|
163
|
-
currentDetail: giftCards[0]
|
|
164
|
-
}
|
|
165
|
-
});
|
|
166
|
-
}
|
|
167
|
-
_context.next = 22;
|
|
168
|
-
break;
|
|
169
|
-
case 19:
|
|
170
|
-
_context.prev = 19;
|
|
171
|
-
_context.t1 = _context["catch"](0);
|
|
172
|
-
console.error(_context.t1);
|
|
173
|
-
case 22:
|
|
174
|
-
case "end":
|
|
175
|
-
return _context.stop();
|
|
176
|
-
}
|
|
177
|
-
}, _callee, null, [[0, 19]]);
|
|
178
|
-
}));
|
|
179
|
-
return function getList(_x, _x2) {
|
|
180
|
-
return _ref.apply(this, arguments);
|
|
181
|
-
};
|
|
182
|
-
}();
|
|
183
|
-
|
|
184
|
-
/**
|
|
185
|
-
* 获取可用卡片的数量
|
|
186
|
-
*/
|
|
187
|
-
var getBadge = function getBadge(data, key) {
|
|
188
|
-
return data.filter(function (item) {
|
|
189
|
-
return item.limit_status === 'enable';
|
|
190
|
-
}).length;
|
|
191
|
-
};
|
|
192
|
-
|
|
193
|
-
/**
|
|
194
|
-
* 处理菜单标签变更
|
|
195
|
-
* @param key 菜单标签
|
|
196
|
-
*/
|
|
197
|
-
var handleTabChange = function handleTabChange(key) {
|
|
198
|
-
dispatch({
|
|
199
|
-
type: 'setState',
|
|
200
|
-
payload: {
|
|
201
|
-
currentTag: key
|
|
202
|
-
}
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
// 在PC环境下,自动选择第一个卡片;在移动端环境下,只切换到卡片列表视图
|
|
206
|
-
if (platform === 'pc') {
|
|
207
|
-
var items = global_wallet[key];
|
|
208
|
-
if (items && items.length > 0) {
|
|
209
|
-
dispatch({
|
|
210
|
-
type: 'setState',
|
|
211
|
-
payload: {
|
|
212
|
-
currentId: items[0].id,
|
|
213
|
-
currentDetail: items[0]
|
|
214
|
-
}
|
|
215
|
-
});
|
|
216
|
-
}
|
|
217
|
-
} else {
|
|
218
|
-
// 移动端环境下,设置setup=list来显示卡片列表,不自动选择详情
|
|
219
|
-
dispatch({
|
|
220
|
-
type: 'setState',
|
|
221
|
-
payload: {
|
|
222
|
-
setup: 'list',
|
|
223
|
-
currentId: '',
|
|
224
|
-
// 清空当前ID
|
|
225
|
-
currentDetail: null // 清空当前详情
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
};
|
|
230
|
-
|
|
231
|
-
/**
|
|
232
|
-
* 为不同类型的钱包创建子组件
|
|
233
|
-
*/
|
|
234
|
-
var renderCardComponent = function renderCardComponent(cardType) {
|
|
235
|
-
var setGlobalState = function setGlobalState(payload) {
|
|
236
|
-
return dispatch({
|
|
237
|
-
type: 'setState',
|
|
238
|
-
payload: payload
|
|
239
|
-
});
|
|
240
|
-
};
|
|
241
|
-
var props = {
|
|
242
|
-
globalState: global_wallet,
|
|
243
|
-
setGlobalState: setGlobalState
|
|
244
|
-
};
|
|
245
|
-
switch (cardType) {
|
|
246
|
-
case 'gift_card':
|
|
247
|
-
return /*#__PURE__*/React.createElement(RechargeableCard, props);
|
|
248
|
-
case 'product_voucher':
|
|
249
|
-
return /*#__PURE__*/React.createElement(Voucher, props);
|
|
250
|
-
case 'point_card':
|
|
251
|
-
return /*#__PURE__*/React.createElement(PointCard, props);
|
|
252
|
-
case 'product_discount_card':
|
|
253
|
-
return /*#__PURE__*/React.createElement(DiscountCard, props);
|
|
254
|
-
default:
|
|
255
|
-
return null;
|
|
256
|
-
}
|
|
257
|
-
};
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* 创建Tabs组件的配置
|
|
261
|
-
*/
|
|
262
|
-
var TabsProps = {
|
|
263
|
-
className: 'pisell-lowcode__wallet__tabs',
|
|
264
|
-
defaultActiveKey: 'gift_card',
|
|
265
|
-
onChange: handleTabChange,
|
|
266
|
-
type: 'line',
|
|
267
|
-
items: [{
|
|
268
|
-
key: 'gift_card',
|
|
269
|
-
label: locales.getText('page.wallet.rechargeableCard'),
|
|
270
|
-
children: renderCardComponent('gift_card'),
|
|
271
|
-
badge: getBadge(global_wallet.gift_card, 'gift_card')
|
|
272
|
-
}, {
|
|
273
|
-
key: 'product_voucher',
|
|
274
|
-
label: locales.getText('page.wallet.voucher'),
|
|
275
|
-
children: renderCardComponent('product_voucher'),
|
|
276
|
-
badge: getBadge(global_wallet.product_voucher, 'product_voucher')
|
|
277
|
-
}, {
|
|
278
|
-
key: 'point_card',
|
|
279
|
-
label: locales.getText('page.wallet.pointCard'),
|
|
280
|
-
children: renderCardComponent('point_card'),
|
|
281
|
-
badge: getBadge(global_wallet.point_card, 'point_card')
|
|
282
|
-
}, {
|
|
283
|
-
key: 'product_discount_card',
|
|
284
|
-
label: locales.getText('page.wallet.discountCard'),
|
|
285
|
-
children: renderCardComponent('product_discount_card'),
|
|
286
|
-
badge: getBadge(global_wallet.product_discount_card, 'product_discount_card')
|
|
287
|
-
}]
|
|
288
|
-
};
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* 创建菜单项
|
|
292
|
-
*/
|
|
293
|
-
var menuItem = function menuItem(_ref3) {
|
|
294
|
-
var _ref3$count = _ref3.count,
|
|
295
|
-
count = _ref3$count === void 0 ? 0 : _ref3$count,
|
|
296
|
-
_ref3$title = _ref3.title,
|
|
297
|
-
title = _ref3$title === void 0 ? '' : _ref3$title;
|
|
298
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
299
|
-
className: "pisell-lowcode-wallet-menu-item"
|
|
300
|
-
}, /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement("span", {
|
|
301
|
-
className: "pisell-lowcode-wallet-menu-title"
|
|
302
|
-
}, title), count > 0 && /*#__PURE__*/React.createElement(Badge, {
|
|
303
|
-
styleType: "default",
|
|
304
|
-
count: count
|
|
305
|
-
})), /*#__PURE__*/React.createElement(RightOutlined, null));
|
|
306
|
-
};
|
|
307
|
-
var mergeSearch = function mergeSearch(currentSearch, params) {
|
|
308
|
-
var searchParams = new URLSearchParams(currentSearch);
|
|
309
|
-
Object.entries(params).forEach(function (_ref4) {
|
|
310
|
-
var _ref5 = _slicedToArray(_ref4, 2),
|
|
311
|
-
key = _ref5[0],
|
|
312
|
-
value = _ref5[1];
|
|
313
|
-
searchParams.set(key, value);
|
|
314
|
-
});
|
|
315
|
-
return searchParams.toString();
|
|
316
|
-
};
|
|
317
|
-
|
|
318
|
-
/**
|
|
319
|
-
* 创建Menu组件的配置
|
|
320
|
-
*/
|
|
321
|
-
var MenuProps = {
|
|
322
|
-
className: 'pisell-lowcode-wallet-menu',
|
|
323
|
-
onClick: function onClick(e) {
|
|
324
|
-
var _context$appHelper$ut;
|
|
325
|
-
(_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut = _context$appHelper$ut.history) === null || _context$appHelper$ut === void 0 || _context$appHelper$ut.push({
|
|
326
|
-
hash: location.hash,
|
|
327
|
-
search: mergeSearch(location.search, {
|
|
328
|
-
type: 'list'
|
|
329
|
-
})
|
|
330
|
-
});
|
|
331
|
-
dispatch({
|
|
332
|
-
type: 'setState',
|
|
333
|
-
payload: {
|
|
334
|
-
setup: 'list',
|
|
335
|
-
currentTag: e.key,
|
|
336
|
-
currentId: '',
|
|
337
|
-
currentDetail: {}
|
|
338
|
-
}
|
|
339
|
-
});
|
|
340
|
-
},
|
|
341
|
-
items: [{
|
|
342
|
-
key: 'gift_card',
|
|
343
|
-
label: menuItem({
|
|
344
|
-
title: locales.getText('page.wallet.rechargeableCard'),
|
|
345
|
-
count: getBadge(global_wallet.gift_card, 'gift_card')
|
|
346
|
-
})
|
|
347
|
-
}, {
|
|
348
|
-
key: 'product_voucher',
|
|
349
|
-
label: menuItem({
|
|
350
|
-
title: locales.getText('page.wallet.voucher'),
|
|
351
|
-
count: getBadge(global_wallet.product_voucher, 'product_voucher')
|
|
352
|
-
})
|
|
353
|
-
}, {
|
|
354
|
-
key: 'point_card',
|
|
355
|
-
label: menuItem({
|
|
356
|
-
title: locales.getText('page.wallet.pointCard'),
|
|
357
|
-
count: getBadge(global_wallet.point_card, 'point_card')
|
|
358
|
-
})
|
|
359
|
-
}, {
|
|
360
|
-
key: 'product_discount_card',
|
|
361
|
-
label: menuItem({
|
|
362
|
-
title: locales.getText('page.wallet.discountCard'),
|
|
363
|
-
count: getBadge(global_wallet.product_discount_card, 'product_discount_card')
|
|
364
|
-
})
|
|
365
|
-
}]
|
|
366
|
-
};
|
|
367
|
-
|
|
368
|
-
// 监听路由 type变化 dispatch更新setup
|
|
369
|
-
useEffect(function () {
|
|
370
|
-
var searchParams = new URLSearchParams(location.search);
|
|
371
|
-
var type = searchParams.get('type');
|
|
372
|
-
if (type) {
|
|
373
|
-
dispatch({
|
|
374
|
-
type: 'setState',
|
|
375
|
-
payload: {
|
|
376
|
-
setup: type
|
|
377
|
-
}
|
|
378
|
-
});
|
|
379
|
-
} else {
|
|
380
|
-
dispatch({
|
|
381
|
-
type: 'setState',
|
|
382
|
-
payload: {
|
|
383
|
-
setup: 'menu'
|
|
384
|
-
}
|
|
385
|
-
});
|
|
386
|
-
}
|
|
387
|
-
}, [location.search]);
|
|
388
|
-
|
|
389
|
-
/**
|
|
390
|
-
* 处理返回按钮点击
|
|
391
|
-
*/
|
|
392
|
-
var onBack = function onBack() {
|
|
393
|
-
if (setup === 'menu') {
|
|
394
|
-
history.back(); // 后退到上一步
|
|
395
|
-
} else {
|
|
396
|
-
// 根据当前状态决定返回到哪一步
|
|
397
|
-
var prevSetup = setup === 'detail' ? 'list' : 'menu';
|
|
398
|
-
dispatch({
|
|
399
|
-
type: 'setState',
|
|
400
|
-
payload: {
|
|
401
|
-
setup: prevSetup
|
|
402
|
-
}
|
|
403
|
-
});
|
|
404
|
-
history.back(); // 后退到上一步
|
|
405
|
-
}
|
|
406
|
-
};
|
|
407
|
-
|
|
408
|
-
/**
|
|
409
|
-
* 打开添加钱包弹窗
|
|
410
|
-
*/
|
|
411
|
-
var openAddModal = function openAddModal() {
|
|
412
|
-
dispatch({
|
|
413
|
-
type: 'setState',
|
|
414
|
-
payload: {
|
|
415
|
-
addModalOpen: true
|
|
416
|
-
}
|
|
417
|
-
});
|
|
418
|
-
};
|
|
419
|
-
|
|
420
|
-
/**
|
|
421
|
-
* 关闭添加钱包弹窗
|
|
422
|
-
*/
|
|
423
|
-
var closeAddModal = function closeAddModal() {
|
|
424
|
-
dispatch({
|
|
425
|
-
type: 'setState',
|
|
426
|
-
payload: {
|
|
427
|
-
addModalOpen: false,
|
|
428
|
-
searchList: [],
|
|
429
|
-
currentSearchListItemCode: ''
|
|
430
|
-
}
|
|
431
|
-
});
|
|
432
|
-
};
|
|
433
|
-
|
|
434
|
-
/**
|
|
435
|
-
* 添加钱包
|
|
436
|
-
* @param code 钱包代码
|
|
437
|
-
*/
|
|
438
|
-
var addWallet = /*#__PURE__*/function () {
|
|
439
|
-
var _ref6 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(code) {
|
|
440
|
-
var onError, data, tagMap, cardType, successMessage;
|
|
441
|
-
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
442
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
443
|
-
case 0:
|
|
444
|
-
// 错误处理回调
|
|
445
|
-
onError = function onError() {
|
|
446
|
-
PisellToast({
|
|
447
|
-
content: locales.getText('page.wallet.addError'),
|
|
448
|
-
duration: 2
|
|
449
|
-
});
|
|
450
|
-
dispatch({
|
|
451
|
-
type: 'setState',
|
|
452
|
-
payload: {
|
|
453
|
-
addModalOpen: false
|
|
454
|
-
}
|
|
455
|
-
});
|
|
456
|
-
};
|
|
457
|
-
_context2.next = 3;
|
|
458
|
-
return customer({
|
|
459
|
-
code: code
|
|
460
|
-
}, onError);
|
|
461
|
-
case 3:
|
|
462
|
-
data = _context2.sent;
|
|
463
|
-
if (data) {
|
|
464
|
-
// 显示成功提示
|
|
465
|
-
tagMap = {
|
|
466
|
-
gift_card: 'rechargeableCard',
|
|
467
|
-
product_voucher: 'voucher',
|
|
468
|
-
point_card: 'pointCard',
|
|
469
|
-
product_discount_card: 'discountCard'
|
|
470
|
-
};
|
|
471
|
-
cardType = tagMap[currentTag];
|
|
472
|
-
successMessage = "".concat(locales.getText("page.wallet.".concat(cardType)), " ").concat(locales.getText('page.wallet.addSuccess'));
|
|
473
|
-
PisellToast({
|
|
474
|
-
content: successMessage,
|
|
475
|
-
duration: 2
|
|
476
|
-
});
|
|
477
|
-
|
|
478
|
-
// 重新获取列表
|
|
479
|
-
getList({
|
|
480
|
-
num: 999,
|
|
481
|
-
skip: 1,
|
|
482
|
-
with: ['customScheduleSnapshot']
|
|
483
|
-
}, code);
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
// 关闭弹窗
|
|
487
|
-
dispatch({
|
|
488
|
-
type: 'setState',
|
|
489
|
-
payload: {
|
|
490
|
-
addModalOpen: false,
|
|
491
|
-
searchList: [],
|
|
492
|
-
currentSearchListItemCode: ''
|
|
493
|
-
}
|
|
494
|
-
});
|
|
495
|
-
case 6:
|
|
496
|
-
case "end":
|
|
497
|
-
return _context2.stop();
|
|
498
|
-
}
|
|
499
|
-
}, _callee2);
|
|
500
|
-
}));
|
|
501
|
-
return function addWallet(_x3) {
|
|
502
|
-
return _ref6.apply(this, arguments);
|
|
503
|
-
};
|
|
504
|
-
}();
|
|
505
|
-
|
|
506
|
-
/**
|
|
507
|
-
* 搜索钱包
|
|
508
|
-
*/
|
|
509
|
-
var handleSearch = /*#__PURE__*/function () {
|
|
510
|
-
var _ref7 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
511
|
-
var code,
|
|
512
|
-
resetSearchState,
|
|
513
|
-
onSearchFail,
|
|
514
|
-
data,
|
|
515
|
-
_args3 = arguments;
|
|
516
|
-
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
517
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
518
|
-
case 0:
|
|
519
|
-
code = _args3.length > 0 && _args3[0] !== undefined ? _args3[0] : '';
|
|
520
|
-
resetSearchState = function resetSearchState() {
|
|
521
|
-
dispatch({
|
|
522
|
-
type: 'setState',
|
|
523
|
-
payload: {
|
|
524
|
-
searchList: [],
|
|
525
|
-
currentSearchListItemCode: ''
|
|
526
|
-
}
|
|
527
|
-
});
|
|
528
|
-
}; // 清空搜索结果
|
|
529
|
-
if (code.trim()) {
|
|
530
|
-
_context3.next = 5;
|
|
531
|
-
break;
|
|
532
|
-
}
|
|
533
|
-
resetSearchState();
|
|
534
|
-
return _context3.abrupt("return");
|
|
535
|
-
case 5:
|
|
536
|
-
// 搜索失败处理
|
|
537
|
-
onSearchFail = function onSearchFail() {
|
|
538
|
-
resetSearchState();
|
|
539
|
-
PisellToast({
|
|
540
|
-
content: locales.getText('page.wallet.searchNoFound'),
|
|
541
|
-
duration: 2
|
|
542
|
-
});
|
|
543
|
-
};
|
|
544
|
-
_context3.prev = 6;
|
|
545
|
-
_context3.next = 9;
|
|
546
|
-
return unbindList({
|
|
547
|
-
code: code,
|
|
548
|
-
tag: global_wallet.currentTag
|
|
549
|
-
}, onSearchFail);
|
|
550
|
-
case 9:
|
|
551
|
-
data = _context3.sent;
|
|
552
|
-
// 处理搜索结果
|
|
553
|
-
if (Array.isArray(data) && data.length > 0) {
|
|
554
|
-
dispatch({
|
|
555
|
-
type: 'setState',
|
|
556
|
-
payload: {
|
|
557
|
-
searchList: data,
|
|
558
|
-
currentSearchListItemCode: data[0].code || ''
|
|
559
|
-
}
|
|
560
|
-
});
|
|
561
|
-
} else {
|
|
562
|
-
onSearchFail();
|
|
563
|
-
}
|
|
564
|
-
_context3.next = 17;
|
|
565
|
-
break;
|
|
566
|
-
case 13:
|
|
567
|
-
_context3.prev = 13;
|
|
568
|
-
_context3.t0 = _context3["catch"](6);
|
|
569
|
-
console.error('[handleSearch] error:', _context3.t0);
|
|
570
|
-
onSearchFail();
|
|
571
|
-
case 17:
|
|
572
|
-
case "end":
|
|
573
|
-
return _context3.stop();
|
|
574
|
-
}
|
|
575
|
-
}, _callee3, null, [[6, 13]]);
|
|
576
|
-
}));
|
|
577
|
-
return function handleSearch() {
|
|
578
|
-
return _ref7.apply(this, arguments);
|
|
579
|
-
};
|
|
580
|
-
}();
|
|
581
|
-
|
|
582
|
-
/**
|
|
583
|
-
* 渲染PC版布局
|
|
584
|
-
*/
|
|
585
|
-
var renderPcLayout = function renderPcLayout() {
|
|
586
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
587
|
-
className: "pisell-lowcode-wallet-pc"
|
|
588
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
589
|
-
className: "pisell-lowcode-wallet-header"
|
|
590
|
-
}, /*#__PURE__*/React.createElement(Title, {
|
|
591
|
-
className: "pisell-lowcode-wallet-title"
|
|
592
|
-
}, locales.getText('page.wallet.wallet')), /*#__PURE__*/React.createElement(Button, {
|
|
593
|
-
icon: /*#__PURE__*/React.createElement(PlusOutlined, null),
|
|
594
|
-
size: "large",
|
|
595
|
-
onClick: openAddModal
|
|
596
|
-
}, locales.getText('page.wallet.add'))), /*#__PURE__*/React.createElement(Tabs, TabsProps));
|
|
597
|
-
};
|
|
598
|
-
|
|
599
|
-
/**
|
|
600
|
-
* 根据setup渲染移动端内容区域
|
|
601
|
-
*/
|
|
602
|
-
var renderMobileContent = function renderMobileContent() {
|
|
603
|
-
// 标题区域(只在setup=menu时显示)
|
|
604
|
-
var renderTitle = function renderTitle() {
|
|
605
|
-
if (setup === 'menu') {
|
|
606
|
-
return /*#__PURE__*/React.createElement(Title, {
|
|
607
|
-
className: "pisell-lowcode-wallet-title"
|
|
608
|
-
}, locales.getText('page.wallet.wallet'));
|
|
609
|
-
}
|
|
610
|
-
return null;
|
|
611
|
-
};
|
|
612
|
-
|
|
613
|
-
// 内容区域
|
|
614
|
-
var renderContent = function renderContent() {
|
|
615
|
-
switch (setup) {
|
|
616
|
-
case 'menu':
|
|
617
|
-
return /*#__PURE__*/React.createElement(Menu, MenuProps);
|
|
618
|
-
case 'list':
|
|
619
|
-
case 'detail':
|
|
620
|
-
// 无论是列表还是详情视图,都交由子组件的RecordView处理
|
|
621
|
-
// RecordView会根据平台自动处理PC/H5布局切换
|
|
622
|
-
return renderCardComponent(currentTag);
|
|
623
|
-
default:
|
|
624
|
-
return renderCardComponent(currentTag);
|
|
625
|
-
}
|
|
626
|
-
};
|
|
627
|
-
return /*#__PURE__*/React.createElement(React.Fragment, null, renderTitle(), renderContent());
|
|
628
|
-
};
|
|
629
|
-
|
|
630
|
-
/**
|
|
631
|
-
* 渲染移动端底部按钮
|
|
632
|
-
*/
|
|
633
|
-
var renderMobileFooter = function renderMobileFooter() {
|
|
634
|
-
// 只在非首页显示底部
|
|
635
|
-
if (setup === 'menu') {
|
|
636
|
-
return null;
|
|
637
|
-
}
|
|
638
|
-
// 添加按钮(setup=list时显示)
|
|
639
|
-
if (setup === 'list') {
|
|
640
|
-
return /*#__PURE__*/React.createElement(Button, {
|
|
641
|
-
block: true,
|
|
642
|
-
size: "large",
|
|
643
|
-
className: "pisell-lowcode-wallet-add",
|
|
644
|
-
type: "default",
|
|
645
|
-
onClick: openAddModal
|
|
646
|
-
}, locales.getText('page.wallet.add'));
|
|
647
|
-
}
|
|
648
|
-
|
|
649
|
-
// 移除setup=detail时的底部按钮(现在由Detail组件自己控制)
|
|
650
|
-
return null;
|
|
651
|
-
};
|
|
652
|
-
|
|
653
|
-
/**
|
|
654
|
-
* 渲染移动端布局
|
|
655
|
-
*/
|
|
656
|
-
var renderMobileLayout = function renderMobileLayout() {
|
|
657
|
-
var _utils$interaction, _utils$interaction$is;
|
|
658
|
-
return /*#__PURE__*/React.createElement("div", {
|
|
659
|
-
className: "pisell-lowcode-wallet-mobile"
|
|
660
|
-
}, !(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(WalletBar, {
|
|
661
|
-
setup: setup,
|
|
662
|
-
onBack: onBack
|
|
663
|
-
}), /*#__PURE__*/React.createElement("div", {
|
|
664
|
-
className: "pisell-lowcode-wallet-content"
|
|
665
|
-
}, renderMobileContent()), /*#__PURE__*/React.createElement("div", {
|
|
666
|
-
className: "pisell-lowcode-wallet-footer"
|
|
667
|
-
}, renderMobileFooter()));
|
|
668
|
-
};
|
|
669
|
-
|
|
670
|
-
/**
|
|
671
|
-
* 渲染搜索结果卡片
|
|
672
|
-
*/
|
|
673
|
-
var renderSearchCard = function renderSearchCard(item) {
|
|
674
|
-
var id = item.id,
|
|
675
|
-
_item$product_name = item.product_name,
|
|
676
|
-
product_name = _item$product_name === void 0 ? '' : _item$product_name,
|
|
677
|
-
_item$balance = item.balance,
|
|
678
|
-
balance = _item$balance === void 0 ? 0 : _item$balance,
|
|
679
|
-
_item$code = item.code,
|
|
680
|
-
code = _item$code === void 0 ? '' : _item$code,
|
|
681
|
-
_item$encoded = item.encoded,
|
|
682
|
-
encoded = _item$encoded === void 0 ? '' : _item$encoded,
|
|
683
|
-
_item$expire_date = item.expire_date,
|
|
684
|
-
expire_date = _item$expire_date === void 0 ? '' : _item$expire_date,
|
|
685
|
-
shop = item.shop,
|
|
686
|
-
limit_status = item.limit_status,
|
|
687
|
-
_item$product_cover = item.product_cover,
|
|
688
|
-
product_cover = _item$product_cover === void 0 ? '' : _item$product_cover,
|
|
689
|
-
_item$unified_message = item.unified_messages,
|
|
690
|
-
unified_messages = _item$unified_message === void 0 ? {} : _item$unified_message,
|
|
691
|
-
_item$par_value = item.par_value,
|
|
692
|
-
par_value = _item$par_value === void 0 ? '' : _item$par_value;
|
|
693
|
-
var _unified_messages$tit = unified_messages.title,
|
|
694
|
-
title = _unified_messages$tit === void 0 ? '' : _unified_messages$tit;
|
|
695
|
-
var _shop$name = shop.name,
|
|
696
|
-
name = _shop$name === void 0 ? '' : _shop$name;
|
|
697
|
-
var isActive = code === currentSearchListItemCode && platform === 'pc';
|
|
698
|
-
var isEnabled = limit_status === 'enable';
|
|
699
|
-
var isDiscountCard = currentTag === 'product_discount_card';
|
|
700
|
-
var handleCardClick = function handleCardClick() {
|
|
701
|
-
dispatch({
|
|
702
|
-
type: 'setState',
|
|
703
|
-
payload: {
|
|
704
|
-
currentSearchListItemCode: code
|
|
705
|
-
}
|
|
706
|
-
});
|
|
707
|
-
};
|
|
708
|
-
var getBalanceTitle = function getBalanceTitle() {
|
|
709
|
-
if (global_wallet.currentTag === 'point_card') {
|
|
710
|
-
return locales.getText('page.wallet.points');
|
|
711
|
-
} else if (global_wallet.currentTag === 'good_pass') {
|
|
712
|
-
return locales.getText('page.wallet.goodPass');
|
|
713
|
-
}
|
|
714
|
-
return undefined;
|
|
715
|
-
};
|
|
716
|
-
return /*#__PURE__*/React.createElement(PisellWalletPassCard, {
|
|
717
|
-
balanceTitle: getBalanceTitle(),
|
|
718
|
-
showDetail: false,
|
|
719
|
-
showRedeem: false,
|
|
720
|
-
showQrCode: false,
|
|
721
|
-
cover: product_cover,
|
|
722
|
-
disabled: !isEnabled,
|
|
723
|
-
showDisabledReason: !isEnabled,
|
|
724
|
-
disabledReason: title,
|
|
725
|
-
propStyle: {
|
|
726
|
-
marginBottom: 10
|
|
727
|
-
},
|
|
728
|
-
showBalanceSymbol: global_wallet.currentTag !== 'point_card',
|
|
729
|
-
showBalance: global_wallet.currentTag !== 'product_discount_card',
|
|
730
|
-
active: isActive,
|
|
731
|
-
name: product_name,
|
|
732
|
-
qrCode: code,
|
|
733
|
-
storeName: name,
|
|
734
|
-
balance: Number(balance),
|
|
735
|
-
code: encoded,
|
|
736
|
-
discount: Number(par_value),
|
|
737
|
-
showDiscount: isDiscountCard,
|
|
738
|
-
validDate: expire_date,
|
|
739
|
-
onClick: handleCardClick
|
|
740
|
-
});
|
|
741
|
-
};
|
|
742
|
-
|
|
743
|
-
/**
|
|
744
|
-
* 获取添加模态框类名
|
|
745
|
-
*/
|
|
746
|
-
var getAddModalClassName = function getAddModalClassName() {
|
|
747
|
-
return addModalOpen ? 'wallet-add-modal' : 'pisell-lowcode__wallet__addModal';
|
|
748
|
-
};
|
|
749
|
-
return /*#__PURE__*/React.createElement(DetailProvider, null, /*#__PURE__*/React.createElement("div", {
|
|
750
|
-
className: "pisell-wallet-container",
|
|
751
|
-
style: {
|
|
752
|
-
height: '100%'
|
|
753
|
-
}
|
|
754
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
755
|
-
className: "pisell-lowcode-wallet",
|
|
756
|
-
style: {
|
|
757
|
-
height: platform === 'pc' ? 'auto' : '100%',
|
|
758
|
-
width: platform === 'pc' ? 960 : '100vw',
|
|
759
|
-
padding: platform === 'pc' ? 20 : 0
|
|
760
|
-
}
|
|
761
|
-
}, platform === 'pc' ? renderPcLayout() : renderMobileLayout()), /*#__PURE__*/React.createElement(PisellModal, {
|
|
762
|
-
className: getAddModalClassName(),
|
|
763
|
-
title: locales.getText('page.wallet.add'),
|
|
764
|
-
platform: platform === 'pc' ? 'pc' : 'h5',
|
|
765
|
-
mobileModalHeight: "auto",
|
|
766
|
-
open: addModalOpen,
|
|
767
|
-
onCancel: closeAddModal,
|
|
768
|
-
cancelVisible: false,
|
|
769
|
-
destroyOnClose: true,
|
|
770
|
-
okText: locales.getText('page.wallet.confirm'),
|
|
771
|
-
okButtonProps: {
|
|
772
|
-
disabled: !currentSearchListItemCode
|
|
773
|
-
},
|
|
774
|
-
onOk: function onOk() {
|
|
775
|
-
return addWallet(currentSearchListItemCode);
|
|
776
|
-
}
|
|
777
|
-
}, /*#__PURE__*/React.createElement("div", {
|
|
778
|
-
style: {
|
|
779
|
-
margin: '24px 0'
|
|
780
|
-
}
|
|
781
|
-
}, /*#__PURE__*/React.createElement(PisellInformationEntry, {
|
|
782
|
-
title: locales.getText('page.wallet.addModalTitle'),
|
|
783
|
-
entryModes: [{
|
|
784
|
-
type: 'scanCode',
|
|
785
|
-
name: locales.getText('page.wallet.scanBarQrCode')
|
|
786
|
-
}, {
|
|
787
|
-
type: 'input',
|
|
788
|
-
name: locales.getText('page.wallet.enterCodes')
|
|
789
|
-
}],
|
|
790
|
-
searchDescribe: locales.getText('page.wallet.searchDescribe'),
|
|
791
|
-
onChange: function onChange(e) {
|
|
792
|
-
return handleSearch(e);
|
|
793
|
-
},
|
|
794
|
-
onChangeType: function onChangeType() {
|
|
795
|
-
dispatch({
|
|
796
|
-
type: 'setState',
|
|
797
|
-
payload: {
|
|
798
|
-
searchList: [],
|
|
799
|
-
currentSearchListItemCode: ''
|
|
800
|
-
}
|
|
801
|
-
});
|
|
802
|
-
}
|
|
803
|
-
}), searchList.map(function (item) {
|
|
804
|
-
return renderSearchCard(item);
|
|
805
|
-
})))));
|
|
806
|
-
});
|
|
807
|
-
export default Wallet;
|