liugl
2020-08-21 e04a10081655911e65a93ac864051747a19a2d99
app/src/main/java/com/okgoincar/slab/SlabMainActivity.kt
@@ -9,6 +9,7 @@
import android.widget.Toast
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import cn.sinata.rxnetty.Cache.CacheUtil
import cn.sinata.rxnetty.NettyClient
import cn.sinata.xldutils.utils.*
import com.amap.api.location.AMapLocation
@@ -124,7 +125,11 @@
    private fun showUI(data: UserInfoBean?) {
        data?.let {
            tv_code_num.text = "资格证号:" + data.taxiAptitudeCard
            if (data.taxiAptitudeCard.length > 7){
                tv_code_num.text  = data.taxiAptitudeCard.substring(0,3)+"**********"+data.taxiAptitudeCard.substring(data.taxiAptitudeCard.length-4,data.taxiAptitudeCard.length)
            }else{
                tv_code_num.text = "资格证号:" + data.taxiAptitudeCard
            }
            tv_name.text = "姓名:" + it.name
            tv_car_num.text = "车牌:" + it.licensePlate
            recycler_view_start.layoutManager =
@@ -134,13 +139,17 @@
                    false
                ) as RecyclerView.LayoutManager?
            recycler_view_start.adapter = SlabStartAdapter(it.score.toDouble())
            tv_company.text = "公司:" + it.company
            var company = it.company
            if (company.startsWith("广西")){
                company = company.substring(2,company.length)
            }
            tv_company.text = "公司:" + company
            tv_time.text = "发证日期:" + it.networkCarlssueDate
            GlideUtil.load(this, it.avatar, iv_head, 8)
            tv_current_time.text = DateUtil.getTime(
                DateUtil.TYPE7,
                System.currentTimeMillis()
            ) + "\n" + DateUtil.getWeek(System.currentTimeMillis())
            ) + DateUtil.getWeek(System.currentTimeMillis())
        }
    }
@@ -203,7 +212,6 @@
        }
        tv_name.clickDelay {
            toast("点亮网约")
        }
        tv_car_num.clickDelay {
@@ -218,12 +226,12 @@
            startActivity<SlabOrderListActivity>()
        }
        ll_task.clickDelay {
            startActivity<SlabMineEventActivity>()
        }
        tv_title_top.clickDelay {
        }
        view_mode.clickDelay {
@@ -232,10 +240,12 @@
                CacheKey.putKeyStr("date_mode", System.currentTimeMillis().toString())
                CacheKey.putKeyStr("mode_now_time", "1")//记录为点击切换的颜色 1 白色 2 黑色
                setBlackMode(false)
                mainFragment.adapter.notifyDataSetChanged()
            } else {
                CacheKey.putKeyStr("date_mode", System.currentTimeMillis().toString())
                CacheKey.putKeyStr("mode_now_time", "2")
                setBlackMode(true)
                mainFragment.adapter.notifyDataSetChanged()
            }
@@ -299,16 +309,16 @@
    override fun onLocationChanged(p0: AMapLocation?) {
        if (p0 == null) {
            toast("高德位置是空的")
//            toast("高德位置是空的")
            return
        }
        if (p0.errorCode == 0) {
            toast("定位成功")
//            toast("定位成功")
            MyApplication.aMapLocation = p0
            CacheKey.putKeyStr("location", Gson().toJson(p0))
        } else {
            p0.let {
                toast("定位失败" + it.errorCode.toString())
//                toast("定位失败" + it.errorCode.toString())
            }
        }
    }
@@ -338,11 +348,9 @@
                }
            } else {
                toast("已经是最新版本")
            }
        }
    }
    private fun callLogin(ok: () -> Unit) {
        var jobNum = CacheKey.getKeyStr("jobNum")