Commit 4c64ee1c by 霍志良

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

parent af7e28d8
......@@ -8,7 +8,7 @@ ext {
"m-confide" : "0.0.48.91",
"m-consultant" : "0.0.59.40",
"m-fm" : "0.0.30.00",
"m-user" : "0.0.60.49",
"m-user" : "0.0.60.50",
"m-home" : "0.0.22.51",
"m-im" : "0.0.18.30",
"m-dynamic" : "0.0.7.13",
......@@ -91,7 +91,7 @@ ext {
"m-confide" : "0.0.48.91",
"m-consultant" : "0.0.51.16",
"m-fm" : "0.0.23.5",
"m-user" : "0.0.60.49",
"m-user" : "0.0.60.50",
"m-home" : "0.0.22.51",
"m-im" : "0.0.3.15",
"m-dynamic" : "0.0.1.7",
......
......@@ -280,7 +280,6 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
if (!TextUtils.isEmpty(YDLCacheUtils.getCountryPhoneCode())) {
countryCode = YDLCacheUtils.getCountryPhoneCode()
country_code.text = "+" + countryCode?.replace("00", "")
LogUtil.e("aaa"+countryCode?.replace("00", ""))
}
setCountryIcon(countryCode)
......@@ -439,7 +438,8 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
if (!TextUtils.equals("0086", countryCode)) {
return !TextUtils.isEmpty(editPhone)
}
return if (editPhone.length == 11 && editPhone.startsWith("1")) {
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
} else {
......@@ -449,7 +449,11 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
false
}
}
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