Commit 0239c319 by YKai

feat:强绑手机号优化

parent 178501b2
......@@ -13,5 +13,6 @@ data class BindPhoneJavaParam(
var phoneNumber: String,//手机号
var verifyCode: 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() {
mIsForceBindPhone = intent.getBooleanExtra("is_force_bind_phone",false)
mIsFromGuide = intent.getBooleanExtra("is_from_guide", false)
iv_back.setOnClickListener {
if (mIsForceBindPhone) {
//清除UserInfo
setUserinfo(null)
clearImData()
logout()
EventBus.getDefault().post(RefreshRecentContactListEvent())
finish()
} else {
LoginUtils.loginSuccessOperate(this)
}
onBackPressed()
}
tv_country_code.setOnClickListener {
val intent = Intent(this, CountryListActivity::class.java)
......@@ -229,7 +220,7 @@ class BindPhoneActivity : BaseActivity() {
val phone = et_phone_number.text.toString().replace(" ", "")
val code = et_code.text.toString()
val bindPhoneParams =
BindPhoneJavaParam("", countryCode, phone, code, UserHelper.getUserInfo()!!.uid!!)
BindPhoneJavaParam("", countryCode, phone, code, UserHelper.getUserInfo()!!.uid!!,transferFlag=1)
LoginApiRequestUtil.bindPhone(bindPhoneParams)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
......@@ -254,6 +245,9 @@ class BindPhoneActivity : BaseActivity() {
} else {
finish()
}
}else if(it.code==1800010011){
RegisterAndLoginActivity.startFromGuide(this,false,mIsFromGuide)
finish()
} else {
ToastUtil.toastShort(it.msg)//服务端返回{验证码错误&异常}信息
}
......@@ -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