运单详情,货源详情,我的页面页面迁移

This commit is contained in:
lijia 2024-11-15 08:45:21 +08:00
parent 125722c03d
commit 390692cd22
34 changed files with 1179 additions and 602 deletions

View File

@ -160,6 +160,13 @@
android:configChanges="keyboardHidden|orientation|locale"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateHidden" />
<activity
android:name=".ui.waybill.activity.SeeDocActivity"
android:configChanges="keyboardHidden|orientation|locale"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateHidden" />
<activity
android:name=".ui.waybill.activity.WaybillLDetailActivity"
android:configChanges="keyboardHidden|orientation|locale"
@ -172,6 +179,11 @@
android:configChanges="keyboardHidden|orientation|locale"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateHidden" />
<activity
android:name=".ui.mine.activity.KnowCarsActivity"
android:configChanges="keyboardHidden|orientation|locale"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateHidden" />
<activity
android:name=".ui.mine.activity.AuthPartyActivity"

View File

@ -4,7 +4,7 @@ import android.content.Context
import android.view.ViewGroup
import com.chad.library.adapter4.BaseQuickAdapter
import com.chad.library.adapter4.viewholder.QuickViewHolder
import com.dahe.glex.bean.WayBillBean
import com.dahe.glex.bean.WaybillBean
import com.dhsd.glowner.R
/**
@ -13,10 +13,10 @@ import com.dhsd.glowner.R
* @Date 2024/1/24 14:40
* @Description TODO
*/
class MessageAdapter: BaseQuickAdapter<WayBillBean, QuickViewHolder>() {
class MessageAdapter: BaseQuickAdapter<WaybillBean, QuickViewHolder>() {
override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: WayBillBean?) {
override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: WaybillBean?) {
}

View File

@ -7,10 +7,8 @@ import android.widget.TextView
import com.chad.library.adapter4.BaseQuickAdapter
import com.chad.library.adapter4.QuickAdapterHelper
import com.chad.library.adapter4.viewholder.QuickViewHolder
import com.dahe.glex.bean.WayBillBean
import com.dhsd.glowner.R
import com.dhsd.glowner.bean.DictBean
import com.dhsd.glowner.bean.PackTypeBean
/**
* @ClassName PackingTypeAdapter

View File

@ -7,10 +7,9 @@ import android.widget.TextView
import com.chad.library.adapter4.BaseQuickAdapter
import com.chad.library.adapter4.QuickAdapterHelper
import com.chad.library.adapter4.viewholder.QuickViewHolder
import com.dahe.glex.bean.WayBillBean
import com.dhsd.glowner.R
import com.dhsd.glowner.bean.DictBean
import com.dhsd.glowner.bean.PackTypeBean
/**
* @ClassName PackingTypeAdapter

View File

@ -3,9 +3,7 @@ package com.dhsd.glowner.adapter
import android.content.Context
import android.view.ViewGroup
import com.chad.library.adapter4.BaseQuickAdapter
import com.chad.library.adapter4.QuickAdapterHelper
import com.chad.library.adapter4.viewholder.QuickViewHolder
import com.dahe.glex.bean.WayBillBean
import com.dhsd.glowner.R
import com.dhsd.glowner.bean.AddressBean

View File

@ -5,7 +5,6 @@ import android.view.ViewGroup
import com.chad.library.adapter4.BaseQuickAdapter
import com.chad.library.adapter4.viewholder.QuickViewHolder
import com.dahe.glex.bean.OrderBean
import com.dahe.glex.bean.WayBillBean
import com.dhsd.glowner.R
import com.dhsd.glowner.utils.OrderUtils
@ -34,6 +33,8 @@ class WaybillAdapter :
}"""
)
setText(R.id.tvProduct,"")
setText(R.id.tvModel, """${if (item.orderType == "0") "一装一卸" else "一装多卸"}""")
setText(R.id.tvMoney, driverFreight)
setText(R.id.tvDate, loadingDeadline)

View File

@ -2,10 +2,13 @@ package com.dhsd.glowner.adapter
import android.content.Context
import android.view.ViewGroup
import android.widget.ImageView
import com.chad.library.adapter4.BaseQuickAdapter
import com.chad.library.adapter4.viewholder.QuickViewHolder
import com.dahe.glex.bean.WayBillBean
import com.dahe.glex.bean.WaybillBean
import com.dahe.mylibrary.utils.ImageLoader
import com.dhsd.glowner.R
import com.dhsd.glowner.utils.OrderUtils
/**
* @ClassName WaybillAdapter
@ -14,8 +17,53 @@ import com.dhsd.glowner.R
* @Description TODO
*/
class WaybillListAdapter() :
BaseQuickAdapter<WayBillBean, QuickViewHolder>() {
override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: WayBillBean?) {
BaseQuickAdapter<WaybillBean, QuickViewHolder>() {
override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: WaybillBean?) {
item?.let {
holder.run {
setText(R.id.tvWaybillId,it.orderNum)
setText(R.id.tvStatu, OrderUtils.getInstance().getOrderStatu(it.waybillStatus))
// setText(R.id.tvType, """${if (it.orderType == "0") "一装一卸" else "一装多卸"}""")
setText(R.id.tvTime, """${it.loadingDeadline}装货""")
// setText(R.id.tvDis, """${it.distance}km""")
setText(R.id.tvCarNum, it.vehicleNum)
// setText(R.id.tvRate, """交易${item.driverTransactionVolume} 好评率${item.driverPositiveReviewRate.toIntOrNull()
// ?.times(100)}%""")
// setText(R.id.tvGood, """${it.goodItemGrossWeight}吨/${it.goodName}""")
setText(R.id.tvMoney, it.driverFreight)
setText(R.id.tvComName, """${it.driverName} ${it.driverPhone}""")
ImageLoader.getInstance().loadRoundImage(context,it.avatar,6,getView<ImageView>(R.id.ivHead),R.drawable.head_defaut)
setText(
R.id.tvStart,
"""${
if (it.loadingCity.length > 1) it.loadingCity.substring(
0,
2
) else it.loadingCity
} ${
if (it.loadingArea.length > 1) it.loadingArea.substring(
0,
2
) else it.loadingArea
}"""
)
setText(
R.id.tvEnd, """${
if (it.receiverCity.length > 1) it.receiverCity.substring(
0,
2
) else it.receiverCity
} ${
if (it.receiverArea.length > 1) it.receiverArea.substring(
0,
2
) else it.receiverArea
}"""
)
}
}
}
override fun onCreateViewHolder(
@ -24,7 +72,7 @@ class WaybillListAdapter() :
viewType: Int
): QuickViewHolder {
// 返回一个 ViewHolder
return QuickViewHolder(R.layout.item_waybill, parent)
return QuickViewHolder(R.layout.item_waybill2, parent)
}
}

View File

@ -3,6 +3,7 @@ package com.dhsd.glowner.base
import android.app.Application
import android.content.Context
import com.dahe.mylibrary.CommonBaseLibrary
import com.dhsd.glowner.oss.OssServiceUtil
import java.lang.Exception
import java.security.SecureRandom
import java.security.cert.X509Certificate
@ -25,7 +26,7 @@ class App : Application() {
// SophixManager.getInstance().queryAndLoadNewPatch();
// OssServiceUtil.getInstance().init();
OssServiceUtil.getInstance().init();
// PendingIntent pendingIntent =
// PendingIntent.getActivity(this, 0, new Intent(this, HomeActivity.class), PendingIntent.FLAG_UPDATE_CURRENT);

View File

@ -14,6 +14,7 @@ object AppConfig {
const val DATAS = "DA_HE_DATAS"
const val CX = "DA_HE_CX"
const val CC = "DA_HE_CC"
const val GO_BACK = "DA_HE_GO_BACK"
const val IS_ADD = "DA_HE_IS_ADD"
const val IS_MUL = "DA_HE_IS_MUL"
const val CAPTAIN_ID = "CAPTAIN_ID"

View File

@ -11,10 +11,25 @@ import com.dhsd.glowner.bean.GoodBean
*/
data class OrderListBean<T>(
var total : String,
var total: String,
var rows: List<T>
)
/**
* 货源详情
* @property order OrderBean
* @property childList MutableList<AddressBean>
* @property goodsList MutableList<GoodBean>
* @constructor
*/
data class OrderSourceBean(
var order: OrderBean,
var childList: MutableList<AddressBean>,
var goodsList: MutableList<GoodBean>,
var captainInfo: CaptainInfo,
var photoList : MutableList<PicsBean>
)
data class TextOrder(var orderId: String)
data class OrderBean(
var acceptTime: String,
@ -112,7 +127,8 @@ data class OrderBean(
var updateBy: String,
var updateTime: String,
var vehicleLength: String,
var vehicleType: String
var vehicleType: String,
var shipperDispatchInfo: ShipperDispatchInfo
)
data class DispatchBean(
@ -199,60 +215,37 @@ data class PostOrderBean(
var vehicleLength: String,
var requirement: String,
var remark: String,
var childList:MutableList<AddressBean> = mutableListOf(),
var goodsList:MutableList<GoodBean> = mutableListOf(),
var order : OrderBean? = null
){
constructor():this("","10","","","",
"","","","","","",
"1002996","","","","","","",
"","","","","","","",
"","","","","","",
"","","","","","",
"","","","","","",
"","","","","","",
"","","","","","",
"","","","","",
"","","","","","","","","",
"","", "","","","")
var childList: MutableList<AddressBean> = mutableListOf(),
var goodsList: MutableList<GoodBean> = mutableListOf(),
var order: OrderBean? = null
) {
constructor() : this(
"", "10", "", "", "",
"", "", "", "", "", "",
"1002996", "", "", "", "", "", "",
"", "", "", "", "", "", "",
"", "", "", "", "", "",
"", "", "", "", "", "",
"", "", "", "", "", "",
"", "", "", "", "", "",
"", "", "", "", "", "",
"", "", "", "", "",
"", "", "", "", "", "", "", "", "",
"", "", "", "", "", ""
)
}
data class Child(
var address: String,
var area: String,
var areaCode: String,
var businessCode: String,
var businessName: String,
var city: String,
var cityCode: String,
var cost: String,
var createBy: String,
var createTime: String,
var deadline: String,
var displayOrder: String,
var isPassingPoStrings: String,
var isSaveToCommonAddress: String,
var latitude: String,
var longitude: String,
var name: String,
var orderChildreId: String,
var orderId: String,
var phone: String,
var province: String,
var provinceAreaCode: List<String>,
var provinceCityArea: String,
var provinceCode: String,
var remark: String,
var sortvarue: String,
data class CaptainInfo(
var captainId: String,
var avatar: String,
var contactName: String,
var contactPhone: String,
var captainType: String,
var status: String,
var totalAmount: String,
var type: String,
var updateBy: String,
var updateTime: String
var captainName: String
)
data class ShipperDispatchInfo(
var carHeight: String,
var carLong: String,
@ -260,9 +253,28 @@ data class ShipperDispatchInfo(
var contactPhone: String,
var idcardName: String,
var isRealName: String,
var avatar: String,
var driverPositiveReviewRate: String,
var driverTransactionVolume: String,
var shipperCarId: String,
var shipperDriverId: String,
var vehicleNum: String,
var vehicleType: String,
var vehicleTypeCode: String
)
data class PicsBean(
val orderId: String,
val phone: String,
val province: String,
val location: String,
val photoUrl: String,
val provinceCityArea: String,
val provinceCode: String,
val sortValue: String,
val status: String,
val totalAmount: String,
val receiptType: String,
val type: String
)

View File

@ -6,4 +6,69 @@ package com.dahe.glex.bean
* @Date 2023/9/21 17:34
* @Description TODO
*/
data class WayBillBean(var waybillId :String="")
data class WaybillBean(
val captainId: String,
val captainName: String,
val carId: String,
val createBy: String,
val createTime: String,
val direction: String,
val driverFreight: String,
val driverId: String,
val driverName: String,
val driverPhone: String,
val driverReceivedAmount: String,
val driverTax: String,
val driverTaxFreight: String,
val estimatedProfit: String,
val inputFreight: String,
val isBargaining: String,
val isSettlementApproval: String,
val loadingAddress: String,
val loadingArea: String,
val loadingAreaCode: String,
val loadingBusinessCode: String,
val loadingBusinessName: String,
val loadingCity: String,
val loadingCityCode: String,
val loadingDeadline: String,
val loadingName: String,
val loadingPhone: String,
val loadingProvince: String,
val loadingProvinceCityArea: String,
val loadingProvinceCode: String,
val motorcadeRatio: String,
val motorcadeTotalFreight: String,
val orderId: String,
val orderNum: String,
val platformRatio: String,
val platformTotalFreight: String,
val receiverAddress: String,
val receiverArea: String,
val receiverAreaCode: String,
val receiverBusinessCode: String,
val receiverBusinessName: String,
val receiverCity: String,
val receiverCityCode: String,
val receiverDeadline: String,
val receiverIdcard: String,
val receiverName: String,
val receiverPhone: String,
val receiverProvince: String,
val receiverProvinceCityArea: String,
val receiverProvinceCode: String,
val receivingOrderTime: String,
val remark: String,
val requirement: String,
val shipperId: String,
val shipperName: String,
val totalFreight: String,
val updateBy: String,
val updateTime: String,
val vehicleNum: String,
val waybillId: String,
val avatar: String,
var driverPositiveReviewRate: String,
var driverTransactionVolume: String,
val waybillStatus: String
)

View File

@ -38,7 +38,7 @@ interface Api {
//获取正在执行的运单/运单详情
@POST(BASE_URL + "app/driver/waybill/getExecuteWaybill")
fun getExecuteWaybill(@Body bean: WayBillBean?): Observable<CommonResponseBean<WayBill2>>
fun getExecuteWaybill(@Body bean: WaybillBean?): Observable<CommonResponseBean<WayBill2>>
companion object {
const val BASE_URL = BuildConfig.BASE_URL
@ -69,7 +69,7 @@ interface Api {
fun cancelSourceOfOrder(@Body bean: TextOrder): Observable<CommonResponseBean<Any>>
@GET(BASE_URL+"devApi/system/user/getInfo")
@GET(BASE_URL + "devApi/system/user/getInfo")
fun getUserInfo(): Observable<CommonResponseBean<UserParent>>
@ -132,6 +132,45 @@ interface Api {
fun getAddressDetail(@Path("addressId") addressId: String): Observable<CommonResponseBean<PostAddressBean>>
/**
* 获取货源详情
* @param orderId String
* @return Observable<CommonResponseBean<PostOrderBean>>
*/
@GET(BASE_URL + "devApi/business/shipper/order/{orderId}")
fun getOrderDetail(@Path("orderId") orderId: String): Observable<CommonResponseBean<OrderSourceBean>>
/**
* 取消货源
* @param bean TextOrder
* @return Observable<CommonResponseBean<Any>>
*/
@PUT(BASE_URL + "devApi/business/shipper/order/cancelSourceOfOrder")
fun cancelOrder(@Body bean: TextOrder): Observable<CommonResponseBean<Any>>
/**
* 运单列表
* @param orderNum String
* @param waybillStatus String
* @return Observable<CommonResponseBean<MutableList<AddressBean>>>
*/
@GET(BASE_URL + "devApi/business/shipper/waybill/list")
fun getWaybillList(
@Query("orderNum") orderNum: String,
@Query("waybillStatus") waybillStatus: String
): Observable<CommonResponseBean<OrderListBean<WaybillBean>>>
/**
* 获取运单详情
* @param orderId String
* @return Observable<CommonResponseBean<PostOrderBean>>
*/
@GET(BASE_URL + "devApi/business/shipper/waybill/{orderId}")
fun getWayBillDetail(@Path("orderId") orderId: String): Observable<CommonResponseBean<OrderSourceBean>>
/**
* 修改货主常用地址
* @param bean PostAddressBean
@ -158,6 +197,14 @@ interface Api {
fun getGoodsList(): Observable<CommonResponseBean<OrderListBean<GoodBean>>>
/**
* 获取货主常用车辆列表
* @return Observable<CommonResponseBean<MutableList<CarBean>>>
*/
@GET(BASE_URL + "devApi/business/shipper/shipperCar/list")
fun getKnowCarsList(): Observable<CommonResponseBean<OrderListBean<CarBean>>>
/**
* 获取地址列表
* @return Observable<CommonResponseBean<OrderListBean<AddressBean>>>
@ -170,7 +217,7 @@ interface Api {
* @param dictType String
* @return Observable<CommonResponseBean<MutableList<DictBean>>>
*/
@GET(BASE_URL + "devApi//system/dict/data/type/{dictType}")
@GET(BASE_URL + "devApi/system/dict/data/type/{dictType}")
fun getDictData(@Path("dictType") dictType: String): Observable<CommonResponseBean<MutableList<DictBean>>>
@ -182,20 +229,19 @@ interface Api {
fun getGoodsCategor(): Observable<CommonResponseBean<MutableList<GoodTypeBean>>>
/**
* 常见问题详情
* @param problemId String
* @return Observable<CommonResponseBean<MutableList<ProBean>>>
*/
@GET(BASE_URL + "driver/app/info/commonProblemDetail")
@GET(BASE_URL + "devApi/driver/app/info/commonProblemDetail")
fun commonProblemDetail(@Query("problemId") problemId: String): Observable<CommonResponseBean<ProBean>>
/**
* 常见问题列表
* @return Observable<CommonResponseBean<MutableList<ProBean>>>
*/
@GET(BASE_URL + "driver/app/info/commonProblemList")
@GET(BASE_URL + "devApi/driver/app/info/commonProblemList")
fun commonProblemList(): Observable<CommonResponseBean<MutableList<ProBean>>>
/**
@ -203,7 +249,7 @@ interface Api {
* @param upPart UpPart
* @return Observable<CommonResponseBean<String>>
*/
@GET(BASE_URL + "driver/driver/getCpcAuthenticationInfo")
@GET(BASE_URL + "devApi/driver/driver/getCpcAuthenticationInfo")
fun getCpcAuthenticationInfo(): Observable<CommonResponseBean<UpPart>>
/**
@ -211,14 +257,14 @@ interface Api {
* @param upPart UpPart
* @return Observable<CommonResponseBean<String>>
*/
@POST(BASE_URL + "driver/driver/submitToCpcAuthentication")
@POST(BASE_URL + "devApi/driver/driver/submitToCpcAuthentication")
fun submitToCpcAuthentication(@Body upPart: UpPart): Observable<CommonResponseBean<Any>>
/**
* 获取APP最新版本信息
* @return Observable<CommonResponseBean<ProBean>>
*/
@GET(BASE_URL + "driver/app/info/getLastAppVersion")
@GET(BASE_URL + "devApi/driver/app/info/getLastAppVersion")
fun getLastAppVersion(): Observable<CommonResponseBean<AppVersion>>
@ -226,7 +272,7 @@ interface Api {
* 安全课堂列表
* @return Observable<CommonResponseBean<AppVersion>>
*/
@GET(BASE_URL + "driver/app/info/safeClassroomList")
@GET(BASE_URL + "devApi/driver/app/info/safeClassroomList")
fun safeClassroomList(): Observable<CommonResponseBean<MutableList<QuestionBean>>>
/**
@ -234,7 +280,7 @@ interface Api {
* @param problemId String
* @return Observable<CommonResponseBean<QueDetail>>
*/
@GET(BASE_URL + "driver/app/info/safeClassroomDetail")
@GET(BASE_URL + "devApi/driver/app/info/safeClassroomDetail")
fun safeClassroomDetail(@Query("classroomId") problemId: String): Observable<CommonResponseBean<QueDetail>>
@ -243,13 +289,13 @@ interface Api {
* opinionsType 评价类型(0=司机评价1=货主评价)
* @return Observable<CommonResponseBean<CaptainBean>>
*/
@GET(BASE_URL + "driver/opinions/list")
@GET(BASE_URL + "devApi/driver/opinions/list")
fun waybillRate(@Query("opinionsType") opinionsType: String): Observable<CommonResponseBean<MutableList<RateBean>>>
/**
* 查询司机总评价信息
* @return Observable<CommonResponseBean<CaptainBean>>
*/
@GET(BASE_URL + "driver/opinions/getDriverOpinionsStatInfo")
@GET(BASE_URL + "devApi/driver/opinions/getDriverOpinionsStatInfo")
fun driverRate(): Observable<CommonResponseBean<RateBean>>
}

View File

@ -13,24 +13,14 @@ import android.widget.LinearLayout
import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.app.AppCompatActivity
import androidx.core.widget.addTextChangedListener
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.dahe.gldriver.base.AppConfig
import com.dahe.glex.bean.WayBillBean
import com.dahe.mylibrary.base.BaseActivity
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 com.dahe.mylibrary.utils.PickerUtils
import com.dahe.mylibrary.utils.ToastUtils
import com.dahe.mylibrary.weight.SwitchView
import com.dhsd.glowner.R
import com.dhsd.glowner.adapter.SendGoodsAdapter
import com.dhsd.glowner.bean.AddressBean
import com.dhsd.glowner.bean.PostAddressBean
import com.dhsd.glowner.databinding.ActivityAddressEditBinding
import com.dhsd.glowner.ui.mine.activity.ChoiceCarActivity
import com.dhsd.glowner.utils.OnLimitClickHelper
import com.dhsd.glowner.utils.OnLimitClickListener
import com.google.gson.Gson

View File

@ -16,26 +16,15 @@ import androidx.core.widget.addTextChangedListener
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.dahe.gldriver.base.AppConfig
import com.dahe.glex.bean.WayBillBean
import com.dahe.mylibrary.base.BaseActivity
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 com.dahe.mylibrary.utils.PickerUtils
import com.dahe.mylibrary.utils.ToastUtils
import com.dahe.mylibrary.weight.SwitchView
import com.dhsd.glowner.R
import com.dhsd.glowner.adapter.SendGoodsAdapter
import com.dhsd.glowner.bean.AddressBean
import com.dhsd.glowner.bean.PostAddressBean
import com.dhsd.glowner.databinding.ActivityAddressEditBinding
import com.dhsd.glowner.ui.mine.activity.ChoiceCarActivity
import com.dhsd.glowner.utils.OnLimitClickHelper
import com.dhsd.glowner.utils.OnLimitClickListener
import com.google.gson.Gson
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
/**
* @ClassName AddresEditActivity

View File

@ -29,6 +29,7 @@ import com.dhsd.glowner.databinding.FragmentHomeBinding
import com.dhsd.glowner.ui.home.activtiy.SendGoodsActivity
import com.dhsd.glowner.ui.mine.activity.ChoiceCarActivity
import com.dhsd.glowner.ui.mine.activity.ChoiceFleetActivity
import com.dhsd.glowner.ui.waybill.activity.SourceDetailActivity
import com.dhsd.glowner.utils.CommonPopUtils
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
@ -108,8 +109,10 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(), RefreshCallBack {
adapter = WaybillAdapter()
adapter as WaybillAdapter
}.apply {
setOnItemClickListener { _, _, position ->
ToastUtils.showToast(mContext, position.toString())
setOnItemClickListener { adapter, _, position ->
ActivityUtils.startActivity(mContext, SourceDetailActivity::class.java,Bundle().apply {
putString(AppConfig.ID, adapter.getItem(position)?.orderId)
})
}
addOnItemChildClickListener(R.id.btnOk) { adapter, _, position ->
// ActivityUtils.startActivity(mContext, WaybillDetailActivity::class.java)

View File

@ -194,7 +194,6 @@ class SendGoodsActivity : BaseActivity<ActivitySendGoodsBinding>() {
remark = binding.etRemark.text.toString().trim()
}
DataManager.getInstance().addOrder(postOrderBean)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())

View File

@ -5,7 +5,7 @@ import android.graphics.Color
import android.widget.LinearLayout
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.dahe.glex.bean.WayBillBean
import com.dahe.glex.bean.WaybillBean
import com.dahe.mylibrary.base.BaseFragment
import com.dahe.mylibrary.callback.RefreshCallBack
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
@ -40,16 +40,6 @@ class MessageFragment : BaseFragment<FragmentMessageBinding>(), RefreshCallBack
}
private fun initRecy() {
var datas = mutableListOf<WayBillBean>(
WayBillBean(),
WayBillBean(),
WayBillBean(),
WayBillBean(),
WayBillBean(),
WayBillBean(),
WayBillBean(),
WayBillBean()
)
var adapter = binding.recyclerView.run {
layoutManager = LinearLayoutManager(mContext,RecyclerView.VERTICAL,false)
@ -65,7 +55,7 @@ class MessageFragment : BaseFragment<FragmentMessageBinding>(), RefreshCallBack
adapter as MessageAdapter
}
adapter.submitList(datas)
// adapter.submitList(datas)
}
}

View File

@ -22,8 +22,10 @@ import com.dhsd.glowner.R
import com.dhsd.glowner.adapter.GridItemAdapter
import com.dhsd.glowner.databinding.FragmentMineBinding
import com.dhsd.glowner.ui.WebActivity
import com.dhsd.glowner.ui.address.AddressListActivity
import com.dhsd.glowner.ui.mine.activity.AuthPartyActivity
import com.dhsd.glowner.ui.mine.activity.ComProActivity
import com.dhsd.glowner.ui.mine.activity.KnowCarsActivity
import com.dhsd.glowner.ui.mine.activity.QuesActivity
import com.dhsd.glowner.ui.mine.activity.RateManActivity
import com.dhsd.glowner.ui.mine.activity.RulesActivity
@ -67,7 +69,7 @@ class MineFragment : BaseFragment<FragmentMineBinding>(), View.OnClickListener,
getUserInfo()
binding.run {
setRefresh(smartRefresh,this@MineFragment)
setRefresh(smartRefresh, this@MineFragment)
smartRefresh.finishLoadMore()
//初始化常用工具
gvTools.run {
@ -113,11 +115,11 @@ class MineFragment : BaseFragment<FragmentMineBinding>(), View.OnClickListener,
private fun goTools(pos: Int) {
when (pos) {
0 -> {
// ActivityUtils.startActivity(mContext, RulesActivity::class.java)
ActivityUtils.startActivity(mContext, AddressListActivity::class.java)
}
1 -> {
// ActivityUtils.startActivity(mContext, CarsManActivity::class.java)
ActivityUtils.startActivity(mContext, KnowCarsActivity::class.java)
}
2 -> {
@ -185,7 +187,7 @@ class MineFragment : BaseFragment<FragmentMineBinding>(), View.OnClickListener,
}
override fun getRefreshDate(stat: Int, page: Int, count: Int) {
if (stat==2){
if (stat == 2) {
binding.smartRefresh.finishLoadMoreWithNoMoreData()
return
}
@ -196,21 +198,23 @@ class MineFragment : BaseFragment<FragmentMineBinding>(), View.OnClickListener,
DataManager.getInstance().getUserInfo()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext,object : RxHttpCallBack<UserParent>(binding.smartRefresh){
override fun onSuccess(t: CommonResponseBean<UserParent>) {
super.onSuccess(t)
initUserByData(t.data.user)
}
}))
.subscribe(BaseObserver(mContext,
object : RxHttpCallBack<UserParent>(binding.smartRefresh) {
override fun onSuccess(t: CommonResponseBean<UserParent>) {
super.onSuccess(t)
initUserByData(t.data.user)
}
}))
}
private fun initUserByData(userBean: UserBean){
UserUtils.instance.updateUser(mContext,userBean)
private fun initUserByData(userBean: UserBean) {
UserUtils.instance.updateUser(mContext, userBean)
binding?.run {
tvName.text = userBean.userName
tvPhone.text = userBean.phonenumber
ImageLoader.getInstance().loadCircleImage(mContext,userBean.avatar,ivHead,R.drawable.head_defaut)
ImageLoader.getInstance()
.loadCircleImage(mContext, userBean.avatar, ivHead, R.drawable.head_defaut)
}
}

View File

@ -41,6 +41,8 @@ class ChoiceCarActivity : BaseActivity<ActivityChoiceCarBinding>(), OnLimitClick
lateinit var adapter: DriverCarsAdapter
private var searchValue: String = ""
private var orderId: String = ""
private var isGoBack:Boolean = false
private var selectCar: CarBean? = null
override fun initView(savedInstanceState: Bundle?) {
setStatusBarColor(R.color.white)
@ -49,6 +51,7 @@ class ChoiceCarActivity : BaseActivity<ActivityChoiceCarBinding>(), OnLimitClick
}
orderId = intent.extras?.getString(AppConfig.ID).toString()
isGoBack = intent.extras?.getBoolean(AppConfig.GO_BACK,false) == true
binding.recycler.run {
this@ChoiceCarActivity.adapter = run {
@ -156,7 +159,7 @@ class ChoiceCarActivity : BaseActivity<ActivityChoiceCarBinding>(), OnLimitClick
showToast(t.msg)
// 设置返回结果
setResult(AppCompatActivity.RESULT_OK, Intent())
ActivityUtils.finishToActivity(HomeActivity::class.java,false)
if (isGoBack) finish() else ActivityUtils.finishToActivity(HomeActivity::class.java,false)
// finish()
}
}))

View File

@ -23,6 +23,7 @@ import com.dhsd.glowner.R
import com.dhsd.glowner.adapter.popadapter.DriverFleetAdapter
import com.dhsd.glowner.bean.CaptainBean
import com.dhsd.glowner.databinding.ActivityChoiceFleetCarBinding
import com.dhsd.glowner.ui.HomeActivity
import com.dhsd.glowner.utils.OnLimitClickHelper
import com.dhsd.glowner.utils.OnLimitClickListener
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
@ -37,12 +38,14 @@ import io.reactivex.rxjava3.schedulers.Schedulers
class ChoiceFleetActivity : BaseActivity<ActivityChoiceFleetCarBinding>(), OnLimitClickListener {
lateinit var adapter: DriverFleetAdapter
private var orderId: String = ""
private var isGoBack:Boolean = false
override fun initView(savedInstanceState: Bundle?) {
setStatusBarColor(R.color.white)
setTitleBar("选择车队/车辆", View.OnClickListener { finish() }, true, "我的熟车") {
ToastUtils.showToast(mContext, "我的熟车")
}
orderId = intent.extras?.getString(AppConfig.ID).toString()
isGoBack = intent.extras?.getBoolean(AppConfig.GO_BACK,false) == true
binding.run {
adapter = recycler.run {
layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
@ -146,7 +149,7 @@ class ChoiceFleetActivity : BaseActivity<ActivityChoiceFleetCarBinding>(), OnLim
showToast(t.msg)
// 设置返回结果
setResult(AppCompatActivity.RESULT_OK, Intent())
finish()
if (isGoBack) finish() else ActivityUtils.finishToActivity(HomeActivity::class.java,false)
}
}))
}

View File

@ -0,0 +1,80 @@
package com.dhsd.glowner.ui.mine.activity
import BaseObserver
import DataManager
import RxHttpCallBack
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.glex.bean.OrderListBean
import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
import com.dahe.mylibrary.utils.ConvertUtils
import com.dhsd.glowner.R
import com.dhsd.glowner.adapter.DriverCarsAdapter
import com.dhsd.glowner.bean.CarBean
import com.dhsd.glowner.databinding.ActivityKnowCarsBinding
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
/**
* @ClassName KnowCarsActivity
* @Author john
* @Date 2024/11/11 14:47
* @Description 我的熟车
*/
class KnowCarsActivity : BaseActivity<ActivityKnowCarsBinding>() {
lateinit var adapter: DriverCarsAdapter
override fun initView(savedInstanceState: Bundle?) {
setStatusBarColor(R.color.white)
setTitleBar("我的熟车", true)
binding.run {
recycler.run {
layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
addItemDecoration(
RecycleViewDivider(
LinearLayout.VERTICAL,
ConvertUtils.dp2px(10.0f),
Color.TRANSPARENT
)
)
adapter = DriverCarsAdapter()
adapter as DriverCarsAdapter
}.apply {
isStateViewEnable = true
}
}
}
override fun initDate() {
DataManager.getInstance().getKnowCarsList()
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext,object :RxHttpCallBack<OrderListBean<CarBean>>(){
override fun onSuccess(t: CommonResponseBean<OrderListBean<CarBean>>) {
super.onSuccess(t)
initList(t.data.rows)
}
}))
}
private fun initList(rows: List<CarBean>) {
if (rows.isEmpty()) {
adapter.submitList(null)
adapter.setStateViewLayout(mContext, R.layout.empty_view)
} else {
if (mRefreshPage === 1) {
adapter?.submitList(rows)
} else {
adapter?.addAll(rows)
}
}
}
}

View File

@ -2,12 +2,17 @@ package com.dhsd.glowner.ui.waybill
import android.content.Context
import android.graphics.Color
import android.view.View
import androidx.fragment.app.Fragment
import com.dahe.mylibrary.base.BaseFragment
import com.dahe.mylibrary.callback.RefreshCallBack
import com.dhsd.glowner.R
import com.dhsd.glowner.databinding.FragmentWaybillBinding
import com.dhsd.glowner.ui.waybill.fragment.AllWaybillFragment
import com.dhsd.glowner.ui.waybill.fragment.WaitLoadFragment
import com.dhsd.glowner.ui.waybill.fragment.WaitRateFragment
import com.dhsd.glowner.ui.waybill.fragment.WaitSignFragment
import com.dhsd.glowner.ui.waybill.fragment.WaitUnLoadFragment
import net.lucode.hackware.magicindicator.FragmentContainerHelper
import net.lucode.hackware.magicindicator.buildins.UIUtil
import net.lucode.hackware.magicindicator.buildins.commonnavigator.CommonNavigator
@ -26,14 +31,16 @@ import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.ColorT
*/
class WaybillFragment : BaseFragment<FragmentWaybillBinding>(), RefreshCallBack {
private var currIndex = 0
private val mFragmentContainerHelper = FragmentContainerHelper()
var mFragments = listOf<Fragment>(AllWaybillFragment(),AllWaybillFragment(),AllWaybillFragment(),AllWaybillFragment(),AllWaybillFragment())
var mFragments = listOf<Fragment>(AllWaybillFragment(),WaitLoadFragment(),WaitUnLoadFragment(),WaitSignFragment(),WaitRateFragment())
val titles = mutableListOf(
"全部",
"待装货",
"待卸货",
"评价",
"取消"
"签收",
"待结算"
)
override fun onFragmentVisibleChange(isVisible: Boolean) {
@ -45,10 +52,31 @@ class WaybillFragment : BaseFragment<FragmentWaybillBinding>(), RefreshCallBack
override fun onFragmentFirstVisible() {
initRecy()
binding.run {
// etSearch.addTextChangedListener {
// ivCancel.visibility = if (it.toString().isNullOrBlank()) View.GONE else View.VISIBLE
// }
mFragmentContainerHelper.handlePageSelected(0,true)
switchPages(0)
btnSearch.setOnClickListener {
val search = etSearch.text.trim().toString()
when (currIndex) {
0 -> (mFragments[currIndex] as AllWaybillFragment).onSearchClick(search)
1 -> (mFragments[currIndex] as AllWaybillFragment).onSearchClick(search)
2 -> (mFragments[currIndex] as AllWaybillFragment).onSearchClick(search)
3 -> (mFragments[currIndex] as AllWaybillFragment).onSearchClick(search)
4 -> (mFragments[currIndex] as AllWaybillFragment).onSearchClick(search)
5 -> (mFragments[currIndex] as AllWaybillFragment).onSearchClick(search)
}
}
}
mFragmentContainerHelper.handlePageSelected(currIndex,true)
switchPages(currIndex)
var commonNavigator = CommonNavigator(mContext)
commonNavigator.run {
@ -100,6 +128,7 @@ class WaybillFragment : BaseFragment<FragmentWaybillBinding>(), RefreshCallBack
}
private fun switchPages(index: Int) {
currIndex = index
val fragmentManager = requireActivity().supportFragmentManager
val fragmentTransaction = fragmentManager.beginTransaction()
var fragment: Fragment

View File

@ -1,8 +1,42 @@
package com.dhsd.glowner.ui.waybill.activity
import BaseObserver
import DataManager
import RxHttpCallBack
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import android.text.TextUtils
import android.view.View
import android.widget.LinearLayout
import androidx.activity.result.contract.ActivityResultContracts
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.dahe.gldriver.base.AppConfig
import com.dahe.glex.bean.OrderSourceBean
import com.dahe.glex.bean.PostOrderBean
import com.dahe.glex.bean.TextOrder
import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
import com.dahe.mylibrary.utils.ConvertUtils
import com.dahe.mylibrary.utils.ImageLoader
import com.dahe.mylibrary.utils.LoadingUtils
import com.dahe.mylibrary.utils.PickerUtils
import com.dhsd.glowner.R
import com.dhsd.glowner.adapter.SendGoodsAdapter
import com.dhsd.glowner.adapter.SourceAddressAdapter
import com.dhsd.glowner.bean.HomeEvent
import com.dhsd.glowner.databinding.ActivitySourceDetailBinding
import com.dhsd.glowner.ui.mine.activity.ChoiceCarActivity
import com.dhsd.glowner.ui.mine.activity.ChoiceFleetActivity
import com.dhsd.glowner.utils.CommonPopUtils
import com.dhsd.glowner.utils.OnLimitClickHelper
import com.dhsd.glowner.utils.OnLimitClickListener
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
import org.greenrobot.eventbus.EventBus
/**
* @ClassName WaybillDetailActivity
@ -10,14 +44,146 @@ import com.dhsd.glowner.databinding.ActivitySourceDetailBinding
* @Date 2024/2/5 14:50
* @Description 货源详情
*/
class SourceDetailActivity :BaseActivity<ActivitySourceDetailBinding>(){
override fun initView(savedInstanceState: Bundle?) {
binding.btnReceiving.setOnClickListener {
// ActivityUtils.startActivity(mContext,WaybillSuccActivity::class.java,Bundle().apply { putInt(AppConfig.SUCCESS_TYPE,0) })
class SourceDetailActivity : BaseActivity<ActivitySourceDetailBinding>(), OnLimitClickListener {
private lateinit var adapter: SourceAddressAdapter
private var orderId: String = ""
private val launcher =
registerForActivityResult(ActivityResultContracts.StartActivityForResult()) { result ->
if (result.resultCode == AppCompatActivity.RESULT_OK) {
initDate()
}
}
override fun initView(savedInstanceState: Bundle?) {
setStatusBarColor(R.color.white)
setTitleBar("货源详情", true)
binding?.run {
adapter = recycler.run {
layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
addItemDecoration(
RecycleViewDivider(
LinearLayout.VERTICAL,
ConvertUtils.dp2px(12.0f),
Color.TRANSPARENT
)
)
adapter = SourceAddressAdapter()
adapter as SourceAddressAdapter
}
btnLeft.setOnClickListener(OnLimitClickHelper(this@SourceDetailActivity))
btnRight.setOnClickListener(OnLimitClickHelper(this@SourceDetailActivity))
}
intent.extras?.getString(AppConfig.ID)?.let {
orderId = it
}
}
override fun initDate() {
// SelectPicUtils().getInstance(mContext)
DataManager.getInstance().getOrderDetail(orderId)
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<OrderSourceBean>() {
override fun onSuccess(t: CommonResponseBean<OrderSourceBean>) {
super.onSuccess(t)
initViewByData(t.data)
}
}))
}
override fun onClick(view: View?) {
super.onClick(view)
when (view?.id) {
R.id.btnLeft -> {
CommonPopUtils.getInstance()
.showCommCenterPop(mContext, "提示", "您确定取消该运单么?") {
DataManager.getInstance().cancelOrder(TextOrder(orderId))
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
override fun onSuccess(t: CommonResponseBean<Any>) {
super.onSuccess(t)
EventBus.getDefault().post(HomeEvent(true))
finish()
}
}))
}
}
R.id.btnRight -> {
if (TextUtils.isEmpty(orderId))
return
CommonPopUtils.getInstance().showCarList(
mContext
) { _, position ->
when (position) {
0 -> {
launcher.launch(Intent(mContext, ChoiceCarActivity::class.java).apply {
putExtras(Bundle().apply {
putString(AppConfig.ID, orderId)
putBoolean(AppConfig.GO_BACK, true)
})
})
}
1 -> {
launcher.launch(
Intent(
mContext,
ChoiceFleetActivity::class.java
).apply {
putExtras(Bundle().apply {
putString(AppConfig.ID, orderId)
putBoolean(AppConfig.GO_BACK, true)
})
})
}
}
}
}
}
}
private fun initViewByData(data: OrderSourceBean) {
data.run {
binding.run {
tvTime.text = """${data.order.loadingDeadline} 装货"""
tvType.text = if (data.order.orderType == "0") "一装一卸" else "一装多卸"
tvLoadDis.text = data.order.distance.toString() + "Km"
tvFreight.text = data.order.driverFreight + ""
tvGoods.text = data.goodsList.joinToString(separator = "\n") { innerIt ->
"""${innerIt.goodName},${innerIt.packName},${
if (!TextUtils.isEmpty(innerIt.goodItemGrossWeight)) innerIt.goodItemGrossWeight + "" else innerIt.goodCube + ""
}"""
}
tvRemark.text = data.order.requirement
tvCarType.text = """${data.order.vehicleType} ${data.order.vehicleLength} """
//派单信息
if (!TextUtils.isEmpty(data.order.shipperDriverId) && "0" != data.order.shipperDriverId) {
cdDriver.visibility = View.VISIBLE
tvCar.text =
"""${data.order.shipperDispatchInfo.vehicleNum},${data.order.shipperDispatchInfo.carLong}mm"""
tvDriverName.text = data.order.shipperDispatchInfo.idcardName
tvRate.text =
"""交易 ${data.order.shipperDispatchInfo.driverTransactionVolume} 好评率${
data.order.shipperDispatchInfo.driverPositiveReviewRate.toDoubleOrNull()
?.times(100)
}%"""
ImageLoader.getInstance().loadImage(
mContext,
data.order.shipperDispatchInfo.avatar,
ivHead,
R.drawable.head_defaut
)
} else {
cdDriver.visibility = View.GONE
}
adapter.submitList(data.childList)
}
}
}
}

View File

@ -1,12 +1,37 @@
package com.dhsd.glowner.ui.waybill.activity
import BaseObserver
import DataManager
import RxHttpCallBack
import android.graphics.Color
import android.os.Bundle
import android.text.TextUtils
import android.view.View
import android.widget.LinearLayout
import androidx.appcompat.app.AppCompatActivity
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.amap.api.maps.AMap
import com.bumptech.glide.Glide
import com.dahe.gldriver.base.AppConfig
import com.dahe.glex.bean.OrderSourceBean
import com.dahe.glex.bean.PicsBean
import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
import com.dahe.mylibrary.utils.ActivityUtils
import com.dahe.mylibrary.utils.BaseUtils
import com.dahe.mylibrary.utils.ConvertUtils
import com.dahe.mylibrary.utils.ImageLoader
import com.dahe.mylibrary.utils.ToastUtils
import com.dhsd.glowner.R
import com.dhsd.glowner.adapter.SourceAddressAdapter
import com.dhsd.glowner.databinding.ActivityWaybillDetailBinding
import com.dhsd.glowner.utils.OrderUtils
import com.google.gson.Gson
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
/**
@ -16,19 +41,51 @@ import com.dhsd.glowner.databinding.ActivityWaybillDetailBinding
* @Description 运单详情
*/
class WaybillLDetailActivity : BaseActivity<ActivityWaybillDetailBinding>() {
private lateinit var adapter: SourceAddressAdapter
private var orderId: String = ""
lateinit var pics : MutableList<PicsBean>
var aMap: AMap? = null
override fun initView(savedInstanceState: Bundle?) {
setStatusBarColor(R.color.white)
setTitleBar("运单详情", { finish() }, true, "查看单据") {
if (!::pics.isInitialized || pics.size==0){
showToast("司机暂未上传照片")
return@setTitleBar
}
setTitleBar("运单详情", View.OnClickListener { finish() }, true, "查看单据") {
ToastUtils.showToast(mContext, "查看单据")
ActivityUtils.startActivity(mContext, SeeDocActivity::class.java,Bundle().apply {
putString(AppConfig.DATAS,Gson().toJson(pics))
})
}
intent.extras?.let {
orderId = it.getString(AppConfig.ID).toString()
}
binding.run {
mapView.onCreate(savedInstanceState)
if (aMap == null) mapView.map
btnRight.setOnClickListener {
adapter = recycler.run {
layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
addItemDecoration(
RecycleViewDivider(
LinearLayout.VERTICAL,
ConvertUtils.dp2px(12.0f),
Color.TRANSPARENT
)
)
adapter = SourceAddressAdapter()
adapter as SourceAddressAdapter
}
btnLeft.setOnClickListener {
// ActivityUtils.startActivity(
// mContext,
// WaybillUpPicActivity::class.java,
@ -38,6 +95,14 @@ class WaybillLDetailActivity : BaseActivity<ActivityWaybillDetailBinding>() {
}
override fun initDate() {
DataManager.getInstance().getWayBillDetail(orderId)
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<OrderSourceBean>() {
override fun onSuccess(t: CommonResponseBean<OrderSourceBean>) {
super.onSuccess(t)
initViewByData(t.data)
}
}))
}
override fun onResume() {
@ -59,6 +124,70 @@ class WaybillLDetailActivity : BaseActivity<ActivityWaybillDetailBinding>() {
if (binding.mapView != null)
binding.mapView.onDestroy();
super.onDestroy()
}
private fun initViewByData(data: OrderSourceBean) {
pics = data.photoList
binding.run {
tvWaybillNum.text = """运单号: ${data.order.orderNum}"""
tvStatus.text = OrderUtils.getInstance().getOrderStatu(data.order.orderStatus)
tvCarNum.text = data.order.shipperDispatchInfo.vehicleNum
tvCarLength.text = data.order.shipperDispatchInfo.carLong
tvCarType.text = data.order.shipperDispatchInfo.vehicleType
tvDriverName.text =
"""${data.order.shipperDispatchInfo.idcardName} ${data.order.shipperDispatchInfo.contactPhone}"""
tvDriverRate.text =
"""交易${data.order.shipperDispatchInfo.driverTransactionVolume} 好评率${
data.order.shipperDispatchInfo.driverPositiveReviewRate.toIntOrNull()
?.times(100)
}%"""
ImageLoader.getInstance().loadCircleImage(
mContext,
data.order.shipperDispatchInfo.avatar,
ivHead,
R.drawable.head_defaut
)
btnCallDriver.setOnClickListener {
BaseUtils.callPhone(this@WaybillLDetailActivity, data.order.shipperDispatchInfo.contactPhone)
}
tvTime.text = """${data.order.loadingDeadline}装货,"""
tvWaybillType.text =
"""${if (data.order.orderType == "0") "一装一卸" else "一装多卸"}"""
tvLoadDis.text = data.order.distance.toString() + "Km"
tvCarTypes.text = """${data.order.vehicleType} ${data.order.vehicleLength} """
tvGoods.text = data.goodsList.joinToString(separator = "\n") { innerIt ->
"""${innerIt.goodName},${innerIt.packName},${
if (!TextUtils.isEmpty(innerIt.goodItemGrossWeight)) innerIt.goodItemGrossWeight + "" else innerIt.goodCube + ""
}"""
}
if (!TextUtils.isEmpty(data.order.remark))
tvRemark.text = data.order.remark
tvJdDate.text = data.order.effectiveTimeStart
if (data.captainInfo!=null&&!TextUtils.isEmpty(data.captainInfo.captainId)){
cdCd.visibility = View.VISIBLE
ImageLoader.getInstance().loadCircleImage(mContext,data.captainInfo.avatar,ivCdHead,R.drawable.head_defaut)
tvCdName.text = data.captainInfo.contactName
tvCdPhone.text = data.captainInfo.contactPhone
btnCallDriver.setOnClickListener {
BaseUtils.callPhone(this@WaybillLDetailActivity, data.captainInfo.contactPhone)
}
}else{
cdCd.visibility = View.GONE
}
tvFreight.text = data.order.driverFreight
btnLeft.setOnClickListener {
BaseUtils.callPhone(this@WaybillLDetailActivity, data.order.loadingPhone)
}
adapter.submitList(data.childList)
}
}
}

View File

@ -1,11 +1,29 @@
package com.dhsd.glowner.ui.waybill.fragment
import BaseObserver
import DataManager
import RxHttpCallBack
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.glex.bean.WayBillBean
import com.dahe.gldriver.base.AppConfig
import com.dahe.glex.bean.OrderListBean
import com.dahe.glex.bean.WaybillBean
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 com.dhsd.glowner.R
import com.dhsd.glowner.adapter.WaybillListAdapter
import com.dhsd.glowner.callback.OnSearchListener
import com.dhsd.glowner.databinding.FragmentWaybillListBinding
import com.dhsd.glowner.ui.waybill.activity.WaybillLDetailActivity
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
/**
* @ClassName AllWaybillFragment
@ -13,30 +31,75 @@ import com.dhsd.glowner.databinding.FragmentWaybillListBinding
* @Date 2024/1/24 14:06
* @Description TODO
*/
class AllWaybillFragment : BaseFragment<FragmentWaybillListBinding>() {
class AllWaybillFragment : BaseFragment<FragmentWaybillListBinding>(),
OnSearchListener, RefreshCallBack {
lateinit var adapter: WaybillListAdapter
override fun onFragmentVisibleChange(isVisible: Boolean) {
}
override fun onFragmentFirstVisible() {
var datas = mutableListOf<WayBillBean>(
WayBillBean(),
WayBillBean(),
WayBillBean(),
WayBillBean(),
WayBillBean(),
WayBillBean(),
WayBillBean(),
WayBillBean()
)
var adapter = binding.recyclerView.run {
layoutManager = LinearLayoutManager(mContext,RecyclerView.VERTICAL,false)
setHasFixedSize(true)
adapter = WaybillListAdapter()
adapter as WaybillListAdapter
initData("")
binding.run {
setRefresh(refresh, this@AllWaybillFragment)
adapter = recyclerView.run {
layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
addItemDecoration(
RecycleViewDivider(
LinearLayout.VERTICAL,
ConvertUtils.dp2px(10.0f),
Color.TRANSPARENT
)
)
adapter = WaybillListAdapter()
adapter as WaybillListAdapter
}.apply {
isStateViewEnable = true
setOnItemClickListener{adapter,_,position->
val item = adapter.getItem(position) as WaybillBean
ActivityUtils.startActivity(mContext, WaybillLDetailActivity::class.java,
Bundle().apply { putString(AppConfig.ID,item.orderId) }
)
}
}
}
adapter.submitList(datas)
}
override fun onSearchClick(search: String) {
initData(search)
}
private fun initData(search: String = "") {
DataManager.getInstance().getWaybillList(search, "")
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext,object : RxHttpCallBack<OrderListBean<WaybillBean>>(binding.refresh){
override fun onSuccess(t: CommonResponseBean<OrderListBean<WaybillBean>>) {
super.onSuccess(t)
initList(t.data.rows)
}
}))
}
private fun initList(rows: List<WaybillBean>) {
if (rows.isEmpty()) {
adapter.submitList(null)
adapter.setStateViewLayout(mContext, R.layout.empty_view)
} else {
if (mRefreshPage === 1) {
adapter?.submitList(rows)
} else {
adapter?.addAll(rows)
}
}
}
override fun getRefreshDate(stat: Int, page: Int, count: Int) {
if (stat ==2){
binding.refresh.finishLoadMoreWithNoMoreData()
return
}
initData("")
}
}

View File

@ -9,6 +9,8 @@ import com.dahe.glex.bean.AppVersion
import com.dahe.mylibrary.base.SingletonNoPHolder
import com.dahe.mylibrary.callback.OnPicResultListener
import com.dahe.mylibrary.pop.PopNorBottomPic
import com.dahe.mylibrary.utils.ConvertUtils
import com.dhsd.glowner.R
import com.dhsd.glowner.bean.PopBean
import com.dhsd.glowner.cuspop.OnCarSelectListener
import com.dhsd.glowner.cuspop.PopBottomCar
@ -100,4 +102,32 @@ class CommonPopUtils private constructor() {
.show()
}
/**
* 展示图片
* @param context Context
* @param position Int
* @param recyclerView RecyclerView
* @param mutableList MutableList<Any>
*/
fun showPics(
context: Context,
imageView: ImageView? = null,
position: Int,
recyclerView: RecyclerView,
mutableList: List<Any>
) {
XPopup.Builder(context) //.animationDuration(1000)
.isTouchThrough(true)
.asImageViewer(
imageView, position, mutableList,
false, true, -1, -1, ConvertUtils.dp2px(10F), false,
Color.rgb(32, 36, 46),
{ popupView, position ->
// popupView.updateSrcView(recyclerView.getChildAt(position) as ImageView)
}, SmartGlideImageLoader(true, R.mipmap.ic_launcher), null
)
.show()
}
}

View File

@ -29,6 +29,6 @@ class OnLimitClickHelper(onLimitClickListener: OnLimitClickListener?) : View.OnC
}
companion object {
const val LIMIT_TIME = 2000
const val LIMIT_TIME = 1500
}
}

View File

@ -0,0 +1,57 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_F3"
android:orientation="vertical">
<include layout="@layout/common_toolbar"></include>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@color/white"
android:paddingLeft="@dimen/dp_15"
android:paddingTop="@dimen/dp_8"
android:paddingRight="@dimen/dp_15"
android:paddingBottom="@dimen/dp_8">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_40"
android:background="@drawable/shape_gray_bg20"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="@dimen/dp_16"
android:layout_height="@dimen/dp_16"
android:layout_marginLeft="@dimen/dp_10"
android:background="@drawable/search_icon_white"></ImageView>
<AutoCompleteTextView
android:id="@+id/etInput"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_vertical"
android:layout_marginLeft="@dimen/dp_6"
android:background="#00000000"
android:hint="请输入车牌号/手机号进行搜索"
android:inputType="text|textAutoComplete"
android:singleLine="true"
android:text=""
android:textColor="@color/black"
android:textSize="14sp" />
</LinearLayout>
</LinearLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler"
android:layout_weight="1"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>

View File

@ -4,39 +4,15 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<RelativeLayout
android:id="@+id/rlTop"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_240"
android:background="@drawable/home_top_bg"
android:paddingTop="@dimen/dp_48">
<TextView
android:id="@+id/tvTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerHorizontal="true"
android:text="货源详情"
android:textColor="@color/white"
android:textSize="@dimen/sp_17" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_16"
android:layout_marginTop="@dimen/dp_4"
android:background="@drawable/left"
android:baselineAlignBottom="@+id/tvTitle" />
</RelativeLayout>
<include layout="@layout/common_toolbar"></include>
<androidx.core.widget.NestedScrollView
android:id="@+id/scrollView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_m_140"
android:layout_marginTop="@dimen/dp_16"
android:layout_weight="1"
android:fillViewport="true">
@ -69,6 +45,7 @@
android:textSize="@dimen/sp_15" />
<TextView
android:id="@+id/tvType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_14"
@ -84,74 +61,20 @@
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" />
<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" />
<ImageView
android:layout_alignTop="@+id/tvUnload"
android:id="@+id/ivUnload"
android:layout_width="@dimen/dp_18"
android:layout_height="@dimen/dp_18"
android:layout_below="@+id/ivLoad"
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/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" />
<LinearLayout
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tvUnloadPhone"
android:layout_marginTop="@dimen/dp_16"
android:layout_below="@+id/tvTime"
android:layout_marginTop="@dimen/dp_18" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/recycler"
android:layout_marginTop="@dimen/dp_6"
android:background="@drawable/shape_gray_5"
android:orientation="horizontal">
@ -159,15 +82,15 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:padding="@dimen/dp_15">
android:gravity="left"
android:padding="@dimen/dp_10">
<TextView
android:id="@+id/tvLoadDis"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="122.5km"
tools:text="122.5km"
android:textColor="@color/black"
android:textSize="@dimen/sp_16"
android:textStyle="bold" />
@ -178,48 +101,28 @@
android:layout_below="@+id/tvLoadDis"
android:layout_marginTop="@dimen/dp_5"
android:gravity="center"
android:text="距装货地约"
android:text="总里程"
android:textColor="@color/color_9"
android:textSize="@dimen/sp_12"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_12"
android:layout_toRightOf="@+id/tvLoadDis"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="@dimen/dp_14"
android:layout_height="@dimen/dp_14"
android:background="@drawable/icon_go" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_6"
android:text="去装货地"
android:textColor="@color/main_blue"
android:textSize="@dimen/dp_9" />
</LinearLayout>
</RelativeLayout>
<View
android:visibility="gone"
android:layout_width="@dimen/dp_1"
android:layout_height="@dimen/dp_24"
android:layout_gravity="center_vertical"
android:background="@color/color_c" />
<RelativeLayout
android:visibility="gone"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:padding="@dimen/dp_15">
android:padding="@dimen/dp_10">
<TextView
android:id="@+id/tvUnloadDis"
@ -242,70 +145,11 @@
android:textSize="@dimen/sp_12"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_12"
android:layout_toRightOf="@+id/tvUnloadDis"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="@dimen/dp_14"
android:layout_height="@dimen/dp_14"
android:background="@drawable/icon_route" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_6"
android:text="查看路线"
android:textColor="@color/main_blue"
android:textSize="@dimen/dp_9" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginRight="@dimen/dp_15"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="@dimen/dp_8">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:padding="@dimen/dp_16">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="收货方"
android:textColor="@color/black"
android:textSize="@dimen/sp_17"
android:textStyle="bold" />
<TextView
android:id="@+id/tvCom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_40"
android:text="安徽东阳矿业科技有限公司"
android:textColor="@color/black"
android:textSize="@dimen/sp_15" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
@ -343,13 +187,14 @@
android:textSize="@dimen/sp_15" />
<TextView
android:id="@+id/tvCarType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/tvCarTitle"
android:layout_alignParentRight="true"
android:layout_marginTop="@dimen/dp_40"
android:paddingRight="@dimen/dp_16"
android:text="整车 4.2/6.2/6.8 米 高栏/厢式"
tools:text="整车 4.2/6.2/6.8 米 高栏/厢式"
android:textColor="@color/main_red"
android:textSize="@dimen/sp_15" />
@ -365,6 +210,7 @@
android:textSize="@dimen/sp_15" />
<TextView
android:id="@+id/tvGoods"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/tvGoodsTitle"
@ -387,6 +233,7 @@
android:textSize="@dimen/sp_15" />
<TextView
android:id="@+id/tvRemark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/tvNotesTitle"
@ -415,6 +262,7 @@
<androidx.cardview.widget.CardView
android:id="@+id/cdDriver"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_15"
@ -431,31 +279,60 @@
<TextView
android:id="@+id/tvPDTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="货主信息"
android:text="派单信息"
android:textColor="@color/black"
android:textSize="@dimen/sp_17"
android:textStyle="bold" />
<LinearLayout
android:id="@+id/llPDTitle"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tvPDTitle"
android:layout_marginTop="@dimen/dp_10"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="车牌号"
android:textSize="@dimen/sp_15"
android:textColor="@color/color_01" />
<TextView
android:id="@+id/tvCar"
android:layout_weight="1"
android:gravity="right"
tools:text="豫V854S616米30吨"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/sp_15"
android:textColor="@color/black" />
</LinearLayout>
<ImageView
android:id="@+id/ivHead"
android:layout_width="@dimen/dp_42"
android:layout_height="@dimen/dp_42"
android:layout_marginTop="@dimen/dp_40"
android:layout_marginTop="@dimen/dp_70"
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_10"
android:layout_marginTop="@dimen/dp_40"
android:layout_marginTop="@dimen/dp_70"
android:layout_toRightOf="@+id/ivHead"
android:text="安徽东阳矿业科技有限公司"
tools:text="安徽东阳矿业科技有限公司"
android:textColor="@color/black"
android:textSize="@dimen/sp_15" />
<TextView
android:id="@+id/tvRate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/ivHead"
@ -507,25 +384,25 @@
<Button
android:id="@+id/btnCall"
android:layout_width="@dimen/dp_120"
android:id="@+id/btnLeft"
android:layout_width="@dimen/dp_100"
android:layout_height="@dimen/dp_36"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/btnReceiving"
android:layout_toLeftOf="@+id/btnRight"
android:background="@drawable/shape_btn_empty_bg"
android:text="联系货主"
android:text="取消货源"
android:textColor="@color/main_red"
android:textSize="@dimen/sp_15" />
<Button
android:id="@+id/btnReceiving"
android:layout_width="@dimen/dp_120"
android:id="@+id/btnRight"
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:text="重新派车"
android:textColor="@color/white"
android:textSize="@dimen/sp_15" />
</RelativeLayout>

View File

@ -4,17 +4,9 @@
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_80"
android:background="@drawable/waybill_top_bg"
android:gravity="bottom">
<include layout="@layout/common_toolbar"></include>
</RelativeLayout>
<include layout="@layout/common_toolbar"></include>
<com.amap.api.maps.MapView
android:id="@+id/mapView"
@ -54,6 +46,7 @@
<TextView
android:id="@+id/tvWaybillNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="运单号DJHS15541125541"
@ -61,6 +54,7 @@
android:textSize="@dimen/sp_15" />
<TextView
android:id="@+id/tvStatus"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
@ -68,24 +62,76 @@
android:textColor="@color/main_red"
android:textSize="@dimen/sp_15" />
<View
android:layout_width="match_parent"
android:layout_height="@dimen/dp_1"
android:layout_below="@+id/tvStatus"
android:layout_marginTop="@dimen/dp_12"
android:background="@color/color_e5" />
<RelativeLayout
android:layout_below="@id/tvStatus"
android:id="@+id/rlDriver"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginTop="@dimen/dp_10"
android:paddingTop="@dimen/dp_12"
android:paddingBottom="@dimen/dp_12"
>
<TextView
android:id="@+id/tvCarNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="豫A87SF9"
android:textColor="@color/black"
android:textSize="@dimen/sp_17"
/>
<TextView
android:id="@+id/tvCarLength"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="16米/30吨"
android:textColor="@color/color_01"
android:textSize="@dimen/sp_14" />
<TextView
android:id="@+id/tvCarType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:text="重型栏板半挂车"
android:textColor="@color/color_01"
android:textSize="@dimen/sp_14" />
</RelativeLayout>
<ImageView
android:layout_below="@+id/rlDriver"
android:id="@+id/ivHead"
android:layout_width="@dimen/dp_42"
android:layout_height="@dimen/dp_42"
android:layout_marginTop="@dimen/dp_40"
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_10"
android:layout_marginTop="@dimen/dp_40"
android:layout_alignTop="@+id/ivHead"
android:layout_toRightOf="@+id/ivHead"
android:text="安徽东阳矿业科技有限公司"
tools:text="王师傅 12562565612"
android:textColor="@color/black"
android:textSize="@dimen/sp_15" />
<TextView
android:id="@+id/tvDriverRate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/ivHead"
@ -96,14 +142,13 @@
android:textSize="@dimen/sp_12" />
<Button
android:id="@+id/btnCallDriver"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_26"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:background="@drawable/bg_btn"
android:paddingLeft="@dimen/dp_4"
android:paddingRight="@dimen/dp_4"
android:text="联系货主"
android:text="联系司机"
android:textColor="@color/white"
android:textSize="@dimen/sp_12" />
@ -127,51 +172,6 @@
android:padding="@dimen/dp_16">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="豫A87SF9"
android:textColor="@color/black"
android:textSize="@dimen/sp_17"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerInParent="true"
android:text="16米/30吨"
android:textColor="@color/color_01"
android:textSize="@dimen/sp_14" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"
android:text="重型栏板半挂车"
android:textColor="@color/color_01"
android:textSize="@dimen/sp_14" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginRight="@dimen/dp_15"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="@dimen/dp_8">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:padding="@dimen/dp_16">
<TextView
android:id="@+id/tvTime"
android:layout_width="wrap_content"
@ -181,6 +181,7 @@
android:textSize="@dimen/sp_15" />
<TextView
android:id="@+id/tvWaybillType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_14"
@ -196,74 +197,20 @@
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" />
<TextView
android:id="@+id/tvLoad"
android:layout_width="wrap_content"
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler"
android:layout_width="match_parent"
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" />
android:layout_marginTop="@dimen/dp_22" />
<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"
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/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" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_below="@+id/tvUnloadPhone"
android:layout_marginTop="@dimen/dp_16"
android:layout_below="@+id/recycler"
android:layout_marginTop="@dimen/dp_12"
android:background="@drawable/shape_gray_5"
android:orientation="horizontal">
@ -271,8 +218,8 @@
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:padding="@dimen/dp_15">
android:gravity="left"
android:padding="@dimen/dp_12">
<TextView
android:id="@+id/tvLoadDis"
@ -290,135 +237,18 @@
android:layout_below="@+id/tvLoadDis"
android:layout_marginTop="@dimen/dp_5"
android:gravity="center"
android:text="距装货地约"
android:text="总里程"
android:textColor="@color/color_9"
android:textSize="@dimen/sp_12"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_12"
android:layout_toRightOf="@+id/tvLoadDis"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="@dimen/dp_14"
android:layout_height="@dimen/dp_14"
android:background="@drawable/icon_go" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_6"
android:text="去装货地"
android:textColor="@color/main_blue"
android:textSize="@dimen/dp_9" />
</LinearLayout>
</RelativeLayout>
<View
android:layout_width="@dimen/dp_1"
android:layout_height="@dimen/dp_24"
android:layout_gravity="center_vertical"
android:background="@color/color_c" />
<RelativeLayout
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:padding="@dimen/dp_15">
<TextView
android:id="@+id/tvUnloadDis"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="122.5km"
android:textColor="@color/black"
android:textSize="@dimen/sp_16"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tvUnloadDis"
android:layout_marginTop="@dimen/dp_5"
android:gravity="center"
android:text="预估里程"
android:textColor="@color/color_9"
android:textSize="@dimen/sp_12"
android:textStyle="bold" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_12"
android:layout_toRightOf="@+id/tvUnloadDis"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_width="@dimen/dp_14"
android:layout_height="@dimen/dp_14"
android:background="@drawable/icon_route" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_6"
android:text="查看路线"
android:textColor="@color/main_blue"
android:textSize="@dimen/dp_9" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>
</RelativeLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginRight="@dimen/dp_15"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="@dimen/dp_8">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:padding="@dimen/dp_16">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="收货方"
android:textColor="@color/black"
android:textSize="@dimen/sp_17"
android:textStyle="bold" />
<TextView
android:id="@+id/tvCom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_40"
android:text="安徽东阳矿业科技有限公司"
android:textColor="@color/black"
android:textSize="@dimen/sp_15" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
@ -455,6 +285,7 @@
android:textSize="@dimen/sp_15" />
<TextView
android:id="@+id/tvCarTypes"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/tvCarTitle"
@ -477,6 +308,7 @@
android:textSize="@dimen/sp_15" />
<TextView
android:id="@+id/tvGoods"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/tvGoodsTitle"
@ -499,6 +331,7 @@
android:textSize="@dimen/sp_15" />
<TextView
android:id="@+id/tvRemark"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/tvNotesTitle"
@ -524,7 +357,124 @@
</RelativeLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginRight="@dimen/dp_15"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="@dimen/dp_8">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:padding="@dimen/dp_16">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="运单信息"
android:textColor="@color/black"
android:textSize="@dimen/sp_17"
android:textStyle="bold" />
<TextView
android:id="@+id/tvCom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_40"
android:text="接单时间"
android:textColor="@color/black"
android:textSize="@dimen/sp_15" />
<TextView
android:id="@+id/tvJdDate"
android:layout_alignBottom="@+id/tvCom"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignParentRight="true"
tools:text="2023-12-11 15:54"
android:textColor="@color/black"
android:textSize="@dimen/sp_15"
/>
</RelativeLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:id="@+id/cdCd"
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginRight="@dimen/dp_15"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="@dimen/dp_8">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:padding="@dimen/dp_16">
<TextView
android:id="@+id/tvCd"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="车队信息"
android:textColor="@color/black"
android:textSize="@dimen/sp_17"
android:textStyle="bold" />
<ImageView
android:layout_marginTop="@dimen/dp_14"
android:layout_below="@+id/tvCd"
android:id="@+id/ivCdHead"
android:layout_width="@dimen/dp_42"
android:layout_height="@dimen/dp_42"
android:background="@drawable/head_defaut" />
<TextView
android:id="@+id/tvCdName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_alignTop="@+id/ivCdHead"
android:layout_toRightOf="@+id/ivCdHead"
android:text="安徽东阳矿业科技有限公司"
android:textColor="@color/black"
android:textSize="@dimen/sp_15" />
<TextView
android:id="@+id/tvCdPhone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/ivCdHead"
android:layout_marginLeft="@dimen/dp_10"
android:layout_toRightOf="@+id/ivCdHead"
android:text="交易200 好评率89%"
android:textColor="@color/color_9"
android:textSize="@dimen/sp_12" />
<Button
android:id="@+id/btnCallCd"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_26"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:background="@drawable/bg_btn"
android:text="联系车队"
android:textColor="@color/white"
android:textSize="@dimen/sp_12" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
<View
android:layout_width="0dp"
@ -536,6 +486,7 @@
</androidx.core.widget.NestedScrollView>
<RelativeLayout
android:background="@color/white"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_74"
android:gravity="center_vertical"
@ -569,12 +520,14 @@
android:layout_height="@dimen/dp_36"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/btnRight"
android:layout_alignParentRight="true"
android:background="@drawable/shape_btn_empty_bg"
android:text="联系装货人"
android:textColor="@color/main_red"
android:textSize="@dimen/sp_15" />
<Button
android:visibility="gone"
android:id="@+id/btnRight"
android:layout_width="@dimen/dp_120"
android:layout_height="@dimen/dp_36"

View File

@ -156,7 +156,7 @@
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:text="急啊卡省的JFK垃圾上单克里夫喀什酱豆腐卡拉就圣诞快乐房价爱上了夫卡是考虑到房价爱上了">
android:text="大河好运2.0上线了!!!">
</TextView>

View File

@ -29,6 +29,7 @@
android:textSize="@dimen/sp_14"/>
<Button
android:id="@+id/btnSearch"
android:layout_marginBottom="@dimen/dp_9"
android:layout_alignParentBottom="true"
android:layout_width="@dimen/dp_57"
@ -43,8 +44,9 @@
<net.lucode.hackware.magicindicator.MagicIndicator
android:id="@+id/magicIndicator"
android:background="@color/white"
android:layout_width="match_parent"
android:layout_height="42dp" />
android:layout_height="44dp" />
<FrameLayout
android:id="@+id/fragmentContainer"

View File

@ -3,7 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_120"
android:layout_height="@dimen/dp_125"
android:id="@+id/cdContent"
android:clickable="true"
app:cardCornerRadius="@dimen/dp_8"
@ -46,7 +46,12 @@
/>
</LinearLayout>
<View
android:layout_marginTop="@dimen/dp_10"
android:layout_width="match_parent"
android:layout_height="1dp"
android:background="@color/color_c"
/>
<LinearLayout
android:layout_marginTop="@dimen/dp_10"
android:layout_width="match_parent"

View File

@ -173,6 +173,27 @@ public abstract class BaseActivity<VB extends ViewBinding> extends AppCompatActi
((TextView) findViewById(R.id.common_toolBar_title)).setText(title);
}
/**
* 设置标题以及主题颜色
*/
protected void setTitleBar(String title, boolean isWhite, boolean isBack) {
mToolbar = (Toolbar) findViewById(R.id.common_toolbar);
mToolbar.setBackgroundColor(statusColor == -1 ? Color.TRANSPARENT : ContextCompat.getColor(mContext, statusColor));
if (isBack) {
mToolbar.setNavigationIcon(isWhite ? R.drawable.left : R.drawable.left_black);
mToolbar.setNavigationOnClickListener(view -> finish());
}
if (!TextUtils.isEmpty(title)) {//
((TextView) findViewById(R.id.common_toolBar_title)).setTextColor(isWhite ? getColor(R.color.colorWhite) : getColor(R.color.black));
((TextView) findViewById(R.id.common_toolBar_title)).setText(title);
}
if (isWhite) {
StatusBar.cancelLightStatusBar(this);//图标文字白色
}
}
/**
* 显示右边标题
@ -202,10 +223,13 @@ public abstract class BaseActivity<VB extends ViewBinding> extends AppCompatActi
* 设置距离顶部距离
*/
protected void setStatusHeightParams(View llContent) {
RelativeLayout.LayoutParams closeLayoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
closeLayoutParams.topMargin = ConvertUtils.dp2px(8) + BarUtils.getStatusBarHeight();
// closeLayoutParams.topMargin = BarUtils.getStatusBarHeight();
llContent.setLayoutParams(closeLayoutParams);
// RelativeLayout.LayoutParams closeLayoutParams = new RelativeLayout.LayoutParams(ViewGroup.LayoutParams.MATCH_PARENT, ViewGroup.LayoutParams.WRAP_CONTENT);
// closeLayoutParams.topMargin = ConvertUtils.dp2px(8) + BarUtils.getStatusBarHeight();
//// closeLayoutParams.topMargin = BarUtils.getStatusBarHeight();
// llContent.setLayoutParams(closeLayoutParams);
llContent.setPadding(0, BarUtils.getStatusBarHeight(), 0, 0);
}
protected abstract void initView(Bundle savedInstanceState);