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.
Files changed (74) hide show
  1. package/lib/commonjs/screens/detail-loan/Info.js +1 -1
  2. package/lib/commonjs/screens/detail-loan/Info.js.flow +32 -35
  3. package/lib/commonjs/screens/detail-loan/Info.js.map +1 -1
  4. package/lib/commonjs/screens/detail-loan/Payment.js +1 -1
  5. package/lib/commonjs/screens/detail-loan/Payment.js.flow +25 -16
  6. package/lib/commonjs/screens/detail-loan/Payment.js.map +1 -1
  7. package/lib/commonjs/screens/detail-loan/PaymentAll.js +1 -1
  8. package/lib/commonjs/screens/detail-loan/PaymentAll.js.flow +28 -34
  9. package/lib/commonjs/screens/detail-loan/PaymentAll.js.map +1 -1
  10. package/lib/commonjs/screens/detail-loan/PaymentInfo.js +1 -1
  11. package/lib/commonjs/screens/detail-loan/PaymentInfo.js.flow +18 -15
  12. package/lib/commonjs/screens/detail-loan/PaymentInfo.js.map +1 -1
  13. package/lib/commonjs/screens/detail-loan/store.js +1 -1
  14. package/lib/commonjs/screens/detail-loan/store.js.flow +14 -3
  15. package/lib/commonjs/screens/detail-loan/store.js.map +1 -1
  16. package/lib/commonjs/screens/full-submit/accept_policy.js +1 -1
  17. package/lib/commonjs/screens/full-submit/accept_policy.js.flow +31 -27
  18. package/lib/commonjs/screens/full-submit/accept_policy.js.map +1 -1
  19. package/lib/commonjs/screens/full-submit/store.js +1 -1
  20. package/lib/commonjs/screens/full-submit/store.js.flow +4 -1
  21. package/lib/commonjs/screens/full-submit/store.js.map +1 -1
  22. package/lib/commonjs/screens/full-submit/update-info.js +1 -1
  23. package/lib/commonjs/screens/full-submit/update-info.js.flow +752 -763
  24. package/lib/commonjs/screens/full-submit/update-info.js.map +1 -1
  25. package/lib/commonjs/screens/schedule-payment/index.js +1 -1
  26. package/lib/commonjs/screens/schedule-payment/index.js.flow +16 -4
  27. package/lib/commonjs/screens/schedule-payment/index.js.map +1 -1
  28. package/lib/commonjs/screens/schedule-payment/store.js +1 -1
  29. package/lib/commonjs/screens/schedule-payment/store.js.flow +4 -1
  30. package/lib/commonjs/screens/schedule-payment/store.js.map +1 -1
  31. package/lib/module/screens/detail-loan/Info.js +1 -1
  32. package/lib/module/screens/detail-loan/Info.js.map +1 -1
  33. package/lib/module/screens/detail-loan/Payment.js +1 -1
  34. package/lib/module/screens/detail-loan/Payment.js.map +1 -1
  35. package/lib/module/screens/detail-loan/PaymentAll.js +1 -1
  36. package/lib/module/screens/detail-loan/PaymentAll.js.map +1 -1
  37. package/lib/module/screens/detail-loan/PaymentInfo.js +1 -1
  38. package/lib/module/screens/detail-loan/PaymentInfo.js.map +1 -1
  39. package/lib/module/screens/detail-loan/store.js +1 -1
  40. package/lib/module/screens/detail-loan/store.js.map +1 -1
  41. package/lib/module/screens/full-submit/accept_policy.js +1 -1
  42. package/lib/module/screens/full-submit/accept_policy.js.map +1 -1
  43. package/lib/module/screens/full-submit/store.js +1 -1
  44. package/lib/module/screens/full-submit/store.js.map +1 -1
  45. package/lib/module/screens/full-submit/update-info.js +1 -1
  46. package/lib/module/screens/full-submit/update-info.js.map +1 -1
  47. package/lib/module/screens/schedule-payment/index.js +1 -1
  48. package/lib/module/screens/schedule-payment/index.js.map +1 -1
  49. package/lib/module/screens/schedule-payment/store.js +1 -1
  50. package/lib/module/screens/schedule-payment/store.js.map +1 -1
  51. package/lib/typescript/screens/detail-loan/Info.d.ts.map +1 -1
  52. package/lib/typescript/screens/detail-loan/Payment.d.ts.map +1 -1
  53. package/lib/typescript/screens/detail-loan/PaymentAll.d.ts.map +1 -1
  54. package/lib/typescript/screens/detail-loan/PaymentInfo.d.ts.map +1 -1
  55. package/lib/typescript/screens/detail-loan/store.d.ts +3 -3
  56. package/lib/typescript/screens/detail-loan/store.d.ts.map +1 -1
  57. package/lib/typescript/screens/full-submit/accept_policy.d.ts.map +1 -1
  58. package/lib/typescript/screens/full-submit/store.d.ts +1 -1
  59. package/lib/typescript/screens/full-submit/store.d.ts.map +1 -1
  60. package/lib/typescript/screens/full-submit/update-info.d.ts.map +1 -1
  61. package/lib/typescript/screens/schedule-payment/index.d.ts.map +1 -1
  62. package/lib/typescript/screens/schedule-payment/store.d.ts +1 -1
  63. package/lib/typescript/screens/schedule-payment/store.d.ts.map +1 -1
  64. package/package.json +1 -1
  65. package/src/screens/detail-loan/Info.tsx +32 -35
  66. package/src/screens/detail-loan/Payment.tsx +25 -16
  67. package/src/screens/detail-loan/PaymentAll.tsx +28 -34
  68. package/src/screens/detail-loan/PaymentInfo.tsx +18 -15
  69. package/src/screens/detail-loan/store.tsx +14 -3
  70. package/src/screens/full-submit/accept_policy.tsx +31 -27
  71. package/src/screens/full-submit/store.tsx +4 -1
  72. package/src/screens/full-submit/update-info.tsx +752 -763
  73. package/src/screens/schedule-payment/index.tsx +16 -4
  74. 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
- SchedulePaymentStore.getSchedulePayment(props.route?.params?.loan?.id);
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
- {SchedulePaymentStore.data.map((item, index) => (
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={SchedulePaymentStore.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
  }