react-native-timacare 0.0.9 → 0.0.10

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 (129) hide show
  1. package/lib/commonjs/assets/icons/call_black.svg +6 -0
  2. package/lib/commonjs/assets/icons/call_red.svg +4 -0
  3. package/lib/commonjs/assets/icons/index.js +1 -1
  4. package/lib/commonjs/assets/icons/index.js.flow +6 -0
  5. package/lib/commonjs/assets/icons/index.js.map +1 -1
  6. package/lib/commonjs/assets/icons/tick2.svg +6 -0
  7. package/lib/commonjs/assets/icons/tima3.svg +34 -6
  8. package/lib/commonjs/screens/camera/index.js +1 -1
  9. package/lib/commonjs/screens/camera/index.js.flow +6 -14
  10. package/lib/commonjs/screens/camera/index.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 +416 -174
  13. package/lib/commonjs/screens/full-submit/accept_policy.js.map +1 -1
  14. package/lib/commonjs/screens/full-submit/store.js +1 -1
  15. package/lib/commonjs/screens/full-submit/store.js.flow +2 -2
  16. package/lib/commonjs/screens/full-submit/store.js.map +1 -1
  17. package/lib/commonjs/screens/home/CIMBxTima.js +1 -1
  18. package/lib/commonjs/screens/home/CIMBxTima.js.flow +27 -11
  19. package/lib/commonjs/screens/home/CIMBxTima.js.map +1 -1
  20. package/lib/commonjs/screens/home/Store.js +1 -1
  21. package/lib/commonjs/screens/home/Store.js.flow +1 -1
  22. package/lib/commonjs/screens/home/Store.js.map +1 -1
  23. package/lib/commonjs/screens/home/accept.png +0 -0
  24. package/lib/commonjs/screens/home/index.js +1 -1
  25. package/lib/commonjs/screens/home/index.js.flow +1044 -581
  26. package/lib/commonjs/screens/home/index.js.map +1 -1
  27. package/lib/commonjs/screens/home/reject.png +0 -0
  28. package/lib/commonjs/screens/liveness/index.js +1 -1
  29. package/lib/commonjs/screens/liveness/index.js.flow +194 -176
  30. package/lib/commonjs/screens/liveness/index.js.map +1 -1
  31. package/lib/commonjs/screens/payment-evidence/Guideline.js +1 -1
  32. package/lib/commonjs/screens/payment-evidence/Guideline.js.flow +28 -3
  33. package/lib/commonjs/screens/payment-evidence/Guideline.js.map +1 -1
  34. package/lib/commonjs/screens/payment-evidence/ModalGuideline.js +1 -1
  35. package/lib/commonjs/screens/payment-evidence/ModalGuideline.js.flow +12 -3
  36. package/lib/commonjs/screens/payment-evidence/ModalGuideline.js.map +1 -1
  37. package/lib/commonjs/screens/payment-evidence/index.js +1 -1
  38. package/lib/commonjs/screens/payment-evidence/index.js.flow +20 -6
  39. package/lib/commonjs/screens/payment-evidence/index.js.map +1 -1
  40. package/lib/commonjs/screens/register/index.js +1 -1
  41. package/lib/commonjs/screens/register/index.js.flow +1 -1
  42. package/lib/commonjs/screens/selfie/index.js +1 -1
  43. package/lib/commonjs/screens/selfie/index.js.flow +1 -25
  44. package/lib/commonjs/screens/selfie/index.js.map +1 -1
  45. package/lib/commonjs/screens/terms/QuickTerm.js +1 -1
  46. package/lib/commonjs/screens/terms/QuickTerm.js.flow +4 -0
  47. package/lib/commonjs/screens/terms/QuickTerm.js.map +1 -1
  48. package/lib/commonjs/services/api/api-config.js +1 -1
  49. package/lib/commonjs/services/api/api-config.js.flow +1 -1
  50. package/lib/commonjs/services/api/api-config.js.map +1 -1
  51. package/lib/commonjs/services/api/api.js +1 -1
  52. package/lib/commonjs/services/api/api.js.flow +38 -2
  53. package/lib/commonjs/services/api/api.js.map +1 -1
  54. package/lib/module/assets/icons/call_black.svg +6 -0
  55. package/lib/module/assets/icons/call_red.svg +4 -0
  56. package/lib/module/assets/icons/index.js +1 -1
  57. package/lib/module/assets/icons/index.js.map +1 -1
  58. package/lib/module/assets/icons/tick2.svg +6 -0
  59. package/lib/module/assets/icons/tima3.svg +34 -6
  60. package/lib/module/screens/camera/index.js +1 -1
  61. package/lib/module/screens/camera/index.js.map +1 -1
  62. package/lib/module/screens/full-submit/accept_policy.js +1 -1
  63. package/lib/module/screens/full-submit/accept_policy.js.map +1 -1
  64. package/lib/module/screens/full-submit/store.js +1 -1
  65. package/lib/module/screens/full-submit/store.js.map +1 -1
  66. package/lib/module/screens/home/CIMBxTima.js +1 -1
  67. package/lib/module/screens/home/CIMBxTima.js.map +1 -1
  68. package/lib/module/screens/home/Store.js +1 -1
  69. package/lib/module/screens/home/Store.js.map +1 -1
  70. package/lib/module/screens/home/accept.png +0 -0
  71. package/lib/module/screens/home/index.js +1 -1
  72. package/lib/module/screens/home/index.js.map +1 -1
  73. package/lib/module/screens/home/reject.png +0 -0
  74. package/lib/module/screens/liveness/index.js +1 -1
  75. package/lib/module/screens/liveness/index.js.map +1 -1
  76. package/lib/module/screens/payment-evidence/Guideline.js +1 -1
  77. package/lib/module/screens/payment-evidence/Guideline.js.map +1 -1
  78. package/lib/module/screens/payment-evidence/ModalGuideline.js +1 -1
  79. package/lib/module/screens/payment-evidence/ModalGuideline.js.map +1 -1
  80. package/lib/module/screens/payment-evidence/index.js +1 -1
  81. package/lib/module/screens/payment-evidence/index.js.map +1 -1
  82. package/lib/module/screens/register/index.js +1 -1
  83. package/lib/module/screens/selfie/index.js +1 -1
  84. package/lib/module/screens/selfie/index.js.map +1 -1
  85. package/lib/module/screens/terms/QuickTerm.js +1 -1
  86. package/lib/module/screens/terms/QuickTerm.js.map +1 -1
  87. package/lib/module/services/api/api-config.js +1 -1
  88. package/lib/module/services/api/api-config.js.map +1 -1
  89. package/lib/module/services/api/api.js +1 -1
  90. package/lib/module/services/api/api.js.map +1 -1
  91. package/lib/typescript/assets/icons/index.d.ts +4 -1
  92. package/lib/typescript/assets/icons/index.d.ts.map +1 -1
  93. package/lib/typescript/screens/camera/index.d.ts.map +1 -1
  94. package/lib/typescript/screens/full-submit/accept_policy.d.ts.map +1 -1
  95. package/lib/typescript/screens/full-submit/store.d.ts +1 -1
  96. package/lib/typescript/screens/full-submit/store.d.ts.map +1 -1
  97. package/lib/typescript/screens/home/CIMBxTima.d.ts.map +1 -1
  98. package/lib/typescript/screens/home/index.d.ts.map +1 -1
  99. package/lib/typescript/screens/liveness/index.d.ts.map +1 -1
  100. package/lib/typescript/screens/payment-evidence/Guideline.d.ts.map +1 -1
  101. package/lib/typescript/screens/payment-evidence/ModalGuideline.d.ts.map +1 -1
  102. package/lib/typescript/screens/payment-evidence/index.d.ts.map +1 -1
  103. package/lib/typescript/screens/selfie/index.d.ts.map +1 -1
  104. package/lib/typescript/screens/terms/QuickTerm.d.ts.map +1 -1
  105. package/lib/typescript/services/api/api.d.ts +33 -1
  106. package/lib/typescript/services/api/api.d.ts.map +1 -1
  107. package/package.json +2 -1
  108. package/src/assets/icons/call_black.svg +6 -0
  109. package/src/assets/icons/call_red.svg +4 -0
  110. package/src/assets/icons/index.tsx +6 -0
  111. package/src/assets/icons/tick2.svg +6 -0
  112. package/src/assets/icons/tima3.svg +34 -6
  113. package/src/screens/camera/index.tsx +6 -14
  114. package/src/screens/full-submit/accept_policy.tsx +416 -174
  115. package/src/screens/full-submit/store.tsx +2 -2
  116. package/src/screens/home/CIMBxTima.tsx +27 -11
  117. package/src/screens/home/Store.tsx +1 -1
  118. package/src/screens/home/accept.png +0 -0
  119. package/src/screens/home/index.tsx +1044 -581
  120. package/src/screens/home/reject.png +0 -0
  121. package/src/screens/liveness/index.tsx +194 -176
  122. package/src/screens/payment-evidence/Guideline.tsx +28 -3
  123. package/src/screens/payment-evidence/ModalGuideline.tsx +12 -3
  124. package/src/screens/payment-evidence/index.tsx +20 -6
  125. package/src/screens/register/index.tsx +1 -1
  126. package/src/screens/selfie/index.tsx +1 -25
  127. package/src/screens/terms/QuickTerm.tsx +4 -0
  128. package/src/services/api/api-config.ts +1 -1
  129. package/src/services/api/api.ts +38 -2
