@pisell/private-materials 3.3.98 → 3.3.99
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 +8 -8
- package/build/lowcode/render/default/view.css +1 -1
- package/build/lowcode/render/default/view.js +11 -11
- package/build/lowcode/view.css +1 -1
- package/build/lowcode/view.js +11 -11
- package/es/components/Sales/Cart/index.d.ts +53 -0
- package/es/components/Sales/Cart/index.js +1 -5
- package/es/components/Sales/Cart/utils.d.ts +23 -0
- package/es/components/Sales/Cart/utils.js +0 -167
- package/es/components/Sales/Checkout/index.d.ts +33 -0
- package/es/components/Sales/Checkout/index.js +8 -52
- package/es/components/Sales/Checkout/serve.d.ts +2 -0
- package/es/components/Sales/Checkout/serve.js +2 -16
- package/es/components/Sales/Checkout/utils.d.ts +35 -0
- package/es/components/Sales/Checkout/utils.js +1 -7
- package/es/components/Sales/Summary/index.d.ts +25 -0
- package/es/components/Sales/Summary/index.js +2 -17
- package/es/components/Sales/Summary/serve.d.ts +0 -0
- package/es/components/Sales/Summary/serve.js +0 -6
- package/es/components/Sales/Summary/utils.d.ts +36 -0
- package/es/components/Sales/Summary/utils.js +1 -43
- package/es/components/appointmentBooking/components/Cart/Item/index.less +3 -3
- package/es/components/appointmentBooking/components/Content/index.d.ts +3 -0
- package/es/components/appointmentBooking/components/Content/index.js +1 -15
- package/es/components/appointmentBooking/components/Content/index.less +1 -1
- package/es/components/appointmentBooking/components/Deposit/index.d.ts +3 -0
- package/es/components/appointmentBooking/components/Deposit/index.js +7 -27
- package/es/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/appointmentBooking/components/Services/index.d.ts +4 -0
- package/es/components/appointmentBooking/components/Services/index.js +27 -23
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +3 -0
- package/es/components/appointmentBooking/deposit/components/PolicyModal/index.js +20 -25
- package/es/components/appointmentBooking/deposit/index.d.ts +3 -0
- package/es/components/appointmentBooking/deposit/index.js +2 -4
- package/es/components/appointmentBooking/index.d.ts +3 -0
- package/es/components/appointmentBooking/index.js +0 -14
- package/es/components/appointmentBooking/index.less +1 -1
- package/es/components/booking/components/voucher/index.d.ts +3 -0
- package/es/components/booking/components/voucher/index.js +2 -2
- package/es/components/booking/info/dateRange/index.d.ts +1 -0
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/es/components/booking/info/index.d.ts +1 -0
- package/es/components/booking/info/service/Lists.d.ts +0 -1
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/es/components/booking/materiels/startTime/index.d.ts +0 -1
- package/es/components/booking/utils.d.ts +2 -2
- package/es/components/eftposPay/amount.d.ts +1 -1
- package/es/components/eftposPay/app.d.ts +0 -1
- package/es/components/eftposPay/const.d.ts +181 -0
- package/es/components/eftposPay/const.js +1 -3
- package/es/components/eftposPay/device.d.ts +1 -1
- package/es/components/eftposPay/hooks.d.ts +35 -0
- package/es/components/eftposPay/hooks.js +1 -3
- package/es/components/eftposPay/index.d.ts +4 -0
- package/es/components/eftposPay/index.js +1 -1
- package/es/components/eftposPay/manufacturer.d.ts +6 -0
- package/es/components/eftposPay/manufacturer.js +0 -4
- package/es/components/eftposPay/pay.d.ts +20 -0
- package/es/components/eftposPay/pay.js +2 -6
- package/es/components/eftposPay/store/index.d.ts +355 -0
- package/es/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +3 -0
- package/es/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +17 -29
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +3 -0
- package/es/components/eventBooking/components/Provider/Cart/Item/Total.js +6 -10
- package/es/components/eventBooking/components/Provider/Cart/Item/index.d.ts +3 -0
- package/es/components/eventBooking/components/Provider/Cart/Item/index.js +2 -4
- package/es/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/es/components/eventBooking/components/bookingDetailModal/index.d.ts +7 -0
- package/es/components/eventBooking/components/bookingDetailModal/index.js +1 -3
- package/es/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
- package/es/components/eventBooking/locales.d.ts +222 -0
- package/es/components/eventBooking/locales.js +3 -27
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/es/components/pay/toC/PaymentMethods/index.d.ts +9 -0
- package/es/components/pay/toC/PaymentMethods/index.js +4 -5
- package/es/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/es/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +9 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
- package/es/components/ticketBooking/components/ticketBooking/index.d.ts +4 -0
- package/es/components/ticketBooking/components/ticketBooking/index.js +1 -120
- package/es/components/ticketBooking/locales.d.ts +153 -0
- package/es/components/ticketBooking/locales.js +147 -195
- package/es/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/es/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
- package/es/utils/index.d.ts +23 -0
- package/lib/components/Sales/Cart/index.d.ts +53 -0
- package/lib/components/Sales/Cart/index.js +0 -1
- package/lib/components/Sales/Cart/utils.d.ts +23 -0
- package/lib/components/Sales/Cart/utils.js +0 -117
- package/lib/components/Sales/Checkout/index.d.ts +33 -0
- package/lib/components/Sales/Checkout/index.js +7 -39
- package/lib/components/Sales/Checkout/serve.d.ts +2 -0
- package/lib/components/Sales/Checkout/serve.js +2 -7
- package/lib/components/Sales/Checkout/utils.d.ts +35 -0
- package/lib/components/Sales/Checkout/utils.js +0 -2
- package/lib/components/Sales/Summary/index.d.ts +25 -0
- package/lib/components/Sales/Summary/index.js +1 -7
- package/lib/components/Sales/Summary/serve.d.ts +0 -0
- package/lib/components/Sales/Summary/serve.js +0 -32
- package/lib/components/Sales/Summary/utils.d.ts +36 -0
- package/lib/components/Sales/Summary/utils.js +1 -30
- package/lib/components/appointmentBooking/components/Cart/Item/index.less +3 -3
- package/lib/components/appointmentBooking/components/Content/index.d.ts +3 -0
- package/lib/components/appointmentBooking/components/Content/index.js +1 -6
- package/lib/components/appointmentBooking/components/Content/index.less +1 -1
- package/lib/components/appointmentBooking/components/Deposit/index.d.ts +3 -0
- package/lib/components/appointmentBooking/components/Deposit/index.js +4 -36
- package/lib/components/appointmentBooking/components/Footer/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Guest/components/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/appointmentBooking/components/Services/index.d.ts +4 -0
- package/lib/components/appointmentBooking/components/Services/index.js +11 -6
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.d.ts +3 -0
- package/lib/components/appointmentBooking/deposit/components/PolicyModal/index.js +4 -8
- package/lib/components/appointmentBooking/deposit/index.d.ts +3 -0
- package/lib/components/appointmentBooking/deposit/index.js +2 -4
- package/lib/components/appointmentBooking/index.d.ts +3 -0
- package/lib/components/appointmentBooking/index.js +0 -11
- package/lib/components/appointmentBooking/index.less +1 -1
- package/lib/components/booking/components/voucher/index.d.ts +3 -0
- package/lib/components/booking/components/voucher/index.js +2 -2
- package/lib/components/booking/info/dateRange/index.d.ts +1 -0
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +0 -1
- package/lib/components/booking/info/index.d.ts +1 -0
- package/lib/components/booking/info/service/Lists.d.ts +0 -1
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service/editService/BookingList/index.d.ts +1 -0
- package/lib/components/booking/info2/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/materiels/startTime/index.d.ts +0 -1
- package/lib/components/booking/utils.d.ts +2 -2
- package/lib/components/eftposPay/amount.d.ts +1 -1
- package/lib/components/eftposPay/app.d.ts +0 -1
- package/lib/components/eftposPay/const.d.ts +181 -0
- package/lib/components/eftposPay/const.js +0 -2
- package/lib/components/eftposPay/device.d.ts +1 -1
- package/lib/components/eftposPay/hooks.d.ts +35 -0
- package/lib/components/eftposPay/hooks.js +4 -11
- package/lib/components/eftposPay/index.d.ts +4 -0
- package/lib/components/eftposPay/index.js +1 -1
- package/lib/components/eftposPay/manufacturer.d.ts +6 -0
- package/lib/components/eftposPay/manufacturer.js +0 -6
- package/lib/components/eftposPay/pay.d.ts +20 -0
- package/lib/components/eftposPay/pay.js +2 -13
- package/lib/components/eftposPay/store/index.d.ts +355 -0
- package/lib/components/eventBooking/components/ErrorTip/index.d.ts +1 -0
- package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.d.ts +3 -0
- package/lib/components/eventBooking/components/Provider/Cart/ContinueButton/index.js +3 -16
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.d.ts +3 -0
- package/lib/components/eventBooking/components/Provider/Cart/Item/Total.js +5 -8
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.d.ts +3 -0
- package/lib/components/eventBooking/components/Provider/Cart/Item/index.js +2 -4
- package/lib/components/eventBooking/components/Provider/InformationOptionsModal/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/CallToBook/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/WeekItem/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingAvailabilityCalendar/components/CalendarDate/CalenDateWeek/index.d.ts +1 -0
- package/lib/components/eventBooking/components/bookingDetailModal/index.d.ts +7 -0
- package/lib/components/eventBooking/components/bookingDetailModal/index.js +1 -1
- package/lib/components/eventBooking/components/scheduleCalendar/calendarItem.d.ts +1 -0
- package/lib/components/eventBooking/locales.d.ts +222 -0
- package/lib/components/eventBooking/locales.js +3 -27
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/components/SetupForm/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/StripePay/Stripe/index.d.ts +1 -0
- package/lib/components/pay/toC/PaymentMethods/index.d.ts +9 -0
- package/lib/components/pay/toC/PaymentMethods/index.js +9 -10
- package/lib/components/pay/toC/WalletPassBlock/components/WalletUseList/index.d.ts +1 -0
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +1 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +9 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.js +1 -1
- package/lib/components/ticketBooking/components/ticketBooking/index.d.ts +4 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.js +1 -120
- package/lib/components/ticketBooking/locales.d.ts +153 -0
- package/lib/components/ticketBooking/locales.js +4 -22
- package/lib/components/workSpaceList/components/Modal/index.d.ts +1 -0
- package/lib/components/workSpaceList/components/SearchWorkspaceAndBase/index.d.ts +1 -0
- package/lib/utils/index.d.ts +23 -0
- package/package.json +4 -4
- package/es/components/eftposPay/linkly/const.js +0 -82
- package/es/components/eftposPay/linkly/hooks/index.js +0 -2
- package/es/components/eftposPay/linkly/hooks/normal.js +0 -321
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +0 -273
- package/es/components/eftposPay/linkly/index.js +0 -197
- package/es/components/eftposPay/linkly/service.js +0 -81
- package/es/components/eventBooking/components/Provider/Cart/Deposit/index.js +0 -17
- package/es/components/ticketBooking/utils/formatProductMessage.js +0 -62
- package/es/components/ticketBooking/utils/formatTime.js +0 -144
- package/lib/components/eftposPay/linkly/const.js +0 -102
- package/lib/components/eftposPay/linkly/hooks/index.js +0 -25
- package/lib/components/eftposPay/linkly/hooks/normal.js +0 -242
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +0 -222
- package/lib/components/eftposPay/linkly/index.js +0 -208
- package/lib/components/eftposPay/linkly/service.js +0 -55
- package/lib/components/eventBooking/components/Provider/Cart/Deposit/index.js +0 -55
- package/lib/components/ticketBooking/utils/formatProductMessage.js +0 -84
- package/lib/components/ticketBooking/utils/formatTime.js +0 -139
|
@@ -74,7 +74,9 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
74
74
|
let type = "";
|
|
75
75
|
if (!isRetailTemplate) {
|
|
76
76
|
type = await checkProductType(item == null ? void 0 : item.id);
|
|
77
|
-
|
|
77
|
+
if (type === "session") {
|
|
78
|
+
appointmentBooking.openProductDetail(item.id);
|
|
79
|
+
}
|
|
78
80
|
}
|
|
79
81
|
utils == null ? void 0 : utils.action({
|
|
80
82
|
type: "pisell1.productDetail",
|
|
@@ -84,10 +86,6 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
84
86
|
},
|
|
85
87
|
callback: async (data) => {
|
|
86
88
|
var _a, _b;
|
|
87
|
-
if (data.isCancel) {
|
|
88
|
-
appointmentBooking.closeProductDetail();
|
|
89
|
-
return;
|
|
90
|
-
}
|
|
91
89
|
const product = {
|
|
92
90
|
...data,
|
|
93
91
|
options: (data == null ? void 0 : data.option) || []
|
|
@@ -98,6 +96,13 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
98
96
|
appointmentBooking.storeProduct(product);
|
|
99
97
|
return;
|
|
100
98
|
}
|
|
99
|
+
if (data == null ? void 0 : data.isCancel) {
|
|
100
|
+
if (type === "session") {
|
|
101
|
+
appointmentBooking.closeProductDetail();
|
|
102
|
+
appointmentBooking.getAvailableDate();
|
|
103
|
+
}
|
|
104
|
+
return;
|
|
105
|
+
}
|
|
101
106
|
const session = data == null ? void 0 : data.session;
|
|
102
107
|
if (session) {
|
|
103
108
|
const startDate = (0, import_dayjs.default)(session == null ? void 0 : session.start_at).format("YYYY-MM-DD");
|
|
@@ -109,6 +114,7 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
109
114
|
endTime: `${endDate} ${session == null ? void 0 : session.end_time}`
|
|
110
115
|
}
|
|
111
116
|
});
|
|
117
|
+
appointmentBooking.closeProductDetail();
|
|
112
118
|
await appointmentBooking.getAvailableDate({
|
|
113
119
|
startDate,
|
|
114
120
|
endDate
|
|
@@ -126,7 +132,6 @@ var Services = (0, import_react.forwardRef)((props, ref) => {
|
|
|
126
132
|
await appointmentBooking.getAvailableDate();
|
|
127
133
|
}
|
|
128
134
|
}
|
|
129
|
-
appointmentBooking.closeProductDetail();
|
|
130
135
|
if (isDateSelectedFirst) {
|
|
131
136
|
const index = (currentStep == null ? void 0 : currentStep.index) + 2;
|
|
132
137
|
if (type === "duration" || appointmentBooking.isCartHasDurationProduct()) {
|
|
@@ -36,6 +36,7 @@ var import_react = __toESM(require("react"));
|
|
|
36
36
|
var import_antd = require("antd");
|
|
37
37
|
var import_materials = require("@pisell/materials");
|
|
38
38
|
var import_utils = require("@pisell/utils");
|
|
39
|
+
var import_context = require("../../../context");
|
|
39
40
|
var import_index = require("./index.less");
|
|
40
41
|
var DepositModal = (props) => {
|
|
41
42
|
const {
|
|
@@ -44,10 +45,9 @@ var DepositModal = (props) => {
|
|
|
44
45
|
item,
|
|
45
46
|
onChange,
|
|
46
47
|
onConfirm,
|
|
47
|
-
isHideCheckout = true
|
|
48
|
-
depositProtocolRequest
|
|
49
|
-
// 定金协议请求
|
|
48
|
+
isHideCheckout = true
|
|
50
49
|
} = props;
|
|
50
|
+
const { appointmentBooking } = (0, import_context.useAppointmentBookingContext)();
|
|
51
51
|
const [policy, setPolicy] = (0, import_react.useState)(null);
|
|
52
52
|
const [loading, setLoading] = (0, import_react.useState)(false);
|
|
53
53
|
const [disabled, setDisabled] = (0, import_react.useState)(false);
|
|
@@ -55,13 +55,9 @@ var DepositModal = (props) => {
|
|
|
55
55
|
setDisabled(!isHideCheckout);
|
|
56
56
|
}, [isHideCheckout]);
|
|
57
57
|
const getPolicy = async (id) => {
|
|
58
|
-
if (!depositProtocolRequest) {
|
|
59
|
-
console.error("depositProtocolRequest is not defined");
|
|
60
|
-
return;
|
|
61
|
-
}
|
|
62
58
|
setLoading(true);
|
|
63
59
|
try {
|
|
64
|
-
const { data } = await (
|
|
60
|
+
const { data } = await appointmentBooking.getProtocol(id);
|
|
65
61
|
setPolicy(data);
|
|
66
62
|
onChange && onChange(data);
|
|
67
63
|
} catch (error) {
|
|
@@ -48,8 +48,7 @@ var Deposit = (props) => {
|
|
|
48
48
|
title,
|
|
49
49
|
isAgreePolicy = true,
|
|
50
50
|
isShowTitle = true,
|
|
51
|
-
onChange
|
|
52
|
-
depositProtocolRequest
|
|
51
|
+
onChange
|
|
53
52
|
} = props;
|
|
54
53
|
const context = (0, import_useEngineContext.default)();
|
|
55
54
|
const [visible, setVisible] = (0, import_react.useState)(false);
|
|
@@ -103,8 +102,7 @@ var Deposit = (props) => {
|
|
|
103
102
|
{
|
|
104
103
|
open: visible,
|
|
105
104
|
onCancel: () => setVisible(false),
|
|
106
|
-
item: policyItem
|
|
107
|
-
depositProtocolRequest
|
|
105
|
+
item: policyItem
|
|
108
106
|
}
|
|
109
107
|
));
|
|
110
108
|
};
|
|
@@ -58,17 +58,6 @@ var AppointmentBooking = () => {
|
|
|
58
58
|
}
|
|
59
59
|
});
|
|
60
60
|
}, []);
|
|
61
|
-
(0, import_react.useEffect)(() => {
|
|
62
|
-
const setRealVH = () => {
|
|
63
|
-
const vh = window.innerHeight * 0.01;
|
|
64
|
-
document.documentElement.style.setProperty("--vh", `${vh}px`);
|
|
65
|
-
};
|
|
66
|
-
setRealVH();
|
|
67
|
-
window.addEventListener("resize", setRealVH);
|
|
68
|
-
return () => {
|
|
69
|
-
window.removeEventListener("resize", setRealVH);
|
|
70
|
-
};
|
|
71
|
-
}, []);
|
|
72
61
|
return /* @__PURE__ */ import_react.default.createElement(
|
|
73
62
|
"div",
|
|
74
63
|
{
|
|
@@ -41,8 +41,8 @@ var import_useEngineContext = __toESM(require("../../../../hooks/useEngineContex
|
|
|
41
41
|
var import_materials = require("@pisell/materials");
|
|
42
42
|
var import_useIsBooking4Shop = require("../../hooks/useIsBooking4Shop");
|
|
43
43
|
var import_index = require("./index.less");
|
|
44
|
-
var import_ahooks = require("ahooks");
|
|
45
44
|
var import_utils2 = require("./utils");
|
|
45
|
+
var import_ahooks = require("ahooks");
|
|
46
46
|
var ShopDiscountHooks = {
|
|
47
47
|
onInited: "shopDiscount:onInited",
|
|
48
48
|
onDestroy: "shopDiscount:onDestroy",
|
|
@@ -274,8 +274,8 @@ var VoucherCard = (props) => {
|
|
|
274
274
|
import_materials.PisellGoodPassCard,
|
|
275
275
|
{
|
|
276
276
|
style: { width: "100%" },
|
|
277
|
-
dataSource: ((_d = (_c = state.service) == null ? void 0 : _c.value) == null ? void 0 : _d.length) ? availableData : [],
|
|
278
277
|
mixedSort,
|
|
278
|
+
dataSource: ((_d = (_c = state.service) == null ? void 0 : _c.value) == null ? void 0 : _d.length) ? availableData : [],
|
|
279
279
|
onChange: (val) => {
|
|
280
280
|
const shopDiscount2 = pisellos.getModule("shopDiscount");
|
|
281
281
|
const detail = shopDiscount2.setDiscountSelected({
|
|
@@ -165,10 +165,10 @@ export declare const getProductTotalPrice: (item: any) => number;
|
|
|
165
165
|
export declare const getDuration: (duration: number | {
|
|
166
166
|
type: string;
|
|
167
167
|
value: number;
|
|
168
|
-
}) => number | {
|
|
168
|
+
}) => number | "flexible" | {
|
|
169
169
|
type: string;
|
|
170
170
|
value: number;
|
|
171
|
-
}
|
|
171
|
+
};
|
|
172
172
|
export declare const isWalkIn: (customer_id?: number | string) => boolean;
|
|
173
173
|
export declare const getIsEdit: (state: any) => boolean;
|
|
174
174
|
export {};
|
|
@@ -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: "success" | "page" | "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;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
export declare enum EftposEnum {
|
|
2
|
+
/** 后端支付 - 仅支付 */
|
|
3
|
+
Payo = "payo",
|
|
4
|
+
/** 前端支付 */
|
|
5
|
+
Tyro = "tyro",
|
|
6
|
+
/** 后端支付 - 支付 + 退款 */
|
|
7
|
+
Windcave = "windcave",
|
|
8
|
+
Stripe = "stripe"
|
|
9
|
+
}
|
|
10
|
+
export declare enum StatusEnum {
|
|
11
|
+
Loading = "loading",
|
|
12
|
+
Warn = "warn",
|
|
13
|
+
Fail = "fail",
|
|
14
|
+
Success = "success",
|
|
15
|
+
Pedding = "pedding",
|
|
16
|
+
Resove = "resove",
|
|
17
|
+
Reject = "reject",
|
|
18
|
+
Question = "question"
|
|
19
|
+
}
|
|
20
|
+
export declare enum ModeEnum {
|
|
21
|
+
/** 支付 */
|
|
22
|
+
Pay = "pay",
|
|
23
|
+
/** 完整支付 */
|
|
24
|
+
FullPay = "fullPay",
|
|
25
|
+
/** 退款 */
|
|
26
|
+
Refund = "refund",
|
|
27
|
+
/** 查询 */
|
|
28
|
+
Query = "query"
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* 崩溃恢复
|
|
32
|
+
*/
|
|
33
|
+
export declare enum RestoreEumn {
|
|
34
|
+
/** 常规 */
|
|
35
|
+
Normal = "normal",
|
|
36
|
+
/** 恢复 */
|
|
37
|
+
Restore = "restore"
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* 订单状态
|
|
41
|
+
*/
|
|
42
|
+
export declare enum OrderEumn {
|
|
43
|
+
/** 恢复 */
|
|
44
|
+
Restore = "restore",
|
|
45
|
+
/** 常规 */
|
|
46
|
+
Normal = "normal",
|
|
47
|
+
/** 成功 */
|
|
48
|
+
Succeed = "succeed",
|
|
49
|
+
/** 失败 */
|
|
50
|
+
Failed = "failed",
|
|
51
|
+
/** 等待 */
|
|
52
|
+
Pending = "pending",
|
|
53
|
+
/** 没有订单状态 */
|
|
54
|
+
Null = "null"
|
|
55
|
+
}
|
|
56
|
+
export declare enum ClientEnum {
|
|
57
|
+
/** 用户端 */
|
|
58
|
+
User = "user",
|
|
59
|
+
/** 商家端 */
|
|
60
|
+
Merchant = "merchant"
|
|
61
|
+
}
|
|
62
|
+
export declare enum RouteEnum {
|
|
63
|
+
/** 改价页 */
|
|
64
|
+
Amount = "amount",
|
|
65
|
+
/** 门店列表页 */
|
|
66
|
+
DeviceList = "deviceList",
|
|
67
|
+
/**支付页 */
|
|
68
|
+
Pay = "pay"
|
|
69
|
+
}
|
|
70
|
+
export declare enum PayRouteEnum {
|
|
71
|
+
Step = "step",
|
|
72
|
+
Unset = "unset"
|
|
73
|
+
}
|
|
74
|
+
export declare type RouteType = `${RouteEnum}`;
|
|
75
|
+
export declare type PayRouteType = `${PayRouteEnum}`;
|
|
76
|
+
export declare type DeviceStatusType = `${EftposEnum}`;
|
|
77
|
+
export declare type StatusType = `${StatusEnum}`;
|
|
78
|
+
export declare type ModeType = `${ModeEnum}`;
|
|
79
|
+
export interface PosProps {
|
|
80
|
+
/** 厂商类型 */
|
|
81
|
+
type: DeviceStatusType;
|
|
82
|
+
getApi: () => {
|
|
83
|
+
[key: string]: (...agrn: unknown[]) => Promise<unknown>;
|
|
84
|
+
};
|
|
85
|
+
params: {
|
|
86
|
+
[key: string]: unknown;
|
|
87
|
+
};
|
|
88
|
+
/** 回调 */
|
|
89
|
+
onChangeStatus: (status: `${StatusEnum.Success}` | `${StatusEnum.Fail}` | 'page' | 'print' | 'mark_tx_processed', params?: {
|
|
90
|
+
[keys: string]: unknown;
|
|
91
|
+
} | string, other?: any) => void;
|
|
92
|
+
onChangeParams(...agrn: unknown[]): void;
|
|
93
|
+
terminal: {
|
|
94
|
+
network: boolean;
|
|
95
|
+
};
|
|
96
|
+
device?: {
|
|
97
|
+
[key: string]: unknown;
|
|
98
|
+
};
|
|
99
|
+
mode: ModeEnum;
|
|
100
|
+
tyroUrl?: string;
|
|
101
|
+
tyroVersion?: string;
|
|
102
|
+
source: 'normal' | 'restore';
|
|
103
|
+
}
|
|
104
|
+
export interface PayProps {
|
|
105
|
+
api: ReturnType<PosProps['getApi']>;
|
|
106
|
+
onChange: PosProps['onChangeStatus'];
|
|
107
|
+
className?: string;
|
|
108
|
+
}
|
|
109
|
+
export declare type Amount = {
|
|
110
|
+
name: string;
|
|
111
|
+
/** 订单金额 */
|
|
112
|
+
money: number;
|
|
113
|
+
/** 上一轮操作订单金额 */
|
|
114
|
+
amount: number;
|
|
115
|
+
/** 金额单位 */
|
|
116
|
+
symbol: string;
|
|
117
|
+
/** 手续费-百分率 */
|
|
118
|
+
surRate: number;
|
|
119
|
+
/** 手续费-是否开启 */
|
|
120
|
+
surMoney: number;
|
|
121
|
+
/** 手续费-是否存在 */
|
|
122
|
+
surcharge: boolean;
|
|
123
|
+
/** 是否使用原始手续费 */
|
|
124
|
+
useOriginSurcharge: boolean;
|
|
125
|
+
};
|
|
126
|
+
export declare type PayAmount = {
|
|
127
|
+
/** 手续费-百分比-带百分号 例: 1% =》 数据为 0.01 */
|
|
128
|
+
surPercentRate: string;
|
|
129
|
+
/** 手续费-百分比-不带百分号 例:1% =》 数据为 1 */
|
|
130
|
+
surRate: string;
|
|
131
|
+
/** 手续费-比例金额 amount * surPercentRate */
|
|
132
|
+
surRateMoney: string;
|
|
133
|
+
/** 手续费-固定金额 */
|
|
134
|
+
surMoney: string;
|
|
135
|
+
/** 手续费 = surPercentRate + surMoney */
|
|
136
|
+
surcharge: string;
|
|
137
|
+
/** 支付金额 (不包含手续费) */
|
|
138
|
+
amount: string;
|
|
139
|
+
/** 支付总金额 = amount + surcharge */
|
|
140
|
+
total: string;
|
|
141
|
+
/** 订单金额 */
|
|
142
|
+
sourceAmount: string;
|
|
143
|
+
/** 支付总金额带单位 + 单位 */
|
|
144
|
+
totalUnit: string;
|
|
145
|
+
};
|
|
146
|
+
export declare enum PayStatus {
|
|
147
|
+
'Success' = "200",
|
|
148
|
+
/** 未生成交易记录 */
|
|
149
|
+
'NoPay' = "4004",
|
|
150
|
+
/** 支付失败 */
|
|
151
|
+
'Unknown' = "701000",
|
|
152
|
+
/** 交易请求超时 */
|
|
153
|
+
'Timeout' = "701001",
|
|
154
|
+
/** 繁忙 EFTPOS终端暂时不可用,因为EFTPOS正在处理另一个请求。 */
|
|
155
|
+
'PayOtherEftposFailed' = "701003",
|
|
156
|
+
/** 购物者没有出示卡片/卡片金额不足/在线拒绝/卡已过期/卡被锁定 */
|
|
157
|
+
'PayCardErrorFailed' = "701004",
|
|
158
|
+
/** 断网 向EFTPOS发送消息失败。可能有网络问题,也可能没有连接websocket。 */
|
|
159
|
+
'NoNetWork' = "701005",
|
|
160
|
+
/** 交易等待超时 */
|
|
161
|
+
'PayTimeout' = "701006",
|
|
162
|
+
/** 连接失败 */
|
|
163
|
+
'SocketError' = "701007",
|
|
164
|
+
/** 银行拒绝 */
|
|
165
|
+
'PayBankRefuses' = "701008",
|
|
166
|
+
/** 签名拒绝 */
|
|
167
|
+
'SignatureDeclined' = "701009",
|
|
168
|
+
/** 配置参数错误 */
|
|
169
|
+
'UserConfigError' = "701010"
|
|
170
|
+
}
|
|
171
|
+
export interface ActionProps {
|
|
172
|
+
onChange: (status: `${StatusEnum.Success}` | `${StatusEnum.Fail}` | 'page', params?: {
|
|
173
|
+
[key: string]: unknown;
|
|
174
|
+
} | string) => void;
|
|
175
|
+
api: {
|
|
176
|
+
[key: string]: (...agrn: unknown[]) => Promise<unknown>;
|
|
177
|
+
};
|
|
178
|
+
className?: string;
|
|
179
|
+
isMobile?: boolean;
|
|
180
|
+
formatAmount: (amount: number | string, precision: number, symbol: string) => string;
|
|
181
|
+
}
|
|
@@ -35,7 +35,6 @@ var EftposEnum = /* @__PURE__ */ ((EftposEnum2) => {
|
|
|
35
35
|
EftposEnum2["Tyro"] = "tyro";
|
|
36
36
|
EftposEnum2["Windcave"] = "windcave";
|
|
37
37
|
EftposEnum2["Stripe"] = "stripe";
|
|
38
|
-
EftposEnum2["Linkly"] = "linkly";
|
|
39
38
|
return EftposEnum2;
|
|
40
39
|
})(EftposEnum || {});
|
|
41
40
|
var StatusEnum = /* @__PURE__ */ ((StatusEnum2) => {
|
|
@@ -89,7 +88,6 @@ var PayRouteEnum = /* @__PURE__ */ ((PayRouteEnum2) => {
|
|
|
89
88
|
var PayStatus = /* @__PURE__ */ ((PayStatus2) => {
|
|
90
89
|
PayStatus2["Success"] = "200";
|
|
91
90
|
PayStatus2["NoPay"] = "4004";
|
|
92
|
-
PayStatus2["PairingFailure"] = "606020";
|
|
93
91
|
PayStatus2["Unknown"] = "701000";
|
|
94
92
|
PayStatus2["Timeout"] = "701001";
|
|
95
93
|
PayStatus2["PayOtherEftposFailed"] = "701003";
|
|
@@ -10,7 +10,7 @@ import './device.less';
|
|
|
10
10
|
declare const _default: ({ api, onChange, onClose, className, device_number, isMobile, net, client, formatAmount, }: {
|
|
11
11
|
api: PayProps['api'];
|
|
12
12
|
className?: string | undefined;
|
|
13
|
-
onChange?: ((status: "
|
|
13
|
+
onChange?: ((status: "success" | "page" | "print" | "fail" | "mark_tx_processed", params?: string | {
|
|
14
14
|
[keys: string]: unknown;
|
|
15
15
|
} | undefined, other?: any) => void) | undefined;
|
|
16
16
|
onClose: () => void;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { PayStatus } from './const';
|
|
3
|
+
import { ModeEnum, ClientEnum } from './const';
|
|
4
|
+
export declare const useStoreRef: <T extends {
|
|
5
|
+
[key: string]: unknown;
|
|
6
|
+
} = {
|
|
7
|
+
[key: string]: unknown;
|
|
8
|
+
}, U extends {
|
|
9
|
+
[key: string]: unknown;
|
|
10
|
+
} = {
|
|
11
|
+
[key: string]: unknown;
|
|
12
|
+
}>() => {
|
|
13
|
+
readonly deviceRef: React.MutableRefObject<T>;
|
|
14
|
+
readonly payRef: React.MutableRefObject<U>;
|
|
15
|
+
readonly numRef: React.MutableRefObject<string | number | undefined>;
|
|
16
|
+
readonly orderIdRef: React.MutableRefObject<string | number>;
|
|
17
|
+
readonly modeRef: React.MutableRefObject<ModeEnum>;
|
|
18
|
+
readonly statusRef: React.MutableRefObject<"success" | "loading" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question">;
|
|
19
|
+
readonly netRef: React.MutableRefObject<boolean | undefined>;
|
|
20
|
+
readonly symbolRef: React.MutableRefObject<string>;
|
|
21
|
+
readonly amountRef: React.MutableRefObject<string | number>;
|
|
22
|
+
readonly eftposRef: React.MutableRefObject<"tyro" | "windcave" | "stripe" | "payo">;
|
|
23
|
+
readonly clientRef: React.MutableRefObject<ClientEnum>;
|
|
24
|
+
readonly dataRef: React.MutableRefObject<import("./store").State>;
|
|
25
|
+
};
|
|
26
|
+
/**
|
|
27
|
+
* @title: 通用失败处理
|
|
28
|
+
* @description: 固定步骤 错误处理逻辑
|
|
29
|
+
* @return null
|
|
30
|
+
* @Author: hongbing.wang
|
|
31
|
+
* @Date: 2024-08-12 11:54
|
|
32
|
+
*/
|
|
33
|
+
export declare const useFail: (index: number) => (res: {
|
|
34
|
+
code?: `${PayStatus}`;
|
|
35
|
+
}, isMark?: boolean) => void;
|
|
@@ -128,7 +128,6 @@ var useFail = (index) => {
|
|
|
128
128
|
return;
|
|
129
129
|
}
|
|
130
130
|
const [code] = [`${res.code}`];
|
|
131
|
-
console.log("code---->>>>>>>", code);
|
|
132
131
|
if (code === import_const.PayStatus.Unknown) {
|
|
133
132
|
steps[index].title = import_utils.locales.getText("page.eftpos-pay.text.failed")(
|
|
134
133
|
modeRef.current
|
|
@@ -169,12 +168,8 @@ var useFail = (index) => {
|
|
|
169
168
|
if (isMark) {
|
|
170
169
|
if (clientRef.current === import_const2.ClientEnum.User) {
|
|
171
170
|
steps[index].status = "fail";
|
|
172
|
-
steps[index].title = import_utils.locales.getText(
|
|
173
|
-
|
|
174
|
-
);
|
|
175
|
-
steps[index].fail = import_utils.locales.getText(
|
|
176
|
-
"page.eftpos-pay.text.transaction.eftpos.fail.other"
|
|
177
|
-
);
|
|
171
|
+
steps[index].title = import_utils.locales.getText("page.eftpos-pay.text.timedout.title");
|
|
172
|
+
steps[index].fail = import_utils.locales.getText("page.eftpos-pay.text.transaction.eftpos.fail.other");
|
|
178
173
|
steps[index].custom = steps[index].custom ? { ...steps[index].custom, isPosNetworkError: true } : { isPosNetworkError: true };
|
|
179
174
|
dispatch((0, import_store.updateSteps)(steps));
|
|
180
175
|
dispatch((0, import_store.updateComponent)("Fail"));
|
|
@@ -315,9 +310,7 @@ ${import_utils.locales.getText(
|
|
|
315
310
|
)}
|
|
316
311
|
${import_utils.locales.getText(
|
|
317
312
|
"page.eftpos-pay.text.transaction.eftpos.fail.if"
|
|
318
|
-
)(modeRef.current)}` : import_utils.locales.getText(
|
|
319
|
-
"page.eftpos-pay.text.transaction.eftpos.fail.other"
|
|
320
|
-
);
|
|
313
|
+
)(modeRef.current)}` : import_utils.locales.getText("page.eftpos-pay.text.transaction.eftpos.fail.other");
|
|
321
314
|
steps[index].status = "warn";
|
|
322
315
|
steps[index].custom = steps[index].custom ? { ...steps[index].custom, isPosNetworkError: true } : { isPosNetworkError: true };
|
|
323
316
|
dispatch((0, import_store.updateSteps)(steps));
|
|
@@ -366,7 +359,7 @@ ${import_utils.locales.getText(
|
|
|
366
359
|
);
|
|
367
360
|
return;
|
|
368
361
|
}
|
|
369
|
-
if (code === import_const.PayStatus.UserConfigError
|
|
362
|
+
if (code === import_const.PayStatus.UserConfigError) {
|
|
370
363
|
steps[index].title = import_utils.locales.getText(
|
|
371
364
|
"page.eftpos-pay.text.transaction.user.config.title"
|
|
372
365
|
);
|
|
@@ -139,7 +139,7 @@ var eftposPay_default = (props) => {
|
|
|
139
139
|
}, [mode, state]);
|
|
140
140
|
(0, import_react.useEffect)(() => {
|
|
141
141
|
document.body.id = "body";
|
|
142
|
-
console.log("初始化 ........
|
|
142
|
+
console.log("初始化 ........11221801");
|
|
143
143
|
}, []);
|
|
144
144
|
console.log("props?.params?.device_number = ", (_e = props == null ? void 0 : props.params) == null ? void 0 : _e.device_number);
|
|
145
145
|
const api = (0, import_react.useMemo)(() => {
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { State } from './store';
|
|
2
|
+
export { getAmonunt } from './helper';
|
|
3
|
+
export { default as Payo } from './payo';
|
|
4
|
+
export { default as Windcave } from './windcave/windcave';
|
|
5
|
+
export { default as Tyro } from './tyro';
|
|
6
|
+
export declare const getInitState: (type: string, params?: any) => State;
|
|
@@ -29,7 +29,6 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
29
29
|
// src/components/eftposPay/manufacturer.tsx
|
|
30
30
|
var manufacturer_exports = {};
|
|
31
31
|
__export(manufacturer_exports, {
|
|
32
|
-
Linkly: () => import_linkly.default,
|
|
33
32
|
Payo: () => import_payo.default,
|
|
34
33
|
Tyro: () => import_tyro.default,
|
|
35
34
|
Windcave: () => import_windcave.default,
|
|
@@ -41,12 +40,10 @@ var import_const = require("./const");
|
|
|
41
40
|
var import_const2 = __toESM(require("./payo/const"));
|
|
42
41
|
var import_const3 = __toESM(require("./tyro/const"));
|
|
43
42
|
var import_const4 = __toESM(require("./windcave/const"));
|
|
44
|
-
var import_const5 = __toESM(require("./linkly/const"));
|
|
45
43
|
var import_helper = require("./helper");
|
|
46
44
|
var import_payo = __toESM(require("./payo"));
|
|
47
45
|
var import_windcave = __toESM(require("./windcave/windcave"));
|
|
48
46
|
var import_tyro = __toESM(require("./tyro"));
|
|
49
|
-
var import_linkly = __toESM(require("./linkly"));
|
|
50
47
|
var getInitState = (type, params) => {
|
|
51
48
|
switch (type) {
|
|
52
49
|
case import_const.EftposEnum.Payo:
|
|
@@ -55,15 +52,12 @@ var getInitState = (type, params) => {
|
|
|
55
52
|
return (0, import_const4.default)(params);
|
|
56
53
|
case import_const.EftposEnum.Tyro:
|
|
57
54
|
return (0, import_const3.default)(params);
|
|
58
|
-
case import_const.EftposEnum.Linkly:
|
|
59
|
-
return (0, import_const5.default)(params);
|
|
60
55
|
default:
|
|
61
56
|
throw new Error("未知的厂商类型");
|
|
62
57
|
}
|
|
63
58
|
};
|
|
64
59
|
// Annotate the CommonJS export names for ESM import in node:
|
|
65
60
|
0 && (module.exports = {
|
|
66
|
-
Linkly,
|
|
67
61
|
Payo,
|
|
68
62
|
Tyro,
|
|
69
63
|
Windcave,
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { PayProps } from './const';
|
|
2
|
+
import './index.less';
|
|
3
|
+
/**
|
|
4
|
+
* @title: 支付组件
|
|
5
|
+
* @description:
|
|
6
|
+
* @Author: hongbing.wang
|
|
7
|
+
* @Date: 2024-08-20 14:59
|
|
8
|
+
*/
|
|
9
|
+
declare const Pay: ({ api, onChange: onChangeStatus, className, terminal, net, isMobile, tyroUrl, tyroVersion, formatAmount, client }: PayProps & {
|
|
10
|
+
terminal: {
|
|
11
|
+
network: boolean;
|
|
12
|
+
};
|
|
13
|
+
net: boolean;
|
|
14
|
+
isMobile: boolean;
|
|
15
|
+
tyroUrl?: string | undefined;
|
|
16
|
+
tyroVersion?: string | undefined;
|
|
17
|
+
formatAmount(amount: number | string, precision: number, symbol: string): string;
|
|
18
|
+
client: string;
|
|
19
|
+
}) => JSX.Element;
|
|
20
|
+
export default Pay;
|