react-native-timacare 3.3.55 → 3.3.57-cccd
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/AppStore.js +1 -1
- package/lib/commonjs/AppStore.js.flow +7 -2
- package/lib/commonjs/AppStore.js.map +1 -1
- package/lib/commonjs/RNTimacare.js +1 -1
- package/lib/commonjs/RNTimacare.js.flow +7 -1
- package/lib/commonjs/RNTimacare.js.map +1 -1
- package/lib/commonjs/assets/icons/index.js +1 -1
- package/lib/commonjs/assets/icons/index.js.flow +10 -0
- package/lib/commonjs/assets/icons/index.js.map +1 -1
- package/lib/commonjs/assets/icons/modal_confirm.svg +15 -0
- package/lib/commonjs/assets/icons/modal_notice.svg +74 -0
- package/lib/commonjs/assets/icons/modal_success.svg +55 -0
- package/lib/commonjs/assets/icons/modal_warning.svg +48 -0
- package/lib/commonjs/assets/icons/user_security.svg +10 -0
- package/lib/commonjs/assets/tts/Frame1000011947.png +0 -0
- package/lib/commonjs/components/AppModal.js +2 -0
- package/lib/commonjs/components/AppModal.js.flow +34 -0
- package/lib/commonjs/components/AppModal.js.map +1 -0
- package/lib/commonjs/components/ItemTimaOne.js +2 -0
- package/lib/commonjs/components/{ItemTimaOneV3.js.flow → ItemTimaOne.js.flow} +1 -1
- package/lib/commonjs/components/ItemTimaOne.js.map +1 -0
- package/lib/commonjs/components/ModalNotification/AlertGlobal.js +2 -0
- package/lib/commonjs/components/ModalNotification/AlertGlobal.js.flow +100 -0
- package/lib/commonjs/components/ModalNotification/AlertGlobal.js.map +1 -0
- package/lib/commonjs/components/ModalNotification/index.js +2 -0
- package/lib/commonjs/components/ModalNotification/index.js.flow +224 -0
- package/lib/commonjs/components/ModalNotification/index.js.map +1 -0
- package/lib/commonjs/components/ModalOptionLoan.js +1 -1
- package/lib/commonjs/components/ModalOptionLoan.js.flow +15 -7
- package/lib/commonjs/components/ModalOptionLoan.js.map +1 -1
- package/lib/commonjs/components/ModalOptionLoanDigital.js +1 -1
- package/lib/commonjs/components/ModalOptionLoanDigital.js.flow +15 -7
- package/lib/commonjs/components/ModalOptionLoanDigital.js.map +1 -1
- package/lib/commonjs/navigation/primary-navigator.js +1 -1
- package/lib/commonjs/navigation/primary-navigator.js.flow +7 -0
- package/lib/commonjs/navigation/primary-navigator.js.map +1 -1
- package/lib/commonjs/screens/NFC/OcrStart.js +2 -0
- package/lib/commonjs/screens/NFC/OcrStart.js.flow +171 -0
- package/lib/commonjs/screens/NFC/OcrStart.js.map +1 -0
- package/lib/commonjs/screens/NFC/ScanMRZ.js +2 -0
- package/lib/commonjs/screens/NFC/ScanMRZ.js.flow +563 -0
- package/lib/commonjs/screens/NFC/ScanMRZ.js.map +1 -0
- package/lib/commonjs/screens/SelectorStore.js +1 -1
- package/lib/commonjs/screens/SelectorStore.js.flow +7 -2
- package/lib/commonjs/screens/SelectorStore.js.map +1 -1
- package/lib/commonjs/screens/camera/CCCDCameraScreen.js +1 -1
- package/lib/commonjs/screens/camera/CCCDCameraScreen.js.flow +253 -187
- package/lib/commonjs/screens/camera/CCCDCameraScreen.js.map +1 -1
- package/lib/commonjs/screens/camera/index.js +1 -1
- package/lib/commonjs/screens/camera/index.js.flow +50 -54
- package/lib/commonjs/screens/camera/index.js.map +1 -1
- package/lib/commonjs/screens/cimb-sign/index.js +1 -1
- package/lib/commonjs/screens/cimb-sign/index.js.flow +10 -14
- package/lib/commonjs/screens/cimb-sign/index.js.map +1 -1
- package/lib/commonjs/screens/detail-loan/PaymentInfo.js +1 -1
- package/lib/commonjs/screens/detail-loan/PaymentInfo.js.flow +75 -54
- package/lib/commonjs/screens/detail-loan/PaymentInfo.js.map +1 -1
- package/lib/commonjs/screens/detail-loan/ShowQrCode.js +1 -1
- package/lib/commonjs/screens/detail-loan/ShowQrCode.js.flow +77 -54
- package/lib/commonjs/screens/detail-loan/ShowQrCode.js.map +1 -1
- package/lib/commonjs/screens/detail-loan/store.js +1 -1
- package/lib/commonjs/screens/detail-loan/store.js.flow +39 -7
- package/lib/commonjs/screens/detail-loan/store.js.map +1 -1
- package/lib/commonjs/screens/detail-loan-tima/InforLoan.js +1 -1
- package/lib/commonjs/screens/detail-loan-tima/InforLoan.js.flow +20 -4
- package/lib/commonjs/screens/detail-loan-tima/InforLoan.js.map +1 -1
- package/lib/commonjs/screens/detail-loan-tima/PaymentSchedule.js +1 -1
- package/lib/commonjs/screens/detail-loan-tima/PaymentSchedule.js.flow +19 -4
- package/lib/commonjs/screens/detail-loan-tima/PaymentSchedule.js.map +1 -1
- package/lib/commonjs/screens/digital-lending/Step6.js +1 -1
- package/lib/commonjs/screens/digital-lending/Step6.js.flow +24 -29
- package/lib/commonjs/screens/digital-lending/Step6.js.map +1 -1
- package/lib/commonjs/screens/digital-lending/store.js +1 -1
- package/lib/commonjs/screens/digital-lending/store.js.flow +113 -20
- package/lib/commonjs/screens/digital-lending/store.js.map +1 -1
- package/lib/commonjs/screens/eSign/Store.js +1 -1
- package/lib/commonjs/screens/eSign/Store.js.flow +69 -34
- package/lib/commonjs/screens/eSign/Store.js.map +1 -1
- package/lib/commonjs/screens/eSign/index.js +1 -1
- package/lib/commonjs/screens/eSign/index.js.flow +33 -34
- package/lib/commonjs/screens/eSign/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 +101 -85
- 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 +157 -27
- package/lib/commonjs/screens/full-submit/store.js.map +1 -1
- package/lib/commonjs/screens/full-submit/update-info.js +1 -1
- package/lib/commonjs/screens/full-submit/update-info.js.flow +0 -1
- package/lib/commonjs/screens/full-submit/update-info.js.map +1 -1
- package/lib/commonjs/screens/home/DigitalTopupItem.js +1 -1
- package/lib/commonjs/screens/home/DigitalTopupItem.js.flow +15 -7
- package/lib/commonjs/screens/home/DigitalTopupItem.js.map +1 -1
- package/lib/commonjs/screens/home/ItemMotoBikeLoan.js +1 -1
- package/lib/commonjs/screens/home/ItemMotoBikeLoan.js.flow +16 -7
- package/lib/commonjs/screens/home/ItemMotoBikeLoan.js.map +1 -1
- package/lib/commonjs/screens/home/Store.js +1 -1
- package/lib/commonjs/screens/home/Store.js.flow +44 -23
- package/lib/commonjs/screens/home/Store.js.map +1 -1
- package/lib/commonjs/screens/home/index.js +1 -1
- package/lib/commonjs/screens/home/index.js.flow +306 -298
- package/lib/commonjs/screens/home/index.js.map +1 -1
- package/lib/commonjs/screens/liveness/LivenessStore.js +1 -1
- package/lib/commonjs/screens/liveness/LivenessStore.js.flow +111 -89
- package/lib/commonjs/screens/liveness/LivenessStore.js.map +1 -1
- package/lib/commonjs/screens/liveness/index.js +1 -1
- package/lib/commonjs/screens/liveness/index.js.flow +67 -68
- package/lib/commonjs/screens/liveness/index.js.map +1 -1
- package/lib/commonjs/screens/liveness-v2/index.js +1 -1
- package/lib/commonjs/screens/liveness-v2/index.js.flow +52 -52
- package/lib/commonjs/screens/liveness-v2/index.js.map +1 -1
- package/lib/commonjs/screens/loan/PreviewSchedulePaymentTopup.js +1 -1
- package/lib/commonjs/screens/loan/PreviewSchedulePaymentTopup.js.flow +20 -10
- package/lib/commonjs/screens/loan/PreviewSchedulePaymentTopup.js.map +1 -1
- package/lib/commonjs/screens/loan/UpdateLoan.js +1 -1
- package/lib/commonjs/screens/loan/UpdateLoan.js.flow +56 -23
- package/lib/commonjs/screens/loan/UpdateLoan.js.map +1 -1
- package/lib/commonjs/screens/motobike/InfoLoanMotobike.js +1 -1
- package/lib/commonjs/screens/motobike/InfoLoanMotobike.js.flow +43 -29
- package/lib/commonjs/screens/motobike/InfoLoanMotobike.js.map +1 -1
- package/lib/commonjs/screens/motobike/PolicyF88.js +1 -1
- package/lib/commonjs/screens/motobike/PolicyF88.js.flow +15 -6
- package/lib/commonjs/screens/motobike/PolicyF88.js.map +1 -1
- package/lib/commonjs/screens/motobike/ReviewLoanMotobike.js +1 -1
- package/lib/commonjs/screens/motobike/ReviewLoanMotobike.js.flow +13 -3
- package/lib/commonjs/screens/motobike/ReviewLoanMotobike.js.map +1 -1
- package/lib/commonjs/screens/mrz-scanner/index.js +1 -1
- package/lib/commonjs/screens/mrz-scanner/index.js.flow +56 -55
- package/lib/commonjs/screens/mrz-scanner/index.js.map +1 -1
- package/lib/commonjs/screens/mrz-scanner/store.js +1 -1
- package/lib/commonjs/screens/mrz-scanner/store.js.flow +13 -3
- package/lib/commonjs/screens/mrz-scanner/store.js.map +1 -1
- package/lib/commonjs/screens/nationalID/Store.js +1 -1
- package/lib/commonjs/screens/nationalID/Store.js.flow +50 -29
- package/lib/commonjs/screens/nationalID/Store.js.map +1 -1
- package/lib/commonjs/screens/nationalID/index.js +1 -1
- package/lib/commonjs/screens/nationalID/index.js.flow +123 -219
- package/lib/commonjs/screens/nationalID/index.js.map +1 -1
- package/lib/commonjs/screens/nationalIDBack/Store.js +1 -1
- package/lib/commonjs/screens/nationalIDBack/Store.js.flow +44 -26
- package/lib/commonjs/screens/nationalIDBack/Store.js.map +1 -1
- package/lib/commonjs/screens/nationalIDBack/index.js +1 -1
- package/lib/commonjs/screens/nationalIDBack/index.js.flow +129 -210
- package/lib/commonjs/screens/nationalIDBack/index.js.map +1 -1
- package/lib/commonjs/screens/notification/ListLoanStore.js +1 -1
- package/lib/commonjs/screens/notification/ListLoanStore.js.flow +19 -4
- package/lib/commonjs/screens/notification/ListLoanStore.js.map +1 -1
- package/lib/commonjs/screens/notification/index.js +1 -1
- package/lib/commonjs/screens/notification/index.js.flow +0 -1
- package/lib/commonjs/screens/notification/index.js.map +1 -1
- package/lib/commonjs/screens/notification/store.js +1 -1
- package/lib/commonjs/screens/notification/store.js.flow +7 -2
- package/lib/commonjs/screens/notification/store.js.map +1 -1
- package/lib/commonjs/screens/personal/index.js +1 -1
- package/lib/commonjs/screens/personal/index.js.flow +21 -19
- package/lib/commonjs/screens/personal/index.js.map +1 -1
- package/lib/commonjs/screens/qualify/Store.js.flow +0 -1
- package/lib/commonjs/screens/qualify/Store.js.map +1 -1
- package/lib/commonjs/screens/quick-submit/store.js +1 -1
- package/lib/commonjs/screens/quick-submit/store.js.flow +85 -15
- package/lib/commonjs/screens/quick-submit/store.js.map +1 -1
- package/lib/commonjs/screens/schedule-payment/DigitalSchedulePayment.js +1 -1
- package/lib/commonjs/screens/schedule-payment/DigitalSchedulePayment.js.flow +20 -4
- package/lib/commonjs/screens/schedule-payment/DigitalSchedulePayment.js.map +1 -1
- package/lib/commonjs/screens/schedule-payment/store.js +1 -1
- package/lib/commonjs/screens/schedule-payment/store.js.flow +13 -5
- package/lib/commonjs/screens/schedule-payment/store.js.map +1 -1
- package/lib/commonjs/screens/selfie/SelfieStore.js +1 -1
- package/lib/commonjs/screens/selfie/SelfieStore.js.flow +25 -9
- package/lib/commonjs/screens/selfie/SelfieStore.js.map +1 -1
- package/lib/commonjs/screens/selfie/index.js +1 -1
- package/lib/commonjs/screens/selfie/index.js.flow +0 -1
- package/lib/commonjs/screens/selfie/index.js.map +1 -1
- package/lib/commonjs/screens/sign-tima/ViewContract.js +1 -1
- package/lib/commonjs/screens/sign-tima/ViewContract.js.flow +17 -18
- package/lib/commonjs/screens/sign-tima/ViewContract.js.map +1 -1
- package/lib/commonjs/screens/sign-tima/store.js +1 -1
- package/lib/commonjs/screens/sign-tima/store.js.flow +37 -7
- package/lib/commonjs/screens/sign-tima/store.js.map +1 -1
- package/lib/commonjs/screens/toan-trinh-so/LoanInterestRate.js +1 -1
- package/lib/commonjs/screens/toan-trinh-so/LoanInterestRate.js.flow +36 -10
- package/lib/commonjs/screens/toan-trinh-so/LoanInterestRate.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 +321 -609
- package/lib/commonjs/screens/toan-trinh-so/OCR.js.map +1 -1
- package/lib/commonjs/screens/toan-trinh-so/RegisterBack.js +1 -1
- package/lib/commonjs/screens/toan-trinh-so/RegisterBack.js.flow +21 -4
- package/lib/commonjs/screens/toan-trinh-so/RegisterBack.js.map +1 -1
- package/lib/commonjs/screens/toan-trinh-so/RegisterCamera.js +1 -1
- package/lib/commonjs/screens/toan-trinh-so/RegisterCamera.js.flow +50 -54
- package/lib/commonjs/screens/toan-trinh-so/RegisterCamera.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 +31 -25
- package/lib/commonjs/screens/toan-trinh-so/ReviewInformation.js.map +1 -1
- package/lib/commonjs/screens/toan-trinh-so/ReviewInformationOther.js +1 -1
- package/lib/commonjs/screens/toan-trinh-so/ReviewInformationOther.js.flow +88 -82
- package/lib/commonjs/screens/toan-trinh-so/ReviewInformationOther.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 +25 -5
- package/lib/commonjs/screens/toan-trinh-so/ReviewLoan.js.map +1 -1
- package/lib/commonjs/screens/toan-trinh-so/TTSNationalIDBack.js +1 -1
- package/lib/commonjs/screens/toan-trinh-so/TTSNationalIDBack.js.flow +19 -4
- package/lib/commonjs/screens/toan-trinh-so/TTSNationalIDBack.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 +19 -4
- package/lib/commonjs/screens/toan-trinh-so/TTSNationalIDFront.js.map +1 -1
- package/lib/commonjs/screens/toan-trinh-so/TTSOTP.js +1 -1
- package/lib/commonjs/screens/toan-trinh-so/TTSOTP.js.flow +42 -25
- package/lib/commonjs/screens/toan-trinh-so/TTSOTP.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 +63 -56
- 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 +63 -55
- 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 +50 -43
- 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 +275 -341
- 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 +19 -4
- package/lib/commonjs/screens/toan-trinh-so/VehicleRegistration.js.map +1 -1
- package/lib/commonjs/screens/toan-trinh-so/VehicleRegistrationBack.js +1 -1
- package/lib/commonjs/screens/toan-trinh-so/VehicleRegistrationBack.js.flow +19 -4
- package/lib/commonjs/screens/toan-trinh-so/VehicleRegistrationBack.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 +19 -4
- package/lib/commonjs/screens/toan-trinh-so/VehicleRegistrationFront.js.map +1 -1
- package/lib/commonjs/screens/toan-trinh-so/store.js +1 -1
- package/lib/commonjs/screens/toan-trinh-so/store.js.flow +82 -37
- package/lib/commonjs/screens/toan-trinh-so/store.js.map +1 -1
- package/lib/commonjs/screens/uploadVideo/index.js +1 -1
- package/lib/commonjs/screens/uploadVideo/index.js.flow +26 -21
- package/lib/commonjs/screens/uploadVideo/index.js.map +1 -1
- package/lib/commonjs/screens/uploadVideo/videoStore.js +1 -1
- package/lib/commonjs/screens/uploadVideo/videoStore.js.flow +19 -4
- package/lib/commonjs/screens/uploadVideo/videoStore.js.map +1 -1
- package/lib/commonjs/screens/v3/AssetInformation.js +1 -1
- package/lib/commonjs/screens/v3/AssetInformation.js.flow +35 -16
- package/lib/commonjs/screens/v3/AssetInformation.js.map +1 -1
- package/lib/commonjs/screens/v3/LoanBuyCar.js +1 -1
- package/lib/commonjs/screens/v3/LoanBuyCar.js.flow +35 -16
- package/lib/commonjs/screens/v3/LoanBuyCar.js.map +1 -1
- package/lib/commonjs/services/api/api.js +1 -1
- package/lib/commonjs/services/api/api.js.flow +23 -26
- package/lib/commonjs/services/api/api.js.map +1 -1
- package/lib/commonjs/utils/cameraCrop.js +2 -0
- package/lib/commonjs/utils/cameraCrop.js.flow +96 -0
- package/lib/commonjs/utils/cameraCrop.js.map +1 -0
- package/lib/module/AppStore.js +1 -1
- package/lib/module/AppStore.js.map +1 -1
- package/lib/module/RNTimacare.js +1 -1
- package/lib/module/RNTimacare.js.map +1 -1
- package/lib/module/assets/icons/index.js +1 -1
- package/lib/module/assets/icons/index.js.map +1 -1
- package/lib/module/assets/icons/modal_confirm.svg +15 -0
- package/lib/module/assets/icons/modal_notice.svg +74 -0
- package/lib/module/assets/icons/modal_success.svg +55 -0
- package/lib/module/assets/icons/modal_warning.svg +48 -0
- package/lib/module/assets/icons/user_security.svg +10 -0
- package/lib/module/assets/tts/Frame1000011947.png +0 -0
- package/lib/module/components/AppModal.js +2 -0
- package/lib/module/components/AppModal.js.map +1 -0
- package/lib/module/components/ItemTimaOne.js +2 -0
- package/lib/module/components/ItemTimaOne.js.map +1 -0
- package/lib/module/components/ModalNotification/AlertGlobal.js +2 -0
- package/lib/module/components/ModalNotification/AlertGlobal.js.map +1 -0
- package/lib/module/components/ModalNotification/index.js +2 -0
- package/lib/module/components/ModalNotification/index.js.map +1 -0
- package/lib/module/components/ModalOptionLoan.js +1 -1
- package/lib/module/components/ModalOptionLoan.js.map +1 -1
- package/lib/module/components/ModalOptionLoanDigital.js +1 -1
- package/lib/module/components/ModalOptionLoanDigital.js.map +1 -1
- package/lib/module/navigation/primary-navigator.js +1 -1
- package/lib/module/navigation/primary-navigator.js.map +1 -1
- package/lib/module/screens/NFC/OcrStart.js +2 -0
- package/lib/module/screens/NFC/OcrStart.js.map +1 -0
- package/lib/module/screens/NFC/ScanMRZ.js +2 -0
- package/lib/module/screens/NFC/ScanMRZ.js.map +1 -0
- package/lib/module/screens/SelectorStore.js +1 -1
- package/lib/module/screens/SelectorStore.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/camera/index.js +1 -1
- package/lib/module/screens/camera/index.js.map +1 -1
- package/lib/module/screens/cimb-sign/index.js +1 -1
- package/lib/module/screens/cimb-sign/index.js.map +1 -1
- package/lib/module/screens/detail-loan/PaymentInfo.js +1 -1
- package/lib/module/screens/detail-loan/PaymentInfo.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/detail-loan/store.js +1 -1
- package/lib/module/screens/detail-loan/store.js.map +1 -1
- package/lib/module/screens/detail-loan-tima/InforLoan.js +1 -1
- package/lib/module/screens/detail-loan-tima/InforLoan.js.map +1 -1
- package/lib/module/screens/detail-loan-tima/PaymentSchedule.js +1 -1
- package/lib/module/screens/detail-loan-tima/PaymentSchedule.js.map +1 -1
- package/lib/module/screens/digital-lending/Step6.js +1 -1
- package/lib/module/screens/digital-lending/Step6.js.map +1 -1
- package/lib/module/screens/digital-lending/store.js +1 -1
- package/lib/module/screens/digital-lending/store.js.map +1 -1
- package/lib/module/screens/eSign/Store.js +1 -1
- package/lib/module/screens/eSign/Store.js.map +1 -1
- package/lib/module/screens/eSign/index.js +1 -1
- package/lib/module/screens/eSign/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/full-submit/update-info.js +1 -1
- package/lib/module/screens/full-submit/update-info.js.map +1 -1
- package/lib/module/screens/home/DigitalTopupItem.js +1 -1
- package/lib/module/screens/home/DigitalTopupItem.js.map +1 -1
- package/lib/module/screens/home/ItemMotoBikeLoan.js +1 -1
- package/lib/module/screens/home/ItemMotoBikeLoan.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/index.js +1 -1
- package/lib/module/screens/home/index.js.map +1 -1
- package/lib/module/screens/liveness/LivenessStore.js +1 -1
- package/lib/module/screens/liveness/LivenessStore.js.map +1 -1
- package/lib/module/screens/liveness/index.js +1 -1
- package/lib/module/screens/liveness/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/loan/PreviewSchedulePaymentTopup.js +1 -1
- package/lib/module/screens/loan/PreviewSchedulePaymentTopup.js.map +1 -1
- package/lib/module/screens/loan/UpdateLoan.js +1 -1
- package/lib/module/screens/loan/UpdateLoan.js.map +1 -1
- package/lib/module/screens/motobike/InfoLoanMotobike.js +1 -1
- package/lib/module/screens/motobike/InfoLoanMotobike.js.map +1 -1
- package/lib/module/screens/motobike/PolicyF88.js +1 -1
- package/lib/module/screens/motobike/PolicyF88.js.map +1 -1
- package/lib/module/screens/motobike/ReviewLoanMotobike.js +1 -1
- package/lib/module/screens/motobike/ReviewLoanMotobike.js.map +1 -1
- package/lib/module/screens/mrz-scanner/index.js +1 -1
- package/lib/module/screens/mrz-scanner/index.js.map +1 -1
- package/lib/module/screens/mrz-scanner/store.js +1 -1
- package/lib/module/screens/mrz-scanner/store.js.map +1 -1
- package/lib/module/screens/nationalID/Store.js +1 -1
- package/lib/module/screens/nationalID/Store.js.map +1 -1
- package/lib/module/screens/nationalID/index.js +1 -1
- package/lib/module/screens/nationalID/index.js.map +1 -1
- package/lib/module/screens/nationalIDBack/Store.js +1 -1
- package/lib/module/screens/nationalIDBack/Store.js.map +1 -1
- package/lib/module/screens/nationalIDBack/index.js +1 -1
- package/lib/module/screens/nationalIDBack/index.js.map +1 -1
- package/lib/module/screens/notification/ListLoanStore.js +1 -1
- package/lib/module/screens/notification/ListLoanStore.js.map +1 -1
- package/lib/module/screens/notification/index.js +1 -1
- package/lib/module/screens/notification/index.js.map +1 -1
- package/lib/module/screens/notification/store.js +1 -1
- package/lib/module/screens/notification/store.js.map +1 -1
- package/lib/module/screens/personal/index.js +1 -1
- package/lib/module/screens/personal/index.js.map +1 -1
- package/lib/module/screens/qualify/Store.js.map +1 -1
- package/lib/module/screens/quick-submit/store.js +1 -1
- package/lib/module/screens/quick-submit/store.js.map +1 -1
- package/lib/module/screens/schedule-payment/DigitalSchedulePayment.js +1 -1
- package/lib/module/screens/schedule-payment/DigitalSchedulePayment.js.map +1 -1
- package/lib/module/screens/schedule-payment/store.js +1 -1
- package/lib/module/screens/schedule-payment/store.js.map +1 -1
- package/lib/module/screens/selfie/SelfieStore.js +1 -1
- package/lib/module/screens/selfie/SelfieStore.js.map +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/sign-tima/ViewContract.js +1 -1
- package/lib/module/screens/sign-tima/ViewContract.js.map +1 -1
- package/lib/module/screens/sign-tima/store.js +1 -1
- package/lib/module/screens/sign-tima/store.js.map +1 -1
- package/lib/module/screens/toan-trinh-so/LoanInterestRate.js +1 -1
- package/lib/module/screens/toan-trinh-so/LoanInterestRate.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/RegisterBack.js +1 -1
- package/lib/module/screens/toan-trinh-so/RegisterBack.js.map +1 -1
- package/lib/module/screens/toan-trinh-so/RegisterCamera.js +1 -1
- package/lib/module/screens/toan-trinh-so/RegisterCamera.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/ReviewInformationOther.js +1 -1
- package/lib/module/screens/toan-trinh-so/ReviewInformationOther.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/TTSNationalIDBack.js +1 -1
- package/lib/module/screens/toan-trinh-so/TTSNationalIDBack.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/TTSOTP.js +1 -1
- package/lib/module/screens/toan-trinh-so/TTSOTP.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/VehicleRegistrationBack.js +1 -1
- package/lib/module/screens/toan-trinh-so/VehicleRegistrationBack.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/screens/toan-trinh-so/store.js +1 -1
- package/lib/module/screens/toan-trinh-so/store.js.map +1 -1
- package/lib/module/screens/uploadVideo/index.js +1 -1
- package/lib/module/screens/uploadVideo/index.js.map +1 -1
- package/lib/module/screens/uploadVideo/videoStore.js +1 -1
- package/lib/module/screens/uploadVideo/videoStore.js.map +1 -1
- package/lib/module/screens/v3/AssetInformation.js +1 -1
- package/lib/module/screens/v3/AssetInformation.js.map +1 -1
- package/lib/module/screens/v3/LoanBuyCar.js +1 -1
- package/lib/module/screens/v3/LoanBuyCar.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/module/utils/cameraCrop.js +2 -0
- package/lib/module/utils/cameraCrop.js.map +1 -0
- package/lib/typescript/AppStore.d.ts.map +1 -1
- package/lib/typescript/RNTimacare.d.ts.map +1 -1
- package/lib/typescript/assets/icons/index.d.ts +6 -1
- package/lib/typescript/assets/icons/index.d.ts.map +1 -1
- package/lib/typescript/components/AppModal.d.ts +18 -0
- package/lib/typescript/components/AppModal.d.ts.map +1 -0
- package/lib/typescript/components/ItemTimaOne.d.ts +7 -0
- package/lib/typescript/components/ItemTimaOne.d.ts.map +1 -0
- package/lib/typescript/components/ModalNotification/AlertGlobal.d.ts +30 -0
- package/lib/typescript/components/ModalNotification/AlertGlobal.d.ts.map +1 -0
- package/lib/typescript/components/ModalNotification/index.d.ts +35 -0
- package/lib/typescript/components/ModalNotification/index.d.ts.map +1 -0
- package/lib/typescript/components/ModalOptionLoan.d.ts.map +1 -1
- package/lib/typescript/components/ModalOptionLoanDigital.d.ts.map +1 -1
- package/lib/typescript/navigation/primary-navigator.d.ts +3 -0
- package/lib/typescript/navigation/primary-navigator.d.ts.map +1 -1
- package/lib/typescript/screens/NFC/OcrStart.d.ts +2 -0
- package/lib/typescript/screens/NFC/OcrStart.d.ts.map +1 -0
- package/lib/typescript/screens/NFC/ScanMRZ.d.ts +15 -0
- package/lib/typescript/screens/NFC/ScanMRZ.d.ts.map +1 -0
- package/lib/typescript/screens/SelectorStore.d.ts.map +1 -1
- package/lib/typescript/screens/camera/CCCDCameraScreen.d.ts.map +1 -1
- package/lib/typescript/screens/camera/index.d.ts.map +1 -1
- package/lib/typescript/screens/cimb-sign/index.d.ts.map +1 -1
- package/lib/typescript/screens/detail-loan/ShowQrCode.d.ts.map +1 -1
- package/lib/typescript/screens/detail-loan/store.d.ts.map +1 -1
- package/lib/typescript/screens/detail-loan-tima/InforLoan.d.ts.map +1 -1
- package/lib/typescript/screens/detail-loan-tima/PaymentSchedule.d.ts.map +1 -1
- package/lib/typescript/screens/digital-lending/Step6.d.ts.map +1 -1
- package/lib/typescript/screens/digital-lending/store.d.ts.map +1 -1
- package/lib/typescript/screens/eSign/Store.d.ts.map +1 -1
- package/lib/typescript/screens/eSign/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.map +1 -1
- package/lib/typescript/screens/full-submit/update-info.d.ts.map +1 -1
- package/lib/typescript/screens/home/DigitalTopupItem.d.ts.map +1 -1
- package/lib/typescript/screens/home/ItemMotoBikeLoan.d.ts.map +1 -1
- package/lib/typescript/screens/home/Store.d.ts.map +1 -1
- package/lib/typescript/screens/home/index.d.ts.map +1 -1
- package/lib/typescript/screens/liveness/LivenessStore.d.ts.map +1 -1
- package/lib/typescript/screens/liveness/index.d.ts.map +1 -1
- package/lib/typescript/screens/loan/PreviewSchedulePaymentTopup.d.ts.map +1 -1
- package/lib/typescript/screens/loan/UpdateLoan.d.ts.map +1 -1
- package/lib/typescript/screens/motobike/InfoLoanMotobike.d.ts.map +1 -1
- package/lib/typescript/screens/motobike/PolicyF88.d.ts.map +1 -1
- package/lib/typescript/screens/motobike/ReviewLoanMotobike.d.ts.map +1 -1
- package/lib/typescript/screens/mrz-scanner/index.d.ts.map +1 -1
- package/lib/typescript/screens/mrz-scanner/store.d.ts.map +1 -1
- package/lib/typescript/screens/nationalID/Store.d.ts.map +1 -1
- package/lib/typescript/screens/nationalID/index.d.ts.map +1 -1
- package/lib/typescript/screens/nationalIDBack/Store.d.ts.map +1 -1
- package/lib/typescript/screens/nationalIDBack/index.d.ts.map +1 -1
- package/lib/typescript/screens/notification/ListLoanStore.d.ts.map +1 -1
- package/lib/typescript/screens/notification/index.d.ts.map +1 -1
- package/lib/typescript/screens/notification/store.d.ts.map +1 -1
- package/lib/typescript/screens/personal/index.d.ts.map +1 -1
- package/lib/typescript/screens/qualify/Store.d.ts.map +1 -1
- package/lib/typescript/screens/quick-submit/store.d.ts.map +1 -1
- package/lib/typescript/screens/schedule-payment/DigitalSchedulePayment.d.ts.map +1 -1
- package/lib/typescript/screens/schedule-payment/store.d.ts.map +1 -1
- package/lib/typescript/screens/selfie/SelfieStore.d.ts.map +1 -1
- package/lib/typescript/screens/selfie/index.d.ts.map +1 -1
- package/lib/typescript/screens/sign-tima/ViewContract.d.ts.map +1 -1
- package/lib/typescript/screens/sign-tima/store.d.ts.map +1 -1
- package/lib/typescript/screens/toan-trinh-so/LoanInterestRate.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/RegisterBack.d.ts.map +1 -1
- package/lib/typescript/screens/toan-trinh-so/RegisterCamera.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/ReviewInformationOther.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/TTSNationalIDBack.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/TTSOTP.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/TopupLoanInfo.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/VehicleRegistrationBack.d.ts.map +1 -1
- package/lib/typescript/screens/toan-trinh-so/VehicleRegistrationFront.d.ts.map +1 -1
- package/lib/typescript/screens/toan-trinh-so/store.d.ts.map +1 -1
- package/lib/typescript/screens/uploadVideo/index.d.ts.map +1 -1
- package/lib/typescript/screens/uploadVideo/videoStore.d.ts.map +1 -1
- package/lib/typescript/screens/v3/AssetInformation.d.ts.map +1 -1
- package/lib/typescript/screens/v3/LoanBuyCar.d.ts.map +1 -1
- package/lib/typescript/services/api/api.d.ts.map +1 -1
- package/lib/typescript/utils/cameraCrop.d.ts +43 -0
- package/lib/typescript/utils/cameraCrop.d.ts.map +1 -0
- package/package.json +2 -1
- package/src/AppStore.tsx +7 -2
- package/src/RNTimacare.tsx +7 -1
- package/src/assets/icons/index.tsx +10 -0
- package/src/assets/icons/modal_confirm.svg +15 -0
- package/src/assets/icons/modal_notice.svg +74 -0
- package/src/assets/icons/modal_success.svg +55 -0
- package/src/assets/icons/modal_warning.svg +48 -0
- package/src/assets/icons/user_security.svg +10 -0
- package/src/assets/tts/Frame1000011947.png +0 -0
- package/src/components/AppModal.tsx +34 -0
- package/src/components/{ItemTimaOneV3.tsx → ItemTimaOne.tsx} +1 -1
- package/src/components/ModalNotification/AlertGlobal.tsx +100 -0
- package/src/components/ModalNotification/index.tsx +224 -0
- package/src/components/ModalOptionLoan.tsx +15 -7
- package/src/components/ModalOptionLoanDigital.tsx +15 -7
- package/src/navigation/primary-navigator.tsx +7 -0
- package/src/screens/NFC/OcrStart.tsx +171 -0
- package/src/screens/NFC/ScanMRZ.tsx +563 -0
- package/src/screens/SelectorStore.tsx +7 -2
- package/src/screens/camera/CCCDCameraScreen.tsx +253 -187
- package/src/screens/camera/index.tsx +50 -54
- package/src/screens/cimb-sign/index.tsx +10 -14
- package/src/screens/detail-loan/PaymentInfo.tsx +75 -54
- package/src/screens/detail-loan/ShowQrCode.tsx +77 -54
- package/src/screens/detail-loan/store.tsx +39 -7
- package/src/screens/detail-loan-tima/InforLoan.tsx +20 -4
- package/src/screens/detail-loan-tima/PaymentSchedule.tsx +19 -4
- package/src/screens/digital-lending/Step6.tsx +24 -29
- package/src/screens/digital-lending/store.tsx +113 -20
- package/src/screens/eSign/Store.tsx +69 -34
- package/src/screens/eSign/index.tsx +33 -34
- package/src/screens/full-submit/accept_policy.tsx +101 -85
- package/src/screens/full-submit/store.tsx +157 -27
- package/src/screens/full-submit/update-info.tsx +0 -1
- package/src/screens/home/DigitalTopupItem.tsx +15 -7
- package/src/screens/home/ItemMotoBikeLoan.tsx +16 -7
- package/src/screens/home/Store.tsx +44 -23
- package/src/screens/home/index.tsx +306 -298
- package/src/screens/liveness/LivenessStore.tsx +111 -89
- package/src/screens/liveness/index.tsx +67 -68
- package/src/screens/liveness-v2/index.tsx +52 -52
- package/src/screens/loan/PreviewSchedulePaymentTopup.tsx +20 -10
- package/src/screens/loan/UpdateLoan.tsx +56 -23
- package/src/screens/motobike/InfoLoanMotobike.tsx +43 -29
- package/src/screens/motobike/PolicyF88.tsx +15 -6
- package/src/screens/motobike/ReviewLoanMotobike.tsx +13 -3
- package/src/screens/mrz-scanner/index.tsx +56 -55
- package/src/screens/mrz-scanner/store.ts +13 -3
- package/src/screens/nationalID/Store.tsx +50 -29
- package/src/screens/nationalID/index.tsx +123 -219
- package/src/screens/nationalIDBack/Store.tsx +44 -26
- package/src/screens/nationalIDBack/index.tsx +129 -210
- package/src/screens/notification/ListLoanStore.tsx +19 -4
- package/src/screens/notification/index.tsx +0 -1
- package/src/screens/notification/store.tsx +7 -2
- package/src/screens/personal/index.tsx +21 -19
- package/src/screens/qualify/Store.tsx +0 -1
- package/src/screens/quick-submit/store.tsx +85 -15
- package/src/screens/schedule-payment/DigitalSchedulePayment.tsx +20 -4
- package/src/screens/schedule-payment/store.tsx +13 -5
- package/src/screens/selfie/SelfieStore.tsx +25 -9
- package/src/screens/selfie/index.tsx +0 -1
- package/src/screens/sign-tima/ViewContract.tsx +17 -18
- package/src/screens/sign-tima/store.tsx +37 -7
- package/src/screens/toan-trinh-so/LoanInterestRate.tsx +36 -10
- package/src/screens/toan-trinh-so/OCR.tsx +321 -609
- package/src/screens/toan-trinh-so/RegisterBack.tsx +21 -4
- package/src/screens/toan-trinh-so/RegisterCamera.tsx +50 -54
- package/src/screens/toan-trinh-so/ReviewInformation.tsx +31 -25
- package/src/screens/toan-trinh-so/ReviewInformationOther.tsx +88 -82
- package/src/screens/toan-trinh-so/ReviewLoan.tsx +25 -5
- package/src/screens/toan-trinh-so/TTSNationalIDBack.tsx +19 -4
- package/src/screens/toan-trinh-so/TTSNationalIDFront.tsx +19 -4
- package/src/screens/toan-trinh-so/TTSOTP.tsx +42 -25
- package/src/screens/toan-trinh-so/TTSSelfie.tsx +63 -56
- package/src/screens/toan-trinh-so/TTSSignLoan.tsx +63 -55
- package/src/screens/toan-trinh-so/TopupLoanInfo.tsx +50 -43
- package/src/screens/toan-trinh-so/VehicleCamera.tsx +275 -341
- package/src/screens/toan-trinh-so/VehicleRegistration.tsx +19 -4
- package/src/screens/toan-trinh-so/VehicleRegistrationBack.tsx +19 -4
- package/src/screens/toan-trinh-so/VehicleRegistrationFront.tsx +19 -4
- package/src/screens/toan-trinh-so/store.ts +82 -37
- package/src/screens/uploadVideo/index.tsx +26 -21
- package/src/screens/uploadVideo/videoStore.tsx +19 -4
- package/src/screens/v3/AssetInformation.tsx +35 -16
- package/src/screens/v3/LoanBuyCar.tsx +35 -16
- package/src/services/api/api.ts +23 -26
- package/src/utils/cameraCrop.ts +96 -0
- package/lib/commonjs/components/ItemTimaOneV2.js +0 -2
- package/lib/commonjs/components/ItemTimaOneV2.js.flow +0 -617
- package/lib/commonjs/components/ItemTimaOneV2.js.map +0 -1
- package/lib/commonjs/components/ItemTimaOneV3.js +0 -2
- package/lib/commonjs/components/ItemTimaOneV3.js.map +0 -1
- package/lib/module/components/ItemTimaOneV2.js +0 -2
- package/lib/module/components/ItemTimaOneV2.js.map +0 -1
- package/lib/module/components/ItemTimaOneV3.js +0 -2
- package/lib/module/components/ItemTimaOneV3.js.map +0 -1
- package/lib/typescript/components/ItemTimaOneV2.d.ts +0 -7
- package/lib/typescript/components/ItemTimaOneV2.d.ts.map +0 -1
- package/lib/typescript/components/ItemTimaOneV3.d.ts +0 -7
- package/lib/typescript/components/ItemTimaOneV3.d.ts.map +0 -1
- package/src/components/ItemTimaOneV2.tsx +0 -617
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
//@ts-nocheck
|
|
2
|
-
import React, {
|
|
3
|
-
|
|
2
|
+
import React, {
|
|
3
|
+
useCallback,
|
|
4
|
+
useEffect,
|
|
5
|
+
useMemo,
|
|
6
|
+
useRef,
|
|
7
|
+
useState,
|
|
8
|
+
} from 'react';
|
|
9
|
+
import { observer } from 'mobx-react-lite';
|
|
4
10
|
import {
|
|
5
11
|
View,
|
|
6
|
-
NativeModules,
|
|
7
12
|
TouchableOpacity,
|
|
8
|
-
SafeAreaView,
|
|
9
13
|
TextStyle,
|
|
10
14
|
ViewStyle,
|
|
11
15
|
ImageStyle,
|
|
12
16
|
Image,
|
|
13
|
-
ActivityIndicator,
|
|
14
|
-
Dimensions,
|
|
15
17
|
StyleSheet,
|
|
16
|
-
Alert,
|
|
17
18
|
Platform,
|
|
18
19
|
} from 'react-native';
|
|
19
20
|
import { MText } from '../../components/MText';
|
|
@@ -24,56 +25,66 @@ import {
|
|
|
24
25
|
RESULTS,
|
|
25
26
|
openSettings,
|
|
26
27
|
} from 'react-native-permissions';
|
|
27
|
-
import {
|
|
28
|
-
Camera as VisionCamera,
|
|
29
|
-
useCameraDevice,
|
|
30
|
-
useCameraFormat,
|
|
31
|
-
} from 'react-native-vision-camera';
|
|
28
|
+
import { Camera as VisionCamera, useCameraDevices } from 'react-native-vision-camera';
|
|
32
29
|
import Modal from 'react-native-modal';
|
|
33
30
|
import LinearGradient from 'react-native-linear-gradient';
|
|
34
|
-
import {
|
|
35
|
-
|
|
36
|
-
ChipSvg,
|
|
37
|
-
CloseIcon,
|
|
38
|
-
IconBackWhite,
|
|
39
|
-
TakePhotoSvg,
|
|
40
|
-
TimaSmall,
|
|
41
|
-
} from '../../assets/icons';
|
|
42
|
-
import MButton from '../../components/MButton';
|
|
43
|
-
import { commonStyles } from '../CommonStyles';
|
|
44
|
-
import {
|
|
45
|
-
StackActions,
|
|
46
|
-
useNavigation,
|
|
47
|
-
useIsFocused,
|
|
48
|
-
} from '@react-navigation/native';
|
|
49
|
-
import TextRecognition from '@react-native-ml-kit/text-recognition';
|
|
31
|
+
import { CloseIcon, IconBack, TakePhotoSvg, TimaSmall } from '../../assets/icons';
|
|
32
|
+
import { useNavigation, useIsFocused } from '@react-navigation/native';
|
|
50
33
|
import { ScreenNames } from '../../navigation';
|
|
51
|
-
import { Api } from '../../services/api';
|
|
52
|
-
import Loading from '../../components/Loading';
|
|
53
|
-
import DeviceInfo from 'react-native-device-info';
|
|
54
34
|
import { IconUpload } from '../../assets/svgs';
|
|
55
35
|
import ImagePicker from 'react-native-image-crop-picker';
|
|
56
36
|
import { launchImageLibrary } from 'react-native-image-picker';
|
|
57
37
|
import { useSafeAreaInsets } from 'react-native-safe-area-context';
|
|
38
|
+
import { AlertGlobal } from '../../components/ModalNotification/AlertGlobal';
|
|
39
|
+
import {
|
|
40
|
+
cropPhotoToAspect,
|
|
41
|
+
pickClosestFocusDevice,
|
|
42
|
+
} from '../../utils/cameraCrop';
|
|
58
43
|
|
|
59
|
-
const
|
|
44
|
+
const ORANGE = '#F05123';
|
|
45
|
+
// Thẻ CMND/CCCD theo chuẩn ID-1: 85.6mm x 54mm
|
|
46
|
+
const CARD_ASPECT_RATIO = 85.6 / 54;
|
|
60
47
|
|
|
61
48
|
export const OCR = observer(function OCR(props: any) {
|
|
62
49
|
const insets = useSafeAreaInsets();
|
|
63
50
|
const isFocused = useIsFocused();
|
|
64
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
65
51
|
const navigation = useNavigation();
|
|
66
52
|
const [showModal, setShowModal] = useState(false);
|
|
67
|
-
const [type, setType] = useState('passport');
|
|
68
53
|
const [taking, setTaking] = useState(false);
|
|
69
54
|
const [passPermission, setPassPermission] = useState(false);
|
|
70
55
|
const [shouldRenderCamera, setShouldRenderCamera] = useState(false);
|
|
56
|
+
const [focusPoint, setFocusPoint] = useState(null);
|
|
57
|
+
|
|
71
58
|
const myCamera = useRef(null);
|
|
72
|
-
const
|
|
73
|
-
const
|
|
74
|
-
|
|
59
|
+
const frameSize = useRef({ width: 0, height: 0 });
|
|
60
|
+
const focusTimer = useRef(null);
|
|
61
|
+
|
|
62
|
+
// Chọn ống kính sau lấy nét gần nhất (macro) để chụp cận thẻ mà không mờ
|
|
63
|
+
const devices = useCameraDevices();
|
|
64
|
+
const device = useMemo(() => pickClosestFocusDevice(devices, 'back'), [
|
|
65
|
+
devices,
|
|
75
66
|
]);
|
|
76
67
|
|
|
68
|
+
const front = props?.route?.params?.front;
|
|
69
|
+
|
|
70
|
+
// Lấy nét vào một điểm (toạ độ theo hệ khung preview = camera view). Dùng cho
|
|
71
|
+
// chạm-để-lấy-nét và lấy nét giữa khung trước khi chụp -> tránh mờ khi gần.
|
|
72
|
+
const focusAt = useCallback(
|
|
73
|
+
async (x, y) => {
|
|
74
|
+
const cam = myCamera.current;
|
|
75
|
+
if (cam == null || !device?.supportsFocus) return;
|
|
76
|
+
setFocusPoint({ x, y });
|
|
77
|
+
if (focusTimer.current) clearTimeout(focusTimer.current);
|
|
78
|
+
focusTimer.current = setTimeout(() => setFocusPoint(null), 800);
|
|
79
|
+
try {
|
|
80
|
+
await cam.focus({ x, y });
|
|
81
|
+
} catch (e) {
|
|
82
|
+
// focus có thể lỗi nếu đang lấy nét dở hoặc điểm ngoài vùng -> bỏ qua
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
[device]
|
|
86
|
+
);
|
|
87
|
+
|
|
77
88
|
const requestPermissions = () => {
|
|
78
89
|
request(
|
|
79
90
|
Platform.OS === 'ios'
|
|
@@ -85,51 +96,49 @@ export const OCR = observer(function OCR(props: any) {
|
|
|
85
96
|
console.log(
|
|
86
97
|
'This feature is not available (on this device / in this context)'
|
|
87
98
|
);
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
'
|
|
91
|
-
|
|
92
|
-
|
|
99
|
+
AlertGlobal.show({
|
|
100
|
+
type: 'warning',
|
|
101
|
+
title: 'Thông báo',
|
|
102
|
+
message:
|
|
103
|
+
'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ị!',
|
|
104
|
+
primaryText: 'Đóng',
|
|
105
|
+
});
|
|
93
106
|
break;
|
|
94
107
|
case RESULTS.DENIED:
|
|
95
108
|
console.log(
|
|
96
109
|
'The permission has not been requested / is denied but requestable'
|
|
97
110
|
);
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
'
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
]
|
|
113
|
-
);
|
|
111
|
+
AlertGlobal.show({
|
|
112
|
+
type: 'warning',
|
|
113
|
+
title: 'Thông báo',
|
|
114
|
+
message:
|
|
115
|
+
'Bạn đã từ chối quyền máy ảnh. Vui lòng cấp quyền máy ảnh để tiếp tục!',
|
|
116
|
+
primaryText: 'Đồng ý',
|
|
117
|
+
onPrimaryPress: () => {
|
|
118
|
+
if (Platform.OS === 'ios') {
|
|
119
|
+
openSettings();
|
|
120
|
+
} else {
|
|
121
|
+
requestPermissions();
|
|
122
|
+
}
|
|
123
|
+
},
|
|
124
|
+
});
|
|
114
125
|
break;
|
|
115
126
|
case RESULTS.LIMITED:
|
|
116
127
|
console.log('The permission is limited: some actions are possible');
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
'
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
]
|
|
132
|
-
);
|
|
128
|
+
AlertGlobal.show({
|
|
129
|
+
type: 'warning',
|
|
130
|
+
title: 'Thông báo',
|
|
131
|
+
message:
|
|
132
|
+
'Quyền máy ảnh bị hạn chế. Vui lòng kiểm tra lại để tiếp tục!',
|
|
133
|
+
primaryText: 'Đồng ý',
|
|
134
|
+
onPrimaryPress: () => {
|
|
135
|
+
if (Platform.OS === 'ios') {
|
|
136
|
+
openSettings();
|
|
137
|
+
} else {
|
|
138
|
+
requestPermissions();
|
|
139
|
+
}
|
|
140
|
+
},
|
|
141
|
+
});
|
|
133
142
|
break;
|
|
134
143
|
case RESULTS.GRANTED:
|
|
135
144
|
console.log('The permission is granted');
|
|
@@ -137,22 +146,20 @@ export const OCR = observer(function OCR(props: any) {
|
|
|
137
146
|
break;
|
|
138
147
|
case RESULTS.BLOCKED:
|
|
139
148
|
console.log('The permission is denied and not requestable anymore');
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
'
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
]
|
|
155
|
-
);
|
|
149
|
+
AlertGlobal.show({
|
|
150
|
+
type: 'warning',
|
|
151
|
+
title: 'Thông báo',
|
|
152
|
+
message:
|
|
153
|
+
'Bạn đã từ chối quyền máy ảnh. Vui lòng cấp quyền máy ảnh để tiếp tục!',
|
|
154
|
+
primaryText: 'Đồng ý',
|
|
155
|
+
onPrimaryPress: () => {
|
|
156
|
+
if (Platform.OS === 'ios') {
|
|
157
|
+
openSettings();
|
|
158
|
+
} else {
|
|
159
|
+
requestPermissions();
|
|
160
|
+
}
|
|
161
|
+
},
|
|
162
|
+
});
|
|
156
163
|
break;
|
|
157
164
|
}
|
|
158
165
|
});
|
|
@@ -182,129 +189,19 @@ export const OCR = observer(function OCR(props: any) {
|
|
|
182
189
|
useEffect(() => {
|
|
183
190
|
requestPermissions();
|
|
184
191
|
loadIntro();
|
|
192
|
+
return () => {
|
|
193
|
+
if (focusTimer.current) clearTimeout(focusTimer.current);
|
|
194
|
+
};
|
|
185
195
|
}, []);
|
|
186
196
|
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
...body,
|
|
191
|
-
loanBriefId: props?.route?.params?.loan?.id,
|
|
192
|
-
});
|
|
193
|
-
if (response.kind === 'ok') {
|
|
194
|
-
if (response.data?.meta?.errorCode === 200) {
|
|
195
|
-
setTimeout(() => {
|
|
196
|
-
navigation.push(ScreenNames.TTSSelfie, {
|
|
197
|
-
loan: props?.route?.params?.loan,
|
|
198
|
-
});
|
|
199
|
-
}, 500);
|
|
200
|
-
} else {
|
|
201
|
-
Alert.alert('Thông báo', response?.data?.meta?.errorMessage);
|
|
202
|
-
}
|
|
203
|
-
} else {
|
|
204
|
-
Alert.alert('Thông báo', 'Có lỗi xảy ra. Vui lòng thử lại sau');
|
|
205
|
-
}
|
|
206
|
-
} catch (error) {
|
|
207
|
-
console.log(error);
|
|
208
|
-
}
|
|
209
|
-
};
|
|
210
|
-
|
|
211
|
-
const convertToDate = (input, end) => {
|
|
212
|
-
let yearPrefix = input.substring(0, 2);
|
|
213
|
-
let year = end
|
|
214
|
-
? '20' + yearPrefix
|
|
215
|
-
: parseInt(yearPrefix) > 20
|
|
216
|
-
? '19' + yearPrefix
|
|
217
|
-
: '20' + yearPrefix;
|
|
218
|
-
let month = input.substring(2, 4);
|
|
219
|
-
let day = input.substring(4, 6);
|
|
220
|
-
|
|
221
|
-
return year + '-' + month + '-' + day;
|
|
222
|
-
};
|
|
223
|
-
|
|
224
|
-
const extractMRZInfo = (text) => {
|
|
225
|
-
let documentNumber = '';
|
|
226
|
-
let birthDate = '';
|
|
227
|
-
let expirationDate = '';
|
|
228
|
-
const regex1 = /VNM(\d{9})/;
|
|
229
|
-
const match1 = text.match(regex1);
|
|
230
|
-
|
|
231
|
-
// If a match is found, return the 9 digits, otherwise return null
|
|
232
|
-
if (match1) {
|
|
233
|
-
documentNumber = match1[1];
|
|
234
|
-
}
|
|
235
|
-
|
|
236
|
-
console.log('documentNumber', documentNumber);
|
|
237
|
-
|
|
238
|
-
// Regular expression to match 'VNM' followed by 9 digits, then two 6-digit numbers
|
|
239
|
-
const regex = /(\d{6}).[MF](\d{6})/;
|
|
240
|
-
|
|
241
|
-
// Search for the pattern in the text
|
|
242
|
-
const match = text.replace(/ /g, '').match(regex);
|
|
243
|
-
|
|
244
|
-
// If a match is found, return the captured groups, otherwise return null
|
|
245
|
-
if (match) {
|
|
246
|
-
console.log({
|
|
247
|
-
documentNumber: documentNumber,
|
|
248
|
-
birthDate: match[1],
|
|
249
|
-
expirationDate: match[2],
|
|
250
|
-
});
|
|
251
|
-
(birthDate = match[1]), (expirationDate = match[2]);
|
|
252
|
-
} else {
|
|
253
|
-
return null;
|
|
254
|
-
}
|
|
255
|
-
if (documentNumber && birthDate && expirationDate) {
|
|
256
|
-
try {
|
|
257
|
-
NFCReader.readNFCCard(
|
|
258
|
-
documentNumber,
|
|
259
|
-
convertToDate(birthDate, false),
|
|
260
|
-
convertToDate(expirationDate, true),
|
|
261
|
-
(error, response) => {
|
|
262
|
-
try {
|
|
263
|
-
const convertData = JSON.parse(response);
|
|
264
|
-
saveDataNfc(convertData);
|
|
265
|
-
} catch (e) {
|
|
266
|
-
console.log(e);
|
|
267
|
-
}
|
|
268
|
-
}
|
|
269
|
-
);
|
|
270
|
-
} catch (e) {
|
|
271
|
-
console.log(e);
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
};
|
|
275
|
-
|
|
276
|
-
const handleTextRecognition = async (imagePath) => {
|
|
277
|
-
try {
|
|
278
|
-
const result = await TextRecognition.recognize(imagePath);
|
|
279
|
-
extractMRZInfo(result.text);
|
|
280
|
-
} catch (error) {
|
|
281
|
-
console.log(error);
|
|
282
|
-
}
|
|
283
|
-
};
|
|
284
|
-
|
|
285
|
-
const scanNfc = async () => {
|
|
286
|
-
if (myCamera.current) {
|
|
287
|
-
const data = await myCamera.current.takePhoto({
|
|
288
|
-
qualityPrioritization: 'speed',
|
|
289
|
-
});
|
|
290
|
-
await handleTextRecognition('file://' + data.path);
|
|
291
|
-
}
|
|
292
|
-
};
|
|
293
|
-
|
|
294
|
-
const takePhoto = async () => {
|
|
295
|
-
if (myCamera.current == null || taking) return;
|
|
296
|
-
setTaking(true);
|
|
297
|
-
const data = await myCamera.current.takePhoto({
|
|
298
|
-
qualityPrioritization: 'quality',
|
|
299
|
-
});
|
|
300
|
-
const uri = 'file://' + data.path;
|
|
301
|
-
setTaking(false);
|
|
302
|
-
if (props?.route?.params?.front && !props.route?.params?.callback) {
|
|
197
|
+
// Điều hướng sau khi có ảnh (giữ nguyên logic gốc của OCR)
|
|
198
|
+
const goNextWithUri = (uri) => {
|
|
199
|
+
if (front && !props.route?.params?.callback) {
|
|
303
200
|
navigation.push(ScreenNames.TTSNationalIDFront, {
|
|
304
201
|
uri,
|
|
305
202
|
loan: props?.route?.params?.loan,
|
|
306
203
|
});
|
|
307
|
-
} else if (!
|
|
204
|
+
} else if (!front && !props.route?.params?.callback) {
|
|
308
205
|
navigation.push(ScreenNames.TTSNationalIDBack, {
|
|
309
206
|
uri,
|
|
310
207
|
loan: props?.route?.params?.loan,
|
|
@@ -315,229 +212,135 @@ export const OCR = observer(function OCR(props: any) {
|
|
|
315
212
|
}
|
|
316
213
|
};
|
|
317
214
|
|
|
215
|
+
const takePhoto = async () => {
|
|
216
|
+
if (myCamera.current == null || taking) return;
|
|
217
|
+
setTaking(true);
|
|
218
|
+
try {
|
|
219
|
+
// Lấy nét giữa khung trước khi chụp để tài liệu ở gần vẫn nét
|
|
220
|
+
const { width: fw, height: fh } = frameSize.current;
|
|
221
|
+
if (device?.supportsFocus && fw && fh) {
|
|
222
|
+
try {
|
|
223
|
+
await myCamera.current.focus({ x: fw / 2, y: fh / 2 });
|
|
224
|
+
} catch (e) {}
|
|
225
|
+
}
|
|
226
|
+
const data = await myCamera.current.takePhoto({
|
|
227
|
+
qualityPrioritization: 'quality',
|
|
228
|
+
});
|
|
229
|
+
// Cắt ảnh vừa đúng khung theo tỉ lệ thẻ (xử lý orientation trong util)
|
|
230
|
+
const uri = await cropPhotoToAspect(data, CARD_ASPECT_RATIO);
|
|
231
|
+
setTaking(false);
|
|
232
|
+
goNextWithUri(uri);
|
|
233
|
+
} catch (e) {
|
|
234
|
+
console.error(e);
|
|
235
|
+
setTaking(false);
|
|
236
|
+
AlertGlobal.show({
|
|
237
|
+
type: 'warning',
|
|
238
|
+
title: 'Thông báo',
|
|
239
|
+
message: 'Không chụp được ảnh. Vui lòng thử lại.',
|
|
240
|
+
primaryText: 'Đóng',
|
|
241
|
+
});
|
|
242
|
+
}
|
|
243
|
+
};
|
|
244
|
+
|
|
318
245
|
const pickImageFromGallery = async () => {
|
|
319
246
|
if (Platform.OS === 'android') {
|
|
320
|
-
const result = await launchImageLibrary({
|
|
321
|
-
mediaType: 'photo',
|
|
322
|
-
});
|
|
247
|
+
const result = await launchImageLibrary({ mediaType: 'photo' });
|
|
323
248
|
if (result.assets) {
|
|
324
|
-
|
|
325
|
-
navigation.push(ScreenNames.TTSNationalIDFront, {
|
|
326
|
-
uri: result.assets[0]?.uri,
|
|
327
|
-
loan: props?.route?.params?.loan,
|
|
328
|
-
});
|
|
329
|
-
} else if (
|
|
330
|
-
!props?.route?.params?.front &&
|
|
331
|
-
!props.route?.params?.callback
|
|
332
|
-
) {
|
|
333
|
-
navigation.push(ScreenNames.TTSNationalIDBack, {
|
|
334
|
-
uri: result.assets[0]?.uri,
|
|
335
|
-
loan: props?.route?.params?.loan,
|
|
336
|
-
});
|
|
337
|
-
} else {
|
|
338
|
-
navigation.goBack();
|
|
339
|
-
props.route?.params?.callback(result.assets[0]?.uri);
|
|
340
|
-
}
|
|
249
|
+
goNextWithUri(result.assets[0]?.uri);
|
|
341
250
|
}
|
|
342
251
|
} else {
|
|
343
252
|
ImagePicker.openPicker({}).then((image) => {
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
Platform.OS === 'android' ? image?.path : 'file://' + image?.path,
|
|
348
|
-
loan: props?.route?.params?.loan,
|
|
349
|
-
});
|
|
350
|
-
} else if (
|
|
351
|
-
!props?.route?.params?.front &&
|
|
352
|
-
!props.route?.params?.callback
|
|
353
|
-
) {
|
|
354
|
-
navigation.push(ScreenNames.TTSNationalIDBack, {
|
|
355
|
-
uri:
|
|
356
|
-
Platform.OS === 'android' ? image?.path : 'file://' + image?.path,
|
|
357
|
-
loan: props?.route?.params?.loan,
|
|
358
|
-
});
|
|
359
|
-
} else {
|
|
360
|
-
navigation.goBack();
|
|
361
|
-
props.route?.params?.callback(
|
|
362
|
-
Platform.OS === 'android' ? image?.path : 'file://' + image?.path
|
|
363
|
-
);
|
|
364
|
-
}
|
|
253
|
+
goNextWithUri(
|
|
254
|
+
Platform.OS === 'android' ? image?.path : 'file://' + image?.path
|
|
255
|
+
);
|
|
365
256
|
});
|
|
366
257
|
}
|
|
367
258
|
};
|
|
368
259
|
|
|
369
260
|
return (
|
|
370
|
-
<View
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
style={{
|
|
403
|
-
color: 'white',
|
|
404
|
-
fontSize: 16,
|
|
405
|
-
textAlign: 'center',
|
|
406
|
-
padding: 16,
|
|
407
|
-
marginTop: 10,
|
|
408
|
-
}}
|
|
409
|
-
>
|
|
410
|
-
{type === 'passport' && props?.route?.params?.front
|
|
411
|
-
? 'Chụp CMND/ CCCD mặt trước'
|
|
412
|
-
: type === 'passport'
|
|
413
|
-
? 'Chụp CMND/ CCCD mặt sau'
|
|
414
|
-
: 'Dùng camera để quét chuỗi ký tự mặt sau thẻ CCCD gắn chíp ở phía dưới'}
|
|
415
|
-
</MText>
|
|
416
|
-
</View>
|
|
417
|
-
|
|
418
|
-
{passPermission && type === 'passport' && shouldRenderCamera ? (
|
|
419
|
-
<View
|
|
420
|
-
style={[
|
|
421
|
-
commonStyles.alignCenter,
|
|
422
|
-
commonStyles.fill,
|
|
423
|
-
commonStyles.justifyCenter,
|
|
424
|
-
{
|
|
425
|
-
position: 'absolute',
|
|
426
|
-
width: Dimensions.get('window').width,
|
|
427
|
-
height: Dimensions.get('window').height,
|
|
428
|
-
},
|
|
429
|
-
]}
|
|
430
|
-
>
|
|
431
|
-
{device ? (
|
|
432
|
-
<View style={styles.passportCameraFrame}>
|
|
261
|
+
<View style={styles.container}>
|
|
262
|
+
{passPermission && shouldRenderCamera ? (
|
|
263
|
+
<>
|
|
264
|
+
<View style={[styles.header, { paddingTop: insets.top + 16 }]}>
|
|
265
|
+
<TouchableOpacity
|
|
266
|
+
onPress={() => navigation.navigate(ScreenNames.Main)}
|
|
267
|
+
hitSlop={{ top: 12, bottom: 12, left: 12, right: 12 }}
|
|
268
|
+
>
|
|
269
|
+
<IconBack />
|
|
270
|
+
</TouchableOpacity>
|
|
271
|
+
<View style={styles.titleWrap}>
|
|
272
|
+
<MText style={styles.headerTitle}>CMND / CCCD</MText>
|
|
273
|
+
</View>
|
|
274
|
+
</View>
|
|
275
|
+
|
|
276
|
+
<MText style={styles.instruction}>
|
|
277
|
+
{front ? 'Chụp CMND/ CCCD mặt trước' : 'Chụp CMND/ CCCD mặt sau'}
|
|
278
|
+
</MText>
|
|
279
|
+
|
|
280
|
+
{/* Khung tỉ lệ thẻ: vùng nhìn thấy của preview = vùng sẽ crop.
|
|
281
|
+
Chạm vào khung để lấy nét thủ công. */}
|
|
282
|
+
<View
|
|
283
|
+
style={styles.photoFrame}
|
|
284
|
+
onLayout={(e) => {
|
|
285
|
+
frameSize.current = e.nativeEvent.layout;
|
|
286
|
+
}}
|
|
287
|
+
onStartShouldSetResponder={() => true}
|
|
288
|
+
onResponderRelease={(e) =>
|
|
289
|
+
focusAt(e.nativeEvent.locationX, e.nativeEvent.locationY)
|
|
290
|
+
}
|
|
291
|
+
>
|
|
292
|
+
{device ? (
|
|
433
293
|
<VisionCamera
|
|
434
294
|
ref={myCamera}
|
|
435
295
|
style={StyleSheet.absoluteFill}
|
|
436
296
|
device={device}
|
|
437
|
-
isActive={
|
|
297
|
+
isActive={isFocused}
|
|
438
298
|
photo={true}
|
|
439
|
-
format={format}
|
|
440
299
|
/>
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
<
|
|
444
|
-
|
|
300
|
+
) : null}
|
|
301
|
+
<View style={[styles.corner, styles.cornerTL]} />
|
|
302
|
+
<View style={[styles.corner, styles.cornerTR]} />
|
|
303
|
+
<View style={[styles.corner, styles.cornerBL]} />
|
|
304
|
+
<View style={[styles.corner, styles.cornerBR]} />
|
|
305
|
+
{focusPoint && (
|
|
306
|
+
<View
|
|
307
|
+
pointerEvents="none"
|
|
308
|
+
style={[
|
|
309
|
+
styles.focusRing,
|
|
310
|
+
{ left: focusPoint.x - 32, top: focusPoint.y - 32 },
|
|
311
|
+
]}
|
|
312
|
+
/>
|
|
313
|
+
)}
|
|
314
|
+
</View>
|
|
315
|
+
|
|
445
316
|
<TouchableOpacity
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
}}
|
|
449
|
-
style={{
|
|
450
|
-
flexDirection: 'row',
|
|
451
|
-
alignItems: 'center',
|
|
452
|
-
marginTop: 16,
|
|
453
|
-
}}
|
|
317
|
+
style={styles.galleryButton}
|
|
318
|
+
onPress={pickImageFromGallery}
|
|
454
319
|
>
|
|
455
320
|
<IconUpload />
|
|
456
|
-
<MText
|
|
457
|
-
style={{
|
|
458
|
-
color: 'white',
|
|
459
|
-
fontSize: 12,
|
|
460
|
-
marginLeft: 8,
|
|
461
|
-
}}
|
|
462
|
-
>
|
|
463
|
-
Tải ảnh từ thư viện
|
|
464
|
-
</MText>
|
|
321
|
+
<MText style={styles.galleryText}>Tải ảnh từ thư viện</MText>
|
|
465
322
|
</TouchableOpacity>
|
|
466
323
|
|
|
467
|
-
<View style={
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
Vui lòng đặt giấy tờ nằm vừa khung hình chữ nhật, chụp đủ ánh sáng
|
|
477
|
-
và rõ nét.
|
|
478
|
-
</MText>
|
|
479
|
-
<MButton
|
|
480
|
-
onPress={() => {
|
|
481
|
-
takePhoto();
|
|
482
|
-
}}
|
|
483
|
-
>
|
|
484
|
-
<TakePhotoSvg />
|
|
485
|
-
</MButton>
|
|
486
|
-
</View>
|
|
487
|
-
</View>
|
|
488
|
-
) : passPermission && type === 'nfc' && shouldRenderCamera ? (
|
|
489
|
-
<>
|
|
490
|
-
{device ? (
|
|
491
|
-
<VisionCamera
|
|
492
|
-
ref={myCamera}
|
|
493
|
-
style={styles.camera}
|
|
494
|
-
device={device}
|
|
495
|
-
isActive={true}
|
|
496
|
-
photo={true}
|
|
497
|
-
format={format}
|
|
498
|
-
/>
|
|
499
|
-
) : null}
|
|
500
|
-
<View style={styles.overlay}>
|
|
501
|
-
<View style={styles.overlayTop} />
|
|
502
|
-
<View style={styles.overlayCenter}>
|
|
503
|
-
<View style={styles.overlayLeft} />
|
|
504
|
-
<View style={styles.overlayRect}></View>
|
|
505
|
-
<View style={styles.overlayRight} />
|
|
506
|
-
</View>
|
|
507
|
-
<View style={styles.overlayBottom} />
|
|
508
|
-
</View>
|
|
509
|
-
<View
|
|
510
|
-
style={[styles.buttonContainer, { bottom: insets.bottom + 24 }]}
|
|
324
|
+
<View style={styles.spacer} />
|
|
325
|
+
<MText style={[styles.hint, { marginTop: 0, marginBottom: 20 }]}>
|
|
326
|
+
Đưa giấy tờ lại gần cho vừa khung, chạm vào màn hình{'\n'}để lấy nét
|
|
327
|
+
nếu ảnh bị mờ.
|
|
328
|
+
</MText>
|
|
329
|
+
<TouchableOpacity
|
|
330
|
+
style={[styles.captureButton, { marginBottom: insets.bottom + 24 }]}
|
|
331
|
+
onPress={takePhoto}
|
|
332
|
+
disabled={taking}
|
|
511
333
|
>
|
|
512
|
-
<
|
|
513
|
-
|
|
514
|
-
color: 'white',
|
|
515
|
-
fontSize: 14,
|
|
516
|
-
textAlign: 'center',
|
|
517
|
-
padding: 16,
|
|
518
|
-
}}
|
|
519
|
-
>
|
|
520
|
-
Vui lòng đặt chuỗi kí tự nằm vừa khung hình chữ nhật, chụp đủ ánh
|
|
521
|
-
sáng và rõ nét.
|
|
522
|
-
</MText>
|
|
523
|
-
<TouchableOpacity
|
|
524
|
-
onPress={() => {
|
|
525
|
-
scanNfc();
|
|
526
|
-
}}
|
|
527
|
-
>
|
|
528
|
-
<TakePhotoSvg />
|
|
529
|
-
</TouchableOpacity>
|
|
530
|
-
</View>
|
|
334
|
+
<TakePhotoSvg />
|
|
335
|
+
</TouchableOpacity>
|
|
531
336
|
</>
|
|
532
|
-
) :
|
|
533
|
-
<></>
|
|
534
|
-
)}
|
|
337
|
+
) : null}
|
|
535
338
|
|
|
536
339
|
<Modal
|
|
537
340
|
isVisible={showModal}
|
|
538
341
|
style={$modal}
|
|
539
342
|
backdropTransitionInTiming={0}
|
|
540
|
-
|
|
343
|
+
animationOutTiming={200}
|
|
541
344
|
animationInTiming={200}
|
|
542
345
|
animationIn={'slideInUp'}
|
|
543
346
|
animationOut={'fadeOutDown'}
|
|
@@ -566,9 +369,7 @@ export const OCR = observer(function OCR(props: any) {
|
|
|
566
369
|
<CloseIcon />
|
|
567
370
|
</TouchableOpacity>
|
|
568
371
|
<MText style={$title}>NHẬN DIỆN GIẤY TỜ TÙY THÂN</MText>
|
|
569
|
-
<MText style={$description}>
|
|
570
|
-
Chụp ảnh 2 mặt hoặc NFC CCCD/ CMND
|
|
571
|
-
</MText>
|
|
372
|
+
<MText style={$description}>Chụp ảnh 2 mặt CCCD/ CMND</MText>
|
|
572
373
|
|
|
573
374
|
<Image
|
|
574
375
|
source={require('../../assets/tts/vehicleStep.png')}
|
|
@@ -576,52 +377,9 @@ export const OCR = observer(function OCR(props: any) {
|
|
|
576
377
|
/>
|
|
577
378
|
|
|
578
379
|
<View style={$bg}>
|
|
579
|
-
<View
|
|
580
|
-
style={{
|
|
581
|
-
flexDirection: 'column',
|
|
582
|
-
alignItems: 'center',
|
|
583
|
-
}}
|
|
584
|
-
>
|
|
585
|
-
<Image
|
|
586
|
-
source={require('../../assets/tts/Frame1000011946.png')}
|
|
587
|
-
style={{
|
|
588
|
-
width: '60%',
|
|
589
|
-
height: 70,
|
|
590
|
-
resizeMode: 'contain',
|
|
591
|
-
marginVertical: 16,
|
|
592
|
-
}}
|
|
593
|
-
/>
|
|
594
|
-
</View>
|
|
595
|
-
<View style={{ marginTop: 10, paddingHorizontal: 24 }}>
|
|
596
|
-
<MText style={[$title2, { textAlign: 'left' }]}>
|
|
597
|
-
Cách 1: NFC (Áp dụng cho CCCD gắn chip)
|
|
598
|
-
</MText>
|
|
599
|
-
<View style={$row}>
|
|
600
|
-
<TimaSmall />
|
|
601
|
-
<MText style={$txt}>
|
|
602
|
-
Đặt phần chip đồng gần lại với phần phía trên của{'\n'}mặt
|
|
603
|
-
lưng điện thoại
|
|
604
|
-
</MText>
|
|
605
|
-
</View>
|
|
606
|
-
<View style={$row}>
|
|
607
|
-
<TimaSmall />
|
|
608
|
-
<MText style={$txt}>
|
|
609
|
-
Giữ nguyên cho đến khi đọc xong thông tin thẻ
|
|
610
|
-
</MText>
|
|
611
|
-
</View>
|
|
612
|
-
<Image
|
|
613
|
-
source={require('../../assets/tts/Frame1000011953.png')}
|
|
614
|
-
style={{
|
|
615
|
-
width: '100%',
|
|
616
|
-
height: 70,
|
|
617
|
-
resizeMode: 'contain',
|
|
618
|
-
marginTop: 16,
|
|
619
|
-
}}
|
|
620
|
-
/>
|
|
621
|
-
</View>
|
|
622
|
-
<View style={{ marginTop: 10, paddingHorizontal: 24 }}>
|
|
380
|
+
<View style={{ marginTop: 16, paddingHorizontal: 24 }}>
|
|
623
381
|
<MText style={[$title2, { textAlign: 'left' }]}>
|
|
624
|
-
|
|
382
|
+
Lưu ý chụp CCCD/ CMND
|
|
625
383
|
</MText>
|
|
626
384
|
<View style={$row}>
|
|
627
385
|
<TimaSmall />
|
|
@@ -653,82 +411,131 @@ export const OCR = observer(function OCR(props: any) {
|
|
|
653
411
|
/>
|
|
654
412
|
</View>
|
|
655
413
|
|
|
656
|
-
<
|
|
414
|
+
<TouchableOpacity
|
|
415
|
+
onPress={() => {
|
|
416
|
+
setShowModal(false);
|
|
417
|
+
save(OCR_V1, true);
|
|
418
|
+
}}
|
|
657
419
|
style={{
|
|
658
|
-
flexDirection: 'row',
|
|
659
|
-
alignItems: 'center',
|
|
660
420
|
margin: 16,
|
|
421
|
+
height: 40,
|
|
422
|
+
alignItems: 'center',
|
|
423
|
+
justifyContent: 'center',
|
|
424
|
+
borderRadius: 40,
|
|
425
|
+
borderWidth: 1,
|
|
426
|
+
borderColor: '#EF592E',
|
|
661
427
|
}}
|
|
662
428
|
>
|
|
663
|
-
<
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
}}
|
|
669
|
-
style={{
|
|
670
|
-
flex: 1,
|
|
671
|
-
borderWidth: 1,
|
|
672
|
-
borderColor: '#EF592E',
|
|
673
|
-
height: 40,
|
|
674
|
-
alignItems: 'center',
|
|
675
|
-
justifyContent: 'center',
|
|
676
|
-
borderRadius: 40,
|
|
677
|
-
// marginRight: 16,
|
|
678
|
-
}}
|
|
679
|
-
>
|
|
680
|
-
<MText
|
|
681
|
-
style={{
|
|
682
|
-
color: '#EF592E',
|
|
683
|
-
fontSize: 16,
|
|
684
|
-
}}
|
|
685
|
-
>
|
|
686
|
-
Chụp 2 mặt
|
|
687
|
-
</MText>
|
|
688
|
-
</TouchableOpacity>
|
|
689
|
-
{/* <MButton
|
|
690
|
-
style={{
|
|
691
|
-
flex: 1,
|
|
692
|
-
}}
|
|
693
|
-
onPress={() => {
|
|
694
|
-
setType('nfc');
|
|
695
|
-
setShowModal(false);
|
|
696
|
-
save(OCR_V1, true);
|
|
697
|
-
}}
|
|
698
|
-
>
|
|
699
|
-
<LinearGradient
|
|
700
|
-
start={{ x: 1, y: 0 }}
|
|
701
|
-
end={{ x: 0, y: 1 }}
|
|
702
|
-
style={{
|
|
703
|
-
height: 40,
|
|
704
|
-
marginVertical: 16,
|
|
705
|
-
borderRadius: 30,
|
|
706
|
-
alignItems: 'center',
|
|
707
|
-
justifyContent: 'center',
|
|
708
|
-
}}
|
|
709
|
-
colors={['#FF7A00', '#EF4123']}
|
|
710
|
-
>
|
|
711
|
-
<MText
|
|
712
|
-
style={{
|
|
713
|
-
fontSize: 16,
|
|
714
|
-
color: 'white',
|
|
715
|
-
}}
|
|
716
|
-
>
|
|
717
|
-
NFC
|
|
718
|
-
</MText>
|
|
719
|
-
</LinearGradient>
|
|
720
|
-
</MButton> */}
|
|
721
|
-
</View>
|
|
722
|
-
<View style={{ height: 24 }}></View>
|
|
429
|
+
<MText style={{ color: '#EF592E', fontSize: 16 }}>
|
|
430
|
+
Chụp 2 mặt
|
|
431
|
+
</MText>
|
|
432
|
+
</TouchableOpacity>
|
|
433
|
+
<View style={{ height: 24 }} />
|
|
723
434
|
</View>
|
|
724
435
|
</View>
|
|
725
436
|
</LinearGradient>
|
|
726
437
|
</Modal>
|
|
727
|
-
|
|
728
|
-
<Loading isLoading={isLoading} />
|
|
729
438
|
</View>
|
|
730
439
|
);
|
|
731
440
|
});
|
|
441
|
+
|
|
442
|
+
const styles = StyleSheet.create({
|
|
443
|
+
container: { flex: 1, backgroundColor: '#FFFFFF' },
|
|
444
|
+
header: {
|
|
445
|
+
flexDirection: 'row',
|
|
446
|
+
alignItems: 'center',
|
|
447
|
+
paddingHorizontal: 16,
|
|
448
|
+
paddingTop: 8,
|
|
449
|
+
},
|
|
450
|
+
titleWrap: {
|
|
451
|
+
flex: 1,
|
|
452
|
+
alignItems: 'center',
|
|
453
|
+
justifyContent: 'center',
|
|
454
|
+
marginRight: 24,
|
|
455
|
+
},
|
|
456
|
+
headerTitle: { color: '#333333', fontSize: 16, fontWeight: '600' },
|
|
457
|
+
instruction: {
|
|
458
|
+
textAlign: 'center',
|
|
459
|
+
color: '#333333',
|
|
460
|
+
fontSize: 14,
|
|
461
|
+
lineHeight: 20,
|
|
462
|
+
marginTop: 20,
|
|
463
|
+
marginBottom: 28,
|
|
464
|
+
},
|
|
465
|
+
photoFrame: {
|
|
466
|
+
marginHorizontal: 24,
|
|
467
|
+
aspectRatio: CARD_ASPECT_RATIO,
|
|
468
|
+
borderRadius: 8,
|
|
469
|
+
overflow: 'hidden',
|
|
470
|
+
backgroundColor: '#000000',
|
|
471
|
+
},
|
|
472
|
+
corner: {
|
|
473
|
+
position: 'absolute',
|
|
474
|
+
width: 26,
|
|
475
|
+
height: 26,
|
|
476
|
+
borderColor: ORANGE,
|
|
477
|
+
},
|
|
478
|
+
focusRing: {
|
|
479
|
+
position: 'absolute',
|
|
480
|
+
width: 64,
|
|
481
|
+
height: 64,
|
|
482
|
+
borderRadius: 8,
|
|
483
|
+
borderWidth: 1.5,
|
|
484
|
+
borderColor: '#FFD54A',
|
|
485
|
+
},
|
|
486
|
+
cornerTL: {
|
|
487
|
+
top: 0,
|
|
488
|
+
left: 0,
|
|
489
|
+
borderTopWidth: 4,
|
|
490
|
+
borderLeftWidth: 4,
|
|
491
|
+
borderTopLeftRadius: 8,
|
|
492
|
+
},
|
|
493
|
+
cornerTR: {
|
|
494
|
+
top: 0,
|
|
495
|
+
right: 0,
|
|
496
|
+
borderTopWidth: 4,
|
|
497
|
+
borderRightWidth: 4,
|
|
498
|
+
borderTopRightRadius: 8,
|
|
499
|
+
},
|
|
500
|
+
cornerBL: {
|
|
501
|
+
bottom: 0,
|
|
502
|
+
left: 0,
|
|
503
|
+
borderBottomWidth: 4,
|
|
504
|
+
borderLeftWidth: 4,
|
|
505
|
+
borderBottomLeftRadius: 8,
|
|
506
|
+
},
|
|
507
|
+
cornerBR: {
|
|
508
|
+
bottom: 0,
|
|
509
|
+
right: 0,
|
|
510
|
+
borderBottomWidth: 4,
|
|
511
|
+
borderRightWidth: 4,
|
|
512
|
+
borderBottomRightRadius: 8,
|
|
513
|
+
},
|
|
514
|
+
galleryButton: {
|
|
515
|
+
alignSelf: 'center',
|
|
516
|
+
flexDirection: 'row',
|
|
517
|
+
alignItems: 'center',
|
|
518
|
+
gap: 8,
|
|
519
|
+
marginTop: 20,
|
|
520
|
+
paddingHorizontal: 14,
|
|
521
|
+
paddingVertical: 8,
|
|
522
|
+
borderRadius: 8,
|
|
523
|
+
borderWidth: 1,
|
|
524
|
+
borderColor: ORANGE,
|
|
525
|
+
backgroundColor: '#FFFFFF',
|
|
526
|
+
},
|
|
527
|
+
galleryText: { color: '#333333', fontSize: 13 },
|
|
528
|
+
hint: {
|
|
529
|
+
textAlign: 'center',
|
|
530
|
+
color: '#555555',
|
|
531
|
+
fontSize: 13,
|
|
532
|
+
lineHeight: 19,
|
|
533
|
+
marginTop: 48,
|
|
534
|
+
},
|
|
535
|
+
spacer: { flex: 1 },
|
|
536
|
+
captureButton: { alignSelf: 'center' },
|
|
537
|
+
});
|
|
538
|
+
|
|
732
539
|
const $row: ViewStyle = {
|
|
733
540
|
flexDirection: 'row',
|
|
734
541
|
alignItems: 'center',
|
|
@@ -776,10 +583,6 @@ const $description: TextStyle = {
|
|
|
776
583
|
textAlign: 'center',
|
|
777
584
|
};
|
|
778
585
|
|
|
779
|
-
const $flex: ViewStyle = {
|
|
780
|
-
flex: 1,
|
|
781
|
-
};
|
|
782
|
-
|
|
783
586
|
const $modal: ViewStyle = {
|
|
784
587
|
justifyContent: 'flex-end',
|
|
785
588
|
margin: 0,
|
|
@@ -789,94 +592,3 @@ const $container: ViewStyle = {
|
|
|
789
592
|
borderTopRightRadius: 26,
|
|
790
593
|
borderTopLeftRadius: 26,
|
|
791
594
|
};
|
|
792
|
-
|
|
793
|
-
const styles = StyleSheet.create({
|
|
794
|
-
container: {
|
|
795
|
-
flex: 1,
|
|
796
|
-
},
|
|
797
|
-
camera: {
|
|
798
|
-
flex: 1,
|
|
799
|
-
},
|
|
800
|
-
passportCameraFrame: {
|
|
801
|
-
width: Dimensions.get('window').width,
|
|
802
|
-
height: 260,
|
|
803
|
-
overflow: 'hidden',
|
|
804
|
-
backgroundColor: 'black',
|
|
805
|
-
},
|
|
806
|
-
buttonContainer: {
|
|
807
|
-
flex: 0,
|
|
808
|
-
flexDirection: 'column',
|
|
809
|
-
justifyContent: 'center',
|
|
810
|
-
alignItems: 'center',
|
|
811
|
-
position: 'absolute',
|
|
812
|
-
left: 0,
|
|
813
|
-
right: 0,
|
|
814
|
-
zIndex: 1000,
|
|
815
|
-
},
|
|
816
|
-
captureButton: {
|
|
817
|
-
width: 56,
|
|
818
|
-
height: 56,
|
|
819
|
-
borderRadius: 35,
|
|
820
|
-
backgroundColor: 'white',
|
|
821
|
-
justifyContent: 'center',
|
|
822
|
-
alignItems: 'center',
|
|
823
|
-
},
|
|
824
|
-
innerCaptureButton: {
|
|
825
|
-
width: 60,
|
|
826
|
-
height: 60,
|
|
827
|
-
borderRadius: 30,
|
|
828
|
-
backgroundColor: 'red',
|
|
829
|
-
},
|
|
830
|
-
overlay: {
|
|
831
|
-
position: 'absolute',
|
|
832
|
-
top: 0,
|
|
833
|
-
left: 0,
|
|
834
|
-
right: 0,
|
|
835
|
-
bottom: 0,
|
|
836
|
-
justifyContent: 'center',
|
|
837
|
-
alignItems: 'center',
|
|
838
|
-
},
|
|
839
|
-
overlayTop: {
|
|
840
|
-
flex: 1,
|
|
841
|
-
backgroundColor: 'black',
|
|
842
|
-
width: '100%',
|
|
843
|
-
},
|
|
844
|
-
overlayCenter: {
|
|
845
|
-
flexDirection: 'row',
|
|
846
|
-
},
|
|
847
|
-
overlayLeft: {
|
|
848
|
-
flex: 1,
|
|
849
|
-
backgroundColor: 'black',
|
|
850
|
-
},
|
|
851
|
-
overlayRect: {
|
|
852
|
-
width: '90%',
|
|
853
|
-
height: 100,
|
|
854
|
-
borderColor: 'white',
|
|
855
|
-
borderWidth: 2,
|
|
856
|
-
justifyContent: 'center',
|
|
857
|
-
alignItems: 'center',
|
|
858
|
-
},
|
|
859
|
-
instructionText: {
|
|
860
|
-
color: 'white',
|
|
861
|
-
textAlign: 'center',
|
|
862
|
-
paddingHorizontal: 10,
|
|
863
|
-
fontSize: 14,
|
|
864
|
-
position: 'absolute',
|
|
865
|
-
top: -50,
|
|
866
|
-
},
|
|
867
|
-
overlayRight: {
|
|
868
|
-
flex: 1,
|
|
869
|
-
backgroundColor: 'black',
|
|
870
|
-
},
|
|
871
|
-
overlayBottom: {
|
|
872
|
-
flex: 1,
|
|
873
|
-
backgroundColor: 'black',
|
|
874
|
-
width: '100%',
|
|
875
|
-
},
|
|
876
|
-
mrzContainer: {
|
|
877
|
-
padding: 10,
|
|
878
|
-
},
|
|
879
|
-
mrzText: {
|
|
880
|
-
fontSize: 16,
|
|
881
|
-
},
|
|
882
|
-
});
|