@pisell/private-materials 6.5.2 → 6.5.4
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 -164
- 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/businessModel/SalesModel/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Content/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Voucher/index.d.ts +1 -0
- package/es/components/appointmentBooking/deposit/index.d.ts +1 -0
- package/es/components/appointmentBooking/index.d.ts +1 -0
- package/es/components/booking/components/actionButtons/index.js +2 -2
- package/es/components/booking/components/customiseItemModal/index.js +2 -2
- package/es/components/booking/components/footer/index.d.ts +1 -0
- package/es/components/booking/components/footer/index.js +48 -42
- package/es/components/booking/components/voucher/index.d.ts +1 -0
- package/es/components/booking/components/voucher/index.js +18 -4
- package/es/components/booking/deposit/index.d.ts +1 -0
- package/es/components/booking/hooks/useQuotation.d.ts +1 -0
- package/es/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/es/components/booking/info/header/index.d.ts +1 -0
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/es/components/booking/info/index.d.ts +1 -0
- package/es/components/booking/info/service/Lists.d.ts +1 -0
- package/es/components/booking/info/service/addService/index.d.ts +1 -0
- package/es/components/booking/info/service/addTimeModal/index.d.ts +1 -0
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/es/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/info/service2/Lists.d.ts +1 -0
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info2/cartClientCard/index.js +33 -20
- package/es/components/booking/info2/cartClientCard/utils.d.ts +2 -2
- package/es/components/booking/info2/service/addService/index.d.ts +1 -0
- package/es/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/es/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/es/components/booking/notes/NoteBlock/index.d.ts +1 -0
- package/es/components/booking/notes/addNote/index.d.ts +1 -0
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/checkout/PaymentModal.js +719 -432
- package/es/components/checkout/PaymentPlugin.d.ts +1 -0
- 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.js +8 -1
- 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.d.ts +1 -0
- 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/ConflictModal/index.d.ts +1 -0
- package/es/components/checkout/components/WalletPassModule/components/DiscountWallet/index.d.ts +1 -0
- 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.d.ts +1 -1
- 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/surcharge/index.d.ts +1 -0
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/app.d.ts +1 -0
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/index.d.ts +1 -0
- package/es/components/eftposPay/linkly/index.d.ts +1 -0
- package/es/components/eftposPay/store/index.d.ts +6 -6
- package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
- package/es/components/eventBooking/index.d.ts +1 -0
- package/es/components/pay/toB/components/Cache/index.d.ts +1 -0
- package/es/components/pay/toB/components/Card/index.d.ts +1 -0
- package/es/components/pay/toB/components/CardGroup/index.d.ts +1 -0
- package/es/components/pay/toB/components/ConfirmedPayment/index.d.ts +1 -0
- package/es/components/pay/toB/components/Content/Footer.d.ts +1 -0
- package/es/components/pay/toB/components/Content/Header.d.ts +1 -0
- package/es/components/pay/toB/components/EFTPOS/index.js +91 -58
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/index.d.ts +1 -0
- package/es/components/productExtension/index.d.ts +1 -0
- package/es/components/productSelect/components/TabProduct/index.d.ts +1 -0
- package/es/components/productSelect/components/productGroup/index.d.ts +1 -0
- package/es/components/ruleSetting/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
- package/es/components/schedules/utils.d.ts +1 -1
- package/es/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/es/components/taxSelect/index.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +4 -3
- package/es/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
- package/es/components/ticketBooking/components/bookingDataPanel/index.js +1 -1
- package/es/components/ticketBooking/components/menuBar/index.d.ts +1 -0
- package/es/components/ticketBooking/components/menuBar/index.js +1 -1
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/es/components/ticketBooking/components/ticketBooking/index.js +2 -2
- package/es/components/ticketBooking/components/timeBar/index.d.ts +1 -0
- 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 +4 -2
- package/es/components/ticketBooking/index.d.ts +1 -0
- package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
- package/es/plus/clientCard/index.js +3 -2
- package/es/plus/clientCard/index.less +3 -32
- package/es/plus/clientName/index.d.ts +1 -0
- package/es/plus/clinetSearch/Add/BirthdayField/index.d.ts +1 -0
- package/es/plus/clinetSearch/Add/GenderField/index.d.ts +1 -0
- package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +1 -0
- package/es/plus/noteModal/AddTempModal.d.ts +1 -0
- package/es/plus/saasCreateOrganization/index.d.ts +1 -0
- 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 +1 -0
- package/es/utils/index.d.ts +1 -1
- package/lib/businessModel/SalesModel/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Content/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Header/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Voucher/index.d.ts +1 -0
- package/lib/components/appointmentBooking/deposit/index.d.ts +1 -0
- package/lib/components/appointmentBooking/index.d.ts +1 -0
- package/lib/components/booking/components/actionButtons/index.js +2 -1
- package/lib/components/booking/components/customiseItemModal/index.js +2 -2
- package/lib/components/booking/components/footer/index.d.ts +1 -0
- package/lib/components/booking/components/footer/index.js +3 -0
- package/lib/components/booking/components/voucher/index.d.ts +1 -0
- package/lib/components/booking/components/voucher/index.js +15 -3
- package/lib/components/booking/deposit/index.d.ts +1 -0
- package/lib/components/booking/hooks/useQuotation.d.ts +1 -0
- package/lib/components/booking/info/addServiceVariant/index.d.ts +1 -0
- package/lib/components/booking/info/header/index.d.ts +1 -0
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +1 -0
- package/lib/components/booking/info/index.d.ts +1 -0
- package/lib/components/booking/info/service/Lists.d.ts +1 -0
- package/lib/components/booking/info/service/addService/index.d.ts +1 -0
- package/lib/components/booking/info/service/addTimeModal/index.d.ts +1 -0
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/info/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/info/service2/Lists.d.ts +1 -0
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info2/cartClientCard/index.js +16 -5
- package/lib/components/booking/info2/cartClientCard/utils.d.ts +2 -2
- package/lib/components/booking/info2/service/addService/index.d.ts +1 -0
- package/lib/components/booking/info2/service/serviceItem/index.d.ts +1 -0
- package/lib/components/booking/info2/service/serviceList/index.d.ts +1 -0
- package/lib/components/booking/notes/NoteBlock/index.d.ts +1 -0
- package/lib/components/booking/notes/addNote/index.d.ts +1 -0
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/checkout/PaymentModal.js +241 -109
- package/lib/components/checkout/PaymentPlugin.d.ts +1 -0
- 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.js +5 -1
- 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.d.ts +1 -0
- 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/ConflictModal/index.d.ts +1 -0
- package/lib/components/checkout/components/WalletPassModule/components/DiscountWallet/index.d.ts +1 -0
- 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.d.ts +1 -1
- 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/surcharge/index.d.ts +1 -0
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/app.d.ts +1 -0
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/index.d.ts +1 -0
- package/lib/components/eftposPay/linkly/index.d.ts +1 -0
- package/lib/components/eftposPay/store/index.d.ts +6 -6
- package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
- package/lib/components/eventBooking/index.d.ts +1 -0
- package/lib/components/pay/toB/components/Cache/index.d.ts +1 -0
- package/lib/components/pay/toB/components/Card/index.d.ts +1 -0
- package/lib/components/pay/toB/components/CardGroup/index.d.ts +1 -0
- package/lib/components/pay/toB/components/ConfirmedPayment/index.d.ts +1 -0
- package/lib/components/pay/toB/components/Content/Footer.d.ts +1 -0
- package/lib/components/pay/toB/components/Content/Header.d.ts +1 -0
- package/lib/components/pay/toB/components/EFTPOS/index.js +25 -10
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/Finish/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/SDK.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/PageLoading/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/PaymentRequestForm.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/index.d.ts +1 -0
- package/lib/components/productExtension/index.d.ts +1 -0
- package/lib/components/productSelect/components/TabProduct/index.d.ts +1 -0
- package/lib/components/productSelect/components/productGroup/index.d.ts +1 -0
- package/lib/components/ruleSetting/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleList/RenderScheduleItem/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
- package/lib/components/schedules/utils.d.ts +1 -1
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/lib/components/taxSelect/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +7 -6
- package/lib/components/ticketBooking/components/addServiceVariant/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/bookingDataPanel/index.js +2 -2
- package/lib/components/ticketBooking/components/menuBar/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/menuBar/index.js +1 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.js +1 -1
- package/lib/components/ticketBooking/components/timeBar/index.d.ts +1 -0
- 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 +5 -13
- package/lib/components/ticketBooking/index.d.ts +1 -0
- package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
- package/lib/plus/clientCard/index.js +5 -4
- package/lib/plus/clientCard/index.less +3 -32
- package/lib/plus/clientName/index.d.ts +1 -0
- package/lib/plus/clinetSearch/Add/BirthdayField/index.d.ts +1 -0
- package/lib/plus/clinetSearch/Add/GenderField/index.d.ts +1 -0
- package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +1 -0
- package/lib/plus/noteModal/AddTempModal.d.ts +1 -0
- package/lib/plus/saasCreateOrganization/index.d.ts +1 -0
- 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 +1 -0
- package/lib/utils/index.d.ts +1 -1
- package/package.json +12 -12
@@ -1,3 +1,7 @@
|
|
1
|
+
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
|
2
|
+
function _regeneratorRuntime() { "use strict"; /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */ _regeneratorRuntime = function _regeneratorRuntime() { return e; }; var t, e = {}, r = Object.prototype, n = r.hasOwnProperty, o = Object.defineProperty || function (t, e, r) { t[e] = r.value; }, i = "function" == typeof Symbol ? Symbol : {}, a = i.iterator || "@@iterator", c = i.asyncIterator || "@@asyncIterator", u = i.toStringTag || "@@toStringTag"; function define(t, e, r) { return Object.defineProperty(t, e, { value: r, enumerable: !0, configurable: !0, writable: !0 }), t[e]; } try { define({}, ""); } catch (t) { define = function define(t, e, r) { return t[e] = r; }; } function wrap(t, e, r, n) { var i = e && e.prototype instanceof Generator ? e : Generator, a = Object.create(i.prototype), c = new Context(n || []); return o(a, "_invoke", { value: makeInvokeMethod(t, r, c) }), a; } function tryCatch(t, e, r) { try { return { type: "normal", arg: t.call(e, r) }; } catch (t) { return { type: "throw", arg: t }; } } e.wrap = wrap; var h = "suspendedStart", l = "suspendedYield", f = "executing", s = "completed", y = {}; function Generator() {} function GeneratorFunction() {} function GeneratorFunctionPrototype() {} var p = {}; define(p, a, function () { return this; }); var d = Object.getPrototypeOf, v = d && d(d(values([]))); v && v !== r && n.call(v, a) && (p = v); var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p); function defineIteratorMethods(t) { ["next", "throw", "return"].forEach(function (e) { define(t, e, function (t) { return this._invoke(e, t); }); }); } function AsyncIterator(t, e) { function invoke(r, o, i, a) { var c = tryCatch(t[r], t, o); if ("throw" !== c.type) { var u = c.arg, h = u.value; return h && "object" == _typeof(h) && n.call(h, "__await") ? e.resolve(h.__await).then(function (t) { invoke("next", t, i, a); }, function (t) { invoke("throw", t, i, a); }) : e.resolve(h).then(function (t) { u.value = t, i(u); }, function (t) { return invoke("throw", t, i, a); }); } a(c.arg); } var r; o(this, "_invoke", { value: function value(t, n) { function callInvokeWithMethodAndArg() { return new e(function (e, r) { invoke(t, n, e, r); }); } return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg(); } }); } function makeInvokeMethod(e, r, n) { var o = h; return function (i, a) { if (o === f) throw new Error("Generator is already running"); if (o === s) { if ("throw" === i) throw a; return { value: t, done: !0 }; } for (n.method = i, n.arg = a;;) { var c = n.delegate; if (c) { var u = maybeInvokeDelegate(c, n); if (u) { if (u === y) continue; return u; } } if ("next" === n.method) n.sent = n._sent = n.arg;else if ("throw" === n.method) { if (o === h) throw o = s, n.arg; n.dispatchException(n.arg); } else "return" === n.method && n.abrupt("return", n.arg); o = f; var p = tryCatch(e, r, n); if ("normal" === p.type) { if (o = n.done ? s : l, p.arg === y) continue; return { value: p.arg, done: n.done }; } "throw" === p.type && (o = s, n.method = "throw", n.arg = p.arg); } }; } function maybeInvokeDelegate(e, r) { var n = r.method, o = e.iterator[n]; if (o === t) return r.delegate = null, "throw" === n && e.iterator.return && (r.method = "return", r.arg = t, maybeInvokeDelegate(e, r), "throw" === r.method) || "return" !== n && (r.method = "throw", r.arg = new TypeError("The iterator does not provide a '" + n + "' method")), y; var i = tryCatch(o, e.iterator, r.arg); if ("throw" === i.type) return r.method = "throw", r.arg = i.arg, r.delegate = null, y; var a = i.arg; return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, "return" !== r.method && (r.method = "next", r.arg = t), r.delegate = null, y) : a : (r.method = "throw", r.arg = new TypeError("iterator result is not an object"), r.delegate = null, y); } function pushTryEntry(t) { var e = { tryLoc: t[0] }; 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e); } function resetTryEntry(t) { var e = t.completion || {}; e.type = "normal", delete e.arg, t.completion = e; } function Context(t) { this.tryEntries = [{ tryLoc: "root" }], t.forEach(pushTryEntry, this), this.reset(!0); } function values(e) { if (e || "" === e) { var r = e[a]; if (r) return r.call(e); if ("function" == typeof e.next) return e; if (!isNaN(e.length)) { var o = -1, i = function next() { for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next; return next.value = t, next.done = !0, next; }; return i.next = i; } } throw new TypeError(_typeof(e) + " is not iterable"); } return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, "constructor", { value: GeneratorFunctionPrototype, configurable: !0 }), o(GeneratorFunctionPrototype, "constructor", { value: GeneratorFunction, configurable: !0 }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, "GeneratorFunction"), e.isGeneratorFunction = function (t) { var e = "function" == typeof t && t.constructor; return !!e && (e === GeneratorFunction || "GeneratorFunction" === (e.displayName || e.name)); }, e.mark = function (t) { return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, "GeneratorFunction")), t.prototype = Object.create(g), t; }, e.awrap = function (t) { return { __await: t }; }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () { return this; }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) { void 0 === i && (i = Promise); var a = new AsyncIterator(wrap(t, r, n, o), i); return e.isGeneratorFunction(r) ? a : a.next().then(function (t) { return t.done ? t.value : a.next(); }); }, defineIteratorMethods(g), define(g, u, "Generator"), define(g, a, function () { return this; }), define(g, "toString", function () { return "[object Generator]"; }), e.keys = function (t) { var e = Object(t), r = []; for (var n in e) r.push(n); return r.reverse(), function next() { for (; r.length;) { var t = r.pop(); if (t in e) return next.value = t, next.done = !1, next; } return next.done = !0, next; }; }, e.values = values, Context.prototype = { constructor: Context, reset: function reset(e) { if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = "next", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) "t" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t); }, stop: function stop() { this.done = !0; var t = this.tryEntries[0].completion; if ("throw" === t.type) throw t.arg; return this.rval; }, dispatchException: function dispatchException(e) { if (this.done) throw e; var r = this; function handle(n, o) { return a.type = "throw", a.arg = e, r.next = n, o && (r.method = "next", r.arg = t), !!o; } for (var o = this.tryEntries.length - 1; o >= 0; --o) { var i = this.tryEntries[o], a = i.completion; if ("root" === i.tryLoc) return handle("end"); if (i.tryLoc <= this.prev) { var c = n.call(i, "catchLoc"), u = n.call(i, "finallyLoc"); if (c && u) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } else if (c) { if (this.prev < i.catchLoc) return handle(i.catchLoc, !0); } else { if (!u) throw new Error("try statement without catch or finally"); if (this.prev < i.finallyLoc) return handle(i.finallyLoc); } } } }, abrupt: function abrupt(t, e) { for (var r = this.tryEntries.length - 1; r >= 0; --r) { var o = this.tryEntries[r]; if (o.tryLoc <= this.prev && n.call(o, "finallyLoc") && this.prev < o.finallyLoc) { var i = o; break; } } i && ("break" === t || "continue" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null); var a = i ? i.completion : {}; return a.type = t, a.arg = e, i ? (this.method = "next", this.next = i.finallyLoc, y) : this.complete(a); }, complete: function complete(t, e) { if ("throw" === t.type) throw t.arg; return "break" === t.type || "continue" === t.type ? this.next = t.arg : "return" === t.type ? (this.rval = this.arg = t.arg, this.method = "return", this.next = "end") : "normal" === t.type && e && (this.next = e), y; }, finish: function finish(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y; } }, catch: function _catch(t) { for (var e = this.tryEntries.length - 1; e >= 0; --e) { var r = this.tryEntries[e]; if (r.tryLoc === t) { var n = r.completion; if ("throw" === n.type) { var o = n.arg; resetTryEntry(r); } return o; } } throw new Error("illegal catch attempt"); }, delegateYield: function delegateYield(e, r, n) { return this.delegate = { iterator: values(e), resultName: r, nextLoc: n }, "next" === this.method && (this.arg = t), y; } }, e; }
|
3
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
4
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
1
5
|
import React from 'react';
|
2
6
|
import { locales, formatAmount } from '@pisell/utils';
|
3
7
|
import Decimal from 'decimal.js';
|
@@ -43,7 +47,7 @@ export var calculateSubtitle = function calculateSubtitle(status, amount, gapAmo
|
|
43
47
|
if (gapAmount) {
|
44
48
|
// 找零金额不为0,显示找零金额
|
45
49
|
text = "".concat(locales.getText('payment.result.changeDue') || 'Change Due', " ").concat(formatCurrency(Math.abs(gapAmount), amountSymbol));
|
46
|
-
colorClass = '
|
50
|
+
colorClass = 'paid'; // 绿色
|
47
51
|
} else {
|
48
52
|
text = "".concat(locales.getText('payment.result.paid') || 'Paid', " ").concat(formatCurrency(amount, amountSymbol));
|
49
53
|
colorClass = 'paid'; // 绿色
|
@@ -69,7 +73,7 @@ export var calculateSubtitle = function calculateSubtitle(status, amount, gapAmo
|
|
69
73
|
// 返回带样式的JSX元素,包含完整的结构和样式
|
70
74
|
return /*#__PURE__*/React.createElement("div", {
|
71
75
|
className: "payment-result-toast-subtitle"
|
72
|
-
}, /*#__PURE__*/React.createElement("
|
76
|
+
}, /*#__PURE__*/React.createElement("div", {
|
73
77
|
className: getSubtitleClassName(colorClass)
|
74
78
|
}, text));
|
75
79
|
};
|
@@ -91,101 +95,136 @@ export var calculateStatusClassName = function calculateStatusClassName(status)
|
|
91
95
|
|
92
96
|
// 根据支付状态计算自动关闭配置
|
93
97
|
export var calculateAutoCloseConfig = function calculateAutoCloseConfig(status, hasChangeDue) {
|
98
|
+
var autoCloseDelay = 30;
|
94
99
|
switch (status) {
|
95
100
|
case 'paid':
|
96
101
|
return {
|
97
102
|
autoClose: true,
|
98
|
-
autoCloseDelay:
|
99
|
-
|
100
|
-
maskClosable: true
|
103
|
+
autoCloseDelay: autoCloseDelay,
|
104
|
+
maskClosable: false
|
101
105
|
};
|
102
106
|
case 'partially_paid':
|
103
107
|
return {
|
104
108
|
autoClose: true,
|
105
|
-
autoCloseDelay:
|
106
|
-
maskClosable:
|
109
|
+
autoCloseDelay: autoCloseDelay,
|
110
|
+
maskClosable: false
|
107
111
|
};
|
108
112
|
case 'failed':
|
109
113
|
case 'wallet-pass-redemption-failed':
|
110
114
|
return {
|
111
115
|
autoClose: false,
|
112
|
-
autoCloseDelay:
|
116
|
+
autoCloseDelay: autoCloseDelay,
|
113
117
|
maskClosable: false
|
114
118
|
};
|
115
119
|
default:
|
116
120
|
return {
|
117
121
|
autoClose: false,
|
118
|
-
autoCloseDelay:
|
122
|
+
autoCloseDelay: autoCloseDelay,
|
119
123
|
maskClosable: false
|
120
124
|
};
|
121
125
|
}
|
122
126
|
};
|
123
127
|
|
124
128
|
// 封装toast显示逻辑
|
125
|
-
export var displayPaymentResultToast = function
|
126
|
-
var
|
127
|
-
|
128
|
-
|
129
|
-
|
130
|
-
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
141
|
-
|
142
|
-
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
}
|
129
|
+
export var displayPaymentResultToast = /*#__PURE__*/function () {
|
130
|
+
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params, config) {
|
131
|
+
var paymentStatus, orderTotalAmount, gapAmount, failureReason, autoCloseConfig, actionButtons, getData, onToastClose;
|
132
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
133
|
+
while (1) switch (_context.prev = _context.next) {
|
134
|
+
case 0:
|
135
|
+
paymentStatus = params.paymentStatus, orderTotalAmount = params.orderTotalAmount, gapAmount = params.gapAmount, failureReason = params.failureReason, autoCloseConfig = params.autoCloseConfig, actionButtons = params.actionButtons;
|
136
|
+
getData = config.getData, onToastClose = config.onToastClose;
|
137
|
+
if (!(paymentStatus === 'paid')) {
|
138
|
+
_context.next = 7;
|
139
|
+
break;
|
140
|
+
}
|
141
|
+
_context.next = 5;
|
142
|
+
return showPaymentResultToastSuccess({
|
143
|
+
title: calculateTitle(paymentStatus),
|
144
|
+
subtitle: calculateSubtitle(paymentStatus, orderTotalAmount, gapAmount, getData),
|
145
|
+
autoClose: (autoCloseConfig === null || autoCloseConfig === void 0 ? void 0 : autoCloseConfig.autoClose) || false,
|
146
|
+
autoCloseDelay: (autoCloseConfig === null || autoCloseConfig === void 0 ? void 0 : autoCloseConfig.autoCloseDelay) || 3000,
|
147
|
+
showCountdownProgress: true,
|
148
|
+
actionButtons: actionButtons || [],
|
149
|
+
onClose: onToastClose || function () {},
|
150
|
+
// 提供默认空函数
|
151
|
+
closable: false // 控制关闭按钮显示
|
152
|
+
});
|
153
|
+
case 5:
|
154
|
+
_context.next = 15;
|
155
|
+
break;
|
156
|
+
case 7:
|
157
|
+
if (!(paymentStatus === 'partially_paid')) {
|
158
|
+
_context.next = 12;
|
159
|
+
break;
|
160
|
+
}
|
161
|
+
_context.next = 10;
|
162
|
+
return showPaymentResultToastSuccess({
|
163
|
+
title: calculateTitle(paymentStatus),
|
164
|
+
subtitle: calculateSubtitle(paymentStatus, orderTotalAmount, gapAmount, getData),
|
165
|
+
autoClose: (autoCloseConfig === null || autoCloseConfig === void 0 ? void 0 : autoCloseConfig.autoClose) || false,
|
166
|
+
actionButtons: actionButtons || [],
|
167
|
+
onClose: onToastClose || function () {} // 提供默认空函数
|
168
|
+
});
|
169
|
+
case 10:
|
170
|
+
_context.next = 15;
|
171
|
+
break;
|
172
|
+
case 12:
|
173
|
+
if (!(paymentStatus === 'failed' || paymentStatus === 'error')) {
|
174
|
+
_context.next = 15;
|
175
|
+
break;
|
176
|
+
}
|
177
|
+
_context.next = 15;
|
178
|
+
return showPaymentResultToastFailed({
|
179
|
+
title: calculateTitle(paymentStatus, failureReason),
|
180
|
+
subtitle: calculateSubtitle(paymentStatus, orderTotalAmount / 100, gapAmount, getData),
|
181
|
+
autoClose: (autoCloseConfig === null || autoCloseConfig === void 0 ? void 0 : autoCloseConfig.autoClose) || false,
|
182
|
+
actionButtons: actionButtons || [],
|
183
|
+
onClose: onToastClose || function () {} // 提供默认空函数
|
184
|
+
});
|
185
|
+
case 15:
|
186
|
+
case "end":
|
187
|
+
return _context.stop();
|
188
|
+
}
|
189
|
+
}, _callee);
|
190
|
+
}));
|
191
|
+
return function displayPaymentResultToast(_x, _x2) {
|
192
|
+
return _ref.apply(this, arguments);
|
193
|
+
};
|
194
|
+
}();
|
164
195
|
|
165
196
|
// 显示成功Toast的包装方法
|
166
197
|
export var createShowSuccessToast = function createShowSuccessToast(config, getActionButtons) {
|
167
|
-
return function (
|
168
|
-
var
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
|
173
|
-
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
198
|
+
return /*#__PURE__*/function () {
|
199
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(result) {
|
200
|
+
var _result$response;
|
201
|
+
var responseData, paymentStatus, orderTotalAmount, gapAmount, autoCloseConfig, actionButtons;
|
202
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
203
|
+
while (1) switch (_context2.prev = _context2.next) {
|
204
|
+
case 0:
|
205
|
+
// 获取支付状态和相关信息
|
206
|
+
responseData = (_result$response = result.response) === null || _result$response === void 0 ? void 0 : _result$response.data; // 获取支付状态
|
207
|
+
paymentStatus = responseData === null || responseData === void 0 ? void 0 : responseData.payment_status; // 获取订单总金额
|
208
|
+
orderTotalAmount = Number((responseData === null || responseData === void 0 ? void 0 : responseData.total_amount) || 0);
|
209
|
+
gapAmount = Number((responseData === null || responseData === void 0 ? void 0 : responseData.amount_gap) || 0); // 计算自动关闭配置
|
210
|
+
autoCloseConfig = calculateAutoCloseConfig(paymentStatus, !!gapAmount); // 获取按钮配置
|
211
|
+
actionButtons = getActionButtons ? getActionButtons(paymentStatus) : []; // 调用封装的toast显示方法
|
212
|
+
_context2.next = 8;
|
213
|
+
return displayPaymentResultToast({
|
214
|
+
paymentStatus: paymentStatus,
|
215
|
+
orderTotalAmount: orderTotalAmount,
|
216
|
+
gapAmount: gapAmount,
|
217
|
+
autoCloseConfig: autoCloseConfig,
|
218
|
+
actionButtons: actionButtons
|
219
|
+
}, config);
|
220
|
+
case 8:
|
221
|
+
case "end":
|
222
|
+
return _context2.stop();
|
223
|
+
}
|
224
|
+
}, _callee2);
|
225
|
+
}));
|
226
|
+
return function (_x3) {
|
227
|
+
return _ref2.apply(this, arguments);
|
228
|
+
};
|
229
|
+
}();
|
191
230
|
};
|
@@ -9,7 +9,7 @@ import { PosProps } from './const';
|
|
9
9
|
*/
|
10
10
|
declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
|
11
11
|
className?: string | undefined;
|
12
|
-
onChange?: ((status: "
|
12
|
+
onChange?: ((status: "success" | "page" | "fail" | "print" | "mark_tx_processed", params?: string | {
|
13
13
|
[keys: string]: unknown;
|
14
14
|
} | undefined, other?: any) => void) | undefined;
|
15
15
|
onClose: () => void;
|
@@ -1,3 +1,4 @@
|
|
1
|
+
/// <reference types="react" />
|
1
2
|
import { PosProps, RouteType } from './const';
|
2
3
|
declare const App: ({ action, api, device_number, terminal, tyroUrl, tyroVersion, onChangeParams, isMobile, channel, formatAmount, ...props }: Omit<PosProps, "type" | "mode" | "getApi"> & {
|
3
4
|
action: RouteType;
|
@@ -11,7 +11,7 @@ import './device.less';
|
|
11
11
|
declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, containerStyle, }: {
|
12
12
|
api: PayProps['api'];
|
13
13
|
className?: string | undefined;
|
14
|
-
onChange?: ((status: "
|
14
|
+
onChange?: ((status: "success" | "page" | "fail" | "print" | "mark_tx_processed", params?: string | {
|
15
15
|
[keys: string]: unknown;
|
16
16
|
} | undefined, other?: any) => void) | undefined;
|
17
17
|
onClose: () => void;
|
@@ -15,11 +15,11 @@ export declare const useStoreRef: <T extends {
|
|
15
15
|
readonly numRef: React.MutableRefObject<string | number | undefined>;
|
16
16
|
readonly orderIdRef: React.MutableRefObject<string | number>;
|
17
17
|
readonly modeRef: React.MutableRefObject<ModeEnum>;
|
18
|
-
readonly statusRef: React.MutableRefObject<"
|
18
|
+
readonly statusRef: React.MutableRefObject<"success" | "warn" | "loading" | "fail" | "pedding" | "resove" | "reject" | "question">;
|
19
19
|
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
20
20
|
readonly symbolRef: React.MutableRefObject<string>;
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
22
|
-
readonly eftposRef: React.MutableRefObject<"
|
22
|
+
readonly eftposRef: React.MutableRefObject<"payo" | "tyro" | "windcave" | "stripe" | "linkly">;
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
24
24
|
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
25
25
|
};
|
@@ -174,7 +174,7 @@ export declare const updateCustom: (payload: {
|
|
174
174
|
export declare const updateStatus: (status: 'loading' | 'warn' | 'fail' | 'success' | 'question') => {
|
175
175
|
type: EActionTypes;
|
176
176
|
payload: {
|
177
|
-
status: "
|
177
|
+
status: "success" | "warn" | "loading" | "fail" | "question";
|
178
178
|
};
|
179
179
|
};
|
180
180
|
/**
|
@@ -295,20 +295,20 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
295
295
|
name?: string | undefined;
|
296
296
|
symbol?: string | undefined;
|
297
297
|
amount?: string | number | undefined;
|
298
|
-
mode?: "pay" | "
|
298
|
+
mode?: "pay" | "fullPay" | "refund" | "query" | undefined;
|
299
299
|
order_id?: string | number | undefined;
|
300
|
-
eftpos?: "
|
301
|
-
action?: "
|
300
|
+
eftpos?: "payo" | "tyro" | "windcave" | "stripe" | "linkly" | undefined;
|
301
|
+
action?: "amount" | "pay" | "deviceList" | undefined;
|
302
302
|
key?: number | undefined;
|
303
303
|
step?: number | undefined;
|
304
304
|
title?: string | undefined;
|
305
305
|
subTitle?: string | undefined;
|
306
|
-
type?: "
|
306
|
+
type?: "step" | "unset" | undefined;
|
307
307
|
render?: boolean | undefined;
|
308
308
|
net?: boolean | undefined;
|
309
309
|
component?: string | undefined;
|
310
310
|
form?: string | undefined;
|
311
|
-
status?: "
|
311
|
+
status?: "success" | "warn" | "loading" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
|
312
312
|
warn?: string | undefined;
|
313
313
|
steps?: {
|
314
314
|
/** 用于重置当前步骤 */
|
@@ -14,6 +14,7 @@ import { useNetwork } from 'ahooks';
|
|
14
14
|
import EFTPos from "../../../../eftposPay/EFTPos";
|
15
15
|
import { request } from "../../../../../utils";
|
16
16
|
import useLogger from "../../../../../hooks/useLogger";
|
17
|
+
import { useEngineContext } from "../../../../../hooks";
|
17
18
|
import "./index.less";
|
18
19
|
var updateTransactionReceiveStatus = /*#__PURE__*/function () {
|
19
20
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee(params) {
|
@@ -32,6 +33,10 @@ var updateTransactionReceiveStatus = /*#__PURE__*/function () {
|
|
32
33
|
};
|
33
34
|
}();
|
34
35
|
var EFTPOS = function EFTPOS(props, ref) {
|
36
|
+
var _context$appHelper;
|
37
|
+
var context = useEngineContext();
|
38
|
+
var _ref2 = ((_context$appHelper = context.appHelper) === null || _context$appHelper === void 0 ? void 0 : _context$appHelper.utils) || {},
|
39
|
+
interaction = _ref2.interaction;
|
35
40
|
var logger = useLogger();
|
36
41
|
var network = useNetwork();
|
37
42
|
var _useState = useState(false),
|
@@ -71,63 +76,91 @@ var EFTPOS = function EFTPOS(props, ref) {
|
|
71
76
|
* @param {function} callback 支付结果回调
|
72
77
|
* @param {string} source 支付来源(正常支付、恢复支付)
|
73
78
|
*/
|
74
|
-
var onOpen = function
|
75
|
-
var
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
79
|
+
var onOpen = /*#__PURE__*/function () {
|
80
|
+
var _ref4 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(_ref3) {
|
81
|
+
var source, data, payCallback, device_number, _interaction$utils, _interaction$utils$as, type, payMethod, params, mode, newData, _newData$code;
|
82
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
83
|
+
while (1) switch (_context2.prev = _context2.next) {
|
84
|
+
case 0:
|
85
|
+
source = _ref3.source, data = _ref3.data, payCallback = _ref3.payCallback;
|
86
|
+
if (!(eftposHandlingRef.current || visible)) {
|
87
|
+
_context2.next = 4;
|
88
|
+
break;
|
89
|
+
}
|
90
|
+
logger === null || logger === void 0 || logger.addLog({
|
91
|
+
type: 'info',
|
92
|
+
title: 'ToB_EFTPOS_onOpen 重复触发被拦截',
|
93
|
+
metadata: {
|
94
|
+
data: data
|
95
|
+
}
|
96
|
+
});
|
97
|
+
return _context2.abrupt("return");
|
98
|
+
case 4:
|
99
|
+
// 设置支付状态为处理中
|
100
|
+
eftposHandlingRef.current = true;
|
101
|
+
// 获取设备编号
|
102
|
+
device_number = '';
|
103
|
+
_context2.prev = 6;
|
104
|
+
_context2.next = 9;
|
105
|
+
return interaction === null || interaction === void 0 || (_interaction$utils = interaction.utils) === null || _interaction$utils === void 0 || (_interaction$utils$as = _interaction$utils.asyncDataManager) === null || _interaction$utils$as === void 0 ? void 0 : _interaction$utils$as.call(_interaction$utils, {
|
106
|
+
module: 'get',
|
107
|
+
key: 'device_number'
|
108
|
+
});
|
109
|
+
case 9:
|
110
|
+
device_number = _context2.sent;
|
111
|
+
_context2.next = 15;
|
112
|
+
break;
|
113
|
+
case 12:
|
114
|
+
_context2.prev = 12;
|
115
|
+
_context2.t0 = _context2["catch"](6);
|
116
|
+
console.error('获取设备编号失败', _context2.t0);
|
117
|
+
case 15:
|
118
|
+
type = data.type, payMethod = data.payMethod, params = data.params, mode = data.mode;
|
119
|
+
newData = {
|
120
|
+
type: type,
|
121
|
+
code: payMethod.code,
|
122
|
+
terminal: {
|
123
|
+
network: network.online
|
124
|
+
},
|
125
|
+
apiParams: {
|
126
|
+
order_id: params.orderId,
|
127
|
+
name: payMethod.name,
|
128
|
+
symbol: params.symbol,
|
129
|
+
amount: params.amount,
|
130
|
+
device_number: device_number
|
131
|
+
},
|
132
|
+
mode: mode
|
133
|
+
};
|
134
|
+
console.log('newData>>>>>>>>>>>>>>', newData);
|
135
|
+
if (!(newData !== null && newData !== void 0 && newData.type) && newData !== null && newData !== void 0 && newData.code) {
|
136
|
+
newData.type = (_newData$code = newData.code) === null || _newData$code === void 0 || (_newData$code = _newData$code.split('_')) === null || _newData$code === void 0 || (_newData$code = _newData$code[1]) === null || _newData$code === void 0 ? void 0 : _newData$code.toLocaleLowerCase();
|
137
|
+
}
|
138
|
+
logger === null || logger === void 0 || logger.addLog({
|
139
|
+
type: 'info',
|
140
|
+
title: 'ToB_EFTPOS_onOpen 开始调用',
|
141
|
+
metadata: {
|
142
|
+
params: data,
|
143
|
+
initData: newData
|
144
|
+
}
|
145
|
+
});
|
146
|
+
eftposOpenParamsRef.current = data;
|
147
|
+
payCallbackRef.current = payCallback;
|
148
|
+
eftposInitDataRef.current = {
|
149
|
+
data: newData,
|
150
|
+
source: source
|
151
|
+
};
|
152
|
+
setVisible(true);
|
153
|
+
setIsEftposLoading(true);
|
154
|
+
case 25:
|
155
|
+
case "end":
|
156
|
+
return _context2.stop();
|
85
157
|
}
|
86
|
-
});
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
// 设置支付状态为处理中
|
91
|
-
eftposHandlingRef.current = true;
|
92
|
-
var type = data.type,
|
93
|
-
payMethod = data.payMethod,
|
94
|
-
params = data.params,
|
95
|
-
mode = data.mode;
|
96
|
-
var newData = {
|
97
|
-
type: type,
|
98
|
-
code: payMethod.code,
|
99
|
-
terminal: {
|
100
|
-
network: network.online
|
101
|
-
},
|
102
|
-
apiParams: {
|
103
|
-
order_id: params.orderId,
|
104
|
-
name: payMethod.name,
|
105
|
-
symbol: params.symbol,
|
106
|
-
amount: params.amount
|
107
|
-
},
|
108
|
-
mode: mode
|
158
|
+
}, _callee2, null, [[6, 12]]);
|
159
|
+
}));
|
160
|
+
return function onOpen(_x2) {
|
161
|
+
return _ref4.apply(this, arguments);
|
109
162
|
};
|
110
|
-
|
111
|
-
var _newData$code;
|
112
|
-
newData.type = (_newData$code = newData.code) === null || _newData$code === void 0 || (_newData$code = _newData$code.split('_')) === null || _newData$code === void 0 || (_newData$code = _newData$code[1]) === null || _newData$code === void 0 ? void 0 : _newData$code.toLocaleLowerCase();
|
113
|
-
}
|
114
|
-
logger === null || logger === void 0 || logger.addLog({
|
115
|
-
type: 'info',
|
116
|
-
title: 'ToB_EFTPOS_onOpen 开始调用',
|
117
|
-
metadata: {
|
118
|
-
params: data,
|
119
|
-
initData: newData
|
120
|
-
}
|
121
|
-
});
|
122
|
-
eftposOpenParamsRef.current = data;
|
123
|
-
payCallbackRef.current = payCallback;
|
124
|
-
eftposInitDataRef.current = {
|
125
|
-
data: newData,
|
126
|
-
source: source
|
127
|
-
};
|
128
|
-
setVisible(true);
|
129
|
-
setIsEftposLoading(true);
|
130
|
-
};
|
163
|
+
}();
|
131
164
|
var onEftposLoad = function onEftposLoad(status) {
|
132
165
|
logger === null || logger === void 0 || logger.addLog({
|
133
166
|
type: 'info',
|
@@ -190,9 +223,9 @@ var EFTPOS = function EFTPOS(props, ref) {
|
|
190
223
|
* @param {string} status 支付状态
|
191
224
|
* @param {any} params 支付参数
|
192
225
|
*/
|
193
|
-
var onPayResult = function onPayResult(
|
194
|
-
var status =
|
195
|
-
params =
|
226
|
+
var onPayResult = function onPayResult(_ref5) {
|
227
|
+
var status = _ref5.status,
|
228
|
+
params = _ref5.params;
|
196
229
|
logger === null || logger === void 0 || logger.addLog({
|
197
230
|
type: 'info',
|
198
231
|
title: 'ToB_EFTPOS_onPayResult',
|