Commit e93f02a7 by YKai

fix:修复绑定号验证失败问题

parent e298457c
...@@ -8,7 +8,7 @@ ext { ...@@ -8,7 +8,7 @@ ext {
"m-confide" : "0.0.48.91", "m-confide" : "0.0.48.91",
"m-consultant" : "0.0.59.40", "m-consultant" : "0.0.59.40",
"m-fm" : "0.0.30.00", "m-fm" : "0.0.30.00",
"m-user" : "0.0.60.58", "m-user" : "0.0.60.60",
"m-home" : "0.0.22.51", "m-home" : "0.0.22.51",
"m-im" : "0.0.18.30", "m-im" : "0.0.18.30",
"m-dynamic" : "0.0.7.13", "m-dynamic" : "0.0.7.13",
......
...@@ -394,54 +394,6 @@ public class AccountSettingActivity extends BaseActivity implements View.OnClick ...@@ -394,54 +394,6 @@ public class AccountSettingActivity extends BaseActivity implements View.OnClick
dismissProgressDialog(); dismissProgressDialog();
} }
}); });
/* UMShareAPI.get(this).doOauthVerify(this, SHARE_MEDIA.WEIXIN, new UMAuthListener() {
@Override
public void onStart(SHARE_MEDIA share_media) {
}
@SuppressLint("CheckResult")
@Override
public void onComplete(SHARE_MEDIA share_media, int i, Map<String, String> map) {
if (map == null||map.size()==0) {
return;
}
String openid = map.get("openid");
String unionid = map.get("unionid");
LogUtil.e("aaaaa"+openid+"bbbb"+unionid);
userHttp.bindWX(new BindWX(openid, unionid))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(o -> {
dismissProgressDialog();
if(o.code == 0 ) {
UserHelper.INSTANCE.getUserInfo().getUserInfo().setBind_weixin(1);
jtv_wechat.setRightText("已绑定");
ToastUtil.toastShort("绑定成功");
}else{
ToastHelper.Companion.show(o.msg);
}
}, new ThrowableConsumer() {
@Override
public void accept(@NotNull String msg) {
dismissProgressDialog();
}
});
UMShareAPI.get(AccountSettingActivity.this).deleteOauth(AccountSettingActivity.this, SHARE_MEDIA.WEIXIN, this);
}
@Override
public void onError(SHARE_MEDIA share_media, int i, Throwable throwable) {
dismissProgressDialog();
ToastUtil.toastShort(throwable.getMessage());
}
@Override
public void onCancel(SHARE_MEDIA share_media, int i) {
dismissProgressDialog();
}
});*/
} }
/** /**
...@@ -559,7 +511,7 @@ public class AccountSettingActivity extends BaseActivity implements View.OnClick ...@@ -559,7 +511,7 @@ public class AccountSettingActivity extends BaseActivity implements View.OnClick
* 绑定手机 * 绑定手机
*/ */
private void bindPhone() { private void bindPhone() {
RegisterAndLoginActivity.Companion.start(this, true); RegisterAndLoginActivity.Companion.start(this,true);
} }
private String isNullString(String str) { private String isNullString(String str) {
......
...@@ -42,7 +42,6 @@ import com.yidianling.user.R ...@@ -42,7 +42,6 @@ import com.yidianling.user.R
import com.yidianling.user.StatusUtils import com.yidianling.user.StatusUtils
import com.yidianling.user.UserHelper import com.yidianling.user.UserHelper
import com.yidianling.user.api.bean.UserResponseBean import com.yidianling.user.api.bean.UserResponseBean
import com.yidianling.user.bean.AliAuthBean
import com.yidianling.user.constants.UserBIConstants import com.yidianling.user.constants.UserBIConstants
import com.yidianling.user.http.request.BindPhoneJavaParam import com.yidianling.user.http.request.BindPhoneJavaParam
import com.yidianling.user.http.request.PhoneLoginAutoParam import com.yidianling.user.http.request.PhoneLoginAutoParam
...@@ -70,11 +69,12 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -70,11 +69,12 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
ILoginContract.View { ILoginContract.View {
private var userPhoneNumber: String? = null private var userPhoneNumber: String? = null
// 是否支持号码认证 // 是否支持号码认证
private var isCanAuth: Boolean = false private var isCanAuth: Boolean = false
private var chcekPhoneResponeBean: ChcekPhoneResponeBean? = null // 手机号校验结果 private var chcekPhoneResponeBean: ChcekPhoneResponeBean? = null // 手机号校验结果
private var isUmengLoginState: Boolean = false //true 通过第三方登录后绑定手机号码 private var isBindPhone: Boolean = false // 是否绑定手机号
private var countryCode: String? = "0086"//国家或地区手机区号 private var countryCode: String? = "0086"//国家或地区手机区号
private var handler: Handler? = null private var handler: Handler? = null
private var isFromGuide = false//是否来自启动页 private var isFromGuide = false//是否来自启动页
...@@ -82,13 +82,14 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -82,13 +82,14 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
companion object { companion object {
private var BIND_PHONE = "bind_phone"//用于判断时候是绑定手机号 private var BIND_PHONE = "bind_phone"//用于判断时候是绑定手机号
private var IS_FROM_GUIDE = "isFromGuide"//是否来自启动页 private var IS_FROM_GUIDE = "isFromGuide"//是否来自启动页
private var IS_FROM_ACCOUNT_SET = "isFromAccountSet"// 是否来自设置页
var REQUEST_CODE_COUNTRY = 1024 var REQUEST_CODE_COUNTRY = 1024
fun start(context: Context) { fun start(context: Context) {
start(context, false) start(context, false)
} }
/** /**
* 绑定手机号调用此方法启动 * 第三方登录,绑定手机号调用此方法启动
*/ */
fun start(context: Context, isBindPhone: Boolean) { fun start(context: Context, isBindPhone: Boolean) {
startFromGuide(context, isBindPhone, false) startFromGuide(context, isBindPhone, false)
...@@ -118,7 +119,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -118,7 +119,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
} }
override fun initDataAndEvent() { override fun initDataAndEvent() {
isUmengLoginState = intent.getBooleanExtra(BIND_PHONE, false) isBindPhone = intent.getBooleanExtra(BIND_PHONE, false)
isFromGuide = intent.getBooleanExtra(IS_FROM_GUIDE, false) isFromGuide = intent.getBooleanExtra(IS_FROM_GUIDE, false)
StatusUtils.isFromGuide = isFromGuide StatusUtils.isFromGuide = isFromGuide
...@@ -130,7 +131,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -130,7 +131,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
private fun setWindowStatusBarColor() { private fun setWindowStatusBarColor() {
StatusBarUtils.Companion.setWindowStatusBarColor(this, R.color.white) StatusBarUtils.Companion.setWindowStatusBarColor(this, R.color.white)
StatusBarUtils.Companion.setStatusBarLightMode(this,true) StatusBarUtils.Companion.setStatusBarLightMode(this, true)
} }
@SuppressLint("CheckResult") @SuppressLint("CheckResult")
...@@ -176,22 +177,16 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -176,22 +177,16 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
requestPermission() requestPermission()
OneKeyLoginHelp.checkEnvAvailable(PhoneNumberAuthHelper.SERVICE_TYPE_AUTH) OneKeyLoginHelp.checkEnvAvailable(PhoneNumberAuthHelper.SERVICE_TYPE_AUTH)
OneKeyLoginHelp.setVerifyTokenResultListener(object :OneKeyLoginHelp.VerifyTokenResultListener{ OneKeyLoginHelp.setVerifyTokenResultListener(object :
OneKeyLoginHelp.VerifyTokenResultListener {
override fun onTokenSuccess(result: String) { override fun onTokenSuccess(result: String) {
val tokenRet = TokenRet.fromJson(result) val tokenRet = TokenRet.fromJson(result)
when (tokenRet.code) { when (tokenRet.code) {
ResultCode.CODE_ERROR_ENV_CHECK_SUCCESS->{ // 终端环境支持认证 ResultCode.CODE_ERROR_ENV_CHECK_SUCCESS -> { // 终端环境支持认证
isCanAuth =true isCanAuth = true
} }
ResultCode.CODE_SUCCESS -> { // 获取token成功 ResultCode.CODE_SUCCESS -> { // 获取token成功
val aliAuthBean = AliAuthBean() autoLogin(tokenRet.token)
aliAuthBean.accessCode = tokenRet.token
if (isUmengLoginState) {
//绑定手机号码
umengLoginBindPhone(aliAuthBean.accessCode)
} else {
autoLogin(tokenRet.token)
}
OneKeyLoginHelp.mPhoneNumberAuthHelper?.setAuthListener(null) OneKeyLoginHelp.mPhoneNumberAuthHelper?.setAuthListener(null)
OneKeyLoginHelp.mIsGetTokenSuccess = false OneKeyLoginHelp.mIsGetTokenSuccess = false
} }
...@@ -214,12 +209,13 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -214,12 +209,13 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
spannableString.setSpan(object : ClickableSpan() { spannableString.setSpan(object : ClickableSpan() {
override fun updateDrawState(ds: TextPaint) { override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds) super.updateDrawState(ds)
ds.color = ContextCompat.getColor(this@RegisterAndLoginActivity,R.color.user_1da1f2trans) ds.color =
ContextCompat.getColor(this@RegisterAndLoginActivity, R.color.user_1da1f2trans)
ds.isUnderlineText = true //设置下划线 ds.isUnderlineText = true //设置下划线
} }
override fun onClick(widget: View) { override fun onClick(widget: View) {
if (!isUmengLoginState) { if (!isBindPhone) {
H5Activity.start(this@RegisterAndLoginActivity, false) H5Activity.start(this@RegisterAndLoginActivity, false)
overridePendingTransition( overridePendingTransition(
R.anim.platform_slide_in_from_bottom, R.anim.platform_slide_in_from_bottom,
...@@ -231,12 +227,13 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -231,12 +227,13 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
spannableString.setSpan(object : ClickableSpan() { spannableString.setSpan(object : ClickableSpan() {
override fun updateDrawState(ds: TextPaint) { override fun updateDrawState(ds: TextPaint) {
super.updateDrawState(ds) super.updateDrawState(ds)
ds.color = ContextCompat.getColor(this@RegisterAndLoginActivity,R.color.user_1da1f2trans) ds.color =
ContextCompat.getColor(this@RegisterAndLoginActivity, R.color.user_1da1f2trans)
ds.isUnderlineText = true //设置下划线 ds.isUnderlineText = true //设置下划线
} }
override fun onClick(widget: View) { override fun onClick(widget: View) {
if (!isUmengLoginState) { if (!isBindPhone) {
H5Activity.start(this@RegisterAndLoginActivity, true) H5Activity.start(this@RegisterAndLoginActivity, true)
overridePendingTransition( overridePendingTransition(
R.anim.platform_slide_in_from_bottom, R.anim.platform_slide_in_from_bottom,
...@@ -255,7 +252,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -255,7 +252,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
setHint() setHint()
requestFocus() requestFocus()
if (isUmengLoginState) { if (isBindPhone) {
skip_bind.visibility = View.VISIBLE skip_bind.visibility = View.VISIBLE
// tv_des.text = "首次绑定即送大礼包" // tv_des.text = "首次绑定即送大礼包"
// tv_des.visibility = View.GONE//"同意" // tv_des.visibility = View.GONE//"同意"
...@@ -264,9 +261,9 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -264,9 +261,9 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
login_wechat.visibility = View.GONE login_wechat.visibility = View.GONE
login_qq.visibility = View.GONE login_qq.visibility = View.GONE
tv_login_title.text = "手机号绑定" tv_login_title.text = "手机号绑定"
ll_next.text="发送验证码" ll_next.text = "发送验证码"
tv_protocol.visibility = View.GONE tv_protocol.visibility = View.GONE
other_login_style.visibility=View.GONE other_login_style.visibility = View.GONE
} }
...@@ -284,9 +281,9 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -284,9 +281,9 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
} }
setCountryIcon(countryCode) setCountryIcon(countryCode)
if (et_phone_number.text.length>0){ if (et_phone_number.text.length > 0) {
ll_next.isEnabled=true ll_next.isEnabled = true
ll_next.background=ContextCompat.getDrawable(this,R.drawable.bg_one_click_login) ll_next.background = ContextCompat.getDrawable(this, R.drawable.bg_one_click_login)
} }
if (isFromGuide) { if (isFromGuide) {
...@@ -337,7 +334,14 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -337,7 +334,14 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
*/ */
private fun setClickEvent() { private fun setClickEvent() {
skip_bind.setOnClickListener { skip_bind.setOnClickListener {
ActionCountUtils.count(uid = "", partId = UserBIConstants.PART_ID_LOGIN_MAIN, position = UserBIConstants.POSITION_LOOK_AROUND_CLICK, url = "无url",api = "无api", sign1 = "") ActionCountUtils.count(
uid = "",
partId = UserBIConstants.PART_ID_LOGIN_MAIN,
position = UserBIConstants.POSITION_LOOK_AROUND_CLICK,
url = "无url",
api = "无api",
sign1 = ""
)
RxKeyboardTool.hideSoftInput(this) RxKeyboardTool.hideSoftInput(this)
onBackPressed() onBackPressed()
} }
...@@ -350,13 +354,14 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -350,13 +354,14 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
//protocol_android 1是开启默认勾选,2是关闭默认勾选,方便应用市场审核 //protocol_android 1是开启默认勾选,2是关闭默认勾选,方便应用市场审核
//新逻辑:华为一直不默认勾选(上线后华为也会抽查隐私协议勾选情况),vivo审核不默认勾选,通过后默认勾选 //新逻辑:华为一直不默认勾选(上线后华为也会抽查隐私协议勾选情况),vivo审核不默认勾选,通过后默认勾选
val privacyOnOffType = PlatformRamImpl.getInstance().getGlobalInfo()?.info?.protocol_android ?: 2 val privacyOnOffType =
PlatformRamImpl.getInstance().getGlobalInfo()?.info?.protocol_android ?: 2
val channel = WalleChannelReader.getChannel(applicationContext) val channel = WalleChannelReader.getChannel(applicationContext)
if (channel=="huawei"){ if (channel == "huawei") {
iv_select_protocol.setImageResource(R.drawable.user_login_protocol_unselected_new) iv_select_protocol.setImageResource(R.drawable.user_login_protocol_unselected_new)
}else if (privacyOnOffType == 2 && (channel=="vivo")){ } else if (privacyOnOffType == 2 && (channel == "vivo")) {
iv_select_protocol.setImageResource(R.drawable.user_login_protocol_unselected_new) iv_select_protocol.setImageResource(R.drawable.user_login_protocol_unselected_new)
}else{ } else {
isAgreeProtocol = true isAgreeProtocol = true
iv_select_protocol.setImageResource(R.drawable.user_login_protocol_selected_new) iv_select_protocol.setImageResource(R.drawable.user_login_protocol_selected_new)
} }
...@@ -396,7 +401,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -396,7 +401,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
return@setOnClickListener return@setOnClickListener
} }
if (checkPhone()) { if (checkPhone()) {
mPresenter.checkPhoneStatus(userPhoneNumber!!, countryCode!!, isUmengLoginState) mPresenter.checkPhoneStatus(userPhoneNumber!!, countryCode!!, isBindPhone)
} }
} }
...@@ -410,12 +415,13 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -410,12 +415,13 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
iv_del.visibility = View.VISIBLE iv_del.visibility = View.VISIBLE
iv_del.isEnabled = true iv_del.isEnabled = true
} }
if (it.toString().length==13||(!countryCode?.contains("86")!! &&et_phone_number.text.toString().length>0)){ if (it.toString().length == 13 || (!countryCode?.contains("86")!! && et_phone_number.text.toString().length > 0)) {
ll_next.isEnabled=true ll_next.isEnabled = true
ll_next.background=ContextCompat.getDrawable(this,R.drawable.bg_one_click_login) ll_next.background = ContextCompat.getDrawable(this, R.drawable.bg_one_click_login)
}else{ } else {
ll_next.isEnabled=false ll_next.isEnabled = false
ll_next.background=ContextCompat.getDrawable(this,R.drawable.login_password_unable_bg_24dp) ll_next.background =
ContextCompat.getDrawable(this, R.drawable.login_password_unable_bg_24dp)
} }
} }
//删除按钮 //删除按钮
...@@ -439,7 +445,10 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -439,7 +445,10 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
if (!TextUtils.equals("0086", countryCode)) { if (!TextUtils.equals("0086", countryCode)) {
return !TextUtils.isEmpty(editPhone) return !TextUtils.isEmpty(editPhone)
} }
return if (editPhone.length == 11 && editPhone.startsWith("1")&&checkRegex(editPhone.toString().trim())) { return if (editPhone.length == 11 && editPhone.startsWith("1") && checkRegex(
editPhone.toString().trim()
)
) {
view_lin.setBackgroundColor(Color.parseColor("#E8E8E8")) view_lin.setBackgroundColor(Color.parseColor("#E8E8E8"))
true true
} else { } else {
...@@ -449,15 +458,17 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -449,15 +458,17 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
false false
} }
} }
private fun checkRegex( phone:String):Boolean{
val regex="^1+[23456789]+\\d{9}" private fun checkRegex(phone: String): Boolean {
val regex = "^1+[23456789]+\\d{9}"
return phone.matches(regex.toRegex()) return phone.matches(regex.toRegex())
} }
/** /**
* 三方登录成功后绑定手机号 * 三方登录成功后绑定手机号
*/ */
private fun umengLoginBindPhone(accessCode: String?) { private fun umengLoginBindPhone(accessCode: String?) {
var param = BindPhoneJavaParam( val param = BindPhoneJavaParam(
accessCode!!, accessCode!!,
countryCode!!, countryCode!!,
userPhoneNumber!!, userPhoneNumber!!,
...@@ -483,22 +494,22 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -483,22 +494,22 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
var bindPhone = userInfo.bind_phone var bindPhone = userInfo.bind_phone
if (bindPhone != 1) { if (bindPhone != 1) {
countryCode = userInfo.country_code countryCode = userInfo.country_code
isUmengLoginState = true isBindPhone = true
skip_bind.visibility = View.VISIBLE skip_bind.visibility = View.VISIBLE
// tv_des.text = "首次绑定即送大礼包" // tv_des.text = "首次绑定即送大礼包"
// tv_des.visibility = View.GONE // tv_des.visibility = View.GONE
iv_select_protocol.visibility = View.GONE iv_select_protocol.visibility = View.GONE
// tv_des_first.visibility = View.VISIBLE // tv_des_first.visibility = View.VISIBLE
bind_phone_hint.visibility=View.VISIBLE bind_phone_hint.visibility = View.VISIBLE
login_wechat.visibility = View.GONE login_wechat.visibility = View.GONE
login_qq.visibility = View.GONE login_qq.visibility = View.GONE
tv_login_title.text = "绑定手机号" tv_login_title.text = "绑定手机号"
tv_protocol.visibility = View.GONE tv_protocol.visibility = View.GONE
other_login_style.visibility=View.GONE other_login_style.visibility = View.GONE
} else { } else {
if (isFromGuide) { if (isFromGuide) {
LoginUtils.LoginSuccessOperate(this) LoginUtils.LoginSuccessOperate(this)
}else{ } else {
finish() finish()
} }
} }
...@@ -510,12 +521,17 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -510,12 +521,17 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
override fun checkPhoneStatusSuccess(bean: ChcekPhoneResponeBean?, phone: String) { override fun checkPhoneStatusSuccess(bean: ChcekPhoneResponeBean?, phone: String) {
//校验手机号的结果需要在本地保存,后续一键认证登录失败后跳转密码登录需要用到校验结果 //校验手机号的结果需要在本地保存,后续一键认证登录失败后跳转密码登录需要用到校验结果
if (bean != null) { if (bean != null) {
chcekPhoneResponeBean = ChcekPhoneResponeBean(bean.hasPwd, bean.isDoctor, bean.isRegistered) chcekPhoneResponeBean =
ChcekPhoneResponeBean(bean.hasPwd, bean.isDoctor, bean.isRegistered)
} }
if (isCanAuth) { if (isBindPhone) {
OneKeyLoginHelp.getVerifyToken()
} else {
aliAuthFailed() aliAuthFailed()
} else {
if (isCanAuth) {
OneKeyLoginHelp.getVerifyToken()
} else {
aliAuthFailed()
}
} }
} }
...@@ -548,7 +564,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -548,7 +564,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
userPhoneNumber!!, userPhoneNumber!!,
countryCode!!, countryCode!!,
VerificationCodeActivity.STATUS_LOGIN_BY_CODE, VerificationCodeActivity.STATUS_LOGIN_BY_CODE,
isUmengLoginState, isBindPhone,
false false
) )
} }
...@@ -558,9 +574,11 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -558,9 +574,11 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
/** /**
* 通过阿里sdk一键认证服务登陆 * 通过阿里sdk一键认证服务登陆
*/ */
private fun autoLogin(token:String) { private fun autoLogin(token: String) {
val param = PhoneLoginAutoParam(token, JPushUtils.getRegistrationID(),2,1,userPhoneNumber!!, val param = PhoneLoginAutoParam(
RxAppTool.getAppVersionName(BaseApp.Companion.getApp())) token, JPushUtils.getRegistrationID(), 2, 1, userPhoneNumber!!,
RxAppTool.getAppVersionName(BaseApp.Companion.getApp())
)
mPresenter.autoLogin(param) mPresenter.autoLogin(param)
} }
...@@ -574,13 +592,14 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -574,13 +592,14 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
finishPrePage() finishPrePage()
} }
/** /**
*菊花框 *菊花框
*/ */
override fun showLoading(state: Boolean) { override fun showLoading(state: Boolean) {
if (state){ if (state) {
showProgressDialog() showProgressDialog()
}else{ } else {
dismissProgressDialog() dismissProgressDialog()
} }
} }
...@@ -595,7 +614,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -595,7 +614,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
handler!!.postDelayed({ handler!!.postDelayed({
if (isFromGuide) { if (isFromGuide) {
LoginUtils.LoginSuccessOperate(this) LoginUtils.LoginSuccessOperate(this)
}else{ } else {
finish() finish()
} }
}, 1000) }, 1000)
...@@ -665,20 +684,20 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont ...@@ -665,20 +684,20 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
* 根据国家个地区号设置国旗 * 根据国家个地区号设置国旗
*/ */
private fun setCountryIcon(code: String?) { private fun setCountryIcon(code: String?) {
country_code.text= "+"+countryCode?.replace("00", "") country_code.text = "+" + countryCode?.replace("00", "")
/* when (code) { /* when (code) {
"0086" -> iv_country_icon.setImageResource(R.drawable.user_ic_china) "0086" -> iv_country_icon.setImageResource(R.drawable.user_ic_china)
"001" -> iv_country_icon.setImageResource(R.drawable.user_country_usa) "001" -> iv_country_icon.setImageResource(R.drawable.user_country_usa)
"00886" -> iv_country_icon.setImageResource(R.drawable.user_ic_china) "00886" -> iv_country_icon.setImageResource(R.drawable.user_ic_china)
"0081" -> iv_country_icon.setImageResource(R.drawable.user_country_japan) "0081" -> iv_country_icon.setImageResource(R.drawable.user_country_japan)
"00852" -> iv_country_icon.setImageResource(R.drawable.user_country_hk) "00852" -> iv_country_icon.setImageResource(R.drawable.user_country_hk)
"0061" -> iv_country_icon.setImageResource(R.drawable.user_country_australia) "0061" -> iv_country_icon.setImageResource(R.drawable.user_country_australia)
"0064" -> iv_country_icon.setImageResource(R.drawable.user_country_nz) "0064" -> iv_country_icon.setImageResource(R.drawable.user_country_nz)
"0082" -> iv_country_icon.setImageResource(R.drawable.user_country_sk) "0082" -> iv_country_icon.setImageResource(R.drawable.user_country_sk)
"0060" -> iv_country_icon.setImageResource(R.drawable.user_country_malaysia) "0060" -> iv_country_icon.setImageResource(R.drawable.user_country_malaysia)
"0044" -> iv_country_icon.setImageResource(R.drawable.user_country_uk) "0044" -> iv_country_icon.setImageResource(R.drawable.user_country_uk)
else -> iv_country_icon.visibility = View.VISIBLE else -> iv_country_icon.visibility = View.VISIBLE
}*/ }*/
} }
override fun onDestroy() { override fun onDestroy() {
......
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