tab运单列表

This commit is contained in:
lijia 2024-03-06 10:19:12 +08:00
parent b04c49c22e
commit 8205238697
49 changed files with 2636 additions and 544 deletions

View File

@ -138,4 +138,8 @@ dependencies {
//
implementation 'com.amap.api:map2d:6.0.0'
//
implementation 'com.amap.api:location:6.4.2'//6.4.2
implementation 'com.amap.api:search:9.7.0'
}

View File

@ -25,6 +25,7 @@
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.VIBRATE" />
<uses-permission android:name="android.permission.CALL_PHONE" />
<!-- Android 13版本适配细化存储权限-->
<uses-permission android:name="android.permission.READ_MEDIA_IMAGES" />

View File

@ -3,10 +3,14 @@ package com.dahe.gldriver.adapter
import android.content.Context
import android.view.ViewGroup
import android.widget.Button
import android.widget.ImageView
import com.chad.library.adapter4.BaseQuickAdapter
import com.chad.library.adapter4.viewholder.QuickViewHolder
import com.dahe.gldriver.R
import com.dahe.gldriver.utils.OrderUtils
import com.dahe.glex.bean.OrderBean
import com.dahe.glex.bean.WayBillBean
import com.dahe.mylibrary.utils.ImageLoader
/**
* @ClassName WaybillAdapter
@ -15,8 +19,39 @@ import com.dahe.glex.bean.WayBillBean
* @Description TODO
*/
class WaybillAdapter :
BaseQuickAdapter<WayBillBean, QuickViewHolder>() {
override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: WayBillBean?) {
BaseQuickAdapter<OrderBean, QuickViewHolder>() {
override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: OrderBean?) {
item?.run {
holder.run {
setText(
R.id.tvStart,
"""${
if (loadingCity.length > 1) loadingCity.substring(0, 2) else loadingCity
} ${if (loadingArea.length > 1) loadingArea.substring(0, 2) else loadingArea}"""
)
setText(
R.id.tvEnd, """${
if (receiverCity.length > 1) receiverCity.substring(0, 2) else receiverCity
} ${
if (receiverArea.length > 1) receiverArea.substring(0, 2) else receiverArea
}"""
)
setText(R.id.tvMoney, driverFreight)
setText(R.id.tvCom, realCompanyName)
setText(R.id.tvDis, """距离:${distance}KM""")
setText(R.id.tvCredit, """信用 ${shipperCreditRating}""")
setText(
R.id.tvRate,
"""交易 ${shipperTransactionVolume} 好评率 ${shipperPositiveReviewRate}"""
)
setText(R.id.tvProduct, """${vehicleLength}/${vehicleType}/""")
setText(R.id.tvModel, """${if (orderType == "0") "一装一卸" else "一装多卸"}""")
setText(R.id.btnOk, OrderUtils.getInstance().getOrderStatu(orderStatus))
ImageLoader.getInstance()
.loadRoundImage(context, avatar, 6, getView<ImageView>(R.id.imgHead))
}
}
}

View File

@ -2,10 +2,13 @@ package com.dahe.gldriver.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.gldriver.R
import com.dahe.glex.bean.WayBillBean
import com.dahe.gldriver.utils.OrderUtils
import com.dahe.glex.bean.OrderBean
import com.dahe.mylibrary.utils.ImageLoader
/**
* @ClassName WaybillAdapter
@ -13,9 +16,42 @@ import com.dahe.glex.bean.WayBillBean
* @Date 2024/1/23 16:27
* @Description TODO
*/
class WaybillListAdapter() :
BaseQuickAdapter<WayBillBean, QuickViewHolder>() {
override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: WayBillBean?) {
class WaybillListAdapter :
BaseQuickAdapter<OrderBean, QuickViewHolder>() {
override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: OrderBean?) {
item?.let {
holder.run {
setText(R.id.tvWaybillId,it.orderNum)
setText(R.id.tvStatu,OrderUtils.getInstance().getOrderStatu(it.orderStatus))
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.tvGood,"""${it.goodItemGrossWeight}吨/${it.goodName}""")
setText(R.id.tvMoney,it.driverFreight)
setText(R.id.tvComName,it.realCompanyName)
setText(R.id.btnOk,OrderUtils.getInstance().getNextByStatu(it.orderStatus))
ImageLoader.getInstance()
.loadRoundImage(context, it.avatar, 6, getView<ImageView>(R.id.ivHead))
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 +60,7 @@ class WaybillListAdapter() :
viewType: Int
): QuickViewHolder {
// 返回一个 ViewHolder
return QuickViewHolder(R.layout.item_waybill, parent)
return QuickViewHolder(R.layout.item_waybill2, parent)
}
}

View File

@ -0,0 +1,44 @@
package com.dahe.gldriver.adapter
import android.content.Context
import android.view.ViewGroup
import android.widget.Button
import android.widget.ImageView
import com.chad.library.adapter4.BaseQuickAdapter
import com.chad.library.adapter4.viewholder.QuickViewHolder
import com.dahe.gldriver.R
import com.dahe.gldriver.bean.OrderChild
import com.dahe.gldriver.utils.OrderUtils
import com.dahe.glex.bean.OrderBean
import com.dahe.glex.bean.WayBillBean
import com.dahe.mylibrary.utils.ImageLoader
/**
* @ClassName WaybillAdapter
* @Author 用户
* @Date 2024/3/5 16:27
* @Description TODO
*/
class WaybillNodeAdapter :
BaseQuickAdapter<OrderChild, QuickViewHolder>() {
override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: OrderChild?) {
item?.run {
holder.run {
setText(R.id.tvLoad, item?.city+item?.area+item?.address)
setText(R.id.tvPhone, """${item?.name} ${item?.phone}""")
setBackgroundResource(R.id.ivLoad,if (item.type == "1") R.drawable.icon_load else R.drawable.icon_unload)
}
}
}
override fun onCreateViewHolder(
context: Context,
parent: ViewGroup,
viewType: Int
): QuickViewHolder {
// 返回一个 ViewHolder
return QuickViewHolder(R.layout.item_waybill_node, parent)
}
}

View File

@ -11,6 +11,9 @@ object AppConfig {
const val TIME = "DA_HE_TIME"
const val ID = "DA_HE_ID"
const val PHONE = "DA_HE_PHONE"
const val ORDER_ID = "DA_HE_ORDER_ID"
const val WAYBILL_ID = "DA_HE_WAYBILL_ID"
const val CHILDRE_ID = "DA_HE_CHILDRE_ID"
const val CODE = "DA_HE_PHONE"
const val SUCCESS_TYPE = "DA_HE_SUCCESS_TYPE"

View File

@ -7,35 +7,38 @@ package com.dahe.glex.bean
* @Description TODO
*/
data class OrderBean(
val avatar: String,
val distance: String,
val driverFreight: Double,
val goodsList: List<Goods>,
val loadingArea: String,
val loadingAreaCode: String,
val loadingCity: String,
val loadingCityCode: String,
val loadingDeadline: String,
val loadingProvince: String,
val loadingProvinceCode: String,
val orderId: String,
val orderNum: String,
val orderStatus: Int,
val orderType: String,
val passingPointsNum: String,
val realCompanyName: String,
val receiverArea: String,
val receiverAreaCode: String,
val receiverCity: String,
val receiverCityCode: String,
val receiverProvince: String,
val receiverProvinceCode: String,
val requirement: String,
val shipperCreditRating: String,
val shipperPositiveReviewRate: String,
val shipperTransactionVolume: String,
val vehicleLength: String,
val vehicleType: String
val avatar: String= "",
val distance: String= "",
val driverFreight: String= "",
val goodsList: List<Goods> = mutableListOf<Goods>(),
val loadingArea: String= "",
val loadingAreaCode: String= "",
val loadingCity: String= "",
val loadingCityCode: String= "",
val loadingDeadline: String= "",
val loadingProvince: String= "",
val loadingProvinceCode: String= "",
val orderId: String= "",
val orderNum: String= "",
val orderStatus: String= "",
val orderType: String= "",
val passingPointsNum: String= "",
val realCompanyName: String= "",
val receiverArea: String= "",
val receiverAreaCode: String= "",
val receiverCity: String= "",
val receiverCityCode: String= "",
val receiverProvince: String= "",
val receiverProvinceCode: String= "",
val requirement: String= "",
val shipperCreditRating: String= "",
val shipperPositiveReviewRate: String= "",
val shipperTransactionVolume: String= "",
val vehicleLength: String= "",
val vehicleType: String = "",
val goodItemGrossWeight: String = "",
val goodName: String = "",
val vehicleNum: String = ""
)
data class Goods(

View File

@ -0,0 +1,96 @@
package com.dahe.gldriver.bean
/**
* @ClassName OrderDetailBean
* @Author john
* @Date 2024/3/4 10:36
* @Description TODO
*/
data class OrderDetailBean(
val avatar: String,
val captainInfo: CaptainInfo,
val distance: String,
val driverFreight: String,
val goodsList: List<Goods>,
val loadingDeadline: String,
val orderChildList: List<OrderChild>,
val orderId: String,
val orderNum: String,
val orderStatus: String,
val orderType: String,
val passingPoStringsNum: String,
val realCompanyName: String,
val receiverBusinessCode: String,
val receiverBusinessName: String,
val receiverDeadline: String,
val requirement: String,
val shipperContactName: String,
val shipperContactPhone: String,
val vehicleLength: String,
val vehicleType: String,
val waybillId: String,
val waybillInfo: WaybillInfo
)
data class CaptainInfo(
val avatar: String,
val captainId: String,
val captainName: String,
val captaStringype: String,
val contactName: String,
val contactPhone: String,
val status: String
)
data class Goods(
val goodCube: String,
val goodItemGrossWeight: String,
val goodName: String,
val goodNum: String,
val orderGoodsId: String
)
data class OrderChild(
val address: String,
val area: String,
val areaCode: String,
val businessCode: String,
val businessName: String,
val city: String,
val cityCode: String,
val cost: String,
val displayOrder: String,
val isPassingPoStrings: String,
val latitude: String,
val longitude: String,
val name: String,
val orderChildreId: String,
val orderId: String,
val phone: String,
val province: String,
val provinceCityArea: String,
val provinceCode: String,
val sortValue: String,
val status: String,
val totalAmount: String,
val type: String
)
data class WaybillInfo(
val captainId: String,
val carId: String,
val carUrl: String,
val contactName: String,
val contactPhone: String,
val driverId: String,
val idcardName: String,
val idcardSex: String,
val isRealName: String,
val loadTime: String,
val receivingOrderTime: String,
val trailerId: String,
val trailerVehicleNum: String,
val unloadTime: String,
val vehicleNum: String,
val waybillId: String
)

View File

@ -0,0 +1,35 @@
package com.dahe.gldriver.bean
/**
* @ClassName UpPicBean
* @Author john
* @Date 2024/3/4 16:25
* @Description TODO
*/
data class UpPicBean(
var address: String = "",
var area: String= "",
var areaCode: String= "",
var city: String= "",
var cityCode: String= "",
var latitude: String= "",
var longitude: String= "",
var orderChildreId: String= "",
var orderId: String= "",
var province: String= "",
var provinceCityArea: String= "",
var provinceCode: String= "",
var type: String= "",
var waybillId: String= "",
var waybillPhotoList: MutableList<WaybillPhoto> = mutableListOf<WaybillPhoto>()
)
data class WaybillPhoto(
var latitude: String= "",
var location: String= "",
var longitude: String= "",
var photoUrl: String= "",
var receiptType: String= "",
var sortvarue: String= "",
var type: String= ""
)

View File

@ -0,0 +1,14 @@
package com.dahe.gldriver.callback
import com.dahe.gldriver.bean.OcrPersonBean
import com.luck.picture.lib.entity.LocalMedia
/**
* @ClassName OnOcrPicResultListener
* @Author john
* @Date 2024/2/28 17:18
* @Description TODO
*/
fun interface OnSearchListener {
fun onSearchClick(search: String)
}

View File

@ -0,0 +1,16 @@
package com.dahe.gldriver.event
/**
* @ClassName OrderStauEvent
* @Author john
* @Date 2024/3/5 15:51
* @Description statu: 1 刷新
*/
class OrderStauEvent constructor(statu: Int) {
var statu: Int = 0
init {
this.statu = statu
}
}

View File

@ -1,11 +1,14 @@
package com.dahe.gldriver.net
import com.dahe.gldriver.BuildConfig
import com.dahe.gldriver.bean.AuthTeamBean
import com.dahe.gldriver.bean.OcrPersonBean
import com.dahe.gldriver.bean.OrderDetailBean
import com.dahe.gldriver.bean.OssBean
import com.dahe.gldriver.bean.UpBankInfoBean
import com.dahe.gldriver.bean.UpDriverInfoBean
import com.dahe.gldriver.bean.UpPersonInfoBean
import com.dahe.gldriver.bean.UpPicBean
import com.dahe.gldriver.bean.UpQualiInfoBean
import com.dahe.glex.bean.*
import com.dahe.mylibrary.net.CommonResponseBean
@ -128,9 +131,47 @@ interface Api {
fun authenticationCaptain(@Body bankBean: AuthTeamBean): Observable<CommonResponseBean<String>>
/**
* 货源列表
* */
@GET(BASE_URL + "driver/order/list")
fun orderList(): Observable<CommonResponseBean<MutableList<OrderBean>>>
/**
* 运单列表
* */
@GET(BASE_URL + "driver/driverWaybill/selectMyWaybillList")
fun selectMyWaybillList(
@Query("pageNum") pageNum: Int = 1,
@Query("pageSize") pageSize: Int = 20,
@Query("waybillStatus") waybillStatus: String ="",
@Query("searchValue") searchValue: String = ""
): Observable<CommonResponseBean<MutableList<OrderBean>>>
/**
* 货源详情
* */
@GET(BASE_URL + "driver/order/detail")
fun orderDetail(@Query("orderId") orderId: String): Observable<CommonResponseBean<OrderDetailBean>>
/**
* 司机接单
* */
@GET(BASE_URL + "driver/driverWaybill/receivingOrders")
fun receivingOrders(
@Query("orderId") orderId: String,
@Query("carId") carId: String
): Observable<CommonResponseBean<String>>
/**
* 司机装卸货
* */
@POST(BASE_URL + "driver/driverWaybill/driverLoadOrUnload")
fun driverLoadOrUnload(
@Body upPicBean: UpPicBean
): Observable<CommonResponseBean<String>>
@GET(BASE_URL + "driver/driver/setUpDriverRole")
fun setUpDriverRole(@Query("role") role: String): Observable<CommonResponseBean<String>>

View File

@ -5,7 +5,10 @@ import android.os.Build
import android.os.Bundle
import android.widget.Toast
import androidx.fragment.app.Fragment
import androidx.fragment.app.FragmentStatePagerAdapter
import androidx.viewpager.widget.ViewPager
import com.amap.api.location.AMapLocationClient.updatePrivacyAgree
import com.amap.api.location.AMapLocationClient.updatePrivacyShow
import com.dahe.gldriver.R
import com.dahe.gldriver.adapter.MyHomePagerAdapter
import com.dahe.gldriver.bean.TabBean
@ -27,7 +30,7 @@ import java.util.TimerTask
* @Date 2023/12/27 17:12
* @Description TODO
*/
class HomeActivity: BaseActivity<ActivityHomeBinding>(), OnTabSelectListener,
class HomeActivity : BaseActivity<ActivityHomeBinding>(), OnTabSelectListener,
ViewPager.OnPageChangeListener {
private val mNormalRes = mutableListOf(
@ -44,24 +47,33 @@ class HomeActivity: BaseActivity<ActivityHomeBinding>(), OnTabSelectListener,
R.drawable.tab_waybill_press,
R.drawable.tab_mine_press
)
private var mTitles = arrayOf("首页","消息","运单","我的")
private var mTitles = arrayOf("首页", "消息", "运单", "我的")
private var mTabEntities = arrayListOf<CustomTabEntity>(
TabBean(mTitles[0],mSelectRes[0],mNormalRes[0]),
TabBean(mTitles[1],mSelectRes[1],mNormalRes[1]),
TabBean(mTitles[2],mSelectRes[2],mNormalRes[2]),
TabBean(mTitles[3],mSelectRes[3],mNormalRes[3]))
private var mFragments = arrayListOf<Fragment>(HomeFragment(),MessageFragment(), WaybillFragment(),MineFragment())
TabBean(mTitles[0], mSelectRes[0], mNormalRes[0]),
TabBean(mTitles[1], mSelectRes[1], mNormalRes[1]),
TabBean(mTitles[2], mSelectRes[2], mNormalRes[2]),
TabBean(mTitles[3], mSelectRes[3], mNormalRes[3])
)
private var mFragments = arrayListOf<Fragment>(HomeFragment().setListener {
binding.homeTabLayout.currentTab = it
binding.homeNoScrollViewPager.currentItem = it
}, MessageFragment(), WaybillFragment(), MineFragment())
override fun initView(savedInstanceState: Bundle?) {
updatePrivacyShow(mContext,true,true)
updatePrivacyAgree(mContext,true)
binding.homeTabLayout.run {
setTabData(mTabEntities)
setOnTabSelectListener(this@HomeActivity)
currentTab=0
currentTab = 0
}
binding.homeNoScrollViewPager.run {
adapter = MyHomePagerAdapter(this@HomeActivity.supportFragmentManager, mTitles, mFragments)
adapter =
MyHomePagerAdapter(this@HomeActivity.supportFragmentManager, mTitles, mFragments)
addOnPageChangeListener(this@HomeActivity)
offscreenPageLimit = 3
}
@ -78,12 +90,18 @@ class HomeActivity: BaseActivity<ActivityHomeBinding>(), OnTabSelectListener,
private fun getPermissions() {
PermissionX.init(this)
.permissions(
Manifest.permission.CAMERA)
Manifest.permission.CAMERA,
Manifest.permission.ACCESS_FINE_LOCATION,
)
.request { allGranted, grantedList, deniedList ->
if (allGranted) {
} else {
Toast.makeText(mContext, "开启权限失败,请在应用设置-权限-定位-始终允许", Toast.LENGTH_SHORT).show()
Toast.makeText(
mContext,
"开启权限失败,请在应用设置-权限-定位-始终允许",
Toast.LENGTH_SHORT
).show()
}
}
}
@ -106,6 +124,14 @@ class HomeActivity: BaseActivity<ActivityHomeBinding>(), OnTabSelectListener,
}
}
// fun getFragment(){
// var adapter : MyHomePagerAdapter = binding.homeNoScrollViewPager.adapter as MyHomePagerAdapter
//
// adapter.instantiateItem(binding.homeNoScrollViewPager,0)
// }
override fun onTabSelect(position: Int) {
binding.homeNoScrollViewPager.setCurrentItem(position)
}

View File

@ -1,34 +1,36 @@
package com.dahe.gldriver.ui.home
import android.graphics.Color
import android.os.Bundle
import android.widget.LinearLayout
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.chad.library.adapter4.BaseQuickAdapter
import com.amap.api.services.route.DistanceSearch
import com.dahe.gldriver.R
import com.dahe.gldriver.adapter.GridItemAdapter
import com.dahe.gldriver.adapter.WaybillAdapter
import com.dahe.gldriver.bean.AuthTeamBean
import com.dahe.gldriver.base.AppConfig
import com.dahe.gldriver.bean.GridBean
import com.dahe.gldriver.databinding.FragmentHomeBinding
import com.dahe.gldriver.event.OrderStauEvent
import com.dahe.gldriver.net.BaseObserver
import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.ui.HomeActivity
import com.dahe.gldriver.ui.waybill.activity.WaybillDetailActivity
import com.dahe.gldriver.ui.waybill.activity.WaybillLoadActivity
import com.dahe.gldriver.ui.waybill.activity.WaybillUnlLoadActivity
import com.dahe.glex.bean.OrderBean
import com.dahe.glex.bean.WayBillBean
import com.dahe.mylibrary.base.BaseFragment
import com.dahe.mylibrary.callback.RefreshCallBack
import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
import com.dahe.mylibrary.utils.ActivityUtils
import com.dahe.mylibrary.utils.ConvertUtils
import com.dahe.mylibrary.utils.ToastUtils
import com.flyco.tablayout.listener.OnTabSelectListener
import com.flyco.tablayout.CommonTabLayout
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
import okhttp3.internal.wait
import org.greenrobot.eventbus.EventBus
import org.greenrobot.eventbus.Subscribe
/**
* @ClassName HomeFragment
@ -37,6 +39,9 @@ import okhttp3.internal.wait
* @Description TODO
*/
class HomeFragment : BaseFragment<FragmentHomeBinding>(), RefreshCallBack {
var adapter: WaybillAdapter? = null
private val gridDatas = mutableListOf(
GridBean("司机之家", R.drawable.home_driver),
GridBean("咨询客服", R.drawable.home_ask),
@ -50,50 +55,75 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(), RefreshCallBack {
}
lateinit var mListener: ((Int) -> Unit)
fun setListener(listener: (Int) -> Unit): HomeFragment {
this.mListener = listener
return this
}
override fun onFragmentFirstVisible() {
initRecy()
binding.gridView.run {
adapter = activity?.let { GridItemAdapter(it, gridDatas) }
setOnItemClickListener { adapterView, view, i, l ->
// println(i)
setRefresh(binding.refresh, this)
binding.run {
gridView.run {
adapter = activity?.let { GridItemAdapter(it, gridDatas) }
setOnItemClickListener { adapterView, view, i, l ->
}
}
tvMar.isSelected = true
ivMyWaybill.setOnClickListener {
if (this@HomeFragment.mListener != null)
this@HomeFragment?.mListener?.invoke(2)
}
}
binding.tvMar.isSelected = true
DataManager.getInstance().orderList()
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext,object : RxHttpCallBack<MutableList<OrderBean>>(){
override fun onSuccess(t: CommonResponseBean<MutableList<OrderBean>>) {
super.onSuccess(t)
}
}))
initData()
}
override fun getRefreshDate(stat: Int, page: Int, count: Int) {
initData()
}
private fun initData() {
DataManager.getInstance().orderList()
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<MutableList<OrderBean>>() {
override fun onSuccess(t: CommonResponseBean<MutableList<OrderBean>>) {
super.onSuccess(t)
if (mRefreshPage === 1) {
adapter?.submitList(t.data)
} else {
adapter?.addAll(t.data)
}
setFinishRefresh(
binding.refresh,
t.total > mRefreshPage * mRefreshCount
)
}
}))
}
@Subscribe
fun eventStatu(orderStauEvent: OrderStauEvent) {
if (orderStauEvent.statu == 1) {
initData()
}
}
private fun initRecy() {
var datas = mutableListOf<WayBillBean>(
WayBillBean(),
WayBillBean(),
WayBillBean(),
WayBillBean(),
WayBillBean(),
WayBillBean(),
WayBillBean(),
WayBillBean()
)
var adapter = binding.recyclerView.run {
adapter = binding.recyclerView.run {
layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
setHasFixedSize(true)
addItemDecoration(
RecycleViewDivider(
LinearLayout.VERTICAL,
ConvertUtils.dp2px(16.0f),
ConvertUtils.dp2px(10.0f),
Color.TRANSPARENT
)
)
@ -101,14 +131,36 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(), RefreshCallBack {
adapter as WaybillAdapter
}.apply {
setOnItemClickListener { _, _, position ->
ToastUtils.showToast(mContext, position.toString())
ActivityUtils.startActivity(
mContext,
WaybillDetailActivity::class.java,
Bundle().apply { putString(AppConfig.ORDER_ID, items[position].orderId) })
// ActivityUtils.startActivity(
// mContext,
// WaybillDetailActivity::class.java,
// Bundle().apply { putString(AppConfig.ORDER_ID, items[position].orderId) })
}
addOnItemChildClickListener(R.id.btnOk) { adapter, view, position ->
ActivityUtils.startActivity(mContext, WaybillDetailActivity::class.java)
ActivityUtils.startActivity(
mContext,
WaybillDetailActivity::class.java,
Bundle().apply { putString(AppConfig.ORDER_ID, items[position].orderId) })
// ActivityUtils.startActivity(mContext, WaybillDetailActivity::class.java)
}
}
adapter.submitList(datas)
}
override fun onStart() {
super.onStart()
EventBus.getDefault().register(this);
}
override fun onStop() {
super.onStop()
EventBus.getDefault().unregister(this);
}
}

View File

@ -2,10 +2,17 @@ package com.dahe.gldriver.ui.waybill
import android.content.Context
import android.graphics.Color
import android.view.View
import androidx.core.widget.addTextChangedListener
import androidx.fragment.app.Fragment
import com.dahe.gldriver.R
import com.dahe.gldriver.callback.OnSearchListener
import com.dahe.gldriver.databinding.FragmentWaybillBinding
import com.dahe.gldriver.ui.waybill.fragment.AllWaybillFragment
import com.dahe.gldriver.ui.waybill.fragment.CancelWaybillFragment
import com.dahe.gldriver.ui.waybill.fragment.WaitAppraiseFragment
import com.dahe.gldriver.ui.waybill.fragment.WaitLoadFragment
import com.dahe.gldriver.ui.waybill.fragment.WaitUnLoadFragment
import com.dahe.mylibrary.base.BaseFragment
import com.dahe.mylibrary.callback.RefreshCallBack
import net.lucode.hackware.magicindicator.FragmentContainerHelper
@ -26,8 +33,17 @@ 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(),
WaitAppraiseFragment(),
CancelWaybillFragment()
)
val titles = mutableListOf(
"全部",
"待装货",
@ -45,10 +61,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
}
ivCancel.setOnClickListener {
etSearch.setText("")
}
btnSearch.setOnClickListener {
val search = etSearch.text.trim().toString()
when (currIndex) {
0 -> (mFragments[currIndex] as AllWaybillFragment).onSearchClick(search)
1 -> (mFragments[currIndex] as WaitLoadFragment).onSearchClick(search)
2 -> (mFragments[currIndex] as WaitUnLoadFragment).onSearchClick(search)
3 -> (mFragments[currIndex] as WaitAppraiseFragment).onSearchClick(search)
4 -> (mFragments[currIndex] as CancelWaybillFragment).onSearchClick(search)
}
mFragmentContainerHelper.handlePageSelected(0,true)
switchPages(0)
}
}
mFragmentContainerHelper.handlePageSelected(currIndex, true)
switchPages(currIndex)
var commonNavigator = CommonNavigator(mContext)
commonNavigator.run {
@ -88,7 +125,6 @@ class WaybillFragment : BaseFragment<FragmentWaybillBinding>(), RefreshCallBack
binding.magicIndicator.navigator = commonNavigator
mFragmentContainerHelper.attachMagicIndicator(binding.magicIndicator)
// ViewPagerHelper.bind(binding.magicIndicator, binding.viewPager);
}
@ -99,7 +135,9 @@ class WaybillFragment : BaseFragment<FragmentWaybillBinding>(), RefreshCallBack
private fun initRecy() {
}
private fun switchPages(index: Int) {
currIndex = index
val fragmentManager = requireActivity().supportFragmentManager
val fragmentTransaction = fragmentManager.beginTransaction()
var fragment: Fragment

View File

@ -1,13 +1,39 @@
package com.dahe.gldriver.ui.waybill.activity
import android.Manifest
import android.app.usage.UsageEvents.Event
import android.graphics.Color
import android.os.Bundle
import android.widget.LinearLayout
import android.widget.Toast
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.amap.api.maps2d.model.LatLng
import com.dahe.gldriver.R
import com.dahe.gldriver.adapter.WaybillAdapter
import com.dahe.gldriver.adapter.WaybillNodeAdapter
import com.dahe.gldriver.base.AppConfig
import com.dahe.gldriver.bean.OrderDetailBean
import com.dahe.gldriver.databinding.ActivityWaybillDetailBinding
import com.dahe.gldriver.event.OrderStauEvent
import com.dahe.gldriver.net.BaseObserver
import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.utils.GDLocationUtils
import com.dahe.gldriver.utils.LocationUtils
import com.dahe.glex.bean.OrderBean
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.LoadingUtils
import com.dahe.mylibrary.utils.SelectPicUtils
import com.permissionx.guolindev.PermissionX
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
import org.greenrobot.eventbus.EventBus
/**
* @ClassName WaybillDetailActivity
@ -15,14 +41,186 @@ import com.dahe.mylibrary.utils.SelectPicUtils
* @Date 2024/1/26 14:50
* @Description 运单详情-接单
*/
class WaybillDetailActivity :BaseActivity<ActivityWaybillDetailBinding>(){
class WaybillDetailActivity : BaseActivity<ActivityWaybillDetailBinding>() {
var orderId: String = ""
lateinit var gdLatLng: LatLng
lateinit var loadPos: LatLng
override fun initView(savedInstanceState: Bundle?) {
binding.btnReceiving.setOnClickListener {
ActivityUtils.startActivity(mContext,WaybillSuccActivity::class.java,Bundle().apply { putInt(AppConfig.SUCCESS_TYPE,0) })
orderId = intent.extras?.getString(AppConfig.ORDER_ID, "").toString()
initRecy()
getLocation()
binding.btnCall.setOnClickListener {
BaseUtils.callPhone(this@WaybillDetailActivity, "15838201105")
}
binding.btnReceiving.setOnClickListener {
DataManager.getInstance().receivingOrders(orderId, "22")
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<String>() {
override fun onSuccess(t: CommonResponseBean<String>) {
super.onSuccess(t)
EventBus.getDefault().post(OrderStauEvent(1))
}
}))
}
}
override fun initDate() {
// SelectPicUtils().getInstance(mContext)
DataManager.getInstance().orderDetail(orderId)
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<OrderDetailBean>() {
override fun onSuccess(t: CommonResponseBean<OrderDetailBean>) {
super.onSuccess(t)
val load = t.data.orderChildList.first { it.type == "1" }
var distance: String = ""
loadPos = LatLng(load.latitude.toDouble(), load.longitude.toDouble())
if (::gdLatLng.isInitialized) {
distance = LocationUtils.getInstance().getDistance(
gdLatLng,
loadPos
) + "km"
}
var goods =
t.data.goodsList.map { """${it.goodName},${it.goodItemGrossWeight}吨,${if (it.goodCube.isNullOrEmpty()) "" else it.goodCube + "方"}""" }
.reduce { acc, s -> """${acc}
|${s}""".trimMargin() }
binding.run {
tvTime.text = t.data.receiverDeadline
tvCom.text = t.data.receiverBusinessName
tvUnloadDis.text = t.data.distance+"km"
tvCarType.text = """${t.data.vehicleLength} ${t.data.vehicleType}"""
if (!t.data.requirement.isNullOrEmpty()) tvRemark.text = t.data.requirement
if (!distance.isNullOrEmpty()) tvLoadDis.text = distance
tvConsignor.text = t.data.realCompanyName
tvType.text = if (t.data.orderType == "0") "一装一卸" else "一装多卸"
tvFreight.text = t.data.driverFreight.toString()
tvGoods.text = goods
btnCall.setOnClickListener {
PermissionX.init(this@WaybillDetailActivity)
.permissions(Manifest.permission.CALL_PHONE)
.request { allGranted, grantedList, deniedList ->
if (allGranted) {
BaseUtils.callPhone(
this@WaybillDetailActivity,
t.data.shipperContactPhone
)
} else {
Toast.makeText(
mContext,
"开启权限失败,请在应用设置-权限中打开电话权限",
Toast.LENGTH_SHORT
).show()
}
}
}
}
adapter?.submitList(t.data.orderChildList)
// initXml(t.data)
}
}))
}
fun getLocation() {
GDLocationUtils.instance.getLocation(this@WaybillDetailActivity) {
//errCode等于0代表定位成功其他的为定位失败具体的可以参照官网定位错误码说明
runOnUiThread {
LoadingUtils.instance.dissLoading()
if (it.getErrorCode() == 0) {
it.getLongitude()//经 度
it.getLatitude()//纬 度
gdLatLng = LatLng(it.latitude, it.longitude)
if (::loadPos.isInitialized) {
var distance = LocationUtils.getInstance().getDistance(
gdLatLng,
loadPos
) + "km"
binding.tvLoadDis.text = distance
}
} else {
showToast("定位失败,请检查定位权限是否开启")
}
}
}
}
// private fun initXml(data: OrderDetailBean) {
// val load = data.orderChildList.find { it.type == "1" }
// val unLoad = data.orderChildList.find { it.type == "2" }
//
// binding.run {
// tvTime.text = data.receiverDeadline
// tvType.text = if (data.orderType == "0") "一装一卸" else "一装多卸"
// tvLoad.text = load?.address
// tvPhone.text = """${load?.name} ${load?.phone}"""
//
// tvUnload.text = unLoad?.address
// tvUnloadPhone.text = """${unLoad?.name} ${unLoad?.phone}"""
//
//
// tvCom.text = data?.receiverBusinessName
// tvConsignor.text = data?.realCompanyName
// tvFreight.text = data?.driverFreight.toString()
//
//
//
//
//
// btnCall.setOnClickListener {
//
// PermissionX.init(this@WaybillDetailActivity)
// .permissions(Manifest.permission.CALL_PHONE)
// .request { allGranted, grantedList, deniedList ->
// if (allGranted) {
// BaseUtils.callPhone(
// this@WaybillDetailActivity,
// data.shipperContactPhone
// )
// } else {
// Toast.makeText(
// mContext,
// "开启权限失败,请在应用设置-权限中打开电话权限",
// Toast.LENGTH_SHORT
// ).show()
// }
// }
//
// }
// }
// }
var adapter: WaybillNodeAdapter? = null
private fun initRecy() {
adapter = binding.recycler.run {
layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
setHasFixedSize(true)
addItemDecoration(
RecycleViewDivider(
LinearLayout.VERTICAL,
ConvertUtils.dp2px(16.0f),
Color.TRANSPARENT
)
)
adapter = WaybillNodeAdapter()
adapter as WaybillNodeAdapter
}.apply {
setOnItemClickListener { _, _, position ->
ActivityUtils.startActivity(
mContext,
WaybillLoadActivity::class.java,
Bundle().apply { putString(AppConfig.ORDER_ID, items[position].orderId) })
}
addOnItemChildClickListener(R.id.btnOk) { adapter, view, position ->
ActivityUtils.startActivity(mContext, WaybillDetailActivity::class.java)
}
}
}
}

