| | |
| | | } |
| | | } |
| | | |
| | | // private fun toLoginActivity(context: Context?, driverCertificate: String?) { |
| | | // var map = getMapByAny() |
| | | // map["identification"] = driverCertificate |
| | | // callNet(context!!, Api.loginByIdentification, map) { |
| | | // toast("登录成功") |
| | | // var bean = Gson().fromJson<LoginBean>(it, LoginBean::class.java) |
| | | // CacheKey.putKeyStr("identification", driverCertificate!!) |
| | | // CacheKey.putKeyStr("appid", bean.data.appid) |
| | | // CacheKey.putKeyStr("token", bean.data.token) |
| | | // CacheKey.putKeyStr("userId", bean.data.id.toString()) |
| | | // CacheKey.putKeyStr("serverId", bean.data.serverId.toString()) |
| | | // CacheKey.putKeyStr("terminalName", bean.data.terminalId.toString()) |
| | | // Handler(Looper.getMainLooper()).post { |
| | | // var intent = Intent() |
| | | // intent.setClass(context, SlabMainActivity::class.java) |
| | | // intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK |
| | | // context.startActivity(intent) |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | private fun toLoginActivity(context: Context?, driverCertificate: String?) { |
| | | var map = getMapByAny() |
| | | if (driverCertificate.isNullOrEmpty()){ |
| | | // toast("资格证号:空") |
| | | toast("资格证号:空") |
| | | return |
| | | }else{ |
| | | // toast("资格证号:"+driverCertificate) |
| | | } |
| | | map["taxiAptitudeCard"] = driverCertificate |
| | | callNet(context!!, Api.loginByTaxiAptitudeCard, map) { |
| | |
| | | import org.greenrobot.eventbus.EventBus |
| | | import java.lang.Exception |
| | | |
| | | /*** |
| | | * 为了支持本页面所需的 MyApplication.currentOrderId 所以在订单列表获取处,订单页面,设置了这个常量的值 |
| | | * |
| | | * 1:接单后 重车时无网 |
| | | * --车载屏无反应 |
| | | * 缓存 订单开始状态 |
| | | * 来网后空车时 --》 查看是否有进行中id,是否有缓存 |
| | | * |
| | | * |
| | | * 2:接单后 空车时无网 |
| | | * |
| | | * |
| | | * |
| | | * 3:接单后 正常状态 |
| | | * |
| | | * |
| | | * |
| | | * 4:接单后 都没有网络 |
| | | * |
| | | * |
| | | */ |
| | | class MoneyBroadCastReceiver : BroadcastReceiver() { |
| | | override fun onReceive(contexts: Context?, intent: Intent?) { |
| | | if (intent == null && contexts == null) { |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | fun callOver(contexts: Context, travelFee: Double) { |
| | | if (MyApplication.currentOrderId.isEmpty()) { |
| | |
| | | |
| | | override fun setOnclick() { |
| | | tv_login.clickDelay { |
| | | // var map = getMapByAny() |
| | | // map["jobNum"] = et_number.getContent().trim() |
| | | // callNet(true, Api.loginByJobNumber, map) { |
| | | // toast("登录成功") |
| | | // var bean = gson.fromJson<LoginBean>(it, LoginBean::class.java) |
| | | // CacheKey.putKeyStr("jobNum",et_number.getContent().trim()) |
| | | // CacheKey.putKeyStr("appid", bean.data.appid) |
| | | // CacheKey.putKeyStr("token", bean.data.token) |
| | | // CacheKey.putKeyStr("userId", bean.data.id.toString()) |
| | | // CacheKey.putKeyStr("serverId", bean.data.serverId.toString()) |
| | | // CacheKey.putKeyStr("terminalName", bean.data.terminalId.toString()) |
| | | // finish() |
| | | // startActivity<SlabMainActivity>() |
| | | // } |
| | | // 51168119911111447X 15928265276 11111q |
| | | toLoginActivity(this,"450211198101280848") |
| | | // 450211198101280848 黄桥账号 |
| | | toLoginActivity(this, et_number.getContent()) |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | } |
| | | |
| | | |
| | | // private fun toLoginActivity(context: Context?, driverCertificate: String?) { |
| | | // var map = getMapByAny() |
| | | // map["identification"] = driverCertificate |
| | | // callNet(context!!, Api.loginByIdentification, map) { |
| | | // toast("登录成功") |
| | | // var bean = Gson().fromJson<LoginBean>(it, LoginBean::class.java) |
| | | // CacheKey.putKeyStr("identification", driverCertificate!!) |
| | | // CacheKey.putKeyStr("appid", bean.data.appid) |
| | | // CacheKey.putKeyStr("token", bean.data.token) |
| | | // CacheKey.putKeyStr("userId", bean.data.id.toString()) |
| | | // CacheKey.putKeyStr("serverId", bean.data.serverId.toString()) |
| | | // CacheKey.putKeyStr("terminalName", bean.data.terminalId.toString()) |
| | | // Handler(Looper.getMainLooper()).post { |
| | | // var intent = Intent() |
| | | // intent.setClass(context, SlabMainActivity::class.java) |
| | | // intent.flags = Intent.FLAG_ACTIVITY_NEW_TASK |
| | | // context.startActivity(intent) |
| | | // } |
| | | // } |
| | | // } |
| | | |
| | | } |
| | |
| | | callVersion() |
| | | } |
| | | }else{ |
| | | toast("无网络") |
| | | showNoneNetDialog() |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | override fun onResume() { |
| | | super.onResume() |
| | | showNoneNetDialog() |
| | | try { |
| | | mainFragment?.refresh() |
| | | }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 { |
| | |
| | | android:layout_height="91dp" |
| | | android:layout_marginTop="30dp" |
| | | android:gravity="center" |
| | | android:text="网 络 不 通 畅" |
| | | android:text="服 务 监 督 卡" |
| | | android:textColor="#ED5F08" |
| | | android:textSize="66sp" |
| | | android:textStyle="bold" |