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