View File

@ -1,13 +1,33 @@
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
import androidx.recyclerview.widget.RecyclerView
import com.amap.api.maps2d.AMap
import com.dahe.gldriver.R
import com.dahe.gldriver.adapter.WaybillNodeAdapter
import com.dahe.gldriver.base.AppConfig
import com.dahe.gldriver.bean.OrderDetailBean
import com.dahe.gldriver.databinding.ActivityWaybillLoadBinding
import com.dahe.gldriver.net.BaseObserver
import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.utils.GDLocationUtils
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.ToastUtils
import com.permissionx.guolindev.PermissionX
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
/**
@ -19,26 +39,82 @@ import com.dahe.mylibrary.utils.ToastUtils
class WaybillLoadActivity : BaseActivity<ActivityWaybillLoadBinding>() {
var aMap: AMap? = null
var orderId: String = ""
var waybillId: String = ""
lateinit var orderBean: OrderDetailBean
override fun initView(savedInstanceState: Bundle?) {
setTitleBar("运单详情", View.OnClickListener { finish() }, true, "查看单据") {
ToastUtils.showToast(mContext, "查看单据")
}
orderId = intent.extras?.getString(AppConfig.ORDER_ID,"").toString()
initRecy()
binding.run {
mapView.onCreate(savedInstanceState)
if (aMap == null) mapView.map
btnRight.setOnClickListener {
var data = orderBean.orderChildList.first { it.type == "1" }
ActivityUtils.startActivity(
mContext,
WaybillUpPicActivity::class.java,
Bundle().apply { putInt(AppConfig.SUCCESS_TYPE, 1) })
Bundle().apply {
putInt(AppConfig.SUCCESS_TYPE, 1)
putString(AppConfig.ORDER_ID,orderId)
putString(AppConfig.WAYBILL_ID,orderBean.waybillId)
putString(AppConfig.CHILDRE_ID,data.orderChildreId)
})
}
}
}
override fun initDate() {
DataManager.getInstance().orderDetail(orderId)
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<OrderDetailBean>() {
override fun onSuccess(t: CommonResponseBean<OrderDetailBean>) {
super.onSuccess(t)
orderBean = t.data
binding.run {
tvTime.text = orderBean.receiverDeadline
tvType.text = if (orderBean.orderType == "0") "一装一卸" else "一装多卸"
tvCom.text = orderBean?.receiverBusinessName
tvFreight.text = orderBean?.driverFreight.toString()
btnLeft.setOnClickListener {
PermissionX.init(this@WaybillLoadActivity)
.permissions(Manifest.permission.CALL_PHONE)
.request { allGranted, grantedList, deniedList ->
if (allGranted) {
BaseUtils.callPhone(
this@WaybillLoadActivity,
orderBean.shipperContactPhone
)
} else {
Toast.makeText(
mContext,
"开启权限失败,请在应用设置-权限中打开电话权限",
Toast.LENGTH_SHORT
).show()
}
}
}
}
adapter?.submitList(t.data.orderChildList)
// initXml(t.data)
}
}))
}
override fun onResume() {
@ -62,4 +138,32 @@ class WaybillLoadActivity : BaseActivity<ActivityWaybillLoadBinding>() {
super.onDestroy()
}
var adapter: WaybillNodeAdapter? = null
private fun initRecy() {
adapter = binding.recycler.run {
layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
setHasFixedSize(true)
addItemDecoration(
RecycleViewDivider(
LinearLayout.VERTICAL,
ConvertUtils.dp2px(16.0f),
Color.TRANSPARENT
)
)
adapter = WaybillNodeAdapter()
adapter as WaybillNodeAdapter
}.apply {
setOnItemClickListener { _, _, position ->
ActivityUtils.startActivity(
mContext,
WaybillLoadActivity::class.java,
Bundle().apply { putString(AppConfig.ORDER_ID, items[position].orderId) })
}
addOnItemChildClickListener(R.id.btnOk) { adapter, view, position ->
ActivityUtils.startActivity(mContext, WaybillDetailActivity::class.java)
}
}
}
}

View File

@ -1,15 +1,33 @@
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
import androidx.recyclerview.widget.RecyclerView
import com.amap.api.maps2d.AMap
import com.dahe.gldriver.R
import com.dahe.gldriver.adapter.WaybillNodeAdapter
import com.dahe.gldriver.base.AppConfig
import com.dahe.gldriver.bean.OrderDetailBean
import com.dahe.gldriver.databinding.ActivityWaybillLoadBinding
import com.dahe.gldriver.databinding.ActivityWaybillUnloadBinding
import com.dahe.gldriver.net.BaseObserver
import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack
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.ToastUtils
import com.permissionx.guolindev.PermissionX
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
/**
* @ClassName WaybillLoadActivity
@ -20,26 +38,107 @@ import com.dahe.mylibrary.utils.ToastUtils
class WaybillUnlLoadActivity : BaseActivity<ActivityWaybillUnloadBinding>() {
var aMap: AMap? = null
var orderId: String = ""
var waybillId: String = ""
lateinit var orderBean: OrderDetailBean
override fun initView(savedInstanceState: Bundle?) {
setTitleBar("运单详情", { finish() }, true, "查看单据") {
ToastUtils.showToast(mContext, "查看单据")
}
orderId = intent.extras?.getString(AppConfig.ORDER_ID, "").toString()
initRecy()
binding.run {
mapView.onCreate(savedInstanceState)
if (aMap == null) mapView.map
btnRight.setOnClickListener {
var data = orderBean.orderChildList.first { it.type == "2" }
ActivityUtils.startActivity(
mContext,
WaybillUpPicActivity::class.java,
Bundle().apply { putInt(AppConfig.SUCCESS_TYPE, 2) })
Bundle().apply {
putInt(AppConfig.SUCCESS_TYPE, 2)
putString(AppConfig.ORDER_ID, orderId)
putString(AppConfig.WAYBILL_ID, orderBean.waybillId)
putString(AppConfig.CHILDRE_ID, data.orderChildreId)
})
}
}
}
override fun initDate() {
DataManager.getInstance().orderDetail(orderId)
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<OrderDetailBean>() {
override fun onSuccess(t: CommonResponseBean<OrderDetailBean>) {
super.onSuccess(t)
orderBean = t.data
binding.run {
tvTime.text = orderBean.receiverDeadline
tvType.text = if (orderBean.orderType == "0") "一装一卸" else "一装多卸"
tvCom.text = orderBean?.receiverBusinessName
tvFreight.text = orderBean?.driverFreight.toString()
btnLeft.setOnClickListener {
PermissionX.init(this@WaybillUnlLoadActivity)
.permissions(Manifest.permission.CALL_PHONE)
.request { allGranted, grantedList, deniedList ->
if (allGranted) {
BaseUtils.callPhone(
this@WaybillUnlLoadActivity,
orderBean.shipperContactPhone
)
} else {
Toast.makeText(
mContext,
"开启权限失败,请在应用设置-权限中打开电话权限",
Toast.LENGTH_SHORT
).show()
}
}
}
}
adapter?.submitList(t.data.orderChildList)
// initXml(t.data)
}
}))
}
var adapter: WaybillNodeAdapter? = null
private fun initRecy() {
adapter = binding.recycler.run {
layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
setHasFixedSize(true)
addItemDecoration(
RecycleViewDivider(
LinearLayout.VERTICAL,
ConvertUtils.dp2px(16.0f),
Color.TRANSPARENT
)
)
adapter = WaybillNodeAdapter()
adapter as WaybillNodeAdapter
}.apply {
setOnItemClickListener { _, _, position ->
ActivityUtils.startActivity(
mContext,
WaybillLoadActivity::class.java,
Bundle().apply { putString(AppConfig.ORDER_ID, items[position].orderId) })
}
addOnItemChildClickListener(R.id.btnOk) { adapter, view, position ->
ActivityUtils.startActivity(mContext, WaybillDetailActivity::class.java)
}
}
}
@ -65,4 +164,5 @@ class WaybillUnlLoadActivity : BaseActivity<ActivityWaybillUnloadBinding>() {
}
}

View File

@ -3,19 +3,31 @@ package com.dahe.gldriver.ui.waybill.activity
import android.os.Bundle
import android.view.View
import androidx.recyclerview.widget.GridLayoutManager
import com.amap.api.maps2d.model.LatLng
import com.dahe.gldriver.base.AppConfig
import com.dahe.gldriver.bean.UpPicBean
import com.dahe.gldriver.bean.WaybillPhoto
import com.dahe.gldriver.databinding.ActivityWaybillUppicBinding
import com.dahe.gldriver.net.BaseObserver
import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.oss.OssServiceUtil
import com.dahe.gldriver.utils.GDLocationUtils
import com.dahe.mylibrary.adapter.GridImageAdapter
import com.dahe.mylibrary.adapter.GridImageAdapter.OnItemClickListener
import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.callback.OnPicResultListener
import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.utils.ActivityUtils
import com.dahe.mylibrary.utils.LoadingUtils
import com.dahe.mylibrary.utils.PopsUtils
import com.dahe.mylibrary.utils.ToastUtils
import com.dahe.mylibrary.weight.FullyGridLayoutManager
import com.luck.picture.lib.decoration.GridSpacingItemDecoration
import com.luck.picture.lib.entity.LocalMedia
import com.luck.picture.lib.utils.DensityUtil
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
/**
* @ClassName WaybillUpPicActivity
@ -24,8 +36,25 @@ import com.luck.picture.lib.utils.DensityUtil
* @Description 上传照片装卸货以及回单照片
*/
class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
lateinit var upBean: UpPicBean//提交对象
lateinit var picBean: WaybillPhoto//照片对象
var orderId: String = ""
var waybillId: String = ""
var childreId: String = ""
lateinit var latLng: LatLng
override fun initView(savedInstanceState: Bundle?) {
var type = intent.extras?.getInt(AppConfig.SUCCESS_TYPE, 0)
upBean = UpPicBean()
var type = intent.extras?.run {
orderId = getString(AppConfig.ORDER_ID, "")
waybillId = getString(AppConfig.WAYBILL_ID, "")
childreId = getString(AppConfig.CHILDRE_ID, "")
getInt(AppConfig.SUCCESS_TYPE, 0)
}
if (1 == type) {
binding.run {
tvTitle.text = "装货"
@ -34,17 +63,131 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
}
}
binding.btnUnload.setOnClickListener {
if (1 == type) {
ActivityUtils.startActivity(
mContext,
WaybillSuccActivity::class.java,
Bundle().apply { putInt(AppConfig.SUCCESS_TYPE, 1) })
} else {
ActivityUtils.startActivity(
mContext,
WaybillSuccActivity::class.java,
Bundle().apply { putInt(AppConfig.SUCCESS_TYPE, 2) })
binding.run {
tvPosi.setOnClickListener {
getLocation()
}
recyclerView.run {
layoutManager =
FullyGridLayoutManager(mContext, 4, GridLayoutManager.VERTICAL, false)
addItemDecoration(
GridSpacingItemDecoration(
4,
DensityUtil.dip2px(mContext, 8f), false
)
)
var myAdapter = GridImageAdapter(mContext, mData)
myAdapter.setOnItemClickListener(object : OnItemClickListener {
override fun onItemClick(v: View?, position: Int) {
}
override fun openPicture() {
PopsUtils.getInstance().showSelPic(mContext, myAdapter) {
OssServiceUtil.getInstance().run {
asyncPutImage(it[0].realPath, this@WaybillUpPicActivity)
setResultCallBack { data, oldPath ->
picBean = WaybillPhoto()
picBean.run {
photoUrl = oldPath
this.type = if (type == 1) "1" else "2"
}
upBean.waybillPhotoList.add(picBean)
}
}
myAdapter.data.addAll(it)
myAdapter.notifyDataSetChanged()
}
}
})
adapter = myAdapter
}
//回单处理
recyclerView2.run {
layoutManager =
FullyGridLayoutManager(mContext, 4, GridLayoutManager.VERTICAL, false)
addItemDecoration(
GridSpacingItemDecoration(
4,
DensityUtil.dip2px(mContext, 8f), false
)
)
var myAdapter = GridImageAdapter(mContext, mData)
myAdapter.setOnItemClickListener(object : OnItemClickListener {
override fun onItemClick(v: View?, position: Int) {
}
override fun openPicture() {
PopsUtils.getInstance().showSelPic(mContext, myAdapter) {
OssServiceUtil.getInstance().run {
asyncPutImage(it[0].realPath, this@WaybillUpPicActivity)
setResultCallBack { data, oldPath ->
picBean = WaybillPhoto()
picBean.run {
photoUrl = oldPath
receiptType = if (type == 1) "4" else if (type == 2) "5" else "6"
this.type = "3"
}
upBean.waybillPhotoList.add(picBean)
}
}
myAdapter.data.addAll(it)
myAdapter.notifyDataSetChanged()
}
}
})
adapter = myAdapter
}
btnUnload.setOnClickListener {
upBean.run {
orderId = this@WaybillUpPicActivity.orderId
waybillId = this@WaybillUpPicActivity.waybillId
latitude = latLng.latitude.toString()
longitude = latLng.longitude.toString()
orderChildreId = this@WaybillUpPicActivity.childreId
this.type = if (type == 1) "1" else "2"
}
DataManager.getInstance().driverLoadOrUnload(upBean)
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<String>() {
override fun onSuccess(t: CommonResponseBean<String>) {
super.onSuccess(t)
}
}))
if (1 == type) {
ActivityUtils.startActivity(
mContext,
WaybillSuccActivity::class.java,
Bundle().apply { putInt(AppConfig.SUCCESS_TYPE, 1) })
} else {
ActivityUtils.startActivity(
mContext,
WaybillSuccActivity::class.java,
Bundle().apply { putInt(AppConfig.SUCCESS_TYPE, 2) })
}
}
}
}
@ -52,44 +195,25 @@ class WaybillUpPicActivity : BaseActivity<ActivityWaybillUppicBinding>() {
private val mData: List<LocalMedia> = ArrayList()
override fun initDate() {
getLocation()
}
binding.recyclerView.run {
layoutManager = FullyGridLayoutManager(mContext, 4, GridLayoutManager.VERTICAL, false)
addItemDecoration(
GridSpacingItemDecoration(
4,
DensityUtil.dip2px(mContext, 8f), false
)
)
var myAdapter = GridImageAdapter(mContext, mData)
myAdapter.setOnItemClickListener(object : OnItemClickListener {
override fun onItemClick(v: View?, position: Int) {
fun getLocation() {
LoadingUtils.instance.showLoading(this,"定位中,请稍等...")
GDLocationUtils.instance.getLocation(this@WaybillUpPicActivity) {
//errCode等于0代表定位成功其他的为定位失败具体的可以参照官网定位错误码说明
runOnUiThread {
LoadingUtils.instance.dissLoading()
if (it.getErrorCode() == 0) {
it.getLongitude()//经 度
it.getLatitude()//纬 度
latLng = LatLng(it.latitude, it.longitude)
binding.tvLoca.text = it.address
} else {
showToast("定位失败,请检查定位权限是否开启")
}
override fun openPicture() {
PopsUtils.getInstance().showSelPic(mContext,myAdapter){
myAdapter.data.addAll(it)
myAdapter.notifyDataSetChanged()
}
// XPopup.Builder(mContext)
// .dismissOnTouchOutside(true)
// .asCustom(PopBottomPic(mContext, myAdapter, onPicResultListener = {
// ToastUtils.showToast(mContext, it.size.toString())
// myAdapter.data.addAll(it)
// myAdapter.notifyDataSetChanged()
// }))
// .show()
}
})
// setHasFixedSize(true)
adapter = myAdapter
}
}
}
}

View File

@ -1,12 +1,28 @@
package com.dahe.gldriver.ui.waybill.fragment
import android.content.Context
import android.graphics.Color
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.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.utils.OrderUtils
import com.dahe.glex.bean.OrderBean
import com.dahe.glex.bean.WayBillBean
import com.dahe.mylibrary.base.BaseFragment
import com.dahe.mylibrary.callback.RefreshCallBack
import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
import com.dahe.mylibrary.utils.ConvertUtils
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
/**
* @ClassName AllWaybillFragment
@ -14,30 +30,90 @@ import com.dahe.mylibrary.base.BaseFragment
* @Date 2024/1/24 14:06
* @Description TODO
*/
class AllWaybillFragment : BaseFragment<FragmentWaybillListBinding>() {
class AllWaybillFragment : BaseFragment<FragmentWaybillListBinding>(), RefreshCallBack, OnSearchListener {
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
binding.run {
setRefresh(refresh, this@AllWaybillFragment)
adapter = recyclerView.run {
layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
addItemDecoration(
RecycleViewDivider(
LinearLayout.VERTICAL,
ConvertUtils.dp2px(8.0f),
Color.TRANSPARENT
)
)
adapter = WaybillListAdapter()
// 打开空布局功能
(adapter as WaybillListAdapter).isStateViewEnable = true
adapter as WaybillListAdapter
}
}
adapter.submitList(datas)
initData()
}
override fun getRefreshDate(stat: Int, page: Int, count: Int) {
initData()
}
override fun onSearchClick(search: String) {
initData(search)
}
private fun initData(search: String = "") {
DataManager.getInstance()
.selectMyWaybillList(mRefreshPage, mRefreshCount, searchValue = search)
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<MutableList<OrderBean>>() {
override fun onSuccess(t: CommonResponseBean<MutableList<OrderBean>>) {
super.onSuccess(t)
if (mRefreshPage === 1) {
if (t.data.size == 0) {
adapter.submitList(null)
adapter.setStateViewLayout(mContext, R.layout.empty_view)
} else {
adapter?.submitList(t.data)
}
} else {
adapter?.addAll(t.data)
}
setFinishRefresh(
binding.refresh,
t.total > mRefreshPage * mRefreshCount
)
}
override fun onCodeError(
mContext: Context?,
t: CommonResponseBean<MutableList<OrderBean>>
) {
super.onCodeError(mContext, t)
setFinishRefresh(
binding.refresh,
true
)
mContext?.let { adapter.setStateViewLayout(it, R.layout.empty_view) }
}
override fun onFailure(mContext: Context?, e: Throwable) {
super.onFailure(mContext, e)
setFinishRefresh(
binding.refresh,
true
)
mContext?.let { adapter.setStateViewLayout(it, R.layout.empty_view) }
}
}))
}
}

