Commit 50692b84 authored by yinjiacheng's avatar yinjiacheng

update 商户管理中心当前生活号UI

parent d9b511e1
...@@ -78,7 +78,10 @@ class FlashActivity : BaseActivity<ActivityFlashBinding>(), IGetLifeAccountListC ...@@ -78,7 +78,10 @@ class FlashActivity : BaseActivity<ActivityFlashBinding>(), IGetLifeAccountListC
// 关联一个生活号 进入商户管理中心 // 关联一个生活号 进入商户管理中心
XPageManager.push( XPageManager.push(
XRouterPathConstants.MERCHANT_CENTER, XRouterPathConstants.MERCHANT_CENTER,
hashMapOf(Pair(MerchantCenterActivity.EXTRA_LIFE_ACCOUNT_INFO, result[0])) hashMapOf(
Pair(MerchantCenterActivity.EXTRA_LIFE_ACCOUNT_INFO, result[0]),
Pair(MerchantCenterActivity.EXTRA_IS_MULTI, false)
)
) )
} }
else -> { else -> {
...@@ -93,6 +96,7 @@ class FlashActivity : BaseActivity<ActivityFlashBinding>(), IGetLifeAccountListC ...@@ -93,6 +96,7 @@ class FlashActivity : BaseActivity<ActivityFlashBinding>(), IGetLifeAccountListC
} }
override fun getLifeAccountListFailure(message: String?) { override fun getLifeAccountListFailure(message: String?) {
// TODO: 6/12/21 处理请求失败情况
finish()
} }
} }
...@@ -146,7 +146,8 @@ class LoginLifeCircleActivity : BaseActivity<ActivityLoginBinding>(), IGetLifeAc ...@@ -146,7 +146,8 @@ class LoginLifeCircleActivity : BaseActivity<ActivityLoginBinding>(), IGetLifeAc
// 关联一个生活号 进入商户管理中心 // 关联一个生活号 进入商户管理中心
XPageManager.push( XPageManager.push(
XRouterPathConstants.MERCHANT_CENTER, XRouterPathConstants.MERCHANT_CENTER,
hashMapOf(Pair(MerchantCenterActivity.EXTRA_LIFE_ACCOUNT_INFO, result[0])) hashMapOf(Pair(MerchantCenterActivity.EXTRA_LIFE_ACCOUNT_INFO, result[0]),
Pair(MerchantCenterActivity.EXTRA_IS_MULTI, false))
) )
} }
else -> { else -> {
...@@ -161,7 +162,8 @@ class LoginLifeCircleActivity : BaseActivity<ActivityLoginBinding>(), IGetLifeAc ...@@ -161,7 +162,8 @@ class LoginLifeCircleActivity : BaseActivity<ActivityLoginBinding>(), IGetLifeAc
} }
override fun getLifeAccountListFailure(message: String?) { override fun getLifeAccountListFailure(message: String?) {
// TODO: 6/12/21 处理请求失败情况
finish()
} }
override fun sendSmsCodeCallBack(t: HttpResult<Any?>?) { override fun sendSmsCodeCallBack(t: HttpResult<Any?>?) {
......
...@@ -75,7 +75,10 @@ class LifeAccountIdentityActivity : BaseActivity<ActivityLifeAccountIdentityBind ...@@ -75,7 +75,10 @@ class LifeAccountIdentityActivity : BaseActivity<ActivityLifeAccountIdentityBind
// 进入商户管理中心页 // 进入商户管理中心页
XPageManager.push( XPageManager.push(
XRouterPathConstants.MERCHANT_CENTER, XRouterPathConstants.MERCHANT_CENTER,
hashMapOf(Pair(MerchantCenterActivity.EXTRA_LIFE_ACCOUNT_INFO, curSelectedItem)) hashMapOf(
Pair(MerchantCenterActivity.EXTRA_LIFE_ACCOUNT_INFO, curSelectedItem),
Pair(MerchantCenterActivity.EXTRA_IS_MULTI, true)
)
) )
finish() finish()
} }
......
...@@ -63,7 +63,7 @@ class LifeAccountPersonalAuthCompleteActivity : ...@@ -63,7 +63,7 @@ class LifeAccountPersonalAuthCompleteActivity :
finish() finish()
} }
viewBind.upgradeEnterpriseAuth.setOnClickListener { viewBind.upgradeEnterpriseAuth.setOnClickListener {
// TODO: 6/10/21 传入生活号id // 传入生活号id 请求企业认证升级相关接口用
XPageManager.push( XPageManager.push(
XRouterPathConstants.LIFE_ACCOUNT_ENTERPRISE_AUTH, XRouterPathConstants.LIFE_ACCOUNT_ENTERPRISE_AUTH,
hashMapOf( hashMapOf(
......
package com.yidian.shenghuoquan.newscontent.ui.center package com.yidian.shenghuoquan.newscontent.ui.center
import android.os.Bundle import android.os.Bundle
import androidx.core.view.isVisible
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import com.yidian.common.XRouterPathConstants import com.yidian.common.XRouterPathConstants
import com.yidian.common.base.BaseActivity import com.yidian.common.base.BaseActivity
...@@ -10,20 +11,29 @@ import com.yidian.shenghuoquan.newscontent.databinding.ActivityMerchantCenterBin ...@@ -10,20 +11,29 @@ import com.yidian.shenghuoquan.newscontent.databinding.ActivityMerchantCenterBin
import com.yidian.shenghuoquan.newscontent.http.ApiService import com.yidian.shenghuoquan.newscontent.http.ApiService
import com.yidian.shenghuoquan.newscontent.http.callback.IGetConfigListCallback import com.yidian.shenghuoquan.newscontent.http.callback.IGetConfigListCallback
import com.yidian.shenghuoquan.newscontent.http.httpbean.GetConfigListBean import com.yidian.shenghuoquan.newscontent.http.httpbean.GetConfigListBean
import com.yidian.shenghuoquan.newscontent.widget.LifeAccountLabelView import com.yidian.shenghuoquan.newscontent.http.httpbean.LifeAccountItemBean
/** /**
* author: yinjiacheng * author: yinjiacheng
* date: 6/8/21 8:11 PM * date: 6/8/21 8:11 PM
* description: 商户管理中心 * description: 商户管理中心
*/ */
class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>() { class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>(),
IGetConfigListCallback {
companion object { companion object {
// 传递的生活号信息 // 传递的生活号信息
const val EXTRA_LIFE_ACCOUNT_INFO = "lifeAccountInfo" const val EXTRA_LIFE_ACCOUNT_INFO = "lifeAccountInfo"
// 是否有多个生活号
const val EXTRA_IS_MULTI = "isMulti"
} }
/**
* 当前生活号
*/
private lateinit var curLifeAccount: LifeAccountItemBean.Response
override fun createViewBinding(): ActivityMerchantCenterBinding { override fun createViewBinding(): ActivityMerchantCenterBinding {
return ActivityMerchantCenterBinding.inflate(layoutInflater) return ActivityMerchantCenterBinding.inflate(layoutInflater)
} }
...@@ -36,39 +46,51 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>() { ...@@ -36,39 +46,51 @@ class MerchantCenterActivity : BaseActivity<ActivityMerchantCenterBinding>() {
super.init(savedInstanceState) super.init(savedInstanceState)
initView() initView()
initListener() initListener()
initData()
} }
private fun initView() { private fun initView() {
viewBind.viewCommonHeader.tvTitle.text = resources.getString(R.string.management_center) viewBind.viewCommonHeader.tvTitle.text = resources.getString(R.string.management_center)
// Test
viewBind.lvLifeAccountLabel.setLifeAccountData(
"一点资讯生活号",
LifeAccountLabelView.STATUS_LIFE_ACCOUNT_NOT_AUTH,
null
)
// 本期需求无资产功能 仅做UI展示 // 本期需求无资产功能 仅做UI展示
viewBind.avMerchantAsset.setMerchantAssetData(8856.88, 675.00) viewBind.avMerchantAsset.setMerchantAssetData(8856.88, 675.00)
}
private fun initListener() {
// Test }
ApiService.getConfigList(object : IGetConfigListCallback {
override fun getConfigListSuccess(result: GetConfigListBean.Response?) {
viewBind.rvServiceGroup.layoutManager =
LinearLayoutManager(this@MerchantCenterActivity)
viewBind.rvServiceGroup.addItemDecoration(MerchantServiceGroupAdapter.MerchantServiceGroupItemDecorator())
viewBind.rvServiceGroup.adapter = MerchantServiceGroupAdapter(
this@MerchantCenterActivity,
result?.merchant_manager_center?.items
)
}
override fun getConfigListFailure(message: String?) { private fun initData() {
val params = intent.getSerializableExtra(XRouterPathConstants.ParamsKey)?.let {
it as HashMap<*, *>
}
// 切换主体入口判断
viewBind.tvSwitch.isVisible = params?.get(EXTRA_IS_MULTI) as Boolean
curLifeAccount =
params[EXTRA_LIFE_ACCOUNT_INFO]?.let { it as LifeAccountItemBean.Response } ?: return
// 设置当前生活号信息
viewBind.lvLifeAccountLabel.setLifeAccountData(
curLifeAccount.life_account_name,
curLifeAccount.life_account_auth_status,
curLifeAccount.life_account_type,
curLifeAccount.enterprise_audit_status
)
} // 请求功能入口配置清单
ApiService.getConfigList(this)
}
}) override fun getConfigListSuccess(result: GetConfigListBean.Response?) {
viewBind.rvServiceGroup.layoutManager =
LinearLayoutManager(this)
viewBind.rvServiceGroup.addItemDecoration(MerchantServiceGroupAdapter.MerchantServiceGroupItemDecorator())
viewBind.rvServiceGroup.adapter = MerchantServiceGroupAdapter(
this,
result?.merchant_manager_center?.items
)
} }
private fun initListener() { override fun getConfigListFailure(message: String?) {
} }
} }
...@@ -4,6 +4,7 @@ import android.content.Context ...@@ -4,6 +4,7 @@ import android.content.Context
import android.util.AttributeSet 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 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
...@@ -19,26 +20,26 @@ class LifeAccountLabelView @JvmOverloads constructor( ...@@ -19,26 +20,26 @@ class LifeAccountLabelView @JvmOverloads constructor(
) : ConstraintLayout(context, attrs, defStyle), View.OnClickListener { ) : ConstraintLayout(context, attrs, defStyle), View.OnClickListener {
companion object { companion object {
// 已认证
const val STATUS_LIFE_ACCOUNT_AUTH = 11
// 未认证 // 未认证
const val STATUS_LIFE_ACCOUNT_NOT_AUTH = 12 const val STATUS_LIFE_ACCOUNT_NOT_AUTH = 1
// 认证驳回 // 已认证
const val STATUS_LIFE_ACCOUNT_REJECT = 13 const val STATUS_LIFE_ACCOUNT_AUTH = 2
// 审核中 // 审核中
const val STATUS_LIFE_ACCOUNT_AUDIT = 14 const val STATUS_LIFE_ACCOUNT_AUDIT = 10
// 认证驳回
const val STATUS_LIFE_ACCOUNT_REJECT = 30
// 个人 // 个人
const val TYPE_LIFE_ACCOUNT_PERSONAL = 20 const val TYPE_LIFE_ACCOUNT_PERSONAL = 1
// 个体工商户 // 个体工商户
const val TYPE_LIFE_ACCOUNT_INDIVIDUAL_BUSINESS = 21 const val TYPE_LIFE_ACCOUNT_INDIVIDUAL_BUSINESS = 2
// 普通企业 // 普通企业
const val TYPE_LIFE_ACCOUNT_COMMON_ENTERPRISE = 22 const val TYPE_LIFE_ACCOUNT_COMMON_ENTERPRISE = 3
} }
private val viewBinding = ViewLifeAccountLabelBinding.bind( private val viewBinding = ViewLifeAccountLabelBinding.bind(
...@@ -55,16 +56,26 @@ class LifeAccountLabelView @JvmOverloads constructor( ...@@ -55,16 +56,26 @@ class LifeAccountLabelView @JvmOverloads constructor(
/** /**
* 设置生活号信息 * 设置生活号信息
* 先判断认证状态 再判断审核状态 即审核中和审核驳回状态可覆盖认证状态
* @param name 生活号名称 * @param name 生活号名称
* @param status 生活号状态 * @param status 生活号认证状态
* @param type 生活号类型 * @param type 生活号类型
* @param audit 生活号审核状态
*/ */
fun setLifeAccountData(name: String, status: Int, type: Int?) { fun setLifeAccountData(name: String?, status: Int?, type: Int?, audit: Int?) {
viewBinding.tvLifeAccountName.text = name viewBinding.tvLifeAccountName.text = name
viewBinding.tvLifeAccountStatus.apply { viewBinding.tvLifeAccountStatus.apply {
when (status) { when (status) {
STATUS_LIFE_ACCOUNT_NOT_AUTH -> {
// 未认证
setBackgroundResource(R.drawable.shape_life_account_status_unauth)
setTextColor(ContextCompat.getColor(context, R.color.color_333333))
text = resources.getString(R.string.not_auth)
}
STATUS_LIFE_ACCOUNT_AUTH -> { STATUS_LIFE_ACCOUNT_AUTH -> {
// 已认证
setBackgroundResource(R.drawable.shape_life_account_status_auth) setBackgroundResource(R.drawable.shape_life_account_status_auth)
setTextColor(ContextCompat.getColor(context, R.color.color_FF1852F1))
text = when (type) { text = when (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)
...@@ -72,18 +83,20 @@ class LifeAccountLabelView @JvmOverloads constructor( ...@@ -72,18 +83,20 @@ class LifeAccountLabelView @JvmOverloads constructor(
else -> "" else -> ""
} }
} }
}
when (audit) {
STATUS_LIFE_ACCOUNT_AUDIT -> { STATUS_LIFE_ACCOUNT_AUDIT -> {
// 审核中
setBackgroundResource(R.drawable.shape_life_account_status_audit) setBackgroundResource(R.drawable.shape_life_account_status_audit)
setTextColor(ContextCompat.getColor(context, R.color.color_FFF26E3D))
text = resources.getString(R.string.auth_audit) text = resources.getString(R.string.auth_audit)
} }
STATUS_LIFE_ACCOUNT_REJECT -> { STATUS_LIFE_ACCOUNT_REJECT -> {
// 审核驳回
setBackgroundResource(R.drawable.shape_life_account_status_reject) setBackgroundResource(R.drawable.shape_life_account_status_reject)
setTextColor(ContextCompat.getColor(context, R.color.color_FFFF3A3A))
text = resources.getString(R.string.auth_reject) text = resources.getString(R.string.auth_reject)
} }
else -> {
setBackgroundResource(R.drawable.shape_life_account_status_unauth)
text = resources.getString(R.string.not_auth)
}
} }
} }
} }
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<solid android:color="#FFEBECEF" /> <solid android:color="@color/color_FFFFF3EE" />
<corners android:radius="21dp" /> <corners android:radius="21dp" />
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<solid android:color="#FFEBECEF" /> <solid android:color="@color/color_FFE9EFFF" />
<corners android:radius="21dp" /> <corners android:radius="21dp" />
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<solid android:color="#FFEBECEF" /> <solid android:color="@color/color_FFFFEEEE" />
<corners android:radius="21dp" /> <corners android:radius="21dp" />
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
<shape xmlns:android="http://schemas.android.com/apk/res/android" <shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle"> android:shape="rectangle">
<solid android:color="#FFEBECEF" /> <solid android:color="@color/color_FFEBECEF" />
<corners android:radius="21dp" /> <corners android:radius="21dp" />
......
...@@ -55,4 +55,7 @@ ...@@ -55,4 +55,7 @@
<color name="color_FF3693FF">#FF3693FF</color> <color name="color_FF3693FF">#FF3693FF</color>
<color name="color_FF1751F1">#FF1751F1</color> <color name="color_FF1751F1">#FF1751F1</color>
<color name="color_FFF2F2F2">#FFF2F2F2</color> <color name="color_FFF2F2F2">#FFF2F2F2</color>
<color name="color_FFEBECEF">#FFEBECEF</color>
<color name="color_FFE9EFFF">#FFE9EFFF</color>
<color name="color_FFFFF3EE">#FFFFF3EE</color>
</resources> </resources>
\ 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