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
789188ba
Commit
789188ba
authored
Aug 06, 2021
by
yinjiacheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 生活号类型判断统一使用tag
parent
0b2e4617
Changes
9
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
270 additions
and
278 deletions
+270
-278
MerchantSwitchAdapter.kt
...nghuoquan/bmanagercenter/adapter/MerchantSwitchAdapter.kt
+19
-25
ManagerCenterConfig.kt
...shenghuoquan/bmanagercenter/config/ManagerCenterConfig.kt
+20
-46
LifeAccountManager.kt
...shenghuoquan/bmanagercenter/manager/LifeAccountManager.kt
+42
-0
MerchantAuthInfoActivity.kt
...quan/bmanagercenter/ui/center/MerchantAuthInfoActivity.kt
+20
-20
MerchantCenterActivity.kt
...uoquan/bmanagercenter/ui/center/MerchantCenterActivity.kt
+83
-102
MerchantInfoActivity.kt
...ghuoquan/bmanagercenter/ui/center/MerchantInfoActivity.kt
+52
-50
LifeAccountEnterpriseAuthInfoView.kt
...managercenter/widget/LifeAccountEnterpriseAuthInfoView.kt
+11
-10
LifeAccountLabelView.kt
...henghuoquan/bmanagercenter/widget/LifeAccountLabelView.kt
+16
-23
view_life_account_label.xml
...gerCenter/src/main/res/layout/view_life_account_label.xml
+7
-2
No files found.
Components/BManagerCenter/src/main/java/com/yidian/shenghuoquan/bmanagercenter/adapter/MerchantSwitchAdapter.kt
View file @
789188ba
...
...
@@ -6,10 +6,10 @@ import android.view.ViewGroup
import
androidx.core.content.ContextCompat
import
androidx.core.view.isVisible
import
androidx.recyclerview.widget.RecyclerView
import
com.yidian.bcommon.bean.LifeAccountItemBean
import
com.yidian.shenghuoquan.bmanagercenter.R
import
com.yidian.shenghuoquan.bmanagercenter.constant.Constant
import
com.yidian.shenghuoquan.bmanagercenter.databinding.ItemMerchantSwitchBinding
import
com.yidian.
bcommon.bean.LifeAccountItemBean
import
com.yidian.
shenghuoquan.bmanagercenter.manager.LifeAccountManager
/**
* author: yinjiacheng
...
...
@@ -17,9 +17,9 @@ import com.yidian.bcommon.bean.LifeAccountItemBean
* description: 商户切换主体
*/
class
MerchantSwitchAdapter
(
private
val
curLifeAccountId
:
String
,
data
:
List
<
LifeAccountItemBean
.
Response
>?
=
null
,
val
listener
:
OnItemClickListener
?
=
null
private
val
curLifeAccountId
:
String
,
data
:
List
<
LifeAccountItemBean
.
Response
>?
=
null
,
val
listener
:
OnItemClickListener
?
=
null
)
:
RecyclerView
.
Adapter
<
MerchantSwitchAdapter
.
MerchantSwitchViewHolder
>()
{
...
...
@@ -41,37 +41,31 @@ class MerchantSwitchAdapter(
val
data
=
data
[
position
]
as
LifeAccountItemBean
.
Response
holder
.
viewBinding
.
tvLifeAccountName
.
text
=
data
.
life_account_name
holder
.
viewBinding
.
tvLifeAccountStatus
.
apply
{
when
(
data
.
life_account_auth_status
)
{
Constant
.
STATUS_AUTH_NOT
->
{
text
=
data
.
tag
.
tag_text
when
(
LifeAccountManager
.
getLifeAccountType
(
data
.
tag
.
tag_key
))
{
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_COMMON_ENTERPRISE_AUTH
,
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_INDIVIDUAL_BUSINESS_AUTH
,
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_PERSONAL_AUTH
->
{
// 个体工商户、普通企业、个人
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_auth
)
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_FF1852F1
))
}
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_NOT_AUTH
->
{
// 未认证
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_unauth
)
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_333333
))
text
=
resources
.
getString
(
R
.
string
.
not_auth
)
}
Constant
.
STATUS_AUTH_FINISH
->
{
// 已认证
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_auth
)
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_FF1852F1
))
text
=
when
(
data
.
tag
.
tag_key
)
{
Constant
.
LIFE_ACCOUNT_TAG_COMMON_ENTERPRISE_AUTH
->
resources
.
getString
(
R
.
string
.
common_enterprise
)
Constant
.
LIFE_ACCOUNT_TAG_INDIVIDUAL_BUSINESS_AUTH
->
resources
.
getString
(
R
.
string
.
individual_business
)
Constant
.
LIFE_ACCOUNT_TAG_PERSONAL_AUTH
->
resources
.
getString
(
R
.
string
.
personal_auth
)
else
->
""
}
}
}
when
(
data
.
enterprise_audit_status
)
{
Constant
.
STATUS_AUDIT_UNDER
->
{
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_AUDIT_UNDER
->
{
// 审核中
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_audit
)
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_FFF26E3D
))
text
=
resources
.
getString
(
R
.
string
.
under_audit
)
}
Constant
.
STATUS_AUDIT
_REJECT
->
{
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_AUTH
_REJECT
->
{
// 审核驳回
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_reject
)
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_FFFF3A3A
))
text
=
resources
.
getString
(
R
.
string
.
auth_reject
)
}
else
->
{
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_auth
)
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_FF1852F1
))
}
}
}
...
...
Components/BManagerCenter/src/main/java/com/yidian/shenghuoquan/bmanagercenter/config/ManagerCenterConfig.kt
View file @
789188ba
...
...
@@ -6,7 +6,7 @@ import com.yidian.bcommon.constant.XBirdPageConstants
import
com.yidian.bcommon.constant.XRouterPathConstants
import
com.yidian.bcommon.http.bean.GetCommonConfigBean
import
com.yidian.bcommon.sdk.ClientType
import
com.yidian.shenghuoquan.bmanagercenter.
constant.Constant
import
com.yidian.shenghuoquan.bmanagercenter.
manager.LifeAccountManager
import
com.yidian.shenghuoquan.bmanagercenter.ui.center.MerchantAuthManagementActivity
/**
...
...
@@ -108,27 +108,16 @@ object ManagerCenterConfig {
* 对应生活号权限下的功能集
* 不在功能集中即为仅展示
*/
fun
getFunctionPermissionMap
(
data
:
List
<
GetCommonConfigBean
.
Item
>,
lifeAccountLabel
:
Int
,
client
:
ClientType
):
ArrayList
<
Int
>?
{
fun
getFunctionPermissionMap
(
data
:
List
<
GetCommonConfigBean
.
Item
>,
lifeAccountType
:
LifeAccountManager
.
LifeAccountType
,
client
:
ClientType
):
ArrayList
<
Int
>?
{
if
(
data
.
isEmpty
())
return
null
when
(
client
)
{
ClientType
.
MERCHANT_B
->
{
when
(
lifeAccountLabel
)
{
Constant
.
LIFE_ACCOUNT_TAG_ENTERPRISE_AUTH
->
{
// 企业认证
// 所有服务都可用
return
arrayListOf
(
data
[
0
].
functions
[
0
].
functionId
,
data
[
0
].
functions
[
1
].
functionId
,
data
[
1
].
functions
[
0
].
functionId
,
data
[
1
].
functions
[
1
].
functionId
,
data
[
2
].
functions
[
0
].
functionId
,
data
[
2
].
functions
[
1
].
functionId
,
data
[
2
].
functions
[
2
].
functionId
,
data
[
2
].
functions
[
3
].
functionId
,
data
[
2
].
functions
[
4
].
functionId
)
}
Constant
.
LIFE_ACCOUNT_TAG_COMMON_ENTERPRISE_AUTH
->
{
when
(
lifeAccountType
)
{
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_COMMON_ENTERPRISE_AUTH
->
{
// 普通企业认证
// 所有服务都可用
return
arrayListOf
(
...
...
@@ -143,7 +132,7 @@ object ManagerCenterConfig {
data
[
2
].
functions
[
4
].
functionId
)
}
Constant
.
LIFE_ACCOUNT_TAG
_INDIVIDUAL_BUSINESS_AUTH
->
{
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT
_INDIVIDUAL_BUSINESS_AUTH
->
{
// 个体工商户认证
// 所有服务都可用
return
arrayListOf
(
...
...
@@ -158,7 +147,7 @@ object ManagerCenterConfig {
data
[
2
].
functions
[
4
].
functionId
)
}
Constant
.
LIFE_ACCOUNT_TAG
_PERSONAL_AUTH
->
{
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT
_PERSONAL_AUTH
->
{
// 个人认证
// 我要发布-招聘 其他服务-职位管理 其他服务-系统设置 其他服务-认证管理
return
arrayListOf
(
...
...
@@ -168,7 +157,7 @@ object ManagerCenterConfig {
data
[
2
].
functions
[
4
].
functionId
)
}
Constant
.
LIFE_ACCOUNT_TAG
_NOT_AUTH
->
{
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT
_NOT_AUTH
->
{
// 未认证
// 我要发布-招聘 其他服务-职位管理 其他服务-系统设置 其他服务-认证管理
return
arrayListOf
(
...
...
@@ -178,7 +167,7 @@ object ManagerCenterConfig {
data
[
2
].
functions
[
4
].
functionId
)
}
Constant
.
LIFE_ACCOUNT_TAG
_AUDIT_UNDER
->
{
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT
_AUDIT_UNDER
->
{
// 审核中
// 我要发布-招聘 其他服务-职位管理 其他服务-系统设置 其他服务-认证管理
return
arrayListOf
(
...
...
@@ -188,7 +177,7 @@ object ManagerCenterConfig {
data
[
2
].
functions
[
4
].
functionId
)
}
Constant
.
LIFE_ACCOUNT_TAG
_AUTH_REJECT
->
{
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT
_AUTH_REJECT
->
{
// 认证驳回
// 我要发布-招聘 其他服务-职位管理 其他服务-系统设置 其他服务-认证管理
return
arrayListOf
(
...
...
@@ -201,23 +190,8 @@ object ManagerCenterConfig {
}
}
ClientType
.
MERCHANT_C
->
{
when
(
lifeAccountLabel
)
{
Constant
.
LIFE_ACCOUNT_TAG_ENTERPRISE_AUTH
->
{
// 企业认证
// 所有服务都可用
return
arrayListOf
(
data
[
0
].
functions
[
0
].
functionId
,
data
[
0
].
functions
[
1
].
functionId
,
data
[
1
].
functions
[
0
].
functionId
,
data
[
1
].
functions
[
1
].
functionId
,
data
[
2
].
functions
[
0
].
functionId
,
data
[
2
].
functions
[
1
].
functionId
,
data
[
2
].
functions
[
2
].
functionId
,
data
[
2
].
functions
[
3
].
functionId
,
data
[
2
].
functions
[
4
].
functionId
)
}
Constant
.
LIFE_ACCOUNT_TAG_COMMON_ENTERPRISE_AUTH
->
{
when
(
lifeAccountType
)
{
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_COMMON_ENTERPRISE_AUTH
->
{
// 普通企业认证
// 所有服务都可用
return
arrayListOf
(
...
...
@@ -232,7 +206,7 @@ object ManagerCenterConfig {
data
[
2
].
functions
[
4
].
functionId
)
}
Constant
.
LIFE_ACCOUNT_TAG
_INDIVIDUAL_BUSINESS_AUTH
->
{
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT
_INDIVIDUAL_BUSINESS_AUTH
->
{
// 个体工商户认证
// 所有服务都可用
return
arrayListOf
(
...
...
@@ -247,7 +221,7 @@ object ManagerCenterConfig {
data
[
2
].
functions
[
4
].
functionId
)
}
Constant
.
LIFE_ACCOUNT_TAG
_PERSONAL_AUTH
->
{
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT
_PERSONAL_AUTH
->
{
// 个人认证
// 我要发布-招聘 其他服务-职位管理 其他服务-认证管理
return
arrayListOf
(
...
...
@@ -256,7 +230,7 @@ object ManagerCenterConfig {
data
[
2
].
functions
[
4
].
functionId
)
}
Constant
.
LIFE_ACCOUNT_TAG
_NOT_AUTH
->
{
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT
_NOT_AUTH
->
{
// 未认证
// 我要发布-招聘 其他服务-职位管理 其他服务-认证管理
return
arrayListOf
(
...
...
@@ -265,7 +239,7 @@ object ManagerCenterConfig {
data
[
2
].
functions
[
4
].
functionId
)
}
Constant
.
LIFE_ACCOUNT_TAG
_AUDIT_UNDER
->
{
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT
_AUDIT_UNDER
->
{
// 审核中
// 我要发布-招聘 其他服务-职位管理 其他服务-认证管理
return
arrayListOf
(
...
...
@@ -274,7 +248,7 @@ object ManagerCenterConfig {
data
[
2
].
functions
[
4
].
functionId
)
}
Constant
.
LIFE_ACCOUNT_TAG
_AUTH_REJECT
->
{
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT
_AUTH_REJECT
->
{
// 认证驳回
// 我要发布-招聘 其他服务-职位管理 其他服务-认证管理
return
arrayListOf
(
...
...
Components/BManagerCenter/src/main/java/com/yidian/shenghuoquan/bmanagercenter/manager/LifeAccountManager.kt
0 → 100644
View file @
789188ba
package
com.yidian.shenghuoquan.bmanagercenter.manager
import
com.yidian.shenghuoquan.bmanagercenter.constant.Constant
/**
* author: yinjiacheng
* date: 8/5/21 6:40 PM
* description: 生活号管理
*/
object
LifeAccountManager
{
/**
* 获取生活号类型 by tag
* e.g. 未认证、个人认证、个体工商户认证、普通企业认证、认证审核、认证驳回
*/
fun
getLifeAccountType
(
tagKey
:
Int
?):
LifeAccountType
{
return
when
(
tagKey
)
{
Constant
.
LIFE_ACCOUNT_TAG_COMMON_ENTERPRISE_AUTH
->
LifeAccountType
.
LIFE_ACCOUNT_COMMON_ENTERPRISE_AUTH
Constant
.
LIFE_ACCOUNT_TAG_INDIVIDUAL_BUSINESS_AUTH
->
LifeAccountType
.
LIFE_ACCOUNT_INDIVIDUAL_BUSINESS_AUTH
Constant
.
LIFE_ACCOUNT_TAG_PERSONAL_AUTH
->
LifeAccountType
.
LIFE_ACCOUNT_PERSONAL_AUTH
Constant
.
LIFE_ACCOUNT_TAG_NOT_AUTH
->
LifeAccountType
.
LIFE_ACCOUNT_NOT_AUTH
Constant
.
LIFE_ACCOUNT_TAG_AUDIT_UNDER
->
LifeAccountType
.
LIFE_ACCOUNT_AUDIT_UNDER
Constant
.
LIFE_ACCOUNT_TAG_AUTH_REJECT
->
LifeAccountType
.
LIFE_ACCOUNT_AUTH_REJECT
else
->
LifeAccountType
.
LIFE_ACCOUNT_DEFAULT
}
}
/**
* 生活号类型
* @param tagKey 唯一标识
* @param tagText 名称
*/
enum
class
LifeAccountType
(
private
val
tagKey
:
Int
,
private
val
tagText
:
String
)
{
LIFE_ACCOUNT_DEFAULT
(-
1
,
""
),
LIFE_ACCOUNT_COMMON_ENTERPRISE_AUTH
(
1
,
"普通企业"
),
LIFE_ACCOUNT_INDIVIDUAL_BUSINESS_AUTH
(
2
,
"个体工商户"
),
LIFE_ACCOUNT_PERSONAL_AUTH
(
3
,
"个人认证"
),
LIFE_ACCOUNT_NOT_AUTH
(
4
,
"未认证"
),
LIFE_ACCOUNT_AUDIT_UNDER
(
5
,
"审核中"
),
LIFE_ACCOUNT_AUTH_REJECT
(
6
,
"认证驳回"
)
}
}
Components/BManagerCenter/src/main/java/com/yidian/shenghuoquan/bmanagercenter/ui/center/MerchantAuthInfoActivity.kt
View file @
789188ba
...
...
@@ -3,12 +3,12 @@ package com.yidian.shenghuoquan.bmanagercenter.ui.center
import
android.os.Bundle
import
androidx.core.view.isVisible
import
com.orhanobut.hawk.Hawk
import
com.yidian.bcommon.base.BaseActivity
import
com.yidian.bcommon.constant.HawkConfig
import
com.yidian.bcommon.constant.XRouterPathConstants
import
com.yidian.bcommon.base.BaseActivity
import
com.yidian.shenghuoquan.bmanagercenter.constant.Constant
import
com.yidian.shenghuoquan.bmanagercenter.databinding.ActivityMerchantAuthInfoBinding
import
com.yidian.shenghuoquan.bmanagercenter.http.httpbean.GetLifeAccountInfoByIdBean
import
com.yidian.shenghuoquan.bmanagercenter.manager.LifeAccountManager
/**
* author: yinjiacheng
...
...
@@ -46,42 +46,42 @@ class MerchantAuthInfoActivity : BaseActivity<ActivityMerchantAuthInfoBinding>()
}
private
fun
initData
()
{
when
(
lifeAccountInfo
?.
id_type
)
{
Constant
.
TYPE_AUTH_PERSONAL
->
{
// 个人认证
viewBind
.
ivPersonAuthInfo
.
isVisible
=
true
viewBind
.
ivPersonAuthInfo
.
fillAuthInfo
(
lifeAccountInfo
?.
life_account_name
,
lifeAccountInfo
?.
occupation
,
lifeAccountInfo
?.
legal_person
,
lifeAccountInfo
?.
id_card
,
Hawk
.
get
(
HawkConfig
.
Mobile
)
)
}
Constant
.
TYPE_AUTH_INDIVIDUAL_BUSINESS
->
{
// 个人工商户认证
when
(
LifeAccountManager
.
getLifeAccountType
(
lifeAccountInfo
?.
tag
?.
tag_key
))
{
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_COMMON_ENTERPRISE_AUTH
->
{
// 普通企业认证
viewBind
.
ivEnterpriseAuthInfo
.
isVisible
=
true
viewBind
.
ivEnterpriseAuthInfo
.
fillAuthInfo
(
lifeAccountInfo
?.
tag
?.
tag_key
,
lifeAccountInfo
?.
id_type
,
lifeAccountInfo
?.
audit_status
,
lifeAccountInfo
?.
name
,
lifeAccountInfo
?.
code
,
lifeAccountInfo
?.
legal_person
,
lifeAccountInfo
?.
id_card
)
}
Constant
.
TYPE_AUTH_COMMON_ENTERPRISE
->
{
//
普通企业
认证
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_INDIVIDUAL_BUSINESS_AUTH
->
{
//
个人工商户
认证
viewBind
.
ivEnterpriseAuthInfo
.
isVisible
=
true
viewBind
.
ivEnterpriseAuthInfo
.
fillAuthInfo
(
lifeAccountInfo
?.
tag
?.
tag_key
,
lifeAccountInfo
?.
id_type
,
lifeAccountInfo
?.
audit_status
,
lifeAccountInfo
?.
name
,
lifeAccountInfo
?.
code
,
lifeAccountInfo
?.
legal_person
,
lifeAccountInfo
?.
id_card
)
}
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_PERSONAL_AUTH
->
{
// 个人认证
viewBind
.
ivPersonAuthInfo
.
isVisible
=
true
viewBind
.
ivPersonAuthInfo
.
fillAuthInfo
(
lifeAccountInfo
?.
life_account_name
,
lifeAccountInfo
?.
occupation
,
lifeAccountInfo
?.
legal_person
,
lifeAccountInfo
?.
id_card
,
Hawk
.
get
(
HawkConfig
.
Mobile
)
)
}
}
}
}
Components/BManagerCenter/src/main/java/com/yidian/shenghuoquan/bmanagercenter/ui/center/MerchantCenterActivity.kt
View file @
789188ba
This diff is collapsed.
Click to expand it.
Components/BManagerCenter/src/main/java/com/yidian/shenghuoquan/bmanagercenter/ui/center/MerchantInfoActivity.kt
View file @
789188ba
...
...
@@ -15,6 +15,7 @@ import com.yidian.shenghuoquan.bmanagercenter.http.callback.IAuthMerchantCheckCa
import
com.yidian.shenghuoquan.bmanagercenter.http.callback.IGetLifeAccountInfoByIdCallback
import
com.yidian.shenghuoquan.bmanagercenter.http.httpbean.AuthMerchantCheckBean
import
com.yidian.shenghuoquan.bmanagercenter.http.httpbean.GetLifeAccountInfoByIdBean
import
com.yidian.shenghuoquan.bmanagercenter.manager.LifeAccountManager
import
com.yidian.shenghuoquan.bmanagercenter.ui.auth.LifeAccountAuthActivity
import
com.yidian.shenghuoquan.bmanagercenter.ui.auth.LifeAccountEnterpriseAuthActivity
import
com.yidian.shenghuoquan.bmanagercenter.widget.MerchantInfoView
...
...
@@ -119,31 +120,28 @@ class MerchantInfoActivity : BaseActivity<ActivityMerchantInfoBinding>(), Mercha
override
fun
onEnterAuth
(
from
:
MerchantInfoView
)
{
// 认证或认证升级或修改认证
if
(
from
==
viewBind
.
ivLifeAccountAuth
)
{
if
(
lifeAccountInfo
.
life_account_type
==
Constant
.
TYPE_LIFE_ACCOUNT_PERSONAL
&&
lifeAccountInfo
.
life_account_auth_status
==
Constant
.
STATUS_AUTH_NOT
&&
lifeAccountInfo
.
audit_status
==
0
)
{
// 未认证 进入认证流程首页 此处需要传参from控制认证流程首页返回按钮显示
XPageManager
.
push
(
XRouterPathConstants
.
LIFE_ACCOUNT_AUTH
,
hashMapOf
(
IntentConstants
.
KEY_EXTRA_LIFE_ACCOUNT_AUTH_FROM
to
LifeAccountAuthActivity
.
FROM_B_MANAGER_CENTER
,
IntentConstants
.
KEY_EXTRA_LIFE_ACCOUNT_ID
to
lifeAccountInfo
.
life_account_id
when
(
LifeAccountManager
.
getLifeAccountType
(
lifeAccountInfo
.
tag
.
tag_key
))
{
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_NOT_AUTH
->
// 未认证 进入认证流程首页 此处需要传参from控制认证流程首页返回按钮显示
XPageManager
.
push
(
XRouterPathConstants
.
LIFE_ACCOUNT_AUTH
,
hashMapOf
(
IntentConstants
.
KEY_EXTRA_LIFE_ACCOUNT_AUTH_FROM
to
LifeAccountAuthActivity
.
FROM_B_MANAGER_CENTER
,
IntentConstants
.
KEY_EXTRA_LIFE_ACCOUNT_ID
to
lifeAccountInfo
.
life_account_id
)
)
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_AUTH_REJECT
->
// 认证驳回 请求企业认证信息 此处为升级认证情况 需要传入生活号id
ApiService
.
authMerchantCheck
(
this
,
hashMapOf
(
PARAMS_LIFE_ACCOUNT_ID
to
lifeAccountInfo
.
life_account_id
)
)
)
}
else
if
(
lifeAccountInfo
.
audit_status
==
Constant
.
STATUS_AUDIT_REJECT
)
{
// 认证驳回 请求企业认证信息 此处为升级认证情况 需要传入生活号id
ApiService
.
authMerchantCheck
(
this
,
hashMapOf
(
PARAMS_LIFE_ACCOUNT_ID
to
lifeAccountInfo
.
life_account_id
)
)
}
}
else
if
(
from
==
viewBind
.
ivLifeAccountAuthUpgrade
)
{
// 认证升级 请求企业认证信息 此处为升级认证情况 需要传入生活号id
ApiService
.
authMerchantCheck
(
this
,
hashMapOf
(
PARAMS_LIFE_ACCOUNT_ID
to
lifeAccountInfo
.
life_account_id
)
)
}
}
...
...
@@ -154,7 +152,7 @@ class MerchantInfoActivity : BaseActivity<ActivityMerchantInfoBinding>(), Mercha
hashMapOf
(
LifeAccountEnterpriseAuthActivity
.
EXTRA_LIFE_ACCOUNT_ID
to
lifeAccountInfo
.
life_account_id
,
LifeAccountEnterpriseAuthActivity
.
EXTRA_AUTH_DATA
to
result
,
LifeAccountEnterpriseAuthActivity
.
EXTRA_IS_AUTH_MODIFY
to
(
lifeAccountInfo
.
audit_status
==
Constant
.
STATUS_AUDIT
_REJECT
)
LifeAccountEnterpriseAuthActivity
.
EXTRA_IS_AUTH_MODIFY
to
(
LifeAccountManager
.
getLifeAccountType
(
lifeAccountInfo
.
tag
.
tag_key
)
==
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_AUTH
_REJECT
)
)
)
}
...
...
@@ -169,47 +167,51 @@ class MerchantInfoActivity : BaseActivity<ActivityMerchantInfoBinding>(), Mercha
// 更新UI
// 生活号名称
viewBind
.
ivLifeAccountName
.
fillContent
(
lifeAccountInfo
.
life_account_name
)
if
(
lifeAccountInfo
.
audit_status
!=
Constant
.
STATUS_AUDIT_UNDER
&&
lifeAccountInfo
.
role_type
!=
Constant
.
TYPE_ROLE_ORDINARY
)
{
if
(
LifeAccountManager
.
getLifeAccountType
(
lifeAccountInfo
.
tag
.
tag_key
)
!=
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_AUDIT_UNDER
&&
lifeAccountInfo
.
role_type
!=
Constant
.
TYPE_ROLE_ORDINARY
)
{
// 审核中和企业员工不允许修改生活号名称
viewBind
.
ivLifeAccountName
.
showDetailEntry
()
}
// 生活号认证信息
// 审核状态
if
(
lifeAccountInfo
.
audit_status
==
Constant
.
STATUS_AUDIT_REJECT
)
{
// 认证驳回
viewBind
.
ivLifeAccountAuth
.
fillContent
(
resources
.
getString
(
R
.
string
.
auth_reject
))
if
(
lifeAccountInfo
.
role_type
!=
Constant
.
TYPE_ROLE_ORDINARY
)
{
// 企业员工不允许修改认证信息
viewBind
.
ivLifeAccountAuth
.
showAuthEntry
(
MerchantInfoView
.
LifeAccountAuthStatus
.
MODIFY_AUTH
)
// 认证信息
when
(
LifeAccountManager
.
getLifeAccountType
(
lifeAccountInfo
.
tag
.
tag_key
))
{
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_COMMON_ENTERPRISE_AUTH
->
{
// 普通企业认证
viewBind
.
ivLifeAccountAuth
.
fillContent
(
resources
.
getString
(
R
.
string
.
common_enterprise
))
if
(
lifeAccountInfo
.
role_type
!=
Constant
.
TYPE_ROLE_ORDINARY
)
{
// 企业员工不允许查看认证信息
viewBind
.
ivLifeAccountAuth
.
showDetailEntry
()
}
}
return
}
// 认证状态
if
(
lifeAccountInfo
.
life_account_auth_status
==
Constant
.
STATUS_AUTH_NOT
&&
lifeAccountInfo
.
enterprise_auth_record_id
==
0
)
{
// 个人未认证生活号 企业审核记录id为0
viewBind
.
ivLifeAccountAuth
.
fillContent
(
resources
.
getString
(
R
.
string
.
not_auth
))
viewBind
.
ivLifeAccountAuth
.
showAuthEntry
(
MerchantInfoView
.
LifeAccountAuthStatus
.
NOT_AUTH
)
return
}
if
(
lifeAccountInfo
.
role_type
!=
Constant
.
TYPE_ROLE_ORDINARY
)
{
// 企业员工不允许查看认证信息
viewBind
.
ivLifeAccountAuth
.
showDetailEntry
()
}
// 认证类型
when
(
lifeAccountInfo
.
id_type
)
{
Constant
.
TYPE_AUTH_PERSONAL
->
{
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_INDIVIDUAL_BUSINESS_AUTH
->
{
// 个体工商户认证
viewBind
.
ivLifeAccountAuth
.
fillContent
(
resources
.
getString
(
R
.
string
.
individual_business
))
if
(
lifeAccountInfo
.
role_type
!=
Constant
.
TYPE_ROLE_ORDINARY
)
{
// 企业员工不允许查看认证信息
viewBind
.
ivLifeAccountAuth
.
showDetailEntry
()
}
}
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_PERSONAL_AUTH
->
{
// 个人认证
viewBind
.
ivLifeAccountAuth
.
fillContent
(
resources
.
getString
(
R
.
string
.
personal_auth
))
viewBind
.
ivLifeAccountAuthUpgrade
.
isVisible
=
true
viewBind
.
ivLifeAccountAuthUpgrade
.
showAuthEntry
(
MerchantInfoView
.
LifeAccountAuthStatus
.
UPGRADE_AUTH
)
}
Constant
.
TYPE_AUTH_INDIVIDUAL_BUSINESS
->
{
// 个体工商户认证
viewBind
.
ivLifeAccountAuth
.
fillContent
(
resources
.
getString
(
R
.
string
.
individual_business
))
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_NOT_AUTH
->
{
// 未认证
viewBind
.
ivLifeAccountAuth
.
fillContent
(
resources
.
getString
(
R
.
string
.
not_auth
))
viewBind
.
ivLifeAccountAuth
.
showAuthEntry
(
MerchantInfoView
.
LifeAccountAuthStatus
.
NOT_AUTH
)
}
Constant
.
TYPE_AUTH_COMMON_ENTERPRISE
->
{
// 普通企业认证
viewBind
.
ivLifeAccountAuth
.
fillContent
(
resources
.
getString
(
R
.
string
.
common_enterprise
))
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_AUDIT_UNDER
->
{
// 审核中
}
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_AUTH_REJECT
->
{
// 认证驳回
viewBind
.
ivLifeAccountAuth
.
fillContent
(
resources
.
getString
(
R
.
string
.
auth_reject
))
if
(
lifeAccountInfo
.
role_type
!=
Constant
.
TYPE_ROLE_ORDINARY
)
{
// 企业员工不允许修改认证信息
viewBind
.
ivLifeAccountAuth
.
showAuthEntry
(
MerchantInfoView
.
LifeAccountAuthStatus
.
MODIFY_AUTH
)
}
}
}
}
...
...
Components/BManagerCenter/src/main/java/com/yidian/shenghuoquan/bmanagercenter/widget/LifeAccountEnterpriseAuthInfoView.kt
View file @
789188ba
...
...
@@ -5,10 +5,11 @@ import android.util.AttributeSet
import
android.view.View
import
androidx.cardview.widget.CardView
import
androidx.core.content.ContextCompat
import
com.yidian.bcommon.utils.SensitiveInfoUtil
import
com.yidian.shenghuoquan.bmanagercenter.R
import
com.yidian.shenghuoquan.bmanagercenter.constant.Constant
import
com.yidian.shenghuoquan.bmanagercenter.databinding.ViewLifeAccountEnterpriseAuthInfoBinding
import
com.yidian.
bcommon.utils.SensitiveInfoUtil
import
com.yidian.
shenghuoquan.bmanagercenter.manager.LifeAccountManager
/**
* author: yinjiacheng
...
...
@@ -33,16 +34,16 @@ class LifeAccountEnterpriseAuthInfoView @JvmOverloads constructor(
/**
* 填充认证信息
* @param
authType 认证类型
* @param au
ditStatus 审核状态
* @param
tagKey 生活号tag
* @param au
thType 认证类型 e.g. 个体工商户、普通企业
* @param registrationName 公司名称
* @param registrationCode 统一社会信用代码
* @param realName 经营者姓名或法人姓名
* @param idCardNo 经营者身份证号或法人身份证号
*/
fun
fillAuthInfo
(
tagKey
:
Int
?,
authType
:
Int
?,
auditStatus
:
Int
?,
registrationName
:
String
?,
registrationCode
:
String
?,
realName
:
String
?,
...
...
@@ -69,14 +70,14 @@ class LifeAccountEnterpriseAuthInfoView @JvmOverloads constructor(
viewBinding
.
tvTitleManagerInfo
.
text
=
resources
.
getText
(
R
.
string
.
legal_person_info
)
}
else
->
{
//
不区分
//
企业认证提交后
viewBinding
.
tvAuthType
.
text
=
resources
.
getText
(
R
.
string
.
enterprise_auth
)
viewBinding
.
tvTitleManagerInfo
.
text
=
resources
.
getText
(
R
.
string
.
operator_information
)
}
}
when
(
auditStatus
)
{
Constant
.
STATUS
_AUDIT_UNDER
->
{
when
(
LifeAccountManager
.
getLifeAccountType
(
tagKey
)
)
{
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT
_AUDIT_UNDER
->
{
// 审核中
viewBinding
.
tvAuditStatus
.
text
=
resources
.
getText
(
R
.
string
.
under_audit
)
viewBinding
.
tvAuditStatus
.
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_audit
)
...
...
@@ -87,8 +88,8 @@ class LifeAccountEnterpriseAuthInfoView @JvmOverloads constructor(
)
)
}
Constant
.
STATUS_AUDIT_PASS
->
{
//
审核通过(已开通)
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_COMMON_ENTERPRISE_AUTH
,
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_INDIVIDUAL_BUSINESS_AUTH
->
{
//
个体工商户、普通企业
viewBinding
.
tvAuditStatus
.
text
=
resources
.
getText
(
R
.
string
.
audit_pass
)
viewBinding
.
tvAuditStatus
.
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_open
)
viewBinding
.
tvAuditStatus
.
setTextColor
(
...
...
@@ -98,7 +99,7 @@ class LifeAccountEnterpriseAuthInfoView @JvmOverloads constructor(
)
)
}
Constant
.
STATUS_AUDIT
_REJECT
->
{
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_AUTH
_REJECT
->
{
// 审核驳回
viewBinding
.
tvAuditStatus
.
text
=
resources
.
getText
(
R
.
string
.
audit_reject
)
viewBinding
.
tvAuditStatus
.
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_reject
)
...
...
Components/BManagerCenter/src/main/java/com/yidian/shenghuoquan/bmanagercenter/widget/LifeAccountLabelView.kt
View file @
789188ba
...
...
@@ -5,10 +5,10 @@ import android.util.AttributeSet
import
android.view.View
import
androidx.constraintlayout.widget.ConstraintLayout
import
androidx.core.content.ContextCompat
import
com.yidian.bcommon.bean.LifeAccountItemBean
import
com.yidian.shenghuoquan.bmanagercenter.R
import
com.yidian.shenghuoquan.bmanagercenter.constant.Constant
import
com.yidian.shenghuoquan.bmanagercenter.databinding.ViewLifeAccountLabelBinding
import
com.yidian.
bcommon.bean.LifeAccountItemBean
import
com.yidian.
shenghuoquan.bmanagercenter.manager.LifeAccountManager
/**
* author: yinjiacheng
...
...
@@ -42,44 +42,37 @@ class LifeAccountLabelView @JvmOverloads constructor(
/**
* 设置生活号信息
* 先判断认证状态 再判断审核状态 即审核中和审核驳回状态可覆盖认证状态
* @param data 生活号详情
*/
fun
setLifeAccountData
(
data
:
LifeAccountItemBean
.
Response
)
{
curLifeAccount
=
data
viewBinding
.
tvLifeAccountName
.
text
=
data
.
life_account_name
viewBinding
.
tvLifeAccountStatus
.
apply
{
when
(
data
.
life_account_auth_status
)
{
Constant
.
STATUS_AUTH_NOT
->
{
text
=
data
.
tag
.
tag_text
when
(
LifeAccountManager
.
getLifeAccountType
(
data
.
tag
.
tag_key
))
{
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_COMMON_ENTERPRISE_AUTH
,
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_INDIVIDUAL_BUSINESS_AUTH
,
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_PERSONAL_AUTH
->
{
// 个体工商户、普通企业、个人
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_auth
)
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_FF1852F1
))
}
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_NOT_AUTH
->
{
// 未认证
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_unauth
)
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_333333
))
text
=
resources
.
getString
(
R
.
string
.
not_auth
)
}
Constant
.
STATUS_AUTH_FINISH
->
{
// 已认证
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_auth
)
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_FF1852F1
))
text
=
when
(
data
.
tag
.
tag_key
)
{
Constant
.
LIFE_ACCOUNT_TAG_COMMON_ENTERPRISE_AUTH
->
resources
.
getString
(
R
.
string
.
common_enterprise
)
Constant
.
LIFE_ACCOUNT_TAG_INDIVIDUAL_BUSINESS_AUTH
->
resources
.
getString
(
R
.
string
.
individual_business
)
Constant
.
LIFE_ACCOUNT_TAG_PERSONAL_AUTH
->
resources
.
getString
(
R
.
string
.
personal_auth
)
else
->
""
}
}
}
when
(
data
.
enterprise_audit_status
)
{
Constant
.
STATUS_AUDIT_UNDER
->
{
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_AUDIT_UNDER
->
{
// 审核中
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_audit
)
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_FFF26E3D
))
text
=
resources
.
getString
(
R
.
string
.
under_audit
)
}
Constant
.
STATUS_AUDIT
_REJECT
->
{
LifeAccountManager
.
LifeAccountType
.
LIFE_ACCOUNT_AUTH
_REJECT
->
{
// 审核驳回
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_reject
)
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_FFFF3A3A
))
text
=
resources
.
getString
(
R
.
string
.
auth_reject
)
}
else
->
{
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_auth
)
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_FF1852F1
))
}
}
}
...
...
Components/BManagerCenter/src/main/res/layout/view_life_account_label.xml
View file @
789188ba
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
xmlns:android=
"http://schemas.android.com/apk/res/android"
xmlns:app=
"http://schemas.android.com/apk/res-auto"
xmlns:tools=
"http://schemas.android.com/tools"
android:layout_width=
"match_parent"
android:layout_height=
"wrap_content"
android:paddingStart=
"@dimen/dp19"
...
...
@@ -21,7 +22,8 @@
android:textStyle=
"bold"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toStartOf=
"parent"
app:layout_constraintTop_toTopOf=
"parent"
/>
app:layout_constraintTop_toTopOf=
"parent"
tools:text=
"生活号名称"
/>
<TextView
android:id=
"@+id/tv_life_account_status"
...
...
@@ -39,7 +41,10 @@
android:textSize=
"@dimen/sp12"
app:layout_constraintBottom_toBottomOf=
"parent"
app:layout_constraintStart_toEndOf=
"@id/tv_life_account_name"
app:layout_constraintTop_toTopOf=
"parent"
/>
app:layout_constraintTop_toTopOf=
"parent"
tools:background=
"@drawable/shape_life_account_status_auth"
tools:text=
"个体工商户"
tools:textColor=
"@color/color_1852F1"
/>
<ImageView
android:id=
"@+id/iv_life_account_detail"
...
...
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