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.
- package/lib/commonjs/assets/icons/call_black.svg +6 -0
- package/lib/commonjs/assets/icons/call_red.svg +4 -0
- package/lib/commonjs/assets/icons/index.js +1 -1
- package/lib/commonjs/assets/icons/index.js.flow +6 -0
- package/lib/commonjs/assets/icons/index.js.map +1 -1
- package/lib/commonjs/assets/icons/tick2.svg +6 -0
- package/lib/commonjs/assets/icons/tima3.svg +34 -6
- package/lib/commonjs/screens/camera/index.js +1 -1
- package/lib/commonjs/screens/camera/index.js.flow +6 -14
- package/lib/commonjs/screens/camera/index.js.map +1 -1
- package/lib/commonjs/screens/full-submit/accept_policy.js +1 -1
- package/lib/commonjs/screens/full-submit/accept_policy.js.flow +416 -174
- package/lib/commonjs/screens/full-submit/accept_policy.js.map +1 -1
- package/lib/commonjs/screens/full-submit/store.js +1 -1
- package/lib/commonjs/screens/full-submit/store.js.flow +2 -2
- package/lib/commonjs/screens/full-submit/store.js.map +1 -1
- package/lib/commonjs/screens/home/CIMBxTima.js +1 -1
- package/lib/commonjs/screens/home/CIMBxTima.js.flow +27 -11
- package/lib/commonjs/screens/home/CIMBxTima.js.map +1 -1
- package/lib/commonjs/screens/home/Store.js +1 -1
- package/lib/commonjs/screens/home/Store.js.flow +1 -1
- package/lib/commonjs/screens/home/Store.js.map +1 -1
- package/lib/commonjs/screens/home/accept.png +0 -0
- package/lib/commonjs/screens/home/index.js +1 -1
- package/lib/commonjs/screens/home/index.js.flow +1044 -581
- package/lib/commonjs/screens/home/index.js.map +1 -1
- package/lib/commonjs/screens/home/reject.png +0 -0
- package/lib/commonjs/screens/liveness/index.js +1 -1
- package/lib/commonjs/screens/liveness/index.js.flow +194 -176
- package/lib/commonjs/screens/liveness/index.js.map +1 -1
- package/lib/commonjs/screens/payment-evidence/Guideline.js +1 -1
- package/lib/commonjs/screens/payment-evidence/Guideline.js.flow +28 -3
- package/lib/commonjs/screens/payment-evidence/Guideline.js.map +1 -1
- package/lib/commonjs/screens/payment-evidence/ModalGuideline.js +1 -1
- package/lib/commonjs/screens/payment-evidence/ModalGuideline.js.flow +12 -3
- package/lib/commonjs/screens/payment-evidence/ModalGuideline.js.map +1 -1
- package/lib/commonjs/screens/payment-evidence/index.js +1 -1
- package/lib/commonjs/screens/payment-evidence/index.js.flow +20 -6
- package/lib/commonjs/screens/payment-evidence/index.js.map +1 -1
- package/lib/commonjs/screens/register/index.js +1 -1
- package/lib/commonjs/screens/register/index.js.flow +1 -1
- package/lib/commonjs/screens/selfie/index.js +1 -1
- package/lib/commonjs/screens/selfie/index.js.flow +1 -25
- package/lib/commonjs/screens/selfie/index.js.map +1 -1
- package/lib/commonjs/screens/terms/QuickTerm.js +1 -1
- package/lib/commonjs/screens/terms/QuickTerm.js.flow +4 -0
- package/lib/commonjs/screens/terms/QuickTerm.js.map +1 -1
- package/lib/commonjs/services/api/api-config.js +1 -1
- package/lib/commonjs/services/api/api-config.js.flow +1 -1
- package/lib/commonjs/services/api/api-config.js.map +1 -1
- package/lib/commonjs/services/api/api.js +1 -1
- package/lib/commonjs/services/api/api.js.flow +38 -2
- package/lib/commonjs/services/api/api.js.map +1 -1
- package/lib/module/assets/icons/call_black.svg +6 -0
- package/lib/module/assets/icons/call_red.svg +4 -0
- package/lib/module/assets/icons/index.js +1 -1
- package/lib/module/assets/icons/index.js.map +1 -1
- package/lib/module/assets/icons/tick2.svg +6 -0
- package/lib/module/assets/icons/tima3.svg +34 -6
- package/lib/module/screens/camera/index.js +1 -1
- package/lib/module/screens/camera/index.js.map +1 -1
- package/lib/module/screens/full-submit/accept_policy.js +1 -1
- package/lib/module/screens/full-submit/accept_policy.js.map +1 -1
- package/lib/module/screens/full-submit/store.js +1 -1
- package/lib/module/screens/full-submit/store.js.map +1 -1
- package/lib/module/screens/home/CIMBxTima.js +1 -1
- package/lib/module/screens/home/CIMBxTima.js.map +1 -1
- package/lib/module/screens/home/Store.js +1 -1
- package/lib/module/screens/home/Store.js.map +1 -1
- package/lib/module/screens/home/accept.png +0 -0
- package/lib/module/screens/home/index.js +1 -1
- package/lib/module/screens/home/index.js.map +1 -1
- package/lib/module/screens/home/reject.png +0 -0
- package/lib/module/screens/liveness/index.js +1 -1
- package/lib/module/screens/liveness/index.js.map +1 -1
- package/lib/module/screens/payment-evidence/Guideline.js +1 -1
- package/lib/module/screens/payment-evidence/Guideline.js.map +1 -1
- package/lib/module/screens/payment-evidence/ModalGuideline.js +1 -1
- package/lib/module/screens/payment-evidence/ModalGuideline.js.map +1 -1
- package/lib/module/screens/payment-evidence/index.js +1 -1
- package/lib/module/screens/payment-evidence/index.js.map +1 -1
- package/lib/module/screens/register/index.js +1 -1
- package/lib/module/screens/selfie/index.js +1 -1
- package/lib/module/screens/selfie/index.js.map +1 -1
- package/lib/module/screens/terms/QuickTerm.js +1 -1
- package/lib/module/screens/terms/QuickTerm.js.map +1 -1
- package/lib/module/services/api/api-config.js +1 -1
- package/lib/module/services/api/api-config.js.map +1 -1
- package/lib/module/services/api/api.js +1 -1
- package/lib/module/services/api/api.js.map +1 -1
- package/lib/typescript/assets/icons/index.d.ts +4 -1
- package/lib/typescript/assets/icons/index.d.ts.map +1 -1
- package/lib/typescript/screens/camera/index.d.ts.map +1 -1
- package/lib/typescript/screens/full-submit/accept_policy.d.ts.map +1 -1
- package/lib/typescript/screens/full-submit/store.d.ts +1 -1
- package/lib/typescript/screens/full-submit/store.d.ts.map +1 -1
- package/lib/typescript/screens/home/CIMBxTima.d.ts.map +1 -1
- package/lib/typescript/screens/home/index.d.ts.map +1 -1
- package/lib/typescript/screens/liveness/index.d.ts.map +1 -1
- package/lib/typescript/screens/payment-evidence/Guideline.d.ts.map +1 -1
- package/lib/typescript/screens/payment-evidence/ModalGuideline.d.ts.map +1 -1
- package/lib/typescript/screens/payment-evidence/index.d.ts.map +1 -1
- package/lib/typescript/screens/selfie/index.d.ts.map +1 -1
- package/lib/typescript/screens/terms/QuickTerm.d.ts.map +1 -1
- package/lib/typescript/services/api/api.d.ts +33 -1
- package/lib/typescript/services/api/api.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/assets/icons/call_black.svg +6 -0
- package/src/assets/icons/call_red.svg +4 -0
- package/src/assets/icons/index.tsx +6 -0
- package/src/assets/icons/tick2.svg +6 -0
- package/src/assets/icons/tima3.svg +34 -6
- package/src/screens/camera/index.tsx +6 -14
- package/src/screens/full-submit/accept_policy.tsx +416 -174
- package/src/screens/full-submit/store.tsx +2 -2
- package/src/screens/home/CIMBxTima.tsx +27 -11
- package/src/screens/home/Store.tsx +1 -1
- package/src/screens/home/accept.png +0 -0
- package/src/screens/home/index.tsx +1044 -581
- package/src/screens/home/reject.png +0 -0
- package/src/screens/liveness/index.tsx +194 -176
- package/src/screens/payment-evidence/Guideline.tsx +28 -3
- package/src/screens/payment-evidence/ModalGuideline.tsx +12 -3
- package/src/screens/payment-evidence/index.tsx +20 -6
- package/src/screens/register/index.tsx +1 -1
- package/src/screens/selfie/index.tsx +1 -25
- package/src/screens/terms/QuickTerm.tsx +4 -0
- package/src/services/api/api-config.ts +1 -1
- 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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
|
|
200
|
-
'
|
|
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
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
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
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
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
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
{
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
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
|
-
{
|
|
468
|
+
{hintAction}
|
|
437
469
|
</MText>
|
|
438
|
-
{!
|
|
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
|
-
|
|
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
|
|
514
|
-
|
|
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
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
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 {
|
|
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
|
-
|
|
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
|
-
<
|
|
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
|
-
<
|
|
48
|
+
<View
|
|
49
49
|
style={{
|
|
50
50
|
position: 'absolute',
|
|
51
|
-
right:
|
|
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
|
-
<
|
|
60
|
-
|
|
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__ ? '
|
|
185
|
+
phone: __DEV__ ? '0912711339' : '',
|
|
186
186
|
terms: true,
|
|
187
187
|
}}
|
|
188
188
|
onSubmit={(values) => {
|