react-native-timacare 3.1.13-beta → 3.1.15-beta

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 (139) hide show
  1. package/lib/commonjs/assets/svgs/edit_disable.svg +15 -0
  2. package/lib/commonjs/assets/svgs/ekyc_disable.svg +4 -0
  3. package/lib/commonjs/assets/svgs/expand.svg +8 -0
  4. package/lib/commonjs/assets/svgs/expand_up.svg +8 -0
  5. package/lib/commonjs/assets/svgs/index.js +1 -1
  6. package/lib/commonjs/assets/svgs/index.js.flow +16 -0
  7. package/lib/commonjs/assets/svgs/index.js.map +1 -1
  8. package/lib/commonjs/assets/svgs/money.svg +5 -0
  9. package/lib/commonjs/assets/svgs/sign_disable.svg +12 -0
  10. package/lib/commonjs/assets/svgs/sign_success.svg +12 -0
  11. package/lib/commonjs/assets/svgs/tima_16.svg +13 -0
  12. package/lib/commonjs/screens/home/index.js +1 -1
  13. package/lib/commonjs/screens/home/index.js.flow +2242 -1617
  14. package/lib/commonjs/screens/home/index.js.map +1 -1
  15. package/lib/commonjs/screens/liveness-v2/index.js +1 -1
  16. package/lib/commonjs/screens/liveness-v2/index.js.flow +10 -6
  17. package/lib/commonjs/screens/liveness-v2/index.js.map +1 -1
  18. package/lib/commonjs/screens/register/index.js +1 -1
  19. package/lib/commonjs/screens/register/index.js.flow +1 -1
  20. package/lib/commonjs/screens/toan-trinh-so/LoanInterestRate.js +1 -1
  21. package/lib/commonjs/screens/toan-trinh-so/LoanInterestRate.js.flow +123 -36
  22. package/lib/commonjs/screens/toan-trinh-so/LoanInterestRate.js.map +1 -1
  23. package/lib/commonjs/screens/toan-trinh-so/OCR.js +1 -1
  24. package/lib/commonjs/screens/toan-trinh-so/OCR.js.flow +3 -1
  25. package/lib/commonjs/screens/toan-trinh-so/OCR.js.map +1 -1
  26. package/lib/commonjs/screens/toan-trinh-so/RegisterCamera.js +1 -1
  27. package/lib/commonjs/screens/toan-trinh-so/RegisterCamera.js.flow +3 -1
  28. package/lib/commonjs/screens/toan-trinh-so/RegisterCamera.js.map +1 -1
  29. package/lib/commonjs/screens/toan-trinh-so/ReviewInformation.js +1 -1
  30. package/lib/commonjs/screens/toan-trinh-so/ReviewInformation.js.flow +538 -510
  31. package/lib/commonjs/screens/toan-trinh-so/ReviewInformation.js.map +1 -1
  32. package/lib/commonjs/screens/toan-trinh-so/ReviewInformationOther.js +1 -1
  33. package/lib/commonjs/screens/toan-trinh-so/ReviewInformationOther.js.flow +76 -57
  34. package/lib/commonjs/screens/toan-trinh-so/ReviewInformationOther.js.map +1 -1
  35. package/lib/commonjs/screens/toan-trinh-so/ReviewLoan.js +1 -1
  36. package/lib/commonjs/screens/toan-trinh-so/ReviewLoan.js.flow +58 -12
  37. package/lib/commonjs/screens/toan-trinh-so/ReviewLoan.js.map +1 -1
  38. package/lib/commonjs/screens/toan-trinh-so/TTSOTP.js +1 -1
  39. package/lib/commonjs/screens/toan-trinh-so/TTSOTP.js.flow +6 -7
  40. package/lib/commonjs/screens/toan-trinh-so/TTSOTP.js.map +1 -1
  41. package/lib/commonjs/screens/toan-trinh-so/TTSSignLoan.js +1 -1
  42. package/lib/commonjs/screens/toan-trinh-so/TTSSignLoan.js.flow +185 -50
  43. package/lib/commonjs/screens/toan-trinh-so/TTSSignLoan.js.map +1 -1
  44. package/lib/commonjs/screens/toan-trinh-so/VehicleCamera.js +1 -1
  45. package/lib/commonjs/screens/toan-trinh-so/VehicleCamera.js.flow +3 -1
  46. package/lib/commonjs/screens/toan-trinh-so/VehicleCamera.js.map +1 -1
  47. package/lib/commonjs/screens/toan-trinh-so/store.js +1 -1
  48. package/lib/commonjs/screens/toan-trinh-so/store.js.flow +23 -1
  49. package/lib/commonjs/screens/toan-trinh-so/store.js.map +1 -1
  50. package/lib/commonjs/services/api/api.js +1 -1
  51. package/lib/commonjs/services/api/api.js.flow +46 -0
  52. package/lib/commonjs/services/api/api.js.map +1 -1
  53. package/lib/commonjs/utils/index.js +1 -1
  54. package/lib/commonjs/utils/index.js.flow +51 -0
  55. package/lib/commonjs/utils/index.js.map +1 -1
  56. package/lib/module/assets/svgs/edit_disable.svg +15 -0
  57. package/lib/module/assets/svgs/ekyc_disable.svg +4 -0
  58. package/lib/module/assets/svgs/expand.svg +8 -0
  59. package/lib/module/assets/svgs/expand_up.svg +8 -0
  60. package/lib/module/assets/svgs/index.js +1 -1
  61. package/lib/module/assets/svgs/index.js.map +1 -1
  62. package/lib/module/assets/svgs/money.svg +5 -0
  63. package/lib/module/assets/svgs/sign_disable.svg +12 -0
  64. package/lib/module/assets/svgs/sign_success.svg +12 -0
  65. package/lib/module/assets/svgs/tima_16.svg +13 -0
  66. package/lib/module/screens/home/index.js +1 -1
  67. package/lib/module/screens/home/index.js.map +1 -1
  68. package/lib/module/screens/liveness-v2/index.js +1 -1
  69. package/lib/module/screens/liveness-v2/index.js.map +1 -1
  70. package/lib/module/screens/register/index.js +1 -1
  71. package/lib/module/screens/toan-trinh-so/LoanInterestRate.js +1 -1
  72. package/lib/module/screens/toan-trinh-so/LoanInterestRate.js.map +1 -1
  73. package/lib/module/screens/toan-trinh-so/OCR.js +1 -1
  74. package/lib/module/screens/toan-trinh-so/OCR.js.map +1 -1
  75. package/lib/module/screens/toan-trinh-so/RegisterCamera.js +1 -1
  76. package/lib/module/screens/toan-trinh-so/RegisterCamera.js.map +1 -1
  77. package/lib/module/screens/toan-trinh-so/ReviewInformation.js +1 -1
  78. package/lib/module/screens/toan-trinh-so/ReviewInformation.js.map +1 -1
  79. package/lib/module/screens/toan-trinh-so/ReviewInformationOther.js +1 -1
  80. package/lib/module/screens/toan-trinh-so/ReviewInformationOther.js.map +1 -1
  81. package/lib/module/screens/toan-trinh-so/ReviewLoan.js +1 -1
  82. package/lib/module/screens/toan-trinh-so/ReviewLoan.js.map +1 -1
  83. package/lib/module/screens/toan-trinh-so/TTSOTP.js +1 -1
  84. package/lib/module/screens/toan-trinh-so/TTSOTP.js.map +1 -1
  85. package/lib/module/screens/toan-trinh-so/TTSSignLoan.js +1 -1
  86. package/lib/module/screens/toan-trinh-so/TTSSignLoan.js.map +1 -1
  87. package/lib/module/screens/toan-trinh-so/VehicleCamera.js +1 -1
  88. package/lib/module/screens/toan-trinh-so/VehicleCamera.js.map +1 -1
  89. package/lib/module/screens/toan-trinh-so/store.js +1 -1
  90. package/lib/module/screens/toan-trinh-so/store.js.map +1 -1
  91. package/lib/module/services/api/api.js +1 -1
  92. package/lib/module/services/api/api.js.map +1 -1
  93. package/lib/module/utils/index.js +1 -1
  94. package/lib/module/utils/index.js.map +1 -1
  95. package/lib/typescript/assets/svgs/index.d.ts +9 -1
  96. package/lib/typescript/assets/svgs/index.d.ts.map +1 -1
  97. package/lib/typescript/screens/home/index.d.ts.map +1 -1
  98. package/lib/typescript/screens/liveness-v2/index.d.ts.map +1 -1
  99. package/lib/typescript/screens/toan-trinh-so/LoanInterestRate.d.ts.map +1 -1
  100. package/lib/typescript/screens/toan-trinh-so/OCR.d.ts.map +1 -1
  101. package/lib/typescript/screens/toan-trinh-so/RegisterCamera.d.ts.map +1 -1
  102. package/lib/typescript/screens/toan-trinh-so/ReviewInformation.d.ts.map +1 -1
  103. package/lib/typescript/screens/toan-trinh-so/ReviewInformationOther.d.ts.map +1 -1
  104. package/lib/typescript/screens/toan-trinh-so/ReviewLoan.d.ts.map +1 -1
  105. package/lib/typescript/screens/toan-trinh-so/TTSOTP.d.ts +1 -1
  106. package/lib/typescript/screens/toan-trinh-so/TTSOTP.d.ts.map +1 -1
  107. package/lib/typescript/screens/toan-trinh-so/TTSSignLoan.d.ts.map +1 -1
  108. package/lib/typescript/screens/toan-trinh-so/VehicleCamera.d.ts.map +1 -1
  109. package/lib/typescript/screens/toan-trinh-so/store.d.ts +2 -0
  110. package/lib/typescript/screens/toan-trinh-so/store.d.ts.map +1 -1
  111. package/lib/typescript/services/api/api.d.ts +48 -0
  112. package/lib/typescript/services/api/api.d.ts.map +1 -1
  113. package/lib/typescript/utils/index.d.ts +8 -0
  114. package/lib/typescript/utils/index.d.ts.map +1 -1
  115. package/package.json +1 -1
  116. package/src/assets/svgs/edit_disable.svg +15 -0
  117. package/src/assets/svgs/ekyc_disable.svg +4 -0
  118. package/src/assets/svgs/expand.svg +8 -0
  119. package/src/assets/svgs/expand_up.svg +8 -0
  120. package/src/assets/svgs/index.tsx +16 -0
  121. package/src/assets/svgs/money.svg +5 -0
  122. package/src/assets/svgs/sign_disable.svg +12 -0
  123. package/src/assets/svgs/sign_success.svg +12 -0
  124. package/src/assets/svgs/tima_16.svg +13 -0
  125. package/src/screens/home/index.tsx +2242 -1617
  126. package/src/screens/liveness-v2/index.tsx +10 -6
  127. package/src/screens/register/index.tsx +1 -1
  128. package/src/screens/toan-trinh-so/LoanInterestRate.tsx +123 -36
  129. package/src/screens/toan-trinh-so/OCR.tsx +3 -1
  130. package/src/screens/toan-trinh-so/RegisterCamera.tsx +3 -1
  131. package/src/screens/toan-trinh-so/ReviewInformation.tsx +538 -510
  132. package/src/screens/toan-trinh-so/ReviewInformationOther.tsx +76 -57
  133. package/src/screens/toan-trinh-so/ReviewLoan.tsx +58 -12
  134. package/src/screens/toan-trinh-so/TTSOTP.tsx +6 -7
  135. package/src/screens/toan-trinh-so/TTSSignLoan.tsx +185 -50
  136. package/src/screens/toan-trinh-so/VehicleCamera.tsx +3 -1
  137. package/src/screens/toan-trinh-so/store.ts +23 -1
  138. package/src/services/api/api.ts +46 -0
  139. package/src/utils/index.tsx +51 -0
