react-native-timacare 3.3.12 → 3.3.14
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/RNTimacare.js +1 -1
- package/lib/commonjs/RNTimacare.js.flow +0 -9
- package/lib/commonjs/RNTimacare.js.map +1 -1
- package/lib/commonjs/assets/digital_topup/index.js +2 -0
- package/lib/commonjs/assets/digital_topup/index.js.flow +28 -0
- package/lib/commonjs/assets/digital_topup/index.js.map +1 -0
- package/lib/commonjs/assets/digital_topup/step1.svg +31 -0
- package/lib/commonjs/assets/digital_topup/step1_disable.svg +31 -0
- package/lib/commonjs/assets/digital_topup/step1_success.svg +21 -0
- package/lib/commonjs/assets/digital_topup/step2.svg +39 -0
- package/lib/commonjs/assets/digital_topup/step2_disable.svg +16 -0
- package/lib/commonjs/assets/digital_topup/step2_success.svg +21 -0
- package/lib/commonjs/assets/digital_topup/step3.svg +23 -0
- package/lib/commonjs/assets/digital_topup/step3_disable.svg +10 -0
- package/lib/commonjs/assets/digital_topup/step3_success.svg +21 -0
- package/lib/commonjs/assets/digital_topup/step4_disable.svg +16 -0
- package/lib/commonjs/assets/digital_topup/step4_success.svg +21 -0
- package/lib/commonjs/components/AlertLoan.js +1 -1
- package/lib/commonjs/components/AlertLoan.js.flow +1 -1
- package/lib/commonjs/components/AlertLoan.js.map +1 -1
- package/lib/commonjs/components/ItemTimaOneV3.js +1 -1
- package/lib/commonjs/components/ItemTimaOneV3.js.flow +1 -5
- package/lib/commonjs/components/ItemTimaOneV3.js.map +1 -1
- package/lib/commonjs/components/MHeader.js +1 -1
- package/lib/commonjs/components/MHeader.js.flow +3 -2
- package/lib/commonjs/components/MHeader.js.map +1 -1
- package/lib/commonjs/components/ModalOptionLoan.js +1 -1
- package/lib/commonjs/components/ModalOptionLoan.js.flow +4 -2
- package/lib/commonjs/components/ModalOptionLoan.js.map +1 -1
- package/lib/commonjs/components/ModalOptionLoanDigital.js +2 -0
- package/lib/commonjs/components/ModalOptionLoanDigital.js.flow +297 -0
- package/lib/commonjs/components/ModalOptionLoanDigital.js.map +1 -0
- package/lib/commonjs/navigation/primary-navigator.js +1 -1
- package/lib/commonjs/navigation/primary-navigator.js.flow +0 -3
- package/lib/commonjs/navigation/primary-navigator.js.map +1 -1
- package/lib/commonjs/screens/camera/CCCDCameraScreen.js +1 -1
- package/lib/commonjs/screens/camera/CCCDCameraScreen.js.flow +93 -56
- package/lib/commonjs/screens/camera/CCCDCameraScreen.js.map +1 -1
- package/lib/commonjs/screens/detail-loan/QrPayment.js +1 -1
- package/lib/commonjs/screens/detail-loan/QrPayment.js.flow +1 -0
- package/lib/commonjs/screens/detail-loan/QrPayment.js.map +1 -1
- package/lib/commonjs/screens/detail-loan/ShowQrCode.js +1 -1
- package/lib/commonjs/screens/detail-loan/ShowQrCode.js.flow +1 -1
- package/lib/commonjs/screens/detail-loan/ShowQrCode.js.map +1 -1
- package/lib/commonjs/screens/home/DigitalTopupItem.js +2 -0
- package/lib/commonjs/screens/home/DigitalTopupItem.js.flow +562 -0
- package/lib/commonjs/screens/home/DigitalTopupItem.js.map +1 -0
- package/lib/commonjs/screens/home/index.js +1 -1
- package/lib/commonjs/screens/home/index.js.flow +49 -4
- package/lib/commonjs/screens/home/index.js.map +1 -1
- package/lib/commonjs/screens/liveness-v2/index.js +1 -1
- package/lib/commonjs/screens/liveness-v2/index.js.flow +12 -9
- package/lib/commonjs/screens/liveness-v2/index.js.map +1 -1
- package/lib/commonjs/screens/toan-trinh-so/OCR.js +1 -1
- package/lib/commonjs/screens/toan-trinh-so/OCR.js.flow +3 -1
- package/lib/commonjs/screens/toan-trinh-so/OCR.js.map +1 -1
- package/lib/commonjs/screens/toan-trinh-so/ReviewInformation.js +1 -1
- package/lib/commonjs/screens/toan-trinh-so/ReviewInformation.js.flow +12 -9
- package/lib/commonjs/screens/toan-trinh-so/ReviewInformation.js.map +1 -1
- package/lib/commonjs/screens/toan-trinh-so/ReviewLoan.js +1 -1
- package/lib/commonjs/screens/toan-trinh-so/ReviewLoan.js.flow +1 -375
- package/lib/commonjs/screens/toan-trinh-so/ReviewLoan.js.map +1 -1
- package/lib/commonjs/screens/toan-trinh-so/TTSNationalIDFront.js +1 -1
- package/lib/commonjs/screens/toan-trinh-so/TTSNationalIDFront.js.flow +12 -9
- package/lib/commonjs/screens/toan-trinh-so/TTSNationalIDFront.js.map +1 -1
- package/lib/commonjs/screens/toan-trinh-so/TTSSelfie.js +1 -1
- package/lib/commonjs/screens/toan-trinh-so/TTSSelfie.js.flow +16 -10
- package/lib/commonjs/screens/toan-trinh-so/TTSSelfie.js.map +1 -1
- package/lib/commonjs/screens/toan-trinh-so/TTSSignLoan.js +1 -1
- package/lib/commonjs/screens/toan-trinh-so/TTSSignLoan.js.flow +18 -15
- package/lib/commonjs/screens/toan-trinh-so/TTSSignLoan.js.map +1 -1
- package/lib/commonjs/screens/toan-trinh-so/TopupLoanInfo.js +1 -1
- package/lib/commonjs/screens/toan-trinh-so/TopupLoanInfo.js.flow +1 -1
- package/lib/commonjs/screens/toan-trinh-so/TopupLoanInfo.js.map +1 -1
- package/lib/commonjs/screens/toan-trinh-so/VehicleCamera.js +1 -1
- package/lib/commonjs/screens/toan-trinh-so/VehicleCamera.js.flow +8 -1
- package/lib/commonjs/screens/toan-trinh-so/VehicleCamera.js.map +1 -1
- package/lib/commonjs/screens/toan-trinh-so/VehicleRegistration.js +1 -1
- package/lib/commonjs/screens/toan-trinh-so/VehicleRegistration.js.flow +20 -17
- package/lib/commonjs/screens/toan-trinh-so/VehicleRegistration.js.map +1 -1
- package/lib/commonjs/screens/toan-trinh-so/VehicleRegistrationFront.js +1 -1
- package/lib/commonjs/screens/toan-trinh-so/VehicleRegistrationFront.js.flow +14 -9
- package/lib/commonjs/screens/toan-trinh-so/VehicleRegistrationFront.js.map +1 -1
- package/lib/commonjs/sdkConfig.js +1 -1
- package/lib/commonjs/sdkConfig.js.flow +6 -0
- package/lib/commonjs/sdkConfig.js.map +1 -1
- package/lib/commonjs/services/api/api.js +1 -1
- package/lib/commonjs/services/api/api.js.flow +32 -0
- package/lib/commonjs/services/api/api.js.map +1 -1
- package/lib/module/RNTimacare.js +1 -1
- package/lib/module/RNTimacare.js.map +1 -1
- package/lib/module/assets/digital_topup/index.js +2 -0
- package/lib/module/assets/digital_topup/index.js.map +1 -0
- package/lib/module/assets/digital_topup/step1.svg +31 -0
- package/lib/module/assets/digital_topup/step1_disable.svg +31 -0
- package/lib/module/assets/digital_topup/step1_success.svg +21 -0
- package/lib/module/assets/digital_topup/step2.svg +39 -0
- package/lib/module/assets/digital_topup/step2_disable.svg +16 -0
- package/lib/module/assets/digital_topup/step2_success.svg +21 -0
- package/lib/module/assets/digital_topup/step3.svg +23 -0
- package/lib/module/assets/digital_topup/step3_disable.svg +10 -0
- package/lib/module/assets/digital_topup/step3_success.svg +21 -0
- package/lib/module/assets/digital_topup/step4_disable.svg +16 -0
- package/lib/module/assets/digital_topup/step4_success.svg +21 -0
- package/lib/module/components/AlertLoan.js +1 -1
- package/lib/module/components/AlertLoan.js.map +1 -1
- package/lib/module/components/ItemTimaOneV3.js +1 -1
- package/lib/module/components/ItemTimaOneV3.js.map +1 -1
- package/lib/module/components/MHeader.js +1 -1
- package/lib/module/components/MHeader.js.map +1 -1
- package/lib/module/components/ModalOptionLoan.js +1 -1
- package/lib/module/components/ModalOptionLoan.js.map +1 -1
- package/lib/module/components/ModalOptionLoanDigital.js +2 -0
- package/lib/module/components/ModalOptionLoanDigital.js.map +1 -0
- package/lib/module/navigation/primary-navigator.js +1 -1
- package/lib/module/navigation/primary-navigator.js.map +1 -1
- package/lib/module/screens/camera/CCCDCameraScreen.js +1 -1
- package/lib/module/screens/camera/CCCDCameraScreen.js.map +1 -1
- package/lib/module/screens/detail-loan/QrPayment.js +1 -1
- package/lib/module/screens/detail-loan/QrPayment.js.map +1 -1
- package/lib/module/screens/detail-loan/ShowQrCode.js +1 -1
- package/lib/module/screens/detail-loan/ShowQrCode.js.map +1 -1
- package/lib/module/screens/home/DigitalTopupItem.js +2 -0
- package/lib/module/screens/home/DigitalTopupItem.js.map +1 -0
- package/lib/module/screens/home/index.js +1 -1
- package/lib/module/screens/home/index.js.map +1 -1
- package/lib/module/screens/liveness-v2/index.js +1 -1
- package/lib/module/screens/liveness-v2/index.js.map +1 -1
- package/lib/module/screens/toan-trinh-so/OCR.js +1 -1
- package/lib/module/screens/toan-trinh-so/OCR.js.map +1 -1
- package/lib/module/screens/toan-trinh-so/ReviewInformation.js +1 -1
- package/lib/module/screens/toan-trinh-so/ReviewInformation.js.map +1 -1
- package/lib/module/screens/toan-trinh-so/ReviewLoan.js +1 -1
- package/lib/module/screens/toan-trinh-so/ReviewLoan.js.map +1 -1
- package/lib/module/screens/toan-trinh-so/TTSNationalIDFront.js +1 -1
- package/lib/module/screens/toan-trinh-so/TTSNationalIDFront.js.map +1 -1
- package/lib/module/screens/toan-trinh-so/TTSSelfie.js +1 -1
- package/lib/module/screens/toan-trinh-so/TTSSelfie.js.map +1 -1
- package/lib/module/screens/toan-trinh-so/TTSSignLoan.js +1 -1
- package/lib/module/screens/toan-trinh-so/TTSSignLoan.js.map +1 -1
- package/lib/module/screens/toan-trinh-so/TopupLoanInfo.js +1 -1
- package/lib/module/screens/toan-trinh-so/TopupLoanInfo.js.map +1 -1
- package/lib/module/screens/toan-trinh-so/VehicleCamera.js +1 -1
- package/lib/module/screens/toan-trinh-so/VehicleCamera.js.map +1 -1
- package/lib/module/screens/toan-trinh-so/VehicleRegistration.js +1 -1
- package/lib/module/screens/toan-trinh-so/VehicleRegistration.js.map +1 -1
- package/lib/module/screens/toan-trinh-so/VehicleRegistrationFront.js +1 -1
- package/lib/module/screens/toan-trinh-so/VehicleRegistrationFront.js.map +1 -1
- package/lib/module/sdkConfig.js +1 -1
- package/lib/module/sdkConfig.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/RNTimacare.d.ts.map +1 -1
- package/lib/typescript/assets/digital_topup/index.d.ts +14 -0
- package/lib/typescript/assets/digital_topup/index.d.ts.map +1 -0
- package/lib/typescript/components/ItemTimaOneV3.d.ts.map +1 -1
- package/lib/typescript/components/MHeader.d.ts.map +1 -1
- package/lib/typescript/components/ModalOptionLoan.d.ts.map +1 -1
- package/lib/typescript/components/ModalOptionLoanDigital.d.ts +9 -0
- package/lib/typescript/components/ModalOptionLoanDigital.d.ts.map +1 -0
- package/lib/typescript/navigation/primary-navigator.d.ts.map +1 -1
- package/lib/typescript/screens/camera/CCCDCameraScreen.d.ts.map +1 -1
- package/lib/typescript/screens/detail-loan/QrPayment.d.ts.map +1 -1
- package/lib/typescript/screens/home/DigitalTopupItem.d.ts +7 -0
- package/lib/typescript/screens/home/DigitalTopupItem.d.ts.map +1 -0
- package/lib/typescript/screens/home/index.d.ts.map +1 -1
- package/lib/typescript/screens/liveness-v2/index.d.ts.map +1 -1
- package/lib/typescript/screens/toan-trinh-so/OCR.d.ts.map +1 -1
- package/lib/typescript/screens/toan-trinh-so/ReviewInformation.d.ts.map +1 -1
- package/lib/typescript/screens/toan-trinh-so/ReviewLoan.d.ts.map +1 -1
- package/lib/typescript/screens/toan-trinh-so/TTSNationalIDFront.d.ts.map +1 -1
- package/lib/typescript/screens/toan-trinh-so/TTSSelfie.d.ts.map +1 -1
- package/lib/typescript/screens/toan-trinh-so/TTSSignLoan.d.ts.map +1 -1
- package/lib/typescript/screens/toan-trinh-so/VehicleCamera.d.ts.map +1 -1
- package/lib/typescript/screens/toan-trinh-so/VehicleRegistration.d.ts.map +1 -1
- package/lib/typescript/screens/toan-trinh-so/VehicleRegistrationFront.d.ts.map +1 -1
- package/lib/typescript/sdkConfig.d.ts.map +1 -1
- package/lib/typescript/services/api/api.d.ts +32 -0
- package/lib/typescript/services/api/api.d.ts.map +1 -1
- package/package.json +1 -1
- package/src/RNTimacare.tsx +0 -9
- package/src/assets/digital_topup/index.tsx +28 -0
- package/src/assets/digital_topup/step1.svg +31 -0
- package/src/assets/digital_topup/step1_disable.svg +31 -0
- package/src/assets/digital_topup/step1_success.svg +21 -0
- package/src/assets/digital_topup/step2.svg +39 -0
- package/src/assets/digital_topup/step2_disable.svg +16 -0
- package/src/assets/digital_topup/step2_success.svg +21 -0
- package/src/assets/digital_topup/step3.svg +23 -0
- package/src/assets/digital_topup/step3_disable.svg +10 -0
- package/src/assets/digital_topup/step3_success.svg +21 -0
- package/src/assets/digital_topup/step4_disable.svg +16 -0
- package/src/assets/digital_topup/step4_success.svg +21 -0
- package/src/components/AlertLoan.tsx +1 -1
- package/src/components/ItemTimaOneV3.tsx +1 -5
- package/src/components/MHeader.tsx +3 -2
- package/src/components/ModalOptionLoan.tsx +4 -2
- package/src/components/ModalOptionLoanDigital.tsx +297 -0
- package/src/navigation/primary-navigator.tsx +0 -3
- package/src/screens/camera/CCCDCameraScreen.tsx +93 -56
- package/src/screens/detail-loan/QrPayment.tsx +1 -0
- package/src/screens/detail-loan/ShowQrCode.tsx +1 -1
- package/src/screens/home/DigitalTopupItem.tsx +562 -0
- package/src/screens/home/index.tsx +49 -4
- package/src/screens/liveness-v2/index.tsx +12 -9
- package/src/screens/toan-trinh-so/OCR.tsx +3 -1
- package/src/screens/toan-trinh-so/ReviewInformation.tsx +12 -9
- package/src/screens/toan-trinh-so/ReviewLoan.tsx +1 -375
- package/src/screens/toan-trinh-so/TTSNationalIDFront.tsx +12 -9
- package/src/screens/toan-trinh-so/TTSSelfie.tsx +16 -10
- package/src/screens/toan-trinh-so/TTSSignLoan.tsx +18 -15
- package/src/screens/toan-trinh-so/TopupLoanInfo.tsx +1 -1
- package/src/screens/toan-trinh-so/VehicleCamera.tsx +8 -1
- package/src/screens/toan-trinh-so/VehicleRegistration.tsx +20 -17
- package/src/screens/toan-trinh-so/VehicleRegistrationFront.tsx +14 -9
- package/src/sdkConfig.ts +6 -0
- package/src/services/api/api.ts +32 -0
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
import {
|
|
13
13
|
Camera,
|
|
14
14
|
useCameraDevice,
|
|
15
|
+
useCameraFormat,
|
|
15
16
|
useCameraPermission,
|
|
16
17
|
} from 'react-native-vision-camera';
|
|
17
18
|
import { IconBackWhite, TakePhotoSvg } from '../../assets/icons';
|
|
@@ -36,6 +37,40 @@ const getImageSize = (
|
|
|
36
37
|
const clamp = (value: number, min: number, max: number) =>
|
|
37
38
|
Math.min(Math.max(value, min), max);
|
|
38
39
|
|
|
40
|
+
const getSnapshotCropRect = ({
|
|
41
|
+
imageWidth,
|
|
42
|
+
imageHeight,
|
|
43
|
+
previewWidth,
|
|
44
|
+
previewHeight,
|
|
45
|
+
frameX,
|
|
46
|
+
frameY,
|
|
47
|
+
frameWidth,
|
|
48
|
+
frameHeight,
|
|
49
|
+
}: {
|
|
50
|
+
imageWidth: number;
|
|
51
|
+
imageHeight: number;
|
|
52
|
+
previewWidth: number;
|
|
53
|
+
previewHeight: number;
|
|
54
|
+
frameX: number;
|
|
55
|
+
frameY: number;
|
|
56
|
+
frameWidth: number;
|
|
57
|
+
frameHeight: number;
|
|
58
|
+
}) => {
|
|
59
|
+
const scaleX = imageWidth / previewWidth;
|
|
60
|
+
const scaleY = imageHeight / previewHeight;
|
|
61
|
+
const originX = clamp(frameX * scaleX, 0, imageWidth);
|
|
62
|
+
const originY = clamp(frameY * scaleY, 0, imageHeight);
|
|
63
|
+
const width = clamp(frameWidth * scaleX, 1, imageWidth - originX);
|
|
64
|
+
const height = clamp(frameHeight * scaleY, 1, imageHeight - originY);
|
|
65
|
+
|
|
66
|
+
return {
|
|
67
|
+
originX: Math.round(originX),
|
|
68
|
+
originY: Math.round(originY),
|
|
69
|
+
width: Math.round(width),
|
|
70
|
+
height: Math.round(height),
|
|
71
|
+
};
|
|
72
|
+
};
|
|
73
|
+
|
|
39
74
|
export default function CCCDCameraScreen(props) {
|
|
40
75
|
const insets = useSafeAreaInsets();
|
|
41
76
|
const navigation = useNavigation();
|
|
@@ -48,82 +83,67 @@ export default function CCCDCameraScreen(props) {
|
|
|
48
83
|
height: screenHeight,
|
|
49
84
|
});
|
|
50
85
|
|
|
86
|
+
const format = useCameraFormat(device, [
|
|
87
|
+
{
|
|
88
|
+
photoAspectRatio: previewLayout.height / previewLayout.width,
|
|
89
|
+
},
|
|
90
|
+
{
|
|
91
|
+
videoAspectRatio: previewLayout.height / previewLayout.width,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
photoResolution: 'max',
|
|
95
|
+
},
|
|
96
|
+
]);
|
|
97
|
+
|
|
51
98
|
useEffect(() => {
|
|
52
99
|
if (!hasPermission) requestPermission();
|
|
53
100
|
}, [hasPermission, requestPermission]);
|
|
54
101
|
|
|
55
102
|
const takePicture = async () => {
|
|
56
103
|
if (camera.current == null) return;
|
|
57
|
-
|
|
58
|
-
const photo = await camera.current.takePhoto({
|
|
59
|
-
skipMetadata: true,
|
|
60
|
-
});
|
|
61
|
-
|
|
62
104
|
try {
|
|
63
|
-
const
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
const
|
|
105
|
+
const snapshot = await camera.current.takeSnapshot({
|
|
106
|
+
quality: 100,
|
|
107
|
+
});
|
|
108
|
+
const imageUri = `file://${snapshot.path}`;
|
|
109
|
+
const normalized = await RNImageManipulator.manipulate(imageUri, [], {
|
|
110
|
+
format: 'jpg',
|
|
111
|
+
compress: 1,
|
|
112
|
+
});
|
|
113
|
+
const { width: imageWidth, height: imageHeight } = await getImageSize(
|
|
114
|
+
normalized.uri
|
|
115
|
+
);
|
|
116
|
+
|
|
117
|
+
const previewWidth = previewLayout.width;
|
|
118
|
+
const previewHeight = previewLayout.height;
|
|
67
119
|
|
|
68
120
|
const frameWidth = previewWidth * 0.85;
|
|
69
|
-
const frameHeight = frameWidth * 0.63;
|
|
121
|
+
const frameHeight = frameWidth * 0.63;
|
|
70
122
|
const frameX = (previewWidth - frameWidth) / 2;
|
|
71
123
|
const frameY = (previewHeight - frameHeight) / 2;
|
|
72
124
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
// Tính tọa độ vùng cần crop trên ảnh gốc dựa vào toạ độ của khung UI
|
|
85
|
-
const cropX = (frameX + offsetX) / scale;
|
|
86
|
-
const cropY = (frameY + offsetY) / scale;
|
|
87
|
-
const cropWidth = frameWidth / scale;
|
|
88
|
-
const cropHeight = frameHeight / scale;
|
|
89
|
-
|
|
90
|
-
const cropXInt = Math.floor(clamp(cropX, 0, Math.max(0, width - 1)));
|
|
91
|
-
const cropYInt = Math.floor(clamp(cropY, 0, Math.max(0, height - 1)));
|
|
92
|
-
const cropWidthInt = Math.floor(
|
|
93
|
-
clamp(cropWidth, 1, Math.max(1, width - cropXInt))
|
|
94
|
-
);
|
|
95
|
-
const cropHeightInt = Math.floor(
|
|
96
|
-
clamp(cropHeight, 1, Math.max(1, height - cropYInt))
|
|
97
|
-
);
|
|
98
|
-
|
|
99
|
-
const cropData = {
|
|
100
|
-
offset: {
|
|
101
|
-
x: cropXInt,
|
|
102
|
-
y: cropYInt,
|
|
103
|
-
},
|
|
104
|
-
size: {
|
|
105
|
-
width: cropWidthInt,
|
|
106
|
-
height: cropHeightInt,
|
|
107
|
-
},
|
|
108
|
-
};
|
|
125
|
+
const cropRect = getSnapshotCropRect({
|
|
126
|
+
imageWidth,
|
|
127
|
+
imageHeight,
|
|
128
|
+
previewWidth,
|
|
129
|
+
previewHeight,
|
|
130
|
+
frameX,
|
|
131
|
+
frameY,
|
|
132
|
+
frameWidth,
|
|
133
|
+
frameHeight,
|
|
134
|
+
});
|
|
109
135
|
|
|
110
136
|
const result = await RNImageManipulator.manipulate(
|
|
111
|
-
|
|
137
|
+
normalized.uri,
|
|
112
138
|
[
|
|
113
139
|
{
|
|
114
|
-
crop:
|
|
115
|
-
originX: cropXInt,
|
|
116
|
-
originY: cropYInt,
|
|
117
|
-
width: cropWidthInt,
|
|
118
|
-
height: cropHeightInt,
|
|
119
|
-
},
|
|
140
|
+
crop: cropRect,
|
|
120
141
|
},
|
|
121
142
|
],
|
|
122
143
|
{ format: 'jpg', compress: 1 }
|
|
123
144
|
);
|
|
124
145
|
setCameraActive(false);
|
|
125
146
|
navigation.goBack();
|
|
126
|
-
|
|
127
147
|
if (props.route?.params?.callback) {
|
|
128
148
|
props.route.params.callback(result?.uri);
|
|
129
149
|
}
|
|
@@ -133,7 +153,20 @@ export default function CCCDCameraScreen(props) {
|
|
|
133
153
|
};
|
|
134
154
|
|
|
135
155
|
if (!device || !hasPermission)
|
|
136
|
-
return
|
|
156
|
+
return (
|
|
157
|
+
<View
|
|
158
|
+
style={{
|
|
159
|
+
flex: 1,
|
|
160
|
+
backgroundColor: '#000',
|
|
161
|
+
alignItems: 'center',
|
|
162
|
+
justifyContent: 'center',
|
|
163
|
+
}}
|
|
164
|
+
>
|
|
165
|
+
<MText style={{ color: '#fff' }}>
|
|
166
|
+
Vui lòng cấp quyền truy cập Camera
|
|
167
|
+
</MText>
|
|
168
|
+
</View>
|
|
169
|
+
);
|
|
137
170
|
|
|
138
171
|
const frameWidth = previewLayout.width * 0.85;
|
|
139
172
|
const frameHeight = frameWidth * 0.63;
|
|
@@ -152,8 +185,12 @@ export default function CCCDCameraScreen(props) {
|
|
|
152
185
|
style={{ flex: 1 }}
|
|
153
186
|
device={device}
|
|
154
187
|
isActive={cameraActive}
|
|
155
|
-
photo={
|
|
188
|
+
photo={false}
|
|
189
|
+
video={true}
|
|
190
|
+
outputOrientation="preview"
|
|
156
191
|
ref={camera}
|
|
192
|
+
format={format}
|
|
193
|
+
resizeMode="cover"
|
|
157
194
|
/>
|
|
158
195
|
<View style={$overlay} pointerEvents="none">
|
|
159
196
|
<View style={[$darkOverlayTop, { height: frameY }]} />
|
|
@@ -34,7 +34,7 @@ export const ShowQrCode = observer(function ShowQrCode(props: any) {
|
|
|
34
34
|
.getQrPayment({
|
|
35
35
|
LoanBriefId: props?.route?.params?.id,
|
|
36
36
|
TypeCloseLoan: 0, // đóng tiền kỳ
|
|
37
|
-
Money: props?.route?.params?.amount,
|
|
37
|
+
Money: Number(props?.route?.params?.amount),
|
|
38
38
|
})
|
|
39
39
|
.then((response) => {
|
|
40
40
|
setIsLoading(false);
|