[fix] 防止页面重复弹出被销毁
This commit is contained in:
@@ -40,6 +40,13 @@ object TaxiLoginModel{
|
||||
.registerCarLocationChangedListener(TAG, mCarLocationChangedListener2)
|
||||
}
|
||||
|
||||
fun hasInit():Boolean{
|
||||
if(mContext==null&& iTaxiLoginCallback==null){
|
||||
return false;
|
||||
}
|
||||
return true
|
||||
}
|
||||
|
||||
// 自车定位
|
||||
private val mCarLocationChangedListener2 = IMogoCarLocationChangedListener2 { location ->
|
||||
mLongitude = location.longitude
|
||||
|
||||
@@ -29,15 +29,18 @@ class TaxiLoginPresenter(view: TaxiLoginDialogFragment?) :
|
||||
private var countDownDisposable: Disposable? = null
|
||||
|
||||
init {
|
||||
TaxiLoginModel.init(AbsMogoApplication.getApp())
|
||||
initListeners()
|
||||
}
|
||||
|
||||
private fun initListeners() {
|
||||
TaxiLoginModel.init(AbsMogoApplication.getApp())
|
||||
TaxiLoginModel.setiTaxiLoginCallback(this)
|
||||
}
|
||||
|
||||
fun getPhoneCode(phone:String){
|
||||
if(!TaxiLoginModel.hasInit()){
|
||||
initListeners()
|
||||
}
|
||||
if (!RegexUtils.isMobileExact(phone)) {
|
||||
ToastUtils.showShort(R.string.module_och_taxi_login_phone_error)
|
||||
mView?.inputPhoneError()
|
||||
@@ -91,6 +94,9 @@ class TaxiLoginPresenter(view: TaxiLoginDialogFragment?) :
|
||||
}
|
||||
|
||||
fun gotoLogin(phone: String, code: String) {
|
||||
if(!TaxiLoginModel.hasInit()){
|
||||
initListeners()
|
||||
}
|
||||
if (!RegexUtils.isMobileExact(phone)) {
|
||||
ToastUtils.showShort(R.string.module_och_taxi_login_phone_error)
|
||||
mView?.inputPhoneError()
|
||||
|
||||
Reference in New Issue
Block a user