react-native-timacare 0.0.40 → 0.0.42

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/store.js +1 -1
  17. package/lib/commonjs/screens/full-submit/store.js.flow +4 -1
  18. package/lib/commonjs/screens/full-submit/store.js.map +1 -1
  19. package/lib/commonjs/screens/full-submit/update-info.js +1 -1
  20. package/lib/commonjs/screens/full-submit/update-info.js.flow +752 -763
  21. package/lib/commonjs/screens/full-submit/update-info.js.map +1 -1
  22. package/lib/commonjs/screens/home/index.js +1 -1
  23. package/lib/commonjs/screens/home/index.js.flow +15 -15
  24. package/lib/commonjs/screens/home/index.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/store.js +1 -1
  42. package/lib/module/screens/full-submit/store.js.map +1 -1
  43. package/lib/module/screens/full-submit/update-info.js +1 -1
  44. package/lib/module/screens/full-submit/update-info.js.map +1 -1
  45. package/lib/module/screens/home/index.js +1 -1
  46. package/lib/module/screens/home/index.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/store.d.ts +1 -1
  58. package/lib/typescript/screens/full-submit/store.d.ts.map +1 -1
  59. package/lib/typescript/screens/full-submit/update-info.d.ts.map +1 -1
  60. package/lib/typescript/screens/home/index.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/store.tsx +4 -1
  71. package/src/screens/full-submit/update-info.tsx +752 -763
  72. package/src/screens/home/index.tsx +15 -15
  73. package/src/screens/schedule-payment/index.tsx +16 -4
  74. package/src/screens/schedule-payment/store.tsx +4 -1
@@ -67,6 +67,7 @@ import Modal from 'react-native-modal';
67
67
  import { Api } from '../../services/api';
68
68
  import { load, save } from '../../utils/storage';
69
69
  import Loading from '../../components/Loading';
70
+ import MButton from '../../components/MButton';
70
71
 
71
72
  const listBanners = [
72
73
  require('../../assets/img/banner1.png'),
@@ -236,7 +237,6 @@ export const Home = observer(function Home() {
236
237
  appStore.long = position.coords.longitude;
237
238
  },
238
239
  (error) => {
239
- // See error code charts below.
240
240
  console.log(error.code, error.message);
241
241
  requestPermissions();
242
242
  },
@@ -265,7 +265,7 @@ export const Home = observer(function Home() {
265
265
  height: 60,
266
266
  }}
267
267
  >
268
- <TouchableOpacity
268
+ <MButton
269
269
  style={{
270
270
  height: 32,
271
271
  width: 32,
@@ -280,7 +280,7 @@ export const Home = observer(function Home() {
280
280
  }}
281
281
  >
282
282
  <IconBackWhite />
283
- </TouchableOpacity>
283
+ </MButton>
284
284
  <MText
285
285
  style={{
286
286
  fontWeight: 'bold',
@@ -290,7 +290,7 @@ export const Home = observer(function Home() {
290
290
  >
291
291
  Vay nhanh 24/7
292
292
  </MText>
293
- <TouchableOpacity
293
+ <MButton
294
294
  style={{
295
295
  height: 32,
296
296
  width: 32,
@@ -307,7 +307,7 @@ export const Home = observer(function Home() {
307
307
  }}
308
308
  >
309
309
  <Call />
310
- </TouchableOpacity>
310
+ </MButton>
311
311
  </View>
312
312
  </SafeAreaView>
313
313
  </LinearGradient>
@@ -403,7 +403,7 @@ export const Home = observer(function Home() {
403
403
  <View style={{ flexDirection: 'row' }}>
404
404
  {loan?.loanStatus === null ||
405
405
  loan?.loanStatus === '' ? (
406
- <TouchableOpacity
406
+ <MButton
407
407
  style={{ alignItems: 'center' }}
408
408
  onPress={() => {
409
409
  navigation.dispatch(
@@ -427,7 +427,7 @@ export const Home = observer(function Home() {
427
427
  >
428
428
  Hoàn thiện{'\n'}cung cấp thông tin
429
429
  </MText>
430
- </TouchableOpacity>
430
+ </MButton>
431
431
  ) : (
432
432
  <View>
433
433
  {loan?.isUpdateLoan ||
@@ -493,7 +493,7 @@ export const Home = observer(function Home() {
493
493
  )}
494
494
 
495
495
  {loan?.isSignContract && (
496
- <TouchableOpacity
496
+ <MButton
497
497
  style={{
498
498
  alignItems: 'center',
499
499
  marginLeft: 20,
@@ -529,10 +529,10 @@ export const Home = observer(function Home() {
529
529
  >
530
530
  Ký hợp đồng
531
531
  </MText>
532
- </TouchableOpacity>
532
+ </MButton>
533
533
  )}
534
534
  {loan?.isSignContractTima && (
535
- <TouchableOpacity
535
+ <MButton
536
536
  style={{
537
537
  alignItems: 'center',
538
538
  marginLeft: 20,
@@ -562,10 +562,10 @@ export const Home = observer(function Home() {
562
562
  >
563
563
  Hợp đồng{'\n'}dịch vụ
564
564
  </MText>
565
- </TouchableOpacity>
565
+ </MButton>
566
566
  )}
567
567
  {loan?.paymentEvidenceUrl && (
568
- <TouchableOpacity
568
+ <MButton
569
569
  style={{
570
570
  alignItems: 'center',
571
571
  marginLeft: 20,
@@ -595,10 +595,10 @@ export const Home = observer(function Home() {
595
595
  >
596
596
  Mục đích {'\n'}sử dụng
597
597
  </MText>
598
- </TouchableOpacity>
598
+ </MButton>
599
599
  )}
600
600
  {loan?.showPaymentPlan && (
601
- <TouchableOpacity
601
+ <MButton
602
602
  style={{
603
603
  alignItems: 'center',
604
604
  marginLeft: 20,
@@ -627,7 +627,7 @@ export const Home = observer(function Home() {
627
627
  >
628
628
  Lịch dự kiến
629
629
  </MText>
630
- </TouchableOpacity>
630
+ </MButton>
631
631
  )}
632
632
  </View>
633
633
 
@@ -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
  }