@@ -568,12 +568,16 @@ export const LivenessV2 = observer(function LivenessV2(props: any) {
568
568
  }}
569
569
  onPress={() => {
570
570
  livenessStore.ekycSuccess = false;
571
- navigation.dispatch(
572
- CommonActions.reset({
573
- index: 1,
574
- routes: [{ name: ScreenNames.Main }],
575
- })
576
- );
571
+ if (loan?.typeLoan === 5) {
572
+ navigation.push(ScreenNames.TTSSignLoan, { loan });
573
+ } else {
574
+ navigation.dispatch(
575
+ CommonActions.reset({
576
+ index: 1,
577
+ routes: [{ name: ScreenNames.Main }],
578
+ })
579
+ );
580
+ }
577
581
  }}
578
582
  >
579
583
  <MText style={[commonStyles.textNormalBold, { color: 'white' }]}>
@@ -184,7 +184,7 @@ export const Register = observer(function Register() {
184
184
  <View style={{ marginTop: 50 }}>
185
185
  <Formik
186
186
  initialValues={{
187
- phone: __DEV__ ? '0839621578' : '',
187
+ phone: __DEV__ ? '0339223176' : '',
188
188
  terms: true,
189
189
  }}
190
190
  onSubmit={(values) => {
@@ -1,20 +1,53 @@
1
1
  //@ts-nocheck
2
- import React from 'react';
3
- import { ScrollView, TextStyle, View, ViewStyle } from 'react-native';
2
+ import React, { useEffect } from 'react';
3
+ import { Alert, ScrollView, TextStyle, View, ViewStyle } from 'react-native';
4
4
  import { commonStyles } from '../CommonStyles';
5
5
  import MHeader from '../../components/MHeader';
6
6
  import { MText } from '../../components/MText';
7
7
  import { CommonActions, useNavigation } from '@react-navigation/native';
8
- import { formatMoney } from '../../utils';
8
+ import { formatDDMMYYY, formatMoney } from '../../utils';
9
9
  import { IconNotify } from '../../assets/svgs';
10
10
  import MButton from '../../components/MButton';
11
11
  import LinearGradient from 'react-native-linear-gradient';
12
12
  import { ScreenNames } from '../../navigation';
13
+ import { Api } from '../../services/api';
14
+ import Loading from '../../components/Loading';
13
15
 
14
16
  export default function LoanInterestRate(props) {
15
17
  const loan = props?.route?.params?.loan;
16
18
 
17
19
  const navigation = useNavigation();
20
+ const [isLoading, setIsLoading] = React.useState(false);
21
+ const [data, setData] = React.useState(null);
22
+
23
+ const getData = async () => {
24
+ setIsLoading(true);
25
+ try {
26
+ const response = await Api.getInstance().getPaymentPlan(loan?.id);
27
+ setIsLoading(false);
28
+ if (response.kind === 'ok') {
29
+ if (response.data?.meta?.errorCode === 200) {
30
+ setData(response.data?.data);
31
+ } else {
32
+ Alert.alert(
33
+ 'Thông báo',
34
+ response.data?.meta?.message ||
35
+ 'Có lỗi xảy ra, vui lòng thử lại sau'
36
+ );
37
+ }
38
+ } else {
39
+ Alert.alert('Thông báo', 'Có lỗi xảy ra, vui lòng thử lại sau');
40
+ }
41
+ } catch (error) {
42
+ console.error('Error fetching data:', error);
43
+ setIsLoading(false);
44
+ Alert.alert('Thông báo', 'Có lỗi xảy ra, vui lòng thử lại sau');
45
+ }
46
+ };
47
+
48
+ useEffect(() => {
49
+ getData();
50
+ }, []);
18
51
 
19
52
  return (
20
53
  <View style={commonStyles.fill}>
@@ -56,7 +89,7 @@ export default function LoanInterestRate(props) {
56
89
  fontWeight: 'bold',
57
90
  }}
58
91
  >
59
- HD-{loan?.id}
92
+ HD-{data?.loanBriefId}
60
93
  </MText>
61
94
  </View>
62
95
  <MText
@@ -92,7 +125,7 @@ export default function LoanInterestRate(props) {
92
125
  fontWeight: 'bold',
93
126
  }}
94
127
  >
95
- {formatMoney(loan?.loanAmount)} đ
128
+ {formatMoney(data?.totalMoney)} đ
96
129
  </MText>
97
130
  </View>
98
131
  <View
@@ -118,7 +151,7 @@ export default function LoanInterestRate(props) {
118
151
  color: '#333333',
119
152
  }}
120
153
  >
121
- {formatMoney(loan?.loanAmount)} đ
154
+ {formatMoney(data?.totalLoanAmount)} đ
122
155
  </MText>
123
156
  </View>
124
157
  <View
@@ -144,7 +177,7 @@ export default function LoanInterestRate(props) {
144
177
  color: '#333333',
145
178
  }}
146
179
  >
147
- {formatMoney(loan?.loanAmount)} đ
180
+ {formatMoney(data?.totalMoneyInsurance)} đ
148
181
  </MText>
149
182
  </View>
150
183
  <MText
@@ -180,7 +213,7 @@ export default function LoanInterestRate(props) {
180
213
  fontWeight: 'bold',
181
214
  }}
182
215
  >
183
- 12 tháng
216
+ {data?.loanTime} tháng
184
217
  </MText>
185
218
  </View>
186
219
  <View
@@ -206,7 +239,7 @@ export default function LoanInterestRate(props) {
206
239
  fontWeight: 'bold',
207
240
  }}
