运单跳转逻辑优化
This commit is contained in:
parent
df6d087704
commit
4af1f8e62b
@ -20,6 +20,7 @@ object AppConfig {
|
||||
const val WAYBILL_ID = "DA_HE_WAYBILL_ID"
|
||||
const val CHILDRE_ID = "DA_HE_CHILDRE_ID"
|
||||
const val RATE_TYPE = "DA_HE_RATE_TYPE"//0:收到的评价 1:发表的评价
|
||||
const val IS_RATEING = "DA_HE_IS_RATEING"//是否已评价
|
||||
const val CODE = "DA_HE_PHONE"
|
||||
const val USER_DETAIL = "DA_HE_USER_DETAIL"
|
||||
const val IS_ONLY_SHOW = "DA_HE_IS_ONLY_SHOW"
|
||||
|
@ -142,26 +142,28 @@ class SeeDocActivity : BaseActivity<ActivitySeeDocBinding>() {
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<MutableList<OrderChild>>() {
|
||||
override fun onSuccess(t: CommonResponseBean<MutableList<OrderChild>>) {
|
||||
super.onSuccess(t)
|
||||
val load = t.data.find { it.type == "1" }
|
||||
val unLoad = t.data.filter { it.type == "2" }.maxBy { it.displayOrder }
|
||||
if (t.data != null && t.data.size > 0) {
|
||||
val load = t.data.find { it.type == "1" }
|
||||
val unLoad = t.data.filter { it.type == "2" }.maxBy { it.displayOrder }
|
||||
|
||||
loadDatas.submitList(t.data.filter { it.type == "1" }
|
||||
.map { LocalMedia().apply { path = it.photoUrl } }.toMutableList())
|
||||
loadBackDatas.submitList(t.data.filter { it.type == "3" && it.receiptType == "4" }
|
||||
.map { LocalMedia().apply { path = it.photoUrl } }.toMutableList())
|
||||
unLoadDatas.submitList(t.data.filter { it.type == "2" }
|
||||
.map { LocalMedia().apply { path = it.photoUrl } }.toMutableList())
|
||||
unLoadBackDatas.submitList(t.data.filter { it.type == "3" && (it.receiptType == "5" || it.receiptType == "6") }
|
||||
.map { LocalMedia().apply { path = it.photoUrl } }.toMutableList())
|
||||
loadDatas.submitList(t.data.filter { it.type == "1" }
|
||||
.map { LocalMedia().apply { path = it.photoUrl } }.toMutableList())
|
||||
loadBackDatas.submitList(t.data.filter { it.type == "3" && it.receiptType == "4" }
|
||||
.map { LocalMedia().apply { path = it.photoUrl } }.toMutableList())
|
||||
unLoadDatas.submitList(t.data.filter { it.type == "2" }
|
||||
.map { LocalMedia().apply { path = it.photoUrl } }.toMutableList())
|
||||
unLoadBackDatas.submitList(t.data.filter { it.type == "3" && (it.receiptType == "5" || it.receiptType == "6") }
|
||||
.map { LocalMedia().apply { path = it.photoUrl } }.toMutableList())
|
||||
|
||||
// picList.addAll(t.data.filter { it.type == "1" }.map { it.photoUrl })
|
||||
// picList.addAll(t.data.filter { it.type == "3"&& it.receiptType=="4" }.map { it.photoUrl })
|
||||
// picList.addAll(t.data.filter { it.type == "2" }.map { it.photoUrl })
|
||||
// picList.addAll(t.data.filter { it.type == "3" }.map { it.photoUrl })
|
||||
|
||||
binding.run {
|
||||
tvLoca.text = load?.location
|
||||
tvUnLoca.text = unLoad?.location
|
||||
binding.run {
|
||||
tvLoca.text = load?.location
|
||||
tvUnLoca.text = unLoad?.location
|
||||
}
|
||||
}
|
||||
}
|
||||
}))
|
||||
|
@ -3,6 +3,7 @@ package com.dahe.gldriver.ui.waybill.activity
|
||||
import android.Manifest
|
||||
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
|
||||
@ -45,11 +46,16 @@ class WaybillAppraiseActivity : BaseActivity<ActivityWaybillUnloadBinding>() {
|
||||
|
||||
|
||||
var orderId: String = ""
|
||||
var isRating: Boolean = false
|
||||
var waybillId: String = ""
|
||||
lateinit var orderBean: OrderDetailBean
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
orderId = intent.extras?.getString(AppConfig.ORDER_ID, "").toString()
|
||||
// orderId = intent.extras?.getString(AppConfig.ORDER_ID, "").toString()
|
||||
intent.extras?.let {
|
||||
orderId = it.getString(AppConfig.ORDER_ID, "")
|
||||
isRating = it.getBoolean(AppConfig.IS_RATEING, false)
|
||||
}
|
||||
setStatusHeightParams(binding.rlTop)
|
||||
setTitleBar("运单详情", true, true, "查看单据") {
|
||||
ActivityUtils.startActivity(
|
||||
@ -85,6 +91,9 @@ class WaybillAppraiseActivity : BaseActivity<ActivityWaybillUnloadBinding>() {
|
||||
.getRoute(mContext, loadPos, unLoadPos, loadAddress, unLoadAddress)
|
||||
}
|
||||
|
||||
if (isRating){
|
||||
btnRight.visibility = View.GONE
|
||||
}
|
||||
|
||||
btnRight.setOnClickListener {
|
||||
//去评价
|
||||
|
@ -2,17 +2,24 @@ package com.dahe.gldriver.ui.waybill.fragment
|
||||
|
||||
import android.content.Context
|
||||
import android.graphics.Color
|
||||
import android.os.Bundle
|
||||
import android.widget.LinearLayout
|
||||
import androidx.recyclerview.widget.LinearLayoutManager
|
||||
import androidx.recyclerview.widget.RecyclerView
|
||||
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
|
||||
import com.dahe.gldriver.net.RxHttpCallBack
|
||||
import com.dahe.gldriver.ui.waybill.activity.WaybillAppraiseActivity
|
||||
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.glex.bean.OrderBean
|
||||
import com.dahe.glex.bean.WayBillBean
|
||||
@ -20,6 +27,7 @@ import com.dahe.mylibrary.base.BaseFragment
|
||||
import com.dahe.mylibrary.callback.RefreshCallBack
|
||||
import com.dahe.mylibrary.net.CommonResponseBean
|
||||
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
|
||||
import com.dahe.mylibrary.utils.ActivityUtils
|
||||
import com.dahe.mylibrary.utils.ConvertUtils
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||
@ -30,7 +38,8 @@ import io.reactivex.rxjava3.schedulers.Schedulers
|
||||
* @Date 2024/1/24 14:06
|
||||
* @Description TODO
|
||||
*/
|
||||
class AllWaybillFragment : BaseFragment<FragmentWaybillListBinding>(), RefreshCallBack, OnSearchListener {
|
||||
class AllWaybillFragment : BaseFragment<FragmentWaybillListBinding>(), RefreshCallBack,
|
||||
OnSearchListener {
|
||||
|
||||
lateinit var adapter: WaybillListAdapter
|
||||
|
||||
@ -55,6 +64,81 @@ class AllWaybillFragment : BaseFragment<FragmentWaybillListBinding>(), RefreshCa
|
||||
// 打开空布局功能
|
||||
(adapter as WaybillListAdapter).isStateViewEnable = true
|
||||
adapter as WaybillListAdapter
|
||||
}.apply {
|
||||
|
||||
setOnItemClickListener { adapter, view, position ->
|
||||
val orderBean = items[position]
|
||||
when (orderBean.orderStatus) {
|
||||
"102040" -> //装货页面
|
||||
ActivityUtils.startActivity(context,
|
||||
WaybillLoadActivity::class.java,
|
||||
Bundle().apply {
|
||||
putString(AppConfig.ORDER_ID, items[position].orderId)
|
||||
}
|
||||
)
|
||||
|
||||
"102050" -> ActivityUtils.startActivity(context,
|
||||
WaybillUnlLoadActivity::class.java,
|
||||
Bundle().apply {
|
||||
putString(AppConfig.ORDER_ID, items[position].orderId)
|
||||
}
|
||||
)
|
||||
|
||||
"102070", "102090" -> ActivityUtils.startActivity(mContext,
|
||||
WaybillAppraiseActivity::class.java,
|
||||
Bundle().apply {
|
||||
putString(AppConfig.ORDER_ID, orderBean.orderId)
|
||||
putBoolean(
|
||||
AppConfig.IS_RATEING,
|
||||
orderBean.driverEvaluationStatus == "1"
|
||||
)
|
||||
})
|
||||
|
||||
else -> ActivityUtils.startActivity(mContext,
|
||||
WaybillAppraiseActivity::class.java,
|
||||
Bundle().apply {
|
||||
putString(AppConfig.ORDER_ID, orderBean.orderId)
|
||||
putBoolean(
|
||||
AppConfig.IS_RATEING,
|
||||
orderBean.driverEvaluationStatus == "1"
|
||||
)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
addOnItemChildClickListener(R.id.btnOk) { _, _, position ->
|
||||
val orderBean = items[position]
|
||||
|
||||
when (orderBean.orderStatus) {
|
||||
"102040" ->
|
||||
ActivityUtils.startActivity(
|
||||
mContext,
|
||||
WaybillUpPicActivity::class.java,
|
||||
Bundle().apply {
|
||||
putInt(AppConfig.SUCCESS_TYPE, 1)
|
||||
putString(AppConfig.ORDER_ID, orderBean.orderId)
|
||||
putString(AppConfig.WAYBILL_ID, orderBean.waybillId)
|
||||
})
|
||||
|
||||
"102050" -> ActivityUtils.startActivity(
|
||||
mContext,
|
||||
WaybillUpPicActivity::class.java,
|
||||
Bundle().apply {
|
||||
putInt(AppConfig.SUCCESS_TYPE, 2)
|
||||
putString(AppConfig.ORDER_ID, orderBean.orderId)
|
||||
putString(AppConfig.WAYBILL_ID, orderBean.waybillId)
|
||||
})
|
||||
|
||||
"102070", "102090" -> ActivityUtils.startActivity(
|
||||
mContext,
|
||||
WaybillRateActivity::class.java,
|
||||
Bundle().apply {
|
||||
putString(AppConfig.ORDER_ID, orderBean.orderId)
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
initData()
|
||||
|
@ -68,16 +68,20 @@ class WaitAppraiseFragment : BaseFragment<FragmentWaybillListBinding>(), Refresh
|
||||
(adapter as WaybillListAdapter).isStateViewEnable = true
|
||||
adapter as WaybillListAdapter
|
||||
}.apply {
|
||||
setOnItemClickListener{_,_,position->
|
||||
setOnItemClickListener { _, _, position ->
|
||||
val orderBean = items[position]
|
||||
ActivityUtils.startActivity(mContext,
|
||||
WaybillAppraiseActivity::class.java,Bundle().apply { putString(AppConfig.ORDER_ID,orderBean.orderId) })
|
||||
WaybillAppraiseActivity::class.java,
|
||||
Bundle().apply { putString(AppConfig.ORDER_ID, orderBean.orderId) })
|
||||
}
|
||||
addOnItemChildClickListener(R.id.btnOk) { _, _, position ->
|
||||
val orderBean = items[position]
|
||||
ActivityUtils.startActivity(mContext,WaybillRateActivity::class.java, Bundle().apply {
|
||||
putString(AppConfig.ORDER_ID,orderBean.orderId)
|
||||
})
|
||||
ActivityUtils.startActivity(
|
||||
mContext,
|
||||
WaybillRateActivity::class.java,
|
||||
Bundle().apply {
|
||||
putString(AppConfig.ORDER_ID, orderBean.orderId)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -64,7 +64,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvLoca"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/tvLocation"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
@ -180,7 +180,7 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvUnLoca"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_below="@+id/tvUnLocation"
|
||||
android:layout_marginTop="@dimen/dp_16"
|
||||
|
@ -79,7 +79,7 @@
|
||||
android:background="@drawable/head_defaut" />
|
||||
|
||||
<TextView
|
||||
android:maxWidth="@dimen/dp_200"
|
||||
android:maxWidth="@dimen/dp_160"
|
||||
android:id="@+id/tvComName"
|
||||
android:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
@ -593,7 +593,7 @@
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnLeft"
|
||||
android:layout_width="@dimen/dp_120"
|
||||
android:layout_width="@dimen/dp_110"
|
||||
android:layout_height="@dimen/dp_36"
|
||||
android:layout_centerVertical="true"
|
||||
android:layout_toLeftOf="@+id/btnRight"
|
||||
@ -604,7 +604,7 @@
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnRight"
|
||||
android:layout_width="@dimen/dp_120"
|
||||
android:layout_width="@dimen/dp_110"
|
||||
android:layout_height="@dimen/dp_36"
|
||||
android:layout_alignParentRight="true"
|
||||
android:layout_centerVertical="true"
|
||||
|
@ -81,14 +81,14 @@
|
||||
|
||||
<TextView
|
||||
android:id="@+id/tvComName"
|
||||
android:maxWidth="@dimen/dp_200"
|
||||
android:maxLines="1"
|
||||
android:singleLine="true"
|
||||
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:text="安徽东阳矿业科技有限公司"
|
||||
android:textColor="@color/black"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
@ -501,11 +501,11 @@
|
||||
app:cardCornerRadius="@dimen/dp_8">
|
||||
|
||||
<RelativeLayout
|
||||
android:paddingBottom="@dimen/dp_16"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_gravity="center_horizontal"
|
||||
android:paddingTop="@dimen/dp_16">
|
||||
android:paddingTop="@dimen/dp_16"
|
||||
android:paddingBottom="@dimen/dp_16">
|
||||
|
||||
|
||||
<TextView
|
||||
@ -584,7 +584,6 @@
|
||||
android:textSize="@dimen/sp_15" />
|
||||
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
</androidx.cardview.widget.CardView>
|
||||
|
||||
@ -624,28 +623,33 @@
|
||||
android:textColor="@color/color_9"
|
||||
android:textSize="@dimen/sp_12" />
|
||||
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnLeft"
|
||||
android:layout_width="@dimen/dp_120"
|
||||
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_120"
|
||||
android:layout_height="@dimen/dp_36"
|
||||
<LinearLayout
|
||||
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:layout_width="wrap_content"
|
||||
android:layout_height="wrap_content"
|
||||
android:orientation="horizontal">
|
||||
|
||||
<Button
|
||||
android:id="@+id/btnLeft"
|
||||
android:layout_width="@dimen/dp_110"
|
||||
android:layout_height="@dimen/dp_36"
|
||||
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_marginLeft="@dimen/dp_10"
|
||||
android:background="@drawable/bg_btn"
|
||||
android:text="立即卸货"
|
||||
android:textColor="@color/white"
|
||||
android:textSize="@dimen/sp_15" />
|
||||
</LinearLayout>
|
||||
|
||||
|
||||
</RelativeLayout>
|
||||
</LinearLayout>
|
Loading…
Reference in New Issue
Block a user