Commit 41473ad7 authored by yinjiacheng's avatar yinjiacheng

fix SHQBD-162 个人、企业认证身份信息提交页展示用户协议和隐私政策

parent 670e8793
......@@ -6,28 +6,29 @@ package com.yidian.shenghuoquan.newscontent.bean
* description: 生活号个人认证数据集
*/
class LifeAccountPersonalAuthData {
var realName: String? = null
var idCardNum: String? = null
var phoneNum: String? = null // 法人手机号
var occupation: String? = null
var idCardPortraitFaceObjectKey: String? = null
var idCardNationalEmblemFaceObjectKey: String? = null
var idCardPortraitFaceBucket: String? = null
var idCardNationalEmblemFaceBucket: String? = null
var isIDCardPortraitFaceUpload: Boolean = false
var isIDCardNationalEmblemFaceUpload: Boolean = false
var idCardPortraitFaceCompleteness: Int = -1
var idCardNationalEmblemFaceCompleteness: Int = -1
var liveDetectBizToken: String? = null
var liveDetectObjectKey: String? = null
var liveDetectBucket: String? = null
var isFaceAuthPass: Boolean = false
var realName: String? = null
var idCardNum: String? = null
var phoneNum: String? = null // 法人手机号
var occupation: String? = null
var idCardPortraitFaceObjectKey: String? = null
var idCardNationalEmblemFaceObjectKey: String? = null
var idCardPortraitFaceBucket: String? = null
var idCardNationalEmblemFaceBucket: String? = null
var isIDCardPortraitFaceUpload: Boolean = false
var isIDCardNationalEmblemFaceUpload: Boolean = false
var idCardPortraitFaceCompleteness: Int = -1
var idCardNationalEmblemFaceCompleteness: Int = -1
var liveDetectBizToken: String? = null
var liveDetectObjectKey: String? = null
var liveDetectBucket: String? = null
var isFaceAuthPass: Boolean = false
var isAgreePrivacyAgreement: Boolean = false // 是否同意用户协议和隐私政策
// 身份证相关信息
var gender: String? = null
var address: String? = null
var nationality: String? = null
var validDateStart: String? = null
var validDateEnd: String? = null
var issuedBy: String? = null
// 身份证相关信息
var gender: String? = null
var address: String? = null
var nationality: String? = null
var validDateStart: String? = null
var validDateEnd: String? = null
var issuedBy: String? = null
}
......@@ -136,12 +136,14 @@ class LifeAccountEnterpriseAuthActivity : BaseActivity<ActivityLifeAccountEnterp
viewBind.btnNext.alpha = 1f
viewBind.btnNext.isEnabled = true
} else if (viewBind.pvAuthProcess.curProcess == LifeAccountAuthProcessView.PROCESS_ENTERPRISE_MANAGER
&& LifeAccountAuthDataManager.personalAuthData.isAgreePrivacyAgreement
&& LifeAccountAuthDataManager.merchantAuthData.merchantType == Constant.TYPE_INDIVIDUAL_BUSINESS
&& LifeAccountAuthDataManager.personalAuthData.isFaceAuthPass
) {
viewBind.btnNext.alpha = 1f
viewBind.btnNext.isEnabled = true
} else if (viewBind.pvAuthProcess.curProcess == LifeAccountAuthProcessView.PROCESS_ENTERPRISE_MANAGER
&& LifeAccountAuthDataManager.personalAuthData.isAgreePrivacyAgreement
&& LifeAccountAuthDataManager.merchantAuthData.merchantType == Constant.TYPE_COMMON_ENTERPRISE
&& LifeAccountAuthDataManager.personalAuthData.isIDCardPortraitFaceUpload
&& LifeAccountAuthDataManager.personalAuthData.isIDCardNationalEmblemFaceUpload
......@@ -212,6 +214,15 @@ class LifeAccountEnterpriseAuthActivity : BaseActivity<ActivityLifeAccountEnterp
curFragment = targetFragment
}
/**
* 清理认证数据
* 避免在修改认证时出现数据异常
*/
private fun cleanLifeAccountAuthData() {
LifeAccountAuthDataManager.merchantAuthData.merchantType = 0
LifeAccountAuthDataManager.personalAuthData.isAgreePrivacyAgreement = false
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.sv_merchant_type -> {
......@@ -296,6 +307,8 @@ class LifeAccountEnterpriseAuthActivity : BaseActivity<ActivityLifeAccountEnterp
bundle.putSerializable(LifeAccountIDCardAuthFragment.EXTRA_AUTH_DATA, authData)
fragment.arguments = bundle
switchFragment(fragment)
// 检查下一步条件
checkNextCondition()
}
override fun authBusinessLicenseCommitFailure(message: String?) {
......@@ -305,6 +318,8 @@ class LifeAccountEnterpriseAuthActivity : BaseActivity<ActivityLifeAccountEnterp
override fun authEnterpriseLegalIdentityCommitSuccess(result: AuthEnterpriseLegalIdentityCommitBean.Response?) {
// 本地保存生活号id
StorageUtil.putLifeAccountId(result?.life_account_id)
// 清理认证数据
cleanLifeAccountAuthData()
// 普通企业法人身份信息提交成功
XPageManager.push(
XRouterPathConstants.LIFE_ACCOUNT_ENTERPRISE_AUTH_COMPLETE,
......@@ -327,6 +342,8 @@ class LifeAccountEnterpriseAuthActivity : BaseActivity<ActivityLifeAccountEnterp
override fun authIndividualBusinessCompleteSuccess(result: AuthIndividualBusinessCompleteBean.Response?) {
// 本地保存生活号id
StorageUtil.putLifeAccountId(result?.life_account_id)
// 清理认证数据
cleanLifeAccountAuthData()
// 个体工商户认证完成
XPageManager.push(
XRouterPathConstants.LIFE_ACCOUNT_ENTERPRISE_AUTH_COMPLETE,
......
......@@ -41,6 +41,7 @@ import com.yidian.shenghuoquan.newscontent.utils.KS3Core
import com.yidian.shenghuoquan.newscontent.widget.LifeAccountAuthIdentityInfoEditView
import com.yidian.shenghuoquan.newscontent.widget.LifeAccountAuthImageView
import com.yidian.shenghuoquan.newscontent.widget.LifeAccountFaceAuthView
import com.yidian.shenghuoquan.newscontent.widget.PrivacyAgreementView
import com.yidian.utils.ToastUtil
import java.io.File
......@@ -55,7 +56,7 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
IAuthLiveIdentityCallback, LifeAccountAuthImageView.OnLifeAccountAuthImageViewCallback,
LifeAccountAuthIdentityInfoEditView.OnLifeAccountAuthIdentityInfoEditViewCallback,
IAuthIndividualBusinessIdentityCommitCallback, IAuthEnterpriseLiveIdentityCallback,
LifeAccountFaceAuthView.OnLifeAccountFaceAuthCallback {
LifeAccountFaceAuthView.OnLifeAccountFaceAuthCallback, PrivacyAgreementView.OnPrivacyAgreementCallback {
companion object {
// 身份证采集页面回传数据
......@@ -155,6 +156,7 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
viewBinding.evIdCardNumber.setOnLifeAccountAuthIdentityInfoEditViewCallback(this)
viewBinding.evMobile.setOnLifeAccountAuthIdentityInfoEditViewCallback(this)
viewBinding.avFaceAuth.setOnLifeAccountFaceAuthCallback(this)
viewBinding.avPrivacyAgreement.setOnPrivacyAgreementCallback(this)
}
private fun initData() {
......@@ -847,4 +849,14 @@ class LifeAccountIDCardAuthFragment : BaseFragment<FragmentLifeAccountIdCardAuth
&& LifeAccountAuthDataManager.personalAuthData.isIDCardNationalEmblemFaceUpload
}
override fun onCheckPrivacyAgreement(isCheck: Boolean) {
LifeAccountAuthDataManager.personalAuthData.isAgreePrivacyAgreement = isCheck
// 检查下一步条件
if (authType == Constant.TYPE_AUTH_PERSONAL) {
(activity as LifeAccountPersonalAuthActivity).checkNextCondition()
} else {
(activity as LifeAccountEnterpriseAuthActivity).checkNextCondition()
}
}
}
......@@ -87,10 +87,7 @@ class LifeAccountPersonalAuthActivity :
private fun initListener() {
viewBind.svOccupation.setOnClickListener(this)
viewBind.cbProtocol.setOnCheckedChangeListener(this)
viewBind.btnNext.setOnClickListener(this)
viewBind.tvPrivacyCertification.setOnClickListener(this)
viewBind.tvUserAgreement.setOnClickListener(this)
}
private fun initData() {
......@@ -108,7 +105,7 @@ class LifeAccountPersonalAuthActivity :
* 检查是否可以进行下一步
*/
fun checkNextCondition() {
if (viewBind.cbProtocol.isChecked
if (LifeAccountAuthDataManager.personalAuthData.isAgreePrivacyAgreement
&& !LifeAccountAuthDataManager.personalAuthData.occupation.isNullOrEmpty()
&& LifeAccountAuthDataManager.personalAuthData.isFaceAuthPass
) {
......@@ -127,6 +124,14 @@ class LifeAccountPersonalAuthActivity :
viewBind.svOccupation.enableSelect(false)
}
/**
* 清理认证数据
* 避免在升级企业认证时出现数据异常
*/
private fun cleanLifeAccountAuthData() {
LifeAccountAuthDataManager.personalAuthData.isAgreePrivacyAgreement = false
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.sv_occupation -> {
......@@ -136,19 +141,6 @@ class LifeAccountPersonalAuthActivity :
// 个人认证 完成认证
ApiService.authComplete(this, lifeAccountId?.let { hashMapOf(Pair(EXTRA_LIFE_ACCOUNT_ID, it)) } ?: hashMapOf())
}
R.id.tv_privacy_certification -> {
val urlMap = HashMap<String, String>()
urlMap[ProtocolActivity.ProtocolUrlKey] = AppConfig.privacyPolicyStatement
XPageManager.push(XRouterPathConstants.PROTOCOL, urlMap)
}
R.id.tv_user_agreement -> {
val urlMap = HashMap<String, String>()
urlMap[ProtocolActivity.ProtocolUrlKey] = AppConfig.userProtocol
XPageManager.push(XRouterPathConstants.PROTOCOL, urlMap)
}
}
}
......@@ -160,6 +152,8 @@ class LifeAccountPersonalAuthActivity :
override fun authPersonalCompleteSuccess(result: AuthPersonalCompleteBean.Response?) {
// 本地保存生活号id
StorageUtil.putLifeAccountId(result?.life_account_id)
// 清理认证数据
cleanLifeAccountAuthData()
// 跳转个人认证成功页
XPageManager.push(
XRouterPathConstants.LIFE_ACCOUNT_PERSONAL_AUTH_COMPLETE,
......
package com.yidian.shenghuoquan.newscontent.widget
import android.content.Context
import android.util.AttributeSet
import android.view.View
import android.widget.CompoundButton
import androidx.constraintlayout.widget.ConstraintLayout
import com.yidian.common.AppConfig
import com.yidian.common.XRouterPathConstants
import com.yidian.shenghuoquan.newscontent.R
import com.yidian.shenghuoquan.newscontent.databinding.ViewPrivacyAgreementBinding
import com.yidian.shenghuoquan.newscontent.ui.ProtocolActivity
import com.yidian.xpage.XPageManager
/**
* author: yinjiacheng
* date: 6/24/21 3:32 AM
* description: 用户协议、隐私政策
*/
class PrivacyAgreementView @JvmOverloads constructor(
context: Context,
attrs: AttributeSet? = null,
defStyle: Int = 0
) : ConstraintLayout(context, attrs, defStyle), View.OnClickListener, CompoundButton.OnCheckedChangeListener {
private val viewBinding: ViewPrivacyAgreementBinding =
ViewPrivacyAgreementBinding.bind(
View.inflate(
getContext(),
R.layout.view_privacy_agreement,
this
)
)
private var callback: OnPrivacyAgreementCallback? = null
init {
viewBinding.tvPrivacyPolicy.setOnClickListener(this)
viewBinding.tvUserAgreement.setOnClickListener(this)
viewBinding.cbAgree.setOnCheckedChangeListener(this)
}
override fun onClick(v: View?) {
val id = v?.id
if (id == R.id.tv_privacy_policy) {
// 隐私政策
XPageManager.push(XRouterPathConstants.PROTOCOL, hashMapOf(Pair(ProtocolActivity.ProtocolUrlKey, AppConfig.privacyPolicyStatement)))
} else if (id == R.id.tv_user_agreement) {
// 用户协议
XPageManager.push(XRouterPathConstants.PROTOCOL, hashMapOf(Pair(ProtocolActivity.ProtocolUrlKey, AppConfig.userProtocol)))
}
}
/**
* 获取当前是否选中
*/
fun getCheckState(): Boolean {
return viewBinding.cbAgree.isChecked
}
override fun onCheckedChanged(buttonView: CompoundButton?, isChecked: Boolean) {
if (buttonView?.isPressed == false) return
callback?.onCheckPrivacyAgreement(isChecked)
}
fun setOnPrivacyAgreementCallback(callback: OnPrivacyAgreementCallback) {
this.callback = callback
}
interface OnPrivacyAgreementCallback {
/**
* 选择用户协议和隐私政策
*/
fun onCheckPrivacyAgreement(isCheck: Boolean)
}
}
......@@ -38,7 +38,8 @@
<com.yidian.nightmode.widget.YdScrollView
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginBottom="25dp"
android:layout_marginBottom="16dp"
android:fillViewport="true"
app:layout_constraintBottom_toTopOf="@id/btn_next"
app:layout_constraintTop_toBottomOf="@id/sv_merchant_type">
......
......@@ -24,54 +24,9 @@
android:id="@+id/fragment_container"
android:layout_width="match_parent"
android:layout_height="0dp"
android:layout_marginBottom="19dp"
app:layout_constraintBottom_toTopOf="@id/ll_protocol"
app:layout_constraintTop_toBottomOf="@id/sv_occupation" />
<com.yidian.nightmode.widget.YdLinearLayout
android:id="@+id/ll_protocol"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginBottom="19dp"
android:gravity="center_vertical"
android:orientation="horizontal"
android:layout_marginBottom="16dp"
app:layout_constraintBottom_toTopOf="@id/btn_next"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent">
<com.yidian.nightmode.widget.YdCheckedBox
android:id="@+id/cb_protocol"
android:layout_width="27dp"
android:layout_height="27dp"
android:layout_marginEnd="2dp"
android:button="@drawable/selector_protocol_check"
android:clickable="true"
android:focusable="true" />
<com.yidian.nightmode.widget.YdTextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/agree"
android:textColor="#FF999999"
android:textSize="13sp" />
<com.yidian.nightmode.widget.YdTextView
android:id="@+id/tv_privacy_certification"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/privacy_certification"
android:textColor="#FF1852F1"
android:textSize="13sp" />
<com.yidian.nightmode.widget.YdTextView
android:id="@+id/tv_user_agreement"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/user_agreement"
android:textColor="#FF1852F1"
android:textSize="13sp" />
</com.yidian.nightmode.widget.YdLinearLayout>
app:layout_constraintTop_toBottomOf="@id/sv_occupation" />
<com.yidian.nightmode.widget.YdButton
android:id="@+id/btn_next"
......
......@@ -97,4 +97,12 @@
android:visibility="gone"
app:layout_constraintTop_toBottomOf="@id/ev_id_card_number" />
<com.yidian.shenghuoquan.newscontent.widget.PrivacyAgreementView
android:id="@+id/av_privacy_agreement"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" />
</com.yidian.nightmode.widget.YdConstraintLayout>
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout 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">
<CheckBox
android:id="@+id/cb_agree"
android:layout_width="@dimen/dp27"
android:layout_height="@dimen/dp27"
android:button="@drawable/selector_protocol_check"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_agree"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginStart="@dimen/dp2"
android:text="@string/agree"
android:textColor="@color/color_999999"
android:textSize="@dimen/sp13"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/cb_agree"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_user_agreement"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/user_agreement"
android:textColor="@color/color_FF1852F1"
android:textSize="@dimen/sp13"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/tv_agree"
app:layout_constraintTop_toTopOf="parent" />
<TextView
android:id="@+id/tv_privacy_policy"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="@string/privacy_certification"
android:textColor="@color/color_FF1852F1"
android:textSize="@dimen/sp13"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintStart_toEndOf="@id/tv_user_agreement"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
\ 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