Commit 02814fc0 authored by yinjiacheng's avatar yinjiacheng

add 商户基本信息-生活号企业认证信息

parent 3aa39181
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<dimen name="sp16">16sp</dimen> <dimen name="sp16">16sp</dimen>
<dimen name="sp18">18sp</dimen> <dimen name="sp18">18sp</dimen>
<dimen name="sp20">20sp</dimen> <dimen name="sp20">20sp</dimen>
<dimen name="sp23">23sp</dimen>
<dimen name="sp24">24sp</dimen> <dimen name="sp24">24sp</dimen>
<dimen name="sp40">40sp</dimen> <dimen name="sp40">40sp</dimen>
......
...@@ -14,19 +14,26 @@ class GetLifeAccountInfoByIdBean { ...@@ -14,19 +14,26 @@ class GetLifeAccountInfoByIdBean {
data class Response( data class Response(
val code: String, val code: String,
val create_time: String, val create_time: String,
val create_user_mobile: String, val enterprise_auth_record_id: Int,
val create_user_nick_name: String, val enterprise_auth_record_status: Int,
val full_name: String,
val id_card: String,
val id_type: Int, val id_type: Int,
val legal_id_card: String,
val legal_person: String,
val life_account_admin_id: Long,
val life_account_auth_status: Int, val life_account_auth_status: Int,
val life_account_id: Long, val life_account_id: Long,
val life_account_name: String, val life_account_name: String,
val life_account_origin: String,
val life_account_status: Int, val life_account_status: Int,
val life_account_type: Int, val life_account_type: Int,
val merchant_id: Int,
val name: String, val name: String,
val shop_auditing_count: Int,
val shop_count: Int,
val shop_totel_count: Int,
val update_time: String,
val occupation: String, val occupation: String,
val legal_person: String val mobile: String
) : Serializable ) : Serializable
} }
\ No newline at end of file
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 com.orhanobut.hawk.Hawk
import com.yidian.common.HawkConfig
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.constant.Constant
import com.yidian.shenghuoquan.newscontent.databinding.ActivityMerchantAuthInfoBinding import com.yidian.shenghuoquan.newscontent.databinding.ActivityMerchantAuthInfoBinding
import com.yidian.shenghuoquan.newscontent.http.httpbean.GetLifeAccountInfoByIdBean import com.yidian.shenghuoquan.newscontent.http.httpbean.GetLifeAccountInfoByIdBean
...@@ -13,11 +17,20 @@ import com.yidian.shenghuoquan.newscontent.http.httpbean.GetLifeAccountInfoByIdB ...@@ -13,11 +17,20 @@ import com.yidian.shenghuoquan.newscontent.http.httpbean.GetLifeAccountInfoByIdB
*/ */
class MerchantAuthInfoActivity : BaseActivity<ActivityMerchantAuthInfoBinding>() { class MerchantAuthInfoActivity : BaseActivity<ActivityMerchantAuthInfoBinding>() {
companion object {
const val EXTRA_LIFE_ACCOUNT_INFO = "life_account_info"
}
/**
* 生活号详情
*/
private val lifeAccountInfo by lazy { private val lifeAccountInfo by lazy {
intent.getSerializableExtra(XRouterPathConstants.ParamsKey)?.let { intent.getSerializableExtra(XRouterPathConstants.ParamsKey)?.let { params ->
(params as HashMap<*, *>)[EXTRA_LIFE_ACCOUNT_INFO]?.let {
it as GetLifeAccountInfoByIdBean.Response it as GetLifeAccountInfoByIdBean.Response
} }
} }
}
override fun createViewBinding(): ActivityMerchantAuthInfoBinding { override fun createViewBinding(): ActivityMerchantAuthInfoBinding {
return ActivityMerchantAuthInfoBinding.inflate(layoutInflater) return ActivityMerchantAuthInfoBinding.inflate(layoutInflater)
...@@ -29,25 +42,45 @@ class MerchantAuthInfoActivity : BaseActivity<ActivityMerchantAuthInfoBinding>() ...@@ -29,25 +42,45 @@ class MerchantAuthInfoActivity : BaseActivity<ActivityMerchantAuthInfoBinding>()
override fun init(savedInstanceState: Bundle?) { override fun init(savedInstanceState: Bundle?) {
super.init(savedInstanceState) super.init(savedInstanceState)
initView()
initListener()
initData() initData()
} }
private fun initView() {
}
private fun initListener() {
}
private fun initData() { private fun initData() {
when (lifeAccountInfo?.id_type) {
Constant.TYPE_AUTH_PERSONAL -> {
// 个人认证
viewBind.ivPersonAuthInfo.isVisible = true
viewBind.ivPersonAuthInfo.fillAuthInfo( viewBind.ivPersonAuthInfo.fillAuthInfo(
lifeAccountInfo?.occupation, lifeAccountInfo?.occupation,
lifeAccountInfo?.legal_person, lifeAccountInfo?.legal_person,
lifeAccountInfo?.id_card, lifeAccountInfo?.legal_id_card,
lifeAccountInfo?.create_user_mobile Hawk.get(HawkConfig.Mobile)
) )
} }
Constant.TYPE_AUTH_INDIVIDUAL_BUSINESS -> {
// 个人工商户认证
viewBind.ivEnterpriseAuthInfo.isVisible = true
viewBind.ivEnterpriseAuthInfo.fillAuthInfo(
lifeAccountInfo?.id_type,
lifeAccountInfo?.enterprise_auth_record_status,
lifeAccountInfo?.name,
lifeAccountInfo?.code,
lifeAccountInfo?.legal_person,
lifeAccountInfo?.legal_id_card
)
}
Constant.TYPE_AUTH_COMMON_ENTERPRISE -> {
// 普通企业认证
viewBind.ivEnterpriseAuthInfo.isVisible = true
viewBind.ivEnterpriseAuthInfo.fillAuthInfo(
lifeAccountInfo?.id_type,
lifeAccountInfo?.enterprise_auth_record_status,
lifeAccountInfo?.name,
lifeAccountInfo?.code,
lifeAccountInfo?.legal_person,
lifeAccountInfo?.legal_id_card
)
}
}
}
} }
\ No newline at end of file
...@@ -196,7 +196,7 @@ class MerchantInfoActivity : BaseActivity<ActivityMerchantInfoBinding>(), View.O ...@@ -196,7 +196,7 @@ class MerchantInfoActivity : BaseActivity<ActivityMerchantInfoBinding>(), View.O
// 跳转认证详情页 // 跳转认证详情页
XPageManager.push( XPageManager.push(
XRouterPathConstants.MERCHANT_AUTH_INFO, XRouterPathConstants.MERCHANT_AUTH_INFO,
hashMapOf(Pair(XRouterPathConstants.ParamsKey, result)) hashMapOf(Pair(MerchantAuthInfoActivity.EXTRA_LIFE_ACCOUNT_INFO, result))
) )
} }
......
package com.yidian.shenghuoquan.newscontent.widget
import android.content.Context
import android.util.AttributeSet
import android.view.View
import androidx.constraintlayout.widget.ConstraintLayout
import androidx.core.content.ContextCompat
import com.yidian.shenghuoquan.newscontent.R
import com.yidian.shenghuoquan.newscontent.constant.Constant
import com.yidian.shenghuoquan.newscontent.databinding.ViewLifeAccountEnterpriseAuthInfoBinding
import com.yidian.shenghuoquan.newscontent.utils.SensitiveInfoUtil
/**
* author: yinjiacheng
* date: 6/15/21 4:43 PM
* description: 商户管理中心-基本信息-生活号企业认证信息
*/
class LifeAccountEnterpriseAuthInfoView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyle: Int = 0
) : ConstraintLayout(context, attrs, defStyle) {
private val viewBinding by lazy {
ViewLifeAccountEnterpriseAuthInfoBinding.bind(
View.inflate(
getContext(),
R.layout.view_life_account_enterprise_auth_info,
this
)
)
}
/**
* 填充认证信息
* @param authType 认证类型
* @param auditStatus 审核状态
* @param registrationName 公司名称
* @param registrationCode 统一社会信用代码
* @param realName 经营者姓名或法人姓名
* @param idCardNo 经营者身份证号或法人身份证号
*/
fun fillAuthInfo(
authType: Int?,
auditStatus: Int?,
registrationName: String?,
registrationCode: String?,
realName: String?,
idCardNo: String?
) {
viewBinding.tvContentRegistrationName.text = registrationName
viewBinding.tvContentRegistrationCode.text = registrationCode
viewBinding.tvContentManagerInfo.text =
String.format(
"%s %s",
realName,
SensitiveInfoUtil.idCardNumEncrypt(idCardNo.toString())
)
when (authType) {
Constant.TYPE_AUTH_INDIVIDUAL_BUSINESS -> {
// 个体工商户
viewBinding.tvAuthType.text = resources.getText(R.string.enterprise_auth)
viewBinding.tvTitleManagerInfo.text =
resources.getText(R.string.operator_information)
}
Constant.TYPE_AUTH_COMMON_ENTERPRISE -> {
// 普通企业
viewBinding.tvAuthType.text = resources.getText(R.string.individual_business)
viewBinding.tvTitleManagerInfo.text = resources.getText(R.string.legal_person_info)
}
}
when (auditStatus) {
Constant.STATUS_AUDIT_UNDER -> {
// 审核中
viewBinding.tvAuditStatus.text = resources.getText(R.string.under_audit)
viewBinding.tvAuditStatus.setBackgroundResource(R.drawable.shape_life_account_status_audit)
viewBinding.tvAuditStatus.setTextColor(
ContextCompat.getColor(
context,
R.color.color_FFF26E3D
)
)
}
Constant.STATUS_AUDIT_PASS -> {
// 审核通过(已开通)
viewBinding.tvAuditStatus.text = resources.getText(R.string.audit_pass)
viewBinding.tvAuditStatus.setBackgroundResource(R.drawable.shape_life_account_status_open)
viewBinding.tvAuditStatus.setTextColor(
ContextCompat.getColor(
context,
R.color.color_FF6BB81F
)
)
}
Constant.STATUS_AUDIT_REJECT -> {
// 审核驳回
viewBinding.tvAuditStatus.text = resources.getText(R.string.audit_reject)
viewBinding.tvAuditStatus.setBackgroundResource(R.drawable.shape_life_account_status_reject)
viewBinding.tvAuditStatus.setTextColor(
ContextCompat.getColor(
context,
R.color.color_FFFF3A3A
)
)
}
}
}
}
\ No newline at end of file
...@@ -96,7 +96,7 @@ class LifeAccountLabelView @JvmOverloads constructor( ...@@ -96,7 +96,7 @@ class LifeAccountLabelView @JvmOverloads constructor(
// 审核中 // 审核中
setBackgroundResource(R.drawable.shape_life_account_status_audit) setBackgroundResource(R.drawable.shape_life_account_status_audit)
setTextColor(ContextCompat.getColor(context, R.color.color_FFF26E3D)) setTextColor(ContextCompat.getColor(context, R.color.color_FFF26E3D))
text = resources.getString(R.string.auth_audit) text = resources.getString(R.string.under_audit)
} }
STATUS_LIFE_ACCOUNT_REJECT -> { STATUS_LIFE_ACCOUNT_REJECT -> {
// 审核驳回 // 审核驳回
......
...@@ -10,7 +10,7 @@ import com.yidian.shenghuoquan.newscontent.databinding.ViewLifeAccountPersonalAu ...@@ -10,7 +10,7 @@ import com.yidian.shenghuoquan.newscontent.databinding.ViewLifeAccountPersonalAu
/** /**
* author: yinjiacheng * author: yinjiacheng
* date: 6/15/21 10:48 AM * date: 6/15/21 10:48 AM
* description: 生活号个人认证信息 * description: 商户管理中心-基本信息-生活号个人认证信息
*/ */
class LifeAccountPersonalAuthInfoView @JvmOverloads constructor( class LifeAccountPersonalAuthInfoView @JvmOverloads constructor(
context: Context, context: Context,
......
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="@color/color_FFE8F9D8" />
<corners android:radius="21dp" />
</shape>
\ No newline at end of file
...@@ -2,7 +2,8 @@ ...@@ -2,7 +2,8 @@
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android" <androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:background="@color/color_FFFFFFFF">
<com.yidian.shenghuoquan.newscontent.widget.CommonTopBarView <com.yidian.shenghuoquan.newscontent.widget.CommonTopBarView
android:id="@+id/bv_top_bar" android:id="@+id/bv_top_bar"
...@@ -11,14 +12,22 @@ ...@@ -11,14 +12,22 @@
app:CommonTopBarView_title_text="@string/life_account_auth_info" app:CommonTopBarView_title_text="@string/life_account_auth_info"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
<com.yidian.shenghuoquan.newscontent.widget.LifeAccountPersonalAuthInfoView <com.yidian.shenghuoquan.newscontent.widget.LifeAccountPersonalAuthInfoView
android:id="@+id/iv_person_auth_info" android:id="@+id/iv_person_auth_info"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp29" android:layout_marginTop="@dimen/dp29"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/bv_top_bar" /> app:layout_constraintTop_toBottomOf="@id/bv_top_bar" />
<com.yidian.shenghuoquan.newscontent.widget.LifeAccountEnterpriseAuthInfoView
android:id="@+id/iv_enterprise_auth_info"
android:layout_width="@dimen/dp302"
android:layout_height="@dimen/dp284"
android:visibility="gone"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/bv_top_bar" />
</androidx.constraintlayout.widget.ConstraintLayout> </androidx.constraintlayout.widget.ConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.cardview.widget.CardView xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="wrap_content"
android:layout_height="wrap_content">
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="@dimen/dp19">
<TextView
android:id="@+id/tv_auth_type"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:includeFontPadding="false"
android:textColor="@color/color_333333"
android:textSize="@dimen/sp23"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_audit_status"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp10"
android:includeFontPadding="false"
android:paddingStart="@dimen/dp6"
android:paddingTop="@dimen/dp1"
android:paddingEnd="@dimen/dp6"
android:paddingBottom="@dimen/dp1"
android:textColor="@color/color_333333"
android:textSize="@dimen/sp13"
app:layout_constraintBottom_toBottomOf="@id/tv_auth_type"
app:layout_constraintStart_toEndOf="@id/tv_auth_type"
app:layout_constraintTop_toTopOf="@id/tv_auth_type" />
<TextView
android:id="@+id/tv_title_registration_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp19"
android:includeFontPadding="false"
android:text="@string/company_name"
android:textColor="@color/color_999999"
android:textSize="@dimen/sp15"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_auth_type" />
<TextView
android:id="@+id/tv_content_registration_name"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp6"
android:includeFontPadding="false"
android:textColor="@color/color_333333"
android:textSize="@dimen/sp15"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_title_registration_name" />
<TextView
android:id="@+id/tv_title_registration_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp19"
android:includeFontPadding="false"
android:text="@string/credit_code"
android:textColor="@color/color_999999"
android:textSize="@dimen/sp15"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_content_registration_name" />
<TextView
android:id="@+id/tv_content_registration_code"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp6"
android:includeFontPadding="false"
android:textColor="@color/color_333333"
android:textSize="@dimen/sp15"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_title_registration_code" />
<TextView
android:id="@+id/tv_title_manager_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp19"
android:includeFontPadding="false"
android:text="@string/operator_information"
android:textColor="@color/color_999999"
android:textSize="@dimen/sp15"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_content_registration_code" />
<TextView
android:id="@+id/tv_content_manager_info"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp6"
android:includeFontPadding="false"
android:textColor="@color/color_333333"
android:textSize="@dimen/sp15"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/tv_title_manager_info" />
</androidx.constraintlayout.widget.ConstraintLayout>
</androidx.cardview.widget.CardView>
\ No newline at end of file
...@@ -58,4 +58,6 @@ ...@@ -58,4 +58,6 @@
<color name="color_FFEBECEF">#FFEBECEF</color> <color name="color_FFEBECEF">#FFEBECEF</color>
<color name="color_FFE9EFFF">#FFE9EFFF</color> <color name="color_FFE9EFFF">#FFE9EFFF</color>
<color name="color_FFFFF3EE">#FFFFF3EE</color> <color name="color_FFFFF3EE">#FFFFF3EE</color>
<color name="color_FFE8F9D8">#FFE8F9D8</color>
<color name="color_FF6BB81F">#FF6BB81F</color>
</resources> </resources>
\ No newline at end of file
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
<string name="switch_life_account">切换主体</string> <string name="switch_life_account">切换主体</string>
<string name="not_auth">未认证</string> <string name="not_auth">未认证</string>
<string name="auth_reject">认证驳回</string> <string name="auth_reject">认证驳回</string>
<string name="auth_audit">审核中</string> <string name="under_audit">审核中</string>
<string name="my_asset">我的资产</string> <string name="my_asset">我的资产</string>
<string name="monthly_income">当月收入</string> <string name="monthly_income">当月收入</string>
<string name="wallet_balance">钱包余额</string> <string name="wallet_balance">钱包余额</string>
...@@ -143,7 +143,6 @@ ...@@ -143,7 +143,6 @@
<string name="auth_apply_reject">您的认证申请被驳回</string> <string name="auth_apply_reject">您的认证申请被驳回</string>
<string name="apply_auth_merchant_description">通过即享更多曝光 · 权威认证 · 服务能力</string> <string name="apply_auth_merchant_description">通过即享更多曝光 · 权威认证 · 服务能力</string>
<string name="modify_auth">修改认证</string> <string name="modify_auth">修改认证</string>
<string name="my_staff">我的员工</string> <string name="my_staff">我的员工</string>
<string name="manager_account_change_tips">管理员账号替换后,原账户将无法操作生活号所有功能,同时将自动退出当前登录状态,新账号将继承原账号所有权益。</string> <string name="manager_account_change_tips">管理员账号替换后,原账户将无法操作生活号所有功能,同时将自动退出当前登录状态,新账号将继承原账号所有权益。</string>
<string name="manager_register_tips">未注册生活圈的手机号,登录时将自动注册,且代表你已经同意《用户协议》《隐私政策》。</string> <string name="manager_register_tips">未注册生活圈的手机号,登录时将自动注册,且代表你已经同意《用户协议》《隐私政策》。</string>
...@@ -158,5 +157,8 @@ ...@@ -158,5 +157,8 @@
<string name="modify_life_account_name">修改名称</string> <string name="modify_life_account_name">修改名称</string>
<string name="save_life_account_name">保存</string> <string name="save_life_account_name">保存</string>
<string name="life_account_name_already_exist">该名称已存在</string> <string name="life_account_name_already_exist">该名称已存在</string>
<string name="audit_reject">审核驳回</string>
<string name="audit_pass">已开通</string>
<string name="legal_person_info">法人信息</string>
</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