react-native-timacare 3.0.9 → 3.0.11-beta
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/lib/commonjs/AppStore.js +1 -1
- package/lib/commonjs/AppStore.js.flow +56 -0
- package/lib/commonjs/AppStore.js.map +1 -1
- package/lib/commonjs/assets/icons/add_info_disable.svg +3 -8
- package/lib/commonjs/assets/icons/index.js +1 -1
- package/lib/commonjs/assets/icons/index.js.flow +4 -0
- package/lib/commonjs/assets/icons/index.js.map +1 -1
- package/lib/commonjs/assets/icons/topup.svg +16 -0
- package/lib/commonjs/assets/icons/topup_success.svg +16 -0
- package/lib/commonjs/navigation/primary-navigator.js +1 -1
- package/lib/commonjs/navigation/primary-navigator.js.flow +9 -0
- package/lib/commonjs/navigation/primary-navigator.js.map +1 -1
- package/lib/commonjs/screens/home/index.js +1 -1
- package/lib/commonjs/screens/home/index.js.flow +65 -0
- package/lib/commonjs/screens/home/index.js.map +1 -1
- package/lib/commonjs/screens/liveness/index.js +1 -1
- package/lib/commonjs/screens/liveness/index.js.flow +8 -8
- package/lib/commonjs/screens/liveness/index.js.map +1 -1
- package/lib/commonjs/screens/liveness-v2/index.js +1 -1
- package/lib/commonjs/screens/liveness-v2/index.js.flow +3 -1
- package/lib/commonjs/screens/liveness-v2/index.js.map +1 -1
- package/lib/commonjs/screens/loan/PreviewSchedulePaymentTopup.js +2 -0
- package/lib/commonjs/screens/loan/PreviewSchedulePaymentTopup.js.flow +304 -0
- package/lib/commonjs/screens/loan/PreviewSchedulePaymentTopup.js.map +1 -0
- package/lib/commonjs/screens/loan/UpdateLoan.js +2 -0
- package/lib/commonjs/screens/loan/UpdateLoan.js.flow +773 -0
- package/lib/commonjs/screens/loan/UpdateLoan.js.map +1 -0
- package/lib/commonjs/screens/register/index.js +1 -1
- package/lib/commonjs/screens/register/index.js.flow +1 -1
- package/lib/commonjs/services/api/api-config.js +1 -1
- package/lib/commonjs/services/api/api-config.js.flow +2 -2
- package/lib/commonjs/services/api/api-config.js.map +1 -1
- package/lib/commonjs/services/api/api.js +1 -1
- package/lib/commonjs/services/api/api.js.flow +136 -0
- package/lib/commonjs/services/api/api.js.map +1 -1
- package/lib/module/AppStore.js +1 -1
- package/lib/module/AppStore.js.map +1 -1
- package/lib/module/assets/icons/add_info_disable.svg +3 -8
- package/lib/module/assets/icons/index.js +1 -1
- package/lib/module/assets/icons/index.js.map +1 -1
- package/lib/module/assets/icons/topup.svg +16 -0
- package/lib/module/assets/icons/topup_success.svg +16 -0
- package/lib/module/navigation/primary-navigator.js +1 -1
- package/lib/module/navigation/primary-navigator.js.map +1 -1
- package/lib/module/screens/home/index.js +1 -1
- package/lib/module/screens/home/index.js.map +1 -1
- package/lib/module/screens/liveness/index.js +1 -1
- package/lib/module/screens/liveness/index.js.map +1 -1
- package/lib/module/screens/liveness-v2/index.js +1 -1
- package/lib/module/screens/liveness-v2/index.js.map +1 -1
- package/lib/module/screens/loan/PreviewSchedulePaymentTopup.js +2 -0
- package/lib/module/screens/loan/PreviewSchedulePaymentTopup.js.map +1 -0
- package/lib/module/screens/loan/UpdateLoan.js +2 -0
- package/lib/module/screens/loan/UpdateLoan.js.map +1 -0
- package/lib/module/screens/register/index.js +1 -1
- package/lib/module/services/api/api-config.js +1 -1
- package/lib/module/services/api/api-config.js.map +1 -1
- package/lib/module/services/api/api.js +1 -1
- package/lib/module/services/api/api.js.map +1 -1
- package/lib/typescript/AppStore.d.ts +8 -0
- package/lib/typescript/AppStore.d.ts.map +1 -1
- package/lib/typescript/assets/icons/index.d.ts +3 -1
- package/lib/typescript/assets/icons/index.d.ts.map +1 -1
- package/lib/typescript/navigation/primary-navigator.d.ts +1 -0
- package/lib/typescript/navigation/primary-navigator.d.ts.map +1 -1
- package/lib/typescript/screens/home/index.d.ts.map +1 -1
- package/lib/typescript/screens/liveness-v2/index.d.ts.map +1 -1
- package/lib/typescript/screens/loan/PreviewSchedulePaymentTopup.d.ts +2 -0
- package/lib/typescript/screens/loan/PreviewSchedulePaymentTopup.d.ts.map +1 -0
- package/lib/typescript/screens/loan/UpdateLoan.d.ts +2 -0
- package/lib/typescript/screens/loan/UpdateLoan.d.ts.map +1 -0
- package/lib/typescript/services/api/api.d.ts +128 -0
- package/lib/typescript/services/api/api.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/AppStore.tsx +56 -0
- package/src/assets/icons/add_info_disable.svg +3 -8
- package/src/assets/icons/index.tsx +4 -0
- package/src/assets/icons/topup.svg +16 -0
- package/src/assets/icons/topup_success.svg +16 -0
- package/src/navigation/primary-navigator.tsx +9 -0
- package/src/screens/home/index.tsx +65 -0
- package/src/screens/liveness/index.tsx +8 -8
- package/src/screens/liveness-v2/index.tsx +3 -1
- package/src/screens/loan/PreviewSchedulePaymentTopup.tsx +304 -0
- package/src/screens/loan/UpdateLoan.tsx +773 -0
- package/src/screens/register/index.tsx +1 -1
- package/src/services/api/api-config.ts +2 -2
- package/src/services/api/api.ts +136 -0
|
@@ -0,0 +1,304 @@
|
|
|
1
|
+
//@ts-nocheck
|
|
2
|
+
import React from 'react';
|
|
3
|
+
import {
|
|
4
|
+
Alert,
|
|
5
|
+
SafeAreaView,
|
|
6
|
+
ScrollView,
|
|
7
|
+
TouchableOpacity,
|
|
8
|
+
View,
|
|
9
|
+
} from 'react-native';
|
|
10
|
+
import { observer } from 'mobx-react-lite';
|
|
11
|
+
import {
|
|
12
|
+
useNavigation,
|
|
13
|
+
StackActions,
|
|
14
|
+
CommonActions,
|
|
15
|
+
} from '@react-navigation/native';
|
|
16
|
+
import MHeader from '../../components/MHeader';
|
|
17
|
+
import { Api } from '../../services/api';
|
|
18
|
+
import Loading from '../../components/Loading';
|
|
19
|
+
import { MText } from '../../components/MText';
|
|
20
|
+
import { formatDDMMYYY, formatMoney } from '../../utils';
|
|
21
|
+
import LinearGradient from 'react-native-linear-gradient';
|
|
22
|
+
import { ScreenNames } from '../../navigation';
|
|
23
|
+
|
|
24
|
+
export const PreviewSchedulePaymentTopup = observer(
|
|
25
|
+
function PreviewSchedulePaymentTopup(props: any) {
|
|
26
|
+
const navigation = useNavigation();
|
|
27
|
+
const [isLoading, setIsLoading] = React.useState(false);
|
|
28
|
+
const [data, setData] = React.useState<any>(null);
|
|
29
|
+
|
|
30
|
+
const getData = async () => {
|
|
31
|
+
setIsLoading(true);
|
|
32
|
+
try {
|
|
33
|
+
const response = await Api.getInstance().getPlanPaymentV2(
|
|
34
|
+
props.route.params?.id
|
|
35
|
+
);
|
|
36
|
+
setIsLoading(false);
|
|
37
|
+
if (response.kind === 'ok') {
|
|
38
|
+
if (response.data.meta.errorCode === 200) {
|
|
39
|
+
setData(response.data.data);
|
|
40
|
+
} else {
|
|
41
|
+
Alert.alert('Thông báo', response.data.meta.errorMessage);
|
|
42
|
+
}
|
|
43
|
+
} else {
|
|
44
|
+
Alert.alert('Thông báo', 'Có lỗi xảy ra, vui lòng thử lại sau');
|
|
45
|
+
}
|
|
46
|
+
} catch (error) {
|
|
47
|
+
setIsLoading(false);
|
|
48
|
+
Alert.alert('Thông báo', 'Có lỗi xảy ra, vui lòng thử lại sau');
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
React.useEffect(() => {
|
|
52
|
+
const unsubscribe = navigation.addListener('focus', () => {
|
|
53
|
+
getData();
|
|
54
|
+
});
|
|
55
|
+
return unsubscribe;
|
|
56
|
+
}, [navigation]);
|
|
57
|
+
|
|
58
|
+
React.useEffect(() => {
|
|
59
|
+
const unsubscribe = navigation.addListener('blur', () => {
|
|
60
|
+
setData(null);
|
|
61
|
+
});
|
|
62
|
+
return unsubscribe;
|
|
63
|
+
}, [navigation]);
|
|
64
|
+
|
|
65
|
+
return (
|
|
66
|
+
<View style={{ flex: 1, backgroundColor: '#FDFDFD' }}>
|
|
67
|
+
<MHeader
|
|
68
|
+
title={`Lịch thanh toán dự kiến`}
|
|
69
|
+
onBack={() => navigation.goBack()}
|
|
70
|
+
/>
|
|
71
|
+
<SafeAreaView style={{ flex: 1 }}>
|
|
72
|
+
<ScrollView>
|
|
73
|
+
<View
|
|
74
|
+
style={{
|
|
75
|
+
borderWidth: 1,
|
|
76
|
+
borderColor: '#FF8E4F',
|
|
77
|
+
borderRadius: 8,
|
|
78
|
+
margin: 16,
|
|
79
|
+
padding: 16,
|
|
80
|
+
}}
|
|
81
|
+
>
|
|
82
|
+
<View
|
|
83
|
+
style={{
|
|
84
|
+
flexDirection: 'row',
|
|
85
|
+
alignItems: 'center',
|
|
86
|
+
justifyContent: 'space-between',
|
|
87
|
+
}}
|
|
88
|
+
>
|
|
89
|
+
<MText style={{ fontSize: 12, color: '#333333' }}>
|
|
90
|
+
Mã HĐ giải ngân
|
|
91
|
+
</MText>
|
|
92
|
+
<MText
|
|
93
|
+
style={{
|
|
94
|
+
fontSize: 12,
|
|
95
|
+
color: '#333333',
|
|
96
|
+
fontWeight: 'bold',
|
|
97
|
+
}}
|
|
98
|
+
>
|
|
99
|
+
HD-{props.route?.params?.id}
|
|
100
|
+
</MText>
|
|
101
|
+
</View>
|
|
102
|
+
<View
|
|
103
|
+
style={{
|
|
104
|
+
flexDirection: 'row',
|
|
105
|
+
alignItems: 'center',
|
|
106
|
+
justifyContent: 'space-between',
|
|
107
|
+
marginTop: 16,
|
|
108
|
+
}}
|
|
109
|
+
>
|
|
110
|
+
<MText style={{ fontSize: 12, color: '#333333' }}>
|
|
111
|
+
Số tiền vay
|
|
112
|
+
</MText>
|
|
113
|
+
<MText
|
|
114
|
+
style={{
|
|
115
|
+
fontSize: 12,
|
|
116
|
+
color: '#EF592E',
|
|
117
|
+
fontWeight: 'bold',
|
|
118
|
+
}}
|
|
119
|
+
>
|
|
120
|
+
{formatMoney(data?.loanAmount)} đ
|
|
121
|
+
</MText>
|
|
122
|
+
</View>
|
|
123
|
+
<View
|
|
124
|
+
style={{
|
|
125
|
+
flexDirection: 'row',
|
|
126
|
+
alignItems: 'center',
|
|
127
|
+
justifyContent: 'space-between',
|
|
128
|
+
marginTop: 16,
|
|
129
|
+
}}
|
|
130
|
+
>
|
|
131
|
+
<MText style={{ fontSize: 12, color: '#333333' }}>
|
|
132
|
+
Bảo hiểm
|
|
133
|
+
</MText>
|
|
134
|
+
<MText
|
|
135
|
+
style={{
|
|
136
|
+
fontSize: 12,
|
|
137
|
+
color: '#333333',
|
|
138
|
+
fontWeight: 'bold',
|
|
139
|
+
}}
|
|
140
|
+
>
|
|
141
|
+
{formatMoney(data?.totalMoneyInsurance)} đ
|
|
142
|
+
</MText>
|
|
143
|
+
</View>
|
|
144
|
+
<View
|
|
145
|
+
style={{
|
|
146
|
+
flexDirection: 'row',
|
|
147
|
+
alignItems: 'center',
|
|
148
|
+
justifyContent: 'space-between',
|
|
149
|
+
marginTop: 16,
|
|
150
|
+
}}
|
|
151
|
+
>
|
|
152
|
+
<MText style={{ fontSize: 12, color: '#333333' }}>
|
|
153
|
+
Thời hạn
|
|
154
|
+
</MText>
|
|
155
|
+
<MText
|
|
156
|
+
style={{
|
|
157
|
+
fontSize: 12,
|
|
158
|
+
color: '#333333',
|
|
159
|
+
fontWeight: 'bold',
|
|
160
|
+
}}
|
|
161
|
+
>
|
|
162
|
+
{data?.loanTime} tháng
|
|
163
|
+
</MText>
|
|
164
|
+
</View>
|
|
165
|
+
<View
|
|
166
|
+
style={{
|
|
167
|
+
flexDirection: 'row',
|
|
168
|
+
alignItems: 'center',
|
|
169
|
+
justifyContent: 'space-between',
|
|
170
|
+
marginTop: 16,
|
|
171
|
+
}}
|
|
172
|
+
>
|
|
173
|
+
<MText style={{ fontSize: 12, color: '#333333' }}>
|
|
174
|
+
Ngày dự kiến giải ngân
|
|
175
|
+
</MText>
|
|
176
|
+
<MText
|
|
177
|
+
style={{
|
|
178
|
+
fontSize: 12,
|
|
179
|
+
color: '#333333',
|
|
180
|
+
fontWeight: 'bold',
|
|
181
|
+
}}
|
|
182
|
+
>
|
|
183
|
+
{formatDDMMYYY(data?.expectedDisbursementDate)}
|
|
184
|
+
</MText>
|
|
185
|
+
</View>
|
|
186
|
+
</View>
|
|
187
|
+
|
|
188
|
+
<View
|
|
189
|
+
style={{
|
|
190
|
+
borderWidth: 1,
|
|
191
|
+
borderColor: '#FF8E4F',
|
|
192
|
+
borderRadius: 8,
|
|
193
|
+
marginHorizontal: 16,
|
|
194
|
+
}}
|
|
195
|
+
>
|
|
196
|
+
<View
|
|
197
|
+
style={{
|
|
198
|
+
backgroundColor: '#FFF3E9',
|
|
199
|
+
height: 32,
|
|
200
|
+
borderTopLeftRadius: 8,
|
|
201
|
+
borderTopRightRadius: 8,
|
|
202
|
+
flexDirection: 'row',
|
|
203
|
+
alignItems: 'center',
|
|
204
|
+
}}
|
|
205
|
+
>
|
|
206
|
+
<MText
|
|
207
|
+
style={{
|
|
208
|
+
flex: 1,
|
|
209
|
+
textAlign: 'center',
|
|
210
|
+
color: '#333333',
|
|
211
|
+
fontSize: 12,
|
|
212
|
+
}}
|
|
213
|
+
>
|
|
214
|
+
Ngày thanh toán
|
|
215
|
+
</MText>
|
|
216
|
+
<MText
|
|
217
|
+
style={{
|
|
218
|
+
flex: 1,
|
|
219
|
+
textAlign: 'center',
|
|
220
|
+
color: '#333333',
|
|
221
|
+
fontSize: 12,
|
|
222
|
+
}}
|
|
223
|
+
>
|
|
224
|
+
Số tiền thanh toán
|
|
225
|
+
</MText>
|
|
226
|
+
</View>
|
|
227
|
+
{data?.listPaymentSchedule?.map((item: any, index: number) => {
|
|
228
|
+
return (
|
|
229
|
+
<View
|
|
230
|
+
key={index}
|
|
231
|
+
style={{
|
|
232
|
+
paddingVertical: 16,
|
|
233
|
+
flexDirection: 'row',
|
|
234
|
+
alignItems: 'center',
|
|
235
|
+
borderBottomWidth:
|
|
236
|
+
index === data?.listPaymentSchedule?.length - 1 ? 0 : 1,
|
|
237
|
+
borderColor: '#DADADA',
|
|
238
|
+
}}
|
|
239
|
+
>
|
|
240
|
+
<MText
|
|
241
|
+
style={{
|
|
242
|
+
flex: 1,
|
|
243
|
+
textAlign: 'center',
|
|
244
|
+
color: '#999999',
|
|
245
|
+
fontSize: 12,
|
|
246
|
+
}}
|
|
247
|
+
>
|
|
248
|
+
{formatDDMMYYY(item?.payDate)}
|
|
249
|
+
</MText>
|
|
250
|
+
<MText
|
|
251
|
+
style={{
|
|
252
|
+
flex: 1,
|
|
253
|
+
textAlign: 'center',
|
|
254
|
+
color: '#333333',
|
|
255
|
+
fontSize: 12,
|
|
256
|
+
fontWeight: 'bold',
|
|
257
|
+
}}
|
|
258
|
+
>
|
|
259
|
+
{formatMoney(item?.totalMoneyNeedPayment)} đ
|
|
260
|
+
</MText>
|
|
261
|
+
</View>
|
|
262
|
+
);
|
|
263
|
+
})}
|
|
264
|
+
</View>
|
|
265
|
+
</ScrollView>
|
|
266
|
+
<TouchableOpacity
|
|
267
|
+
onPress={() => {
|
|
268
|
+
navigation.dispatch(
|
|
269
|
+
CommonActions.reset({
|
|
270
|
+
index: 1,
|
|
271
|
+
routes: [{ name: ScreenNames.Main }],
|
|
272
|
+
})
|
|
273
|
+
);
|
|
274
|
+
}}
|
|
275
|
+
style={{
|
|
276
|
+
marginHorizontal: 16,
|
|
277
|
+
marginVertical: 16,
|
|
278
|
+
}}
|
|
279
|
+
>
|
|
280
|
+
<LinearGradient
|
|
281
|
+
colors={['#FF7A00', '#EF4123']}
|
|
282
|
+
style={{
|
|
283
|
+
alignItems: 'center',
|
|
284
|
+
borderRadius: 30,
|
|
285
|
+
height: 40,
|
|
286
|
+
justifyContent: 'center',
|
|
287
|
+
}}
|
|
288
|
+
>
|
|
289
|
+
<MText
|
|
290
|
+
style={{
|
|
291
|
+
color: 'white',
|
|
292
|
+
fontSize: 16,
|
|
293
|
+
}}
|
|
294
|
+
>
|
|
295
|
+
Xác nhận
|
|
296
|
+
</MText>
|
|
297
|
+
</LinearGradient>
|
|
298
|
+
</TouchableOpacity>
|
|
299
|
+
</SafeAreaView>
|
|
300
|
+
<Loading isLoading={isLoading} />
|
|
301
|
+
</View>
|
|
302
|
+
);
|
|
303
|
+
}
|
|
304
|
+
);
|