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
bd4de1d4
Commit
bd4de1d4
authored
Jun 13, 2021
by
yinjiacheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 生活号基本信息页
parent
50692b84
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
99 additions
and
30 deletions
+99
-30
Constant.kt
.../com/yidian/shenghuoquan/newscontent/constant/Constant.kt
+5
-1
MerchantCenterActivity.kt
...nghuoquan/newscontent/ui/center/MerchantCenterActivity.kt
+1
-6
MerchantInfoActivity.kt
...henghuoquan/newscontent/ui/center/MerchantInfoActivity.kt
+71
-12
LifeAccountLabelView.kt
...n/shenghuoquan/newscontent/widget/LifeAccountLabelView.kt
+21
-10
MerchantInfoView.kt
...idian/shenghuoquan/newscontent/widget/MerchantInfoView.kt
+1
-1
No files found.
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/constant/Constant.kt
View file @
bd4de1d4
...
@@ -18,7 +18,11 @@ object Constant {
...
@@ -18,7 +18,11 @@ object Constant {
// 认证状态
// 认证状态
const
val
STATUS_AUTH_NOT
=
1
// 未认证
const
val
STATUS_AUTH_NOT
=
1
// 未认证
const
val
STATUS_AUTH_FINISH
=
2
// 已认证
const
val
STATUS_AUTH_FINISH
=
2
// 已认证
const
val
STATUS_AUTH_REJECT
=
3
// 认证驳回
// 审核状态
const
val
STATUS_AUDIT_UNDER
=
10
// 审核中
const
val
STATUS_AUDIT_PASS
=
20
// 审核通过
const
val
STATUS_AUDIT_REJECT
=
30
// 审核失败
// 商户类型
// 商户类型
const
val
ITEM_INDIVIDUAL_BUSINESSES
=
"个体工商户"
const
val
ITEM_INDIVIDUAL_BUSINESSES
=
"个体工商户"
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/center/MerchantCenterActivity.kt
View file @
bd4de1d4
...
@@ -69,12 +69,7 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(),
...
@@ -69,12 +69,7 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(),
curLifeAccount
=
curLifeAccount
=
params
[
EXTRA_LIFE_ACCOUNT_INFO
]
?.
let
{
it
as
LifeAccountItemBean
.
Response
}
?:
return
params
[
EXTRA_LIFE_ACCOUNT_INFO
]
?.
let
{
it
as
LifeAccountItemBean
.
Response
}
?:
return
// 设置当前生活号信息
// 设置当前生活号信息
viewBind
.
lvLifeAccountLabel
.
setLifeAccountData
(
viewBind
.
lvLifeAccountLabel
.
setLifeAccountData
(
curLifeAccount
)
curLifeAccount
.
life_account_name
,
curLifeAccount
.
life_account_auth_status
,
curLifeAccount
.
life_account_type
,
curLifeAccount
.
enterprise_audit_status
)
// 请求功能入口配置清单
// 请求功能入口配置清单
ApiService
.
getConfigList
(
this
)
ApiService
.
getConfigList
(
this
)
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/center/MerchantInfoActivity.kt
View file @
bd4de1d4
...
@@ -8,8 +8,13 @@ import com.yidian.common.base.BaseActivity
...
@@ -8,8 +8,13 @@ import com.yidian.common.base.BaseActivity
import
com.yidian.shenghuoquan.newscontent.R
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.ActivityMerchantInfoBinding
import
com.yidian.shenghuoquan.newscontent.databinding.ActivityMerchantInfoBinding
import
com.yidian.shenghuoquan.newscontent.http.ApiService
import
com.yidian.shenghuoquan.newscontent.http.callback.IAuthMerchantCheckCallback
import
com.yidian.shenghuoquan.newscontent.http.httpbean.AuthMerchantCheckBean
import
com.yidian.shenghuoquan.newscontent.http.httpbean.LifeAccountItemBean
import
com.yidian.shenghuoquan.newscontent.http.httpbean.LifeAccountItemBean
import
com.yidian.shenghuoquan.newscontent.ui.auth.LifeAccountEnterpriseAuthActivity
import
com.yidian.shenghuoquan.newscontent.widget.MerchantInfoView
import
com.yidian.shenghuoquan.newscontent.widget.MerchantInfoView
import
com.yidian.xpage.XPageManager
/**
/**
* author: yinjiacheng
* author: yinjiacheng
...
@@ -17,10 +22,22 @@ import com.yidian.shenghuoquan.newscontent.widget.MerchantInfoView
...
@@ -17,10 +22,22 @@ import com.yidian.shenghuoquan.newscontent.widget.MerchantInfoView
* description: 商户基本信息
* description: 商户基本信息
*/
*/
class
MerchantInfoActivity
:
BaseActivity
<
ActivityMerchantInfoBinding
>(),
View
.
OnClickListener
,
class
MerchantInfoActivity
:
BaseActivity
<
ActivityMerchantInfoBinding
>(),
View
.
OnClickListener
,
MerchantInfoView
.
OnMerchantInfoViewListener
{
MerchantInfoView
.
OnMerchantInfoViewListener
,
IAuthMerchantCheckCallback
{
companion
object
{
companion
object
{
const
val
EXTRA_LIFE_ACCOUNT_INFO
=
"lifeAccountInfo"
const
val
EXTRA_LIFE_ACCOUNT_INFO
=
"lifeAccountInfo"
const
val
PARAMS_LIFE_ACCOUNT_ID
=
"life_account_id"
}
/**
* 当前生活号信息
*/
private
val
lifeAccountInfo
by
lazy
{
intent
.
getSerializableExtra
(
XRouterPathConstants
.
ParamsKey
)
?.
let
{
params
->
(
params
as
HashMap
<*,
*>)[
EXTRA_LIFE_ACCOUNT_INFO
]
?.
let
{
it
as
LifeAccountItemBean
.
Response
}
}
}
}
override
fun
createViewBinding
():
ActivityMerchantInfoBinding
{
override
fun
createViewBinding
():
ActivityMerchantInfoBinding
{
...
@@ -47,16 +64,16 @@ class MerchantInfoActivity : BaseActivity<ActivityMerchantInfoBinding>(), View.O
...
@@ -47,16 +64,16 @@ class MerchantInfoActivity : BaseActivity<ActivityMerchantInfoBinding>(), View.O
}
}
private
fun
initData
()
{
private
fun
initData
()
{
val
lifeAccountInfo
=
intent
.
getSerializableExtra
(
XRouterPathConstants
.
ParamsKey
)
?.
let
{
params
->
(
params
as
HashMap
<*,
*>)[
EXTRA_LIFE_ACCOUNT_INFO
]
?.
let
{
it
as
LifeAccountItemBean
.
Response
}
}
// 生活号名称
// 生活号名称
viewBind
.
ivLifeAccountName
.
fillContent
(
lifeAccountInfo
?.
life_account_name
)
viewBind
.
ivLifeAccountName
.
fillContent
(
lifeAccountInfo
?.
life_account_name
)
viewBind
.
ivLifeAccountName
.
showDetailEntry
()
viewBind
.
ivLifeAccountName
.
showDetailEntry
()
// 生活号认证信息
// 生活号认证信息
if
(
lifeAccountInfo
?.
enterprise_audit_status
==
Constant
.
STATUS_AUDIT_REJECT
)
{
// 认证驳回
viewBind
.
ivLifeAccountAuth
.
fillContent
(
resources
.
getString
(
R
.
string
.
auth_reject
))
viewBind
.
ivLifeAccountAuth
.
showAuthEntry
(
MerchantInfoView
.
LifeAccountAuthStatus
.
MODIFY_AUTH
)
return
}
when
(
lifeAccountInfo
?.
life_account_auth_status
)
{
when
(
lifeAccountInfo
?.
life_account_auth_status
)
{
Constant
.
STATUS_AUTH_NOT
->
{
Constant
.
STATUS_AUTH_NOT
->
{
// 未认证
// 未认证
...
@@ -65,7 +82,7 @@ class MerchantInfoActivity : BaseActivity<ActivityMerchantInfoBinding>(), View.O
...
@@ -65,7 +82,7 @@ class MerchantInfoActivity : BaseActivity<ActivityMerchantInfoBinding>(), View.O
}
}
Constant
.
STATUS_AUTH_FINISH
->
{
Constant
.
STATUS_AUTH_FINISH
->
{
// 已认证 判断认证类型
// 已认证 判断认证类型
when
(
lifeAccountInfo
.
life_account_type
)
{
when
(
lifeAccountInfo
?
.
life_account_type
)
{
Constant
.
TYPE_AUTH_PERSONAL
->
{
Constant
.
TYPE_AUTH_PERSONAL
->
{
// 个人认证
// 个人认证
viewBind
.
ivLifeAccountAuth
.
fillContent
(
resources
.
getString
(
R
.
string
.
personal_auth
))
viewBind
.
ivLifeAccountAuth
.
fillContent
(
resources
.
getString
(
R
.
string
.
personal_auth
))
...
@@ -85,9 +102,6 @@ class MerchantInfoActivity : BaseActivity<ActivityMerchantInfoBinding>(), View.O
...
@@ -85,9 +102,6 @@ class MerchantInfoActivity : BaseActivity<ActivityMerchantInfoBinding>(), View.O
}
}
}
}
}
}
Constant
.
STATUS_AUTH_REJECT
->
{
// 认证驳回
}
}
}
}
}
...
@@ -98,10 +112,55 @@ class MerchantInfoActivity : BaseActivity<ActivityMerchantInfoBinding>(), View.O
...
@@ -98,10 +112,55 @@ class MerchantInfoActivity : BaseActivity<ActivityMerchantInfoBinding>(), View.O
}
}
override
fun
onEnterDetail
(
from
:
MerchantInfoView
)
{
override
fun
onEnterDetail
(
from
:
MerchantInfoView
)
{
// 进入生活号名称修改页或认证信息详情
}
}
override
fun
onEnterAuth
(
from
:
MerchantInfoView
)
{
override
fun
onEnterAuth
(
from
:
MerchantInfoView
)
{
// 认证或认证升级或修改认证
if
(
from
==
viewBind
.
ivLifeAccountAuth
)
{
if
(
lifeAccountInfo
?.
life_account_auth_status
==
Constant
.
STATUS_AUTH_NOT
)
{
// 未认证 进入认证流程首页
XPageManager
.
push
(
XRouterPathConstants
.
LIFE_ACCOUNT_AUTH
,
null
)
}
else
if
(
lifeAccountInfo
?.
enterprise_audit_status
==
Constant
.
STATUS_AUDIT_REJECT
)
{
// 认证驳回 请求企业认证信息 此处为升级认证情况 需要传入生活号id
ApiService
.
authMerchantCheck
(
this
,
hashMapOf
(
Pair
(
PARAMS_LIFE_ACCOUNT_ID
,
lifeAccountInfo
?.
life_account_id
.
toString
()
)
)
)
}
}
else
if
(
from
==
viewBind
.
ivLifeAccountAuthUpgrade
)
{
// 认证升级 请求企业认证信息 此处为升级认证情况 需要传入生活号id
ApiService
.
authMerchantCheck
(
this
,
hashMapOf
(
Pair
(
PARAMS_LIFE_ACCOUNT_ID
,
lifeAccountInfo
?.
life_account_id
.
toString
()
)
)
)
}
}
override
fun
authMerchantCheckSuccess
(
result
:
AuthMerchantCheckBean
.
Response
?)
{
// 跳转企业认证流程
XPageManager
.
push
(
XRouterPathConstants
.
LIFE_ACCOUNT_ENTERPRISE_AUTH
,
hashMapOf
(
Pair
(
LifeAccountEnterpriseAuthActivity
.
EXTRA_LIFE_ACCOUNT_ID
,
lifeAccountInfo
?.
life_account_id
),
Pair
(
LifeAccountEnterpriseAuthActivity
.
EXTRA_AUTH_DATA
,
result
)
)
)
}
override
fun
authMerchantCheckFailure
(
message
:
String
?)
{
}
}
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/widget/LifeAccountLabelView.kt
View file @
bd4de1d4
...
@@ -5,8 +5,12 @@ import android.util.AttributeSet
...
@@ -5,8 +5,12 @@ import android.util.AttributeSet
import
android.view.View
import
android.view.View
import
androidx.constraintlayout.widget.ConstraintLayout
import
androidx.constraintlayout.widget.ConstraintLayout
import
androidx.core.content.ContextCompat
import
androidx.core.content.ContextCompat
import
com.yidian.common.XRouterPathConstants
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.databinding.ViewLifeAccountLabelBinding
import
com.yidian.shenghuoquan.newscontent.databinding.ViewLifeAccountLabelBinding
import
com.yidian.shenghuoquan.newscontent.http.httpbean.LifeAccountItemBean
import
com.yidian.shenghuoquan.newscontent.ui.center.MerchantInfoActivity
import
com.yidian.xpage.XPageManager
/**
/**
* author: yinjiacheng
* author: yinjiacheng
...
@@ -50,6 +54,11 @@ class LifeAccountLabelView @JvmOverloads constructor(
...
@@ -50,6 +54,11 @@ class LifeAccountLabelView @JvmOverloads constructor(
)
)
)
)
/**
* 当前显示的生活号
*/
private
lateinit
var
curLifeAccount
:
LifeAccountItemBean
.
Response
init
{
init
{
viewBinding
.
ivLifeAccountDetail
.
setOnClickListener
(
this
)
viewBinding
.
ivLifeAccountDetail
.
setOnClickListener
(
this
)
}
}
...
@@ -57,15 +66,13 @@ class LifeAccountLabelView @JvmOverloads constructor(
...
@@ -57,15 +66,13 @@ class LifeAccountLabelView @JvmOverloads constructor(
/**
/**
* 设置生活号信息
* 设置生活号信息
* 先判断认证状态 再判断审核状态 即审核中和审核驳回状态可覆盖认证状态
* 先判断认证状态 再判断审核状态 即审核中和审核驳回状态可覆盖认证状态
* @param name 生活号名称
* @param data 生活号详情
* @param status 生活号认证状态
* @param type 生活号类型
* @param audit 生活号审核状态
*/
*/
fun
setLifeAccountData
(
name
:
String
?,
status
:
Int
?,
type
:
Int
?,
audit
:
Int
?)
{
fun
setLifeAccountData
(
data
:
LifeAccountItemBean
.
Response
)
{
viewBinding
.
tvLifeAccountName
.
text
=
name
curLifeAccount
=
data
viewBinding
.
tvLifeAccountName
.
text
=
data
.
life_account_name
viewBinding
.
tvLifeAccountStatus
.
apply
{
viewBinding
.
tvLifeAccountStatus
.
apply
{
when
(
status
)
{
when
(
data
.
life_account_
status
)
{
STATUS_LIFE_ACCOUNT_NOT_AUTH
->
{
STATUS_LIFE_ACCOUNT_NOT_AUTH
->
{
// 未认证
// 未认证
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_unauth
)
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_unauth
)
...
@@ -76,7 +83,7 @@ class LifeAccountLabelView @JvmOverloads constructor(
...
@@ -76,7 +83,7 @@ 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
(
type
)
{
text
=
when
(
data
.
life_account_
type
)
{
TYPE_LIFE_ACCOUNT_INDIVIDUAL_BUSINESS
->
resources
.
getString
(
R
.
string
.
individual_business
)
TYPE_LIFE_ACCOUNT_INDIVIDUAL_BUSINESS
->
resources
.
getString
(
R
.
string
.
individual_business
)
TYPE_LIFE_ACCOUNT_COMMON_ENTERPRISE
->
resources
.
getString
(
R
.
string
.
common_enterprise
)
TYPE_LIFE_ACCOUNT_COMMON_ENTERPRISE
->
resources
.
getString
(
R
.
string
.
common_enterprise
)
TYPE_LIFE_ACCOUNT_PERSONAL
->
resources
.
getString
(
R
.
string
.
personal_auth
)
TYPE_LIFE_ACCOUNT_PERSONAL
->
resources
.
getString
(
R
.
string
.
personal_auth
)
...
@@ -84,7 +91,7 @@ class LifeAccountLabelView @JvmOverloads constructor(
...
@@ -84,7 +91,7 @@ class LifeAccountLabelView @JvmOverloads constructor(
}
}
}
}
}
}
when
(
audit
)
{
when
(
data
.
enterprise_audit_status
)
{
STATUS_LIFE_ACCOUNT_AUDIT
->
{
STATUS_LIFE_ACCOUNT_AUDIT
->
{
// 审核中
// 审核中
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_audit
)
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_audit
)
...
@@ -103,7 +110,11 @@ class LifeAccountLabelView @JvmOverloads constructor(
...
@@ -103,7 +110,11 @@ class LifeAccountLabelView @JvmOverloads constructor(
override
fun
onClick
(
v
:
View
?)
{
override
fun
onClick
(
v
:
View
?)
{
if
(
v
?.
id
==
R
.
id
.
iv_life_account_detail
)
{
if
(
v
?.
id
==
R
.
id
.
iv_life_account_detail
)
{
// TODO: 6/8/21 跳转生活号基本信息
// 跳转生活号基本信息
XPageManager
.
push
(
XRouterPathConstants
.
MERCHANT_INFO
,
hashMapOf
(
Pair
(
MerchantInfoActivity
.
EXTRA_LIFE_ACCOUNT_INFO
,
curLifeAccount
))
)
}
}
}
}
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/widget/MerchantInfoView.kt
View file @
bd4de1d4
...
@@ -63,7 +63,7 @@ class MerchantInfoView @JvmOverloads constructor(
...
@@ -63,7 +63,7 @@ class MerchantInfoView @JvmOverloads constructor(
viewBinding
.
tvAuth
.
setBackgroundResource
(
R
.
drawable
.
shape_bg_common_btn
)
viewBinding
.
tvAuth
.
setBackgroundResource
(
R
.
drawable
.
shape_bg_common_btn
)
}
}
LifeAccountAuthStatus
.
MODIFY_AUTH
->
{
LifeAccountAuthStatus
.
MODIFY_AUTH
->
{
viewBinding
.
tvAuth
.
text
=
resources
.
getText
(
R
.
string
.
upgrade_enterprise_merchant
)
viewBinding
.
tvAuth
.
text
=
resources
.
getText
(
R
.
string
.
modify_auth
)
viewBinding
.
tvAuth
.
setBackgroundResource
(
R
.
drawable
.
shape_bg_modify_auth_btn
)
viewBinding
.
tvAuth
.
setBackgroundResource
(
R
.
drawable
.
shape_bg_modify_auth_btn
)
}
}
}
}
...
...
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