View File

@ -0,0 +1,113 @@
package com.dahe.gldriver.ui.waybill.fragment
import android.content.Context
import android.graphics.Color
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.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.utils.OrderUtils
import com.dahe.glex.bean.OrderBean
import com.dahe.glex.bean.WayBillBean
import com.dahe.mylibrary.base.BaseFragment
import com.dahe.mylibrary.callback.RefreshCallBack
import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
import com.dahe.mylibrary.utils.ConvertUtils
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
/**
* @ClassName AllWaybillFragment
* @Author 用户
* @Date 2024/1/24 14:06
* @Description 取消运单
*/
class CancelWaybillFragment : BaseFragment<FragmentWaybillListBinding>(), RefreshCallBack ,
OnSearchListener {
lateinit var adapter: WaybillListAdapter
override fun onFragmentVisibleChange(isVisible: Boolean) {
}
override fun onFragmentFirstVisible() {
binding.run {
setRefresh(refresh, this@CancelWaybillFragment)
adapter = recyclerView.run {
layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
addItemDecoration(
RecycleViewDivider(
LinearLayout.VERTICAL,
ConvertUtils.dp2px(8.0f),
Color.TRANSPARENT
)
)
adapter = WaybillListAdapter()
// 打开空布局功能
(adapter as WaybillListAdapter).isStateViewEnable = true
adapter as WaybillListAdapter
}
}
initData()
}
override fun getRefreshDate(stat: Int, page: Int, count: Int) {
initData()
}
override fun onSearchClick(search: String) {
initData(search)
}
private fun initData(search: String = "") {
DataManager.getInstance().selectMyWaybillList(mRefreshPage, mRefreshCount, "103000",search)
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<MutableList<OrderBean>>() {
override fun onSuccess(t: CommonResponseBean<MutableList<OrderBean>>) {
super.onSuccess(t)
if (mRefreshPage === 1) {
if (t.data.size==0){
adapter.submitList(null)
adapter.setStateViewLayout(mContext, R.layout.empty_view)
}else{
adapter?.submitList(t.data)
}
} else {
adapter?.addAll(t.data)
}
setFinishRefresh(
binding.refresh,
t.total > mRefreshPage * mRefreshCount
)
}
override fun onCodeError(mContext: Context?, t: CommonResponseBean<MutableList<OrderBean>>) {
super.onCodeError(mContext, t)
setFinishRefresh(
binding.refresh,
true
)
mContext?.let { adapter.setStateViewLayout(it, R.layout.empty_view) }
}
override fun onFailure(mContext: Context?, e: Throwable) {
super.onFailure(mContext, e)
setFinishRefresh(
binding.refresh,
true
)
mContext?.let { adapter.setStateViewLayout(it, R.layout.empty_view) }
}
}))
}
}

