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
c148d178
Commit
c148d178
authored
Jun 17, 2021
by
yinjiacheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix 生活号名称修改后同步商户基本信息页面和商户管理中心页面
parent
1edc7b7f
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
139 additions
and
75 deletions
+139
-75
XEventConfig.kt
...ib/Common/src/main/java/com/yidian/common/XEventConfig.kt
+1
-0
LifeAccountModifyNameActivity.kt
...an/newscontent/ui/center/LifeAccountModifyNameActivity.kt
+5
-1
MerchantCenterActivity.kt
...nghuoquan/newscontent/ui/center/MerchantCenterActivity.kt
+22
-0
MerchantInfoActivity.kt
...henghuoquan/newscontent/ui/center/MerchantInfoActivity.kt
+30
-1
LifeAccountLabelView.kt
...n/shenghuoquan/newscontent/widget/LifeAccountLabelView.kt
+81
-73
No files found.
CommonLib/Common/src/main/java/com/yidian/common/XEventConfig.kt
View file @
c148d178
...
@@ -15,5 +15,6 @@ class XEventConfig {
...
@@ -15,5 +15,6 @@ class XEventConfig {
const
val
UPDATE_LIKE
:
String
=
"updateLike"
const
val
UPDATE_LIKE
:
String
=
"updateLike"
const
val
GIF_DATA
:
String
=
"gifData"
const
val
GIF_DATA
:
String
=
"gifData"
const
val
CHOOSE_CAREER
:
String
=
"chooseCareer"
const
val
CHOOSE_CAREER
:
String
=
"chooseCareer"
const
val
LIFE_ACCOUNT_NAME_MODIFY
=
"lifeAccountNameModify"
}
}
}
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/center/LifeAccountModifyNameActivity.kt
View file @
c148d178
...
@@ -2,6 +2,7 @@ package com.yidian.shenghuoquan.newscontent.ui.center
...
@@ -2,6 +2,7 @@ package com.yidian.shenghuoquan.newscontent.ui.center
import
android.os.Bundle
import
android.os.Bundle
import
android.text.InputFilter
import
android.text.InputFilter
import
com.yidian.common.XEventConfig
import
com.yidian.common.XRouterPathConstants
import
com.yidian.common.XRouterPathConstants
import
com.yidian.common.base.BaseActivity
import
com.yidian.common.base.BaseActivity
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.R
...
@@ -11,6 +12,8 @@ import com.yidian.shenghuoquan.newscontent.http.ApiService
...
@@ -11,6 +12,8 @@ import com.yidian.shenghuoquan.newscontent.http.ApiService
import
com.yidian.shenghuoquan.newscontent.utils.InputFilterUtil
import
com.yidian.shenghuoquan.newscontent.utils.InputFilterUtil
import
com.yidian.shenghuoquan.newscontent.widget.CommonTopBarView
import
com.yidian.shenghuoquan.newscontent.widget.CommonTopBarView
import
com.yidian.shenghuoquan.newscontent.widget.LifeAccountAuthIdentityInfoEditView
import
com.yidian.shenghuoquan.newscontent.widget.LifeAccountAuthIdentityInfoEditView
import
com.yidian.xarc.xevent.XBaseEvent
import
com.yidian.xarc.xevent.XEventManager
import
com.yidian.xpage.XPageManager
import
com.yidian.xpage.XPageManager
/**
/**
...
@@ -89,7 +92,8 @@ class LifeAccountModifyNameActivity : BaseActivity<ActivityLifeAccountModifyName
...
@@ -89,7 +92,8 @@ class LifeAccountModifyNameActivity : BaseActivity<ActivityLifeAccountModifyName
override
fun
createLifeAccountCallback
(
result
:
Boolean
)
{
override
fun
createLifeAccountCallback
(
result
:
Boolean
)
{
if
(
result
)
{
if
(
result
)
{
// 生活号名称修改成功
// 生活号名称修改成功 发送事件通知商户基本信息页面和商户管理中心页面
XEventManager
.
post
(
XBaseEvent
(
XEventConfig
.
LIFE_ACCOUNT_NAME_MODIFY
,
viewBind
.
evLifeAccountName
.
getEditContent
()))
XPageManager
.
pop
(
null
)
XPageManager
.
pop
(
null
)
}
else
{
}
else
{
// 生活号名称修改失败 提示
// 生活号名称修改失败 提示
...
...
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/center/MerchantCenterActivity.kt
View file @
c148d178
...
@@ -4,6 +4,7 @@ import android.os.Bundle
...
@@ -4,6 +4,7 @@ import android.os.Bundle
import
android.view.View
import
android.view.View
import
androidx.core.content.ContextCompat
import
androidx.core.content.ContextCompat
import
androidx.recyclerview.widget.LinearLayoutManager
import
androidx.recyclerview.widget.LinearLayoutManager
import
com.yidian.common.XEventConfig
import
com.yidian.common.XRouterPathConstants
import
com.yidian.common.XRouterPathConstants
import
com.yidian.common.base.BaseActivity
import
com.yidian.common.base.BaseActivity
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.R
...
@@ -27,7 +28,11 @@ import com.yidian.shenghuoquan.newscontent.ui.dialog.HintDialog
...
@@ -27,7 +28,11 @@ import com.yidian.shenghuoquan.newscontent.ui.dialog.HintDialog
import
com.yidian.shenghuoquan.newscontent.ui.dialog.MerchantCenterBottomHintDialog
import
com.yidian.shenghuoquan.newscontent.ui.dialog.MerchantCenterBottomHintDialog
import
com.yidian.shenghuoquan.newscontent.widget.CommonTopBarView
import
com.yidian.shenghuoquan.newscontent.widget.CommonTopBarView
import
com.yidian.shenghuoquan.newscontent.widget.LifeAccountLabelView
import
com.yidian.shenghuoquan.newscontent.widget.LifeAccountLabelView
import
com.yidian.xarc.xevent.XBaseEvent
import
com.yidian.xarc.xevent.XEventManager
import
com.yidian.xpage.XPageManager
import
com.yidian.xpage.XPageManager
import
org.greenrobot.eventbus.Subscribe
import
org.greenrobot.eventbus.ThreadMode
/**
/**
* author: yinjiacheng
* author: yinjiacheng
...
@@ -74,6 +79,12 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(),
...
@@ -74,6 +79,12 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(),
initView
()
initView
()
initListener
()
initListener
()
initData
()
initData
()
XEventManager
.
register
(
this
)
}
override
fun
onDestroy
()
{
super
.
onDestroy
()
XEventManager
.
unRegister
(
this
)
}
}
private
fun
initView
()
{
private
fun
initView
()
{
...
@@ -384,4 +395,15 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(),
...
@@ -384,4 +395,15 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(),
// 切换主体 请求生活号列表接口
// 切换主体 请求生活号列表接口
ApiService
.
getLifeAccountList
(
this
)
ApiService
.
getLifeAccountList
(
this
)
}
}
@Subscribe
(
sticky
=
false
,
threadMode
=
ThreadMode
.
MAIN
)
fun
onEvent
(
event
:
XBaseEvent
?)
{
when
(
event
?.
name
)
{
XEventConfig
.
LIFE_ACCOUNT_NAME_MODIFY
->
{
// 更新生活号名称
val
accountName
=
event
.
body
as
String
viewBind
.
lvLifeAccountLabel
.
setLifeAccountName
(
accountName
)
}
}
}
}
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/ui/center/MerchantInfoActivity.kt
View file @
c148d178
...
@@ -2,6 +2,7 @@ package com.yidian.shenghuoquan.newscontent.ui.center
...
@@ -2,6 +2,7 @@ package com.yidian.shenghuoquan.newscontent.ui.center
import
android.os.Bundle
import
android.os.Bundle
import
androidx.core.view.isVisible
import
androidx.core.view.isVisible
import
com.yidian.common.XEventConfig
import
com.yidian.common.XRouterPathConstants
import
com.yidian.common.XRouterPathConstants
import
com.yidian.common.base.BaseActivity
import
com.yidian.common.base.BaseActivity
import
com.yidian.shenghuoquan.newscontent.R
import
com.yidian.shenghuoquan.newscontent.R
...
@@ -11,9 +12,14 @@ import com.yidian.shenghuoquan.newscontent.http.ApiService
...
@@ -11,9 +12,14 @@ import com.yidian.shenghuoquan.newscontent.http.ApiService
import
com.yidian.shenghuoquan.newscontent.http.callback.IAuthMerchantCheckCallback
import
com.yidian.shenghuoquan.newscontent.http.callback.IAuthMerchantCheckCallback
import
com.yidian.shenghuoquan.newscontent.http.httpbean.AuthMerchantCheckBean
import
com.yidian.shenghuoquan.newscontent.http.httpbean.AuthMerchantCheckBean
import
com.yidian.shenghuoquan.newscontent.http.httpbean.GetLifeAccountInfoByIdBean
import
com.yidian.shenghuoquan.newscontent.http.httpbean.GetLifeAccountInfoByIdBean
import
com.yidian.shenghuoquan.newscontent.ui.auth.LifeAccountAuthDataManager
import
com.yidian.shenghuoquan.newscontent.ui.auth.LifeAccountEnterpriseAuthActivity
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.xarc.xevent.XBaseEvent
import
com.yidian.xarc.xevent.XEventManager
import
com.yidian.xpage.XPageManager
import
com.yidian.xpage.XPageManager
import
org.greenrobot.eventbus.Subscribe
import
org.greenrobot.eventbus.ThreadMode
/**
/**
* author: yinjiacheng
* author: yinjiacheng
...
@@ -39,6 +45,11 @@ class MerchantInfoActivity : BaseActivity<ActivityMerchantInfoBinding>(), Mercha
...
@@ -39,6 +45,11 @@ class MerchantInfoActivity : BaseActivity<ActivityMerchantInfoBinding>(), Mercha
}
}
}
}
/**
* 修改后的生活号名称
*/
private
var
modifyAccountName
:
String
?
=
null
override
fun
createViewBinding
():
ActivityMerchantInfoBinding
{
override
fun
createViewBinding
():
ActivityMerchantInfoBinding
{
return
ActivityMerchantInfoBinding
.
inflate
(
layoutInflater
)
return
ActivityMerchantInfoBinding
.
inflate
(
layoutInflater
)
}
}
...
@@ -47,11 +58,17 @@ class MerchantInfoActivity : BaseActivity<ActivityMerchantInfoBinding>(), Mercha
...
@@ -47,11 +58,17 @@ class MerchantInfoActivity : BaseActivity<ActivityMerchantInfoBinding>(), Mercha
return
XRouterPathConstants
.
MERCHANT_INFO
return
XRouterPathConstants
.
MERCHANT_INFO
}
}
override
fun
onDestroy
()
{
super
.
onDestroy
()
XEventManager
.
unRegister
(
this
)
}
override
fun
init
(
savedInstanceState
:
Bundle
?)
{
override
fun
init
(
savedInstanceState
:
Bundle
?)
{
super
.
init
(
savedInstanceState
)
super
.
init
(
savedInstanceState
)
initView
()
initView
()
initListener
()
initListener
()
initData
()
initData
()
XEventManager
.
register
(
this
)
}
}
private
fun
initView
()
{
private
fun
initView
()
{
...
@@ -119,7 +136,7 @@ class MerchantInfoActivity : BaseActivity<ActivityMerchantInfoBinding>(), Mercha
...
@@ -119,7 +136,7 @@ class MerchantInfoActivity : BaseActivity<ActivityMerchantInfoBinding>(), Mercha
),
),
Pair
(
Pair
(
LifeAccountModifyNameActivity
.
EXTRA_LIFE_ACCOUNT_NAME
,
LifeAccountModifyNameActivity
.
EXTRA_LIFE_ACCOUNT_NAME
,
lifeAccountInfo
?.
life_account_name
modifyAccountName
?:
lifeAccountInfo
?.
life_account_name
)
)
)
)
)
)
...
@@ -184,4 +201,16 @@ class MerchantInfoActivity : BaseActivity<ActivityMerchantInfoBinding>(), Mercha
...
@@ -184,4 +201,16 @@ class MerchantInfoActivity : BaseActivity<ActivityMerchantInfoBinding>(), Mercha
}
}
@Subscribe
(
sticky
=
false
,
threadMode
=
ThreadMode
.
MAIN
)
fun
onEvent
(
event
:
XBaseEvent
?)
{
when
(
event
?.
name
)
{
XEventConfig
.
LIFE_ACCOUNT_NAME_MODIFY
->
{
// 更新生活号名称
val
accountName
=
event
.
body
as
String
modifyAccountName
=
accountName
viewBind
.
ivLifeAccountName
.
fillContent
(
accountName
)
}
}
}
}
}
Components/newscontent/src/main/java/com/yidian/shenghuoquan/newscontent/widget/LifeAccountLabelView.kt
View file @
c148d178
...
@@ -16,91 +16,99 @@ import com.yidian.shenghuoquan.newscontent.http.httpbean.LifeAccountItemBean
...
@@ -16,91 +16,99 @@ import com.yidian.shenghuoquan.newscontent.http.httpbean.LifeAccountItemBean
* description: 管理中心-生活号标签
* description: 管理中心-生活号标签
*/
*/
class
LifeAccountLabelView
@JvmOverloads
constructor
(
class
LifeAccountLabelView
@JvmOverloads
constructor
(
context
:
Context
,
context
:
Context
,
attrs
:
AttributeSet
?
=
null
,
attrs
:
AttributeSet
?
=
null
,
defStyle
:
Int
=
0
defStyle
:
Int
=
0
)
:
ConstraintLayout
(
context
,
attrs
,
defStyle
),
View
.
OnClickListener
{
)
:
ConstraintLayout
(
context
,
attrs
,
defStyle
),
View
.
OnClickListener
{
private
val
viewBinding
=
ViewLifeAccountLabelBinding
.
bind
(
private
val
viewBinding
=
ViewLifeAccountLabelBinding
.
bind
(
View
.
inflate
(
View
.
inflate
(
getContext
(),
getContext
(),
R
.
layout
.
view_life_account_label
,
R
.
layout
.
view_life_account_label
,
this
this
)
)
)
)
/**
/**
* 当前显示的生活号
* 当前显示的生活号
*/
*/
private
lateinit
var
curLifeAccount
:
LifeAccountItemBean
.
Response
private
lateinit
var
curLifeAccount
:
LifeAccountItemBean
.
Response
private
var
callback
:
OnLifeAccountLabelCallback
?
=
null
private
var
callback
:
OnLifeAccountLabelCallback
?
=
null
init
{
init
{
viewBinding
.
ivLifeAccountDetail
.
setOnClickListener
(
this
)
viewBinding
.
ivLifeAccountDetail
.
setOnClickListener
(
this
)
}
}
/**
/**
* 设置生活号信息
* 设置生活号信息
* 先判断认证状态 再判断审核状态 即审核中和审核驳回状态可覆盖认证状态
* 先判断认证状态 再判断审核状态 即审核中和审核驳回状态可覆盖认证状态
* @param data 生活号详情
* @param data 生活号详情
*/
*/
fun
setLifeAccountData
(
data
:
LifeAccountItemBean
.
Response
)
{
fun
setLifeAccountData
(
data
:
LifeAccountItemBean
.
Response
)
{
curLifeAccount
=
data
curLifeAccount
=
data
viewBinding
.
tvLifeAccountName
.
text
=
data
.
life_account_name
viewBinding
.
tvLifeAccountName
.
text
=
data
.
life_account_name
viewBinding
.
tvLifeAccountStatus
.
apply
{
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
->
{
// 已认证
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_auth
)
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_FF1852F1
))
text
=
when
(
data
.
life_account_type
)
{
Constant
.
TYPE_LIFE_ACCOUNT_PERSONAL
->
resources
.
getString
(
R
.
string
.
personal_auth
)
Constant
.
TYPE_LIFE_ACCOUNT_ENTERPRISE
->
resources
.
getString
(
R
.
string
.
enterprise_auth
)
else
->
""
}
}
}
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
))
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_AUTH_FINISH
->
{
// 已认证
override
fun
onClick
(
v
:
View
?)
{
setBackgroundResource
(
R
.
drawable
.
shape_life_account_status_auth
)
if
(
v
?.
id
==
R
.
id
.
iv_life_account_detail
)
{
setTextColor
(
ContextCompat
.
getColor
(
context
,
R
.
color
.
color_FF1852F1
))
// 跳转生活号基本信息
text
=
when
(
data
.
life_account_type
)
{
callback
?.
onEnterLifeAccountInfo
(
curLifeAccount
.
life_account_id
)
Constant
.
TYPE_LIFE_ACCOUNT_PERSONAL
->
resources
.
getString
(
R
.
string
.
personal_auth
)
Constant
.
TYPE_LIFE_ACCOUNT_ENTERPRISE
->
resources
.
getString
(
R
.
string
.
enterprise_auth
)
else
->
""
}
}
}
}
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
))
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
)
}
}
}
}
}
fun
setOnLifeAccountLabelCallback
(
callback
:
OnLifeAccountLabelCallback
)
{
/**
this
.
callback
=
callback
* 设置生活号名称
}
* @param name 修改后的生活号名称
*/
fun
setLifeAccountName
(
name
:
String
)
{
viewBinding
.
tvLifeAccountName
.
text
=
name
}
interface
OnLifeAccountLabelCallback
{
override
fun
onClick
(
v
:
View
?)
{
/**
if
(
v
?.
id
==
R
.
id
.
iv_life_account_detail
)
{
* 进入生活号基本信息
// 跳转生活号基本信息
*/
callback
?.
onEnterLifeAccountInfo
(
curLifeAccount
.
life_account_id
)
fun
onEnterLifeAccountInfo
(
lifeAccountId
:
String
)
}
}
}
fun
setOnLifeAccountLabelCallback
(
callback
:
OnLifeAccountLabelCallback
)
{
this
.
callback
=
callback
}
interface
OnLifeAccountLabelCallback
{
/**
* 进入生活号基本信息
*/
fun
onEnterLifeAccountInfo
(
lifeAccountId
:
String
)
}
}
}
\ No newline at end of file
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