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
096d19bc
Commit
096d19bc
authored
Jan 19, 2021
by
YKai
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix:一键登录逻辑修复
parent
c8b1f32b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
43 additions
and
17 deletions
+43
-17
config.gradle
config.gradle
+1
-1
OneKeyLoginHelp.kt
m-user/src/main/java/com/yidianling/user/ui/login/OneKeyLoginHelp.kt
+4
-3
RegisterAndLoginActivity.kt
m-user/src/main/java/com/yidianling/user/ui/login/RegisterAndLoginActivity.kt
+38
-13
No files found.
config.gradle
View file @
096d19bc
...
...
@@ -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.7
4
"
,
"m-user"
:
"0.0.60.7
6
"
,
"m-home"
:
"0.0.22.51"
,
"m-im"
:
"0.0.18.30"
,
"m-dynamic"
:
"0.0.7.13"
,
...
...
m-user/src/main/java/com/yidianling/user/ui/login/OneKeyLoginHelp.kt
View file @
096d19bc
...
...
@@ -119,9 +119,9 @@ object OneKeyLoginHelp {
*/
fun
toLoginActivity
()
{
if
(
mOpenPageIsSuccess
){
RegisterAndLoginActivity
.
start
(
mActivity
)
RegisterAndLoginActivity
.
start
(
mActivity
,
isFromOneKey
=
true
,
isFromGuide
=
false
)
}
else
{
RegisterAndLoginActivity
.
start
FromGuide
(
mActivity
,
isBindPhone
=
false
,
isFromGudil
e
=
true
)
RegisterAndLoginActivity
.
start
(
mActivity
,
isFromOneKey
=
false
,
isFromGuid
e
=
true
)
}
}
...
...
@@ -133,10 +133,11 @@ object OneKeyLoginHelp {
if
(
mIsOpenOneKeyLogin
){
getLoginToken
(
isOpenDialog
)
}
else
{
// 一键登录页面打开成功
if
(
mOpenPageIsSuccess
){
RegisterAndLoginActivity
.
start
(
mActivity
)
}
else
{
RegisterAndLoginActivity
.
start
FromGuide
(
mActivity
,
isBindPhone
=
false
,
isFromGudil
e
=
true
)
RegisterAndLoginActivity
.
start
(
mActivity
,
isFromOneKey
=
false
,
isFromGuid
e
=
true
)
}
}
}
...
...
m-user/src/main/java/com/yidianling/user/ui/login/RegisterAndLoginActivity.kt
View file @
096d19bc
...
...
@@ -41,6 +41,7 @@ import com.yidianling.user.LoginUtils
import
com.yidianling.user.R
import
com.yidianling.user.StatusUtils
import
com.yidianling.user.UserHelper
import
com.yidianling.user.UserHelper.isLogin
import
com.yidianling.user.api.bean.UserResponseBean
import
com.yidianling.user.constants.UserBIConstants
import
com.yidianling.user.http.request.BindPhoneJavaParam
...
...
@@ -78,10 +79,12 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
private
var
countryCode
:
String
?
=
"0086"
//国家或地区手机区号
private
var
handler
:
Handler
?
=
null
private
var
isFromGuide
=
false
//是否来自启动页
private
var
isFromOneKeyLogin
=
false
// 是否来自一键登录界面
companion
object
{
private
var
BIND_PHONE
=
"bind_phone"
//用于判断时候是绑定手机号
private
var
IS_FROM_GUIDE
=
"isFromGuide"
//是否来自启动页
private
var
IS_FROM_ONE_KEY_LOGIN
=
"isFromOneKeyLogin"
//是否来自启动页
var
REQUEST_CODE_COUNTRY
=
1024
fun
start
(
context
:
Context
)
{
start
(
context
,
false
)
...
...
@@ -95,12 +98,25 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
}
/**
* 打开登录注册页面
*
* @param isFromOneKey 是否来自一键登录界面
* @param isFromGuide 是否来自启动页面
*/
fun
start
(
context
:
Context
,
isFromOneKey
:
Boolean
,
isFromGuide
:
Boolean
)
{
val
intent
=
Intent
(
context
,
RegisterAndLoginActivity
::
class
.
java
)
intent
.
putExtra
(
IS_FROM_ONE_KEY_LOGIN
,
isFromOneKey
)
intent
.
putExtra
(
IS_FROM_GUIDE
,
isFromGuide
)
context
.
startActivity
(
intent
)
}
/**
* 注意:此方法仅限于启动页调用,其他页面不要调用此方法
*/
fun
startFromGuide
(
context
:
Context
,
isBindPhone
:
Boolean
,
isFromGu
dil
e
:
Boolean
)
{
fun
startFromGuide
(
context
:
Context
,
isBindPhone
:
Boolean
,
isFromGu
id
e
:
Boolean
)
{
val
intent
=
Intent
(
context
,
RegisterAndLoginActivity
::
class
.
java
)
intent
.
putExtra
(
BIND_PHONE
,
isBindPhone
)
intent
.
putExtra
(
IS_FROM_GUIDE
,
isFromGu
dil
e
)
intent
.
putExtra
(
IS_FROM_GUIDE
,
isFromGu
id
e
)
context
.
startActivity
(
intent
)
}
...
...
@@ -120,6 +136,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
override
fun
initDataAndEvent
()
{
isBindPhone
=
intent
.
getBooleanExtra
(
BIND_PHONE
,
false
)
isFromGuide
=
intent
.
getBooleanExtra
(
IS_FROM_GUIDE
,
false
)
isFromOneKeyLogin
=
intent
.
getBooleanExtra
(
IS_FROM_ONE_KEY_LOGIN
,
false
)
StatusUtils
.
isFromGuide
=
isFromGuide
setWindowStatusBarColor
()
...
...
@@ -423,20 +440,21 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
ll_next.background =
ContextCompat.getDrawable(this, R.drawable.login_password_unable_bg_24dp)
}*/
if
(
country_code
.
text
.
equals
(
"+86"
)
!!
&&
it
.
toString
().
length
==
13
)
{
if
(
country_code
.
text
.
equals
(
"+86"
)
!!
&&
it
.
toString
().
length
==
13
)
{
ll_next
.
isEnabled
=
true
ll_next
.
background
=
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
bg_one_click_login
)
}
else
{
if
(
country_code
.
text
.
equals
(
"+86"
)
!!
){
}
else
{
if
(
country_code
.
text
.
equals
(
"+86"
)
!!
)
{
ll_next
.
isEnabled
=
false
ll_next
.
background
=
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
login_password_unable_bg_24dp
)
return
@setListener
}
if
(!
country_code
.
text
?.
equals
(
"+86"
)
!!
&&
it
.
toString
().
length
>
0
)
{
if
(!
country_code
.
text
?.
equals
(
"+86"
)
!!
&&
it
.
toString
().
length
>
0
)
{
ll_next
.
isEnabled
=
true
ll_next
.
background
=
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
bg_one_click_login
)
}
else
{
ll_next
.
background
=
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
bg_one_click_login
)
}
else
{
ll_next
.
isEnabled
=
false
ll_next
.
background
=
ContextCompat
.
getDrawable
(
this
,
R
.
drawable
.
login_password_unable_bg_24dp
)
...
...
@@ -661,13 +679,20 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
// } else {
// super.onBackPressed()
// }
// 如果从引导页面过来,点击返回键直接返回到主页
if
(
isFromGuide
){
if
(
isFromGuide
)
{
ActivityManager
.
finishOtherActivity
(
this
)
UserIn
.
mainIntent
(
this
,
4
)
finish
()
}
else
{
super
.
onBackPressed
()
}
else
if
(
isFromOneKeyLogin
)
{
// 来自一键登录界面
// 如果已经登录
if
(
isLogin
())
{
OneKeyLoginHelp
.
quitLoginPage
()
ActivityManager
.
finishOtherActivity
(
this
)
UserIn
.
mainIntent
(
this
,
4
)
finish
()
}
else
{
super
.
onBackPressed
()
}
}
}
...
...
@@ -713,7 +738,7 @@ class RegisterAndLoginActivity : BaseMvpActivity<ILoginContract.View, ILoginCont
*/
private
fun
setCountryIcon
(
code
:
String
?)
{
country_code
.
text
=
"+"
+
countryCode
?.
replace
(
"00"
,
""
)
val
splitCode
=
countryCode
?.
replace
(
"00"
,
""
)
val
splitCode
=
countryCode
?.
replace
(
"00"
,
""
)
/* when (code) {
"0086" -> iv_country_icon.setImageResource(R.drawable.user_ic_china)
"001" -> iv_country_icon.setImageResource(R.drawable.user_country_usa)
...
...
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