liugl
2021-01-14 40f9ac00ec5e4d6363450d1c8e0b0937cc0b1de4
app/src/main/java/com/okgoincar/slab/SlabGetOrderFragment.kt
@@ -5,10 +5,7 @@
import android.os.Bundle
import android.os.CountDownTimer
import cn.sinata.xldutils.activitys.DialogActivity
import cn.sinata.xldutils.utils.Toast
import cn.sinata.xldutils.utils.clickDelay
import cn.sinata.xldutils.utils.getNowTimeBlack
import cn.sinata.xldutils.utils.textColor
import cn.sinata.xldutils.utils.*
import com.amap.api.maps.model.LatLng
import com.okgoincar.netUtls.*
import com.okgoincar.slab.util.UiUtil
@@ -19,6 +16,7 @@
import com.okgoincar.bean.OrderBean
import com.okgoincar.bean.ServerVoiceBean
import com.okgoincar.netUtls.Api
import com.okgoincar.slab.cargo.CargoActivity
import kotlinx.android.synthetic.main.item_get_order.*
import kotlinx.android.synthetic.main.item_map_market.view.*
import org.jetbrains.anko.startActivity
@@ -126,6 +124,21 @@
            tv_end.text = data.endAddress
            tv_money.text = data.tipMoney.toString() + "元红包"
            tv_reassign.text = data.type
            if (orderType == "5" || orderType == "4"){
                toast("确少货物数量")
                tv_name.visible()
                tv_cargo_num.visible()
                tv_money.visible()
                tv_money.setDrawableLeft(R.mipmap.rocket_cargo)
                tv_name.text = data.nickName+"-"+data.phone
                var cargoStrType = if (data.cargoType == "1") "普通小件X" else "贵重小件X"
                tv_cargo_num.text = cargoStrType+data.peopleNumber
                if (data.tipMoney != null && data.tipMoney > 0.0){
                    tv_money.text = doubleTwo(data.tipMoney)+"元加急费"
                }else{
                    tv_money.gone()
                }
            }
            AMapKit.initRouteLine(
                this,
                LatLng(MyApplication.getLocation().latitude, MyApplication.getLocation().longitude),
@@ -151,6 +164,8 @@
            tv_start.textColor(this,R.color.white)
            tv_end.textColor(this,R.color.white)
            tv_money.textColor(this,R.color.white)
            tv_name.textColor(this,R.color.white)
            tv_cargo_num.textColor(this,R.color.white)
            tv_title.textColor(this,R.color.slab_yellow_zhong)
        }else{
            rl_top_back.setBackgroundResource(R.color.white)
@@ -159,6 +174,8 @@
            tv_start.textColor(this,R.color.black)
            tv_end.textColor(this,R.color.black)
            tv_money.textColor(this,R.color.black)
            tv_name.textColor(this,R.color.black)
            tv_cargo_num.textColor(this,R.color.black)
            tv_title.textColor(this,R.color.yellow_ffa72d)
        }
    }
@@ -173,7 +190,14 @@
            dismissDialog()
            Toast.create(this).show("抢单成功")
            onBackPressed()
            this.startActivity<SlabTripActivity>("orderId" to orderId, "orderType" to orderType)
            when(orderType){
                "1","2","3" -> {
                    this.startActivity<SlabTripActivity>("orderId" to orderId, "orderType" to orderType)
                }
                "4","5" -> {
                    this.startActivity<CargoActivity>("orderId" to orderId, "orderType" to orderType)
                }
            }
        },{
            toast(it!!)
            dismissDialog()