[login]
[3.2.0] [登录获取经纬度 去掉监听直接获取值]
This commit is contained in:
@@ -3,8 +3,6 @@ package com.mogo.och.common.module.biz.model
|
||||
import android.annotation.SuppressLint
|
||||
import android.content.Context
|
||||
import com.mogo.eagle.core.data.BaseData
|
||||
import com.mogo.eagle.core.data.map.MogoLocation
|
||||
import com.mogo.eagle.core.function.api.autopilot.IMoGoChassisLocationGCJ02Listener
|
||||
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager
|
||||
import com.mogo.eagle.core.utilcode.util.NetworkUtils
|
||||
import com.mogo.eagle.core.utilcode.util.SharedPrefs
|
||||
@@ -26,17 +24,13 @@ import com.mogo.och.common.module.utils.ToastUtilsOch
|
||||
* 网约车 - 出租车业务逻辑处理
|
||||
*/
|
||||
@SuppressLint("StaticFieldLeak")
|
||||
object OchCommonLoginModel : IMoGoChassisLocationGCJ02Listener {
|
||||
object OchCommonLoginModel {
|
||||
|
||||
private val TAG = "TaxiLoginModel"
|
||||
private var mContext: Context? = null
|
||||
var iTaxiLoginCallback: ITaxiLoginCallback? = null
|
||||
private var mLongitude = 0.0
|
||||
private var mLatitude = 0.0
|
||||
fun init(context: Context) {
|
||||
mContext = context.applicationContext
|
||||
// 达到起始站围栏监听
|
||||
CallerChassisLocationGCJ02ListenerManager.addListener(TAG, this)
|
||||
}
|
||||
|
||||
fun hasInit(): Boolean {
|
||||
@@ -46,13 +40,6 @@ object OchCommonLoginModel : IMoGoChassisLocationGCJ02Listener {
|
||||
return true
|
||||
}
|
||||
|
||||
override fun onChassisLocationGCJ02(gnssInfo: MogoLocation?) {
|
||||
gnssInfo?.let {
|
||||
mLongitude = it.longitude
|
||||
mLatitude = it.latitude
|
||||
}
|
||||
}
|
||||
|
||||
fun getiTaxiLoginCallback(): ITaxiLoginCallback? {
|
||||
return iTaxiLoginCallback
|
||||
}
|
||||
@@ -64,8 +51,6 @@ object OchCommonLoginModel : IMoGoChassisLocationGCJ02Listener {
|
||||
fun release() {
|
||||
mContext = null
|
||||
iTaxiLoginCallback = null
|
||||
// 注销到达起始站围栏监听
|
||||
CallerChassisLocationGCJ02ListenerManager.removeListener(TAG)
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -105,7 +90,8 @@ object OchCommonLoginModel : IMoGoChassisLocationGCJ02Listener {
|
||||
|
||||
fun gotoLogin(phone: String, code: String) {
|
||||
mContext?.let {
|
||||
val location4Login = TaxiLoginReqBean.Location4Login(mLatitude, mLongitude)
|
||||
val location = CallerChassisLocationGCJ02ListenerManager.getChassisLocationGCJ02()
|
||||
val location4Login = TaxiLoginReqBean.Location4Login(location.latitude, location.longitude)
|
||||
OchCommonServiceManager.gotoLoginBycode(it, phone, code, location4Login,
|
||||
object : OchCommonServiceCallback<TaxiLoginRespBean> {
|
||||
override fun onSuccess(data: TaxiLoginRespBean?) {
|
||||
|
||||
Reference in New Issue
Block a user