Commit 0239c319 by YKai

feat:强绑手机号优化

parent 178501b2
...@@ -13,5 +13,6 @@ data class BindPhoneJavaParam( ...@@ -13,5 +13,6 @@ data class BindPhoneJavaParam(
var phoneNumber: String,//手机号 var phoneNumber: String,//手机号
var verifyCode: String,// 验证码 var verifyCode: String,// 验证码
var uid: String, var uid: String,
var type: Int = 2//2:Android var type: Int = 2, //2:Android
var transferFlag:Int = 0 // 默认为0,1表示需要转换x账号到y账号触发 1800010011 code提醒触发重新登录标记
) )
\ No newline at end of file
...@@ -67,16 +67,7 @@ class BindPhoneActivity : BaseActivity() { ...@@ -67,16 +67,7 @@ class BindPhoneActivity : BaseActivity() {
mIsForceBindPhone = intent.getBooleanExtra("is_force_bind_phone",false) mIsForceBindPhone = intent.getBooleanExtra("is_force_bind_phone",false)
mIsFromGuide = intent.getBooleanExtra("is_from_guide", false) mIsFromGuide = intent.getBooleanExtra("is_from_guide", false)
iv_back.setOnClickListener { iv_back.setOnClickListener {
if (mIsForceBindPhone) { onBackPressed()
//清除UserInfo
setUserinfo(null)
clearImData()
logout()
EventBus.getDefault().post(RefreshRecentContactListEvent())
finish()
} else {
LoginUtils.loginSuccessOperate(this)
}
} }
tv_country_code.setOnClickListener { tv_country_code.setOnClickListener {
val intent = Intent(this, CountryListActivity::class.java) val intent = Intent(this, CountryListActivity::class.java)
...@@ -229,7 +220,7 @@ class BindPhoneActivity : BaseActivity() { ...@@ -229,7 +220,7 @@ class BindPhoneActivity : BaseActivity() {
val phone = et_phone_number.text.toString().replace(" ", "") val phone = et_phone_number.text.toString().replace(" ", "")
val code = et_code.text.toString() val code = et_code.text.toString()
val bindPhoneParams = val bindPhoneParams =
BindPhoneJavaParam("", countryCode, phone, code, UserHelper.getUserInfo()!!.uid!!) BindPhoneJavaParam("", countryCode, phone, code, UserHelper.getUserInfo()!!.uid!!,transferFlag=1)
LoginApiRequestUtil.bindPhone(bindPhoneParams) LoginApiRequestUtil.bindPhone(bindPhoneParams)
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
...@@ -254,6 +245,9 @@ class BindPhoneActivity : BaseActivity() { ...@@ -254,6 +245,9 @@ class BindPhoneActivity : BaseActivity() {
} else { } else {
finish() finish()
} }
}else if(it.code==1800010011){
RegisterAndLoginActivity.startFromGuide(this,false,mIsFromGuide)
finish()
} else { } else {
ToastUtil.toastShort(it.msg)//服务端返回{验证码错误&异常}信息 ToastUtil.toastShort(it.msg)//服务端返回{验证码错误&异常}信息
} }
...@@ -262,6 +256,19 @@ class BindPhoneActivity : BaseActivity() { ...@@ -262,6 +256,19 @@ class BindPhoneActivity : BaseActivity() {
}) })
} }
override fun onBackPressed() {
if (mIsForceBindPhone) {
//清除UserInfo
setUserinfo(null)
clearImData()
logout()
EventBus.getDefault().post(RefreshRecentContactListEvent())
finish()
} else {
LoginUtils.loginSuccessOperate(this)
}
}
/** /**
* 开始倒计时 * 开始倒计时
......
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