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
30d229d2
Commit
30d229d2
authored
Jul 29, 2021
by
yinjiacheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 跳转生活号基本信息页改为页内请求
parent
8813a0a8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
85 additions
and
110 deletions
+85
-110
MerchantCenterActivity.kt
...uoquan/bmanagercenter/ui/center/MerchantCenterActivity.kt
+4
-21
MerchantInfoActivity.kt
...ghuoquan/bmanagercenter/ui/center/MerchantInfoActivity.kt
+81
-89
No files found.
Components/BManagerCenter/src/main/java/com/yidian/shenghuoquan/bmanagercenter/ui/center/MerchantCenterActivity.kt
View file @
30d229d2
...
...
@@ -30,7 +30,6 @@ import com.yidian.shenghuoquan.bmanagercenter.databinding.ActivityMerchantCenter
import
com.yidian.shenghuoquan.bmanagercenter.http.ApiService
import
com.yidian.shenghuoquan.bmanagercenter.http.callback.*
import
com.yidian.shenghuoquan.bmanagercenter.http.httpbean.AuthMerchantCheckBean
import
com.yidian.shenghuoquan.bmanagercenter.http.httpbean.GetLifeAccountInfoByIdBean
import
com.yidian.shenghuoquan.bmanagercenter.ui.auth.LifeAccountAuthActivity
import
com.yidian.shenghuoquan.bmanagercenter.ui.auth.LifeAccountEnterpriseAuthActivity
import
com.yidian.shenghuoquan.bmanagercenter.ui.dialog.MerchantCenterBottomHintDialog
...
...
@@ -51,10 +50,9 @@ import org.greenrobot.eventbus.ThreadMode
* description: 商户管理中心
*/
class
MerchantCenterActivity
:
BaseActivity
<
ActivityMerchantCenterBinding
>(),
MerchantSwitchDialog
.
OnMerchantSwitchCallback
,
LifeAccountLabelView
.
OnLifeAccountLabelCallback
,
IGetLifeAccountInfoByIdCallback
,
MerchantCenterBottomHintDialog
.
OnMerchantCenterBottomHintCallback
,
IAuthMerchantCheckCallback
,
MerchantServiceFunctionAdapter
.
OnItemClickListener
,
CommonTopBarView
.
OnCommonTopBarActionCallback
,
OnRefreshListener
,
DialogInterface
.
OnShowListener
,
DialogInterface
.
OnDismissListener
,
IGetCommonConfigCallback
{
LifeAccountLabelView
.
OnLifeAccountLabelCallback
,
MerchantCenterBottomHintDialog
.
OnMerchantCenterBottomHintCallback
,
IAuthMerchantCheckCallback
,
MerchantServiceFunctionAdapter
.
OnItemClickListener
,
CommonTopBarView
.
OnCommonTopBarActionCallback
,
OnRefreshListener
,
DialogInterface
.
OnShowListener
,
DialogInterface
.
OnDismissListener
,
IGetCommonConfigCallback
{
companion
object
{
// 传递的生活号信息
...
...
@@ -260,23 +258,8 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(), Me
}
override
fun
onEnterLifeAccountInfo
(
lifeAccountId
:
String
)
{
// 请求生活号详情接口
ApiService
.
getLifeAccountInfoById
(
this
,
hashMapOf
(
Pair
(
PARAMS_LIFE_ACCOUNT_ID
,
lifeAccountId
))
)
}
override
fun
getLifeAccountInfoByIdSuccess
(
result
:
GetLifeAccountInfoByIdBean
.
Response
?)
{
// 跳转生活号基本信息
XPageManager
.
push
(
XRouterPathConstants
.
LIFE_ACCOUNT_INFO
,
hashMapOf
(
Pair
(
MerchantInfoActivity
.
EXTRA_LIFE_ACCOUNT_INFO
,
result
))
)
}
override
fun
getLifeAccountInfoByIdFailure
(
message
:
String
?)
{
XPageManager
.
push
(
XRouterPathConstants
.
LIFE_ACCOUNT_INFO
,
null
)
}
override
fun
onUpgradeAuth
()
{
...
...
Components/BManagerCenter/src/main/java/com/yidian/shenghuoquan/bmanagercenter/ui/center/MerchantInfoActivity.kt
View file @
30d229d2
...
...
@@ -2,14 +2,16 @@ package com.yidian.shenghuoquan.bmanagercenter.ui.center
import
android.os.Bundle
import
androidx.core.view.isVisible
import
com.yidian.bcommon.base.BaseActivity
import
com.yidian.bcommon.constant.XEventConfig
import
com.yidian.bcommon.constant.XRouterPathConstants
import
com.yidian.bcommon.
base.BaseActivity
import
com.yidian.bcommon.
utils.StorageUtil
import
com.yidian.shenghuoquan.bmanagercenter.R
import
com.yidian.shenghuoquan.bmanagercenter.constant.Constant
import
com.yidian.shenghuoquan.bmanagercenter.databinding.ActivityMerchantInfoBinding
import
com.yidian.shenghuoquan.bmanagercenter.http.ApiService
import
com.yidian.shenghuoquan.bmanagercenter.http.callback.IAuthMerchantCheckCallback
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.ui.auth.LifeAccountAuthActivity
...
...
@@ -27,23 +29,16 @@ import org.greenrobot.eventbus.ThreadMode
* description: 商户基本信息
*/
class
MerchantInfoActivity
:
BaseActivity
<
ActivityMerchantInfoBinding
>(),
MerchantInfoView
.
OnMerchantInfoViewListener
,
IAuthMerchantCheckCallback
{
IAuthMerchantCheckCallback
,
IGetLifeAccountInfoByIdCallback
{
companion
object
{
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
GetLifeAccountInfoByIdBean
.
Response
}
}
}
private
lateinit
var
lifeAccountInfo
:
GetLifeAccountInfoByIdBean
.
Response
/**
* 修改后的生活号名称
...
...
@@ -82,51 +77,11 @@ class MerchantInfoActivity : BaseActivity<ActivityMerchantInfoBinding>(), Mercha
}
private
fun
initData
()
{
// 生活号名称
viewBind
.
ivLifeAccountName
.
fillContent
(
lifeAccountInfo
?.
life_account_name
)
if
(
lifeAccountInfo
?.
audit_status
!=
Constant
.
STATUS_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
)
}
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
->
{
// 个人认证
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
))
}
Constant
.
TYPE_AUTH_COMMON_ENTERPRISE
->
{
// 普通企业认证
viewBind
.
ivLifeAccountAuth
.
fillContent
(
resources
.
getString
(
R
.
string
.
common_enterprise
))
}
}
// 请求生活号详情接口
ApiService
.
getLifeAccountInfoById
(
this
,
hashMapOf
(
PARAMS_LIFE_ACCOUNT_ID
to
StorageUtil
.
getLifeAccountId
())
)
}
override
fun
onEnterDetail
(
from
:
MerchantInfoView
)
{
...
...
@@ -136,21 +91,15 @@ class MerchantInfoActivity : BaseActivity<ActivityMerchantInfoBinding>(), Mercha
XPageManager
.
push
(
XRouterPathConstants
.
LIFE_ACCOUNT_MODIFY_NAME
,
hashMapOf
(
Pair
(
LifeAccountModifyNameActivity
.
EXTRA_LIFE_ACCOUNT_ID
,
lifeAccountInfo
?.
life_account_id
),
Pair
(
LifeAccountModifyNameActivity
.
EXTRA_LIFE_ACCOUNT_NAME
,
modifyAccountName
?:
lifeAccountInfo
?.
life_account_name
)
LifeAccountModifyNameActivity
.
EXTRA_LIFE_ACCOUNT_ID
to
lifeAccountInfo
.
life_account_id
,
LifeAccountModifyNameActivity
.
EXTRA_LIFE_ACCOUNT_NAME
to
(
modifyAccountName
?:
lifeAccountInfo
.
life_account_name
)
)
)
}
else
if
(
from
==
viewBind
.
ivLifeAccountAuth
)
{
// 跳转认证详情页
XPageManager
.
push
(
XRouterPathConstants
.
LIFE_ACCOUNT_AUTH_INFO
,
hashMapOf
(
Pair
(
MerchantAuthInfoActivity
.
EXTRA_LIFE_ACCOUNT_INFO
,
lifeAccountInfo
)
)
hashMapOf
(
MerchantAuthInfoActivity
.
EXTRA_LIFE_ACCOUNT_INFO
to
lifeAccountInfo
)
)
}
}
...
...
@@ -158,39 +107,29 @@ 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
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
(
Pair
(
LifeAccountAuthActivity
.
EXTRA_PAGE_FROM
,
LifeAccountAuthActivity
.
FROM_AUTH
)
,
Pair
(
LifeAccountAuthActivity
.
EXTRA_LIFE_ACCOUNT_ID
,
lifeAccountInfo
?.
life_account_id
)
LifeAccountAuthActivity
.
EXTRA_PAGE_FROM
to
LifeAccountAuthActivity
.
FROM_AUTH
,
LifeAccountAuthActivity
.
EXTRA_LIFE_ACCOUNT_ID
to
lifeAccountInfo
.
life_account_id
)
)
}
else
if
(
lifeAccountInfo
?
.
audit_status
==
Constant
.
STATUS_AUDIT_REJECT
)
{
}
else
if
(
lifeAccountInfo
.
audit_status
==
Constant
.
STATUS_AUDIT_REJECT
)
{
// 认证驳回 请求企业认证信息 此处为升级认证情况 需要传入生活号id
ApiService
.
authMerchantCheck
(
this
,
hashMapOf
(
Pair
(
PARAMS_LIFE_ACCOUNT_ID
,
lifeAccountInfo
?.
life_account_id
.
toString
()
)
)
hashMapOf
(
PARAMS_LIFE_ACCOUNT_ID
to
lifeAccountInfo
.
life_account_id
)
)
}
}
else
if
(
from
==
viewBind
.
ivLifeAccountAuthUpgrade
)
{
// 认证升级 请求企业认证信息 此处为升级认证情况 需要传入生活号id
ApiService
.
authMerchantCheck
(
this
,
hashMapOf
(
Pair
(
PARAMS_LIFE_ACCOUNT_ID
,
lifeAccountInfo
?.
life_account_id
.
toString
()
)
)
this
,
hashMapOf
(
PARAMS_LIFE_ACCOUNT_ID
to
lifeAccountInfo
.
life_account_id
)
)
}
...
...
@@ -201,12 +140,9 @@ class MerchantInfoActivity : BaseActivity<ActivityMerchantInfoBinding>(), Mercha
XPageManager
.
push
(
XRouterPathConstants
.
LIFE_ACCOUNT_ENTERPRISE_AUTH
,
hashMapOf
(
Pair
(
LifeAccountEnterpriseAuthActivity
.
EXTRA_LIFE_ACCOUNT_ID
,
lifeAccountInfo
?.
life_account_id
),
Pair
(
LifeAccountEnterpriseAuthActivity
.
EXTRA_AUTH_DATA
,
result
),
Pair
(
LifeAccountEnterpriseAuthActivity
.
EXTRA_IS_AUTH_MODIFY
,
lifeAccountInfo
?.
audit_status
==
Constant
.
STATUS_AUDIT_REJECT
)
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
)
)
)
}
...
...
@@ -215,6 +151,62 @@ class MerchantInfoActivity : BaseActivity<ActivityMerchantInfoBinding>(), Mercha
}
override
fun
getLifeAccountInfoByIdSuccess
(
result
:
GetLifeAccountInfoByIdBean
.
Response
?)
{
result
?.
let
{
lifeAccountInfo
=
it
// 更新UI
// 生活号名称
viewBind
.
ivLifeAccountName
.
fillContent
(
lifeAccountInfo
.
life_account_name
)
if
(
lifeAccountInfo
.
audit_status
!=
Constant
.
STATUS_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
)
}
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
->
{
// 个人认证
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
))
}
Constant
.
TYPE_AUTH_COMMON_ENTERPRISE
->
{
// 普通企业认证
viewBind
.
ivLifeAccountAuth
.
fillContent
(
resources
.
getString
(
R
.
string
.
common_enterprise
))
}
}
}
}
override
fun
getLifeAccountInfoByIdFailure
(
message
:
String
?)
{
}
@Subscribe
(
sticky
=
false
,
threadMode
=
ThreadMode
.
MAIN
)
fun
onEvent
(
event
:
XBaseEvent
?)
{
when
(
event
?.
name
)
{
...
...
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