Commit 157af2b6 authored by yinjiacheng's avatar yinjiacheng

update 商户管理中心底部升级、修改认证提示框

parent 47e82c5d
......@@ -11,12 +11,15 @@ import com.yidian.shenghuoquan.newscontent.adapter.MerchantServiceGroupAdapter
import com.yidian.shenghuoquan.newscontent.constant.Constant
import com.yidian.shenghuoquan.newscontent.databinding.ActivityMerchantCenterBinding
import com.yidian.shenghuoquan.newscontent.http.ApiService
import com.yidian.shenghuoquan.newscontent.http.callback.IAuthMerchantCheckCallback
import com.yidian.shenghuoquan.newscontent.http.callback.IGetConfigListCallback
import com.yidian.shenghuoquan.newscontent.http.callback.IGetLifeAccountInfoByIdCallback
import com.yidian.shenghuoquan.newscontent.http.callback.IGetLifeAccountListCallback
import com.yidian.shenghuoquan.newscontent.http.httpbean.AuthMerchantCheckBean
import com.yidian.shenghuoquan.newscontent.http.httpbean.GetConfigListBean
import com.yidian.shenghuoquan.newscontent.http.httpbean.GetLifeAccountInfoByIdBean
import com.yidian.shenghuoquan.newscontent.http.httpbean.LifeAccountItemBean
import com.yidian.shenghuoquan.newscontent.ui.auth.LifeAccountEnterpriseAuthActivity
import com.yidian.shenghuoquan.newscontent.ui.dialog.MerchantCenterBottomHintDialog
import com.yidian.shenghuoquan.newscontent.widget.LifeAccountLabelView
import com.yidian.xpage.XPageManager
......@@ -29,7 +32,8 @@ import com.yidian.xpage.XPageManager
class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(),
IGetConfigListCallback, IGetLifeAccountListCallback, View.OnClickListener,
MerchantSwitchDialog.OnMerchantSwitchCallback, LifeAccountLabelView.OnLifeAccountLabelCallback,
IGetLifeAccountInfoByIdCallback {
IGetLifeAccountInfoByIdCallback,
MerchantCenterBottomHintDialog.OnMerchantCenterBottomHintCallback, IAuthMerchantCheckCallback {
companion object {
// 传递的生活号信息
......@@ -80,7 +84,9 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(),
}
// 切换主体入口判断
viewBind.tvSwitch.isVisible = params?.get(EXTRA_IS_MULTI)?.let { it as Boolean } ?: false
curLifeAccount = params?.get(EXTRA_LIFE_ACCOUNT_INFO)?.let { it as LifeAccountItemBean.Response } ?: return
curLifeAccount =
params?.get(EXTRA_LIFE_ACCOUNT_INFO)?.let { it as LifeAccountItemBean.Response }
?: return
// 设置当前生活号信息
viewBind.lvLifeAccountLabel.setLifeAccountData(curLifeAccount)
......@@ -92,14 +98,14 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(),
// 当前是个人生活号 提示升级
MerchantCenterBottomHintDialog(
this,
MerchantCenterBottomHintDialog.TYPE_AUTH_UPGRADE
MerchantCenterBottomHintDialog.TYPE_AUTH_UPGRADE, this
).show()
}
if (curLifeAccount.enterprise_audit_status == Constant.STATUS_AUDIT_REJECT) {
// 当前企业认证驳回 提示修改
MerchantCenterBottomHintDialog(
this,
MerchantCenterBottomHintDialog.TYPE_AUTH_REJECT
MerchantCenterBottomHintDialog.TYPE_AUTH_REJECT, this
).show()
}
}
......@@ -159,4 +165,47 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(),
override fun getLifeAccountInfoByIdFailure(message: String?) {
}
override fun onUpgradeEnterpriseAuth() {
// 升级企业认证 先请求企业认证信息
ApiService.authMerchantCheck(
this,
hashMapOf(
Pair(
MerchantInfoActivity.PARAMS_LIFE_ACCOUNT_ID,
curLifeAccount.life_account_id
)
)
)
}
override fun onModifyEnterpriseAuth() {
// 修改企业认证 先请求企业认证信息
ApiService.authMerchantCheck(
this,
hashMapOf(
Pair(
MerchantInfoActivity.PARAMS_LIFE_ACCOUNT_ID,
curLifeAccount.life_account_id
)
)
)
}
override fun authMerchantCheckSuccess(result: AuthMerchantCheckBean.Response?) {
// 跳转企业认证流程
XPageManager.push(
XRouterPathConstants.LIFE_ACCOUNT_ENTERPRISE_AUTH,
hashMapOf(
Pair(
LifeAccountEnterpriseAuthActivity.EXTRA_LIFE_ACCOUNT_ID,
curLifeAccount.life_account_id
), Pair(LifeAccountEnterpriseAuthActivity.EXTRA_AUTH_DATA, result)
)
)
}
override fun authMerchantCheckFailure(message: String?) {
}
}
......@@ -14,7 +14,11 @@ import com.yidian.utils.DensityUtil
* date: 6/9/21 8:56 PM
* description: 商户管理中心底部提示弹窗
*/
class MerchantCenterBottomHintDialog(context: Context, val type: Int) :
class MerchantCenterBottomHintDialog(
context: Context,
val type: Int,
val callback: OnMerchantCenterBottomHintCallback? = null
) :
BaseDialog<DialogMerchantCenterBottomHintBinding>(
context,
R.style.merchant_center_bottom_hint_dialog
......@@ -75,12 +79,26 @@ class MerchantCenterBottomHintDialog(context: Context, val type: Int) :
if (v?.id == R.id.tv_next) {
when (type) {
TYPE_AUTH_UPGRADE -> {
// TODO: 6/9/21 开始企业认证
// 升级企业认证
callback?.onUpgradeEnterpriseAuth()
}
TYPE_AUTH_REJECT -> {
// TODO: 6/9/21 修改企业认证
// 修改企业认证
callback?.onModifyEnterpriseAuth()
}
}
}
}
interface OnMerchantCenterBottomHintCallback {
/**
* 升级企业认证
*/
fun onUpgradeEnterpriseAuth()
/**
* 修改企业认证
*/
fun onModifyEnterpriseAuth()
}
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment