@pisell/private-materials 6.4.35 → 6.4.37
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 +150 -150
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +6 -6
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +8 -8
- package/es/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
- package/es/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Deposit/index.d.ts +0 -1
- 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/deposit/components/PolicyModal/index.d.ts +0 -1
- package/es/components/booking/components/TabProduct/index.d.ts +0 -1
- package/es/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
- package/es/components/booking/components/TabProduct/selectProductItem/index.d.ts +0 -1
- package/es/components/booking/components/actionButtons/index.js +2 -2
- package/es/components/booking/components/collapsibleList/utils.d.ts +0 -1
- package/es/components/booking/components/customiseItemModal/index.js +2 -2
- package/es/components/booking/components/emptyBooking/index.d.ts +0 -1
- package/es/components/booking/components/footer/FooterMenus/index.d.ts +0 -1
- package/es/components/booking/components/footer/index.js +48 -42
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/es/components/booking/components/reloadResourceModal/index.d.ts +0 -1
- package/es/components/booking/forms/footer.d.ts +0 -1
- package/es/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/es/components/booking/forms/single/index.d.ts +0 -1
- package/es/components/booking/forms/table/index.d.ts +0 -1
- package/es/components/booking/hooks/useClearCart.d.ts +0 -1
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/es/components/booking/info/date/index.d.ts +0 -1
- package/es/components/booking/info/dateRange/index.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/es/components/booking/info/notes/index.d.ts +0 -1
- package/es/components/booking/info/service/actions/index.d.ts +0 -1
- package/es/components/booking/info/service/like/index.d.ts +0 -1
- package/es/components/booking/info/service/serviceItem/index.d.ts +0 -1
- package/es/components/booking/info2/cartClientCard/index.js +1 -2
- package/es/components/booking/info2/service/actions/index.d.ts +0 -1
- package/es/components/booking/info2/service/serviceItem/index.d.ts +0 -1
- package/es/components/booking/materiels/contacts/index.d.ts +0 -1
- package/es/components/booking/materiels/duration/index.d.ts +0 -1
- package/es/components/booking/materiels/holder/index.d.ts +0 -1
- package/es/components/booking/materiels/startTime/index.d.ts +0 -1
- package/es/components/booking/notes/NoteBlock/NoteItem/index.d.ts +0 -1
- package/es/components/booking/notes/NoteBlock/index.d.ts +0 -1
- package/es/components/booking/notes/addNote/index.d.ts +0 -1
- package/es/components/checkout/PaymentModal.js +723 -434
- package/es/components/checkout/components/AdditionalModule/index.d.ts +1 -1
- package/es/components/checkout/components/AdditionalModule/index.js +80 -49
- package/es/components/checkout/components/AdditionalModule/index.less +33 -34
- package/es/components/checkout/components/AdditionalModule/locales.d.ts +3 -0
- package/es/components/checkout/components/AdditionalModule/locales.js +7 -4
- package/es/components/checkout/components/AmountSummary/index.d.ts +2 -1
- package/es/components/checkout/components/AmountSummary/index.js +69 -31
- package/es/components/checkout/components/AmountSummary/index.less +27 -9
- package/es/components/checkout/components/CashPaymentModule/index.less +0 -2
- package/es/components/checkout/components/PaymentDetailModal/index.js +55 -10
- package/es/components/checkout/components/PaymentOptionsModule/index.d.ts +2 -1
- package/es/components/checkout/components/PaymentOptionsModule/index.js +40 -25
- package/es/components/checkout/components/PaymentOptionsModule/index.less +11 -6
- package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts +42 -9
- package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +512 -82
- package/es/components/checkout/components/PaymentResultToast/index.d.ts +2 -1
- package/es/components/checkout/components/PaymentResultToast/index.js +90 -35
- package/es/components/checkout/components/PaymentResultToast/index.less +445 -77
- package/es/components/checkout/components/PaymentResultToast/types.d.ts +3 -3
- package/es/components/checkout/components/PaymentResultToast/utils.d.ts +26 -0
- package/es/components/checkout/components/PaymentResultToast/utils.js +81 -2
- package/es/components/checkout/components/SearchAndClientModule/index.js +17 -16
- package/es/components/checkout/components/SearchAndClientModule/index.less +29 -8
- package/es/components/checkout/components/WalletPassModule/components/WalletPassHeader/index.js +3 -1
- package/es/components/checkout/components/WalletPassModule/index.less +3 -3
- package/es/components/checkout/hooks/useWalletPass.js +1 -1
- package/es/components/checkout/index.d.ts +1 -1
- package/es/components/checkout/index.js +1 -1
- package/es/components/checkout/index.less +56 -38
- package/es/components/checkout/locales.d.ts +6 -0
- package/es/components/checkout/locales.js +9 -3
- package/es/components/checkout/payment-modal-utils.js +5 -5
- package/es/components/checkout/utils/PaymentResultToastUtils.d.ts +3 -3
- package/es/components/checkout/utils/PaymentResultToastUtils.js +111 -72
- package/es/components/eftpos/deviceList/index.d.ts +0 -1
- package/es/components/eftpos/form/index.d.ts +0 -1
- package/es/components/eftpos/group/index.d.ts +0 -1
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftpos/icon/apiKey.d.ts +0 -1
- package/es/components/eftpos/icon/device.d.ts +0 -1
- package/es/components/eftpos/index.d.ts +0 -1
- package/es/components/eftpos/pos.d.ts +0 -1
- package/es/components/eftpos/receipt/index.d.ts +0 -1
- package/es/components/eftposPay/amount.d.ts +0 -1
- package/es/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/es/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/es/components/eftposPay/component/fail/index.d.ts +0 -1
- package/es/components/eftposPay/component/fail/network.d.ts +0 -1
- package/es/components/eftposPay/component/fail/unknow.d.ts +0 -1
- package/es/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/es/components/eftposPay/component/manual/index.d.ts +0 -1
- package/es/components/eftposPay/component/signature/index.d.ts +0 -1
- package/es/components/eftposPay/component/step/index.d.ts +0 -1
- package/es/components/eftposPay/component/step/step.d.ts +0 -1
- package/es/components/eftposPay/pay.d.ts +0 -1
- package/es/components/eftposPay/payo/config.d.ts +0 -1
- package/es/components/eftposPay/tip.d.ts +0 -1
- package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/es/components/eftposPay/windcave/receiptAction.d.ts +0 -1
- package/es/components/eftposPay/windcave/windcave.d.ts +0 -1
- 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/Cart/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Event/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Information/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Resource/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
- package/es/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
- package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +0 -1
- package/es/components/login/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- 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/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
- package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/es/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
- package/es/components/productSelect/components/TabProduct/index.d.ts +0 -1
- package/es/components/ruleSetting/ruleBorder/index.d.ts +0 -1
- package/es/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/es/components/schedules/calendar/index.d.ts +0 -1
- package/es/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/es/components/schedules/components/ScheduleDetailList/index.d.ts +0 -1
- package/es/components/schedules/components/ScheduleList/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +0 -1
- 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/schedules/products/ProductDetailDrawer/index.d.ts +0 -1
- package/es/components/schedules/products/index.d.ts +0 -1
- package/es/components/schedules/products/list/ProductItem/index.d.ts +0 -1
- package/es/components/schedules/products/list/index.d.ts +0 -1
- package/es/components/schedules/resources/index.d.ts +0 -1
- package/es/components/schedules/resources/list/index.d.ts +0 -1
- package/es/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/es/components/schedules/schedules/AllSchedules/index.d.ts +0 -1
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +0 -1
- package/es/components/schedules/schedules/index.d.ts +0 -1
- package/es/components/schedules/utils.d.ts +1 -1
- package/es/components/shoppingCart/components/Cart/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/hooks/useAddService.d.ts +0 -1
- package/es/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
- package/es/components/shoppingCart/index.d.ts +0 -1
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +4 -3
- package/es/components/ticketBooking/components/bookingDataPanel/index.js +1 -1
- package/es/components/ticketBooking/components/ticketBooking/index.js +2 -2
- package/es/components/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/es/components/ticketBooking/hooks/pisellos/useScanCustomer.js +1 -1
- package/es/components/ticketBooking/hooks/pisellos/useScanGlobal.js +1 -1
- package/es/components/ticketBooking/hooks/pisellos/useScanGlobalHandle.js +1 -1
- package/es/components/wallet/hooks/useWalletCard.d.ts +0 -1
- package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/es/plus/clientCard/index.js +3 -2
- package/es/plus/clientCard/index.less +3 -32
- package/es/plus/clientName/index.d.ts +0 -1
- package/es/plus/clinetSearch/Add/BirthdayField/index.d.ts +0 -1
- package/es/plus/clinetSearch/Add/GenderField/index.d.ts +0 -1
- package/es/plus/saasCreateOrganization/components/Header.d.ts +0 -1
- package/es/plus/saasRegister/components/EntryEmail.d.ts +0 -1
- package/es/plus/saasRegister/components/EntryInfo.d.ts +0 -1
- package/es/plus/saasRegister/components/GoLogin.d.ts +0 -1
- package/es/plus/saasRegister/components/Header.d.ts +0 -1
- package/es/plus/saasRegister/components/VerifyError.d.ts +0 -1
- package/es/plus/saasRegister/components/VerifyingLink.d.ts +0 -1
- package/es/plus/saasRegister/components/VertifyEmail.d.ts +0 -1
- package/es/pro/comprehensiveSearch/components/searchSection/index.js +9 -12
- package/es/pro/comprehensiveSearch/components/searchSection/index.less +22 -19
- package/es/pro/pisellPhoneKeyboard/index.d.ts +0 -1
- package/es/utils/index.d.ts +1 -1
- package/lib/components/appointmentBooking/components/Cart/Item/Total.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Cart/Item/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Cart/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Deposit/index.d.ts +0 -1
- 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/deposit/components/PolicyModal/index.d.ts +0 -1
- package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
- package/lib/components/booking/components/TabProduct/productItem/index.d.ts +0 -1
- package/lib/components/booking/components/TabProduct/selectProductItem/index.d.ts +0 -1
- package/lib/components/booking/components/actionButtons/index.js +2 -1
- package/lib/components/booking/components/collapsibleList/utils.d.ts +0 -1
- package/lib/components/booking/components/customiseItemModal/index.js +2 -2
- package/lib/components/booking/components/emptyBooking/index.d.ts +0 -1
- package/lib/components/booking/components/footer/FooterMenus/index.d.ts +0 -1
- package/lib/components/booking/components/footer/index.js +3 -0
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/lib/components/booking/components/reloadResourceModal/index.d.ts +0 -1
- package/lib/components/booking/forms/footer.d.ts +0 -1
- package/lib/components/booking/forms/sendModal/useSendModal.d.ts +0 -1
- package/lib/components/booking/forms/single/index.d.ts +0 -1
- package/lib/components/booking/forms/table/index.d.ts +0 -1
- package/lib/components/booking/hooks/useClearCart.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/lib/components/booking/info/date/index.d.ts +0 -1
- package/lib/components/booking/info/dateRange/index.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/lib/components/booking/info/notes/index.d.ts +0 -1
- package/lib/components/booking/info/service/actions/index.d.ts +0 -1
- package/lib/components/booking/info/service/like/index.d.ts +0 -1
- package/lib/components/booking/info/service/serviceItem/index.d.ts +0 -1
- package/lib/components/booking/info2/cartClientCard/index.js +1 -2
- package/lib/components/booking/info2/service/actions/index.d.ts +0 -1
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +0 -1
- package/lib/components/booking/materiels/contacts/index.d.ts +0 -1
- package/lib/components/booking/materiels/duration/index.d.ts +0 -1
- package/lib/components/booking/materiels/holder/index.d.ts +0 -1
- package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
- package/lib/components/booking/notes/NoteBlock/NoteItem/index.d.ts +0 -1
- package/lib/components/booking/notes/NoteBlock/index.d.ts +0 -1
- package/lib/components/booking/notes/addNote/index.d.ts +0 -1
- package/lib/components/checkout/PaymentModal.js +225 -93
- package/lib/components/checkout/components/AdditionalModule/index.d.ts +1 -1
- package/lib/components/checkout/components/AdditionalModule/index.js +98 -34
- package/lib/components/checkout/components/AdditionalModule/index.less +33 -34
- package/lib/components/checkout/components/AdditionalModule/locales.d.ts +3 -0
- package/lib/components/checkout/components/AdditionalModule/locales.js +7 -4
- package/lib/components/checkout/components/AmountSummary/index.d.ts +2 -1
- package/lib/components/checkout/components/AmountSummary/index.js +103 -47
- package/lib/components/checkout/components/AmountSummary/index.less +27 -9
- package/lib/components/checkout/components/CashPaymentModule/index.less +0 -2
- package/lib/components/checkout/components/PaymentDetailModal/index.js +56 -11
- package/lib/components/checkout/components/PaymentOptionsModule/index.d.ts +2 -1
- package/lib/components/checkout/components/PaymentOptionsModule/index.js +11 -8
- package/lib/components/checkout/components/PaymentOptionsModule/index.less +11 -6
- package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts +42 -9
- package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +279 -73
- package/lib/components/checkout/components/PaymentResultToast/index.d.ts +2 -1
- package/lib/components/checkout/components/PaymentResultToast/index.js +69 -22
- package/lib/components/checkout/components/PaymentResultToast/index.less +445 -77
- package/lib/components/checkout/components/PaymentResultToast/types.d.ts +3 -3
- package/lib/components/checkout/components/PaymentResultToast/utils.d.ts +26 -0
- package/lib/components/checkout/components/PaymentResultToast/utils.js +58 -4
- package/lib/components/checkout/components/SearchAndClientModule/index.js +17 -15
- package/lib/components/checkout/components/SearchAndClientModule/index.less +29 -8
- package/lib/components/checkout/components/WalletPassModule/components/WalletPassHeader/index.js +12 -2
- package/lib/components/checkout/components/WalletPassModule/index.less +3 -3
- package/lib/components/checkout/hooks/useWalletPass.js +2 -2
- package/lib/components/checkout/index.d.ts +1 -1
- package/lib/components/checkout/index.js +2 -0
- package/lib/components/checkout/index.less +56 -38
- package/lib/components/checkout/locales.d.ts +6 -0
- package/lib/components/checkout/locales.js +9 -3
- package/lib/components/checkout/payment-modal-utils.js +5 -5
- package/lib/components/checkout/utils/PaymentResultToastUtils.d.ts +3 -3
- package/lib/components/checkout/utils/PaymentResultToastUtils.js +26 -18
- package/lib/components/eftpos/deviceList/index.d.ts +0 -1
- package/lib/components/eftpos/form/index.d.ts +0 -1
- package/lib/components/eftpos/group/index.d.ts +0 -1
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftpos/icon/apiKey.d.ts +0 -1
- package/lib/components/eftpos/icon/device.d.ts +0 -1
- package/lib/components/eftpos/index.d.ts +0 -1
- package/lib/components/eftpos/pos.d.ts +0 -1
- package/lib/components/eftpos/receipt/index.d.ts +0 -1
- package/lib/components/eftposPay/amount.d.ts +0 -1
- package/lib/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/failCustom.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/index.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/network.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/unknow.d.ts +0 -1
- package/lib/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/lib/components/eftposPay/component/manual/index.d.ts +0 -1
- package/lib/components/eftposPay/component/signature/index.d.ts +0 -1
- package/lib/components/eftposPay/component/step/index.d.ts +0 -1
- package/lib/components/eftposPay/component/step/step.d.ts +0 -1
- package/lib/components/eftposPay/pay.d.ts +0 -1
- package/lib/components/eftposPay/payo/config.d.ts +0 -1
- package/lib/components/eftposPay/tip.d.ts +0 -1
- package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/lib/components/eftposPay/windcave/receiptAction.d.ts +0 -1
- package/lib/components/eftposPay/windcave/windcave.d.ts +0 -1
- 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/Cart/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Content/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/EmptyHolderModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Event/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Footer/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Header/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Information/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/OrderProductModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/RemoveOptionConfirmModal.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Resource/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/SelectHolderModal.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/BookingOptions.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/Resource.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingDetailModal/components/Schedule.d.ts +0 -1
- package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/scheduleCalendar/components/ScheduleTimeItem/index.d.ts +0 -1
- package/lib/components/login/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- 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/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/List/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Forms/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectProducts/ProductItem/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectProducts/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectResourcesTable/index.d.ts +0 -1
- package/lib/components/productSelect/components/TabProduct/index.d.ts +0 -1
- package/lib/components/ruleSetting/ruleBorder/index.d.ts +0 -1
- package/lib/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/lib/components/schedules/calendar/index.d.ts +0 -1
- package/lib/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/lib/components/schedules/components/ScheduleDetailList/index.d.ts +0 -1
- package/lib/components/schedules/components/ScheduleList/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/ResourcesModule/index.d.ts +0 -1
- 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/schedules/products/ProductDetailDrawer/index.d.ts +0 -1
- package/lib/components/schedules/products/index.d.ts +0 -1
- package/lib/components/schedules/products/list/ProductItem/index.d.ts +0 -1
- package/lib/components/schedules/products/list/index.d.ts +0 -1
- package/lib/components/schedules/resources/index.d.ts +0 -1
- package/lib/components/schedules/resources/list/index.d.ts +0 -1
- package/lib/components/schedules/resources/relationProduct/index.d.ts +0 -1
- package/lib/components/schedules/schedules/AllSchedules/index.d.ts +0 -1
- package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +0 -1
- package/lib/components/schedules/schedules/index.d.ts +0 -1
- package/lib/components/schedules/utils.d.ts +1 -1
- package/lib/components/shoppingCart/components/Cart/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/hooks/useAddService.d.ts +0 -1
- package/lib/components/shoppingCart/hooks/useClearCart.d.ts +0 -1
- package/lib/components/shoppingCart/index.d.ts +0 -1
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +7 -6
- package/lib/components/ticketBooking/components/bookingDataPanel/index.js +2 -2
- package/lib/components/ticketBooking/components/ticketBooking/index.js +1 -1
- package/lib/components/ticketBooking/components/timeBar/index.d.ts +0 -1
- package/lib/components/ticketBooking/hooks/pisellos/useScanCustomer.js +2 -12
- package/lib/components/ticketBooking/hooks/pisellos/useScanGlobal.js +2 -12
- package/lib/components/ticketBooking/hooks/pisellos/useScanGlobalHandle.js +2 -12
- package/lib/components/wallet/hooks/useWalletCard.d.ts +0 -1
- package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/lib/plus/clientCard/index.js +5 -4
- package/lib/plus/clientCard/index.less +3 -32
- package/lib/plus/clientName/index.d.ts +0 -1
- package/lib/plus/clinetSearch/Add/BirthdayField/index.d.ts +0 -1
- package/lib/plus/clinetSearch/Add/GenderField/index.d.ts +0 -1
- package/lib/plus/saasCreateOrganization/components/Header.d.ts +0 -1
- package/lib/plus/saasRegister/components/EntryEmail.d.ts +0 -1
- package/lib/plus/saasRegister/components/EntryInfo.d.ts +0 -1
- package/lib/plus/saasRegister/components/GoLogin.d.ts +0 -1
- package/lib/plus/saasRegister/components/Header.d.ts +0 -1
- package/lib/plus/saasRegister/components/VerifyError.d.ts +0 -1
- package/lib/plus/saasRegister/components/VerifyingLink.d.ts +0 -1
- package/lib/plus/saasRegister/components/VertifyEmail.d.ts +0 -1
- package/lib/pro/comprehensiveSearch/components/searchSection/index.js +6 -18
- package/lib/pro/comprehensiveSearch/components/searchSection/index.less +22 -19
- package/lib/pro/pisellPhoneKeyboard/index.d.ts +0 -1
- package/lib/utils/index.d.ts +1 -1
- package/package.json +12 -12
@@ -20,9 +20,9 @@ import { locales, webPrint } from '@pisell/utils';
|
|
20
20
|
import { getLocale } from "../../utils/locales";
|
21
21
|
import { useMemoizedFn } from 'ahooks';
|
22
22
|
import { createPortal } from 'react-dom';
|
23
|
+
import ReactDOM from 'react-dom';
|
23
24
|
import checkoutLocales from "./locales";
|
24
|
-
import { PisellContainer } from '@pisell/materials';
|
25
|
-
import { PisellAdjustPrice } from '@pisell/materials';
|
25
|
+
import { PisellContainer, PisellAdjustPrice, Icon, useToast, ConfigProvider } from '@pisell/materials';
|
26
26
|
import useEngineContext from "../../hooks/useEngineContext";
|
27
27
|
import NoteModal from "../../plus/noteModal";
|
28
28
|
import SendPaymentLinkModal from "./components/SendPaymentLinkModal";
|
@@ -33,14 +33,12 @@ import PaymentOptionsModule from "./components/PaymentOptionsModule";
|
|
33
33
|
import CashPaymentModule from "./components/CashPaymentModule";
|
34
34
|
import AdditionalModule from "./components/AdditionalModule";
|
35
35
|
import { getSumTotal } from "../booking/components/footer/amount";
|
36
|
-
import {
|
36
|
+
import { closePaymentResultToast, closeAllPaymentResultToasts, setTillButton } from "./components/PaymentResultToast";
|
37
37
|
import { formatCurrency, calculateStatusClassName, calculateAutoCloseConfig, displayPaymentResultToast, createShowSuccessToast } from "./utils/PaymentResultToastUtils";
|
38
38
|
import { Printer, FileCheck02, RefreshCw05, CreditCard02, MessageTextSquare02, ArrowLeft, DotsVertical } from '@pisell/icon';
|
39
39
|
import { checkoutStyles } from "./styles";
|
40
40
|
import PaymentMethods from "../pay/toB/paymentMethods";
|
41
|
-
import { DeviceIconGroup } from "../../pro/comprehensiveSearch/components";
|
42
41
|
import SearchAndClientModule from "./components/SearchAndClientModule";
|
43
|
-
import useToast from "../../hooks/useToast";
|
44
42
|
import "./index.less";
|
45
43
|
import { WALLET_PASS_CODE_ARRAY, WALLET_PASS_CODE_MAP } from "./constants";
|
46
44
|
import { cloneDeep } from 'lodash';
|
@@ -505,51 +503,67 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
505
503
|
// Toast?.fail(locales.getText('pisell2.checkout.order-sync-failed') || 'Order sync failed');
|
506
504
|
// }
|
507
505
|
// );
|
508
|
-
var orderPaymentAddedUnsubscribe = core.effects.on(CheckoutHooks.OnOrderPaymentAdded, function (
|
509
|
-
|
510
|
-
|
511
|
-
|
512
|
-
|
513
|
-
|
514
|
-
|
515
|
-
|
516
|
-
|
517
|
-
|
518
|
-
|
519
|
-
|
520
|
-
|
521
|
-
|
522
|
-
|
523
|
-
|
524
|
-
|
525
|
-
|
526
|
-
|
527
|
-
|
528
|
-
|
529
|
-
|
530
|
-
|
531
|
-
|
532
|
-
|
533
|
-
|
534
|
-
|
535
|
-
|
536
|
-
|
537
|
-
|
538
|
-
|
539
|
-
|
540
|
-
|
541
|
-
|
542
|
-
|
543
|
-
|
544
|
-
|
545
|
-
|
546
|
-
|
547
|
-
|
548
|
-
|
506
|
+
var orderPaymentAddedUnsubscribe = core.effects.on(CheckoutHooks.OnOrderPaymentAdded, /*#__PURE__*/function () {
|
507
|
+
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(data) {
|
508
|
+
var balanceDueAmount, autoCloseConfig, _orderInfo, paymentMethodName, isCashPayment, _interaction$utils, _interaction$utils$po;
|
509
|
+
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
510
|
+
while (1) switch (_context5.prev = _context5.next) {
|
511
|
+
case 0:
|
512
|
+
console.log('orderPaymentAddedUnsubscribe>>>>', data);
|
513
|
+
balanceDueAmount = checkoutModule.getBalanceDueAmount();
|
514
|
+
if (!(Number(balanceDueAmount) > 0)) {
|
515
|
+
_context5.next = 7;
|
516
|
+
break;
|
517
|
+
}
|
518
|
+
autoCloseConfig = calculateAutoCloseConfig('partially_paid', false); // 获取订单总金额
|
519
|
+
_orderInfo = checkoutModule.getCurrentOrderInfo(); // 根据支付状态展示不同的 toast
|
520
|
+
_context5.next = 7;
|
521
|
+
return displayPaymentResultToast({
|
522
|
+
paymentStatus: 'partially_paid',
|
523
|
+
orderTotalAmount: _orderInfo.totalAmount,
|
524
|
+
gapAmount: balanceDueAmount,
|
525
|
+
failureReason: '',
|
526
|
+
autoCloseConfig: autoCloseConfig,
|
527
|
+
actionButtons: generateActionButtons === null || generateActionButtons === void 0 ? void 0 : generateActionButtons('partially_paid')
|
528
|
+
}, _objectSpread(_objectSpread({}, paymentResultToastConfig), {}, {
|
529
|
+
onToastClose: function onToastClose() {
|
530
|
+
closePaymentResultToast();
|
531
|
+
},
|
532
|
+
onCountdownComplete: function onCountdownComplete() {
|
533
|
+
closePaymentResultToast();
|
534
|
+
// PaymentResultToast自己管理关闭,不需要额外调用
|
535
|
+
// 不自动关闭Modal,让两个弹窗独立管理
|
536
|
+
}
|
537
|
+
}));
|
538
|
+
case 7:
|
539
|
+
// 判断是否为现金支付
|
540
|
+
paymentMethodName = data.paymentMethodName || data.name || '';
|
541
|
+
isCashPayment = data.paymentMethodCode === 'CASHMANUAL' || /现金|現金/i.test(paymentMethodName) || /cash/i.test(paymentMethodName);
|
542
|
+
if (isCashPayment) {
|
543
|
+
logger === null || logger === void 0 || logger.addLog({
|
544
|
+
type: 'info',
|
545
|
+
title: 'open_till',
|
546
|
+
metadata: {}
|
547
|
+
});
|
548
|
+
// handleToastClose();
|
549
|
+
interaction === null || interaction === void 0 || (_interaction$utils = interaction.utils) === null || _interaction$utils === void 0 || (_interaction$utils$po = _interaction$utils.postMessageToApp) === null || _interaction$utils$po === void 0 || _interaction$utils$po.call(_interaction$utils, {
|
550
|
+
module: 'till',
|
551
|
+
key: 'open_till',
|
552
|
+
data: {
|
553
|
+
type: 'cash' // cash 不需要验证钱箱权限
|
554
|
+
}
|
555
|
+
});
|
556
|
+
}
|
557
|
+
case 10:
|
558
|
+
case "end":
|
559
|
+
return _context5.stop();
|
549
560
|
}
|
550
|
-
});
|
551
|
-
}
|
552
|
-
|
561
|
+
}, _callee5);
|
562
|
+
}));
|
563
|
+
return function (_x5) {
|
564
|
+
return _ref8.apply(this, arguments);
|
565
|
+
};
|
566
|
+
}());
|
553
567
|
return function () {
|
554
568
|
if (unsubscribe && typeof unsubscribe === 'function') {
|
555
569
|
unsubscribe();
|
@@ -576,98 +590,100 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
576
590
|
|
577
591
|
// 处理金额修改
|
578
592
|
var handleAmountChange = useCallback( /*#__PURE__*/function () {
|
579
|
-
var
|
580
|
-
return _regeneratorRuntime().wrap(function
|
581
|
-
while (1) switch (
|
593
|
+
var _ref9 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee6(newAmount) {
|
594
|
+
return _regeneratorRuntime().wrap(function _callee6$(_context6) {
|
595
|
+
while (1) switch (_context6.prev = _context6.next) {
|
582
596
|
case 0:
|
583
597
|
if (!checkoutModule) {
|
584
|
-
|
598
|
+
_context6.next = 10;
|
585
599
|
break;
|
586
600
|
}
|
587
|
-
|
588
|
-
|
601
|
+
_context6.prev = 1;
|
602
|
+
_context6.next = 4;
|
589
603
|
return checkoutModule.setStateAmountAsync(newAmount);
|
590
604
|
case 4:
|
591
605
|
setCustomAmount(newAmount);
|
592
|
-
|
606
|
+
_context6.next = 10;
|
593
607
|
break;
|
594
608
|
case 7:
|
595
|
-
|
596
|
-
|
597
|
-
console.error('Failed to set custom amount:',
|
609
|
+
_context6.prev = 7;
|
610
|
+
_context6.t0 = _context6["catch"](1);
|
611
|
+
console.error('Failed to set custom amount:', _context6.t0);
|
598
612
|
case 10:
|
599
613
|
case "end":
|
600
|
-
return
|
614
|
+
return _context6.stop();
|
601
615
|
}
|
602
|
-
},
|
616
|
+
}, _callee6, null, [[1, 7]]);
|
603
617
|
}));
|
604
|
-
return function (
|
605
|
-
return
|
618
|
+
return function (_x6) {
|
619
|
+
return _ref9.apply(this, arguments);
|
606
620
|
};
|
607
621
|
}(), [checkoutModule]);
|
608
622
|
|
609
623
|
// 处理押金状态变更
|
610
624
|
var handleDepositStatusChange = useCallback( /*#__PURE__*/function () {
|
611
|
-
var
|
625
|
+
var _ref10 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee7(isDeposit) {
|
612
626
|
var depositStatus;
|
613
|
-
return _regeneratorRuntime().wrap(function
|
614
|
-
while (1) switch (
|
627
|
+
return _regeneratorRuntime().wrap(function _callee7$(_context7) {
|
628
|
+
while (1) switch (_context7.prev = _context7.next) {
|
615
629
|
case 0:
|
616
630
|
if (!checkoutModule) {
|
617
|
-
|
631
|
+
_context7.next = 11;
|
618
632
|
break;
|
619
633
|
}
|
620
|
-
|
634
|
+
_context7.prev = 1;
|
621
635
|
depositStatus = isDeposit ? 1 : 0;
|
622
|
-
|
636
|
+
_context7.next = 5;
|
623
637
|
return checkoutModule.updateOrderDepositStatusAsync(depositStatus);
|
624
638
|
case 5:
|
625
639
|
console.log("Deposit status updated to: ".concat(depositStatus, " (").concat(isDeposit ? 'deposit' : 'regular', ")"));
|
626
|
-
|
640
|
+
_context7.next = 11;
|
627
641
|
break;
|
628
642
|
case 8:
|
629
|
-
|
630
|
-
|
631
|
-
console.error('Failed to update deposit status:',
|
643
|
+
_context7.prev = 8;
|
644
|
+
_context7.t0 = _context7["catch"](1);
|
645
|
+
console.error('Failed to update deposit status:', _context7.t0);
|
632
646
|
case 11:
|
633
647
|
case "end":
|
634
|
-
return
|
648
|
+
return _context7.stop();
|
635
649
|
}
|
636
|
-
},
|
650
|
+
}, _callee7, null, [[1, 8]]);
|
637
651
|
}));
|
638
|
-
return function (
|
639
|
-
return
|
652
|
+
return function (_x7) {
|
653
|
+
return _ref10.apply(this, arguments);
|
640
654
|
};
|
641
655
|
}(), [checkoutModule]);
|
642
656
|
|
643
657
|
// 当 walletpass 直接就满足订单支付时,触发此方法
|
644
658
|
var handleWalletPassConfirmPay = /*#__PURE__*/function () {
|
645
|
-
var
|
659
|
+
var _ref11 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee8(action) {
|
646
660
|
var result, _result$response, responseData, _responseData$payment, params;
|
647
|
-
return _regeneratorRuntime().wrap(function
|
648
|
-
while (1) switch (
|
661
|
+
return _regeneratorRuntime().wrap(function _callee8$(_context8) {
|
662
|
+
while (1) switch (_context8.prev = _context8.next) {
|
649
663
|
case 0:
|
650
664
|
if (!(action === 'save-without-deduct')) {
|
651
|
-
|
665
|
+
_context8.next = 5;
|
652
666
|
break;
|
653
667
|
}
|
654
|
-
|
668
|
+
_context8.next = 3;
|
655
669
|
return checkoutModule.updateVoucherPaymentItemsAsync([]);
|
656
670
|
case 3:
|
657
|
-
|
671
|
+
_context8.next = 7;
|
658
672
|
break;
|
659
673
|
case 5:
|
660
674
|
if (!(action === 'cancel')) {
|
661
|
-
|
675
|
+
_context8.next = 7;
|
662
676
|
break;
|
663
677
|
}
|
664
|
-
return
|
678
|
+
return _context8.abrupt("return");
|
665
679
|
case 7:
|
666
|
-
|
680
|
+
_context8.next = 9;
|
667
681
|
return checkoutModule.manualSyncOrderAsync();
|
668
682
|
case 9:
|
669
|
-
result =
|
670
|
-
|
683
|
+
result = _context8.sent;
|
684
|
+
_context8.next = 12;
|
685
|
+
return showSuccessToast === null || showSuccessToast === void 0 ? void 0 : showSuccessToast(result);
|
686
|
+
case 12:
|
671
687
|
if (result.success) {
|
672
688
|
responseData = (_result$response = result.response) === null || _result$response === void 0 ? void 0 : _result$response.data; // 打印订单完整信息
|
673
689
|
console.log('print_order_onOrderSynced>>>>', result);
|
@@ -688,74 +704,75 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
688
704
|
} catch (error) {
|
689
705
|
console.error('print_order_onOrderSynced_error>>>>', error);
|
690
706
|
}
|
707
|
+
// 支付成功时关闭 PaymentModal
|
708
|
+
onPaymentCancel(true);
|
691
709
|
}
|
692
|
-
|
693
|
-
case 12:
|
710
|
+
case 13:
|
694
711
|
case "end":
|
695
|
-
return
|
712
|
+
return _context8.stop();
|
696
713
|
}
|
697
|
-
},
|
714
|
+
}, _callee8);
|
698
715
|
}));
|
699
|
-
return function handleWalletPassConfirmPay(
|
700
|
-
return
|
716
|
+
return function handleWalletPassConfirmPay(_x8) {
|
717
|
+
return _ref11.apply(this, arguments);
|
701
718
|
};
|
702
719
|
}();
|
703
720
|
|
704
721
|
// 处理 Save & Pay Later 的钱包余额确认
|
705
722
|
var handleSavePayLater = useCallback( /*#__PURE__*/function () {
|
706
|
-
var
|
723
|
+
var _ref12 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee9(action) {
|
707
724
|
var res;
|
708
|
-
return _regeneratorRuntime().wrap(function
|
709
|
-
while (1) switch (
|
725
|
+
return _regeneratorRuntime().wrap(function _callee9$(_context9) {
|
726
|
+
while (1) switch (_context9.prev = _context9.next) {
|
710
727
|
case 0:
|
711
728
|
if (!(action === 'apply-deduct-now')) {
|
712
|
-
|
729
|
+
_context9.next = 4;
|
713
730
|
break;
|
714
731
|
}
|
715
732
|
console.log('立即应用并扣除钱包余额,然后保存稍后付款');
|
716
733
|
// 执行扣除逻辑
|
717
|
-
|
734
|
+
_context9.next = 13;
|
718
735
|
break;
|
719
736
|
case 4:
|
720
737
|
if (!(action === 'save-without-deduct')) {
|
721
|
-
|
738
|
+
_context9.next = 10;
|
722
739
|
break;
|
723
740
|
}
|
724
741
|
console.log('保存但不扣除钱包余额,稍后付款');
|
725
742
|
// 保存但不扣除,先把 os 里 voucher_id 的 payment 删除
|
726
|
-
|
743
|
+
_context9.next = 8;
|
727
744
|
return checkoutModule.updateVoucherPaymentItemsAsync([]);
|
728
745
|
case 8:
|
729
|
-
|
746
|
+
_context9.next = 13;
|
730
747
|
break;
|
731
748
|
case 10:
|
732
749
|
if (!(action === 'cancel')) {
|
733
|
-
|
750
|
+
_context9.next = 13;
|
734
751
|
break;
|
735
752
|
}
|
736
753
|
console.log('取消保存稍后付款');
|
737
|
-
return
|
754
|
+
return _context9.abrupt("return");
|
738
755
|
case 13:
|
739
756
|
if (!checkoutModule) {
|
740
|
-
|
757
|
+
_context9.next = 18;
|
741
758
|
break;
|
742
759
|
}
|
743
|
-
|
760
|
+
_context9.next = 16;
|
744
761
|
return checkoutModule.saveForLaterPaymentAsync();
|
745
762
|
case 16:
|
746
|
-
res =
|
763
|
+
res = _context9.sent;
|
747
764
|
if (res.success) {
|
748
765
|
onPaymentCancel(true);
|
749
|
-
|
766
|
+
// 不关闭PaymentResultToast,让Save & Pay Later操作后toast保持显示
|
750
767
|
}
|
751
768
|
case 18:
|
752
769
|
case "end":
|
753
|
-
return
|
770
|
+
return _context9.stop();
|
754
771
|
}
|
755
|
-
},
|
772
|
+
}, _callee9);
|
756
773
|
}));
|
757
|
-
return function (
|
758
|
-
return
|
774
|
+
return function (_x9) {
|
775
|
+
return _ref12.apply(this, arguments);
|
759
776
|
};
|
760
777
|
}(), [checkoutModule, onPaymentCancel]);
|
761
778
|
var moduleConfig = {
|
@@ -823,13 +840,13 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
823
840
|
}
|
824
841
|
}, [state, showPriceAdjustModal]);
|
825
842
|
var handleSelectWalletChange = useMemoizedFn( /*#__PURE__*/function () {
|
826
|
-
var
|
843
|
+
var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(select) {
|
827
844
|
var voucherItems, data;
|
828
|
-
return _regeneratorRuntime().wrap(function
|
829
|
-
while (1) switch (
|
845
|
+
return _regeneratorRuntime().wrap(function _callee10$(_context10) {
|
846
|
+
while (1) switch (_context10.prev = _context10.next) {
|
830
847
|
case 0:
|
831
848
|
if (!walletPassDetail.isShow) {
|
832
|
-
|
849
|
+
_context10.next = 7;
|
833
850
|
break;
|
834
851
|
}
|
835
852
|
voucherItems = [];
|
@@ -858,7 +875,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
858
875
|
title: 'handleSelectWalletChange checkoutModule updateVoucherPaymentItemsAsync',
|
859
876
|
metadata: {}
|
860
877
|
});
|
861
|
-
|
878
|
+
_context10.next = 6;
|
862
879
|
return checkoutModule.updateVoucherPaymentItemsAsync(voucherItems);
|
863
880
|
case 6:
|
864
881
|
// 更新钱包卡券数据
|
@@ -868,21 +885,21 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
868
885
|
}
|
869
886
|
case 7:
|
870
887
|
case "end":
|
871
|
-
return
|
888
|
+
return _context10.stop();
|
872
889
|
}
|
873
|
-
},
|
890
|
+
}, _callee10);
|
874
891
|
}));
|
875
|
-
return function (
|
876
|
-
return
|
892
|
+
return function (_x10) {
|
893
|
+
return _ref13.apply(this, arguments);
|
877
894
|
};
|
878
895
|
}());
|
879
896
|
|
880
897
|
// 手动折扣相关处理函数
|
881
898
|
var handlePriceAdjustConfirm = /*#__PURE__*/function () {
|
882
|
-
var
|
899
|
+
var _ref14 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee11(newPrice) {
|
883
900
|
var ScheduleModule, _getSumTotal2, productAmount, discountAmount;
|
884
|
-
return _regeneratorRuntime().wrap(function
|
885
|
-
while (1) switch (
|
901
|
+
return _regeneratorRuntime().wrap(function _callee11$(_context11) {
|
902
|
+
while (1) switch (_context11.prev = _context11.next) {
|
886
903
|
case 0:
|
887
904
|
try {
|
888
905
|
if (checkoutModule && orderInfo !== null && orderInfo !== void 0 && orderInfo.totalAmount) {
|
@@ -913,51 +930,51 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
913
930
|
setShowPriceAdjustModal(false);
|
914
931
|
case 2:
|
915
932
|
case "end":
|
916
|
-
return
|
933
|
+
return _context11.stop();
|
917
934
|
}
|
918
|
-
},
|
935
|
+
}, _callee11);
|
919
936
|
}));
|
920
|
-
return function handlePriceAdjustConfirm(
|
921
|
-
return
|
937
|
+
return function handlePriceAdjustConfirm(_x11) {
|
938
|
+
return _ref14.apply(this, arguments);
|
922
939
|
};
|
923
940
|
}();
|
924
941
|
var handleButtonClick = /*#__PURE__*/function () {
|
925
|
-
var
|
942
|
+
var _ref15 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee12(key) {
|
926
943
|
var _savePayLaterHandlerR;
|
927
944
|
var data, isSynced, orderId, params, _paymentItems;
|
928
|
-
return _regeneratorRuntime().wrap(function
|
929
|
-
while (1) switch (
|
945
|
+
return _regeneratorRuntime().wrap(function _callee12$(_context12) {
|
946
|
+
while (1) switch (_context12.prev = _context12.next) {
|
930
947
|
case 0:
|
931
948
|
console.log('handleButtonClick', key);
|
932
|
-
|
933
|
-
|
949
|
+
_context12.t0 = key;
|
950
|
+
_context12.next = _context12.t0 === 'order-note' ? 4 : _context12.t0 === 'send-link' ? 6 : _context12.t0 === 'print-receipt' ? 8 : _context12.t0 === 'manual-discount' ? 24 : _context12.t0 === 'save-pay-later' ? 38 : 40;
|
934
951
|
break;
|
935
952
|
case 4:
|
936
953
|
setNoteModalOpen(true);
|
937
|
-
return
|
954
|
+
return _context12.abrupt("break", 40);
|
938
955
|
case 6:
|
939
956
|
setPaymentLinkModalOpen(true);
|
940
|
-
return
|
957
|
+
return _context12.abrupt("break", 40);
|
941
958
|
case 8:
|
942
|
-
|
959
|
+
_context12.next = 10;
|
943
960
|
return checkoutModule.isCurrentOrderSynced();
|
944
961
|
case 10:
|
945
|
-
isSynced =
|
962
|
+
isSynced = _context12.sent;
|
946
963
|
if (isSynced) {
|
947
|
-
|
964
|
+
_context12.next = 17;
|
948
965
|
break;
|
949
966
|
}
|
950
|
-
|
967
|
+
_context12.next = 14;
|
951
968
|
return checkoutModule.manualSyncOrderAsync();
|
952
969
|
case 14:
|
953
|
-
data =
|
954
|
-
|
970
|
+
data = _context12.sent;
|
971
|
+
_context12.next = 21;
|
955
972
|
break;
|
956
973
|
case 17:
|
957
|
-
|
974
|
+
_context12.next = 19;
|
958
975
|
return checkoutModule.getCurrentOrderId();
|
959
976
|
case 19:
|
960
|
-
orderId =
|
977
|
+
orderId = _context12.sent;
|
961
978
|
data = {
|
962
979
|
orderId: orderId
|
963
980
|
};
|
@@ -982,47 +999,47 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
982
999
|
console.error('handleButtonClick_print-receipt_error>>>>', error);
|
983
1000
|
}
|
984
1001
|
}
|
985
|
-
return
|
1002
|
+
return _context12.abrupt("break", 40);
|
986
1003
|
case 24:
|
987
1004
|
if (orderInfo !== null && orderInfo !== void 0 && orderInfo.totalAmount) {
|
988
|
-
|
1005
|
+
_context12.next = 27;
|
989
1006
|
break;
|
990
1007
|
}
|
991
1008
|
Toast === null || Toast === void 0 || Toast.fail(locales.getText('pisell2.checkout.manual-discount.no-amount'));
|
992
|
-
return
|
1009
|
+
return _context12.abrupt("return");
|
993
1010
|
case 27:
|
994
|
-
|
1011
|
+
_context12.next = 29;
|
995
1012
|
return checkoutModule.getCurrentOrderPaymentItemsAsync();
|
996
1013
|
case 29:
|
997
|
-
_paymentItems =
|
1014
|
+
_paymentItems = _context12.sent;
|
998
1015
|
if (!(_paymentItems !== null && _paymentItems !== void 0 && _paymentItems.length)) {
|
999
|
-
|
1016
|
+
_context12.next = 33;
|
1000
1017
|
break;
|
1001
1018
|
}
|
1002
1019
|
Toast === null || Toast === void 0 || Toast.fail(locales.getText('pisell2.checkout.manual-discount.has-payment-items'));
|
1003
|
-
return
|
1020
|
+
return _context12.abrupt("return");
|
1004
1021
|
case 33:
|
1005
1022
|
if (!(Number(customAmount) <= 0 && Number(orderInfo === null || orderInfo === void 0 ? void 0 : orderInfo.totalAmount) >= 0)) {
|
1006
|
-
|
1023
|
+
_context12.next = 36;
|
1007
1024
|
break;
|
1008
1025
|
}
|
1009
1026
|
Toast === null || Toast === void 0 || Toast.fail(locales.getText('pisell2.checkout.manual-discount.no-amount'));
|
1010
|
-
return
|
1027
|
+
return _context12.abrupt("return");
|
1011
1028
|
case 36:
|
1012
1029
|
setShowPriceAdjustModal(true);
|
1013
|
-
return
|
1030
|
+
return _context12.abrupt("break", 40);
|
1014
1031
|
case 38:
|
1015
1032
|
// 通过 ref 调用 SavePayLaterHandler 的处理方法
|
1016
1033
|
(_savePayLaterHandlerR = savePayLaterHandlerRef.current) === null || _savePayLaterHandlerR === void 0 || _savePayLaterHandlerR.handleSavePayLaterClick();
|
1017
|
-
return
|
1034
|
+
return _context12.abrupt("break", 40);
|
1018
1035
|
case 40:
|
1019
1036
|
case "end":
|
1020
|
-
return
|
1037
|
+
return _context12.stop();
|
1021
1038
|
}
|
1022
|
-
},
|
1039
|
+
}, _callee12);
|
1023
1040
|
}));
|
1024
|
-
return function handleButtonClick(
|
1025
|
-
return
|
1041
|
+
return function handleButtonClick(_x12) {
|
1042
|
+
return _ref15.apply(this, arguments);
|
1026
1043
|
};
|
1027
1044
|
}();
|
1028
1045
|
|
@@ -1050,37 +1067,37 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
1050
1067
|
};
|
1051
1068
|
};
|
1052
1069
|
var handleSendCustomerPaymentLink = /*#__PURE__*/function () {
|
1053
|
-
var
|
1070
|
+
var _ref16 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee13(data) {
|
1054
1071
|
var order, stateAmount, isCurrentOrderSynced, res;
|
1055
|
-
return _regeneratorRuntime().wrap(function
|
1056
|
-
while (1) switch (
|
1072
|
+
return _regeneratorRuntime().wrap(function _callee13$(_context13) {
|
1073
|
+
while (1) switch (_context13.prev = _context13.next) {
|
1057
1074
|
case 0:
|
1058
1075
|
// 先检测订单是否同步过,如果没有,需要先手动下单
|
1059
1076
|
// 如果是定金模式,则需要设置当前待付金额至 os 的 deposit_amount
|
1060
1077
|
order = checkoutModule.getCurrentOrderInfo();
|
1061
1078
|
if (!order.isDeposit) {
|
1062
|
-
|
1079
|
+
_context13.next = 5;
|
1063
1080
|
break;
|
1064
1081
|
}
|
1065
1082
|
stateAmount = checkoutModule.getStateAmount();
|
1066
|
-
|
1083
|
+
_context13.next = 5;
|
1067
1084
|
return checkoutModule.setDepositAmountAsync(stateAmount);
|
1068
1085
|
case 5:
|
1069
1086
|
isCurrentOrderSynced = checkoutModule.isCurrentOrderSynced();
|
1070
1087
|
if (isCurrentOrderSynced) {
|
1071
|
-
|
1088
|
+
_context13.next = 9;
|
1072
1089
|
break;
|
1073
1090
|
}
|
1074
|
-
|
1091
|
+
_context13.next = 9;
|
1075
1092
|
return checkoutModule.manualSyncOrderAsync();
|
1076
1093
|
case 9:
|
1077
|
-
|
1094
|
+
_context13.next = 11;
|
1078
1095
|
return checkoutModule.sendCustomerPayLinkAsync({
|
1079
1096
|
emails: data.emails,
|
1080
1097
|
order_ids: [checkoutModule.getCurrentOrderId()]
|
1081
1098
|
});
|
1082
1099
|
case 11:
|
1083
|
-
res =
|
1100
|
+
res = _context13.sent;
|
1084
1101
|
// 支付链接发送成功 转 toC,这边可以关掉了
|
1085
1102
|
if (res.success) {
|
1086
1103
|
Toast === null || Toast === void 0 || Toast.success(locales.getText('pisell2.checkout.send-payment-link.success'));
|
@@ -1090,12 +1107,12 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
1090
1107
|
}
|
1091
1108
|
case 13:
|
1092
1109
|
case "end":
|
1093
|
-
return
|
1110
|
+
return _context13.stop();
|
1094
1111
|
}
|
1095
|
-
},
|
1112
|
+
}, _callee13);
|
1096
1113
|
}));
|
1097
|
-
return function handleSendCustomerPaymentLink(
|
1098
|
-
return
|
1114
|
+
return function handleSendCustomerPaymentLink(_x13) {
|
1115
|
+
return _ref16.apply(this, arguments);
|
1099
1116
|
};
|
1100
1117
|
}();
|
1101
1118
|
var searchAndClientProps = useMemo(function () {
|
@@ -1107,31 +1124,44 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
1107
1124
|
return {};
|
1108
1125
|
}, [paymentItems]);
|
1109
1126
|
var roundingFunction = /*#__PURE__*/function () {
|
1110
|
-
var
|
1127
|
+
var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(amount) {
|
1111
1128
|
var res;
|
1112
|
-
return _regeneratorRuntime().wrap(function
|
1113
|
-
while (1) switch (
|
1129
|
+
return _regeneratorRuntime().wrap(function _callee14$(_context14) {
|
1130
|
+
while (1) switch (_context14.prev = _context14.next) {
|
1114
1131
|
case 0:
|
1115
|
-
|
1132
|
+
_context14.next = 2;
|
1116
1133
|
return checkoutModule.roundAmountAsync(amount);
|
1117
1134
|
case 2:
|
1118
|
-
res =
|
1119
|
-
return
|
1135
|
+
res = _context14.sent;
|
1136
|
+
return _context14.abrupt("return", res);
|
1120
1137
|
case 4:
|
1121
1138
|
case "end":
|
1122
|
-
return
|
1139
|
+
return _context14.stop();
|
1123
1140
|
}
|
1124
|
-
},
|
1141
|
+
}, _callee14);
|
1125
1142
|
}));
|
1126
|
-
return function roundingFunction(
|
1127
|
-
return
|
1143
|
+
return function roundingFunction(_x14) {
|
1144
|
+
return _ref17.apply(this, arguments);
|
1128
1145
|
};
|
1129
1146
|
}();
|
1147
|
+
|
1148
|
+
// 处理PaymentModal区域的点击事件
|
1149
|
+
var handleModalClick = useCallback(function (event) {
|
1150
|
+
// 关闭所有Toast
|
1151
|
+
closeAllPaymentResultToasts();
|
1152
|
+
}, []);
|
1130
1153
|
return /*#__PURE__*/React.createElement("div", {
|
1131
1154
|
ref: checkoutRef,
|
1155
|
+
onClick: handleModalClick,
|
1132
1156
|
style: _objectSpread(_objectSpread({}, checkoutStyles.container), {}, {
|
1133
1157
|
maxHeight: dynamicMaxHeight
|
1134
1158
|
})
|
1159
|
+
}, /*#__PURE__*/React.createElement("div", {
|
1160
|
+
style: {
|
1161
|
+
padding: '12px 16px',
|
1162
|
+
border: '1px solid #d0d5dd',
|
1163
|
+
borderRadius: 8
|
1164
|
+
}
|
1135
1165
|
}, /*#__PURE__*/React.createElement(SearchAndClientModule, _extends({
|
1136
1166
|
onClientChange: function onClientChange() {
|
1137
1167
|
// 同步记录客户信息变更情况
|
@@ -1145,7 +1175,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
1145
1175
|
ref: walletPassRef,
|
1146
1176
|
paymentItems: paymentItems,
|
1147
1177
|
onSelectChange: handleSelectWalletChange
|
1148
|
-
}), /*#__PURE__*/React.createElement(AmountSummary, {
|
1178
|
+
})), /*#__PURE__*/React.createElement(AmountSummary, {
|
1149
1179
|
amountSymbol: state.amountSymbol,
|
1150
1180
|
orderInfo: orderInfo || undefined,
|
1151
1181
|
cartData: cartData,
|
@@ -1157,6 +1187,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
1157
1187
|
clientInfo: state === null || state === void 0 || (_state$client3 = state.client) === null || _state$client3 === void 0 ? void 0 : _state$client3.value,
|
1158
1188
|
onAmountChange: handleAmountChange,
|
1159
1189
|
onDepositStatusChange: handleDepositStatusChange,
|
1190
|
+
onBalanceDueAmountClick: handleButtonClick,
|
1160
1191
|
onConfirm: handleWalletPassConfirmPay,
|
1161
1192
|
totalAmount: totalAmount
|
1162
1193
|
}), /*#__PURE__*/React.createElement("div", {
|
@@ -1188,7 +1219,8 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
1188
1219
|
paymentMethods: paymentMethods,
|
1189
1220
|
customAmount: customAmount,
|
1190
1221
|
title: paymentOptionsTitle,
|
1191
|
-
disabled: isOrderFree
|
1222
|
+
disabled: isOrderFree,
|
1223
|
+
showCashPayment: showCashPayment
|
1192
1224
|
})), moduleConfig.showAdditionalModule && /*#__PURE__*/React.createElement("div", {
|
1193
1225
|
className: showCashPayment ? '' : 'additional-module-container',
|
1194
1226
|
style: showCashPayment ? {
|
@@ -1252,20 +1284,20 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
1252
1284
|
|
1253
1285
|
// 主要的支付弹窗组件
|
1254
1286
|
|
1255
|
-
var PaymentModal = function PaymentModal(
|
1287
|
+
var PaymentModal = function PaymentModal(_ref18) {
|
1256
1288
|
var _context$appHelper$ut, _context$appHelper$ut2, _context$appHelper$ut3, _context$appHelper$ut4, _context$appHelper;
|
1257
|
-
var open =
|
1258
|
-
data =
|
1259
|
-
callback =
|
1260
|
-
onClose =
|
1261
|
-
dispatch =
|
1262
|
-
state =
|
1289
|
+
var open = _ref18.open,
|
1290
|
+
data = _ref18.data,
|
1291
|
+
callback = _ref18.callback,
|
1292
|
+
onClose = _ref18.onClose,
|
1293
|
+
dispatch = _ref18.dispatch,
|
1294
|
+
state = _ref18.state;
|
1263
1295
|
var context = useEngineContext();
|
1264
1296
|
locales.init(checkoutLocales, ((_context$appHelper$ut = context.appHelper.utils) === null || _context$appHelper$ut === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut.getApp) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.call(_context$appHelper$ut)) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut2 = _context$appHelper$ut2.locales) === null || _context$appHelper$ut2 === void 0 || (_context$appHelper$ut3 = _context$appHelper$ut2.getLocale) === null || _context$appHelper$ut3 === void 0 ? void 0 : _context$appHelper$ut3.call(_context$appHelper$ut2)) || ((_context$appHelper$ut4 = context.appHelper.utils) === null || _context$appHelper$ut4 === void 0 || (_context$appHelper$ut4 = _context$appHelper$ut4.storage) === null || _context$appHelper$ut4 === void 0 ? void 0 : _context$appHelper$ut4.get('umi_locale')) || 'en');
|
1265
|
-
var
|
1266
|
-
pisellos =
|
1267
|
-
getData =
|
1268
|
-
interaction =
|
1297
|
+
var _ref19 = (context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
|
1298
|
+
pisellos = _ref19.pisellos,
|
1299
|
+
getData = _ref19.getData,
|
1300
|
+
interaction = _ref19.interaction;
|
1269
1301
|
var _useState21 = useState(null),
|
1270
1302
|
_useState22 = _slicedToArray(_useState21, 2),
|
1271
1303
|
orderInfo = _useState22[0],
|
@@ -1290,10 +1322,10 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1290
1322
|
|
1291
1323
|
// 重试处理函数(逻辑由用户自己实现)
|
1292
1324
|
var handleRetry = /*#__PURE__*/function () {
|
1293
|
-
var
|
1325
|
+
var _ref20 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee15() {
|
1294
1326
|
var checkoutModule, res;
|
1295
|
-
return _regeneratorRuntime().wrap(function
|
1296
|
-
while (1) switch (
|
1327
|
+
return _regeneratorRuntime().wrap(function _callee15$(_context15) {
|
1328
|
+
while (1) switch (_context15.prev = _context15.next) {
|
1297
1329
|
case 0:
|
1298
1330
|
// TODO: 用户在这里实现重试逻辑
|
1299
1331
|
// console.log('重试按钮被点击,请在这里添加重试逻辑');
|
@@ -1305,24 +1337,26 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1305
1337
|
// // 失败保持弹窗打开,允许继续重试
|
1306
1338
|
// }
|
1307
1339
|
checkoutModule = pisellos === null || pisellos === void 0 ? void 0 : pisellos.getModule('checkout');
|
1308
|
-
|
1340
|
+
_context15.next = 3;
|
1309
1341
|
return checkoutModule === null || checkoutModule === void 0 ? void 0 : checkoutModule.manualSyncOrderAsync();
|
1310
1342
|
case 3:
|
1311
|
-
res =
|
1343
|
+
res = _context15.sent;
|
1312
1344
|
console.log(res);
|
1313
|
-
if (res.success) {
|
1314
|
-
|
1315
|
-
|
1316
|
-
// setShowRetryModal(false);
|
1345
|
+
if (!res.success) {
|
1346
|
+
_context15.next = 9;
|
1347
|
+
break;
|
1317
1348
|
}
|
1318
|
-
|
1349
|
+
setShowRetryModal(false);
|
1350
|
+
_context15.next = 9;
|
1351
|
+
return showSuccessToast === null || showSuccessToast === void 0 ? void 0 : showSuccessToast(res);
|
1352
|
+
case 9:
|
1319
1353
|
case "end":
|
1320
|
-
return
|
1354
|
+
return _context15.stop();
|
1321
1355
|
}
|
1322
|
-
},
|
1356
|
+
}, _callee15);
|
1323
1357
|
}));
|
1324
1358
|
return function handleRetry() {
|
1325
|
-
return
|
1359
|
+
return _ref20.apply(this, arguments);
|
1326
1360
|
};
|
1327
1361
|
}();
|
1328
1362
|
|
@@ -1346,6 +1380,53 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1346
1380
|
};
|
1347
1381
|
}, []);
|
1348
1382
|
|
1383
|
+
// 初始化 tillButton 数据
|
1384
|
+
useEffect(function () {
|
1385
|
+
var _interaction$utils3;
|
1386
|
+
var initTillButtonData = /*#__PURE__*/function () {
|
1387
|
+
var _ref21 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee16() {
|
1388
|
+
var _interaction$utils2, _interaction$utils2$a, tillButtonData;
|
1389
|
+
return _regeneratorRuntime().wrap(function _callee16$(_context16) {
|
1390
|
+
while (1) switch (_context16.prev = _context16.next) {
|
1391
|
+
case 0:
|
1392
|
+
console.log('准备获取tillButton数据');
|
1393
|
+
_context16.prev = 1;
|
1394
|
+
_context16.next = 4;
|
1395
|
+
return interaction === null || interaction === void 0 || (_interaction$utils2 = interaction.utils) === null || _interaction$utils2 === void 0 || (_interaction$utils2$a = _interaction$utils2.asyncDataManager) === null || _interaction$utils2$a === void 0 ? void 0 : _interaction$utils2$a.call(_interaction$utils2, {
|
1396
|
+
module: 'get',
|
1397
|
+
key: 'till_button'
|
1398
|
+
});
|
1399
|
+
case 4:
|
1400
|
+
tillButtonData = _context16.sent;
|
1401
|
+
console.log('获取tillButton数据成功', tillButtonData);
|
1402
|
+
if (tillButtonData) {
|
1403
|
+
// 设置 tillButton 数据到全局 Toast 管理器
|
1404
|
+
setTillButton(tillButtonData);
|
1405
|
+
console.log('PaymentModal: tillButton data set successfully', tillButtonData);
|
1406
|
+
}
|
1407
|
+
_context16.next = 12;
|
1408
|
+
break;
|
1409
|
+
case 9:
|
1410
|
+
_context16.prev = 9;
|
1411
|
+
_context16.t0 = _context16["catch"](1);
|
1412
|
+
console.error('PaymentModal: Failed to get till_button from asyncDataManager:', _context16.t0);
|
1413
|
+
case 12:
|
1414
|
+
case "end":
|
1415
|
+
return _context16.stop();
|
1416
|
+
}
|
1417
|
+
}, _callee16, null, [[1, 9]]);
|
1418
|
+
}));
|
1419
|
+
return function initTillButtonData() {
|
1420
|
+
return _ref21.apply(this, arguments);
|
1421
|
+
};
|
1422
|
+
}();
|
1423
|
+
|
1424
|
+
// 只在 PaymentModal 打开时初始化 tillButton 数据
|
1425
|
+
if (interaction !== null && interaction !== void 0 && (_interaction$utils3 = interaction.utils) !== null && _interaction$utils3 !== void 0 && _interaction$utils3.asyncDataManager) {
|
1426
|
+
initTillButtonData();
|
1427
|
+
}
|
1428
|
+
}, [interaction]);
|
1429
|
+
|
1349
1430
|
// 计算元素最大高度: window.innerHeight * 0.9 - 72
|
1350
1431
|
var dynamicMaxHeight = useMemo(function () {
|
1351
1432
|
if (windowHeight === 0) return '600px'; // 默认值
|
@@ -1384,13 +1465,13 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1384
1465
|
|
1385
1466
|
// 订单备注相关处理函数
|
1386
1467
|
var handleNoteConfirm = /*#__PURE__*/function () {
|
1387
|
-
var
|
1468
|
+
var _ref22 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee17(noteValue) {
|
1388
1469
|
var checkoutModule, orderId, _checkoutModule$editO, _checkoutModule, _checkoutModule$updat;
|
1389
|
-
return _regeneratorRuntime().wrap(function
|
1390
|
-
while (1) switch (
|
1470
|
+
return _regeneratorRuntime().wrap(function _callee17$(_context17) {
|
1471
|
+
while (1) switch (_context17.prev = _context17.next) {
|
1391
1472
|
case 0:
|
1392
1473
|
if (!(noteModalSource === 'payment-result-toast')) {
|
1393
|
-
|
1474
|
+
_context17.next = 6;
|
1394
1475
|
break;
|
1395
1476
|
}
|
1396
1477
|
checkoutModule = pisellos === null || pisellos === void 0 ? void 0 : pisellos.getModule('checkout');
|
@@ -1401,15 +1482,15 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1401
1482
|
Toast === null || Toast === void 0 || Toast.success(locales.getText('pisell2.checkout.order-note.updated-successfully'));
|
1402
1483
|
}
|
1403
1484
|
setNoteModalOpen(false);
|
1404
|
-
return
|
1485
|
+
return _context17.abrupt("return");
|
1405
1486
|
case 6:
|
1406
|
-
|
1487
|
+
_context17.prev = 6;
|
1407
1488
|
_checkoutModule = pisellos === null || pisellos === void 0 ? void 0 : pisellos.getModule('checkout');
|
1408
1489
|
if (!_checkoutModule) {
|
1409
|
-
|
1490
|
+
_context17.next = 13;
|
1410
1491
|
break;
|
1411
1492
|
}
|
1412
|
-
|
1493
|
+
_context17.next = 11;
|
1413
1494
|
return (_checkoutModule$updat = _checkoutModule.updateOrderNoteAsync) === null || _checkoutModule$updat === void 0 ? void 0 : _checkoutModule$updat.call(_checkoutModule, noteValue);
|
1414
1495
|
case 11:
|
1415
1496
|
setOrderNote(noteValue);
|
@@ -1435,38 +1516,38 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1435
1516
|
console.log('Note added from payment content');
|
1436
1517
|
// 在支付内容中打开的,执行常规处理逻辑
|
1437
1518
|
}
|
1438
|
-
|
1519
|
+
_context17.next = 21;
|
1439
1520
|
break;
|
1440
1521
|
case 17:
|
1441
|
-
|
1442
|
-
|
1443
|
-
console.error('Failed to update order note:',
|
1522
|
+
_context17.prev = 17;
|
1523
|
+
_context17.t0 = _context17["catch"](6);
|
1524
|
+
console.error('Failed to update order note:', _context17.t0);
|
1444
1525
|
Toast === null || Toast === void 0 || Toast.error(locales.getText('pisell2.checkout.order-note.update-failed'));
|
1445
1526
|
case 21:
|
1446
1527
|
setNoteModalOpen(false);
|
1447
1528
|
case 22:
|
1448
1529
|
case "end":
|
1449
|
-
return
|
1530
|
+
return _context17.stop();
|
1450
1531
|
}
|
1451
|
-
},
|
1532
|
+
}, _callee17, null, [[6, 17]]);
|
1452
1533
|
}));
|
1453
|
-
return function handleNoteConfirm(
|
1454
|
-
return
|
1534
|
+
return function handleNoteConfirm(_x15) {
|
1535
|
+
return _ref22.apply(this, arguments);
|
1455
1536
|
};
|
1456
1537
|
}();
|
1457
1538
|
var handleNoteDelete = /*#__PURE__*/function () {
|
1458
|
-
var
|
1539
|
+
var _ref23 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee18() {
|
1459
1540
|
var checkoutModule, _checkoutModule$updat2;
|
1460
|
-
return _regeneratorRuntime().wrap(function
|
1461
|
-
while (1) switch (
|
1541
|
+
return _regeneratorRuntime().wrap(function _callee18$(_context18) {
|
1542
|
+
while (1) switch (_context18.prev = _context18.next) {
|
1462
1543
|
case 0:
|
1463
|
-
|
1544
|
+
_context18.prev = 0;
|
1464
1545
|
checkoutModule = pisellos === null || pisellos === void 0 ? void 0 : pisellos.getModule('checkout');
|
1465
1546
|
if (!checkoutModule) {
|
1466
|
-
|
1547
|
+
_context18.next = 7;
|
1467
1548
|
break;
|
1468
1549
|
}
|
1469
|
-
|
1550
|
+
_context18.next = 5;
|
1470
1551
|
return (_checkoutModule$updat2 = checkoutModule.updateOrderNoteAsync) === null || _checkoutModule$updat2 === void 0 ? void 0 : _checkoutModule$updat2.call(checkoutModule, '');
|
1471
1552
|
case 5:
|
1472
1553
|
setOrderNote('');
|
@@ -1482,23 +1563,23 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1482
1563
|
}
|
1483
1564
|
});
|
1484
1565
|
}
|
1485
|
-
|
1566
|
+
_context18.next = 14;
|
1486
1567
|
break;
|
1487
1568
|
case 10:
|
1488
|
-
|
1489
|
-
|
1490
|
-
console.error('Failed to delete order note:',
|
1569
|
+
_context18.prev = 10;
|
1570
|
+
_context18.t0 = _context18["catch"](0);
|
1571
|
+
console.error('Failed to delete order note:', _context18.t0);
|
1491
1572
|
Toast === null || Toast === void 0 || Toast.error(locales.getText('pisell2.checkout.order-note.delete-failed'));
|
1492
1573
|
case 14:
|
1493
1574
|
setNoteModalOpen(false);
|
1494
1575
|
case 15:
|
1495
1576
|
case "end":
|
1496
|
-
return
|
1577
|
+
return _context18.stop();
|
1497
1578
|
}
|
1498
|
-
},
|
1579
|
+
}, _callee18, null, [[0, 10]]);
|
1499
1580
|
}));
|
1500
1581
|
return function handleNoteDelete() {
|
1501
|
-
return
|
1582
|
+
return _ref23.apply(this, arguments);
|
1502
1583
|
};
|
1503
1584
|
}();
|
1504
1585
|
var handleNoteCancel = function handleNoteCancel() {
|
@@ -1516,8 +1597,173 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1516
1597
|
|
1517
1598
|
// 处理从支付结果toast打开订单备注的事件
|
1518
1599
|
var handleOrderNoteClickFromToast = function handleOrderNoteClickFromToast() {
|
1519
|
-
|
1520
|
-
|
1600
|
+
var _context$appHelper$ut5, _context$appHelper$ut6, _context$appHelper$ut7, _context$appHelper$ut8;
|
1601
|
+
// 创建独立的Modal容器
|
1602
|
+
var modalContainer = document.createElement('div');
|
1603
|
+
document.body.appendChild(modalContainer);
|
1604
|
+
|
1605
|
+
// 获取当前的Toast实例,如果不可用则创建全局Toast函数
|
1606
|
+
var showToast = function showToast(type, message) {
|
1607
|
+
if (Toast && Toast[type]) {
|
1608
|
+
Toast[type](message);
|
1609
|
+
} else {
|
1610
|
+
// 如果Toast不可用,尝试使用全局的消息提示
|
1611
|
+
if (type === 'success') {
|
1612
|
+
console.log('✅ Success:', message);
|
1613
|
+
// 可以在这里添加其他全局提示方式
|
1614
|
+
} else {
|
1615
|
+
console.error('❌ Error:', message);
|
1616
|
+
// 可以在这里添加其他全局提示方式
|
1617
|
+
}
|
1618
|
+
}
|
1619
|
+
};
|
1620
|
+
var handleNoteConfirm = /*#__PURE__*/function () {
|
1621
|
+
var _ref24 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee19(noteValue) {
|
1622
|
+
var checkoutModule, orderId, _checkoutModule$editO2;
|
1623
|
+
return _regeneratorRuntime().wrap(function _callee19$(_context19) {
|
1624
|
+
while (1) switch (_context19.prev = _context19.next) {
|
1625
|
+
case 0:
|
1626
|
+
_context19.prev = 0;
|
1627
|
+
checkoutModule = pisellos === null || pisellos === void 0 ? void 0 : pisellos.getModule('checkout');
|
1628
|
+
orderId = checkoutModule === null || checkoutModule === void 0 ? void 0 : checkoutModule.getCurrentOrderId();
|
1629
|
+
if (!(checkoutModule && orderId)) {
|
1630
|
+
_context19.next = 8;
|
1631
|
+
break;
|
1632
|
+
}
|
1633
|
+
_context19.next = 6;
|
1634
|
+
return (_checkoutModule$editO2 = checkoutModule.editOrderNoteByOrderIdAsync) === null || _checkoutModule$editO2 === void 0 ? void 0 : _checkoutModule$editO2.call(checkoutModule, orderId, noteValue);
|
1635
|
+
case 6:
|
1636
|
+
setOrderNote(noteValue);
|
1637
|
+
showToast('success', locales.getText('pisell2.checkout.order-note.updated-successfully'));
|
1638
|
+
case 8:
|
1639
|
+
_context19.next = 14;
|
1640
|
+
break;
|
1641
|
+
case 10:
|
1642
|
+
_context19.prev = 10;
|
1643
|
+
_context19.t0 = _context19["catch"](0);
|
1644
|
+
console.error('Failed to update order note:', _context19.t0);
|
1645
|
+
showToast('error', locales.getText('pisell2.checkout.order-note.update-failed'));
|
1646
|
+
case 14:
|
1647
|
+
// 清理DOM
|
1648
|
+
ReactDOM.unmountComponentAtNode(modalContainer);
|
1649
|
+
if (document.body.contains(modalContainer)) {
|
1650
|
+
document.body.removeChild(modalContainer);
|
1651
|
+
}
|
1652
|
+
case 16:
|
1653
|
+
case "end":
|
1654
|
+
return _context19.stop();
|
1655
|
+
}
|
1656
|
+
}, _callee19, null, [[0, 10]]);
|
1657
|
+
}));
|
1658
|
+
return function handleNoteConfirm(_x16) {
|
1659
|
+
return _ref24.apply(this, arguments);
|
1660
|
+
};
|
1661
|
+
}();
|
1662
|
+
var handleNoteDelete = /*#__PURE__*/function () {
|
1663
|
+
var _ref25 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee20() {
|
1664
|
+
var checkoutModule, orderId, _checkoutModule$editO3;
|
1665
|
+
return _regeneratorRuntime().wrap(function _callee20$(_context20) {
|
1666
|
+
while (1) switch (_context20.prev = _context20.next) {
|
1667
|
+
case 0:
|
1668
|
+
_context20.prev = 0;
|
1669
|
+
checkoutModule = pisellos === null || pisellos === void 0 ? void 0 : pisellos.getModule('checkout');
|
1670
|
+
orderId = checkoutModule === null || checkoutModule === void 0 ? void 0 : checkoutModule.getCurrentOrderId();
|
1671
|
+
if (!(checkoutModule && orderId)) {
|
1672
|
+
_context20.next = 8;
|
1673
|
+
break;
|
1674
|
+
}
|
1675
|
+
_context20.next = 6;
|
1676
|
+
return (_checkoutModule$editO3 = checkoutModule.editOrderNoteByOrderIdAsync) === null || _checkoutModule$editO3 === void 0 ? void 0 : _checkoutModule$editO3.call(checkoutModule, orderId, '');
|
1677
|
+
case 6:
|
1678
|
+
setOrderNote('');
|
1679
|
+
showToast('success', locales.getText('pisell2.checkout.order-note.deleted-successfully'));
|
1680
|
+
case 8:
|
1681
|
+
_context20.next = 14;
|
1682
|
+
break;
|
1683
|
+
case 10:
|
1684
|
+
_context20.prev = 10;
|
1685
|
+
_context20.t0 = _context20["catch"](0);
|
1686
|
+
console.error('Failed to delete order note:', _context20.t0);
|
1687
|
+
showToast('error', locales.getText('pisell2.checkout.order-note.delete-failed'));
|
1688
|
+
case 14:
|
1689
|
+
// 清理DOM
|
1690
|
+
ReactDOM.unmountComponentAtNode(modalContainer);
|
1691
|
+
if (document.body.contains(modalContainer)) {
|
1692
|
+
document.body.removeChild(modalContainer);
|
1693
|
+
}
|
1694
|
+
case 16:
|
1695
|
+
case "end":
|
1696
|
+
return _context20.stop();
|
1697
|
+
}
|
1698
|
+
}, _callee20, null, [[0, 10]]);
|
1699
|
+
}));
|
1700
|
+
return function handleNoteDelete() {
|
1701
|
+
return _ref25.apply(this, arguments);
|
1702
|
+
};
|
1703
|
+
}();
|
1704
|
+
var handleNoteCancel = function handleNoteCancel() {
|
1705
|
+
// 清理DOM
|
1706
|
+
ReactDOM.unmountComponentAtNode(modalContainer);
|
1707
|
+
if (document.body.contains(modalContainer)) {
|
1708
|
+
document.body.removeChild(modalContainer);
|
1709
|
+
}
|
1710
|
+
};
|
1711
|
+
|
1712
|
+
// 获取当前语言环境
|
1713
|
+
var currentLocale = ((_context$appHelper$ut5 = context.appHelper.utils) === null || _context$appHelper$ut5 === void 0 || (_context$appHelper$ut6 = _context$appHelper$ut5.getApp) === null || _context$appHelper$ut6 === void 0 || (_context$appHelper$ut6 = _context$appHelper$ut6.call(_context$appHelper$ut5)) === null || _context$appHelper$ut6 === void 0 || (_context$appHelper$ut6 = _context$appHelper$ut6.locales) === null || _context$appHelper$ut6 === void 0 || (_context$appHelper$ut7 = _context$appHelper$ut6.getLocale) === null || _context$appHelper$ut7 === void 0 ? void 0 : _context$appHelper$ut7.call(_context$appHelper$ut6)) || ((_context$appHelper$ut8 = context.appHelper.utils) === null || _context$appHelper$ut8 === void 0 || (_context$appHelper$ut8 = _context$appHelper$ut8.storage) === null || _context$appHelper$ut8 === void 0 ? void 0 : _context$appHelper$ut8.get('umi_locale')) || 'en';
|
1714
|
+
|
1715
|
+
// 创建一个临时的Context Provider来传递正确的语言环境
|
1716
|
+
var EngineContextProvider = function EngineContextProvider(_ref26) {
|
1717
|
+
var _context$engine;
|
1718
|
+
var children = _ref26.children;
|
1719
|
+
var tempEngineContext = _objectSpread(_objectSpread({}, context), {}, {
|
1720
|
+
engine: _objectSpread(_objectSpread({}, context.engine), {}, {
|
1721
|
+
props: _objectSpread(_objectSpread({}, (_context$engine = context.engine) === null || _context$engine === void 0 ? void 0 : _context$engine.props), {}, {
|
1722
|
+
locale: currentLocale
|
1723
|
+
})
|
1724
|
+
})
|
1725
|
+
});
|
1726
|
+
|
1727
|
+
// 创建临时的Context
|
1728
|
+
var TempContext = /*#__PURE__*/React.createContext(tempEngineContext);
|
1729
|
+
|
1730
|
+
// 临时设置全局上下文,确保useEngineContext能够获取到正确的语言环境
|
1731
|
+
var originalContext = window.__injectedContext;
|
1732
|
+
window.__injectedContext = tempEngineContext;
|
1733
|
+
React.useEffect(function () {
|
1734
|
+
return function () {
|
1735
|
+
// 组件卸载时恢复原始上下文
|
1736
|
+
window.__injectedContext = originalContext;
|
1737
|
+
};
|
1738
|
+
}, []);
|
1739
|
+
return /*#__PURE__*/React.createElement(TempContext.Provider, {
|
1740
|
+
value: tempEngineContext
|
1741
|
+
}, children);
|
1742
|
+
};
|
1743
|
+
var orderNote = '';
|
1744
|
+
try {
|
1745
|
+
var checkoutModule = pisellos === null || pisellos === void 0 ? void 0 : pisellos.getModule('checkout');
|
1746
|
+
orderNote = checkoutModule.getOrderNote();
|
1747
|
+
} catch (error) {
|
1748
|
+
console.warn('Failed to get initial custom amount:', error);
|
1749
|
+
}
|
1750
|
+
|
1751
|
+
// 渲染NoteModal
|
1752
|
+
ReactDOM.render( /*#__PURE__*/React.createElement(EngineContextProvider, null, /*#__PURE__*/React.createElement(ConfigProvider, {
|
1753
|
+
prefixCls: "pisell-lowcode",
|
1754
|
+
theme: {
|
1755
|
+
token: {
|
1756
|
+
colorPrimary: '#7F56DA'
|
1757
|
+
}
|
1758
|
+
}
|
1759
|
+
}, /*#__PURE__*/React.createElement(NoteModal, {
|
1760
|
+
open: true,
|
1761
|
+
title: locales.getText('pisell2.text.add-order-notes'),
|
1762
|
+
value: orderNote,
|
1763
|
+
onConfirm: handleNoteConfirm,
|
1764
|
+
onDelete: handleNoteDelete,
|
1765
|
+
onCancel: handleNoteCancel
|
1766
|
+
}))), modalContainer);
|
1521
1767
|
};
|
1522
1768
|
|
1523
1769
|
// 创建本地翻译函数,优先使用 checkout 语言包
|
@@ -1547,14 +1793,19 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1547
1793
|
currentPaymentResultRef.current = result;
|
1548
1794
|
};
|
1549
1795
|
|
1550
|
-
// 创建toast关闭时的统一回调函数
|
1796
|
+
// 创建toast关闭时的统一回调函数 - 现在只处理支付完成回调,不自动关闭Modal
|
1551
1797
|
var handleToastClose = function handleToastClose() {
|
1552
|
-
console.log('PaymentModal - Toast closed, executing
|
1798
|
+
console.log('PaymentModal - Toast closed, executing payment completion callback');
|
1553
1799
|
// 调用支付完成回调
|
1554
1800
|
if (currentPaymentResultRef.current) {
|
1555
1801
|
callback === null || callback === void 0 || callback(currentPaymentResultRef.current);
|
1556
1802
|
}
|
1557
|
-
//
|
1803
|
+
// 不再自动关闭PaymentModal,让两个弹窗独立管理
|
1804
|
+
};
|
1805
|
+
|
1806
|
+
// 专门用于关闭PaymentModal的函数
|
1807
|
+
var handleModalClose = function handleModalClose() {
|
1808
|
+
console.log('PaymentModal - Modal closing independently');
|
1558
1809
|
onClose === null || onClose === void 0 || onClose(true);
|
1559
1810
|
};
|
1560
1811
|
var handlePaymentCancel = function handlePaymentCancel(reset) {
|
@@ -1564,33 +1815,42 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1564
1815
|
});
|
1565
1816
|
var checkout = pisellos.getModule('checkout');
|
1566
1817
|
checkout.cancelCurrentOrderAsync();
|
1818
|
+
// 不关闭PaymentResultToast,让它独立存在
|
1567
1819
|
onClose === null || onClose === void 0 || onClose(reset || false);
|
1568
1820
|
};
|
1569
1821
|
|
1570
1822
|
// 自定义头部组件
|
1571
1823
|
var CustomHeader = function CustomHeader() {
|
1572
1824
|
return /*#__PURE__*/React.createElement("div", {
|
1573
|
-
|
1574
|
-
display: 'flex',
|
1575
|
-
alignItems: 'center',
|
1576
|
-
width: '100%',
|
1577
|
-
position: 'relative'
|
1578
|
-
}
|
1825
|
+
className: "payment-modal-custom-header"
|
1579
1826
|
}, /*#__PURE__*/React.createElement("div", {
|
1580
|
-
|
1581
|
-
|
1582
|
-
|
1583
|
-
|
1584
|
-
|
1827
|
+
className: "header__left"
|
1828
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
1829
|
+
icon: /*#__PURE__*/React.createElement(Icon, {
|
1830
|
+
type: "pisell2-arrow-left",
|
1831
|
+
size: 24
|
1832
|
+
}),
|
1833
|
+
size: "small",
|
1834
|
+
type: "text",
|
1835
|
+
onClick: function onClick() {
|
1836
|
+
var checkout = pisellos.getModule('checkout');
|
1837
|
+
if (checkout.isCurrentOrderSynced()) {
|
1838
|
+
handlePaymentCancel(true);
|
1839
|
+
} else {
|
1840
|
+
handlePaymentCancel(false);
|
1841
|
+
}
|
1585
1842
|
}
|
1586
|
-
}
|
1587
|
-
|
1588
|
-
|
1589
|
-
|
1590
|
-
|
1591
|
-
|
1843
|
+
})), /*#__PURE__*/React.createElement("div", {
|
1844
|
+
className: "header__center"
|
1845
|
+
}, translation('order.total'), "\uFF1A", formatCurrency(totalAmount, state === null || state === void 0 ? void 0 : state.amountSymbol)), /*#__PURE__*/React.createElement("div", {
|
1846
|
+
className: "header__right"
|
1847
|
+
}, /*#__PURE__*/React.createElement(Button, {
|
1848
|
+
size: "small",
|
1849
|
+
type: "link",
|
1850
|
+
onClick: function onClick() {
|
1851
|
+
return handlePaymentCancel(true);
|
1592
1852
|
}
|
1593
|
-
},
|
1853
|
+
}, locales.getText('order.start-new-order'))));
|
1594
1854
|
};
|
1595
1855
|
|
1596
1856
|
// 初始化订单备注
|
@@ -1607,23 +1867,23 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1607
1867
|
// 初始化checkout数据
|
1608
1868
|
useEffect(function () {
|
1609
1869
|
var initCheckoutData = /*#__PURE__*/function () {
|
1610
|
-
var
|
1870
|
+
var _ref27 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22() {
|
1611
1871
|
var checkout, _newData$subtotal_inf, shop_wallet_pass_id, newData, _orderInfo2, _data$subtotal_info, _orderInfo3;
|
1612
|
-
return _regeneratorRuntime().wrap(function
|
1613
|
-
while (1) switch (
|
1872
|
+
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
1873
|
+
while (1) switch (_context22.prev = _context22.next) {
|
1614
1874
|
case 0:
|
1615
|
-
|
1875
|
+
_context22.prev = 0;
|
1616
1876
|
// 获取 checkout 模块并处理订单数据
|
1617
1877
|
checkout = pisellos === null || pisellos === void 0 ? void 0 : pisellos.getModule('checkout');
|
1618
1878
|
if (!(checkout && data && !isLocalOrderCreated.current)) {
|
1619
|
-
|
1879
|
+
_context22.next = 18;
|
1620
1880
|
break;
|
1621
1881
|
}
|
1622
1882
|
isLocalOrderCreated.current = true;
|
1623
|
-
|
1883
|
+
_context22.next = 6;
|
1624
1884
|
return getShopWalletPassId(interaction);
|
1625
1885
|
case 6:
|
1626
|
-
shop_wallet_pass_id =
|
1886
|
+
shop_wallet_pass_id = _context22.sent;
|
1627
1887
|
checkout.setOtherParams({
|
1628
1888
|
is_price_include_tax: getData('is_price_include_tax'),
|
1629
1889
|
tax_rate: getData('tax_rate') || '10',
|
@@ -1638,7 +1898,7 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1638
1898
|
});
|
1639
1899
|
newData = cloneDeep(data); // setTotalAmount(newData.total.expectAmount);
|
1640
1900
|
// 先往 checkout 解决方案推送一条 local 数据
|
1641
|
-
|
1901
|
+
_context22.next = 11;
|
1642
1902
|
return checkout.createLocalOrderAsync({
|
1643
1903
|
orderData: newData.order_info,
|
1644
1904
|
cartSummary: (_newData$subtotal_inf = newData.subtotal_info) === null || _newData$subtotal_inf === void 0 ? void 0 : _newData$subtotal_inf.subTotalList,
|
@@ -1662,122 +1922,151 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1662
1922
|
unsubscribeRef.current = undefined;
|
1663
1923
|
}
|
1664
1924
|
// 监听订单同步完成,同步完成后显示订单完成 toast,关闭当前弹窗
|
1665
|
-
unsubscribeRef.current = checkout.core.effects.on('checkout:onOrderSynced', function (
|
1666
|
-
var
|
1667
|
-
|
1668
|
-
|
1669
|
-
|
1670
|
-
|
1671
|
-
|
1672
|
-
|
1673
|
-
|
1674
|
-
|
1675
|
-
|
1676
|
-
|
1677
|
-
|
1678
|
-
|
1679
|
-
|
1680
|
-
|
1681
|
-
|
1682
|
-
|
1683
|
-
|
1684
|
-
|
1685
|
-
|
1686
|
-
|
1687
|
-
|
1688
|
-
|
1689
|
-
|
1690
|
-
|
1691
|
-
|
1692
|
-
|
1693
|
-
|
1694
|
-
|
1695
|
-
|
1696
|
-
|
1697
|
-
|
1698
|
-
|
1699
|
-
|
1700
|
-
|
1701
|
-
|
1702
|
-
|
1703
|
-
|
1704
|
-
|
1705
|
-
|
1706
|
-
|
1707
|
-
|
1708
|
-
|
1709
|
-
|
1710
|
-
|
1711
|
-
|
1712
|
-
|
1713
|
-
|
1714
|
-
|
1715
|
-
|
1716
|
-
|
1717
|
-
|
1718
|
-
|
1719
|
-
|
1720
|
-
|
1721
|
-
|
1722
|
-
|
1925
|
+
unsubscribeRef.current = checkout.core.effects.on('checkout:onOrderSynced', /*#__PURE__*/function () {
|
1926
|
+
var _ref28 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee21(data) {
|
1927
|
+
var _data$response, _responseData$payment2;
|
1928
|
+
var responseData, paymentStatus, orderTotalAmount, gapAmount, currentChangeGivenAmount, failureReason, _interaction$utils4, _interaction$utils4$a, _responseData$payment3, params, statusClassName, autoCloseConfig, enabledAutoPrint, paymentResult;
|
1929
|
+
return _regeneratorRuntime().wrap(function _callee21$(_context21) {
|
1930
|
+
while (1) switch (_context21.prev = _context21.next) {
|
1931
|
+
case 0:
|
1932
|
+
// 获取支付状态和相关信息
|
1933
|
+
responseData = (_data$response = data.response) === null || _data$response === void 0 ? void 0 : _data$response.data; // 获取支付状态
|
1934
|
+
paymentStatus = responseData === null || responseData === void 0 ? void 0 : responseData.payment_status;
|
1935
|
+
if (!data.isManual) {
|
1936
|
+
_context21.next = 4;
|
1937
|
+
break;
|
1938
|
+
}
|
1939
|
+
return _context21.abrupt("return");
|
1940
|
+
case 4:
|
1941
|
+
handlePaymentComplete(data);
|
1942
|
+
// 如果正在显示现金支付 toast,跳过自动关闭逻辑
|
1943
|
+
if (!showingCashToastRef.current) {
|
1944
|
+
_context21.next = 7;
|
1945
|
+
break;
|
1946
|
+
}
|
1947
|
+
return _context21.abrupt("return");
|
1948
|
+
case 7:
|
1949
|
+
// 获取订单总金额
|
1950
|
+
orderTotalAmount = Number((responseData === null || responseData === void 0 ? void 0 : responseData.total_amount) || 0);
|
1951
|
+
gapAmount = Number((responseData === null || responseData === void 0 ? void 0 : responseData.amount_gap) || 0);
|
1952
|
+
currentChangeGivenAmount = Number((responseData === null || responseData === void 0 || (_responseData$payment2 = responseData.payment_info) === null || _responseData$payment2 === void 0 ? void 0 : _responseData$payment2.current_change_given_amount) || 0); // const changeDue = Number(responseData?.amount_gap || 0);
|
1953
|
+
// 获取失败原因
|
1954
|
+
failureReason = responseData === null || responseData === void 0 ? void 0 : responseData.failure_reason; // 根据支付状态弹出对应的支付结果toast
|
1955
|
+
if (!paymentStatus) {
|
1956
|
+
_context21.next = 27;
|
1957
|
+
break;
|
1958
|
+
}
|
1959
|
+
// 打印订单完整信息
|
1960
|
+
console.log('print_order_onOrderSynced>>>>', responseData);
|
1961
|
+
logger === null || logger === void 0 || logger.addLog({
|
1962
|
+
type: 'info',
|
1963
|
+
title: 'print_order_onOrderSynced',
|
1964
|
+
metadata: {
|
1965
|
+
responseData: responseData
|
1966
|
+
}
|
1967
|
+
});
|
1968
|
+
try {
|
1969
|
+
params = {
|
1970
|
+
type: '99',
|
1971
|
+
// 打印订单全部信息
|
1972
|
+
data: {
|
1973
|
+
order_id: responseData.order_id,
|
1974
|
+
machine_code_print_info: responseData === null || responseData === void 0 ? void 0 : responseData.machine_code_print_info,
|
1975
|
+
small_ticket_data: responseData === null || responseData === void 0 || (_responseData$payment3 = responseData.payment_info) === null || _responseData$payment3 === void 0 ? void 0 : _responseData$payment3.small_ticket_data
|
1976
|
+
}
|
1977
|
+
};
|
1978
|
+
console.log('print_order_onOrderSynced_params>>>>', params);
|
1979
|
+
logger === null || logger === void 0 || logger.addLog({
|
1980
|
+
type: 'info',
|
1981
|
+
title: 'print_order_onOrderSynced_params',
|
1982
|
+
metadata: {
|
1983
|
+
params: params
|
1984
|
+
}
|
1985
|
+
});
|
1986
|
+
webPrint(params, function (res) {
|
1987
|
+
console.log('print_order_onOrderSynced_res>>>>', res);
|
1988
|
+
logger === null || logger === void 0 || logger.addLog({
|
1989
|
+
type: 'info',
|
1990
|
+
title: 'print_order_onOrderSynced_res',
|
1991
|
+
metadata: {
|
1992
|
+
res: res
|
1993
|
+
}
|
1994
|
+
});
|
1995
|
+
});
|
1996
|
+
} catch (error) {
|
1997
|
+
console.error('print_order_onOrderSynced_error>>>>', error);
|
1998
|
+
logger === null || logger === void 0 || logger.addLog({
|
1999
|
+
type: 'info',
|
2000
|
+
title: 'print_order_onOrderSynced_error',
|
2001
|
+
metadata: {
|
2002
|
+
error: error
|
2003
|
+
}
|
2004
|
+
});
|
1723
2005
|
}
|
1724
|
-
});
|
1725
|
-
});
|
1726
|
-
} catch (error) {
|
1727
|
-
console.error('print_order_onOrderSynced_error>>>>', error);
|
1728
|
-
logger === null || logger === void 0 || logger.addLog({
|
1729
|
-
type: 'info',
|
1730
|
-
title: 'print_order_onOrderSynced_error',
|
1731
|
-
metadata: {
|
1732
|
-
error: error
|
1733
|
-
}
|
1734
|
-
});
|
1735
|
-
}
|
1736
|
-
|
1737
|
-
// 确定支付状态
|
1738
|
-
var statusClassName = calculateStatusClassName(paymentStatus);
|
1739
|
-
var autoCloseConfig = calculateAutoCloseConfig(paymentStatus, !!currentChangeGivenAmount);
|
1740
2006
|
|
1741
|
-
|
1742
|
-
|
1743
|
-
|
1744
|
-
|
1745
|
-
|
1746
|
-
|
1747
|
-
|
1748
|
-
|
1749
|
-
|
2007
|
+
// 确定支付状态
|
2008
|
+
statusClassName = calculateStatusClassName(paymentStatus);
|
2009
|
+
autoCloseConfig = calculateAutoCloseConfig(paymentStatus, !!currentChangeGivenAmount);
|
2010
|
+
_context21.next = 19;
|
2011
|
+
return interaction === null || interaction === void 0 || (_interaction$utils4 = interaction.utils) === null || _interaction$utils4 === void 0 || (_interaction$utils4$a = _interaction$utils4.asyncDataManager) === null || _interaction$utils4$a === void 0 ? void 0 : _interaction$utils4$a.call(_interaction$utils4, {
|
2012
|
+
module: 'get',
|
2013
|
+
key: 'auto_print_receipt'
|
2014
|
+
});
|
2015
|
+
case 19:
|
2016
|
+
enabledAutoPrint = _context21.sent;
|
2017
|
+
_context21.next = 22;
|
2018
|
+
return displayPaymentResultToast({
|
2019
|
+
paymentStatus: paymentStatus,
|
2020
|
+
orderTotalAmount: orderTotalAmount,
|
2021
|
+
gapAmount: paymentStatus === 'partially_paid' ? gapAmount : currentChangeGivenAmount,
|
2022
|
+
failureReason: failureReason,
|
2023
|
+
autoCloseConfig: autoCloseConfig,
|
2024
|
+
actionButtons: generateActionButtons(paymentStatus, enabledAutoPrint)
|
2025
|
+
}, paymentResultToastConfig);
|
2026
|
+
case 22:
|
2027
|
+
// 当支付状态为 paid 时,关闭 paymentModal
|
2028
|
+
if (paymentStatus === 'paid') {
|
2029
|
+
handleModalClose();
|
2030
|
+
}
|
1750
2031
|
|
1751
|
-
|
1752
|
-
|
1753
|
-
|
1754
|
-
|
1755
|
-
|
1756
|
-
|
1757
|
-
|
2032
|
+
// 将支付结果信息传递给回调处理
|
2033
|
+
paymentResult = _objectSpread(_objectSpread({}, data), {}, {
|
2034
|
+
toastInfo: {
|
2035
|
+
status: paymentStatus,
|
2036
|
+
amount: orderTotalAmount,
|
2037
|
+
gapAmount: currentChangeGivenAmount,
|
2038
|
+
failureReason: failureReason
|
2039
|
+
}
|
2040
|
+
});
|
2041
|
+
handlePaymentComplete(paymentResult);
|
2042
|
+
_context21.next = 28;
|
2043
|
+
break;
|
2044
|
+
case 27:
|
2045
|
+
handlePaymentComplete(data);
|
2046
|
+
case 28:
|
2047
|
+
case "end":
|
2048
|
+
return _context21.stop();
|
1758
2049
|
}
|
1759
|
-
});
|
1760
|
-
|
1761
|
-
|
1762
|
-
|
1763
|
-
}
|
1764
|
-
|
1765
|
-
|
1766
|
-
});
|
1767
|
-
_context17.next = 29;
|
2050
|
+
}, _callee21);
|
2051
|
+
}));
|
2052
|
+
return function (_x17) {
|
2053
|
+
return _ref28.apply(this, arguments);
|
2054
|
+
};
|
2055
|
+
}());
|
2056
|
+
_context22.next = 29;
|
1768
2057
|
break;
|
1769
2058
|
case 18:
|
1770
2059
|
if (!isLocalOrderCreated.current) {
|
1771
|
-
|
2060
|
+
_context22.next = 29;
|
1772
2061
|
break;
|
1773
2062
|
}
|
1774
2063
|
// // 如果本地订单已创建,这时候还更新了 data,则需要销毁当前的订单数据,然后更新新的订单数据了
|
1775
2064
|
console.log('🔄 PaymentModal: data changed, updating checkout data...');
|
1776
2065
|
isLocalOrderCreated.current = false;
|
1777
|
-
|
2066
|
+
_context22.next = 23;
|
1778
2067
|
return checkout.cancelCurrentOrderAsync();
|
1779
2068
|
case 23:
|
1780
|
-
|
2069
|
+
_context22.next = 25;
|
1781
2070
|
return checkout.createLocalOrderAsync({
|
1782
2071
|
orderData: data === null || data === void 0 ? void 0 : data.order_info,
|
1783
2072
|
cartSummary: data === null || data === void 0 || (_data$subtotal_info = data.subtotal_info) === null || _data$subtotal_info === void 0 ? void 0 : _data$subtotal_info.subTotalList,
|
@@ -1793,27 +2082,27 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1793
2082
|
setOrderInfo(_orderInfo3);
|
1794
2083
|
isLocalOrderCreated.current = true;
|
1795
2084
|
case 29:
|
1796
|
-
|
2085
|
+
_context22.next = 35;
|
1797
2086
|
break;
|
1798
2087
|
case 31:
|
1799
|
-
|
1800
|
-
|
1801
|
-
console.error('Failed to initialize checkout data:',
|
2088
|
+
_context22.prev = 31;
|
2089
|
+
_context22.t0 = _context22["catch"](0);
|
2090
|
+
console.error('Failed to initialize checkout data:', _context22.t0);
|
1802
2091
|
logger === null || logger === void 0 || logger.addLog({
|
1803
2092
|
type: 'error',
|
1804
2093
|
title: 'Failed to initialize checkout data',
|
1805
2094
|
metadata: {
|
1806
|
-
error:
|
2095
|
+
error: _context22.t0
|
1807
2096
|
}
|
1808
2097
|
});
|
1809
2098
|
case 35:
|
1810
2099
|
case "end":
|
1811
|
-
return
|
2100
|
+
return _context22.stop();
|
1812
2101
|
}
|
1813
|
-
},
|
2102
|
+
}, _callee22, null, [[0, 31]]);
|
1814
2103
|
}));
|
1815
2104
|
return function initCheckoutData() {
|
1816
|
-
return
|
2105
|
+
return _ref27.apply(this, arguments);
|
1817
2106
|
};
|
1818
2107
|
}();
|
1819
2108
|
if (data) {
|
@@ -1842,36 +2131,35 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1842
2131
|
};
|
1843
2132
|
|
1844
2133
|
// 支付结果弹窗按钮生成函数
|
1845
|
-
var generateActionButtons = function generateActionButtons(paymentStatus) {
|
2134
|
+
var generateActionButtons = function generateActionButtons(paymentStatus, enabledAutoPrint) {
|
1846
2135
|
var getClassName = function getClassName(suffix) {
|
1847
2136
|
return "payment-result-toast-".concat(suffix);
|
1848
2137
|
};
|
1849
2138
|
|
1850
2139
|
// 通用回调函数
|
1851
2140
|
var handleDetailsClick = /*#__PURE__*/function () {
|
1852
|
-
var
|
2141
|
+
var _ref29 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
|
1853
2142
|
var _context$appHelper2;
|
1854
|
-
var _context$appHelper$
|
1855
|
-
return _regeneratorRuntime().wrap(function
|
1856
|
-
while (1) switch (
|
2143
|
+
var _context$appHelper$ut9, isTerminal, isWebPos, checkout, orderId;
|
2144
|
+
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
2145
|
+
while (1) switch (_context23.prev = _context23.next) {
|
1857
2146
|
case 0:
|
1858
2147
|
setTimeout(function () {
|
1859
|
-
//
|
2148
|
+
// 主动关闭PaymentResultToast
|
1860
2149
|
closePaymentResultToast();
|
1861
|
-
//
|
1862
|
-
handleToastClose();
|
2150
|
+
// 不关闭PaymentModal,保持其打开状态
|
1863
2151
|
}, 0);
|
1864
|
-
_context$appHelper$
|
2152
|
+
_context$appHelper$ut9 = (_context$appHelper2 = context.appHelper) === null || _context$appHelper2 === void 0 ? void 0 : _context$appHelper2.utils, isTerminal = _context$appHelper$ut9.isTerminal, isWebPos = _context$appHelper$ut9.isWebPos;
|
1865
2153
|
if (!(isTerminal !== null && isTerminal !== void 0 && isTerminal())) {
|
1866
|
-
|
2154
|
+
_context23.next = 8;
|
1867
2155
|
break;
|
1868
2156
|
}
|
1869
2157
|
checkout = pisellos.getModule('checkout');
|
1870
|
-
|
2158
|
+
_context23.next = 6;
|
1871
2159
|
return checkout.getCurrentOrderId();
|
1872
2160
|
case 6:
|
1873
|
-
orderId =
|
1874
|
-
return
|
2161
|
+
orderId = _context23.sent;
|
2162
|
+
return _context23.abrupt("return", interaction.utils.postMessageToApp({
|
1875
2163
|
module: 'booking',
|
1876
2164
|
key: 'view_order',
|
1877
2165
|
data: {
|
@@ -1881,50 +2169,55 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1881
2169
|
}));
|
1882
2170
|
case 8:
|
1883
2171
|
case "end":
|
1884
|
-
return
|
2172
|
+
return _context23.stop();
|
1885
2173
|
}
|
1886
|
-
},
|
2174
|
+
}, _callee23);
|
1887
2175
|
}));
|
1888
2176
|
return function handleDetailsClick() {
|
1889
|
-
return
|
2177
|
+
return _ref29.apply(this, arguments);
|
1890
2178
|
};
|
1891
2179
|
}();
|
1892
2180
|
var handlePrintReceiptClick = /*#__PURE__*/function () {
|
1893
|
-
var
|
2181
|
+
var _ref30 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee24() {
|
1894
2182
|
var checkoutModule, data, isSynced, orderId, params;
|
1895
|
-
return _regeneratorRuntime().wrap(function
|
1896
|
-
while (1) switch (
|
2183
|
+
return _regeneratorRuntime().wrap(function _callee24$(_context24) {
|
2184
|
+
while (1) switch (_context24.prev = _context24.next) {
|
1897
2185
|
case 0:
|
2186
|
+
setTimeout(function () {
|
2187
|
+
// 主动关闭PaymentResultToast
|
2188
|
+
closePaymentResultToast();
|
2189
|
+
// 不关闭PaymentModal,保持其打开状态
|
2190
|
+
}, 0);
|
1898
2191
|
checkoutModule = pisellos === null || pisellos === void 0 ? void 0 : pisellos.getModule('checkout');
|
1899
2192
|
if (checkoutModule) {
|
1900
|
-
|
2193
|
+
_context24.next = 4;
|
1901
2194
|
break;
|
1902
2195
|
}
|
1903
|
-
return
|
1904
|
-
case
|
1905
|
-
|
2196
|
+
return _context24.abrupt("return");
|
2197
|
+
case 4:
|
2198
|
+
_context24.next = 6;
|
1906
2199
|
return checkoutModule.isCurrentOrderSynced();
|
1907
|
-
case
|
1908
|
-
isSynced =
|
2200
|
+
case 6:
|
2201
|
+
isSynced = _context24.sent;
|
1909
2202
|
if (isSynced) {
|
1910
|
-
|
2203
|
+
_context24.next = 13;
|
1911
2204
|
break;
|
1912
2205
|
}
|
1913
|
-
|
2206
|
+
_context24.next = 10;
|
1914
2207
|
return checkoutModule.manualSyncOrderAsync();
|
1915
|
-
case
|
1916
|
-
data =
|
1917
|
-
|
2208
|
+
case 10:
|
2209
|
+
data = _context24.sent;
|
2210
|
+
_context24.next = 17;
|
1918
2211
|
break;
|
1919
|
-
case
|
1920
|
-
|
2212
|
+
case 13:
|
2213
|
+
_context24.next = 15;
|
1921
2214
|
return checkoutModule.getCurrentOrderId();
|
1922
|
-
case
|
1923
|
-
orderId =
|
2215
|
+
case 15:
|
2216
|
+
orderId = _context24.sent;
|
1924
2217
|
data = {
|
1925
2218
|
orderId: orderId
|
1926
2219
|
};
|
1927
|
-
case
|
2220
|
+
case 17:
|
1928
2221
|
// data.orderId 就是订单号,可以用来打印小票
|
1929
2222
|
if (data.orderId) {
|
1930
2223
|
params = {
|
@@ -1944,14 +2237,14 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1944
2237
|
console.error('handleButtonClick_print-receipt_error>>>>', error);
|
1945
2238
|
}
|
1946
2239
|
}
|
1947
|
-
case
|
2240
|
+
case 18:
|
1948
2241
|
case "end":
|
1949
|
-
return
|
2242
|
+
return _context24.stop();
|
1950
2243
|
}
|
1951
|
-
},
|
2244
|
+
}, _callee24);
|
1952
2245
|
}));
|
1953
2246
|
return function handlePrintReceiptClick() {
|
1954
|
-
return
|
2247
|
+
return _ref30.apply(this, arguments);
|
1955
2248
|
};
|
1956
2249
|
}();
|
1957
2250
|
var handleRetryClick = function handleRetryClick() {
|
@@ -1978,6 +2271,9 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1978
2271
|
closePaymentResultToast();
|
1979
2272
|
};
|
1980
2273
|
var handleOrderNoteClick = function handleOrderNoteClick() {
|
2274
|
+
setTimeout(function () {
|
2275
|
+
closePaymentResultToast();
|
2276
|
+
}, 0);
|
1981
2277
|
console.log(locales.getText('payment.result.actions.orderNoteClicked'));
|
1982
2278
|
// 从支付结果toast打开NoteModal,使用传入的回调函数
|
1983
2279
|
if (handleOrderNoteClickFromToast) {
|
@@ -1991,7 +2287,7 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1991
2287
|
switch (paymentStatus) {
|
1992
2288
|
case 'paid':
|
1993
2289
|
// 成功状态,显示查看详情和打印收据按钮
|
1994
|
-
return [[{
|
2290
|
+
return [[enabledAutoPrint ? {
|
1995
2291
|
id: 'details',
|
1996
2292
|
buttonProps: {
|
1997
2293
|
className: getClassName('action-button'),
|
@@ -2001,7 +2297,7 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
2001
2297
|
}),
|
2002
2298
|
children: locales.getText('payment.result.details')
|
2003
2299
|
}
|
2004
|
-
}
|
2300
|
+
} : {
|
2005
2301
|
id: 'print',
|
2006
2302
|
buttonProps: {
|
2007
2303
|
className: getClassName('action-button'),
|
@@ -2032,20 +2328,14 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
2032
2328
|
case 'partially_paid':
|
2033
2329
|
// 部分支付状态
|
2034
2330
|
return [[{
|
2035
|
-
id: '
|
2036
|
-
buttonProps: {
|
2037
|
-
className: getClassName('action-button'),
|
2038
|
-
onClick: handleSaveAsPartialPaidClick,
|
2039
|
-
children: locales.getText('payment.result.saveAsPartialPaid')
|
2040
|
-
}
|
2041
|
-
}, {
|
2042
|
-
id: 'continuePayment',
|
2331
|
+
id: 'details',
|
2043
2332
|
buttonProps: {
|
2044
2333
|
className: getClassName('action-button'),
|
2045
|
-
onClick:
|
2046
|
-
|
2047
|
-
|
2048
|
-
|
2334
|
+
onClick: handleDetailsClick,
|
2335
|
+
icon: /*#__PURE__*/React.createElement(FileCheck02, {
|
2336
|
+
className: getClassName('action-icon')
|
2337
|
+
}),
|
2338
|
+
children: locales.getText('payment.result.details')
|
2049
2339
|
}
|
2050
2340
|
}, {
|
2051
2341
|
id: 'more',
|
@@ -2174,7 +2464,7 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
2174
2464
|
|
2175
2465
|
// 使用新的工具方法创建showSuccessToast函数
|
2176
2466
|
var showSuccessToast = createShowSuccessToast(paymentResultToastConfig, generateActionButtons);
|
2177
|
-
return /*#__PURE__*/React.createElement(
|
2467
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement(PisellContainer
|
2178
2468
|
// open={open}
|
2179
2469
|
, {
|
2180
2470
|
renderType: "modal",
|
@@ -2188,10 +2478,9 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
2188
2478
|
destroyOnClose: false,
|
2189
2479
|
maskClosable: false,
|
2190
2480
|
footer: null,
|
2191
|
-
closeIcon:
|
2481
|
+
closeIcon: false,
|
2192
2482
|
wrapClassName: "payment-modal-wrapper ".concat(!actualShowCashPayment ? 'no-cash-payment' : ''),
|
2193
2483
|
size: 'large',
|
2194
|
-
headerDivider: false,
|
2195
2484
|
style: {
|
2196
2485
|
height: 'auto'
|
2197
2486
|
},
|
@@ -2199,7 +2488,7 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
2199
2488
|
maxHeight: '100%',
|
2200
2489
|
// 使用100%基于父元素,而不是视口的90%
|
2201
2490
|
overflowY: 'auto',
|
2202
|
-
padding:
|
2491
|
+
padding: 16,
|
2203
2492
|
display: 'flex',
|
2204
2493
|
flexDirection: 'column'
|
2205
2494
|
}
|