From 0fb44d953ab25a53d228b4c1f9381df80e70ee03 Mon Sep 17 00:00:00 2001
From: liugl <liugl@sinata.cn>
Date: 星期一, 21 六月 2021 15:32:23 +0800
Subject: [PATCH] 1。4:处理预约单导致串单的问题 隐藏预约单

---
 app/src/main/java/com/okgoincar/slab/SlabLoginActivity.kt |   53 ++++++++++++++++++++---------------------------------
 1 files changed, 20 insertions(+), 33 deletions(-)

diff --git a/app/src/main/java/com/okgoincar/slab/SlabLoginActivity.kt b/app/src/main/java/com/okgoincar/slab/SlabLoginActivity.kt
index c759399..79dab30 100644
--- a/app/src/main/java/com/okgoincar/slab/SlabLoginActivity.kt
+++ b/app/src/main/java/com/okgoincar/slab/SlabLoginActivity.kt
@@ -1,6 +1,7 @@
 package com.okgoincar.slab
 
 import android.content.Context
+import android.content.Intent
 import android.os.Handler
 import android.os.Looper
 import android.widget.Toast
@@ -23,6 +24,11 @@
 import org.jetbrains.anko.toast
 
 class SlabLoginActivity : MySlabBaseActivity() {
+
+    val isMoreLogin by lazy {
+        intent.getBooleanExtra("IsMoreLogin",false)
+    }
+
     override fun setContentView() {
         setContentView(R.layout.slab_activity_login)
     }
@@ -31,50 +37,32 @@
         showTitle(false)
         showHeader(false)
 
-    }
+        if (isMoreLogin){
+            window.decorView.post {
+                var pop =  DialogUtil.getSlabDelAndSurePopWindow(false,this,"确定","取消","您的账号在其他车载端登录,或者在本机长时间未登录,需要重新登签!",{}){
 
-    override fun onResume() {
-        super.onResume()
-        if (!NetUtils.isNetworkConnected(this)){
-           var dialog =  DialogUtil.getSlabSurePopWindow(this,"当前网络不通畅,请稍后再登录"){
-                EventBus.getDefault().post(BaseEvent(BaseEvent.OUT_APP))
+                }
+                pop.showCenter(window.decorView)
             }
-            dialog.showCenter(window.decorView)
         }
     }
 
     override fun setOnclick() {
         tv_login.clickDelay {
-            if (et_number.getContent().isNullOrEmpty()) {
-                toast("请输入工号")
-                return@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>()
-            }
-//            toLoginActivity(this,"452229198204010012")
-
+            //            51168119911111447X  15928265276 11111q
+//            450211198101280848 黄桥账号
+//            toLoginActivity(this, "450211198101280848")
+            toLoginActivity(this, et_number.getContent())
         }
     }
 
-    override fun setBlackMode(b:Boolean) {
+    override fun setBlackMode(b: Boolean) {
         super.setBlackMode(b)
-        if (b){
+        if (b) {
             iv_back_login.setBackgroundResource(R.mipmap.bg_black)
             ll_center.setBackgroundResource(R.color.black_mode_383838)
             et_number.setBackgroundResource(R.drawable.bg_gray_4_line_black)
-        }else{
+        } else {
             iv_back_login.setBackgroundResource(R.mipmap.bg_lab_login)
             ll_center.setBackgroundResource(R.color.write)
             et_number.setBackgroundResource(R.drawable.bg_gray_4_line)
@@ -96,8 +84,8 @@
 
     private fun toLoginActivity(context: Context?, driverCertificate: String?) {
         var map = getMapByAny()
-        map["identification"] = driverCertificate
-        callNet(context!!,Api.loginByIdentification,map){
+        map["taxiAptitudeCard"] = driverCertificate
+        callNet(context!!, Api.loginByTaxiAptitudeCard, map) {
             cn.sinata.xldutils.utils.toast("登录成功")
             var bean = Gson().fromJson<LoginBean>(it, LoginBean::class.java)
             CacheKey.putKeyStr("appid", bean.data.appid)
@@ -110,5 +98,4 @@
             }
         }
     }
-
 }
\ No newline at end of file

--
Gitblit v1.7.1