@pisell/private-materials 6.3.25 → 6.3.27
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 +1 -1
- package/build/lowcode/preview.js +146 -146
- 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 +8 -8
- package/es/components/Sales/Summary/utils.d.ts +1 -1
- package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +1 -0
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Cart/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Deposit/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Services/index.js +22 -8
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +1 -0
- package/es/components/booking/addons/model.d.ts +10 -1
- package/es/components/booking/components/TabProduct/index.d.ts +1 -0
- package/es/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/es/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
- package/es/components/booking/components/collapsibleList/utils.d.ts +1 -0
- package/es/components/booking/components/emptyBooking/index.d.ts +1 -0
- package/es/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/es/components/booking/components/reloadResourceModal/index.d.ts +1 -0
- package/es/components/booking/forms/model.d.ts +10 -1
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
- package/es/components/booking/forms/single/index.d.ts +1 -0
- package/es/components/booking/forms/table/index.d.ts +1 -0
- package/es/components/booking/hooks/useClearCart.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/es/components/booking/info/date/index.d.ts +1 -0
- package/es/components/booking/info/dateRange/index.d.ts +1 -0
- package/es/components/booking/info/model.d.ts +10 -1
- package/es/components/booking/info/notes/index.d.ts +1 -0
- package/es/components/booking/info/service/actions/index.d.ts +1 -0
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/like/index.d.ts +1 -0
- package/es/components/booking/info2/service/actions/index.d.ts +1 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/materiels/contacts/index.d.ts +1 -0
- package/es/components/booking/materiels/duration/index.d.ts +1 -0
- package/es/components/booking/materiels/holder/index.d.ts +1 -0
- package/es/components/booking/materiels/startTime/index.d.ts +1 -0
- package/es/components/booking/model.d.ts +9 -1
- package/es/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
- package/es/components/booking/notes/NoteBlock/index.d.ts +1 -0
- package/es/components/booking/notes/model.d.ts +10 -1
- package/es/components/booking/payments/model.d.ts +10 -1
- package/es/components/eftpos/deviceList/index.d.ts +1 -0
- package/es/components/eftpos/form/index.d.ts +1 -0
- package/es/components/eftpos/group/index.d.ts +1 -0
- package/es/components/eftpos/hooks.d.ts +1 -0
- package/es/components/eftpos/icon/apiKey.d.ts +1 -0
- package/es/components/eftpos/icon/device.d.ts +1 -0
- package/es/components/eftpos/index.d.ts +1 -0
- package/es/components/eftpos/pos.d.ts +1 -0
- package/es/components/eftpos/receipt/index.d.ts +1 -0
- package/es/components/eftposPay/amount.d.ts +1 -0
- package/es/components/eftposPay/app.d.ts +1 -1
- package/es/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/es/components/eftposPay/component/fail/failCustom.d.ts +1 -0
- package/es/components/eftposPay/component/fail/index.d.ts +1 -0
- package/es/components/eftposPay/component/fail/network.d.ts +1 -0
- package/es/components/eftposPay/component/fail/unknow.d.ts +1 -0
- package/es/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/es/components/eftposPay/component/manual/index.d.ts +1 -0
- package/es/components/eftposPay/component/signature/index.d.ts +1 -0
- package/es/components/eftposPay/component/step/index.d.ts +1 -0
- package/es/components/eftposPay/component/step/step.d.ts +1 -0
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/pay.d.ts +1 -0
- package/es/components/eftposPay/payo/config.d.ts +1 -0
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/eftposPay/tip.d.ts +1 -0
- package/es/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/es/components/eftposPay/windcave/receiptAction.d.ts +1 -0
- package/es/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/Item/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Event/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Footer/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Information/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Resource/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +1 -0
- package/es/components/login/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/ApplePay/index.js +68 -35
- package/es/components/pay/toC/PaymentMethods/GooglePay/index.js +70 -42
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +72 -41
- package/es/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.d.ts +15 -0
- package/es/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.js +143 -0
- package/es/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.less +34 -0
- package/es/components/pay/toC/PaymentMethods/hooks/index.d.ts +19 -0
- package/es/components/pay/toC/PaymentMethods/hooks/index.js +126 -0
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/es/components/pay/toC/index.js +3 -2
- package/es/components/pay/toC/locales.d.ts +9 -0
- package/es/components/pay/toC/locales.js +12 -3
- package/es/components/pay/toC/model.d.ts +10 -1
- package/es/components/pay/toC/serve.d.ts +5 -0
- package/es/components/pay/toC/serve.js +9 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/es/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/es/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/es/components/ruleSetting/ruleBorder/index.d.ts +1 -0
- package/es/components/schedules/calendar/calendarItem.d.ts +1 -0
- package/es/components/schedules/calendar/index.d.ts +1 -0
- package/es/components/schedules/components/CurrentDay/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleDetailList/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleList/index.d.ts +1 -0
- package/es/components/schedules/model.d.ts +9 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
- package/es/components/schedules/products/index.d.ts +1 -0
- package/es/components/schedules/products/list/ProductItem/index.d.ts +1 -0
- package/es/components/schedules/products/list/index.d.ts +1 -0
- package/es/components/schedules/resources/index.d.ts +1 -0
- package/es/components/schedules/resources/list/index.d.ts +1 -0
- package/es/components/schedules/resources/relationProduct/index.d.ts +1 -0
- package/es/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
- package/es/components/schedules/schedules/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/es/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
- package/es/components/shoppingCart/index.d.ts +1 -0
- package/es/components/wallet/Detail/model.d.ts +13 -1
- package/es/components/wallet/DiscountCard/model.d.ts +14 -1
- package/es/components/wallet/PointCard/model.d.ts +13 -1
- package/es/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/es/components/wallet/Voucher/model.d.ts +13 -1
- package/es/components/wallet/hooks/useWalletCard.d.ts +1 -0
- package/es/components/wallet/model.d.ts +9 -1
- package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/es/hooks/usePaymentLogger.d.ts +1 -0
- package/es/plus/productSelect/ProductCard/index.d.ts +3 -1
- package/es/plus/productSelect/ProductCard/index.js +14 -5
- package/es/plus/productSelect/index.d.ts +3 -2
- package/es/plus/productSelect/index.js +33 -8
- package/es/plus/productSelect/index.less +4 -0
- package/es/plus/saasCreateOrganization/components/Header.d.ts +1 -0
- package/es/plus/saasRegister/components/EntryEmail.d.ts +1 -0
- package/es/plus/saasRegister/components/EntryInfo.d.ts +1 -0
- package/es/plus/saasRegister/components/GoLogin.d.ts +1 -0
- package/es/plus/saasRegister/components/Header.d.ts +1 -0
- package/es/plus/saasRegister/components/VerifyError.d.ts +1 -0
- package/es/plus/saasRegister/components/VerifyingLink.d.ts +1 -0
- package/es/plus/saasRegister/components/VertifyEmail.d.ts +1 -0
- package/lib/components/Sales/Summary/utils.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Cart/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Deposit/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Services/index.js +8 -3
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +1 -0
- package/lib/components/booking/addons/model.d.ts +10 -1
- package/lib/components/booking/components/TabProduct/index.d.ts +1 -0
- package/lib/components/booking/components/TabProduct/productItem/index.d.ts +1 -0
- package/lib/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
- package/lib/components/booking/components/collapsibleList/utils.d.ts +1 -0
- package/lib/components/booking/components/emptyBooking/index.d.ts +1 -0
- package/lib/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +1 -0
- package/lib/components/booking/components/reloadResourceModal/index.d.ts +1 -0
- package/lib/components/booking/forms/model.d.ts +10 -1
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +1 -0
- package/lib/components/booking/forms/single/index.d.ts +1 -0
- package/lib/components/booking/forms/table/index.d.ts +1 -0
- package/lib/components/booking/hooks/useClearCart.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +1 -0
- package/lib/components/booking/info/date/index.d.ts +1 -0
- package/lib/components/booking/info/dateRange/index.d.ts +1 -0
- package/lib/components/booking/info/model.d.ts +10 -1
- package/lib/components/booking/info/notes/index.d.ts +1 -0
- package/lib/components/booking/info/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service/like/index.d.ts +1 -0
- package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/materiels/contacts/index.d.ts +1 -0
- package/lib/components/booking/materiels/duration/index.d.ts +1 -0
- package/lib/components/booking/materiels/holder/index.d.ts +1 -0
- package/lib/components/booking/materiels/startTime/index.d.ts +1 -0
- package/lib/components/booking/model.d.ts +9 -1
- package/lib/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
- package/lib/components/booking/notes/NoteBlock/index.d.ts +1 -0
- package/lib/components/booking/notes/model.d.ts +10 -1
- package/lib/components/booking/payments/model.d.ts +10 -1
- package/lib/components/eftpos/deviceList/index.d.ts +1 -0
- package/lib/components/eftpos/form/index.d.ts +1 -0
- package/lib/components/eftpos/group/index.d.ts +1 -0
- package/lib/components/eftpos/hooks.d.ts +1 -0
- package/lib/components/eftpos/icon/apiKey.d.ts +1 -0
- package/lib/components/eftpos/icon/device.d.ts +1 -0
- package/lib/components/eftpos/index.d.ts +1 -0
- package/lib/components/eftpos/pos.d.ts +1 -0
- package/lib/components/eftpos/receipt/index.d.ts +1 -0
- package/lib/components/eftposPay/amount.d.ts +1 -0
- package/lib/components/eftposPay/app.d.ts +1 -1
- package/lib/components/eftposPay/component/alert/warn.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/index.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/network.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -0
- package/lib/components/eftposPay/component/header/titlebar.d.ts +1 -0
- package/lib/components/eftposPay/component/manual/index.d.ts +1 -0
- package/lib/components/eftposPay/component/signature/index.d.ts +1 -0
- package/lib/components/eftposPay/component/step/index.d.ts +1 -0
- package/lib/components/eftposPay/component/step/step.d.ts +1 -0
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/pay.d.ts +1 -0
- package/lib/components/eftposPay/payo/config.d.ts +1 -0
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/eftposPay/tip.d.ts +1 -0
- package/lib/components/eftposPay/tyro/hooks.d.ts +1 -0
- package/lib/components/eftposPay/windcave/receiptAction.d.ts +1 -0
- package/lib/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Event/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Information/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Resource/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +1 -0
- package/lib/components/login/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/ApplePay/index.js +27 -7
- package/lib/components/pay/toC/PaymentMethods/GooglePay/index.js +32 -8
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/SuperPayAliPayH5/index.js +30 -4
- package/lib/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.d.ts +15 -0
- package/lib/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.js +88 -0
- package/lib/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.less +34 -0
- package/lib/components/pay/toC/PaymentMethods/hooks/index.d.ts +19 -0
- package/lib/components/pay/toC/PaymentMethods/hooks/index.js +90 -0
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/lib/components/pay/toC/index.js +2 -1
- package/lib/components/pay/toC/locales.d.ts +9 -0
- package/lib/components/pay/toC/locales.js +12 -3
- package/lib/components/pay/toC/model.d.ts +10 -1
- package/lib/components/pay/toC/serve.d.ts +5 -0
- package/lib/components/pay/toC/serve.js +3 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Actor/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +1 -0
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +1 -0
- package/lib/components/ruleSetting/ruleBorder/index.d.ts +1 -0
- package/lib/components/schedules/calendar/calendarItem.d.ts +1 -0
- package/lib/components/schedules/calendar/index.d.ts +1 -0
- package/lib/components/schedules/components/CurrentDay/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleDetailList/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleList/index.d.ts +1 -0
- package/lib/components/schedules/model.d.ts +9 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
- package/lib/components/schedules/products/index.d.ts +1 -0
- package/lib/components/schedules/products/list/ProductItem/index.d.ts +1 -0
- package/lib/components/schedules/products/list/index.d.ts +1 -0
- package/lib/components/schedules/resources/index.d.ts +1 -0
- package/lib/components/schedules/resources/list/index.d.ts +1 -0
- package/lib/components/schedules/resources/relationProduct/index.d.ts +1 -0
- package/lib/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
- package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
- package/lib/components/schedules/schedules/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Empty/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Render/index.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useAddService.d.ts +1 -0
- package/lib/components/shoppingCart/hooks/useClearCart.d.ts +1 -0
- package/lib/components/shoppingCart/index.d.ts +1 -0
- package/lib/components/wallet/Detail/model.d.ts +13 -1
- package/lib/components/wallet/DiscountCard/model.d.ts +14 -1
- package/lib/components/wallet/PointCard/model.d.ts +13 -1
- package/lib/components/wallet/RechargeableCard/model.d.ts +29 -1
- package/lib/components/wallet/Voucher/model.d.ts +13 -1
- package/lib/components/wallet/hooks/useWalletCard.d.ts +1 -0
- package/lib/components/wallet/model.d.ts +9 -1
- package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/lib/hooks/usePaymentLogger.d.ts +1 -0
- package/lib/plus/productSelect/ProductCard/index.d.ts +3 -1
- package/lib/plus/productSelect/ProductCard/index.js +18 -4
- package/lib/plus/productSelect/index.d.ts +3 -2
- package/lib/plus/productSelect/index.js +20 -6
- package/lib/plus/productSelect/index.less +4 -0
- package/lib/plus/saasCreateOrganization/components/Header.d.ts +1 -0
- package/lib/plus/saasRegister/components/EntryEmail.d.ts +1 -0
- package/lib/plus/saasRegister/components/EntryInfo.d.ts +1 -0
- package/lib/plus/saasRegister/components/GoLogin.d.ts +1 -0
- package/lib/plus/saasRegister/components/Header.d.ts +1 -0
- package/lib/plus/saasRegister/components/VerifyError.d.ts +1 -0
- package/lib/plus/saasRegister/components/VerifyingLink.d.ts +1 -0
- package/lib/plus/saasRegister/components/VertifyEmail.d.ts +1 -0
- package/package.json +2 -2
|
@@ -19,6 +19,8 @@ import "./index.less";
|
|
|
19
19
|
import useEngineContext from "../../../../../hooks/useEngineContext";
|
|
20
20
|
import usePaymentLogger from "../../../../../hooks/usePaymentLogger";
|
|
21
21
|
import { clientPayment } from "../../utils";
|
|
22
|
+
import { usePaymentRedirect } from "../hooks";
|
|
23
|
+
import PaymentReturnContent from "../components/PaymentReturnContent";
|
|
22
24
|
/**
|
|
23
25
|
* @title: 支付宝支付
|
|
24
26
|
* @description:
|
|
@@ -27,7 +29,7 @@ import { clientPayment } from "../../utils";
|
|
|
27
29
|
* @Date: 2024-08-16 11:18
|
|
28
30
|
*/
|
|
29
31
|
var SuperPayAliPayH5 = function SuperPayAliPayH5(props, ref) {
|
|
30
|
-
var _context$appHelper, _state$payGroup;
|
|
32
|
+
var _context$appHelper, _state$payGroup, _state$payGroup2, _state$payGroup3;
|
|
31
33
|
var _useContext = useContext(Context),
|
|
32
34
|
state = _useContext.state;
|
|
33
35
|
var onChange = props.onChange;
|
|
@@ -39,6 +41,10 @@ var SuperPayAliPayH5 = function SuperPayAliPayH5(props, ref) {
|
|
|
39
41
|
_useState4 = _slicedToArray(_useState3, 2),
|
|
40
42
|
showSuccessBackButton = _useState4[0],
|
|
41
43
|
setShowSuccessBackButton = _useState4[1];
|
|
44
|
+
var _useState5 = useState(''),
|
|
45
|
+
_useState6 = _slicedToArray(_useState5, 2),
|
|
46
|
+
statePayNumber = _useState6[0],
|
|
47
|
+
setStatePayNumber = _useState6[1];
|
|
42
48
|
var context = useEngineContext();
|
|
43
49
|
var _context$appHelper$ut = (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils,
|
|
44
50
|
interaction = _context$appHelper$ut.interaction;
|
|
@@ -49,6 +55,15 @@ var SuperPayAliPayH5 = function SuperPayAliPayH5(props, ref) {
|
|
|
49
55
|
step: '2'
|
|
50
56
|
});
|
|
51
57
|
|
|
58
|
+
// 使用支付跳转 hooks
|
|
59
|
+
var _usePaymentRedirect = usePaymentRedirect({
|
|
60
|
+
orderId: (_state$payGroup2 = state.payGroup) === null || _state$payGroup2 === void 0 ? void 0 : _state$payGroup2.order_id,
|
|
61
|
+
paymentType: 'aliPay'
|
|
62
|
+
}),
|
|
63
|
+
isReturned = _usePaymentRedirect.isReturned,
|
|
64
|
+
handleRedirect = _usePaymentRedirect.handleRedirect,
|
|
65
|
+
resetState = _usePaymentRedirect.resetState;
|
|
66
|
+
|
|
52
67
|
/**
|
|
53
68
|
* @title: 初始化
|
|
54
69
|
* @description:
|
|
@@ -68,7 +83,7 @@ var SuperPayAliPayH5 = function SuperPayAliPayH5(props, ref) {
|
|
|
68
83
|
// 记录SuperPayAliPayH5初始化开始
|
|
69
84
|
paymentLogger.addLog({
|
|
70
85
|
key: 'SuperPayAliPayH5初始化开始',
|
|
71
|
-
value:
|
|
86
|
+
value: ''
|
|
72
87
|
});
|
|
73
88
|
|
|
74
89
|
// 交易组
|
|
@@ -80,7 +95,7 @@ var SuperPayAliPayH5 = function SuperPayAliPayH5(props, ref) {
|
|
|
80
95
|
// 记录App环境检测
|
|
81
96
|
paymentLogger.addLog({
|
|
82
97
|
key: 'SuperPayAliPayH5App环境检测',
|
|
83
|
-
value:
|
|
98
|
+
value: '检测到App环境,调用客户端支付'
|
|
84
99
|
});
|
|
85
100
|
paymentLogger.sendLogs('SuperPayAliPayH5App环境支付');
|
|
86
101
|
return _context.abrupt("return", clientPayment({
|
|
@@ -112,51 +127,57 @@ var SuperPayAliPayH5 = function SuperPayAliPayH5(props, ref) {
|
|
|
112
127
|
// 记录获取支付参数成功
|
|
113
128
|
paymentLogger.addLog({
|
|
114
129
|
key: 'SuperPayAliPayH5获取支付参数成功',
|
|
115
|
-
value:
|
|
130
|
+
value: ''
|
|
116
131
|
});
|
|
117
132
|
_context.prev = 14;
|
|
118
133
|
_context.next = 17;
|
|
119
134
|
return getAliPayUrl(payGroup.order_id, values);
|
|
120
135
|
case 17:
|
|
121
136
|
data = _context.sent;
|
|
122
|
-
if (data !== null && data !== void 0 && data.pay_url) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
setShowSuccessBackButton(true);
|
|
137
|
+
if (!(data !== null && data !== void 0 && data.pay_url)) {
|
|
138
|
+
_context.next = 29;
|
|
139
|
+
break;
|
|
140
|
+
}
|
|
141
|
+
// 记录获取支付宝支付链接成功
|
|
142
|
+
paymentLogger.addLog({
|
|
143
|
+
key: 'SuperPayAliPayH5获取支付链接成功',
|
|
144
|
+
value: ''
|
|
145
|
+
});
|
|
132
146
|
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
});
|
|
138
|
-
paymentLogger.sendLogs('SuperPayAliPayH5跳转成功');
|
|
147
|
+
// 设置交易号
|
|
148
|
+
setPayNumber(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, data === null || data === void 0 ? void 0 : data.pay_number);
|
|
149
|
+
setStatePayNumber(data === null || data === void 0 ? void 0 : data.pay_number);
|
|
150
|
+
setShowSuccessBackButton(true);
|
|
139
151
|
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
152
|
+
// 记录即将跳转到支付宝
|
|
153
|
+
paymentLogger.addLog({
|
|
154
|
+
key: 'SuperPayAliPayH5准备跳转支付宝',
|
|
155
|
+
value: ''
|
|
156
|
+
});
|
|
157
|
+
paymentLogger.sendLogs('SuperPayAliPayH5跳转成功');
|
|
158
|
+
_context.next = 27;
|
|
159
|
+
return handleRedirect(data === null || data === void 0 ? void 0 : data.pay_url);
|
|
160
|
+
case 27:
|
|
161
|
+
_context.next = 32;
|
|
162
|
+
break;
|
|
163
|
+
case 29:
|
|
164
|
+
// 记录支付链接为空
|
|
165
|
+
paymentLogger.addLog({
|
|
166
|
+
key: 'SuperPayAliPayH5支付链接为空',
|
|
167
|
+
value: {
|
|
168
|
+
title: "\u8BA2\u5355".concat(payGroup === null || payGroup === void 0 ? void 0 : payGroup.order_id, " \u652F\u4ED8\u5B9D\u652F\u4ED8\u94FE\u63A5\u4E3A\u7A7A"),
|
|
169
|
+
data: {
|
|
170
|
+
response_data: data
|
|
151
171
|
}
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
172
|
+
}
|
|
173
|
+
});
|
|
174
|
+
paymentLogger.sendLogs('SuperPayAliPayH5支付链接为空');
|
|
175
|
+
setOpen(false);
|
|
176
|
+
case 32:
|
|
177
|
+
_context.next = 39;
|
|
157
178
|
break;
|
|
158
|
-
case
|
|
159
|
-
_context.prev =
|
|
179
|
+
case 34:
|
|
180
|
+
_context.prev = 34;
|
|
160
181
|
_context.t0 = _context["catch"](14);
|
|
161
182
|
// 记录SuperPayAliPayH5处理错误
|
|
162
183
|
paymentLogger.addLog({
|
|
@@ -171,11 +192,11 @@ var SuperPayAliPayH5 = function SuperPayAliPayH5(props, ref) {
|
|
|
171
192
|
});
|
|
172
193
|
paymentLogger.sendLogs('SuperPayAliPayH5处理失败', _context.t0);
|
|
173
194
|
setOpen(false);
|
|
174
|
-
case
|
|
195
|
+
case 39:
|
|
175
196
|
case "end":
|
|
176
197
|
return _context.stop();
|
|
177
198
|
}
|
|
178
|
-
}, _callee, null, [[14,
|
|
199
|
+
}, _callee, null, [[14, 34]]);
|
|
179
200
|
}));
|
|
180
201
|
return function init(_x) {
|
|
181
202
|
return _ref2.apply(this, arguments);
|
|
@@ -192,6 +213,10 @@ var SuperPayAliPayH5 = function SuperPayAliPayH5(props, ref) {
|
|
|
192
213
|
key: 'success'
|
|
193
214
|
});
|
|
194
215
|
};
|
|
216
|
+
var handleReturn = function handleReturn() {
|
|
217
|
+
setOpen(false);
|
|
218
|
+
resetState();
|
|
219
|
+
};
|
|
195
220
|
return /*#__PURE__*/React.createElement(PisellModal, {
|
|
196
221
|
platform: 'h5',
|
|
197
222
|
open: open,
|
|
@@ -203,10 +228,16 @@ var SuperPayAliPayH5 = function SuperPayAliPayH5(props, ref) {
|
|
|
203
228
|
}
|
|
204
229
|
}, /*#__PURE__*/React.createElement("div", {
|
|
205
230
|
className: ""
|
|
206
|
-
}, /*#__PURE__*/React.createElement(ThreedsLoading, {
|
|
231
|
+
}, !isReturned && /*#__PURE__*/React.createElement(ThreedsLoading, {
|
|
207
232
|
title: locales.getText('tocPay.text.redirectingToAlipay'),
|
|
208
233
|
onSuccessBack: handleSuccessBack,
|
|
209
234
|
showSuccessBackButton: showSuccessBackButton
|
|
235
|
+
}), isReturned && /*#__PURE__*/React.createElement(PaymentReturnContent, {
|
|
236
|
+
pay_number: statePayNumber,
|
|
237
|
+
handleReturn: handleReturn,
|
|
238
|
+
state: state,
|
|
239
|
+
orderId: (_state$payGroup3 = state.payGroup) === null || _state$payGroup3 === void 0 ? void 0 : _state$payGroup3.order_id,
|
|
240
|
+
unique_payment_number: state.front_order_uuid
|
|
210
241
|
})));
|
|
211
242
|
};
|
|
212
243
|
export default /*#__PURE__*/forwardRef(SuperPayAliPayH5);
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import './index.less';
|
|
3
|
+
export interface PaymentReturnContentProps {
|
|
4
|
+
orderId?: string;
|
|
5
|
+
unique_payment_number?: string;
|
|
6
|
+
state?: any;
|
|
7
|
+
handleReturn?: () => void;
|
|
8
|
+
pay_number?: string;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* 支付返回后展示的内容组件
|
|
12
|
+
* 当用户从外部支付页面返回时展示此组件
|
|
13
|
+
*/
|
|
14
|
+
declare const PaymentReturnContent: React.FC<PaymentReturnContentProps>;
|
|
15
|
+
export default PaymentReturnContent;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
5
|
+
import React from 'react';
|
|
6
|
+
import { Button, PisellToast } from '@pisell/materials';
|
|
7
|
+
import { locales } from '@pisell/utils';
|
|
8
|
+
import { useMemoizedFn } from 'ahooks';
|
|
9
|
+
import { getPaymentResult } from "../../../serve";
|
|
10
|
+
import usePrefix from "../../../../../../hooks/usePrefix";
|
|
11
|
+
import "./index.less";
|
|
12
|
+
/**
|
|
13
|
+
* 支付返回后展示的内容组件
|
|
14
|
+
* 当用户从外部支付页面返回时展示此组件
|
|
15
|
+
*/
|
|
16
|
+
var PaymentReturnContent = function PaymentReturnContent(_ref) {
|
|
17
|
+
var orderId = _ref.orderId,
|
|
18
|
+
unique_payment_number = _ref.unique_payment_number,
|
|
19
|
+
state = _ref.state,
|
|
20
|
+
handleReturn = _ref.handleReturn,
|
|
21
|
+
pay_number = _ref.pay_number;
|
|
22
|
+
var prefix = usePrefix();
|
|
23
|
+
var getPaymentIsPaid = useMemoizedFn( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
24
|
+
var _yield$getPaymentResu, data;
|
|
25
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
26
|
+
while (1) switch (_context.prev = _context.next) {
|
|
27
|
+
case 0:
|
|
28
|
+
if (!(!unique_payment_number && !pay_number)) {
|
|
29
|
+
_context.next = 2;
|
|
30
|
+
break;
|
|
31
|
+
}
|
|
32
|
+
return _context.abrupt("return", true);
|
|
33
|
+
case 2:
|
|
34
|
+
_context.next = 4;
|
|
35
|
+
return getPaymentResult({
|
|
36
|
+
order_id: orderId,
|
|
37
|
+
pay_number: pay_number,
|
|
38
|
+
unique_payment_number: pay_number ? undefined : unique_payment_number
|
|
39
|
+
});
|
|
40
|
+
case 4:
|
|
41
|
+
_yield$getPaymentResu = _context.sent;
|
|
42
|
+
data = _yield$getPaymentResu.data;
|
|
43
|
+
return _context.abrupt("return", (data === null || data === void 0 ? void 0 : data.payment_status) === 'paid');
|
|
44
|
+
case 7:
|
|
45
|
+
case "end":
|
|
46
|
+
return _context.stop();
|
|
47
|
+
}
|
|
48
|
+
}, _callee);
|
|
49
|
+
})));
|
|
50
|
+
|
|
51
|
+
/**
|
|
52
|
+
* 查看订单
|
|
53
|
+
* @returns
|
|
54
|
+
*/
|
|
55
|
+
var handleViewOrder = /*#__PURE__*/function () {
|
|
56
|
+
var _ref3 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
57
|
+
var _state$payCallback;
|
|
58
|
+
var isPaid;
|
|
59
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
60
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
61
|
+
case 0:
|
|
62
|
+
_context2.next = 2;
|
|
63
|
+
return getPaymentIsPaid();
|
|
64
|
+
case 2:
|
|
65
|
+
isPaid = _context2.sent;
|
|
66
|
+
if (isPaid) {
|
|
67
|
+
_context2.next = 6;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
PisellToast({
|
|
71
|
+
content: locales.getText('tocPay.text.paymentFailed')
|
|
72
|
+
});
|
|
73
|
+
return _context2.abrupt("return");
|
|
74
|
+
case 6:
|
|
75
|
+
// 如果已支付,则跳转至订单详情
|
|
76
|
+
(_state$payCallback = state.payCallback) === null || _state$payCallback === void 0 || _state$payCallback.call(state, {
|
|
77
|
+
key: 'success'
|
|
78
|
+
});
|
|
79
|
+
case 7:
|
|
80
|
+
case "end":
|
|
81
|
+
return _context2.stop();
|
|
82
|
+
}
|
|
83
|
+
}, _callee2);
|
|
84
|
+
}));
|
|
85
|
+
return function handleViewOrder() {
|
|
86
|
+
return _ref3.apply(this, arguments);
|
|
87
|
+
};
|
|
88
|
+
}();
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* 返回并选择其他支付方式
|
|
92
|
+
* @returns
|
|
93
|
+
*/
|
|
94
|
+
var handleGoBack = /*#__PURE__*/function () {
|
|
95
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
|
|
96
|
+
var isPaid, _state$payCallback2;
|
|
97
|
+
return _regeneratorRuntime().wrap(function _callee3$(_context3) {
|
|
98
|
+
while (1) switch (_context3.prev = _context3.next) {
|
|
99
|
+
case 0:
|
|
100
|
+
_context3.next = 2;
|
|
101
|
+
return getPaymentIsPaid();
|
|
102
|
+
case 2:
|
|
103
|
+
isPaid = _context3.sent;
|
|
104
|
+
if (isPaid) {
|
|
105
|
+
_context3.next = 8;
|
|
106
|
+
break;
|
|
107
|
+
}
|
|
108
|
+
handleReturn === null || handleReturn === void 0 || handleReturn();
|
|
109
|
+
return _context3.abrupt("return");
|
|
110
|
+
case 8:
|
|
111
|
+
// 如果已支付,则跳转至订单详情
|
|
112
|
+
(_state$payCallback2 = state.payCallback) === null || _state$payCallback2 === void 0 || _state$payCallback2.call(state, {
|
|
113
|
+
key: 'success'
|
|
114
|
+
});
|
|
115
|
+
case 9:
|
|
116
|
+
case "end":
|
|
117
|
+
return _context3.stop();
|
|
118
|
+
}
|
|
119
|
+
}, _callee3);
|
|
120
|
+
}));
|
|
121
|
+
return function handleGoBack() {
|
|
122
|
+
return _ref4.apply(this, arguments);
|
|
123
|
+
};
|
|
124
|
+
}();
|
|
125
|
+
return /*#__PURE__*/React.createElement("div", {
|
|
126
|
+
className: "payment-return-content"
|
|
127
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
128
|
+
className: "payment-return-content-img"
|
|
129
|
+
}, /*#__PURE__*/React.createElement("img", {
|
|
130
|
+
src: "".concat(prefix, "/payment-content.png"),
|
|
131
|
+
alt: "success"
|
|
132
|
+
})), /*#__PURE__*/React.createElement("div", {
|
|
133
|
+
className: "payment-return-content-buttons"
|
|
134
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
|
135
|
+
block: true,
|
|
136
|
+
className: "payment-return-content-order-button",
|
|
137
|
+
onClick: handleViewOrder
|
|
138
|
+
}, locales.getText('tocPay.text.paymentCompletedAndViewOrder')), /*#__PURE__*/React.createElement(Button, {
|
|
139
|
+
block: true,
|
|
140
|
+
onClick: handleGoBack
|
|
141
|
+
}, locales.getText('tocPay.text.returnAndSelectOtherPaymentMethod'))));
|
|
142
|
+
};
|
|
143
|
+
export default PaymentReturnContent;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
.payment-return-content {
|
|
2
|
+
padding: 100px 46px 0;
|
|
3
|
+
|
|
4
|
+
.payment-return-content-img {
|
|
5
|
+
width: 100%;
|
|
6
|
+
margin-bottom: 60px;
|
|
7
|
+
min-height: 270px;
|
|
8
|
+
img {
|
|
9
|
+
width: 100%;
|
|
10
|
+
height: 100%;
|
|
11
|
+
}
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
.payment-return-content-buttons {
|
|
15
|
+
display: flex;
|
|
16
|
+
flex-direction: column;
|
|
17
|
+
gap: 24px;
|
|
18
|
+
button {
|
|
19
|
+
border-radius: 40px;
|
|
20
|
+
span {
|
|
21
|
+
width: 100%;
|
|
22
|
+
text-overflow: ellipsis;
|
|
23
|
+
overflow: hidden;
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
.payment-return-content-order-button {
|
|
27
|
+
background: #7F56DA;
|
|
28
|
+
color: var(--Primary-700, #6941C6);
|
|
29
|
+
border: 1px solid var(--Primary-200, #E9D7FE);
|
|
30
|
+
background: var(--Primary-50, #F9F5FF);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export interface UsePaymentRedirectOptions {
|
|
2
|
+
orderId?: string;
|
|
3
|
+
paymentType: string;
|
|
4
|
+
onAfterReturn?: () => void;
|
|
5
|
+
}
|
|
6
|
+
export interface UsePaymentRedirectReturn {
|
|
7
|
+
isReturned: boolean;
|
|
8
|
+
handleRedirect: (url: string) => Promise<void>;
|
|
9
|
+
resetState: () => void;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* 支付跳转 Hook
|
|
13
|
+
* 用于处理跳转到外部支付页面的逻辑,包括:
|
|
14
|
+
* 1. 保存跳转标记到 history state
|
|
15
|
+
* 2. 跳转到外部支付页面
|
|
16
|
+
* 3. 监听页面返回事件
|
|
17
|
+
* 4. 返回后更新状态
|
|
18
|
+
*/
|
|
19
|
+
export declare const usePaymentRedirect: (options: UsePaymentRedirectOptions) => UsePaymentRedirectReturn;
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
|
3
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
4
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
5
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
6
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
7
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
8
|
+
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); } }
|
|
9
|
+
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); }); }; }
|
|
10
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
11
|
+
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."); }
|
|
12
|
+
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); }
|
|
13
|
+
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; }
|
|
14
|
+
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; } }
|
|
15
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
16
|
+
import { useMemoizedFn } from 'ahooks';
|
|
17
|
+
import { useState, useEffect } from 'react';
|
|
18
|
+
/**
|
|
19
|
+
* 支付跳转 Hook
|
|
20
|
+
* 用于处理跳转到外部支付页面的逻辑,包括:
|
|
21
|
+
* 1. 保存跳转标记到 history state
|
|
22
|
+
* 2. 跳转到外部支付页面
|
|
23
|
+
* 3. 监听页面返回事件
|
|
24
|
+
* 4. 返回后更新状态
|
|
25
|
+
*/
|
|
26
|
+
export var usePaymentRedirect = function usePaymentRedirect(options) {
|
|
27
|
+
var orderId = options.orderId,
|
|
28
|
+
paymentType = options.paymentType,
|
|
29
|
+
onAfterReturn = options.onAfterReturn;
|
|
30
|
+
var _useState = useState(false),
|
|
31
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
32
|
+
isReturned = _useState2[0],
|
|
33
|
+
setIsReturned = _useState2[1];
|
|
34
|
+
|
|
35
|
+
/**
|
|
36
|
+
* 执行跳转
|
|
37
|
+
*/
|
|
38
|
+
var handleRedirect = useMemoizedFn( /*#__PURE__*/function () {
|
|
39
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(url) {
|
|
40
|
+
var currentState;
|
|
41
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
42
|
+
while (1) switch (_context.prev = _context.next) {
|
|
43
|
+
case 0:
|
|
44
|
+
_context.prev = 0;
|
|
45
|
+
// 使用 History State 保存跳转标记
|
|
46
|
+
currentState = window.history.state || {};
|
|
47
|
+
window.history.replaceState(_objectSpread(_objectSpread({}, currentState), {}, {
|
|
48
|
+
paymentRedirected: true,
|
|
49
|
+
paymentType: paymentType,
|
|
50
|
+
orderId: orderId,
|
|
51
|
+
timestamp: Date.now()
|
|
52
|
+
}), '', window.location.href);
|
|
53
|
+
|
|
54
|
+
// 跳转到外部支付页面
|
|
55
|
+
window.location.href = url;
|
|
56
|
+
_context.next = 9;
|
|
57
|
+
break;
|
|
58
|
+
case 6:
|
|
59
|
+
_context.prev = 6;
|
|
60
|
+
_context.t0 = _context["catch"](0);
|
|
61
|
+
throw _context.t0;
|
|
62
|
+
case 9:
|
|
63
|
+
case "end":
|
|
64
|
+
return _context.stop();
|
|
65
|
+
}
|
|
66
|
+
}, _callee, null, [[0, 6]]);
|
|
67
|
+
}));
|
|
68
|
+
return function (_x) {
|
|
69
|
+
return _ref.apply(this, arguments);
|
|
70
|
+
};
|
|
71
|
+
}());
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* 重置状态
|
|
75
|
+
*/
|
|
76
|
+
var resetState = useMemoizedFn(function () {
|
|
77
|
+
setIsReturned(false);
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* 监听页面显示事件(包括浏览器返回按钮)
|
|
82
|
+
*/
|
|
83
|
+
useEffect(function () {
|
|
84
|
+
var handlePageShow = function handlePageShow(event) {
|
|
85
|
+
if (!orderId) return;
|
|
86
|
+
|
|
87
|
+
// 检查 History State 中是否有跳转标记
|
|
88
|
+
var historyState = window.history.state;
|
|
89
|
+
if (historyState !== null && historyState !== void 0 && historyState.paymentRedirected && (historyState === null || historyState === void 0 ? void 0 : historyState.paymentType) === paymentType && (historyState === null || historyState === void 0 ? void 0 : historyState.orderId) === orderId) {
|
|
90
|
+
console.log("\u68C0\u6D4B\u5230\u4ECE ".concat(paymentType, " \u8FD4\u56DE, event.persisted:"), event.persisted);
|
|
91
|
+
|
|
92
|
+
// 从支付页面返回,设置返回状态
|
|
93
|
+
setIsReturned(true);
|
|
94
|
+
|
|
95
|
+
// 执行返回后的回调
|
|
96
|
+
if (onAfterReturn) {
|
|
97
|
+
onAfterReturn();
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// 清除标记,避免重复触发
|
|
101
|
+
var newState = _objectSpread({}, historyState);
|
|
102
|
+
delete newState.paymentRedirected;
|
|
103
|
+
delete newState.paymentType;
|
|
104
|
+
delete newState.timestamp;
|
|
105
|
+
delete newState.orderId;
|
|
106
|
+
window.history.replaceState(newState, '', window.location.href);
|
|
107
|
+
}
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
// 首次加载时也检查一次
|
|
111
|
+
handlePageShow({
|
|
112
|
+
persisted: false
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
// 监听 pageshow 事件(浏览器返回时触发)
|
|
116
|
+
window.addEventListener('pageshow', handlePageShow);
|
|
117
|
+
return function () {
|
|
118
|
+
window.removeEventListener('pageshow', handlePageShow);
|
|
119
|
+
};
|
|
120
|
+
}, [orderId, paymentType]);
|
|
121
|
+
return {
|
|
122
|
+
isReturned: isReturned,
|
|
123
|
+
handleRedirect: handleRedirect,
|
|
124
|
+
resetState: resetState
|
|
125
|
+
};
|
|
126
|
+
};
|
|
@@ -17,7 +17,7 @@ import React, { useState, useMemo, useContext, useRef, useImperativeHandle, forw
|
|
|
17
17
|
import { Decimal } from 'decimal.js';
|
|
18
18
|
import { useMemoizedFn, useUpdateEffect } from 'ahooks';
|
|
19
19
|
import { PisellModal, PisellText, PisellContainer, PisellLoading, PisellToast } from '@pisell/materials';
|
|
20
|
-
import { detectIncognito, locales, copyToClipboard } from '@pisell/utils';
|
|
20
|
+
import { detectIncognito, locales, copyToClipboard, getUniqueId } from '@pisell/utils';
|
|
21
21
|
import PayCountdown from "./PayCountdown";
|
|
22
22
|
import PayAmount from "./PayAmount";
|
|
23
23
|
import WalletPassBlock from "./WalletPassBlock";
|
|
@@ -121,7 +121,8 @@ var ToCPay = function ToCPay(props, ref) {
|
|
|
121
121
|
status: 'init',
|
|
122
122
|
// 将支付回调储存在store, 方便其他模块调用
|
|
123
123
|
payCallback: props.callback,
|
|
124
|
-
history: (_context$appHelper$ut5 = context.appHelper.utils) === null || _context$appHelper$ut5 === void 0 ? void 0 : _context$appHelper$ut5.history
|
|
124
|
+
history: (_context$appHelper$ut5 = context.appHelper.utils) === null || _context$appHelper$ut5 === void 0 ? void 0 : _context$appHelper$ut5.history,
|
|
125
|
+
front_order_uuid: getUniqueId('front_order_uuid_')
|
|
125
126
|
// 支付组
|
|
126
127
|
// payGroup: {
|
|
127
128
|
// order_id: initProps?.order?.order_id,
|
|
@@ -94,6 +94,9 @@ declare const _default: {
|
|
|
94
94
|
'tocPay.text.youCanSelectMultipleWalletPassesToCombineForPayment': (walletName: string) => string;
|
|
95
95
|
'tocPay.text.bestValueCombination': string;
|
|
96
96
|
'tocPay.text.viewDetail': string;
|
|
97
|
+
'tocPay.text.returnAndSelectOtherPaymentMethod': string;
|
|
98
|
+
'tocPay.text.paymentCompletedAndViewOrder': string;
|
|
99
|
+
'tocPay.text.paymentFailed': string;
|
|
97
100
|
};
|
|
98
101
|
'zh-CN': {
|
|
99
102
|
'tocPay.text.checkout': string;
|
|
@@ -189,6 +192,9 @@ declare const _default: {
|
|
|
189
192
|
'tocPay.text.youCanSelectMultipleWalletPassesToCombineForPayment': (walletName: string) => string;
|
|
190
193
|
'tocPay.text.bestValueCombination': string;
|
|
191
194
|
'tocPay.text.viewDetail': string;
|
|
195
|
+
'tocPay.text.returnAndSelectOtherPaymentMethod': string;
|
|
196
|
+
'tocPay.text.paymentCompletedAndViewOrder': string;
|
|
197
|
+
'tocPay.text.paymentFailed': string;
|
|
192
198
|
};
|
|
193
199
|
'zh-HK': {
|
|
194
200
|
'tocPay.text.checkout': string;
|
|
@@ -284,6 +290,9 @@ declare const _default: {
|
|
|
284
290
|
'tocPay.text.youCanSelectMultipleWalletPassesToCombineForPayment': (walletName: string) => string;
|
|
285
291
|
'tocPay.text.bestValueCombination': string;
|
|
286
292
|
'tocPay.text.viewDetail': string;
|
|
293
|
+
'tocPay.text.returnAndSelectOtherPaymentMethod': string;
|
|
294
|
+
'tocPay.text.paymentCompletedAndViewOrder': string;
|
|
295
|
+
'tocPay.text.paymentFailed': string;
|
|
287
296
|
};
|
|
288
297
|
};
|
|
289
298
|
export default _default;
|