best-unit 1.2.12 → 1.2.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/dist/best-unit.cjs +13 -13
- package/dist/best-unit.js +1459 -1442
- package/dist/types/global.d.ts +14 -0
- package/dist/types/index.ts +4 -0
- package/package.json +1 -1
- package/src/api/axiosInstance.ts +34 -40
- package/src/components/business/recharge-sdk/components/offline-transfer-form/index.tsx +1 -1
- package/src/components/business/recharge-sdk/components/offline-transfer-form/theme.tsx +42 -43
- package/src/components/business/recharge-sdk/components/online-recharge-form/theme.tsx +27 -27
- package/src/components/business/recharge-sdk/components/recharge/index.tsx +9 -2
- package/src/components/business/recharge-sdk/components/recharge/theme.tsx +6 -7
- package/src/components/business/statistical-balance/theme.tsx +24 -23
- package/src/components/common/button/theme.tsx +6 -6
- package/src/components/common/modal/index.tsx +7 -5
- package/src/components/common/modal/theme.tsx +18 -18
- package/src/components/common/select/index.tsx +23 -14
- package/src/components/common/upload/index.tsx +26 -9
- package/src/components/common/upload/theme.tsx +19 -17
- package/src/demo/App.tsx +10 -9
- package/src/types/global.d.ts +14 -0
- package/src/types/index.ts +4 -0
- package/src/utils/business/index.ts +5 -1
- package/src/api/waitUnit.ts +0 -62
package/dist/types/global.d.ts
CHANGED
|
@@ -17,6 +17,11 @@ export enum Env {
|
|
|
17
17
|
PRODUCTION = "production",
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
export enum Size {
|
|
21
|
+
SMALL = "small",
|
|
22
|
+
MEDIUM = "medium",
|
|
23
|
+
}
|
|
24
|
+
|
|
20
25
|
// 类型定义
|
|
21
26
|
export interface BalanceData {
|
|
22
27
|
fundBalanceId: string;
|
|
@@ -43,15 +48,22 @@ export interface InitParams {
|
|
|
43
48
|
theme?: Theme;
|
|
44
49
|
locale?: Locale;
|
|
45
50
|
env: Env;
|
|
51
|
+
size?: Size;
|
|
46
52
|
themeConfig?: ThemeConfig;
|
|
47
53
|
}
|
|
48
54
|
|
|
49
55
|
export interface ThemeConfig {
|
|
50
56
|
white?: {
|
|
51
57
|
color?: string;
|
|
58
|
+
fontSize?: number;
|
|
52
59
|
};
|
|
53
60
|
dark?: {
|
|
54
61
|
color?: string;
|
|
62
|
+
fontSize?: number;
|
|
63
|
+
};
|
|
64
|
+
global?: {
|
|
65
|
+
size?: Size;
|
|
66
|
+
fontSize?: number;
|
|
55
67
|
};
|
|
56
68
|
}
|
|
57
69
|
|
|
@@ -68,6 +80,7 @@ export declare function initFundUnit(params: {
|
|
|
68
80
|
theme?: Theme;
|
|
69
81
|
locale?: Locale;
|
|
70
82
|
env: Env;
|
|
83
|
+
size?: Size;
|
|
71
84
|
themeConfig?: ThemeConfig;
|
|
72
85
|
}): {
|
|
73
86
|
token: string;
|
|
@@ -77,6 +90,7 @@ export declare function initFundUnit(params: {
|
|
|
77
90
|
theme?: Theme;
|
|
78
91
|
locale: Locale;
|
|
79
92
|
env: Env;
|
|
93
|
+
size?: Size;
|
|
80
94
|
themeConfig?: ThemeConfig;
|
|
81
95
|
};
|
|
82
96
|
|
package/dist/types/index.ts
CHANGED
package/package.json
CHANGED
package/src/api/axiosInstance.ts
CHANGED
|
@@ -6,7 +6,6 @@ import type {
|
|
|
6
6
|
} from "axios";
|
|
7
7
|
import { message } from "@/components/common/message";
|
|
8
8
|
import { Env, Locale } from "@/types";
|
|
9
|
-
import { waitFundUnitReady } from "./waitUnit";
|
|
10
9
|
|
|
11
10
|
export interface CreateAxiosOptions {
|
|
12
11
|
baseURL?: string;
|
|
@@ -15,50 +14,45 @@ export interface CreateAxiosOptions {
|
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
export function createAxiosInstance(options: CreateAxiosOptions = {}) {
|
|
18
|
-
//
|
|
19
|
-
|
|
17
|
+
// 根据 fund_unit_params 中的 env 参数选择 API URL
|
|
18
|
+
const fundUnitParams = JSON.parse(
|
|
19
|
+
sessionStorage.getItem("fund_unit_params") || "{}"
|
|
20
|
+
);
|
|
21
|
+
|
|
22
|
+
console.log("fundUnitParams", fundUnitParams);
|
|
23
|
+
const { env } = fundUnitParams;
|
|
24
|
+
|
|
25
|
+
let apiUrl: string;
|
|
26
|
+
switch (env) {
|
|
27
|
+
case Env.DEV:
|
|
28
|
+
case Env.DEVELOPMENT:
|
|
29
|
+
apiUrl = "/api";
|
|
30
|
+
break;
|
|
31
|
+
case Env.TEST:
|
|
32
|
+
apiUrl = "https://fund.bestfulfill.tech/api/sdk";
|
|
33
|
+
break;
|
|
34
|
+
case Env.PROD:
|
|
35
|
+
case Env.PRODUCTION:
|
|
36
|
+
default:
|
|
37
|
+
apiUrl = "https://fund.bestfulfill.com/api/sdk";
|
|
38
|
+
break;
|
|
39
|
+
}
|
|
20
40
|
|
|
21
41
|
const { baseURL = apiUrl, timeout = 10000, onError } = options;
|
|
22
42
|
|
|
23
43
|
const instance: AxiosInstance = axios.create({ baseURL, timeout });
|
|
24
44
|
|
|
25
|
-
//
|
|
26
|
-
instance.interceptors.request.use(
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
// 按 env 设置 baseURL(覆盖实例级 baseURL,以便热切换环境)
|
|
38
|
-
switch (env) {
|
|
39
|
-
case Env.DEV:
|
|
40
|
-
case Env.DEVELOPMENT:
|
|
41
|
-
config.baseURL = "/api";
|
|
42
|
-
break;
|
|
43
|
-
case Env.TEST:
|
|
44
|
-
config.baseURL = "https://fund.bestfulfill.tech/api/sdk";
|
|
45
|
-
break;
|
|
46
|
-
case Env.PROD:
|
|
47
|
-
case Env.PRODUCTION:
|
|
48
|
-
default:
|
|
49
|
-
config.baseURL = "https://fund.bestfulfill.com/api/sdk";
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
config.headers = {
|
|
54
|
-
...config.headers,
|
|
55
|
-
Authorization: token,
|
|
56
|
-
"x-locale": locale === Locale.ZH ? "zh-CN" : "en-US",
|
|
57
|
-
} as any;
|
|
58
|
-
|
|
59
|
-
return config;
|
|
60
|
-
}
|
|
61
|
-
);
|
|
45
|
+
// 请求拦截:加 token、国际化
|
|
46
|
+
instance.interceptors.request.use((config: InternalAxiosRequestConfig) => {
|
|
47
|
+
const { token, locale } = fundUnitParams;
|
|
48
|
+
config.headers = {
|
|
49
|
+
...config.headers,
|
|
50
|
+
Authorization: token,
|
|
51
|
+
"x-locale": locale === Locale.ZH ? "zh-CN" : "en-US",
|
|
52
|
+
} as any;
|
|
53
|
+
|
|
54
|
+
return config;
|
|
55
|
+
});
|
|
62
56
|
|
|
63
57
|
// 响应拦截:code=0判定成功,其他走 onError
|
|
64
58
|
instance.interceptors.response.use(
|
|
@@ -1,24 +1,25 @@
|
|
|
1
|
-
import { Theme, type ThemeConfig } from "@/types";
|
|
1
|
+
import { Size, Theme, type ThemeConfig } from "@/types";
|
|
2
2
|
import { getInitParams } from "@/utils/business";
|
|
3
|
+
const size = getInitParams<Size>("size");
|
|
3
4
|
|
|
4
5
|
export const offlineTransferFormThemes = {
|
|
5
6
|
white: {
|
|
6
7
|
label: {
|
|
7
|
-
marginBottom: 8,
|
|
8
|
-
fontSize: 14,
|
|
8
|
+
marginBottom: size === Size.SMALL ? 6 : 8,
|
|
9
|
+
fontSize: size === Size.SMALL ? 12 : 14,
|
|
9
10
|
color: "#222",
|
|
10
11
|
textAlign: "left",
|
|
11
12
|
display: "block",
|
|
12
13
|
},
|
|
13
14
|
input: {
|
|
14
15
|
width: "100%",
|
|
15
|
-
padding: "10px 12px",
|
|
16
|
+
padding: size === Size.SMALL ? "8px 10px" : "10px 12px",
|
|
16
17
|
borderRadius: 6,
|
|
17
18
|
boxSizing: "border-box",
|
|
18
19
|
border: "1px solid #E5E6EB",
|
|
19
20
|
background: "#fff",
|
|
20
21
|
color: "#222",
|
|
21
|
-
fontSize: 15,
|
|
22
|
+
fontSize: size === Size.SMALL ? 12 : 15,
|
|
22
23
|
outline: "none",
|
|
23
24
|
marginBottom: 0,
|
|
24
25
|
},
|
|
@@ -27,12 +28,12 @@ export const offlineTransferFormThemes = {
|
|
|
27
28
|
},
|
|
28
29
|
select: {
|
|
29
30
|
width: "100%",
|
|
30
|
-
padding: "10px 12px",
|
|
31
|
+
padding: size === Size.SMALL ? "8px 10px" : "10px 12px",
|
|
31
32
|
borderRadius: 6,
|
|
32
33
|
border: "1px solid #E5E6EB",
|
|
33
34
|
background: "#fff",
|
|
34
35
|
color: "#222",
|
|
35
|
-
fontSize: 15,
|
|
36
|
+
fontSize: size === Size.SMALL ? 12 : 15,
|
|
36
37
|
outline: "none",
|
|
37
38
|
},
|
|
38
39
|
selectError: {
|
|
@@ -42,16 +43,16 @@ export const offlineTransferFormThemes = {
|
|
|
42
43
|
border: "1px dashed #E5E6EB",
|
|
43
44
|
borderRadius: 8,
|
|
44
45
|
background: "#FCFCFD",
|
|
45
|
-
padding: 24,
|
|
46
|
+
padding: size === Size.SMALL ? 12 : 24,
|
|
46
47
|
textAlign: "center",
|
|
47
48
|
cursor: "pointer",
|
|
48
|
-
minHeight: 120,
|
|
49
|
+
minHeight: size === Size.SMALL ? 80 : 120,
|
|
49
50
|
display: "flex",
|
|
50
51
|
flexDirection: "column",
|
|
51
52
|
alignItems: "center",
|
|
52
53
|
justifyContent: "center",
|
|
53
54
|
color: "#999",
|
|
54
|
-
fontSize: 15,
|
|
55
|
+
fontSize: size === Size.SMALL ? 12 : 15,
|
|
55
56
|
},
|
|
56
57
|
uploadError: {
|
|
57
58
|
border: "1px dashed #ff4d4f",
|
|
@@ -61,9 +62,9 @@ export const offlineTransferFormThemes = {
|
|
|
61
62
|
alignItems: "center",
|
|
62
63
|
background: "#F7F8FA",
|
|
63
64
|
borderRadius: 8,
|
|
64
|
-
padding: "12px 16px",
|
|
65
|
-
marginBottom: 8,
|
|
66
|
-
fontSize: 15,
|
|
65
|
+
padding: size === Size.SMALL ? "8px 10px" : "12px 16px",
|
|
66
|
+
marginBottom: size === Size.SMALL ? 6 : 8,
|
|
67
|
+
fontSize: size === Size.SMALL ? 12 : 15,
|
|
67
68
|
color: "#222",
|
|
68
69
|
justifyContent: "space-between",
|
|
69
70
|
},
|
|
@@ -72,8 +73,7 @@ export const offlineTransferFormThemes = {
|
|
|
72
73
|
color: "#222",
|
|
73
74
|
border: "1px solid #E5E6EB",
|
|
74
75
|
borderRadius: 6,
|
|
75
|
-
padding: "8px 24px",
|
|
76
|
-
fontSize: 15,
|
|
76
|
+
padding: size === Size.SMALL ? "6px 18px" : "8px 24px",
|
|
77
77
|
cursor: "pointer",
|
|
78
78
|
},
|
|
79
79
|
buttonSubmit: {
|
|
@@ -81,8 +81,7 @@ export const offlineTransferFormThemes = {
|
|
|
81
81
|
color: "#fff",
|
|
82
82
|
border: "none",
|
|
83
83
|
borderRadius: 6,
|
|
84
|
-
padding: "8px 24px",
|
|
85
|
-
fontSize: 15,
|
|
84
|
+
padding: size === Size.SMALL ? "6px 18px" : "8px 24px",
|
|
86
85
|
cursor: "pointer",
|
|
87
86
|
fontWeight: 600,
|
|
88
87
|
},
|
|
@@ -91,35 +90,35 @@ export const offlineTransferFormThemes = {
|
|
|
91
90
|
color: "#fff",
|
|
92
91
|
border: "none",
|
|
93
92
|
borderRadius: 6,
|
|
94
|
-
padding: "4px 14px",
|
|
95
|
-
fontSize: 15,
|
|
96
|
-
marginLeft: 16,
|
|
93
|
+
padding: size === Size.SMALL ? "6px 18px" : "4px 14px",
|
|
94
|
+
fontSize: size === Size.SMALL ? 12 : 15,
|
|
95
|
+
marginLeft: size === Size.SMALL ? 8 : 16,
|
|
97
96
|
cursor: "pointer",
|
|
98
97
|
},
|
|
99
98
|
error: {
|
|
100
99
|
color: "#ff4d4f",
|
|
101
|
-
fontSize: 13,
|
|
102
|
-
marginTop: 4,
|
|
100
|
+
fontSize: size === Size.SMALL ? 12 : 13,
|
|
101
|
+
marginTop: size === Size.SMALL ? 2 : 4,
|
|
103
102
|
textAlign: "left",
|
|
104
103
|
},
|
|
105
104
|
},
|
|
106
105
|
dark: {
|
|
107
106
|
label: {
|
|
108
|
-
marginBottom: 8,
|
|
109
|
-
fontSize: 14,
|
|
107
|
+
marginBottom: size === Size.SMALL ? 4 : 8,
|
|
108
|
+
fontSize: size === Size.SMALL ? 12 : 14,
|
|
110
109
|
color: "#fff",
|
|
111
110
|
textAlign: "left",
|
|
112
111
|
display: "block",
|
|
113
112
|
},
|
|
114
113
|
input: {
|
|
115
114
|
width: "100%",
|
|
116
|
-
padding: "10px 12px",
|
|
115
|
+
padding: size === Size.SMALL ? "8px 10px" : "10px 12px",
|
|
117
116
|
borderRadius: 6,
|
|
118
117
|
boxSizing: "border-box",
|
|
119
118
|
border: "1px solid #374151",
|
|
120
119
|
background: "#23262F",
|
|
121
120
|
color: "#fff",
|
|
122
|
-
fontSize: 15,
|
|
121
|
+
fontSize: size === Size.SMALL ? 12 : 15,
|
|
123
122
|
outline: "none",
|
|
124
123
|
marginBottom: 0,
|
|
125
124
|
},
|
|
@@ -128,12 +127,12 @@ export const offlineTransferFormThemes = {
|
|
|
128
127
|
},
|
|
129
128
|
select: {
|
|
130
129
|
width: "100%",
|
|
131
|
-
padding: "10px 12px",
|
|
130
|
+
padding: size === Size.SMALL ? "8px 10px" : "10px 12px",
|
|
132
131
|
borderRadius: 6,
|
|
133
132
|
border: "1px solid #374151",
|
|
134
133
|
background: "#23262F",
|
|
135
134
|
color: "#fff",
|
|
136
|
-
fontSize: 15,
|
|
135
|
+
fontSize: size === Size.SMALL ? 12 : 15,
|
|
137
136
|
outline: "none",
|
|
138
137
|
},
|
|
139
138
|
selectError: {
|
|
@@ -143,16 +142,16 @@ export const offlineTransferFormThemes = {
|
|
|
143
142
|
border: "1px dashed #374151",
|
|
144
143
|
borderRadius: 8,
|
|
145
144
|
background: "#181A20",
|
|
146
|
-
padding: 24,
|
|
145
|
+
padding: size === Size.SMALL ? 12 : 24,
|
|
147
146
|
textAlign: "center",
|
|
148
147
|
cursor: "pointer",
|
|
149
|
-
minHeight: 120,
|
|
148
|
+
minHeight: size === Size.SMALL ? 80 : 120,
|
|
150
149
|
display: "flex",
|
|
151
150
|
flexDirection: "column",
|
|
152
151
|
alignItems: "center",
|
|
153
152
|
justifyContent: "center",
|
|
154
153
|
color: "#999",
|
|
155
|
-
fontSize:
|
|
154
|
+
fontSize: size === Size.SMALL ? 12 : 14,
|
|
156
155
|
},
|
|
157
156
|
uploadError: {
|
|
158
157
|
border: "1px dashed #ff4d4f",
|
|
@@ -162,9 +161,9 @@ export const offlineTransferFormThemes = {
|
|
|
162
161
|
alignItems: "center",
|
|
163
162
|
background: "#23262F",
|
|
164
163
|
borderRadius: 8,
|
|
165
|
-
padding: "12px 16px",
|
|
166
|
-
marginBottom: 8,
|
|
167
|
-
fontSize: 15,
|
|
164
|
+
padding: size === Size.SMALL ? "8px 10px" : "12px 16px",
|
|
165
|
+
marginBottom: size === Size.SMALL ? 6 : 8,
|
|
166
|
+
fontSize: size === Size.SMALL ? 12 : 15,
|
|
168
167
|
color: "#fff",
|
|
169
168
|
justifyContent: "space-between",
|
|
170
169
|
},
|
|
@@ -173,8 +172,8 @@ export const offlineTransferFormThemes = {
|
|
|
173
172
|
color: "#fff",
|
|
174
173
|
border: "none",
|
|
175
174
|
borderRadius: 6,
|
|
176
|
-
padding: "8px 24px",
|
|
177
|
-
fontSize: 15,
|
|
175
|
+
padding: size === Size.SMALL ? "6px 18px" : "8px 24px",
|
|
176
|
+
fontSize: size === Size.SMALL ? 12 : 15,
|
|
178
177
|
cursor: "pointer",
|
|
179
178
|
},
|
|
180
179
|
buttonSubmit: {
|
|
@@ -182,8 +181,8 @@ export const offlineTransferFormThemes = {
|
|
|
182
181
|
color: "#fff",
|
|
183
182
|
border: "none",
|
|
184
183
|
borderRadius: 6,
|
|
185
|
-
padding: "8px 24px",
|
|
186
|
-
fontSize:
|
|
184
|
+
padding: size === Size.SMALL ? "6px 18px" : "8px 24px",
|
|
185
|
+
fontSize: size === Size.SMALL ? 12 : 14,
|
|
187
186
|
cursor: "pointer",
|
|
188
187
|
fontWeight: 600,
|
|
189
188
|
},
|
|
@@ -192,15 +191,15 @@ export const offlineTransferFormThemes = {
|
|
|
192
191
|
color: "#fff",
|
|
193
192
|
border: "none",
|
|
194
193
|
borderRadius: 6,
|
|
195
|
-
padding: "4px 14px",
|
|
196
|
-
fontSize: 15,
|
|
197
|
-
marginLeft: 16,
|
|
194
|
+
padding: size === Size.SMALL ? "6px 18px" : "4px 14px",
|
|
195
|
+
fontSize: size === Size.SMALL ? 12 : 15,
|
|
196
|
+
marginLeft: size === Size.SMALL ? 8 : 16,
|
|
198
197
|
cursor: "pointer",
|
|
199
198
|
},
|
|
200
199
|
error: {
|
|
201
200
|
color: "#ff4d4f",
|
|
202
|
-
fontSize: 13,
|
|
203
|
-
marginTop: 4,
|
|
201
|
+
fontSize: size === Size.SMALL ? 12 : 13,
|
|
202
|
+
marginTop: size === Size.SMALL ? 2 : 4,
|
|
204
203
|
textAlign: "left",
|
|
205
204
|
},
|
|
206
205
|
},
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import { Theme, type ThemeConfig } from "@/types";
|
|
1
|
+
import { Size, Theme, type ThemeConfig } from "@/types";
|
|
2
2
|
import { getInitParams } from "@/utils/business";
|
|
3
|
-
|
|
3
|
+
const size = getInitParams<Size>("size");
|
|
4
4
|
export const onlineRechargeFormThemes = {
|
|
5
5
|
white: {
|
|
6
6
|
label: {
|
|
7
|
-
marginBottom: 8,
|
|
8
|
-
fontSize: 14,
|
|
7
|
+
marginBottom: size === Size.SMALL ? 4 : 8,
|
|
8
|
+
fontSize: size === Size.SMALL ? 12 : 14,
|
|
9
9
|
color: "#222",
|
|
10
10
|
textAlign: "left",
|
|
11
11
|
display: "block",
|
|
12
12
|
},
|
|
13
13
|
input: {
|
|
14
14
|
width: "100%",
|
|
15
|
-
padding: "10px 12px",
|
|
15
|
+
padding: size === Size.SMALL ? "8px 10px" : "10px 12px",
|
|
16
16
|
borderRadius: 6,
|
|
17
17
|
boxSizing: "border-box",
|
|
18
18
|
border: "1px solid #E5E6EB",
|
|
19
19
|
background: "#fff",
|
|
20
20
|
color: "#222",
|
|
21
|
-
fontSize: 15,
|
|
21
|
+
fontSize: size === Size.SMALL ? 12 : 15,
|
|
22
22
|
outline: "none",
|
|
23
23
|
marginBottom: 0,
|
|
24
24
|
},
|
|
@@ -30,8 +30,8 @@ export const onlineRechargeFormThemes = {
|
|
|
30
30
|
},
|
|
31
31
|
error: {
|
|
32
32
|
color: "#ff4d4f",
|
|
33
|
-
fontSize: 13,
|
|
34
|
-
marginTop: 4,
|
|
33
|
+
fontSize: size === Size.SMALL ? 12 : 13,
|
|
34
|
+
marginTop: size === Size.SMALL ? 2 : 4,
|
|
35
35
|
textAlign: "left",
|
|
36
36
|
},
|
|
37
37
|
buttonCancel: {
|
|
@@ -39,8 +39,8 @@ export const onlineRechargeFormThemes = {
|
|
|
39
39
|
color: "#222",
|
|
40
40
|
border: "1px solid #E5E6EB",
|
|
41
41
|
borderRadius: 6,
|
|
42
|
-
padding: "8px 24px",
|
|
43
|
-
fontSize: 15,
|
|
42
|
+
padding: size === Size.SMALL ? "6px 16px" : "8px 24px",
|
|
43
|
+
fontSize: size === Size.SMALL ? 12 : 15,
|
|
44
44
|
cursor: "pointer",
|
|
45
45
|
},
|
|
46
46
|
buttonSubmit: {
|
|
@@ -48,38 +48,38 @@ export const onlineRechargeFormThemes = {
|
|
|
48
48
|
color: "#fff",
|
|
49
49
|
border: "none",
|
|
50
50
|
borderRadius: 6,
|
|
51
|
-
padding: "8px 24px",
|
|
52
|
-
fontSize: 15,
|
|
51
|
+
padding: size === Size.SMALL ? "6px 16px" : "8px 24px",
|
|
52
|
+
fontSize: size === Size.SMALL ? 12 : 15,
|
|
53
53
|
cursor: "pointer",
|
|
54
54
|
fontWeight: 600,
|
|
55
55
|
},
|
|
56
56
|
feeTip: {
|
|
57
57
|
marginBottom: 24,
|
|
58
|
-
padding: "12px 16px",
|
|
58
|
+
padding: size === Size.SMALL ? "8px 10px" : "12px 16px",
|
|
59
59
|
background: "#f6ffed",
|
|
60
60
|
border: "1px solid #b7eb8f",
|
|
61
61
|
borderRadius: 6,
|
|
62
|
-
fontSize: 14,
|
|
62
|
+
fontSize: size === Size.SMALL ? 12 : 14,
|
|
63
63
|
color: "#52c41a",
|
|
64
64
|
},
|
|
65
65
|
},
|
|
66
66
|
dark: {
|
|
67
67
|
label: {
|
|
68
|
-
marginBottom: 8,
|
|
69
|
-
fontSize: 14,
|
|
68
|
+
marginBottom: size === Size.SMALL ? 6 : 8,
|
|
69
|
+
fontSize: size === Size.SMALL ? 12 : 14,
|
|
70
70
|
color: "#fff",
|
|
71
71
|
textAlign: "left",
|
|
72
72
|
display: "block",
|
|
73
73
|
},
|
|
74
74
|
input: {
|
|
75
75
|
width: "100%",
|
|
76
|
-
padding: "10px 12px",
|
|
76
|
+
padding: size === Size.SMALL ? "8px 10px" : "10px 12px",
|
|
77
77
|
borderRadius: 6,
|
|
78
78
|
boxSizing: "border-box",
|
|
79
79
|
border: "1px solid #374151",
|
|
80
80
|
background: "#23262F",
|
|
81
81
|
color: "#fff",
|
|
82
|
-
fontSize: 15,
|
|
82
|
+
fontSize: size === Size.SMALL ? 12 : 15,
|
|
83
83
|
outline: "none",
|
|
84
84
|
marginBottom: 0,
|
|
85
85
|
},
|
|
@@ -91,8 +91,8 @@ export const onlineRechargeFormThemes = {
|
|
|
91
91
|
},
|
|
92
92
|
error: {
|
|
93
93
|
color: "#ff4d4f",
|
|
94
|
-
fontSize: 13,
|
|
95
|
-
marginTop: 4,
|
|
94
|
+
fontSize: size === Size.SMALL ? 12 : 13,
|
|
95
|
+
marginTop: size === Size.SMALL ? 2 : 4,
|
|
96
96
|
textAlign: "left",
|
|
97
97
|
},
|
|
98
98
|
buttonCancel: {
|
|
@@ -100,8 +100,8 @@ export const onlineRechargeFormThemes = {
|
|
|
100
100
|
color: "#fff",
|
|
101
101
|
border: "none",
|
|
102
102
|
borderRadius: 6,
|
|
103
|
-
padding: "8px 24px",
|
|
104
|
-
fontSize: 15,
|
|
103
|
+
padding: size === Size.SMALL ? "6px 16px" : "8px 24px",
|
|
104
|
+
fontSize: size === Size.SMALL ? 12 : 15,
|
|
105
105
|
cursor: "pointer",
|
|
106
106
|
},
|
|
107
107
|
buttonSubmit: {
|
|
@@ -109,18 +109,18 @@ export const onlineRechargeFormThemes = {
|
|
|
109
109
|
color: "#fff",
|
|
110
110
|
border: "none",
|
|
111
111
|
borderRadius: 6,
|
|
112
|
-
padding: "8px 24px",
|
|
113
|
-
fontSize: 15,
|
|
112
|
+
padding: size === Size.SMALL ? "6px 16px" : "8px 24px",
|
|
113
|
+
fontSize: size === Size.SMALL ? 12 : 15,
|
|
114
114
|
cursor: "pointer",
|
|
115
115
|
fontWeight: 600,
|
|
116
116
|
},
|
|
117
117
|
feeTip: {
|
|
118
|
-
marginBottom: 24,
|
|
119
|
-
padding: "12px 16px",
|
|
118
|
+
marginBottom: size === Size.SMALL ? 16 : 24,
|
|
119
|
+
padding: size === Size.SMALL ? "8px 10px" : "12px 16px",
|
|
120
120
|
background: "#1a1a1a",
|
|
121
121
|
border: "1px solid #333",
|
|
122
122
|
borderRadius: 6,
|
|
123
|
-
fontSize: 14,
|
|
123
|
+
fontSize: size === Size.SMALL ? 12 : 14,
|
|
124
124
|
color: "#52c41a",
|
|
125
125
|
},
|
|
126
126
|
},
|
|
@@ -4,7 +4,9 @@ import { OfflineTransferForm } from "../offline-transfer-form";
|
|
|
4
4
|
import { t } from "@/local";
|
|
5
5
|
import { Modal } from "@/components/common/modal";
|
|
6
6
|
import { getRechargeTheme } from "./theme";
|
|
7
|
-
|
|
7
|
+
import { getInitParams } from "@/utils/business";
|
|
8
|
+
import { Size } from "@/types";
|
|
9
|
+
const size = getInitParams<Size>("size");
|
|
8
10
|
interface ModalFormProps {
|
|
9
11
|
visible: boolean;
|
|
10
12
|
onClose: () => void;
|
|
@@ -106,7 +108,12 @@ export function Recharge({ visible, onClose, onSubmit }: ModalFormProps) {
|
|
|
106
108
|
return (
|
|
107
109
|
<Modal visible={visible} onClose={onClose} title={t("充值 / 转账")}>
|
|
108
110
|
{/* tab 按钮区域 */}
|
|
109
|
-
<div
|
|
111
|
+
<div
|
|
112
|
+
style={{
|
|
113
|
+
display: "flex",
|
|
114
|
+
marginBottom: size === Size.SMALL ? 16 : 28,
|
|
115
|
+
}}
|
|
116
|
+
>
|
|
110
117
|
<button
|
|
111
118
|
type="button"
|
|
112
119
|
onClick={() => setActiveTab("online")}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Theme, type ThemeConfig } from "@/types";
|
|
1
|
+
import { Size, Theme, type ThemeConfig } from "@/types";
|
|
2
2
|
import { getInitParams } from "@/utils/business";
|
|
3
|
-
|
|
3
|
+
const size = getInitParams<Size>("size");
|
|
4
4
|
export const rechargeThemes = {
|
|
5
5
|
white: {
|
|
6
6
|
tabBtn: (active: boolean, left: boolean) => ({
|
|
@@ -10,8 +10,8 @@ export const rechargeThemes = {
|
|
|
10
10
|
border: "none",
|
|
11
11
|
borderRadius: left ? "8px 0 0 8px" : "0 8px 8px 0",
|
|
12
12
|
fontWeight: active ? 600 : 400,
|
|
13
|
-
fontSize: 16,
|
|
14
|
-
height: 48,
|
|
13
|
+
fontSize: size === Size.SMALL ? 12 : 16,
|
|
14
|
+
height: size === Size.SMALL ? 32 : 48,
|
|
15
15
|
boxShadow: active ? "0 2px 8px 0 rgba(20,20,20,0.04)" : "none",
|
|
16
16
|
outline: "none",
|
|
17
17
|
cursor: "pointer",
|
|
@@ -28,8 +28,8 @@ export const rechargeThemes = {
|
|
|
28
28
|
border: "none",
|
|
29
29
|
borderRadius: left ? "8px 0 0 8px" : "0 8px 8px 0",
|
|
30
30
|
fontWeight: active ? 600 : 400,
|
|
31
|
-
fontSize: 16,
|
|
32
|
-
height: 48,
|
|
31
|
+
fontSize: size === Size.SMALL ? 12 : 16,
|
|
32
|
+
height: size === Size.SMALL ? 32 : 48,
|
|
33
33
|
boxShadow: active ? "0 2px 8px 0 rgba(20,20,20,0.10)" : "none",
|
|
34
34
|
outline: "none",
|
|
35
35
|
cursor: "pointer",
|
|
@@ -40,7 +40,6 @@ export const rechargeThemes = {
|
|
|
40
40
|
},
|
|
41
41
|
};
|
|
42
42
|
|
|
43
|
-
|
|
44
43
|
export function getRechargeTheme() {
|
|
45
44
|
const theme = getInitParams<Theme>("theme");
|
|
46
45
|
const themeConfig = getInitParams<ThemeConfig>("themeConfig");
|