@pisell/private-materials 6.4.32 → 6.4.33
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 +5 -5
- package/build/lowcode/render/default/view.js +6 -6
- package/build/lowcode/view.js +6 -6
- package/es/businessModel/SalesModel/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Footer/index.d.ts +0 -1
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
- package/es/components/booking/components/TabProduct/index.d.ts +0 -1
- package/es/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
- package/es/components/booking/components/collapsibleList/utils.d.ts +1 -0
- package/es/components/booking/components/emptyBooking/index.d.ts +1 -0
- package/es/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
- package/es/components/booking/components/footer/index.js +23 -7
- package/es/components/booking/components/reloadResourceModal/index.d.ts +1 -0
- package/es/components/booking/forms/single/index.d.ts +1 -0
- package/es/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/es/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/es/components/booking/info/date/index.d.ts +1 -0
- package/es/components/booking/info/dateRange/index.d.ts +0 -1
- package/es/components/booking/info/header/index.d.ts +1 -0
- package/es/components/booking/info/service/Lists.d.ts +0 -1
- package/es/components/booking/info/service/actions/index.d.ts +1 -0
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
- package/es/components/booking/info/service2/Lists.d.ts +0 -1
- package/es/components/booking/info/service2/utils.d.ts +1 -1
- package/es/components/booking/info2/service/actions/index.d.ts +1 -0
- package/es/components/booking/materiels/contacts/index.d.ts +1 -0
- package/es/components/booking/materiels/duration/index.d.ts +1 -0
- package/es/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
- package/es/components/checkout/PaymentModal.js +23 -33
- package/es/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +1 -1
- package/es/components/checkout/components/PaymentResultToast/index.js +1 -1
- package/es/components/checkout/components/ScrollableList/index.js +0 -1
- package/es/components/checkout/components/WalletPassModule/components/ConflictModal/index.d.ts +0 -1
- package/es/components/eftpos/index.d.ts +1 -0
- package/es/components/eftpos/pos.d.ts +1 -0
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/app.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/manual/index.d.ts +1 -0
- package/es/components/eftposPay/component/signature/index.d.ts +1 -0
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/payo/config.d.ts +1 -0
- package/es/components/eftposPay/store/index.d.ts +6 -6
- package/es/components/eftposPay/tip.d.ts +1 -0
- package/es/components/eftposPay/windcave/receiptAction.d.ts +1 -0
- package/es/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/es/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
- package/es/components/login/index.d.ts +1 -0
- package/es/components/pay/toB/components/CardGroup/index.d.ts +0 -1
- package/es/components/pay/toB/components/Content/Header.d.ts +1 -0
- package/es/components/pay/toB/components/MX51/index.js +14 -44
- package/es/components/pay/toB/types/index.d.ts +0 -12
- package/es/components/pay/toB/types/index.js +0 -4
- package/es/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
- package/es/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
- package/es/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/es/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
- package/es/components/ruleSetting/ruleBorder/index.d.ts +1 -0
- package/es/components/schedules/calendar/index.d.ts +1 -0
- package/es/components/schedules/components/ScheduleDetailList/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/ResourcesModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
- package/es/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
- package/es/components/schedules/products/list/ProductItem/index.d.ts +1 -0
- package/es/components/schedules/products/list/index.d.ts +1 -0
- package/es/components/schedules/resources/index.d.ts +1 -0
- package/es/components/schedules/resources/list/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/shoppingCart/components/Cart/Product.d.ts +0 -1
- package/es/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/es/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/es/components/taxSelect/index.d.ts +1 -0
- package/es/components/ticketBooking/utils/index.d.ts +1 -1
- package/es/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
- package/es/hooks/usePaymentLogger.d.ts +1 -0
- package/es/plus/clinetSearch/Add/BirthdayField/index.d.ts +1 -0
- package/es/plus/clinetSearch/Add/GenderField/index.d.ts +1 -0
- package/es/plus/clinetSearch/Add/PhoneField/index.d.ts +0 -1
- package/es/plus/saasCreateOrganization/components/Header.d.ts +1 -0
- package/es/plus/saasCreateOrganization/index.d.ts +1 -0
- package/es/plus/saasRegister/components/EntryEmail.d.ts +1 -0
- package/es/plus/saasRegister/components/EntryInfo.d.ts +1 -0
- package/es/plus/saasRegister/components/GoLogin.d.ts +1 -0
- package/es/plus/saasRegister/components/Header.d.ts +1 -0
- package/es/plus/saasRegister/components/VerifyError.d.ts +1 -0
- package/es/plus/saasRegister/components/VerifyingLink.d.ts +1 -0
- package/lib/businessModel/SalesModel/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +0 -1
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +0 -1
- package/lib/components/booking/components/TabProduct/index.d.ts +0 -1
- package/lib/components/booking/components/TabProduct/selectProductItem/index.d.ts +1 -0
- package/lib/components/booking/components/collapsibleList/utils.d.ts +1 -0
- package/lib/components/booking/components/emptyBooking/index.d.ts +1 -0
- package/lib/components/booking/components/footer/FooterMenus/index.d.ts +1 -0
- package/lib/components/booking/components/footer/index.js +8 -7
- package/lib/components/booking/components/reloadResourceModal/index.d.ts +1 -0
- package/lib/components/booking/forms/single/index.d.ts +1 -0
- package/lib/components/booking/info/addServiceVariant/index.d.ts +0 -1
- package/lib/components/booking/info/clientVariant/hooks/useClientFn.d.ts +1 -0
- package/lib/components/booking/info/date/index.d.ts +1 -0
- package/lib/components/booking/info/dateRange/index.d.ts +0 -1
- package/lib/components/booking/info/header/index.d.ts +1 -0
- package/lib/components/booking/info/service/Lists.d.ts +0 -1
- package/lib/components/booking/info/service/actions/index.d.ts +1 -0
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +0 -1
- package/lib/components/booking/info/service2/Lists.d.ts +0 -1
- package/lib/components/booking/info/service2/utils.d.ts +1 -1
- package/lib/components/booking/info2/service/actions/index.d.ts +1 -0
- package/lib/components/booking/materiels/contacts/index.d.ts +1 -0
- package/lib/components/booking/materiels/duration/index.d.ts +1 -0
- package/lib/components/booking/notes/NoteBlock/NoteItem/index.d.ts +1 -0
- package/lib/components/checkout/PaymentModal.js +7 -17
- package/lib/components/checkout/components/PaymentResultToast/PaymentResultToastProvider.js +1 -1
- package/lib/components/checkout/components/PaymentResultToast/index.js +1 -1
- package/lib/components/checkout/components/ScrollableList/index.js +0 -1
- package/lib/components/checkout/components/WalletPassModule/components/ConflictModal/index.d.ts +0 -1
- package/lib/components/eftpos/index.d.ts +1 -0
- package/lib/components/eftpos/pos.d.ts +1 -0
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/app.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/manual/index.d.ts +1 -0
- package/lib/components/eftposPay/component/signature/index.d.ts +1 -0
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/payo/config.d.ts +1 -0
- package/lib/components/eftposPay/store/index.d.ts +6 -6
- package/lib/components/eftposPay/tip.d.ts +1 -0
- package/lib/components/eftposPay/windcave/receiptAction.d.ts +1 -0
- package/lib/components/eftposPay/windcave/windcave.d.ts +1 -0
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.d.ts +0 -1
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +0 -1
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +0 -1
- package/lib/components/eventBooking/components/scheduleCalendar/ProductItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +0 -1
- package/lib/components/login/index.d.ts +1 -0
- package/lib/components/pay/toB/components/CardGroup/index.d.ts +0 -1
- package/lib/components/pay/toB/components/Content/Header.d.ts +1 -0
- package/lib/components/pay/toB/components/MX51/index.js +12 -37
- package/lib/components/pay/toB/types/index.d.ts +0 -12
- package/lib/components/pay/toC/PaymentMethods/MWCreditCard/TDSPay/ThreedsLoading/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +0 -1
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +0 -1
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +0 -1
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/BirthdayField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/GenderField/index.d.ts +1 -0
- package/lib/components/pisellSelectCustomerModal/RightPanel/Add/PhoneField/index.d.ts +0 -1
- package/lib/components/productExtension/fields/Actor/index.d.ts +0 -1
- package/lib/components/productExtension/fields/SelectProducts/ProductItemPreview/index.d.ts +1 -0
- package/lib/components/ruleSetting/ruleBorder/index.d.ts +1 -0
- package/lib/components/schedules/calendar/index.d.ts +1 -0
- package/lib/components/schedules/components/ScheduleDetailList/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/ResourcesModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/AddSchedules/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/ProductDetail/SchedulesModule/index.d.ts +1 -0
- package/lib/components/schedules/products/ProductDetailDrawer/index.d.ts +1 -0
- package/lib/components/schedules/products/list/ProductItem/index.d.ts +1 -0
- package/lib/components/schedules/products/list/index.d.ts +1 -0
- package/lib/components/schedules/resources/index.d.ts +1 -0
- package/lib/components/schedules/resources/list/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/shoppingCart/components/Cart/Product.d.ts +0 -1
- package/lib/components/shoppingCart/components/Empty/index.d.ts +0 -1
- package/lib/components/shoppingCart/components/Render/index.d.ts +0 -1
- package/lib/components/taxSelect/index.d.ts +1 -0
- package/lib/components/ticketBooking/utils/index.d.ts +1 -1
- package/lib/components/workSpaceList/components/Modal/index.d.ts +0 -1
- package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +0 -1
- package/lib/hooks/usePaymentLogger.d.ts +1 -0
- package/lib/plus/clinetSearch/Add/BirthdayField/index.d.ts +1 -0
- package/lib/plus/clinetSearch/Add/GenderField/index.d.ts +1 -0
- package/lib/plus/clinetSearch/Add/PhoneField/index.d.ts +0 -1
- package/lib/plus/saasCreateOrganization/components/Header.d.ts +1 -0
- package/lib/plus/saasCreateOrganization/index.d.ts +1 -0
- package/lib/plus/saasRegister/components/EntryEmail.d.ts +1 -0
- package/lib/plus/saasRegister/components/EntryInfo.d.ts +1 -0
- package/lib/plus/saasRegister/components/GoLogin.d.ts +1 -0
- package/lib/plus/saasRegister/components/Header.d.ts +1 -0
- package/lib/plus/saasRegister/components/VerifyError.d.ts +1 -0
- package/lib/plus/saasRegister/components/VerifyingLink.d.ts +1 -0
- package/package.json +1 -1
- package/es/hooks/printer.d.ts +0 -4
- package/es/hooks/printer.js +0 -35
- package/lib/hooks/printer.d.ts +0 -4
- package/lib/hooks/printer.js +0 -60
@@ -45,6 +45,8 @@ import { Iconfont } from '@pisell/materials';
|
|
45
45
|
import { useCustomer } from "../../../ticketBooking/hooks/pisellos/useCustomer";
|
46
46
|
import { useDebounceEffect, useMemoizedFn } from 'ahooks';
|
47
47
|
import { cloneDeep } from 'lodash';
|
48
|
+
import { useShopDiscount } from "../../../appointmentBooking/hooks";
|
49
|
+
|
48
50
|
/**
|
49
51
|
* @title: 底部
|
50
52
|
* @description:
|
@@ -654,12 +656,12 @@ var Footer = function Footer(props) {
|
|
654
656
|
setPaymentCallback(function () {
|
655
657
|
return function (paymentResult) {
|
656
658
|
console.log('Payment result:', paymentResult);
|
659
|
+
setIsPaymentModalOpen(false);
|
657
660
|
if ((paymentResult === null || paymentResult === void 0 ? void 0 : paymentResult.status) === 'success') {
|
658
661
|
var _window5;
|
659
662
|
console.log('Payment completed successfully');
|
660
663
|
(_window5 = window) === null || _window5 === void 0 || (_window5 = _window5.shopApi) === null || _window5 === void 0 || (_window5 = _window5.bookingTicket) === null || _window5 === void 0 || _window5.clearAllCart();
|
661
664
|
// 支付成功后关闭弹窗
|
662
|
-
setIsPaymentModalOpen(false);
|
663
665
|
setPaymentModalData(null);
|
664
666
|
setPaymentCallback(null);
|
665
667
|
} else if ((paymentResult === null || paymentResult === void 0 ? void 0 : paymentResult.status) === 'cancelled') {
|
@@ -669,13 +671,11 @@ var Footer = function Footer(props) {
|
|
669
671
|
(_window6 = window) === null || _window6 === void 0 || (_window6 = _window6.shopApi) === null || _window6 === void 0 || (_window6 = _window6.booking) === null || _window6 === void 0 || _window6.voidBooking(res.order_id);
|
670
672
|
}
|
671
673
|
// 支付取消后关闭弹窗
|
672
|
-
setIsPaymentModalOpen(false);
|
673
674
|
setPaymentModalData(null);
|
674
675
|
setPaymentCallback(null);
|
675
676
|
} else {
|
676
677
|
console.log('Payment status:', paymentResult === null || paymentResult === void 0 ? void 0 : paymentResult.status);
|
677
678
|
// 其他状态也关闭弹窗
|
678
|
-
setIsPaymentModalOpen(false);
|
679
679
|
setPaymentModalData(null);
|
680
680
|
setPaymentCallback(null);
|
681
681
|
}
|
@@ -1656,12 +1656,15 @@ var Footer = function Footer(props) {
|
|
1656
1656
|
changeCustomerToGlobalState: changeCustomerToGlobalState
|
1657
1657
|
}),
|
1658
1658
|
selectCustomer = _useCustomer.selectCustomer;
|
1659
|
+
var shopDiscount = useShopDiscount();
|
1659
1660
|
var _useScanManager2 = useScanManager(),
|
1660
1661
|
clearAllScanListenersTaskQueue = _useScanManager2.clearAllScanListenersTaskQueue;
|
1661
1662
|
// 清空所有内容并重置购物车
|
1662
1663
|
var handleClearAllAndReset = function handleClearAllAndReset() {
|
1663
|
-
var
|
1664
|
-
|
1664
|
+
var _shopDiscount$clear;
|
1665
|
+
// setTimeout(() => {
|
1666
|
+
// (window as any)?.shopApi?.bookingTicket?.clearAllCart();
|
1667
|
+
// }, 0);
|
1665
1668
|
clearAllScanListenersTaskQueue();
|
1666
1669
|
// 清空服务项目
|
1667
1670
|
dispatch({
|
@@ -1716,6 +1719,9 @@ var Footer = function Footer(props) {
|
|
1716
1719
|
orderNote: ''
|
1717
1720
|
}
|
1718
1721
|
});
|
1722
|
+
|
1723
|
+
// 清空商品券
|
1724
|
+
shopDiscount === null || shopDiscount === void 0 || (_shopDiscount$clear = shopDiscount.clear) === null || _shopDiscount$clear === void 0 || _shopDiscount$clear.call(shopDiscount);
|
1719
1725
|
};
|
1720
1726
|
return /*#__PURE__*/React.createElement(Skeleton, {
|
1721
1727
|
title: false,
|
@@ -1800,13 +1806,23 @@ var Footer = function Footer(props) {
|
|
1800
1806
|
state: state,
|
1801
1807
|
dispatch: dispatch,
|
1802
1808
|
onClose: function onClose(reset) {
|
1803
|
-
console.log('🔄 Footer: Closing PaymentModal');
|
1809
|
+
// console.log('🔄 Footer: Closing PaymentModal');
|
1804
1810
|
setIsPaymentModalOpen(false);
|
1805
1811
|
setPaymentModalData(null);
|
1806
1812
|
setPaymentCallback(null);
|
1813
|
+
// if (reset) {
|
1814
|
+
// handleClearAllAndReset();
|
1815
|
+
// }
|
1807
1816
|
if (reset) {
|
1808
|
-
|
1817
|
+
setTimeout(function () {
|
1818
|
+
handleClearAllAndReset();
|
1819
|
+
}, 0);
|
1809
1820
|
}
|
1821
|
+
// setPaymentModalData(null);
|
1822
|
+
// setPaymentCallback(null);
|
1823
|
+
// if (reset) {
|
1824
|
+
// handleClearAllAndReset();
|
1825
|
+
// }
|
1810
1826
|
}
|
1811
1827
|
}));
|
1812
1828
|
};
|
@@ -248,4 +248,4 @@ export declare const updateAppointmentServicePrice: (state: any, { start_date, e
|
|
248
248
|
* @Author: WangHan
|
249
249
|
* @Date: 2024-12-24 11:32
|
250
250
|
*/
|
251
|
-
export declare const updateServicePrice: (state: any) => Promise<any
|
251
|
+
export declare const updateServicePrice: (state: any) => never[] | Promise<any>;
|
@@ -16,7 +16,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
|
|
16
16
|
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; } }
|
17
17
|
function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
|
18
18
|
import React, { useRef, useState, useEffect, useCallback, useMemo, useImperativeHandle, forwardRef } from 'react';
|
19
|
-
import { locales } from '@pisell/utils';
|
19
|
+
import { locales, webPrint } from '@pisell/utils';
|
20
20
|
import { getLocale } from "../../utils/locales";
|
21
21
|
import { useMemoizedFn } from 'ahooks';
|
22
22
|
import { createPortal } from 'react-dom';
|
@@ -47,7 +47,6 @@ import { cloneDeep } from 'lodash';
|
|
47
47
|
import { getShopWalletPassId, reorderPaymentMethodList } from "./utils";
|
48
48
|
import usePaymentLogger from "./hooks/usePaymentLogger";
|
49
49
|
import { Button } from 'antd';
|
50
|
-
import usePrinter from "../../hooks/printer";
|
51
50
|
|
52
51
|
// Checkout 模块的事件常量
|
53
52
|
var CheckoutHooks = {
|
@@ -140,8 +139,6 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
140
139
|
_useState16 = _slicedToArray(_useState15, 2),
|
141
140
|
walletPassData = _useState16[0],
|
142
141
|
setWalletPassData = _useState16[1];
|
143
|
-
var _usePrinter = usePrinter(),
|
144
|
-
nativePrint = _usePrinter.nativePrint;
|
145
142
|
var isOrderFree = useMemo(function () {
|
146
143
|
if (!customAmount) return false;
|
147
144
|
var amount = parseFloat(customAmount);
|
@@ -678,12 +675,11 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
678
675
|
data: {
|
679
676
|
order_id: responseData.order_id,
|
680
677
|
machine_code_print_info: responseData === null || responseData === void 0 ? void 0 : responseData.machine_code_print_info,
|
681
|
-
small_ticket_data: responseData === null || responseData === void 0 || (_responseData$payment = responseData.payment_info) === null || _responseData$payment === void 0 ? void 0 : _responseData$payment.small_ticket_data
|
682
|
-
machine_code_print_info_v2: responseData === null || responseData === void 0 ? void 0 : responseData.machine_code_print_info_v2
|
678
|
+
small_ticket_data: responseData === null || responseData === void 0 || (_responseData$payment = responseData.payment_info) === null || _responseData$payment === void 0 ? void 0 : _responseData$payment.small_ticket_data
|
683
679
|
}
|
684
680
|
};
|
685
681
|
console.log('print_order_onOrderSynced_params>>>>', params);
|
686
|
-
|
682
|
+
webPrint(params, function (res) {
|
687
683
|
console.log('print_order_onOrderSynced_res>>>>', res);
|
688
684
|
});
|
689
685
|
} catch (error) {
|
@@ -973,7 +969,7 @@ var PaymentContent = /*#__PURE__*/forwardRef(function (_ref, ref) {
|
|
973
969
|
}
|
974
970
|
};
|
975
971
|
try {
|
976
|
-
|
972
|
+
webPrint(params, function (res) {
|
977
973
|
console.log('handleButtonClick_print-receipt_res>>>>', res);
|
978
974
|
if (!(res !== null && res !== void 0 && res.result)) {
|
979
975
|
Toast === null || Toast === void 0 || Toast.error((res === null || res === void 0 ? void 0 : res.msg) || '');
|
@@ -1288,8 +1284,6 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1288
1284
|
showRetryModal = _useState30[0],
|
1289
1285
|
setShowRetryModal = _useState30[1];
|
1290
1286
|
var Toast = useToast();
|
1291
|
-
var _usePrinter2 = usePrinter(),
|
1292
|
-
nativePrint = _usePrinter2.nativePrint;
|
1293
1287
|
|
1294
1288
|
// 重试处理函数(逻辑由用户自己实现)
|
1295
1289
|
var handleRetry = /*#__PURE__*/function () {
|
@@ -1619,7 +1613,7 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1619
1613
|
// 获取 checkout 模块并处理订单数据
|
1620
1614
|
checkout = pisellos === null || pisellos === void 0 ? void 0 : pisellos.getModule('checkout');
|
1621
1615
|
if (!(checkout && data && !isLocalOrderCreated.current)) {
|
1622
|
-
_context17.next =
|
1616
|
+
_context17.next = 18;
|
1623
1617
|
break;
|
1624
1618
|
}
|
1625
1619
|
isLocalOrderCreated.current = true;
|
@@ -1639,19 +1633,16 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1639
1633
|
order_rounding_setting: getData('order_rounding_setting'),
|
1640
1634
|
shop_wallet_pass_id: shop_wallet_pass_id
|
1641
1635
|
});
|
1642
|
-
console.time('initCheckoutData');
|
1643
1636
|
newData = cloneDeep(data); // setTotalAmount(newData.total.expectAmount);
|
1644
1637
|
// 先往 checkout 解决方案推送一条 local 数据
|
1645
|
-
_context17.next =
|
1638
|
+
_context17.next = 11;
|
1646
1639
|
return checkout.createLocalOrderAsync({
|
1647
1640
|
orderData: newData.order_info,
|
1648
1641
|
cartSummary: (_newData$subtotal_inf = newData.subtotal_info) === null || _newData$subtotal_inf === void 0 ? void 0 : _newData$subtotal_inf.subTotalList,
|
1649
1642
|
autoPayment: true,
|
1650
1643
|
totalInfo: newData.subtotal_info
|
1651
1644
|
});
|
1652
|
-
case
|
1653
|
-
console.timeEnd('initCheckoutData');
|
1654
|
-
|
1645
|
+
case 11:
|
1655
1646
|
// 获取订单总金额
|
1656
1647
|
_orderInfo2 = checkout.getCurrentOrderInfo();
|
1657
1648
|
if (_orderInfo2 && _orderInfo2.totalAmount) {
|
@@ -1708,8 +1699,7 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1708
1699
|
data: {
|
1709
1700
|
order_id: responseData.order_id,
|
1710
1701
|
machine_code_print_info: responseData === null || responseData === void 0 ? void 0 : responseData.machine_code_print_info,
|
1711
|
-
small_ticket_data: responseData === null || responseData === void 0 || (_responseData$payment3 = responseData.payment_info) === null || _responseData$payment3 === void 0 ? void 0 : _responseData$payment3.small_ticket_data
|
1712
|
-
machine_code_print_info_v2: responseData === null || responseData === void 0 ? void 0 : responseData.machine_code_print_info_v2
|
1702
|
+
small_ticket_data: responseData === null || responseData === void 0 || (_responseData$payment3 = responseData.payment_info) === null || _responseData$payment3 === void 0 ? void 0 : _responseData$payment3.small_ticket_data
|
1713
1703
|
}
|
1714
1704
|
};
|
1715
1705
|
console.log('print_order_onOrderSynced_params>>>>', params);
|
@@ -1720,7 +1710,7 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1720
1710
|
params: params
|
1721
1711
|
}
|
1722
1712
|
});
|
1723
|
-
|
1713
|
+
webPrint(params, function (res) {
|
1724
1714
|
console.log('print_order_onOrderSynced_res>>>>', res);
|
1725
1715
|
logger === null || logger === void 0 || logger.addLog({
|
1726
1716
|
type: 'info',
|
@@ -1771,27 +1761,27 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1771
1761
|
// 可以在这里执行同步完成后的业务逻辑
|
1772
1762
|
// 比如:通知其他系统、更新UI状态等
|
1773
1763
|
});
|
1774
|
-
_context17.next =
|
1764
|
+
_context17.next = 29;
|
1775
1765
|
break;
|
1776
|
-
case
|
1766
|
+
case 18:
|
1777
1767
|
if (!isLocalOrderCreated.current) {
|
1778
|
-
_context17.next =
|
1768
|
+
_context17.next = 29;
|
1779
1769
|
break;
|
1780
1770
|
}
|
1781
1771
|
// // 如果本地订单已创建,这时候还更新了 data,则需要销毁当前的订单数据,然后更新新的订单数据了
|
1782
1772
|
console.log('🔄 PaymentModal: data changed, updating checkout data...');
|
1783
1773
|
isLocalOrderCreated.current = false;
|
1784
|
-
_context17.next =
|
1774
|
+
_context17.next = 23;
|
1785
1775
|
return checkout.cancelCurrentOrderAsync();
|
1786
|
-
case
|
1787
|
-
_context17.next =
|
1776
|
+
case 23:
|
1777
|
+
_context17.next = 25;
|
1788
1778
|
return checkout.createLocalOrderAsync({
|
1789
1779
|
orderData: data === null || data === void 0 ? void 0 : data.order_info,
|
1790
1780
|
cartSummary: data === null || data === void 0 || (_data$subtotal_info = data.subtotal_info) === null || _data$subtotal_info === void 0 ? void 0 : _data$subtotal_info.subTotalList,
|
1791
1781
|
autoPayment: true,
|
1792
1782
|
totalInfo: data === null || data === void 0 ? void 0 : data.subtotal_info
|
1793
1783
|
});
|
1794
|
-
case
|
1784
|
+
case 25:
|
1795
1785
|
// 获取订单总金额
|
1796
1786
|
_orderInfo3 = checkout.getCurrentOrderInfo();
|
1797
1787
|
if (_orderInfo3 && _orderInfo3.totalAmount) {
|
@@ -1799,11 +1789,11 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1799
1789
|
}
|
1800
1790
|
setOrderInfo(_orderInfo3);
|
1801
1791
|
isLocalOrderCreated.current = true;
|
1802
|
-
case
|
1803
|
-
_context17.next =
|
1792
|
+
case 29:
|
1793
|
+
_context17.next = 35;
|
1804
1794
|
break;
|
1805
|
-
case
|
1806
|
-
_context17.prev =
|
1795
|
+
case 31:
|
1796
|
+
_context17.prev = 31;
|
1807
1797
|
_context17.t0 = _context17["catch"](0);
|
1808
1798
|
console.error('Failed to initialize checkout data:', _context17.t0);
|
1809
1799
|
logger === null || logger === void 0 || logger.addLog({
|
@@ -1813,11 +1803,11 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1813
1803
|
error: _context17.t0
|
1814
1804
|
}
|
1815
1805
|
});
|
1816
|
-
case
|
1806
|
+
case 35:
|
1817
1807
|
case "end":
|
1818
1808
|
return _context17.stop();
|
1819
1809
|
}
|
1820
|
-
}, _callee17, null, [[0,
|
1810
|
+
}, _callee17, null, [[0, 31]]);
|
1821
1811
|
}));
|
1822
1812
|
return function initCheckoutData() {
|
1823
1813
|
return _ref22.apply(this, arguments);
|
@@ -1941,7 +1931,7 @@ var PaymentModal = function PaymentModal(_ref17) {
|
|
1941
1931
|
}
|
1942
1932
|
};
|
1943
1933
|
try {
|
1944
|
-
|
1934
|
+
webPrint(params, function (res) {
|
1945
1935
|
console.log('handleButtonClick_print-receipt_res>>>>', res);
|
1946
1936
|
if (!(res !== null && res !== void 0 && res.result)) {
|
1947
1937
|
Toast === null || Toast === void 0 || Toast.error((res === null || res === void 0 ? void 0 : res.msg) || '');
|
@@ -51,7 +51,7 @@ var PaymentResultToast = /*#__PURE__*/memo(function (props) {
|
|
51
51
|
_props$mask = props.mask,
|
52
52
|
mask = _props$mask === void 0 ? true : _props$mask,
|
53
53
|
_props$maskClosable = props.maskClosable,
|
54
|
-
maskClosable = _props$maskClosable === void 0 ?
|
54
|
+
maskClosable = _props$maskClosable === void 0 ? true : _props$maskClosable,
|
55
55
|
_props$closable = props.closable,
|
56
56
|
closable = _props$closable === void 0 ? true : _props$closable,
|
57
57
|
zIndex = props.zIndex;
|
@@ -241,7 +241,6 @@ var ScrollableList = function ScrollableList(_ref) {
|
|
241
241
|
style: getGridStyle()
|
242
242
|
}, children)), isScrollable && /*#__PURE__*/React.createElement("button", {
|
243
243
|
style: _objectSpread(_objectSpread({}, bottomGradientStyle), {}, {
|
244
|
-
width: '100%',
|
245
244
|
border: 'none',
|
246
245
|
background: 'linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, #A78BE1 100%)'
|
247
246
|
}, gradientStyle),
|
@@ -8,7 +8,7 @@ import { PosProps } from './const';
|
|
8
8
|
*/
|
9
9
|
declare const _default: ({ className, onChange, onClose, formatAmount, isMobile, net, client }: {
|
10
10
|
className?: string | undefined;
|
11
|
-
onChange?: ((status: "
|
11
|
+
onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
|
12
12
|
[keys: string]: unknown;
|
13
13
|
} | undefined, other?: any) => void) | undefined;
|
14
14
|
onClose: () => void;
|
@@ -1,4 +1,3 @@
|
|
1
|
-
/// <reference types="react" />
|
2
1
|
import { PosProps, RouteType } from './const';
|
3
2
|
declare const App: ({ action, api, device_number, terminal, tyroUrl, tyroVersion, onChangeParams, isMobile, channel, formatAmount, ...props }: Omit<PosProps, "type" | "mode" | "getApi"> & {
|
4
3
|
action: RouteType;
|
@@ -11,7 +11,7 @@ import './device.less';
|
|
11
11
|
declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, containerStyle, }: {
|
12
12
|
api: PayProps['api'];
|
13
13
|
className?: string | undefined;
|
14
|
-
onChange?: ((status: "
|
14
|
+
onChange?: ((status: "page" | "success" | "print" | "fail" | "mark_tx_processed", params?: string | {
|
15
15
|
[keys: string]: unknown;
|
16
16
|
} | undefined, other?: any) => void) | undefined;
|
17
17
|
onClose: () => void;
|
@@ -15,11 +15,11 @@ export declare const useStoreRef: <T extends {
|
|
15
15
|
readonly numRef: React.MutableRefObject<string | number | undefined>;
|
16
16
|
readonly orderIdRef: React.MutableRefObject<string | number>;
|
17
17
|
readonly modeRef: React.MutableRefObject<ModeEnum>;
|
18
|
-
readonly statusRef: React.MutableRefObject<"
|
18
|
+
readonly statusRef: React.MutableRefObject<"loading" | "warn" | "success" | "fail" | "pedding" | "resove" | "reject" | "question">;
|
19
19
|
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
20
20
|
readonly symbolRef: React.MutableRefObject<string>;
|
21
21
|
readonly amountRef: React.MutableRefObject<string | number>;
|
22
|
-
readonly eftposRef: React.MutableRefObject<"
|
22
|
+
readonly eftposRef: React.MutableRefObject<"stripe" | "payo" | "tyro" | "windcave" | "linkly">;
|
23
23
|
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
24
24
|
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
25
25
|
};
|
@@ -174,7 +174,7 @@ export declare const updateCustom: (payload: {
|
|
174
174
|
export declare const updateStatus: (status: 'loading' | 'warn' | 'fail' | 'success' | 'question') => {
|
175
175
|
type: EActionTypes;
|
176
176
|
payload: {
|
177
|
-
status: "
|
177
|
+
status: "loading" | "warn" | "success" | "fail" | "question";
|
178
178
|
};
|
179
179
|
};
|
180
180
|
/**
|
@@ -295,20 +295,20 @@ export declare const backUpFree: (payload: Partial<State>) => {
|
|
295
295
|
name?: string | undefined;
|
296
296
|
symbol?: string | undefined;
|
297
297
|
amount?: string | number | undefined;
|
298
|
-
mode?: "refund" | "
|
298
|
+
mode?: "refund" | "fullPay" | "pay" | "query" | undefined;
|
299
299
|
order_id?: string | number | undefined;
|
300
|
-
eftpos?: "
|
301
|
-
action?: "
|
300
|
+
eftpos?: "stripe" | "payo" | "tyro" | "windcave" | "linkly" | undefined;
|
301
|
+
action?: "amount" | "pay" | "deviceList" | undefined;
|
302
302
|
key?: number | undefined;
|
303
303
|
step?: number | undefined;
|
304
304
|
title?: string | undefined;
|
305
305
|
subTitle?: string | undefined;
|
306
|
-
type?: "
|
306
|
+
type?: "unset" | "step" | undefined;
|
307
307
|
render?: boolean | undefined;
|
308
308
|
net?: boolean | undefined;
|
309
309
|
component?: string | undefined;
|
310
310
|
form?: string | undefined;
|
311
|
-
status?: "
|
311
|
+
status?: "loading" | "warn" | "success" | "fail" | "pedding" | "resove" | "reject" | "question" | undefined;
|
312
312
|
warn?: string | undefined;
|
313
313
|
steps?: {
|
314
314
|
/** 用于重置当前步骤 */
|