lmw
4 天以前 dbd287f9349ed52c8e861c2aadecff9a9bd83f3a
app/src/main/java/com/zhaoyang/driver/ui/main/GetOrderFragment.kt
@@ -1,5 +1,6 @@
package com.zhaoyang.driver.ui.main
import android.graphics.Color
import android.os.Bundle
import android.os.CountDownTimer
import android.view.View
@@ -115,6 +116,10 @@
        callNet(this, Api.queryPushOrder, map) {
            val data = Gson().fromJson<OrderBean>(it, OrderBean::class.java).data
            sysErr(data)
            if (data.reservation == 2){
                rl_top.setBackgroundResource(R.drawable.car_get_top_red)
                tv_reassign.setTextColor(Color.parseColor("#D42A23"))
            }
            val startView = createView(R.layout.item_map_market, this)
            val endView = createView(R.layout.item_map_market, this)
            startView.iv_img.setImageResource(R.mipmap.starting_point)
@@ -199,26 +204,27 @@
        callNet(this, Api.grabOrder, map) {
            Toast.create(this).show("抢单成功")
            onBackPressed()
            when (orderType) {
                "2" -> {
                    this.startActivity<TripActivity>("orderId" to orderId, "orderType" to orderType)
            if (MyApplication.currentOrderId.isEmpty()) //判断上一单是否结束
                when (orderType) {
                    "2" -> {
                        this.startActivity<TripActivity>("orderId" to orderId, "orderType" to orderType)
                    }
                    "1" -> {
                        this.startActivity<TripActivity>("orderId" to orderId, "orderType" to orderType)
                    }
                    "3" -> {
                        this.startActivity<TripCityActivity>(
                            "orderId" to orderId,
                            "orderType" to orderType
                        )
                    }
                    "4","5" -> {
                        this.startActivity<SmallCargoActivity>(
                            "orderId" to orderId,
                            "orderType" to orderType
                        )
                    }
                }
                "1" -> {
                    this.startActivity<TripActivity>("orderId" to orderId, "orderType" to orderType)
                }
                "3" -> {
                    this.startActivity<TripCityActivity>(
                        "orderId" to orderId,
                        "orderType" to orderType
                    )
                }
                "4","5" -> {
                    this.startActivity<SmallCargoActivity>(
                        "orderId" to orderId,
                        "orderType" to orderType
                    )
                }
            }
        }
    }
}