Commit 751a3eb5 by 霍志良

feat:验证码异常回调

parent 6bb6de86
...@@ -5,6 +5,7 @@ import android.app.Activity ...@@ -5,6 +5,7 @@ import android.app.Activity
import android.content.Context import android.content.Context
import android.content.Intent import android.content.Intent
import android.net.Uri import android.net.Uri
import android.os.Build
import android.os.Handler import android.os.Handler
import android.support.v4.content.ContextCompat import android.support.v4.content.ContextCompat
import android.text.TextUtils import android.text.TextUtils
...@@ -16,6 +17,7 @@ import com.ydl.ydlcommon.utils.ActivityManager ...@@ -16,6 +17,7 @@ import com.ydl.ydlcommon.utils.ActivityManager
import com.ydl.ydlcommon.utils.StatusBarUtils import com.ydl.ydlcommon.utils.StatusBarUtils
import com.ydl.ydlcommon.utils.YDLCacheUtils import com.ydl.ydlcommon.utils.YDLCacheUtils
import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils import com.ydl.ydlcommon.utils.actionutil.ActionCountUtils
import com.yidianling.common.tools.LogUtil
import com.yidianling.common.tools.RxKeyboardTool import com.yidianling.common.tools.RxKeyboardTool
import com.yidianling.common.tools.ToastUtil import com.yidianling.common.tools.ToastUtil
import com.yidianling.user.LoginUtils import com.yidianling.user.LoginUtils
...@@ -25,6 +27,7 @@ import com.yidianling.user.constants.UserBIConstants ...@@ -25,6 +27,7 @@ import com.yidianling.user.constants.UserBIConstants
import com.yidianling.user.http.request.BindPhoneJavaParam import com.yidianling.user.http.request.BindPhoneJavaParam
import com.yidianling.user.ui.login.contract.IVerificationCodeContract import com.yidianling.user.ui.login.contract.IVerificationCodeContract
import com.yidianling.user.ui.login.presenter.VerificationCodePresenterImpl 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.PinField.PinField
import com.yidianling.user.widget.ZDialog import com.yidianling.user.widget.ZDialog
import io.reactivex.Observable import io.reactivex.Observable
...@@ -274,6 +277,14 @@ class VerificationCodeActivity : ...@@ -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 : ...@@ -395,7 +406,9 @@ class VerificationCodeActivity :
//设置红色边框 //设置红色边框
// verify_code.setErrorColor() // verify_code.setErrorColor()
//验证码设置红色边框,验证码错误 //验证码设置红色边框,验证码错误&验证码过期
} }
private fun closeAnim(hasAnim: Boolean) { private fun closeAnim(hasAnim: Boolean) {
......
...@@ -52,6 +52,11 @@ interface IVerificationCodeContract { ...@@ -52,6 +52,11 @@ interface IVerificationCodeContract {
* 百度监测埋点 * 百度监测埋点
*/ */
fun baiduActionBury() fun baiduActionBury()
/*
* 验证码错误&异常超时等回调
* */
fun verificationErrorCode()
} }
interface Presenter : IPresenter< View> { interface Presenter : IPresenter< View> {
......
package com.yidianling.user.ui.login.presenter package com.yidianling.user.ui.login.presenter
import android.annotation.SuppressLint
import android.text.TextUtils import android.text.TextUtils
import com.ydl.ydlcommon.modular.ModularServiceManager import com.ydl.ydlcommon.modular.ModularServiceManager
import com.ydl.ydlcommon.mvp.base.BasePresenter import com.ydl.ydlcommon.mvp.base.BasePresenter
...@@ -129,6 +130,7 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base ...@@ -129,6 +130,7 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base
/** /**
* 验证码验证码登录 * 验证码验证码登录
*/ */
@SuppressLint("CheckResult")
override fun loginByMsgCode(phone: String, phoneCountryCode: String, msgCode: String) { override fun loginByMsgCode(phone: String, phoneCountryCode: String, msgCode: String) {
ActionCountUtils.count(UserBIConstants.POSITION_LOGIN_CLICK,UserBIConstants.ACTION_TYPE_CODE_LOGIN) ActionCountUtils.count(UserBIConstants.POSITION_LOGIN_CLICK,UserBIConstants.ACTION_TYPE_CODE_LOGIN)
var param = PhoneLoginCodeParam(msgCode, phoneCountryCode, phone) var param = PhoneLoginCodeParam(msgCode, phoneCountryCode, phone)
...@@ -152,7 +154,9 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base ...@@ -152,7 +154,9 @@ class VerificationCodePresenterImpl(view: IVerificationCodeContract.View) : Base
} }
mView.closeActivity() mView.closeActivity()
} else { } else {
mView.startAnim() ToastUtil.toastShort(it.msg)//服务端返回{验证码错误&异常}信息
// mView.startAnim()
mView.verificationErrorCode()
} }
}, { }, {
mView.startAnim() mView.startAnim()
......
...@@ -82,7 +82,7 @@ open class PinField : AppCompatEditText { ...@@ -82,7 +82,7 @@ open class PinField : AppCompatEditText {
protected var yPadding = dp2px(10f) protected var yPadding = dp2px(10f)
protected var highlightSingleFieldType = public var highlightSingleFieldType =
HighlightType.ALL_FIELDS HighlightType.ALL_FIELDS
private var lastCursorChangeState: Long = -1 private var lastCursorChangeState: Long = -1
...@@ -90,7 +90,7 @@ open class PinField : AppCompatEditText { ...@@ -90,7 +90,7 @@ open class PinField : AppCompatEditText {
private var cursorCurrentVisible = true private var cursorCurrentVisible = true
private val cursorTimeout = 500L private val cursorTimeout = 500L
// public var fieldBgColor=0
var isCustomBackground = false var isCustomBackground = false
set(value) { set(value) {
if (!value) { if (!value) {
......
...@@ -25,4 +25,5 @@ ...@@ -25,4 +25,5 @@
<color name="user_pinFieldLibraryAccent">#1da1f2</color> <color name="user_pinFieldLibraryAccent">#1da1f2</color>
<color name="user_inactivePinFieldColor">#ebebeb</color> <color name="user_inactivePinFieldColor">#ebebeb</color>
<color name="user_pinFieldLibraryTransparent">#00000000</color> <color name="user_pinFieldLibraryTransparent">#00000000</color>
<color name="user_bgcolorred">#990000</color>
</resources> </resources>
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