| | |
| | | callVersion() |
| | | } |
| | | }else{ |
| | | toast("无网络") |
| | | showNoneNetDialog() |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | override fun onResume() { |
| | | super.onResume() |
| | | showNoneNetDialog() |
| | | try { |
| | | mainFragment?.refresh() |
| | | callPersion() |
| | | }catch (e:Exception){ |
| | | |
| | | } |
| | | } |
| | | |
| | | fun showNoneNetDialog(){ |
| | | if (!NetUtils.isNetworkConnected(this)){ |
| | | popup = getSlabDelAndSurePopWindow(this,"刷新","取消","网络不通畅,是否刷新页面?",{}){ |
| | | if (!NetUtils.isNetworkConnected(this)){ |
| | |
| | | popup?.showCenter(window.decorView) |
| | | } |
| | | } |
| | | try { |
| | | mainFragment?.refresh() |
| | | }catch (e:Exception){ |
| | | |
| | | } |
| | | |
| | | } |
| | | |
| | | fun getSlabDelAndSurePopWindow(context: Context,sureStr:String,cancelStr:String,content:String,clickClose :() -> Unit,clickSure:() -> Unit): EasyPopup { |
| | |
| | | toast("收到显示屏信息") |
| | | } |
| | | } |
| | | BaseEvent.UPDATA_MAIN_CAR->{ |
| | | try { |
| | | mainFragment.refresh() |
| | | }catch (e:Exception){ |
| | | } |
| | | } |
| | | BaseEvent.ERROR_INFO -> { |
| | | try { |
| | | mainFragment.refresh() |
| | | }catch (e:Exception){ |
| | | |
| | | } |
| | | } |
| | | } |
| | |
| | | if (bean.data.version != "" && bean.data.version != Utils.getAppVersion(this)) { |
| | | if (bean.data.mandatory == 0) { |
| | | var pop = |
| | | DialogUtil.getSlabDelAndSurePopWindow(this, "确定", "取消", "有新版本是否更新", {}) { |
| | | DialogUtil.getSlabDelAndSurePopWindow(true,this, "确定", "取消", "有新版本是否更新", {}) { |
| | | DownloadUtil(this).downloadAPK(bean.data.url, "ok出行车载端") |
| | | } |
| | | pop.showCenter(window.decorView) |
| | | } else { |
| | | var pop = DialogUtil.getSlabDelAndSurePopWindow( |
| | | false, |
| | | this, |
| | | "确定", |
| | | "取消", |
| | | "版本已过时,是否强制升级?", |
| | | "版本已过时,强制升级!", |
| | | {}) { |
| | | DownloadUtil(this).downloadAPK(bean.data.url, "ok出行车载端") |
| | | toast("后台开始下载,请等待") |
| | |
| | | var map = getMapByAny() |
| | | map["taxiAptitudeCard"] = identification |
| | | callNet(this, Api.loginByTaxiAptitudeCard, map,{ |
| | | ok() |
| | | }) { |
| | | var bean = Gson().fromJson<LoginBean>(it, LoginBean::class.java) |
| | | CacheKey.putKeyStr("identification", identification) |
| | | CacheKey.putKeyStr("appid", bean.data.appid) |
| | |
| | | CacheKey.putKeyStr("userId", bean.data.id.toString()) |
| | | CacheKey.putKeyStr("serverId", bean.data.serverId.toString()) |
| | | CacheKey.putKeyStr("terminalName", bean.data.terminalId.toString()) |
| | | ok() |
| | | }) { |
| | | ok() |
| | | } |
| | | } else if (identification.isNotEmpty()) { |
| | | var map = getMapByAny() |
| | | map["taxiAptitudeCard"] = identification |
| | | callNet(true, Api.loginByTaxiAptitudeCard, map) { |
| | | callNet(this, Api.loginByTaxiAptitudeCard, map,{ |
| | | var bean = Gson().fromJson<LoginBean>(it, LoginBean::class.java) |
| | | CacheKey.putKeyStr("identification", identification) |
| | | CacheKey.putKeyStr("appid", bean.data.appid) |
| | |
| | | CacheKey.putKeyStr("serverId", bean.data.serverId.toString()) |
| | | CacheKey.putKeyStr("terminalName", bean.data.terminalId.toString()) |
| | | ok() |
| | | }) { |
| | | ok() |
| | | } |
| | | } else { |
| | | ok() |