@pisell/private-materials 3.4.12 → 3.4.14
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.js +12 -12
- package/build/lowcode/view.js +11 -11
- package/es/components/booking/addons/model.d.ts +1 -10
- package/es/components/booking/components/customSelect/index.d.ts +38 -0
- package/es/components/booking/editBookingModal/index.js +3 -4
- package/es/components/booking/forms/model.d.ts +1 -10
- package/es/components/booking/forms/single/RenderValueById.d.ts +7 -0
- package/es/components/booking/hooks/useClearCart.d.ts +2 -0
- package/es/components/booking/hooks/useQuotation.d.ts +5 -0
- package/es/components/booking/info/client/index.d.ts +4 -0
- package/es/components/booking/info/hooks/useInfoHolder.d.ts +9 -0
- package/es/components/booking/info/model.d.ts +1 -10
- package/es/components/booking/info/service/Lists.d.ts +2 -0
- package/es/components/booking/info/service/addService/utils.d.ts +1 -1
- package/es/components/booking/info/service2/utils.d.ts +247 -0
- package/es/components/booking/info/utils.d.ts +50 -0
- package/es/components/booking/info2/index.d.ts +12 -0
- package/es/components/booking/info2/service/addService/utils.d.ts +98 -0
- package/es/components/booking/info2/service/addService/utils.js +16 -1
- package/es/components/booking/info2/service/addTimeModal/index.d.ts +3 -0
- package/es/components/booking/info2/service/editService/Resources/index.d.ts +4 -0
- package/es/components/booking/info2/service/editService/index.d.ts +7 -0
- package/es/components/booking/info2/service/index.d.ts +4 -0
- package/es/components/booking/info2/utilsByBooking.d.ts +35 -0
- package/es/components/booking/locales.d.ts +822 -0
- package/es/components/booking/materiels/duration/index.d.ts +13 -0
- package/es/components/booking/materiels/startTime/index.d.ts +9 -0
- package/es/components/booking/model.d.ts +1 -9
- package/es/components/booking/notes/model.d.ts +1 -10
- package/es/components/booking/payments/model.d.ts +1 -10
- package/es/components/booking/utils.d.ts +174 -0
- package/es/components/eftposPay/const.d.ts +4 -1
- package/es/components/eftposPay/const.js +3 -1
- package/es/components/eftposPay/hooks.d.ts +2 -2
- package/es/components/eftposPay/hooks.js +3 -1
- package/es/components/eftposPay/index.js +1 -1
- package/es/components/eftposPay/linkly/const.d.ts +23 -0
- package/es/components/eftposPay/linkly/const.js +82 -0
- package/es/components/eftposPay/linkly/hooks/index.d.ts +2 -0
- package/es/components/eftposPay/linkly/hooks/index.js +2 -0
- package/es/components/eftposPay/linkly/hooks/normal.d.ts +30 -0
- package/es/components/eftposPay/linkly/hooks/normal.js +321 -0
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +4 -0
- package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +273 -0
- package/es/components/eftposPay/linkly/index.d.ts +2 -0
- package/es/components/eftposPay/linkly/index.js +197 -0
- package/es/components/eftposPay/linkly/service.d.ts +32 -0
- package/es/components/eftposPay/linkly/service.js +81 -0
- package/es/components/eftposPay/manufacturer.d.ts +1 -0
- package/es/components/eftposPay/manufacturer.js +4 -0
- package/es/components/eftposPay/pay.d.ts +1 -1
- package/es/components/eftposPay/pay.js +6 -2
- package/es/components/eftposPay/store/index.d.ts +4 -4
- package/es/components/pay/toC/model.d.ts +1 -9
- package/es/components/schedules/model.d.ts +1 -9
- package/es/components/shoppingCart/components/Cart/Product.d.ts +3 -0
- package/es/components/shoppingCart/components/Cart/index.d.ts +3 -0
- package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +9 -0
- package/es/components/ticketBooking/components/ticketBooking/index.js +3 -0
- package/es/components/ticketBooking/components/timeBar/index.d.ts +12 -0
- package/es/components/ticketBooking/utils/index.d.ts +25 -0
- package/es/components/wallet/Detail/model.d.ts +1 -13
- package/es/components/wallet/DiscountCard/model.d.ts +1 -14
- package/es/components/wallet/PointCard/model.d.ts +1 -13
- package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/es/components/wallet/Voucher/model.d.ts +1 -13
- package/es/components/wallet/model.d.ts +1 -9
- package/lib/components/booking/addons/model.d.ts +1 -10
- package/lib/components/booking/components/customSelect/index.d.ts +38 -0
- package/lib/components/booking/editBookingModal/index.js +3 -4
- package/lib/components/booking/forms/model.d.ts +1 -10
- package/lib/components/booking/forms/single/RenderValueById.d.ts +7 -0
- package/lib/components/booking/hooks/useClearCart.d.ts +2 -0
- package/lib/components/booking/hooks/useQuotation.d.ts +5 -0
- package/lib/components/booking/info/client/index.d.ts +4 -0
- package/lib/components/booking/info/hooks/useInfoHolder.d.ts +9 -0
- package/lib/components/booking/info/model.d.ts +1 -10
- package/lib/components/booking/info/service/Lists.d.ts +2 -0
- package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
- package/lib/components/booking/info/service2/utils.d.ts +247 -0
- package/lib/components/booking/info/utils.d.ts +50 -0
- package/lib/components/booking/info2/index.d.ts +12 -0
- package/lib/components/booking/info2/service/addService/utils.d.ts +98 -0
- package/lib/components/booking/info2/service/addService/utils.js +15 -3
- package/lib/components/booking/info2/service/addTimeModal/index.d.ts +3 -0
- package/lib/components/booking/info2/service/editService/Resources/index.d.ts +4 -0
- package/lib/components/booking/info2/service/editService/index.d.ts +7 -0
- package/lib/components/booking/info2/service/index.d.ts +4 -0
- package/lib/components/booking/info2/utilsByBooking.d.ts +35 -0
- package/lib/components/booking/locales.d.ts +822 -0
- package/lib/components/booking/materiels/duration/index.d.ts +13 -0
- package/lib/components/booking/materiels/startTime/index.d.ts +9 -0
- package/lib/components/booking/model.d.ts +1 -9
- package/lib/components/booking/notes/model.d.ts +1 -10
- package/lib/components/booking/payments/model.d.ts +1 -10
- package/lib/components/booking/utils.d.ts +174 -0
- package/lib/components/eftposPay/const.d.ts +4 -1
- package/lib/components/eftposPay/const.js +2 -0
- package/lib/components/eftposPay/hooks.d.ts +2 -2
- package/lib/components/eftposPay/hooks.js +11 -4
- package/lib/components/eftposPay/index.js +1 -1
- package/lib/components/eftposPay/linkly/const.d.ts +23 -0
- package/lib/components/eftposPay/linkly/const.js +102 -0
- package/lib/components/eftposPay/linkly/hooks/index.d.ts +2 -0
- package/lib/components/eftposPay/linkly/hooks/index.js +25 -0
- package/lib/components/eftposPay/linkly/hooks/normal.d.ts +30 -0
- package/lib/components/eftposPay/linkly/hooks/normal.js +242 -0
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +4 -0
- package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +222 -0
- package/lib/components/eftposPay/linkly/index.d.ts +2 -0
- package/lib/components/eftposPay/linkly/index.js +208 -0
- package/lib/components/eftposPay/linkly/service.d.ts +32 -0
- package/lib/components/eftposPay/linkly/service.js +55 -0
- package/lib/components/eftposPay/manufacturer.d.ts +1 -0
- package/lib/components/eftposPay/manufacturer.js +6 -0
- package/lib/components/eftposPay/pay.d.ts +1 -1
- package/lib/components/eftposPay/pay.js +13 -2
- package/lib/components/eftposPay/store/index.d.ts +4 -4
- package/lib/components/pay/toC/model.d.ts +1 -9
- package/lib/components/schedules/model.d.ts +1 -9
- package/lib/components/shoppingCart/components/Cart/Product.d.ts +3 -0
- package/lib/components/shoppingCart/components/Cart/index.d.ts +3 -0
- package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +9 -0
- package/lib/components/ticketBooking/components/ticketBooking/index.js +3 -0
- package/lib/components/ticketBooking/components/timeBar/index.d.ts +12 -0
- package/lib/components/ticketBooking/utils/index.d.ts +25 -0
- package/lib/components/wallet/Detail/model.d.ts +1 -13
- package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
- package/lib/components/wallet/PointCard/model.d.ts +1 -13
- package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
- package/lib/components/wallet/Voucher/model.d.ts +1 -13
- package/lib/components/wallet/model.d.ts +1 -9
- package/package.json +1 -1
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { SelectProps } from 'antd';
|
|
2
|
+
interface DurationProps extends SelectProps {
|
|
3
|
+
locale?: string;
|
|
4
|
+
slice?: number;
|
|
5
|
+
selectProps?: SelectProps;
|
|
6
|
+
timeObjChange?: any;
|
|
7
|
+
duration?: any;
|
|
8
|
+
usableTime?: any;
|
|
9
|
+
startDate?: any;
|
|
10
|
+
timeObj?: any;
|
|
11
|
+
}
|
|
12
|
+
declare const Duration: (props: DurationProps) => JSX.Element;
|
|
13
|
+
export default Duration;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { SelectProps } from "antd";
|
|
2
|
+
interface StartTimeProps extends SelectProps {
|
|
3
|
+
locale?: string;
|
|
4
|
+
slice?: number;
|
|
5
|
+
selectProps?: SelectProps;
|
|
6
|
+
timeObjChange?: any;
|
|
7
|
+
}
|
|
8
|
+
declare const StartTime: (props: StartTimeProps) => JSX.Element;
|
|
9
|
+
export default StartTime;
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
1
|
export interface FormState {
|
|
3
2
|
amountSymbol: string;
|
|
4
3
|
apis: {
|
|
@@ -105,11 +104,4 @@ export declare const walkInData: {
|
|
|
105
104
|
id: number;
|
|
106
105
|
nickname: string;
|
|
107
106
|
};
|
|
108
|
-
export declare const Provider:
|
|
109
|
-
state: FormState;
|
|
110
|
-
} & {
|
|
111
|
-
dispatch: (params: {
|
|
112
|
-
type: string;
|
|
113
|
-
payload: any;
|
|
114
|
-
}) => void;
|
|
115
|
-
}>;
|
|
107
|
+
export declare const Provider: any, Context: any;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
4
|
-
state: FormState;
|
|
5
|
-
} & {
|
|
6
|
-
dispatch: (params: {
|
|
7
|
-
type: string;
|
|
8
|
-
payload: any;
|
|
9
|
-
}) => void;
|
|
10
|
-
}>;
|
|
1
|
+
export declare const Provider: any, Context: any;
|
|
@@ -1,10 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { FormState } from "../model";
|
|
3
|
-
export declare const Provider: (ComponentUi: any) => any, Context: import("react").Context<{
|
|
4
|
-
state: FormState;
|
|
5
|
-
} & {
|
|
6
|
-
dispatch: (params: {
|
|
7
|
-
type: string;
|
|
8
|
-
payload: any;
|
|
9
|
-
}) => void;
|
|
10
|
-
}>;
|
|
1
|
+
export declare const Provider: any, Context: any;
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import dayjs from 'dayjs';
|
|
2
|
+
declare type RType = (url: string, data?: {} | undefined, config?: {} | undefined) => Promise<any>;
|
|
3
|
+
declare class Request {
|
|
4
|
+
private request;
|
|
5
|
+
constructor();
|
|
6
|
+
setRequest(val: any): void;
|
|
7
|
+
getRequest(): {
|
|
8
|
+
get: RType;
|
|
9
|
+
post: RType;
|
|
10
|
+
put: RType;
|
|
11
|
+
remove: RType;
|
|
12
|
+
custom: RType;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export declare const request: Request;
|
|
16
|
+
/**
|
|
17
|
+
* @title: 格式化持续时长用于展示
|
|
18
|
+
* @description:
|
|
19
|
+
* @param {number} service_times
|
|
20
|
+
* @return {*}
|
|
21
|
+
* @Author: zhiwei.Wang
|
|
22
|
+
* @Date: 2024-04-26 14:00
|
|
23
|
+
*/
|
|
24
|
+
export declare const getDiscountTime: (service_times: number, isDay?: boolean) => string;
|
|
25
|
+
/**
|
|
26
|
+
* @title: 时间切片
|
|
27
|
+
* @description:
|
|
28
|
+
* @param {any} config
|
|
29
|
+
* @param {string} locale
|
|
30
|
+
* @return {*}
|
|
31
|
+
* @Author: zhiwei.Wang
|
|
32
|
+
* @Date: 2024-04-26 13:59
|
|
33
|
+
*/
|
|
34
|
+
export declare const sliceDayIntoFiveMinutes: (config: any, locale: string, isDay?: boolean) => {
|
|
35
|
+
timeSlices: {
|
|
36
|
+
label: string;
|
|
37
|
+
value: string;
|
|
38
|
+
}[];
|
|
39
|
+
durationSlicesBasedOnTime: {
|
|
40
|
+
label: string;
|
|
41
|
+
value: number;
|
|
42
|
+
}[];
|
|
43
|
+
};
|
|
44
|
+
export declare const getNowTime: () => string;
|
|
45
|
+
export declare const isNowTime: (time: string) => boolean;
|
|
46
|
+
/**
|
|
47
|
+
* @title: 获取服务的开始时间, 如果是now 转换为当前的时间
|
|
48
|
+
* @description:
|
|
49
|
+
* @param {string} start_time
|
|
50
|
+
* @return {*}
|
|
51
|
+
* @Author: zhiwei.Wang
|
|
52
|
+
* @Date: 2024-04-26 14:03
|
|
53
|
+
*/
|
|
54
|
+
export declare const getServeStartTime: (start_time: string) => string;
|
|
55
|
+
/**
|
|
56
|
+
* @title: 格式化服务的 开始时间-结束时间-时长, 用于展示
|
|
57
|
+
* @description:
|
|
58
|
+
* @param {any} item
|
|
59
|
+
* @param {any} currentDate
|
|
60
|
+
* @return {*}
|
|
61
|
+
* @Author: zhiwei.Wang
|
|
62
|
+
* @Date: 2024-04-26 14:04
|
|
63
|
+
*/
|
|
64
|
+
export declare const getServiceTime: (item: any, currentDate: any) => string;
|
|
65
|
+
export declare const findNextSlice: ({ timeSlices, index, date, }: {
|
|
66
|
+
timeSlices: any[];
|
|
67
|
+
index?: number | undefined;
|
|
68
|
+
date?: string | undefined;
|
|
69
|
+
}) => any;
|
|
70
|
+
export declare const findNextDuration: (current: any, array: any, defaultValue?: any) => any;
|
|
71
|
+
export declare const formatProductListByCategory: (list: any, filterItem: any) => unknown[];
|
|
72
|
+
export declare const getResourceTimeIsUsable: (item: any, cacheItem: any) => any;
|
|
73
|
+
/**
|
|
74
|
+
* @title: 查找是否有可用的time
|
|
75
|
+
* @description:
|
|
76
|
+
* @param {any} resourceItem
|
|
77
|
+
* @return {*}
|
|
78
|
+
* @Author: zhiwei.Wang
|
|
79
|
+
* @Date: 2024-01-09 13:57
|
|
80
|
+
*/
|
|
81
|
+
export declare const formatTimes: (resourceItem: any, cacheItem: any) => any;
|
|
82
|
+
/**
|
|
83
|
+
* @title: 获取店铺的营业结束时间
|
|
84
|
+
* @description:
|
|
85
|
+
* @return {*}
|
|
86
|
+
* @Author: zhiwei.Wang
|
|
87
|
+
* @Date: 2024-02-23 10:00
|
|
88
|
+
*/
|
|
89
|
+
export declare const getShopOpeningHours: () => string;
|
|
90
|
+
/**
|
|
91
|
+
* @title: 对灵活时长进行处理
|
|
92
|
+
* @description:
|
|
93
|
+
* @return {*}
|
|
94
|
+
* @Author: zhiwei.Wang
|
|
95
|
+
* @Date: 2024-02-23 10:00
|
|
96
|
+
*/
|
|
97
|
+
export declare const flexibleObj: {
|
|
98
|
+
create: (num: number) => any;
|
|
99
|
+
getValue: (str: string | number) => number;
|
|
100
|
+
isFlexible: (str: string | number) => boolean;
|
|
101
|
+
add: (current: number | string, duration: number) => any;
|
|
102
|
+
};
|
|
103
|
+
/**
|
|
104
|
+
* @title: 获取结束时间
|
|
105
|
+
* @description: 取 endDate | 店铺营业时间 最小的那一个
|
|
106
|
+
* @param {any} startDate
|
|
107
|
+
* @param {string} duration
|
|
108
|
+
* @param {any} endDate
|
|
109
|
+
* @return {*}
|
|
110
|
+
* @Author: zhiwei.Wang
|
|
111
|
+
* @Date: 2024-02-23 10:01
|
|
112
|
+
*/
|
|
113
|
+
export declare const getEndDate: (startDate: any, duration: string | number, endDate: any) => any;
|
|
114
|
+
export declare const getServiceTimes: (service: any) => {
|
|
115
|
+
startDate: dayjs.Dayjs;
|
|
116
|
+
endDate: dayjs.Dayjs;
|
|
117
|
+
};
|
|
118
|
+
export declare const getErrorList: (resource: any, cacheItem: any, isDay?: boolean) => {
|
|
119
|
+
label: any;
|
|
120
|
+
type: string;
|
|
121
|
+
}[];
|
|
122
|
+
/**
|
|
123
|
+
* @title: 格式化资源, 添加自定义参数
|
|
124
|
+
* @description:
|
|
125
|
+
* @param {any} resourceItem
|
|
126
|
+
* @return {*}
|
|
127
|
+
* @Author: zhiwei.Wang
|
|
128
|
+
* @Date: 2024-01-09 13:40
|
|
129
|
+
*/
|
|
130
|
+
export declare const formatResource: (resourceItem: any, cacheItem?: any, formatLabel?: any) => any;
|
|
131
|
+
export declare const getLastServer: (list: any) => any;
|
|
132
|
+
export declare const getCacheParams: () => any;
|
|
133
|
+
export declare const deleteCacheParams: () => void;
|
|
134
|
+
/**
|
|
135
|
+
* @title: 获取跨日预约的时长
|
|
136
|
+
* @description:
|
|
137
|
+
* @param {any} cacheItem
|
|
138
|
+
* @return {*}
|
|
139
|
+
* @Author: WangHan
|
|
140
|
+
* @Date: 2024-12-01 22:43
|
|
141
|
+
*/
|
|
142
|
+
export declare const getDays: (cacheItem: any, type: 'minutes' | 'days') => any;
|
|
143
|
+
export declare const isSessionProduct: (cacheItem: any) => boolean;
|
|
144
|
+
export declare const getIsEject: (item: any, type: 'select' | 'detail') => boolean;
|
|
145
|
+
export declare const getIsOnlySession: (item: any) => boolean;
|
|
146
|
+
/**
|
|
147
|
+
* @title: 创建一个服务商品
|
|
148
|
+
* @description:
|
|
149
|
+
* @param {any} state
|
|
150
|
+
* @param {any} item
|
|
151
|
+
* @return {*}
|
|
152
|
+
* @Author: zhiwei.Wang
|
|
153
|
+
* @Date: 2024-01-26 14:09
|
|
154
|
+
*/
|
|
155
|
+
export declare const getServerItemExtend: (state: any, cacheItem: any, timeObj: any) => any;
|
|
156
|
+
export declare const getProductTotalPrice: (item: any) => number;
|
|
157
|
+
/**
|
|
158
|
+
* @title: 判断 duration
|
|
159
|
+
* @description: 用于处理不同格式的duration
|
|
160
|
+
* @param {number} duration
|
|
161
|
+
* @return {*}
|
|
162
|
+
* @Author: zhiwei.Wang
|
|
163
|
+
* @Date: 2024-02-23 10:02
|
|
164
|
+
*/
|
|
165
|
+
export declare const getDuration: (duration: number | {
|
|
166
|
+
type: string;
|
|
167
|
+
value: number;
|
|
168
|
+
}) => number | {
|
|
169
|
+
type: string;
|
|
170
|
+
value: number;
|
|
171
|
+
} | "flexible";
|
|
172
|
+
export declare const isWalkIn: (customer_id?: number | string) => boolean;
|
|
173
|
+
export declare const getIsEdit: (state: any) => boolean;
|
|
174
|
+
export {};
|
|
@@ -5,7 +5,8 @@ export declare enum EftposEnum {
|
|
|
5
5
|
Tyro = "tyro",
|
|
6
6
|
/** 后端支付 - 支付 + 退款 */
|
|
7
7
|
Windcave = "windcave",
|
|
8
|
-
Stripe = "stripe"
|
|
8
|
+
Stripe = "stripe",
|
|
9
|
+
Linkly = "linkly"
|
|
9
10
|
}
|
|
10
11
|
export declare enum StatusEnum {
|
|
11
12
|
Loading = "loading",
|
|
@@ -147,6 +148,8 @@ export declare enum PayStatus {
|
|
|
147
148
|
'Success' = "200",
|
|
148
149
|
/** 未生成交易记录 */
|
|
149
150
|
'NoPay' = "4004",
|
|
151
|
+
/** 配对失效 */
|
|
152
|
+
'PairingFailure' = "606020",
|
|
150
153
|
/** 支付失败 */
|
|
151
154
|
'Unknown' = "701000",
|
|
152
155
|
/** 交易请求超时 */
|
|
@@ -35,6 +35,7 @@ var EftposEnum = /* @__PURE__ */ ((EftposEnum2) => {
|
|
|
35
35
|
EftposEnum2["Tyro"] = "tyro";
|
|
36
36
|
EftposEnum2["Windcave"] = "windcave";
|
|
37
37
|
EftposEnum2["Stripe"] = "stripe";
|
|
38
|
+
EftposEnum2["Linkly"] = "linkly";
|
|
38
39
|
return EftposEnum2;
|
|
39
40
|
})(EftposEnum || {});
|
|
40
41
|
var StatusEnum = /* @__PURE__ */ ((StatusEnum2) => {
|
|
@@ -88,6 +89,7 @@ var PayRouteEnum = /* @__PURE__ */ ((PayRouteEnum2) => {
|
|
|
88
89
|
var PayStatus = /* @__PURE__ */ ((PayStatus2) => {
|
|
89
90
|
PayStatus2["Success"] = "200";
|
|
90
91
|
PayStatus2["NoPay"] = "4004";
|
|
92
|
+
PayStatus2["PairingFailure"] = "606020";
|
|
91
93
|
PayStatus2["Unknown"] = "701000";
|
|
92
94
|
PayStatus2["Timeout"] = "701001";
|
|
93
95
|
PayStatus2["PayOtherEftposFailed"] = "701003";
|
|
@@ -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
|
};
|
|
@@ -128,6 +128,7 @@ var useFail = (index) => {
|
|
|
128
128
|
return;
|
|
129
129
|
}
|
|
130
130
|
const [code] = [`${res.code}`];
|
|
131
|
+
console.log("code---->>>>>>>", code);
|
|
131
132
|
if (code === import_const.PayStatus.Unknown) {
|
|
132
133
|
steps[index].title = import_utils.locales.getText("page.eftpos-pay.text.failed")(
|
|
133
134
|
modeRef.current
|
|
@@ -168,8 +169,12 @@ var useFail = (index) => {
|
|
|
168
169
|
if (isMark) {
|
|
169
170
|
if (clientRef.current === import_const2.ClientEnum.User) {
|
|
170
171
|
steps[index].status = "fail";
|
|
171
|
-
steps[index].title = import_utils.locales.getText(
|
|
172
|
-
|
|
172
|
+
steps[index].title = import_utils.locales.getText(
|
|
173
|
+
"page.eftpos-pay.text.timedout.title"
|
|
174
|
+
);
|
|
175
|
+
steps[index].fail = import_utils.locales.getText(
|
|
176
|
+
"page.eftpos-pay.text.transaction.eftpos.fail.other"
|
|
177
|
+
);
|
|
173
178
|
steps[index].custom = steps[index].custom ? { ...steps[index].custom, isPosNetworkError: true } : { isPosNetworkError: true };
|
|
174
179
|
dispatch((0, import_store.updateSteps)(steps));
|
|
175
180
|
dispatch((0, import_store.updateComponent)("Fail"));
|
|
@@ -310,7 +315,9 @@ ${import_utils.locales.getText(
|
|
|
310
315
|
)}
|
|
311
316
|
${import_utils.locales.getText(
|
|
312
317
|
"page.eftpos-pay.text.transaction.eftpos.fail.if"
|
|
313
|
-
)(modeRef.current)}` : import_utils.locales.getText(
|
|
318
|
+
)(modeRef.current)}` : import_utils.locales.getText(
|
|
319
|
+
"page.eftpos-pay.text.transaction.eftpos.fail.other"
|
|
320
|
+
);
|
|
314
321
|
steps[index].status = "warn";
|
|
315
322
|
steps[index].custom = steps[index].custom ? { ...steps[index].custom, isPosNetworkError: true } : { isPosNetworkError: true };
|
|
316
323
|
dispatch((0, import_store.updateSteps)(steps));
|
|
@@ -359,7 +366,7 @@ ${import_utils.locales.getText(
|
|
|
359
366
|
);
|
|
360
367
|
return;
|
|
361
368
|
}
|
|
362
|
-
if (code === import_const.PayStatus.UserConfigError) {
|
|
369
|
+
if (code === import_const.PayStatus.UserConfigError || code === import_const.PayStatus.PairingFailure) {
|
|
363
370
|
steps[index].title = import_utils.locales.getText(
|
|
364
371
|
"page.eftpos-pay.text.transaction.user.config.title"
|
|
365
372
|
);
|
|
@@ -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("初始化 ........112218017777");
|
|
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,23 @@
|
|
|
1
|
+
import { State } from '../store';
|
|
2
|
+
import { ModeEnum } from '../const';
|
|
3
|
+
export declare const getStep: (mode?: ModeEnum) => State['steps'];
|
|
4
|
+
declare const _default: (params: any) => State;
|
|
5
|
+
export default _default;
|
|
6
|
+
export declare enum EVisibleButtonType {
|
|
7
|
+
/** 取消按钮 */
|
|
8
|
+
CancelButton = "CancelButton",
|
|
9
|
+
/** 等待按钮 */
|
|
10
|
+
WaitButton = "WaitButton"
|
|
11
|
+
}
|
|
12
|
+
export declare enum LinklyActionStatus {
|
|
13
|
+
/** 空 */
|
|
14
|
+
Empty = "Empty",
|
|
15
|
+
/** 取消 */
|
|
16
|
+
Cancel = "Cancel",
|
|
17
|
+
/** 取消中 */
|
|
18
|
+
CancelWaiting = "CancelWaiting",
|
|
19
|
+
/** 签名 */
|
|
20
|
+
Signature = "Signature",
|
|
21
|
+
/** 签名等待中 */
|
|
22
|
+
SignatureWaiting = "SignatureWaiting"
|
|
23
|
+
}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
8
|
+
};
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
16
|
+
};
|
|
17
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
18
|
+
|
|
19
|
+
// src/components/eftposPay/linkly/const.ts
|
|
20
|
+
var const_exports = {};
|
|
21
|
+
__export(const_exports, {
|
|
22
|
+
EVisibleButtonType: () => EVisibleButtonType,
|
|
23
|
+
LinklyActionStatus: () => LinklyActionStatus,
|
|
24
|
+
default: () => const_default,
|
|
25
|
+
getStep: () => getStep
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(const_exports);
|
|
28
|
+
var import_utils = require("@pisell/utils");
|
|
29
|
+
var import_const = require("../const");
|
|
30
|
+
var getStep = (mode = import_const.ModeEnum.Pay) => [
|
|
31
|
+
{
|
|
32
|
+
key: Date.now(),
|
|
33
|
+
title: import_utils.locales.getText("page.eftpos-pay.text.loading")(mode),
|
|
34
|
+
// 'Payment in process...',
|
|
35
|
+
text: import_utils.locales.getText("page.eftpos-pay.text.waiting.processing"),
|
|
36
|
+
// 'Waiting for the processing...',
|
|
37
|
+
warn: "",
|
|
38
|
+
tip: import_utils.locales.getText("page.eftpos-pay.text.processing"),
|
|
39
|
+
// 'processing...',
|
|
40
|
+
status: import_const.StatusEnum.Loading
|
|
41
|
+
}
|
|
42
|
+
];
|
|
43
|
+
var const_default = (params) => {
|
|
44
|
+
const {
|
|
45
|
+
order_id,
|
|
46
|
+
name,
|
|
47
|
+
symbol,
|
|
48
|
+
amount,
|
|
49
|
+
mode,
|
|
50
|
+
number,
|
|
51
|
+
pay,
|
|
52
|
+
device,
|
|
53
|
+
net,
|
|
54
|
+
client,
|
|
55
|
+
...other
|
|
56
|
+
} = params || {
|
|
57
|
+
mode: import_const.ModeEnum.Pay
|
|
58
|
+
};
|
|
59
|
+
console.log("params =>>>>>> ", params);
|
|
60
|
+
return {
|
|
61
|
+
order_id,
|
|
62
|
+
name,
|
|
63
|
+
symbol,
|
|
64
|
+
amount,
|
|
65
|
+
mode,
|
|
66
|
+
eftpos: import_const.EftposEnum.Linkly,
|
|
67
|
+
key: Date.now(),
|
|
68
|
+
step: 0,
|
|
69
|
+
type: import_const.PayRouteEnum.Step,
|
|
70
|
+
title: import_utils.locales.getText("page.eftpos-pay.text.loading")(mode),
|
|
71
|
+
component: "",
|
|
72
|
+
status: import_const.StatusEnum.Loading,
|
|
73
|
+
steps: getStep(mode),
|
|
74
|
+
render: true,
|
|
75
|
+
client: client !== "undefined" ? client : import_const.ClientEnum.Merchant,
|
|
76
|
+
warn: "",
|
|
77
|
+
custom: other || {},
|
|
78
|
+
...typeof net !== "undefined" ? { net } : {},
|
|
79
|
+
...typeof number !== "undefined" ? { number } : {},
|
|
80
|
+
...typeof pay !== "undefined" ? { pay } : {},
|
|
81
|
+
...typeof device !== "undefined" ? { device } : {}
|
|
82
|
+
};
|
|
83
|
+
};
|
|
84
|
+
var EVisibleButtonType = /* @__PURE__ */ ((EVisibleButtonType2) => {
|
|
85
|
+
EVisibleButtonType2["CancelButton"] = "CancelButton";
|
|
86
|
+
EVisibleButtonType2["WaitButton"] = "WaitButton";
|
|
87
|
+
return EVisibleButtonType2;
|
|
88
|
+
})(EVisibleButtonType || {});
|
|
89
|
+
var LinklyActionStatus = /* @__PURE__ */ ((LinklyActionStatus2) => {
|
|
90
|
+
LinklyActionStatus2["Empty"] = "Empty";
|
|
91
|
+
LinklyActionStatus2["Cancel"] = "Cancel";
|
|
92
|
+
LinklyActionStatus2["CancelWaiting"] = "CancelWaiting";
|
|
93
|
+
LinklyActionStatus2["Signature"] = "Signature";
|
|
94
|
+
LinklyActionStatus2["SignatureWaiting"] = "SignatureWaiting";
|
|
95
|
+
return LinklyActionStatus2;
|
|
96
|
+
})(LinklyActionStatus || {});
|
|
97
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
98
|
+
0 && (module.exports = {
|
|
99
|
+
EVisibleButtonType,
|
|
100
|
+
LinklyActionStatus,
|
|
101
|
+
getStep
|
|
102
|
+
});
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __copyProps = (to, from, except, desc) => {
|
|
6
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
7
|
+
for (let key of __getOwnPropNames(from))
|
|
8
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
9
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
10
|
+
}
|
|
11
|
+
return to;
|
|
12
|
+
};
|
|
13
|
+
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/components/eftposPay/linkly/hooks/index.ts
|
|
17
|
+
var hooks_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(hooks_exports);
|
|
19
|
+
__reExport(hooks_exports, require("./normal"), module.exports);
|
|
20
|
+
__reExport(hooks_exports, require("./useTimeQuery"), module.exports);
|
|
21
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
22
|
+
0 && (module.exports = {
|
|
23
|
+
...require("./normal"),
|
|
24
|
+
...require("./useTimeQuery")
|
|
25
|
+
});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 支付或退款
|
|
3
|
+
* @param failAction 失败回调
|
|
4
|
+
*/
|
|
5
|
+
export declare const useLinklyPayOrRefund: (handleCheck: () => boolean) => {
|
|
6
|
+
action: {
|
|
7
|
+
pay: import("ahooks/lib/useRequest/src/types").Result<any, [data: any]>;
|
|
8
|
+
};
|
|
9
|
+
payOrRefund: (resultQuery: any, handleLinklySuccess: any) => void;
|
|
10
|
+
};
|
|
11
|
+
/**
|
|
12
|
+
* @title: 取消支付或退款
|
|
13
|
+
* @description: 取消支付或退款调用接口后不管成功还是失败都需要调用支付查询接口
|
|
14
|
+
*/
|
|
15
|
+
export declare const useLinklyCancel: (handleCheck: () => boolean) => {
|
|
16
|
+
action: {
|
|
17
|
+
cancel: import("ahooks/lib/useRequest/src/types").Result<any, [param: any]>;
|
|
18
|
+
};
|
|
19
|
+
linklyCancel: (resultQuery: any) => void;
|
|
20
|
+
};
|
|
21
|
+
/**
|
|
22
|
+
* @title: 支付或退款签名
|
|
23
|
+
* @description: 支付或退款签名调用接口后不管成功还是失败都需要调用支付查询接口
|
|
24
|
+
*/
|
|
25
|
+
export declare const useLinklySignature: (handleCheck: () => boolean) => {
|
|
26
|
+
action: {
|
|
27
|
+
signature: import("ahooks/lib/useRequest/src/types").Result<any, [param: any]>;
|
|
28
|
+
};
|
|
29
|
+
linklySignature: (status: number, resultQuery: any) => void;
|
|
30
|
+
};
|