react-native-timacare 0.0.44 → 0.0.46

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 (92) hide show
  1. package/lib/commonjs/assets/icons/index.js +1 -1
  2. package/lib/commonjs/assets/icons/index.js.flow +2 -0
  3. package/lib/commonjs/assets/icons/index.js.map +1 -1
  4. package/lib/commonjs/assets/icons/warning.svg +4 -0
  5. package/lib/commonjs/index.js +1 -1
  6. package/lib/commonjs/index.js.flow +2 -3
  7. package/lib/commonjs/index.js.map +1 -1
  8. package/lib/commonjs/navigation/primary-navigator.js +1 -1
  9. package/lib/commonjs/navigation/primary-navigator.js.flow +1 -1
  10. package/lib/commonjs/navigation/primary-navigator.js.map +1 -1
  11. package/lib/commonjs/screens/full-submit/accept_policy.js +1 -1
  12. package/lib/commonjs/screens/full-submit/accept_policy.js.flow +172 -88
  13. package/lib/commonjs/screens/full-submit/accept_policy.js.map +1 -1
  14. package/lib/commonjs/screens/home/CIMBxTima.js +1 -1
  15. package/lib/commonjs/screens/home/CIMBxTima.js.flow +10 -8
  16. package/lib/commonjs/screens/home/CIMBxTima.js.map +1 -1
  17. package/lib/commonjs/screens/home/Store.js +1 -1
  18. package/lib/commonjs/screens/home/Store.js.flow +6 -6
  19. package/lib/commonjs/screens/home/Store.js.map +1 -1
  20. package/lib/commonjs/screens/home/index.js +1 -1
  21. package/lib/commonjs/screens/home/index.js.flow +1010 -962
  22. package/lib/commonjs/screens/home/index.js.map +1 -1
  23. package/lib/commonjs/screens/loginWithPassword/index.js +1 -1
  24. package/lib/commonjs/screens/loginWithPassword/index.js.flow +48 -47
  25. package/lib/commonjs/screens/loginWithPassword/index.js.map +1 -1
  26. package/lib/commonjs/screens/loginWithPassword/store.js +1 -1
  27. package/lib/commonjs/screens/loginWithPassword/store.js.flow +2 -0
  28. package/lib/commonjs/screens/loginWithPassword/store.js.map +1 -1
  29. package/lib/commonjs/screens/register/index.js +1 -1
  30. package/lib/commonjs/screens/register/index.js.flow +1 -1
  31. package/lib/commonjs/screens/setPassword/confirmPassword.js +1 -1
  32. package/lib/commonjs/screens/setPassword/confirmPassword.js.flow +6 -35
  33. package/lib/commonjs/screens/setPassword/confirmPassword.js.map +1 -1
  34. package/lib/commonjs/screens/setPassword/index.js +1 -1
  35. package/lib/commonjs/screens/setPassword/index.js.flow +6 -45
  36. package/lib/commonjs/screens/setPassword/index.js.map +1 -1
  37. package/lib/commonjs/screens/setPassword/store.js +1 -1
  38. package/lib/commonjs/screens/setPassword/store.js.flow +2 -2
  39. package/lib/commonjs/screens/setPassword/store.js.map +1 -1
  40. package/lib/module/assets/icons/index.js +1 -1
  41. package/lib/module/assets/icons/index.js.map +1 -1
  42. package/lib/module/assets/icons/warning.svg +4 -0
  43. package/lib/module/index.js +1 -1
  44. package/lib/module/index.js.map +1 -1
  45. package/lib/module/navigation/primary-navigator.js +1 -1
  46. package/lib/module/navigation/primary-navigator.js.map +1 -1
  47. package/lib/module/screens/full-submit/accept_policy.js +1 -1
  48. package/lib/module/screens/full-submit/accept_policy.js.map +1 -1
  49. package/lib/module/screens/home/CIMBxTima.js +1 -1
  50. package/lib/module/screens/home/CIMBxTima.js.map +1 -1
  51. package/lib/module/screens/home/Store.js +1 -1
  52. package/lib/module/screens/home/Store.js.map +1 -1
  53. package/lib/module/screens/home/index.js +1 -1
  54. package/lib/module/screens/home/index.js.map +1 -1
  55. package/lib/module/screens/loginWithPassword/index.js +1 -1
  56. package/lib/module/screens/loginWithPassword/index.js.map +1 -1
  57. package/lib/module/screens/loginWithPassword/store.js +1 -1
  58. package/lib/module/screens/loginWithPassword/store.js.map +1 -1
  59. package/lib/module/screens/register/index.js +1 -1
  60. package/lib/module/screens/setPassword/confirmPassword.js +1 -1
  61. package/lib/module/screens/setPassword/confirmPassword.js.map +1 -1
  62. package/lib/module/screens/setPassword/index.js +1 -1
  63. package/lib/module/screens/setPassword/index.js.map +1 -1
  64. package/lib/module/screens/setPassword/store.js +1 -1
  65. package/lib/module/screens/setPassword/store.js.map +1 -1
  66. package/lib/typescript/assets/icons/index.d.ts +2 -1
  67. package/lib/typescript/assets/icons/index.d.ts.map +1 -1
  68. package/lib/typescript/index.d.ts.map +1 -1
  69. package/lib/typescript/screens/full-submit/accept_policy.d.ts.map +1 -1
  70. package/lib/typescript/screens/home/CIMBxTima.d.ts.map +1 -1
  71. package/lib/typescript/screens/home/Store.d.ts +2 -1
  72. package/lib/typescript/screens/home/Store.d.ts.map +1 -1
  73. package/lib/typescript/screens/home/index.d.ts.map +1 -1
  74. package/lib/typescript/screens/loginWithPassword/index.d.ts.map +1 -1
  75. package/lib/typescript/screens/loginWithPassword/store.d.ts.map +1 -1
  76. package/lib/typescript/screens/setPassword/confirmPassword.d.ts.map +1 -1
  77. package/lib/typescript/screens/setPassword/index.d.ts.map +1 -1
  78. package/package.json +1 -1
  79. package/src/assets/icons/index.tsx +2 -0
  80. package/src/assets/icons/warning.svg +4 -0
  81. package/src/index.tsx +2 -3
  82. package/src/navigation/primary-navigator.tsx +1 -1
  83. package/src/screens/full-submit/accept_policy.tsx +172 -88
  84. package/src/screens/home/CIMBxTima.tsx +10 -8
  85. package/src/screens/home/Store.tsx +6 -6
  86. package/src/screens/home/index.tsx +1010 -962
  87. package/src/screens/loginWithPassword/index.tsx +48 -47
  88. package/src/screens/loginWithPassword/store.tsx +2 -0
  89. package/src/screens/register/index.tsx +1 -1
  90. package/src/screens/setPassword/confirmPassword.tsx +6 -35
  91. package/src/screens/setPassword/index.tsx +6 -45
  92. package/src/screens/setPassword/store.tsx +2 -2
@@ -15,7 +15,11 @@ import {
15
15
  TouchableOpacity,
16
16
  View,
17
17
  } from 'react-native';
18
- import { useNavigation, StackActions } from '@react-navigation/native';
18
+ import {
19
+ useNavigation,
20
+ StackActions,
21
+ CommonActions,
22
+ } from '@react-navigation/native';
19
23
  import { observer, Observer } from 'mobx-react-lite';
20
24
  import { commonStyles } from '../CommonStyles';
21
25
  import { MText } from '../../components/MText';
@@ -74,44 +78,43 @@ const listBanners = [
74
78
  require('../../assets/img/banner2.png'),
75
79
  ];
76
80
 