View File

@ -0,0 +1,113 @@
package com.dahe.gldriver.ui.waybill.fragment
import android.content.Context
import android.graphics.Color
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.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.utils.OrderUtils
import com.dahe.glex.bean.OrderBean
import com.dahe.glex.bean.WayBillBean
import com.dahe.mylibrary.base.BaseFragment
import com.dahe.mylibrary.callback.RefreshCallBack
import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
import com.dahe.mylibrary.utils.ConvertUtils
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
/**
* @ClassName AllWaybillFragment
* @Author 用户
* @Date 2024/1/24 14:06
* @Description 待评价
*/
class WaitAppraiseFragment : BaseFragment<FragmentWaybillListBinding>() , RefreshCallBack ,
OnSearchListener {
lateinit var adapter: WaybillListAdapter
override fun onFragmentVisibleChange(isVisible: Boolean) {
}
override fun onFragmentFirstVisible() {
binding.run {
setRefresh(refresh, this@WaitAppraiseFragment)
adapter = recyclerView.run {
layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
addItemDecoration(
RecycleViewDivider(
LinearLayout.VERTICAL,
ConvertUtils.dp2px(8.0f),
Color.TRANSPARENT
)
)
adapter = WaybillListAdapter()
// 打开空布局功能
(adapter as WaybillListAdapter).isStateViewEnable = true
adapter as WaybillListAdapter
}
}
initData()
}
override fun getRefreshDate(stat: Int, page: Int, count: Int) {
initData()
}
override fun onSearchClick(search: String) {
initData(search)
}
private fun initData(search: String = "") {
DataManager.getInstance().selectMyWaybillList(mRefreshPage,mRefreshCount,"102080",search)
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<MutableList<OrderBean>>() {
override fun onSuccess(t: CommonResponseBean<MutableList<OrderBean>>) {
super.onSuccess(t)
if (mRefreshPage === 1) {
if (t.data.size==0){
adapter.submitList(null)
adapter.setStateViewLayout(mContext, R.layout.empty_view)
}else{
adapter?.submitList(t.data)
}
} else {
adapter?.addAll(t.data)
}
setFinishRefresh(
binding.refresh,
t.total > mRefreshPage * mRefreshCount
)
}
override fun onCodeError(mContext: Context?, t: CommonResponseBean<MutableList<OrderBean>>) {
super.onCodeError(mContext, t)
setFinishRefresh(
binding.refresh,
true
)
mContext?.let { adapter.setStateViewLayout(it, R.layout.empty_view) }
}
override fun onFailure(mContext: Context?, e: Throwable) {
super.onFailure(mContext, e)
setFinishRefresh(
binding.refresh,
true
)
mContext?.let { adapter.setStateViewLayout(it, R.layout.empty_view) }
}
}))
}
}

