@pisell/private-materials 6.6.5 → 6.6.6
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 +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/Footer/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Services/index.js +25 -22
- package/es/components/appointmentBooking/components/Voucher/index.js +15 -1
- package/es/components/booking/addons/index.js +25 -17
- package/es/components/booking/components/actionButtons/index.js +3 -1
- 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 +36 -33
- package/es/components/booking/components/footer/utils.d.ts +19 -0
- package/es/components/booking/components/footer/utils.js +166 -67
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/es/components/booking/components/voucher/index.js +53 -15
- package/es/components/booking/forms/table/index.d.ts +0 -1
- 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/dateRange/index.d.ts +0 -1
- package/es/components/booking/info/service/like/index.d.ts +0 -1
- package/es/components/booking/info/service2/utils.js +1 -0
- package/es/components/booking/info2/cartClientCard/index.js +5 -3
- package/es/components/booking/info2/service/addService/index.js +9 -9
- package/es/components/booking/info2/service/editNormalService/index.js +6 -0
- package/es/components/booking/info2/service/editService/index.js +27 -17
- 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/materiels/startTime/index.d.ts +0 -1
- package/es/components/booking/utils.d.ts +1 -0
- package/es/components/booking/utils.js +15 -2
- package/es/components/checkout/components/AmountSummary/index.less +4 -5
- package/es/components/eftpos/deviceList/index.d.ts +0 -1
- package/es/components/eftpos/form/index.d.ts +0 -1
- package/es/components/eftpos/group/index.d.ts +0 -1
- package/es/components/eftpos/hooks.d.ts +0 -1
- package/es/components/eftpos/icon/apiKey.d.ts +0 -1
- package/es/components/eftpos/icon/device.d.ts +0 -1
- package/es/components/eftpos/receipt/index.d.ts +0 -1
- package/es/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/es/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/es/components/eftposPay/component/step/index.d.ts +0 -1
- package/es/components/eftposPay/component/step/step.d.ts +0 -1
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +14 -6
- package/es/components/eftposPay/payo/config.d.ts +1 -0
- 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 +1 -1
- package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
- 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/Provider/InformationOptionsModal/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/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 -2
- package/es/components/index.js +2 -2
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +13 -11
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.js +2 -0
- package/es/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.less +13 -3
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- 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/productExtension/fields/Forms/index.d.ts +0 -1
- package/es/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/es/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/es/components/schedules/products/index.d.ts +0 -1
- package/es/components/schedules/resources/relationProduct/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/{wallet/serve.js → systemSettings/registry/components/GroupModal.js} +145 -190
- 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/addServiceVariant/addService.js +7 -5
- package/es/components/ticketBooking/utils/index.d.ts +5 -1
- package/es/components/ticketBooking/utils/index.js +37 -17
- package/es/components/walletList/index.d.ts +0 -25
- package/es/components/walletList/index.js +173 -41
- package/es/components/walletList/locales.d.ts +9 -0
- package/es/components/walletList/locales.js +12 -3
- package/es/components/walletList/serve.d.ts +19 -0
- package/es/components/walletList/serve.js +94 -5
- package/es/components/walletList/tempHolderSelector/index.d.ts +14 -0
- package/es/components/walletList/tempHolderSelector/index.js +196 -0
- package/es/components/walletList/tempHolderSelector/index.less +63 -0
- package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/es/index.d.ts +3 -2
- package/es/index.js +4 -3
- package/es/plus/clientName/index.d.ts +0 -1
- package/es/plus/walletEditor/WalletEditor.js +60 -2
- package/es/plus/walletEditor/locales.d.ts +9 -0
- package/es/plus/walletEditor/locales.js +12 -3
- 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.js +5 -1
- package/es/plus/walletPassGallery/components/passDetail/index.less +4 -0
- package/es/plus/walletPassGallery/components/passList/index.d.ts +1 -0
- package/es/plus/walletPassGallery/components/passList/index.js +17 -5
- package/es/plus/walletPassGallery/components/recharge/index.js +19 -8
- package/es/plus/walletPassGallery/index.js +226 -42
- package/es/plus/walletPassGallery/locales.d.ts +15 -0
- package/es/plus/walletPassGallery/locales.js +29 -5
- package/es/plus/walletPassGallery/serve.d.ts +15 -1
- package/es/plus/walletPassGallery/serve.js +59 -2
- package/es/plus/walletPassGallery/utils.d.ts +48 -0
- package/es/plus/walletPassGallery/utils.js +342 -0
- package/es/pro/Login2.0/index.less +15 -8
- package/es/pro/pisellPaymentList/example.d.ts +0 -1
- package/es/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +35 -30
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Services/index.js +5 -2
- package/lib/components/appointmentBooking/components/Voucher/index.js +13 -1
- package/lib/components/booking/addons/index.js +15 -7
- package/lib/components/booking/components/actionButtons/index.js +4 -2
- 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 +5 -2
- package/lib/components/booking/components/footer/utils.d.ts +19 -0
- package/lib/components/booking/components/footer/utils.js +111 -35
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/lib/components/booking/components/voucher/index.js +56 -16
- package/lib/components/booking/forms/table/index.d.ts +0 -1
- 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/dateRange/index.d.ts +0 -1
- package/lib/components/booking/info/service/like/index.d.ts +0 -1
- package/lib/components/booking/info/service2/utils.js +1 -0
- package/lib/components/booking/info2/cartClientCard/index.js +4 -2
- package/lib/components/booking/info2/service/addService/index.js +1 -1
- package/lib/components/booking/info2/service/editNormalService/index.js +6 -0
- package/lib/components/booking/info2/service/editService/index.js +30 -8
- 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/materiels/startTime/index.d.ts +0 -1
- package/lib/components/booking/utils.d.ts +1 -0
- package/lib/components/booking/utils.js +11 -0
- package/lib/components/checkout/components/AmountSummary/index.less +4 -5
- package/lib/components/eftpos/deviceList/index.d.ts +0 -1
- package/lib/components/eftpos/form/index.d.ts +0 -1
- package/lib/components/eftpos/group/index.d.ts +0 -1
- package/lib/components/eftpos/hooks.d.ts +0 -1
- package/lib/components/eftpos/icon/apiKey.d.ts +0 -1
- package/lib/components/eftpos/icon/device.d.ts +0 -1
- package/lib/components/eftpos/receipt/index.d.ts +0 -1
- package/lib/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/lib/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/lib/components/eftposPay/component/step/index.d.ts +0 -1
- package/lib/components/eftposPay/component/step/step.d.ts +0 -1
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +12 -6
- package/lib/components/eftposPay/payo/config.d.ts +1 -0
- 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 +1 -1
- package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
- 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/Provider/InformationOptionsModal/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/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 -2
- package/lib/components/index.js +3 -3
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +13 -11
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/StripeSDK/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.js +1 -1
- package/lib/components/pay/toC/PaymentMethods/components/PaymentReturnContent/index.less +13 -3
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- 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/productExtension/fields/Forms/index.d.ts +0 -1
- package/lib/components/schedules/calendar/calendarItem.d.ts +0 -1
- package/lib/components/schedules/components/CurrentDay/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +0 -1
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetailByDate/index.d.ts +0 -1
- package/lib/components/schedules/products/index.d.ts +0 -1
- package/lib/components/schedules/resources/relationProduct/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/{wallet → systemSettings/registry}/components/index.js +13 -10
- 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/{wallet/RechargeableCard/serve.js → systemSettings/registry/types.js} +3 -19
- 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/addServiceVariant/addService.js +9 -7
- package/lib/components/ticketBooking/utils/index.d.ts +5 -1
- package/lib/components/ticketBooking/utils/index.js +21 -6
- package/lib/components/walletList/index.d.ts +0 -25
- package/lib/components/walletList/index.js +100 -4
- package/lib/components/walletList/locales.d.ts +9 -0
- package/lib/components/walletList/locales.js +12 -3
- package/lib/components/walletList/serve.d.ts +19 -0
- package/lib/components/walletList/serve.js +26 -3
- package/lib/components/walletList/tempHolderSelector/index.d.ts +14 -0
- package/lib/components/walletList/tempHolderSelector/index.js +166 -0
- package/lib/components/walletList/tempHolderSelector/index.less +63 -0
- package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/lib/index.d.ts +3 -2
- package/lib/index.js +5 -2
- package/lib/plus/clientName/index.d.ts +0 -1
- package/lib/plus/walletEditor/WalletEditor.js +53 -0
- package/lib/plus/walletEditor/locales.d.ts +9 -0
- package/lib/plus/walletEditor/locales.js +12 -3
- 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.js +4 -1
- package/lib/plus/walletPassGallery/components/passDetail/index.less +4 -0
- package/lib/plus/walletPassGallery/components/passList/index.d.ts +1 -0
- package/lib/plus/walletPassGallery/components/passList/index.js +16 -4
- package/lib/plus/walletPassGallery/components/recharge/index.js +7 -1
- package/lib/plus/walletPassGallery/index.js +157 -28
- package/lib/plus/walletPassGallery/locales.d.ts +15 -0
- package/lib/plus/walletPassGallery/locales.js +32 -5
- package/lib/plus/walletPassGallery/serve.d.ts +15 -1
- package/lib/plus/walletPassGallery/serve.js +17 -5
- package/lib/plus/walletPassGallery/utils.d.ts +48 -0
- package/lib/plus/walletPassGallery/utils.js +287 -0
- package/lib/pro/Login2.0/index.less +15 -8
- package/lib/pro/pisellPaymentList/example.d.ts +0 -1
- package/lib/pro/priceKeyboard/components/cashKeyboard/CashKeyboardIntact.js +34 -39
- package/lowcode/settings-registry/meta.ts +29 -0
- package/package.json +3 -3
- package/es/components/wallet/Detail/index.d.ts +0 -42
- package/es/components/wallet/Detail/index.js +0 -1182
- package/es/components/wallet/Detail/index.less +0 -386
- package/es/components/wallet/Detail/locales.d.ts +0 -153
- package/es/components/wallet/Detail/locales.js +0 -170
- package/es/components/wallet/Detail/model.d.ts +0 -13
- package/es/components/wallet/Detail/model.js +0 -22
- package/es/components/wallet/Detail/serve.d.ts +0 -39
- package/es/components/wallet/Detail/serve.js +0 -64
- package/es/components/wallet/DetailContext.d.ts +0 -25
- package/es/components/wallet/DetailContext.js +0 -162
- package/es/components/wallet/DiscountCard/index.d.ts +0 -3
- package/es/components/wallet/DiscountCard/index.js +0 -218
- package/es/components/wallet/DiscountCard/index.less +0 -9
- package/es/components/wallet/DiscountCard/model.d.ts +0 -14
- package/es/components/wallet/DiscountCard/model.js +0 -22
- package/es/components/wallet/PointCard/index.d.ts +0 -3
- package/es/components/wallet/PointCard/index.js +0 -169
- package/es/components/wallet/PointCard/index.less +0 -9
- package/es/components/wallet/PointCard/model.d.ts +0 -13
- package/es/components/wallet/PointCard/model.js +0 -22
- package/es/components/wallet/RechargeableCard/index.d.ts +0 -13
- package/es/components/wallet/RechargeableCard/index.js +0 -463
- package/es/components/wallet/RechargeableCard/index.less +0 -108
- package/es/components/wallet/RechargeableCard/model.d.ts +0 -29
- package/es/components/wallet/RechargeableCard/model.js +0 -28
- package/es/components/wallet/RechargeableCard/serve.d.ts +0 -23
- package/es/components/wallet/RechargeableCard/serve.js +0 -32
- package/es/components/wallet/Voucher/index.d.ts +0 -12
- package/es/components/wallet/Voucher/index.js +0 -131
- package/es/components/wallet/Voucher/index.less +0 -9
- package/es/components/wallet/Voucher/locales.d.ts +0 -21
- package/es/components/wallet/Voucher/locales.js +0 -20
- package/es/components/wallet/Voucher/model.d.ts +0 -13
- package/es/components/wallet/Voucher/model.js +0 -22
- package/es/components/wallet/carouselArrow.png +0 -0
- package/es/components/wallet/components/FooterButtons/index.d.ts +0 -18
- package/es/components/wallet/components/FooterButtons/index.js +0 -81
- package/es/components/wallet/components/FooterButtons/index.less +0 -91
- package/es/components/wallet/components/UsageRules/index.d.ts +0 -23
- package/es/components/wallet/components/UsageRules/index.js +0 -147
- package/es/components/wallet/components/UsageRules/index.less +0 -157
- package/es/components/wallet/components/WalletBar/index.d.ts +0 -8
- package/es/components/wallet/components/WalletBar/index.js +0 -19
- package/es/components/wallet/components/WalletBar/index.less +0 -36
- package/es/components/wallet/components/WalletCard.d.ts +0 -11
- package/es/components/wallet/components/WalletCard.js +0 -91
- package/es/components/wallet/components/index.d.ts +0 -3
- package/es/components/wallet/components/index.js +0 -4
- package/es/components/wallet/hooks/useWalletCard.d.ts +0 -34
- package/es/components/wallet/hooks/useWalletCard.js +0 -147
- package/es/components/wallet/index.d.ts +0 -10
- package/es/components/wallet/index.js +0 -807
- package/es/components/wallet/index.less +0 -151
- package/es/components/wallet/locales.d.ts +0 -132
- package/es/components/wallet/locales.js +0 -139
- package/es/components/wallet/model.d.ts +0 -37
- package/es/components/wallet/model.js +0 -86
- package/es/components/wallet/serve.d.ts +0 -150
- package/es/components/wallet/utils/formatUtils.d.ts +0 -36
- package/es/components/wallet/utils/formatUtils.js +0 -73
- package/lib/components/wallet/Detail/index.d.ts +0 -42
- package/lib/components/wallet/Detail/index.js +0 -874
- package/lib/components/wallet/Detail/index.less +0 -386
- package/lib/components/wallet/Detail/locales.d.ts +0 -153
- package/lib/components/wallet/Detail/locales.js +0 -194
- package/lib/components/wallet/Detail/model.d.ts +0 -13
- package/lib/components/wallet/Detail/model.js +0 -43
- package/lib/components/wallet/Detail/serve.d.ts +0 -39
- package/lib/components/wallet/Detail/serve.js +0 -44
- package/lib/components/wallet/DetailContext.d.ts +0 -25
- package/lib/components/wallet/DetailContext.js +0 -118
- package/lib/components/wallet/DiscountCard/index.d.ts +0 -3
- package/lib/components/wallet/DiscountCard/index.js +0 -209
- package/lib/components/wallet/DiscountCard/index.less +0 -9
- package/lib/components/wallet/DiscountCard/model.d.ts +0 -14
- package/lib/components/wallet/DiscountCard/model.js +0 -43
- package/lib/components/wallet/PointCard/index.d.ts +0 -3
- package/lib/components/wallet/PointCard/index.js +0 -190
- package/lib/components/wallet/PointCard/index.less +0 -9
- package/lib/components/wallet/PointCard/model.d.ts +0 -13
- package/lib/components/wallet/PointCard/model.js +0 -43
- package/lib/components/wallet/RechargeableCard/index.d.ts +0 -13
- package/lib/components/wallet/RechargeableCard/index.js +0 -380
- package/lib/components/wallet/RechargeableCard/index.less +0 -108
- package/lib/components/wallet/RechargeableCard/model.d.ts +0 -29
- package/lib/components/wallet/RechargeableCard/model.js +0 -49
- package/lib/components/wallet/RechargeableCard/serve.d.ts +0 -23
- package/lib/components/wallet/Voucher/index.d.ts +0 -12
- package/lib/components/wallet/Voucher/index.js +0 -146
- package/lib/components/wallet/Voucher/index.less +0 -9
- package/lib/components/wallet/Voucher/locales.d.ts +0 -21
- package/lib/components/wallet/Voucher/locales.js +0 -44
- package/lib/components/wallet/Voucher/model.d.ts +0 -13
- package/lib/components/wallet/Voucher/model.js +0 -43
- package/lib/components/wallet/carouselArrow.png +0 -0
- package/lib/components/wallet/components/FooterButtons/index.d.ts +0 -18
- package/lib/components/wallet/components/FooterButtons/index.js +0 -109
- package/lib/components/wallet/components/FooterButtons/index.less +0 -91
- package/lib/components/wallet/components/UsageRules/index.d.ts +0 -23
- package/lib/components/wallet/components/UsageRules/index.js +0 -113
- package/lib/components/wallet/components/UsageRules/index.less +0 -157
- package/lib/components/wallet/components/WalletBar/index.d.ts +0 -8
- package/lib/components/wallet/components/WalletBar/index.js +0 -49
- package/lib/components/wallet/components/WalletBar/index.less +0 -36
- package/lib/components/wallet/components/WalletCard.d.ts +0 -11
- package/lib/components/wallet/components/WalletCard.js +0 -97
- package/lib/components/wallet/components/index.d.ts +0 -3
- package/lib/components/wallet/hooks/useWalletCard.d.ts +0 -34
- package/lib/components/wallet/hooks/useWalletCard.js +0 -111
- package/lib/components/wallet/index.d.ts +0 -10
- package/lib/components/wallet/index.js +0 -580
- package/lib/components/wallet/index.less +0 -151
- package/lib/components/wallet/locales.d.ts +0 -132
- package/lib/components/wallet/locales.js +0 -163
- package/lib/components/wallet/model.d.ts +0 -37
- package/lib/components/wallet/model.js +0 -91
- package/lib/components/wallet/serve.d.ts +0 -150
- package/lib/components/wallet/serve.js +0 -85
- package/lib/components/wallet/utils/formatUtils.d.ts +0 -36
- package/lib/components/wallet/utils/formatUtils.js +0 -73
|
@@ -1,6 +1,8 @@
|
|
|
1
|
+
var __create = Object.create;
|
|
1
2
|
var __defProp = Object.defineProperty;
|
|
2
3
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
4
6
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
7
|
var __export = (target, all) => {
|
|
6
8
|
for (var name in all)
|
|
@@ -14,21 +16,32 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
14
16
|
}
|
|
15
17
|
return to;
|
|
16
18
|
};
|
|
19
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
+
mod
|
|
26
|
+
));
|
|
17
27
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
28
|
|
|
19
29
|
// src/components/booking/info2/service/editService/utils.tsx
|
|
20
30
|
var utils_exports = {};
|
|
21
31
|
__export(utils_exports, {
|
|
22
32
|
getAutoAllocationStorage: () => getAutoAllocationStorage,
|
|
23
|
-
setAutoAllocationStorage: () => setAutoAllocationStorage
|
|
33
|
+
setAutoAllocationStorage: () => setAutoAllocationStorage,
|
|
34
|
+
setProductPrice: () => setProductPrice
|
|
24
35
|
});
|
|
25
36
|
module.exports = __toCommonJS(utils_exports);
|
|
26
37
|
var import_utils = require("@pisell/utils");
|
|
38
|
+
var import_utils2 = require("@pisell/utils");
|
|
39
|
+
var import_decimal = __toESM(require("decimal.js"));
|
|
27
40
|
var getAutoAllocationStorage = (id) => {
|
|
28
41
|
const value = localStorage.getItem("resource-auto-allocation");
|
|
29
42
|
if (value) {
|
|
30
43
|
const valueObj = JSON.parse(value);
|
|
31
|
-
return (0,
|
|
44
|
+
return (0, import_utils2.isBoolean)(valueObj[id]) ? valueObj[id] : true;
|
|
32
45
|
}
|
|
33
46
|
return true;
|
|
34
47
|
};
|
|
@@ -41,8 +54,32 @@ var setAutoAllocationStorage = (data) => {
|
|
|
41
54
|
localStorage.setItem("resource-auto-allocation", JSON.stringify({ ...data }));
|
|
42
55
|
}
|
|
43
56
|
};
|
|
57
|
+
var setProductPrice = (cacheItem, { newTotal, origin_total }) => {
|
|
58
|
+
var _a, _b, _c, _d, _e, _f, _g, _h;
|
|
59
|
+
const discountRatio = new import_decimal.default(newTotal).div(new import_decimal.default(origin_total));
|
|
60
|
+
let subTotal = new import_decimal.default(0);
|
|
61
|
+
if (((_a = cacheItem._extend.other) == null ? void 0 : _a.bundle) && (0, import_utils.isArr)((_b = cacheItem._extend.other) == null ? void 0 : _b.bundle)) {
|
|
62
|
+
(_d = (_c = cacheItem._extend.other) == null ? void 0 : _c.bundle) == null ? void 0 : _d.forEach((bundle) => {
|
|
63
|
+
const newPrice = new import_decimal.default(bundle.original_price || bundle.price).mul(discountRatio).toDecimalPlaces(2, import_decimal.default.ROUND_DOWN).toNumber();
|
|
64
|
+
const quantity = bundle.num ?? bundle.quantity ?? 1;
|
|
65
|
+
subTotal = subTotal.add(new import_decimal.default(newPrice).mul(quantity));
|
|
66
|
+
bundle.price = newPrice;
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
if (((_e = cacheItem._extend.other) == null ? void 0 : _e.option) && (0, import_utils.isArr)((_f = cacheItem._extend.other) == null ? void 0 : _f.option)) {
|
|
70
|
+
(_h = (_g = cacheItem._extend.other) == null ? void 0 : _g.option) == null ? void 0 : _h.forEach((option) => {
|
|
71
|
+
const newPrice = new import_decimal.default(option.price).mul(discountRatio).toDecimalPlaces(2, import_decimal.default.ROUND_DOWN).toNumber();
|
|
72
|
+
const quantity = option.num ?? option.quantity ?? 1;
|
|
73
|
+
subTotal = subTotal.add(new import_decimal.default(newPrice).mul(quantity));
|
|
74
|
+
option.price = newPrice;
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
cacheItem._extend.price = new import_decimal.default(newTotal).sub(subTotal).toNumber();
|
|
78
|
+
return cacheItem;
|
|
79
|
+
};
|
|
44
80
|
// Annotate the CommonJS export names for ESM import in node:
|
|
45
81
|
0 && (module.exports = {
|
|
46
82
|
getAutoAllocationStorage,
|
|
47
|
-
setAutoAllocationStorage
|
|
83
|
+
setAutoAllocationStorage,
|
|
84
|
+
setProductPrice
|
|
48
85
|
});
|
|
@@ -161,6 +161,7 @@ export declare const getIsOnlySession: (item: any) => boolean;
|
|
|
161
161
|
* @Date: 2024-01-26 14:09
|
|
162
162
|
*/
|
|
163
163
|
export declare const getServerItemExtend: (state: any, cacheItem: any, timeObj: any) => any;
|
|
164
|
+
export declare const getMainPrice: (item: any, price?: number) => number;
|
|
164
165
|
export declare const getProductTotalPrice: (item: any) => number;
|
|
165
166
|
/**
|
|
166
167
|
* @title: 判断 duration
|
|
@@ -47,6 +47,7 @@ __export(utils_exports, {
|
|
|
47
47
|
getIsEject: () => getIsEject,
|
|
48
48
|
getIsOnlySession: () => getIsOnlySession,
|
|
49
49
|
getLastServer: () => getLastServer,
|
|
50
|
+
getMainPrice: () => getMainPrice,
|
|
50
51
|
getNowTime: () => getNowTime,
|
|
51
52
|
getProductTotalPrice: () => getProductTotalPrice,
|
|
52
53
|
getResourceTimeIsUsable: () => getResourceTimeIsUsable,
|
|
@@ -624,6 +625,15 @@ var getServerItemExtend = (state, cacheItem, timeObj) => {
|
|
|
624
625
|
}
|
|
625
626
|
return _extend;
|
|
626
627
|
};
|
|
628
|
+
var getMainPrice = (item, price) => {
|
|
629
|
+
var _a;
|
|
630
|
+
let newPrice = new import_decimal.default(price || item._extend.price || 0);
|
|
631
|
+
let other = (_a = item._extend) == null ? void 0 : _a.other;
|
|
632
|
+
if (other == null ? void 0 : other.product_variant_id) {
|
|
633
|
+
newPrice = new import_decimal.default((other == null ? void 0 : other.price) || 0);
|
|
634
|
+
}
|
|
635
|
+
return newPrice.toNumber();
|
|
636
|
+
};
|
|
627
637
|
var getProductTotalPrice = (item) => {
|
|
628
638
|
var _a;
|
|
629
639
|
let price = new import_decimal.default(item._extend.price || 0);
|
|
@@ -718,6 +728,7 @@ var getIsEdit = (state) => {
|
|
|
718
728
|
getIsEject,
|
|
719
729
|
getIsOnlySession,
|
|
720
730
|
getLastServer,
|
|
731
|
+
getMainPrice,
|
|
721
732
|
getNowTime,
|
|
722
733
|
getProductTotalPrice,
|
|
723
734
|
getResourceTimeIsUsable,
|
|
@@ -248,7 +248,6 @@
|
|
|
248
248
|
|
|
249
249
|
.balance-due-label {
|
|
250
250
|
font-size: 16px;
|
|
251
|
-
color: #7f56da;
|
|
252
251
|
font-weight: 400;
|
|
253
252
|
line-height: 1.5;
|
|
254
253
|
margin-bottom: 4px;
|
|
@@ -256,7 +255,7 @@
|
|
|
256
255
|
|
|
257
256
|
.balance-due-amount {
|
|
258
257
|
font-size: 14px;
|
|
259
|
-
font-weight:
|
|
258
|
+
font-weight: 600;
|
|
260
259
|
color: #7f56da;
|
|
261
260
|
line-height: 0.75;
|
|
262
261
|
text-decoration: underline;
|
|
@@ -272,13 +271,13 @@
|
|
|
272
271
|
.pay-text {
|
|
273
272
|
font-size: 16px;
|
|
274
273
|
font-weight: 500;
|
|
275
|
-
color: #7f56da;
|
|
276
274
|
letter-spacing: 0.09375em;
|
|
275
|
+
margin-top: 12px;
|
|
277
276
|
}
|
|
278
277
|
|
|
279
278
|
.pay-amount {
|
|
280
|
-
font-size:
|
|
281
|
-
font-weight:
|
|
279
|
+
font-size: 36px;
|
|
280
|
+
font-weight: 600;
|
|
282
281
|
color: #1e1830;
|
|
283
282
|
line-height: 0.75;
|
|
284
283
|
}
|
|
@@ -41,6 +41,7 @@ var import_const = require("../../const");
|
|
|
41
41
|
var import_const2 = require("../const");
|
|
42
42
|
var GlobalTimeout = 1e3 * 60 * 2;
|
|
43
43
|
var RequestTimeout = 1e3 * 5;
|
|
44
|
+
var QUERY_INTERVAL = 1e3 * 2;
|
|
44
45
|
var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
|
45
46
|
const dispatch = (0, import_store.useDispatch)();
|
|
46
47
|
const { numRef, modeRef, deviceRef, orderIdRef } = (0, import_hooks.useStoreRef)();
|
|
@@ -56,6 +57,7 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
|
|
56
57
|
const startTimeRef = (0, import_react.useRef)(null);
|
|
57
58
|
const isQueryFinishedRef = (0, import_react.useRef)(true);
|
|
58
59
|
const queryIdRef = (0, import_react.useRef)(null);
|
|
60
|
+
const queryIntervalTimerRef = (0, import_react.useRef)(null);
|
|
59
61
|
const _resultQuery = async () => {
|
|
60
62
|
var _a, _b;
|
|
61
63
|
if (controllerRef.current) {
|
|
@@ -107,9 +109,9 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
|
|
107
109
|
console.log("交易状态为0需要继续查询");
|
|
108
110
|
_log("Querying" /* Querying */, result);
|
|
109
111
|
isQueryFinishedRef.current = false;
|
|
110
|
-
setTimeout(() => {
|
|
112
|
+
queryIntervalTimerRef.current = setTimeout(() => {
|
|
111
113
|
_resultQuery();
|
|
112
|
-
},
|
|
114
|
+
}, QUERY_INTERVAL);
|
|
113
115
|
return;
|
|
114
116
|
}
|
|
115
117
|
if (data.status < 0) {
|
|
@@ -145,18 +147,18 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
|
|
145
147
|
_log("AbortError" /* AbortError */);
|
|
146
148
|
console.log("Error: 请求被取消,将继续查询");
|
|
147
149
|
isQueryFinishedRef.current = false;
|
|
148
|
-
setTimeout(() => {
|
|
150
|
+
queryIntervalTimerRef.current = setTimeout(() => {
|
|
149
151
|
_resultQuery();
|
|
150
|
-
},
|
|
152
|
+
}, QUERY_INTERVAL);
|
|
151
153
|
return;
|
|
152
154
|
}
|
|
153
155
|
if (!(error == null ? void 0 : error.code) || `${error.code}` === import_const.PayStatus.Timeout) {
|
|
154
156
|
_log("NetworkError" /* NetworkError */);
|
|
155
157
|
console.log("Error: 网关类报错,将继续查询");
|
|
156
158
|
isQueryFinishedRef.current = false;
|
|
157
|
-
setTimeout(() => {
|
|
159
|
+
queryIntervalTimerRef.current = setTimeout(() => {
|
|
158
160
|
_resultQuery();
|
|
159
|
-
},
|
|
161
|
+
}, QUERY_INTERVAL);
|
|
160
162
|
return;
|
|
161
163
|
}
|
|
162
164
|
_log("Error" /* Error */, error);
|
|
@@ -203,6 +205,10 @@ var useTimeResultQuery = (api, resultCheck, handleLinklySuccess) => {
|
|
|
203
205
|
clearTimeout(requestTimeoutIdRef.current);
|
|
204
206
|
requestTimeoutIdRef.current = null;
|
|
205
207
|
}
|
|
208
|
+
if (queryIntervalTimerRef.current) {
|
|
209
|
+
clearTimeout(queryIntervalTimerRef.current);
|
|
210
|
+
queryIntervalTimerRef.current = null;
|
|
211
|
+
}
|
|
206
212
|
if (controllerRef.current) {
|
|
207
213
|
controllerRef.current.abort();
|
|
208
214
|
controllerRef.current = null;
|
|
@@ -42,6 +42,7 @@ var import_helper = require("../helper");
|
|
|
42
42
|
var import_hooks = require("../hooks");
|
|
43
43
|
var import_store = require("../store");
|
|
44
44
|
var import_hooks2 = require("./hooks");
|
|
45
|
+
var import_payment = require("./payment");
|
|
45
46
|
var POS = ({
|
|
46
47
|
api,
|
|
47
48
|
onChange
|
|
@@ -68,6 +69,13 @@ var POS = ({
|
|
|
68
69
|
const initRef = (0, import_react.useRef)(false);
|
|
69
70
|
const unloadRef = (0, import_react.useRef)(false);
|
|
70
71
|
const [check] = (0, import_hooks2.useValidate)(1e3 * 60);
|
|
72
|
+
const { run: paymentRun, clean: paymentClean } = (0, import_payment.usePayment)({
|
|
73
|
+
payApi: api.pay,
|
|
74
|
+
checkApi: api.check,
|
|
75
|
+
shouldContinue: () => {
|
|
76
|
+
return !(unloadRef.current || !netRef.current);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
71
79
|
(0, import_react.useEffect)(() => {
|
|
72
80
|
failRef.current = fail;
|
|
73
81
|
}, [fail]);
|
|
@@ -126,7 +134,7 @@ var POS = ({
|
|
|
126
134
|
);
|
|
127
135
|
};
|
|
128
136
|
(0, import_react.useEffect)(() => {
|
|
129
|
-
var _a, _b;
|
|
137
|
+
var _a, _b, _c;
|
|
130
138
|
if (statusRef.current === import_const.StatusEnum.Success || statusRef.current === import_const.StatusEnum.Fail) {
|
|
131
139
|
return;
|
|
132
140
|
}
|
|
@@ -145,82 +153,98 @@ var POS = ({
|
|
|
145
153
|
})
|
|
146
154
|
);
|
|
147
155
|
controllerRef.current = new AbortController();
|
|
148
|
-
const
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
)
|
|
156
|
+
const isPay = modeRef.current === import_const.ModeEnum.Pay || modeRef.current === import_const.ModeEnum.FullPay;
|
|
157
|
+
const apiParams = isPay ? {
|
|
158
|
+
...(custom == null ? void 0 : custom.platform) ? {
|
|
159
|
+
operator_id: custom.operator_id,
|
|
160
|
+
operator_type: custom.operator_type,
|
|
161
|
+
platform: custom.platform,
|
|
162
|
+
custom_payment_id: custom.custom_payment_id
|
|
163
|
+
} : {},
|
|
164
|
+
original_amount: payRef.current.amount,
|
|
165
|
+
service_charge: {
|
|
166
|
+
amount: payRef.current.surMoney,
|
|
167
|
+
percentage: payRef.current.surPercentRate
|
|
168
|
+
},
|
|
169
|
+
order_id: orderIdRef.current,
|
|
170
|
+
amount: payRef.current.total,
|
|
171
|
+
card_reader_type: eftposRef.current,
|
|
172
|
+
card_reader_id: (_a = deviceRef.current) == null ? void 0 : _a.id,
|
|
173
|
+
number: numRef.current,
|
|
174
|
+
pay_param_base64: encodeURIComponent(
|
|
175
|
+
btoa(
|
|
176
|
+
encodeURIComponent(
|
|
177
|
+
JSON.stringify({
|
|
178
|
+
...dataRef.current,
|
|
179
|
+
number: numRef.current
|
|
180
|
+
})
|
|
174
181
|
)
|
|
175
182
|
)
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
number: numRef.current
|
|
191
|
-
})
|
|
192
|
-
)
|
|
183
|
+
)
|
|
184
|
+
} : {
|
|
185
|
+
order_id: orderIdRef.current,
|
|
186
|
+
amount: amountRef.current,
|
|
187
|
+
card_reader_type: eftposRef.current,
|
|
188
|
+
card_reader_id: (_b = deviceRef.current) == null ? void 0 : _b.id,
|
|
189
|
+
number: numRef.current,
|
|
190
|
+
pay_param_base64: encodeURIComponent(
|
|
191
|
+
btoa(
|
|
192
|
+
encodeURIComponent(
|
|
193
|
+
JSON.stringify({
|
|
194
|
+
...dataRef.current,
|
|
195
|
+
number: numRef.current
|
|
196
|
+
})
|
|
193
197
|
)
|
|
194
198
|
)
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
)
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
199
|
+
)
|
|
200
|
+
};
|
|
201
|
+
if (isPay) {
|
|
202
|
+
paymentRun({
|
|
203
|
+
paymentType: import_payment.ActionType.Pay,
|
|
204
|
+
paymentNum: numRef.current,
|
|
205
|
+
orderId: orderIdRef.current,
|
|
206
|
+
deviceId: (_c = deviceRef.current) == null ? void 0 : _c.id,
|
|
207
|
+
params: apiParams,
|
|
208
|
+
callbacks: {
|
|
209
|
+
onSuccess: (res) => {
|
|
210
|
+
success(res);
|
|
211
|
+
},
|
|
212
|
+
onError: (err) => {
|
|
213
|
+
console.log("err = >>>>>", err);
|
|
214
|
+
failRef.current(err, true);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
});
|
|
218
|
+
return;
|
|
219
|
+
} else {
|
|
220
|
+
const resultPromise = api.refund(apiParams, { signal: controllerRef.current.signal });
|
|
221
|
+
resultPromise.then((res) => {
|
|
222
|
+
console.log("netRef.current111 = ", netRef.current);
|
|
223
|
+
if (unloadRef.current || !netRef.current) {
|
|
224
|
+
return;
|
|
225
|
+
}
|
|
226
|
+
if (res && `${res.code}` === "200") {
|
|
227
|
+
success(res);
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
230
|
+
return Promise.reject(res);
|
|
231
|
+
}).catch((err) => {
|
|
232
|
+
console.log(
|
|
233
|
+
"netRef.current222 = ",
|
|
234
|
+
netRef.current,
|
|
235
|
+
unloadRef.current,
|
|
236
|
+
err
|
|
237
|
+
);
|
|
238
|
+
if (unloadRef.current || !netRef.current) {
|
|
239
|
+
return;
|
|
240
|
+
}
|
|
241
|
+
if (!(err == null ? void 0 : err.code) || `${err.code}` === import_const.PayStatus.Timeout) {
|
|
242
|
+
checkApi();
|
|
243
|
+
return;
|
|
244
|
+
}
|
|
245
|
+
failRef.current(err, true);
|
|
246
|
+
});
|
|
247
|
+
}
|
|
224
248
|
}, [api, check, dispatch, onChange]);
|
|
225
249
|
(0, import_react.useEffect)(
|
|
226
250
|
() => () => {
|
|
@@ -230,6 +254,7 @@ var POS = ({
|
|
|
230
254
|
if (clearRef.current) {
|
|
231
255
|
clearTimeout(clearRef.current);
|
|
232
256
|
}
|
|
257
|
+
paymentClean();
|
|
233
258
|
},
|
|
234
259
|
[]
|
|
235
260
|
);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
interface RunApiParams {
|
|
2
|
+
[key: string]: any;
|
|
3
|
+
}
|
|
4
|
+
export declare enum ActionType {
|
|
5
|
+
Pay = "pay",
|
|
6
|
+
Refund = "refund",
|
|
7
|
+
Query = "query"
|
|
8
|
+
}
|
|
9
|
+
interface UsePaymentOptions {
|
|
10
|
+
/**
|
|
11
|
+
* 支付接口
|
|
12
|
+
*/
|
|
13
|
+
payApi: (params: RunApiParams, options?: {
|
|
14
|
+
signal?: AbortSignal;
|
|
15
|
+
}) => Promise<any>;
|
|
16
|
+
/**
|
|
17
|
+
* 退款接口
|
|
18
|
+
*/
|
|
19
|
+
refundApi?: (params: RunApiParams, options?: {
|
|
20
|
+
signal?: AbortSignal;
|
|
21
|
+
}) => Promise<any>;
|
|
22
|
+
/**
|
|
23
|
+
* 查询接口
|
|
24
|
+
*/
|
|
25
|
+
checkApi: (params: {
|
|
26
|
+
number: string;
|
|
27
|
+
}, options?: {
|
|
28
|
+
signal?: AbortSignal;
|
|
29
|
+
}) => Promise<any>;
|
|
30
|
+
/**
|
|
31
|
+
* 检查是否应该继续处理结果(用于处理网络断开、组件卸载等情况)
|
|
32
|
+
*/
|
|
33
|
+
shouldContinue?: () => boolean;
|
|
34
|
+
}
|
|
35
|
+
interface RunParams {
|
|
36
|
+
/** 支付类型 */
|
|
37
|
+
paymentType: ActionType;
|
|
38
|
+
/** 支付交易号 */
|
|
39
|
+
paymentNum: string;
|
|
40
|
+
/** 订单ID */
|
|
41
|
+
orderId?: string | number;
|
|
42
|
+
/** 设备ID */
|
|
43
|
+
deviceId?: string | number;
|
|
44
|
+
/** 支付参数 */
|
|
45
|
+
params: RunApiParams;
|
|
46
|
+
/** 回调方法 */
|
|
47
|
+
callbacks: RunCallbacks;
|
|
48
|
+
}
|
|
49
|
+
interface RunCallbacks {
|
|
50
|
+
/**
|
|
51
|
+
* 成功回调
|
|
52
|
+
*/
|
|
53
|
+
onSuccess: (res: any) => void;
|
|
54
|
+
/**
|
|
55
|
+
* 失败回调
|
|
56
|
+
*/
|
|
57
|
+
onError: (error: any) => void;
|
|
58
|
+
}
|
|
59
|
+
export declare const usePayment: (options: UsePaymentOptions) => {
|
|
60
|
+
run: (options: RunParams) => Promise<void>;
|
|
61
|
+
stop: () => void;
|
|
62
|
+
clean: (params?: {
|
|
63
|
+
clearCallbacks?: boolean;
|
|
64
|
+
}) => void;
|
|
65
|
+
};
|
|
66
|
+
export {};
|