[fix]
[获取验证码添加日志]
This commit is contained in:
yangyakun
2024-11-29 15:32:00 +08:00
parent dfadd7e569
commit 656cfcad28
7 changed files with 57 additions and 32 deletions

View File

@@ -31,6 +31,7 @@ import com.mogo.och.common.module.biz.login.LoginStatusEnum.Companion.valueOf
import com.mogo.och.common.module.biz.login.LoginStatusManager
import com.mogo.och.common.module.manager.autopilot.location.OchLocationManager
import com.mogo.och.common.module.manager.cache.OchSPManager
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
import com.mogo.och.common.module.manager.socket.lan.bean.BusCacheKey
import com.mogo.och.common.module.manager.socket.lan.bean.LoginCacheStatus
import com.mogo.och.common.module.network.OchCommonServiceCallback
@@ -101,33 +102,37 @@ object LoginModel {
* 获取手机验证码
*/
fun getPhoneCode(phone: String?) {
mContext?.let {
OchCommonServiceManager.getPhoneCode(it, phone,
object : OchCommonServiceCallback<BaseData> {
override fun onSuccess(data: BaseData?) {
if (null != data && 0 == data.code) {
// 获取验证码成功
ToastCharterUtils.showToastShort(mContext?.getString(R.string.module_och_taxi_login_get_code_success))
iTaxiLoginCallback?.getPhoneCodeSuccess()
} else {
if (data != null) {
ToastCharterUtils.showToastShort(data.code.toString())
if(mContext==null){
OchChainLogManager.writeChainLog("登录页面","获取验证码 mContext${mContext}")
}else {
mContext?.let {
OchCommonServiceManager.getPhoneCode(it, phone,
object : OchCommonServiceCallback<BaseData> {
override fun onSuccess(data: BaseData?) {
if (null != data && 0 == data.code) {
// 获取验证码成功
ToastCharterUtils.showToastShort(mContext?.getString(R.string.module_och_taxi_login_get_code_success))
iTaxiLoginCallback?.getPhoneCodeSuccess()
} else {
if (data != null) {
ToastCharterUtils.showToastShort(data.code.toString())
}
}
}
}
override fun onError() {
if (!NetworkUtils.isConnected(mContext)) {
ToastCharterUtils.showToastShort(mContext?.getString(R.string.network_error_tip))
} else {
ToastCharterUtils.showToastShort(mContext?.getString(R.string.request_error_tip))
override fun onError() {
if (!NetworkUtils.isConnected(mContext)) {
ToastCharterUtils.showToastShort(mContext?.getString(R.string.network_error_tip))
} else {
ToastCharterUtils.showToastShort(mContext?.getString(R.string.request_error_tip))
}
}
}
override fun onFail(code: Int, msg: String) {
ToastUtilsOch.showWithCodeMessage(code, msg)
}
})
override fun onFail(code: Int, msg: String) {
ToastUtilsOch.showWithCodeMessage(code, msg)
}
})
}
}
}

View File

@@ -13,6 +13,7 @@ import com.mogo.och.biz.login.callback.ITaxiLoginCallback
import com.mogo.och.biz.login.ui.LoginFragment
import com.mogo.och.biz.login.model.LoginModel
import com.mogo.och.common.module.biz.login.LoginStatusManager
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
import io.reactivex.Observable
import io.reactivex.android.schedulers.AndroidSchedulers
@@ -54,6 +55,7 @@ class LoginPresenter(view: LoginFragment?) : Presenter<LoginFragment?>(view), IT
if (!RegexUtils.isMobileExact(phone)) {
ToastCharterUtils.showToastShort(R.string.module_och_taxi_login_phone_error)
mView?.inputPhoneError()
OchChainLogManager.writeChainLog("登录页面","获取验证码 手机号输入错误")
return
}
LoginModel.getPhoneCode(phone)

View File

@@ -32,6 +32,7 @@ import com.mogo.och.biz.BuildConfig
import com.mogo.och.biz.R
import com.mogo.och.biz.login.callback.ILoginViewCallback
import com.mogo.och.biz.login.presenter.LoginPresenter
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
import com.mogo.skin.utils.SkinResources
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
import com.shuyu.gsyvideoplayer.listener.GSYSampleCallBack
@@ -134,8 +135,12 @@ class LoginFragment : MvpFragment<LoginFragment?, LoginPresenter?>(), ILoginView
biz_actv_welcome_login_title.setOnClickListener {
continuousClick()
}
biz_actv_login_get_code.onClick(300) {
mPresenter?.getPhoneCode(biz_ace_login_phone_value.text.toString())
biz_actv_login_get_code.setOnClickListener {
if(mPresenter==null){
OchChainLogManager.writeChainLog("司机登录页面","mPresenter=${mPresenter}")
}else{
mPresenter?.getPhoneCode(biz_ace_login_phone_value.text.toString())
}
}
biz_ace_login_phone_value.addTextChangedListener {

View File

@@ -0,0 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<selector xmlns:android="http://schemas.android.com/apk/res/android">
<item android:color="@color/biz_login_2EACFF" android:state_pressed="true"/>
<item android:color="@color/white" android:state_pressed="false"/>
<item android:color="@color/white"/>
</selector>

View File

@@ -128,7 +128,8 @@
app:layout_constraintEnd_toEndOf="@+id/v_phone_code_bg"
android:paddingEnd="30dp"
android:textSize="40dp"
android:textColor="@color/biz_login_878890"
app:pressed_enabled="false"
android:textColor="@color/biz_login_getcode_text_color_selector"
android:gravity="start|center_vertical"
android:text="@string/module_och_taxi_login_get_code"
android:layout_width="wrap_content"

View File

@@ -12,4 +12,6 @@
<color name="biz_login_19FFF5">#19FFF5</color>
<color name="biz_login_1970FF">#1970FF</color>
<color name="biz_login_2EACFF">#2EACFF</color>
</resources>

View File

@@ -510,13 +510,17 @@ object OrderModel {
@JvmStatic
fun logoutInner() {
ThreadUtils.getIoPool().execute {
if(RepositoryManager.haveDataWaitSyn()){
ToastUtils.showShort(ResourcesUtils.getString(R.string.shuttle_logout_error))
return@execute
}
if(RepositoryManager.haveRunningTask()){
ToastUtils.showShort(ResourcesUtils.getString(R.string.shuttle_logout_error_running))
return@execute
try {
if(RepositoryManager.haveDataWaitSyn()){
ToastUtils.showShort(ResourcesUtils.getString(R.string.shuttle_logout_error))
return@execute
}
if(RepositoryManager.haveRunningTask()){
ToastUtils.showShort(ResourcesUtils.getString(R.string.shuttle_logout_error_running))
return@execute
}
}catch (e:Exception){
OchChainLogManager.writeChainLog("错误","${e.message}")
}
MapMakerManager.removeAllMapMarkerByOwner(TAG)
BusTrajectoryManager.getInstance().stopTrajReqLoop();