View File

@ -0,0 +1,113 @@
package com.dahe.gldriver.ui.waybill.fragment
import android.content.Context
import android.graphics.Color
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.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.utils.OrderUtils
import com.dahe.glex.bean.OrderBean
import com.dahe.glex.bean.WayBillBean
import com.dahe.mylibrary.base.BaseFragment
import com.dahe.mylibrary.callback.RefreshCallBack
import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
import com.dahe.mylibrary.utils.ConvertUtils
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
/**
* @ClassName AllWaybillFragment
* @Author 用户
* @Date 2024/1/24 14:06
* @Description 待装货
*/
class WaitLoadFragment : BaseFragment<FragmentWaybillListBinding>(), RefreshCallBack , OnSearchListener {
lateinit var adapter: WaybillListAdapter
override fun onFragmentVisibleChange(isVisible: Boolean) {
}
override fun onFragmentFirstVisible() {
binding.run {
setRefresh(refresh, this@WaitLoadFragment)
adapter = recyclerView.run {
layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
addItemDecoration(
RecycleViewDivider(
LinearLayout.VERTICAL,
ConvertUtils.dp2px(8.0f),
Color.TRANSPARENT
)
)
adapter = WaybillListAdapter()// 打开空布局功能
(adapter as WaybillListAdapter).isStateViewEnable = true
adapter as WaybillListAdapter
}
}
initData()
}
override fun getRefreshDate(stat: Int, page: Int, count: Int) {
initData()
}
override fun onSearchClick(search: String) {
initData(search)
}
private fun initData(search: String = "") {
DataManager.getInstance().selectMyWaybillList(mRefreshPage,mRefreshCount,"102040",search)
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<MutableList<OrderBean>>() {
override fun onSuccess(t: CommonResponseBean<MutableList<OrderBean>>) {
super.onSuccess(t)
if (mRefreshPage === 1) {
if (t.data.size==0){
adapter.submitList(null)
adapter.setStateViewLayout(mContext, R.layout.empty_view)
}else{
adapter?.submitList(t.data)
}
} else {
adapter?.addAll(t.data)
}
setFinishRefresh(
binding.refresh,
t.total > mRefreshPage * mRefreshCount
)
}
override fun onCodeError(mContext: Context?, t: CommonResponseBean<MutableList<OrderBean>>) {
super.onCodeError(mContext, t)
setFinishRefresh(
binding.refresh,
true
)
mContext?.let { adapter.setStateViewLayout(it, R.layout.empty_view) }
}
override fun onFailure(mContext: Context?, e: Throwable) {
super.onFailure(mContext, e)
setFinishRefresh(
binding.refresh,
true
)
mContext?.let { adapter.setStateViewLayout(it, R.layout.empty_view) }
}
}))
}
}

