@pisell/private-materials 6.7.9 → 6.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +7 -7
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +9 -9
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +9 -9
- package/es/components/appointmentBooking/components/Voucher/index.js +2 -1
- package/es/components/booking/addons/index.js +25 -17
- package/es/components/booking/components/footer/amount.d.ts +1 -0
- package/es/components/booking/components/footer/amount.js +548 -84
- package/es/components/booking/components/footer/index.js +77 -56
- package/es/components/booking/components/footer/utils.d.ts +19 -0
- package/es/components/booking/components/footer/utils.js +194 -73
- package/es/components/booking/components/voucher/index.js +23 -7
- package/es/components/booking/hooks/useQuotation.js +4 -1
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/es/components/booking/info/service2/utils.js +1 -0
- package/es/components/booking/info2/cartClientCard/index.js +30 -6
- package/es/components/booking/info2/index.js +1 -1
- package/es/components/booking/info2/service/addService/index.js +2 -3
- package/es/components/booking/info2/service/editNormalService/index.js +6 -0
- package/es/components/booking/info2/service/editService/index.js +16 -6
- package/es/components/booking/info2/service/editService/utils.d.ts +15 -0
- package/es/components/booking/info2/service/editService/utils.js +66 -0
- package/es/components/booking/utils.d.ts +1 -0
- package/es/components/booking/utils.js +16 -3
- package/es/components/checkout/PaymentModal.d.ts +13 -5
- package/es/components/checkout/PaymentModal.js +304 -252
- package/es/components/checkout/components/AdditionalModule/index.d.ts +3 -1
- package/es/components/checkout/components/AdditionalModule/index.js +52 -12
- package/es/components/checkout/components/AmountSummary/index.js +9 -76
- package/es/components/checkout/components/AmountSummary/index.less +5 -6
- package/es/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
- package/es/components/checkout/components/CashPaymentModule/index.js +5 -2
- package/es/components/checkout/components/PaymentDetailModal/index.js +2 -2
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +2 -0
- package/es/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +6 -1
- package/es/components/checkout/components/PaymentOptionsModule/index.d.ts +1 -0
- package/es/components/checkout/components/PaymentOptionsModule/index.js +2 -1
- package/es/components/checkout/components/PaymentOptionsModule/index.less +4 -0
- package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts +4 -0
- package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +31 -8
- package/es/components/checkout/components/PaymentResultToast/index.js +6 -6
- package/es/components/checkout/components/PaymentResultToast/index.less +94 -33
- package/es/components/checkout/components/SearchAndClientModule/index.js +39 -40
- package/es/components/checkout/index.less +1 -1
- package/es/components/checkout/locales.d.ts +6 -0
- package/es/components/checkout/locales.js +6 -0
- package/es/components/checkout/plugin.d.ts +2 -0
- package/es/components/checkout/plugin.js +303 -0
- package/es/components/checkout/utils/PaymentResultToastUtils.d.ts +0 -1
- package/es/components/checkout/utils/PaymentResultToastUtils.js +11 -1
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftposPay/hooks.d.ts +1 -1
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +14 -6
- package/es/components/eftposPay/payo/config.js +70 -32
- package/es/components/eftposPay/payo/payment.d.ts +66 -0
- package/es/components/eftposPay/payo/payment.js +579 -0
- package/es/components/eftposPay/store/index.d.ts +4 -4
- package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/es/components/eftposPay/tyro/index.js +12 -0
- package/es/components/eftposPay/utils/log/index.d.ts +110 -0
- package/es/components/eftposPay/utils/log/index.js +371 -0
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/es/components/index.d.ts +2 -1
- package/es/components/index.js +2 -1
- package/es/components/list/List.js +99 -56
- package/es/components/list/hooks/useListState.d.ts +5 -3
- package/es/components/list/hooks/useListState.js +10 -2
- package/es/components/list/styles/base.less +4 -0
- package/es/components/list/styles/content.less +1 -1
- package/es/components/list/styles/header.less +4 -4
- package/es/components/list/types.d.ts +1 -0
- package/es/components/list/utils/index.d.ts +13 -1
- package/es/components/list/utils/index.js +43 -1
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +14 -12
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/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/PageLoading/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
- package/es/components/pay/toC/PaymentMethods/WalletPass/utils.js +4 -2
- package/es/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.js +2 -0
- package/es/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.less +13 -3
- package/es/components/pay/toC/index.js +7 -4
- package/es/components/pay/toC/locales.d.ts +3 -0
- package/es/components/pay/toC/locales.js +6 -3
- package/es/components/pay/toC/status.d.ts +1 -0
- package/es/components/pay/toC/status.js +3 -0
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/es/components/subTotal/index.js +1 -1
- package/es/components/systemSettings/registry/components/GroupModal.d.ts +4 -0
- package/es/components/{checkout/PaymentPlugin.js → systemSettings/registry/components/GroupModal.js} +132 -171
- package/es/components/systemSettings/registry/components/ItemModal.d.ts +4 -0
- package/es/components/systemSettings/registry/components/ItemModal.js +547 -0
- package/es/components/systemSettings/registry/components/ModuleList.d.ts +4 -0
- package/es/components/systemSettings/registry/components/ModuleList.js +54 -0
- package/es/components/systemSettings/registry/components/SectionList.d.ts +4 -0
- package/es/components/systemSettings/registry/components/SectionList.js +174 -0
- package/es/components/systemSettings/registry/components/SettingsTable.d.ts +4 -0
- package/es/components/systemSettings/registry/components/SettingsTable.js +765 -0
- package/es/components/systemSettings/registry/components/index.d.ts +4 -0
- package/es/components/systemSettings/registry/components/index.js +4 -0
- package/es/components/systemSettings/registry/index.d.ts +5 -0
- package/es/components/systemSettings/registry/index.js +1059 -0
- package/es/components/systemSettings/registry/index.less +410 -0
- package/es/components/systemSettings/registry/locales.d.ts +272 -0
- package/es/components/systemSettings/registry/locales.js +300 -0
- package/es/components/systemSettings/registry/services.d.ts +77 -0
- package/es/components/systemSettings/registry/services.js +472 -0
- package/es/components/systemSettings/registry/types.d.ts +126 -0
- package/es/components/systemSettings/registry/types.js +1 -0
- package/es/components/systemSettings/registry/utils/typeValidation.d.ts +16 -0
- package/es/components/systemSettings/registry/utils/typeValidation.js +284 -0
- package/es/components/systemSettings/registry/utils/validators.d.ts +8 -0
- package/es/components/systemSettings/registry/utils/validators.js +44 -0
- package/es/components/ticketBooking/components/ProductDisplayAdapter/ProductDisplayAdapter.js +58 -11
- package/es/components/ticketBooking/components/ProductDisplayAdapter/index.less +28 -1
- package/es/components/ticketBooking/components/ProductDisplayAdapter/utils.d.ts +35 -2
- package/es/components/ticketBooking/components/ProductDisplayAdapter/utils.js +149 -36
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +2 -86
- package/es/components/ticketBooking/components/menuBar/index.js +109 -12
- package/es/components/ticketBooking/components/ticketBooking/index.js +2 -2
- package/es/components/ticketBooking/components/timeBar/index.js +112 -7
- package/es/components/ticketBooking/components/timeBar/index.less +59 -0
- package/es/components/ticketBooking/hooks/pisellos/useProducts.js +29 -18
- package/es/components/ticketBooking/locales.d.ts +9 -0
- package/es/components/ticketBooking/locales.js +12 -3
- package/es/components/ticketBooking/utils/index.d.ts +3 -0
- package/es/components/ticketBooking/utils/index.js +36 -13
- package/es/components/wallet/Detail/index.js +34 -2
- package/es/components/wallet/Detail/index.less +11 -0
- package/es/components/wallet/Detail/locales.d.ts +6 -0
- package/es/components/wallet/Detail/locales.js +14 -2
- package/es/components/wallet/Voucher/index.js +11 -10
- package/es/components/wallet/components/WalletCard.js +5 -1
- package/es/components/wallet/index.js +4 -2
- package/es/components/wallet/serve.d.ts +7 -0
- package/es/components/wallet/utils.d.ts +48 -0
- package/es/components/wallet/utils.js +342 -0
- package/es/index.d.ts +5 -0
- package/es/index.js +6 -1
- package/es/plus/clientCard/locales.js +3 -3
- package/es/plus/clinetSearch/index.js +28 -30
- package/es/plus/clinetSearch/locales.d.ts +3 -0
- package/es/plus/clinetSearch/locales.js +7 -4
- package/es/plus/clinetSearch/types.d.ts +12 -0
- package/es/plus/productSelect/CategoryTabs/index.d.ts +1 -0
- package/es/plus/productSelect/CategoryTabs/index.js +2 -1
- package/es/plus/walletPassGallery/components/footerButton/index.js +2 -4
- package/es/plus/walletPassGallery/components/footerButton/index.less +14 -59
- package/es/plus/walletPassGallery/components/passDetail/index.d.ts +1 -0
- package/es/plus/walletPassGallery/components/passDetail/index.js +84 -31
- package/es/plus/walletPassGallery/components/passDetail/index.less +4 -0
- package/es/plus/walletPassGallery/components/recharge/index.js +19 -8
- package/es/plus/walletPassGallery/index.js +7 -3
- package/es/plus/walletPassGallery/serve.d.ts +3 -0
- package/es/plus/walletPassGallery/serve.js +4 -2
- package/es/pro/Login2.0/index.less +15 -8
- package/es/pro/Selector/BatchSelectorDemo.d.ts +3 -0
- package/es/pro/Selector/BatchSelectorDemo.js +470 -0
- package/es/pro/Selector/Selector.d.ts +5 -0
- package/es/pro/Selector/Selector.js +283 -0
- package/es/pro/Selector/SelectorGroup.d.ts +11 -0
- package/es/pro/Selector/SelectorGroup.js +537 -0
- package/es/pro/Selector/components/Card/index.d.ts +27 -0
- package/es/pro/Selector/components/Card/index.js +96 -0
- package/es/pro/Selector/components/Card/index.less +132 -0
- package/es/pro/Selector/components/IntersectionObserver.d.ts +105 -0
- package/es/pro/Selector/components/IntersectionObserver.js +384 -0
- package/es/pro/Selector/components/NumericStepper/index.d.ts +41 -0
- package/es/pro/Selector/components/NumericStepper/index.js +198 -0
- package/es/pro/Selector/components/NumericStepper/index.less +221 -0
- package/es/pro/Selector/components/index.d.ts +2 -0
- package/es/pro/Selector/components/index.js +2 -0
- package/es/pro/Selector/demo.d.ts +3 -0
- package/es/pro/Selector/demo.js +158 -0
- package/es/pro/Selector/hooks/useSelectionController.d.ts +42 -0
- package/es/pro/Selector/hooks/useSelectionController.js +414 -0
- package/es/pro/Selector/index.d.ts +8 -0
- package/es/pro/Selector/index.js +5 -0
- package/es/pro/Selector/locales.d.ts +42 -0
- package/es/pro/Selector/locales.js +80 -0
- package/es/pro/Selector/selector.less +3 -0
- package/es/pro/Selector/selectorGroup.less +8 -0
- package/es/pro/Selector/types.d.ts +114 -0
- package/es/pro/Selector/types.js +1 -0
- package/es/pro/Selector/utils/index.d.ts +49 -0
- package/es/pro/Selector/utils/index.js +229 -0
- package/es/pro/comprehensiveSearch/components/searchSection/locales.js +3 -3
- package/es/pro/comprehensiveSearch/locales.js +1 -1
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +45 -36
- package/es/pro/priceKeyboard/components/cashKeyboard/index.d.ts +1 -0
- package/es/pro/priceKeyboard/components/cashKeyboard/index.js +4 -2
- package/es/pro/priceKeyboard/components/cashKeyboard/types.d.ts +1 -0
- package/es/pro/priceKeyboard/components/discountKeyboard/index.js +10 -1
- package/es/pro/priceKeyboard/components/discountKeyboard/index.less +14 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.d.ts +1 -0
- package/es/pro/priceKeyboard/components/shortcuts/index.js +5 -2
- package/es/pro/priceKeyboard/components/shortcuts/index.less +4 -0
- package/lib/components/appointmentBooking/components/Voucher/index.js +2 -1
- package/lib/components/booking/addons/index.js +15 -7
- package/lib/components/booking/components/footer/amount.d.ts +1 -0
- package/lib/components/booking/components/footer/amount.js +293 -41
- package/lib/components/booking/components/footer/index.js +30 -11
- package/lib/components/booking/components/footer/utils.d.ts +19 -0
- package/lib/components/booking/components/footer/utils.js +138 -41
- package/lib/components/booking/components/voucher/index.js +25 -9
- package/lib/components/booking/hooks/useQuotation.js +2 -1
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/lib/components/booking/info/service2/utils.js +1 -0
- package/lib/components/booking/info2/cartClientCard/index.js +25 -5
- package/lib/components/booking/info2/index.js +7 -2
- package/lib/components/booking/info2/service/addService/index.js +1 -2
- package/lib/components/booking/info2/service/editNormalService/index.js +6 -0
- package/lib/components/booking/info2/service/editService/index.js +12 -3
- package/lib/components/booking/info2/service/editService/utils.d.ts +15 -0
- package/lib/components/booking/info2/service/editService/utils.js +40 -3
- package/lib/components/booking/utils.d.ts +1 -0
- package/lib/components/booking/utils.js +11 -0
- package/lib/components/checkout/PaymentModal.d.ts +13 -5
- package/lib/components/checkout/PaymentModal.js +190 -147
- package/lib/components/checkout/components/AdditionalModule/index.d.ts +3 -1
- package/lib/components/checkout/components/AdditionalModule/index.js +52 -11
- package/lib/components/checkout/components/AmountSummary/index.js +5 -46
- package/lib/components/checkout/components/AmountSummary/index.less +5 -6
- package/lib/components/checkout/components/CashPaymentModule/index.d.ts +3 -1
- package/lib/components/checkout/components/CashPaymentModule/index.js +5 -2
- package/lib/components/checkout/components/PaymentDetailModal/index.js +2 -2
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.d.ts +2 -0
- package/lib/components/checkout/components/PaymentOptionsModule/PaymentMethodItem.js +5 -1
- package/lib/components/checkout/components/PaymentOptionsModule/index.d.ts +1 -0
- package/lib/components/checkout/components/PaymentOptionsModule/index.js +6 -0
- package/lib/components/checkout/components/PaymentOptionsModule/index.less +4 -0
- package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.d.ts +4 -0
- package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +23 -5
- package/lib/components/checkout/components/PaymentResultToast/index.js +4 -4
- package/lib/components/checkout/components/PaymentResultToast/index.less +94 -33
- package/lib/components/checkout/components/SearchAndClientModule/index.js +29 -3
- package/lib/components/checkout/index.less +1 -1
- package/lib/components/checkout/locales.d.ts +6 -0
- package/lib/components/checkout/locales.js +6 -0
- package/lib/components/checkout/plugin.d.ts +2 -0
- package/lib/components/checkout/plugin.js +263 -0
- package/lib/components/checkout/utils/PaymentResultToastUtils.d.ts +0 -1
- package/lib/components/checkout/utils/PaymentResultToastUtils.js +11 -1
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftposPay/hooks.d.ts +1 -1
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +12 -6
- package/lib/components/eftposPay/payo/config.js +98 -73
- package/lib/components/eftposPay/payo/payment.d.ts +66 -0
- package/lib/components/eftposPay/payo/payment.js +357 -0
- package/lib/components/eftposPay/store/index.d.ts +4 -4
- package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/lib/components/eftposPay/tyro/index.js +12 -0
- package/lib/components/eftposPay/utils/log/index.d.ts +110 -0
- package/lib/components/eftposPay/utils/log/index.js +294 -0
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateStatus/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/DayItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Item/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/Status/index.d.ts +0 -1
- package/lib/components/index.d.ts +2 -1
- package/lib/components/index.js +3 -0
- package/lib/components/list/List.js +58 -36
- package/lib/components/list/hooks/useListState.d.ts +5 -3
- package/lib/components/list/hooks/useListState.js +9 -1
- package/lib/components/list/styles/base.less +4 -0
- package/lib/components/list/styles/content.less +1 -1
- package/lib/components/list/styles/header.less +4 -4
- package/lib/components/list/types.d.ts +1 -0
- package/lib/components/list/utils/index.d.ts +13 -1
- package/lib/components/list/utils/index.js +27 -0
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +14 -12
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/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/PageLoading/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/WalletPass/serve.d.ts +6 -0
- package/lib/components/pay/toC/PaymentMethods/WalletPass/utils.js +4 -2
- package/lib/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.js +1 -1
- package/lib/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.less +13 -3
- package/lib/components/pay/toC/index.js +4 -1
- package/lib/components/pay/toC/locales.d.ts +3 -0
- package/lib/components/pay/toC/locales.js +6 -3
- package/lib/components/pay/toC/status.d.ts +1 -0
- package/lib/components/pay/toC/status.js +5 -0
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/lib/components/subTotal/index.js +1 -1
- package/lib/components/systemSettings/registry/components/GroupModal.d.ts +4 -0
- package/lib/components/systemSettings/registry/components/GroupModal.js +177 -0
- package/lib/components/systemSettings/registry/components/ItemModal.d.ts +4 -0
- package/lib/components/systemSettings/registry/components/ItemModal.js +508 -0
- package/lib/components/systemSettings/registry/components/ModuleList.d.ts +4 -0
- package/lib/components/systemSettings/registry/components/ModuleList.js +71 -0
- package/lib/components/systemSettings/registry/components/SectionList.d.ts +4 -0
- package/lib/components/systemSettings/registry/components/SectionList.js +181 -0
- package/lib/components/systemSettings/registry/components/SettingsTable.d.ts +4 -0
- package/lib/components/systemSettings/registry/components/SettingsTable.js +575 -0
- package/lib/components/systemSettings/registry/components/index.d.ts +4 -0
- package/lib/components/systemSettings/registry/components/index.js +48 -0
- package/lib/components/systemSettings/registry/index.d.ts +5 -0
- package/lib/components/systemSettings/registry/index.js +529 -0
- package/lib/components/systemSettings/registry/index.less +410 -0
- package/lib/components/systemSettings/registry/locales.d.ts +272 -0
- package/lib/components/systemSettings/registry/locales.js +324 -0
- package/lib/components/systemSettings/registry/services.d.ts +77 -0
- package/lib/components/systemSettings/registry/services.js +290 -0
- package/lib/components/systemSettings/registry/types.d.ts +126 -0
- package/lib/components/systemSettings/registry/types.js +17 -0
- package/lib/components/systemSettings/registry/utils/typeValidation.d.ts +16 -0
- package/lib/components/systemSettings/registry/utils/typeValidation.js +228 -0
- package/lib/components/systemSettings/registry/utils/validators.d.ts +8 -0
- package/lib/components/systemSettings/registry/utils/validators.js +54 -0
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/ProductDisplayAdapter.js +40 -5
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/index.less +28 -1
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/utils.d.ts +35 -2
- package/lib/components/ticketBooking/components/ProductDisplayAdapter/utils.js +93 -24
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +0 -1
- package/lib/components/ticketBooking/components/menuBar/index.js +42 -6
- package/lib/components/ticketBooking/components/ticketBooking/index.js +2 -2
- package/lib/components/ticketBooking/components/timeBar/index.js +105 -4
- package/lib/components/ticketBooking/components/timeBar/index.less +59 -0
- package/lib/components/ticketBooking/hooks/pisellos/useProducts.js +17 -13
- package/lib/components/ticketBooking/locales.d.ts +9 -0
- package/lib/components/ticketBooking/locales.js +12 -3
- package/lib/components/ticketBooking/utils/index.d.ts +3 -0
- package/lib/components/ticketBooking/utils/index.js +20 -6
- package/lib/components/wallet/Detail/index.js +31 -3
- package/lib/components/wallet/Detail/index.less +11 -0
- package/lib/components/wallet/Detail/locales.d.ts +6 -0
- package/lib/components/wallet/Detail/locales.js +14 -2
- package/lib/components/wallet/Voucher/index.js +8 -8
- package/lib/components/wallet/components/WalletCard.js +4 -0
- package/lib/components/wallet/index.js +2 -2
- package/lib/components/wallet/serve.d.ts +7 -0
- package/lib/components/wallet/utils.d.ts +48 -0
- package/lib/components/wallet/utils.js +287 -0
- package/lib/index.d.ts +5 -0
- package/lib/index.js +15 -0
- package/lib/plus/clientCard/locales.js +3 -3
- package/lib/plus/clinetSearch/index.js +17 -8
- package/lib/plus/clinetSearch/locales.d.ts +3 -0
- package/lib/plus/clinetSearch/locales.js +7 -4
- package/lib/plus/clinetSearch/types.d.ts +12 -0
- package/lib/plus/productSelect/CategoryTabs/index.d.ts +1 -0
- package/lib/plus/productSelect/CategoryTabs/index.js +2 -1
- package/lib/plus/walletPassGallery/components/footerButton/index.js +2 -2
- package/lib/plus/walletPassGallery/components/footerButton/index.less +14 -59
- package/lib/plus/walletPassGallery/components/passDetail/index.d.ts +1 -0
- package/lib/plus/walletPassGallery/components/passDetail/index.js +54 -15
- package/lib/plus/walletPassGallery/components/passDetail/index.less +4 -0
- package/lib/plus/walletPassGallery/components/recharge/index.js +7 -1
- package/lib/plus/walletPassGallery/index.js +7 -3
- package/lib/plus/walletPassGallery/serve.d.ts +3 -0
- package/lib/plus/walletPassGallery/serve.js +3 -2
- package/lib/pro/Login2.0/index.less +15 -8
- package/lib/pro/Selector/BatchSelectorDemo.d.ts +3 -0
- package/lib/pro/Selector/BatchSelectorDemo.js +376 -0
- package/lib/pro/Selector/Selector.d.ts +5 -0
- package/lib/pro/Selector/Selector.js +264 -0
- package/lib/pro/Selector/SelectorGroup.d.ts +11 -0
- package/lib/pro/Selector/SelectorGroup.js +463 -0
- package/lib/pro/Selector/components/Card/index.d.ts +27 -0
- package/lib/pro/Selector/components/Card/index.js +114 -0
- package/lib/pro/Selector/components/Card/index.less +132 -0
- package/lib/pro/Selector/components/IntersectionObserver.d.ts +105 -0
- package/lib/pro/Selector/components/IntersectionObserver.js +281 -0
- package/lib/pro/Selector/components/NumericStepper/index.d.ts +41 -0
- package/lib/pro/Selector/components/NumericStepper/index.js +221 -0
- package/lib/pro/Selector/components/NumericStepper/index.less +221 -0
- package/lib/pro/Selector/components/index.d.ts +2 -0
- package/lib/pro/Selector/components/index.js +42 -0
- package/lib/pro/Selector/demo.d.ts +3 -0
- package/lib/pro/Selector/demo.js +102 -0
- package/lib/pro/Selector/hooks/useSelectionController.d.ts +42 -0
- package/lib/pro/Selector/hooks/useSelectionController.js +338 -0
- package/lib/pro/Selector/index.d.ts +8 -0
- package/lib/pro/Selector/index.js +39 -0
- package/lib/pro/Selector/locales.d.ts +42 -0
- package/lib/pro/Selector/locales.js +80 -0
- package/lib/pro/Selector/selector.less +3 -0
- package/lib/pro/Selector/selectorGroup.less +8 -0
- package/lib/pro/Selector/types.d.ts +114 -0
- package/lib/pro/Selector/types.js +17 -0
- package/lib/pro/Selector/utils/index.d.ts +49 -0
- package/lib/pro/Selector/utils/index.js +221 -0
- package/lib/pro/comprehensiveSearch/components/searchSection/locales.js +3 -3
- package/lib/pro/comprehensiveSearch/locales.js +1 -1
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +42 -43
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/cashKeyboard/index.js +3 -2
- package/lib/pro/priceKeyboard/components/cashKeyboard/types.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.js +8 -1
- package/lib/pro/priceKeyboard/components/discountKeyboard/index.less +14 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.d.ts +1 -0
- package/lib/pro/priceKeyboard/components/shortcuts/index.js +3 -2
- package/lib/pro/priceKeyboard/components/shortcuts/index.less +4 -0
- package/lowcode/payment-modal/meta.ts +135 -0
- package/lowcode/selector/meta.ts +352 -0
- package/lowcode/selector.group/meta.ts +200 -0
- package/lowcode/settings-registry/meta.ts +29 -0
- package/lowcode/wallet-pass-detail/meta.ts +89 -0
- package/package.json +4 -4
- package/es/components/checkout/PaymentPlugin.d.ts +0 -3
- package/lib/components/checkout/PaymentPlugin.d.ts +0 -3
- package/lib/components/checkout/PaymentPlugin.js +0 -181
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
|
2
2
|
function _extends() { _extends = Object.assign ? Object.assign.bind() : function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
3
|
-
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
4
3
|
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
5
4
|
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
6
5
|
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
@@ -30,10 +29,9 @@ import SendPaymentLinkModal from "./components/SendPaymentLinkModal";
|
|
|
30
29
|
import AmountSummary from "./components/AmountSummary/index";
|
|
31
30
|
import SavePayLaterHandler from "./components/SavePayLaterHandler";
|
|
32
31
|
import WalletPassModule from "./components/WalletPassModule";
|
|
33
|
-
import PaymentOptionsModule from "./components/PaymentOptionsModule";
|
|
32
|
+
import PaymentOptionsModule, { SHOW_METHODS_CODE } from "./components/PaymentOptionsModule";
|
|
34
33
|
import CashPaymentModule from "./components/CashPaymentModule";
|
|
35
34
|
import AdditionalModule from "./components/AdditionalModule";
|
|
36
|
-
import { getSumTotal } from "../booking/components/footer/amount";
|
|
37
35
|
import { closePaymentResultToast, closeAllPaymentResultToasts, setTillButton } from "./components/PaymentResultToast";
|
|
38
36
|
import { formatCurrency, calculateStatusClassName, calculateAutoCloseConfig, displayPaymentResultToast, createShowSuccessToast } from "./utils/PaymentResultToastUtils";
|
|
39
37
|
import { Printer, FileCheck02, RefreshCw05, CreditCard02, MessageTextSquare02, ArrowLeft, DotsVertical } from '@pisell/icon';
|
|
@@ -47,7 +45,7 @@ import { getShopWalletPassId, reorderPaymentMethodList } from "./utils";
|
|
|
47
45
|
import usePaymentLogger from "./hooks/usePaymentLogger";
|
|
48
46
|
import { Button } from 'antd';
|
|
49
47
|
import usePrinter from "../../hooks/printer";
|
|
50
|
-
import { DiscountKeyboard } from "../../pro/priceKeyboard";
|
|
48
|
+
import { DiscountKeyboard, PaymentKeyboard } from "../../pro/priceKeyboard";
|
|
51
49
|
import { useActiveExecute } from "../ticketBooking/hooks/pisellos";
|
|
52
50
|
|
|
53
51
|
// Checkout 模块的事件常量
|
|
@@ -66,15 +64,13 @@ var CheckoutHooks = {
|
|
|
66
64
|
|
|
67
65
|
// 支付弹窗主体内容组件
|
|
68
66
|
var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
69
|
-
var _parentModuleConfig$s
|
|
67
|
+
var _parentModuleConfig$s;
|
|
70
68
|
var cartData = _ref.cartData,
|
|
71
69
|
orderInfo = _ref.orderInfo,
|
|
72
70
|
isModalOpen = _ref.isModalOpen,
|
|
73
71
|
onPaymentComplete = _ref.onPaymentComplete,
|
|
74
72
|
onPaymentCancel = _ref.onPaymentCancel,
|
|
75
73
|
onStatusChange = _ref.onStatusChange,
|
|
76
|
-
dispatch = _ref.dispatch,
|
|
77
|
-
state = _ref.state,
|
|
78
74
|
showingCashToastRef = _ref.showingCashToastRef,
|
|
79
75
|
onToastClose = _ref.onToastClose,
|
|
80
76
|
orderNote = _ref.orderNote,
|
|
@@ -92,7 +88,16 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
92
88
|
generateActionButtons = _ref.generateActionButtons,
|
|
93
89
|
paymentResultToastConfig = _ref.paymentResultToastConfig,
|
|
94
90
|
updateOrderInfo = _ref.updateOrderInfo,
|
|
95
|
-
setCurrentEditOrderId = _ref.setCurrentEditOrderId
|
|
91
|
+
setCurrentEditOrderId = _ref.setCurrentEditOrderId,
|
|
92
|
+
config = _ref.config,
|
|
93
|
+
paymentResultDisplayMode = _ref.paymentResultDisplayMode,
|
|
94
|
+
shopDiscount = _ref.shopDiscount,
|
|
95
|
+
client = _ref.client,
|
|
96
|
+
currentTotalPrice = _ref.currentTotalPrice,
|
|
97
|
+
onChangeShopDiscount = _ref.onChangeShopDiscount,
|
|
98
|
+
onChangeOrderNote = _ref.onChangeOrderNote,
|
|
99
|
+
onDeleteOrderNote = _ref.onDeleteOrderNote,
|
|
100
|
+
any = _ref.config;
|
|
96
101
|
var context = useEngineContext();
|
|
97
102
|
var utils = context.appHelper.utils || {};
|
|
98
103
|
var pisellos = utils.pisellos,
|
|
@@ -125,37 +130,46 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
125
130
|
_useState8 = _slicedToArray(_useState7, 2),
|
|
126
131
|
recommendAmounts = _useState8[0],
|
|
127
132
|
setRecommendAmounts = _useState8[1];
|
|
128
|
-
var
|
|
129
|
-
var _useState9 = useState([]),
|
|
133
|
+
var _useState9 = useState(false),
|
|
130
134
|
_useState10 = _slicedToArray(_useState9, 2),
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
var
|
|
135
|
+
showSplitPaymentKeyboard = _useState10[0],
|
|
136
|
+
setShowSplitPaymentKeyboard = _useState10[1];
|
|
137
|
+
var paymentMethodsRef = useRef(null);
|
|
138
|
+
var _useState11 = useState([]),
|
|
134
139
|
_useState12 = _slicedToArray(_useState11, 2),
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
var _useState13 = useState(
|
|
140
|
+
paymentMethods = _useState12[0],
|
|
141
|
+
setPaymentMethods = _useState12[1];
|
|
142
|
+
var _useState13 = useState(false),
|
|
138
143
|
_useState14 = _slicedToArray(_useState13, 2),
|
|
139
|
-
|
|
140
|
-
|
|
144
|
+
showCashPayment = _useState14[0],
|
|
145
|
+
setShowCashPayment = _useState14[1];
|
|
146
|
+
var _useState15 = useState(locales.getText('cards.and.digitals') || 'Cards & Digitals'),
|
|
147
|
+
_useState16 = _slicedToArray(_useState15, 2),
|
|
148
|
+
paymentOptionsTitle = _useState16[0],
|
|
149
|
+
setPaymentOptionsTitle = _useState16[1];
|
|
150
|
+
var paymentOptionList = useMemo(function () {
|
|
151
|
+
return paymentMethods.filter(function (item) {
|
|
152
|
+
return !(item.type === 'app' && item.code === 'EFTPOS_LINKLY') && (['custom'].includes(item.type) || SHOW_METHODS_CODE.includes(item.code));
|
|
153
|
+
});
|
|
154
|
+
}, [paymentMethods]);
|
|
141
155
|
var clientChangedRef = useRef(false);
|
|
142
156
|
var walletPassRef = useRef(null);
|
|
143
157
|
// 已保存的支付项数据
|
|
144
|
-
var
|
|
145
|
-
_useState16 = _slicedToArray(_useState15, 2),
|
|
146
|
-
paymentItems = _useState16[0],
|
|
147
|
-
setPaymentItems = _useState16[1];
|
|
148
|
-
// 钱包卡券数据
|
|
149
|
-
var _useState17 = useState({}),
|
|
158
|
+
var _useState17 = useState([]),
|
|
150
159
|
_useState18 = _slicedToArray(_useState17, 2),
|
|
151
|
-
|
|
152
|
-
|
|
160
|
+
paymentItems = _useState18[0],
|
|
161
|
+
setPaymentItems = _useState18[1];
|
|
162
|
+
// 钱包卡券数据
|
|
163
|
+
var _useState19 = useState({}),
|
|
164
|
+
_useState20 = _slicedToArray(_useState19, 2),
|
|
165
|
+
walletPassData = _useState20[0],
|
|
166
|
+
setWalletPassData = _useState20[1];
|
|
153
167
|
var _usePrinter = usePrinter(),
|
|
154
168
|
nativePrint = _usePrinter.nativePrint;
|
|
155
|
-
var
|
|
156
|
-
|
|
157
|
-
syncingLock =
|
|
158
|
-
setSyncingLock =
|
|
169
|
+
var _useState21 = useState(false),
|
|
170
|
+
_useState22 = _slicedToArray(_useState21, 2),
|
|
171
|
+
syncingLock = _useState22[0],
|
|
172
|
+
setSyncingLock = _useState22[1];
|
|
159
173
|
var isOrderFree = useMemo(function () {
|
|
160
174
|
if (!customAmount) return false;
|
|
161
175
|
var amount = parseFloat(customAmount);
|
|
@@ -163,14 +177,14 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
163
177
|
}, [customAmount]);
|
|
164
178
|
|
|
165
179
|
// 新增状态:订单备注和手动折扣
|
|
166
|
-
var _useState21 = useState(false),
|
|
167
|
-
_useState22 = _slicedToArray(_useState21, 2),
|
|
168
|
-
paymentLinkModalOpen = _useState22[0],
|
|
169
|
-
setPaymentLinkModalOpen = _useState22[1];
|
|
170
180
|
var _useState23 = useState(false),
|
|
171
181
|
_useState24 = _slicedToArray(_useState23, 2),
|
|
172
|
-
|
|
173
|
-
|
|
182
|
+
paymentLinkModalOpen = _useState24[0],
|
|
183
|
+
setPaymentLinkModalOpen = _useState24[1];
|
|
184
|
+
var _useState25 = useState(false),
|
|
185
|
+
_useState26 = _slicedToArray(_useState25, 2),
|
|
186
|
+
showPriceAdjustModal = _useState26[0],
|
|
187
|
+
setShowPriceAdjustModal = _useState26[1];
|
|
174
188
|
var logger = usePaymentLogger();
|
|
175
189
|
var currency = getData('shop_currency_code') || 'USD';
|
|
176
190
|
|
|
@@ -223,7 +237,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
223
237
|
/** 支付类型,跟支付列表上对应的支付方式保持一致 */
|
|
224
238
|
code: cashPaymentMethod === null || cashPaymentMethod === void 0 ? void 0 : cashPaymentMethod.code,
|
|
225
239
|
/** 支付类型id,跟支付列表上对应的支付方式保持一致 */
|
|
226
|
-
|
|
240
|
+
custom_payment_id: cashPaymentMethod === null || cashPaymentMethod === void 0 ? void 0 : cashPaymentMethod.id,
|
|
227
241
|
/** 支付类型名称,跟支付列表上对应的支付方式保持一致 */
|
|
228
242
|
name: cashPaymentMethod === null || cashPaymentMethod === void 0 ? void 0 : cashPaymentMethod.name,
|
|
229
243
|
/** 支付类型type,跟支付列表上对应的支付方式保持一致 */
|
|
@@ -335,7 +349,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
335
349
|
// 支付金额
|
|
336
350
|
code: code,
|
|
337
351
|
// 支付类型code
|
|
338
|
-
|
|
352
|
+
custom_payment_id: id,
|
|
339
353
|
// 支付类型id
|
|
340
354
|
name: name,
|
|
341
355
|
// 支付类型name
|
|
@@ -403,7 +417,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
403
417
|
/** 支付类型,跟支付列表上对应的支付方式保持一致 */
|
|
404
418
|
code: method.code,
|
|
405
419
|
/** 支付类型id,跟支付列表上对应的支付方式保持一致 */
|
|
406
|
-
|
|
420
|
+
custom_payment_id: method.id,
|
|
407
421
|
/** 支付类型名称,跟支付列表上对应的支付方式保持一致 */
|
|
408
422
|
name: method.name,
|
|
409
423
|
/** 支付类型type,跟支付列表上对应的支付方式保持一致 */
|
|
@@ -570,7 +584,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
570
584
|
// );
|
|
571
585
|
var orderPaymentAddedUnsubscribe = core.effects.on(CheckoutHooks.OnOrderPaymentAdded, executeIfActive( /*#__PURE__*/function () {
|
|
572
586
|
var _ref8 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee5(data) {
|
|
573
|
-
var orderInfo, balanceDueAmount, autoCloseConfig, _paymentItems, _totalAmount, serviceChargeTotal, paymentMethodName, isCashPayment, _interaction$utils3, _interaction$utils3$p;
|
|
587
|
+
var orderInfo, balanceDueAmount, autoCloseConfig, _paymentItems, _totalAmount, serviceChargeTotal, isToastMode, paymentMethodName, isCashPayment, _interaction$utils3, _interaction$utils3$p;
|
|
574
588
|
return _regeneratorRuntime().wrap(function _callee5$(_context5) {
|
|
575
589
|
while (1) switch (_context5.prev = _context5.next) {
|
|
576
590
|
case 0:
|
|
@@ -580,7 +594,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
580
594
|
updateOrderInfo === null || updateOrderInfo === void 0 || updateOrderInfo(orderInfo);
|
|
581
595
|
balanceDueAmount = checkoutModule.getBalanceDueAmount();
|
|
582
596
|
if (!(Number(balanceDueAmount) > 0)) {
|
|
583
|
-
_context5.next =
|
|
597
|
+
_context5.next = 16;
|
|
584
598
|
break;
|
|
585
599
|
}
|
|
586
600
|
autoCloseConfig = calculateAutoCloseConfig('partially_paid', false); // 获取订单总金额
|
|
@@ -610,9 +624,16 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
610
624
|
_totalAmount = _totalAmount.add(serviceChargeTotal);
|
|
611
625
|
}
|
|
612
626
|
console.log(_totalAmount, _paymentItems);
|
|
627
|
+
// 弹窗模式判断
|
|
628
|
+
isToastMode = paymentResultDisplayMode !== 'modal';
|
|
629
|
+
if (!isToastMode) {
|
|
630
|
+
autoCloseConfig.autoClose = false;
|
|
631
|
+
autoCloseConfig.autoCloseDelay = 0;
|
|
632
|
+
autoCloseConfig.maskClosable = false;
|
|
633
|
+
}
|
|
613
634
|
|
|
614
635
|
// 根据支付状态展示不同的 toast
|
|
615
|
-
_context5.next =
|
|
636
|
+
_context5.next = 16;
|
|
616
637
|
return displayPaymentResultToast({
|
|
617
638
|
paymentStatus: 'partially_paid',
|
|
618
639
|
orderTotalAmount: _totalAmount.toNumber(),
|
|
@@ -630,7 +651,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
630
651
|
// 不自动关闭Modal,让两个弹窗独立管理
|
|
631
652
|
}
|
|
632
653
|
}));
|
|
633
|
-
case
|
|
654
|
+
case 16:
|
|
634
655
|
// 判断是否为现金支付
|
|
635
656
|
paymentMethodName = data.paymentMethodName || data.name || '';
|
|
636
657
|
isCashPayment = data.paymentMethodCode === 'CASHMANUAL' || /现金|現金/i.test(paymentMethodName) || /cash/i.test(paymentMethodName);
|
|
@@ -649,7 +670,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
649
670
|
}
|
|
650
671
|
});
|
|
651
672
|
}
|
|
652
|
-
case
|
|
673
|
+
case 19:
|
|
653
674
|
case "end":
|
|
654
675
|
return _context5.stop();
|
|
655
676
|
}
|
|
@@ -898,64 +919,11 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
898
919
|
return walletPassRef.current.handleSearchIdentificationCode(keyword);
|
|
899
920
|
}
|
|
900
921
|
}, []);
|
|
901
|
-
var getDataFromHost = function getDataFromHost() {
|
|
902
|
-
try {
|
|
903
|
-
var is_price_include_tax = getData('is_price_include_tax');
|
|
904
|
-
var tax_rate = getData('tax_rate') || '10';
|
|
905
|
-
var tax_title = getData('tax_title') || 'GST';
|
|
906
|
-
var surcharge_list = getData('surcharge_list');
|
|
907
|
-
var schedule_list = getData('schedule_list');
|
|
908
|
-
var scheduleById = {};
|
|
909
|
-
// 提前转换,节省附加费计算时的遍历时间
|
|
910
|
-
if (Array.isArray(schedule_list)) {
|
|
911
|
-
var _iterator = _createForOfIteratorHelper(schedule_list),
|
|
912
|
-
_step;
|
|
913
|
-
try {
|
|
914
|
-
for (_iterator.s(); !(_step = _iterator.n()).done;) {
|
|
915
|
-
var item = _step.value;
|
|
916
|
-
scheduleById[item.id] = item;
|
|
917
|
-
}
|
|
918
|
-
} catch (err) {
|
|
919
|
-
_iterator.e(err);
|
|
920
|
-
} finally {
|
|
921
|
-
_iterator.f();
|
|
922
|
-
}
|
|
923
|
-
}
|
|
924
|
-
return {
|
|
925
|
-
is_price_include_tax: is_price_include_tax,
|
|
926
|
-
tax_rate: tax_rate,
|
|
927
|
-
tax_title: tax_title,
|
|
928
|
-
surcharge_list: surcharge_list,
|
|
929
|
-
schedule_list: schedule_list,
|
|
930
|
-
scheduleById: scheduleById
|
|
931
|
-
};
|
|
932
|
-
} catch (error) {
|
|
933
|
-
console.error(error);
|
|
934
|
-
return {};
|
|
935
|
-
}
|
|
936
|
-
};
|
|
937
|
-
|
|
938
|
-
// 计算当前订单总价(不包含税费那些,所以应该是产品总价)
|
|
939
|
-
var currentTotalPrice = useMemo(function () {
|
|
940
|
-
if (!showPriceAdjustModal) return 0;
|
|
941
|
-
var ScheduleModule = pisellosAllModule.ScheduleModule;
|
|
942
|
-
try {
|
|
943
|
-
var _getSumTotal = getSumTotal(state, _objectSpread({
|
|
944
|
-
isEdit: true,
|
|
945
|
-
ScheduleModule: ScheduleModule
|
|
946
|
-
}, getDataFromHost())),
|
|
947
|
-
productAmount = _getSumTotal.productAmount;
|
|
948
|
-
return productAmount;
|
|
949
|
-
} catch (error) {
|
|
950
|
-
console.error('计算总价失败:', error);
|
|
951
|
-
return 0;
|
|
952
|
-
}
|
|
953
|
-
}, [state, showPriceAdjustModal]);
|
|
954
922
|
|
|
955
923
|
// 手动折扣后订单总价
|
|
956
924
|
var currentTotalPriceAfterDiscount = useMemo(function () {
|
|
957
|
-
return new Decimal(currentTotalPrice).minus(
|
|
958
|
-
}, [
|
|
925
|
+
return new Decimal(currentTotalPrice || 0).minus(shopDiscount || 0).toNumber();
|
|
926
|
+
}, [shopDiscount, currentTotalPrice]);
|
|
959
927
|
var handleSelectWalletChange = useMemoizedFn( /*#__PURE__*/function () {
|
|
960
928
|
var _ref13 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee10(select) {
|
|
961
929
|
var voucherItems, data;
|
|
@@ -1019,14 +987,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1019
987
|
case 0:
|
|
1020
988
|
try {
|
|
1021
989
|
if (checkoutModule && orderInfo !== null && orderInfo !== void 0 && orderInfo.totalAmount) {
|
|
1022
|
-
|
|
1023
|
-
dispatch({
|
|
1024
|
-
type: 'setState',
|
|
1025
|
-
payload: {
|
|
1026
|
-
shop_discount: discountAmount
|
|
1027
|
-
}
|
|
1028
|
-
});
|
|
1029
|
-
}
|
|
990
|
+
onChangeShopDiscount === null || onChangeShopDiscount === void 0 || onChangeShopDiscount(discountAmount);
|
|
1030
991
|
}
|
|
1031
992
|
} catch (error) {
|
|
1032
993
|
console.error('Failed to adjust price:', error);
|
|
@@ -1051,38 +1012,42 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1051
1012
|
case 0:
|
|
1052
1013
|
console.log('handleButtonClick', key);
|
|
1053
1014
|
_context12.t0 = key;
|
|
1054
|
-
_context12.next = _context12.t0 === 'order-note' ? 4 : _context12.t0 === 'send-link' ? 6 : _context12.t0 === 'print-receipt' ?
|
|
1015
|
+
_context12.next = _context12.t0 === 'order-note' ? 4 : _context12.t0 === 'send-link' ? 6 : _context12.t0 === 'split-payment' ? 8 : _context12.t0 === 'print-receipt' ? 10 : _context12.t0 === 'manual-discount' ? 26 : _context12.t0 === 'save-pay-later' ? 40 : 42;
|
|
1055
1016
|
break;
|
|
1056
1017
|
case 4:
|
|
1057
1018
|
setNoteModalOpen(true);
|
|
1058
|
-
return _context12.abrupt("break",
|
|
1019
|
+
return _context12.abrupt("break", 42);
|
|
1059
1020
|
case 6:
|
|
1060
1021
|
setPaymentLinkModalOpen(true);
|
|
1061
|
-
return _context12.abrupt("break",
|
|
1022
|
+
return _context12.abrupt("break", 42);
|
|
1062
1023
|
case 8:
|
|
1063
|
-
|
|
1064
|
-
|
|
1024
|
+
// 唤醒分账支付键盘
|
|
1025
|
+
setShowSplitPaymentKeyboard(true);
|
|
1026
|
+
return _context12.abrupt("break", 42);
|
|
1065
1027
|
case 10:
|
|
1028
|
+
_context12.next = 12;
|
|
1029
|
+
return checkoutModule.isCurrentOrderSynced();
|
|
1030
|
+
case 12:
|
|
1066
1031
|
isSynced = _context12.sent;
|
|
1067
1032
|
if (isSynced) {
|
|
1068
|
-
_context12.next =
|
|
1033
|
+
_context12.next = 19;
|
|
1069
1034
|
break;
|
|
1070
1035
|
}
|
|
1071
|
-
_context12.next =
|
|
1036
|
+
_context12.next = 16;
|
|
1072
1037
|
return checkoutModule.manualSyncOrderAsync();
|
|
1073
|
-
case
|
|
1038
|
+
case 16:
|
|
1074
1039
|
data = _context12.sent;
|
|
1075
|
-
_context12.next =
|
|
1040
|
+
_context12.next = 23;
|
|
1076
1041
|
break;
|
|
1077
|
-
case 17:
|
|
1078
|
-
_context12.next = 19;
|
|
1079
|
-
return checkoutModule.getCurrentOrderId();
|
|
1080
1042
|
case 19:
|
|
1043
|
+
_context12.next = 21;
|
|
1044
|
+
return checkoutModule.getCurrentOrderId();
|
|
1045
|
+
case 21:
|
|
1081
1046
|
_orderId2 = _context12.sent;
|
|
1082
1047
|
data = {
|
|
1083
1048
|
orderId: _orderId2
|
|
1084
1049
|
};
|
|
1085
|
-
case
|
|
1050
|
+
case 23:
|
|
1086
1051
|
console.log('handleButtonClick_print-receipt_data>>>>', data);
|
|
1087
1052
|
// data.orderId 就是订单号,可以用来打印小票
|
|
1088
1053
|
if (data.orderId) {
|
|
@@ -1103,40 +1068,40 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1103
1068
|
console.error('handleButtonClick_print-receipt_error>>>>', error);
|
|
1104
1069
|
}
|
|
1105
1070
|
}
|
|
1106
|
-
return _context12.abrupt("break",
|
|
1107
|
-
case
|
|
1071
|
+
return _context12.abrupt("break", 42);
|
|
1072
|
+
case 26:
|
|
1108
1073
|
if (orderInfo !== null && orderInfo !== void 0 && orderInfo.totalAmount) {
|
|
1109
|
-
_context12.next =
|
|
1074
|
+
_context12.next = 29;
|
|
1110
1075
|
break;
|
|
1111
1076
|
}
|
|
1112
1077
|
Toast === null || Toast === void 0 || Toast.fail(locales.getText('pisell2.checkout.manual-discount.no-amount'));
|
|
1113
1078
|
return _context12.abrupt("return");
|
|
1114
|
-
case 27:
|
|
1115
|
-
_context12.next = 29;
|
|
1116
|
-
return checkoutModule.getCurrentOrderPaymentItemsAsync();
|
|
1117
1079
|
case 29:
|
|
1080
|
+
_context12.next = 31;
|
|
1081
|
+
return checkoutModule.getCurrentOrderPaymentItemsAsync();
|
|
1082
|
+
case 31:
|
|
1118
1083
|
_paymentItems2 = _context12.sent;
|
|
1119
1084
|
if (!(_paymentItems2 !== null && _paymentItems2 !== void 0 && _paymentItems2.length)) {
|
|
1120
|
-
_context12.next =
|
|
1085
|
+
_context12.next = 35;
|
|
1121
1086
|
break;
|
|
1122
1087
|
}
|
|
1123
1088
|
Toast === null || Toast === void 0 || Toast.fail(locales.getText('pisell2.checkout.manual-discount.has-payment-items'));
|
|
1124
1089
|
return _context12.abrupt("return");
|
|
1125
|
-
case
|
|
1090
|
+
case 35:
|
|
1126
1091
|
if (!(Number(customAmount) <= 0 && Number(orderInfo === null || orderInfo === void 0 ? void 0 : orderInfo.totalAmount) >= 0)) {
|
|
1127
|
-
_context12.next =
|
|
1092
|
+
_context12.next = 38;
|
|
1128
1093
|
break;
|
|
1129
1094
|
}
|
|
1130
1095
|
Toast === null || Toast === void 0 || Toast.fail(locales.getText('pisell2.checkout.manual-discount.no-amount'));
|
|
1131
1096
|
return _context12.abrupt("return");
|
|
1132
|
-
case 36:
|
|
1133
|
-
setShowPriceAdjustModal(true);
|
|
1134
|
-
return _context12.abrupt("break", 40);
|
|
1135
1097
|
case 38:
|
|
1098
|
+
setShowPriceAdjustModal(true);
|
|
1099
|
+
return _context12.abrupt("break", 42);
|
|
1100
|
+
case 40:
|
|
1136
1101
|
// 通过 ref 调用 SavePayLaterHandler 的处理方法
|
|
1137
1102
|
(_savePayLaterHandlerR = savePayLaterHandlerRef.current) === null || _savePayLaterHandlerR === void 0 || _savePayLaterHandlerR.handleSavePayLaterClick();
|
|
1138
|
-
return _context12.abrupt("break",
|
|
1139
|
-
case
|
|
1103
|
+
return _context12.abrupt("break", 42);
|
|
1104
|
+
case 42:
|
|
1140
1105
|
case "end":
|
|
1141
1106
|
return _context12.stop();
|
|
1142
1107
|
}
|
|
@@ -1154,8 +1119,8 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1154
1119
|
};
|
|
1155
1120
|
});
|
|
1156
1121
|
var getCustomerInfo = function getCustomerInfo() {
|
|
1157
|
-
var
|
|
1158
|
-
|
|
1122
|
+
var _client$contacts;
|
|
1123
|
+
// const client = state?.client?.value;
|
|
1159
1124
|
|
|
1160
1125
|
// 修复逻辑:只有在 undefined 或 null 时才使用默认值,空字符串应该保留
|
|
1161
1126
|
var getValidName = function getValidName(value) {
|
|
@@ -1220,13 +1185,11 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1220
1185
|
};
|
|
1221
1186
|
}();
|
|
1222
1187
|
var searchAndClientProps = useMemo(function () {
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
return {};
|
|
1229
|
-
}, [paymentItems]);
|
|
1188
|
+
return {
|
|
1189
|
+
disabledSwitch: (config === null || config === void 0 ? void 0 : config.disabledSwitchClient) || false
|
|
1190
|
+
};
|
|
1191
|
+
}, [paymentItems, config]);
|
|
1192
|
+
console.log(searchAndClientProps, 'searchAndClientProps');
|
|
1230
1193
|
var roundingFunction = /*#__PURE__*/function () {
|
|
1231
1194
|
var _ref17 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee14(amount) {
|
|
1232
1195
|
var res;
|
|
@@ -1252,7 +1215,10 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1252
1215
|
// 处理PaymentModal区域的点击事件
|
|
1253
1216
|
var handleModalClick = useCallback(function (event) {
|
|
1254
1217
|
// 关闭所有Toast
|
|
1255
|
-
|
|
1218
|
+
var isToastMode = paymentResultDisplayMode !== 'modal';
|
|
1219
|
+
if (isToastMode) {
|
|
1220
|
+
closeAllPaymentResultToasts();
|
|
1221
|
+
}
|
|
1256
1222
|
}, []);
|
|
1257
1223
|
return /*#__PURE__*/React.createElement("div", {
|
|
1258
1224
|
ref: checkoutRef,
|
|
@@ -1273,14 +1239,14 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1273
1239
|
},
|
|
1274
1240
|
onSearch: handleSearch
|
|
1275
1241
|
}, searchAndClientProps)), moduleConfig.showWalletPass && /*#__PURE__*/React.createElement(WalletPassModule, {
|
|
1276
|
-
clientId:
|
|
1242
|
+
clientId: client === null || client === void 0 ? void 0 : client.id,
|
|
1277
1243
|
customAmount: balanceDueAmount,
|
|
1278
1244
|
orderInfo: orderInfo || undefined,
|
|
1279
1245
|
ref: walletPassRef,
|
|
1280
1246
|
paymentItems: paymentItems,
|
|
1281
1247
|
onSelectChange: handleSelectWalletChange
|
|
1282
1248
|
})), /*#__PURE__*/React.createElement(AmountSummary, {
|
|
1283
|
-
amountSymbol:
|
|
1249
|
+
amountSymbol: getData('shop_symbol'),
|
|
1284
1250
|
orderInfo: orderInfo || undefined,
|
|
1285
1251
|
cartData: cartData,
|
|
1286
1252
|
open_deposit: open_deposit,
|
|
@@ -1288,7 +1254,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1288
1254
|
balanceDueAmount: balanceDueAmount,
|
|
1289
1255
|
paymentItems: paymentItems,
|
|
1290
1256
|
walletPassData: walletPassData,
|
|
1291
|
-
clientInfo:
|
|
1257
|
+
clientInfo: client,
|
|
1292
1258
|
onAmountChange: handleAmountChange,
|
|
1293
1259
|
onDepositStatusChange: handleDepositStatusChange,
|
|
1294
1260
|
onBalanceDueAmountClick: handleButtonClick,
|
|
@@ -1299,7 +1265,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1299
1265
|
}, showCashPayment && /*#__PURE__*/React.createElement("div", {
|
|
1300
1266
|
style: showCashPayment ? {
|
|
1301
1267
|
gridColumn: '1',
|
|
1302
|
-
gridRow: '1'
|
|
1268
|
+
gridRow: (paymentOptionList === null || paymentOptionList === void 0 ? void 0 : paymentOptionList.length) === 1 ? 'span 2' : '1'
|
|
1303
1269
|
} : {}
|
|
1304
1270
|
}, /*#__PURE__*/React.createElement(CashPaymentModule, {
|
|
1305
1271
|
disabled: isOrderFree,
|
|
@@ -1312,15 +1278,16 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1312
1278
|
customAmount: customAmount,
|
|
1313
1279
|
roundingFunction: roundingFunction,
|
|
1314
1280
|
balanceDueAmount: balanceDueAmount,
|
|
1315
|
-
balanceDueTotalAmount: balanceDueTotalAmount
|
|
1316
|
-
|
|
1281
|
+
balanceDueTotalAmount: balanceDueTotalAmount,
|
|
1282
|
+
shortcutsSize: (paymentOptionList === null || paymentOptionList === void 0 ? void 0 : paymentOptionList.length) === 3 || (paymentOptionList === null || paymentOptionList === void 0 ? void 0 : paymentOptionList.length) === 1 ? 'large' : 'default'
|
|
1283
|
+
})), moduleConfig.showPaymentOptions && (paymentOptionList === null || paymentOptionList === void 0 ? void 0 : paymentOptionList.length) > 0 && /*#__PURE__*/React.createElement("div", {
|
|
1317
1284
|
className: showCashPayment ? '' : 'payment-options-module-container',
|
|
1318
1285
|
style: showCashPayment ? {
|
|
1319
1286
|
gridColumn: '2',
|
|
1320
|
-
gridRow: '1 / 3'
|
|
1287
|
+
gridRow: (paymentOptionList === null || paymentOptionList === void 0 ? void 0 : paymentOptionList.length) > 3 ? '1 / 3' : '1'
|
|
1321
1288
|
} : {}
|
|
1322
1289
|
}, /*#__PURE__*/React.createElement(PaymentOptionsModule, {
|
|
1323
|
-
amountSymbol:
|
|
1290
|
+
amountSymbol: getData('shop_symbol'),
|
|
1324
1291
|
orderInfo: orderInfo || undefined,
|
|
1325
1292
|
onClick: onPaymentOptionClick,
|
|
1326
1293
|
paymentMethods: paymentMethods,
|
|
@@ -1331,8 +1298,8 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1331
1298
|
})), moduleConfig.showAdditionalModule && /*#__PURE__*/React.createElement("div", {
|
|
1332
1299
|
className: showCashPayment ? '' : 'additional-module-container',
|
|
1333
1300
|
style: showCashPayment ? {
|
|
1334
|
-
gridColumn: '1',
|
|
1335
|
-
gridRow: '2'
|
|
1301
|
+
gridColumn: (paymentOptionList === null || paymentOptionList === void 0 ? void 0 : paymentOptionList.length) > 3 ? '1' : (paymentOptionList === null || paymentOptionList === void 0 ? void 0 : paymentOptionList.length) <= 1 ? '2' : 'span 2',
|
|
1302
|
+
gridRow: (paymentOptionList === null || paymentOptionList === void 0 ? void 0 : paymentOptionList.length) === 0 ? '1' : '2'
|
|
1336
1303
|
} : {}
|
|
1337
1304
|
}, /*#__PURE__*/React.createElement(AdditionalModule, {
|
|
1338
1305
|
orderInfo: orderInfo || undefined,
|
|
@@ -1340,7 +1307,9 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1340
1307
|
handleButtonClick: handleButtonClick,
|
|
1341
1308
|
hasOrderNote: !!orderNote && orderNote.trim().length > 0,
|
|
1342
1309
|
disabled: isOrderFree,
|
|
1343
|
-
showCashPayment: showCashPayment
|
|
1310
|
+
showCashPayment: showCashPayment,
|
|
1311
|
+
isFullWidth: !((paymentOptionList === null || paymentOptionList === void 0 ? void 0 : paymentOptionList.length) > 3 || (paymentOptionList === null || paymentOptionList === void 0 ? void 0 : paymentOptionList.length) <= 1),
|
|
1312
|
+
showMore: !(showCashPayment && (paymentOptionList === null || paymentOptionList === void 0 ? void 0 : paymentOptionList.length) === 0)
|
|
1344
1313
|
}))), /*#__PURE__*/React.createElement(PaymentMethods, {
|
|
1345
1314
|
ref: paymentMethodsRef,
|
|
1346
1315
|
dynamicMaxHeight: dynamicMaxHeight,
|
|
@@ -1362,6 +1331,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1362
1331
|
return setShowPriceAdjustModal(false);
|
|
1363
1332
|
}
|
|
1364
1333
|
},
|
|
1334
|
+
tips: locales.getText('pisell2.checkout.modal.price-adjustment-tips') || 'Changing amount will update order total',
|
|
1365
1335
|
selectType: "dark",
|
|
1366
1336
|
originalValue: currentTotalPrice,
|
|
1367
1337
|
defaultValue: currentTotalPriceAfterDiscount,
|
|
@@ -1369,9 +1339,43 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
|
1369
1339
|
onEnter: handlePriceAdjustConfirm
|
|
1370
1340
|
}), /*#__PURE__*/React.createElement(SavePayLaterHandler, {
|
|
1371
1341
|
ref: savePayLaterHandlerRef,
|
|
1372
|
-
amountSymbol:
|
|
1342
|
+
amountSymbol: getData('shop_symbol'),
|
|
1373
1343
|
walletPassData: walletPassData,
|
|
1374
1344
|
onSavePayLater: handleSavePayLater
|
|
1345
|
+
}), /*#__PURE__*/React.createElement(PaymentKeyboard, {
|
|
1346
|
+
containerProps: {
|
|
1347
|
+
renderType: 'modal',
|
|
1348
|
+
open: showSplitPaymentKeyboard,
|
|
1349
|
+
onCancel: function onCancel() {
|
|
1350
|
+
return setShowSplitPaymentKeyboard(false);
|
|
1351
|
+
}
|
|
1352
|
+
}
|
|
1353
|
+
// 原始值:此支付阶段的待支付金额,reset时还原为此值
|
|
1354
|
+
,
|
|
1355
|
+
paymentOriginalValue: balanceDueAmount,
|
|
1356
|
+
paymentDefaultValue: String(customAmount || 0),
|
|
1357
|
+
enableExceedMaxAmount: false,
|
|
1358
|
+
payment: {
|
|
1359
|
+
enable: true
|
|
1360
|
+
},
|
|
1361
|
+
surcharge: {
|
|
1362
|
+
enable: false
|
|
1363
|
+
},
|
|
1364
|
+
surchargeDefaultValue: {
|
|
1365
|
+
percent: '0',
|
|
1366
|
+
fixed: '0'
|
|
1367
|
+
},
|
|
1368
|
+
selectType: "light",
|
|
1369
|
+
onChange: function onChange(value) {
|
|
1370
|
+
console.log(value);
|
|
1371
|
+
},
|
|
1372
|
+
doneText: locales.getText('confirm') || '确认',
|
|
1373
|
+
onPay: function onPay(args) {
|
|
1374
|
+
console.log(args);
|
|
1375
|
+
// 处理支付逻辑
|
|
1376
|
+
setShowSplitPaymentKeyboard(false);
|
|
1377
|
+
handleAmountChange(String(args.amount));
|
|
1378
|
+
}
|
|
1375
1379
|
}));
|
|
1376
1380
|
});
|
|
1377
1381
|
|
|
@@ -1383,10 +1387,20 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1383
1387
|
data = _ref18.data,
|
|
1384
1388
|
callback = _ref18.callback,
|
|
1385
1389
|
onClose = _ref18.onClose,
|
|
1386
|
-
dispatch = _ref18.dispatch,
|
|
1387
|
-
state = _ref18.state,
|
|
1388
1390
|
setEditCartMode = _ref18.setEditCartMode,
|
|
1389
|
-
editOrderId = _ref18.editOrderId
|
|
1391
|
+
editOrderId = _ref18.editOrderId,
|
|
1392
|
+
paymentResultDisplayMode = _ref18.paymentResultDisplayMode,
|
|
1393
|
+
shopDiscount = _ref18.shopDiscount,
|
|
1394
|
+
client = _ref18.client,
|
|
1395
|
+
currentTotalPrice = _ref18.currentTotalPrice,
|
|
1396
|
+
onChangeShopDiscount = _ref18.onChangeShopDiscount,
|
|
1397
|
+
onChangeOrderNote = _ref18.onChangeOrderNote,
|
|
1398
|
+
onDeleteOrderNote = _ref18.onDeleteOrderNote,
|
|
1399
|
+
_ref18$config = _ref18.config,
|
|
1400
|
+
config = _ref18$config === void 0 ? {
|
|
1401
|
+
showHeaderCenter: true,
|
|
1402
|
+
showHeaderRightButton: true
|
|
1403
|
+
} : _ref18$config;
|
|
1390
1404
|
var context = useEngineContext();
|
|
1391
1405
|
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');
|
|
1392
1406
|
var _ref19 = (context === null || context === void 0 || (_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
|
|
@@ -1394,30 +1408,34 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1394
1408
|
getData = _ref19.getData,
|
|
1395
1409
|
interaction = _ref19.interaction,
|
|
1396
1410
|
isWebPos = _ref19.isWebPos;
|
|
1397
|
-
var
|
|
1398
|
-
_useState26 = _slicedToArray(_useState25, 2),
|
|
1399
|
-
orderInfo = _useState26[0],
|
|
1400
|
-
setOrderInfo = _useState26[1];
|
|
1401
|
-
var _useState27 = useState(0),
|
|
1411
|
+
var _useState27 = useState(null),
|
|
1402
1412
|
_useState28 = _slicedToArray(_useState27, 2),
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
var _useState29 = useState(
|
|
1413
|
+
orderInfo = _useState28[0],
|
|
1414
|
+
setOrderInfo = _useState28[1];
|
|
1415
|
+
var _useState29 = useState(0),
|
|
1406
1416
|
_useState30 = _slicedToArray(_useState29, 2),
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
var _useState31 = useState(
|
|
1417
|
+
totalAmount = _useState30[0],
|
|
1418
|
+
setTotalAmount = _useState30[1];
|
|
1419
|
+
var _useState31 = useState(true),
|
|
1410
1420
|
_useState32 = _slicedToArray(_useState31, 2),
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
var _useState33 = useState(
|
|
1421
|
+
actualShowCashPayment = _useState32[0],
|
|
1422
|
+
setActualShowCashPayment = _useState32[1];
|
|
1423
|
+
var _useState33 = useState(0),
|
|
1414
1424
|
_useState34 = _slicedToArray(_useState33, 2),
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
var _useState35 = useState(
|
|
1425
|
+
windowHeight = _useState34[0],
|
|
1426
|
+
setWindowHeight = _useState34[1];
|
|
1427
|
+
var _useState35 = useState(false),
|
|
1418
1428
|
_useState36 = _slicedToArray(_useState35, 2),
|
|
1419
|
-
|
|
1420
|
-
|
|
1429
|
+
showRetryModal = _useState36[0],
|
|
1430
|
+
setShowRetryModal = _useState36[1];
|
|
1431
|
+
var _useState37 = useState(false),
|
|
1432
|
+
_useState38 = _slicedToArray(_useState37, 2),
|
|
1433
|
+
showCreateErrorModal = _useState38[0],
|
|
1434
|
+
setShowCreateErrorModal = _useState38[1];
|
|
1435
|
+
var _useState39 = useState(editOrderId || 0),
|
|
1436
|
+
_useState40 = _slicedToArray(_useState39, 2),
|
|
1437
|
+
currentEditOrderId = _useState40[0],
|
|
1438
|
+
_setCurrentEditOrderId = _useState40[1];
|
|
1421
1439
|
var _useActiveExecute2 = useActiveExecute(),
|
|
1422
1440
|
executeIfActive = _useActiveExecute2.executeIfActive;
|
|
1423
1441
|
var Toast = useToast();
|
|
@@ -1554,18 +1572,18 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1554
1572
|
}, []);
|
|
1555
1573
|
|
|
1556
1574
|
// 订单备注相关状态
|
|
1557
|
-
var
|
|
1558
|
-
_useState38 = _slicedToArray(_useState37, 2),
|
|
1559
|
-
noteModalOpen = _useState38[0],
|
|
1560
|
-
setNoteModalOpen = _useState38[1];
|
|
1561
|
-
var _useState39 = useState(''),
|
|
1562
|
-
_useState40 = _slicedToArray(_useState39, 2),
|
|
1563
|
-
orderNote = _useState40[0],
|
|
1564
|
-
setOrderNote = _useState40[1];
|
|
1565
|
-
var _useState41 = useState('payment-content'),
|
|
1575
|
+
var _useState41 = useState(false),
|
|
1566
1576
|
_useState42 = _slicedToArray(_useState41, 2),
|
|
1567
|
-
|
|
1568
|
-
|
|
1577
|
+
noteModalOpen = _useState42[0],
|
|
1578
|
+
setNoteModalOpen = _useState42[1];
|
|
1579
|
+
var _useState43 = useState(''),
|
|
1580
|
+
_useState44 = _slicedToArray(_useState43, 2),
|
|
1581
|
+
orderNote = _useState44[0],
|
|
1582
|
+
setOrderNote = _useState44[1];
|
|
1583
|
+
var _useState45 = useState('payment-content'),
|
|
1584
|
+
_useState46 = _slicedToArray(_useState45, 2),
|
|
1585
|
+
noteModalSource = _useState46[0],
|
|
1586
|
+
setNoteModalSource = _useState46[1];
|
|
1569
1587
|
|
|
1570
1588
|
// 订单备注相关处理函数
|
|
1571
1589
|
var handleNoteConfirm = /*#__PURE__*/function () {
|
|
@@ -1601,15 +1619,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1601
1619
|
Toast === null || Toast === void 0 || Toast.success(locales.getText('pisell2.checkout.order-note.updated-successfully'));
|
|
1602
1620
|
case 13:
|
|
1603
1621
|
// 同时把购物车的也给改了
|
|
1604
|
-
|
|
1605
|
-
dispatch({
|
|
1606
|
-
type: 'setNotes',
|
|
1607
|
-
payload: {
|
|
1608
|
-
orderNote: noteValue,
|
|
1609
|
-
edit: true
|
|
1610
|
-
}
|
|
1611
|
-
});
|
|
1612
|
-
}
|
|
1622
|
+
onChangeOrderNote === null || onChangeOrderNote === void 0 || onChangeOrderNote(noteValue);
|
|
1613
1623
|
|
|
1614
1624
|
// 根据打开来源执行不同的逻辑
|
|
1615
1625
|
if (noteModalSource === 'payment-result-toast') {
|
|
@@ -1658,15 +1668,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1658
1668
|
Toast === null || Toast === void 0 || Toast.success(locales.getText('pisell2.checkout.order-note.deleted-successfully'));
|
|
1659
1669
|
case 7:
|
|
1660
1670
|
// 同时把购物车的也给改了
|
|
1661
|
-
|
|
1662
|
-
dispatch({
|
|
1663
|
-
type: 'setNotes',
|
|
1664
|
-
payload: {
|
|
1665
|
-
orderNote: '',
|
|
1666
|
-
edit: true
|
|
1667
|
-
}
|
|
1668
|
-
});
|
|
1669
|
-
}
|
|
1671
|
+
onDeleteOrderNote === null || onDeleteOrderNote === void 0 || onDeleteOrderNote();
|
|
1670
1672
|
_context18.next = 14;
|
|
1671
1673
|
break;
|
|
1672
1674
|
case 10:
|
|
@@ -1990,9 +1992,9 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
1990
1992
|
handlePaymentCancel(false);
|
|
1991
1993
|
}
|
|
1992
1994
|
}
|
|
1993
|
-
})), /*#__PURE__*/React.createElement("div", {
|
|
1995
|
+
})), (config === null || config === void 0 ? void 0 : config.showHeaderCenter) && /*#__PURE__*/React.createElement("div", {
|
|
1994
1996
|
className: "header__center"
|
|
1995
|
-
}, translation('order.total'), "\uFF1A", formatCurrency(totalAmount,
|
|
1997
|
+
}, translation('order.total'), "\uFF1A", formatCurrency(totalAmount, getData('shop_symbol'))), (config === null || config === void 0 ? void 0 : config.showHeaderRightButton) && /*#__PURE__*/React.createElement("div", {
|
|
1996
1998
|
className: "header__right"
|
|
1997
1999
|
}, /*#__PURE__*/React.createElement(Button, {
|
|
1998
2000
|
size: "small",
|
|
@@ -2018,7 +2020,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2018
2020
|
useEffect(function () {
|
|
2019
2021
|
var initCheckoutData = /*#__PURE__*/function () {
|
|
2020
2022
|
var _ref28 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee23() {
|
|
2021
|
-
var checkout, shop_wallet_pass_id, newData, _newData$subtotal_inf, _newData$subtotal_inf2, _orderInfo2, _data$subtotal_info, _data$subtotal_info2, _orderInfo4;
|
|
2023
|
+
var checkout, shop_wallet_pass_id, newData, existPayment, _newData$subtotal_inf, _newData$subtotal_inf2, _orderInfo2, _data$subtotal_info, _data$subtotal_info2, _orderInfo4;
|
|
2022
2024
|
return _regeneratorRuntime().wrap(function _callee23$(_context23) {
|
|
2023
2025
|
while (1) switch (_context23.prev = _context23.next) {
|
|
2024
2026
|
case 0:
|
|
@@ -2026,7 +2028,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2026
2028
|
// 获取 checkout 模块并处理订单数据
|
|
2027
2029
|
checkout = pisellos === null || pisellos === void 0 ? void 0 : pisellos.getModule('checkout');
|
|
2028
2030
|
if (!(checkout && data && !isLocalOrderCreated.current)) {
|
|
2029
|
-
_context23.next =
|
|
2031
|
+
_context23.next = 26;
|
|
2030
2032
|
break;
|
|
2031
2033
|
}
|
|
2032
2034
|
isLocalOrderCreated.current = true;
|
|
@@ -2046,24 +2048,26 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2046
2048
|
order_rounding_setting: getData('order_rounding_setting'),
|
|
2047
2049
|
shop_wallet_pass_id: shop_wallet_pass_id
|
|
2048
2050
|
});
|
|
2049
|
-
newData = cloneDeep(data);
|
|
2051
|
+
newData = cloneDeep(data);
|
|
2052
|
+
existPayment = newData.existPayment; // setTotalAmount(newData.total.expectAmount);
|
|
2050
2053
|
// 先往 checkout 解决方案推送一条 local 数据
|
|
2051
2054
|
if (!(editOrderId || currentEditOrderId)) {
|
|
2052
|
-
_context23.next =
|
|
2055
|
+
_context23.next = 15;
|
|
2053
2056
|
break;
|
|
2054
2057
|
}
|
|
2055
|
-
_context23.next =
|
|
2058
|
+
_context23.next = 13;
|
|
2056
2059
|
return checkout.updateLocalOrderAsync({
|
|
2057
2060
|
orderId: editOrderId || currentEditOrderId,
|
|
2058
2061
|
orderData: newData.order_info,
|
|
2059
2062
|
cartSummary: (_newData$subtotal_inf = newData.subtotal_info) === null || _newData$subtotal_inf === void 0 ? void 0 : _newData$subtotal_inf.subTotalList,
|
|
2060
2063
|
autoPayment: true,
|
|
2061
|
-
totalInfo: newData.subtotal_info
|
|
2064
|
+
totalInfo: newData.subtotal_info,
|
|
2065
|
+
existPayment: existPayment
|
|
2062
2066
|
});
|
|
2063
|
-
case
|
|
2064
|
-
_context23.next =
|
|
2067
|
+
case 13:
|
|
2068
|
+
_context23.next = 18;
|
|
2065
2069
|
break;
|
|
2066
|
-
case
|
|
2070
|
+
case 15:
|
|
2067
2071
|
logger === null || logger === void 0 || logger.addLog({
|
|
2068
2072
|
type: 'info',
|
|
2069
2073
|
title: '正常创建 createLocalOrderAsync',
|
|
@@ -2071,14 +2075,14 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2071
2075
|
data: data
|
|
2072
2076
|
}
|
|
2073
2077
|
});
|
|
2074
|
-
_context23.next =
|
|
2078
|
+
_context23.next = 18;
|
|
2075
2079
|
return checkout.createLocalOrderAsync({
|
|
2076
2080
|
orderData: newData.order_info,
|
|
2077
2081
|
cartSummary: (_newData$subtotal_inf2 = newData.subtotal_info) === null || _newData$subtotal_inf2 === void 0 ? void 0 : _newData$subtotal_inf2.subTotalList,
|
|
2078
2082
|
autoPayment: true,
|
|
2079
2083
|
totalInfo: newData.subtotal_info
|
|
2080
2084
|
});
|
|
2081
|
-
case
|
|
2085
|
+
case 18:
|
|
2082
2086
|
// 获取订单总金额
|
|
2083
2087
|
_orderInfo2 = checkout.getCurrentOrderInfo();
|
|
2084
2088
|
console.log(_orderInfo2);
|
|
@@ -2099,7 +2103,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2099
2103
|
unsubscribeRef.current = checkout.core.effects.on('checkout:onOrderSynced', executeIfActive( /*#__PURE__*/function () {
|
|
2100
2104
|
var _ref29 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee22(data) {
|
|
2101
2105
|
var _data$response, _responseData$payment2;
|
|
2102
|
-
var currentOrderId, responseData, paymentStatus, orderTotalAmount, gapAmount, currentChangeGivenAmount, failureReason, _responseData$payment3, params, statusClassName, autoCloseConfig, enabledAutoPrint, _interaction$utils6, _interaction$utils6$a, _orderInfo3, paymentResult;
|
|
2106
|
+
var currentOrderId, responseData, paymentStatus, orderTotalAmount, gapAmount, currentChangeGivenAmount, failureReason, _responseData$payment3, params, statusClassName, autoCloseConfig, enabledAutoPrint, _interaction$utils6, _interaction$utils6$a, _orderInfo3, isToastMode, paymentResult;
|
|
2103
2107
|
return _regeneratorRuntime().wrap(function _callee22$(_context22) {
|
|
2104
2108
|
while (1) switch (_context22.prev = _context22.next) {
|
|
2105
2109
|
case 0:
|
|
@@ -2130,7 +2134,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2130
2134
|
// 获取失败原因
|
|
2131
2135
|
failureReason = responseData === null || responseData === void 0 ? void 0 : responseData.failure_reason; // 根据支付状态弹出对应的支付结果toast
|
|
2132
2136
|
if (!paymentStatus) {
|
|
2133
|
-
_context22.next =
|
|
2137
|
+
_context22.next = 37;
|
|
2134
2138
|
break;
|
|
2135
2139
|
}
|
|
2136
2140
|
// 打印订单完整信息
|
|
@@ -2203,8 +2207,16 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2203
2207
|
case 26:
|
|
2204
2208
|
enabledAutoPrint = _context22.sent;
|
|
2205
2209
|
case 27:
|
|
2206
|
-
_orderInfo3 = checkout.getCurrentOrderInfo(); //
|
|
2207
|
-
|
|
2210
|
+
_orderInfo3 = checkout.getCurrentOrderInfo(); // 弹窗模式判断
|
|
2211
|
+
isToastMode = paymentResultDisplayMode !== 'modal';
|
|
2212
|
+
if (!isToastMode) {
|
|
2213
|
+
autoCloseConfig.autoClose = false;
|
|
2214
|
+
autoCloseConfig.autoCloseDelay = 0;
|
|
2215
|
+
autoCloseConfig.maskClosable = false;
|
|
2216
|
+
}
|
|
2217
|
+
|
|
2218
|
+
// 根据支付状态展示不同的 toast
|
|
2219
|
+
_context22.next = 32;
|
|
2208
2220
|
return displayPaymentResultToast({
|
|
2209
2221
|
paymentStatus: paymentStatus,
|
|
2210
2222
|
orderTotalAmount: _orderInfo3.isDeposit ? _orderInfo3.depositAmount : orderTotalAmount,
|
|
@@ -2213,7 +2225,7 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2213
2225
|
autoCloseConfig: autoCloseConfig,
|
|
2214
2226
|
actionButtons: generateActionButtons(paymentStatus, enabledAutoPrint)
|
|
2215
2227
|
}, paymentResultToastConfig);
|
|
2216
|
-
case
|
|
2228
|
+
case 32:
|
|
2217
2229
|
// 当支付状态为 paid 时,关闭 paymentModal
|
|
2218
2230
|
if (paymentStatus === 'paid') {
|
|
2219
2231
|
handleModalClose();
|
|
@@ -2229,11 +2241,11 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2229
2241
|
}
|
|
2230
2242
|
});
|
|
2231
2243
|
handlePaymentComplete(paymentResult);
|
|
2232
|
-
_context22.next =
|
|
2244
|
+
_context22.next = 38;
|
|
2233
2245
|
break;
|
|
2234
|
-
case
|
|
2246
|
+
case 37:
|
|
2235
2247
|
handlePaymentComplete(data);
|
|
2236
|
-
case
|
|
2248
|
+
case 38:
|
|
2237
2249
|
case "end":
|
|
2238
2250
|
return _context22.stop();
|
|
2239
2251
|
}
|
|
@@ -2243,24 +2255,24 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2243
2255
|
return _ref29.apply(this, arguments);
|
|
2244
2256
|
};
|
|
2245
2257
|
}()));
|
|
2246
|
-
_context23.next =
|
|
2258
|
+
_context23.next = 43;
|
|
2247
2259
|
break;
|
|
2248
|
-
case
|
|
2260
|
+
case 26:
|
|
2249
2261
|
if (!isLocalOrderCreated.current) {
|
|
2250
|
-
_context23.next =
|
|
2262
|
+
_context23.next = 43;
|
|
2251
2263
|
break;
|
|
2252
2264
|
}
|
|
2253
2265
|
// // 如果本地订单已创建,这时候还更新了 data,则需要销毁当前的订单数据,然后更新新的订单数据了
|
|
2254
2266
|
console.log('🔄 PaymentModal: data changed, updating checkout data...');
|
|
2255
2267
|
isLocalOrderCreated.current = false;
|
|
2256
|
-
_context23.next =
|
|
2268
|
+
_context23.next = 31;
|
|
2257
2269
|
return checkout.cancelCurrentOrderAsync();
|
|
2258
|
-
case
|
|
2270
|
+
case 31:
|
|
2259
2271
|
if (!(editOrderId || currentEditOrderId)) {
|
|
2260
|
-
_context23.next =
|
|
2272
|
+
_context23.next = 36;
|
|
2261
2273
|
break;
|
|
2262
2274
|
}
|
|
2263
|
-
_context23.next =
|
|
2275
|
+
_context23.next = 34;
|
|
2264
2276
|
return checkout.updateLocalOrderAsync({
|
|
2265
2277
|
orderId: editOrderId || currentEditOrderId,
|
|
2266
2278
|
orderData: data === null || data === void 0 ? void 0 : data.order_info,
|
|
@@ -2268,10 +2280,10 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2268
2280
|
autoPayment: true,
|
|
2269
2281
|
totalInfo: data === null || data === void 0 ? void 0 : data.subtotal_info
|
|
2270
2282
|
});
|
|
2271
|
-
case
|
|
2272
|
-
_context23.next =
|
|
2283
|
+
case 34:
|
|
2284
|
+
_context23.next = 39;
|
|
2273
2285
|
break;
|
|
2274
|
-
case
|
|
2286
|
+
case 36:
|
|
2275
2287
|
logger === null || logger === void 0 || logger.addLog({
|
|
2276
2288
|
type: 'info',
|
|
2277
2289
|
title: '含有 localOrderCreate, 调用 createLocalOrderAsync',
|
|
@@ -2279,14 +2291,14 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2279
2291
|
data: data
|
|
2280
2292
|
}
|
|
2281
2293
|
});
|
|
2282
|
-
_context23.next =
|
|
2294
|
+
_context23.next = 39;
|
|
2283
2295
|
return checkout.createLocalOrderAsync({
|
|
2284
2296
|
orderData: data === null || data === void 0 ? void 0 : data.order_info,
|
|
2285
2297
|
cartSummary: data === null || data === void 0 || (_data$subtotal_info2 = data.subtotal_info) === null || _data$subtotal_info2 === void 0 ? void 0 : _data$subtotal_info2.subTotalList,
|
|
2286
2298
|
autoPayment: true,
|
|
2287
2299
|
totalInfo: data === null || data === void 0 ? void 0 : data.subtotal_info
|
|
2288
2300
|
});
|
|
2289
|
-
case
|
|
2301
|
+
case 39:
|
|
2290
2302
|
// 获取订单总金额
|
|
2291
2303
|
_orderInfo4 = checkout.getCurrentOrderInfo();
|
|
2292
2304
|
if (_orderInfo4 && _orderInfo4.totalAmount) {
|
|
@@ -2294,11 +2306,11 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2294
2306
|
}
|
|
2295
2307
|
setOrderInfo(_orderInfo4);
|
|
2296
2308
|
isLocalOrderCreated.current = true;
|
|
2297
|
-
case
|
|
2298
|
-
_context23.next =
|
|
2309
|
+
case 43:
|
|
2310
|
+
_context23.next = 50;
|
|
2299
2311
|
break;
|
|
2300
|
-
case
|
|
2301
|
-
_context23.prev =
|
|
2312
|
+
case 45:
|
|
2313
|
+
_context23.prev = 45;
|
|
2302
2314
|
_context23.t0 = _context23["catch"](0);
|
|
2303
2315
|
console.error('Failed to initialize checkout data:', _context23.t0);
|
|
2304
2316
|
logger === null || logger === void 0 || logger.addLog({
|
|
@@ -2308,11 +2320,13 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2308
2320
|
error: _context23.t0
|
|
2309
2321
|
}
|
|
2310
2322
|
});
|
|
2311
|
-
|
|
2323
|
+
// 如果订单创建失败,弹出提示让重新加载 app
|
|
2324
|
+
setShowCreateErrorModal(true);
|
|
2325
|
+
case 50:
|
|
2312
2326
|
case "end":
|
|
2313
2327
|
return _context23.stop();
|
|
2314
2328
|
}
|
|
2315
|
-
}, _callee23, null, [[0,
|
|
2329
|
+
}, _callee23, null, [[0, 45]]);
|
|
2316
2330
|
}));
|
|
2317
2331
|
return function initCheckoutData() {
|
|
2318
2332
|
return _ref28.apply(this, arguments);
|
|
@@ -2339,12 +2353,12 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2339
2353
|
getData: getData,
|
|
2340
2354
|
interaction: interaction,
|
|
2341
2355
|
Toast: Toast,
|
|
2342
|
-
state: state,
|
|
2343
2356
|
onToastClose: handleToastClose
|
|
2344
2357
|
};
|
|
2345
2358
|
|
|
2346
2359
|
// 支付结果弹窗按钮生成函数
|
|
2347
|
-
var generateActionButtons = function generateActionButtons(paymentStatus
|
|
2360
|
+
var generateActionButtons = function generateActionButtons(paymentStatus) {
|
|
2361
|
+
var enabledAutoPrint = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
2348
2362
|
var getClassName = function getClassName(suffix) {
|
|
2349
2363
|
return "payment-result-toast-".concat(suffix);
|
|
2350
2364
|
};
|
|
@@ -2753,8 +2767,13 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2753
2767
|
onPaymentCancel: handlePaymentCancel
|
|
2754
2768
|
// onStatusChange={(status) => console.log('Status changed:', status)}
|
|
2755
2769
|
,
|
|
2756
|
-
|
|
2757
|
-
|
|
2770
|
+
paymentResultDisplayMode: paymentResultDisplayMode,
|
|
2771
|
+
shopDiscount: shopDiscount,
|
|
2772
|
+
client: client,
|
|
2773
|
+
currentTotalPrice: currentTotalPrice,
|
|
2774
|
+
onChangeShopDiscount: onChangeShopDiscount,
|
|
2775
|
+
onChangeOrderNote: onChangeOrderNote,
|
|
2776
|
+
onDeleteOrderNote: onDeleteOrderNote,
|
|
2758
2777
|
showingCashToastRef: showingCashToastRef,
|
|
2759
2778
|
onToastClose: handleToastClose,
|
|
2760
2779
|
orderNote: orderNote,
|
|
@@ -2776,7 +2795,8 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2776
2795
|
},
|
|
2777
2796
|
setCurrentEditOrderId: function setCurrentEditOrderId(orderId) {
|
|
2778
2797
|
return _setCurrentEditOrderId(orderId);
|
|
2779
|
-
}
|
|
2798
|
+
},
|
|
2799
|
+
config: config
|
|
2780
2800
|
})), noteModalOpen && /*#__PURE__*/createPortal( /*#__PURE__*/React.createElement("div", null, /*#__PURE__*/React.createElement(NoteModal, {
|
|
2781
2801
|
open: noteModalOpen,
|
|
2782
2802
|
title: locales.getText('pisell2.text.add-order-notes'),
|
|
@@ -2814,7 +2834,39 @@ var PaymentModal = function PaymentModal(_ref18) {
|
|
|
2814
2834
|
width: '100%',
|
|
2815
2835
|
marginTop: '80px'
|
|
2816
2836
|
}
|
|
2817
|
-
}, locales.getText('retry') || '重试')))
|
|
2837
|
+
}, locales.getText('retry') || '重试'))), /*#__PURE__*/React.createElement(PisellContainer, {
|
|
2838
|
+
renderType: "modal",
|
|
2839
|
+
props: {
|
|
2840
|
+
open: showCreateErrorModal,
|
|
2841
|
+
title: locales.getText('pisell2.checkout.tips'),
|
|
2842
|
+
footer: null,
|
|
2843
|
+
keyboard: false,
|
|
2844
|
+
onCancel: function onCancel() {
|
|
2845
|
+
setShowCreateErrorModal(false);
|
|
2846
|
+
} // 禁用关闭
|
|
2847
|
+
}
|
|
2848
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2849
|
+
style: {
|
|
2850
|
+
textAlign: 'center',
|
|
2851
|
+
padding: '20px'
|
|
2852
|
+
}
|
|
2853
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
2854
|
+
style: {
|
|
2855
|
+
marginBottom: '16px',
|
|
2856
|
+
fontSize: '16px'
|
|
2857
|
+
}
|
|
2858
|
+
}, locales.getText('pisell2.checkout.order-create-failed')), /*#__PURE__*/React.createElement(Button, {
|
|
2859
|
+
type: "primary",
|
|
2860
|
+
size: "large",
|
|
2861
|
+
onClick: function onClick() {
|
|
2862
|
+
setShowCreateErrorModal(false);
|
|
2863
|
+
window.location.reload();
|
|
2864
|
+
},
|
|
2865
|
+
style: {
|
|
2866
|
+
width: '100%',
|
|
2867
|
+
marginTop: '80px'
|
|
2868
|
+
}
|
|
2869
|
+
}, locales.getText('confirm') || '确认'))));
|
|
2818
2870
|
};
|
|
2819
2871
|
|
|
2820
2872
|
// 导出类型供外部使用
|