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
6f73ad44
Commit
6f73ad44
authored
Jun 23, 2021
by
yinjiacheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix SHQBD-237 生活号标签具体区分普通企业和个体工商户
parent
bc88061e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
70 additions
and
69 deletions
+70
-69
MerchantSwitchAdapter.kt
...shenghuoquan/newscontent/adapter/MerchantSwitchAdapter.kt
+66
-65
MerchantCenterActivity.kt
...nghuoquan/newscontent/ui/center/MerchantCenterActivity.kt
+0
-1
LifeAccountLabelView.kt
...n/shenghuoquan/newscontent/widget/LifeAccountLabelView.kt
+4
-3
No files found.
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/adapter/MerchantSwitchAdapter.kt
View file @
6f73ad44
...
@@ -17,79 +17,80 @@ import com.yidian.shenghuoquan.newscontent.http.httpbean.LifeAccountItemBean
...
@@ -17,79 +17,80 @@ import com.yidian.shenghuoquan.newscontent.http.httpbean.LifeAccountItemBean
* description: 商户切换主体
* description: 商户切换主体
*/
*/
class
MerchantSwitchAdapter
(
class
MerchantSwitchAdapter
(
private
val
curLifeAccountId
:
String
,
private
val
curLifeAccountId
:
String
,
data
:
List
<
LifeAccountItemBean
.
Response
>?
=
null
,
data
:
List
<
LifeAccountItemBean
.
Response
>?
=
null
,
val
listener
:
OnItemClickListener
?
=
null
val
listener
:
OnItemClickListener
?
=
null
)
:
)
:
RecyclerView
.
Adapter
<
MerchantSwitchAdapter
.
MerchantSwitchViewHolder
>()
{
RecyclerView
.
Adapter
<
MerchantSwitchAdapter
.
MerchantSwitchViewHolder
>()
{
private
val
data
by
lazy
{
private
val
data
by
lazy
{
data
?.
let
{
data
?.
let
{
ArrayList
<
LifeAccountItemBean
.
Response
>(
it
)
ArrayList
<
LifeAccountItemBean
.
Response
>(
it
)
}
?:
ArrayList
()
}
?:
ArrayList
()
}
}
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
MerchantSwitchViewHolder
{
override
fun
onCreateViewHolder
(
parent
:
ViewGroup
,
viewType
:
Int
):
MerchantSwitchViewHolder
{
val
viewBinding
=
ItemMerchantSwitchBinding
.
bind
(
val
viewBinding
=
ItemMerchantSwitchBinding
.
bind
(
LayoutInflater
.
from
(
parent
.
context
)
LayoutInflater
.
from
(
parent
.
context
)
.
inflate
(
R
.
layout
.
item_merchant_switch
,
parent
,
false
)
.
inflate
(
R
.
layout
.
item_merchant_switch
,
parent
,
false
)
)
)
return
MerchantSwitchViewHolder
(
viewBinding
.
root
,
viewBinding
)
return
MerchantSwitchViewHolder
(
viewBinding
.
root
,
viewBinding
)
}
}
override
fun
onBindViewHolder
(
holder
:
MerchantSwitchViewHolder
,
position
:
Int
)
{
override
fun
onBindViewHolder
(
holder
:
MerchantSwitchViewHolder
,
position
:
Int
)
{
val
data
=
data
[
position
]
as
LifeAccountItemBean
.
Response
val
data
=
data
[
position
]
as
LifeAccountItemBean
.
Response
holder
.
viewBinding
.
tvLifeAccountName
.
text
=
data
.
life_account_name
holder
.
viewBinding
.
tvLifeAccountName
.
text
=
data
.
life_account_name
holder
.
viewBinding
.
tvLifeAccountStatus
.
apply
{
holder
.
viewBinding
.
tvLifeAccountStatus
.
apply
{
when
(
data
.
life_account_auth_status
)
{
when
(
data
.
life_account_auth_status
)
{
Constant
.
STATUS_AUTH_NOT
->
{
Constant
.
STATUS_AUTH_NOT
->
{
// 未认证
// 未认证
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_unauth
)
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_unauth
)
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_333333
))
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_333333
))
text
=
resources
.
getString
(
R
.
string
.
not_auth
)
text
=
resources
.
getString
(
R
.
string
.
not_auth
)
}
}
Constant
.
STATUS_AUTH_FINISH
->
{
Constant
.
STATUS_AUTH_FINISH
->
{
// 已认证
// 已认证
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_auth
)
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_auth
)
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_FF1852F1
))
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_FF1852F1
))
text
=
when
(
data
.
life_account_type
)
{
text
=
when
(
data
.
tag
.
tag_key
)
{
Constant
.
TYPE_LIFE_ACCOUNT_PERSONAL
->
resources
.
getString
(
R
.
string
.
personal_auth
)
Constant
.
LIFE_ACCOUNT_TAG_COMMON_ENTERPRISE_AUTH
->
resources
.
getString
(
R
.
string
.
common_enterprise
)
Constant
.
TYPE_LIFE_ACCOUNT_ENTERPRISE
->
resources
.
getString
(
R
.
string
.
enterprise_auth
)
Constant
.
LIFE_ACCOUNT_TAG_INDIVIDUAL_BUSINESS_AUTH
->
resources
.
getString
(
R
.
string
.
individual_business
)
else
->
""
Constant
.
LIFE_ACCOUNT_TAG_PERSONAL_AUTH
->
resources
.
getString
(
R
.
string
.
personal_auth
)
}
else
->
""
}
}
}
}
when
(
data
.
enterprise_audit_status
)
{
}
Constant
.
STATUS_AUDIT_UNDER
->
{
when
(
data
.
enterprise_audit_status
)
{
// 审核中
Constant
.
STATUS_AUDIT_UNDER
->
{
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_audit
)
// 审核中
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_FFF26E3D
))
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_audit
)
text
=
resources
.
getString
(
R
.
string
.
under_audit
)
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_FFF26E3D
))
}
text
=
resources
.
getString
(
R
.
string
.
under_audit
)
Constant
.
STATUS_AUDIT_REJECT
->
{
// 审核驳回
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_reject
)
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_FFFF3A3A
))
text
=
resources
.
getString
(
R
.
string
.
auth_reject
)
}
}
}
}
// 当前选中的生活号
Constant
.
STATUS_AUDIT_REJECT
->
{
holder
.
viewBinding
.
ivLifeAccountSelect
.
isVisible
=
data
.
life_account_id
==
curLifeAccountId
// 审核驳回
holder
.
viewBinding
.
root
.
setOnClickListener
{
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_reject
)
listener
?.
onItemClick
(
it
,
position
,
data
)
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_FFFF3A3A
))
text
=
resources
.
getString
(
R
.
string
.
auth_reject
)
}
}
}
}
}
// 当前选中的生活号
override
fun
getItemCount
():
Int
{
holder
.
viewBinding
.
ivLifeAccountSelect
.
isVisible
=
data
.
life_account_id
==
curLifeAccountId
return
data
.
size
holder
.
viewBinding
.
root
.
setOnClickListener
{
listener
?.
onItemClick
(
it
,
position
,
data
)
}
}
}
interface
OnItemClickListener
{
override
fun
getItemCount
():
Int
{
fun
onItemClick
(
view
:
View
,
position
:
Int
,
data
:
LifeAccountItemBean
.
Response
)
return
data
.
size
}
}
interface
OnItemClickListener
{
fun
onItemClick
(
view
:
View
,
position
:
Int
,
data
:
LifeAccountItemBean
.
Response
)
}
class
MerchantSwitchViewHolder
(
itemView
:
View
,
val
viewBinding
:
ItemMerchantSwitchBinding
)
:
class
MerchantSwitchViewHolder
(
itemView
:
View
,
val
viewBinding
:
ItemMerchantSwitchBinding
)
:
RecyclerView
.
ViewHolder
(
itemView
)
RecyclerView
.
ViewHolder
(
itemView
)
}
}
\ No newline at end of file
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/center/MerchantCenterActivity.kt
View file @
6f73ad44
...
@@ -194,7 +194,6 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(),
...
@@ -194,7 +194,6 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(),
/**
/**
* 对应生活号权限下的功能集
* 对应生活号权限下的功能集
* @param tagKey 生活号认证类型/状态
* todo 优化逻辑
* todo 优化逻辑
*/
*/
private
fun
generateFunctionPermissionMap
(
data
:
List
<
GetConfigListBean
.
Item
>)
{
private
fun
generateFunctionPermissionMap
(
data
:
List
<
GetConfigListBean
.
Item
>)
{
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/widget/LifeAccountLabelView.kt
View file @
6f73ad44
...
@@ -60,9 +60,10 @@ class LifeAccountLabelView @JvmOverloads constructor(
...
@@ -60,9 +60,10 @@ class LifeAccountLabelView @JvmOverloads constructor(
// 已认证
// 已认证
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_auth
)
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_auth
)
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_FF1852F1
))
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_FF1852F1
))
text
=
when
(
data
.
life_account_type
)
{
text
=
when
(
data
.
tag
.
tag_key
)
{
Constant
.
TYPE_LIFE_ACCOUNT_PERSONAL
->
resources
.
getString
(
R
.
string
.
personal_auth
)
Constant
.
LIFE_ACCOUNT_TAG_COMMON_ENTERPRISE_AUTH
->
resources
.
getString
(
R
.
string
.
common_enterprise
)
Constant
.
TYPE_LIFE_ACCOUNT_ENTERPRISE
->
resources
.
getString
(
R
.
string
.
enterprise_auth
)
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
->
""
else
->
""
}
}
}
}
...
...
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