Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
ShenghuoquanBusiness
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bp
ShenghuoquanBusiness
Commits
f0e967b0
Commit
f0e967b0
authored
Jun 04, 2021
by
yinjiacheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add 企业认证相关接口 个人认证身份信息校验错误提示
parent
a474415c
Changes
19
Hide whitespace changes
Inline
Side-by-side
Showing
19 changed files
with
407 additions
and
13 deletions
+407
-13
URLs.kt
...onLib/Common/src/main/java/com/yidian/common/http/URLs.kt
+6
-0
Constant.kt
.../com/yidian/shenghuoquan/newscontent/constant/Constant.kt
+2
-2
ApiService.kt
...va/com/yidian/shenghuoquan/newscontent/http/ApiService.kt
+103
-4
CommonService.kt
...com/yidian/shenghuoquan/newscontent/http/CommonService.kt
+22
-0
IAuthBusinessLicenseCommitCallback.kt
...ntent/http/callback/IAuthBusinessLicenseCommitCallback.kt
+13
-0
IAuthEnterpriseCompleteCallback.kt
...scontent/http/callback/IAuthEnterpriseCompleteCallback.kt
+13
-0
IAuthEnterpriseLegalIdentityCommitCallback.kt
...tp/callback/IAuthEnterpriseLegalIdentityCommitCallback.kt
+11
-0
IAuthEnterpriseLiveIdentityCallback.kt
...tent/http/callback/IAuthEnterpriseLiveIdentityCallback.kt
+11
-0
IAuthIndividualBusinessIdentityCommitCallback.kt
...callback/IAuthIndividualBusinessIdentityCommitCallback.kt
+11
-0
IAuthMerchantCheckCallback.kt
...n/newscontent/http/callback/IAuthMerchantCheckCallback.kt
+13
-0
AuthBusinessLicenseCommitBean.kt
...ewscontent/http/httpbean/AuthBusinessLicenseCommitBean.kt
+37
-0
AuthEnterpriseCompleteBean.kt
...n/newscontent/http/httpbean/AuthEnterpriseCompleteBean.kt
+22
-0
AuthEnterpriseLegalIdentityCommitBean.kt
...nt/http/httpbean/AuthEnterpriseLegalIdentityCommitBean.kt
+30
-0
AuthEnterpriseLiveIdentityBean.kt
...wscontent/http/httpbean/AuthEnterpriseLiveIdentityBean.kt
+11
-0
AuthIndividualBusinessIdentityCommitBean.kt
...http/httpbean/AuthIndividualBusinessIdentityCommitBean.kt
+29
-0
AuthMerchantCheckBean.kt
...uoquan/newscontent/http/httpbean/AuthMerchantCheckBean.kt
+18
-0
LifeAccountIDCardAuthFragment.kt
...quan/newscontent/ui/auth/LifeAccountIDCardAuthFragment.kt
+16
-3
LifeAccountAuthIdentityInfoEditView.kt
...newscontent/widget/LifeAccountAuthIdentityInfoEditView.kt
+37
-2
strings.xml
Components/newscontent/src/main/res/values/strings.xml
+2
-2
No files found.
CommonLib/Common/src/main/java/com/yidian/common/http/URLs.kt
View file @
f0e967b0
...
...
@@ -37,5 +37,11 @@ class URLs {
const
val
authLiveIdentity
=
"/merchant/auth/live_identity"
const
val
authComplete
=
"/merchant/auth/complete"
const
val
authAuthentication
=
"/merchant/auth/authentication"
const
val
authMerchantCheck
=
"/merchant/enterprise/ent_check"
const
val
authBusinessLicenseCommit
=
"/merchant/enterprise/ent_commit"
const
val
authEnterpriseLegalIdentityCommit
=
"/merchant/enterprise/legal_commit"
const
val
authIndividualBusinessIdentityCommit
=
"/merchant/enterprise/ent_personal"
const
val
authEnterpriseLiveIdentity
=
"/merchant/enterprise/live_identity"
const
val
authEnterpriseComplete
=
"/merchant/enterprise/complete"
}
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/constant/Constant.kt
View file @
f0e967b0
...
...
@@ -42,6 +42,6 @@ object Constant {
const
val
TYPE_RAW_IMAGE
=
"raw_image"
// 不进行活体验证,仅使用上传的图片进行后续的比对
// 服务端error message
const
val
error_message_id_card_number
=
"身份证号码有误"
const
val
error_message_real_name
=
"姓名缺失"
const
val
ERROR_MESSAGE_ID_CARD_NUMBER
=
"身份证号码有误"
const
val
ERROR_MESSAGE_REAL_NAME
=
"姓名缺失"
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/ApiService.kt
View file @
f0e967b0
...
...
@@ -7,10 +7,7 @@ import com.yidian.common.http.TransformUtil
import
com.yidian.http.ServiceFactory
import
com.yidian.shenghuoquan.newscontent.bean.CreateLifeAccountBean
import
com.yidian.shenghuoquan.newscontent.bean.ICreateLifeAccountCallback
import
com.yidian.shenghuoquan.newscontent.http.callback.IAuthAuthenticationCallback
import
com.yidian.shenghuoquan.newscontent.http.callback.IAuthCompleteCallback
import
com.yidian.shenghuoquan.newscontent.http.callback.IAuthLiveIdentityCallback
import
com.yidian.shenghuoquan.newscontent.http.callback.IAuthPersonalCheckCallback
import
com.yidian.shenghuoquan.newscontent.http.callback.*
import
com.yidian.shenghuoquan.newscontent.http.httpbean.*
import
okhttp3.MultipartBody
...
...
@@ -297,5 +294,107 @@ class ApiService {
}
})
}
// 401 商户认证检查
fun
authMerchantCheck
(
apiCallback
:
IAuthMerchantCheckCallback
,
requestParams
:
Map
<
String
,
String
>)
{
val
paramsMap
=
HttpParamsUtils
.
getParamsMap
()
ServiceFactory
.
getInstance
().
createService
(
CommonService
::
class
.
java
)
.
authMerchantCheck
(
paramsMap
,
requestParams
)
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
subscribe
(
object
:
HttpResultSubscriber
<
AuthMerchantCheckBean
.
Response
>()
{
override
fun
onSuccess
(
result
:
HttpResult
<
AuthMerchantCheckBean
.
Response
>?)
{
apiCallback
.
authMerchantCheckSuccess
(
result
?.
result
)
}
override
fun
onFailer
(
result
:
HttpResult
<
AuthMerchantCheckBean
.
Response
>?)
{
apiCallback
.
authMerchantCheckFailure
(
result
?.
reason
)
}
})
}
// 402 商户上传营业执照信息
fun
authBusinessLicenseCommit
(
apiCallback
:
IAuthBusinessLicenseCommitCallback
,
requestParams
:
AuthBusinessLicenseCommitBean
.
Request
)
{
val
paramsMap
=
HttpParamsUtils
.
getParamsMap
()
ServiceFactory
.
getInstance
().
createService
(
CommonService
::
class
.
java
)
.
authBusinessLicenseCommit
(
paramsMap
,
requestParams
)
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
subscribe
(
object
:
HttpResultSubscriber
<
AuthBusinessLicenseCommitBean
.
Response
>()
{
override
fun
onSuccess
(
result
:
HttpResult
<
AuthBusinessLicenseCommitBean
.
Response
>?)
{
apiCallback
.
authBusinessLicenseCommitSuccess
(
result
?.
result
)
}
override
fun
onFailer
(
result
:
HttpResult
<
AuthBusinessLicenseCommitBean
.
Response
>?)
{
apiCallback
.
authBusinessLicenseCommitFailure
(
result
?.
reason
)
}
})
}
// 403 普通企业上传法人身份信息
fun
authEnterpriseLegalIdentityCommit
(
apiCallback
:
IAuthEnterpriseLegalIdentityCommitCallback
,
requestParams
:
AuthEnterpriseLegalIdentityCommitBean
.
Request
)
{
val
paramsMap
=
HttpParamsUtils
.
getParamsMap
()
ServiceFactory
.
getInstance
().
createService
(
CommonService
::
class
.
java
)
.
authEnterpriseLegalIdentityCommit
(
paramsMap
,
requestParams
)
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
subscribe
(
object
:
HttpResultSubscriber
<
Any
>()
{
override
fun
onSuccess
(
result
:
HttpResult
<
Any
>?)
{
apiCallback
.
authEnterpriseLegalIdentityCommitSuccess
()
}
override
fun
onFailer
(
result
:
HttpResult
<
Any
>?)
{
apiCallback
.
authEnterpriseLegalIdentityCommitFailure
(
result
?.
reason
)
}
})
}
// 404 个体工商户身份认证
fun
authIndividualBusinessIdentityCommit
(
apiCallback
:
IAuthIndividualBusinessIdentityCommitCallback
,
requestParams
:
AuthIndividualBusinessIdentityCommitBean
.
Request
)
{
val
paramsMap
=
HttpParamsUtils
.
getParamsMap
()
ServiceFactory
.
getInstance
().
createService
(
CommonService
::
class
.
java
)
.
authIndividualBusinessIdentityCommit
(
paramsMap
,
requestParams
)
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
subscribe
(
object
:
HttpResultSubscriber
<
Any
>()
{
override
fun
onSuccess
(
result
:
HttpResult
<
Any
>?)
{
apiCallback
.
authIndividualBusinessIdentityCommitSuccess
()
}
override
fun
onFailer
(
result
:
HttpResult
<
Any
>?)
{
apiCallback
.
authIndividualBusinessIdentityCommitFailure
(
result
?.
reason
)
}
})
}
// 405 活体识别成功后回调接口
fun
authEnterpriseLiveIdentity
(
apiCallback
:
IAuthEnterpriseLiveIdentityCallback
,
requestParams
:
Map
<
String
,
String
>)
{
val
paramsMap
=
HttpParamsUtils
.
getParamsMap
()
ServiceFactory
.
getInstance
().
createService
(
CommonService
::
class
.
java
)
.
authEnterpriseLiveIdentity
(
paramsMap
,
requestParams
)
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
subscribe
(
object
:
HttpResultSubscriber
<
Any
>()
{
override
fun
onSuccess
(
result
:
HttpResult
<
Any
>?)
{
apiCallback
.
authEnterpriseLiveIdentitySuccess
()
}
override
fun
onFailer
(
result
:
HttpResult
<
Any
>?)
{
apiCallback
.
authEnterpriseLiveIdentityFailure
(
result
?.
reason
)
}
})
}
// 410 企业认证完成认证
fun
authEnterpriseComplete
(
apiCallback
:
IAuthEnterpriseCompleteCallback
,
requestParams
:
Map
<
String
,
String
>)
{
val
paramsMap
=
HttpParamsUtils
.
getParamsMap
()
ServiceFactory
.
getInstance
().
createService
(
CommonService
::
class
.
java
)
.
authEnterpriseComplete
(
paramsMap
,
requestParams
)
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
subscribe
(
object
:
HttpResultSubscriber
<
AuthEnterpriseCompleteBean
.
Response
>()
{
override
fun
onSuccess
(
result
:
HttpResult
<
AuthEnterpriseCompleteBean
.
Response
>?)
{
apiCallback
.
authEnterpriseCompleteSuccess
(
result
?.
result
)
}
override
fun
onFailer
(
result
:
HttpResult
<
AuthEnterpriseCompleteBean
.
Response
>?)
{
apiCallback
.
authEnterpriseCompleteFailure
(
result
?.
reason
)
}
})
}
}
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/CommonService.kt
View file @
f0e967b0
...
...
@@ -72,4 +72,26 @@ interface CommonService {
@GET
(
URLs
.
authAuthentication
)
fun
authAuthentication
(
@QueryMap
commonParams
:
Map
<
String
,
String
>):
Observable
<
HttpResult
<
AuthAuthenticationBean
.
Response
>>
@GET
(
URLs
.
authMerchantCheck
)
fun
authMerchantCheck
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@QueryMap
requestParams
:
Map
<
String
,
String
>)
:
Observable
<
HttpResult
<
AuthMerchantCheckBean
.
Response
>>
@Headers
(
"Content-Type: application/json"
)
@POST
(
URLs
.
authBusinessLicenseCommit
)
fun
authBusinessLicenseCommit
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
requestParams
:
AuthBusinessLicenseCommitBean
.
Request
)
:
Observable
<
HttpResult
<
AuthBusinessLicenseCommitBean
.
Response
>>
@Headers
(
"Content-Type: application/json"
)
@POST
(
URLs
.
authEnterpriseLegalIdentityCommit
)
fun
authEnterpriseLegalIdentityCommit
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
requestParams
:
AuthEnterpriseLegalIdentityCommitBean
.
Request
)
:
Observable
<
HttpResult
<
Any
>>
@Headers
(
"Content-Type: application/json"
)
@POST
(
URLs
.
authIndividualBusinessIdentityCommit
)
fun
authIndividualBusinessIdentityCommit
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@Body
requestParams
:
AuthIndividualBusinessIdentityCommitBean
.
Request
)
:
Observable
<
HttpResult
<
Any
>>
@GET
(
URLs
.
authEnterpriseLiveIdentity
)
fun
authEnterpriseLiveIdentity
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@QueryMap
requestParams
:
Map
<
String
,
String
>)
:
Observable
<
HttpResult
<
Any
>>
@GET
(
URLs
.
authEnterpriseComplete
)
fun
authEnterpriseComplete
(
@QueryMap
commonParams
:
Map
<
String
,
String
>,
@QueryMap
requestParams
:
Map
<
String
,
String
>)
:
Observable
<
HttpResult
<
AuthEnterpriseCompleteBean
.
Response
>>
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/callback/IAuthBusinessLicenseCommitCallback.kt
0 → 100644
View file @
f0e967b0
package
com.yidian.shenghuoquan.newscontent.http.callback
import
com.yidian.shenghuoquan.newscontent.http.httpbean.AuthBusinessLicenseCommitBean
/**
* author: yinjiacheng
* date: 6/3/21 7:25 PM
* description: API /merchant/enterprise/ent_commit
*/
interface
IAuthBusinessLicenseCommitCallback
{
fun
authBusinessLicenseCommitSuccess
(
result
:
AuthBusinessLicenseCommitBean
.
Response
?)
fun
authBusinessLicenseCommitFailure
(
message
:
String
?)
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/callback/IAuthEnterpriseCompleteCallback.kt
0 → 100644
View file @
f0e967b0
package
com.yidian.shenghuoquan.newscontent.http.callback
import
com.yidian.shenghuoquan.newscontent.http.httpbean.AuthEnterpriseCompleteBean
/**
* author: yinjiacheng
* date: 6/3/21 9:12 PM
* description: API /merchant/enterprise/complete
*/
interface
IAuthEnterpriseCompleteCallback
{
fun
authEnterpriseCompleteSuccess
(
result
:
AuthEnterpriseCompleteBean
.
Response
?)
fun
authEnterpriseCompleteFailure
(
message
:
String
?)
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/callback/IAuthEnterpriseLegalIdentityCommitCallback.kt
0 → 100644
View file @
f0e967b0
package
com.yidian.shenghuoquan.newscontent.http.callback
/**
* author: yinjiacheng
* date: 6/3/21 8:38 PM
* description: API /merchant/enterprise/ent_commit
*/
interface
IAuthEnterpriseLegalIdentityCommitCallback
{
fun
authEnterpriseLegalIdentityCommitSuccess
()
fun
authEnterpriseLegalIdentityCommitFailure
(
message
:
String
?)
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/callback/IAuthEnterpriseLiveIdentityCallback.kt
0 → 100644
View file @
f0e967b0
package
com.yidian.shenghuoquan.newscontent.http.callback
/**
* author: yinjiacheng
* date: 6/3/21 9:06 PM
* description: API /merchant/enterprise/live_identity
*/
interface
IAuthEnterpriseLiveIdentityCallback
{
fun
authEnterpriseLiveIdentitySuccess
()
fun
authEnterpriseLiveIdentityFailure
(
message
:
String
?)
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/callback/IAuthIndividualBusinessIdentityCommitCallback.kt
0 → 100644
View file @
f0e967b0
package
com.yidian.shenghuoquan.newscontent.http.callback
/**
* author: yinjiacheng
* date: 6/3/21 8:55 PM
* description: API /merchant/enterprise/ent_personal
*/
interface
IAuthIndividualBusinessIdentityCommitCallback
{
fun
authIndividualBusinessIdentityCommitSuccess
()
fun
authIndividualBusinessIdentityCommitFailure
(
message
:
String
?)
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/callback/IAuthMerchantCheckCallback.kt
0 → 100644
View file @
f0e967b0
package
com.yidian.shenghuoquan.newscontent.http.callback
import
com.yidian.shenghuoquan.newscontent.http.httpbean.AuthMerchantCheckBean
/**
* author: yinjiacheng
* date: 6/3/21 6:21 PM
* description: API /merchant/enterprise/ent_check
*/
interface
IAuthMerchantCheckCallback
{
fun
authMerchantCheckSuccess
(
result
:
AuthMerchantCheckBean
.
Response
?)
fun
authMerchantCheckFailure
(
message
:
String
?)
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/httpbean/AuthBusinessLicenseCommitBean.kt
0 → 100644
View file @
f0e967b0
package
com.yidian.shenghuoquan.newscontent.http.httpbean
/**
* author: yinjiacheng
* date: 6/3/21 6:23 PM
* description: API /merchant/enterprise/ent_commit
*/
class
AuthBusinessLicenseCommitBean
{
data class
Request
(
val
user_id
:
Long
,
val
code
:
String
,
val
name
:
String
,
val
type
:
String
?,
val
addr
:
String
?,
val
pers
:
String
?,
val
scope
:
String
?,
val
time
:
String
?,
val
regi
:
String
?,
val
organizer
:
String
?,
val
date
:
String
?,
val
comp
:
String
?,
val
num
:
String
?,
val
form
:
String
?,
val
funding
:
String
?,
val
issue_date
:
String
?,
val
entterprise_image
:
String
,
val
data_from
:
Int
,
val
data_type
:
Int
,
val
life_account_id
:
Long
?,
val
proxy_user_name
:
String
?,
val
mobile
:
String
?,
val
is_agent
:
Int
?
)
data class
Response
(
val
data
:
Int
)
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/httpbean/AuthEnterpriseCompleteBean.kt
0 → 100644
View file @
f0e967b0
package
com.yidian.shenghuoquan.newscontent.http.httpbean
/**
* author: yinjiacheng
* date: 6/3/21 9:08 PM
* description: API /merchant/enterprise/complete
*/
class
AuthEnterpriseCompleteBean
{
data class
Request
(
val
code
:
String
)
data class
Response
(
val
enterprise_auth_record_id
:
Long
,
val
code
:
String
,
val
name
:
String
,
val
legal_person
:
String
,
val
legal_id_card
:
String
,
val
data_type
:
Int
,
val
audit_status
:
Int
)
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/httpbean/AuthEnterpriseLegalIdentityCommitBean.kt
0 → 100644
View file @
f0e967b0
package
com.yidian.shenghuoquan.newscontent.http.httpbean
/**
* author: yinjiacheng
* date: 6/3/21 7:37 PM
* description: API /merchant/enterprise/ent_commit
*/
class
AuthEnterpriseLegalIdentityCommitBean
()
{
data class
Request
(
val
record_id
:
Long
,
val
front_img
:
String
,
val
bak_img
:
String
,
val
front_completeness
:
Int
,
val
bak_completeness
:
Int
,
val
idcard_number
:
String
,
val
gender
:
String
?,
val
name
:
String
,
val
address
:
String
?,
val
nationality
:
String
?,
val
valid_date_start
:
String
?,
val
valid_date_end
:
String
?,
val
issued_by
:
String
?,
val
life_account_id
:
Long
?,
val
proxy_user_name
:
String
?,
val
mobile
:
String
,
val
is_agent
:
String
?
)
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/httpbean/AuthEnterpriseLiveIdentityBean.kt
0 → 100644
View file @
f0e967b0
package
com.yidian.shenghuoquan.newscontent.http.httpbean
/**
* author: yinjiacheng
* date: 6/3/21 9:05 PM
* description: API /merchant/enterprise/live_identity
*/
class
AuthEnterpriseLiveIdentityBean
{
data class
Request
(
val
code
:
String
,
val
idcard_number
:
String
)
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/httpbean/AuthIndividualBusinessIdentityCommitBean.kt
0 → 100644
View file @
f0e967b0
package
com.yidian.shenghuoquan.newscontent.http.httpbean
/**
* author: yinjiacheng
* date: 6/3/21 8:41 PM
* description: API /merchant/enterprise/ent_personal
*/
class
AuthIndividualBusinessIdentityCommitBean
{
data class
Request
(
val
code
:
String
,
val
data_type
:
Int
,
val
front_img
:
String
,
val
bak_img
:
String
,
val
front_completeness
:
Int
,
val
bak_completeness
:
Int
,
val
idcard_number
:
String
,
val
gender
:
String
?,
val
name
:
String
,
val
address
:
String
?,
val
nationality
:
String
?,
val
valid_date_start
:
String
?,
val
valid_date_end
:
String
?,
val
issued_by
:
String
?,
val
proxy_user_name
:
String
?,
val
phone
:
String
?,
val
is_agent
:
Int
?
)
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/httpbean/AuthMerchantCheckBean.kt
0 → 100644
View file @
f0e967b0
package
com.yidian.shenghuoquan.newscontent.http.httpbean
/**
* author: yinjiacheng
* date: 6/3/21 6:05 PM
* description: API /merchant/enterprise/ent_check
*/
class
AuthMerchantCheckBean
{
data class
Request
(
val
user_id
:
Long
,
val
life_account_id
:
Long
?,
val
mobile
:
String
?,
val
is_agent
:
Int
?
)
data class
Response
(
val
enterprise_auth_record_id
:
Int
)
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/auth/LifeAccountIDCardAuthFragment.kt
View file @
f0e967b0
...
...
@@ -575,6 +575,19 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
Constant
.
LIFE_ACCOUNT_AUTH_TAG
,
"request auth personal check failure: message: $message"
)
// 展示错误提示
when
(
message
)
{
Constant
.
ERROR_MESSAGE_REAL_NAME
->
{
viewBinding
.
evRealName
.
showErrorTips
(
resources
.
getText
(
R
.
string
.
id_card_name_error_tips
)
as
String
)
viewBinding
.
evRealName
.
highLightEditContent
()
}
Constant
.
ERROR_MESSAGE_ID_CARD_NUMBER
->
{
viewBinding
.
evIdCardNumber
.
showErrorTips
(
resources
.
getText
(
R
.
string
.
id_card_number_error_tips
)
as
String
)
viewBinding
.
evIdCardNumber
.
highLightEditContent
()
}
}
}
override
fun
authLiveIdentitySuccess
()
{
...
...
@@ -622,15 +635,15 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
*/
private
fun
changeFaceAuthUI
(
result
:
Boolean
)
{
if
(
result
)
{
viewBinding
.
tvFaceAuthResult
.
text
=
activity
?
.
getText
(
R
.
string
.
face_auth_success
)
viewBinding
.
tvFaceAuthResult
.
text
=
resources
.
getText
(
R
.
string
.
face_auth_success
)
viewBinding
.
tvFaceAuthResult
.
setTextColor
(
Color
.
parseColor
(
"#FF6BB81F"
))
viewBinding
.
ivFaceAuthStart
.
visibility
=
View
.
GONE
viewBinding
.
tvFaceAuthErrorTips
.
visibility
=
View
.
GONE
}
else
{
viewBinding
.
tvFaceAuthResult
.
text
=
activity
?
.
getText
(
R
.
string
.
face_auth_fail
)
viewBinding
.
tvFaceAuthResult
.
text
=
resources
.
getText
(
R
.
string
.
face_auth_fail
)
viewBinding
.
tvFaceAuthResult
.
setTextColor
(
Color
.
parseColor
(
"#FFFF3A3A"
))
viewBinding
.
tvFaceAuthErrorTips
.
visibility
=
View
.
VISIBLE
viewBinding
.
tvFaceAuthErrorTips
.
text
=
activity
?
.
getText
(
R
.
string
.
face_auth_error_tips
)
viewBinding
.
tvFaceAuthErrorTips
.
text
=
resources
.
getText
(
R
.
string
.
face_auth_error_tips
)
}
}
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/widget/LifeAccountAuthIdentityInfoEditView.kt
View file @
f0e967b0
package
com.yidian.shenghuoquan.newscontent.widget
import
android.content.Context
import
android.graphics.Color
import
android.text.Editable
import
android.text.TextUtils
import
android.text.TextWatcher
...
...
@@ -33,6 +34,11 @@ class LifeAccountAuthIdentityInfoEditView @JvmOverloads constructor(
private
var
callback
:
OnLifeAccountAuthIdentityInfoEditViewCallback
?
=
null
/**
* 是否输入错误标识位
*/
private
var
isInputError
=
false
init
{
val
typedArray
=
context
.
obtainStyledAttributes
(
attrs
,
R
.
styleable
.
LifeAccountAuthIdentityInfoEditView
)
...
...
@@ -53,13 +59,22 @@ class LifeAccountAuthIdentityInfoEditView @JvmOverloads constructor(
viewBinding
.
tvErrorTips
.
text
=
tips
}
/**
* 隐藏错误提示
*/
fun
dismissErrorTips
()
{
viewBinding
.
tvErrorTips
.
visibility
=
View
.
GONE
viewBinding
.
tvErrorTips
.
text
=
""
}
/**
* 清除输入的文字
*/
fun
clearEditContent
()
{
viewBinding
.
etContent
.
setText
(
""
)
if
(
viewBinding
.
tvErrorTips
.
visibility
==
View
.
VISIBLE
)
{
viewBinding
.
tvErrorTips
.
visibility
=
View
.
GONE
if
(
isInputError
)
{
dismissErrorTips
()
cancelHighLightEditContent
()
}
callback
?.
onTextClear
(
this
)
}
...
...
@@ -82,6 +97,22 @@ class LifeAccountAuthIdentityInfoEditView @JvmOverloads constructor(
isEnabled
=
false
}
/**
* 高亮显示输入文本
*/
fun
highLightEditContent
()
{
isInputError
=
true
viewBinding
.
etContent
.
setTextColor
(
Color
.
parseColor
(
"#FFFF3A3A"
))
}
/**
* 取消高亮显示输入文本
*/
fun
cancelHighLightEditContent
()
{
isInputError
=
false
viewBinding
.
etContent
.
setTextColor
(
Color
.
parseColor
(
"#FF333333"
))
}
override
fun
onClick
(
v
:
View
?)
{
if
(
v
?.
id
==
R
.
id
.
iv_clear
)
{
// 清除输入框中的内容
...
...
@@ -101,6 +132,10 @@ class LifeAccountAuthIdentityInfoEditView @JvmOverloads constructor(
// 处理一键清除按钮
viewBinding
.
ivClear
.
visibility
=
if
(
TextUtils
.
isEmpty
(
s
))
View
.
GONE
else
View
.
VISIBLE
callback
?.
onTextChange
(
this
,
s
.
toString
())
if
(
isInputError
)
{
dismissErrorTips
()
cancelHighLightEditContent
()
}
}
fun
setOnLifeAccountAuthIdentityInfoEditViewCallback
(
callback
:
OnLifeAccountAuthIdentityInfoEditViewCallback
)
{
...
...
Components/newscontent/src/main/res/values/strings.xml
View file @
f0e967b0
...
...
@@ -92,10 +92,10 @@
<string
name=
"upload_national_emblem_face"
>
点击上传国徽面
</string>
<string
name=
"real_name"
>
真实姓名
</string>
<string
name=
"input_real_name"
>
请输入真实姓名
</string>
<string
name=
"
check_id_card_name
"
>
请核对证件姓名
</string>
<string
name=
"
id_card_name_error_tips
"
>
请核对证件姓名
</string>
<string
name=
"id_card_number"
>
证件号码
</string>
<string
name=
"input_id_card_number"
>
请输入18位身份证号码
</string>
<string
name=
"
check_id_card_number
"
>
请核对证件号码
</string>
<string
name=
"
id_card_number_error_tips
"
>
请核对证件号码
</string>
<string
name=
"face_auth"
>
人脸验证
</string>
<string
name=
"start_face_auth"
>
去验证
</string>
<string
name=
"face_auth_success"
>
验证通过
</string>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment