Commit 9f9c4b02 authored by yinjiacheng's avatar yinjiacheng

update 身份证OCR流程

parent 1e0d35ec
......@@ -387,7 +387,7 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
it
}
}
startIDCardOCR()
startIDCardOCR(face)
}
override fun onTaskFailure(statesCode: Int, message: String?) {
......@@ -403,17 +403,34 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
/**
* 执行身份证OCR
*/
private fun startIDCardOCR() {
val requestParams = HashMap<String, String?>()
requestParams["posit_image_objectid"] =
private fun startIDCardOCR(face: Int) {
if (face == Constant.ID_CARD_PORTRAIT_FACE) {
ApiService.getIDCardOCR(
this, hashMapOf(
Pair(
"posit_image_objectid",
LifeAccountAuthDataManager.personalAuthData.idCardPortraitFaceObjectKey
requestParams["back_image_objectid"] =
LifeAccountAuthDataManager.personalAuthData.idCardNationalEmblemFaceObjectKey
requestParams["posit_bucket"] =
),
Pair(
"posit_bucket",
LifeAccountAuthDataManager.personalAuthData.idCardPortraitFaceBucket
requestParams["back_bucket"] =
),
)
)
} else {
ApiService.getIDCardOCR(
this, hashMapOf(
Pair(
"back_image_objectid",
LifeAccountAuthDataManager.personalAuthData.idCardNationalEmblemFaceObjectKey
),
Pair(
"back_bucket",
LifeAccountAuthDataManager.personalAuthData.idCardNationalEmblemFaceBucket
ApiService.getIDCardOCR(this, requestParams)
),
)
)
}
}
override fun getIDCardOCRSuccess(result: GetIDCardOCRBean.Response?) {
......@@ -638,8 +655,12 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
LifeAccountAuthDataManager.personalAuthData.isIDCardNationalEmblemFaceUpload = false
}
// 检查下一步条件
if (authType == Constant.TYPE_AUTH_PERSONAL) {
(activity as LifeAccountPersonalAuthActivity).checkNextCondition()
} else {
(activity as LifeAccountEnterpriseAuthActivity).checkNextCondition()
}
}
override fun onTextClear(from: LifeAccountAuthIdentityInfoEditView) {
when (from) {
......@@ -654,8 +675,12 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
}
}
// 检查下一步条件
if (authType == Constant.TYPE_AUTH_PERSONAL) {
(activity as LifeAccountPersonalAuthActivity).checkNextCondition()
} else {
(activity as LifeAccountEnterpriseAuthActivity).checkNextCondition()
}
}
override fun onTextChange(from: LifeAccountAuthIdentityInfoEditView, text: String) {
when (from) {
......@@ -670,8 +695,12 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
}
}
// 检查下一步条件
if (authType == Constant.TYPE_AUTH_PERSONAL) {
(activity as LifeAccountPersonalAuthActivity).checkNextCondition()
} else {
(activity as LifeAccountEnterpriseAuthActivity).checkNextCondition()
}
}
override fun onStartFaceAuth() {
// 判断是否满足条件进行活体检测
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment