车队长分配车辆

This commit is contained in:
lijia 2024-04-17 15:50:45 +08:00
parent 632bfc4912
commit b7706e4549
19 changed files with 321 additions and 197 deletions

View File

@ -2,13 +2,12 @@ package com.dahe.gldriver.adapter
import android.content.Context
import android.view.ViewGroup
import android.widget.Button
import android.widget.LinearLayout
import android.widget.ImageView
import com.chad.library.adapter4.BaseQuickAdapter
import com.chad.library.adapter4.viewholder.QuickViewHolder
import com.dahe.gldriver.R
import com.dahe.gldriver.bean.CarBean
import com.dahe.glex.bean.WayBillBean
import com.dahe.mylibrary.utils.ImageLoader
/**
* @ClassName WaybillAdapter
@ -16,15 +15,21 @@ import com.dahe.glex.bean.WayBillBean
* @Date 2024/1/23 16:27
* @Description TODO
*/
class SelectCarAdapter :
class SelectCarAdapter(var isCap: Boolean) :
BaseQuickAdapter<CarBean, QuickViewHolder>() {
override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: CarBean?) {
holder.run {
setGone(R.id.llTop,!isCap)
setText(R.id.tvCarNum, item?.vehicleNum)
setText(R.id.tvCarType, """${item?.vehicleType}""")
setText(R.id.tvCarLen, """车长:${item?.carLong}""")
setText(R.id.tvCarWei, """核定载重:${item?.approvedLoad}""")
setSelected(R.id.llContent, item?.isSelect!!)
setText(R.id.tvDriverName, item?.idcardName)
setText(R.id.tvPhone, item?.contactPhone)
ImageLoader.getInstance()
.loadRoundImage(context, item?.avatar, 6, getView<ImageView>(R.id.ivDriverHead))
}
}

View File

@ -16,7 +16,7 @@ import com.dahe.mylibrary.utils.ImageLoader
* @Date 2024/1/23 16:27
* @Description TODO
*/
class WaybillListAdapter :
class WaybillListAdapter(var isCap : Boolean) :
BaseQuickAdapter<OrderBean, QuickViewHolder>() {
override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: OrderBean?) {
item?.let {
@ -37,7 +37,7 @@ class WaybillListAdapter :
setGone(R.id.btnOk,it.driverEvaluationStatus=="1")
}
setGone(R.id.btnOk,isCap)
ImageLoader.getInstance()
.loadRoundImage(context, it.avatar, 6, getView<ImageView>(R.id.ivHead))

View File

@ -11,6 +11,7 @@ data class CarBean(
val tractionWeight: String="",
val carHeight: String="",
var carId: String="",
var driverId: String="",
val carLong: String="",
val carUrl: String="",
val carWidth: String="",
@ -71,3 +72,9 @@ data class CapCarListBean(
val idcardSex: String
)
data class UpDriverCar(
val orderId: String,
val driverId: String,
val carId: String,
)

View File

@ -6,15 +6,11 @@ import android.widget.Button
import android.widget.LinearLayout
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.chad.library.adapter4.BaseQuickAdapter
import com.dahe.gldriver.R
import com.dahe.gldriver.adapter.SelectCarAdapter
import com.dahe.gldriver.bean.CarBean
import com.dahe.mylibrary.adapter.GridImageAdapter
import com.dahe.mylibrary.callback.OnPicResultListener
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
import com.dahe.mylibrary.utils.ConvertUtils
import com.luck.picture.lib.entity.LocalMedia
import com.lxj.xpopup.core.BottomPopupView
@ -27,6 +23,7 @@ import com.lxj.xpopup.core.BottomPopupView
class PopBottomCar(
context: Context,
cars: MutableList<CarBean>,
private var isCap: Boolean,
onCarSelectListener: OnCarSelectListener
) : BottomPopupView(context) {
@ -47,7 +44,7 @@ class PopBottomCar(
var recycler = findViewById<RecyclerView>(R.id.recycler)
var btnOk = findViewById<Button>(R.id.btnOk)
initRecycle(recycler)
btnOk.text = if (isCap) "分配车辆" else "接单"
btnOk.setOnClickListener {
if (currCar == null) {
dismiss()
@ -73,7 +70,8 @@ class PopBottomCar(
Color.TRANSPARENT
)
)
adapter = SelectCarAdapter()
adapter = SelectCarAdapter(isCap)
(adapter as SelectCarAdapter).submitList(cars)
(adapter as SelectCarAdapter)
}.run {

View File

@ -21,6 +21,7 @@ import com.dahe.gldriver.bean.QuestionBean
import com.dahe.gldriver.bean.RateBean
import com.dahe.gldriver.bean.UpBankInfoBean
import com.dahe.gldriver.bean.UpCaptain
import com.dahe.gldriver.bean.UpDriverCar
import com.dahe.gldriver.bean.UpDriverInfoBean
import com.dahe.gldriver.bean.UpDrivingInfoBean
import com.dahe.gldriver.bean.UpLocation
@ -280,6 +281,14 @@ interface Api {
@Query("carId") carId: String
): Observable<CommonResponseBean<Any>>
/**
* 车队长对货源进行重新派单
* */
@POST(BASE_URL + "driver/captain/redeliveryOrder")
fun redeliveryOrder(
@Body upDriverCar: UpDriverCar
): Observable<CommonResponseBean<Any>>
/**
* 司机装卸货
* */

View File

@ -22,6 +22,7 @@ import com.dahe.gldriver.utils.GDLocationUtils
import com.dahe.gldriver.utils.LocationUtils
import com.dahe.gldriver.utils.NaviUtils
import com.dahe.gldriver.utils.OrderUtils
import com.dahe.gldriver.utils.SPUtils
import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
@ -63,7 +64,7 @@ class WaybillAppraiseActivity : BaseActivity<ActivityWaybillUnloadBinding>() {
SeeDocActivity::class.java,
Bundle().apply { putString(AppConfig.ORDER_ID, orderId) })
}
binding.btnRight.visibility = if (SPUtils.instance.getUserInfo(mContext).isCarCaptain=="1") View.GONE else View.VISIBLE
initRecy()
getLocation()
binding.run {
@ -237,9 +238,9 @@ class WaybillAppraiseActivity : BaseActivity<ActivityWaybillUnloadBinding>() {
adapter = WaybillNodeAdapter()
adapter as WaybillNodeAdapter
}.apply {
addOnItemChildClickListener(R.id.btnOk) { adapter, view, position ->
ActivityUtils.startActivity(mContext, WaybillDetailActivity::class.java)
}
// addOnItemChildClickListener(R.id.btnOk) { adapter, view, position ->
// ActivityUtils.startActivity(mContext, WaybillDetailActivity::class.java)
// }
}
}

View File

@ -4,6 +4,7 @@ import android.Manifest
import android.app.usage.UsageEvents.Event
import android.graphics.Color
import android.os.Bundle
import android.view.View
import android.widget.LinearLayout
import android.widget.Toast
import androidx.recyclerview.widget.LinearLayoutManager
@ -20,6 +21,7 @@ import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.utils.GDLocationUtils
import com.dahe.gldriver.utils.LocationUtils
import com.dahe.gldriver.utils.OrderUtils
import com.dahe.gldriver.utils.SPUtils
import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
@ -42,17 +44,24 @@ class WaybillDetailActivity : BaseActivity<ActivityWaybillDetailBinding>() {
var orderId: String = ""
lateinit var gdLatLng: LatLng
lateinit var loadPos: LatLng
var isCap: Boolean = false
override fun initView(savedInstanceState: Bundle?) {
isCap = SPUtils.instance.getUserInfo(mContext).isCarCaptain == "1"
orderId = intent.extras?.getString(AppConfig.ORDER_ID, "").toString()
initRecy()
getLocation()
binding.btnReceiving.visibility = if (isCap) View.GONE else View.VISIBLE
binding.btnCall.setOnClickListener {
BaseUtils.callPhone(this@WaybillDetailActivity, "15838201105")
}
binding.btnReceiving.setOnClickListener {
OrderUtils.getInstance().goReceWaybill(mContext, orderId){
ActivityUtils.startActivity(mContext,WaybillSuccActivity::class.java,intent.extras)
OrderUtils.getInstance().goReceWaybill(mContext, orderId) {
ActivityUtils.startActivity(
mContext,
WaybillSuccActivity::class.java,
intent.extras
)
}
}
@ -75,12 +84,14 @@ class WaybillDetailActivity : BaseActivity<ActivityWaybillDetailBinding>() {
}
var goods =
t.data.goodsList.map { """${it.goodName},${it.goodItemGrossWeight}吨,${if (it.goodCube.isNullOrEmpty()) "" else it.goodCube + "方"}""" }
.reduce { acc, s -> """${acc}
|${s}""".trimMargin() }
.reduce { acc, s ->
"""${acc}
|${s}""".trimMargin()
}
binding.run {
tvTime.text = t.data.receiverDeadline
tvCom.text = t.data.receiverBusinessName
tvUnloadDis.text = t.data.distance+"km"
tvUnloadDis.text = t.data.distance + "km"
tvCarType.text = """${t.data.vehicleLength} ${t.data.vehicleType}"""
if (!t.data.requirement.isNullOrEmpty()) tvRemark.text = t.data.requirement
if (!distance.isNullOrEmpty()) tvLoadDis.text = distance
@ -163,7 +174,7 @@ class WaybillDetailActivity : BaseActivity<ActivityWaybillDetailBinding>() {
}
private fun receWaybill(){
private fun receWaybill() {
}
}

View File

@ -4,6 +4,7 @@ import android.Manifest
import android.annotation.SuppressLint
import android.graphics.Color
import android.os.Bundle
import android.view.View
import android.widget.LinearLayout
import android.widget.Toast
import androidx.recyclerview.widget.LinearLayoutManager
@ -27,6 +28,7 @@ import com.dahe.gldriver.utils.GDLocationUtils
import com.dahe.gldriver.utils.LocationUtils
import com.dahe.gldriver.utils.NaviUtils
import com.dahe.gldriver.utils.OrderUtils
import com.dahe.gldriver.utils.SPUtils
import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
@ -65,7 +67,7 @@ class WaybillLoadActivity : BaseActivity<ActivityWaybillLoadBinding>() {
Bundle().apply { putString(AppConfig.ORDER_ID, orderId) })
}
binding.btnRight.visibility = if (SPUtils.instance.getUserInfo(mContext).isCarCaptain=="1") View.GONE else View.VISIBLE
initRecy()
getLocation()
@ -261,9 +263,9 @@ class WaybillLoadActivity : BaseActivity<ActivityWaybillLoadBinding>() {
adapter = WaybillNodeAdapter()
adapter as WaybillNodeAdapter
}.apply {
addOnItemChildClickListener(R.id.btnOk) { adapter, view, position ->
ActivityUtils.startActivity(mContext, WaybillDetailActivity::class.java)
}
// addOnItemChildClickListener(R.id.btnOk) { adapter, view, position ->
// ActivityUtils.startActivity(mContext, WaybillDetailActivity::class.java)
// }
}
}

View File

@ -4,6 +4,7 @@ import android.Manifest
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import android.view.View
import android.widget.LinearLayout
import android.widget.Toast
import androidx.recyclerview.widget.LinearLayoutManager
@ -22,6 +23,7 @@ import com.dahe.gldriver.utils.GDLocationUtils
import com.dahe.gldriver.utils.LocationUtils
import com.dahe.gldriver.utils.NaviUtils
import com.dahe.gldriver.utils.OrderUtils
import com.dahe.gldriver.utils.SPUtils
import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
@ -59,7 +61,7 @@ class WaybillUnlLoadActivity : BaseActivity<ActivityWaybillUnloadBinding>() {
SeeDocActivity::class.java,
Bundle().apply { putString(AppConfig.ORDER_ID, orderId) })
}
binding.btnRight.visibility = if (SPUtils.instance.getUserInfo(mContext).isCarCaptain=="1") View.GONE else View.VISIBLE
initRecy()
getLocation()
binding.run {
@ -239,9 +241,9 @@ class WaybillUnlLoadActivity : BaseActivity<ActivityWaybillUnloadBinding>() {
adapter = WaybillNodeAdapter()
adapter as WaybillNodeAdapter
}.apply {
addOnItemChildClickListener(R.id.btnOk) { adapter, view, position ->
ActivityUtils.startActivity(mContext, WaybillDetailActivity::class.java)
}
// addOnItemChildClickListener(R.id.btnOk) { adapter, view, position ->
// ActivityUtils.startActivity(mContext, WaybillDetailActivity::class.java)
// }
}
}

View File

@ -10,7 +10,6 @@ import com.dahe.gldriver.R
import com.dahe.gldriver.adapter.WaybillListAdapter
import com.dahe.gldriver.base.AppConfig
import com.dahe.gldriver.callback.OnSearchListener
import com.dahe.gldriver.databinding.FragmentWaybillBinding
import com.dahe.gldriver.databinding.FragmentWaybillListBinding
import com.dahe.gldriver.net.BaseObserver
import com.dahe.gldriver.net.DataManager
@ -20,9 +19,8 @@ import com.dahe.gldriver.ui.waybill.activity.WaybillLoadActivity
import com.dahe.gldriver.ui.waybill.activity.WaybillRateActivity
import com.dahe.gldriver.ui.waybill.activity.WaybillUnlLoadActivity
import com.dahe.gldriver.ui.waybill.activity.WaybillUpPicActivity
import com.dahe.gldriver.utils.OrderUtils
import com.dahe.gldriver.utils.SPUtils
import com.dahe.glex.bean.OrderBean
import com.dahe.glex.bean.WayBillBean
import com.dahe.mylibrary.base.BaseFragment
import com.dahe.mylibrary.callback.RefreshCallBack
import com.dahe.mylibrary.net.CommonResponseBean
@ -60,12 +58,11 @@ class AllWaybillFragment : BaseFragment<FragmentWaybillListBinding>(), RefreshCa
)
)
adapter = WaybillListAdapter()
// 打开空布局功能
(adapter as WaybillListAdapter).isStateViewEnable = true
adapter = WaybillListAdapter(SPUtils.instance.getUserInfo(mContext).isCarCaptain=="1")
adapter as WaybillListAdapter
}.apply {
// 打开空布局功能
isStateViewEnable = true
setOnItemClickListener { adapter, view, position ->
val orderBean = items[position]
when (orderBean.orderStatus) {

View File

@ -8,16 +8,14 @@ import androidx.recyclerview.widget.RecyclerView
import com.dahe.gldriver.R
import com.dahe.gldriver.adapter.WaybillListAdapter
import com.dahe.gldriver.callback.OnSearchListener
import com.dahe.gldriver.databinding.FragmentWaybillBinding
import com.dahe.gldriver.databinding.FragmentWaybillListBinding
import com.dahe.gldriver.event.RefreshEvent
import com.dahe.gldriver.net.BaseObserver
import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.ui.waybill.activity.WaybillRateActivity
import com.dahe.gldriver.utils.OrderUtils
import com.dahe.gldriver.utils.SPUtils
import com.dahe.glex.bean.OrderBean
import com.dahe.glex.bean.WayBillBean
import com.dahe.mylibrary.base.BaseFragment
import com.dahe.mylibrary.callback.RefreshCallBack
import com.dahe.mylibrary.net.CommonResponseBean
@ -58,11 +56,11 @@ class CancelWaybillFragment : BaseFragment<FragmentWaybillListBinding>(), Refres
Color.TRANSPARENT
)
)
adapter = WaybillListAdapter()
// 打开空布局功能
(adapter as WaybillListAdapter).isStateViewEnable = true
adapter = WaybillListAdapter(SPUtils.instance.getUserInfo(mContext).isCarCaptain=="1")
adapter as WaybillListAdapter
}.apply {
// 打开空布局功能
isStateViewEnable = true
addOnItemChildClickListener(R.id.btnOk){_,_,position->
ActivityUtils.startActivity(mContext,WaybillRateActivity::class.java)
}

View File

@ -10,19 +10,15 @@ import com.dahe.gldriver.R
import com.dahe.gldriver.adapter.WaybillListAdapter
import com.dahe.gldriver.base.AppConfig
import com.dahe.gldriver.callback.OnSearchListener
import com.dahe.gldriver.databinding.FragmentWaybillBinding
import com.dahe.gldriver.databinding.FragmentWaybillListBinding
import com.dahe.gldriver.event.RefreshEvent
import com.dahe.gldriver.net.BaseObserver
import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.ui.waybill.activity.SeeDocActivity
import com.dahe.gldriver.ui.waybill.activity.WaybillAppraiseActivity
import com.dahe.gldriver.ui.waybill.activity.WaybillRateActivity
import com.dahe.gldriver.ui.waybill.activity.WaybillUnlLoadActivity
import com.dahe.gldriver.utils.OrderUtils
import com.dahe.gldriver.utils.SPUtils
import com.dahe.glex.bean.OrderBean
import com.dahe.glex.bean.WayBillBean
import com.dahe.mylibrary.base.BaseFragment
import com.dahe.mylibrary.callback.RefreshCallBack
import com.dahe.mylibrary.net.CommonResponseBean
@ -63,11 +59,11 @@ class WaitAppraiseFragment : BaseFragment<FragmentWaybillListBinding>(), Refresh
Color.TRANSPARENT
)
)
adapter = WaybillListAdapter()
// 打开空布局功能
(adapter as WaybillListAdapter).isStateViewEnable = true
adapter = WaybillListAdapter(SPUtils.instance.getUserInfo(mContext).isCarCaptain=="1")
adapter as WaybillListAdapter
}.apply {
// 打开空布局功能
isStateViewEnable = true
setOnItemClickListener { _, _, position ->
val orderBean = items[position]
ActivityUtils.startActivity(mContext,

View File

@ -21,6 +21,7 @@ import com.dahe.gldriver.ui.mine.activity.CarsManActivity
import com.dahe.gldriver.ui.waybill.activity.WaybillLoadActivity
import com.dahe.gldriver.ui.waybill.activity.WaybillUpPicActivity
import com.dahe.gldriver.utils.OrderUtils
import com.dahe.gldriver.utils.SPUtils
import com.dahe.glex.bean.OrderBean
import com.dahe.glex.bean.WayBillBean
import com.dahe.mylibrary.base.BaseFragment
@ -63,10 +64,11 @@ class WaitLoadFragment : BaseFragment<FragmentWaybillListBinding>(), RefreshCall
Color.TRANSPARENT
)
)
adapter = WaybillListAdapter()// 打开空布局功能
(adapter as WaybillListAdapter).isStateViewEnable = true
adapter = WaybillListAdapter(SPUtils.instance.getUserInfo(mContext).isCarCaptain=="1")
adapter as WaybillListAdapter
}.apply {
// 打开空布局功能
isStateViewEnable = true
setOnItemClickListener() { adapter, view, position ->
//装货页面
ActivityUtils.startActivity(context,

View File

@ -10,18 +10,15 @@ import com.dahe.gldriver.R
import com.dahe.gldriver.adapter.WaybillListAdapter
import com.dahe.gldriver.base.AppConfig
import com.dahe.gldriver.callback.OnSearchListener
import com.dahe.gldriver.databinding.FragmentWaybillBinding
import com.dahe.gldriver.databinding.FragmentWaybillListBinding
import com.dahe.gldriver.event.RefreshEvent
import com.dahe.gldriver.net.BaseObserver
import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.ui.waybill.activity.WaybillLoadActivity
import com.dahe.gldriver.ui.waybill.activity.WaybillUnlLoadActivity
import com.dahe.gldriver.ui.waybill.activity.WaybillUpPicActivity
import com.dahe.gldriver.utils.OrderUtils
import com.dahe.gldriver.utils.SPUtils
import com.dahe.glex.bean.OrderBean
import com.dahe.glex.bean.WayBillBean
import com.dahe.mylibrary.base.BaseFragment
import com.dahe.mylibrary.callback.RefreshCallBack
import com.dahe.mylibrary.net.CommonResponseBean
@ -62,11 +59,11 @@ class WaitUnLoadFragment : BaseFragment<FragmentWaybillListBinding>(), RefreshCa
Color.TRANSPARENT
)
)
adapter = WaybillListAdapter()
// 打开空布局功能
(adapter as WaybillListAdapter).isStateViewEnable = true
adapter = WaybillListAdapter(SPUtils.instance.getUserInfo(mContext).isCarCaptain=="1")
adapter as WaybillListAdapter
}.apply {
// 打开空布局功能
isStateViewEnable = true
setOnItemClickListener() { adapter, view, position ->
//装货页面
ActivityUtils.startActivity(context,

View File

@ -35,11 +35,11 @@ class CommonPopUtils private constructor() {
/**
* 选择车辆
* */
fun showCarList(context: Context, cars: MutableList<CarBean>, listener: OnCarSelectListener) {
fun showCarList(context: Context, cars: MutableList<CarBean>,isCap:Boolean = false, listener: OnCarSelectListener) {
XPopup.Builder(context)
.isViewMode(true)
// .isDestroyOnDismiss(true) //对于只使用一次的弹窗,推荐设置这个
.asCustom(PopBottomCar(context, cars, listener))
.asCustom(PopBottomCar(context, cars,isCap, listener))
.show()

View File

@ -4,11 +4,13 @@ import android.content.Context
import android.content.Intent
import android.os.Build
import android.os.Bundle
import com.dahe.gldriver.R
import com.dahe.gldriver.base.App
import com.dahe.gldriver.base.AppConfig
import com.dahe.gldriver.base.AppConfig.NEED_UP_ORDER
import com.dahe.gldriver.bean.CarBean
import com.dahe.gldriver.bean.OrderDetailBean
import com.dahe.gldriver.bean.UpDriverCar
import com.dahe.gldriver.bean.UpLocation
import com.dahe.gldriver.callback.OnResultListener
import com.dahe.gldriver.net.BaseObserver
@ -96,30 +98,67 @@ class OrderUtils private constructor() {
* 接单包含选择车辆->装货
* */
fun goReceWaybill(context: Context, orderId: String, listener: OnResultListener) {
//选择车辆
DataManager.getInstance().carList()
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(
BaseObserver(context, object : RxHttpCallBack<MutableList<CarBean>>() {
val userInfo = SPUtils.instance.getUserInfo(context)
if (userInfo.isCarCaptain == "1") {
DataManager.getInstance()
.selectCarsList(userInfo.captainId)
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(context, object : RxHttpCallBack<MutableList<CarBean>>() {
override fun onSuccess(t: CommonResponseBean<MutableList<CarBean>>) {
super.onSuccess(t)
if (t.data != null) {
if (t.data == null || t.data.size == 0) {
ToastUtils.showToast(context, "暂未查询到车辆")
return
}
if (t.data.size > 0) {//多辆车需选择车辆,单个车辆直接接单
CommonPopUtils.getInstance()
.showCarList(context, t.data) {
//接单接口
receivingOrders(context, orderId, it, listener)
}
} else {
//单量车,直接默认当前车辆 ,接单接口
receivingOrders(context, orderId, t.data[0], listener)
}
CommonPopUtils.getInstance()
.showCarList(context, t.data, true) {
//分配车辆redeliveryOrder
DataManager.getInstance()
.redeliveryOrder(UpDriverCar(orderId,it.driverId,it.carId))
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
BaseObserver(
context,
object : RxHttpCallBack<Any>() {
override fun onSuccess(t: CommonResponseBean<Any>) {
super.onSuccess(t)
listener.onResult(true)
ToastUtils.showToast(context, "分配车辆成功")
}
})
)
}
}
})
)
}))
} else {
//选择车辆
DataManager.getInstance().carList()
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(
BaseObserver(context, object : RxHttpCallBack<MutableList<CarBean>>() {
override fun onSuccess(t: CommonResponseBean<MutableList<CarBean>>) {
super.onSuccess(t)
if (t.data == null || t.data.size == 0) {
ToastUtils.showToast(context, "暂未查询到车辆")
return
}
if (t.data.size > 1) {//多辆车需选择车辆,单个车辆直接接单
CommonPopUtils.getInstance()
.showCarList(context, t.data, false) {
//接单接口
receivingOrders(context, orderId, it, listener)
}
} else {
//单量车,直接默认当前车辆 ,接单接口
receivingOrders(context, orderId, t.data[0], listener)
}
}
})
)
}
}
/**

View File

@ -174,13 +174,13 @@
android:id="@+id/tvLoadDis"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
tools:text="122.5km"
android:maxLength="10"
android:ellipsize="end"
android:gravity="center"
android:maxLength="10"
android:textColor="@color/black"
android:textSize="@dimen/sp_16"
android:textStyle="bold" />
android:textStyle="bold"
tools:text="122.5km" />
<TextView
android:id="@+id/tvDisTitle"
@ -384,12 +384,12 @@
<TextView
android:id="@+id/tvGoods"
android:gravity="right"
android:layout_toRightOf="@+id/tvGoodsTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignTop="@+id/tvGoodsTitle"
android:layout_alignParentRight="true"
android:layout_toRightOf="@+id/tvGoodsTitle"
android:gravity="right"
android:paddingRight="@dimen/dp_16"
android:text="钢铁1吨螺纹钢"
android:textColor="@color/main_red"
@ -523,10 +523,10 @@
android:id="@+id/tvFreightUnit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="元"
android:layout_marginBottom="@dimen/dp_3"
android:layout_alignBottom="@+id/tvFreight"
android:layout_marginBottom="@dimen/dp_3"
android:layout_toRightOf="@+id/tvFreight"
android:text="元"
android:textColor="@color/main_red"
android:textSize="@dimen/sp_12"
android:textStyle="bold" />
@ -540,28 +540,35 @@
android:textColor="@color/color_9"
android:textSize="@dimen/sp_12" />
<Button
android:id="@+id/btnCall"
android:layout_width="@dimen/dp_100"
android:layout_height="@dimen/dp_36"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/btnReceiving"
android:background="@drawable/shape_btn_empty_bg"
android:text="联系货主"
android:textColor="@color/main_red"
android:textSize="@dimen/sp_15" />
<Button
android:id="@+id/btnReceiving"
android:layout_width="@dimen/dp_100"
android:layout_height="@dimen/dp_36"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_10"
android:background="@drawable/bg_btn"
android:text="立即接单"
android:textColor="@color/white"
android:textSize="@dimen/sp_15" />
android:orientation="horizontal">
<Button
android:id="@+id/btnCall"
android:layout_width="@dimen/dp_100"
android:layout_height="@dimen/dp_36"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/btnReceiving"
android:background="@drawable/shape_btn_empty_bg"
android:text="联系货主"
android:textColor="@color/main_red"
android:textSize="@dimen/sp_15" />
<Button
android:id="@+id/btnReceiving"
android:layout_width="@dimen/dp_100"
android:layout_height="@dimen/dp_36"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_10"
android:background="@drawable/bg_btn"
android:text="立即接单"
android:textColor="@color/white"
android:textSize="@dimen/sp_15" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>

View File

@ -11,8 +11,7 @@
android:id="@+id/rlTop"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_90"
android:background="@drawable/waybill_top_bg"
>
android:background="@drawable/waybill_top_bg">
<include layout="@layout/common_toolbar"></include>
</RelativeLayout>
@ -39,6 +38,7 @@
android:layout_width="0dp"
android:layout_height="@dimen/dp_10"
android:background="@android:color/transparent" />
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -79,15 +79,15 @@
android:background="@drawable/head_defaut" />
<TextView
android:maxWidth="@dimen/dp_160"
android:id="@+id/tvComName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_marginTop="@dimen/dp_40"
android:layout_toRightOf="@+id/ivHead"
android:maxWidth="@dimen/dp_160"
android:maxLines="1"
android:singleLine="true"
android:layout_toRightOf="@+id/ivHead"
android:text="安徽东阳矿业科技有限公司安徽东阳矿业科技有限公司"
android:textColor="@color/black"
android:textSize="@dimen/sp_15" />
@ -137,31 +137,31 @@
<TextView
android:layout_weight="1"
android:id="@+id/tvCarNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="豫A87SF9"
android:layout_weight="1"
android:gravity="left"
android:text="豫A87SF9"
android:textColor="@color/black"
android:textSize="@dimen/sp_17"
android:textStyle="bold" />
<TextView
android:layout_weight="1"
android:id="@+id/tvCarLen"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="16米/30吨"
android:textColor="@color/color_01"
android:textSize="@dimen/sp_14" />
<TextView
android:layout_weight="1"
android:id="@+id/tvCarType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:text="重型栏板半挂车"
android:textColor="@color/color_01"
@ -212,68 +212,68 @@
android:layout_marginTop="@dimen/dp_14"
android:background="@color/color_e5" />
<!-- <ImageView-->
<!-- android:id="@+id/ivLoad"-->
<!-- android:layout_width="@dimen/dp_18"-->
<!-- android:layout_height="@dimen/dp_18"-->
<!-- android:layout_below="@+id/tvTime"-->
<!-- android:layout_marginTop="@dimen/dp_33"-->
<!-- android:background="@drawable/icon_load" />-->
<!-- <ImageView-->
<!-- android:id="@+id/ivLoad"-->
<!-- android:layout_width="@dimen/dp_18"-->
<!-- android:layout_height="@dimen/dp_18"-->
<!-- android:layout_below="@+id/tvTime"-->
<!-- android:layout_marginTop="@dimen/dp_33"-->
<!-- android:background="@drawable/icon_load" />-->
<!-- <TextView-->
<!-- android:id="@+id/tvLoad"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_below="@+id/tvTime"-->
<!-- android:layout_marginLeft="@dimen/dp_15"-->
<!-- android:layout_marginTop="@dimen/dp_29"-->
<!-- android:layout_toRightOf="@+id/ivLoad"-->
<!-- android:text="河南省郑州市金水区农业路经三路交叉 口银丰商务A座"-->
<!-- android:textColor="@color/black"-->
<!-- android:textSize="@dimen/sp_16" />-->
<!-- <TextView-->
<!-- android:id="@+id/tvLoad"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_below="@+id/tvTime"-->
<!-- android:layout_marginLeft="@dimen/dp_15"-->
<!-- android:layout_marginTop="@dimen/dp_29"-->
<!-- android:layout_toRightOf="@+id/ivLoad"-->
<!-- android:text="河南省郑州市金水区农业路经三路交叉 口银丰商务A座"-->
<!-- android:textColor="@color/black"-->
<!-- android:textSize="@dimen/sp_16" />-->
<!-- <TextView-->
<!-- android:id="@+id/tvPhone"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_below="@+id/tvLoad"-->
<!-- android:layout_alignStart="@+id/tvLoad"-->
<!-- android:layout_marginTop="@dimen/dp_12"-->
<!-- android:text="刘静 15854215412"-->
<!-- android:textColor="@color/color_9"-->
<!-- android:textSize="@dimen/sp_16" />-->
<!-- <TextView-->
<!-- android:id="@+id/tvPhone"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_below="@+id/tvLoad"-->
<!-- android:layout_alignStart="@+id/tvLoad"-->
<!-- android:layout_marginTop="@dimen/dp_12"-->
<!-- android:text="刘静 15854215412"-->
<!-- android:textColor="@color/color_9"-->
<!-- android:textSize="@dimen/sp_16" />-->
<!-- <ImageView-->
<!-- android:id="@+id/ivUnload"-->
<!-- android:layout_width="@dimen/dp_18"-->
<!-- android:layout_height="@dimen/dp_18"-->
<!-- android:layout_below="@+id/ivLoad"-->
<!-- android:layout_alignTop="@+id/tvUnload"-->
<!-- <ImageView-->
<!-- android:id="@+id/ivUnload"-->
<!-- android:layout_width="@dimen/dp_18"-->
<!-- android:layout_height="@dimen/dp_18"-->
<!-- android:layout_below="@+id/ivLoad"-->
<!-- android:layout_alignTop="@+id/tvUnload"-->
<!-- android:background="@drawable/icon_unload" />-->
<!-- android:background="@drawable/icon_unload" />-->
<!-- <TextView-->
<!-- android:id="@+id/tvUnload"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_below="@+id/tvPhone"-->
<!-- android:layout_marginLeft="@dimen/dp_15"-->
<!-- android:layout_marginTop="@dimen/dp_29"-->
<!-- android:layout_toRightOf="@id/ivUnload"-->
<!-- android:text="河南省郑州市登封市少室路1553西南方 向170米登封第十加油站-便利店"-->
<!-- android:textColor="@color/black"-->
<!-- android:textSize="@dimen/sp_16" />-->
<!-- <TextView-->
<!-- android:id="@+id/tvUnload"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_below="@+id/tvPhone"-->
<!-- android:layout_marginLeft="@dimen/dp_15"-->
<!-- android:layout_marginTop="@dimen/dp_29"-->
<!-- android:layout_toRightOf="@id/ivUnload"-->
<!-- android:text="河南省郑州市登封市少室路1553西南方 向170米登封第十加油站-便利店"-->
<!-- android:textColor="@color/black"-->
<!-- android:textSize="@dimen/sp_16" />-->
<!-- <TextView-->
<!-- android:id="@+id/tvUnloadPhone"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_below="@+id/tvUnload"-->
<!-- android:layout_alignStart="@+id/tvUnload"-->
<!-- android:layout_marginTop="@dimen/dp_12"-->
<!-- android:text="王文建 15854215412"-->
<!-- android:textColor="@color/color_9"-->
<!-- android:textSize="@dimen/sp_16" />-->
<!-- <TextView-->
<!-- android:id="@+id/tvUnloadPhone"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_below="@+id/tvUnload"-->
<!-- android:layout_alignStart="@+id/tvUnload"-->
<!-- android:layout_marginTop="@dimen/dp_12"-->
<!-- android:text="王文建 15854215412"-->
<!-- android:textColor="@color/color_9"-->
<!-- android:textSize="@dimen/sp_16" />-->
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler"
@ -590,28 +590,35 @@
android:textColor="@color/color_9"
android:textSize="@dimen/sp_12" />
<Button
android:id="@+id/btnLeft"
android:layout_width="@dimen/dp_110"
android:layout_height="@dimen/dp_36"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/btnRight"
android:background="@drawable/shape_btn_empty_bg"
android:text="联系装货人"
android:textColor="@color/main_red"
android:textSize="@dimen/sp_15" />
<Button
android:id="@+id/btnRight"
android:layout_width="@dimen/dp_110"
android:layout_height="@dimen/dp_36"
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_10"
android:background="@drawable/bg_btn"
android:text="立即装货"
android:textColor="@color/white"
android:textSize="@dimen/sp_15" />
android:orientation="horizontal">
<Button
android:id="@+id/btnLeft"
android:layout_width="@dimen/dp_110"
android:layout_height="@dimen/dp_36"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/btnRight"
android:background="@drawable/shape_btn_empty_bg"
android:text="联系装货人"
android:textColor="@color/main_red"
android:textSize="@dimen/sp_15" />
<Button
android:id="@+id/btnRight"
android:layout_width="@dimen/dp_110"
android:layout_height="@dimen/dp_36"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_10"
android:background="@drawable/bg_btn"
android:text="立即装货"
android:textColor="@color/white"
android:textSize="@dimen/sp_15" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>

View File

@ -1,14 +1,60 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/llContent"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/select_car_bg"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_15"
android:paddingTop="@dimen/dp_20"
android:id="@+id/llContent"
android:paddingTop="@dimen/dp_10"
android:paddingRight="@dimen/dp_15"
android:paddingBottom="@dimen/dp_20">
android:paddingBottom="@dimen/dp_10">
<LinearLayout
android:visibility="gone"
android:id="@+id/llTop"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="@dimen/dp_6">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<ImageView
android:id="@+id/ivDriverHead"
android:layout_width="@dimen/dp_21"
android:layout_height="@dimen/dp_21"
android:background="@drawable/head_defaut" />
<TextView
android:id="@+id/tvDriverName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_8"
android:text="王师傅"
android:textColor="@color/black"
android:textSize="@dimen/sp_14" />
<TextView
android:id="@+id/tvPhone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_16"
android:text="156****5410"
android:textColor="@color/black"
android:textSize="@dimen/sp_14" />
</LinearLayout>
<View
android:layout_width="match_parent"
android:layout_height="1dp"
android:layout_marginTop="@dimen/dp_10"
android:background="@color/color_c" />
</LinearLayout>
<TextView
android:id="@+id/tvCarNum"