@@ -3,6 +3,7 @@ import React, { useEffect, useState } from 'react';
3
3
  import {
4
4
  ActivityIndicator,
5
5
  Alert,
6
+ Dimensions,
6
7
  Image,
7
8
  ImageBackground,
8
9
  Platform,
@@ -30,6 +31,7 @@ import {
30
31
  Contract,
31
32
  ContractActive,
32
33
  ContractTimeIcon,
34
+ IconBackWhite,
33
35
  IconEviden,
34
36
  IconNavClose,
35
37
  IconNotify,
@@ -61,6 +63,8 @@ import {
61
63
  } from 'react-native-permissions';
62
64
  import appStore from '../../AppStore';
63
65
  import Modal from 'react-native-modal';
66
+ import { Api } from '../../services/api';
67
+ import { load, save } from '../../utils/storage';
64
68
 
65
69
  const listBanners = [
66
70
  require('../../assets/img/banner1.png'),
@@ -70,23 +74,35 @@ const listBanners = [
70
74
  export const Home = observer(function Home() {
71
75
  const navigation = useNavigation();
72
76
  const [showModal, setShowModal] = useState(false);
77
+ const [showModal2, setShowModal2] = useState(false);
78
+
73
79
  const onRefresh = () => {
74
80
  homeStore.getListLoan();
75
- homeStore.getListLoanPending((loan) => {
81
+ homeStore.getListLoanPending(async (loan) => {
76
82
  homeStore.getCheckEKYC({ loanBriefId: loan.id });
77
- if (loan.messageErrorCIMB !== '' && loan?.messageErrorCIMB) {
83
+ if (
84
+ loan.messageErrorCIMB !== '' &&
85
+ loan?.messageErrorCIMB &&
86
+ loan?.isCimbApproveFull === null
87
+ ) {
78
88
  setShowModal(true);
79
89
  }
90
+ if (loan?.typeLoan === 4 && loan?.isCimbApproveFull !== null) {
91
+ const checkShow = await load(`SHOW_${loan?.id}`);
92
+ if (!checkShow) {
93
+ setShowModal2(true);
94
+ }
95
+ }
80
96
  });
81
97
  };
82
98
  useEffect(() => {
83
99
  onRefresh();
84
100
  }, []);
85
101
 
86
- useEffect(() => {
87
- FullSubmitStore.getTypeMerried();
88
- FullSubmitStore.getListBank();
89
- }, []);
102
+ // useEffect(() => {
103
+ // FullSubmitStore.getTypeMerried();
104
+ // FullSubmitStore.getListBank();
105
+ // }, []);
90
106
 
91
107
  useEffect(() => {
92
108
  return navigation.addListener('focus', () => {
@@ -216,166 +232,186 @@ export const Home = observer(function Home() {
216
232
  <View
217
233
  style={[commonStyles.fill, { zIndex: 1, backgroundColor: '#FFFFFF' }]}
218
234
  >
219
- {homeStore.isLoading ? (
235
+ <LinearGradient colors={['#FF8E4F', '#EF592E']}>
236
+ <SafeAreaView
237
+ style={{
238
+ flexDirection: 'row',
239
+ justifyContent: 'center',
240
+ paddingHorizontal: 16,
241
+ alignItems: 'center',
242
+ height: 60,
243
+ }}
244
+ >
245
+ <TouchableOpacity
246
+ style={{
247
+ height: 32,
248
+ width: 32,
249
+ borderRadius: 30,
250
+ alignItems: 'center',
251
+ justifyContent: 'center',
252
+ position: 'absolute',
253
+ left: 16,
254
+ }}
255
+ onPress={() => {
256
+ // Linking.openURL()
257
+ navigation.pop();
258
+ }}
259
+ >
260
+ <IconBackWhite />
261
+ </TouchableOpacity>
262
+ <MText
263
+ style={{
264
+ fontWeight: 'bold',
265
+ color: 'white',
266
+ fontSize: 16,
267
+ }}
268
+ >
269
+ Vay nhanh 24/7
270
+ </MText>
271
+
272
+ <TouchableOpacity
273
+ style={{
274
+ height: 32,
275
+ width: 32,
276
+ borderRadius: 30,
277
+ borderWidth: 1,
278
+ borderColor: 'white',
279
+ alignItems: 'center',
280
+ justifyContent: 'center',
281
+ position: 'absolute',
282
+ right: 16,
283
+ }}
284
+ onPress={() => {
285
+ navigation.push(ScreenNames.PaymentEvidence);
286
+ }}
287
+ >
288
+ <Call />
289
+ </TouchableOpacity>
290
+ </SafeAreaView>
291
+ </LinearGradient>
292
+ <ScrollView
293
+ refreshControl={
294
+ <RefreshControl
295
+ refreshing={homeStore.isLoading}
296
+ onRefresh={onRefresh}
297
+ />
298
+ }
299
+ style={{ flex: 1, marginBottom: 16 }}
300
+ >
220
301
  <View
221
- style={{ flex: 1, alignItems: 'center', justifyContent: 'center' }}
302
+ style={[commonStyles.fill, { backgroundColor: 'white', padding: 16 }]}
222
303
  >
223
- <ActivityIndicator size={'small'} color={color.primary} />
224
- </View>
225
- ) : (
226
- <>
227
304
  <View>
228
- <LinearGradient colors={['#FF8E4F', '#EF592E']}>
229
- <SafeAreaView
230
- style={{
231
- flexDirection: 'row',
232
- justifyContent: 'space-between',
233
- paddingHorizontal: 16,
234
- paddingVertical: 16,
235
- alignItems: 'center',
236
- }}
237
- >
238
- <MText
239
- style={{
240
- fontWeight: 'bold',
241
- color: 'white',
242
- fontSize: 16,
243
- }}
244
- >
245
- Vay nhanh 24/7
246
- </MText>
247
- <View
248
- style={{
249
- flexDirection: 'row',
250
- borderWidth: 1,
251
- borderColor: 'white',
252
- borderRadius: 30,
253
- paddingVertical: 8,
254
- }}
255
- >
256
- <TouchableOpacity
257
- style={{ paddingHorizontal: 10 }}
258
- // onPress={() => {
259
- // Linking.openURL()
260
- // }}
261
- >
262
- <Call />
263
- </TouchableOpacity>
264
- <View style={{ width: 1, backgroundColor: 'white' }} />
265
- <TouchableOpacity
266
- style={{ paddingHorizontal: 10 }}
267
- onPress={() => {
268
- navigation.pop();
269
- // navigation.push(ScreenNames.AcceptPolicy, {
270
- // loan: {},
271
- // });
272
- }}
273
- >
274
- <CloseIcon />
275
- </TouchableOpacity>
276
- </View>
277
- </SafeAreaView>
278
- </LinearGradient>
279
- </View>
280
- <ScrollView
281
- refreshControl={
282
- <RefreshControl
283
- refreshing={homeStore.isLoading}
284
- onRefresh={onRefresh}
285
- />
286
- }
287
- style={{ flex: 1, marginBottom: 16 }}
288
- >
289
- <View
290
- style={[
291
- commonStyles.fill,
292
- { backgroundColor: 'white', padding: 16 },
293
- ]}
305
+ <MText
306
+ style={{ fontSize: 16, fontWeight: 'bold', marginBottom: 16 }}
294
307
  >
295
- <View>
296
- <MText
297
- style={{ fontSize: 16, fontWeight: 'bold', marginBottom: 16 }}
298
- >
299
- Danh sách đơn mới
308
+ Danh sách đơn mới
309
+ </MText>
310
+ {!homeStore.listLoanPending ? (
311
+ <View style={{ alignItems: 'center', marginTop: 20 }}>
312
+ <MText style={[commonStyles.textNormal]}>
313
+ Không có đơn vay
300
314
  </MText>
301
- {!homeStore.listLoanPending ? (
302
- <View style={{ alignItems: 'center', marginTop: 20 }}>
303
- <MText style={[commonStyles.textNormal]}>
304
- Không có đơn vay
305
- </MText>
306
- </View>
307
- ) : (
308
- <>
309
- {homeStore.listLoanPending &&
310
- homeStore.listLoanPending?.isPipelineCIMB ? (
311
- <View>
312
- {homeStore.listLoanPending?.loanStatus !== null &&
313
- homeStore.listLoanPending?.loanStatus !== '' ? (
314
- <View
315
- style={{
316
- backgroundColor: '#FFFFFF',
317
- paddingHorizontal: 16,
318
- paddingTop: 16,
319
- borderRadius: 8,
320
- borderWidth: 0.5,
321
- borderColor: '#E0E0E0',
322
- }}
315
+ </View>
316
+ ) : (
317
+ <>
318
+ {homeStore.listLoanPending &&
319
+ homeStore.listLoanPending?.isPipelineCIMB ? (
320
+ <View>
321
+ {homeStore.listLoanPending?.typeLoan === 4 ? (
322
+ <View
323
+ style={{
324
+ backgroundColor: '#FFFFFF',
325
+ paddingHorizontal: 16,
326
+ paddingTop: 16,
327
+ borderRadius: 8,
328
+ borderWidth: 0.5,
329
+ borderColor: '#E0E0E0',
330
+ }}
331
+ >
332
+ <View
333
+ style={{
334
+ flexDirection: 'row',
335
+ alignItems: 'center',
336
+ }}
337
+ >
338
+ <Contract />
339
+ <View style={{ flex: 1, paddingLeft: 8 }}>
340
+ <MText style={commonStyles.textNormalBold}>
341
+ Mã Đơn vay-{homeStore.listLoanPending?.id}
342
+ </MText>
343
+ <MText style={commonStyles.textNormal}>
344
+ Số tiền vay (VND):{' '}
345
+ {homeStore.listLoanPending?.loanAmountOffer
346
+ ? formatMoney(
347
+ homeStore.listLoanPending?.loanAmountOffer
348
+ )
349
+ : 'Chưa xác định'}
350
+ </MText>
351
+ </View>
352
+ </View>
353
+ <View
354
+ style={{
355
+ height: 1,
356
+ backgroundColor: '#E0E0E0',
357
+ marginVertical: 16,
358
+ }}
359
+ />
360
+ <View
361
+ style={{
362
+ flexDirection: 'row',
363
+ justifyContent: 'space-between',
364
+ }}
365
+ >
366
+ <MText style={commonStyles.textNormal}>
367
+ Trạng thái
368
+ </MText>
369
+ <MText
370
+ style={[
371
+ commonStyles.textNormalBold,
372
+ { color: '#F05123' },
373
+ ]}
323
374
  >
324
- <View
325
- style={{
326
- flexDirection: 'row',
327
- alignItems: 'center',
328
- }}
329
- >
330
- <Contract />
331
- <View style={{ flex: 1, paddingLeft: 8 }}>
332
- <MText style={commonStyles.textNormalBold}>
333
- Mã Đơn vay-{homeStore.listLoanPending?.id}
334
- </MText>
335
- <MText style={commonStyles.textNormal}>
336
- Số tiền vay (VND):{' '}
337
- {homeStore.listLoanPending?.loanAmountOffer
338
- ? formatMoney(
339
- homeStore.listLoanPending
340
- ?.loanAmountOffer
341
- )
342
- : 'Chưa xác định'}
343
- </MText>
344
- </View>
345
- </View>
346
- <View
347
- style={{
348
- height: 1,
349
- backgroundColor: '#E0E0E0',
350
- marginVertical: 16,
351
- }}
352
- />
353
- <View
354
- style={{
355
- flexDirection: 'row',
356
- justifyContent: 'space-between',
375
+ {homeStore?.listLoanPending?.loanStatus}
376
+ </MText>
377
+ </View>
378
+ <View
379
+ style={{
380
+ height: 0.5,
381
+ backgroundColor: '#E0E0E0',
382
+ marginVertical: 16,
383
+ }}
384
+ />
385
+ <View style={{ flexDirection: 'row' }}>
386
+ {homeStore.listLoanPending?.loanStatus === null ||
387
+ homeStore.listLoanPending?.loanStatus === '' ? (
388
+ <TouchableOpacity
389
+ style={{ alignItems: 'center' }}
390
+ onPress={() => {
391
+ navigation.dispatch(
392
+ StackActions.push(ScreenNames.CIMBxTima, {
393
+ loan: homeStore.listLoanPending,
394
+ })
395
+ );
357
396
  }}
358
397
  >
359
- <MText style={commonStyles.textNormal}>
360
- Trạng thái
361
- </MText>
398
+ <AddInfo />
362
399
  <MText
363
400
  style={[
364
- commonStyles.textNormalBold,
365
- { color: '#F05123' },
401
+ commonStyles.textNormal,
402
+ {
403
+ fontSize: 12,
404
+ fontWeight: '300',
405
+ marginTop: 8,
406
+ textAlign: 'center',
407
+ },
366
408
  ]}
367
409
  >
368
- {homeStore?.listLoanPending?.loanStatus}
410
+ Hoàn thiện{'\n'}cung cấp thông tin
369
411
  </MText>
370
- </View>
371
- <View
372
- style={{
373
- height: 0.5,
374
- backgroundColor: '#E0E0E0',
375
- marginVertical: 16,
376
- }}
377
- />
378
- <View style={{ flexDirection: 'row' }}>
412
+ </TouchableOpacity>
413
+ ) : (
414
+ <View>
379
415
  {homeStore?.listLoanPending?.isUpdateLoan ||
380
416
  homeStore?.listLoanPending
381
417
  ?.isUpdateInformation ? (
@@ -438,81 +474,382 @@ export const Home = observer(function Home() {
438
474
  </MText>
439
475
  </View>
440
476
  )}
441
- {homeStore.listLoanPending?.isSignContract && (
442
- <TouchableOpacity
443
- style={{
444
- alignItems: 'center',
445
- marginLeft: 20,
446
- }}
447
- onPress={() => {
448
- if (
449
- homeStore.listLoanPending?.urlSignContract
450
- ) {
451
- navigation.dispatch(
452
- StackActions.push(
453
- ScreenNames.CIMBSign,
454
- {
455
- url: homeStore.listLoanPending
456
- ?.urlSignContract,
457
- }
458
- )
459
- );
460
- } else {
461
- Alert.alert(
462
- 'Thông báo',
463
- 'Bạn chưa thể ký hợp đồng bây giờ?'
464
- );
465
- }
466
- }}
467
- >
468
- <IconSign2 />
469
- <MText
470
- style={[
471
- commonStyles.textNormal,
472
- {
473
- fontSize: 12,
474
- fontWeight: '300',
475
- marginTop: 8,
476
- },
477
- ]}
478
- >
479
- Ký hợp đồng
480
- </MText>
481
- </TouchableOpacity>
482
- )}
483
- {homeStore.listLoanPending
484
- ?.isSignContractTima && (
485
- <TouchableOpacity
486
- style={{
487
- alignItems: 'center',
488
- marginLeft: 20,
489
- }}
490
- onPress={() => {
491
- navigation.dispatch(
492
- StackActions.push(
493
- ScreenNames.ViewContract,
494
- {
495
- loan: homeStore.listLoanPending,
496
- }
497
- )
498
- );
499
- }}
500
- >
501
- <ContractTimeIcon />
502
- <MText
503
- style={[
504
- commonStyles.textNormal,
505
- {
506
- fontSize: 12,
507
- fontWeight: '300',
508
- marginTop: 8,
509
- textAlign: 'center',
510
- },
511
- ]}
512
- >
513
- Hợp đồng{'\n'}dịch vụ
514
- </MText>
515
- </TouchableOpacity>
477
+ </View>
478
+ )}
479
+
480
+ {homeStore.listLoanPending?.isSignContract && (
481
+ <TouchableOpacity
482
+ style={{
483
+ alignItems: 'center',
484
+ marginLeft: 20,
485
+ }}
486
+ onPress={() => {
487
+ if (
488
+ homeStore.listLoanPending?.urlSignContract
489
+ ) {
490
+ navigation.dispatch(
491
+ StackActions.push(ScreenNames.CIMBSign, {
492
+ url: homeStore.listLoanPending
493
+ ?.urlSignContract,
494
+ })
495
+ );
496
+ } else {
497
+ Alert.alert(
498
+ 'Thông báo',
499
+ 'Bạn chưa thể ký hợp đồng bây giờ?'
500
+ );
501
+ }
502
+ }}
503
+ >
504
+ <IconSign2 />
505
+ <MText
506
+ style={[
507
+ commonStyles.textNormal,
508
+ {
509
+ fontSize: 12,
510
+ fontWeight: '300',
511
+ marginTop: 8,
512
+ },
513
+ ]}
514
+ >
515
+ Ký hợp đồng
516
+ </MText>
517
+ </TouchableOpacity>
518
+ )}
519
+ {homeStore.listLoanPending?.isSignContractTima && (
520
+ <TouchableOpacity
521
+ style={{
522
+ alignItems: 'center',
523
+ marginLeft: 20,
524
+ }}
525
+ onPress={() => {
526
+ navigation.dispatch(
527
+ StackActions.push(ScreenNames.ViewContract, {
528
+ loan: homeStore.listLoanPending,
529
+ })
530
+ );
531
+ }}
532
+ >
533
+ <ContractTimeIcon />
534
+ <MText
535
+ style={[
536
+ commonStyles.textNormal,
537
+ {
538
+ fontSize: 12,
539
+ fontWeight: '300',
540
+ marginTop: 8,
541
+ textAlign: 'center',
542
+ },
543
+ ]}
544
+ >
545
+ Hợp đồng{'\n'}dịch vụ
546
+ </MText>
547
+ </TouchableOpacity>
548
+ )}
549
+ {homeStore.listLoanPending?.paymentEvidenceUrl && (
550
+ <TouchableOpacity
551
+ style={{
552
+ alignItems: 'center',
553
+ marginLeft: 20,
554
+ }}
555
+ onPress={() => {
556
+ navigation.dispatch(
557
+ StackActions.push(
558
+ ScreenNames.PaymentEvidence,
559
+ {
560
+ url: homeStore.listLoanPending
561
+ ?.paymentEvidenceUrl,
562
+ }
563
+ )
564
+ );
565
+ }}
566
+ >
567
+ <IconEviden />
568
+ <MText
569
+ style={[
570
+ commonStyles.textNormal,
571
+ {
572
+ fontSize: 12,
573
+ fontWeight: '300',
574
+ marginTop: 8,
575
+ textAlign: 'center',
576
+ },
577
+ ]}
578
+ >
579
+ Mục đích {'\n'}sử dụng
580
+ </MText>
581
+ </TouchableOpacity>
582
+ )}
583
+ {homeStore.listLoanPending?.showPaymentPlan && (
584
+ <TouchableOpacity
585
+ style={{
586
+ alignItems: 'center',
587
+ marginLeft: 20,
588
+ }}
589
+ onPress={() => {
590
+ navigation.dispatch(
591
+ StackActions.push(
592
+ ScreenNames.SchedulePayment,
593
+ {
594
+ loan: homeStore.listLoanPending,
595
+ }
596
+ )
597
+ );
598
+ }}
599
+ >
600
+ <IconSchedule />
601
+ <MText
602
+ style={[
603
+ commonStyles.textNormal,
604
+ {
605
+ fontSize: 12,
606
+ fontWeight: '300',
607
+ marginTop: 8,
608
+ },
609
+ ]}
610
+ >
611
+ Lịch dự kiến
612
+ </MText>
613
+ </TouchableOpacity>
614
+ )}
615
+ </View>
616
+ <View
617
+ style={{
618
+ flexDirection: 'row',
619
+ alignItems: 'center',
620
+ backgroundColor: '#FBEFE7',
621
+ marginHorizontal: -16,
622
+ paddingVertical: 8,
623
+ marginTop: 16,
624
+ borderBottomRightRadius: 8,
625
+ borderBottomLeftRadius: 8,
626
+ paddingHorizontal: 16,
627
+ }}
628
+ >
629
+ <Info />
630
+ <MText
631
+ style={[
632
+ {
633
+ fontWeight: '300',
634
+ fontSize: 10,
635
+ fontStyle: 'italic',
636
+ color: '#333333',
637
+ marginLeft: 8,
638
+ },
639
+ ]}
640
+ >
641
+ {homeStore.listLoanPending?.suggestion
642
+ ? homeStore.listLoanPending?.suggestion
643
+ : 'Thực hiện đầy đủ các bước để giải ngân nhanh nhất'}
644
+ </MText>
645
+ </View>
646
+ </View>
647
+ ) : (
648
+ <View>
649
+ {homeStore.listLoanPending?.loanStatus !== null &&
650
+ homeStore.listLoanPending?.loanStatus !== '' ? (
651
+ <View
652
+ style={{
653
+ backgroundColor: '#FFFFFF',
654
+ paddingHorizontal: 16,
655
+ paddingTop: 16,
656
+ borderRadius: 8,
657
+ borderWidth: 0.5,
658
+ borderColor: '#E0E0E0',
659
+ }}
660
+ >
661
+ <View
662
+ style={{
663
+ flexDirection: 'row',
664
+ alignItems: 'center',
665
+ }}
666
+ >
667
+ <Contract />
668
+ <View style={{ flex: 1, paddingLeft: 8 }}>
669
+ <MText style={commonStyles.textNormalBold}>
670
+ Mã Đơn vay-{homeStore.listLoanPending?.id}
671
+ </MText>
672
+ <MText style={commonStyles.textNormal}>
673
+ Số tiền vay (VND):{' '}
674
+ {homeStore.listLoanPending?.loanAmountOffer
675
+ ? formatMoney(
676
+ homeStore.listLoanPending
677
+ ?.loanAmountOffer
678
+ )
679
+ : 'Chưa xác định'}
680
+ </MText>
681
+ </View>
682
+ </View>
683
+ <View
684
+ style={{
685
+ height: 1,
686
+ backgroundColor: '#E0E0E0',
687
+ marginVertical: 16,
688
+ }}
689
+ />
690
+ <View
691
+ style={{
692
+ flexDirection: 'row',
693
+ justifyContent: 'space-between',
694
+ }}
695
+ >
696
+ <MText style={commonStyles.textNormal}>
697
+ Trạng thái
698
+ </MText>
699
+ <MText
700
+ style={[
701
+ commonStyles.textNormalBold,
702
+ { color: '#F05123' },
703
+ ]}
704
+ >
705
+ {homeStore?.listLoanPending?.loanStatus}
706
+ </MText>
707
+ </View>
708
+ <View
709
+ style={{
710
+ height: 0.5,
711
+ backgroundColor: '#E0E0E0',
712
+ marginVertical: 16,
713
+ }}
714
+ />
715
+ <View style={{ flexDirection: 'row' }}>
716
+ {homeStore?.listLoanPending?.isUpdateLoan ||
717
+ homeStore?.listLoanPending
718
+ ?.isUpdateInformation ? (
719
+ <TouchableOpacity
720
+ style={{ alignItems: 'center' }}
721
+ onPress={() => {
722
+ if (
723
+ homeStore.listLoanPending?.isUpdateLoan
724
+ ) {
725
+ navigation.dispatch(
726
+ StackActions.push(
727
+ ScreenNames.CimbSelfie,
728
+ {
729
+ loan: homeStore.listLoanPending,
730
+ }
731
+ )
732
+ );
733
+ } else {
734
+ navigation.dispatch(
735
+ StackActions.push(
736
+ ScreenNames.QuickSubmit,
737
+ {
738
+ loan: homeStore.listLoanPending,
739
+ }
740
+ )
741
+ );
742
+ }
743
+ }}
744
+ >
745
+ <AddInfo />
746
+ <MText
747
+ style={[
748
+ commonStyles.textNormal,
749
+ {
750
+ fontSize: 12,
751
+ fontWeight: '300',
752
+ marginTop: 8,
753
+ textAlign: 'center',
754
+ },
755
+ ]}
756
+ >
757
+ Hoàn thiện{'\n'}cung cấp thông tin
758
+ </MText>
759
+ </TouchableOpacity>
760
+ ) : (
761
+ <View style={{ alignItems: 'center' }}>
762
+ <AddInfoDisable />
763
+ <MText
764
+ style={[
765
+ commonStyles.textNormal,
766
+ {
767
+ fontSize: 12,
768
+ fontWeight: '300',
769
+ marginTop: 8,
770
+ textAlign: 'center',
771
+ },
772
+ ]}
773
+ >
774
+ Hoàn thiện{'\n'}cung cấp thông tin
775
+ </MText>
776
+ </View>
777
+ )}
778
+ {homeStore.listLoanPending?.isSignContract && (
779
+ <TouchableOpacity
780
+ style={{
781
+ alignItems: 'center',
782
+ marginLeft: 20,
783
+ }}
784
+ onPress={() => {
785
+ if (
786
+ homeStore.listLoanPending?.urlSignContract
787
+ ) {
788
+ navigation.dispatch(
789
+ StackActions.push(
790
+ ScreenNames.CIMBSign,
791
+ {
792
+ url: homeStore.listLoanPending
793
+ ?.urlSignContract,
794
+ }
795
+ )
796
+ );
797
+ } else {
798
+ Alert.alert(
799
+ 'Thông báo',
800
+ 'Bạn chưa thể ký hợp đồng bây giờ?'
801
+ );
802
+ }
803
+ }}
804
+ >
805
+ <IconSign2 />
806
+ <MText
807
+ style={[
808
+ commonStyles.textNormal,
809
+ {
810
+ fontSize: 12,
811
+ fontWeight: '300',
812
+ marginTop: 8,
813
+ },
814
+ ]}
815
+ >
816
+ Ký hợp đồng
817
+ </MText>
818
+ </TouchableOpacity>
819
+ )}
820
+ {homeStore.listLoanPending
821
+ ?.isSignContractTima && (
822
+ <TouchableOpacity
823
+ style={{
824
+ alignItems: 'center',
825
+ marginLeft: 20,
826
+ }}
827
+ onPress={() => {
828
+ navigation.dispatch(
829
+ StackActions.push(
830
+ ScreenNames.ViewContract,
831
+ {
832
+ loan: homeStore.listLoanPending,
833
+ }
834
+ )
835
+ );
836
+ }}
837
+ >
838
+ <ContractTimeIcon />
839
+ <MText
840
+ style={[
841
+ commonStyles.textNormal,
842
+ {
843
+ fontSize: 12,
844
+ fontWeight: '300',
845
+ marginTop: 8,
846
+ textAlign: 'center',
847
+ },
848
+ ]}
849
+ >
850
+ Hợp đồng{'\n'}dịch vụ
851
+ </MText>
852
+ </TouchableOpacity>
516
853
  )}
517
854
  {homeStore.listLoanPending
518
855
  ?.paymentEvidenceUrl && (
@@ -675,391 +1012,377 @@ export const Home = observer(function Home() {
675
1012
  Hoàn thiện hồ sơ
676
1013
  </MText>
677
1014
  </LinearGradient>
678
- </TouchableOpacity>
679
- <View
680
- style={{
681
- flexDirection: 'row',
682
- alignItems: 'center',
683
- alignContent: 'center',
684
- marginTop: 16,
685
- }}
686
- >
687
- <MText style={{ fontSize: 10, color: '#333333' }}>
688
- SẢN PHẨM VAY TIÊU DÙNG HỢP TÁC GIỮA{' '}
689
- </MText>
690
- <LogoSmall />
691
- <MText style={{ fontSize: 12, color: '#333333' }}>
692
- {' '}
693
- VÀ{' '}
694
- </MText>
695
- <CIMBSmall />
696
- </View>
697
- </ImageBackground>
698
- )}
699
- </View>
700
- ) : (
701
- <View
702
- style={{
703
- backgroundColor: '#FFFFFF',
704
- paddingHorizontal: 16,
705
- paddingTop: 16,
706
- borderRadius: 8,
707
- borderWidth: 0.5,
708
- borderColor: '#E0E0E0',
709
- }}
710
- >
711
- <View
712
- style={{ flexDirection: 'row', alignItems: 'center' }}
713
- >
714
- <Contract />
715
- <View style={{ flex: 1, paddingLeft: 8 }}>
716
- <MText style={commonStyles.textNormalBold}>
717
- Đơn vay {homeStore.listLoanPending?.id}
718
- </MText>
719
- <MText style={commonStyles.textNormal}>
720
- Số tiền vay (VND):{' '}
721
- {homeStore.listLoanPending?.loanAmount
722
- ? formatMoney(
723
- homeStore.listLoanPending?.loanAmount
724
- )
725
- : 'Chưa xác định'}
726
- </MText>
727
- </View>
728
- </View>
729
- <View
730
- style={{
731
- height: 1,
732
- backgroundColor: '#E0E0E0',
733
- marginVertical: 16,
734
- }}
735
- />
736
- <View
737
- style={{
738
- flexDirection: 'row',
739
- justifyContent: 'space-between',
740
- }}
741
- >
742
- <MText style={commonStyles.textNormal}>
743
- Trạng thái
744
- </MText>
745
- <MText
746
- style={[
747
- commonStyles.textNormalBold,
748
- { color: '#F05123' },
749
- ]}
750
- >
751
- {homeStore?.listLoanPending?.loanStatus}
752
- </MText>
753
- </View>
754
- <View
755
- style={{
756
- height: 0.5,
757
- backgroundColor: '#E0E0E0',
758
- marginVertical: 16,
759
- }}
760
- />
761
- <View style={{ flexDirection: 'row' }}>
762
- {!homeStore.checkEKYC[
763
- homeStore.listLoanPending?.id
764
- ] ? (
765
- <TouchableOpacity
766
- style={{ alignItems: 'center' }}
767
- onPress={() => {
768
- navigation.dispatch(
769
- StackActions.push(ScreenNames.NationalID, {
770
- loan: homeStore.listLoanPending,
771
- reLoan: true,
772
- })
773
- );
774
- }}
775
- >
776
- <AddInfo />
777
- <MText
778
- style={[
779
- commonStyles.textNormal,
780
- {
781
- fontSize: 12,
782
- fontWeight: '300',
783
- marginTop: 8,
784
- },
785
- ]}
786
- >
787
- EKYC
788
- </MText>
789
- </TouchableOpacity>
790
- ) : (
791
- <View style={{ alignItems: 'center' }}>
792
- <AddInfoDisable />
793
- <MText
794
- style={[
795
- commonStyles.textNormal,
796
- {
797
- fontSize: 12,
798
- fontWeight: '300',
799
- marginTop: 8,
800
- },
801
- ]}
802
- >
803
- EKYC
804
- </MText>
805
- </View>
806
- )}
807
-
808
- <TouchableOpacity
809
- style={{ alignItems: 'center', marginLeft: 20 }}
810
- onPress={() => {
811
- navigation.dispatch(
812
- StackActions.push(ScreenNames.Video, {
813
- loan: homeStore.listLoanPending,
814
- })
815
- );
816
- }}
817
- >
818
- <IconVideo />
819
- <MText
820
- style={[
821
- commonStyles.textNormal,
822
- {
823
- fontSize: 12,
824
- fontWeight: '300',
825
- marginTop: 8,
826
- },
827
- ]}
828
- >
829
- Quay video
830
- </MText>
831
- </TouchableOpacity>
832
-
833
- {homeStore.checkEKYC[
834
- homeStore.listLoanPending?.id
835
- ] ? (
836
- <TouchableOpacity
837
- style={{ alignItems: 'center', marginLeft: 20 }}
838
- onPress={() => {
839
- signLoan(homeStore.listLoanPending);
840
- }}
841
- >
842
- <IconSign2 />
843
- <MText
844
- style={[
845
- commonStyles.textNormal,
846
- {
847
- fontSize: 12,
848
- fontWeight: '300',
849
- marginTop: 8,
850
- },
851
- ]}
852
- >
853
- Ký HĐ
854
- </MText>
855
- </TouchableOpacity>
856
- ) : (
857
- <View
858
- style={{ alignItems: 'center', marginLeft: 20 }}
859
- >
860
- <SignDisable />
861
- <MText
862
- style={[
863
- commonStyles.textNormal,
864
- {
865
- fontSize: 12,
866
- fontWeight: '300',
867
- marginTop: 8,
868
- },
869
- ]}
870
- >
871
- Ký HĐ
1015
+ </TouchableOpacity>
1016
+ <View
1017
+ style={{
1018
+ flexDirection: 'row',
1019
+ alignItems: 'center',
1020
+ alignContent: 'center',
1021
+ marginTop: 16,
1022
+ }}
1023
+ >
1024
+ <MText style={{ fontSize: 10, color: '#333333' }}>
1025
+ SẢN PHẨM VAY TIÊU DÙNG HỢP TÁC GIỮA{' '}
1026
+ </MText>
1027
+ <LogoSmall />
1028
+ <MText style={{ fontSize: 12, color: '#333333' }}>
1029
+ {' '}
1030
+ VÀ{' '}
872
1031
  </MText>
1032
+ <CIMBSmall />
873
1033
  </View>
874
- )}
875
- </View>
876
- <View
877
- style={{
878
- flexDirection: 'row',
879
- alignItems: 'center',
880
- backgroundColor: '#FBEFE7',
881
- marginHorizontal: -16,
882
- paddingVertical: 8,
883
- marginTop: 16,
884
- borderBottomRightRadius: 8,
885
- borderBottomLeftRadius: 8,
886
- paddingHorizontal: 16,
1034
+ </ImageBackground>
1035
+ )}
1036
+ </View>
1037
+ )}
1038
+ </View>
1039
+ ) : (
1040
+ <View
1041
+ style={{
1042
+ backgroundColor: '#FFFFFF',
1043
+ paddingHorizontal: 16,
1044
+ paddingTop: 16,
1045
+ borderRadius: 8,
1046
+ borderWidth: 0.5,
1047
+ borderColor: '#E0E0E0',
1048
+ }}
1049
+ >
1050
+ <View
1051
+ style={{ flexDirection: 'row', alignItems: 'center' }}
1052
+ >
1053
+ <Contract />
1054
+ <View style={{ flex: 1, paddingLeft: 8 }}>
1055
+ <MText style={commonStyles.textNormalBold}>
1056
+ Đơn vay {homeStore.listLoanPending?.id}
1057
+ </MText>
1058
+ <MText style={commonStyles.textNormal}>
1059
+ Số tiền vay (VND):{' '}
1060
+ {homeStore.listLoanPending?.loanAmount
1061
+ ? formatMoney(homeStore.listLoanPending?.loanAmount)
1062
+ : 'Chưa xác định'}
1063
+ </MText>
1064
+ </View>
1065
+ </View>
1066
+ <View
1067
+ style={{
1068
+ height: 1,
1069
+ backgroundColor: '#E0E0E0',
1070
+ marginVertical: 16,
1071
+ }}
1072
+ />
1073
+ <View
1074
+ style={{
1075
+ flexDirection: 'row',
1076
+ justifyContent: 'space-between',
1077
+ }}
1078
+ >
1079
+ <MText style={commonStyles.textNormal}>Trạng thái</MText>
1080
+ <MText
1081
+ style={[
1082
+ commonStyles.textNormalBold,
1083
+ { color: '#F05123' },
1084
+ ]}
1085
+ >
1086
+ {homeStore?.listLoanPending?.loanStatus}
1087
+ </MText>
1088
+ </View>
1089
+ <View
1090
+ style={{
1091
+ height: 0.5,
1092
+ backgroundColor: '#E0E0E0',
1093
+ marginVertical: 16,
1094
+ }}
1095
+ />
1096
+ <View style={{ flexDirection: 'row' }}>
1097
+ {!homeStore.checkEKYC[homeStore.listLoanPending?.id] ? (
1098
+ <TouchableOpacity
1099
+ style={{ alignItems: 'center' }}
1100
+ onPress={() => {
1101
+ navigation.dispatch(
1102
+ StackActions.push(ScreenNames.NationalID, {
1103
+ loan: homeStore.listLoanPending,
1104
+ reLoan: true,
1105
+ })
1106
+ );
887
1107
  }}
888
1108
  >
889
- <Info />
1109
+ <AddInfo />
890
1110
  <MText
891
1111
  style={[
1112
+ commonStyles.textNormal,
892
1113
  {
1114
+ fontSize: 12,
893
1115
  fontWeight: '300',
1116
+ marginTop: 8,
1117
+ },
1118
+ ]}
1119
+ >
1120
+ EKYC
1121
+ </MText>
1122
+ </TouchableOpacity>
1123
+ ) : (
1124
+ <View style={{ alignItems: 'center' }}>
1125
+ <AddInfoDisable />
1126
+ <MText
1127
+ style={[
1128
+ commonStyles.textNormal,
1129
+ {
894
1130
  fontSize: 12,
895
- fontStyle: 'italic',
896
- color: '#333333',
897
- marginLeft: 8,
1131
+ fontWeight: '300',
1132
+ marginTop: 8,
898
1133
  },
899
1134
  ]}
900
1135
  >
901
- Thực hiện đầy đủ các bước để giải ngân nhanh nhất
1136
+ EKYC
902
1137
  </MText>
903
1138
  </View>
904
- </View>
905
- )}
906
- </>
907
- )}
908
- </View>
909
- <View>
910
- <MText
911
- style={{
912
- fontSize: 16,
913
- fontWeight: 'bold',
914
- marginBottom: 16,
915
- marginTop: 16,
916
- }}
917
- >
918
- Danh sách đơn đang vay
919
- </MText>
920
- {homeStore.listLoan && homeStore.listLoan.length === 0 && (
921
- <View style={{ alignItems: 'center', marginTop: 20 }}>
922
- <MText style={[commonStyles.textNormal]}>
923
- Không có đơn vay
924
- </MText>
925
- </View>
926
- )}
927
- {homeStore?.listLoan &&
928
- homeStore?.listLoan.map((loan, index) => (
929
- <View key={index}>
1139
+ )}
1140
+
930
1141
  <TouchableOpacity
931
- disabled={
932
- loan?.disbursementPartner === 'CIMB' ? false : true
933
- }
934
- style={{
935
- backgroundColor: '#FFFFFF',
936
- paddingHorizontal: 16,
937
- paddingTop: 16,
938
- borderRadius: 8,
939
- borderWidth: 0.5,
940
- borderColor: '#E0E0E0',
941
- marginBottom: 16,
942
- }}
1142
+ style={{ alignItems: 'center', marginLeft: 20 }}
943
1143
  onPress={() => {
944
- if (loan?.disbursementPartner === 'CIMB') {
945
- navigation.dispatch(
946
- StackActions.push(ScreenNames.DetailLoan, {
947
- loan,
948
- })
949
- );
950
- }
1144
+ navigation.dispatch(
1145
+ StackActions.push(ScreenNames.Video, {
1146
+ loan: homeStore.listLoanPending,
1147
+ })
1148
+ );
951
1149
  }}
952
1150
  >
953
- <View
954
- style={{ flexDirection: 'row', alignItems: 'center' }}
955
- >
956
- <ContractActive />
957
- <View style={{ flex: 1, paddingLeft: 8 }}>
958
- <MText style={commonStyles.textNormalBold}>
959
- Đơn vay-{loan?.id}
960
- </MText>
961
- <MText style={commonStyles.textNormal}>
962
- Số tiền vay (VND): {formatMoney(loan?.loanAmount)}
963
- </MText>
964
- </View>
965
- </View>
966
- <View
967
- style={{
968
- height: 1,
969
- backgroundColor: '#E0E0E0',
970
- marginVertical: 16,
971
- }}
972
- />
973
- <View
974
- style={{
975
- flexDirection: 'row',
976
- justifyContent: 'space-between',
977
- }}
978
- >
979
- <MText style={commonStyles.textNormal}>
980
- Ngày giải ngân
981
- </MText>
982
- <MText style={commonStyles.textNormalBold}>
983
- {formatDDMMYYY(loan?.disbursementAt)}
984
- </MText>
985
- </View>
986
- <View
987
- style={{
988
- height: 0.5,
989
- backgroundColor: '#E0E0E0',
990
- marginVertical: 16,
991
- }}
992
- />
993
- <View
994
- style={{
995
- flexDirection: 'row',
996
- justifyContent: 'space-between',
997
- }}
998
- >
999
- <MText style={commonStyles.textNormal}>
1000
- Ngày kết thúc khoản vay
1001
- </MText>
1002
- <MText style={commonStyles.textNormalBold}>
1003
- {formatDDMMYYY(loan?.finishAt)}
1004
- </MText>
1005
- </View>
1006
- <View
1007
- style={{
1008
- height: 0.5,
1009
- backgroundColor: '#E0E0E0',
1010
- marginVertical: 16,
1011
- }}
1012
- />
1013
- <View
1014
- style={{
1015
- flexDirection: 'row',
1016
- justifyContent: 'space-between',
1017
- }}
1151
+ <IconVideo />
1152
+ <MText
1153
+ style={[
1154
+ commonStyles.textNormal,
1155
+ {
1156
+ fontSize: 12,
1157
+ fontWeight: '300',
1158
+ marginTop: 8,
1159
+ },
1160
+ ]}
1018
1161
  >
1019
- <MText style={commonStyles.textNormal}>
1020
- Ngày đến hạn tiếp theo
1021
- </MText>
1022
- <MText style={commonStyles.textNormalBold}>
1023
- {formatDDMMYYY(loan?.nextDate)}
1024
- </MText>
1025
- </View>
1026
- <View
1027
- style={{
1028
- flexDirection: 'row',
1029
- alignItems: 'center',
1030
- backgroundColor: '#EAF5E4',
1031
- marginHorizontal: -16,
1032
- paddingVertical: 8,
1033
- marginTop: 16,
1034
- borderBottomRightRadius: 8,
1035
- borderBottomLeftRadius: 8,
1036
- paddingHorizontal: 16,
1162
+ Quay video
1163
+ </MText>
1164
+ </TouchableOpacity>
1165
+
1166
+ {homeStore.checkEKYC[homeStore.listLoanPending?.id] ? (
1167
+ <TouchableOpacity
1168
+ style={{ alignItems: 'center', marginLeft: 20 }}
1169
+ onPress={() => {
1170
+ signLoan(homeStore.listLoanPending);
1037
1171
  }}
1038
1172
  >
1039
- <Info />
1173
+ <IconSign2 />
1040
1174
  <MText
1041
1175
  style={[
1176
+ commonStyles.textNormal,
1042
1177
  {
1178
+ fontSize: 12,
1043
1179
  fontWeight: '300',
1180
+ marginTop: 8,
1181
+ },
1182
+ ]}
1183
+ >
1184
+ Ký HĐ
1185
+ </MText>
1186
+ </TouchableOpacity>
1187
+ ) : (
1188
+ <View style={{ alignItems: 'center', marginLeft: 20 }}>
1189
+ <SignDisable />
1190
+ <MText
1191
+ style={[
1192
+ commonStyles.textNormal,
1193
+ {
1044
1194
  fontSize: 12,
1045
- fontStyle: 'italic',
1046
- color: '#333333',
1047
- marginLeft: 8,
1195
+ fontWeight: '300',
1196
+ marginTop: 8,
1048
1197
  },
1049
1198
  ]}
1050
1199
  >
1051
- Thời gian tất toán còn lại là{' '}
1052
- {diffDays(new Date(), loan?.finishAt)} ngày
1200
+
1053
1201
  </MText>
1054
1202
  </View>
1055
- </TouchableOpacity>
1203
+ )}
1056
1204
  </View>
1057
- ))}
1058
- </View>
1059
- </View>
1060
- </ScrollView>
1061
- </>
1062
- )}
1205
+ <View
1206
+ style={{
1207
+ flexDirection: 'row',
1208
+ alignItems: 'center',
1209
+ backgroundColor: '#FBEFE7',
1210
+ marginHorizontal: -16,
1211
+ paddingVertical: 8,
1212
+ marginTop: 16,
1213
+ borderBottomRightRadius: 8,
1214
+ borderBottomLeftRadius: 8,
1215
+ paddingHorizontal: 16,
1216
+ }}
1217
+ >
1218
+ <Info />
1219
+ <MText
1220
+ style={[
1221
+ {
1222
+ fontWeight: '300',
1223
+ fontSize: 12,
1224
+ fontStyle: 'italic',
1225
+ color: '#333333',
1226
+ marginLeft: 8,
1227
+ },
1228
+ ]}
1229
+ >
1230
+ Thực hiện đầy đủ các bước để giải ngân nhanh nhất
1231
+ </MText>
1232
+ </View>
1233
+ </View>
1234
+ )}
1235
+ </>
1236
+ )}
1237
+ </View>
1238
+ <View>
1239
+ {homeStore.listLoan && homeStore.listLoan.length > 0 && (
1240
+ <MText
1241
+ style={{
1242
+ fontSize: 16,
1243
+ fontWeight: 'bold',
1244
+ marginBottom: 16,
1245
+ marginTop: 16,
1246
+ }}
1247
+ >
1248
+ Danh sách đơn đang vay
1249
+ </MText>
1250
+ )}
1251
+ {homeStore?.listLoan &&
1252
+ homeStore?.listLoan.map((loan, index) => (
1253
+ <View key={index}>
1254
+ <TouchableOpacity
1255
+ disabled={
1256
+ loan?.disbursementPartner === 'CIMB' ? false : true
1257
+ }
1258
+ style={{
1259
+ backgroundColor: '#FFFFFF',
1260
+ paddingHorizontal: 16,
1261
+ paddingTop: 16,
1262
+ borderRadius: 8,
1263
+ borderWidth: 0.5,
1264
+ borderColor: '#E0E0E0',
1265
+ marginBottom: 16,
1266
+ }}
1267
+ onPress={() => {
1268
+ if (loan?.disbursementPartner === 'CIMB') {
1269
+ navigation.dispatch(
1270
+ StackActions.push(ScreenNames.DetailLoan, {
1271
+ loan,
1272
+ })
1273
+ );
1274
+ }
1275
+ }}
1276
+ >
1277
+ <View
1278
+ style={{ flexDirection: 'row', alignItems: 'center' }}
1279
+ >
1280
+ <ContractActive />
1281
+ <View style={{ flex: 1, paddingLeft: 8 }}>
1282
+ <MText style={commonStyles.textNormalBold}>
1283
+ Đơn vay-{loan?.id}
1284
+ </MText>
1285
+ <MText style={commonStyles.textNormal}>
1286
+ Số tiền vay (VND): {formatMoney(loan?.loanAmount)}
1287
+ </MText>
1288
+ </View>
1289
+ </View>
1290
+ <View
1291
+ style={{
1292
+ height: 1,
1293
+ backgroundColor: '#E0E0E0',
1294
+ marginVertical: 16,
1295
+ }}
1296
+ />
1297
+ <View
1298
+ style={{
1299
+ flexDirection: 'row',
1300
+ justifyContent: 'space-between',
1301
+ }}
1302
+ >
1303
+ <MText style={commonStyles.textNormal}>
1304
+ Ngày giải ngân
1305
+ </MText>
1306
+ <MText style={commonStyles.textNormalBold}>
1307
+ {formatDDMMYYY(loan?.disbursementAt)}
1308
+ </MText>
1309
+ </View>
1310
+ <View
1311
+ style={{
1312
+ height: 0.5,
1313
+ backgroundColor: '#E0E0E0',
1314
+ marginVertical: 16,
1315
+ }}
1316
+ />
1317
+ <View
1318
+ style={{
1319
+ flexDirection: 'row',
1320
+ justifyContent: 'space-between',
1321
+ }}
1322
+ >
1323
+ <MText style={commonStyles.textNormal}>
1324
+ Ngày kết thúc khoản vay
1325
+ </MText>
1326
+ <MText style={commonStyles.textNormalBold}>
1327
+ {formatDDMMYYY(loan?.finishAt)}
1328
+ </MText>
1329
+ </View>
1330
+ <View
1331
+ style={{
1332
+ height: 0.5,
1333
+ backgroundColor: '#E0E0E0',
1334
+ marginVertical: 16,
1335
+ }}
1336
+ />
1337
+ <View
1338
+ style={{
1339
+ flexDirection: 'row',
1340
+ justifyContent: 'space-between',
1341
+ }}
1342
+ >
1343
+ <MText style={commonStyles.textNormal}>
1344
+ Ngày đến hạn tiếp theo
1345
+ </MText>
1346
+ <MText style={commonStyles.textNormalBold}>
1347
+ {formatDDMMYYY(loan?.nextDate)}
1348
+ </MText>
1349
+ </View>
1350
+ <View
1351
+ style={{
1352
+ flexDirection: 'row',
1353
+ alignItems: 'center',
1354
+ backgroundColor: '#EAF5E4',
1355
+ marginHorizontal: -16,
1356
+ paddingVertical: 8,
1357
+ marginTop: 16,
1358
+ borderBottomRightRadius: 8,
1359
+ borderBottomLeftRadius: 8,
1360
+ paddingHorizontal: 16,
1361
+ }}
1362
+ >
1363
+ <Info />
1364
+ <MText
1365
+ style={[
1366
+ {
1367
+ fontWeight: '300',
1368
+ fontSize: 12,
1369
+ fontStyle: 'italic',
1370
+ color: '#333333',
1371
+ marginLeft: 8,
1372
+ },
1373
+ ]}
1374
+ >
1375
+ Thời gian tất toán còn lại là{' '}
1376
+ {diffDays(new Date(), loan?.finishAt)} ngày
1377
+ </MText>
1378
+ </View>
1379
+ </TouchableOpacity>
1380
+ </View>
1381
+ ))}
1382
+ </View>
1383
+ </View>
1384
+ </ScrollView>
1385
+
1063
1386
  <Modal
1064
1387
  isVisible={showModal}
1065
1388
  onDismiss={() => setShowModal(false)}
@@ -1093,6 +1416,146 @@ export const Home = observer(function Home() {
1093
1416
  </View>
1094
1417
  </SafeAreaView>
1095
1418
  </Modal>
1419
+ <Modal isVisible={showModal2}>
1420
+ <SafeAreaView style={{ backgroundColor: '#FFFFFF', borderRadius: 8 }}>
1421
+ <View>
1422
+ <Image
1423
+ source={
1424
+ homeStore?.listLoanPending?.isCimbApproveFull === true
1425
+ ? require('./accept.png')
1426
+ : require('./reject.png')
1427
+ }
1428
+ resizeMode="stretch"
1429
+ style={{
1430
+ width: '100%',
1431
+ height: (Dimensions.get('window').height / 2) * 0.8,
1432
+ }}
1433
+ />
1434
+ {homeStore?.listLoanPending?.isCimbApproveFull === true ? (
1435
+ <View style={{ padding: 24 }}>
1436
+ <MText
1437
+ style={{
1438
+ textAlign: 'center',
1439
+ fontWeight: 'bold',
1440
+ fontSize: 16,
1441
+ }}
1442
+ >
1443
+ Chúc mừng bạn!
1444
+ </MText>
1445
+ <MText
1446
+ style={[
1447
+ commonStyles.textNormal,
1448
+ { textAlign: 'center', color: '#828282', marginTop: 8 },
1449
+ ]}
1450
+ >
1451
+ Bạn đã được phê duyệt khoản vay từ CIMB với số tiền là{' '}
1452
+ {formatMoney(homeStore?.listLoanPending?.loanAmount)} VNĐ!
1453
+ </MText>
1454
+ <View
1455
+ style={{
1456
+ flexDirection: 'row',
1457
+ justifyContent: 'center',
1458
+ marginTop: 24,
1459
+ }}
1460
+ >
1461
+ <TouchableOpacity
1462
+ style={{
1463
+ borderWidth: 1,
1464
+ borderColor: color.primary,
1465
+ borderRadius: 30,
1466
+ paddingHorizontal: 48,
1467
+ paddingVertical: 8,
1468
+ }}
1469
+ onPress={() => {
1470
+ setShowModal2(false);
1471
+ navigation.push(ScreenNames.AcceptPolicy, {
1472
+ loan: homeStore?.listLoanPending,
1473
+ isCimb: true,
1474
+ });
1475
+ }}
1476
+ >
1477
+ <MText style={{ color: color.primary }}>Xác nhận</MText>
1478
+ </TouchableOpacity>
1479
+ </View>
1480
+ <TouchableOpacity
1481
+ style={{
1482
+ flexDirection: 'row',
1483
+ justifyContent: 'center',
1484
+ marginTop: 8,
1485
+ }}
1486
+ onPress={async () => {
1487
+ const response = await Api.getInstance().customerCancel({
1488
+ LoanBriefId: homeStore?.listLoanPending?.id,
1489
+ });
1490
+ if (response.kind === 'ok') {
1491
+ if (response.data.meta.errorCode === 200) {
1492
+ setShowModal2(false);
1493
+ const key = `SHOW_${homeStore.listLoanPending.id}`;
1494
+ save(key, true);
1495
+ Alert.alert('Thông báo', 'Huỷ đơn thành công');
1496
+ onRefresh();
1497
+ }
1498
+ } else {
1499
+ Alert.alert('Có lỗi xảy ra. Vui lòng thử lại sau!');
1500
+ }
1501
+ }}
1502
+ >
1503
+ <MText style={{ color: '#BDBDBD' }}>Huỷ</MText>
1504
+ </TouchableOpacity>
1505
+ </View>
1506
+ ) : (
1507
+ <View style={{ padding: 24 }}>
1508
+ <MText
1509
+ style={{
1510
+ color: color.primary,
1511
+ textAlign: 'center',
1512
+ fontWeight: 'bold',
1513
+ }}
1514
+ >
1515
+ Hồ sơ của bạn chưa thỏa mãn điều kiện cho vay của ngân hàng
1516
+ CIMB
1517
+ </MText>
1518
+ <MText
1519
+ style={{
1520
+ textAlign: 'center',
1521
+ marginTop: 8,
1522
+ fontSize: 12,
1523
+ }}
1524
+ >
1525
+ Bạn vui lòng hoàn thiện các bước tiếp theo để được giới thiệu
1526
+ vay qua nhà đầu tư khác.
1527
+ </MText>
1528
+ <View
1529
+ style={{
1530
+ flexDirection: 'row',
1531
+ justifyContent: 'center',
1532
+ marginTop: 24,
1533
+ }}
1534
+ >
1535
+ <TouchableOpacity
1536
+ style={{
1537
+ borderWidth: 1,
1538
+ borderColor: color.primary,
1539
+ borderRadius: 30,
1540
+ paddingHorizontal: 48,
1541
+ paddingVertical: 8,
1542
+ }}
1543
+ onPress={() => {
1544
+ setShowModal2(false);
1545
+ navigation.push(ScreenNames.AcceptPolicy, {
1546
+ loan: homeStore?.listLoanPending,
1547
+ isCimb: false,
1548
+ });
1549
+ }}
1550
+ >
1551
+ <MText style={{ color: color.primary }}>Tiếp tục</MText>
1552
+ </TouchableOpacity>
1553
+ </View>
1554
+ </View>
1555
+ )}
1556
+ </View>
1557
+ </SafeAreaView>
1558
+ </Modal>
1096
1559
  </View>
1097
1560
  );
1098
1561
  });