@pisell/private-materials 6.3.86 → 6.3.87
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/lowcode/assets-daily.json +11 -11
- package/build/lowcode/assets-dev.json +2 -2
- package/build/lowcode/assets-prod.json +11 -11
- package/build/lowcode/index.js +1 -1
- package/build/lowcode/meta.js +2 -2
- package/build/lowcode/preview.js +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +10 -10
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +9 -9
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/TimeSlicing/components/SelectDateOS.d.ts +1 -0
- package/es/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/es/components/booking/forms/single/index.d.ts +1 -0
- package/es/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/es/components/booking/info/service/like/index.d.ts +0 -1
- package/es/components/booking/materiels/contacts/index.d.ts +1 -0
- package/es/components/eftpos/const.d.ts +3 -1
- package/es/components/eftpos/const.js +2 -0
- package/es/components/eftpos/device.d.ts +3 -1
- package/es/components/eftpos/device.js +5 -3
- package/es/components/eftpos/deviceList/index.d.ts +0 -1
- package/es/components/eftpos/group/index.d.ts +0 -1
- package/es/components/eftpos/icon/apiKey.d.ts +0 -1
- package/es/components/eftpos/icon/device.d.ts +0 -1
- package/es/components/eftpos/index.js +34 -11
- package/es/components/eftpos/index.less +26 -1
- package/es/components/eftpos/locales.d.ts +3 -0
- package/es/components/eftpos/locales.js +3 -0
- package/es/components/eftpos/pos.d.ts +1 -0
- package/es/components/eftpos/receipt/index.d.ts +0 -1
- package/es/components/eftposPay/aggregatePayment/hooks/usePayment.d.ts +6 -0
- package/es/components/eftposPay/aggregatePayment/hooks/usePayment.js +125 -0
- package/es/components/eftposPay/aggregatePayment/index.d.ts +3 -0
- package/es/components/eftposPay/aggregatePayment/index.js +3 -0
- package/es/components/eftposPay/aggregatePayment/mock.d.ts +495 -0
- package/es/components/eftposPay/aggregatePayment/mock.js +567 -0
- package/es/components/eftposPay/aggregatePayment/service.d.ts +24 -0
- package/es/components/eftposPay/aggregatePayment/service.js +70 -0
- package/es/components/eftposPay/aggregatePayment/types.d.ts +96 -0
- package/es/components/eftposPay/aggregatePayment/types.js +61 -0
- package/es/components/eftposPay/aggregatePayment/utils/logs.d.ts +110 -0
- package/es/components/eftposPay/aggregatePayment/utils/logs.js +385 -0
- package/es/components/eftposPay/aggregatePayment/utils/payment.d.ts +132 -0
- package/es/components/eftposPay/aggregatePayment/utils/payment.js +1127 -0
- package/es/components/eftposPay/app.d.ts +1 -1
- package/es/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/es/components/eftposPay/component/fail/network.d.ts +1 -0
- package/es/components/eftposPay/component/fail/unknow.d.ts +1 -0
- package/es/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/es/components/eftposPay/component/manual/index.d.ts +1 -0
- package/es/components/eftposPay/component/signature/index.d.ts +1 -0
- package/es/components/eftposPay/component/step/index.d.ts +0 -1
- package/es/components/eftposPay/component/step/step.d.ts +0 -1
- package/es/components/eftposPay/const.d.ts +6 -1
- package/es/components/eftposPay/const.js +2 -0
- package/es/components/eftposPay/hooks.d.ts +2 -1
- package/es/components/eftposPay/hooks.js +12 -0
- package/es/components/eftposPay/linkly/index.js +1 -0
- package/es/components/eftposPay/manufacturer.d.ts +1 -0
- package/es/components/eftposPay/manufacturer.js +4 -0
- package/es/components/eftposPay/mx51/Action.d.ts +6 -0
- package/es/components/eftposPay/mx51/Action.js +91 -0
- package/es/components/eftposPay/mx51/const.d.ts +5 -0
- package/es/components/eftposPay/mx51/const.js +69 -0
- package/es/components/eftposPay/mx51/index.d.ts +6 -0
- package/es/components/eftposPay/mx51/index.js +362 -0
- package/es/components/eftposPay/mx51/types.d.ts +136 -0
- package/es/components/eftposPay/mx51/types.js +29 -0
- package/es/components/eftposPay/mx51/utils.d.ts +10 -0
- package/es/components/eftposPay/mx51/utils.js +120 -0
- package/es/components/eftposPay/pay.js +7 -2
- package/es/components/eftposPay/store/index.d.ts +1 -1
- package/es/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/es/components/eftposPay/windcave/windcave.d.ts +0 -1
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/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/scheduleCalendar/ProductItem/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +1 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
- package/es/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleList/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
- package/es/components/schedules/products/index.d.ts +1 -0
- package/es/components/schedules/resources/index.d.ts +1 -0
- package/es/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
- package/es/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
- package/es/components/schedules/schedules/index.d.ts +1 -0
- package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/es/hooks/useEngineContext.d.ts +0 -1
- package/es/hooks/useEngineContext.js +0 -7
- package/es/index.d.ts +1 -5
- package/es/index.js +1 -5
- package/es/plus/clientName/index.d.ts +0 -1
- package/es/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
- package/es/plus/skuOptionsSelection/components/OptionsCard/index.d.ts +1 -0
- package/es/plus/skuOptionsSelection/components/OptionsCard/index.less +0 -2
- package/es/plus/skuOptionsSelection/components/TitleExtra/index.d.ts +1 -0
- package/es/plus/skuOptionsSelection/components/VariantCard/index.d.ts +1 -0
- package/es/plus/skuOptionsSelection/index.js +2 -2
- package/es/plus/skuOptionsSelection/utils/transformSelectorValueToValue.js +2 -9
- package/es/plus/skuOptionsSelection/utils/transformValueToSelectorValue.js +4 -8
- package/es/plus/walletEditor/components/relationProduct/index.d.ts +1 -0
- package/es/pro/NumericStepper/index.d.ts +3 -28
- package/es/pro/NumericStepper/index.js +107 -175
- package/es/pro/NumericStepper/index.less +143 -295
- package/es/pro/Selector/Selector.js +26 -33
- package/es/pro/Selector/components/Card/index.js +3 -2
- package/es/pro/Selector/components/Card/index.less +4 -11
- package/es/pro/Selector/components/Indicator/index.d.ts +0 -1
- package/es/pro/Selector/components/Indicator/index.js +1 -2
- package/es/pro/Selector/components/Indicator/index.less +1 -4
- package/es/pro/Selector/components/LayoutContainer/index.d.ts +3 -5
- package/es/pro/Selector/components/LayoutContainer/index.js +9 -226
- package/es/pro/Selector/demo.js +1 -1
- package/es/pro/Selector/hooks/usePresetItemProps.js +0 -2
- package/es/pro/Selector/hooks/usePresetProps.js +6 -60
- package/es/pro/Selector/selector.less +64 -0
- package/es/pro/Selector/types.d.ts +0 -40
- package/es/pro/pisellPaymentList/example.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/TimeSlicing/components/SelectDateOS.d.ts +1 -0
- package/lib/components/booking/components/formItemChildrenWrap/index.d.ts +0 -1
- package/lib/components/booking/forms/single/index.d.ts +1 -0
- package/lib/components/booking/info/clientVariant/hooks/useIsLowSpeedNetwork.d.ts +0 -1
- package/lib/components/booking/info/service/like/index.d.ts +0 -1
- package/lib/components/booking/materiels/contacts/index.d.ts +1 -0
- package/lib/components/eftpos/const.d.ts +3 -1
- package/lib/components/eftpos/const.js +2 -0
- package/lib/components/eftpos/device.d.ts +3 -1
- package/lib/components/eftpos/device.js +3 -3
- package/lib/components/eftpos/deviceList/index.d.ts +0 -1
- package/lib/components/eftpos/group/index.d.ts +0 -1
- package/lib/components/eftpos/icon/apiKey.d.ts +0 -1
- package/lib/components/eftpos/icon/device.d.ts +0 -1
- package/lib/components/eftpos/index.js +20 -5
- package/lib/components/eftpos/index.less +26 -1
- package/lib/components/eftpos/locales.d.ts +3 -0
- package/lib/components/eftpos/locales.js +3 -0
- package/lib/components/eftpos/pos.d.ts +1 -0
- package/lib/components/eftpos/receipt/index.d.ts +0 -1
- package/lib/components/eftposPay/aggregatePayment/hooks/usePayment.d.ts +6 -0
- package/lib/components/eftposPay/aggregatePayment/hooks/usePayment.js +152 -0
- package/lib/components/eftposPay/aggregatePayment/index.d.ts +3 -0
- package/lib/components/{ecocup/customerList/hooks → eftposPay/aggregatePayment}/index.js +10 -10
- package/lib/components/eftposPay/aggregatePayment/mock.d.ts +495 -0
- package/lib/components/eftposPay/aggregatePayment/mock.js +679 -0
- package/lib/components/eftposPay/aggregatePayment/service.d.ts +24 -0
- package/lib/components/eftposPay/aggregatePayment/service.js +81 -0
- package/lib/components/eftposPay/aggregatePayment/types.d.ts +96 -0
- package/lib/components/eftposPay/aggregatePayment/types.js +74 -0
- package/lib/components/eftposPay/aggregatePayment/utils/logs.d.ts +110 -0
- package/lib/components/eftposPay/aggregatePayment/utils/logs.js +302 -0
- package/lib/components/eftposPay/aggregatePayment/utils/payment.d.ts +132 -0
- package/lib/components/eftposPay/aggregatePayment/utils/payment.js +746 -0
- package/lib/components/eftposPay/app.d.ts +1 -1
- package/lib/components/eftposPay/component/alert/warn.d.ts +0 -1
- package/lib/components/eftposPay/component/fail/network.d.ts +1 -0
- package/lib/components/eftposPay/component/fail/unknow.d.ts +1 -0
- package/lib/components/eftposPay/component/header/titlebar.d.ts +0 -1
- package/lib/components/eftposPay/component/manual/index.d.ts +1 -0
- package/lib/components/eftposPay/component/signature/index.d.ts +1 -0
- package/lib/components/eftposPay/component/step/index.d.ts +0 -1
- package/lib/components/eftposPay/component/step/step.d.ts +0 -1
- package/lib/components/eftposPay/const.d.ts +6 -1
- package/lib/components/eftposPay/const.js +2 -0
- package/lib/components/eftposPay/hooks.d.ts +2 -1
- package/lib/components/eftposPay/hooks.js +16 -0
- package/lib/components/eftposPay/linkly/index.js +1 -0
- package/lib/components/eftposPay/manufacturer.d.ts +1 -0
- package/lib/components/eftposPay/manufacturer.js +6 -0
- package/lib/components/eftposPay/mx51/Action.d.ts +6 -0
- package/lib/components/eftposPay/mx51/Action.js +127 -0
- package/lib/components/eftposPay/mx51/const.d.ts +5 -0
- package/lib/components/eftposPay/mx51/const.js +85 -0
- package/lib/components/eftposPay/mx51/index.d.ts +6 -0
- package/lib/components/eftposPay/mx51/index.js +330 -0
- package/lib/components/eftposPay/mx51/types.d.ts +136 -0
- package/lib/components/{ecocup/cupList/hooks/index.js → eftposPay/mx51/types.js} +17 -17
- package/lib/components/eftposPay/mx51/utils.d.ts +10 -0
- package/lib/components/eftposPay/mx51/utils.js +114 -0
- package/lib/components/eftposPay/pay.js +4 -2
- package/lib/components/eftposPay/store/index.d.ts +1 -1
- package/lib/components/eftposPay/tyro/hooks.d.ts +0 -1
- package/lib/components/eftposPay/windcave/windcave.d.ts +0 -1
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/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/scheduleCalendar/ProductItem/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/tds2.js +1 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/index.d.ts +1 -0
- package/lib/components/productExtension/fields/Forms/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleList/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/MaxParticipantsModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
- package/lib/components/schedules/products/index.d.ts +1 -0
- package/lib/components/schedules/resources/index.d.ts +1 -0
- package/lib/components/schedules/schedules/AllSchedules/index.d.ts +1 -0
- package/lib/components/schedules/schedules/ScheduleDetailDrawer/index.d.ts +1 -0
- package/lib/components/schedules/schedules/index.d.ts +1 -0
- package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/lib/hooks/useEngineContext.d.ts +0 -1
- package/lib/hooks/useEngineContext.js +2 -10
- package/lib/index.d.ts +1 -5
- package/lib/index.js +1 -13
- package/lib/plus/clientName/index.d.ts +0 -1
- package/lib/plus/selectHolder/components/ErrorTip/index.d.ts +0 -1
- package/lib/plus/skuOptionsSelection/components/OptionsCard/index.d.ts +1 -0
- package/lib/plus/skuOptionsSelection/components/OptionsCard/index.less +0 -2
- package/lib/plus/skuOptionsSelection/components/TitleExtra/index.d.ts +1 -0
- package/lib/plus/skuOptionsSelection/components/VariantCard/index.d.ts +1 -0
- package/lib/plus/skuOptionsSelection/index.js +2 -2
- package/lib/plus/skuOptionsSelection/utils/transformSelectorValueToValue.js +2 -9
- package/lib/plus/skuOptionsSelection/utils/transformValueToSelectorValue.js +3 -7
- package/lib/plus/walletEditor/components/relationProduct/index.d.ts +1 -0
- package/lib/pro/NumericStepper/index.d.ts +3 -28
- package/lib/pro/NumericStepper/index.js +88 -176
- package/lib/pro/NumericStepper/index.less +143 -295
- package/lib/pro/Selector/Selector.js +16 -27
- package/lib/pro/Selector/components/Card/index.js +1 -9
- package/lib/pro/Selector/components/Card/index.less +4 -11
- package/lib/pro/Selector/components/Indicator/index.d.ts +0 -1
- package/lib/pro/Selector/components/Indicator/index.js +1 -1
- package/lib/pro/Selector/components/Indicator/index.less +1 -4
- package/lib/pro/Selector/components/LayoutContainer/index.d.ts +3 -5
- package/lib/pro/Selector/components/LayoutContainer/index.js +2 -130
- package/lib/pro/Selector/demo.js +1 -1
- package/lib/pro/Selector/hooks/usePresetItemProps.js +0 -2
- package/lib/pro/Selector/hooks/usePresetProps.js +6 -28
- package/lib/pro/Selector/selector.less +64 -0
- package/lib/pro/Selector/types.d.ts +0 -40
- package/lib/pro/pisellPaymentList/example.d.ts +0 -1
- package/package.json +5 -5
- package/es/components/ecocup/components/AddCustomerModal/index.d.ts +0 -9
- package/es/components/ecocup/components/AddCustomerModal/index.js +0 -216
- package/es/components/ecocup/components/AddCustomerModal/index.less +0 -9
- package/es/components/ecocup/components/CupActionList/index.d.ts +0 -13
- package/es/components/ecocup/components/CupActionList/index.js +0 -91
- package/es/components/ecocup/components/CupActionList/index.less +0 -102
- package/es/components/ecocup/components/CupActionModal/hooks.d.ts +0 -5
- package/es/components/ecocup/components/CupActionModal/hooks.js +0 -68
- package/es/components/ecocup/components/CupActionModal/index.d.ts +0 -14
- package/es/components/ecocup/components/CupActionModal/index.js +0 -92
- package/es/components/ecocup/components/CupActionModal/index.less +0 -38
- package/es/components/ecocup/components/CupInfoCard/index.d.ts +0 -8
- package/es/components/ecocup/components/CupInfoCard/index.js +0 -12
- package/es/components/ecocup/components/CupInfoCard/index.less +0 -11
- package/es/components/ecocup/components/CupStatusModal/hooks.d.ts +0 -5
- package/es/components/ecocup/components/CupStatusModal/hooks.js +0 -68
- package/es/components/ecocup/components/CupStatusModal/index.d.ts +0 -13
- package/es/components/ecocup/components/CupStatusModal/index.js +0 -147
- package/es/components/ecocup/components/CupStatusModal/index.less +0 -35
- package/es/components/ecocup/components/CustomerAndCupModal/hooks.d.ts +0 -14
- package/es/components/ecocup/components/CustomerAndCupModal/hooks.js +0 -133
- package/es/components/ecocup/components/CustomerAndCupModal/index.d.ts +0 -16
- package/es/components/ecocup/components/CustomerAndCupModal/index.js +0 -227
- package/es/components/ecocup/components/CustomerAndCupModal/index.less +0 -68
- package/es/components/ecocup/components/CustomerCard/index.d.ts +0 -7
- package/es/components/ecocup/components/CustomerCard/index.js +0 -34
- package/es/components/ecocup/components/CustomerCard/index.less +0 -50
- package/es/components/ecocup/components/MoreDropdown/index.d.ts +0 -9
- package/es/components/ecocup/components/MoreDropdown/index.js +0 -33
- package/es/components/ecocup/components/PageHeader/index.d.ts +0 -6
- package/es/components/ecocup/components/PageHeader/index.js +0 -37
- package/es/components/ecocup/components/PageHeader/index.less +0 -19
- package/es/components/ecocup/components/SearchBar/const.d.ts +0 -4
- package/es/components/ecocup/components/SearchBar/const.js +0 -16
- package/es/components/ecocup/components/SearchBar/hooks.d.ts +0 -44
- package/es/components/ecocup/components/SearchBar/hooks.js +0 -184
- package/es/components/ecocup/components/SearchBar/index.d.ts +0 -12
- package/es/components/ecocup/components/SearchBar/index.js +0 -218
- package/es/components/ecocup/components/SearchBar/index.less +0 -88
- package/es/components/ecocup/cupList/const.d.ts +0 -133
- package/es/components/ecocup/cupList/const.js +0 -306
- package/es/components/ecocup/cupList/hooks/index.d.ts +0 -4
- package/es/components/ecocup/cupList/hooks/index.js +0 -4
- package/es/components/ecocup/cupList/hooks/useColumns.d.ts +0 -43
- package/es/components/ecocup/cupList/hooks/useColumns.js +0 -168
- package/es/components/ecocup/cupList/hooks/useCupApi.d.ts +0 -32
- package/es/components/ecocup/cupList/hooks/useCupApi.js +0 -172
- package/es/components/ecocup/cupList/hooks/useSummary.d.ts +0 -3
- package/es/components/ecocup/cupList/hooks/useSummary.js +0 -40
- package/es/components/ecocup/cupList/index.d.ts +0 -6
- package/es/components/ecocup/cupList/index.js +0 -220
- package/es/components/ecocup/cupList/index.less +0 -113
- package/es/components/ecocup/cupProject/const.d.ts +0 -7
- package/es/components/ecocup/cupProject/const.js +0 -27
- package/es/components/ecocup/cupProject/index.d.ts +0 -3
- package/es/components/ecocup/cupProject/index.js +0 -103
- package/es/components/ecocup/cupProject/index.less +0 -41
- package/es/components/ecocup/customerList/const.d.ts +0 -44
- package/es/components/ecocup/customerList/const.js +0 -67
- package/es/components/ecocup/customerList/hooks/index.d.ts +0 -3
- package/es/components/ecocup/customerList/hooks/index.js +0 -3
- package/es/components/ecocup/customerList/hooks/useColumns.d.ts +0 -15
- package/es/components/ecocup/customerList/hooks/useColumns.js +0 -44
- package/es/components/ecocup/customerList/hooks/useCustomerApi.d.ts +0 -15
- package/es/components/ecocup/customerList/hooks/useCustomerApi.js +0 -70
- package/es/components/ecocup/customerList/index.d.ts +0 -7
- package/es/components/ecocup/customerList/index.js +0 -127
- package/es/components/ecocup/customerList/index.less +0 -15
- package/es/components/ecocup/hooks.d.ts +0 -49
- package/es/components/ecocup/hooks.js +0 -151
- package/es/components/ecocup/locales.d.ts +0 -339
- package/es/components/ecocup/locales.js +0 -372
- package/es/components/ecocup/types.d.ts +0 -103
- package/es/components/ecocup/types.js +0 -36
- package/es/components/ecocup/utils/scanListener.d.ts +0 -20
- package/es/components/ecocup/utils/scanListener.js +0 -107
- package/es/plus/orderList/components/BatchActionBar.d.ts +0 -9
- package/es/plus/orderList/components/BatchActionBar.js +0 -861
- package/es/plus/orderList/components/FilterList.d.ts +0 -8
- package/es/plus/orderList/components/FilterList.js +0 -78
- package/es/plus/orderList/components/HandleActions.d.ts +0 -5
- package/es/plus/orderList/components/HandleActions.js +0 -24
- package/es/plus/orderList/components/QuickFilter.d.ts +0 -5
- package/es/plus/orderList/components/QuickFilter.js +0 -14
- package/es/plus/orderList/components/Reset.d.ts +0 -7
- package/es/plus/orderList/components/Reset.js +0 -23
- package/es/plus/orderList/components/Toolbar.d.ts +0 -6
- package/es/plus/orderList/components/Toolbar.js +0 -57
- package/es/plus/orderList/config.d.ts +0 -154
- package/es/plus/orderList/config.js +0 -786
- package/es/plus/orderList/index.d.ts +0 -9
- package/es/plus/orderList/index.js +0 -128
- package/es/plus/orderList/index.less +0 -125
- package/es/plus/orderList/locales.d.ts +0 -372
- package/es/plus/orderList/locales.js +0 -459
- package/es/plus/orderList/serve.d.ts +0 -42
- package/es/plus/orderList/serve.js +0 -351
- package/es/pro/Selector/components/LayoutContainer/index.less +0 -19
- package/es/pro/comprehensiveSearch/components/deviceIconGroup/index.d.ts +0 -11
- package/es/pro/comprehensiveSearch/components/deviceIconGroup/index.js +0 -54
- package/es/pro/comprehensiveSearch/components/deviceIconGroup/index.less +0 -28
- package/es/pro/comprehensiveSearch/components/index.d.ts +0 -2
- package/es/pro/comprehensiveSearch/components/index.js +0 -2
- package/es/pro/comprehensiveSearch/components/searchSection/index.d.ts +0 -24
- package/es/pro/comprehensiveSearch/components/searchSection/index.js +0 -140
- package/es/pro/comprehensiveSearch/components/searchSection/index.less +0 -100
- package/es/pro/comprehensiveSearch/components/searchSection/locales.d.ts +0 -15
- package/es/pro/comprehensiveSearch/components/searchSection/locales.js +0 -14
- package/es/pro/comprehensiveSearch/hooks/useNativeScanner.d.ts +0 -5
- package/es/pro/comprehensiveSearch/hooks/useNativeScanner.js +0 -24
- package/es/pro/comprehensiveSearch/hooks/useTerminalPeripherals.d.ts +0 -9
- package/es/pro/comprehensiveSearch/hooks/useTerminalPeripherals.js +0 -44
- package/es/pro/comprehensiveSearch/index.d.ts +0 -7
- package/es/pro/comprehensiveSearch/index.js +0 -207
- package/es/pro/comprehensiveSearch/index.less +0 -196
- package/es/pro/comprehensiveSearch/locales.d.ts +0 -15
- package/es/pro/comprehensiveSearch/locales.js +0 -14
- package/es/pro/comprehensiveSearch/types.d.ts +0 -32
- package/es/pro/comprehensiveSearch/types.js +0 -1
- package/es/pro/keyboards/index.d.ts +0 -2
- package/es/pro/keyboards/index.js +0 -1
- package/es/pro/keyboards/locales.d.ts +0 -24
- package/es/pro/keyboards/locales.js +0 -35
- package/es/pro/keyboards/numberKeyboard/index.d.ts +0 -16
- package/es/pro/keyboards/numberKeyboard/index.js +0 -523
- package/es/pro/keyboards/numberKeyboard/index.less +0 -59
- package/es/pro/keyboards/numberKeyboard/types.d.ts +0 -63
- package/es/pro/keyboards/numberKeyboard/types.js +0 -1
- package/lib/components/ecocup/components/AddCustomerModal/index.d.ts +0 -9
- package/lib/components/ecocup/components/AddCustomerModal/index.js +0 -212
- package/lib/components/ecocup/components/AddCustomerModal/index.less +0 -9
- package/lib/components/ecocup/components/CupActionList/index.d.ts +0 -13
- package/lib/components/ecocup/components/CupActionList/index.js +0 -116
- package/lib/components/ecocup/components/CupActionList/index.less +0 -102
- package/lib/components/ecocup/components/CupActionModal/hooks.d.ts +0 -5
- package/lib/components/ecocup/components/CupActionModal/hooks.js +0 -55
- package/lib/components/ecocup/components/CupActionModal/index.d.ts +0 -14
- package/lib/components/ecocup/components/CupActionModal/index.js +0 -125
- package/lib/components/ecocup/components/CupActionModal/index.less +0 -38
- package/lib/components/ecocup/components/CupInfoCard/index.d.ts +0 -8
- package/lib/components/ecocup/components/CupInfoCard/index.js +0 -43
- package/lib/components/ecocup/components/CupInfoCard/index.less +0 -11
- package/lib/components/ecocup/components/CupStatusModal/hooks.d.ts +0 -5
- package/lib/components/ecocup/components/CupStatusModal/hooks.js +0 -55
- package/lib/components/ecocup/components/CupStatusModal/index.d.ts +0 -13
- package/lib/components/ecocup/components/CupStatusModal/index.js +0 -140
- package/lib/components/ecocup/components/CupStatusModal/index.less +0 -35
- package/lib/components/ecocup/components/CustomerAndCupModal/hooks.d.ts +0 -14
- package/lib/components/ecocup/components/CustomerAndCupModal/hooks.js +0 -89
- package/lib/components/ecocup/components/CustomerAndCupModal/index.d.ts +0 -16
- package/lib/components/ecocup/components/CustomerAndCupModal/index.js +0 -178
- package/lib/components/ecocup/components/CustomerAndCupModal/index.less +0 -68
- package/lib/components/ecocup/components/CustomerCard/index.d.ts +0 -7
- package/lib/components/ecocup/components/CustomerCard/index.js +0 -48
- package/lib/components/ecocup/components/CustomerCard/index.less +0 -50
- package/lib/components/ecocup/components/MoreDropdown/index.d.ts +0 -9
- package/lib/components/ecocup/components/MoreDropdown/index.js +0 -68
- package/lib/components/ecocup/components/PageHeader/index.d.ts +0 -6
- package/lib/components/ecocup/components/PageHeader/index.js +0 -59
- package/lib/components/ecocup/components/PageHeader/index.less +0 -19
- package/lib/components/ecocup/components/SearchBar/const.d.ts +0 -4
- package/lib/components/ecocup/components/SearchBar/const.js +0 -50
- package/lib/components/ecocup/components/SearchBar/hooks.d.ts +0 -44
- package/lib/components/ecocup/components/SearchBar/hooks.js +0 -135
- package/lib/components/ecocup/components/SearchBar/index.d.ts +0 -12
- package/lib/components/ecocup/components/SearchBar/index.js +0 -213
- package/lib/components/ecocup/components/SearchBar/index.less +0 -88
- package/lib/components/ecocup/cupList/const.d.ts +0 -133
- package/lib/components/ecocup/cupList/const.js +0 -326
- package/lib/components/ecocup/cupList/hooks/index.d.ts +0 -4
- package/lib/components/ecocup/cupList/hooks/useColumns.d.ts +0 -43
- package/lib/components/ecocup/cupList/hooks/useColumns.js +0 -202
- package/lib/components/ecocup/cupList/hooks/useCupApi.d.ts +0 -32
- package/lib/components/ecocup/cupList/hooks/useCupApi.js +0 -112
- package/lib/components/ecocup/cupList/hooks/useSummary.d.ts +0 -3
- package/lib/components/ecocup/cupList/hooks/useSummary.js +0 -75
- package/lib/components/ecocup/cupList/index.d.ts +0 -6
- package/lib/components/ecocup/cupList/index.js +0 -208
- package/lib/components/ecocup/cupList/index.less +0 -113
- package/lib/components/ecocup/cupProject/const.d.ts +0 -7
- package/lib/components/ecocup/cupProject/const.js +0 -58
- package/lib/components/ecocup/cupProject/index.d.ts +0 -3
- package/lib/components/ecocup/cupProject/index.js +0 -126
- package/lib/components/ecocup/cupProject/index.less +0 -41
- package/lib/components/ecocup/customerList/const.d.ts +0 -44
- package/lib/components/ecocup/customerList/const.js +0 -93
- package/lib/components/ecocup/customerList/hooks/index.d.ts +0 -3
- package/lib/components/ecocup/customerList/hooks/useColumns.d.ts +0 -15
- package/lib/components/ecocup/customerList/hooks/useColumns.js +0 -89
- package/lib/components/ecocup/customerList/hooks/useCustomerApi.d.ts +0 -15
- package/lib/components/ecocup/customerList/hooks/useCustomerApi.js +0 -56
- package/lib/components/ecocup/customerList/index.d.ts +0 -7
- package/lib/components/ecocup/customerList/index.js +0 -138
- package/lib/components/ecocup/customerList/index.less +0 -15
- package/lib/components/ecocup/hooks.d.ts +0 -49
- package/lib/components/ecocup/hooks.js +0 -155
- package/lib/components/ecocup/locales.d.ts +0 -339
- package/lib/components/ecocup/locales.js +0 -389
- package/lib/components/ecocup/types.d.ts +0 -103
- package/lib/components/ecocup/types.js +0 -57
- package/lib/components/ecocup/utils/scanListener.d.ts +0 -20
- package/lib/components/ecocup/utils/scanListener.js +0 -90
- package/lib/plus/orderList/components/BatchActionBar.d.ts +0 -9
- package/lib/plus/orderList/components/BatchActionBar.js +0 -584
- package/lib/plus/orderList/components/FilterList.d.ts +0 -8
- package/lib/plus/orderList/components/FilterList.js +0 -121
- package/lib/plus/orderList/components/HandleActions.d.ts +0 -5
- package/lib/plus/orderList/components/HandleActions.js +0 -52
- package/lib/plus/orderList/components/QuickFilter.d.ts +0 -5
- package/lib/plus/orderList/components/QuickFilter.js +0 -43
- package/lib/plus/orderList/components/Reset.d.ts +0 -7
- package/lib/plus/orderList/components/Reset.js +0 -58
- package/lib/plus/orderList/components/Toolbar.d.ts +0 -6
- package/lib/plus/orderList/components/Toolbar.js +0 -68
- package/lib/plus/orderList/config.d.ts +0 -154
- package/lib/plus/orderList/config.js +0 -764
- package/lib/plus/orderList/index.d.ts +0 -9
- package/lib/plus/orderList/index.js +0 -132
- package/lib/plus/orderList/index.less +0 -125
- package/lib/plus/orderList/locales.d.ts +0 -372
- package/lib/plus/orderList/locales.js +0 -471
- package/lib/plus/orderList/serve.d.ts +0 -42
- package/lib/plus/orderList/serve.js +0 -177
- package/lib/pro/Selector/components/LayoutContainer/index.less +0 -19
- package/lib/pro/comprehensiveSearch/components/deviceIconGroup/index.d.ts +0 -11
- package/lib/pro/comprehensiveSearch/components/deviceIconGroup/index.js +0 -64
- package/lib/pro/comprehensiveSearch/components/deviceIconGroup/index.less +0 -28
- package/lib/pro/comprehensiveSearch/components/index.d.ts +0 -2
- package/lib/pro/comprehensiveSearch/components/index.js +0 -42
- package/lib/pro/comprehensiveSearch/components/searchSection/index.d.ts +0 -24
- package/lib/pro/comprehensiveSearch/components/searchSection/index.js +0 -153
- package/lib/pro/comprehensiveSearch/components/searchSection/index.less +0 -100
- package/lib/pro/comprehensiveSearch/components/searchSection/locales.d.ts +0 -15
- package/lib/pro/comprehensiveSearch/components/searchSection/locales.js +0 -38
- package/lib/pro/comprehensiveSearch/hooks/useNativeScanner.d.ts +0 -5
- package/lib/pro/comprehensiveSearch/hooks/useNativeScanner.js +0 -56
- package/lib/pro/comprehensiveSearch/hooks/useTerminalPeripherals.d.ts +0 -9
- package/lib/pro/comprehensiveSearch/hooks/useTerminalPeripherals.js +0 -70
- package/lib/pro/comprehensiveSearch/index.d.ts +0 -7
- package/lib/pro/comprehensiveSearch/index.js +0 -190
- package/lib/pro/comprehensiveSearch/index.less +0 -196
- package/lib/pro/comprehensiveSearch/locales.d.ts +0 -15
- package/lib/pro/comprehensiveSearch/locales.js +0 -38
- package/lib/pro/comprehensiveSearch/types.d.ts +0 -32
- package/lib/pro/comprehensiveSearch/types.js +0 -17
- package/lib/pro/keyboards/index.d.ts +0 -2
- package/lib/pro/keyboards/index.js +0 -39
- package/lib/pro/keyboards/locales.d.ts +0 -24
- package/lib/pro/keyboards/locales.js +0 -47
- package/lib/pro/keyboards/numberKeyboard/index.d.ts +0 -16
- package/lib/pro/keyboards/numberKeyboard/index.js +0 -400
- package/lib/pro/keyboards/numberKeyboard/index.less +0 -59
- package/lib/pro/keyboards/numberKeyboard/types.d.ts +0 -63
- package/lib/pro/keyboards/numberKeyboard/types.js +0 -17
- package/lowcode/eco-cup-list/meta.ts +0 -63
- package/lowcode/eco-customer-list/meta.ts +0 -63
- package/lowcode/ecocup-cup-list/meta.ts +0 -38
- package/lowcode/ecocup-cup-project/meta.ts +0 -35
- package/lowcode/ecocup-customer-list/meta.ts +0 -38
- package/lowcode/order-list/meta.ts +0 -87
|
@@ -0,0 +1,362 @@
|
|
|
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 ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
|
|
8
|
+
function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
|
|
9
|
+
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
10
|
+
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
11
|
+
function _iterableToArrayLimit(r, l) { var t = null == r ? null : "undefined" != typeof Symbol && r[Symbol.iterator] || r["@@iterator"]; if (null != t) { var e, n, i, u, a = [], f = !0, o = !1; try { if (i = (t = t.call(r)).next, 0 === l) { if (Object(t) !== t) return; f = !1; } else for (; !(f = (e = i.call(t)).done) && (a.push(e.value), a.length !== l); f = !0); } catch (r) { o = !0, n = r; } finally { try { if (!f && null != t.return && (u = t.return(), Object(u) !== u)) return; } finally { if (o) throw n; } } return a; } }
|
|
12
|
+
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
|
13
|
+
import React, { useEffect, useRef, useState } from 'react';
|
|
14
|
+
import { locales } from '@pisell/utils';
|
|
15
|
+
import { PisellModal } from '@pisell/materials';
|
|
16
|
+
import useEngineContext from "../../../hooks/useEngineContext";
|
|
17
|
+
import { request } from "../../../utils";
|
|
18
|
+
import { useContextData } from "../store";
|
|
19
|
+
import { StatusEnum } from "../const";
|
|
20
|
+
import { useStoreRef } from "../hooks";
|
|
21
|
+
import { usePayment } from "../aggregatePayment";
|
|
22
|
+
import { EPaymentStatus } from "../aggregatePayment/types";
|
|
23
|
+
import { parseMX51Params } from "./utils";
|
|
24
|
+
import { EButtonKeyType } from "./types";
|
|
25
|
+
import Action from "./Action";
|
|
26
|
+
import { useDispatch, updateStatus, updateCustom, updateState } from "../store";
|
|
27
|
+
import { useFail } from "../hooks";
|
|
28
|
+
import { getInitState } from "../manufacturer";
|
|
29
|
+
import { getPayParams } from "../helper";
|
|
30
|
+
var AggregatePayment = function AggregatePayment(_ref) {
|
|
31
|
+
var onChange = _ref.onChange;
|
|
32
|
+
// 设置request
|
|
33
|
+
var context = useEngineContext();
|
|
34
|
+
var utils = context.appHelper.utils || {};
|
|
35
|
+
request.setRequest(utils === null || utils === void 0 ? void 0 : utils.request);
|
|
36
|
+
|
|
37
|
+
// 数据源
|
|
38
|
+
var _useContextData = useContextData(),
|
|
39
|
+
title = _useContextData.title,
|
|
40
|
+
custom = _useContextData.custom,
|
|
41
|
+
status = _useContextData.status,
|
|
42
|
+
eftpos = _useContextData.eftpos,
|
|
43
|
+
mode = _useContextData.mode,
|
|
44
|
+
name = _useContextData.name,
|
|
45
|
+
symbol = _useContextData.symbol,
|
|
46
|
+
amount = _useContextData.amount,
|
|
47
|
+
order_id = _useContextData.order_id;
|
|
48
|
+
var _useStoreRef = useStoreRef(),
|
|
49
|
+
statusRef = _useStoreRef.statusRef,
|
|
50
|
+
numRef = _useStoreRef.numRef,
|
|
51
|
+
netRef = _useStoreRef.netRef,
|
|
52
|
+
modeRef = _useStoreRef.modeRef,
|
|
53
|
+
deviceRef = _useStoreRef.deviceRef,
|
|
54
|
+
orderIdRef = _useStoreRef.orderIdRef,
|
|
55
|
+
amountRef = _useStoreRef.amountRef,
|
|
56
|
+
payRef = _useStoreRef.payRef;
|
|
57
|
+
var dispatch = useDispatch();
|
|
58
|
+
var fail = useFail(0);
|
|
59
|
+
var failRef = useRef(fail);
|
|
60
|
+
var _useState = useState(false),
|
|
61
|
+
_useState2 = _slicedToArray(_useState, 2),
|
|
62
|
+
receiptModalShow = _useState2[0],
|
|
63
|
+
setReceiptModalShow = _useState2[1];
|
|
64
|
+
var _useState3 = useState(null),
|
|
65
|
+
_useState4 = _slicedToArray(_useState3, 2),
|
|
66
|
+
receiptModalData = _useState4[0],
|
|
67
|
+
setReceiptModalData = _useState4[1];
|
|
68
|
+
useEffect(function () {
|
|
69
|
+
failRef.current = fail;
|
|
70
|
+
}, [fail]);
|
|
71
|
+
|
|
72
|
+
// 当前组件数据
|
|
73
|
+
var initRef = useRef(false);
|
|
74
|
+
var unloadRef = useRef(false);
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* 更新到加载状态
|
|
78
|
+
*/
|
|
79
|
+
var updateToLoading = function updateToLoading() {
|
|
80
|
+
dispatch(updateStatus(StatusEnum.Loading));
|
|
81
|
+
dispatch(updateState({
|
|
82
|
+
title: locales.getText('page.eftpos-pay.text.loading')(modeRef.current)
|
|
83
|
+
}));
|
|
84
|
+
};
|
|
85
|
+
var payment = usePayment({
|
|
86
|
+
paymentCode: 'EFTPOS_MX51',
|
|
87
|
+
paymentNum: numRef.current || '',
|
|
88
|
+
shouldContinue: function shouldContinue() {
|
|
89
|
+
return !(unloadRef.current || !netRef.current);
|
|
90
|
+
},
|
|
91
|
+
config: {
|
|
92
|
+
hasQueryInterval: false // 不开启轮询间隔
|
|
93
|
+
},
|
|
94
|
+
callback: function callback(_instance, response) {
|
|
95
|
+
var _data$data;
|
|
96
|
+
console.log('callback =>>>>>> ', response);
|
|
97
|
+
var _ref2 = response || {},
|
|
98
|
+
status = _ref2.status,
|
|
99
|
+
data = _ref2.data;
|
|
100
|
+
var _ref3 = (data === null || data === void 0 || (_data$data = data.data) === null || _data$data === void 0 ? void 0 : _data$data.external_unified_response) || {},
|
|
101
|
+
transaction = _ref3.transaction,
|
|
102
|
+
action = _ref3.action;
|
|
103
|
+
var transformedData = parseMX51Params(transaction, status, data);
|
|
104
|
+
console.log('event_transformedData =>>>>>> ', transformedData);
|
|
105
|
+
dispatch(updateCustom({
|
|
106
|
+
customAction: transformedData
|
|
107
|
+
}));
|
|
108
|
+
if (status === EPaymentStatus.Processing) {
|
|
109
|
+
if (action === 'signature') {
|
|
110
|
+
var _transformedData$auto;
|
|
111
|
+
// 签名,需要停止轮询
|
|
112
|
+
dispatch(updateStatus(StatusEnum.Question));
|
|
113
|
+
// 更新标题
|
|
114
|
+
dispatch(updateState({
|
|
115
|
+
title: (transformedData === null || transformedData === void 0 ? void 0 : transformedData.message) || ''
|
|
116
|
+
}));
|
|
117
|
+
_instance.stop();
|
|
118
|
+
// 如果存在签名票自动打印,需要触发打印
|
|
119
|
+
if (transformedData !== null && transformedData !== void 0 && (_transformedData$auto = transformedData.autoAction) !== null && _transformedData$auto !== void 0 && _transformedData$auto.includes('PRINT_MERCHANT_RECEIPT')) {
|
|
120
|
+
var merchantReceipt = (transformedData === null || transformedData === void 0 ? void 0 : transformedData.merchantReceipt) || '';
|
|
121
|
+
onChange('print', merchantReceipt ? [merchantReceipt] : []);
|
|
122
|
+
}
|
|
123
|
+
} else {
|
|
124
|
+
updateToLoading();
|
|
125
|
+
}
|
|
126
|
+
} else if (status === EPaymentStatus.Success) {
|
|
127
|
+
dispatch(updateStatus('success'));
|
|
128
|
+
dispatch(updateState({
|
|
129
|
+
title: (transformedData === null || transformedData === void 0 ? void 0 : transformedData.message) || ''
|
|
130
|
+
}));
|
|
131
|
+
} else if (status === EPaymentStatus.Failed) {
|
|
132
|
+
// 失败分为两种情况:MX51返回失败信息 和 后端返回失败信息
|
|
133
|
+
if (transformedData) {
|
|
134
|
+
// 渲染需要走自定义
|
|
135
|
+
dispatch(updateStatus('fail'));
|
|
136
|
+
dispatch(updateState({
|
|
137
|
+
title: (transformedData === null || transformedData === void 0 ? void 0 : transformedData.message) || ''
|
|
138
|
+
}));
|
|
139
|
+
} else {
|
|
140
|
+
var _failRef$current;
|
|
141
|
+
(_failRef$current = failRef.current) === null || _failRef$current === void 0 || _failRef$current.call(failRef, data, false);
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
|
|
147
|
+
// 页面初始化处理
|
|
148
|
+
useEffect(function () {
|
|
149
|
+
// 支付检测
|
|
150
|
+
console.log('mx51页面初始化', statusRef.current);
|
|
151
|
+
if (statusRef.current === StatusEnum.Success || statusRef.current === StatusEnum.Fail || statusRef.current === StatusEnum.Question) {
|
|
152
|
+
return;
|
|
153
|
+
}
|
|
154
|
+
if (initRef.current) {
|
|
155
|
+
return;
|
|
156
|
+
}
|
|
157
|
+
initRef.current = true;
|
|
158
|
+
|
|
159
|
+
// 存在支付流水号
|
|
160
|
+
if (numRef.current) {
|
|
161
|
+
console.log('payment.query');
|
|
162
|
+
payment.query();
|
|
163
|
+
return;
|
|
164
|
+
}
|
|
165
|
+
payment.run();
|
|
166
|
+
}, []);
|
|
167
|
+
|
|
168
|
+
// 页面卸载处理
|
|
169
|
+
useEffect(function () {
|
|
170
|
+
return function () {
|
|
171
|
+
console.log('页面卸载');
|
|
172
|
+
unloadRef.current = true;
|
|
173
|
+
};
|
|
174
|
+
}, []);
|
|
175
|
+
|
|
176
|
+
// 取消支付
|
|
177
|
+
var onCancel = function onCancel(element) {
|
|
178
|
+
console.log('onCancel', element);
|
|
179
|
+
payment.action({
|
|
180
|
+
submit_url: element === null || element === void 0 ? void 0 : element.submitUrl
|
|
181
|
+
});
|
|
182
|
+
};
|
|
183
|
+
|
|
184
|
+
// 拒绝签名
|
|
185
|
+
var onDecline = function onDecline(element) {
|
|
186
|
+
console.log('onDecline', element);
|
|
187
|
+
updateToLoading();
|
|
188
|
+
payment.action({
|
|
189
|
+
submit_url: element === null || element === void 0 ? void 0 : element.submitUrl
|
|
190
|
+
});
|
|
191
|
+
};
|
|
192
|
+
|
|
193
|
+
// 接受签名
|
|
194
|
+
var onAccept = function onAccept(element) {
|
|
195
|
+
console.log('onAccept', element);
|
|
196
|
+
updateToLoading();
|
|
197
|
+
payment.action({
|
|
198
|
+
submit_url: element === null || element === void 0 ? void 0 : element.submitUrl
|
|
199
|
+
});
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
// 打印商户收据
|
|
203
|
+
var onPrintMerchantReceipt = function onPrintMerchantReceipt(element) {
|
|
204
|
+
console.log('onPrintMerchantReceipt', element);
|
|
205
|
+
onChange('print', element !== null && element !== void 0 && element.receipt ? [element === null || element === void 0 ? void 0 : element.receipt] : []);
|
|
206
|
+
setReceiptModalShow(true);
|
|
207
|
+
setReceiptModalData(element === null || element === void 0 ? void 0 : element.receipt);
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
// 打印客户收据
|
|
211
|
+
var onPrintCustomerReceipt = function onPrintCustomerReceipt(element) {
|
|
212
|
+
console.log('onPrintCustomerReceipt', element);
|
|
213
|
+
onChange('print', element !== null && element !== void 0 && element.receipt ? [element === null || element === void 0 ? void 0 : element.receipt] : []);
|
|
214
|
+
setReceiptModalShow(true);
|
|
215
|
+
setReceiptModalData(element === null || element === void 0 ? void 0 : element.receipt);
|
|
216
|
+
};
|
|
217
|
+
|
|
218
|
+
// 重试交易
|
|
219
|
+
var onRetry = function onRetry(element) {
|
|
220
|
+
console.log('onRetry', element);
|
|
221
|
+
onChange('page', 'pay');
|
|
222
|
+
var _params = _objectSpread(_objectSpread({}, custom || {}), {}, {
|
|
223
|
+
// 自定义参数需要重新传递
|
|
224
|
+
mode: mode,
|
|
225
|
+
name: name,
|
|
226
|
+
symbol: symbol,
|
|
227
|
+
amount: amount,
|
|
228
|
+
order_id: order_id,
|
|
229
|
+
number: ''
|
|
230
|
+
});
|
|
231
|
+
dispatch(updateState(getInitState(eftpos, _params)));
|
|
232
|
+
};
|
|
233
|
+
|
|
234
|
+
// 交易完成
|
|
235
|
+
var onTransactionComplete = function onTransactionComplete(element) {
|
|
236
|
+
console.log('onTransactionComplete', element);
|
|
237
|
+
var _ref4 = element._extra || {},
|
|
238
|
+
paymentStatus = _ref4.paymentStatus,
|
|
239
|
+
response = _ref4.response,
|
|
240
|
+
merchantReceipt = _ref4.merchantReceipt,
|
|
241
|
+
customerReceipt = _ref4.customerReceipt;
|
|
242
|
+
if (paymentStatus === EPaymentStatus.Success) {
|
|
243
|
+
var _response$data, _deviceRef$current;
|
|
244
|
+
var receipt = [];
|
|
245
|
+
// 刷卡机的手续费
|
|
246
|
+
var card_reader_surcharge = (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 || (_response$data = _response$data.external_unified_response) === null || _response$data === void 0 ? void 0 : _response$data.external_service_fee) || 0;
|
|
247
|
+
var deviceSetting = (_deviceRef$current = deviceRef.current) === null || _deviceRef$current === void 0 ? void 0 : _deviceRef$current.setting;
|
|
248
|
+
// 设备是否打印商家小票
|
|
249
|
+
var isEftposPrintMerchantReceipt = deviceSetting === null || deviceSetting === void 0 ? void 0 : deviceSetting.print_merchant_receipt;
|
|
250
|
+
// 设备是否打印客户小票
|
|
251
|
+
var isEftposPrintCustomerReceipt = deviceSetting === null || deviceSetting === void 0 ? void 0 : deviceSetting.prompt_customer_receipt;
|
|
252
|
+
if (!isEftposPrintMerchantReceipt && merchantReceipt) {
|
|
253
|
+
receipt.push(merchantReceipt);
|
|
254
|
+
}
|
|
255
|
+
if (!isEftposPrintCustomerReceipt && customerReceipt) {
|
|
256
|
+
receipt.push(customerReceipt);
|
|
257
|
+
}
|
|
258
|
+
var _params2 = getPayParams({
|
|
259
|
+
mode: modeRef.current,
|
|
260
|
+
amount: amountRef.current,
|
|
261
|
+
order_id: orderIdRef.current,
|
|
262
|
+
number: numRef.current,
|
|
263
|
+
device: deviceRef.current,
|
|
264
|
+
pay: payRef.current,
|
|
265
|
+
custom: {
|
|
266
|
+
card_reader_surcharge: card_reader_surcharge,
|
|
267
|
+
receipt: receipt
|
|
268
|
+
}
|
|
269
|
+
}, 'success');
|
|
270
|
+
onChange('success', _objectSpread(_objectSpread({}, _params2), {}, {
|
|
271
|
+
receipt: receipt
|
|
272
|
+
}));
|
|
273
|
+
} else {
|
|
274
|
+
onChange('fail', {
|
|
275
|
+
order_id: orderIdRef.current,
|
|
276
|
+
number: numRef.current,
|
|
277
|
+
uniquePaymentNumber: numRef.current,
|
|
278
|
+
device: deviceRef.current
|
|
279
|
+
});
|
|
280
|
+
}
|
|
281
|
+
};
|
|
282
|
+
var onNormalClick = function onNormalClick(element) {
|
|
283
|
+
// 如果存在submit_url,则提交到API
|
|
284
|
+
if (element !== null && element !== void 0 && element.submitUrl) {
|
|
285
|
+
console.log('onNormalClick_submit_url', element === null || element === void 0 ? void 0 : element.submitUrl);
|
|
286
|
+
updateToLoading();
|
|
287
|
+
payment.action({
|
|
288
|
+
submit_url: element === null || element === void 0 ? void 0 : element.submitUrl
|
|
289
|
+
});
|
|
290
|
+
} else {
|
|
291
|
+
console.log('onNormalClick_no_submit_url', element);
|
|
292
|
+
}
|
|
293
|
+
};
|
|
294
|
+
|
|
295
|
+
// 点击元素
|
|
296
|
+
var onElementClick = function onElementClick(element) {
|
|
297
|
+
console.log('onElementClick', element);
|
|
298
|
+
switch (element.key) {
|
|
299
|
+
case EButtonKeyType.CancelTransaction:
|
|
300
|
+
onCancel(element);
|
|
301
|
+
break;
|
|
302
|
+
case EButtonKeyType.DeclineSignature:
|
|
303
|
+
onDecline(element);
|
|
304
|
+
break;
|
|
305
|
+
case EButtonKeyType.ApproveSignature:
|
|
306
|
+
onAccept(element);
|
|
307
|
+
break;
|
|
308
|
+
case EButtonKeyType.PrintMerchantReceipt:
|
|
309
|
+
onPrintMerchantReceipt(element);
|
|
310
|
+
break;
|
|
311
|
+
case EButtonKeyType.PrintCustomerReceipt:
|
|
312
|
+
onPrintCustomerReceipt(element);
|
|
313
|
+
break;
|
|
314
|
+
case EButtonKeyType.RetryTransaction:
|
|
315
|
+
onRetry(element);
|
|
316
|
+
break;
|
|
317
|
+
case EButtonKeyType.TransactionComplete:
|
|
318
|
+
onTransactionComplete(element);
|
|
319
|
+
break;
|
|
320
|
+
default:
|
|
321
|
+
onNormalClick(element);
|
|
322
|
+
break;
|
|
323
|
+
}
|
|
324
|
+
};
|
|
325
|
+
console.log('custom>>>>', custom);
|
|
326
|
+
var onCloseReceiptModal = function onCloseReceiptModal() {
|
|
327
|
+
setReceiptModalShow(false);
|
|
328
|
+
setReceiptModalData(null);
|
|
329
|
+
};
|
|
330
|
+
return /*#__PURE__*/React.createElement(React.Fragment, null, /*#__PURE__*/React.createElement("div", {
|
|
331
|
+
className: "pisell-lowcode__eft-pay-body"
|
|
332
|
+
}, status === StatusEnum.Question ? /*#__PURE__*/React.createElement("div", {
|
|
333
|
+
className: "pisell-lowcode__eft-pay-title",
|
|
334
|
+
style: {
|
|
335
|
+
textAlign: 'center'
|
|
336
|
+
}
|
|
337
|
+
}, title) : null, /*#__PURE__*/React.createElement(Action, {
|
|
338
|
+
data: custom === null || custom === void 0 ? void 0 : custom.customAction,
|
|
339
|
+
showMessage: status === StatusEnum.Loading,
|
|
340
|
+
onClick: onElementClick
|
|
341
|
+
})), receiptModalShow ? /*#__PURE__*/React.createElement(PisellModal, {
|
|
342
|
+
open: receiptModalShow,
|
|
343
|
+
onCancel: onCloseReceiptModal,
|
|
344
|
+
maskClosable: true,
|
|
345
|
+
footer: null
|
|
346
|
+
}, /*#__PURE__*/React.createElement("div", {
|
|
347
|
+
style: {
|
|
348
|
+
padding: '16px',
|
|
349
|
+
display: 'flex',
|
|
350
|
+
alignItems: 'center',
|
|
351
|
+
justifyContent: 'center'
|
|
352
|
+
}
|
|
353
|
+
}, /*#__PURE__*/React.createElement("span", {
|
|
354
|
+
style: {
|
|
355
|
+
display: 'inline-block',
|
|
356
|
+
whiteSpace: 'pre-wrap',
|
|
357
|
+
fontFamily: 'monospace',
|
|
358
|
+
backgroundColor: '#fff'
|
|
359
|
+
}
|
|
360
|
+
}, receiptModalData))) : null);
|
|
361
|
+
};
|
|
362
|
+
export default AggregatePayment;
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
import { EPaymentStatus } from '../aggregatePayment/types';
|
|
2
|
+
/** 元素类型定义 */
|
|
3
|
+
export interface ElementType {
|
|
4
|
+
label: string;
|
|
5
|
+
key: string;
|
|
6
|
+
}
|
|
7
|
+
/** 布局类型定义 */
|
|
8
|
+
export interface LayoutType {
|
|
9
|
+
type: string;
|
|
10
|
+
elements: ElementType[];
|
|
11
|
+
}
|
|
12
|
+
/** 元素属性定义 */
|
|
13
|
+
export interface ElementProperty {
|
|
14
|
+
type: 'button' | 'text' | 'image' | 'input';
|
|
15
|
+
submit_url: string;
|
|
16
|
+
action: string | null;
|
|
17
|
+
text?: string | null;
|
|
18
|
+
name?: string | null;
|
|
19
|
+
data?: string | null;
|
|
20
|
+
encoding?: string | null;
|
|
21
|
+
}
|
|
22
|
+
/** Action Form 定义 */
|
|
23
|
+
export interface ActionFormType {
|
|
24
|
+
layout: LayoutType[];
|
|
25
|
+
properties: {
|
|
26
|
+
[key: string]: ElementProperty;
|
|
27
|
+
};
|
|
28
|
+
details: {
|
|
29
|
+
[key: string]: string;
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
/** POS 指令定义 */
|
|
33
|
+
export interface PosInstructions {
|
|
34
|
+
auto_actions: any;
|
|
35
|
+
action_form: ActionFormType | null;
|
|
36
|
+
}
|
|
37
|
+
/** MX51 参数定义 */
|
|
38
|
+
export interface MX51Params {
|
|
39
|
+
id: string;
|
|
40
|
+
version: number;
|
|
41
|
+
status: string;
|
|
42
|
+
message: string;
|
|
43
|
+
merchant_receipt: string | null;
|
|
44
|
+
customer_receipt: string | null;
|
|
45
|
+
result_amounts: any;
|
|
46
|
+
result_financial_status: string | null;
|
|
47
|
+
pos_instructions: PosInstructions | null;
|
|
48
|
+
}
|
|
49
|
+
/** 解析后的按钮配置 */
|
|
50
|
+
export interface ParsedElement {
|
|
51
|
+
/** 元素键 */
|
|
52
|
+
key: string;
|
|
53
|
+
/** 元素标签 */
|
|
54
|
+
label: string;
|
|
55
|
+
/** 提交URL */
|
|
56
|
+
submitUrl: string;
|
|
57
|
+
/** 按钮动作 */
|
|
58
|
+
action: string | null;
|
|
59
|
+
/** 元素类型 */
|
|
60
|
+
type: 'button' | 'text';
|
|
61
|
+
/** 文本信息 */
|
|
62
|
+
text?: string | null;
|
|
63
|
+
/** 小票信息 */
|
|
64
|
+
receipt?: string | null;
|
|
65
|
+
/** 额外信息 */
|
|
66
|
+
_extra?: {
|
|
67
|
+
/** 商户收据 */
|
|
68
|
+
merchantReceipt?: string | null;
|
|
69
|
+
/** 客户收据 */
|
|
70
|
+
customerReceipt?: string | null;
|
|
71
|
+
/** 支付状态 */
|
|
72
|
+
paymentStatus: EPaymentStatus;
|
|
73
|
+
/** 接口返回的原始数据 */
|
|
74
|
+
response: any;
|
|
75
|
+
};
|
|
76
|
+
/** 图片信息 */
|
|
77
|
+
image?: {
|
|
78
|
+
name?: string | null;
|
|
79
|
+
data?: string | null;
|
|
80
|
+
encoding?: string | null;
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
/** 解析后的布局配置 */
|
|
84
|
+
export interface ParsedLayout {
|
|
85
|
+
/** 布局类型,如 horizontal_layout */
|
|
86
|
+
layoutType: string;
|
|
87
|
+
/** 该布局中的按钮列表 */
|
|
88
|
+
elements: ParsedElement[];
|
|
89
|
+
}
|
|
90
|
+
/** 解析后的结果 */
|
|
91
|
+
export interface ParsedMX51Result {
|
|
92
|
+
/** 交易ID */
|
|
93
|
+
transactionId: string;
|
|
94
|
+
/** 版本号 */
|
|
95
|
+
version: number;
|
|
96
|
+
/** 状态 */
|
|
97
|
+
status: string;
|
|
98
|
+
/** 提示信息 */
|
|
99
|
+
message: string;
|
|
100
|
+
/** 商户收据 */
|
|
101
|
+
merchantReceipt: string | null;
|
|
102
|
+
/** 客户收据 */
|
|
103
|
+
customerReceipt: string | null;
|
|
104
|
+
/** 结果金额 */
|
|
105
|
+
resultAmounts: any;
|
|
106
|
+
/** 结果财务状态 */
|
|
107
|
+
resultFinancialStatus: string | null;
|
|
108
|
+
/** 布局列表,每个布局包含其类型和按钮 */
|
|
109
|
+
layouts: ParsedLayout[];
|
|
110
|
+
/** 详情信息 */
|
|
111
|
+
details: {
|
|
112
|
+
[key: string]: string;
|
|
113
|
+
};
|
|
114
|
+
/** 详情信息 text */
|
|
115
|
+
detailsText: string;
|
|
116
|
+
/** 自动操作 */
|
|
117
|
+
autoAction: Array<string> | null;
|
|
118
|
+
}
|
|
119
|
+
export declare enum EButtonKeyType {
|
|
120
|
+
/** 取消交易 */
|
|
121
|
+
CancelTransaction = "cancel_transaction",
|
|
122
|
+
/** 交易完成 */
|
|
123
|
+
TransactionComplete = "transaction_complete",
|
|
124
|
+
/** 重试交易 */
|
|
125
|
+
RetryTransaction = "retry_transaction",
|
|
126
|
+
/** 打印商户收据 */
|
|
127
|
+
PrintMerchantReceipt = "print_merchant_receipt",
|
|
128
|
+
/** 打印客户收据 */
|
|
129
|
+
PrintCustomerReceipt = "print_customer_receipt",
|
|
130
|
+
/** 批准签名 */
|
|
131
|
+
ApproveSignature = "approve_signature",
|
|
132
|
+
/** 拒绝签名 */
|
|
133
|
+
DeclineSignature = "decline_signature",
|
|
134
|
+
/** 提交到API */
|
|
135
|
+
SubmitToAPI = "submit_to_api"
|
|
136
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/** 元素类型定义 */
|
|
2
|
+
|
|
3
|
+
/** 布局类型定义 */
|
|
4
|
+
|
|
5
|
+
/** 元素属性定义 */
|
|
6
|
+
|
|
7
|
+
/** Action Form 定义 */
|
|
8
|
+
|
|
9
|
+
/** POS 指令定义 */
|
|
10
|
+
|
|
11
|
+
/** MX51 参数定义 */
|
|
12
|
+
|
|
13
|
+
/** 解析后的按钮配置 */
|
|
14
|
+
|
|
15
|
+
/** 解析后的布局配置 */
|
|
16
|
+
|
|
17
|
+
/** 解析后的结果 */
|
|
18
|
+
|
|
19
|
+
export var EButtonKeyType = /*#__PURE__*/function (EButtonKeyType) {
|
|
20
|
+
EButtonKeyType["CancelTransaction"] = "cancel_transaction";
|
|
21
|
+
EButtonKeyType["TransactionComplete"] = "transaction_complete";
|
|
22
|
+
EButtonKeyType["RetryTransaction"] = "retry_transaction";
|
|
23
|
+
EButtonKeyType["PrintMerchantReceipt"] = "print_merchant_receipt";
|
|
24
|
+
EButtonKeyType["PrintCustomerReceipt"] = "print_customer_receipt";
|
|
25
|
+
EButtonKeyType["ApproveSignature"] = "approve_signature";
|
|
26
|
+
EButtonKeyType["DeclineSignature"] = "decline_signature";
|
|
27
|
+
EButtonKeyType["SubmitToAPI"] = "submit_to_api";
|
|
28
|
+
return EButtonKeyType;
|
|
29
|
+
}({});
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { EPaymentStatus } from '../aggregatePayment/types';
|
|
2
|
+
import { type MX51Params, type ParsedMX51Result } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* 解析MX51参数
|
|
5
|
+
* @param params 接口返回的原始参数
|
|
6
|
+
* @param status 支付状态
|
|
7
|
+
* @param data 接口返回的数据
|
|
8
|
+
* @returns 解析后的结果对象
|
|
9
|
+
*/
|
|
10
|
+
export declare const parseMX51Params: (params: MX51Params, paymentStatus: EPaymentStatus, data: any) => ParsedMX51Result | null;
|
|
@@ -0,0 +1,120 @@
|
|
|
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 ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
3
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
4
|
+
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
5
|
+
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
|
|
6
|
+
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
|
|
7
|
+
import { EButtonKeyType } from "./types";
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* 解析MX51参数
|
|
11
|
+
* @param params 接口返回的原始参数
|
|
12
|
+
* @param status 支付状态
|
|
13
|
+
* @param data 接口返回的数据
|
|
14
|
+
* @returns 解析后的结果对象
|
|
15
|
+
*/
|
|
16
|
+
export var parseMX51Params = function parseMX51Params(params, paymentStatus, data) {
|
|
17
|
+
if (!params) {
|
|
18
|
+
return null;
|
|
19
|
+
}
|
|
20
|
+
// 默认值
|
|
21
|
+
var result = {
|
|
22
|
+
transactionId: (params === null || params === void 0 ? void 0 : params.id) || '',
|
|
23
|
+
status: (params === null || params === void 0 ? void 0 : params.status) || '',
|
|
24
|
+
version: (params === null || params === void 0 ? void 0 : params.version) || 0,
|
|
25
|
+
message: (params === null || params === void 0 ? void 0 : params.message) || '',
|
|
26
|
+
merchantReceipt: params === null || params === void 0 ? void 0 : params.merchant_receipt,
|
|
27
|
+
customerReceipt: params === null || params === void 0 ? void 0 : params.customer_receipt,
|
|
28
|
+
resultAmounts: params === null || params === void 0 ? void 0 : params.result_amounts,
|
|
29
|
+
resultFinancialStatus: params === null || params === void 0 ? void 0 : params.result_financial_status,
|
|
30
|
+
layouts: [],
|
|
31
|
+
details: {},
|
|
32
|
+
detailsText: '',
|
|
33
|
+
autoAction: []
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// 检查是否存在 pos_instructions
|
|
37
|
+
if (!(params !== null && params !== void 0 && params.pos_instructions)) {
|
|
38
|
+
return result;
|
|
39
|
+
}
|
|
40
|
+
var posInstructions = (params === null || params === void 0 ? void 0 : params.pos_instructions) || {};
|
|
41
|
+
|
|
42
|
+
// 检查是否有自动操作
|
|
43
|
+
result.autoAction = (posInstructions === null || posInstructions === void 0 ? void 0 : posInstructions.auto_actions) || [];
|
|
44
|
+
|
|
45
|
+
// 检查是否存在 action_form
|
|
46
|
+
if (!(posInstructions !== null && posInstructions !== void 0 && posInstructions.action_form)) {
|
|
47
|
+
return result;
|
|
48
|
+
}
|
|
49
|
+
var actionForm = (posInstructions === null || posInstructions === void 0 ? void 0 : posInstructions.action_form) || {};
|
|
50
|
+
|
|
51
|
+
// 解析详情信息
|
|
52
|
+
if (actionForm !== null && actionForm !== void 0 && actionForm.details) {
|
|
53
|
+
result.details = _objectSpread({}, (actionForm === null || actionForm === void 0 ? void 0 : actionForm.details) || {});
|
|
54
|
+
var detailsTextArr = [];
|
|
55
|
+
Object.keys((actionForm === null || actionForm === void 0 ? void 0 : actionForm.details) || {}).forEach(function (key) {
|
|
56
|
+
var _actionForm$details;
|
|
57
|
+
detailsTextArr.push("".concat(key, ": ").concat((actionForm === null || actionForm === void 0 || (_actionForm$details = actionForm.details) === null || _actionForm$details === void 0 ? void 0 : _actionForm$details[key]) || ''));
|
|
58
|
+
});
|
|
59
|
+
result.detailsText = (detailsTextArr === null || detailsTextArr === void 0 ? void 0 : detailsTextArr.join(', ')) || '';
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// 解析布局和按钮
|
|
63
|
+
if (actionForm !== null && actionForm !== void 0 && actionForm.layout && Array.isArray(actionForm === null || actionForm === void 0 ? void 0 : actionForm.layout)) {
|
|
64
|
+
var layouts = [];
|
|
65
|
+
|
|
66
|
+
// 遍历所有布局
|
|
67
|
+
actionForm.layout.forEach(function (layout) {
|
|
68
|
+
var elements = [];
|
|
69
|
+
if (layout !== null && layout !== void 0 && layout.elements && Array.isArray(layout === null || layout === void 0 ? void 0 : layout.elements)) {
|
|
70
|
+
// 遍历布局中的所有元素
|
|
71
|
+
layout.elements.forEach(function (element) {
|
|
72
|
+
var _actionForm$propertie;
|
|
73
|
+
var elementKey = (element === null || element === void 0 ? void 0 : element.key) || '';
|
|
74
|
+
var elementLabel = (element === null || element === void 0 ? void 0 : element.label) || '';
|
|
75
|
+
|
|
76
|
+
// 从 properties 中获取对应的属性
|
|
77
|
+
var property = (actionForm === null || actionForm === void 0 || (_actionForm$propertie = actionForm.properties) === null || _actionForm$propertie === void 0 ? void 0 : _actionForm$propertie[elementKey]) || {};
|
|
78
|
+
if (property) {
|
|
79
|
+
var _element = {
|
|
80
|
+
_extra: {
|
|
81
|
+
merchantReceipt: params === null || params === void 0 ? void 0 : params.merchant_receipt,
|
|
82
|
+
customerReceipt: params === null || params === void 0 ? void 0 : params.customer_receipt,
|
|
83
|
+
paymentStatus: paymentStatus,
|
|
84
|
+
response: data
|
|
85
|
+
},
|
|
86
|
+
key: elementKey,
|
|
87
|
+
label: elementLabel,
|
|
88
|
+
submitUrl: (property === null || property === void 0 ? void 0 : property.submit_url) || '',
|
|
89
|
+
action: property === null || property === void 0 ? void 0 : property.action,
|
|
90
|
+
type: (property === null || property === void 0 ? void 0 : property.type) || 'button',
|
|
91
|
+
text: property === null || property === void 0 ? void 0 : property.text,
|
|
92
|
+
// 如果是打印收据按钮,需要关联对应的小票信息
|
|
93
|
+
receipt: elementKey === EButtonKeyType.PrintMerchantReceipt ? result === null || result === void 0 ? void 0 : result.merchantReceipt : elementKey === EButtonKeyType.PrintCustomerReceipt ? result === null || result === void 0 ? void 0 : result.customerReceipt : null
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
// 只在 type 为 'image' 时添加 image 字段
|
|
97
|
+
if ((property === null || property === void 0 ? void 0 : property.type) === 'image') {
|
|
98
|
+
_element.image = {
|
|
99
|
+
name: (property === null || property === void 0 ? void 0 : property.name) || '',
|
|
100
|
+
data: (property === null || property === void 0 ? void 0 : property.data) || '',
|
|
101
|
+
encoding: (property === null || property === void 0 ? void 0 : property.encoding) || ''
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
elements.push(_element);
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
// 只添加有元素的布局
|
|
110
|
+
if (elements.length > 0) {
|
|
111
|
+
layouts.push({
|
|
112
|
+
layoutType: layout.type || 'unknown',
|
|
113
|
+
elements: elements
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
result.layouts = layouts;
|
|
118
|
+
}
|
|
119
|
+
return result;
|
|
120
|
+
};
|