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
ffb6f400
Commit
ffb6f400
authored
Aug 06, 2021
by
yinjiacheng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update 管理中心优化提示弹窗逻辑
parent
a9147c04
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
93 additions
and
80 deletions
+93
-80
CommonHintDialog.kt
...c/main/java/com/yidian/bcommon/widget/CommonHintDialog.kt
+6
-5
MerchantCenterActivity.kt
...uoquan/bmanagercenter/ui/center/MerchantCenterActivity.kt
+87
-75
No files found.
CommonLib/BCommon/src/main/java/com/yidian/bcommon/widget/CommonHintDialog.kt
View file @
ffb6f400
...
@@ -5,6 +5,7 @@ import android.os.Bundle
...
@@ -5,6 +5,7 @@ import android.os.Bundle
import
android.view.Gravity
import
android.view.Gravity
import
android.view.View
import
android.view.View
import
android.view.WindowManager
import
android.view.WindowManager
import
androidx.annotation.ColorRes
import
androidx.core.content.ContextCompat
import
androidx.core.content.ContextCompat
import
androidx.core.view.isVisible
import
androidx.core.view.isVisible
import
com.yidian.bcommon.R
import
com.yidian.bcommon.R
...
@@ -22,8 +23,8 @@ class CommonHintDialog @JvmOverloads constructor(
...
@@ -22,8 +23,8 @@ class CommonHintDialog @JvmOverloads constructor(
val
content
:
CharSequence
,
val
content
:
CharSequence
,
val
options
:
ArrayList
<
String
>,
val
options
:
ArrayList
<
String
>,
val
callback
:
OnHintOptionCallback
?,
val
callback
:
OnHintOptionCallback
?,
private
val
leftBtnColor
:
Int
=
R
.
color
.
color_8F000000
,
@ColorRes
private
val
leftBtnColor
:
Int
?
=
R
.
color
.
color_8F000000
,
private
val
rightBtnColor
:
Int
=
R
.
color
.
color_1852F1
,
@ColorRes
private
val
rightBtnColor
:
Int
?
=
R
.
color
.
color_1852F1
,
)
:
BaseDialog
<
DialogCommonHintBinding
>(
context
),
View
.
OnClickListener
{
)
:
BaseDialog
<
DialogCommonHintBinding
>(
context
),
View
.
OnClickListener
{
override
fun
createViewBinding
():
DialogCommonHintBinding
{
override
fun
createViewBinding
():
DialogCommonHintBinding
{
...
@@ -37,13 +38,13 @@ class CommonHintDialog @JvmOverloads constructor(
...
@@ -37,13 +38,13 @@ class CommonHintDialog @JvmOverloads constructor(
viewBinding
.
btnRight
.
text
=
options
[
0
]
viewBinding
.
btnRight
.
text
=
options
[
0
]
viewBinding
.
btnLeft
.
isVisible
=
false
viewBinding
.
btnLeft
.
isVisible
=
false
viewBinding
.
viewVerticalDivider
.
isVisible
=
false
viewBinding
.
viewVerticalDivider
.
isVisible
=
false
viewBinding
.
btnRight
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
rightBtnColor
))
viewBinding
.
btnRight
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
rightBtnColor
?:
R
.
color
.
color_1852F1
))
}
}
2
->
{
2
->
{
viewBinding
.
btnLeft
.
text
=
options
[
0
]
viewBinding
.
btnLeft
.
text
=
options
[
0
]
viewBinding
.
btnRight
.
text
=
options
[
1
]
viewBinding
.
btnRight
.
text
=
options
[
1
]
viewBinding
.
btnLeft
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
leftBtnColor
))
viewBinding
.
btnLeft
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
leftBtnColor
?:
R
.
color
.
color_8F000000
))
viewBinding
.
btnRight
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
rightBtnColor
))
viewBinding
.
btnRight
.
setTextColor
(
ContextCompat
.
getColor
(
context
,
rightBtnColor
?:
R
.
color
.
color_1852F1
))
}
}
}
}
}
}
...
...
Components/BManagerCenter/src/main/java/com/yidian/shenghuoquan/bmanagercenter/ui/center/MerchantCenterActivity.kt
View file @
ffb6f400
...
@@ -10,7 +10,6 @@ import com.google.gson.Gson
...
@@ -10,7 +10,6 @@ import com.google.gson.Gson
import
com.scwang.smart.refresh.layout.api.RefreshLayout
import
com.scwang.smart.refresh.layout.api.RefreshLayout
import
com.scwang.smart.refresh.layout.listener.OnRefreshListener
import
com.scwang.smart.refresh.layout.listener.OnRefreshListener
import
com.yidian.bcommon.base.BaseActivity
import
com.yidian.bcommon.base.BaseActivity
import
com.yidian.bcommon.bean.HintOptionBean
import
com.yidian.bcommon.bean.LifeAccountItemBean
import
com.yidian.bcommon.bean.LifeAccountItemBean
import
com.yidian.bcommon.constant.*
import
com.yidian.bcommon.constant.*
import
com.yidian.bcommon.http.bean.GetCommonConfigBean
import
com.yidian.bcommon.http.bean.GetCommonConfigBean
...
@@ -19,7 +18,7 @@ import com.yidian.bcommon.sdk.JudgeClientUtils
...
@@ -19,7 +18,7 @@ import com.yidian.bcommon.sdk.JudgeClientUtils
import
com.yidian.bcommon.services.ZapServiceActionConstants
import
com.yidian.bcommon.services.ZapServiceActionConstants
import
com.yidian.bcommon.services.ZapServiceNameConstants
import
com.yidian.bcommon.services.ZapServiceNameConstants
import
com.yidian.bcommon.utils.StorageUtil
import
com.yidian.bcommon.utils.StorageUtil
import
com.yidian.bcommon.widget.
dialog.
HintDialog
import
com.yidian.bcommon.widget.
Common
HintDialog
import
com.yidian.shenghuoquan.bmanagercenter.R
import
com.yidian.shenghuoquan.bmanagercenter.R
import
com.yidian.shenghuoquan.bmanagercenter.adapter.MerchantServiceFunctionAdapter
import
com.yidian.shenghuoquan.bmanagercenter.adapter.MerchantServiceFunctionAdapter
import
com.yidian.shenghuoquan.bmanagercenter.adapter.MerchantServiceGroupAdapter
import
com.yidian.shenghuoquan.bmanagercenter.adapter.MerchantServiceGroupAdapter
...
@@ -56,10 +55,6 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(), Me
...
@@ -56,10 +55,6 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(), Me
IAuthMerchantCheckCallback
,
MerchantServiceFunctionAdapter
.
OnItemClickListener
,
CommonTopBarView
.
OnCommonTopBarActionCallback
,
IAuthMerchantCheckCallback
,
MerchantServiceFunctionAdapter
.
OnItemClickListener
,
CommonTopBarView
.
OnCommonTopBarActionCallback
,
OnRefreshListener
,
DialogInterface
.
OnShowListener
,
DialogInterface
.
OnDismissListener
{
OnRefreshListener
,
DialogInterface
.
OnShowListener
,
DialogInterface
.
OnDismissListener
{
companion
object
{
const
val
PARAMS_LIFE_ACCOUNT_ID
=
"life_account_id"
}
/**
/**
* 当前生活号
* 当前生活号
*/
*/
...
@@ -248,19 +243,13 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(), Me
...
@@ -248,19 +243,13 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(), Me
}
}
override
fun
onUpgradeAuth
()
{
override
fun
onUpgradeAuth
()
{
// 由未认证升级认证 跳转认证首页
// 未认证进行认证
XPageManager
.
push
(
startAuth
()
XRouterPathConstants
.
LIFE_ACCOUNT_AUTH
,
hashMapOf
(
Pair
(
IntentConstants
.
KEY_EXTRA_LIFE_ACCOUNT_AUTH_FROM
,
LifeAccountAuthActivity
.
FROM_B_MANAGER_CENTER
),
Pair
(
IntentConstants
.
KEY_EXTRA_LIFE_ACCOUNT_ID
,
curLifeAccount
?.
life_account_id
)
)
)
}
}
override
fun
onModifyEnterpriseAuth
()
{
override
fun
onModifyEnterpriseAuth
()
{
// 修改
企业认证 先请求企业认证信息
// 修改
认证
ApiService
.
authMerchantCheck
(
this
,
hashMapOf
(
Pair
(
PARAMS_LIFE_ACCOUNT_ID
,
curLifeAccount
?.
life_account_id
))
)
modifyAuth
(
)
}
}
override
fun
authMerchantCheckSuccess
(
result
:
AuthMerchantCheckBean
.
Response
?)
{
override
fun
authMerchantCheckSuccess
(
result
:
AuthMerchantCheckBean
.
Response
?)
{
...
@@ -295,74 +284,32 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(), Me
...
@@ -295,74 +284,32 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(), Me
when
(
LifeAccountManager
.
getLifeAccountTag
(
curLifeAccount
?.
tag
?.
tag_key
))
{
when
(
LifeAccountManager
.
getLifeAccountTag
(
curLifeAccount
?.
tag
?.
tag_key
))
{
LifeAccountManager
.
LifeAccountTag
.
LIFE_ACCOUNT_TAG_AUDIT_UNDER
->
LifeAccountManager
.
LifeAccountTag
.
LIFE_ACCOUNT_TAG_AUDIT_UNDER
->
// 审核中 提示加急审核
// 审核中 提示加急审核
HintDialog
(
showHintDialog
(
this
,
resources
.
getString
(
R
.
string
.
audit_urgent
),
resources
.
getString
(
R
.
string
.
audit_urgent
),
arrayListOf
(
HintOptionBean
(
resources
.
getString
(
R
.
string
.
close
))),
null
arrayListOf
(
resources
.
getString
(
R
.
string
.
close
)),
).
setRightBtnColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
color_FF1852F1
)).
show
()
null
,
null
,
null
,
null
)
LifeAccountManager
.
LifeAccountTag
.
LIFE_ACCOUNT_TAG_AUTH_REJECT
->
LifeAccountManager
.
LifeAccountTag
.
LIFE_ACCOUNT_TAG_AUTH_REJECT
->
// 审核驳回 提示修改认证
// 审核驳回 提示修改认证
HintDialog
(
showHintDialog
(
this
,
resources
.
getString
(
R
.
string
.
auth_apply_reject
),
resources
.
getString
(
R
.
string
.
auth_apply_reject
),
arrayListOf
(
HintOptionBean
(
resources
.
getString
(
R
.
string
.
close
)),
HintOptionBean
(
resources
.
getString
(
R
.
string
.
modify_auth
))),
arrayListOf
(
resources
.
getString
(
R
.
string
.
close
),
resources
.
getString
(
R
.
string
.
modify_auth
)),
object
:
HintDialog
.
OnHintOptionCallback
{
null
,
{
modifyAuth
()
},
null
,
R
.
color
.
color_FF3A3A
override
fun
onLeftOption
()
{
)
}
override
fun
onRightOption
()
{
// 认证修改 请求商户认证检查
ApiService
.
authMerchantCheck
(
this
@MerchantCenterActivity
,
hashMapOf
(
Pair
(
LifeAccountEnterpriseAuthActivity
.
EXTRA_LIFE_ACCOUNT_ID
,
curLifeAccount
?.
life_account_id
))
)
}
}).
setRightBtnColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
color_FFFF3A3A
)).
show
()
LifeAccountManager
.
LifeAccountTag
.
LIFE_ACCOUNT_TAG_NOT_AUTH
->
LifeAccountManager
.
LifeAccountTag
.
LIFE_ACCOUNT_TAG_NOT_AUTH
->
// 未认证 提示认证 此处企业审核中也满足此条件但前面审核状态判断已拦截
// 未认证 提示认证
HintDialog
(
showHintDialog
(
this
,
resources
.
getString
(
R
.
string
.
auth_to_use_more_tool
),
resources
.
getString
(
R
.
string
.
auth_to_use_more_tool
),
arrayListOf
(
HintOptionBean
(
resources
.
getString
(
R
.
string
.
close
)),
HintOptionBean
(
resources
.
getString
(
R
.
string
.
goto_auth
))),
arrayListOf
(
resources
.
getString
(
R
.
string
.
close
),
resources
.
getString
(
R
.
string
.
goto_auth
)),
object
:
HintDialog
.
OnHintOptionCallback
{
null
,
{
startAuth
()
},
null
,
null
override
fun
onLeftOption
()
{
)
}
override
fun
onRightOption
()
{
// 进行认证
XPageManager
.
push
(
XRouterPathConstants
.
LIFE_ACCOUNT_AUTH
,
hashMapOf
(
Pair
(
IntentConstants
.
KEY_EXTRA_LIFE_ACCOUNT_AUTH_FROM
,
LifeAccountAuthActivity
.
FROM_B_MANAGER_CENTER
),
Pair
(
IntentConstants
.
KEY_EXTRA_LIFE_ACCOUNT_ID
,
curLifeAccount
?.
life_account_id
)
)
)
}
}).
setRightBtnColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
color_FF1852F1
)).
show
()
LifeAccountManager
.
LifeAccountTag
.
LIFE_ACCOUNT_TAG_PERSONAL_AUTH
->
LifeAccountManager
.
LifeAccountTag
.
LIFE_ACCOUNT_TAG_PERSONAL_AUTH
->
// 个人认证 提示认证升级
// 个人认证 提示认证升级
HintDialog
(
showHintDialog
(
this
,
resources
.
getString
(
R
.
string
.
upgrade_to_use_more_tool
),
resources
.
getString
(
R
.
string
.
upgrade_to_use_more_tool
),
arrayListOf
(
HintOptionBean
(
resources
.
getString
(
R
.
string
.
close
)),
HintOptionBean
(
resources
.
getString
(
R
.
string
.
goto_upgrade
))),
arrayListOf
(
resources
.
getString
(
R
.
string
.
close
),
resources
.
getString
(
R
.
string
.
goto_upgrade
)),
object
:
HintDialog
.
OnHintOptionCallback
{
null
,
{
upgradeAuth
()
},
null
,
null
override
fun
onLeftOption
()
{
)
}
override
fun
onRightOption
()
{
// 认证升级 请求商户认证检查
ApiService
.
authMerchantCheck
(
this
@MerchantCenterActivity
,
hashMapOf
(
Pair
(
LifeAccountEnterpriseAuthActivity
.
EXTRA_LIFE_ACCOUNT_ID
,
curLifeAccount
?.
life_account_id
))
)
}
}).
setRightBtnColor
(
ContextCompat
.
getColor
(
this
,
R
.
color
.
color_FF1852F1
)).
show
()
}
}
}
}
}
}
...
@@ -477,4 +424,69 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(), Me
...
@@ -477,4 +424,69 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(), Me
}
}
}.
ship
()
}.
ship
()
}
}
/**
* 提示弹窗
* @param content 提示内容
* @param options 操作项
* @param leftOption 左操作项函数
* @param rightOption 右操作项函数
* @param leftBtnColor 左操作按钮文字颜色
* @param rightBtnColor 右操作按钮文字颜色
*/
private
fun
showHintDialog
(
content
:
String
,
options
:
ArrayList
<
String
>,
leftOption
:
(()
->
Unit
)?,
rightOption
:
(()
->
Unit
)?,
leftBtnColor
:
Int
?,
rightBtnColor
:
Int
?
)
{
CommonHintDialog
(
this
,
content
,
options
,
object
:
CommonHintDialog
.
OnHintOptionCallback
{
override
fun
onLeftOption
()
{
leftOption
?.
invoke
()
}
override
fun
onRightOption
()
{
rightOption
?.
invoke
()
}
},
leftBtnColor
,
rightBtnColor
).
show
()
}
/**
* 未认证 跳转认证首页
*/
private
fun
startAuth
()
{
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
curLifeAccount
?.
life_account_id
)
)
}
/**
* 认证修改 跳转企业认证修改
*/
private
fun
modifyAuth
()
{
// 请求商户认证检查
ApiService
.
authMerchantCheck
(
this
,
hashMapOf
(
LifeAccountEnterpriseAuthActivity
.
EXTRA_LIFE_ACCOUNT_ID
to
curLifeAccount
?.
life_account_id
)
)
}
/**
* 认证升级 跳转企业认证修改
*/
private
fun
upgradeAuth
()
{
// 请求商户认证检查
ApiService
.
authMerchantCheck
(
this
,
hashMapOf
(
LifeAccountEnterpriseAuthActivity
.
EXTRA_LIFE_ACCOUNT_ID
to
curLifeAccount
?.
life_account_id
)
)
}
}
}
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