208
241
  >
209
- 16/05/2023
242
+ {formatDDMMYYY(data?.expectedDisbursementDate)}
210
243
  </MText>
211
244
  </View>
212
245
  </View>
@@ -260,6 +293,60 @@ export default function LoanInterestRate(props) {
260
293
  Tổng trả kỳ
261
294
  </MText>
262
295
  </View>
296
+ {data?.listPaymentSchedule?.map((item, index) => (
297
+ <View
298
+ key={index}
299
+ style={{
300
+ flexDirection: 'row',
301
+ paddingHorizontal: 16,
302
+ paddingVertical: 16,
303
+ borderBottomWidth: 1,
304
+ borderBottomColor: '#F0F0F0',
305
+ }}
306
+ >
307
+ <MText
308
+ style={{
309
+ fontSize: 10,
310
+ color: '#333333',
311
+ width: '25%',
312
+ textAlign: 'center',
313
+ }}
314
+ >
315
+ {item?.payDate}
316
+ </MText>
317
+ <MText
318
+ style={{
319
+ fontSize: 10,
320
+ color: '#333333',
321
+ width: '25%',
322
+ textAlign: 'center',
323
+ }}
324
+ >
325
+ {formatMoney(item?.moneyOriginal)} đ
326
+ </MText>
327
+ <MText
328
+ style={{
329
+ fontSize: 10,
330
+ color: '#333333',
331
+ width: '25%',
332
+ textAlign: 'center',
333
+ }}
334
+ >
335
+ {formatMoney(item?.totalInterest)} đ
336
+ </MText>
337
+ <MText
338
+ style={{
339
+ fontSize: 10,
340
+ color: 'rgba(239, 89, 46, 1)',
341
+ width: '25%',
342
+ textAlign: 'center',
343
+ fontWeight: 'bold',
344
+ }}
345
+ >
346
+ {formatMoney(item?.totalMoneyNeedPayment)} đ
347
+ </MText>
348
+ </View>
349
+ ))}
263
350
 
264
351
  <MText style={$des}>
265
352
  <MText style={{ fontSize: 10, color: '#E40010' }}>*</MText> Đây là
@@ -303,41 +390,41 @@ export default function LoanInterestRate(props) {
303
390
  được giải ngân nhanh nhất!
304
391
  </MText>
305
392
  </View>
306
-
307
- <MButton
308
- onPress={() => {
309
- navigation.push(ScreenNames.LivenessV2, { loan });
310
- }}
393
+ </ScrollView>
394
+ <MButton
395
+ onPress={() => {
396
+ navigation.push(ScreenNames.LivenessV2, { loan });
397
+ }}
398
+ style={{
399
+ marginVertical: 24,
400
+ marginHorizontal: 16,
401
+ }}
402
+ >
403
+ <LinearGradient
404
+ start={{ x: 1, y: 0 }}
405
+ end={{ x: 0, y: 1 }}
311
406
  style={{
312
- marginVertical: 24,
313
- marginHorizontal: 16,
407
+ height: 40,
408
+ marginVertical: 16,
409
+ borderRadius: 30,
410
+ alignItems: 'center',
411
+ justifyContent: 'center',
314
412
  }}
413
+ colors={['#FF7A00', '#EF4123']}
315
414
  >
316
- <LinearGradient
317
- start={{ x: 1, y: 0 }}
318
- end={{ x: 0, y: 1 }}
415
+ <MText
319
416
  style={{
320
- height: 40,
321
- marginVertical: 16,
322
- borderRadius: 30,
323
- alignItems: 'center',
324
- justifyContent: 'center',
417
+ color: 'white',
418
+ fontSize: 16,
325
419
  }}
326
- colors={['#FF7A00', '#EF4123']}
327
420
  >
328
- <MText
329
- style={{
330
- color: 'white',
331
- fontSize: 16,
332
- }}
333
- >
334
- Đi tới eKYC
335
- </MText>
336
- </LinearGradient>
337
- </MButton>
338
- </ScrollView>
421
+ Đi tới eKYC
422
+ </MText>
423
+ </LinearGradient>
424
+ </MButton>
339
425
  </View>
340
426
  </View>
427
+ <Loading isLoading={isLoading} />
341
428
  </View>
342
429
  );
343
430
  }
@@ -264,12 +264,14 @@ export const OCR = observer(function OCR(props: any) {
264
264
  const takePhoto = async () => {
265
265
  setTaking(true);
266
266
  const options = {
267
- width: 720,
267
+ // width: 720,
268
268
  base64: true,
269
269
  pauseAfterCapture: true,
270
270
  fixOrientation: false,
271
271
  forceUpOrientation: false,
272
272
  orientation: RNCamera.Constants.Orientation.portrait,
273
+ quality: 0.8,
274
+ pictureSize: '1280x720',
273
275
  };
274
276
  const data = await myCamera.current.takePictureAsync(options);
275
277
  setTaking(false);
@@ -143,7 +143,7 @@ export default function RegisterCamera(props: any) {
143
143
  const takePhoto = async () => {
144
144
  setTaking(true);
145
145
  const options = {
146
- width: 720,
146
+ // width: 720,
147
147
  pauseAfterCapture: true,
148
148
  fixOrientation: false,
149
149
  forceUpOrientation: false,
@@ -252,6 +252,8 @@ export default function RegisterCamera(props: any) {
252
252
  buttonPositive: 'Ok',
253
253
  buttonNegative: 'Cancel',
254
254
  }}
255
+ quality={0.8}
256
+ pictureSize="1280x720"
255
257
  >
256
258
  {({ camera, status, recordAudioPermissionStatus }) => {
257
259
  if (status !== 'READY') return <ActivityIndicator />;