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
1a402b85
Commit
1a402b85
authored
Jun 10, 2021
by
yinjiacheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 认证流程
parent
963a89ff
Changes
21
Hide whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
394 additions
and
134 deletions
+394
-134
NewsContentApplication.kt
...an/shenghuoquan/newscontent/app/NewsContentApplication.kt
+2
-0
LifeAccountMerchantAuthData.kt
...nghuoquan/newscontent/bean/LifeAccountMerchantAuthData.kt
+1
-0
LifeAccountPersonalAuthData.kt
...nghuoquan/newscontent/bean/LifeAccountPersonalAuthData.kt
+4
-4
Constant.kt
.../com/yidian/shenghuoquan/newscontent/constant/Constant.kt
+4
-0
ApiService.kt
...va/com/yidian/shenghuoquan/newscontent/http/ApiService.kt
+6
-6
IAuthPersonalCompleteCallback.kt
...ewscontent/http/callback/IAuthPersonalCompleteCallback.kt
+13
-0
AuthAuthenticationBean.kt
...oquan/newscontent/http/httpbean/AuthAuthenticationBean.kt
+8
-3
AuthMerchantCheckBean.kt
...uoquan/newscontent/http/httpbean/AuthMerchantCheckBean.kt
+4
-2
AuthPersonalCompleteBean.kt
...uan/newscontent/http/httpbean/AuthPersonalCompleteBean.kt
+11
-0
LifeAccountAuthActivity.kt
...enghuoquan/newscontent/ui/auth/LifeAccountAuthActivity.kt
+9
-14
LifeAccountAuthDataManager.kt
...huoquan/newscontent/ui/auth/LifeAccountAuthDataManager.kt
+13
-2
LifeAccountBusinessLicenseAuthFragment.kt
...content/ui/auth/LifeAccountBusinessLicenseAuthFragment.kt
+54
-12
LifeAccountEnterpriseAuthActivity.kt
.../newscontent/ui/auth/LifeAccountEnterpriseAuthActivity.kt
+83
-24
LifeAccountIDCardAuthFragment.kt
...quan/newscontent/ui/auth/LifeAccountIDCardAuthFragment.kt
+80
-54
LifeAccountPersonalAuthActivity.kt
...an/newscontent/ui/auth/LifeAccountPersonalAuthActivity.kt
+72
-9
LifeAccountPersonalAuthCompleteActivity.kt
...ontent/ui/auth/LifeAccountPersonalAuthCompleteActivity.kt
+15
-2
LifeAccountAuthBusinessInfoEditView.kt
...newscontent/widget/LifeAccountAuthBusinessInfoEditView.kt
+1
-1
LifeAccountAuthIdentityInfoEditView.kt
...newscontent/widget/LifeAccountAuthIdentityInfoEditView.kt
+1
-1
LifeAccountAuthImageView.kt
...enghuoquan/newscontent/widget/LifeAccountAuthImageView.kt
+11
-0
activity_life_account_enterprise_auth.xml
...main/res/layout/activity_life_account_enterprise_auth.xml
+1
-0
activity_life_account_personal_auth.xml
...c/main/res/layout/activity_life_account_personal_auth.xml
+1
-0
No files found.
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/app/NewsContentApplication.kt
View file @
1a402b85
...
@@ -26,6 +26,7 @@ import com.yidian.common.XRouterPathConstants.Companion.PROTOCOL
...
@@ -26,6 +26,7 @@ import com.yidian.common.XRouterPathConstants.Companion.PROTOCOL
import
com.yidian.common.XRouterPathConstants.Companion.SUPPORT
import
com.yidian.common.XRouterPathConstants.Companion.SUPPORT
import
com.yidian.common.XRouterPathConstants.Companion.SYSTEM_SETTING
import
com.yidian.common.XRouterPathConstants.Companion.SYSTEM_SETTING
import
com.yidian.common.YdBaseApplication
import
com.yidian.common.YdBaseApplication
import
com.yidian.news.YdImageLoader
import
com.yidian.news.util.ProcessUtil
import
com.yidian.news.util.ProcessUtil
import
com.yidian.nightmode.util.NightModeUtil
import
com.yidian.nightmode.util.NightModeUtil
import
com.yidian.shenghuoquan.newscontent.personnel.ui.*
import
com.yidian.shenghuoquan.newscontent.personnel.ui.*
...
@@ -52,6 +53,7 @@ class NewsContentApplication : YdBaseApplication() {
...
@@ -52,6 +53,7 @@ class NewsContentApplication : YdBaseApplication() {
initService
()
initService
()
NightModeUtil
.
setContext
(
this
)
NightModeUtil
.
setContext
(
this
)
DensityUtil
.
init
(
this
)
DensityUtil
.
init
(
this
)
YdImageLoader
.
init
(
this
)
}
}
}
}
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/bean/LifeAccountMerchantAuthData.kt
View file @
1a402b85
...
@@ -13,6 +13,7 @@ class LifeAccountMerchantAuthData {
...
@@ -13,6 +13,7 @@ class LifeAccountMerchantAuthData {
var
registrationCode
:
String
=
""
var
registrationCode
:
String
=
""
var
authRecordId
:
Long
?
=
null
var
authRecordId
:
Long
?
=
null
var
lifeAccountId
:
Long
?
=
null
var
lifeAccountId
:
Long
?
=
null
var
isRecoverAuthProcess
:
Boolean
=
false
// 是否为恢复认证流程
// 营业执照相关信息
// 营业执照相关信息
var
type
:
String
?
=
null
var
type
:
String
?
=
null
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/bean/LifeAccountPersonalAuthData.kt
View file @
1a402b85
...
@@ -6,10 +6,10 @@ package com.yidian.shenghuoquan.newscontent.bean
...
@@ -6,10 +6,10 @@ package com.yidian.shenghuoquan.newscontent.bean
* description: 生活号个人认证数据集
* description: 生活号个人认证数据集
*/
*/
class
LifeAccountPersonalAuthData
{
class
LifeAccountPersonalAuthData
{
var
realName
:
String
=
""
var
realName
:
String
?
=
null
var
idCardNum
:
String
=
""
var
idCardNum
:
String
?
=
null
var
phoneNum
:
String
=
""
// 法人手机号
var
phoneNum
:
String
?
=
null
// 法人手机号
var
occupation
:
String
=
""
var
occupation
:
String
?
=
null
var
idCardPortraitFaceObjectKey
:
String
?
=
null
var
idCardPortraitFaceObjectKey
:
String
?
=
null
var
idCardNationalEmblemFaceObjectKey
:
String
?
=
null
var
idCardNationalEmblemFaceObjectKey
:
String
?
=
null
var
idCardPortraitFaceBucket
:
String
?
=
null
var
idCardPortraitFaceBucket
:
String
?
=
null
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/constant/Constant.kt
View file @
1a402b85
...
@@ -57,4 +57,8 @@ object Constant {
...
@@ -57,4 +57,8 @@ object Constant {
const
val
DATA_FROM_C
=
1
// C端
const
val
DATA_FROM_C
=
1
// C端
const
val
DATA_FROM_B
=
2
// B端
const
val
DATA_FROM_B
=
2
// B端
const
val
DATA_FROM_OP
=
3
// OP后台
const
val
DATA_FROM_OP
=
3
// OP后台
// 服务端标识
const
val
ALIVE_DETECT_SUCCESS
=
1
// 活体检测成功
const
val
ALIVE_DETECT_FAIL
=
2
// 活体检测未检测或失败
}
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/ApiService.kt
View file @
1a402b85
...
@@ -298,20 +298,20 @@ class ApiService {
...
@@ -298,20 +298,20 @@ class ApiService {
}
}
// 103 认证完成后创建生活号
// 103 认证完成后创建生活号
fun
authComplete
(
apiCallback
:
IAuth
CompleteCallback
,
requestParams
:
HashMap
<
String
,
String
?
>)
{
fun
authComplete
(
apiCallback
Personal
:
IAuthPersonal
CompleteCallback
,
requestParams
:
HashMap
<
String
,
String
?
>)
{
val
timeStamp
=
System
.
currentTimeMillis
()
val
timeStamp
=
System
.
currentTimeMillis
()
val
publicParamsMap
=
HttpParamsUtils
.
getPublicParamsMap
(
timeStamp
)
val
publicParamsMap
=
HttpParamsUtils
.
getPublicParamsMap
(
timeStamp
)
val
privateParamsMap
=
HttpParamsUtils
.
getPrivateParamsMap
(
requestParams
,
timeStamp
)
val
privateParamsMap
=
HttpParamsUtils
.
getPrivateParamsMap
(
requestParams
,
timeStamp
)
ServiceFactory
.
getInstance
().
createService
(
CommonService
::
class
.
java
)
ServiceFactory
.
getInstance
().
createService
(
CommonService
::
class
.
java
)
.
authComplete
(
publicParamsMap
,
privateParamsMap
)
.
authComplete
(
publicParamsMap
,
privateParamsMap
)
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
compose
(
TransformUtil
.
defaultSchedulers
())
.
subscribe
(
object
:
HttpResultSubscriber
<
A
ny
?>()
{
.
subscribe
(
object
:
HttpResultSubscriber
<
A
uthPersonalCompleteBean
.
Response
?>()
{
override
fun
onSuccess
(
result
:
HttpResult
<
A
ny
?
>?)
{
override
fun
onSuccess
(
result
:
HttpResult
<
A
uthPersonalCompleteBean
.
Response
?
>?)
{
apiCallback
.
authCompleteSuccess
(
)
apiCallback
Personal
.
authPersonalCompleteSuccess
(
result
?.
result
)
}
}
override
fun
onFailer
(
result
:
HttpResult
<
A
ny
?
>?)
{
override
fun
onFailer
(
result
:
HttpResult
<
A
uthPersonalCompleteBean
.
Response
?
>?)
{
apiCallback
.
auth
CompleteFailure
(
result
?.
reason
)
apiCallback
Personal
.
authPersonal
CompleteFailure
(
result
?.
reason
)
}
}
})
})
}
}
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/callback/IAuthCompleteCallback.kt
→
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/callback/IAuth
Personal
CompleteCallback.kt
View file @
1a402b85
package
com.yidian.shenghuoquan.newscontent.http.callback
package
com.yidian.shenghuoquan.newscontent.http.callback
import
com.yidian.shenghuoquan.newscontent.http.httpbean.AuthPersonalCompleteBean
/**
/**
* author: yinjiacheng
* author: yinjiacheng
* date: 6/1/21 7:43 PM
* date: 6/1/21 7:43 PM
* description: API /merchant/auth/complete
* description: API /merchant/auth/complete
*/
*/
interface
IAuthCompleteCallback
{
interface
IAuth
Personal
CompleteCallback
{
fun
auth
CompleteSuccess
(
)
fun
auth
PersonalCompleteSuccess
(
result
:
AuthPersonalCompleteBean
.
Response
?
)
fun
authCompleteFailure
(
message
:
String
?)
fun
auth
Personal
CompleteFailure
(
message
:
String
?)
}
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/httpbean/AuthAuthenticationBean.kt
View file @
1a402b85
package
com.yidian.shenghuoquan.newscontent.http.httpbean
package
com.yidian.shenghuoquan.newscontent.http.httpbean
import
java.io.Serializable
/**
/**
* author: yinjiacheng
* author: yinjiacheng
* date: 6/1/21 7:54 PM
* date: 6/1/21 7:54 PM
* description: API /merchant/auth/authentication
* description: API /merchant/auth/authentication
*/
*/
class
AuthAuthenticationBean
(
val
response
:
Response
)
{
class
AuthAuthenticationBean
(
val
response
:
Response
)
:
Serializable
{
data class
Response
(
data class
Response
(
val
audit_status
:
Int
,
val
audit_status
:
Int
,
val
back_id_card
:
String
,
val
back_id_card
:
String
,
...
@@ -14,6 +17,8 @@ class AuthAuthenticationBean(val response: Response) {
...
@@ -14,6 +17,8 @@ class AuthAuthenticationBean(val response: Response) {
val
full_name
:
String
,
val
full_name
:
String
,
val
id_card
:
String
,
val
id_card
:
String
,
val
live_identity_status
:
Int
,
val
live_identity_status
:
Int
,
val
occupation
:
String
val
occupation
:
String
,
)
val
auth
:
Int
)
:
Serializable
}
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/httpbean/AuthMerchantCheckBean.kt
View file @
1a402b85
package
com.yidian.shenghuoquan.newscontent.http.httpbean
package
com.yidian.shenghuoquan.newscontent.http.httpbean
import
java.io.Serializable
/**
/**
* author: yinjiacheng
* author: yinjiacheng
* date: 6/3/21 6:05 PM
* date: 6/3/21 6:05 PM
* description: API /merchant/enterprise/check
* description: API /merchant/enterprise/check
*/
*/
class
AuthMerchantCheckBean
{
class
AuthMerchantCheckBean
:
Serializable
{
data class
Request
(
data class
Request
(
val
life_account_id
:
Long
?,
val
life_account_id
:
Long
?,
...
@@ -25,6 +27,6 @@ class AuthMerchantCheckBean {
...
@@ -25,6 +27,6 @@ class AuthMerchantCheckBean {
val
live_identity_status
:
Int
,
val
live_identity_status
:
Int
,
val
mobile
:
String
,
val
mobile
:
String
,
val
name
:
String
val
name
:
String
)
)
:
Serializable
}
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/httpbean/AuthCompleteBean.kt
→
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/http/httpbean/Auth
Personal
CompleteBean.kt
View file @
1a402b85
...
@@ -5,6 +5,7 @@ package com.yidian.shenghuoquan.newscontent.http.httpbean
...
@@ -5,6 +5,7 @@ package com.yidian.shenghuoquan.newscontent.http.httpbean
* date: 6/1/21 7:40 PM
* date: 6/1/21 7:40 PM
* description: API /merchant/auth/complete
* description: API /merchant/auth/complete
*/
*/
class
AuthCompleteBean
(
val
request
:
Request
)
{
class
AuthPersonalCompleteBean
(
val
request
:
Request
)
{
data class
Request
(
val
mobile
:
String
)
data class
Request
(
val
mobile
:
String
,
val
life_account_id
:
Long
?)
data class
Response
(
val
life_account_id
:
Long
)
}
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/auth/LifeAccountAuthActivity.kt
View file @
1a402b85
...
@@ -11,8 +11,7 @@ import com.yidian.shenghuoquan.newscontent.databinding.ActivityLifeAccountAuthBi
...
@@ -11,8 +11,7 @@ import com.yidian.shenghuoquan.newscontent.databinding.ActivityLifeAccountAuthBi
import
com.yidian.shenghuoquan.newscontent.http.ApiService
import
com.yidian.shenghuoquan.newscontent.http.ApiService
import
com.yidian.shenghuoquan.newscontent.http.callback.IAuthAuthenticationCallback
import
com.yidian.shenghuoquan.newscontent.http.callback.IAuthAuthenticationCallback
import
com.yidian.shenghuoquan.newscontent.http.callback.IAuthMerchantCheckCallback
import
com.yidian.shenghuoquan.newscontent.http.callback.IAuthMerchantCheckCallback
import
com.yidian.shenghuoquan.newscontent.http.httpbean.AuthAuthenticationBean
import
com.yidian.shenghuoquan.newscontent.http.httpbean.*
import
com.yidian.shenghuoquan.newscontent.http.httpbean.AuthMerchantCheckBean
import
com.yidian.xpage.XPageManager
import
com.yidian.xpage.XPageManager
/**
/**
...
@@ -78,11 +77,13 @@ class LifeAccountAuthActivity : BaseActivity<ActivityLifeAccountAuthBinding>(),
...
@@ -78,11 +77,13 @@ class LifeAccountAuthActivity : BaseActivity<ActivityLifeAccountAuthBinding>(),
}
}
override
fun
authAuthenticationSuccess
(
result
:
AuthAuthenticationBean
.
Response
?)
{
override
fun
authAuthenticationSuccess
(
result
:
AuthAuthenticationBean
.
Response
?)
{
// TODO: 6/6/21 带参跳转
viewBind
.
viewPersonalAuth
.
isSelected
=
true
viewBind
.
viewPersonalAuth
.
isSelected
=
true
viewBind
.
viewEnterpriseAuth
.
isSelected
=
false
viewBind
.
viewEnterpriseAuth
.
isSelected
=
false
// 跳转个人认证页
// 跳转个人认证页
XPageManager
.
push
(
XRouterPathConstants
.
LIFE_ACCOUNT_PERSONAL_AUTH
,
null
)
XPageManager
.
push
(
XRouterPathConstants
.
LIFE_ACCOUNT_PERSONAL_AUTH
,
hashMapOf
(
Pair
(
LifeAccountPersonalAuthActivity
.
EXTRA_AUTH_DATA
,
result
))
)
}
}
override
fun
authAuthenticationFailure
(
message
:
String
?)
{
override
fun
authAuthenticationFailure
(
message
:
String
?)
{
...
@@ -90,18 +91,16 @@ class LifeAccountAuthActivity : BaseActivity<ActivityLifeAccountAuthBinding>(),
...
@@ -90,18 +91,16 @@ class LifeAccountAuthActivity : BaseActivity<ActivityLifeAccountAuthBinding>(),
Constant
.
LIFE_ACCOUNT_AUTH_TAG
,
Constant
.
LIFE_ACCOUNT_AUTH_TAG
,
"request auth authentication failure, message: $message"
"request auth authentication failure, message: $message"
)
)
// Test
viewBind
.
viewPersonalAuth
.
isSelected
=
true
viewBind
.
viewEnterpriseAuth
.
isSelected
=
false
XPageManager
.
push
(
XRouterPathConstants
.
LIFE_ACCOUNT_PERSONAL_AUTH
,
null
)
}
}
override
fun
authMerchantCheckSuccess
(
result
:
AuthMerchantCheckBean
.
Response
?)
{
override
fun
authMerchantCheckSuccess
(
result
:
AuthMerchantCheckBean
.
Response
?)
{
// TODO: 6/6/21 带参跳转
viewBind
.
viewPersonalAuth
.
isSelected
=
false
viewBind
.
viewPersonalAuth
.
isSelected
=
false
viewBind
.
viewEnterpriseAuth
.
isSelected
=
true
viewBind
.
viewEnterpriseAuth
.
isSelected
=
true
// 跳转企业认证页
// 跳转企业认证页
XPageManager
.
push
(
XRouterPathConstants
.
LIFE_ACCOUNT_ENTERPRISE_AUTH
,
null
)
XPageManager
.
push
(
XRouterPathConstants
.
LIFE_ACCOUNT_ENTERPRISE_AUTH
,
hashMapOf
(
Pair
(
LifeAccountEnterpriseAuthActivity
.
EXTRA_AUTH_DATA
,
result
))
)
}
}
override
fun
authMerchantCheckFailure
(
message
:
String
?)
{
override
fun
authMerchantCheckFailure
(
message
:
String
?)
{
...
@@ -109,9 +108,5 @@ class LifeAccountAuthActivity : BaseActivity<ActivityLifeAccountAuthBinding>(),
...
@@ -109,9 +108,5 @@ class LifeAccountAuthActivity : BaseActivity<ActivityLifeAccountAuthBinding>(),
Constant
.
LIFE_ACCOUNT_AUTH_TAG
,
Constant
.
LIFE_ACCOUNT_AUTH_TAG
,
"request auth merchant check failure, message: $message"
"request auth merchant check failure, message: $message"
)
)
// Test
viewBind
.
viewPersonalAuth
.
isSelected
=
false
viewBind
.
viewEnterpriseAuth
.
isSelected
=
true
XPageManager
.
push
(
XRouterPathConstants
.
LIFE_ACCOUNT_ENTERPRISE_AUTH
,
null
)
}
}
}
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/auth/LifeAccountAuthDataManager.kt
View file @
1a402b85
...
@@ -100,7 +100,6 @@ object LifeAccountAuthDataManager {
...
@@ -100,7 +100,6 @@ object LifeAccountAuthDataManager {
* 生成营业执照上传接口请求体
* 生成营业执照上传接口请求体
*/
*/
fun
generateAuthBusinessLicenseCommitRequest
(
fun
generateAuthBusinessLicenseCommitRequest
(
dataType
:
Int
,
lifeAccountId
:
Long
?
lifeAccountId
:
Long
?
):
HashMap
<
String
,
String
?
>
{
):
HashMap
<
String
,
String
?
>
{
val
requestMap
=
HashMap
<
String
,
String
?>()
val
requestMap
=
HashMap
<
String
,
String
?>()
...
@@ -121,7 +120,7 @@ object LifeAccountAuthDataManager {
...
@@ -121,7 +120,7 @@ object LifeAccountAuthDataManager {
requestMap
[
"issue_date"
]
=
merchantAuthData
.
date_issue
requestMap
[
"issue_date"
]
=
merchantAuthData
.
date_issue
requestMap
[
"entterprise_image"
]
=
merchantAuthData
.
businessLicenseObjectKey
requestMap
[
"entterprise_image"
]
=
merchantAuthData
.
businessLicenseObjectKey
requestMap
[
"data_from"
]
=
Constant
.
DATA_FROM_B
.
toString
()
requestMap
[
"data_from"
]
=
Constant
.
DATA_FROM_B
.
toString
()
requestMap
[
"data_type"
]
=
data
Type
.
toString
()
requestMap
[
"data_type"
]
=
merchantAuthData
.
merchant
Type
.
toString
()
lifeAccountId
?.
let
{
lifeAccountId
?.
let
{
requestMap
[
"life_account_id"
]
=
it
.
toString
()
requestMap
[
"life_account_id"
]
=
it
.
toString
()
}
}
...
@@ -179,4 +178,16 @@ object LifeAccountAuthDataManager {
...
@@ -179,4 +178,16 @@ object LifeAccountAuthDataManager {
}
}
return
requestMap
return
requestMap
}
}
/**
* 生成个体工商户认证完成接口请求体
*/
fun
generateAuthIndividualBusinessCompleteRequest
(
lifeAccountId
:
Long
?):
HashMap
<
String
,
String
?
>
{
val
requestMap
=
HashMap
<
String
,
String
?>()
requestMap
[
"record_id"
]
=
merchantAuthData
.
authRecordId
.
toString
()
lifeAccountId
?.
let
{
requestMap
[
"life_account_id"
]
=
it
.
toString
()
}
return
requestMap
}
}
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/auth/LifeAccountBusinessLicenseAuthFragment.kt
View file @
1a402b85
...
@@ -12,6 +12,7 @@ import android.view.View
...
@@ -12,6 +12,7 @@ import android.view.View
import
android.view.ViewGroup
import
android.view.ViewGroup
import
androidx.core.content.FileProvider
import
androidx.core.content.FileProvider
import
androidx.core.view.isVisible
import
androidx.core.view.isVisible
import
com.bumptech.glide.Glide
import
com.yidian.common.base.BaseFragment
import
com.yidian.common.base.BaseFragment
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.adapter.BottomSelectAdapter
import
com.yidian.shenghuoquan.newscontent.adapter.BottomSelectAdapter
...
@@ -19,6 +20,7 @@ import com.yidian.shenghuoquan.newscontent.bean.BottomSelectBean
...
@@ -19,6 +20,7 @@ import com.yidian.shenghuoquan.newscontent.bean.BottomSelectBean
import
com.yidian.shenghuoquan.newscontent.constant.Constant
import
com.yidian.shenghuoquan.newscontent.constant.Constant
import
com.yidian.shenghuoquan.newscontent.databinding.FragmentLifeAccountBusinessLicenseAuthBinding
import
com.yidian.shenghuoquan.newscontent.databinding.FragmentLifeAccountBusinessLicenseAuthBinding
import
com.yidian.shenghuoquan.newscontent.http.ApiService
import
com.yidian.shenghuoquan.newscontent.http.ApiService
import
com.yidian.shenghuoquan.newscontent.http.httpbean.AuthMerchantCheckBean
import
com.yidian.shenghuoquan.newscontent.http.httpbean.BusinessLicenseOCRBean
import
com.yidian.shenghuoquan.newscontent.http.httpbean.BusinessLicenseOCRBean
import
com.yidian.shenghuoquan.newscontent.http.httpbean.IBusinessLicenseOCRCallback
import
com.yidian.shenghuoquan.newscontent.http.httpbean.IBusinessLicenseOCRCallback
import
com.yidian.shenghuoquan.newscontent.ui.dialog.BottomSelectDialog
import
com.yidian.shenghuoquan.newscontent.ui.dialog.BottomSelectDialog
...
@@ -39,6 +41,11 @@ class LifeAccountBusinessLicenseAuthFragment :
...
@@ -39,6 +41,11 @@ class LifeAccountBusinessLicenseAuthFragment :
IBusinessLicenseOCRCallback
,
IBusinessLicenseOCRCallback
,
LifeAccountAuthBusinessInfoEditView
.
OnLifeAccountAuthBusinessInfoEditViewCallback
{
LifeAccountAuthBusinessInfoEditView
.
OnLifeAccountAuthBusinessInfoEditViewCallback
{
companion
object
{
// 认证数据
const
val
EXTRA_AUTH_DATA
=
"authData"
}
/**
/**
* sdcard/Android/data/package/cache
* sdcard/Android/data/package/cache
*/
*/
...
@@ -60,6 +67,7 @@ class LifeAccountBusinessLicenseAuthFragment :
...
@@ -60,6 +67,7 @@ class LifeAccountBusinessLicenseAuthFragment :
super
.
init
(
savedInstanceState
)
super
.
init
(
savedInstanceState
)
initView
()
initView
()
initListener
()
initListener
()
initData
()
}
}
private
fun
initView
()
{
private
fun
initView
()
{
...
@@ -74,6 +82,41 @@ class LifeAccountBusinessLicenseAuthFragment :
...
@@ -74,6 +82,41 @@ class LifeAccountBusinessLicenseAuthFragment :
viewBinding
.
evRegistrationCode
.
setOnLifeAccountAuthBusinessInfoEditViewCallback
(
this
)
viewBinding
.
evRegistrationCode
.
setOnLifeAccountAuthBusinessInfoEditViewCallback
(
this
)
}
}
private
fun
initData
()
{
// 还原认证数据
val
authData
=
arguments
?.
getSerializable
(
LifeAccountIDCardAuthFragment
.
EXTRA_AUTH_DATA
)
?:
return
fillAuthInfo
(
authData
as
AuthMerchantCheckBean
.
Response
)
}
/**
* 认证流程中断,下次进入认证流程时还原进度
*/
private
fun
fillAuthInfo
(
data
:
AuthMerchantCheckBean
.
Response
)
{
LifeAccountAuthDataManager
.
merchantAuthData
.
registrationName
=
data
.
name
LifeAccountAuthDataManager
.
merchantAuthData
.
registrationCode
=
data
.
code
LifeAccountAuthDataManager
.
merchantAuthData
.
isBusinessLicenseUpload
=
true
// UI
Glide
.
with
(
this
).
load
(
data
.
entterprise_image
).
into
(
viewBinding
.
ivBusinessLicense
)
// 填入注册名称和注册码
viewBinding
.
evRegistrationName
.
fillEditContent
(
data
.
name
)
viewBinding
.
evRegistrationCode
.
fillEditContent
(
data
.
code
)
// 检查下一步条件
(
activity
as
LifeAccountEnterpriseAuthActivity
).
checkNextCondition
()
lockAuthInfo
()
}
/**
* 锁定当前输入状态
*/
private
fun
lockAuthInfo
()
{
viewBinding
.
ivClear
.
isVisible
=
false
viewBinding
.
clBusinessLicenseUpload
.
isEnabled
=
false
viewBinding
.
evRegistrationName
.
disableModify
()
viewBinding
.
evRegistrationCode
.
disableModify
()
(
activity
as
LifeAccountEnterpriseAuthActivity
).
disableModifyMerchantType
()
}
override
fun
onClick
(
v
:
View
?)
{
override
fun
onClick
(
v
:
View
?)
{
when
(
v
?.
id
)
{
when
(
v
?.
id
)
{
R
.
id
.
cl_business_license_upload
->
{
R
.
id
.
cl_business_license_upload
->
{
...
@@ -90,18 +133,7 @@ class LifeAccountBusinessLicenseAuthFragment :
...
@@ -90,18 +133,7 @@ class LifeAccountBusinessLicenseAuthFragment :
}
}
}
}
R
.
id
.
iv_clear
->
{
R
.
id
.
iv_clear
->
{
// 清除已上传的营业执照
clearBusinessLicenseInfo
()
viewBinding
.
ivBusinessLicense
.
setImageDrawable
(
null
)
LifeAccountAuthDataManager
.
merchantAuthData
.
isBusinessLicenseUpload
=
false
// 清除OCR或用户输入内容
viewBinding
.
evRegistrationName
.
clearEditContent
()
viewBinding
.
evRegistrationCode
.
clearEditContent
()
LifeAccountAuthDataManager
.
merchantAuthData
.
registrationName
=
""
LifeAccountAuthDataManager
.
merchantAuthData
.
registrationCode
=
""
// 设置上传区域可点击
viewBinding
.
clBusinessLicenseUpload
.
isEnabled
=
true
// 隐藏清除按钮
viewBinding
.
ivClear
.
visibility
=
View
.
GONE
// 检查下一步条件
// 检查下一步条件
(
activity
as
LifeAccountEnterpriseAuthActivity
).
checkNextCondition
()
(
activity
as
LifeAccountEnterpriseAuthActivity
).
checkNextCondition
()
}
}
...
@@ -212,12 +244,18 @@ class LifeAccountBusinessLicenseAuthFragment :
...
@@ -212,12 +244,18 @@ class LifeAccountBusinessLicenseAuthFragment :
fun
clearBusinessLicenseInfo
()
{
fun
clearBusinessLicenseInfo
()
{
// 清除已上传的营业执照
// 清除已上传的营业执照
viewBinding
.
ivBusinessLicense
.
setImageDrawable
(
null
)
viewBinding
.
ivBusinessLicense
.
setImageDrawable
(
null
)
// 清除错误提示
viewBinding
.
tvUploadErrorTips
.
isVisible
=
false
viewBinding
.
ivClear
.
isVisible
=
false
viewBinding
.
ivClear
.
isVisible
=
false
// 清除OCR或用户输入内容
// 清除OCR或用户输入内容
viewBinding
.
evRegistrationName
.
clearEditContent
()
viewBinding
.
evRegistrationName
.
clearEditContent
()
viewBinding
.
evRegistrationCode
.
clearEditContent
()
viewBinding
.
evRegistrationCode
.
clearEditContent
()
// 设置上传区域可点击
// 设置上传区域可点击
viewBinding
.
clBusinessLicenseUpload
.
isEnabled
=
true
viewBinding
.
clBusinessLicenseUpload
.
isEnabled
=
true
LifeAccountAuthDataManager
.
merchantAuthData
.
isBusinessLicenseUpload
=
false
LifeAccountAuthDataManager
.
merchantAuthData
.
registrationName
=
""
LifeAccountAuthDataManager
.
merchantAuthData
.
registrationCode
=
""
}
}
override
fun
onTaskStart
()
{
override
fun
onTaskStart
()
{
...
@@ -263,6 +301,10 @@ class LifeAccountBusinessLicenseAuthFragment :
...
@@ -263,6 +301,10 @@ class LifeAccountBusinessLicenseAuthFragment :
Constant
.
LIFE_ACCOUNT_AUTH_TAG
,
Constant
.
LIFE_ACCOUNT_AUTH_TAG
,
"request business license ocr failure, message: $message"
"request business license ocr failure, message: $message"
)
)
// 营业执照OCR识别失败提示
viewBinding
.
tvUploadErrorTips
.
isVisible
=
true
viewBinding
.
tvUploadErrorTips
.
text
=
resources
.
getString
(
R
.
string
.
check_business_license_distinct
)
}
}
override
fun
onTextClear
(
from
:
LifeAccountAuthBusinessInfoEditView
)
{
override
fun
onTextClear
(
from
:
LifeAccountAuthBusinessInfoEditView
)
{
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/auth/LifeAccountEnterpriseAuthActivity.kt
View file @
1a402b85
...
@@ -15,9 +15,7 @@ import com.yidian.shenghuoquan.newscontent.http.ApiService
...
@@ -15,9 +15,7 @@ import com.yidian.shenghuoquan.newscontent.http.ApiService
import
com.yidian.shenghuoquan.newscontent.http.callback.IAuthBusinessLicenseCommitCallback
import
com.yidian.shenghuoquan.newscontent.http.callback.IAuthBusinessLicenseCommitCallback
import
com.yidian.shenghuoquan.newscontent.http.callback.IAuthIndividualBusinessCompleteCallback
import
com.yidian.shenghuoquan.newscontent.http.callback.IAuthIndividualBusinessCompleteCallback
import
com.yidian.shenghuoquan.newscontent.http.callback.IAuthEnterpriseLegalIdentityCommitCallback
import
com.yidian.shenghuoquan.newscontent.http.callback.IAuthEnterpriseLegalIdentityCommitCallback
import
com.yidian.shenghuoquan.newscontent.http.httpbean.AuthBusinessLicenseCommitBean
import
com.yidian.shenghuoquan.newscontent.http.httpbean.*
import
com.yidian.shenghuoquan.newscontent.http.httpbean.AuthEnterpriseLegalIdentityCommitBean
import
com.yidian.shenghuoquan.newscontent.http.httpbean.AuthIndividualBusinessCompleteBean
import
com.yidian.shenghuoquan.newscontent.ui.dialog.BottomSelectDialog
import
com.yidian.shenghuoquan.newscontent.ui.dialog.BottomSelectDialog
import
com.yidian.shenghuoquan.newscontent.widget.LifeAccountAuthProcessView
import
com.yidian.shenghuoquan.newscontent.widget.LifeAccountAuthProcessView
import
com.yidian.xpage.XPageManager
import
com.yidian.xpage.XPageManager
...
@@ -33,10 +31,12 @@ class LifeAccountEnterpriseAuthActivity : BaseActivity<ActivityLifeAccountEnterp
...
@@ -33,10 +31,12 @@ class LifeAccountEnterpriseAuthActivity : BaseActivity<ActivityLifeAccountEnterp
IAuthIndividualBusinessCompleteCallback
{
IAuthIndividualBusinessCompleteCallback
{
companion
object
{
companion
object
{
/**
* 生活号id 个人生活号主动升级企业生活号的认证流程传入
// 生活号id 个人生活号主动升级企业生活号的认证流程传入
*/
const
val
EXTRA_LIFE_ACCOUNT_ID
=
"lifeAccountId"
const
val
EXTRA_LIFE_ACCOUNT_ID
=
"life_account_id"
// 认证数据
const
val
EXTRA_AUTH_DATA
=
"authData"
}
}
private
val
fragmentList
:
ArrayList
<
Fragment
>
by
lazy
{
private
val
fragmentList
:
ArrayList
<
Fragment
>
by
lazy
{
...
@@ -52,11 +52,24 @@ class LifeAccountEnterpriseAuthActivity : BaseActivity<ActivityLifeAccountEnterp
...
@@ -52,11 +52,24 @@ class LifeAccountEnterpriseAuthActivity : BaseActivity<ActivityLifeAccountEnterp
private
var
curFragment
:
Fragment
?
=
null
private
var
curFragment
:
Fragment
?
=
null
/**
/**
* 当前生活号id,个人生活号升级使用
* 个人生活号id 企业升级用
*/
private
val
personalLifeAccountId
by
lazy
{
intent
.
getSerializableExtra
(
XRouterPathConstants
.
ParamsKey
)
?.
let
{
(
it
as
HashMap
<*,
*>)[
EXTRA_LIFE_ACCOUNT_ID
]
?.
let
{
id
->
id
as
Long
}
}
}
/**
* 认证数据 还原认证流程用
*/
*/
private
val
curLifeAccountId
by
lazy
{
private
val
authData
by
lazy
{
intent
.
getSerializableExtra
(
XRouterPathConstants
.
ParamsKey
)
?.
let
{
intent
.
getSerializableExtra
(
XRouterPathConstants
.
ParamsKey
)
?.
let
{
(
it
as
HashMap
<*,
*>)[
EXTRA_LIFE_ACCOUNT_ID
]
as
Long
(
it
as
HashMap
<*,
*>)[
EXTRA_AUTH_DATA
]
?.
let
{
data
->
data
as
AuthMerchantCheckBean
.
Response
}
}
}
}
}
...
@@ -74,7 +87,7 @@ class LifeAccountEnterpriseAuthActivity : BaseActivity<ActivityLifeAccountEnterp
...
@@ -74,7 +87,7 @@ class LifeAccountEnterpriseAuthActivity : BaseActivity<ActivityLifeAccountEnterp
initListener
()
initListener
()
// 默认企业资质Fragment
// 默认企业资质Fragment
viewBind
.
pvAuthProcess
.
setProcess
(
LifeAccountAuthProcessView
.
PROCESS_ENTERPRISE_QUALIFICATION
)
viewBind
.
pvAuthProcess
.
setProcess
(
LifeAccountAuthProcessView
.
PROCESS_ENTERPRISE_QUALIFICATION
)
switchFragment
(
fragmentList
[
0
]
)
initFragment
(
)
}
}
private
fun
initView
()
{
private
fun
initView
()
{
...
@@ -109,9 +122,9 @@ class LifeAccountEnterpriseAuthActivity : BaseActivity<ActivityLifeAccountEnterp
...
@@ -109,9 +122,9 @@ class LifeAccountEnterpriseAuthActivity : BaseActivity<ActivityLifeAccountEnterp
&&
LifeAccountAuthDataManager
.
merchantAuthData
.
merchantType
==
Constant
.
TYPE_COMMON_ENTERPRISE
&&
LifeAccountAuthDataManager
.
merchantAuthData
.
merchantType
==
Constant
.
TYPE_COMMON_ENTERPRISE
&&
LifeAccountAuthDataManager
.
personalAuthData
.
isIDCardPortraitFaceUpload
&&
LifeAccountAuthDataManager
.
personalAuthData
.
isIDCardPortraitFaceUpload
&&
LifeAccountAuthDataManager
.
personalAuthData
.
isIDCardNationalEmblemFaceUpload
&&
LifeAccountAuthDataManager
.
personalAuthData
.
isIDCardNationalEmblemFaceUpload
&&
LifeAccountAuthDataManager
.
personalAuthData
.
realName
.
isNot
Empty
()
&&
!
LifeAccountAuthDataManager
.
personalAuthData
.
realName
.
isNullOr
Empty
()
&&
LifeAccountAuthDataManager
.
personalAuthData
.
idCardNum
.
isNot
Empty
()
&&
!
LifeAccountAuthDataManager
.
personalAuthData
.
idCardNum
.
isNullOr
Empty
()
&&
LifeAccountAuthDataManager
.
personalAuthData
.
phoneNum
.
isNot
Empty
()
&&
!
LifeAccountAuthDataManager
.
personalAuthData
.
phoneNum
.
isNullOr
Empty
()
)
{
)
{
viewBind
.
btnNext
.
alpha
=
1f
viewBind
.
btnNext
.
alpha
=
1f
viewBind
.
btnNext
.
isEnabled
=
true
viewBind
.
btnNext
.
isEnabled
=
true
...
@@ -121,6 +134,39 @@ class LifeAccountEnterpriseAuthActivity : BaseActivity<ActivityLifeAccountEnterp
...
@@ -121,6 +134,39 @@ class LifeAccountEnterpriseAuthActivity : BaseActivity<ActivityLifeAccountEnterp
}
}
}
}
/**
* 禁止修改商户类型
*/
fun
disableModifyMerchantType
()
{
viewBind
.
svMerchantType
.
enableSelect
(
false
)
}
private
fun
initFragment
()
{
if
(
authData
==
null
)
{
switchFragment
(
fragmentList
[
0
])
}
else
{
// 如果有已存在的认证流程则还原进度
viewBind
.
svMerchantType
.
setContentResult
(
if
(
authData
?.
data_type
==
Constant
.
TYPE_INDIVIDUAL_BUSINESS
)
{
Constant
.
ITEM_INDIVIDUAL_BUSINESSES
}
else
{
Constant
.
ITEM_COMMON_ENTERPRISE
}
)
LifeAccountAuthDataManager
.
merchantAuthData
.
merchantType
=
if
(
authData
?.
data_type
==
Constant
.
TYPE_AUTH_INDIVIDUAL_BUSINESS
)
{
Constant
.
TYPE_INDIVIDUAL_BUSINESS
}
else
{
Constant
.
TYPE_COMMON_ENTERPRISE
}
val
bundle
=
Bundle
()
bundle
.
putSerializable
(
LifeAccountBusinessLicenseAuthFragment
.
EXTRA_AUTH_DATA
,
authData
)
fragmentList
[
0
].
arguments
=
bundle
switchFragment
(
fragmentList
[
0
])
LifeAccountAuthDataManager
.
merchantAuthData
.
isRecoverAuthProcess
=
true
}
}
/**
/**
* fragment切换
* fragment切换
*/
*/
...
@@ -179,30 +225,43 @@ class LifeAccountEnterpriseAuthActivity : BaseActivity<ActivityLifeAccountEnterp
...
@@ -179,30 +225,43 @@ class LifeAccountEnterpriseAuthActivity : BaseActivity<ActivityLifeAccountEnterp
}
}
R
.
id
.
btn_next
->
{
R
.
id
.
btn_next
->
{
if
(
viewBind
.
pvAuthProcess
.
curProcess
==
LifeAccountAuthProcessView
.
PROCESS_ENTERPRISE_QUALIFICATION
)
{
if
(
viewBind
.
pvAuthProcess
.
curProcess
==
LifeAccountAuthProcessView
.
PROCESS_ENTERPRISE_QUALIFICATION
)
{
// TODO: 6/4/21 判断是否为个人生活号升级
// personalLifeAccountId不为null则是由个人生活号升级为企业生活号情况
// personalLifeAccountId为null则是直接进行企业认证情况
if
(
LifeAccountAuthDataManager
.
merchantAuthData
.
isRecoverAuthProcess
)
{
viewBind
.
pvAuthProcess
.
setProcess
(++
viewBind
.
pvAuthProcess
.
curProcess
)
// 向身份信息fragment传参
val
fragment
=
fragmentList
[
viewBind
.
pvAuthProcess
.
curProcess
]
val
bundle
=
Bundle
()
bundle
.
putInt
(
Constant
.
TYPE_AUTH
,
LifeAccountAuthDataManager
.
merchantAuthData
.
merchantType
)
bundle
.
putSerializable
(
LifeAccountIDCardAuthFragment
.
EXTRA_AUTH_DATA
,
authData
)
fragment
.
arguments
=
bundle
switchFragment
(
fragment
)
}
ApiService
.
authBusinessLicenseCommit
(
ApiService
.
authBusinessLicenseCommit
(
this
,
this
,
LifeAccountAuthDataManager
.
generateAuthBusinessLicenseCommitRequest
(
LifeAccountAuthDataManager
.
generateAuthBusinessLicenseCommitRequest
(
LifeAccountAuthDataManager
.
merchantAuthData
.
merchantType
,
personalLifeAccountId
curLifeAccountId
)
)
)
)
}
else
if
(
viewBind
.
pvAuthProcess
.
curProcess
==
LifeAccountAuthProcessView
.
PROCESS_ENTERPRISE_MANAGER
)
{
}
else
if
(
viewBind
.
pvAuthProcess
.
curProcess
==
LifeAccountAuthProcessView
.
PROCESS_ENTERPRISE_MANAGER
)
{
if
(
LifeAccountAuthDataManager
.
merchantAuthData
.
merchantType
==
Constant
.
TYPE_INDIVIDUAL_BUSINESS
)
{
if
(
LifeAccountAuthDataManager
.
merchantAuthData
.
merchantType
==
Constant
.
TYPE_INDIVIDUAL_BUSINESS
)
{
ApiService
.
authIndividualBusinessComplete
(
ApiService
.
authIndividualBusinessComplete
(
this
,
this
,
hashMapOf
(
LifeAccountAuthDataManager
.
generateAuthIndividualBusinessCompleteRequest
(
Pair
(
personalLifeAccountId
"record_id"
,
LifeAccountAuthDataManager
.
merchantAuthData
.
authRecordId
.
toString
()
)
)
)
)
)
}
else
if
(
LifeAccountAuthDataManager
.
merchantAuthData
.
merchantType
==
Constant
.
TYPE_COMMON_ENTERPRISE
)
{
}
else
if
(
LifeAccountAuthDataManager
.
merchantAuthData
.
merchantType
==
Constant
.
TYPE_COMMON_ENTERPRISE
)
{
ApiService
.
authEnterpriseLegalIdentityCommit
(
ApiService
.
authEnterpriseLegalIdentityCommit
(
this
,
this
,
LifeAccountAuthDataManager
.
generateAuthEnterpriseLegalIdentityCommitRequest
(
LifeAccountAuthDataManager
.
generateAuthEnterpriseLegalIdentityCommitRequest
(
cur
LifeAccountId
personal
LifeAccountId
)
)
)
)
}
}
...
@@ -237,9 +296,9 @@ class LifeAccountEnterpriseAuthActivity : BaseActivity<ActivityLifeAccountEnterp
...
@@ -237,9 +296,9 @@ class LifeAccountEnterpriseAuthActivity : BaseActivity<ActivityLifeAccountEnterp
Constant
.
TYPE_AUTH
,
Constant
.
TYPE_AUTH
,
LifeAccountAuthDataManager
.
merchantAuthData
.
merchantType
LifeAccountAuthDataManager
.
merchantAuthData
.
merchantType
)
)
bundle
.
putSerializable
(
LifeAccountIDCardAuthFragment
.
EXTRA_AUTH_DATA
,
authData
)
fragment
.
arguments
=
bundle
fragment
.
arguments
=
bundle
switchFragment
(
fragment
)
switchFragment
(
fragment
)
checkNextCondition
()
}
}
override
fun
authBusinessLicenseCommitFailure
(
message
:
String
?)
{
override
fun
authBusinessLicenseCommitFailure
(
message
:
String
?)
{
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/auth/LifeAccountIDCardAuthFragment.kt
View file @
1a402b85
package
com.yidian.shenghuoquan.newscontent.ui.auth
package
com.yidian.shenghuoquan.newscontent.ui.auth
import
android.app.Activity
import
android.app.Activity
import
android.content.ContentResolver
import
android.content.Intent
import
android.content.Intent
import
android.graphics.BitmapFactory
import
android.graphics.BitmapFactory
import
android.net.Uri
import
android.os.Build
import
android.os.Bundle
import
android.os.Bundle
import
android.os.FileUtils
import
android.provider.MediaStore
import
android.provider.MediaStore
import
android.util.Log
import
android.util.Log
import
android.view.LayoutInflater
import
android.view.LayoutInflater
...
@@ -23,7 +19,6 @@ import com.megvii.meglive_sdk.listener.PreCallback
...
@@ -23,7 +19,6 @@ import com.megvii.meglive_sdk.listener.PreCallback
import
com.megvii.meglive_sdk.manager.MegLiveManager
import
com.megvii.meglive_sdk.manager.MegLiveManager
import
com.yidian.common.base.BaseFragment
import
com.yidian.common.base.BaseFragment
import
com.yidian.common.http.HttpResult
import
com.yidian.common.http.HttpResult
import
com.yidian.common.utils.YdFileUtils
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.adapter.BottomSelectAdapter
import
com.yidian.shenghuoquan.newscontent.adapter.BottomSelectAdapter
import
com.yidian.shenghuoquan.newscontent.bean.BottomSelectBean
import
com.yidian.shenghuoquan.newscontent.bean.BottomSelectBean
...
@@ -44,7 +39,6 @@ import com.yidian.shenghuoquan.newscontent.widget.LifeAccountAuthImageView
...
@@ -44,7 +39,6 @@ import com.yidian.shenghuoquan.newscontent.widget.LifeAccountAuthImageView
import
com.yidian.shenghuoquan.newscontent.widget.LifeAccountFaceAuthView
import
com.yidian.shenghuoquan.newscontent.widget.LifeAccountFaceAuthView
import
com.yidian.utils.ToastUtil
import
com.yidian.utils.ToastUtil
import
java.io.File
import
java.io.File
import
java.io.FileOutputStream
/**
/**
* author: yinjiacheng
* author: yinjiacheng
...
@@ -72,6 +66,9 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
...
@@ -72,6 +66,9 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
//活体检测请求host 详见文档
//活体检测请求host 详见文档
private
const
val
ALIVE_DETECT_HOST
=
"https://api.megvii.com"
private
const
val
ALIVE_DETECT_HOST
=
"https://api.megvii.com"
// 认证数据
const
val
EXTRA_AUTH_DATA
=
"authData"
}
}
/**
/**
...
@@ -118,11 +115,13 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
...
@@ -118,11 +115,13 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
super
.
init
(
savedInstanceState
)
super
.
init
(
savedInstanceState
)
initView
()
initView
()
initListener
()
initListener
()
initData
()
initFaceID
()
initFaceID
()
}
}
private
fun
initView
()
{
private
fun
initView
()
{
authType
=
arguments
?.
getInt
(
Constant
.
TYPE_AUTH
,
-
1
)
?:
Constant
.
TYPE_AUTH_PERSONAL
authType
=
arguments
?.
getInt
(
Constant
.
TYPE_AUTH
,
Constant
.
TYPE_AUTH_PERSONAL
)
?:
Constant
.
TYPE_AUTH_PERSONAL
when
(
authType
)
{
when
(
authType
)
{
Constant
.
TYPE_AUTH_PERSONAL
->
{
Constant
.
TYPE_AUTH_PERSONAL
->
{
viewBinding
.
evRealName
.
setTitleContent
(
resources
.
getString
(
R
.
string
.
real_name
))
viewBinding
.
evRealName
.
setTitleContent
(
resources
.
getString
(
R
.
string
.
real_name
))
...
@@ -150,6 +149,12 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
...
@@ -150,6 +149,12 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
viewBinding
.
avFaceAuth
.
setOnLifeAccountFaceAuthCallback
(
this
)
viewBinding
.
avFaceAuth
.
setOnLifeAccountFaceAuthCallback
(
this
)
}
}
private
fun
initData
()
{
// 还原认证数据
val
authData
=
arguments
?.
getSerializable
(
EXTRA_AUTH_DATA
)
?:
return
fillAuthInfo
(
authData
as
AuthAuthenticationBean
.
Response
)
}
/**
/**
* 初始化旷视FaceID
* 初始化旷视FaceID
*/
*/
...
@@ -194,6 +199,43 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
...
@@ -194,6 +199,43 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
return
false
return
false
}
}
/**
* 认证流程中断,下次进入认证流程时还原进度
*/
private
fun
fillAuthInfo
(
data
:
AuthAuthenticationBean
.
Response
)
{
// 保存姓名和身份证号 用于后面进行人脸验证
LifeAccountAuthDataManager
.
personalAuthData
.
realName
=
data
.
full_name
LifeAccountAuthDataManager
.
personalAuthData
.
idCardNum
=
data
.
id_card
LifeAccountAuthDataManager
.
personalAuthData
.
isFaceAuthPass
=
data
.
live_identity_status
==
Constant
.
ALIVE_DETECT_SUCCESS
// UI
activity
?.
let
{
viewBinding
.
ivIdCardPortraitFace
.
addImage
(
it
,
data
.
front_id_card
)
}
activity
?.
let
{
viewBinding
.
ivIdCardNationalEmblemFace
.
addImage
(
it
,
data
.
back_id_card
)
}
viewBinding
.
evRealName
.
fillEditContent
(
data
.
full_name
)
viewBinding
.
evIdCardNumber
.
fillEditContent
(
data
.
id_card
)
viewBinding
.
avFaceAuth
.
showFaceAuthResult
(
data
.
live_identity_status
==
Constant
.
ALIVE_DETECT_SUCCESS
)
// 如果人脸验证已通过 则直接锁定输入状态
if
(
data
.
live_identity_status
==
Constant
.
ALIVE_DETECT_SUCCESS
)
lockAuthInfo
()
// 检查下一步条件
if
(
authType
==
Constant
.
TYPE_AUTH_PERSONAL
)
{
(
activity
as
LifeAccountPersonalAuthActivity
).
checkNextCondition
()
}
else
{
(
activity
as
LifeAccountEnterpriseAuthActivity
).
checkNextCondition
()
}
}
/**
* 锁定当前输入状态
* 即完成人脸验证后无法修改身份证照片、姓名、身份证号、职业标签
*/
private
fun
lockAuthInfo
()
{
viewBinding
.
ivIdCardPortraitFace
.
disableModify
()
viewBinding
.
ivIdCardNationalEmblemFace
.
disableModify
()
viewBinding
.
evRealName
.
disableModify
()
viewBinding
.
evIdCardNumber
.
disableModify
()
(
activity
as
LifeAccountPersonalAuthActivity
).
disableModifyOccupation
()
}
override
fun
onClick
(
v
:
View
?)
{
override
fun
onClick
(
v
:
View
?)
{
when
(
v
?.
id
)
{
when
(
v
?.
id
)
{
R
.
id
.
iv_id_card_portrait_face
->
{
R
.
id
.
iv_id_card_portrait_face
->
{
...
@@ -479,11 +521,7 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
...
@@ -479,11 +521,7 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
File
(
cachePath
+
Constant
.
FILE_PATH_ALIVE_DETECT_VERIFY_DATA
).
apply
{
File
(
cachePath
+
Constant
.
FILE_PATH_ALIVE_DETECT_VERIFY_DATA
).
apply
{
if
(
exists
())
delete
()
if
(
exists
())
delete
()
}
}
// 锁定当前输入状态 即完成人脸验证后无法修改身份证照片、姓名、身份证号
lockAuthInfo
()
viewBinding
.
ivIdCardPortraitFace
.
disableModify
()
viewBinding
.
ivIdCardNationalEmblemFace
.
disableModify
()
viewBinding
.
evRealName
.
disableModify
()
viewBinding
.
evIdCardNumber
.
disableModify
()
// 回调server 保存活体识别认证状态
// 回调server 保存活体识别认证状态
if
(
authType
==
Constant
.
TYPE_AUTH_PERSONAL
)
{
if
(
authType
==
Constant
.
TYPE_AUTH_PERSONAL
)
{
ApiService
.
authLiveIdentity
(
this
)
ApiService
.
authLiveIdentity
(
this
)
...
@@ -599,11 +637,14 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
...
@@ -599,11 +637,14 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
if
(
exists
())
delete
()
if
(
exists
())
delete
()
}
}
// 跳转人脸认证
// 跳转人脸认证
val
requestParams
=
HashMap
<
String
,
String
?>()
ApiService
.
authPersonalGetToken
(
requestParams
[
"id_number"
]
=
LifeAccountAuthDataManager
.
personalAuthData
.
idCardNum
this
,
requestParams
[
"id_card_name"
]
=
LifeAccountAuthDataManager
.
personalAuthData
.
realName
hashMapOf
(
requestParams
[
"liveness_type"
]
=
Constant
.
TYPE_MEG_LIVE
Pair
(
"id_number"
,
LifeAccountAuthDataManager
.
personalAuthData
.
idCardNum
),
ApiService
.
authPersonalGetToken
(
this
,
requestParams
)
Pair
(
"id_card_name"
,
LifeAccountAuthDataManager
.
personalAuthData
.
realName
),
Pair
(
"liveness_type"
,
Constant
.
TYPE_MEG_LIVE
)
)
)
}
}
override
fun
authPersonCheckFailure
(
message
:
String
?)
{
override
fun
authPersonCheckFailure
(
message
:
String
?)
{
...
@@ -704,7 +745,10 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
...
@@ -704,7 +745,10 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
override
fun
onStartFaceAuth
()
{
override
fun
onStartFaceAuth
()
{
// 判断是否满足条件进行活体检测
// 判断是否满足条件进行活体检测
if
(!
checkFaceAuthCondition
())
return
if
(!
checkFaceAuthCondition
())
{
ToastUtil
.
showToast
(
activity
,
"请补全信息后重试"
)
return
}
when
(
authType
)
{
when
(
authType
)
{
Constant
.
TYPE_AUTH_PERSONAL
->
{
Constant
.
TYPE_AUTH_PERSONAL
->
{
ApiService
.
authPersonalCheck
(
ApiService
.
authPersonalCheck
(
...
@@ -728,11 +772,14 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
...
@@ -728,11 +772,14 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
if
(
exists
())
delete
()
if
(
exists
())
delete
()
}
}
// 跳转人脸认证
// 跳转人脸认证
val
requestParams
=
HashMap
<
String
,
String
?>()
ApiService
.
authPersonalGetToken
(
requestParams
[
"id_number"
]
=
LifeAccountAuthDataManager
.
personalAuthData
.
idCardNum
this
,
requestParams
[
"id_card_name"
]
=
LifeAccountAuthDataManager
.
personalAuthData
.
realName
hashMapOf
(
requestParams
[
"liveness_type"
]
=
Constant
.
TYPE_MEG_LIVE
Pair
(
"id_number"
,
LifeAccountAuthDataManager
.
personalAuthData
.
idCardNum
),
ApiService
.
authPersonalGetToken
(
this
,
requestParams
)
Pair
(
"id_card_name"
,
LifeAccountAuthDataManager
.
personalAuthData
.
realName
),
Pair
(
"liveness_type"
,
Constant
.
TYPE_MEG_LIVE
)
)
)
}
}
override
fun
authIndividualBusinessIdentityCommitFailure
(
message
:
String
?)
{
override
fun
authIndividualBusinessIdentityCommitFailure
(
message
:
String
?)
{
...
@@ -755,41 +802,20 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
...
@@ -755,41 +802,20 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
/**
/**
* 本地校验是否可以进行人脸验证
* 本地校验是否可以进行人脸验证
* 必须同时满足真实姓名已填、身份证号已填、身份证两面已上传、职业标签已选
* 必须同时满足真实姓名已填、身份证号已填、身份证两面已上传、职业标签已选
(只有个人认证需要)
*/
*/
private
fun
checkFaceAuthCondition
():
Boolean
{
private
fun
checkFaceAuthCondition
():
Boolean
{
// TODO: 6/2/21 添加职业标签校验
if
(
authType
==
Constant
.
TYPE_AUTH_PERSONAL
)
{
return
LifeAccountAuthDataManager
.
personalAuthData
.
realName
.
isNotEmpty
()
return
!
LifeAccountAuthDataManager
.
personalAuthData
.
occupation
.
isNullOrEmpty
()
&&
LifeAccountAuthDataManager
.
personalAuthData
.
idCardNum
.
isNotEmpty
()
&&
!
LifeAccountAuthDataManager
.
personalAuthData
.
realName
.
isNullOrEmpty
()
&&
!
LifeAccountAuthDataManager
.
personalAuthData
.
idCardNum
.
isNullOrEmpty
()
&&
LifeAccountAuthDataManager
.
personalAuthData
.
isIDCardPortraitFaceUpload
&&
LifeAccountAuthDataManager
.
personalAuthData
.
isIDCardNationalEmblemFaceUpload
}
return
!
LifeAccountAuthDataManager
.
personalAuthData
.
realName
.
isNullOrEmpty
()
&&
!
LifeAccountAuthDataManager
.
personalAuthData
.
idCardNum
.
isNullOrEmpty
()
&&
LifeAccountAuthDataManager
.
personalAuthData
.
isIDCardPortraitFaceUpload
&&
LifeAccountAuthDataManager
.
personalAuthData
.
isIDCardPortraitFaceUpload
&&
LifeAccountAuthDataManager
.
personalAuthData
.
isIDCardNationalEmblemFaceUpload
&&
LifeAccountAuthDataManager
.
personalAuthData
.
isIDCardNationalEmblemFaceUpload
}
}
/**
* 通过Uri获取文件全路径
* 适配Android Q
*/
@Deprecated
(
"Temporary"
)
private
fun
getFilePathFromUri
(
uri
:
Uri
?,
path
:
String
):
String
?
{
if
(
Build
.
VERSION
.
SDK_INT
>=
Build
.
VERSION_CODES
.
Q
)
{
val
file
=
File
(
path
)
if
(
file
.
exists
())
{
file
.
delete
()
}
file
.
parentFile
?.
mkdirs
()
file
.
createNewFile
()
if
(
uri
?.
scheme
==
ContentResolver
.
SCHEME_CONTENT
)
{
val
inputStream
=
activity
?.
contentResolver
?.
openInputStream
(
uri
)
val
fileOutputStream
=
FileOutputStream
(
file
)
inputStream
?.
let
{
FileUtils
.
copy
(
it
,
fileOutputStream
)
}
inputStream
?.
close
()
fileOutputStream
.
close
()
return
file
.
absolutePath
}
return
null
}
else
{
return
YdFileUtils
.
getImageAbsolutePath
(
activity
,
uri
)
}
}
}
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/auth/LifeAccountPersonalAuthActivity.kt
View file @
1a402b85
...
@@ -12,7 +12,9 @@ import com.yidian.shenghuoquan.newscontent.R
...
@@ -12,7 +12,9 @@ import com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.constant.Constant
import
com.yidian.shenghuoquan.newscontent.constant.Constant
import
com.yidian.shenghuoquan.newscontent.databinding.ActivityLifeAccountPersonalAuthBinding
import
com.yidian.shenghuoquan.newscontent.databinding.ActivityLifeAccountPersonalAuthBinding
import
com.yidian.shenghuoquan.newscontent.http.ApiService
import
com.yidian.shenghuoquan.newscontent.http.ApiService
import
com.yidian.shenghuoquan.newscontent.http.callback.IAuthCompleteCallback
import
com.yidian.shenghuoquan.newscontent.http.callback.IAuthPersonalCompleteCallback
import
com.yidian.shenghuoquan.newscontent.http.httpbean.AuthAuthenticationBean
import
com.yidian.shenghuoquan.newscontent.http.httpbean.AuthPersonalCompleteBean
import
com.yidian.xpage.XPageManager
import
com.yidian.xpage.XPageManager
/**
/**
...
@@ -20,8 +22,19 @@ import com.yidian.xpage.XPageManager
...
@@ -20,8 +22,19 @@ import com.yidian.xpage.XPageManager
* date: 5/26/21 7:38 PM
* date: 5/26/21 7:38 PM
* description: 生活号个人认证
* description: 生活号个人认证
*/
*/
class
LifeAccountPersonalAuthActivity
:
BaseActivity
<
ActivityLifeAccountPersonalAuthBinding
>(),
class
LifeAccountPersonalAuthActivity
:
View
.
OnClickListener
,
CompoundButton
.
OnCheckedChangeListener
,
IAuthCompleteCallback
{
BaseActivity
<
ActivityLifeAccountPersonalAuthBinding
>(),
View
.
OnClickListener
,
CompoundButton
.
OnCheckedChangeListener
,
IAuthPersonalCompleteCallback
{
companion
object
{
// 认证数据
const
val
EXTRA_AUTH_DATA
=
"authData"
}
/**
* 当前fragment
*/
private
val
fragment
by
lazy
{
LifeAccountIDCardAuthFragment
()
}
override
fun
createViewBinding
():
ActivityLifeAccountPersonalAuthBinding
{
override
fun
createViewBinding
():
ActivityLifeAccountPersonalAuthBinding
{
return
ActivityLifeAccountPersonalAuthBinding
.
inflate
(
layoutInflater
)
return
ActivityLifeAccountPersonalAuthBinding
.
inflate
(
layoutInflater
)
...
@@ -33,10 +46,9 @@ class LifeAccountPersonalAuthActivity : BaseActivity<ActivityLifeAccountPersonal
...
@@ -33,10 +46,9 @@ class LifeAccountPersonalAuthActivity : BaseActivity<ActivityLifeAccountPersonal
override
fun
init
(
savedInstanceState
:
Bundle
?)
{
override
fun
init
(
savedInstanceState
:
Bundle
?)
{
super
.
init
(
savedInstanceState
)
super
.
init
(
savedInstanceState
)
supportFragmentManager
.
beginTransaction
()
.
add
(
R
.
id
.
fragment_container
,
LifeAccountIDCardAuthFragment
()).
commit
()
initView
()
initView
()
initListener
()
initListener
()
initFragment
()
}
}
private
fun
initView
()
{
private
fun
initView
()
{
...
@@ -50,12 +62,30 @@ class LifeAccountPersonalAuthActivity : BaseActivity<ActivityLifeAccountPersonal
...
@@ -50,12 +62,30 @@ class LifeAccountPersonalAuthActivity : BaseActivity<ActivityLifeAccountPersonal
viewBind
.
btnNext
.
setOnClickListener
(
this
)
viewBind
.
btnNext
.
setOnClickListener
(
this
)
}
}
private
fun
initFragment
()
{
val
authData
=
intent
.
getSerializableExtra
(
XRouterPathConstants
.
ParamsKey
)
?.
let
{
(
it
as
HashMap
<*,
*>)[
EXTRA_AUTH_DATA
]
?.
let
{
data
->
data
as
AuthAuthenticationBean
.
Response
}
}
// 如果有已存在的认证流程则还原进度
val
bundle
=
Bundle
()
bundle
.
putSerializable
(
LifeAccountIDCardAuthFragment
.
EXTRA_AUTH_DATA
,
authData
)
fragment
.
arguments
=
bundle
supportFragmentManager
.
beginTransaction
()
.
add
(
R
.
id
.
fragment_container
,
fragment
).
commit
()
authData
?.
occupation
?.
let
{
viewBind
.
svOccupation
.
setContentResult
(
it
)
LifeAccountAuthDataManager
.
personalAuthData
.
occupation
=
it
}
}
/**
/**
* 检查是否可以进行下一步
* 检查是否可以进行下一步
*/
*/
fun
checkNextCondition
()
{
fun
checkNextCondition
()
{
if
(
viewBind
.
cbProtocol
.
isChecked
if
(
viewBind
.
cbProtocol
.
isChecked
&&
LifeAccountAuthDataManager
.
personalAuthData
.
occupation
.
isNot
Empty
()
&&
!
LifeAccountAuthDataManager
.
personalAuthData
.
occupation
.
isNullOr
Empty
()
&&
LifeAccountAuthDataManager
.
personalAuthData
.
isFaceAuthPass
&&
LifeAccountAuthDataManager
.
personalAuthData
.
isFaceAuthPass
)
{
)
{
viewBind
.
btnNext
.
alpha
=
1f
viewBind
.
btnNext
.
alpha
=
1f
...
@@ -66,6 +96,13 @@ class LifeAccountPersonalAuthActivity : BaseActivity<ActivityLifeAccountPersonal
...
@@ -66,6 +96,13 @@ class LifeAccountPersonalAuthActivity : BaseActivity<ActivityLifeAccountPersonal
}
}
}
}
/**
* 禁止修改职业标签 用于人脸验证通过后
*/
fun
disableModifyOccupation
()
{
viewBind
.
svOccupation
.
enableSelect
(
false
)
}
override
fun
onClick
(
v
:
View
?)
{
override
fun
onClick
(
v
:
View
?)
{
when
(
v
?.
id
)
{
when
(
v
?.
id
)
{
R
.
id
.
iv_back
->
XPageManager
.
pop
(
null
)
R
.
id
.
iv_back
->
XPageManager
.
pop
(
null
)
...
@@ -73,6 +110,7 @@ class LifeAccountPersonalAuthActivity : BaseActivity<ActivityLifeAccountPersonal
...
@@ -73,6 +110,7 @@ class LifeAccountPersonalAuthActivity : BaseActivity<ActivityLifeAccountPersonal
// TODO: 5/27/21 跳转职业标签选择 选择完成后进行下一步检查
// TODO: 5/27/21 跳转职业标签选择 选择完成后进行下一步检查
LifeAccountAuthDataManager
.
personalAuthData
.
occupation
=
"工程师"
LifeAccountAuthDataManager
.
personalAuthData
.
occupation
=
"工程师"
viewBind
.
svOccupation
.
setContentResult
(
"工程师"
)
viewBind
.
svOccupation
.
setContentResult
(
"工程师"
)
checkNextCondition
()
}
}
R
.
id
.
btn_next
->
{
R
.
id
.
btn_next
->
{
// 个人认证 完成认证
// 个人认证 完成认证
...
@@ -91,11 +129,36 @@ class LifeAccountPersonalAuthActivity : BaseActivity<ActivityLifeAccountPersonal
...
@@ -91,11 +129,36 @@ class LifeAccountPersonalAuthActivity : BaseActivity<ActivityLifeAccountPersonal
checkNextCondition
()
checkNextCondition
()
}
}
override
fun
authCompleteSuccess
()
{
override
fun
authPersonalCompleteSuccess
(
result
:
AuthPersonalCompleteBean
.
Response
?)
{
// TODO: 6/3/21 跳转个人认证成功页
// 跳转个人认证成功页
XPageManager
.
push
(
XRouterPathConstants
.
LIFE_ACCOUNT_PERSONAL_AUTH_COMPLETE
,
hashMapOf
(
Pair
(
LifeAccountPersonalAuthCompleteActivity
.
OCCUPATION
,
LifeAccountAuthDataManager
.
personalAuthData
.
occupation
),
Pair
(
LifeAccountPersonalAuthCompleteActivity
.
PHONE_NUM
,
Hawk
.
get
(
HawkConfig
.
Mobile
,
""
)
),
Pair
(
LifeAccountPersonalAuthCompleteActivity
.
REAL_NAME
,
LifeAccountAuthDataManager
.
personalAuthData
.
realName
),
Pair
(
LifeAccountPersonalAuthCompleteActivity
.
ID_CARD_NUM
,
LifeAccountAuthDataManager
.
personalAuthData
.
idCardNum
),
Pair
(
LifeAccountPersonalAuthCompleteActivity
.
LIFE_ACCOUNT_ID
,
result
?.
life_account_id
)
)
)
}
}
override
fun
authCompleteFailure
(
message
:
String
?)
{
override
fun
auth
Personal
CompleteFailure
(
message
:
String
?)
{
Log
.
e
(
Log
.
e
(
Constant
.
LIFE_ACCOUNT_AUTH_TAG
,
Constant
.
LIFE_ACCOUNT_AUTH_TAG
,
"request auth complete failure: message: $message"
"request auth complete failure: message: $message"
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/auth/LifeAccountPersonalAuthCompleteActivity.kt
View file @
1a402b85
...
@@ -21,6 +21,7 @@ class LifeAccountPersonalAuthCompleteActivity :
...
@@ -21,6 +21,7 @@ class LifeAccountPersonalAuthCompleteActivity :
const
val
REAL_NAME
=
"realName"
const
val
REAL_NAME
=
"realName"
const
val
ID_CARD_NUM
=
"idCardNum"
const
val
ID_CARD_NUM
=
"idCardNum"
const
val
PHONE_NUM
=
"phoneNum"
const
val
PHONE_NUM
=
"phoneNum"
const
val
LIFE_ACCOUNT_ID
=
"lifeAccountId"
// 个人生活号升级用
}
}
/**
/**
...
@@ -57,10 +58,22 @@ class LifeAccountPersonalAuthCompleteActivity :
...
@@ -57,10 +58,22 @@ class LifeAccountPersonalAuthCompleteActivity :
private
fun
initListener
()
{
private
fun
initListener
()
{
viewBind
.
enterLifeAccount
.
setOnClickListener
{
viewBind
.
enterLifeAccount
.
setOnClickListener
{
// TODO: 2021/5/27 跳转生活号管理首页
// 跳转生活号管理首页
XPageManager
.
push
(
XRouterPathConstants
.
MERCHANT_CENTER
,
null
)
finish
()
}
}
viewBind
.
upgradeEnterpriseAuth
.
setOnClickListener
{
viewBind
.
upgradeEnterpriseAuth
.
setOnClickListener
{
XPageManager
.
push
(
XRouterPathConstants
.
LIFE_ACCOUNT_ENTERPRISE_AUTH
,
null
)
// TODO: 6/10/21 传入生活号id
XPageManager
.
push
(
XRouterPathConstants
.
LIFE_ACCOUNT_ENTERPRISE_AUTH
,
hashMapOf
(
Pair
(
LifeAccountEnterpriseAuthActivity
.
EXTRA_LIFE_ACCOUNT_ID
,
params
[
LIFE_ACCOUNT_ID
]
as
Long
)
)
)
finish
()
}
}
}
}
}
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/widget/LifeAccountAuthBusinessInfoEditView.kt
View file @
1a402b85
...
@@ -94,7 +94,7 @@ class LifeAccountAuthBusinessInfoEditView @JvmOverloads constructor(
...
@@ -94,7 +94,7 @@ class LifeAccountAuthBusinessInfoEditView @JvmOverloads constructor(
*/
*/
fun
disableModify
()
{
fun
disableModify
()
{
viewBinding
.
ivClear
.
isVisible
=
false
viewBinding
.
ivClear
.
isVisible
=
false
isEnabled
=
false
viewBinding
.
etContent
.
keyListener
=
null
}
}
/**
/**
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/widget/LifeAccountAuthIdentityInfoEditView.kt
View file @
1a402b85
...
@@ -100,7 +100,7 @@ class LifeAccountAuthIdentityInfoEditView @JvmOverloads constructor(
...
@@ -100,7 +100,7 @@ class LifeAccountAuthIdentityInfoEditView @JvmOverloads constructor(
*/
*/
fun
disableModify
()
{
fun
disableModify
()
{
viewBinding
.
ivClear
.
visibility
=
View
.
GONE
viewBinding
.
ivClear
.
visibility
=
View
.
GONE
isEnabled
=
false
viewBinding
.
etContent
.
keyListener
=
null
}
}
/**
/**
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/widget/LifeAccountAuthImageView.kt
View file @
1a402b85
...
@@ -5,6 +5,7 @@ import android.graphics.Bitmap
...
@@ -5,6 +5,7 @@ import android.graphics.Bitmap
import
android.util.AttributeSet
import
android.util.AttributeSet
import
android.view.View
import
android.view.View
import
androidx.core.view.isVisible
import
androidx.core.view.isVisible
import
com.bumptech.glide.Glide
import
com.yidian.nightmode.widget.YdConstraintLayout
import
com.yidian.nightmode.widget.YdConstraintLayout
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.databinding.ViewLifeAccountAuthImageBinding
import
com.yidian.shenghuoquan.newscontent.databinding.ViewLifeAccountAuthImageBinding
...
@@ -63,6 +64,16 @@ class LifeAccountAuthImageView @JvmOverloads constructor(
...
@@ -63,6 +64,16 @@ class LifeAccountAuthImageView @JvmOverloads constructor(
viewBinding
.
ivClear
.
isVisible
=
true
viewBinding
.
ivClear
.
isVisible
=
true
}
}
/**
* 填充图片
* @param url 图片url
*/
fun
addImage
(
context
:
Context
,
url
:
String
)
{
Glide
.
with
(
context
).
load
(
url
).
into
(
viewBinding
.
ivContent
)
isEnabled
=
false
viewBinding
.
ivClear
.
isVisible
=
true
}
/**
/**
* 清除图片
* 清除图片
*/
*/
...
...
Components/newscontent/src/main/res/layout/activity_life_account_enterprise_auth.xml
View file @
1a402b85
...
@@ -57,6 +57,7 @@
...
@@ -57,6 +57,7 @@
android:layout_marginBottom=
"33dp"
android:layout_marginBottom=
"33dp"
android:alpha=
"0.32"
android:alpha=
"0.32"
android:background=
"@drawable/bg_btn_auth"
android:background=
"@drawable/bg_btn_auth"
android:enabled=
"false"
android:gravity=
"center"
android:gravity=
"center"
android:text=
"@string/next_step"
android:text=
"@string/next_step"
android:textColor=
"#FFFFFFFF"
android:textColor=
"#FFFFFFFF"
...
...
Components/newscontent/src/main/res/layout/activity_life_account_personal_auth.xml
View file @
1a402b85
...
@@ -81,6 +81,7 @@
...
@@ -81,6 +81,7 @@
android:layout_marginBottom=
"33dp"
android:layout_marginBottom=
"33dp"
android:alpha=
"0.32"
android:alpha=
"0.32"
android:background=
"@drawable/bg_btn_auth"
android:background=
"@drawable/bg_btn_auth"
android:enabled=
"false"
android:text=
"@string/auth_finish"
android:text=
"@string/auth_finish"
android:textColor=
"#FFFFFFFF"
android:textColor=
"#FFFFFFFF"
android:textSize=
"17sp"
android:textSize=
"17sp"
...
...
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