@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.
Files changed (139) hide show
  1. package/build/lowcode/assets-daily.json +11 -11
  2. package/build/lowcode/assets-dev.json +2 -2
  3. package/build/lowcode/assets-prod.json +11 -11
  4. package/build/lowcode/index.js +1 -1
  5. package/build/lowcode/meta.js +1 -1
  6. package/build/lowcode/preview.js +8 -8
  7. package/build/lowcode/render/default/view.js +12 -12
  8. package/build/lowcode/view.js +11 -11
  9. package/es/components/booking/addons/model.d.ts +1 -10
  10. package/es/components/booking/components/customSelect/index.d.ts +38 -0
  11. package/es/components/booking/editBookingModal/index.js +3 -4
  12. package/es/components/booking/forms/model.d.ts +1 -10
  13. package/es/components/booking/forms/single/RenderValueById.d.ts +7 -0
  14. package/es/components/booking/hooks/useClearCart.d.ts +2 -0
  15. package/es/components/booking/hooks/useQuotation.d.ts +5 -0
  16. package/es/components/booking/info/client/index.d.ts +4 -0
  17. package/es/components/booking/info/hooks/useInfoHolder.d.ts +9 -0
  18. package/es/components/booking/info/model.d.ts +1 -10
  19. package/es/components/booking/info/service/Lists.d.ts +2 -0
  20. package/es/components/booking/info/service/addService/utils.d.ts +1 -1
  21. package/es/components/booking/info/service2/utils.d.ts +247 -0
  22. package/es/components/booking/info/utils.d.ts +50 -0
  23. package/es/components/booking/info2/index.d.ts +12 -0
  24. package/es/components/booking/info2/service/addService/utils.d.ts +98 -0
  25. package/es/components/booking/info2/service/addService/utils.js +16 -1
  26. package/es/components/booking/info2/service/addTimeModal/index.d.ts +3 -0
  27. package/es/components/booking/info2/service/editService/Resources/index.d.ts +4 -0
  28. package/es/components/booking/info2/service/editService/index.d.ts +7 -0
  29. package/es/components/booking/info2/service/index.d.ts +4 -0
  30. package/es/components/booking/info2/utilsByBooking.d.ts +35 -0
  31. package/es/components/booking/locales.d.ts +822 -0
  32. package/es/components/booking/materiels/duration/index.d.ts +13 -0
  33. package/es/components/booking/materiels/startTime/index.d.ts +9 -0
  34. package/es/components/booking/model.d.ts +1 -9
  35. package/es/components/booking/notes/model.d.ts +1 -10
  36. package/es/components/booking/payments/model.d.ts +1 -10
  37. package/es/components/booking/utils.d.ts +174 -0
  38. package/es/components/eftposPay/const.d.ts +4 -1
  39. package/es/components/eftposPay/const.js +3 -1
  40. package/es/components/eftposPay/hooks.d.ts +2 -2
  41. package/es/components/eftposPay/hooks.js +3 -1
  42. package/es/components/eftposPay/index.js +1 -1
  43. package/es/components/eftposPay/linkly/const.d.ts +23 -0
  44. package/es/components/eftposPay/linkly/const.js +82 -0
  45. package/es/components/eftposPay/linkly/hooks/index.d.ts +2 -0
  46. package/es/components/eftposPay/linkly/hooks/index.js +2 -0
  47. package/es/components/eftposPay/linkly/hooks/normal.d.ts +30 -0
  48. package/es/components/eftposPay/linkly/hooks/normal.js +321 -0
  49. package/es/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +4 -0
  50. package/es/components/eftposPay/linkly/hooks/useTimeQuery.js +273 -0
  51. package/es/components/eftposPay/linkly/index.d.ts +2 -0
  52. package/es/components/eftposPay/linkly/index.js +197 -0
  53. package/es/components/eftposPay/linkly/service.d.ts +32 -0
  54. package/es/components/eftposPay/linkly/service.js +81 -0
  55. package/es/components/eftposPay/manufacturer.d.ts +1 -0
  56. package/es/components/eftposPay/manufacturer.js +4 -0
  57. package/es/components/eftposPay/pay.d.ts +1 -1
  58. package/es/components/eftposPay/pay.js +6 -2
  59. package/es/components/eftposPay/store/index.d.ts +4 -4
  60. package/es/components/pay/toC/model.d.ts +1 -9
  61. package/es/components/schedules/model.d.ts +1 -9
  62. package/es/components/shoppingCart/components/Cart/Product.d.ts +3 -0
  63. package/es/components/shoppingCart/components/Cart/index.d.ts +3 -0
  64. package/es/components/ticketBooking/components/addServiceVariant/addService.d.ts +9 -0
  65. package/es/components/ticketBooking/components/ticketBooking/index.js +3 -0
  66. package/es/components/ticketBooking/components/timeBar/index.d.ts +12 -0
  67. package/es/components/ticketBooking/utils/index.d.ts +25 -0
  68. package/es/components/wallet/Detail/model.d.ts +1 -13
  69. package/es/components/wallet/DiscountCard/model.d.ts +1 -14
  70. package/es/components/wallet/PointCard/model.d.ts +1 -13
  71. package/es/components/wallet/RechargeableCard/model.d.ts +1 -29
  72. package/es/components/wallet/Voucher/model.d.ts +1 -13
  73. package/es/components/wallet/model.d.ts +1 -9
  74. package/lib/components/booking/addons/model.d.ts +1 -10
  75. package/lib/components/booking/components/customSelect/index.d.ts +38 -0
  76. package/lib/components/booking/editBookingModal/index.js +3 -4
  77. package/lib/components/booking/forms/model.d.ts +1 -10
  78. package/lib/components/booking/forms/single/RenderValueById.d.ts +7 -0
  79. package/lib/components/booking/hooks/useClearCart.d.ts +2 -0
  80. package/lib/components/booking/hooks/useQuotation.d.ts +5 -0
  81. package/lib/components/booking/info/client/index.d.ts +4 -0
  82. package/lib/components/booking/info/hooks/useInfoHolder.d.ts +9 -0
  83. package/lib/components/booking/info/model.d.ts +1 -10
  84. package/lib/components/booking/info/service/Lists.d.ts +2 -0
  85. package/lib/components/booking/info/service/addService/utils.d.ts +1 -1
  86. package/lib/components/booking/info/service2/utils.d.ts +247 -0
  87. package/lib/components/booking/info/utils.d.ts +50 -0
  88. package/lib/components/booking/info2/index.d.ts +12 -0
  89. package/lib/components/booking/info2/service/addService/utils.d.ts +98 -0
  90. package/lib/components/booking/info2/service/addService/utils.js +15 -3
  91. package/lib/components/booking/info2/service/addTimeModal/index.d.ts +3 -0
  92. package/lib/components/booking/info2/service/editService/Resources/index.d.ts +4 -0
  93. package/lib/components/booking/info2/service/editService/index.d.ts +7 -0
  94. package/lib/components/booking/info2/service/index.d.ts +4 -0
  95. package/lib/components/booking/info2/utilsByBooking.d.ts +35 -0
  96. package/lib/components/booking/locales.d.ts +822 -0
  97. package/lib/components/booking/materiels/duration/index.d.ts +13 -0
  98. package/lib/components/booking/materiels/startTime/index.d.ts +9 -0
  99. package/lib/components/booking/model.d.ts +1 -9
  100. package/lib/components/booking/notes/model.d.ts +1 -10
  101. package/lib/components/booking/payments/model.d.ts +1 -10
  102. package/lib/components/booking/utils.d.ts +174 -0
  103. package/lib/components/eftposPay/const.d.ts +4 -1
  104. package/lib/components/eftposPay/const.js +2 -0
  105. package/lib/components/eftposPay/hooks.d.ts +2 -2
  106. package/lib/components/eftposPay/hooks.js +11 -4
  107. package/lib/components/eftposPay/index.js +1 -1
  108. package/lib/components/eftposPay/linkly/const.d.ts +23 -0
  109. package/lib/components/eftposPay/linkly/const.js +102 -0
  110. package/lib/components/eftposPay/linkly/hooks/index.d.ts +2 -0
  111. package/lib/components/eftposPay/linkly/hooks/index.js +25 -0
  112. package/lib/components/eftposPay/linkly/hooks/normal.d.ts +30 -0
  113. package/lib/components/eftposPay/linkly/hooks/normal.js +242 -0
  114. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.d.ts +4 -0
  115. package/lib/components/eftposPay/linkly/hooks/useTimeQuery.js +222 -0
  116. package/lib/components/eftposPay/linkly/index.d.ts +2 -0
  117. package/lib/components/eftposPay/linkly/index.js +208 -0
  118. package/lib/components/eftposPay/linkly/service.d.ts +32 -0
  119. package/lib/components/eftposPay/linkly/service.js +55 -0
  120. package/lib/components/eftposPay/manufacturer.d.ts +1 -0
  121. package/lib/components/eftposPay/manufacturer.js +6 -0
  122. package/lib/components/eftposPay/pay.d.ts +1 -1
  123. package/lib/components/eftposPay/pay.js +13 -2
  124. package/lib/components/eftposPay/store/index.d.ts +4 -4
  125. package/lib/components/pay/toC/model.d.ts +1 -9
  126. package/lib/components/schedules/model.d.ts +1 -9
  127. package/lib/components/shoppingCart/components/Cart/Product.d.ts +3 -0
  128. package/lib/components/shoppingCart/components/Cart/index.d.ts +3 -0
  129. package/lib/components/ticketBooking/components/addServiceVariant/addService.d.ts +9 -0
  130. package/lib/components/ticketBooking/components/ticketBooking/index.js +3 -0
  131. package/lib/components/ticketBooking/components/timeBar/index.d.ts +12 -0
  132. package/lib/components/ticketBooking/utils/index.d.ts +25 -0
  133. package/lib/components/wallet/Detail/model.d.ts +1 -13
  134. package/lib/components/wallet/DiscountCard/model.d.ts +1 -14
  135. package/lib/components/wallet/PointCard/model.d.ts +1 -13
  136. package/lib/components/wallet/RechargeableCard/model.d.ts +1 -29
  137. package/lib/components/wallet/Voucher/model.d.ts +1 -13
  138. package/lib/components/wallet/model.d.ts +1 -9
  139. 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: (ComponentUi: any) => any, Context: import("react").Context<{
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
- /// <reference types="react" />
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
- /// <reference types="react" />
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
  /** 交易请求超时 */
@@ -3,8 +3,9 @@ export var EftposEnum = /*#__PURE__*/function (EftposEnum) {
3
3
  EftposEnum["Tyro"] = "tyro";
4
4
  EftposEnum["Windcave"] = "windcave";
5
5
  EftposEnum["Stripe"] = "stripe";
6
+ EftposEnum["Linkly"] = "linkly";
6
7
  return EftposEnum;
7
- }({}); // Eftpos = 'eftpos',
8
+ }({});
8
9
  export var StatusEnum = /*#__PURE__*/function (StatusEnum) {
9
10
  StatusEnum["Loading"] = "loading";
10
11
  StatusEnum["Warn"] = "warn";
@@ -64,6 +65,7 @@ export var PayRouteEnum = /*#__PURE__*/function (PayRouteEnum) {
64
65
  export var PayStatus = /*#__PURE__*/function (PayStatus) {
65
66
  PayStatus["Success"] = "200";
66
67
  PayStatus["NoPay"] = "4004";
68
+ PayStatus["PairingFailure"] = "606020";
67
69
  PayStatus["Unknown"] = "701000";
68
70
  PayStatus["Timeout"] = "701001";
69
71
  PayStatus["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<"success" | "loading" | "warn" | "fail" | "pedding" | "resove" | "reject" | "question">;
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<"tyro" | "windcave" | "stripe" | "payo">;
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
  };
@@ -139,6 +139,7 @@ export var useFail = function useFail(index) {
139
139
  return;
140
140
  }
141
141
  var code = "".concat(res.code);
142
+ console.log('code---->>>>>>>', code);
142
143
  if (code === PayStatus.Unknown) {
143
144
  // 前往报错页 不可标记
144
145
  steps[index].title = locales.getText('page.eftpos-pay.text.failed')(modeRef.current);
@@ -224,6 +225,7 @@ export var useFail = function useFail(index) {
224
225
  dispatch(updateComponent('Fail'));
225
226
  return;
226
227
  }
228
+
227
229
  // 重新支付 最多到重新发起2次
228
230
  ref.current += 1;
229
231
  dispatch(updateState({
@@ -300,7 +302,7 @@ export var useFail = function useFail(index) {
300
302
  }));
301
303
  return;
302
304
  }
303
- if (code === PayStatus.UserConfigError) {
305
+ if (code === PayStatus.UserConfigError || code === PayStatus.PairingFailure) {
304
306
  // 前往错误页 不可标记状态
305
307
  steps[index].title = locales.getText('page.eftpos-pay.text.transaction.user.config.title');
306
308
  steps[index].fail = locales.getText('page.eftpos-pay.text.transaction.user.config.text');
@@ -163,7 +163,7 @@ export default (function (props) {
163
163
  }, [mode, state]);
164
164
  useEffect(function () {
165
165
  document.body.id = 'body';
166
- console.log('初始化 ........11221801');
166
+ console.log('初始化 ........112218017777');
167
167
  }, []);
168
168
 
169
169
  // console.log('action = ', action);
@@ -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,82 @@
1
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
2
+ var _excluded = ["order_id", "name", "symbol", "amount", "mode", "number", "pay", "device", "net", "client"];
3
+ function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
4
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
5
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
6
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
7
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
8
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
9
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
10
+ import { locales } from '@pisell/utils';
11
+ import { ClientEnum, EftposEnum, ModeEnum, PayRouteEnum, StatusEnum } from "../const";
12
+ export var getStep = function getStep() {
13
+ var mode = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : ModeEnum.Pay;
14
+ return [{
15
+ key: Date.now(),
16
+ title: locales.getText('page.eftpos-pay.text.loading')(mode),
17
+ // 'Payment in process...',
18
+ text: locales.getText('page.eftpos-pay.text.waiting.processing'),
19
+ // 'Waiting for the processing...',
20
+ warn: '',
21
+ tip: locales.getText('page.eftpos-pay.text.processing'),
22
+ // 'processing...',
23
+ status: StatusEnum.Loading
24
+ }];
25
+ };
26
+ export default (function (params) {
27
+ var _ref = params || {
28
+ mode: ModeEnum.Pay
29
+ },
30
+ order_id = _ref.order_id,
31
+ name = _ref.name,
32
+ symbol = _ref.symbol,
33
+ amount = _ref.amount,
34
+ mode = _ref.mode,
35
+ number = _ref.number,
36
+ pay = _ref.pay,
37
+ device = _ref.device,
38
+ net = _ref.net,
39
+ client = _ref.client,
40
+ other = _objectWithoutProperties(_ref, _excluded);
41
+ console.log('params =>>>>>> ', params);
42
+ return _objectSpread(_objectSpread(_objectSpread(_objectSpread({
43
+ order_id: order_id,
44
+ name: name,
45
+ symbol: symbol,
46
+ amount: amount,
47
+ mode: mode,
48
+ eftpos: EftposEnum.Linkly,
49
+ key: Date.now(),
50
+ step: 0,
51
+ type: PayRouteEnum.Step,
52
+ title: locales.getText('page.eftpos-pay.text.loading')(mode),
53
+ component: '',
54
+ status: StatusEnum.Loading,
55
+ steps: getStep(mode),
56
+ render: true,
57
+ client: client !== 'undefined' ? client : ClientEnum.Merchant,
58
+ warn: '',
59
+ custom: other || {}
60
+ }, typeof net !== 'undefined' ? {
61
+ net: net
62
+ } : {}), typeof number !== 'undefined' ? {
63
+ number: number
64
+ } : {}), typeof pay !== 'undefined' ? {
65
+ pay: pay
66
+ } : {}), typeof device !== 'undefined' ? {
67
+ device: device
68
+ } : {});
69
+ });
70
+ export var EVisibleButtonType = /*#__PURE__*/function (EVisibleButtonType) {
71
+ EVisibleButtonType["CancelButton"] = "CancelButton";
72
+ EVisibleButtonType["WaitButton"] = "WaitButton";
73
+ return EVisibleButtonType;
74
+ }({});
75
+ export var LinklyActionStatus = /*#__PURE__*/function (LinklyActionStatus) {
76
+ LinklyActionStatus["Empty"] = "Empty";
77
+ LinklyActionStatus["Cancel"] = "Cancel";
78
+ LinklyActionStatus["CancelWaiting"] = "CancelWaiting";
79
+ LinklyActionStatus["Signature"] = "Signature";
80
+ LinklyActionStatus["SignatureWaiting"] = "SignatureWaiting";
81
+ return LinklyActionStatus;
82
+ }({});
@@ -0,0 +1,2 @@
1
+ export * from './normal';
2
+ export * from './useTimeQuery';
@@ -0,0 +1,2 @@
1
+ export * from "./normal";
2
+ export * from "./useTimeQuery";
@@ -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
+ };