Commit daf0c5f7 authored by 宋永孟's avatar 宋永孟

修复了攻略、说明、退出APP的三个问题

parent 157af2b6
......@@ -22,69 +22,79 @@ import com.yidian.xpage.XPageManager
*/
class LifeAccountAuthActivity : BaseActivity<ActivityLifeAccountAuthBinding>(),
View.OnClickListener, IAuthAuthenticationCallback, IAuthMerchantCheckCallback {
override fun createViewBinding(): ActivityLifeAccountAuthBinding {
return ActivityLifeAccountAuthBinding.inflate(layoutInflater)
}
override fun getXPageName(): String {
return XRouterPathConstants.LIFE_ACCOUNT_AUTH
}
override fun createViewBinding(): ActivityLifeAccountAuthBinding {
return ActivityLifeAccountAuthBinding.inflate(layoutInflater)
}
override fun init(savedInstanceState: Bundle?) {
super.init(savedInstanceState)
initView()
initListener()
}
override fun getXPageName(): String {
return XRouterPathConstants.LIFE_ACCOUNT_AUTH
}
private fun initView() {
viewBind.layoutCommonHeader.tvTitle.text = resources.getString(R.string.join_life_circle)
viewBind.viewPersonalAuth.setData(
resources.getString(R.string.personal_auth),
resources.getString(R.string.personal_auth_condition),
resources.getString(R.string.personal_auth_description), false
)
viewBind.viewEnterpriseAuth.setData(
resources.getString(R.string.enterprise_auth),
resources.getString(R.string.enterprise_auth_condition),
resources.getString(R.string.enterprise_auth_description),
false
)
}
override fun init(savedInstanceState: Bundle?) {
super.init(savedInstanceState)
initView()
initListener()
}
private fun initView() {
viewBind.layoutCommonHeader.ivBack.visibility = View.GONE
private fun initListener() {
viewBind.layoutCommonHeader.ivBack.setOnClickListener(this)
viewBind.tvJoinStrategy.setOnClickListener(this)
viewBind.viewPersonalAuth.setOnClickListener(this)
viewBind.viewEnterpriseAuth.setOnClickListener(this)
viewBind.layoutCommonHeader.tvTitle.text = resources.getString(R.string.join_life_circle)
viewBind.viewPersonalAuth.setData(
resources.getString(R.string.personal_auth),
resources.getString(R.string.personal_auth_condition),
resources.getString(R.string.personal_auth_description), false
)
viewBind.viewEnterpriseAuth.setData(
resources.getString(R.string.enterprise_auth),
resources.getString(R.string.enterprise_auth_condition),
resources.getString(R.string.enterprise_auth_description),
false
)
if (intent.getSerializableExtra(XRouterPathConstants.ParamsKey) != null) {
val paramsMap = intent.getSerializableExtra(XRouterPathConstants.ParamsKey) as HashMap<*, *>
var fromTag = paramsMap["from"] as String
if (fromTag == "auth") {
viewBind.layoutCommonHeader.ivBack.visibility = View.VISIBLE
}
}
}
private fun initListener() {
viewBind.layoutCommonHeader.ivBack.setOnClickListener(this)
viewBind.tvJoinStrategy.setOnClickListener(this)
viewBind.viewPersonalAuth.setOnClickListener(this)
viewBind.viewEnterpriseAuth.setOnClickListener(this)
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.iv_back -> {
XPageManager.pop(null)
}
R.id.tv_join_strategy -> {
// TODO: 5/26/21 入驻攻略
}
R.id.view_personal_auth -> {
// 请求个人认证信息 用于回显已填入的信息
ApiService.authAuthentication(this)
}
R.id.view_enterprise_auth -> {
// 请求企业认证信息 用于回显已填入的信息
ApiService.authMerchantCheck(this, hashMapOf())
}
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.iv_back -> {
XPageManager.pop(null)
}
R.id.tv_join_strategy -> {
// TODO: 5/26/21 入驻攻略
}
R.id.view_personal_auth -> {
// 请求个人认证信息 用于回显已填入的信息
ApiService.authAuthentication(this)
}
R.id.view_enterprise_auth -> {
// 请求企业认证信息 用于回显已填入的信息
ApiService.authMerchantCheck(this, hashMapOf())
}
}
}
override fun authAuthenticationSuccess(result: AuthAuthenticationBean.Response?) {
viewBind.viewPersonalAuth.isSelected = true
viewBind.viewEnterpriseAuth.isSelected = false
// 跳转个人认证页
XPageManager.push(
XRouterPathConstants.LIFE_ACCOUNT_PERSONAL_AUTH,
hashMapOf(Pair(LifeAccountPersonalAuthActivity.EXTRA_AUTH_DATA, result))
)
override fun authAuthenticationSuccess(result: AuthAuthenticationBean.Response?) {
viewBind.viewPersonalAuth.isSelected = true
viewBind.viewEnterpriseAuth.isSelected = false
// 跳转个人认证页
XPageManager.push(
XRouterPathConstants.LIFE_ACCOUNT_PERSONAL_AUTH,
hashMapOf(Pair(LifeAccountPersonalAuthActivity.EXTRA_AUTH_DATA, result))
)
finish()
}
......
......@@ -4,7 +4,9 @@ import android.os.Bundle
import android.util.Log
import android.view.View
import android.widget.CompoundButton
import android.widget.Toast
import com.orhanobut.hawk.Hawk
import com.yidian.common.AppConfig
import com.yidian.common.HawkConfig
import com.yidian.common.XRouterPathConstants
import com.yidian.common.base.BaseActivity
......@@ -15,6 +17,7 @@ import com.yidian.shenghuoquan.newscontent.http.ApiService
import com.yidian.shenghuoquan.newscontent.http.callback.IAuthPersonalCompleteCallback
import com.yidian.shenghuoquan.newscontent.http.httpbean.AuthAuthenticationBean
import com.yidian.shenghuoquan.newscontent.http.httpbean.AuthPersonalCompleteBean
import com.yidian.shenghuoquan.newscontent.ui.ProtocolActivity
import com.yidian.xpage.XPageManager
/**
......@@ -71,6 +74,8 @@ class LifeAccountPersonalAuthActivity :
viewBind.svOccupation.setOnClickListener(this)
viewBind.cbProtocol.setOnCheckedChangeListener(this)
viewBind.btnNext.setOnClickListener(this)
viewBind.tvPrivacyCertification.setOnClickListener(this)
viewBind.tvUserAgreement.setOnClickListener(this)
}
private fun initData() {
......@@ -108,24 +113,37 @@ class LifeAccountPersonalAuthActivity :
}
override fun onClick(v: View?) {
when (v?.id) {
R.id.iv_back -> XPageManager.pop(null)
R.id.sv_occupation -> {
// TODO: 5/27/21 跳转职业标签选择 选择完成后进行下一步检查
LifeAccountAuthDataManager.personalAuthData.occupation = "工程师"
viewBind.svOccupation.setContentResult("工程师")
checkNextCondition()
}
R.id.btn_next -> {
// 个人认证 完成认证
val requestParams = HashMap<String, String?>()
requestParams["mobile"] = Hawk.get(HawkConfig.Mobile, "")
ApiService.authComplete(
this,
requestParams
)
}
when (v?.id) {
R.id.iv_back -> XPageManager.pop(null)
R.id.sv_occupation -> {
// TODO: 5/27/21 跳转职业标签选择 选择完成后进行下一步检查
LifeAccountAuthDataManager.personalAuthData.occupation = "工程师"
viewBind.svOccupation.setContentResult("工程师")
checkNextCondition()
}
R.id.btn_next -> {
// 个人认证 完成认证
val requestParams = HashMap<String, String?>()
requestParams["mobile"] = Hawk.get(HawkConfig.Mobile, "")
ApiService.authComplete(
this,
requestParams
)
}
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)
}
}
}
override fun onCheckedChanged(buttonView: CompoundButton?, isChecked: Boolean) {
......@@ -171,4 +189,4 @@ class LifeAccountPersonalAuthActivity :
"request auth complete failure: message: $message"
)
}
}
\ No newline at end of file
}
......@@ -70,6 +70,7 @@
android:text="@string/join_strategy"
android:textColor="#FF1852F1"
android:textSize="13sp"
android:visibility="gone"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toBottomOf="@id/view_enterprise_auth" />
......
......@@ -81,7 +81,7 @@
android:layout_marginBottom="33dp"
android:alpha="0.32"
android:background="@drawable/bg_btn_auth"
android:enabled="false"
android:enabled="true"
android:text="@string/auth_finish"
android:textColor="#FFFFFFFF"
android:textSize="17sp"
......
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