Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
YDL-Component-Medical
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
杨凯
YDL-Component-Medical
Commits
4c64ee1c
Commit
4c64ee1c
authored
Jan 15, 2021
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:和IOS保持一致,加国内手机号正则校验
parent
af7e28d8
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
5 deletions
+9
-5
config.gradle
config.gradle
+2
-2
RegisterAndLoginActivity.kt
m-user/src/main/java/com/yidianling/user/ui/login/RegisterAndLoginActivity.kt
+7
-3
No files found.
config.gradle
View file @
4c64ee1c
...
@@ -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.
49
"
,
"m-user"
:
"0.0.60.
50
"
,
"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"
,
...
@@ -91,7 +91,7 @@ ext {
...
@@ -91,7 +91,7 @@ ext {
"m-confide"
:
"0.0.48.91"
,
"m-confide"
:
"0.0.48.91"
,
"m-consultant"
:
"0.0.51.16"
,
"m-consultant"
:
"0.0.51.16"
,
"m-fm"
:
"0.0.23.5"
,
"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-home"
:
"0.0.22.51"
,
"m-im"
:
"0.0.3.15"
,
"m-im"
:
"0.0.3.15"
,
"m-dynamic"
:
"0.0.1.7"
,
"m-dynamic"
:
"0.0.1.7"
,
...
...
m-user/src/main/java/com/yidianling/user/ui/login/RegisterAndLoginActivity.kt
View file @
4c64ee1c
...
@@ -280,7 +280,6 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
...
@@ -280,7 +280,6 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
if
(!
TextUtils
.
isEmpty
(
YDLCacheUtils
.
getCountryPhoneCode
()))
{
if
(!
TextUtils
.
isEmpty
(
YDLCacheUtils
.
getCountryPhoneCode
()))
{
countryCode
=
YDLCacheUtils
.
getCountryPhoneCode
()
countryCode
=
YDLCacheUtils
.
getCountryPhoneCode
()
country_code
.
text
=
"+"
+
countryCode
?.
replace
(
"00"
,
""
)
country_code
.
text
=
"+"
+
countryCode
?.
replace
(
"00"
,
""
)
LogUtil
.
e
(
"aaa"
+
countryCode
?.
replace
(
"00"
,
""
))
}
}
setCountryIcon
(
countryCode
)
setCountryIcon
(
countryCode
)
...
@@ -439,7 +438,8 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
...
@@ -439,7 +438,8 @@ 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"
))
{
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"
))
view_lin
.
setBackgroundColor
(
Color
.
parseColor
(
"#E8E8E8"
))
true
true
}
else
{
}
else
{
...
@@ -449,7 +449,11 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
...
@@ -449,7 +449,11 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
false
false
}
}
}
}
private
fun
checkRegex
(
phone
:
String
):
Boolean
{
LogUtil
.
e
(
"aaaa"
+
phone
)
val
regex
=
"^1+[23456789]+\\d{9}"
return
phone
.
matches
(
regex
.
toRegex
())
}
/**
/**
* 三方登录成功后绑定手机号
* 三方登录成功后绑定手机号
*/
*/
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment