react-native-timacare 0.0.9 → 0.0.11

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
Binary file
@@ -27,16 +27,24 @@ import { myLog } from '../../utils/log';
27
27
  import { MText } from '../../components/MText';
28
28
  import livenessStore from './LivenessStore';
29
29
  import RNFS, { CachesDirectoryPath } from 'react-native-fs';
30
- // import { RNFFmpeg } from "react-native-ffmpeg"
30
+ import { RNFFmpeg } from 'react-native-ffmpeg';
31
31
  import { ScreenNames } from '../../navigation';
32
32
  import selfieStore from '../selfie/SelfieStore';
33
33
  import Slack from 'react-native-slack-webhook';
34
34
  import Loading from '../../components/Loading';
35
+ import { Api } from '../../services/api';
35
36
  const webHookURL =
36
37
  'https://hooks.slack.com/services/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';
37
38
 
38
39
  export const LiveNess = observer(function LiveNess(props: any) {
39
40
  const navigation = useNavigation();
41
+ const [isLoading, setIsLoading] = useState(false);
42
+ const [ekycSuccess, setEkycSuccess] = useState(false);
43
+ const [recording, setRecording] = useState(false);
44
+ const [hintAction, setHintAction] = useState(
45
+ 'Vui lòng bấm bắt đầu và thực hiện\ncác hành động theo yêu cầu'
46
+ );
47
+
40
48
  const [passPermission, setPassPermission] = useState(false);
41
49
  const [flash, setFlash] = useState(false);
42
50
  const [front, setFront] = useState(true);
@@ -54,68 +62,101 @@ export const LiveNess = observer(function LiveNess(props: any) {
54
62
  ];
55
63
 
56
64
  const uploadLiveness = async (template) => {
57
- try {
65
+ if (loan?.typeLoan === 4) {
58
66
  const listImage = [];
59
- const imgSelfie = await RNFS.readFile(selfieStore.photo, 'base64');
60
-
61
67
  for (let i = 1; i <= 20; i++) {
62
68
  const file = 'file://' + template + `_img_${('000' + i).slice(-4)}.jpg`;
63
69
  const imgBase64 = await RNFS.readFile(file, 'base64');
64
70
  listImage.push(imgBase64);
65
71
  }
72
+ myLog('call api 2 uploadLiveness');
73
+ const response = await Api.getInstance().uploadLivenessV2({
74
+ loanBriefId: loan?.id,
75
+ files: listImage,
76
+ selfie: null,
77
+ });
78
+ setIsLoading(false);
79
+ if (response.kind === 'ok') {
80
+ if (response.data.meta.errorCode === 200) {
81
+ setEkycSuccess(true);
82
+ myLog('data', response.data.data);
83
+ } else {
84
+ Alert.alert(response.data.meta.errorMessage);
85
+ }
86
+ } else {
87
+ Alert.alert('Lỗi đã xảy ra. Vui lòng thực hiện lại');
88
+ }
89
+ try {
90
+ } catch (error) {
91
+ myLog(e);
92
+ }
93
+ } else {
94
+ try {
95
+ const listImage = [];
96
+ const imgSelfie = await RNFS.readFile(selfieStore.photo, 'base64');
97
+ for (let i = 1; i <= 20; i++) {
98
+ const file =
99
+ 'file://' + template + `_img_${('000' + i).slice(-4)}.jpg`;
100
+ const imgBase64 = await RNFS.readFile(file, 'base64');
101
+ listImage.push(imgBase64);
102
+ }
66
103
 
67
- await livenessStore.uploadLiveness(
68
- {
69
- loanBriefId: loan.id,
70
- files: listImage,
71
- selfie: imgSelfie,
72
- },
73
- () => {
74
- try {
75
- new Slack(webHookURL).post(
76
- JSON.stringify({
77
- loanID: loan?.id,
78
- eKYC: 'Success',
79
- }),
80
- '#timacare'
81
- );
82
- } catch (e) {}
83
- RNFS.unlink(livenessStore.videoFile);
84
- for (let i = 1; i <= 20; i++) {
85
- const file =
86
- 'file://' + template + `_img_${('000' + i).slice(-4)}.jpg`;
87
- RNFS.unlink(file);
88
- }
89
- },
90
- (errorMessage) => {
91
- try {
92
- new Slack(webHookURL).post(
93
- JSON.stringify({
94
- loanID: loan.id,
95
- eKYC: 'Fail',
96
- }),
97
- '#timacare'
98
- );
99
- } catch (e) {}
100
- Alert.alert('Thông báo', errorMessage, [
101
- {
102
- text: 'Đồng ý',
103
- onPress: () => {
104
- setPassPermission(false);
105
- setTimeout(() => {
106
- setPassPermission(true);
107
- }, 100);
104
+ await livenessStore.uploadLiveness(
105
+ {
106
+ loanBriefId: loan.id,
107
+ files: listImage,
108
+ selfie: imgSelfie,
109
+ },
110
+ () => {
111
+ setEkycSuccess(true);
112
+ try {
113
+ new Slack(webHookURL).post(
114
+ JSON.stringify({
115
+ loanID: loan?.id,
116
+ eKYC: 'Success',
117
+ }),
118
+ '#timacare'
119
+ );
120
+ } catch (e) {}
121
+ RNFS.unlink(livenessStore.videoFile);
122
+ for (let i = 1; i <= 20; i++) {
123
+ const file =
124
+ 'file://' + template + `_img_${('000' + i).slice(-4)}.jpg`;
125
+ RNFS.unlink(file);
126
+ }
127
+ },
128
+ (errorMessage) => {
129
+ try {
130
+ new Slack(webHookURL).post(
131
+ JSON.stringify({
132
+ loanID: loan?.id,
133
+ eKYC: 'Fail',
134
+ }),
135
+ '#timacare'
136
+ );
137
+ } catch (e) {}
138
+ Alert.alert('Thông báo', errorMessage, [
139
+ {
140
+ text: 'Đồng ý',
141
+ onPress: () => {
142
+ setPassPermission(false);
143
+ setTimeout(() => {
144
+ setPassPermission(true);
145
+ }, 100);
146
+ },
108
147
  },
109
- },
110
- ]);
111
- }
112
- );
113
- } catch (e) {}
148
+ ]);
149
+ }
150
+ );
151
+ } catch (e) {
152
+ myLog(e);
153
+ }
154
+ }
114
155
  };
115
156
 
116
157
  const captureFromVideo = async (videoFile) => {
117
158
  if (!livenessStore.cancel) {
118
- livenessStore.isLoading = true;
159
+ setIsLoading(true);
119
160
  const time = new Date().getTime();
120
161
  const template = CachesDirectoryPath + '/' + time;
121
162
  const output = template + '_img_%04d.jpg';
@@ -123,6 +164,7 @@ export const LiveNess = observer(function LiveNess(props: any) {
123
164
  myLog(`FFmpeg process exited with rc=${result}.`);
124
165
  if (result === 0) {
125
166
  uploadLiveness(template);
167
+ myLog('FFmpeg template', template);
126
168
  } else {
127
169
  Alert.alert(
128
170
  'Thông báo',
@@ -141,10 +183,12 @@ export const LiveNess = observer(function LiveNess(props: any) {
141
183
  livenessStore.counter += 1;
142
184
  if (livenessStore.counter < 20) {
143
185
  if ((livenessStore.counter + 1) % 4 === 0) {
186
+ setHintAction(actions[Math.round(Math.random() * actions.length)]);
144
187
  livenessStore.hintAction =
145
188
  actions[Math.round(Math.random() * actions.length)];
146
189
  }
147
190
  } else {
191
+ setHintAction('');
148
192
  livenessStore.hintAction = '';
149
193
  clearInterval(livenessStore.interval);
150
194
  }
@@ -162,7 +206,7 @@ export const LiveNess = observer(function LiveNess(props: any) {
162
206
 
163
207
  const recordVideo = async () => {
164
208
  if (myCamera) {
165
- livenessStore.recording = true;
209
+ setRecording(true);
166
210
  const videoFile =
167
211
  CachesDirectoryPath + '/' + new Date().getTime() + '.mp4';
168
212
  const options = {
@@ -176,8 +220,7 @@ export const LiveNess = observer(function LiveNess(props: any) {
176
220
  startLiveNess();
177
221
  const data = await myCamera.current.recordAsync(options);
178
222
  if (data.uri) {
179
- // livenessStore.videoFile = data.uri
180
- livenessStore.recording = false;
223
+ setRecording(false);
181
224
  captureFromVideo(data.uri);
182
225
  } else {
183
226
  Alert.alert(
@@ -196,54 +239,51 @@ export const LiveNess = observer(function LiveNess(props: any) {
196
239
  ).then((result) => {
197
240
  switch (result) {
198
241
  case RESULTS.UNAVAILABLE:
199
- console.log(
200
- 'This feature is not available (on this device / in this context)'
242
+ Alert.alert(
243
+ 'Thông báo',
244
+ 'Máy ảnh trên thiết bị không tương thích.\nVui lòng kiểm tra lại thiết bị!',
245
+ [{ text: 'Đồng ý' }]
201
246
  );
202
- // Alert.alert(
203
- // "Thông báo",
204
- // "Máy ảnh trên thiết bị không tương thích.\nVui lòng kiểm tra lại thiết bị!",
205
- // [{ text: "Đồng ý" }],
206
- // )
207
247
  break;
208
248
  case RESULTS.DENIED:
209
249
  console.log(
210
250
  'The permission has not been requested / is denied but requestable'
211
251
  );
212
- // Alert.alert(
213
- // "Thông báo",
214
- // "Bạn đã từ chối quyền máy ảnh. Vui lòng cấp quyền máy ảnh để tiếp tục!",
215
- // [
216
- // {
217
- // text: "Đồng ý",
218
- // // onPress: () => {
219
- // // if (Platform.OS === "ios") {
220
- // // openSettings()
221
- // // } else {
222
- // // requestPermissions()
223
- // // }
224
- // // },
225
- // },
226
- // ],
227
- // )
252
+ Alert.alert(
253
+ 'Thông báo',
254
+ 'Bạn đã từ chối quyền máy ảnh. Vui lòng cấp quyền máy ảnh để tiếp tục!',
255
+ [
256
+ {
257
+ text: 'Đồng ý',
258
+ onPress: () => {
259
+ if (Platform.OS === 'ios') {
260
+ openSettings();
261
+ } else {
262
+ requestPermissions();
263
+ }
264
+ },
265
+ },
266
+ ]
267
+ );
228
268
  break;
229
269
  case RESULTS.LIMITED:
230
270
  console.log('The permission is limited: some actions are possible');
231
- // Alert.alert(
232
- // "Thông báo",
233
- // "Quyền máy ảnh bị hạn chế. Vui lòng kiểm tra lại để tiếp tục!",
234
- // [
235
- // {
236
- // text: "Đồng ý",
237
- // onPress: () => {
238
- // if (Platform.OS === "ios") {
239
- // openSettings()
240
- // } else {
241
- // requestPermissions()
242
- // }
243
- // },
244
- // },
245
- // ],
246
- // )
271
+ Alert.alert(
272
+ 'Thông báo',
273
+ 'Quyền máy ảnh bị hạn chế. Vui lòng kiểm tra lại để tiếp tục!',
274
+ [
275
+ {
276
+ text: 'Đồng ý',
277
+ onPress: () => {
278
+ if (Platform.OS === 'ios') {
279
+ openSettings();
280
+ } else {
281
+ requestPermissions();
282
+ }
283
+ },
284
+ },
285
+ ]
286
+ );
247
287
  break;
248
288
  case RESULTS.GRANTED:
249
289
  console.log('The permission is granted');
@@ -251,22 +291,22 @@ export const LiveNess = observer(function LiveNess(props: any) {
251
291
  break;
252
292
  case RESULTS.BLOCKED:
253
293
  console.log('The permission is denied and not requestable anymore');
254
- // Alert.alert(
255
- // "Thông báo",
256
- // "Bạn đã từ chối quyền máy ảnh. Vui lòng cấp quyền máy ảnh để tiếp tục!",
257
- // [
258
- // {
259
- // text: "Đồng ý",
260
- // // onPress: () => {
261
- // // if (Platform.OS === "ios") {
262
- // // openSettings()
263
- // // } else {
264
- // // openSettings()
265
- // // }
266
- // // },
267
- // },
268
- // ],
269
- // )
294
+ Alert.alert(
295
+ 'Thông báo',
296
+ 'Bạn đã từ chối quyền máy ảnh. Vui lòng cấp quyền máy ảnh để tiếp tục!',
297
+ [
298
+ {
299
+ text: 'Đồng ý',
300
+ onPress: () => {
301
+ if (Platform.OS === 'ios') {
302
+ openSettings();
303
+ } else {
304
+ openSettings();
305
+ }
306
+ },
307
+ },
308
+ ]
309
+ );
270
310
  break;
271
311
  }
272
312
  });
@@ -285,7 +325,7 @@ export const LiveNess = observer(function LiveNess(props: any) {
285
325
  clearInterval(livenessStore.interval);
286
326
  clearInterval(livenessStore.intervalFace);
287
327
  RNFFmpeg.cancel();
288
- livenessStore.isLoading = false;
328
+ setIsLoading(false);
289
329
  };
290
330
  }, []);
291
331
 
@@ -337,10 +377,10 @@ export const LiveNess = observer(function LiveNess(props: any) {
337
377
  buttonPositive: 'Ok',
338
378
  buttonNegative: 'Cancel',
339
379
  }}
340
- onGoogleVisionBarcodesDetected={({ barcodes }) => {
341
- console.log(barcodes);
342
- }}
343
- onFacesDetected={handlerFace}
380
+ // onGoogleVisionBarcodesDetected={({ barcodes }) => {
381
+ // console.log(barcodes);
382
+ // }}
383
+ // onFacesDetected={handlerFace}
344
384
  >
345
385
  {({ camera, status, recordAudioPermissionStatus }) => {
346
386
  if (status !== 'READY') return <ActivityIndicator />;
@@ -359,15 +399,8 @@ export const LiveNess = observer(function LiveNess(props: any) {
359
399
  { position: 'absolute', width: '100%', height: '100%' },
360
400
  ]}
361
401
  >
362
- <View
363
- style={[
364
- commonStyles.row,
365
- commonStyles.alignCenter,
366
- { paddingHorizontal: 16 },
367
- ]}
368
- >
402
+ <View style={[commonStyles.row, commonStyles.alignCenter]}>
369
403
  <MButton
370
- //@ts-ignore
371
404
  onPress={() => {
372
405
  navigation.goBack();
373
406
  livenessStore.ekycSuccess = false;
@@ -405,22 +438,21 @@ export const LiveNess = observer(function LiveNess(props: any) {
405
438
  width: '100%',
406
439
  }}
407
440
  >
408
- {(Platform.OS === 'ios' ? false : !livenessStore.isFace) &&
409
- !livenessStore.recording && (
410
- <MText
411
- style={[
412
- commonStyles.textNormal,
413
- {
414
- color: 'white',
415
- textAlign: 'center',
416
- backgroundColor: '#00000099',
417
- paddingVertical: 12,
418
- },
419
- ]}
420
- >
421
- Vui lòng hướng khuôn mặt vào máy ảnh
422
- </MText>
423
- )}
441
+ {!recording && (
442
+ <MText
443
+ style={[
444
+ commonStyles.textNormal,
445
+ {
446
+ color: 'white',
447
+ textAlign: 'center',
448
+ backgroundColor: '#00000099',
449
+ paddingVertical: 12,
450
+ },
451
+ ]}
452
+ >
453
+ Vui lòng hướng khuôn mặt vào máy ảnh
454
+ </MText>
455
+ )}
424
456
  <MText
425
457
  style={{
426
458
  lineHeight: 22,
@@ -433,11 +465,10 @@ export const LiveNess = observer(function LiveNess(props: any) {
433
465
  paddingHorizontal: 16,
434
466
  }}
435
467
  >
436
- {livenessStore.hintAction}
468
+ {hintAction}
437
469
  </MText>
438
- {!livenessStore.recording && (
470
+ {!recording ? (
439
471
  <MButton
440
- disabled={Platform.OS === 'ios' ? false : !livenessStore.isFace}
441
472
  onPress={() => recordVideo()}
442
473
  style={[
443
474
  commonStyles.alignCenter,
@@ -465,36 +496,14 @@ export const LiveNess = observer(function LiveNess(props: any) {
465
496
  Bắt đầu
466
497
  </MText>
467
498
  </MButton>
499
+ ) : (
500
+ <View />
468
501
  )}
469
502
  </View>
470
503
  </SafeAreaView>
471
- {/* <Modal visible={livenessStore.isLoading} animationType={"fade"} transparent>
472
- <View
473
- style={[
474
- commonStyles.alignCenter,
475
- commonStyles.justifyCenter,
476
- { backgroundColor: "transparent", height: "100%" },
477
- ]}
478
- >
479
- <View
480
- style={[
481
- commonStyles.alignCenter,
482
- commonStyles.justifyCenter,
483
- { width: 150, height: 150, backgroundColor: "white", borderRadius: 8 },
484
- ]}
485
- >
486
- <ActivityIndicator size={"large"} color={color.primary} />
487
- <MText style={commonStyles.textNormal}>đang tải thông tin</MText>
488
- </View>
489
- </View>
490
- </Modal> */}
491
- <Loading isLoading={livenessStore.isLoading} />
504
+ <Loading isLoading={isLoading} />
492
505
 
493
- <Modal
494
- visible={livenessStore.ekycSuccess}
495
- animationType={'fade'}
496
- transparent
497
- >
506
+ <Modal visible={ekycSuccess} animationType={'fade'} transparent>
498
507
  <View
499
508
  style={[
500
509
  commonStyles.alignCenter,
@@ -510,8 +519,13 @@ export const LiveNess = observer(function LiveNess(props: any) {
510
519
  ]}
511
520
  >
512
521
  <IconEkyc />
513
- <MText style={[commonStyles.textNormalBold, { marginTop: 16 }]}>
514
- Chúc mừng bạn đã thực hiện xác thực khách hàng thành công.
522
+ <MText
523
+ style={[
524
+ commonStyles.textNormalBold,
525
+ { marginTop: 16, textAlign: 'center' },
526
+ ]}
527
+ >
528
+ Chúc mừng bạn đã thực hiện xác thực{'\n'}khách hàng thành công.
515
529
  </MText>
516
530
  <TouchableOpacity
517
531
  style={{
@@ -524,13 +538,17 @@ export const LiveNess = observer(function LiveNess(props: any) {
524
538
  justifyContent: 'center',
525
539
  }}
526
540
  onPress={() => {
527
- livenessStore.ekycSuccess = false;
528
- navigation.dispatch(
529
- CommonActions.reset({
530
- index: 1,
531
- routes: [{ name: ScreenNames.Main }],
532
- })
533
- );
541
+ setEkycSuccess(false);
542
+ if (loan?.typeLoan === 4) {
543
+ navigation.push(ScreenNames.QuickSubmit, { loan });
544
+ } else {
545
+ navigation.dispatch(
546
+ CommonActions.reset({
547
+ index: 1,
548
+ routes: [{ name: ScreenNames.Main }],
549
+ })
550
+ );
551
+ }
534
552
  }}
535
553
  >
536
554
  <MText style={[commonStyles.textNormalBold, { color: 'white' }]}>
@@ -7,7 +7,16 @@ import {
7
7
  TouchableOpacity,
8
8
  View,
9
9
  } from 'react-native';
10
- import { B1, B2, B3, B4, B5, B6, Close2Icon } from '../../assets/icons';
10
+ import {
11
+ B1,
12
+ B2,
13
+ B3,
14
+ B4,
15
+ B5,
16
+ B6,
17
+ CallBlack,
18
+ Close2Icon,
19
+ } from '../../assets/icons';
11
20
  import { MText } from '../../components/MText';
12
21
  import { useNavigation } from '@react-navigation/native';
13
22
  import AppIntroSlider from 'react-native-app-intro-slider';
@@ -77,12 +86,11 @@ export default function Guideline() {
77
86
  alignItems: 'center',
78
87
  }}
79
88
  >
80
- <MText style={{ fontWeight: 'bold', fontSize: 16 }}>Hướng dẫn</MText>
81
89
  <TouchableOpacity
82
90
  onPress={() => navigation.goBack()}
83
91
  style={{
84
92
  position: 'absolute',
85
- right: 0,
93
+ left: 0,
86
94
  width: 40,
87
95
  height: 40,
88
96
  alignItems: 'center',
@@ -91,6 +99,23 @@ export default function Guideline() {
91
99
  >
92
100
  <Close2Icon />
93
101
  </TouchableOpacity>
102
+ <MText style={{ fontWeight: 'bold', fontSize: 16 }}>Hướng dẫn</MText>
103
+ <TouchableOpacity
104
+ // onPress={() => navigation.goBack()}
105
+ style={{
106
+ position: 'absolute',
107
+ right: 10,
108
+ width: 32,
109
+ height: 32,
110
+ alignItems: 'center',
111
+ justifyContent: 'center',
112
+ borderWidth: 1,
113
+ borderRadius: 30,
114
+ borderColor: '#BDBDBD',
115
+ }}
116
+ >
117
+ <CallBlack />
118
+ </TouchableOpacity>
94
119
  </View>
95
120
  <View
96
121
  style={{
@@ -1,7 +1,7 @@
1
1
  import React, { useEffect, useState } from 'react';
2
2
  import { SafeAreaView, TouchableOpacity, View } from 'react-native';
3
3
  import Modal from 'react-native-modal';
4
- import { GuideLineIcon, LineIcon } from '../../assets/icons';
4
+ import { CallRed, GuideLineIcon, LineIcon } from '../../assets/icons';
5
5
  import { MText } from '../../components/MText';
6
6
 
7
7
  interface Props {
@@ -37,7 +37,7 @@ export default function ModalGuideline({ isOpen, onClose }: Props) {
37
37
  <SafeAreaView style={{ flex: 1 }}>
38
38
  <View
39
39
  style={{
40
- width: 40,
40
+ // width: 40,
41
41
  height: 40,
42
42
  backgroundColor: 'white',
43
43
  justifyContent: 'center',
@@ -47,9 +47,18 @@ export default function ModalGuideline({ isOpen, onClose }: Props) {
47
47
  borderBottomLeftRadius: 6,
48
48
  top: -16,
49
49
  right: -16,
50
+ flexDirection: 'row',
50
51
  }}
51
52
  >
52
- <GuideLineIcon />
53
+ <View style={{ paddingHorizontal: 8 }}>
54
+ <GuideLineIcon />
55
+ </View>
56
+ <View
57
+ style={{ width: 1, backgroundColor: '#828282', height: '60%' }}
58
+ />
59
+ <View style={{ paddingHorizontal: 8 }}>
60
+ <CallRed />
61
+ </View>
53
62
  </View>
54
63
  <View
55
64
  style={{
@@ -5,7 +5,7 @@ import React, { useState } from 'react';
5
5
  import { SafeAreaView, TouchableOpacity, View } from 'react-native';
6
6
  import WebView from 'react-native-webview';
7
7
  import { ScreenNames } from '../../navigation';
8
- import { GuideLineIcon, IconBack } from '../../assets/icons';
8
+ import { CallRed, GuideLineIcon, IconBack } from '../../assets/icons';
9
9
  import { MText } from '../../components/MText';
10
10
  import { color } from '../../theme';
11
11
  import { commonStyles } from '../CommonStyles';
@@ -45,19 +45,33 @@ export const PaymentEvidence = observer(function PaymentEvidence(props: any) {
45
45
  >
46
46
  Mục đích sử dụng
47
47
  </MText>
48
- <TouchableOpacity
48
+ <View
49
49
  style={{
50
50
  position: 'absolute',
51
- right: 0,
51
+ right: 16,
52
52
  width: 40,
53
53
  height: 40,
54
54
  alignItems: 'center',
55
55
  justifyContent: 'center',
56
+ flexDirection: 'row',
56
57
  }}
57
- onPress={() => navigation.navigate(ScreenNames.Guideline)}
58
58
  >
59
- <GuideLineIcon />
60
- </TouchableOpacity>
59
+ <TouchableOpacity
60
+ style={{ paddingHorizontal: 8 }}
61
+ onPress={() => navigation.navigate(ScreenNames.Guideline)}
62
+ >
63
+ <GuideLineIcon />
64
+ </TouchableOpacity>
65
+ {/* <View
66
+ style={{ width: 1, backgroundColor: '#828282', height: '60%' }}
67
+ /> */}
68
+ <TouchableOpacity
69
+ style={{ paddingHorizontal: 8 }}
70
+ // onPress={() => navigation.navigate(ScreenNames.Guideline)}
71
+ >
72
+ <CallRed />
73
+ </TouchableOpacity>
74
+ </View>
61
75
  </View>
62
76
  <View style={{ flex: 1, marginBottom: 16 }}>
63
77
  <WebView
@@ -182,7 +182,7 @@ export const Register = observer(function Register() {
182
182
  <View style={{ marginTop: 50 }}>
183
183
  <Formik
184
184
  initialValues={{
185
- phone: __DEV__ ? '0981227740' : '',
185
+ phone: __DEV__ ? '0912711339' : '',
186
186
  terms: true,
187
187
  }}
188
188
  onSubmit={(values) => {