react-native-timacare 0.0.39 → 0.0.41
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/screens/detail-loan/Info.js +1 -1
- package/lib/commonjs/screens/detail-loan/Info.js.flow +32 -35
- package/lib/commonjs/screens/detail-loan/Info.js.map +1 -1
- package/lib/commonjs/screens/detail-loan/Payment.js +1 -1
- package/lib/commonjs/screens/detail-loan/Payment.js.flow +25 -16
- package/lib/commonjs/screens/detail-loan/Payment.js.map +1 -1
- package/lib/commonjs/screens/detail-loan/PaymentAll.js +1 -1
- package/lib/commonjs/screens/detail-loan/PaymentAll.js.flow +28 -34
- package/lib/commonjs/screens/detail-loan/PaymentAll.js.map +1 -1
- package/lib/commonjs/screens/detail-loan/PaymentInfo.js +1 -1
- package/lib/commonjs/screens/detail-loan/PaymentInfo.js.flow +18 -15
- package/lib/commonjs/screens/detail-loan/PaymentInfo.js.map +1 -1
- package/lib/commonjs/screens/detail-loan/store.js +1 -1
- package/lib/commonjs/screens/detail-loan/store.js.flow +14 -3
- package/lib/commonjs/screens/detail-loan/store.js.map +1 -1
- package/lib/commonjs/screens/full-submit/accept_policy.js +1 -1
- package/lib/commonjs/screens/full-submit/accept_policy.js.flow +31 -27
- package/lib/commonjs/screens/full-submit/accept_policy.js.map +1 -1
- package/lib/commonjs/screens/full-submit/store.js +1 -1
- package/lib/commonjs/screens/full-submit/store.js.flow +4 -1
- package/lib/commonjs/screens/full-submit/store.js.map +1 -1
- package/lib/commonjs/screens/full-submit/update-info.js +1 -1
- package/lib/commonjs/screens/full-submit/update-info.js.flow +752 -763
- package/lib/commonjs/screens/full-submit/update-info.js.map +1 -1
- package/lib/commonjs/screens/schedule-payment/index.js +1 -1
- package/lib/commonjs/screens/schedule-payment/index.js.flow +16 -4
- package/lib/commonjs/screens/schedule-payment/index.js.map +1 -1
- package/lib/commonjs/screens/schedule-payment/store.js +1 -1
- package/lib/commonjs/screens/schedule-payment/store.js.flow +4 -1
- package/lib/commonjs/screens/schedule-payment/store.js.map +1 -1
- package/lib/module/screens/detail-loan/Info.js +1 -1
- package/lib/module/screens/detail-loan/Info.js.map +1 -1
- package/lib/module/screens/detail-loan/Payment.js +1 -1
- package/lib/module/screens/detail-loan/Payment.js.map +1 -1
- package/lib/module/screens/detail-loan/PaymentAll.js +1 -1
- package/lib/module/screens/detail-loan/PaymentAll.js.map +1 -1
- package/lib/module/screens/detail-loan/PaymentInfo.js +1 -1
- package/lib/module/screens/detail-loan/PaymentInfo.js.map +1 -1
- package/lib/module/screens/detail-loan/store.js +1 -1
- package/lib/module/screens/detail-loan/store.js.map +1 -1
- package/lib/module/screens/full-submit/accept_policy.js +1 -1
- package/lib/module/screens/full-submit/accept_policy.js.map +1 -1
- package/lib/module/screens/full-submit/store.js +1 -1
- package/lib/module/screens/full-submit/store.js.map +1 -1
- package/lib/module/screens/full-submit/update-info.js +1 -1
- package/lib/module/screens/full-submit/update-info.js.map +1 -1
- package/lib/module/screens/schedule-payment/index.js +1 -1
- package/lib/module/screens/schedule-payment/index.js.map +1 -1
- package/lib/module/screens/schedule-payment/store.js +1 -1
- package/lib/module/screens/schedule-payment/store.js.map +1 -1
- package/lib/typescript/screens/detail-loan/Info.d.ts.map +1 -1
- package/lib/typescript/screens/detail-loan/Payment.d.ts.map +1 -1
- package/lib/typescript/screens/detail-loan/PaymentAll.d.ts.map +1 -1
- package/lib/typescript/screens/detail-loan/PaymentInfo.d.ts.map +1 -1
- package/lib/typescript/screens/detail-loan/store.d.ts +3 -3
- package/lib/typescript/screens/detail-loan/store.d.ts.map +1 -1
- package/lib/typescript/screens/full-submit/accept_policy.d.ts.map +1 -1
- package/lib/typescript/screens/full-submit/store.d.ts +1 -1
- package/lib/typescript/screens/full-submit/store.d.ts.map +1 -1
- package/lib/typescript/screens/full-submit/update-info.d.ts.map +1 -1
- package/lib/typescript/screens/schedule-payment/index.d.ts.map +1 -1
- package/lib/typescript/screens/schedule-payment/store.d.ts +1 -1
- package/lib/typescript/screens/schedule-payment/store.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/screens/detail-loan/Info.tsx +32 -35
- package/src/screens/detail-loan/Payment.tsx +25 -16
- package/src/screens/detail-loan/PaymentAll.tsx +28 -34
- package/src/screens/detail-loan/PaymentInfo.tsx +18 -15
- package/src/screens/detail-loan/store.tsx +14 -3
- package/src/screens/full-submit/accept_policy.tsx +31 -27
- package/src/screens/full-submit/store.tsx +4 -1
- package/src/screens/full-submit/update-info.tsx +752 -763
- package/src/screens/schedule-payment/index.tsx +16 -4
- package/src/screens/schedule-payment/store.tsx +4 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
//@ts-nocheck
|
|
2
2
|
import { useNavigation } from '@react-navigation/native';
|
|
3
3
|
import { observer } from 'mobx-react-lite';
|
|
4
|
-
import React, { useEffect } from 'react';
|
|
4
|
+
import React, { useEffect, useState } from 'react';
|
|
5
5
|
import {
|
|
6
6
|
ActivityIndicator,
|
|
7
7
|
Image,
|
|
@@ -30,8 +30,20 @@ const logoView: ImageStyle = {
|
|
|
30
30
|
|
|
31
31
|
export const SchedulePayment = observer(function SchedulePayment(props: any) {
|
|
32
32
|
const navigation = useNavigation();
|
|
33
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
34
|
+
const [data, setData] = useState<any[]>();
|
|
33
35
|
const getData = () => {
|
|
34
|
-
|
|
36
|
+
setIsLoading(true);
|
|
37
|
+
SchedulePaymentStore.getSchedulePayment(
|
|
38
|
+
props.route?.params?.loan?.id,
|
|
39
|
+
(res) => {
|
|
40
|
+
setIsLoading(false);
|
|
41
|
+
setData(res);
|
|
42
|
+
},
|
|
43
|
+
() => {
|
|
44
|
+
setIsLoading(false);
|
|
45
|
+
}
|
|
46
|
+
);
|
|
35
47
|
};
|
|
36
48
|
|
|
37
49
|
useEffect(() => {
|
|
@@ -79,7 +91,7 @@ export const SchedulePayment = observer(function SchedulePayment(props: any) {
|
|
|
79
91
|
<RefreshControl refreshing={false} onRefresh={getData} />
|
|
80
92
|
}
|
|
81
93
|
>
|
|
82
|
-
{
|
|
94
|
+
{data.map((item, index) => (
|
|
83
95
|
<View
|
|
84
96
|
key={index}
|
|
85
97
|
style={{
|
|
@@ -199,7 +211,7 @@ export const SchedulePayment = observer(function SchedulePayment(props: any) {
|
|
|
199
211
|
<CIMBBank />
|
|
200
212
|
</View>
|
|
201
213
|
</View>
|
|
202
|
-
<Loading isLoading={
|
|
214
|
+
<Loading isLoading={isLoading} />
|
|
203
215
|
</SafeAreaView>
|
|
204
216
|
</View>
|
|
205
217
|
);
|
|
@@ -8,20 +8,23 @@ class Store {
|
|
|
8
8
|
@observable data = [];
|
|
9
9
|
|
|
10
10
|
@action
|
|
11
|
-
async getSchedulePayment(id) {
|
|
11
|
+
async getSchedulePayment(id, onSuccess?, onError?) {
|
|
12
12
|
this.isLoading = true;
|
|
13
13
|
const response = await Api.getInstance().getPaymentSchedule(id);
|
|
14
14
|
this.isLoading = false;
|
|
15
15
|
if (response.kind === 'ok') {
|
|
16
16
|
if (response.data.meta.errorCode === 200) {
|
|
17
|
+
if (onSuccess) onSuccess(response.data.data);
|
|
17
18
|
this.data = response.data.data;
|
|
18
19
|
} else {
|
|
19
20
|
Alert.alert('Thông báo', response.data.meta.errorMessage, [
|
|
20
21
|
{ text: 'Đồng ý' },
|
|
21
22
|
]);
|
|
23
|
+
if (onError) onError();
|
|
22
24
|
}
|
|
23
25
|
} else {
|
|
24
26
|
this.isLoading = false;
|
|
27
|
+
if (onError) onError();
|
|
25
28
|
Alert.alert('Thông báo', 'Có lỗi xảy ra. Vui lòng thử lại sau!');
|
|
26
29
|
}
|
|
27
30
|
}
|