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
751a3eb5
Commit
751a3eb5
authored
Jan 08, 2021
by
霍志良
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat:验证码异常回调
parent
6bb6de86
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
27 additions
and
4 deletions
+27
-4
VerificationCodeActivity.kt
m-user/src/main/java/com/yidianling/user/ui/login/VerificationCodeActivity.kt
+14
-1
IVerificationCodeContract.kt
m-user/src/main/java/com/yidianling/user/ui/login/contract/IVerificationCodeContract.kt
+5
-0
VerificationCodePresenterImpl.kt
m-user/src/main/java/com/yidianling/user/ui/login/presenter/VerificationCodePresenterImpl.kt
+5
-1
PinField.kt
m-user/src/main/java/com/yidianling/user/widget/PinField/PinField.kt
+2
-2
colors.xml
m-user/src/main/res/values/colors.xml
+1
-0
No files found.
m-user/src/main/java/com/yidianling/user/ui/login/VerificationCodeActivity.kt
View file @
751a3eb5
...
...
@@ -5,6 +5,7 @@ import android.app.Activity
import
android.content.Context
import
android.content.Intent
import
android.net.Uri
import
android.os.Build
import
android.os.Handler
import
android.support.v4.content.ContextCompat
import
android.text.TextUtils
...
...
@@ -16,6 +17,7 @@ import com.ydl.ydlcommon.utils.ActivityManager
import
com.ydl.ydlcommon.utils.StatusBarUtils
import
com.ydl.ydlcommon.utils.YDLCacheUtils
import
com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import
com.yidianling.common.tools.LogUtil
import
com.yidianling.common.tools.RxKeyboardTool
import
com.yidianling.common.tools.ToastUtil
import
com.yidianling.user.LoginUtils
...
...
@@ -25,6 +27,7 @@ import com.yidianling.user.constants.UserBIConstants
import
com.yidianling.user.http.request.BindPhoneJavaParam
import
com.yidianling.user.ui.login.contract.IVerificationCodeContract
import
com.yidianling.user.ui.login.presenter.VerificationCodePresenterImpl
import
com.yidianling.user.widget.PinField.HighlightType
import
com.yidianling.user.widget.PinField.PinField
import
com.yidianling.user.widget.ZDialog
import
io.reactivex.Observable
...
...
@@ -274,6 +277,14 @@ class VerificationCodeActivity :
)
}
override
fun
verificationErrorCode
()
{
//验证码异常回调
verify_code
.
highlightSingleFieldType
=
HighlightType
.
ALL_FIELDS
verify_code
.
highlightPaintColor
=
getColor
(
R
.
color
.
user_bgcolorred
)
verify_code
.
invalidate
()
dismissProgressDialog
()
}
/**
*发送验证码
*/
...
...
@@ -395,7 +406,9 @@ class VerificationCodeActivity :
//设置红色边框
// verify_code.setErrorColor()
//验证码设置红色边框,验证码错误
//验证码设置红色边框,验证码错误&验证码过期
}
private
fun
closeAnim
(
hasAnim
:
Boolean
)
{
...
...
m-user/src/main/java/com/yidianling/user/ui/login/contract/IVerificationCodeContract.kt
View file @
751a3eb5
...
...
@@ -52,6 +52,11 @@ interface IVerificationCodeContract {
* 百度监测埋点
*/
fun
baiduActionBury
()
/*
* 验证码错误&异常超时等回调
* */
fun
verificationErrorCode
()
}
interface
Presenter
:
IPresenter
<
View
>
{
...
...
m-user/src/main/java/com/yidianling/user/ui/login/presenter/VerificationCodePresenterImpl.kt
View file @
751a3eb5
package
com.yidianling.user.ui.login.presenter
import
android.annotation.SuppressLint
import
android.text.TextUtils
import
com.ydl.ydlcommon.modular.ModularServiceManager
import
com.ydl.ydlcommon.mvp.base.BasePresenter
...
...
@@ -129,6 +130,7 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base
/**
* 验证码验证码登录
*/
@SuppressLint
(
"CheckResult"
)
override
fun
loginByMsgCode
(
phone
:
String
,
phoneCountryCode
:
String
,
msgCode
:
String
)
{
ActionCountUtils
.
count
(
UserBIConstants
.
POSITION_LOGIN_CLICK
,
UserBIConstants
.
ACTION_TYPE_CODE_LOGIN
)
var
param
=
PhoneLoginCodeParam
(
msgCode
,
phoneCountryCode
,
phone
)
...
...
@@ -152,7 +154,9 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base
}
mView
.
closeActivity
()
}
else
{
mView
.
startAnim
()
ToastUtil
.
toastShort
(
it
.
msg
)
//服务端返回{验证码错误&异常}信息
// mView.startAnim()
mView
.
verificationErrorCode
()
}
},
{
mView
.
startAnim
()
...
...
m-user/src/main/java/com/yidianling/user/widget/PinField/PinField.kt
View file @
751a3eb5
...
...
@@ -82,7 +82,7 @@ open class PinField : AppCompatEditText {
protected
var
yPadding
=
dp2px
(
10f
)
p
rotected
var
highlightSingleFieldType
=
p
ublic
var
highlightSingleFieldType
=
HighlightType
.
ALL_FIELDS
private
var
lastCursorChangeState
:
Long
=
-
1
...
...
@@ -90,7 +90,7 @@ open class PinField : AppCompatEditText {
private
var
cursorCurrentVisible
=
true
private
val
cursorTimeout
=
500L
// public var fieldBgColor=0
var
isCustomBackground
=
false
set
(
value
)
{
if
(!
value
)
{
...
...
m-user/src/main/res/values/colors.xml
View file @
751a3eb5
...
...
@@ -25,4 +25,5 @@
<color
name=
"user_pinFieldLibraryAccent"
>
#1da1f2
</color>
<color
name=
"user_inactivePinFieldColor"
>
#ebebeb
</color>
<color
name=
"user_pinFieldLibraryTransparent"
>
#00000000
</color>
<color
name=
"user_bgcolorred"
>
#990000
</color>
</resources>
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