81
+ let _unsubscribe;
82
+
77
83
  export const Home = observer(function Home() {
78
84
  const navigation = useNavigation();
79
85
  const [showModal, setShowModal] = useState(false);
80
86
  const [showModal2, setShowModal2] = useState(false);
81
- const [loan, setLoan] = useState(null);
82
- const [checkEKYC, setCheckEKYC] = useState(null);
87
+ const [listLoan, setListLoan] = useState<any[]>();
88
+ const [checkEKYC, setCheckEKYC] = useState<any>({});
83
89
  const [isLoading, setIsLoading] = useState(false);
84
- const [isCancel, setIsCancel] = useState(false);
85
-
90
+ const [loanCimb, setLoanCimb] = useState(null);
86
91
  const onRefresh = () => {
87
92
  setIsLoading(true);
88
93
  homeStore.getListLoan();
89
94
  homeStore.getListLoanPending(
90
95
  async (res) => {
91
- setLoan(res);
92
- homeStore.getCheckEKYC(
93
- { loanBriefId: res.id },
94
- (data) => {
95
- setCheckEKYC(!data);
96
- setIsLoading(false);
97
- },
98
- () => {
99
- setIsLoading(false);
100
- }
96
+ setListLoan(res);
97
+ Promise.all(
98
+ res?.map(async (item) => {
99
+ homeStore.getCheckEKYC({ loanBriefId: item.id }, (response) => {});
100
+ if (item?.messageErrorCIMB && item.messageErrorCIMB !== '') {
101
+ setLoanCimb(item);
102
+ setTimeout(() => {
103
+ setShowModal(true);
104
+ }, 200);
105
+ }
106
+ if (item?.typeLoan === 4 && item?.isCimbApproveFull !== null) {
107
+ const checkShow = await load(`SHOW_${item?.id}`);
108
+ if (!checkShow || checkShow !== true) {
109
+ setLoanCimb(item);
110
+ setTimeout(() => {
111
+ setShowModal2(true);
112
+ }, 200);
113
+ }
114
+ }
115
+ })
101
116
  );
102
- if (res?.messageErrorCIMB && res.messageErrorCIMB !== '') {
103
- setTimeout(() => {
104
- setShowModal(true);
105
- }, 200);
106
- }
107
- if (loan?.typeLoan === 4 && loan?.isCimbApproveFull !== null) {
108
- const checkShow = await load(`SHOW_${loan?.id}`);
109
- if (!checkShow || checkShow !== true) {
110
- setTimeout(() => {
111
- setShowModal2(true);
112
- }, 200);
113
- }
114
- }
117
+ setIsLoading(false);
115
118
  },
116
119
  () => {
117
120
  setIsLoading(false);
@@ -119,24 +122,51 @@ export const Home = observer(function Home() {
119
122
  );
120
123
  };
121
124
 
125
+ const goLogin = async () => {
126
+ const token = await load('TOKEN_TIMACARE');
127
+ if (token) {
128
+ Api.getInstance().changeAuth(token);
129
+ setTimeout(() => {
130
+ onRefresh();
131
+ }, 300);
132
+ } else {
133
+ navigation.dispatch(
134
+ CommonActions.reset({
135
+ index: 1,
136
+ routes: [{ name: ScreenNames.Register }],
137
+ })
138
+ );
139
+ }
140
+ _unsubscribe = navigation.addListener('focus', () => {
141
+ onRefresh();
142
+ });
143
+ };
144
+
122
145
  useEffect(() => {
123
- onRefresh();
146
+ goLogin();
147
+ return () => {
148
+ if (_unsubscribe) {
149
+ _unsubscribe();
150
+ }
151
+ };
124
152
  }, []);
125
153
 
126
154
  useEffect(() => {
127
- FullSubmitStore.getTypeMerried();
128
- FullSubmitStore.getListBank();
129
- FullSubmitStore.getIncomeCIMB();
130
- FullSubmitStore.getPositionCIMB();
131
- FullSubmitStore.getJobStatusCIMB();
132
- QuickSubmitStore.getJobsCIMB();
155
+ setTimeout(() => {
156
+ FullSubmitStore.getTypeMerried();
157
+ FullSubmitStore.getListBank();
158
+ FullSubmitStore.getIncomeCIMB();
159
+ FullSubmitStore.getPositionCIMB();
160
+ FullSubmitStore.getJobStatusCIMB();
161
+ QuickSubmitStore.getJobsCIMB();
162
+ }, 2000);
133
163
  }, []);
134
164
 
135
- useEffect(() => {
136
- return navigation.addListener('focus', () => {
137
- onRefresh();
138
- });
139
- }, [navigation]);
165
+ // useEffect(() => {
166
+ // return navigation.addListener('focus', () => {
167
+ // onRefresh();
168
+ // });
169
+ // }, [navigation]);
140
170
 
141
171
  const signLoan = (loan) => {
142
172
  homeStore.checkValidateESign({ loanBriefId: loan.id }, () => {
@@ -331,7 +361,7 @@ export const Home = observer(function Home() {
331
361
  >
332
362
  Danh sách đơn mới
333
363
  </MText>
334
- {loan === null ? (
364
+ {listLoan?.length === 0 ? (
335
365
  <View style={{ alignItems: 'center', marginTop: 20 }}>
336
366
  <MText style={[commonStyles.textNormal]}>
337
367
  Không có đơn vay
@@ -339,633 +369,918 @@ export const Home = observer(function Home() {
339
369
  </View>
340
370
  ) : (
341
371
  <View>
342
- {loan?.isPipelineCIMB ? (
343
- <View>
344
- {loan?.typeLoan === 4 ? (
345
- <View>
346
- <View
347
- style={{
348
- backgroundColor: '#FFFFFF',
349
- paddingHorizontal: 16,
350
- paddingTop: 16,
351
- borderRadius: 8,
352
- borderWidth: 0.5,
353
- borderColor: '#E0E0E0',
354
- }}
355
- >
356
- <View
357
- style={{
358
- flexDirection: 'row',
359
- alignItems: 'center',
360
- }}
361
- >
362
- <Contract />
363
- <View style={{ flex: 1, paddingLeft: 8 }}>
364
- <MText style={commonStyles.textNormalBold}>
365
- Mã Đơn vay-{loan?.id}
366
- </MText>
367
- <MText style={commonStyles.textNormal}>
368
- Số tiền vay (VND):{' '}
369
- {loan?.loanAmountOffer
370
- ? formatMoney(loan?.loanAmountOffer)
371
- : 'Chưa xác định'}
372
- </MText>
373
- </View>
374
- </View>
375
- <View
376
- style={{
377
- height: 1,
378
- backgroundColor: '#E0E0E0',
379
- marginVertical: 16,
380
- }}
381
- />
382
- <View
383
- style={{
384
- flexDirection: 'row',
385
- justifyContent: 'space-between',
386
- }}
387
- >
388
- <MText style={commonStyles.textNormal}>
389
- Trạng thái
390
- </MText>
391
- <MText
392
- style={[
393
- commonStyles.textNormalBold,
394
- { color: '#F05123' },
395
- ]}
396
- >
397
- {loan?.loanStatus}
398
- </MText>
399
- </View>
400
- <View
401
- style={{
402
- height: 0.5,
403
- backgroundColor: '#E0E0E0',
404
- marginVertical: 16,
405
- }}
406
- />
407
- <View style={{ flexDirection: 'row' }}>
408
- {loan?.loanStatus === null ||
409
- loan?.loanStatus === '' ? (
410
- <MButton
411
- style={{ alignItems: 'center' }}
412
- onPress={() => {
413
- navigation.dispatch(
414
- StackActions.push(ScreenNames.CIMBxTima, {
415
- loan: loan,
416
- })
417
- );
372
+ {listLoan?.map((item, index) => (
373
+ <View style={{ marginBottom: 14 }}>
374
+ <View>
375
+ {item?.isPipelineCIMB ? (
376
+ <View>
377
+ {item?.typeLoan === 4 ? (
378
+ <View>
379
+ <View
380
+ style={{
381
+ backgroundColor: '#FFFFFF',
382
+ paddingHorizontal: 16,
383
+ paddingTop: 16,
384
+ borderRadius: 8,
385
+ borderWidth: 0.5,
386
+ borderColor: '#E0E0E0',
418
387
  }}
419
388
  >
420
- <AddInfo />
421
- <MText
422
- style={[
423
- commonStyles.textNormal,
424
- {
425
- fontSize: 12,
426
- fontWeight: '300',
427
- marginTop: 8,
428
- textAlign: 'center',
429
- },
430
- ]}
389
+ <View
390
+ style={{
391
+ flexDirection: 'row',
392
+ alignItems: 'center',
393
+ }}
431
394
  >
432
- Hoàn thiện{'\n'}cung cấp thông tin
433
- </MText>
434
- </MButton>
435
- ) : (
436
- <View>
437
- {loan?.isUpdateLoan ||
438
- loan?.isUpdateInformation ? (
439
- <TouchableOpacity
440
- style={{ alignItems: 'center' }}
441
- onPress={() => {
442
- if (loan?.isUpdateLoan) {
443
- navigation.dispatch(
444
- StackActions.push(
445
- ScreenNames.CimbSelfie,
446
- {
447
- loan: loan,
448
- }
449
- )
450
- );
451
- } else {
452
- navigation.dispatch(
453
- StackActions.push(
454
- ScreenNames.QuickSubmit,
455
- {
456
- loan: loan,
457
- }
458
- )
459
- );
460
- }
461
- }}
462
- >
463
- <AddInfo />
464
- <MText
465
- style={[
466
- commonStyles.textNormal,
467
- {
468
- fontSize: 12,
469
- fontWeight: '300',
470
- marginTop: 8,
471
- textAlign: 'center',
472
- },
473
- ]}
474
- >
475
- Hoàn thiện{'\n'}cung cấp thông tin
395
+ <Contract />
396
+ <View style={{ flex: 1, paddingLeft: 8 }}>
397
+ <MText style={commonStyles.textNormalBold}>
398
+ Đơn vay-{item?.id}
476
399
  </MText>
477
- </TouchableOpacity>
478
- ) : (
479
- <View style={{ alignItems: 'center' }}>
480
- <AddInfoDisable />
481
- <MText
482
- style={[
483
- commonStyles.textNormal,
484
- {
485
- fontSize: 12,
486
- fontWeight: '300',
487
- marginTop: 8,
488
- textAlign: 'center',
489
- },
490
- ]}
491
- >
492
- Hoàn thiện{'\n'}cung cấp thông tin
400
+ <MText style={commonStyles.textNormal}>
401
+ Số tiền vay (VND):{' '}
402
+ {item?.loanAmountOffer
403
+ ? formatMoney(item?.loanAmountOffer)
404
+ : 'Chưa xác định'}
493
405
  </MText>
494
406
  </View>
495
- )}
496
- </View>
497
- )}
498
-
499
- {loan?.isSignContract && (
500
- <MButton
501
- style={{
502
- alignItems: 'center',
503
- marginLeft: 20,
504
- }}
505
- onPress={() => {
506
- if (loan?.urlSignContract) {
507
- navigation.dispatch(
508
- StackActions.push(ScreenNames.CIMBSign, {
509
- url: loan?.urlSignContract,
510
- })
511
- );
512
- } else {
513
- Alert.alert(
514
- 'Thông báo',
515
- 'Bạn chưa thể ký hợp đồng bây giờ?'
516
- );
517
- }
518
- }}
519
- >
520
- <IconSign2 />
521
- <MText
522
- style={[
523
- commonStyles.textNormal,
524
- {
525
- fontSize: 12,
526
- fontWeight: '300',
527
- marginTop: 8,
528
- },
529
- ]}
530
- >
531
- Ký hợp đồng
532
- </MText>
533
- </MButton>
534
- )}
535
- {loan?.isSignContractTima && (
536
- <MButton
537
- style={{
538
- alignItems: 'center',
539
- marginLeft: 20,
540
- }}
541
- onPress={() => {
542
- navigation.dispatch(
543
- StackActions.push(
544
- ScreenNames.ViewContract,
545
- {
546
- loan: loan,
547
- }
548
- )
549
- );
550
- }}
551
- >
552
- <ContractTimeIcon />
553
- <MText
554
- style={[
555
- commonStyles.textNormal,
556
- {
557
- fontSize: 12,
558
- fontWeight: '300',
559
- marginTop: 8,
560
- textAlign: 'center',
561
- },
562
- ]}
563
- >
564
- Hợp đồng{'\n'}dịch vụ
565
- </MText>
566
- </MButton>
567
- )}
568
- {loan?.paymentEvidenceUrl && (
569
- <MButton
570
- style={{
571
- alignItems: 'center',
572
- marginLeft: 20,
573
- }}
574
- onPress={() => {
575
- navigation.dispatch(
576
- StackActions.push(
577
- ScreenNames.PaymentEvidence,
578
- {
579
- url: loan?.paymentEvidenceUrl,
580
- }
581
- )
582
- );
583
- }}
584
- >
585
- <IconEviden />
586
- <MText
587
- style={[
588
- commonStyles.textNormal,
589
- {
590
- fontSize: 12,
591
- fontWeight: '300',
592
- marginTop: 8,
593
- textAlign: 'center',
594
- },
595
- ]}
596
- >
597
- Mục đích {'\n'}sử dụng
598
- </MText>
599
- </MButton>
600
- )}
601
- {loan?.showPaymentPlan && (
602
- <MButton
603
- style={{
604
- alignItems: 'center',
605
- marginLeft: 20,
606
- }}
607
- onPress={() => {
608
- navigation.dispatch(
609
- StackActions.push(
610
- ScreenNames.SchedulePayment,
611
- {
612
- loan: loan,
613
- }
614
- )
615
- );
616
- }}
617
- >
618
- <IconSchedule />
619
- <MText
620
- style={[
621
- commonStyles.textNormal,
622
- {
623
- fontSize: 12,
624
- fontWeight: '300',
625
- marginTop: 8,
626
- },
627
- ]}
628
- >
629
- Lịch dự kiến
630
- </MText>
631
- </MButton>
632
- )}
633
- </View>
634
-
635
- {loan.messageErrorCIMB !== '' &&
636
- loan?.messageErrorCIMB &&
637
- loan?.isCimbApproveFull === null ? (
638
- <View
639
- style={{
640
- backgroundColor: '#FBEFE7',
641
- marginHorizontal: -16,
642
- paddingVertical: 8,
643
- marginTop: 16,
644
- borderBottomRightRadius: 8,
645
- borderBottomLeftRadius: 8,
646
- paddingHorizontal: 16,
647
- }}
648
- >
649
- <View
650
- style={{
651
- flexDirection: 'row',
652
- justifyContent: 'space-between',
653
- alignItems: 'center',
654
- }}
655
- >
407
+ </View>
408
+ <View
409
+ style={{
410
+ height: 1,
411
+ backgroundColor: '#E0E0E0',
412
+ marginVertical: 16,
413
+ }}
414
+ />
656
415
  <View
657
416
  style={{
658
- flex: 1,
659
417
  flexDirection: 'row',
660
- paddingRight: 20,
418
+ justifyContent: 'space-between',
661
419
  }}
662
420
  >
663
- <Image
664
- source={require('./error.png')}
665
- style={{ width: 16, height: 16 }}
666
- />
667
- <MText style={{ marginLeft: 5 }}>
668
- Đơn vay của bạn gặp gián đoạn, vui lòng liên
669
- hệ tổng đài 1900633688
421
+ <MText style={commonStyles.textNormal}>
422
+ Trạng thái
423
+ </MText>
424
+ <MText
425
+ style={[
426
+ commonStyles.textNormalBold,
427
+ { color: '#F05123' },
428
+ ]}
429
+ >
430
+ {item?.loanStatus}
670
431
  </MText>
671
432
  </View>
672
-
673
- <TouchableOpacity
674
- onPress={() => {
675
- Linking.openURL(`tel:1900633688`);
433
+ <View
434
+ style={{
435
+ height: 0.5,
436
+ backgroundColor: '#E0E0E0',
437
+ marginVertical: 16,
676
438
  }}
677
- >
678
- <LinearGradient
679
- colors={['#FF8E4F', '#EF592E']}
680
- style={{
681
- paddingHorizontal: 10,
682
- height: 30,
683
- borderRadius: 30,
684
- justifyContent: 'center',
685
- alignItems: 'center',
686
- flexDirection: 'row',
687
- }}
688
- >
689
- <Call />
690
- <MText
439
+ />
440
+ <View style={{ flexDirection: 'row' }}>
441
+ {item?.loanStatus === null ||
442
+ item?.loanStatus === '' ? (
443
+ <MButton
444
+ style={{ alignItems: 'center' }}
445
+ onPress={() => {
446
+ navigation.dispatch(
447
+ StackActions.push(
448
+ ScreenNames.CIMBxTima,
449
+ {
450
+ loan: item,
451
+ }
452
+ )
453
+ );
454
+ }}
455
+ >
456
+ <AddInfo />
457
+ <MText
458
+ style={[
459
+ commonStyles.textNormal,
460
+ {
461
+ fontSize: 12,
462
+ fontWeight: '300',
463
+ marginTop: 8,
464
+ textAlign: 'center',
465
+ },
466
+ ]}
467
+ >
468
+ Hoàn thiện{'\n'}cung cấp thông tin
469
+ </MText>
470
+ </MButton>
471
+ ) : (
472
+ <View>
473
+ {item?.isUpdateLoan ||
474
+ item?.isUpdateInformation ? (
475
+ <TouchableOpacity
476
+ style={{ alignItems: 'center' }}
477
+ onPress={() => {
478
+ if (item?.isUpdateLoan) {
479
+ navigation.dispatch(
480
+ StackActions.push(
481
+ ScreenNames.CimbSelfie,
482
+ {
483
+ loan: item,
484
+ }
485
+ )
486
+ );
487
+ } else {
488
+ navigation.dispatch(
489
+ StackActions.push(
490
+ ScreenNames.QuickSubmit,
491
+ {
492
+ loan: item,
493
+ }
494
+ )
495
+ );
496
+ }
497
+ }}
498
+ >
499
+ <AddInfo />
500
+ <MText
501
+ style={[
502
+ commonStyles.textNormal,
503
+ {
504
+ fontSize: 12,
505
+ fontWeight: '300',
506
+ marginTop: 8,
507
+ textAlign: 'center',
508
+ },
509
+ ]}
510
+ >
511
+ Hoàn thiện{'\n'}cung cấp thông tin
512
+ </MText>
513
+ </TouchableOpacity>
514
+ ) : (
515
+ <View style={{ alignItems: 'center' }}>
516
+ <AddInfoDisable />
517
+ <MText
518
+ style={[
519
+ commonStyles.textNormal,
520
+ {
521
+ fontSize: 12,
522
+ fontWeight: '300',
523
+ marginTop: 8,
524
+ textAlign: 'center',
525
+ },
526
+ ]}
527
+ >
528
+ Hoàn thiện{'\n'}cung cấp thông tin
529
+ </MText>
530
+ </View>
531
+ )}
532
+ </View>
533
+ )}
534
+
535
+ {item?.isSignContract && (
536
+ <MButton
691
537
  style={{
692
- color: 'white',
693
- fontSize: 12,
694
- marginLeft: 5,
538
+ alignItems: 'center',
539
+ marginLeft: 20,
540
+ }}
541
+ onPress={() => {
542
+ if (item?.urlSignContract) {
543
+ navigation.dispatch(
544
+ StackActions.push(
545
+ ScreenNames.CIMBSign,
546
+ {
547
+ url: item?.urlSignContract,
548
+ }
549
+ )
550
+ );
551
+ } else {
552
+ Alert.alert(
553
+ 'Thông báo',
554
+ 'Bạn chưa thể ký hợp đồng bây giờ?'
555
+ );
556
+ }
695
557
  }}
696
558
  >
697
- Liên hệ
698
- </MText>
699
- </LinearGradient>
700
- </TouchableOpacity>
701
- </View>
702
- </View>
703
- ) : (
704
- <View
705
- style={{
706
- flexDirection: 'row',
707
- alignItems: 'center',
708
- backgroundColor: '#FBEFE7',
709
- marginHorizontal: -16,
710
- paddingVertical: 8,
711
- marginTop: 16,
712
- borderBottomRightRadius: 8,
713
- borderBottomLeftRadius: 8,
714
- paddingHorizontal: 16,
715
- }}
716
- >
717
- <Info />
718
- <MText
719
- style={[
720
- {
721
- fontWeight: '300',
722
- fontSize: 10,
723
- fontStyle: 'italic',
724
- color: '#333333',
725
- marginLeft: 8,
726
- },
727
- ]}
728
- >
729
- {loan?.suggestion
730
- ? loan?.suggestion
731
- : 'Thực hiện đầy đủ các bước để giải ngân nhanh nhất'}
732
- </MText>
733
- </View>
734
- )}
735
- </View>
736
- </View>
737
- ) : (
738
- <View>
739
- <View>
740
- {loan?.loanStatus !== null &&
741
- loan?.loanStatus !== '' ? (
742
- <View
743
- style={{
744
- backgroundColor: '#FFFFFF',
745
- paddingHorizontal: 16,
746
- paddingTop: 16,
747
- borderRadius: 8,
748
- borderWidth: 0.5,
749
- borderColor: '#E0E0E0',
750
- }}
751
- >
752
- <View
753
- style={{
754
- flexDirection: 'row',
755
- alignItems: 'center',
756
- }}
757
- >
758
- <Contract />
759
- <View style={{ flex: 1, paddingLeft: 8 }}>
760
- <MText style={commonStyles.textNormalBold}>
761
- Mã Đơn vay-{loan?.id}
762
- </MText>
763
- <MText style={commonStyles.textNormal}>
764
- Số tiền vay (VND):{' '}
765
- {loan?.loanAmountOffer
766
- ? formatMoney(loan?.loanAmountOffer)
767
- : 'Chưa xác định'}
768
- </MText>
769
- </View>
770
- </View>
771
- <View
772
- style={{
773
- height: 1,
774
- backgroundColor: '#E0E0E0',
775
- marginVertical: 16,
776
- }}
777
- />
778
- <View
779
- style={{
780
- flexDirection: 'row',
781
- justifyContent: 'space-between',
782
- }}
783
- >
784
- <MText style={commonStyles.textNormal}>
785
- Trạng thái
786
- </MText>
787
- <MText
788
- style={[
789
- commonStyles.textNormalBold,
790
- { color: '#F05123' },
791
- ]}
792
- >
793
- {loan?.loanStatus}
794
- </MText>
795
- </View>
796
- <View
797
- style={{
798
- height: 0.5,
799
- backgroundColor: '#E0E0E0',
800
- marginVertical: 16,
801
- }}
802
- />
803
- <View style={{ flexDirection: 'row' }}>
804
- {loan?.isUpdateLoan ||
805
- loan?.isUpdateInformation ? (
806
- <TouchableOpacity
807
- style={{ alignItems: 'center' }}
808
- onPress={() => {
809
- if (loan?.isUpdateLoan) {
559
+ <IconSign2 />
560
+ <MText
561
+ style={[
562
+ commonStyles.textNormal,
563
+ {
564
+ fontSize: 12,
565
+ fontWeight: '300',
566
+ marginTop: 8,
567
+ },
568
+ ]}
569
+ >
570
+ hợp đồng
571
+ </MText>
572
+ </MButton>
573
+ )}
574
+ {item?.isSignContractTima && (
575
+ <MButton
576
+ style={{
577
+ alignItems: 'center',
578
+ marginLeft: 20,
579
+ }}
580
+ onPress={() => {
810
581
  navigation.dispatch(
811
582
  StackActions.push(
812
- ScreenNames.CimbSelfie,
583
+ ScreenNames.ViewContract,
813
584
  {
814
- loan: loan,
585
+ loan: item,
815
586
  }
816
587
  )
817
588
  );
818
- } else {
589
+ }}
590
+ >
591
+ <ContractTimeIcon />
592
+ <MText
593
+ style={[
594
+ commonStyles.textNormal,
595
+ {
596
+ fontSize: 12,
597
+ fontWeight: '300',
598
+ marginTop: 8,
599
+ textAlign: 'center',
600
+ },
601
+ ]}
602
+ >
603
+ Hợp đồng{'\n'}dịch vụ
604
+ </MText>
605
+ </MButton>
606
+ )}
607
+ {item?.paymentEvidenceUrl && (
608
+ <MButton
609
+ style={{
610
+ alignItems: 'center',
611
+ marginLeft: 20,
612
+ }}
613
+ onPress={() => {
819
614
  navigation.dispatch(
820
615
  StackActions.push(
821
- ScreenNames.QuickSubmit,
616
+ ScreenNames.PaymentEvidence,
822
617
  {
823
- loan: loan,
618
+ url: item?.paymentEvidenceUrl,
824
619
  }
825
620
  )
826
621
  );
827
- }
828
- }}
829
- >
830
- <AddInfo />
831
- <MText
832
- style={[
833
- commonStyles.textNormal,
834
- {
835
- fontSize: 12,
836
- fontWeight: '300',
837
- marginTop: 8,
838
- textAlign: 'center',
839
- },
840
- ]}
841
- >
842
- Hoàn thiện{'\n'}cung cấp thông tin
843
- </MText>
844
- </TouchableOpacity>
845
- ) : (
846
- <View style={{ alignItems: 'center' }}>
847
- <AddInfoDisable />
848
- <MText
849
- style={[
850
- commonStyles.textNormal,
851
- {
852
- fontSize: 12,
853
- fontWeight: '300',
854
- marginTop: 8,
855
- textAlign: 'center',
856
- },
857
- ]}
622
+ }}
858
623
  >
859
- Hoàn thiện{'\n'}cung cấp thông tin
860
- </MText>
861
- </View>
862
- )}
863
- {loan?.isSignContract && (
864
- <TouchableOpacity
865
- style={{
866
- alignItems: 'center',
867
- marginLeft: 20,
868
- }}
869
- onPress={() => {
870
- if (loan?.urlSignContract) {
624
+ <IconEviden />
625
+ <MText
626
+ style={[
627
+ commonStyles.textNormal,
628
+ {
629
+ fontSize: 12,
630
+ fontWeight: '300',
631
+ marginTop: 8,
632
+ textAlign: 'center',
633
+ },
634
+ ]}
635
+ >
636
+ Mục đích {'\n'}sử dụng
637
+ </MText>
638
+ </MButton>
639
+ )}
640
+ {item?.showPaymentPlan && (
641
+ <MButton
642
+ style={{
643
+ alignItems: 'center',
644
+ marginLeft: 20,
645
+ }}
646
+ onPress={() => {
871
647
  navigation.dispatch(
872
648
  StackActions.push(
873
- ScreenNames.CIMBSign,
649
+ ScreenNames.SchedulePayment,
874
650
  {
875
- url: loan?.urlSignContract,
651
+ loan: item,
876
652
  }
877
653
  )
878
654
  );
879
- } else {
880
- Alert.alert(
881
- 'Thông báo',
882
- 'Bạn chưa thể ký hợp đồng bây giờ?'
883
- );
884
- }
655
+ }}
656
+ >
657
+ <IconSchedule />
658
+ <MText
659
+ style={[
660
+ commonStyles.textNormal,
661
+ {
662
+ fontSize: 12,
663
+ fontWeight: '300',
664
+ marginTop: 8,
665
+ },
666
+ ]}
667
+ >
668
+ Lịch dự kiến
669
+ </MText>
670
+ </MButton>
671
+ )}
672
+ </View>
673
+
674
+ {item.messageErrorCIMB !== '' &&
675
+ item?.messageErrorCIMB &&
676
+ item?.isCimbApproveFull === null ? (
677
+ <View
678
+ style={{
679
+ backgroundColor: '#FBEFE7',
680
+ marginHorizontal: -16,
681
+ paddingVertical: 8,
682
+ marginTop: 16,
683
+ borderBottomRightRadius: 8,
684
+ borderBottomLeftRadius: 8,
685
+ paddingHorizontal: 16,
885
686
  }}
886
687
  >
887
- <IconSign2 />
888
- <MText
889
- style={[
890
- commonStyles.textNormal,
891
- {
892
- fontSize: 12,
893
- fontWeight: '300',
894
- marginTop: 8,
895
- },
896
- ]}
688
+ <View
689
+ style={{
690
+ flexDirection: 'row',
691
+ justifyContent: 'space-between',
692
+ alignItems: 'center',
693
+ }}
897
694
  >
898
- Ký hợp đồng
899
- </MText>
900
- </TouchableOpacity>
901
- )}
902
- {loan?.isSignContractTima && (
903
- <TouchableOpacity
695
+ <View
696
+ style={{
697
+ flex: 1,
698
+ flexDirection: 'row',
699
+ paddingRight: 20,
700
+ }}
701
+ >
702
+ <Image
703
+ source={require('./error.png')}
704
+ style={{ width: 16, height: 16 }}
705
+ />
706
+ <MText style={{ marginLeft: 5 }}>
707
+ Đơn vay của bạn gặp gián đoạn, vui
708
+ lòng liên hệ tổng đài 1900633688
709
+ </MText>
710
+ </View>
711
+
712
+ <TouchableOpacity
713
+ onPress={() => {
714
+ Linking.openURL(`tel:1900633688`);
715
+ }}
716
+ >
717
+ <LinearGradient
718
+ colors={['#FF8E4F', '#EF592E']}
719
+ style={{
720
+ paddingHorizontal: 10,
721
+ height: 30,
722
+ borderRadius: 30,
723
+ justifyContent: 'center',
724
+ alignItems: 'center',
725
+ flexDirection: 'row',
726
+ }}
727
+ >
728
+ <Call />
729
+ <MText
730
+ style={{
731
+ color: 'white',
732
+ fontSize: 12,
733
+ marginLeft: 5,
734
+ }}
735
+ >
736
+ Liên hệ
737
+ </MText>
738
+ </LinearGradient>
739
+ </TouchableOpacity>
740
+ </View>
741
+ </View>
742
+ ) : (
743
+ <View
904
744
  style={{
745
+ flexDirection: 'row',
905
746
  alignItems: 'center',
906
- marginLeft: 20,
907
- }}
908
- onPress={() => {
909
- navigation.dispatch(
910
- StackActions.push(
911
- ScreenNames.ViewContract,
912
- {
913
- loan: loan,
914
- }
915
- )
916
- );
747
+ backgroundColor: '#FBEFE7',
748
+ marginHorizontal: -16,
749
+ paddingVertical: 8,
750
+ marginTop: 16,
751
+ borderBottomRightRadius: 8,
752
+ borderBottomLeftRadius: 8,
753
+ paddingHorizontal: 16,
917
754
  }}
918
755
  >
919
- <ContractTimeIcon />
756
+ <Info />
920
757
  <MText
921
758
  style={[
922
- commonStyles.textNormal,
923
759
  {
924
- fontSize: 12,
925
760
  fontWeight: '300',
926
- marginTop: 8,
927
- textAlign: 'center',
761
+ fontSize: 10,
762
+ fontStyle: 'italic',
763
+ color: '#333333',
764
+ marginLeft: 8,
928
765
  },
929
766
  ]}
930
767
  >
931
- Hợp đồng{'\n'}dịch vụ
768
+ {item?.suggestion
769
+ ? item?.suggestion
770
+ : 'Thực hiện đầy đủ các bước để giải ngân nhanh nhất'}
932
771
  </MText>
933
- </TouchableOpacity>
772
+ </View>
934
773
  )}
935
- {loan?.paymentEvidenceUrl && (
936
- <TouchableOpacity
774
+ </View>
775
+ </View>
776
+ ) : (
777
+ <View>
778
+ <View>
779
+ {item?.loanStatus !== null &&
780
+ item?.loanStatus !== '' ? (
781
+ <View
937
782
  style={{
938
- alignItems: 'center',
939
- marginLeft: 20,
783
+ backgroundColor: '#FFFFFF',
784
+ paddingHorizontal: 16,
785
+ paddingTop: 16,
786
+ borderRadius: 8,
787
+ borderWidth: 0.5,
788
+ borderColor: '#E0E0E0',
940
789
  }}
941
- onPress={() => {
942
- navigation.dispatch(
943
- StackActions.push(
944
- ScreenNames.PaymentEvidence,
790
+ >
791
+ <View
792
+ style={{
793
+ flexDirection: 'row',
794
+ alignItems: 'center',
795
+ }}
796
+ >
797
+ <Contract />
798
+ <View style={{ flex: 1, paddingLeft: 8 }}>
799
+ <MText
800
+ style={commonStyles.textNormalBold}
801
+ >
802
+ Mã Đơn vay-{item?.id}
803
+ </MText>
804
+ <MText style={commonStyles.textNormal}>
805
+ Số tiền vay (VND):{' '}
806
+ {item?.loanAmountOffer
807
+ ? formatMoney(item?.loanAmountOffer)
808
+ : 'Chưa xác định'}
809
+ </MText>
810
+ </View>
811
+ </View>
812
+ <View
813
+ style={{
814
+ height: 1,
815
+ backgroundColor: '#E0E0E0',
816
+ marginVertical: 16,
817
+ }}
818
+ />
819
+ <View
820
+ style={{
821
+ flexDirection: 'row',
822
+ justifyContent: 'space-between',
823
+ }}
824
+ >
825
+ <MText style={commonStyles.textNormal}>
826
+ Trạng thái
827
+ </MText>
828
+ <MText
829
+ style={[
830
+ commonStyles.textNormalBold,
831
+ { color: '#F05123' },
832
+ ]}
833
+ >
834
+ {item?.loanStatus}
835
+ </MText>
836
+ </View>
837
+ <View
838
+ style={{
839
+ height: 0.5,
840
+ backgroundColor: '#E0E0E0',
841
+ marginVertical: 16,
842
+ }}
843
+ />
844
+ <View style={{ flexDirection: 'row' }}>
845
+ {item?.isUpdateLoan ||
846
+ item?.isUpdateInformation ? (
847
+ <TouchableOpacity
848
+ style={{ alignItems: 'center' }}
849
+ onPress={() => {
850
+ if (item?.isUpdateLoan) {
851
+ navigation.dispatch(
852
+ StackActions.push(
853
+ ScreenNames.CimbSelfie,
854
+ {
855
+ loan: item,
856
+ }
857
+ )
858
+ );
859
+ } else {
860
+ navigation.dispatch(
861
+ StackActions.push(
862
+ ScreenNames.QuickSubmit,
863
+ {
864
+ loan: item,
865
+ }
866
+ )
867
+ );
868
+ }
869
+ }}
870
+ >
871
+ <AddInfo />
872
+ <MText
873
+ style={[
874
+ commonStyles.textNormal,
875
+ {
876
+ fontSize: 12,
877
+ fontWeight: '300',
878
+ marginTop: 8,
879
+ textAlign: 'center',
880
+ },
881
+ ]}
882
+ >
883
+ Hoàn thiện{'\n'}cung cấp thông tin
884
+ </MText>
885
+ </TouchableOpacity>
886
+ ) : (
887
+ <View style={{ alignItems: 'center' }}>
888
+ <AddInfoDisable />
889
+ <MText
890
+ style={[
891
+ commonStyles.textNormal,
892
+ {
893
+ fontSize: 12,
894
+ fontWeight: '300',
895
+ marginTop: 8,
896
+ textAlign: 'center',
897
+ },
898
+ ]}
899
+ >
900
+ Hoàn thiện{'\n'}cung cấp thông tin
901
+ </MText>
902
+ </View>
903
+ )}
904
+ {item?.isSignContract && (
905
+ <TouchableOpacity
906
+ style={{
907
+ alignItems: 'center',
908
+ marginLeft: 20,
909
+ }}
910
+ onPress={() => {
911
+ if (item?.urlSignContract) {
912
+ navigation.dispatch(
913
+ StackActions.push(
914
+ ScreenNames.CIMBSign,
915
+ {
916
+ url: item?.urlSignContract,
917
+ }
918
+ )
919
+ );
920
+ } else {
921
+ Alert.alert(
922
+ 'Thông báo',
923
+ 'Bạn chưa thể ký hợp đồng bây giờ?'
924
+ );
925
+ }
926
+ }}
927
+ >
928
+ <IconSign2 />
929
+ <MText
930
+ style={[
931
+ commonStyles.textNormal,
932
+ {
933
+ fontSize: 12,
934
+ fontWeight: '300',
935
+ marginTop: 8,
936
+ },
937
+ ]}
938
+ >
939
+ Ký hợp đồng
940
+ </MText>
941
+ </TouchableOpacity>
942
+ )}
943
+ {item?.isSignContractTima && (
944
+ <TouchableOpacity
945
+ style={{
946
+ alignItems: 'center',
947
+ marginLeft: 20,
948
+ }}
949
+ onPress={() => {
950
+ navigation.dispatch(
951
+ StackActions.push(
952
+ ScreenNames.ViewContract,
953
+ {
954
+ loan: item,
955
+ }
956
+ )
957
+ );
958
+ }}
959
+ >
960
+ <ContractTimeIcon />
961
+ <MText
962
+ style={[
963
+ commonStyles.textNormal,
964
+ {
965
+ fontSize: 12,
966
+ fontWeight: '300',
967
+ marginTop: 8,
968
+ textAlign: 'center',
969
+ },
970
+ ]}
971
+ >
972
+ Hợp đồng{'\n'}dịch vụ
973
+ </MText>
974
+ </TouchableOpacity>
975
+ )}
976
+ {item?.paymentEvidenceUrl && (
977
+ <TouchableOpacity
978
+ style={{
979
+ alignItems: 'center',
980
+ marginLeft: 20,
981
+ }}
982
+ onPress={() => {
983
+ navigation.dispatch(
984
+ StackActions.push(
985
+ ScreenNames.PaymentEvidence,
986
+ {
987
+ url: item?.paymentEvidenceUrl,
988
+ }
989
+ )
990
+ );
991
+ }}
992
+ >
993
+ <IconEviden />
994
+ <MText
995
+ style={[
996
+ commonStyles.textNormal,
997
+ {
998
+ fontSize: 12,
999
+ fontWeight: '300',
1000
+ marginTop: 8,
1001
+ textAlign: 'center',
1002
+ },
1003
+ ]}
1004
+ >
1005
+ Mục đích {'\n'}sử dụng
1006
+ </MText>
1007
+ </TouchableOpacity>
1008
+ )}
1009
+ {item?.showPaymentPlan && (
1010
+ <TouchableOpacity
1011
+ style={{
1012
+ alignItems: 'center',
1013
+ marginLeft: 20,
1014
+ }}
1015
+ onPress={() => {
1016
+ navigation.dispatch(
1017
+ StackActions.push(
1018
+ ScreenNames.SchedulePayment,
1019
+ {
1020
+ loan: item,
1021
+ }
1022
+ )
1023
+ );
1024
+ }}
1025
+ >
1026
+ <IconSchedule />
1027
+ <MText
1028
+ style={[
1029
+ commonStyles.textNormal,
1030
+ {
1031
+ fontSize: 12,
1032
+ fontWeight: '300',
1033
+ marginTop: 8,
1034
+ },
1035
+ ]}
1036
+ >
1037
+ Lịch dự kiến
1038
+ </MText>
1039
+ </TouchableOpacity>
1040
+ )}
1041
+ </View>
1042
+
1043
+ <View
1044
+ style={{
1045
+ flexDirection: 'row',
1046
+ alignItems: 'center',
1047
+ backgroundColor: '#FBEFE7',
1048
+ marginHorizontal: -16,
1049
+ paddingVertical: 8,
1050
+ marginTop: 16,
1051
+ borderBottomRightRadius: 8,
1052
+ borderBottomLeftRadius: 8,
1053
+ paddingHorizontal: 16,
1054
+ }}
1055
+ >
1056
+ <Info />
1057
+ <MText
1058
+ style={[
945
1059
  {
946
- url: loan?.paymentEvidenceUrl,
947
- }
948
- )
949
- );
950
- }}
1060
+ fontWeight: '300',
1061
+ fontSize: 10,
1062
+ fontStyle: 'italic',
1063
+ color: '#333333',
1064
+ marginLeft: 8,
1065
+ },
1066
+ ]}
1067
+ >
1068
+ {item?.suggestion
1069
+ ? item?.suggestion
1070
+ : 'Thực hiện đầy đủ các bước để giải ngân nhanh nhất'}
1071
+ </MText>
1072
+ </View>
1073
+ </View>
1074
+ ) : (
1075
+ <ImageBackground
1076
+ source={require('../../assets/img/bann.png')}
1077
+ style={{ flex: 1, padding: 16 }}
1078
+ resizeMode="cover"
1079
+ height={220}
1080
+ borderRadius={8}
951
1081
  >
952
- <IconEviden />
953
1082
  <MText
954
- style={[
955
- commonStyles.textNormal,
956
- {
957
- fontSize: 12,
958
- fontWeight: '300',
959
- marginTop: 8,
960
- textAlign: 'center',
961
- },
962
- ]}
1083
+ style={{
1084
+ color: '#333333',
1085
+ fontWeight: 'bold',
1086
+ fontSize: 12,
1087
+ }}
963
1088
  >
964
- Mục đích {'\n'}sử dụng
1089
+ BẠN ĐỦ ĐIỀU KIỆN VAY TIÊU DÙNG{'\n'}THEO
1090
+ THÔNG TIN TÀI SẢN SỞ HỮU
1091
+ {'\n'}
1092
+ (XE MÁY/ Ô TÔ)
965
1093
  </MText>
966
- </TouchableOpacity>
1094
+ <MText
1095
+ style={{
1096
+ marginTop: 12,
1097
+ fontSize: 24,
1098
+ fontWeight: 'bold',
1099
+ color: '#EF4123',
1100
+ }}
1101
+ >
1102
+ {formatMoney(item?.loanAmount)} VND
1103
+ </MText>
1104
+ <TouchableOpacity
1105
+ onPress={() => {
1106
+ navigation.dispatch(
1107
+ StackActions.push(
1108
+ ScreenNames.CIMBxTima,
1109
+ {
1110
+ loan: item,
1111
+ }
1112
+ )
1113
+ );
1114
+ }}
1115
+ >
1116
+ <LinearGradient
1117
+ colors={['#FF7A00', '#EF4123']}
1118
+ style={{
1119
+ backgroundColor: '#F36D21cd ',
1120
+ marginTop: 12,
1121
+ alignItems: 'center',
1122
+ borderRadius: 30,
1123
+ paddingVertical: 10,
1124
+ width: '50%',
1125
+ }}
1126
+ >
1127
+ <MText
1128
+ style={{
1129
+ color: '#FFFFFF',
1130
+ fontWeight: 'bold',
1131
+ }}
1132
+ >
1133
+ Hoàn thiện hồ sơ
1134
+ </MText>
1135
+ </LinearGradient>
1136
+ </TouchableOpacity>
1137
+ <View
1138
+ style={{
1139
+ flexDirection: 'row',
1140
+ alignItems: 'center',
1141
+ alignContent: 'center',
1142
+ marginTop: 16,
1143
+ }}
1144
+ >
1145
+ <MText
1146
+ style={{
1147
+ fontSize: 10,
1148
+ color: '#333333',
1149
+ }}
1150
+ >
1151
+ SẢN PHẨM VAY TIÊU DÙNG HỢP TÁC GIỮA{' '}
1152
+ </MText>
1153
+ <LogoSmall />
1154
+ <MText
1155
+ style={{
1156
+ fontSize: 12,
1157
+ color: '#333333',
1158
+ }}
1159
+ >
1160
+ {' '}
1161
+ VÀ{' '}
1162
+ </MText>
1163
+ <CIMBSmall />
1164
+ </View>
1165
+ </ImageBackground>
967
1166
  )}
968
- {loan?.showPaymentPlan && (
1167
+ </View>
1168
+ </View>
1169
+ )}
1170
+ </View>
1171
+ ) : (
1172
+ <Observer>
1173
+ {() => (
1174
+ <View>
1175
+ <View
1176
+ style={{
1177
+ backgroundColor: '#FFFFFF',
1178
+ paddingHorizontal: 16,
1179
+ paddingTop: 16,
1180
+ borderRadius: 8,
1181
+ borderWidth: 0.5,
1182
+ borderColor: '#E0E0E0',
1183
+ }}
1184
+ >
1185
+ <View
1186
+ style={{
1187
+ flexDirection: 'row',
1188
+ alignItems: 'center',
1189
+ }}
1190
+ >
1191
+ <Contract />
1192
+ <View style={{ flex: 1, paddingLeft: 8 }}>
1193
+ <MText style={commonStyles.textNormalBold}>
1194
+ Đơn vay {item?.id}
1195
+ </MText>
1196
+ <MText style={commonStyles.textNormal}>
1197
+ Số tiền vay (VND):{' '}
1198
+ {item?.loanAmount
1199
+ ? formatMoney(item?.loanAmount)
1200
+ : 'Chưa xác định'}
1201
+ </MText>
1202
+ </View>
1203
+ </View>
1204
+ <View
1205
+ style={{
1206
+ height: 1,
1207
+ backgroundColor: '#E0E0E0',
1208
+ marginVertical: 16,
1209
+ }}
1210
+ />
1211
+ <View
1212
+ style={{
1213
+ flexDirection: 'row',
1214
+ justifyContent: 'space-between',
1215
+ }}
1216
+ >
1217
+ <MText style={commonStyles.textNormal}>
1218
+ Trạng thái
1219
+ </MText>
1220
+ <MText
1221
+ style={[
1222
+ commonStyles.textNormalBold,
1223
+ { color: '#F05123' },
1224
+ ]}
1225
+ >
1226
+ {item?.loanStatus}
1227
+ </MText>
1228
+ </View>
1229
+ <View
1230
+ style={{
1231
+ height: 0.5,
1232
+ backgroundColor: '#E0E0E0',
1233
+ marginVertical: 16,
1234
+ }}
1235
+ />
1236
+ <View style={{ flexDirection: 'row' }}>
1237
+ {!homeStore.checkEKYC[item?.id] ? (
1238
+ <TouchableOpacity
1239
+ style={{ alignItems: 'center' }}
1240
+ onPress={() => {
1241
+ navigation.dispatch(
1242
+ StackActions.push(
1243
+ ScreenNames.NationalID,
1244
+ {
1245
+ loan: item,
1246
+ reLoan: true,
1247
+ }
1248
+ )
1249
+ );
1250
+ }}
1251
+ >
1252
+ <AddInfo />
1253
+ <MText
1254
+ style={[
1255
+ commonStyles.textNormal,
1256
+ {
1257
+ fontSize: 12,
1258
+ fontWeight: '300',
1259
+ marginTop: 8,
1260
+ },
1261
+ ]}
1262
+ >
1263
+ EKYC
1264
+ </MText>
1265
+ </TouchableOpacity>
1266
+ ) : (
1267
+ <View style={{ alignItems: 'center' }}>
1268
+ <AddInfoDisable />
1269
+ <MText
1270
+ style={[
1271
+ commonStyles.textNormal,
1272
+ {
1273
+ fontSize: 12,
1274
+ fontWeight: '300',
1275
+ marginTop: 8,
1276
+ },
1277
+ ]}
1278
+ >
1279
+ EKYC
1280
+ </MText>
1281
+ </View>
1282
+ )}
1283
+
969
1284
  <TouchableOpacity
970
1285
  style={{
971
1286
  alignItems: 'center',
@@ -973,16 +1288,13 @@ export const Home = observer(function Home() {
973
1288
  }}
974
1289
  onPress={() => {
975
1290
  navigation.dispatch(
976
- StackActions.push(
977
- ScreenNames.SchedulePayment,
978
- {
979
- loan: loan,
980
- }
981
- )
1291
+ StackActions.push(ScreenNames.Video, {
1292
+ loan: item,
1293
+ })
982
1294
  );
983
1295
  }}
984
1296
  >
985
- <IconSchedule />
1297
+ <IconVideo />
986
1298
  <MText
987
1299
  style={[
988
1300
  commonStyles.textNormal,
@@ -993,349 +1305,94 @@ export const Home = observer(function Home() {
993
1305
  },
994
1306
  ]}
995
1307
  >
996
- Lịch dự kiến
1308
+ Quay video
997
1309
  </MText>
998
1310
  </TouchableOpacity>
999
- )}
1000
- </View>
1001
1311
 
1002
- <View
1003
- style={{
1004
- flexDirection: 'row',
1005
- alignItems: 'center',
1006
- backgroundColor: '#FBEFE7',
1007
- marginHorizontal: -16,
1008
- paddingVertical: 8,
1009
- marginTop: 16,
1010
- borderBottomRightRadius: 8,
1011
- borderBottomLeftRadius: 8,
1012
- paddingHorizontal: 16,
1013
- }}
1014
- >
1015
- <Info />
1016
- <MText
1017
- style={[
1018
- {
1019
- fontWeight: '300',
1020
- fontSize: 10,
1021
- fontStyle: 'italic',
1022
- color: '#333333',
1023
- marginLeft: 8,
1024
- },
1025
- ]}
1026
- >
1027
- {loan?.suggestion
1028
- ? loan?.suggestion
1029
- : 'Thực hiện đầy đủ các bước để giải ngân nhanh nhất'}
1030
- </MText>
1031
- </View>
1032
- </View>
1033
- ) : (
1034
- <ImageBackground
1035
- source={require('../../assets/img/bann.png')}
1036
- style={{ flex: 1, padding: 16 }}
1037
- resizeMode="cover"
1038
- height={220}
1039
- borderRadius={8}
1040
- >
1041
- <MText
1042
- style={{
1043
- color: '#333333',
1044
- fontWeight: 'bold',
1045
- fontSize: 12,
1046
- }}
1047
- >
1048
- BẠN ĐỦ ĐIỀU KIỆN VAY TIÊU DÙNG{'\n'}THEO THÔNG
1049
- TIN TÀI SẢN SỞ HỮU
1050
- {'\n'}
1051
- (XE MÁY/ Ô TÔ)
1052
- </MText>
1053
- <MText
1054
- style={{
1055
- marginTop: 12,
1056
- fontSize: 24,
1057
- fontWeight: 'bold',
1058
- color: '#EF4123',
1059
- }}
1060
- >
1061
- {formatMoney(loan?.loanAmount)} VND
1062
- </MText>
1063
- <TouchableOpacity
1064
- onPress={() => {
1065
- navigation.dispatch(
1066
- StackActions.push(ScreenNames.CIMBxTima, {
1067
- loan: loan,
1068
- })
1069
- );
1070
- }}
1071
- >
1072
- <LinearGradient
1073
- colors={['#FF7A00', '#EF4123']}
1312
+ {homeStore.checkEKYC[item?.id] ? (
1313
+ <TouchableOpacity
1314
+ style={{
1315
+ alignItems: 'center',
1316
+ marginLeft: 20,
1317
+ }}
1318
+ onPress={() => {
1319
+ signLoan(item);
1320
+ }}
1321
+ >
1322
+ <IconSign2 />
1323
+ <MText
1324
+ style={[
1325
+ commonStyles.textNormal,
1326
+ {
1327
+ fontSize: 12,
1328
+ fontWeight: '300',
1329
+ marginTop: 8,
1330
+ },
1331
+ ]}
1332
+ >
1333
+
1334
+ </MText>
1335
+ </TouchableOpacity>
1336
+ ) : (
1337
+ <View
1338
+ style={{
1339
+ alignItems: 'center',
1340
+ marginLeft: 20,
1341
+ }}
1342
+ >
1343
+ <SignDisable />
1344
+ <MText
1345
+ style={[
1346
+ commonStyles.textNormal,
1347
+ {
1348
+ fontSize: 12,
1349
+ fontWeight: '300',
1350
+ marginTop: 8,
1351
+ },
1352
+ ]}
1353
+ >
1354
+
1355
+ </MText>
1356
+ </View>
1357
+ )}
1358
+ </View>
1359
+ <View
1074
1360
  style={{
1075
- backgroundColor: '#F36D21cd ',
1076
- marginTop: 12,
1361
+ flexDirection: 'row',
1077
1362
  alignItems: 'center',
1078
- borderRadius: 30,
1079
- paddingVertical: 10,
1080
- width: '50%',
1363
+ backgroundColor: '#FBEFE7',
1364
+ marginHorizontal: -16,
1365
+ paddingVertical: 8,
1366
+ marginTop: 16,
1367
+ borderBottomRightRadius: 8,
1368
+ borderBottomLeftRadius: 8,
1369
+ paddingHorizontal: 16,
1081
1370
  }}
1082
1371
  >
1372
+ <Info />
1083
1373
  <MText
1084
- style={{
1085
- color: '#FFFFFF',
1086
- fontWeight: 'bold',
1087
- }}
1374
+ style={[
1375
+ {
1376
+ fontWeight: '300',
1377
+ fontSize: 12,
1378
+ fontStyle: 'italic',
1379
+ color: '#333333',
1380
+ marginLeft: 8,
1381
+ },
1382
+ ]}
1088
1383
  >
1089
- Hoàn thiện hồ
1384
+ Thực hiện đầy đủ các bước để giải ngân nhanh
1385
+ nhất
1090
1386
  </MText>
1091
- </LinearGradient>
1092
- </TouchableOpacity>
1093
- <View
1094
- style={{
1095
- flexDirection: 'row',
1096
- alignItems: 'center',
1097
- alignContent: 'center',
1098
- marginTop: 16,
1099
- }}
1100
- >
1101
- <MText
1102
- style={{ fontSize: 10, color: '#333333' }}
1103
- >
1104
- SẢN PHẨM VAY TIÊU DÙNG HỢP TÁC GIỮA{' '}
1105
- </MText>
1106
- <LogoSmall />
1107
- <MText
1108
- style={{ fontSize: 12, color: '#333333' }}
1109
- >
1110
- {' '}
1111
- VÀ{' '}
1112
- </MText>
1113
- <CIMBSmall />
1387
+ </View>
1114
1388
  </View>
1115
- </ImageBackground>
1389
+ </View>
1116
1390
  )}
1117
- </View>
1118
- </View>
1119
- )}
1391
+ </Observer>
1392
+ )}
1393
+ </View>
1120
1394
  </View>
1121
- ) : (
1122
- <Observer>
1123
- {() => (
1124
- <View>
1125
- <View
1126
- style={{
1127
- backgroundColor: '#FFFFFF',
1128
- paddingHorizontal: 16,
1129
- paddingTop: 16,
1130
- borderRadius: 8,
1131
- borderWidth: 0.5,
1132
- borderColor: '#E0E0E0',
1133
- }}
1134
- >
1135
- <View
1136
- style={{
1137
- flexDirection: 'row',
1138
- alignItems: 'center',
1139
- }}
1140
- >
1141
- <Contract />
1142
- <View style={{ flex: 1, paddingLeft: 8 }}>
1143
- <MText style={commonStyles.textNormalBold}>
1144
- Đơn vay {loan?.id}
1145
- </MText>
1146
- <MText style={commonStyles.textNormal}>
1147
- Số tiền vay (VND):{' '}
1148
- {loan?.loanAmount
1149
- ? formatMoney(loan?.loanAmount)
1150
- : 'Chưa xác định'}
1151
- </MText>
1152
- </View>
1153
- </View>
1154
- <View
1155
- style={{
1156
- height: 1,
1157
- backgroundColor: '#E0E0E0',
1158
- marginVertical: 16,
1159
- }}
1160
- />
1161
- <View
1162
- style={{
1163
- flexDirection: 'row',
1164
- justifyContent: 'space-between',
1165
- }}
1166
- >
1167
- <MText style={commonStyles.textNormal}>
1168
- Trạng thái
1169
- </MText>
1170
- <MText
1171
- style={[
1172
- commonStyles.textNormalBold,
1173
- { color: '#F05123' },
1174
- ]}
1175
- >
1176
- {loan?.loanStatus}
1177
- </MText>
1178
- </View>
1179
- <View
1180
- style={{
1181
- height: 0.5,
1182
- backgroundColor: '#E0E0E0',
1183
- marginVertical: 16,
1184
- }}
1185
- />
1186
- <View style={{ flexDirection: 'row' }}>
1187
- {!checkEKYC ? (
1188
- <TouchableOpacity
1189
- style={{ alignItems: 'center' }}
1190
- onPress={() => {
1191
- navigation.dispatch(
1192
- StackActions.push(ScreenNames.NationalID, {
1193
- loan: loan,
1194
- reLoan: true,
1195
- })
1196
- );
1197
- }}
1198
- >
1199
- <AddInfo />
1200
- <MText
1201
- style={[
1202
- commonStyles.textNormal,
1203
- {
1204
- fontSize: 12,
1205
- fontWeight: '300',
1206
- marginTop: 8,
1207
- },
1208
- ]}
1209
- >
1210
- EKYC
1211
- </MText>
1212
- </TouchableOpacity>
1213
- ) : (
1214
- <View style={{ alignItems: 'center' }}>
1215
- <AddInfoDisable />
1216
- <MText
1217
- style={[
1218
- commonStyles.textNormal,
1219
- {
1220
- fontSize: 12,
1221
- fontWeight: '300',
1222
- marginTop: 8,
1223
- },
1224
- ]}
1225
- >
1226
- EKYC
1227
- </MText>
1228
- </View>
1229
- )}
1230
-
1231
- <TouchableOpacity
1232
- style={{
1233
- alignItems: 'center',
1234
- marginLeft: 20,
1235
- }}
1236
- onPress={() => {
1237
- navigation.dispatch(
1238
- StackActions.push(ScreenNames.Video, {
1239
- loan: loan,
1240
- })
1241
- );
1242
- }}
1243
- >
1244
- <IconVideo />
1245
- <MText
1246
- style={[
1247
- commonStyles.textNormal,
1248
- {
1249
- fontSize: 12,
1250
- fontWeight: '300',
1251
- marginTop: 8,
1252
- },
1253
- ]}
1254
- >
1255
- Quay video
1256
- </MText>
1257
- </TouchableOpacity>
1258
-
1259
- {checkEKYC ? (
1260
- <TouchableOpacity
1261
- style={{
1262
- alignItems: 'center',
1263
- marginLeft: 20,
1264
- }}
1265
- onPress={() => {
1266
- signLoan(loan);
1267
- }}
1268
- >
1269
- <IconSign2 />
1270
- <MText
1271
- style={[
1272
- commonStyles.textNormal,
1273
- {
1274
- fontSize: 12,
1275
- fontWeight: '300',
1276
- marginTop: 8,
1277
- },
1278
- ]}
1279
- >
1280
- Ký HĐ
1281
- </MText>
1282
- </TouchableOpacity>
1283
- ) : (
1284
- <View
1285
- style={{
1286
- alignItems: 'center',
1287
- marginLeft: 20,
1288
- }}
1289
- >
1290
- <SignDisable />
1291
- <MText
1292
- style={[
1293
- commonStyles.textNormal,
1294
- {
1295
- fontSize: 12,
1296
- fontWeight: '300',
1297
- marginTop: 8,
1298
- },
1299
- ]}
1300
- >
1301
- Ký HĐ
1302
- </MText>
1303
- </View>
1304
- )}
1305
- </View>
1306
- <View
1307
- style={{
1308
- flexDirection: 'row',
1309
- alignItems: 'center',
1310
- backgroundColor: '#FBEFE7',
1311
- marginHorizontal: -16,
1312
- paddingVertical: 8,
1313
- marginTop: 16,
1314
- borderBottomRightRadius: 8,
1315
- borderBottomLeftRadius: 8,
1316
- paddingHorizontal: 16,
1317
- }}
1318
- >
1319
- <Info />
1320
- <MText
1321
- style={[
1322
- {
1323
- fontWeight: '300',
1324
- fontSize: 12,
1325
- fontStyle: 'italic',
1326
- color: '#333333',
1327
- marginLeft: 8,
1328
- },
1329
- ]}
1330
- >
1331
- Thực hiện đầy đủ các bước để giải ngân nhanh nhất
1332
- </MText>
1333
- </View>
1334
- </View>
1335
- </View>
1336
- )}
1337
- </Observer>
1338
- )}
1395
+ ))}
1339
1396
  </View>
1340
1397
  )}
1341
1398
  </View>
@@ -1580,7 +1637,7 @@ export const Home = observer(function Home() {
1580
1637
  <View>
1581
1638
  <Image
1582
1639
  source={
1583
- loan?.isCimbApproveFull === true
1640
+ loanCimb?.isCimbApproveFull === true
1584
1641
  ? require('./accept.png')
1585
1642
  : require('./reject.png')
1586
1643
  }
@@ -1590,7 +1647,7 @@ export const Home = observer(function Home() {
1590
1647
  height: (Dimensions.get('window').height / 2) * 0.8,
1591
1648
  }}
1592
1649
  />
1593
- {loan?.isCimbApproveFull === true ? (
1650
+ {loanCimb?.isCimbApproveFull === true ? (
1594
1651
  <View style={{ padding: 24 }}>
1595
1652
  <MText
1596
1653
  style={{
@@ -1608,7 +1665,7 @@ export const Home = observer(function Home() {
1608
1665
  ]}
1609
1666
  >
1610
1667
  Bạn đã được phê duyệt khoản vay từ CIMB với số tiền là{' '}
1611
- {formatMoney(loan?.loanAmount)} VNĐ!
1668
+ {formatMoney(loanCimb?.loanAmount)} VNĐ!
1612
1669
  </MText>
1613
1670
  <View
1614
1671
  style={{
@@ -1618,7 +1675,6 @@ export const Home = observer(function Home() {
1618
1675
  }}
1619
1676
  >
1620
1677
  <TouchableOpacity
1621
- disabled={isCancel}
1622
1678
  style={{
1623
1679
  borderWidth: 1,
1624
1680
  borderColor: color.primary,
@@ -1629,7 +1685,7 @@ export const Home = observer(function Home() {
1629
1685
  onPress={() => {
1630
1686
  setShowModal2(false);
1631
1687
  navigation.push(ScreenNames.AcceptPolicy, {
1632
- loan: loan,
1688
+ loan: loanCimb,
1633
1689
  isCimb: true,
1634
1690
  });
1635
1691
  }}
@@ -1638,7 +1694,6 @@ export const Home = observer(function Home() {
1638
1694
  </TouchableOpacity>
1639
1695
  </View>
1640
1696
  <TouchableOpacity
1641
- disabled={isCancel}
1642
1697
  style={{
1643
1698
  flexDirection: 'row',
1644
1699
  justifyContent: 'center',
@@ -1648,22 +1703,20 @@ export const Home = observer(function Home() {
1648
1703
  Alert.alert(
1649
1704
  'Vui lòng xác nhận lại',
1650
1705
  `Bạn có chắc chắn muốn huỷ khoản vay từ CIMB với số tiền ${formatMoney(
1651
- loan?.loanAmount
1706
+ loanCimb?.loanAmount
1652
1707
  )}`,
1653
1708
  [
1654
1709
  {
1655
1710
  text: 'Có',
1656
1711
  onPress: async () => {
1657
- setIsCancel(true);
1658
1712
  const response =
1659
1713
  await Api.getInstance().customerCancel({
1660
- LoanBriefId: loan?.id,
1714
+ LoanBriefId: loanCimb?.id,
1661
1715
  });
1662
- setIsCancel(false);
1663
1716
  if (response.kind === 'ok') {
1664
1717
  if (response.data.meta.errorCode === 200) {
1665
1718
  setShowModal2(false);
1666
- const key = `SHOW_${loan.id}`;
1719
+ const key = `SHOW_${loanCimb.id}`;
1667
1720
  save(key, true);
1668
1721
  Alert.alert(
1669
1722
  'Thông báo',
@@ -1679,7 +1732,6 @@ export const Home = observer(function Home() {
1679
1732
  );
1680
1733
  }
1681
1734
  } else {
1682
- setIsCancel(false);
1683
1735
  Alert.alert(
1684
1736
  'Có lỗi xảy ra. Vui lòng thử lại sau!'
1685
1737
  );
@@ -1693,11 +1745,7 @@ export const Home = observer(function Home() {
1693
1745
  );
1694
1746
  }}
1695
1747
  >
1696
- {isCancel ? (
1697
- <ActivityIndicator size={'small'} color={color.primary} />
1698
- ) : (
1699
- <MText style={{ color: '#BDBDBD' }}>Huỷ</MText>
1700
- )}
1748
+ <MText style={{ color: '#BDBDBD' }}>Huỷ</MText>
1701
1749
  </TouchableOpacity>
1702
1750
  </View>
1703
1751
  ) : (