View File

@ -0,0 +1,116 @@
package com.dahe.gldriver.ui.waybill.fragment
import android.content.Context
import android.graphics.Color
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.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.utils.OrderUtils
import com.dahe.glex.bean.OrderBean
import com.dahe.glex.bean.WayBillBean
import com.dahe.mylibrary.base.BaseFragment
import com.dahe.mylibrary.callback.RefreshCallBack
import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
import com.dahe.mylibrary.utils.ConvertUtils
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
/**
* @ClassName AllWaybillFragment
* @Author 用户
* @Date 2024/1/24 14:06
* @Description 待卸货
*/
class WaitUnLoadFragment : BaseFragment<FragmentWaybillListBinding>(), RefreshCallBack ,
OnSearchListener {
lateinit var adapter: WaybillListAdapter
override fun onFragmentVisibleChange(isVisible: Boolean) {
}
override fun onFragmentFirstVisible() {
binding.run {
setRefresh(refresh, this@WaitUnLoadFragment)
adapter = recyclerView.run {
layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
addItemDecoration(
RecycleViewDivider(
LinearLayout.VERTICAL,
ConvertUtils.dp2px(8.0f),
Color.TRANSPARENT
)
)
adapter = WaybillListAdapter()
// 打开空布局功能
(adapter as WaybillListAdapter).isStateViewEnable = true
adapter as WaybillListAdapter
}
}
initData()
}
override fun getRefreshDate(stat: Int, page: Int, count: Int) {
initData()
}
override fun onSearchClick(search: String) {
initData(search)
}
private fun initData(search: String = "") {
DataManager.getInstance().selectMyWaybillList(mRefreshPage, mRefreshCount, "102050",search)
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<MutableList<OrderBean>>() {
override fun onSuccess(t: CommonResponseBean<MutableList<OrderBean>>) {
super.onSuccess(t)
if (mRefreshPage === 1) {
if (t.data.size==0){
adapter.submitList(null)
adapter.setStateViewLayout(mContext, R.layout.empty_view)
}else{
adapter?.submitList(t.data)
}
} else {
adapter?.addAll(t.data)
}
setFinishRefresh(
binding.refresh,
t.total > mRefreshPage * mRefreshCount
)
}
override fun onCodeError(
mContext: Context?,
t: CommonResponseBean<MutableList<OrderBean>>
) {
super.onCodeError(mContext, t)
setFinishRefresh(
binding.refresh,
true
)
mContext?.let { adapter.setStateViewLayout(it, R.layout.empty_view) }
}
override fun onFailure(mContext: Context?, e: Throwable) {
super.onFailure(mContext, e)
setFinishRefresh(
binding.refresh,
true
)
mContext?.let { adapter.setStateViewLayout(it, R.layout.empty_view) }
}
}))
}
}

View File

@ -0,0 +1,17 @@
package com.dahe.gldriver.utils
import com.dahe.mylibrary.base.SingletonNoPHolder
/**
* @ClassName CommonPopUtils
* @Author john
* @Date 2024/3/5 15:48
* @Description TODO
*/
class CommonPopUtils private constructor(){
companion object : SingletonNoPHolder<CommonPopUtils>(::CommonPopUtils)
}

View File

@ -0,0 +1,70 @@
package com.dahe.gldriver.utils
import android.content.Context
import com.amap.api.location.AMapLocationClient
import com.amap.api.location.AMapLocationClientOption
import com.amap.api.location.AMapLocationListener
class GDLocationUtils private constructor(){
//声明AMapLocationClient类对象
var mLocationClient : AMapLocationClient?= null;
//声明AMapLocationClientOption对象
var mLocationOption: AMapLocationClientOption? = null
companion object{
val instance = Holder.holder
}
object Holder {
val holder = GDLocationUtils()
}
fun getLocation(ctx : Context,mLocationListener : AMapLocationListener){
//初始化定位
mLocationClient = AMapLocationClient(ctx)
//设置定位回调监听
mLocationClient?.setLocationListener(mLocationListener)
//初始化AMapLocationClientOption对象
mLocationOption = AMapLocationClientOption()
/**
* 设置定位场景目前支持三种场景签到出行运动默认无场景
*/
mLocationOption?.setLocationPurpose(AMapLocationClientOption.AMapLocationPurpose.SignIn)
//设置定位模式为AMapLocationMode.Hight_Accuracy高精度模式。
mLocationOption?.setLocationMode(AMapLocationClientOption.AMapLocationMode.Hight_Accuracy)
// mLocationOption?.setLocationMode(AMapLocationClientOption.AMapLocationMode.Battery_Saving)
//获取一次定位结果:
//该方法默认为false。
mLocationOption?.setOnceLocation(true)
//获取最近3s内精度最高的一次定位结果
//设置setOnceLocationLatest(boolean b)接口为true启动定位时SDK会返回最近3s内精度最高的一次定位结果。如果设置其为truesetOnceLocation(boolean b)接口也会被设置为true反之不会默认为false。
mLocationOption?.setOnceLocationLatest(true)
//设置是否允许模拟位置,默认为true允许模拟位置
mLocationOption?.setMockEnable(true)
//给定位客户端对象设置定位参数
mLocationClient?.setLocationOption(mLocationOption);
if(null != mLocationClient){
mLocationClient?.setLocationOption(mLocationOption);
//设置场景模式后最好调用一次stop再调用start以保证场景模式生效
mLocationClient?.stopLocation()
mLocationClient?.startLocation()
}
}
fun stopLocation(){
if(null != mLocationClient){
mLocationClient?.stopLocation()
}
}
}

View File

@ -0,0 +1,67 @@
package com.dahe.gldriver.utils
import com.amap.api.maps2d.AMapException
import com.amap.api.maps2d.model.LatLng
import com.dahe.mylibrary.base.SingletonNoPHolder
/**
* @ClassName LocationUtils
* @Author john
* @Date 2024/3/4 15:53
* @Description TODO
*/
class LocationUtils private constructor() {
companion object : SingletonNoPHolder<LocationUtils>(::LocationUtils)
fun getDistance(var0: LatLng?, var1: LatLng?): String {
return if (var0 != null && var1 != null) {
try {
var var2: Double = var0.longitude
var var4: Double = var0.latitude
var var6: Double = var1.longitude
var var8: Double = var1.latitude
var2 *= 0.01745329251994329
var4 *= 0.01745329251994329
var6 *= 0.01745329251994329
var8 *= 0.01745329251994329
val var10 = Math.sin(var2)
val var12 = Math.sin(var4)
val var14 = Math.cos(var2)
val var16 = Math.cos(var4)
val var18 = Math.sin(var6)
val var20 = Math.sin(var8)
val var22 = Math.cos(var6)
val var24 = Math.cos(var8)
val var28 = DoubleArray(3)
val var29 = DoubleArray(3)
var28[0] = var16 * var14
var28[1] = var16 * var10
var28[2] = var12
var29[0] = var24 * var22
var29[1] = var24 * var18
var29[2] = var20
String.format(
"%.2f", (Math.asin(
Math.sqrt(
(var28[0] - var29[0]) * (var28[0] - var29[0]) +
(var28[1] - var29[1]) * (var28[1] - var29[1]) + (var28[2] - var29[2]) * (var28[2] - var29[2])
) / 2.0
)
* 1.27420015798544E7).toFloat() / 1000
)
} catch (var26: Throwable) {
var26.printStackTrace()
"0.00"
}
} else {
try {
throw AMapException("非法坐标值")
} catch (var27: AMapException) {
var27.printStackTrace()
"0.00"
}
}
}
}

View File

