Commit bf6b3b26 by 霍志良

feat:和IOS保持一致,加国内手机号正则校验

parent 4c64ee1c
......@@ -438,7 +438,6 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
if (!TextUtils.equals("0086", countryCode)) {
return !TextUtils.isEmpty(editPhone)
}
LogUtil.e("aaa"+editPhone.length+"bbb"+checkRegex(editPhone.toString().trim()))
return if (editPhone.length == 11 && editPhone.startsWith("1")&&checkRegex(editPhone.toString().trim())) {
view_lin.setBackgroundColor(Color.parseColor("#E8E8E8"))
true
......@@ -450,7 +449,6 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
}
}
private fun checkRegex( phone:String):Boolean{
LogUtil.e("aaaa"+phone)
val regex="^1+[23456789]+\\d{9}"
return phone.matches(regex.toRegex())
}
......
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