@ -0,0 +1,67 @@
package com.dahe.gldriver.utils
import com.dahe.mylibrary.base.SingletonNoPHolder
/**
* @ClassName OrderUtils
* @Author john
* @Date 2024/3/4 14:48
* @Description 订单状态转换
*/
class OrderUtils private constructor() {
companion object : SingletonNoPHolder<OrderUtils>(::OrderUtils)
fun getOrderStatu(statu: String): String {
return when (statu) {
"102010" -> "草稿箱"
"102020" -> "待调度"
"102030" -> "待接单"
"102040" -> "待装货"
"102050" -> "待卸货"
"102060" -> "待签收"
"102070" -> "待结算"
"102080" -> "待评价"
"103000" -> "已取消"
else -> {
""
}
}
}
fun getNextByStatu(statu: String): String {
return when (statu) {
"102010" -> "草稿箱"
"102020" -> "待调度"
"102030" -> "去接单"
"102040" -> "去装货"
"102050" -> "去卸货"
"102060" -> "待签收"
"102070" -> "待结算"
"102080" -> "去评价"
"103000" -> "已取消"
else -> {
""
}
}
}
fun getStatuByString(statu: String): String {
return when (statu) {
"草稿箱" -> "102010"
"待调度" -> "102020"
"待接单" -> "102030"
"待装货" -> "102040"
"待卸货" -> "102050"
"待签收" -> "102060"
"待结算" -> "102070"
"待评价" -> "102080"
"已取消" -> "103000"
else -> {
""
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 739 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 53 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#EFCFB9" />
<corners
android:radius="@dimen/dp_2" />
</shape>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#FFFFFAF0" />
<corners
android:radius="@dimen/dp_4" />
</shape>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<shape xmlns:android="http://schemas.android.com/apk/res/android"
android:shape="rectangle">
<solid android:color="#FFFFFF" />
<corners
android:radius="@dimen/dp_8" />
</shape>

View File

@ -69,6 +69,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 +85,81 @@
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_33" />
<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/ivLoad"-->
<!-- android:layout_width="@dimen/dp_18"-->
<!-- android:layout_height="@dimen/dp_18"-->
<!-- android:layout_below="@+id/tvTime"-->
<!-- android:layout_marginTop="@dimen/dp_33"-->
<!-- android:background="@drawable/icon_load" />-->
<ImageView
android: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"
<!-- <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" />-->
android:background="@drawable/icon_unload" />
<!-- <TextView-->
<!-- android:id="@+id/tvPhone"-->
<!-- android:layout_width="wrap_content"-->
<!-- android:layout_height="wrap_content"-->
<!-- android:layout_below="@+id/tvLoad"-->
<!-- android:layout_alignStart="@+id/tvLoad"-->
<!-- android:layout_marginTop="@dimen/dp_12"-->
<!-- android:text="刘静 15854215412"-->
<!-- android:textColor="@color/color_9"-->
<!-- android:textSize="@dimen/sp_16" />-->
<TextView
android:id="@+id/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" />
<!-- <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"-->
<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" />
<!-- 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_6"
android:background="@drawable/shape_gray_5"
android:orientation="horizontal">
@ -167,12 +175,15 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="122.5km"
tools:text="122.5km"
android:maxLength="10"
android:ellipsize="end"
android:textColor="@color/black"
android:textSize="@dimen/sp_16"
android:textStyle="bold" />
<TextView
android:id="@+id/tvDisTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tvLoadDis"
@ -188,7 +199,7 @@
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_12"
android:layout_toRightOf="@+id/tvLoadDis"
android:layout_toRightOf="@+id/tvDisTitle"
android:gravity="center"
android:orientation="vertical">
@ -246,7 +257,7 @@
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_centerVertical="true"
android:layout_marginLeft="@dimen/dp_12"
android:layout_marginLeft="@dimen/dp_2"
android:layout_toRightOf="@+id/tvUnloadDis"
android:gravity="center"
android:orientation="vertical">
@ -343,15 +354,22 @@
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_marginLeft="@dimen/dp_16"
android:layout_marginTop="@dimen/dp_40"
android:layout_toRightOf="@+id/tvCarTitle"
android:ellipsize="end"
android:gravity="right"
android:maxLines="1"
android:paddingRight="@dimen/dp_16"
android:text="整车 4.2/6.2/6.8 米 高栏/厢式"
android:singleLine="true"
android:textColor="@color/main_red"
android:textSize="@dimen/sp_15" />
android:textSize="@dimen/sp_15"
tools:text="整车 4.2/6.2/6.8 米 高栏/厢式" />
<TextView
android:id="@+id/tvGoodsTitle"
@ -365,11 +383,13 @@
android:textSize="@dimen/sp_15" />
<TextView
android:id="@+id/tvGoods"
android:gravity="right"
android:layout_toRightOf="@+id/tvGoodsTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/tvGoodsTitle"
android:layout_alignTop="@+id/tvGoodsTitle"
android:layout_alignParentRight="true"
android:layout_marginTop="@dimen/dp_40"
android:paddingRight="@dimen/dp_16"
android:text="钢铁1吨螺纹钢"
android:textColor="@color/main_red"
@ -379,7 +399,7 @@
android:id="@+id/tvNotesTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tvGoodsTitle"
android:layout_below="@+id/tvGoods"
android:layout_marginTop="@dimen/dp_18"
android:paddingLeft="@dimen/dp_16"
android:text="备注"
@ -387,6 +407,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"
@ -446,6 +467,7 @@
android:background="@drawable/head_defaut" />
<TextView
android:id="@+id/tvConsignor"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
@ -456,6 +478,7 @@
android:textSize="@dimen/sp_15" />
<TextView
android:id="@+id/tvConsignorRate"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/ivHead"
@ -491,11 +514,23 @@
android:id="@+id/tvFreight"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2000"
android:text="2000"
android:textColor="@color/main_red"
android:textSize="@dimen/sp_22"
android:textStyle="bold" />
<TextView
android:id="@+id/tvFreightUnit"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="元"
android:layout_marginBottom="@dimen/dp_3"
android:layout_alignBottom="@+id/tvFreight"
android:layout_toRightOf="@+id/tvFreight"
android:textColor="@color/main_red"
android:textSize="@dimen/sp_12"
android:textStyle="bold" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
@ -508,7 +543,7 @@
<Button
android:id="@+id/btnCall"
android:layout_width="@dimen/dp_120"
android:layout_width="@dimen/dp_100"
android:layout_height="@dimen/dp_36"
android:layout_centerVertical="true"
android:layout_toLeftOf="@+id/btnReceiving"
@ -519,7 +554,7 @@
<Button
android:id="@+id/btnReceiving"
android:layout_width="@dimen/dp_120"
android:layout_width="@dimen/dp_100"
android:layout_height="@dimen/dp_36"
android:layout_alignParentRight="true"
android:layout_centerVertical="true"

View File

@ -181,6 +181,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"
@ -196,74 +197,81 @@
android:layout_marginTop="@dimen/dp_14"
android:background="@color/color_e5" />
<ImageView
android:id="@+id/ivLoad"
android:layout_width="@dimen/dp_18"
android:layout_height="@dimen/dp_18"
android:layout_below="@+id/tvTime"
android:layout_marginTop="@dimen/dp_33"
android:background="@drawable/icon_load" />
<!-- <ImageView-->
<!-- android:id="@+id/ivLoad"-->
<!-- android:layout_width="@dimen/dp_18"-->
<!-- android:layout_height="@dimen/dp_18"-->
<!-- android:layout_below="@+id/tvTime"-->
<!-- android:layout_marginTop="@dimen/dp_33"-->
<!-- android:background="@drawable/icon_load" />-->
<TextView
android:id="@+id/tvLoad"
android:layout_width="wrap_content"
<!-- <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: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" />-->
<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" />
<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" />
android:layout_marginTop="@dimen/dp_33" />
<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_6"
android:background="@drawable/shape_gray_5"
android:orientation="horizontal">

View File

@ -181,6 +181,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"
@ -196,74 +197,18 @@
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" />
<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" />
android:layout_marginTop="@dimen/dp_33" />
<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_6"
android:background="@drawable/shape_gray_5"
android:orientation="horizontal">

View File

@ -94,11 +94,12 @@
android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tvLoca"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tvLocation"
android:layout_marginTop="@dimen/dp_16"
android:text="河南省郑州市金水区农业路经三路东南角银 丰商务A座"
tools:text="河南省郑州市金水区农业路经三路东南角银 丰商务A座"
android:textColor="@color/black"
android:textSize="@dimen/sp_16" />
@ -202,19 +203,19 @@
android:textColor="@color/black"
android:textSize="@dimen/sp_15" />
<ImageView
android:id="@+id/ivHead"
android:layout_width="@dimen/dp_42"
android:layout_height="@dimen/dp_42"
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView2"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_40"
android:background="@drawable/head_defaut" />
android:overScrollMode="never" />
<TextView
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:layout_toRightOf="@+id/recyclerView2"
android:text="上传回单"
android:textColor="@color/black"
android:textSize="@dimen/sp_15" />
@ -222,9 +223,9 @@
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_alignBottom="@+id/ivHead"
android:layout_alignBottom="@+id/recyclerView2"
android:layout_marginLeft="@dimen/dp_10"
android:layout_toRightOf="@+id/ivHead"
android:layout_toRightOf="@+id/recyclerView2"
android:text="请按照要求上传装货回单"
android:textColor="@color/color_9"
android:textSize="@dimen/sp_12" />

View File

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:gravity="center"
android:orientation="vertical">
<ImageView
android:layout_marginTop="@dimen/dp_m_60"
android:layout_width="@dimen/dp_210"
android:layout_height="@dimen/dp_210"
android:background="@drawable/empty_content" />
</LinearLayout>

View File

@ -1,189 +1,187 @@
<?xml version="1.0" encoding="utf-8"?>
<androidx.core.widget.NestedScrollView 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"
<com.scwang.smart.refresh.layout.SmartRefreshLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:id="@+id/refresh"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:fillViewport="true">
<LinearLayout
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
android:layout_height="wrap_content"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_275"
android:background="@drawable/home_top_bg"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_14"
android:paddingTop="@dimen/dp_46"
android:paddingRight="@dimen/dp_14"
android:layout_height="match_parent"
android:orientation="vertical">
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_275"
android:background="@drawable/home_top_bg"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_14"
android:paddingTop="@dimen/dp_46"
android:paddingRight="@dimen/dp_14"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="@dimen/dp_87"
android:layout_height="@dimen/dp_21"
android:background="@drawable/home_logo"></ImageView>
<View
android:layout_width="@dimen/dp_1"
android:layout_height="@dimen/dp_14"
android:layout_marginLeft="@dimen/dp_8"
android:layout_marginRight="@dimen/dp_8"
android:background="@color/white"></View>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="河南日报报业集团旗下APP"
android:textColor="@color/white"
android:textSize="@dimen/sp_12">
</TextView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_20"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="郑州"
android:textColor="@color/white"
android:textSize="@dimen/sp_16"></TextView>
<EditText
android:layout_width="match_parent"
android:layout_height="@dimen/dp_34"
android:layout_marginLeft="@dimen/dp_12"
android:layout_weight="1"
android:background="@drawable/search_bg"
android:drawableLeft="@drawable/search"
android:drawablePadding="@dimen/dp_6"
android:gravity="center_vertical"
android:hint="请输入搜索内容"
android:maxLines="1"
android:paddingLeft="@dimen/dp_10"
android:singleLine="true"
android:textSize="@dimen/sp_12"></EditText>
</LinearLayout>
<GridView
android:id="@+id/gridView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_20"
android:horizontalSpacing="@dimen/dp_30"
android:listSelector="@color/color_transparent"
android:numColumns="4"></GridView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
android:layout_marginTop="@dimen/dp_m_36"
android:gravity="center"
android:orientation="horizontal"
android:paddingLeft="@dimen/dp_14"
android:paddingRight="@dimen/dp_14">
<ImageView
android:layout_width="@dimen/dp_87"
android:layout_height="@dimen/dp_21"
android:background="@drawable/home_logo"></ImageView>
android:layout_width="@dimen/dp_160"
android:layout_height="@dimen/dp_96"
android:background="@drawable/home_all"></ImageView>
<View
android:layout_width="@dimen/dp_1"
android:layout_height="@dimen/dp_14"
android:layout_marginLeft="@dimen/dp_8"
android:layout_marginRight="@dimen/dp_8"
android:background="@color/white"></View>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="河南日报报业集团旗下APP"
android:textColor="@color/white"
android:textSize="@dimen/sp_12">
android:layout_height="1dp"
android:layout_weight="1"></View>
</TextView>
<ImageView
android:id="@+id/ivMyWaybill"
android:layout_width="@dimen/dp_160"
android:layout_height="@dimen/dp_96"
android:background="@drawable/home_my"></ImageView>
</LinearLayout>
//搜索
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_height="@dimen/dp_42"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginTop="@dimen/dp_20"
android:orientation="horizontal">
android:layout_marginRight="@dimen/dp_14"
android:background="@drawable/marquee_bg"
android:gravity="center_vertical">
<ImageView
android:layout_width="@dimen/dp_28"
android:layout_height="@dimen/dp_28"
android:background="@drawable/kuaixun"></ImageView>
<ImageView
android:layout_width="@dimen/dp_18"
android:layout_height="@dimen/dp_18"
android:layout_marginLeft="@dimen/dp_13"
android:background="@drawable/bobao"></ImageView>
<TextView
android:id="@+id/tvMar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_2"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:text="急啊卡省的JFK垃圾上单克里夫喀什酱豆腐卡拉就圣诞快乐房价爱上了夫卡是考虑到房价爱上了">
</TextView>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_22"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginTop="@dimen/dp_24">
<ImageView
android:layout_width="@dimen/dp_50"
android:layout_height="@dimen/dp_8"
android:layout_alignParentBottom="true"
android:background="@drawable/title_bg"></ImageView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="郑州"
android:textColor="@color/white"
android:textSize="@dimen/sp_16"></TextView>
android:text="推荐货源"
android:textColor="@color/black"
android:textSize="@dimen/sp_18"
android:textStyle="bold"
<EditText
android:layout_width="match_parent"
android:layout_height="@dimen/dp_34"
android:layout_marginLeft="@dimen/dp_12"
android:layout_weight="1"
android:background="@drawable/search_bg"
android:drawableLeft="@drawable/search"
android:drawablePadding="@dimen/dp_6"
android:gravity="center_vertical"
android:hint="请输入搜索内容"
android:maxLines="1"
android:paddingLeft="@dimen/dp_10"
android:singleLine="true"
android:textSize="@dimen/sp_12"></EditText>
</LinearLayout>
//金刚区
></TextView>
<GridView
android:id="@+id/gridView"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_20"
android:horizontalSpacing="@dimen/dp_30"
android:listSelector="@color/color_transparent"
android:numColumns="4"></GridView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_m_36"
android:gravity="center"
android:orientation="horizontal"
android:paddingLeft="@dimen/dp_14"
android:paddingRight="@dimen/dp_14">
<ImageView
android:layout_width="@dimen/dp_160"
android:layout_height="@dimen/dp_96"
android:background="@drawable/home_all"></ImageView>
<View
android:layout_width="wrap_content"
android:layout_height="1dp"
android:layout_weight="1"></View>
<ImageView
android:layout_width="@dimen/dp_160"
android:layout_height="@dimen/dp_96"
android:background="@drawable/home_my"></ImageView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_42"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_14"
android:background="@drawable/marquee_bg"
android:gravity="center_vertical">
<ImageView
android:layout_width="@dimen/dp_28"
android:layout_height="@dimen/dp_28"
android:background="@drawable/kuaixun"></ImageView>
<ImageView
android:layout_width="@dimen/dp_18"
android:layout_height="@dimen/dp_18"
android:layout_marginLeft="@dimen/dp_13"
android:background="@drawable/bobao"></ImageView>
<TextView
android:id="@+id/tvMar"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_2"
android:ellipsize="marquee"
android:focusable="true"
android:focusableInTouchMode="true"
android:marqueeRepeatLimit="marquee_forever"
android:scrollHorizontally="true"
android:singleLine="true"
android:text="急啊卡省的JFK垃圾上单克里夫喀什酱豆腐卡拉就圣诞快乐房价爱上了夫卡是考虑到房价爱上了">
</TextView>
</LinearLayout>
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_22"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginTop="@dimen/dp_24">
<ImageView
android:layout_width="@dimen/dp_50"
android:layout_height="@dimen/dp_8"
android:layout_alignParentBottom="true"
android:background="@drawable/title_bg"></ImageView>
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="推荐货源"
android:textColor="@color/black"
android:textSize="@dimen/sp_18"
android:textStyle="bold"
></TextView>
</RelativeLayout>
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
</RelativeLayout>
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView"
@ -192,6 +190,8 @@
android:paddingLeft="@dimen/dp_14"
android:paddingTop="@dimen/dp_24"
android:paddingRight="@dimen/dp_14"></androidx.recyclerview.widget.RecyclerView>
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</LinearLayout>
</androidx.core.widget.NestedScrollView>
</com.scwang.smart.refresh.layout.SmartRefreshLayout>

View File

@ -30,7 +30,21 @@
android:singleLine="true"
android:textSize="@dimen/sp_14"></EditText>
<ImageView
android:visibility="gone"
android:id="@+id/ivCancel"
android:layout_width="@dimen/dp_21"
android:layout_height="@dimen/dp_21"
android:background="@drawable/cancel"
android:layout_toLeftOf="@+id/btnSearch"
android:layout_alignParentBottom="true"
android:layout_marginBottom="@dimen/dp_12"
android:layout_marginRight="@dimen/dp_10"
/>
<Button
android:id="@+id/btnSearch"
android:layout_marginBottom="@dimen/dp_9"
android:layout_alignParentBottom="true"
android:layout_width="@dimen/dp_57"

View File

@ -2,6 +2,7 @@
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/color_F5"
android:orientation="vertical">
<com.scwang.smart.refresh.layout.SmartRefreshLayout
@ -13,8 +14,7 @@
android:id="@+id/recyclerView"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:paddingLeft="@dimen/dp_14"
android:paddingRight="@dimen/dp_14"></androidx.recyclerview.widget.RecyclerView>
android:layout_marginLeft="@dimen/dp_12"
android:layout_marginRight="@dimen/dp_12"></androidx.recyclerview.widget.RecyclerView>
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
</LinearLayout>

View File

@ -3,8 +3,8 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_waybill_item_bg"
android:padding="@dimen/dp_16"
android:orientation="vertical">
android:orientation="vertical"
android:padding="@dimen/dp_16">
<!-- <LinearLayout-->
<!-- android:layout_width="match_parent"-->
@ -49,16 +49,16 @@
android:layout_height="wrap_content"
android:text="郑州 高新"
android:textColor="@color/black"
android:textSize="@dimen/sp_20"
android:textSize="@dimen/sp_18"
android:textStyle="bold"></TextView>
<ImageView
android:id="@+id/imageGo"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_8"
android:layout_marginLeft="@dimen/dp_2"
android:layout_marginTop="@dimen/sp_10"
android:layout_marginRight="@dimen/dp_8"
android:layout_marginRight="@dimen/dp_2"
android:layout_toRightOf="@+id/tvStart"
android:background="@drawable/go_right"></ImageView>
@ -69,16 +69,16 @@
android:layout_toRightOf="@+id/imageGo"
android:text="郑州 高新"
android:textColor="@color/black"
android:textSize="@dimen/sp_20"
android:textSize="@dimen/sp_18"
android:textStyle="bold"></TextView>
<TextView
android:layout_marginTop="@dimen/dp_4"
android:id="@+id/tvProduct"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/tvStart"
android:layout_marginTop="@dimen/dp_4"
android:text="6米/厢式/20吨/螺纹钢"
android:textColor="@color/color_6"
android:textSize="@dimen/sp_14"></TextView>
@ -104,7 +104,6 @@
android:id="@+id/tvMoney"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2000"
android:textColor="@color/money_color"
android:textSize="@dimen/sp_22"
@ -123,11 +122,11 @@
<TextView
android:id="@+id/tvDis"
android:layout_marginTop="@dimen/dp_6"
android:layout_alignParentRight="true"
android:layout_below="@+id/llMoney"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_below="@+id/llMoney"
android:layout_alignParentRight="true"
android:layout_marginTop="@dimen/dp_6"
android:text="大约50km"
android:textColor="@color/color_9"
android:textSize="@dimen/sp_13"></TextView>
@ -142,27 +141,44 @@
<TextView
android:id="@+id/tvCom"
android:layout_toRightOf="@+id/imgHead"
android:layout_alignTop="@+id/imgHead"
android:layout_marginLeft="@dimen/dp_8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/sp_14"
android:textColor="@color/black"
android:layout_alignTop="@+id/imgHead"
android:layout_marginLeft="@dimen/dp_8"
android:layout_toRightOf="@+id/imgHead"
android:text="双汇食品有限公司"
></TextView>
android:textColor="@color/black"
android:textSize="@dimen/sp_14"></TextView>
<TextView
android:id="@+id/tvCredit"
android:layout_width="wrap_content"
android:layout_height="12dp"
android:layout_alignTop="@+id/tvCom"
android:layout_marginLeft="@dimen/dp_4"
android:layout_marginTop="@dimen/dp_3"
android:layout_toRightOf="@+id/tvCom"
android:background="@drawable/shape_orange_2"
android:gravity="center"
android:paddingLeft="@dimen/dp_4"
android:paddingRight="@dimen/dp_4"
android:paddingBottom="@dimen/dp_2"
android:text="信用 4.0"
android:textColor="@color/main_red"
android:textSize="@dimen/sp_9"></TextView>
<TextView
android:id="@+id/tvRate"
android:layout_toRightOf="@+id/imgHead"
android:layout_alignBottom="@+id/imgHead"
android:layout_marginLeft="@dimen/dp_8"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:textSize="@dimen/sp_12"
android:textColor="@color/color_9"
android:layout_alignBottom="@+id/imgHead"
android:layout_marginLeft="@dimen/dp_8"
android:layout_toRightOf="@+id/imgHead"
android:text="交易 200 好评率80%"
></TextView>
android:textColor="@color/color_9"
android:textSize="@dimen/sp_12"></TextView>
<Button

View File

@ -0,0 +1,244 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/shape_white_8"
android:padding="@dimen/dp_10"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:layout_width="@dimen/dp_21"
android:layout_height="@dimen/dp_21"
android:background="@drawable/icon_wabill" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:text="运单:"
android:textColor="@color/black"
android:textSize="@dimen/sp_16" />
<TextView
android:id="@+id/tvWaybillId"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:layout_weight="1"
android:text="451254565442"
android:textColor="@color/black"
android:textSize="@dimen/sp_16" />
<TextView
android:id="@+id/tvStatu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="待装货"
android:textColor="@color/main_red"
android:textSize="@dimen/sp_16" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_14"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tvStart"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="center"
android:maxLines="1"
android:text="郑州 金水"
android:textColor="@color/black"
android:textSize="@dimen/sp_20" />
<View
android:layout_width="@dimen/dp_30"
android:layout_height="@dimen/dp_1"
android:background="@color/black" />
<TextView
android:id="@+id/tvDis"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_8"
android:layout_marginRight="@dimen/dp_8"
android:text="56km" />
<View
android:layout_width="@dimen/dp_30"
android:layout_height="@dimen/dp_1"
android:background="@color/black" />
<TextView
android:layout_width="0dp"
android:layout_height="wrap_content"
android:id="@+id/tvEnd"
android:layout_weight="1"
android:gravity="center"
android:maxLines="1"
android:text="安徽 凤阳"
android:textColor="@color/black"
android:textSize="@dimen/sp_20" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_28"
android:layout_marginTop="@dimen/dp_14"
android:background="@drawable/shape_orange_4"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tvType"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:minWidth="@dimen/dp_100"
android:text="一装一卸"
android:textColor="@color/main_red"
android:textSize="@dimen/sp_15" />
<TextView
android:id="@+id/tvTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="12-07 16:00-20:00装货"
android:textColor="@color/color_6"
android:textSize="@dimen/sp_15" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_28"
android:layout_marginTop="@dimen/dp_6"
android:background="@drawable/shape_orange_4"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tvCarNum"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:minWidth="@dimen/dp_100"
android:text="豫A5866S"
android:textColor="@color/black"
android:textSize="@dimen/sp_15" />
<TextView
android:id="@+id/tvGood"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="20吨/螺纹钢"
android:textColor="@color/color_6"
android:textSize="@dimen/sp_15" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:gravity="right"
android:orientation="horizontal"
android:paddingRight="@dimen/dp_10">
<TextView
android:id="@+id/tvMoney"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="2000"
android:textColor="@color/main_red"
android:textSize="@dimen/sp_20" />
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center"
android:text="元/趟"
android:textColor="@color/main_red"
android:textSize="@dimen/sp_12" />
</LinearLayout>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_14"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/ivHead"
android:layout_width="@dimen/dp_41"
android:layout_height="@dimen/dp_41"
android:background="@color/color_9" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<TextView
android:id="@+id/tvComName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android: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/imgHead"
android:layout_marginLeft="@dimen/dp_10"
android:layout_toRightOf="@+id/imgHead"
android:text="交易 200 好评率80%"
android:textColor="@color/color_9"
android:textSize="@dimen/sp_12"></TextView>
</LinearLayout>
<Button
android:id="@+id/btnOk"
android:layout_width="@dimen/dp_68"
android:layout_height="@dimen/dp_30"
android:layout_alignTop="@+id/imgHead"
android:layout_alignParentRight="true"
android:layout_marginTop="@dimen/dp_4"
android:layout_marginBottom="@dimen/dp_4"
android:background="@drawable/shape_ok_bg"
android:text="去装货"
android:textColor="@color/white"
android:textSize="@dimen/sp_15"
android:textStyle="bold"></Button>
</LinearLayout>
</LinearLayout>

View File

@ -0,0 +1,42 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<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_4"
android:background="@drawable/icon_load" />
<TextView
android:id="@+id/tvLoad"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_15"
android:text="河南省郑州市金水区农业路经三路交叉 口银丰商务A座"
android:textColor="@color/black"
android:textSize="@dimen/sp_16" />
</LinearLayout>
<TextView
android:id="@+id/tvPhone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_32"
android:layout_marginTop="@dimen/dp_12"
android:text="刘静 15854215412"
android:textColor="@color/color_9"
android:textSize="@dimen/sp_16" />
</LinearLayout>

View File

@ -84,6 +84,8 @@ dependencies {
api rootProject.ext.dependencies["AddressPicker"]
api 'pub.devrel:easypermissions:3.0.0'
api 'io.github.lucksiege:compress:v3.11.2'
api 'org.greenrobot:eventbus:3.3.1'
// api 'com.gyf.cactus:cactus:1.1.3-beta13'

View File

@ -31,6 +31,8 @@ import com.scwang.smart.refresh.layout.api.RefreshLayout;
import com.scwang.smart.refresh.layout.constant.RefreshState;
import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener;
import org.greenrobot.eventbus.EventBus;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
@ -324,6 +326,17 @@ public abstract class BaseActivity<VB extends ViewBinding> extends AppCompatActi
return ContextCompat.getColor(this, id);
}
@Override
protected void onStart() {
super.onStart();
}
@Override
protected void onStop() {
super.onStop();
}
@Override
public void onResume() {
super.onResume();

View File

@ -28,6 +28,8 @@ import com.scwang.smart.refresh.layout.api.RefreshLayout;
import com.scwang.smart.refresh.layout.constant.RefreshState;
import com.scwang.smart.refresh.layout.listener.OnRefreshLoadMoreListener;
import org.greenrobot.eventbus.EventBus;
import java.lang.reflect.InvocationTargetException;
import java.lang.reflect.Method;
import java.lang.reflect.ParameterizedType;
@ -298,7 +300,15 @@ public abstract class BaseFragment<VB extends ViewBinding> extends Fragment {
rootView = null;
isReuseView = true;
}
@Override
public void onStart() {
super.onStart();
}
@Override
public void onStop() {
super.onStop();
}
@Override
public void onPause() {
isPause = true;

View File

@ -90,7 +90,7 @@ class PopBottomPic(
.setCompressEngine(ImageFileCompressEngine())
.isPreviewImage(true)
.isMaxSelectEnabledMask(true)
.setMaxSelectNum(6)
.setMaxSelectNum(1)
.isGif(false)
.setSelectedData(myAdapter.data)
selectionModel.forResult(object : OnResultCallbackListener<LocalMedia> {