车队(邀请,同意,拒绝)功能完善

This commit is contained in:
lijia 2024-03-12 15:03:45 +08:00
parent 14dde2eb20
commit 124943cb75
58 changed files with 3098 additions and 235 deletions

View File

@ -127,6 +127,11 @@
android:configChanges="keyboardHidden|orientation|locale" android:configChanges="keyboardHidden|orientation|locale"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateHidden" /> android:windowSoftInputMode="adjustPan|stateHidden" />
<activity
android:name=".ui.account.AuthSuccActivity"
android:configChanges="keyboardHidden|orientation|locale"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateHidden" />
<!-- 司机车辆认证相关start --> <!-- 司机车辆认证相关start -->
@ -166,6 +171,12 @@
<activity <activity
android:name=".ui.account.authperson.AuthDrivingActivity" android:name=".ui.account.authperson.AuthDrivingActivity"
android:configChanges="keyboardHidden|orientation|locale" android:configChanges="keyboardHidden|orientation|locale"
android:launchMode="singleTop"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateHidden" />
<activity
android:name=".ui.account.authperson.AuthTrailerActivity"
android:configChanges="keyboardHidden|orientation|locale"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateHidden" /> android:windowSoftInputMode="adjustPan|stateHidden" />
@ -239,12 +250,33 @@
android:configChanges="keyboardHidden|orientation|locale" android:configChanges="keyboardHidden|orientation|locale"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateHidden" /> android:windowSoftInputMode="adjustPan|stateHidden" />
<activity
android:name=".ui.mine.activity.DriverTeamDetailActivity"
android:configChanges="keyboardHidden|orientation|locale"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateHidden" />
<activity
android:name=".ui.mine.activity.DriverTeamsActivity"
android:configChanges="keyboardHidden|orientation|locale"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateHidden" />
<activity <activity
android:name=".ui.mine.activity.PersonInfoActivity" android:name=".ui.mine.activity.PersonInfoActivity"
android:configChanges="keyboardHidden|orientation|locale" android:configChanges="keyboardHidden|orientation|locale"
android:screenOrientation="portrait" android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateHidden" /> android:windowSoftInputMode="adjustPan|stateHidden" />
<activity
android:name=".ui.mine.InviteDriverActivity"
android:configChanges="keyboardHidden|orientation|locale"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateHidden" />
<activity
android:name=".ui.mine.InviteRecordActivity"
android:configChanges="keyboardHidden|orientation|locale"
android:screenOrientation="portrait"
android:windowSoftInputMode="adjustPan|stateHidden" />
<!-- 我的相关end --> <!-- 我的相关end -->

View File

@ -23,8 +23,14 @@ class CarsAdapter :
holder.run { holder.run {
setText(R.id.tvCarNum, item?.vehicleNum) setText(R.id.tvCarNum, item?.vehicleNum)
setText(R.id.tvCarType, item?.vehicleType) setText(R.id.tvCarType, item?.vehicleType)
setText(R.id.tvCarLen, """${item?.carLong}mm""") setText(R.id.tvCarLen, """${if (!item?.carLong.isNullOrEmpty()) item?.carLong else ""}mm""")
setText(R.id.tvCarWei, """${item?.approvedLoad?.toFloat()?.div(1000)}""") setText(
R.id.tvCarWei,
"""${
if (!item?.approvedLoad.isNullOrEmpty()) item?.approvedLoad?.toFloat()
?.div(1000) else 0
}"""
)
ImageLoader.getInstance() ImageLoader.getInstance()
.loadRoundImage(context, item?.carUrl, 6, getView<ImageView>(R.id.ivHead)) .loadRoundImage(context, item?.carUrl, 6, getView<ImageView>(R.id.ivHead))

View File

@ -0,0 +1,45 @@
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.CaptainBean
import com.dahe.gldriver.bean.DriverBean
import com.dahe.glex.bean.WayBillBean
import com.dahe.mylibrary.utils.ImageLoader
/**
* @ClassName WaybillAdapter
* @Author 用户
* @Date 2024/1/23 16:27
* @Description TODO
*/
class DriverTeamsAdapter() :
BaseQuickAdapter<CaptainBean, QuickViewHolder>() {
override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: CaptainBean?) {
item?.let {
holder.run {
setText(R.id.tvName, it.captainName)
setText(R.id.tvPhone, """司机:${item.driverNum} 车辆:${item.carNum}""")
setVisible(R.id.tvStatu, item.joinStatus == "0")
ImageLoader.getInstance()
.loadRoundImage(context, it.avatar, 6, getView<ImageView>(R.id.ivHead))
}
}
}
override fun onCreateViewHolder(
context: Context,
parent: ViewGroup,
viewType: Int
): QuickViewHolder {
// 返回一个 ViewHolder
return QuickViewHolder(R.layout.item_carteam, parent)
}
}

View File

@ -17,17 +17,24 @@ import com.dahe.mylibrary.utils.ImageLoader
* @Date 2024/1/23 16:27 * @Date 2024/1/23 16:27
* @Description TODO * @Description TODO
*/ */
class DriversAdapter : class DriversAdapter(var isInvite : Boolean = false) :
BaseQuickAdapter<DriverBean, QuickViewHolder>() { BaseQuickAdapter<DriverBean, QuickViewHolder>() {
override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: DriverBean?) { override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: DriverBean?) {
item?.let { item?.let {
holder.run { holder.run {
setText(R.id.tvName,it.idcardName) setText(R.id.tvName,it.idcardName)
setText(R.id.tvPhone,it.driverPhone) setText(R.id.tvPhone,if (isInvite) it.contactPhone else it.driverPhone)
setText(R.id.tvDays,"""加入${it.diffDay}""") setText(R.id.tvDays,"""加入${it.diffDay}""")
ImageLoader.getInstance() ImageLoader.getInstance()
.loadRoundImage(context, it.driverAvatar, 6, getView<ImageView>(R.id.ivHead)) .loadRoundImage(context, it.driverAvatar, 6, getView<ImageView>(R.id.ivHead))
setVisible(R.id.tvStatu,it.level=="2")
setVisible(R.id.tvInvite,isInvite)
setVisible(R.id.vLine,!isInvite)
setVisible(R.id.tvDays,!isInvite)
} }
} }
} }

View File

@ -0,0 +1,47 @@
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.DriverBean
import com.dahe.gldriver.bean.InviteRecord
import com.dahe.glex.bean.WayBillBean
import com.dahe.mylibrary.utils.ImageLoader
/**
* @ClassName WaybillAdapter
* @Author 用户
* @Date 2024/1/23 16:27
* @Description TODO
*/
class InviteRecordAdapter() :
BaseQuickAdapter<InviteRecord, QuickViewHolder>() {
override fun onBindViewHolder(holder: QuickViewHolder, position: Int, item: InviteRecord?) {
item?.let {
holder.run {
setText(R.id.tvTime,it.createTime)
setText(R.id.tvContent, """${if (it.joinStatus=="0")"邀请" else ""}${it.driverName} ${it.driverPhone} ${if (it.joinStatus=="2") "拒绝加入车队" else "加入车队"}""")
setText(R.id.tvReason,it.reason)
setGone(R.id.tvReason,it.joinStatus!="2")
}
}
}
override fun onCreateViewHolder(
context: Context,
parent: ViewGroup,
viewType: Int
): QuickViewHolder {
// 返回一个 ViewHolder
return QuickViewHolder(R.layout.item_invite_record, parent)
}
}

View File

@ -12,9 +12,12 @@ object AppConfig {
const val ID = "DA_HE_ID" const val ID = "DA_HE_ID"
const val PHONE = "DA_HE_PHONE" const val PHONE = "DA_HE_PHONE"
const val ORDER_ID = "DA_HE_ORDER_ID" const val ORDER_ID = "DA_HE_ORDER_ID"
const val CAR_ID = "DA_HE_CAR_ID"
const val IS_SHOW = "DA_HE_IS_SHOW"
const val WAYBILL_ID = "DA_HE_WAYBILL_ID" const val WAYBILL_ID = "DA_HE_WAYBILL_ID"
const val CHILDRE_ID = "DA_HE_CHILDRE_ID" const val CHILDRE_ID = "DA_HE_CHILDRE_ID"
const val CODE = "DA_HE_PHONE" const val CODE = "DA_HE_PHONE"
const val REFRSH = "DA_HE_REFRSH"
const val SUCCESS_TYPE = "DA_HE_SUCCESS_TYPE" const val SUCCESS_TYPE = "DA_HE_SUCCESS_TYPE"
} }

View File

@ -0,0 +1,34 @@
package com.dahe.gldriver.bean
/**
* @ClassName CaptainBean
* @Author john
* @Date 2024/3/11 15:45
* @Description 车队信息bean
*/
data class CaptainBean(
val auditStatus: String,
val avatar: String,
val captainId: String,
val captainName: String,
val driverNum: String,
val carNum: String,
val captainType: String,
val contactName: String,
val isRealname: String,
val joinStatus: String,
val status: String
)
data class InviteRecord(
val bindTime: String,
val captainId: Int,
val createTime: String,
val driverName: String,
val driverPhone: String,
val driverId: Int,
val joinStatus: String,
val level: String,
val linkId: Int,
val reason: String
)

View File

@ -9,7 +9,7 @@ package com.dahe.gldriver.bean
data class CarBean( data class CarBean(
val approvedLoad: String="", val approvedLoad: String="",
val carHeight: String="", val carHeight: String="",
val carId: String="", var carId: String="",
val carLong: String="", val carLong: String="",
val carUrl: String="", val carUrl: String="",
val carWidth: String="", val carWidth: String="",

View File

@ -0,0 +1,21 @@
package com.dahe.gldriver.bean
import com.github.gzuliyujiang.wheelview.contract.TextProvider
/**
* @ClassName DicBean
* @Author john
* @Date 2024/3/11 08:52
* @Description 字典bean
*/
data class DiCarColor(
val dictCode: Int,
val dictLabel: String,
val dictValue: String,
val isDefault: String,
val status: String
) : TextProvider {
override fun provideText(): String {
return dictLabel
}
}

View File

@ -7,16 +7,20 @@ package com.dahe.gldriver.bean
* @Description TODO * @Description TODO
*/ */
data class DriverBean( data class DriverBean(
val bindTime: String, var bindTime: String = "",
val captainId: String, var captainId: String = "",
val createTime: String, var createTime: String = "",
val diffDay: String, var diffDay: String = "",
val driverAvatar: String, var driverNum: String = "",
val driverId: String, var carNum: String = "",
val driverPhone: String, var driverAvatar: String = "",
val idcardName: String, var driverId: String = "",
val idcardSex: String, var driverPhone: String = "",
val isRealName: String, var contactName: String = "",
val joinStatus: String, var contactPhone: String = "",
val level: String var idcardName: String = "",
var idcardSex: String = "",
var isRealName: String = "",
var joinStatus: String = "",
var level: String = ""
) )

View File

@ -77,12 +77,11 @@ data class DataX(
val validFromDate: String = "", val validFromDate: String = "",
//行驶证 //行驶证
val issueDate: String = "",
val model: String = "", val model: String = "",
val owner: String = "", val owner: String = "",
val licensePlateNumber: String = "", val licensePlateNumber: String = "",
val registrationDate: String = "", val registrationDate: String = "",
val useNature: String = "", val useNature: String = "",//使用性质
val vehicleType: String = "", val vehicleType: String = "",
val vinCode: String = "", val vinCode: String = "",
val recordNumber: String = "",//档案编号 val recordNumber: String = "",//档案编号
@ -92,6 +91,9 @@ data class DataX(
val permittedWeight: String = "",//核定载质量 val permittedWeight: String = "",//核定载质量
val tractionWeight: String = "",//准牵引总质量 val tractionWeight: String = "",//准牵引总质量
val overallDimension: String = "",//6915×2550×3960mm val overallDimension: String = "",//6915×2550×3960mm
val plateColorCode: String = "",//车牌颜色
val inspectionRecord: String = "",//检验有效期至2023年06月吉J 有效期
val issueDate: String = "",//发证日期
val energySign: String = "",//能源类型 val energySign: String = "",//能源类型
) )

View File

@ -35,6 +35,58 @@ data class UpDriverInfoBean(
var licenseApproveOrganization: String = "" var licenseApproveOrganization: String = ""
) )
/**
* 上传行驶证
* */
data class UpDrivingInfoBean(
var address: String = "",
var approvedLoad: String = "",
var barcodeNumber: String = "",
var carHeight: String = "",
var carLong: String = "",
var carUrl: String = "",
var carId: String = "",
var carWidth: String = "",
var curbWeight: String = "",
var energySign: String = "",
var energySignCode: String = "",
var engineNo: String = "",
var inspectionRecord: String = "",
var isTrailer: String = "",
var issuingAuthority: String = "",
var licenseBackUrl: String = "",
var licenseFaceUrl: String = "",
var licenseIssueDate: String = "",
var licenseRegisterDate: String = "",
var licenseRemarks: String = "",
var licensevaridity: String = "",
var model: String = "",
var overallDimension: String = "",
var owner: String = "",
var passengerCapacity: String = "",
var plateColor: String = "",
var plateColorCode: String = "",
var trailerPlateColor: String = "",
var trailerPlateColorCode: String = "",
var recordNumber: String = "",
var registerImageUrl: String = "",
var roadLicense: String = "",
var roadLicensePhotoUrl: String = "",
var roadLicenseSend: String = "",
var roadLicensevaridity: String = "",
var totalWeight: String = "",
var tractionWeight: String = "",
var useNature: String = "",
var vehicleNum: String = "",
var vehicleType: String = "",
var vehicleTypeCode: String = "",
var roadLicenseValidity: String = "",
var licenseValidity: String = "",//到期时间
var vinCode: String = ""
)
/** /**
* 上传从业资格 * 上传从业资格
* */ * */
@ -45,6 +97,18 @@ data class UpQualiInfoBean(
var qualificationCertificateExamineDate: String = "" var qualificationCertificateExamineDate: String = ""
) )
/**
* 上传车辆的道路运输证
* */
data class UpRoadInfoBean(
var carId: String = "",
var roadLicensePhotoUrl: String = "",
var roadLicense: String = "",
var roadLicensevaridity: String = "",
var roadLicenseSend: String = ""
)
/** /**
* 上传银行卡 * 上传银行卡
* */ * */
@ -75,7 +139,7 @@ data class AuthTeamBean(
var idcardNo: String="", var idcardNo: String="",
var roadLicensePhotoUrl: String="", var roadLicensePhotoUrl: String="",
var roadLicense: String="", var roadLicense: String="",
var roadLicenseValidity: String="", var roadLicensevaridity: String="",
var businessLicensePhoneUrl: String="", var businessLicensePhoneUrl: String="",
var businessLicenseCreditCode: String="", var businessLicenseCreditCode: String="",
var businessLicenseEffectiveStart: String="", var businessLicenseEffectiveStart: String="",
@ -87,3 +151,18 @@ data class AuthTeamBean(
} }
} }
/**
* 司机同意/拒绝加入车队
* @property joinStatus String 0=待同意,1=已同意,2=已拒绝
* @property linkId Int
* @property reason String
* @constructor
*/
data class UpCaptain(
var joinStatus: String="",
var linkId: String="",
var captainId: String="",
var driverId: String="",
var reason: String=""
)

View File

@ -23,6 +23,7 @@ data class UserBean(
var distance :String, var distance :String,
var idCardValidity :String, var idCardValidity :String,
var driverValidity :String, var driverValidity :String,
var driverId :String,
var qualificationValidity :String, var qualificationValidity :String,
var isCar :String, var isCar :String,
var qrcodeUrl :String, var qrcodeUrl :String,

View File

@ -10,7 +10,7 @@ import com.luck.picture.lib.entity.LocalMedia
* @Description TODO * @Description TODO
*/ */
fun interface OnOcrPicResultListener { fun interface OnOcrPicResultListener {
fun onSuccResult(picPath: PicPath, result: OcrPersonBean) fun onSuccResult(picPath: PicPath, result: OcrPersonBean?)
} }
data class PicPath( data class PicPath(

View File

@ -3,16 +3,22 @@ package com.dahe.gldriver.net
import com.dahe.gldriver.BuildConfig import com.dahe.gldriver.BuildConfig
import com.dahe.gldriver.BuildConfig.BASE_URL import com.dahe.gldriver.BuildConfig.BASE_URL
import com.dahe.gldriver.bean.AuthTeamBean import com.dahe.gldriver.bean.AuthTeamBean
import com.dahe.gldriver.bean.CaptainBean
import com.dahe.gldriver.bean.CarBean import com.dahe.gldriver.bean.CarBean
import com.dahe.gldriver.bean.DiCarColor
import com.dahe.gldriver.bean.DriverBean import com.dahe.gldriver.bean.DriverBean
import com.dahe.gldriver.bean.InviteRecord
import com.dahe.gldriver.bean.OcrPersonBean import com.dahe.gldriver.bean.OcrPersonBean
import com.dahe.gldriver.bean.OrderDetailBean import com.dahe.gldriver.bean.OrderDetailBean
import com.dahe.gldriver.bean.OssBean import com.dahe.gldriver.bean.OssBean
import com.dahe.gldriver.bean.UpBankInfoBean import com.dahe.gldriver.bean.UpBankInfoBean
import com.dahe.gldriver.bean.UpCaptain
import com.dahe.gldriver.bean.UpDriverInfoBean import com.dahe.gldriver.bean.UpDriverInfoBean
import com.dahe.gldriver.bean.UpDrivingInfoBean
import com.dahe.gldriver.bean.UpPersonInfoBean import com.dahe.gldriver.bean.UpPersonInfoBean
import com.dahe.gldriver.bean.UpPicBean import com.dahe.gldriver.bean.UpPicBean
import com.dahe.gldriver.bean.UpQualiInfoBean import com.dahe.gldriver.bean.UpQualiInfoBean
import com.dahe.gldriver.bean.UpRoadInfoBean
import com.dahe.glex.bean.* import com.dahe.glex.bean.*
import com.dahe.mylibrary.net.CommonResponseBean import com.dahe.mylibrary.net.CommonResponseBean
import io.reactivex.rxjava3.core.Observable import io.reactivex.rxjava3.core.Observable
@ -23,6 +29,7 @@ import retrofit2.http.Multipart
import retrofit2.http.POST import retrofit2.http.POST
import retrofit2.http.Part import retrofit2.http.Part
import retrofit2.http.Query import retrofit2.http.Query
import java.util.Objects
/** /**
@ -40,6 +47,17 @@ interface Api {
): Observable<CommonResponseBean<UserBean>> ): Observable<CommonResponseBean<UserBean>>
/**
* 根据字典类型查询字典-不分页
* @param dictType String
* @return Observable<CommonResponseBean<MutableList<>>>
*/
@GET(BASE_URL + "driver/common/dict/getSysDictDataList/all")
fun getSysDictDataList(
@Query("dictType") dictType: String
): Observable<CommonResponseBean<MutableList<DiCarColor>>>
/** /**
* 获取验证码 * 获取验证码
* */ * */
@ -120,6 +138,12 @@ interface Api {
@POST(BASE_URL + "driver/driver/setUpDriverQualificationCertificate") @POST(BASE_URL + "driver/driver/setUpDriverQualificationCertificate")
fun setUpDriverQualificationCertificate(@Body qualiBean: UpQualiInfoBean): Observable<CommonResponseBean<String>> fun setUpDriverQualificationCertificate(@Body qualiBean: UpQualiInfoBean): Observable<CommonResponseBean<String>>
/**
* 上传车辆的道路运输证
* */
@POST(BASE_URL + "driver/car/setUpRoadLicense")
fun setUpRoadLicense(@Body roadBean: UpRoadInfoBean): Observable<CommonResponseBean<String>>
/** /**
* 司机上传银行卡 * 司机上传银行卡
* */ * */
@ -177,6 +201,11 @@ interface Api {
): Observable<CommonResponseBean<String>> ): Observable<CommonResponseBean<String>>
/**
* 设置司机账号类型
* @param role String 0普通司机1车队长
* @return Observable<CommonResponseBean<String>>
*/
@GET(BASE_URL + "driver/driver/setUpDriverRole") @GET(BASE_URL + "driver/driver/setUpDriverRole")
fun setUpDriverRole(@Query("role") role: String): Observable<CommonResponseBean<String>> fun setUpDriverRole(@Query("role") role: String): Observable<CommonResponseBean<String>>
@ -188,6 +217,13 @@ interface Api {
@GET(BASE_URL + "driver/car/carList") @GET(BASE_URL + "driver/car/carList")
fun carList(): Observable<CommonResponseBean<MutableList<CarBean>>> fun carList(): Observable<CommonResponseBean<MutableList<CarBean>>>
/**
*
* 根据车牌号查询车辆信息
* */
@GET(BASE_URL + "driver/car/getCarByCarVehicleNum")
fun getCarByCarVehicleNum(@Query("vehicleNum") vehicleNum: String): Observable<CommonResponseBean<UpDrivingInfoBean>>
/** /**
* *
* 解绑车辆 * 解绑车辆
@ -195,6 +231,72 @@ interface Api {
@POST(BASE_URL + "driver/car/unBindCar") @POST(BASE_URL + "driver/car/unBindCar")
fun unBindCar(@Body carBean: CarBean): Observable<CommonResponseBean<String>> fun unBindCar(@Body carBean: CarBean): Observable<CommonResponseBean<String>>
/**
*
* 绑定车辆
* */
@POST(BASE_URL + "driver/car/bindCar")
fun bindCar(@Body carBean: CarBean): Observable<CommonResponseBean<String>>
/**
*
* 新增车辆
* */
@POST(BASE_URL + "driver/car/addCar")
fun addCar(@Body upDrivingInfoBean: UpDrivingInfoBean): Observable<CommonResponseBean<UpDrivingInfoBean>>
/**
*
* 新增挂车信息
* */
@POST(BASE_URL + "driver/car/addTrailer")
fun addTrailer(@Body upDrivingInfoBean: UpDrivingInfoBean): Observable<CommonResponseBean<Int>>
/**
*
*邀请司机加入车队
* */
@POST(BASE_URL + "driver/captain/askToDriver")
fun askToDriver(@Body upDrivingInfoBean: DriverBean): Observable<CommonResponseBean<Int>>
/**
*
*根据手机号查询司机
* */
@GET(BASE_URL + "driver/captain/selectDriverList")
fun selectDriverList(@Query("phone") phone: String): Observable<CommonResponseBean<MutableList<DriverBean>>>
/**
*
*查询司机所在车队信息
* */
@GET(BASE_URL + "driver/captain/selectCaptainListInDriver")
fun selectCaptainListInDriver(): Observable<CommonResponseBean<MutableList<CaptainBean>>>
/**
*
*查询车队邀请历史
* */
@GET(BASE_URL + "driver/captain/selectCaptainAskByDriverHistoryList")
fun selectCaptainAskByDriverHistoryList(): Observable<CommonResponseBean<MutableList<InviteRecord>>>
/**
* 司机同意/拒绝加入车队
* @param upCaptain UpCaptain
* @return Observable<CommonResponseBean<String>>
*/
@POST(BASE_URL + "driver/driver/responseToCaptain")
fun responseToCaptain(@Body upCaptain: UpCaptain): Observable<CommonResponseBean<String>>
/**
* 司机退出车队
* @param upCaptain UpCaptain
* @return Observable<CommonResponseBean<String>>
*/
@POST(BASE_URL + "driver/captain/unbindDriver")
fun unbindDriver(@Body upCaptain: UpCaptain): Observable<CommonResponseBean<String>>
/** /**
* 查询车队所属的司机列表包含车辆 * 查询车队所属的司机列表包含车辆
@ -203,6 +305,21 @@ interface Api {
@GET(BASE_URL + "driver/captain/selectDriversInCaptain") @GET(BASE_URL + "driver/captain/selectDriversInCaptain")
fun selectDriversInCaptain(@Query("captainId") captainId: String): Observable<CommonResponseBean<MutableList<DriverBean>>> fun selectDriversInCaptain(@Query("captainId") captainId: String): Observable<CommonResponseBean<MutableList<DriverBean>>>
/**
* 根据ID查询车队车辆列表-根据司机分页
* @return Observable<CommonResponseBean<MutableList<DriverBean>>>
*/
@GET(BASE_URL + "driver/captain/selectDriverIdsForCarPage")
fun selectDriverIdsForCarPage(@Query("captainId") captainId: String): Observable<CommonResponseBean<MutableList<CarBean>>>
/**
* 根据ID查询车队信息
* @param captainId String
* @return Observable<CommonResponseBean<MutableList<DriverBean>>>
*/
@GET(BASE_URL + "driver/captain/getCaptainById")
fun getCaptainById(@Query("captainId") captainId: String): Observable<CommonResponseBean<CaptainBean>>
companion object { companion object {
// String BASE_URL = "https://tmstest.dahehuoyun.com/"; // String BASE_URL = "https://tmstest.dahehuoyun.com/";

View File

@ -0,0 +1,57 @@
package com.dahe.gldriver.ui.account
import android.os.Bundle
import com.dahe.gldriver.R
import com.dahe.gldriver.base.AppConfig
import com.dahe.gldriver.databinding.ActivityAuthSuccBinding
import com.dahe.gldriver.ui.HomeActivity
import com.dahe.gldriver.ui.account.authperson.AuthDrivingActivity
import com.dahe.gldriver.ui.mine.activity.CarsManActivity
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.gldriver.ui.waybill.activity.WaybillUpPicActivity
import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.utils.ActivityUtils
import com.dahe.mylibrary.utils.BaseUtils
import com.dahe.mylibrary.utils.TimeUtil
/**
* @ClassName AuthSuccActivity
* @Author john
* @Date 2024/3/8 15:13
* @Description TODO
*/
class AuthSuccActivity : BaseActivity<ActivityAuthSuccBinding>() {
override fun initView(savedInstanceState: Bundle?) {
setStatusBarColor(R.color.white)
val type = intent.extras?.getInt(AppConfig.SUCCESS_TYPE)
setTitleBar("提交成功", true)
binding.run {
btnLeft.setOnClickListener {
goLeftOrRight(type, true)
}
btnRight.setOnClickListener {
goLeftOrRight(type, false)
}
}
}
override fun initDate() {
}
/*
*
* */
private fun goLeftOrRight(type: Int?, isLeft: Boolean) {
if (isLeft) {
ActivityUtils.finishToActivity(HomeActivity::class.java, false)
} else {
ActivityUtils.finishToActivity(mContext,CarsManActivity::class.java,AuthDrivingActivity::class.java,false)
}
}
}

View File

@ -33,14 +33,15 @@ class CodeLoginActivity : BaseActivity<ActivityCodeBinding>(), View.OnClickListe
} }
override fun initDate() { override fun initDate() {
DataManager.getInstance().getCode(phone) // TODO: 获取验证码,暂时注释
.subscribeOn(Schedulers.io()) // DataManager.getInstance().getCode(phone)
.observeOn(AndroidSchedulers.mainThread()) // .subscribeOn(Schedulers.io())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<UserBean>() { // .observeOn(AndroidSchedulers.mainThread())
override fun onSuccess(t: CommonResponseBean<UserBean>) { // .subscribe(BaseObserver(mContext, object : RxHttpCallBack<UserBean>() {
super.onSuccess(t) // override fun onSuccess(t: CommonResponseBean<UserBean>) {
} // super.onSuccess(t)
})) // }
// }))
} }
override fun onClick(view: View?) { override fun onClick(view: View?) {
@ -58,16 +59,15 @@ class CodeLoginActivity : BaseActivity<ActivityCodeBinding>(), View.OnClickListe
} }
.subscribeOn(Schedulers.io()) .subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread()) .observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<UserBean>() { .subscribe(BaseObserver(mContext, object : RxHttpCallBack<UserBean>(this) {
override fun onSuccess(t: CommonResponseBean<UserBean>) { override fun onSuccess(t: CommonResponseBean<UserBean>) {
super.onSuccess(t) super.onSuccess(t)
SPUtils.instance.setUserInfo(mContext, Gson().toJson(t.data)) SPUtils.instance.setUserInfo(mContext, Gson().toJson(t.data))
ActivityUtils.startActivity( ActivityUtils.startActivity(
mContext, mContext,
SelectRoleActivity::class.java HomeActivity::class.java
) )
finish() ActivityUtils.finishToActivity(LoginActivity::class.java,true)
ActivityUtils.finishActivity(LoginActivity::class.java)
} }
})) }))

View File

@ -6,6 +6,8 @@ import android.view.View
import com.dahe.gldriver.base.AppConfig import com.dahe.gldriver.base.AppConfig
import com.dahe.gldriver.databinding.ActivityLoginBinding import com.dahe.gldriver.databinding.ActivityLoginBinding
import com.dahe.gldriver.ui.HomeActivity import com.dahe.gldriver.ui.HomeActivity
import com.dahe.gldriver.ui.account.authperson.AuthDrivingActivity
import com.dahe.gldriver.ui.account.authperson.AuthTrailerActivity
import com.dahe.mylibrary.base.BaseActivity import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.utils.ActivityUtils import com.dahe.mylibrary.utils.ActivityUtils
import com.dahe.mylibrary.utils.ToastUtils import com.dahe.mylibrary.utils.ToastUtils
@ -40,6 +42,12 @@ class LoginActivity : BaseActivity<ActivityLoginBinding>(), View.OnClickListener
binding.ok.setOnClickListener(this) binding.ok.setOnClickListener(this)
binding.imgHead.setOnLongClickListener { binding.imgHead.setOnLongClickListener {
// TODO: 调试图片上传
// ActivityUtils.startActivity(mContext, AuthTrailerActivity::class.java,Bundle().apply {
// putString(AppConfig.CAR_ID,"25")
// })
// ActivityUtils.startActivity(mContext, AuthDrivingActivity::class.java)
ActivityUtils.startActivity(mContext, HomeActivity::class.java) ActivityUtils.startActivity(mContext, HomeActivity::class.java)
return@setOnLongClickListener true return@setOnLongClickListener true
} }

View File

@ -7,6 +7,7 @@ import com.dahe.gldriver.net.BaseObserver
import com.dahe.gldriver.net.DataManager import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.ui.account.authperson.AuthDrivingActivity import com.dahe.gldriver.ui.account.authperson.AuthDrivingActivity
import com.dahe.gldriver.ui.account.authperson.AuthPersonActivity
import com.dahe.gldriver.ui.account.authteam.AuthTeamActivity import com.dahe.gldriver.ui.account.authteam.AuthTeamActivity
import com.dahe.mylibrary.base.BaseActivity import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.net.CommonResponseBean import com.dahe.mylibrary.net.CommonResponseBean
@ -27,7 +28,7 @@ class SelectRoleActivity : BaseActivity<ActivitySelectRoleBinding>() {
binding.rlPerson.setOnClickListener { binding.rlPerson.setOnClickListener {
ActivityUtils.startActivity(mContext, AuthDrivingActivity::class.java) ActivityUtils.startActivity(mContext, AuthPersonActivity::class.java)
// DataManager.getInstance().setUpDriverRole("0") // DataManager.getInstance().setUpDriverRole("0")
// .subscribeOn(Schedulers.io()) // .subscribeOn(Schedulers.io())
@ -48,9 +49,10 @@ class SelectRoleActivity : BaseActivity<ActivitySelectRoleBinding>() {
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<String>(this) { .subscribe(BaseObserver(mContext, object : RxHttpCallBack<String>(this) {
override fun onSuccess(t: CommonResponseBean<String>) { override fun onSuccess(t: CommonResponseBean<String>) {
super.onSuccess(t) super.onSuccess(t)
ActivityUtils.startActivity(mContext, AuthTeamActivity::class.java)
} }
})) }))
ActivityUtils.startActivity(mContext, AuthTeamActivity::class.java)
} }
} }

View File

@ -113,7 +113,7 @@ class AuthDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
private fun selFrontPic() { private fun selFrontPic() {
OcrUtils.getInstance().ocrDriver(mContext, this) { picPath, result -> OcrUtils.getInstance().ocrDriver(mContext, this) { picPath, result ->
result.data.face?.data.let { result?.data?.face?.data.let {
ImageLoader.getInstance() ImageLoader.getInstance()
.loadRoundImage(mContext, picPath.locPic, 12, binding.ivFront) .loadRoundImage(mContext, picPath.locPic, 12, binding.ivFront)
driverInfoBean.licensePhotoFaceUrl = picPath.picPath driverInfoBean.licensePhotoFaceUrl = picPath.picPath
@ -143,7 +143,7 @@ class AuthDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
private fun selBackPic() { private fun selBackPic() {
OcrUtils.getInstance().ocrDriver(mContext, this) { picPath, result -> OcrUtils.getInstance().ocrDriver(mContext, this) { picPath, result ->
result.data.back?.data.let { result?.data?.back?.data.let {
ImageLoader.getInstance() ImageLoader.getInstance()
.loadRoundImage(mContext, picPath.locPic, 12, binding.ivBack) .loadRoundImage(mContext, picPath.locPic, 12, binding.ivBack)
driverInfoBean.licensePhotoBackUrl = picPath.picPath driverInfoBean.licensePhotoBackUrl = picPath.picPath

View File

@ -2,17 +2,22 @@ package com.dahe.gldriver.ui.account.authperson
import android.os.Bundle import android.os.Bundle
import com.dahe.gldriver.R import com.dahe.gldriver.R
import com.dahe.gldriver.bean.OcrPersonBean import com.dahe.gldriver.base.AppConfig
import com.dahe.gldriver.bean.DiCarColor
import com.dahe.gldriver.bean.UpDrivingInfoBean
import com.dahe.gldriver.databinding.ActivityAuthDrivingBinding import com.dahe.gldriver.databinding.ActivityAuthDrivingBinding
import com.dahe.gldriver.net.BaseObserver import com.dahe.gldriver.net.BaseObserver
import com.dahe.gldriver.net.DataManager import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.oss.OssServiceUtil import com.dahe.gldriver.ui.account.AuthSuccActivity
import com.dahe.gldriver.utils.DicUtils
import com.dahe.gldriver.utils.OcrUtils
import com.dahe.mylibrary.base.BaseActivity import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.net.CommonResponseBean import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.utils.ActivityUtils import com.dahe.mylibrary.utils.ActivityUtils
import com.dahe.mylibrary.utils.ImageLoader import com.dahe.mylibrary.utils.ImageLoader
import com.dahe.mylibrary.utils.PopsUtils import com.dahe.mylibrary.utils.PickerUtils
import com.dahe.mylibrary.utils.TimeUtil
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers import io.reactivex.rxjava3.schedulers.Schedulers
@ -24,30 +29,74 @@ import io.reactivex.rxjava3.schedulers.Schedulers
*/ */
class AuthDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() { class AuthDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
var ossServiceUtil: OssServiceUtil = OssServiceUtil.getInstance()
var upDrivingInfoBean = UpDrivingInfoBean()
override fun initView(savedInstanceState: Bundle?) { override fun initView(savedInstanceState: Bundle?) {
setStatusBarColor(R.color.white) setStatusBarColor(R.color.white)
setTitleBar("实名认证", true) setTitleBar("实名认证", true)
binding.btnOk.setOnClickListener { binding.btnOk.setOnClickListener {
ActivityUtils.startActivity(mContext, AuthRoadActivity::class.java) subMit()
} }
binding.run { binding.run {
ivFront.setOnClickListener { ivFront.setOnClickListener {
selFrontPic() selFrontPic()
// PopsUtils.getInstance().showSimSelPic(mContext) {
// ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivFront)
// }
} }
ivBack.setOnClickListener { ivBack.setOnClickListener {
selBackPic() selBackPic()
// PopsUtils.getInstance().showSimSelPic(mContext) { }
// ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivBack) ivRoadFront.setOnClickListener {
// } OcrUtils.getInstance()
.noOcrUpPic(mContext, this@AuthDrivingActivity) { picPath, ocrResult ->
ImageLoader.getInstance()
.loadRoundImage(mContext, picPath.locPic, 12, ivRoadFront)
upDrivingInfoBean.roadLicensePhotoUrl = picPath.picPath
}
} }
ivCar.setOnClickListener { ivCar.setOnClickListener {
PopsUtils.getInstance().showSimSelPic(mContext) { OcrUtils.getInstance()
ImageLoader.getInstance().loadRoundImage(mContext, it[0].path, 12, ivCar) .noOcrUpPic(mContext, this@AuthDrivingActivity) { picPath, ocrResult ->
ImageLoader.getInstance()
.loadRoundImage(mContext, picPath.locPic, 12, ivCar)
upDrivingInfoBean.carUrl = picPath.picPath
}
}
tvDate.setOnClickListener {
PickerUtils.getInstance().showDateSim(this@AuthDrivingActivity) {
tvDate.text = it
}
}
//车辆类型
tvCarType.setOnClickListener {
//车辆类型
DicUtils.getInstance()
.selectDicCarType(mContext, this@AuthDrivingActivity, isLoading = true) { position, item ->
var data = item as DiCarColor
tvCarType.text = data.dictLabel
upDrivingInfoBean.run {
vehicleTypeCode = data.dictValue
vehicleType = data.dictLabel
}
}
}
tvEnd.setOnClickListener {
PickerUtils.getInstance().showDateSim(this@AuthDrivingActivity) {
tvEnd.text = it
}
}
tvCarColor.setOnClickListener {
DicUtils.getInstance()
.getCarColor(mContext, this@AuthDrivingActivity) { position, item ->
var data = item as DiCarColor
tvCarColor.text = data.dictLabel
upDrivingInfoBean.run {
plateColorCode = data.dictValue
plateColor = data.dictLabel
}
} }
} }
} }
@ -56,87 +105,182 @@ class AuthDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
override fun initDate() { override fun initDate() {
} }
/**
* 行驶证正面
*/
private fun selFrontPic() { private fun selFrontPic() {
PopsUtils.getInstance().showSimSelPic(mContext) { OcrUtils.getInstance().ocrDriveing(mContext, this) { picPath, result ->
var data = it[0] ImageLoader.getInstance()
ossServiceUtil.asyncPutImage(data.realPath, this@AuthDrivingActivity) .loadRoundImage(mContext, picPath.locPic, 12, binding.ivFront)
ossServiceUtil.setResultCallBack { data, oldPath -> upDrivingInfoBean.licenseFaceUrl = picPath.picPath//行驶证照片(正面)
DataManager.getInstance().recognizeVehicleLicense(oldPath) result?.data?.face?.data?.let {
.subscribeOn(Schedulers.io()) var isHasFow = it.vehicleType.contains("牵引车")
.observeOn(AndroidSchedulers.mainThread()) upDrivingInfoBean.isTrailer = if (isHasFow) "1" else "0"//是否有挂车(0否 1是)
.subscribe(
BaseObserver(mContext,
object : RxHttpCallBack<OcrPersonBean>() { //识别车辆类型后调用接口匹配code值
override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) { DicUtils.getInstance()
super.onSuccess(t) .getCarTypeByValue(mContext, it.vehicleType) { position, item ->
t.data.data.face?.data?.let { if (item != null) {
var data = item as DiCarColor
upDrivingInfoBean.run {
vehicleTypeCode = data.dictValue
vehicleType = data.dictLabel
}
binding.tvCarType.text = data.dictLabel
}
}
binding.run { binding.run {
etCarNum.setText(it.licensePlateNumber) etCarNum.setText(it.licensePlateNumber)
etOwner.setText(it.owner) etOwner.setText(it.owner)
etUseNature.setText(it.useNature) etUseNature.setText(it.useNature)
etCurbWeight.setText(it.curbWeight) etCurbWeight.setText(it.curbWeight)
etPermittedWeight.setText(it.permittedWeight) etPermittedWeight.setText(it.permittedWeight)
tvCarType.text = it.vehicleType
} }
} }
// t.data.data.face?.data.let {
// driverInfoBean.licensePhotoFaceUrl = oldPath
// it?.run {
// driverInfoBean.run {
// licenseApproveOrganization =
// issueAuthority //发证机关
// }
//
//
// binding.run {
// etName.setText(it.name)
// etId.setText(it.licenseNumber)
// tvCarType.text = it.approvedType
// if (validPeriod.contains("至")) {
// val split = validPeriod.split("至")
// tvStart.text = split[0]
// tvEnd.text =
// if (split.size == 2) split[1] else ""
// }
// }
// }
// }
}
})
)
}
ImageLoader.getInstance().loadRoundImage(mContext, data.realPath, 12, binding.ivFront)
} }
} }
private fun selBackPic() { private fun selBackPic() {
PopsUtils.getInstance().showSimSelPic(mContext) {
var data = it[0] OcrUtils.getInstance().ocrDriveing(mContext, this) { picPath, result ->
ossServiceUtil.asyncPutImage(data.realPath, this@AuthDrivingActivity) ImageLoader.getInstance()
ossServiceUtil.setResultCallBack { data, oldPath -> .loadRoundImage(mContext, picPath.locPic, 12, binding.ivBack)
run { upDrivingInfoBean.licenseBackUrl = picPath.picPath//行驶证照片(反面)
DataManager.getInstance().recognizeVehicleLicense(oldPath)
.subscribeOn(Schedulers.io()) result?.data?.back?.data?.let {
.observeOn(AndroidSchedulers.mainThread()) if (it.inspectionRecord.length > 13) {
.subscribe( val changeDateNoneFormat = TimeUtil.changeDateNoneFormat(
BaseObserver(mContext, it.inspectionRecord.substring(6, 14),
object : RxHttpCallBack<OcrPersonBean>() { "yyyy年MM月"
override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) { )
super.onSuccess(t) if (!changeDateNoneFormat.isNullOrEmpty()) {
// t.data.data.back?.data.let { upDrivingInfoBean.licenseValidity = changeDateNoneFormat//行驶证到期时间
// driverInfoBean.licensePhotoBackUrl = oldPath binding.tvEnd.text = changeDateNoneFormat
}
}
//车长
val split = it.overallDimension.split("mm")[0].split("X")
if (split!=null&&split.size>2){
upDrivingInfoBean.run {
carLong = split[0]
carWidth = split[1]
carHeight = split[2]
}
}
upDrivingInfoBean.tractionWeight = it.tractionWeight
upDrivingInfoBean.energySignCode = it.energySign
binding.run {
etCurbWeight.setText(it.curbWeight)//整备质量
etPermittedWeight.setText(it.permittedWeight)//核定载质量
}
}
}
// PopsUtils.getInstance().showSimSelPic(mContext) {
// var data = it[0]
// ossServiceUtil.asyncPutImage(data.realPath, this@AuthDrivingActivity)
// ossServiceUtil.setResultCallBack { data, oldPath ->
// run {
// DataManager.getInstance().recognizeVehicleLicense(oldPath)
// .subscribeOn(Schedulers.io())
// .observeOn(AndroidSchedulers.mainThread())
// .subscribe(
// BaseObserver(mContext,
// object : RxHttpCallBack<OcrPersonBean>() {
// override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) {
// super.onSuccess(t)
//// t.data.data.back?.data.let {
//// driverInfoBean.licensePhotoBackUrl = oldPath
//// }
// }
// })
// )
//
// }
// }
//
//
// ImageLoader.getInstance().loadRoundImage(mContext, data.realPath, 12, binding.ivBack)
// } // }
} }
private fun subMit() {
binding.run {
if (etCarNum.text.isNullOrEmpty() ||
tvCarType.text.isNullOrEmpty() ||
tvEnd.text.isNullOrEmpty() ||
tvCarColor.text.isNullOrEmpty()
) {
showToast("请完善车辆信息")
return@subMit
}
}
upDrivingInfoBean.run {
roadLicenseValidity = binding.tvDate.text.toString()//道路有效期
licenseValidity = binding.tvEnd.text.toString()//行驶证有效期
roadLicense = binding.etID.text.toString()//道路运输许可证号
vehicleNum = binding.etCarNum.text.trim().toString()
vehicleType = binding.tvCarType.text.trim().toString()
plateColor = binding.tvCarColor.text.trim().toString()
}
DataManager.getInstance().addCar(upDrivingInfoBean)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<UpDrivingInfoBean>() {
override fun onSuccess(t: CommonResponseBean<UpDrivingInfoBean>) {
super.onSuccess(t)
if (upDrivingInfoBean.isTrailer == "1") {
finish()
ActivityUtils.startActivity(mContext, AuthTrailerActivity::class.java,Bundle().apply {
putString(AppConfig.CAR_ID,t.data.carId)
}) })
) } else {
ActivityUtils.startActivity(mContext, AuthSuccActivity::class.java)
} }
} }
}))
}
ImageLoader.getInstance().loadRoundImage(mContext, data.realPath, 12, binding.ivBack) /**
* 根据车牌号查询车辆信任
* @param carNum String
*/
private fun getCarInfoByCarNum(carNum: String) {
DataManager.getInstance().getCarByCarVehicleNum(carNum)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<UpDrivingInfoBean>() {
override fun onSuccess(t: CommonResponseBean<UpDrivingInfoBean>) {
super.onSuccess(t)
t.data.let {
binding.run {
ImageLoader.getInstance()
.loadRoundImage(mContext, it.licenseFaceUrl, 12, ivFront)
ImageLoader.getInstance()
.loadRoundImage(mContext, it.licenseBackUrl, 12, ivBack)
ImageLoader.getInstance()
.loadRoundImage(mContext, it.carUrl, 12, ivCar)
ImageLoader.getInstance()
.loadRoundImage(mContext, it.roadLicensePhotoUrl, 12, ivRoadFront)
etCarNum.setText(it.vehicleNum)
etOwner.setText(it.owner)
tvCarType.text = it.vehicleType
etUseNature.setText(it.useNature)
etID.setText(it.roadLicense)
tvDate.text = it.roadLicenseValidity
} }
} }
}
}))
}
} }

View File

@ -3,6 +3,7 @@ package com.dahe.gldriver.ui.account.authperson
import android.os.Bundle import android.os.Bundle
import com.dahe.gldriver.R import com.dahe.gldriver.R
import com.dahe.gldriver.databinding.ActivityAuthFaceBinding import com.dahe.gldriver.databinding.ActivityAuthFaceBinding
import com.dahe.gldriver.ui.account.AuthSuccActivity
import com.dahe.mylibrary.base.BaseActivity import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.utils.ActivityUtils import com.dahe.mylibrary.utils.ActivityUtils
@ -17,7 +18,7 @@ class AuthFaceActivity : BaseActivity<ActivityAuthFaceBinding>() {
setStatusBarColor(R.color.white) setStatusBarColor(R.color.white)
setTitleBar("实名认证",true) setTitleBar("实名认证",true)
binding.btnOk.setOnClickListener { binding.btnOk.setOnClickListener {
ActivityUtils.startActivity(mContext,AuthDrivingActivity::class.java) ActivityUtils.startActivity(mContext,AuthSuccActivity::class.java)
} }
} }

View File

@ -84,7 +84,7 @@ class AuthPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
OcrUtils.getInstance().ocrPerson(mContext,this@AuthPersonActivity){picPath,result-> OcrUtils.getInstance().ocrPerson(mContext,this@AuthPersonActivity){picPath,result->
ImageLoader.getInstance().loadRoundImage(mContext, picPath.locPic, 12, ivFront) ImageLoader.getInstance().loadRoundImage(mContext, picPath.locPic, 12, ivFront)
perInfoBean.idcardFrontUrl = picPath.picPath perInfoBean.idcardFrontUrl = picPath.picPath
result.data.face?.data.let { result?.data?.face?.data.let {
it?.run { it?.run {
perInfoBean.run { perInfoBean.run {
idcardNo = idNumber idcardNo = idNumber

View File

@ -3,15 +3,23 @@ package com.dahe.gldriver.ui.account.authperson
import android.os.Bundle import android.os.Bundle
import com.dahe.gldriver.R import com.dahe.gldriver.R
import com.dahe.gldriver.bean.UpQualiInfoBean import com.dahe.gldriver.bean.UpQualiInfoBean
import com.dahe.gldriver.bean.UpRoadInfoBean
import com.dahe.gldriver.databinding.ActivityAuthRoadBinding import com.dahe.gldriver.databinding.ActivityAuthRoadBinding
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.oss.OssServiceUtil
import com.dahe.gldriver.ui.account.AuthSuccActivity
import com.dahe.gldriver.ui.account.SelectRoleActivity import com.dahe.gldriver.ui.account.SelectRoleActivity
import com.dahe.mylibrary.base.BaseActivity import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.utils.ActivityUtils import com.dahe.mylibrary.utils.ActivityUtils
import com.dahe.mylibrary.utils.ImageLoader import com.dahe.mylibrary.utils.ImageLoader
import com.dahe.mylibrary.utils.PickerUtils import com.dahe.mylibrary.utils.PickerUtils
import com.dahe.mylibrary.utils.PopsUtils import com.dahe.mylibrary.utils.PopsUtils
import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
/** /**
* @ClassName AuthRoadActivity * @ClassName AuthRoadActivity
@ -22,18 +30,18 @@ import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener
class AuthRoadActivity : BaseActivity<ActivityAuthRoadBinding>() { class AuthRoadActivity : BaseActivity<ActivityAuthRoadBinding>() {
var ossServiceUtil: OssServiceUtil = OssServiceUtil.getInstance() var ossServiceUtil: OssServiceUtil = OssServiceUtil.getInstance()
var upQuaInfo = UpQualiInfoBean() var upRoad = UpRoadInfoBean()
override fun initView(savedInstanceState: Bundle?) { override fun initView(savedInstanceState: Bundle?) {
setStatusBarColor(R.color.white) setStatusBarColor(R.color.white)
setTitleBar("实名认证",true) setTitleBar("实名认证",true)
binding.run { binding.run {
btnOk.setOnClickListener { btnOk.setOnClickListener {
ActivityUtils.startActivity(mContext, SelectRoleActivity::class.java) subMit()
} }
tvDate.setOnClickListener { tvDate.setOnClickListener {
PickerUtils.getInstance().showDate(this@AuthRoadActivity){ date -> PickerUtils.getInstance().showDate(this@AuthRoadActivity){ date ->
// upRoad.roadLicenseValidity = date
} }
} }
ivFront.setOnClickListener { ivFront.setOnClickListener {
@ -46,4 +54,22 @@ class AuthRoadActivity : BaseActivity<ActivityAuthRoadBinding>() {
override fun initDate() { override fun initDate() {
} }
private fun subMit() {
upRoad.run {
roadLicense = binding.etID.text.trim().toString()
// qualificationCertificateNo = binding.etId.text.toString()
// qualificationCertificateEffectiveEnd = binding.tvDate.text.toString()
DataManager.getInstance().setUpRoadLicense(upRoad)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<String>() {
override fun onSuccess(t: CommonResponseBean<String>) {
super.onSuccess(t)
ActivityUtils.startActivity(mContext, AuthSuccActivity::class.java)
}
}))
}
}
} }

View File

@ -0,0 +1,177 @@
package com.dahe.gldriver.ui.account.authperson
import android.os.Bundle
import com.dahe.gldriver.R
import com.dahe.gldriver.base.AppConfig
import com.dahe.gldriver.bean.DiCarColor
import com.dahe.gldriver.bean.UpDrivingInfoBean
import com.dahe.gldriver.databinding.ActivityAuthTrailerBinding
import com.dahe.gldriver.net.BaseObserver
import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.ui.account.AuthSuccActivity
import com.dahe.gldriver.utils.DicUtils
import com.dahe.gldriver.utils.OcrUtils
import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.utils.ActivityUtils
import com.dahe.mylibrary.utils.ImageLoader
import com.dahe.mylibrary.utils.PickerUtils
import com.dahe.mylibrary.utils.TimeUtil
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
/**
* @ClassName AuthTrailerActivity
* @Author john
* @Date 2024/3/11 10:00
* @Description TODO
*/
class AuthTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
var carId :String = ""
var upDrivingInfoBean = UpDrivingInfoBean()
override fun initView(savedInstanceState: Bundle?) {
setStatusBarColor(R.color.white)
setTitleBar("实名认证", true)
carId = intent.extras?.getString(AppConfig.CAR_ID,"").toString()
binding.run {
ivFront.setOnClickListener {
selFrontPic()
}
ivBack.setOnClickListener {
selBackPic()
}
tvCarType.setOnClickListener {
//车辆类型
DicUtils.getInstance()
.selectDicCarType(mContext, this@AuthTrailerActivity,"重型自卸半挂车",true) { position, item ->
var data = item as DiCarColor
tvCarType.text = data.dictLabel
upDrivingInfoBean.run {
vehicleTypeCode = data.dictValue
vehicleType = data.dictLabel
}
}
}
tvCarColor.setOnClickListener {
DicUtils.getInstance()
.getCarColor(mContext, this@AuthTrailerActivity,true) { position, item ->
var data = item as DiCarColor
tvCarColor.text = data.dictLabel
upDrivingInfoBean.run {
trailerPlateColorCode = data.dictValue
trailerPlateColor = data.dictLabel
}
}
}
tvEnd.setOnClickListener {
PickerUtils.getInstance().showDateSim(this@AuthTrailerActivity) {
tvEnd.text = it
upDrivingInfoBean.licenseValidity = it
}
}
btnOk.setOnClickListener {
subMint()
}
}
}
override fun initDate() {
}
/**
* 行驶证正面
*/
private fun selFrontPic() {
OcrUtils.getInstance().ocrDriveing(mContext, this) { picPath, result ->
ImageLoader.getInstance()
.loadRoundImage(mContext, picPath.locPic, 12, binding.ivFront)
upDrivingInfoBean.licenseFaceUrl = picPath.picPath//行驶证照片(正面)
result?.data?.face?.data?.let {
//识别车辆类型后调用接口匹配code值
DicUtils.getInstance()
.getCarTypeByValue(mContext, it.vehicleType) { position, item ->
if (item != null) {
var data = item as DiCarColor
upDrivingInfoBean.run {
vehicleTypeCode = data.dictValue
vehicleType = data.dictLabel
}
binding.tvCarType.text = data.dictLabel
}
}
binding.run {
etCarNum.setText(it.licensePlateNumber)
etUseNature.setText(it.useNature)
}
}
}
}
private fun selBackPic() {
OcrUtils.getInstance().ocrDriveing(mContext, this) { picPath, result ->
ImageLoader.getInstance()
.loadRoundImage(mContext, picPath.locPic, 12, binding.ivBack)
upDrivingInfoBean.licenseBackUrl = picPath.picPath//行驶证照片(反面)
result?.data?.back?.data?.let {
if (it.inspectionRecord.length > 19) {
//行驶证到期时间
val changeDateNoneFormat = TimeUtil.changeDateNoneFormat(
it.inspectionRecord.substring(12, 19),
"yyyy年MM月"
)
if (!changeDateNoneFormat.isNullOrEmpty()) {
upDrivingInfoBean.licenseValidity = changeDateNoneFormat
binding.tvEnd.text = changeDateNoneFormat
}
}
}
}
}
private fun subMint() {
if (binding.tvCarType.text.isNullOrEmpty() ||
binding.etCarNum.text.isNullOrEmpty() ||
binding.tvCarColor.text.isNullOrEmpty() ||
upDrivingInfoBean.licenseFaceUrl.isNullOrEmpty() ||
upDrivingInfoBean.licenseBackUrl.isNullOrEmpty() ||
binding.tvEnd.text.isNullOrEmpty()
) {
showToast("请完善证件信息")
return
}
upDrivingInfoBean.run {
vehicleNum = binding.etCarNum.text.trim().toString()
vehicleType = binding.tvCarType.text.trim().toString()//车辆类型
licenseValidity = binding.tvEnd.text.trim().toString()
trailerPlateColor = binding.tvCarColor.text.trim().toString()
carId = this@AuthTrailerActivity.carId
}
DataManager.getInstance().addTrailer(upDrivingInfoBean)
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Int>() {
override fun onSuccess(t: CommonResponseBean<Int>) {
super.onSuccess(t)
ActivityUtils.startActivity(mContext, AuthSuccActivity::class.java)
}
}))
}
}

View File

@ -29,11 +29,9 @@ import io.reactivex.rxjava3.schedulers.Schedulers
class AuthTeamActivity : BaseActivity<ActivityAuthTeamBinding>(), View.OnClickListener { class AuthTeamActivity : BaseActivity<ActivityAuthTeamBinding>(), View.OnClickListener {
private var checkTeamType = 1 //1代表运输公司0代表个人车队 private var checkTeamType = 1 //1代表运输公司0代表个人车队
var fff : MutableList<String> = mutableListOf("sdfsdf","asdfasdf")
var ossServiceUtil: OssServiceUtil = OssServiceUtil.getInstance() var ossServiceUtil: OssServiceUtil = OssServiceUtil.getInstance()
var upComInfoBean: AuthTeamBean = AuthTeamBean("1")//公司车队 var upComInfoBean: AuthTeamBean = AuthTeamBean("1")//企业车队
var upPerInfoBean: AuthTeamBean = AuthTeamBean("0")//个人车队 var upPerInfoBean: AuthTeamBean = AuthTeamBean("0")//个人车队
override fun initView(savedInstanceState: Bundle?) { override fun initView(savedInstanceState: Bundle?) {
@ -49,7 +47,7 @@ class AuthTeamActivity : BaseActivity<ActivityAuthTeamBinding>(), View.OnClickLi
.ocrBusinessCard(mContext, this@AuthTeamActivity) { picPath, result -> .ocrBusinessCard(mContext, this@AuthTeamActivity) { picPath, result ->
upComInfoBean.businessLicensePhoneUrl = picPath.picPath upComInfoBean.businessLicensePhoneUrl = picPath.picPath
result.data?.run { result?.data?.run {
upComInfoBean.businessLicenseCreditCode = creditCode upComInfoBean.businessLicenseCreditCode = creditCode
upComInfoBean.businessLicenseEffectiveStart= TimeUtil.changeDateNoneFormat(validFromDate) upComInfoBean.businessLicenseEffectiveStart= TimeUtil.changeDateNoneFormat(validFromDate)
upComInfoBean.businessLicenseEffectiveEnd=TimeUtil.changeDateNoneFormat(validToDate) upComInfoBean.businessLicenseEffectiveEnd=TimeUtil.changeDateNoneFormat(validToDate)
@ -65,7 +63,7 @@ class AuthTeamActivity : BaseActivity<ActivityAuthTeamBinding>(), View.OnClickLi
.ocrPerson(mContext, this@AuthTeamActivity) { picPath, result -> .ocrPerson(mContext, this@AuthTeamActivity) { picPath, result ->
ImageLoader.getInstance() ImageLoader.getInstance()
.loadRoundImage(mContext, picPath.locPic, 12, ivComFront) .loadRoundImage(mContext, picPath.locPic, 12, ivComFront)
result.data.face?.data?.run { result?.data?.face?.data?.run {
etName.setText(name) etName.setText(name)
etId.setText(idNumber) etId.setText(idNumber)
upComInfoBean.run { upComInfoBean.run {
@ -85,7 +83,7 @@ class AuthTeamActivity : BaseActivity<ActivityAuthTeamBinding>(), View.OnClickLi
.ocrPerson(mContext, this@AuthTeamActivity) { picPath, result -> .ocrPerson(mContext, this@AuthTeamActivity) { picPath, result ->
ImageLoader.getInstance() ImageLoader.getInstance()
.loadRoundImage(mContext, picPath.locPic, 12, ivComBack) .loadRoundImage(mContext, picPath.locPic, 12, ivComBack)
result.data.back?.data?.run { result?.data?.back?.data?.run {
if (validPeriod.contains("-")) { if (validPeriod.contains("-")) {
val split = validPeriod.split("-") val split = validPeriod.split("-")
tvStart.text = TimeUtil.changeDateFormat(split[0]) tvStart.text = TimeUtil.changeDateFormat(split[0])
@ -105,7 +103,7 @@ class AuthTeamActivity : BaseActivity<ActivityAuthTeamBinding>(), View.OnClickLi
.ocrPerson(mContext, this@AuthTeamActivity) { picPath, result -> .ocrPerson(mContext, this@AuthTeamActivity) { picPath, result ->
ImageLoader.getInstance() ImageLoader.getInstance()
.loadRoundImage(mContext, picPath.locPic, 12, ivFront) .loadRoundImage(mContext, picPath.locPic, 12, ivFront)
result.data.face?.data?.run { result?.data?.face?.data?.run {
etPerName.setText(name) etPerName.setText(name)
etPerId.setText(idNumber) etPerId.setText(idNumber)
@ -127,7 +125,7 @@ class AuthTeamActivity : BaseActivity<ActivityAuthTeamBinding>(), View.OnClickLi
.ocrPerson(mContext, this@AuthTeamActivity) { picPath, result -> .ocrPerson(mContext, this@AuthTeamActivity) { picPath, result ->
ImageLoader.getInstance() ImageLoader.getInstance()
.loadRoundImage(mContext, picPath.locPic, 12, ivBack) .loadRoundImage(mContext, picPath.locPic, 12, ivBack)
result.data.back?.data?.run { result?.data?.back?.data?.run {
if (validPeriod.contains("-")) { if (validPeriod.contains("-")) {
val split = validPeriod.split("-") val split = validPeriod.split("-")
tvPerStart.text = TimeUtil.changeDateFormat(split[0]) tvPerStart.text = TimeUtil.changeDateFormat(split[0])
@ -151,7 +149,7 @@ class AuthTeamActivity : BaseActivity<ActivityAuthTeamBinding>(), View.OnClickLi
.ocrBankCard(mContext, this@AuthTeamActivity) { picPath, result -> .ocrBankCard(mContext, this@AuthTeamActivity) { picPath, result ->
ImageLoader.getInstance() ImageLoader.getInstance()
.loadRoundImage(mContext, picPath.locPic, 12, ivBank) .loadRoundImage(mContext, picPath.locPic, 12, ivBank)
result.data.run { result?.data?.run {
etPerBankId.setText(cardNumber) etPerBankId.setText(cardNumber)
tvPerBankName.setText(bankName) tvPerBankName.setText(bankName)
upPerInfoBean.run { upPerInfoBean.run {
@ -175,7 +173,7 @@ class AuthTeamActivity : BaseActivity<ActivityAuthTeamBinding>(), View.OnClickLi
.ocrBankCard(mContext, this@AuthTeamActivity) { picPath, result -> .ocrBankCard(mContext, this@AuthTeamActivity) { picPath, result ->
ImageLoader.getInstance() ImageLoader.getInstance()
.loadRoundImage(mContext, picPath.locPic, 12, ivComBank) .loadRoundImage(mContext, picPath.locPic, 12, ivComBank)
result.data?.run { result?.data?.run {
binding.let { binding.let {
it.etComBankId.setText(cardNumber) it.etComBankId.setText(cardNumber)
it.etComBankName.setText(bankName) it.etComBankName.setText(bankName)

View File

@ -17,6 +17,7 @@ import com.dahe.gldriver.event.OrderStauEvent
import com.dahe.gldriver.net.BaseObserver import com.dahe.gldriver.net.BaseObserver
import com.dahe.gldriver.net.DataManager import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.ui.account.authperson.AuthDrivingActivity
import com.dahe.gldriver.ui.waybill.activity.WaybillDetailActivity import com.dahe.gldriver.ui.waybill.activity.WaybillDetailActivity
import com.dahe.gldriver.ui.waybill.activity.WaybillUpPicActivity import com.dahe.gldriver.ui.waybill.activity.WaybillUpPicActivity
import com.dahe.gldriver.utils.CommonPopUtils import com.dahe.gldriver.utils.CommonPopUtils
@ -77,12 +78,6 @@ class HomeFragment : BaseFragment<FragmentHomeBinding>(), RefreshCallBack {
tvMar.isSelected = true tvMar.isSelected = true
ivMyWaybill.setOnClickListener { ivMyWaybill.setOnClickListener {
// TODO: 调试图片上传
// ActivityUtils.startActivity(mContext,WaybillUpPicActivity::class.java,Bundle().apply {
// putInt(AppConfig.SUCCESS_TYPE,1)
// })
if (this@HomeFragment.mListener != null) if (this@HomeFragment.mListener != null)
this@HomeFragment?.mListener?.invoke(2) this@HomeFragment?.mListener?.invoke(2)
} }

View File

@ -0,0 +1,115 @@
package com.dahe.gldriver.ui.mine
import android.graphics.Color
import android.os.Bundle
import android.widget.LinearLayout
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.dahe.gldriver.R
import com.dahe.gldriver.adapter.CarsAdapter
import com.dahe.gldriver.adapter.DriversAdapter
import com.dahe.gldriver.base.AppConfig
import com.dahe.gldriver.bean.DriverBean
import com.dahe.gldriver.databinding.ActivityInviteDriverBinding
import com.dahe.gldriver.net.BaseObserver
import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.utils.CommonPopUtils
import com.dahe.mylibrary.base.BaseActivity
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 com.lxj.xpopup.util.KeyboardUtils
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
/**
* @ClassName InviteDriverActivity
* @Author john
* @Date 2024/3/11 16:13
* @Description 搜索司机
*/
class InviteDriverActivity : BaseActivity<ActivityInviteDriverBinding>(), RefreshCallBack {
lateinit var adapter: DriversAdapter
override fun initView(savedInstanceState: Bundle?) {
setStatusBarColor(R.color.white)
setTitleBar("邀请司机", true)
binding.run {
setRefresh(refresh, this@InviteDriverActivity)
adapter = recycler.run {
layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
addItemDecoration(
RecycleViewDivider(
LinearLayout.VERTICAL,
ConvertUtils.dp2px(16.0f),
Color.TRANSPARENT
)
)
adapter = DriversAdapter(true)
adapter as DriversAdapter
}.apply {
isStateViewEnable = true
setStateViewLayout(mContext, R.layout.empty_view)
addOnItemChildClickListener(R.id.tvInvite) { _, _, postion ->
var data = items[postion] as DriverBean
CommonPopUtils.getInstance()
.showCommCenterPop(mContext, content = """确定邀请 ${data.idcardName} 加入车队?""") {
DataManager.getInstance().askToDriver(DriverBean().apply {
driverId = data.driverId
}).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Int>() {
override fun onSuccess(t: CommonResponseBean<Int>) {
super.onSuccess(t)
showToast("邀请成功,等待对方同意")
}
}))
}
}
}
tvSearch.setOnClickListener {
KeyboardUtils.hideSoftInput(etPhone)
getDrivers()
}
}
}
override fun initDate() {
}
override fun getRefreshDate(stat: Int, page: Int, count: Int) {
}
private fun getDrivers() {
val phone = binding.etPhone.text.toString()
if (phone.isNullOrEmpty()){
return
}
DataManager.getInstance().selectDriverList(phone).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext,object : RxHttpCallBack<MutableList<DriverBean>>(){
override fun onSuccess(t: CommonResponseBean<MutableList<DriverBean>>) {
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
)
}
}))
}
}

View File

@ -0,0 +1,140 @@
package com.dahe.gldriver.ui.mine
import android.graphics.Color
import android.os.Bundle
import android.widget.LinearLayout
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.dahe.gldriver.R
import com.dahe.gldriver.adapter.CarsAdapter
import com.dahe.gldriver.adapter.DriversAdapter
import com.dahe.gldriver.adapter.InviteRecordAdapter
import com.dahe.gldriver.base.AppConfig
import com.dahe.gldriver.bean.DriverBean
import com.dahe.gldriver.bean.InviteRecord
import com.dahe.gldriver.databinding.ActivityInviteDriverBinding
import com.dahe.gldriver.databinding.ActivityInviteRecordBinding
import com.dahe.gldriver.net.BaseObserver
import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.utils.CommonPopUtils
import com.dahe.mylibrary.base.BaseActivity
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 com.lxj.xpopup.util.KeyboardUtils
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
/**
* @ClassName InviteDriverActivity
* @Author john
* @Date 2024/3/11 16:13
* @Description 邀请记录
*/
class InviteRecordActivity : BaseActivity<ActivityInviteRecordBinding>(), RefreshCallBack {
lateinit var adapter: InviteRecordAdapter
override fun initView(savedInstanceState: Bundle?) {
setStatusBarColor(R.color.white)
setTitleBar("邀请记录", true)
binding.run {
setRefresh(refresh, this@InviteRecordActivity)
adapter = recycler.run {
layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
addItemDecoration(
RecycleViewDivider(
LinearLayout.VERTICAL,
ConvertUtils.dp2px(16.0f),
Color.TRANSPARENT
)
)
adapter = InviteRecordAdapter()
adapter as InviteRecordAdapter
}.apply {
isStateViewEnable = true
setStateViewLayout(mContext, R.layout.empty_view)
addOnItemChildClickListener(R.id.tvInvite) { _, _, postion ->
var data = items[postion] as DriverBean
CommonPopUtils.getInstance()
.showCommCenterPop(
mContext,
content = """确定邀请 ${data.idcardName} 加入车队?"""
) {
DataManager.getInstance().askToDriver(DriverBean().apply {
driverId = data.driverId
}).subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Int>() {
override fun onSuccess(t: CommonResponseBean<Int>) {
super.onSuccess(t)
showToast("邀请成功,等待对方同意")
}
}))
}
}
}
}
}
override fun initDate() {
DataManager.getInstance().selectCaptainAskByDriverHistoryList().subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<MutableList<InviteRecord>>() {
override fun onSuccess(t: CommonResponseBean<MutableList<InviteRecord>>) {
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 getRefreshDate(stat: Int, page: Int, count: Int) {
initDate()
}
/**
* TODO
* 获取邀请记录
*/
private fun getRecord() {
DataManager.getInstance().selectCaptainAskByDriverHistoryList().subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<MutableList<InviteRecord>>() {
override fun onSuccess(t: CommonResponseBean<MutableList<InviteRecord>>) {
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
)
}
}))
}
}

View File

@ -10,14 +10,13 @@ import com.dahe.gldriver.databinding.FragmentMineBinding
import com.dahe.gldriver.ui.account.authperson.AuthPartyActivity import com.dahe.gldriver.ui.account.authperson.AuthPartyActivity
import com.dahe.gldriver.ui.mine.activity.CarTeamActivity import com.dahe.gldriver.ui.mine.activity.CarTeamActivity
import com.dahe.gldriver.ui.mine.activity.CarsManActivity import com.dahe.gldriver.ui.mine.activity.CarsManActivity
import com.dahe.gldriver.ui.mine.activity.DriverTeamsActivity
import com.dahe.gldriver.ui.mine.activity.PersonInfoActivity import com.dahe.gldriver.ui.mine.activity.PersonInfoActivity
import com.dahe.gldriver.ui.mine.activity.RulesActivity
import com.dahe.gldriver.ui.mine.activity.WalletActivity import com.dahe.gldriver.ui.mine.activity.WalletActivity
import com.dahe.gldriver.utils.SPUtils import com.dahe.gldriver.utils.SPUtils
import com.dahe.mylibrary.base.BaseFragment import com.dahe.mylibrary.base.BaseFragment
import com.dahe.mylibrary.utils.ActivityUtils import com.dahe.mylibrary.utils.ActivityUtils
import com.dahe.mylibrary.utils.ToastUtils import com.dahe.mylibrary.utils.ToastUtils
import com.tencent.bugly.crashreport.CrashReport
class MineFragment : BaseFragment<FragmentMineBinding>(), View.OnClickListener { class MineFragment : BaseFragment<FragmentMineBinding>(), View.OnClickListener {
private val tools = mutableListOf( private val tools = mutableListOf(
@ -100,7 +99,13 @@ class MineFragment : BaseFragment<FragmentMineBinding>(), View.OnClickListener {
private fun goTools(pos: Int) { private fun goTools(pos: Int) {
when (pos) { when (pos) {
0 -> { 0 -> {
if (SPUtils.instance.getUserInfo(mContext)?.isCarCaptain == "1") {//车队长
ActivityUtils.startActivity(mContext, CarTeamActivity::class.java) ActivityUtils.startActivity(mContext, CarTeamActivity::class.java)
} else {//司机
ActivityUtils.startActivity(mContext, DriverTeamsActivity::class.java)
}
} }
1 -> { 1 -> {

View File

@ -6,11 +6,24 @@ import android.os.Bundle
import androidx.fragment.app.Fragment import androidx.fragment.app.Fragment
import androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback import androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback
import com.dahe.gldriver.adapter.PagersAdapter import com.dahe.gldriver.adapter.PagersAdapter
import com.dahe.gldriver.base.AppConfig
import com.dahe.gldriver.bean.CaptainBean
import com.dahe.gldriver.databinding.ActivityCarTeamBinding import com.dahe.gldriver.databinding.ActivityCarTeamBinding
import com.dahe.gldriver.net.BaseObserver
import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.ui.mine.InviteRecordActivity
import com.dahe.gldriver.ui.mine.fragment.CarsManFragment import com.dahe.gldriver.ui.mine.fragment.CarsManFragment
import com.dahe.gldriver.ui.mine.fragment.DriversManFragment import com.dahe.gldriver.ui.mine.fragment.DriversManFragment
import com.dahe.gldriver.ui.waybill.fragment.AllWaybillFragment import com.dahe.gldriver.ui.waybill.fragment.AllWaybillFragment
import com.dahe.gldriver.utils.SPUtils
import com.dahe.mylibrary.base.BaseActivity import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.utils.ActivityUtils
import com.dahe.mylibrary.utils.ImageLoader
import com.dahe.mylibrary.utils.ToastUtils
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
import net.lucode.hackware.magicindicator.FragmentContainerHelper import net.lucode.hackware.magicindicator.FragmentContainerHelper
import net.lucode.hackware.magicindicator.buildins.UIUtil import net.lucode.hackware.magicindicator.buildins.UIUtil
import net.lucode.hackware.magicindicator.buildins.commonnavigator.CommonNavigator import net.lucode.hackware.magicindicator.buildins.commonnavigator.CommonNavigator
@ -25,31 +38,37 @@ import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.ColorT
* @ClassName CarTeamActivity * @ClassName CarTeamActivity
* @Author john * @Author john
* @Date 2024/2/6 16:38 * @Date 2024/2/6 16:38
* @Description 车队管理 * @Description 车队-车队管理
*/ */
class CarTeamActivity : BaseActivity<ActivityCarTeamBinding>() { class CarTeamActivity : BaseActivity<ActivityCarTeamBinding>() {
private val mFragmentContainerHelper = FragmentContainerHelper() private val mFragmentContainerHelper = FragmentContainerHelper()
var mFragments = mutableListOf<Fragment>( var mFragments = mutableListOf<Fragment>()
DriversManFragment(),
CarsManFragment(),
AllWaybillFragment()
)
val titles = mutableListOf( val titles = mutableListOf(
"司机管理", "司机管理",
"车辆管理", "车辆管理"
"车队订单"
) )
override fun initView(savedInstanceState: Bundle?) { override fun initView(savedInstanceState: Bundle?) {
setStatusHeightParams(binding.rlTop) setStatusHeightParams(binding.rlTop)
setTitleBar("车队管理",true,true) setTitleBar("车队管理", true, true, "邀请记录") {
ActivityUtils.startActivity(mContext, InviteRecordActivity::class.java)
}
mFragments.run {
add(DriversManFragment().apply {
arguments = Bundle().apply {
putString(AppConfig.ID, SPUtils.instance.getUserInfo(mContext)!!.captainId)
}
})
add(CarsManFragment().apply {
arguments = Bundle().apply {
putString(AppConfig.ID, SPUtils.instance.getUserInfo(mContext)!!.captainId)
}
})
}
var pagerAdapter = PagersAdapter(this, mFragments) var pagerAdapter = PagersAdapter(this, mFragments)
// pagerAdapter.addFragment(AllWaybillFragment())
// pagerAdapter.addFragment(AllWaybillFragment())
// pagerAdapter.addFragment(AllWaybillFragment())
mFragmentContainerHelper.handlePageSelected(0, true) mFragmentContainerHelper.handlePageSelected(0, true)
@ -100,6 +119,19 @@ class CarTeamActivity : BaseActivity<ActivityCarTeamBinding>() {
} }
override fun initDate() { override fun initDate() {
DataManager.getInstance().getCaptainById(SPUtils.instance.getUserInfo(mContext)!!.captainId)
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<CaptainBean>() {
override fun onSuccess(t: CommonResponseBean<CaptainBean>) {
super.onSuccess(t)
val data = t.data
binding.run {
tvCapName.text = data.captainName
tvStatu.text = if (data.isRealname == "0") "未实名" else "已实名"
ImageLoader.getInstance().loadCircleImage(mContext, data.avatar, ivHead)
}
}
}))
} }
private fun switchPages(index: Int) { private fun switchPages(index: Int) {

View File

@ -5,21 +5,19 @@ import android.os.Bundle
import android.widget.LinearLayout import android.widget.LinearLayout
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.LayoutManager
import com.chad.library.adapter4.BaseQuickAdapter
import com.dahe.gldriver.R import com.dahe.gldriver.R
import com.dahe.gldriver.adapter.CarsAdapter import com.dahe.gldriver.adapter.CarsAdapter
import com.dahe.gldriver.adapter.WaybillAdapter
import com.dahe.gldriver.bean.CarBean import com.dahe.gldriver.bean.CarBean
import com.dahe.gldriver.databinding.ActivityCarsManBinding import com.dahe.gldriver.databinding.ActivityCarsManBinding
import com.dahe.gldriver.net.BaseObserver import com.dahe.gldriver.net.BaseObserver
import com.dahe.gldriver.net.DataManager import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.ui.account.authperson.AuthDrivingActivity
import com.dahe.gldriver.utils.CommonPopUtils import com.dahe.gldriver.utils.CommonPopUtils
import com.dahe.glex.bean.WayBillBean
import com.dahe.mylibrary.base.BaseActivity import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.net.CommonResponseBean import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
import com.dahe.mylibrary.utils.ActivityUtils
import com.dahe.mylibrary.utils.ConvertUtils import com.dahe.mylibrary.utils.ConvertUtils
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers import io.reactivex.rxjava3.schedulers.Schedulers
@ -38,8 +36,8 @@ class CarsManActivity : BaseActivity<ActivityCarsManBinding>() {
setTitleBar("车辆管理", true) setTitleBar("车辆管理", true)
binding.run {
adapter = binding.recycler.run { adapter = recycler.run {
layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false) layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
addItemDecoration( addItemDecoration(
RecycleViewDivider( RecycleViewDivider(
@ -53,19 +51,30 @@ class CarsManActivity : BaseActivity<ActivityCarsManBinding>() {
}.apply { }.apply {
addOnItemChildClickListener(R.id.tvUnbind) { adapter, view, position -> addOnItemChildClickListener(R.id.tvUnbind) { adapter, view, position ->
CommonPopUtils.getInstance() CommonPopUtils.getInstance()
.showCommCenterPop(mContext, content = """您确定解绑:${items[position].vehicleNum}么?"""){ .showCommCenterPop(
mContext,
content = """您确定解绑:${items[position].vehicleNum}么?"""
) {
DataManager.getInstance().unBindCar(items[position]) DataManager.getInstance().unBindCar(items[position])
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io())
.subscribe(BaseObserver(mContext,object : RxHttpCallBack<String>(){ .observeOn(AndroidSchedulers.mainThread())
.subscribe(
BaseObserver(mContext,
object : RxHttpCallBack<String>() {
override fun onSuccess(t: CommonResponseBean<String>) { override fun onSuccess(t: CommonResponseBean<String>) {
super.onSuccess(t) super.onSuccess(t)
initDate() unBindCar(items[position].carId)
} }
})) })
)
} }
} }
} }
btnOk.setOnClickListener {
ActivityUtils.startActivity(mContext, AuthDrivingActivity::class.java)
}
}
} }
override fun initDate() { override fun initDate() {
@ -80,4 +89,17 @@ class CarsManActivity : BaseActivity<ActivityCarsManBinding>() {
}) })
) )
} }
private fun unBindCar(carId: String) {
DataManager.getInstance().unBindCar(CarBean().apply {
this.carId = carId
})
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<String>() {
override fun onSuccess(t: CommonResponseBean<String>) {
super.onSuccess(t)
initDate()
}
}))
}
} }

View File

@ -0,0 +1,195 @@
package com.dahe.gldriver.ui.mine.activity
import android.content.Context
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import android.view.View
import androidx.fragment.app.Fragment
import androidx.viewpager2.widget.ViewPager2.OnPageChangeCallback
import com.dahe.gldriver.adapter.PagersAdapter
import com.dahe.gldriver.base.AppConfig
import com.dahe.gldriver.bean.CaptainBean
import com.dahe.gldriver.bean.UpCaptain
import com.dahe.gldriver.databinding.ActivityDriverTeamDetailBinding
import com.dahe.gldriver.net.BaseObserver
import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.ui.mine.fragment.CarsManFragment
import com.dahe.gldriver.ui.mine.fragment.DriversManFragment
import com.dahe.gldriver.utils.CommonPopUtils
import com.dahe.gldriver.utils.SPUtils
import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.utils.ImageLoader
import com.lxj.xpopup.interfaces.OnInputConfirmListener
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
import net.lucode.hackware.magicindicator.FragmentContainerHelper
import net.lucode.hackware.magicindicator.buildins.UIUtil
import net.lucode.hackware.magicindicator.buildins.commonnavigator.CommonNavigator
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.CommonNavigatorAdapter
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IPagerIndicator
import net.lucode.hackware.magicindicator.buildins.commonnavigator.abs.IPagerTitleView
import net.lucode.hackware.magicindicator.buildins.commonnavigator.indicators.LinePagerIndicator
import net.lucode.hackware.magicindicator.buildins.commonnavigator.titles.ColorTransitionPagerTitleView
/**
* @ClassName CarTeamActivity
* @Author john
* @Date 2024/2/6 16:38
* @Description 司机-车队详情
*/
class DriverTeamDetailActivity : BaseActivity<ActivityDriverTeamDetailBinding>() {
lateinit var captainId: String
var upCaptain: UpCaptain = UpCaptain()
private val mFragmentContainerHelper = FragmentContainerHelper()
var mFragments = mutableListOf<Fragment>()
val titles = mutableListOf(
"司机管理",
"车辆管理"
)
override fun initView(savedInstanceState: Bundle?) {
setStatusHeightParams(binding.rlTop)
setTitleBar("车队管理", true, true)
captainId = intent.extras?.getString(AppConfig.ID, "").toString()
mFragments.run {
add(DriversManFragment().apply {
arguments = Bundle().apply {
putString(AppConfig.ID, captainId)
putInt(AppConfig.IS_SHOW, View.GONE)
}
})
add(CarsManFragment().apply {
arguments = Bundle().apply {
putInt(AppConfig.IS_SHOW, View.GONE)
putString(AppConfig.ID, captainId)
}
})
}
var pagerAdapter = PagersAdapter(this, mFragments)
mFragmentContainerHelper.handlePageSelected(0, true)
binding.viewPager.adapter = pagerAdapter
binding.viewPager.currentItem = 0
binding.viewPager.registerOnPageChangeCallback(object : OnPageChangeCallback() {
override fun onPageSelected(position: Int) {
super.onPageSelected(position)
mFragmentContainerHelper.handlePageSelected(position, true)
}
});
var commonNavigator = CommonNavigator(mContext)
commonNavigator.run {
isAdjustMode = true
adapter = object : CommonNavigatorAdapter() {
override fun getCount(): Int {
return titles.size
}
override fun getTitleView(context: Context?, index: Int): IPagerTitleView {
val colorTransitionPagerTitleView = ColorTransitionPagerTitleView(context)
colorTransitionPagerTitleView.normalColor = Color.BLACK
colorTransitionPagerTitleView.selectedColor = Color.RED
colorTransitionPagerTitleView.text = titles[index]
colorTransitionPagerTitleView.setOnClickListener {
mFragmentContainerHelper.handlePageSelected(index)
switchPages(index)
}
return colorTransitionPagerTitleView
}
override fun getIndicator(context: Context?): IPagerIndicator {
val indicator = LinePagerIndicator(context)
indicator.mode = LinePagerIndicator.MODE_WRAP_CONTENT
indicator.yOffset =
UIUtil.dip2px(context, 3.0).toFloat()
indicator.setColors(Color.RED)
return indicator
}
}
}
binding.run {
btnReject.setOnClickListener {
CommonPopUtils.getInstance().showCenterInputPop(mContext, "拒绝原因") {
dealData("2", reject = it)
}
}
btnOk.setOnClickListener {
dealData("1")
}
btnQuit.setOnClickListener {
dealData("1", true)
}
}
binding.magicIndicator.navigator = commonNavigator
mFragmentContainerHelper.attachMagicIndicator(binding.magicIndicator)
}
override fun initDate() {
DataManager.getInstance().getCaptainById(captainId)
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<CaptainBean>() {
override fun onSuccess(t: CommonResponseBean<CaptainBean>) {
super.onSuccess(t)
val data = t.data
binding.run {
tvCapName.text = data.captainName
tvStatu.text = if (data.isRealname == "0") "未实名" else "已实名"
tvPhone.text = """司机:${data.driverNum} 车辆:${data.carNum}"""
ImageLoader.getInstance().loadCircleImage(mContext, data.avatar, ivHead)
llJoin.visibility = if (data.joinStatus == "0") View.VISIBLE else View.GONE
btnQuit.visibility = if (data.joinStatus == "0") View.GONE else View.VISIBLE
}
}
}))
}
private fun switchPages(index: Int) {
binding.viewPager.currentItem = index
}
private fun dealData(status: String, quit: Boolean = false, reject: String = "") {
if (quit) {
DataManager.getInstance().unbindDriver(upCaptain.apply {
captainId = this@DriverTeamDetailActivity.captainId
driverId = SPUtils.instance.getUserInfo(mContext)!!.driverId
})
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<String>() {
override fun onSuccess(t: CommonResponseBean<String>) {
super.onSuccess(t)
setResult(RESULT_OK, Intent().apply { putExtra(AppConfig.REFRSH, true) })
finish()
}
}))
} else {
DataManager.getInstance().responseToCaptain(upCaptain.apply {
joinStatus = status
captainId = this@DriverTeamDetailActivity.captainId
reason = reject
})
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<String>() {
override fun onSuccess(t: CommonResponseBean<String>) {
super.onSuccess(t)
setResult(RESULT_OK, Intent().apply { putExtra(AppConfig.REFRSH, true) })
finish()
}
}))
}
}
}

View File

@ -0,0 +1,108 @@
package com.dahe.gldriver.ui.mine.activity
import android.content.Intent
import android.graphics.Color
import android.os.Bundle
import android.widget.LinearLayout
import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView
import com.dahe.gldriver.R
import com.dahe.gldriver.adapter.DriverTeamsAdapter
import com.dahe.gldriver.base.AppConfig
import com.dahe.gldriver.bean.CaptainBean
import com.dahe.gldriver.bean.DriverBean
import com.dahe.gldriver.databinding.ActivityDriverCarTeamBinding
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.callback.RefreshCallBack
import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
import com.dahe.mylibrary.utils.ActivityUtils
import com.dahe.mylibrary.utils.ConvertUtils
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
/**
* @ClassName CarTeamActivity
* @Author john
* @Date 2024/2/6 16:38
* @Description 司机-车队管理-车队列表
*/
class DriverTeamsActivity : BaseActivity<ActivityDriverCarTeamBinding>(), RefreshCallBack {
lateinit var adapter: DriverTeamsAdapter
override fun initView(savedInstanceState: Bundle?) {
setStatusBarColor(R.color.white)
setTitleBar("车队管理", true)
binding.run {
setRefresh(refresh, this@DriverTeamsActivity)
adapter = recycler.run {
layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
addItemDecoration(
RecycleViewDivider(
LinearLayout.VERTICAL,
ConvertUtils.dp2px(16.0f),
Color.TRANSPARENT
)
)
adapter = DriverTeamsAdapter()
adapter as DriverTeamsAdapter
}.apply {
isStateViewEnable = true
setStateViewLayout(mContext, R.layout.empty_view)
setOnItemClickListener { adapter, view, position ->
ActivityUtils.startActivityForResult(
this@DriverTeamsActivity,
DriverTeamDetailActivity::class.java,
Bundle().apply { putString(AppConfig.ID, items[position].captainId) },
1
)
}
}
}
}
override fun initDate() {
DataManager.getInstance().selectCaptainListInDriver()
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<MutableList<CaptainBean>>() {
override fun onSuccess(t: CommonResponseBean<MutableList<CaptainBean>>) {
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 getRefreshDate(stat: Int, page: Int, count: Int) {
initDate()
}
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
super.onActivityResult(requestCode, resultCode, data)
if (resultCode == RESULT_OK && requestCode == 1) {
var code = data?.getBooleanExtra(AppConfig.REFRSH, false)
mRefreshPage = 1
initDate()
}
}
}

View File

@ -2,20 +2,34 @@ package com.dahe.gldriver.ui.mine.fragment
import android.graphics.Color import android.graphics.Color
import android.os.Bundle import android.os.Bundle
import android.view.View
import android.widget.LinearLayout import android.widget.LinearLayout
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
import androidx.recyclerview.widget.RecyclerView.LayoutManager import androidx.recyclerview.widget.RecyclerView.LayoutManager
import com.dahe.gldriver.R import com.dahe.gldriver.R
import com.dahe.gldriver.adapter.CarsAdapter import com.dahe.gldriver.adapter.CarsAdapter
import com.dahe.gldriver.adapter.DriversAdapter
import com.dahe.gldriver.adapter.WaybillAdapter import com.dahe.gldriver.adapter.WaybillAdapter
import com.dahe.gldriver.base.AppConfig
import com.dahe.gldriver.bean.CarBean
import com.dahe.gldriver.databinding.ActivityCarsManBinding import com.dahe.gldriver.databinding.ActivityCarsManBinding
import com.dahe.gldriver.databinding.FragmentWaybillListBinding import com.dahe.gldriver.databinding.FragmentWaybillListBinding
import com.dahe.gldriver.net.BaseObserver
import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.ui.mine.InviteDriverActivity
import com.dahe.gldriver.utils.SPUtils
import com.dahe.glex.bean.WayBillBean import com.dahe.glex.bean.WayBillBean
import com.dahe.mylibrary.base.BaseActivity import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.base.BaseFragment 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.recycleviewswipe.RecycleViewDivider
import com.dahe.mylibrary.utils.ActivityUtils
import com.dahe.mylibrary.utils.ConvertUtils import com.dahe.mylibrary.utils.ConvertUtils
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
/** /**
* @ClassName CarsManActivity * @ClassName CarsManActivity
@ -23,14 +37,19 @@ import com.dahe.mylibrary.utils.ConvertUtils
* @Date 2024/2/1 08:59 * @Date 2024/2/1 08:59
* @Description 车辆管理 * @Description 车辆管理
*/ */
class CarsManFragment : BaseFragment<FragmentWaybillListBinding>() { class CarsManFragment : BaseFragment<FragmentWaybillListBinding>(), RefreshCallBack {
private var captainId: String = ""
lateinit var adapter: CarsAdapter
override fun onFragmentVisibleChange(isVisible: Boolean) { override fun onFragmentVisibleChange(isVisible: Boolean) {
} }
override fun onFragmentFirstVisible() { override fun onFragmentFirstVisible() {
arguments?.let {
var adapter = binding.recyclerView.run { captainId = it.getString(AppConfig.ID, "")
}
binding.run {
setRefresh(refresh, this@CarsManFragment)
adapter = binding.recyclerView.run {
layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false) layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
addItemDecoration( addItemDecoration(
RecycleViewDivider( RecycleViewDivider(
@ -41,7 +60,43 @@ class CarsManFragment : BaseFragment<FragmentWaybillListBinding>() {
) )
adapter = CarsAdapter() adapter = CarsAdapter()
adapter as CarsAdapter adapter as CarsAdapter
}.apply {
isStateViewEnable = true
} }
llOk.visibility=View.GONE
} }
initData()
}
override fun getRefreshDate(stat: Int, page: Int, count: Int) {
initData()
}
private fun initData() {
DataManager.getInstance()
.selectDriverIdsForCarPage(captainId)
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<MutableList<CarBean>>() {
override fun onSuccess(t: CommonResponseBean<MutableList<CarBean>>) {
super.onSuccess(t)
if (mRefreshPage === 1) {
if (t.data.isNullOrEmpty() || 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
)
}
}))
}
} }

View File

@ -1,7 +1,9 @@
package com.dahe.gldriver.ui.mine.fragment package com.dahe.gldriver.ui.mine.fragment
import android.graphics.Color import android.graphics.Color
import android.opengl.Visibility
import android.os.Bundle import android.os.Bundle
import android.view.View
import android.widget.LinearLayout import android.widget.LinearLayout
import androidx.recyclerview.widget.LinearLayoutManager import androidx.recyclerview.widget.LinearLayoutManager
import androidx.recyclerview.widget.RecyclerView import androidx.recyclerview.widget.RecyclerView
@ -10,18 +12,22 @@ import com.dahe.gldriver.R
import com.dahe.gldriver.adapter.CarsAdapter import com.dahe.gldriver.adapter.CarsAdapter
import com.dahe.gldriver.adapter.DriversAdapter import com.dahe.gldriver.adapter.DriversAdapter
import com.dahe.gldriver.adapter.WaybillAdapter import com.dahe.gldriver.adapter.WaybillAdapter
import com.dahe.gldriver.base.AppConfig
import com.dahe.gldriver.bean.DriverBean import com.dahe.gldriver.bean.DriverBean
import com.dahe.gldriver.databinding.ActivityCarsManBinding import com.dahe.gldriver.databinding.ActivityCarsManBinding
import com.dahe.gldriver.databinding.FragmentWaybillListBinding import com.dahe.gldriver.databinding.FragmentWaybillListBinding
import com.dahe.gldriver.net.BaseObserver import com.dahe.gldriver.net.BaseObserver
import com.dahe.gldriver.net.DataManager import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.ui.mine.InviteDriverActivity
import com.dahe.gldriver.utils.SPUtils import com.dahe.gldriver.utils.SPUtils
import com.dahe.glex.bean.WayBillBean import com.dahe.glex.bean.WayBillBean
import com.dahe.mylibrary.base.BaseActivity import com.dahe.mylibrary.base.BaseActivity
import com.dahe.mylibrary.base.BaseFragment import com.dahe.mylibrary.base.BaseFragment
import com.dahe.mylibrary.callback.RefreshCallBack
import com.dahe.mylibrary.net.CommonResponseBean import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider import com.dahe.mylibrary.recycleviewswipe.RecycleViewDivider
import com.dahe.mylibrary.utils.ActivityUtils
import com.dahe.mylibrary.utils.ConvertUtils import com.dahe.mylibrary.utils.ConvertUtils
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers import io.reactivex.rxjava3.schedulers.Schedulers
@ -30,15 +36,21 @@ import io.reactivex.rxjava3.schedulers.Schedulers
* @ClassName CarsManActivity * @ClassName CarsManActivity
* @Author john * @Author john
* @Date 2024/2/1 08:59 * @Date 2024/2/1 08:59
* @Description 车辆管理 * @Description 司机管理
*/ */
class DriversManFragment : BaseFragment<FragmentWaybillListBinding>() { class DriversManFragment : BaseFragment<FragmentWaybillListBinding>(), RefreshCallBack {
private var captainId: String = ""
lateinit var adapter: DriversAdapter lateinit var adapter: DriversAdapter
override fun onFragmentVisibleChange(isVisible: Boolean) { override fun onFragmentVisibleChange(isVisible: Boolean) {
} }
override fun onFragmentFirstVisible() { override fun onFragmentFirstVisible() {
setRefresh(binding.refresh, this)
arguments?.let {
binding.llOk.visibility = it.getInt(AppConfig.IS_SHOW)
captainId = it.getString(AppConfig.ID, "")
}
adapter = binding.recyclerView.run { adapter = binding.recyclerView.run {
layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false) layoutManager = LinearLayoutManager(mContext, RecyclerView.VERTICAL, false)
addItemDecoration( addItemDecoration(
@ -50,20 +62,47 @@ class DriversManFragment : BaseFragment<FragmentWaybillListBinding>() {
) )
adapter = DriversAdapter() adapter = DriversAdapter()
adapter as DriversAdapter adapter as DriversAdapter
}.apply {
isStateViewEnable = true
} }
binding.btnOk.setOnClickListener {
ActivityUtils.startActivity(mContext, InviteDriverActivity::class.java)
}
initData() initData()
} }
private fun initData(){ open fun setVisibility(visibility: Int): DriversManFragment {
binding.llOk.visibility = visibility
return this
}
DataManager.getInstance().selectDriversInCaptain(SPUtils.instance.getUserInfo(mContext)!!.captainId) private fun initData() {
DataManager.getInstance()
.selectDriversInCaptain(captainId)
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread()) .subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<MutableList<DriverBean>>() { .subscribe(BaseObserver(mContext, object : RxHttpCallBack<MutableList<DriverBean>>() {
override fun onSuccess(t: CommonResponseBean<MutableList<DriverBean>>) { override fun onSuccess(t: CommonResponseBean<MutableList<DriverBean>>) {
super.onSuccess(t) super.onSuccess(t)
adapter.submitList(t.data) 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 getRefreshDate(stat: Int, page: Int, count: Int) {
initData()
}
} }

View File

@ -8,6 +8,7 @@ import com.dahe.mylibrary.base.SingletonNoPHolder
import com.lxj.xpopup.XPopup import com.lxj.xpopup.XPopup
import com.lxj.xpopup.interfaces.OnCancelListener import com.lxj.xpopup.interfaces.OnCancelListener
import com.lxj.xpopup.interfaces.OnConfirmListener import com.lxj.xpopup.interfaces.OnConfirmListener
import com.lxj.xpopup.interfaces.OnInputConfirmListener
/** /**
* @ClassName CommonPopUtils * @ClassName CommonPopUtils
@ -65,4 +66,22 @@ class CommonPopUtils private constructor() {
.show() .show()
} }
/**
* 弹出带有输入框的
* @param context Context
* @param title String
* @param listener OnInputConfirmListener
*/
fun showCenterInputPop(context: Context,title: String,listener: OnInputConfirmListener){
XPopup.Builder(context)
.hasStatusBarShadow(false)
.hasNavigationBar(false)
.autoOpenSoftInput(true)
.asInputConfirm(title,"","请输入拒绝原因",listener)
.show()
}
} }

View File

@ -0,0 +1,115 @@
package com.dahe.gldriver.utils
import android.content.Context
import androidx.appcompat.app.AppCompatActivity
import com.dahe.gldriver.bean.DiCarColor
import com.dahe.gldriver.net.BaseObserver
import com.dahe.gldriver.net.DataManager
import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.mylibrary.base.SingletonNoPHolder
import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.utils.PickerUtils
import com.github.gzuliyujiang.wheelpicker.contract.OnOptionPickedListener
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
import io.reactivex.rxjava3.schedulers.Schedulers
/**
* @ClassName DicUtils
* @Author john
* @Date 2024/3/11 09:32
* @Description 字典工具类
*/
class DicUtils private constructor() {
companion object : SingletonNoPHolder<DicUtils>(::DicUtils)
/**
* 选择车辆类型
* @param context Context
* @param activity AppCompatActivity
* @param listener OnOptionPickedListener
*/
fun selectDicCarType(
context: Context,
activity: AppCompatActivity,
defaultCont: String = "重型半挂牵引车",
isLoading: Boolean = false,
listener: OnOptionPickedListener
) {
//车辆类型
DataManager.getInstance().getSysDictDataList("vehicle_type")
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
BaseObserver(context, object : RxHttpCallBack<MutableList<DiCarColor>>(if (isLoading) activity else null) {
override fun onSuccess(t: CommonResponseBean<MutableList<DiCarColor>>) {
super.onSuccess(t)
PickerUtils.getInstance()
.showSelectCarColor(
activity,
"车辆类型",
"重型半挂牵引车",
t.data, listener
)
}
})
)
}
/**
* 根据名称获取车辆类型
* @param context Context
* @param value String
* @param listener OnOptionPickedListener
*/
fun getCarTypeByValue(
context: Context,
value: String,
listener: OnOptionPickedListener
) {
//车辆类型
DataManager.getInstance().getSysDictDataList("vehicle_type")
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
BaseObserver(context, object : RxHttpCallBack<MutableList<DiCarColor>>() {
override fun onSuccess(t: CommonResponseBean<MutableList<DiCarColor>>) {
super.onSuccess(t)
var first = t.data?.firstOrNull { it.dictLabel == value }
listener.onOptionPicked(0, first)
}
})
)
}
/**
* 设置车牌颜色
* @param context Context
* @param appCompatActivity AppCompatActivity
* @param listener OnOptionPickedListener
*/
fun getCarColor(
context: Context, appCompatActivity: AppCompatActivity,
isLoading : Boolean=false,
listener: OnOptionPickedListener
) {
DataManager.getInstance().getSysDictDataList("plate_color")
.subscribeOn(Schedulers.io())
.observeOn(AndroidSchedulers.mainThread())
.subscribe(
BaseObserver(context, object : RxHttpCallBack<MutableList<DiCarColor>>(if (isLoading) appCompatActivity else null) {
override fun onSuccess(t: CommonResponseBean<MutableList<DiCarColor>>) {
super.onSuccess(t)
PickerUtils.getInstance()
.showSelectCarColor(
appCompatActivity,
"车牌颜色",
"黄色",
t.data, listener
)
}
})
)
}
}

View File

@ -11,6 +11,7 @@ import com.dahe.gldriver.net.RxHttpCallBack
import com.dahe.gldriver.oss.OssServiceUtil import com.dahe.gldriver.oss.OssServiceUtil
import com.dahe.mylibrary.base.SingletonNoPHolder import com.dahe.mylibrary.base.SingletonNoPHolder
import com.dahe.mylibrary.net.CommonResponseBean import com.dahe.mylibrary.net.CommonResponseBean
import com.dahe.mylibrary.utils.ImageLoader
import com.dahe.mylibrary.utils.LoadingUtils import com.dahe.mylibrary.utils.LoadingUtils
import com.dahe.mylibrary.utils.PopsUtils import com.dahe.mylibrary.utils.PopsUtils
import com.dahe.mylibrary.utils.ToastUtils import com.dahe.mylibrary.utils.ToastUtils
@ -125,6 +126,64 @@ class OcrUtils private constructor() {
} }
/**
* 行驶证ocr识别
* */
fun ocrDriveing(
context: Context,
activity: AppCompatActivity,
listener: OnOcrPicResultListener
) {
PopsUtils.getInstance().showSimSelPic(context) { result ->
LoadingUtils.instance.showLoading(activity)
//上传oss得到图片地址
OssServiceUtil.getInstance().run {
asyncPutImage(result[0].realPath, null)
setResultCallBack { data, oldPath ->
DataManager.getInstance().recognizeVehicleLicense(oldPath)//行驶证识别
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.subscribe(
BaseObserver(
context,
object : RxHttpCallBack<OcrPersonBean>() {
override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) {
super.onSuccess(t)
LoadingUtils.instance.dissLoading()
t.data?.let {
listener.onSuccResult(
PicPath(
result[0].realPath,
oldPath
), it
)
}
}
override fun onCodeError(
mContext: Context?,
t: CommonResponseBean<OcrPersonBean>
) {
// super.onCodeError(mContext, t)
LoadingUtils.instance.dissLoading()
if (t.code == 500) {
if (t.msg.contains("code: 400, The image type does not match the API operation")) {
ToastUtils.showToast(
mContext,
"图片识别失败,请重新上传"
)
} else {
ToastUtils.showToast(mContext, t.msg)
}
}
}
})
)
}
}
}
}
/** /**
* 银行卡ocr识别 * 银行卡ocr识别
* */ * */
@ -235,4 +294,26 @@ class OcrUtils private constructor() {
} }
} }
} }
fun noOcrUpPic(
context: Context,
activity: AppCompatActivity,
listener: OnOcrPicResultListener
) {
PopsUtils.getInstance().showSimSelPic(context) {
var data = it[0]
OssServiceUtil.getInstance().run {
asyncPutImage(data.realPath, activity)
setResultCallBack { data, oldPath ->
activity.runOnUiThread {
listener.onSuccResult(
PicPath(it[0].realPath, oldPath), null
)
}
}
}
}
}
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 KiB

View File

@ -203,7 +203,7 @@
android:drawableRight="@drawable/right_gray" android:drawableRight="@drawable/right_gray"
android:drawablePadding="@dimen/dp_6" android:drawablePadding="@dimen/dp_6"
android:gravity="right|center_vertical" android:gravity="right|center_vertical"
android:hint="重型栏板半挂车" android:hint="请选择车辆类型"
android:paddingLeft="@dimen/dp_10" android:paddingLeft="@dimen/dp_10"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/sp_15"></TextView> android:textSize="@dimen/sp_15"></TextView>
@ -265,12 +265,75 @@
android:textSize="@dimen/sp_15" android:textSize="@dimen/sp_15"
tools:text="王海生"></EditText> tools:text="王海生"></EditText>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_14" android:layout_marginTop="@dimen/dp_14"
android:orientation="horizontal"> android:orientation="horizontal">
<TextView
android:layout_width="@dimen/dp_70"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/start"
android:drawablePadding="@dimen/dp_2"
android:text="车牌颜色"
android:textColor="@color/black"
android:textSize="@dimen/sp_15"></TextView>
<TextView
android:id="@+id/tvCarColor"
android:layout_width="0dp"
android:layout_height="@dimen/dp_34"
android:layout_marginLeft="@dimen/dp_10"
android:layout_weight="1"
android:drawableRight="@drawable/right_gray"
android:drawablePadding="@dimen/dp_6"
android:gravity="right|center_vertical"
android:hint="请选择车牌颜色"
android:paddingLeft="@dimen/dp_10"
android:textColor="@color/black"
android:textSize="@dimen/sp_15"></TextView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="有效期至"
android:drawableLeft="@drawable/start"
android:drawablePadding="@dimen/dp_2"
android:textColor="@color/black"
android:textSize="@dimen/sp_15"></TextView>
<TextView
android:id="@+id/tvEnd"
android:layout_width="0dp"
android:layout_height="@dimen/dp_34"
android:layout_marginLeft="@dimen/dp_10"
android:layout_weight="1"
android:drawableRight="@drawable/right_gray"
android:drawablePadding="@dimen/dp_6"
android:gravity="right|center_vertical"
android:hint="请选择有效期至"
android:paddingLeft="@dimen/dp_10"
android:textColor="@color/black"
android:textSize="@dimen/sp_15"
></TextView>
</LinearLayout>
<LinearLayout
android:visibility="gone"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_14"
android:orientation="horizontal">
<TextView <TextView
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -294,6 +357,7 @@
tools:text="王海生"></EditText> tools:text="王海生"></EditText>
</LinearLayout> </LinearLayout>
<LinearLayout <LinearLayout
android:visibility="gone"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_14" android:layout_marginTop="@dimen/dp_14"
@ -326,6 +390,127 @@
</LinearLayout> </LinearLayout>
</androidx.cardview.widget.CardView> </androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="@dimen/dp_174"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginRight="@dimen/dp_15"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="@dimen/dp_8">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginTop="@dimen/dp_16"
android:text="上传道路运输证"
android:textColor="@color/black"
android:textSize="@dimen/sp_16" />
<ImageView
android:id="@+id/ivRoadFront"
android:layout_width="@dimen/dp_155"
android:layout_height="@dimen/dp_97"
android:layout_alignParentBottom="true"
android:layout_centerHorizontal="true"
android:layout_marginBottom="@dimen/dp_22"
android:background="@drawable/road" />
</RelativeLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_20"
android:layout_marginRight="@dimen/dp_15"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="@dimen/dp_8">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginRight="@dimen/dp_14"
android:paddingBottom="@dimen/dp_18">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_26"
android:orientation="horizontal">
<TextView
android:layout_width="@dimen/dp_90"
android:layout_height="wrap_content"
android:text="道路运输证号"
android:textColor="@color/black"
android:textSize="@dimen/sp_15" />
<EditText
android:id="@+id/etID"
android:layout_width="0dp"
android:layout_height="@dimen/dp_34"
android:layout_marginLeft="@dimen/dp_10"
android:layout_weight="1"
android:background="@null"
android:gravity="right|center_vertical"
android:hint="请输入道路运输证号"
android:maxLines="1"
android:paddingRight="@dimen/dp_10"
android:singleLine="true"
android:textColor="@color/black"
android:textSize="@dimen/sp_15" />
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_76"
android:orientation="horizontal">
<TextView
android:layout_width="@dimen/dp_70"
android:layout_height="wrap_content"
android:text="有效期至"
android:textColor="@color/black"
android:textSize="@dimen/sp_15" />
<TextView
android:id="@+id/tvDate"
android:layout_width="0dp"
android:layout_height="@dimen/dp_34"
android:layout_marginLeft="@dimen/dp_10"
android:layout_weight="1"
android:drawableRight="@drawable/right_gray"
android:drawablePadding="@dimen/dp_6"
android:gravity="right|center_vertical"
android:hint="请选择有效期至"
android:paddingLeft="@dimen/dp_10"
android:textColor="@color/black"
android:textSize="@dimen/sp_15" />
</LinearLayout>
</RelativeLayout>
</androidx.cardview.widget.CardView>
<View <View
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"

View File

@ -96,6 +96,7 @@
android:textSize="@dimen/sp_15" /> android:textSize="@dimen/sp_15" />
<EditText <EditText
android:id="@+id/etID"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="@dimen/dp_34" android:layout_height="@dimen/dp_34"
android:layout_marginLeft="@dimen/dp_10" android:layout_marginLeft="@dimen/dp_10"
@ -103,10 +104,11 @@
android:background="@null" android:background="@null"
android:gravity="right|center_vertical" android:gravity="right|center_vertical"
android:hint="请输入道路运输证号" android:hint="请输入道路运输证号"
android:maxLines="1"
android:paddingRight="@dimen/dp_10" android:paddingRight="@dimen/dp_10"
android:singleLine="true"
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/sp_15" android:textSize="@dimen/sp_15" />
/>
</LinearLayout> </LinearLayout>

View File

@ -0,0 +1,66 @@
<?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:gravity="center_horizontal"
android:orientation="vertical">
<include layout="@layout/common_toolbar"></include>
<ImageView
android:id="@+id/ivSucc"
android:layout_width="@dimen/dp_150"
android:layout_height="@dimen/dp_150"
android:layout_marginTop="@dimen/dp_50"
android:background="@drawable/success" />
<TextView
android:id="@+id/tvSucc"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_28"
android:text="恭喜您,提交成功"
android:textColor="@color/black"
android:textSize="@dimen/sp_17" />
<TextView
android:id="@+id/tvTime"
android:layout_width="@dimen/dp_220"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_14"
android:gravity="center"
android:text="工作人员将在1-3个工作日完成审核 请耐心等待"
android:textColor="@color/color_9"
android:textSize="@dimen/sp_14" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:gravity="center"
android:layout_marginTop="@dimen/dp_52"
android:orientation="horizontal">
<Button
android:id="@+id/btnLeft"
android:layout_width="@dimen/dp_120"
android:layout_height="@dimen/dp_36"
android:background="@drawable/shape_btn_empty_bg"
android:text="跳转首页"
android:textColor="@color/main_red"
android:textSize="@dimen/sp_17" />
<Button
android:id="@+id/btnRight"
android:layout_width="@dimen/dp_120"
android:layout_height="@dimen/dp_36"
android:layout_marginLeft="@dimen/dp_10"
android:background="@drawable/bg_btn"
android:text="添加车辆"
android:textColor="@color/white"
android:textSize="@dimen/sp_17" />
</LinearLayout>
</LinearLayout>

View File

@ -0,0 +1,301 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:background="@color/white"
android:orientation="vertical">
<include layout="@layout/common_toolbar"></include>
<TextView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#FFEFE8"
android:paddingLeft="@dimen/dp_20"
android:paddingTop="@dimen/dp_14"
android:paddingRight="@dimen/dp_20"
android:paddingBottom="@dimen/dp_16"
android:text="为了认证您的身份信息,请上传您的身份证(属于您的
敏感信息)以供我们认证,请先去下证件卡套后拍摄,
确保上传证件拍摄完成且清晰可见。"
android:textColor="#FF5F20"
android:textSize="@dimen/sp_14"></TextView>
<androidx.core.widget.NestedScrollView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:fillViewport="true">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="vertical">
<androidx.cardview.widget.CardView
android:id="@+id/cdPerson"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_174"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_30"
android:layout_marginRight="@dimen/dp_15"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="@dimen/dp_8">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginTop="@dimen/dp_16"
android:text="上传挂车行驶证(必填)"
android:textColor="@color/black"
android:textSize="@dimen/sp_16"></TextView>
<ImageView
android:id="@+id/ivFront"
android:layout_width="@dimen/dp_155"
android:layout_height="@dimen/dp_97"
android:layout_alignParentBottom="true"
android:layout_marginLeft="@dimen/dp_8"
android:layout_marginBottom="@dimen/dp_22"
android:background="@drawable/driving_front"></ImageView>
<ImageView
android:id="@+id/ivBack"
android:layout_width="@dimen/dp_155"
android:layout_height="@dimen/dp_97"
android:layout_alignParentRight="true"
android:layout_alignParentBottom="true"
android:layout_marginRight="@dimen/dp_8"
android:layout_marginBottom="@dimen/dp_22"
android:background="@drawable/driving_back"></ImageView>
</RelativeLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginRight="@dimen/dp_15"
app:cardBackgroundColor="@color/white"
app:cardCornerRadius="@dimen/dp_8">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_gravity="center_horizontal"
android:layout_marginLeft="@dimen/dp_14"
android:layout_marginRight="@dimen/dp_14"
android:orientation="vertical"
android:paddingBottom="@dimen/dp_18">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_16"
android:text="确认主要信息"
android:textColor="@color/black"
android:textSize="@dimen/sp_16"></TextView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_20"
android:orientation="horizontal">
<TextView
android:layout_width="@dimen/dp_70"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/start"
android:drawablePadding="@dimen/dp_2"
android:text="车牌号"
android:textColor="@color/black"
android:textSize="@dimen/sp_15"></TextView>
<EditText
android:id="@+id/etCarNum"
android:layout_width="0dp"
android:layout_height="@dimen/dp_34"
android:layout_marginLeft="@dimen/dp_10"
android:layout_weight="1"
android:background="@null"
android:gravity="right|center_vertical"
android:hint="请输入车牌号"
android:paddingRight="@dimen/dp_10"
android:textColor="@color/black"
android:textSize="@dimen/sp_15"
tools:text="王海生"></EditText>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_14"
android:orientation="horizontal">
<TextView
android:layout_width="@dimen/dp_70"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/start"
android:drawablePadding="@dimen/dp_2"
android:text="车辆类型"
android:textColor="@color/black"
android:textSize="@dimen/sp_15"></TextView>
<TextView
android:id="@+id/tvCarType"
android:layout_width="0dp"
android:layout_height="@dimen/dp_34"
android:layout_marginLeft="@dimen/dp_10"
android:layout_weight="1"
android:drawableRight="@drawable/right_gray"
android:drawablePadding="@dimen/dp_6"
android:gravity="right|center_vertical"
android:hint="请选择车辆类型"
android:paddingLeft="@dimen/dp_10"
android:textColor="@color/black"
android:textSize="@dimen/sp_15"></TextView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_14"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:maxWidth="@dimen/dp_100"
android:text="使用性质"
android:textColor="@color/black"
android:textSize="@dimen/sp_15"></TextView>
<EditText
android:id="@+id/etUseNature"
android:layout_width="0dp"
android:layout_height="@dimen/dp_34"
android:layout_marginLeft="@dimen/dp_10"
android:layout_weight="1"
android:background="@null"
android:gravity="right|center_vertical"
android:hint="请输入车辆使用性质"
android:paddingRight="@dimen/dp_10"
android:textColor="@color/black"
android:textSize="@dimen/sp_15"
tools:text="王海生"></EditText>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_14"
android:orientation="horizontal">
<TextView
android:layout_width="@dimen/dp_70"
android:layout_height="wrap_content"
android:drawableLeft="@drawable/start"
android:drawablePadding="@dimen/dp_2"
android:text="车牌颜色"
android:textColor="@color/black"
android:textSize="@dimen/sp_15"></TextView>
<TextView
android:id="@+id/tvCarColor"
android:layout_width="0dp"
android:layout_height="@dimen/dp_34"
android:layout_marginLeft="@dimen/dp_10"
android:layout_weight="1"
android:drawableRight="@drawable/right_gray"
android:drawablePadding="@dimen/dp_6"
android:gravity="right|center_vertical"
android:hint="请选择车牌颜色"
android:paddingLeft="@dimen/dp_10"
android:textColor="@color/black"
android:textSize="@dimen/sp_15"></TextView>
</LinearLayout>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12"
android:orientation="horizontal">
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="有效期至"
android:textColor="@color/black"
android:textSize="@dimen/sp_15"></TextView>
<TextView
android:id="@+id/tvEnd"
android:layout_width="0dp"
android:layout_height="@dimen/dp_34"
android:layout_marginLeft="@dimen/dp_10"
android:layout_weight="1"
android:drawableRight="@drawable/right_gray"
android:drawablePadding="@dimen/dp_6"
android:gravity="right|center_vertical"
android:hint="请选择有效期至"
android:paddingLeft="@dimen/dp_10"
android:textColor="@color/black"
android:textSize="@dimen/sp_15"
></TextView>
</LinearLayout>
</LinearLayout>
</androidx.cardview.widget.CardView>
<View
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10" />
</LinearLayout>
</androidx.core.widget.NestedScrollView>
<LinearLayout
android:layout_width="match_parent"
android:layout_height="@dimen/dp_70"
android:background="@color/white"
android:gravity="center"
android:paddingLeft="@dimen/dp_15"
android:paddingRight="@dimen/dp_15">
<Button
android:id="@+id/btnOk"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_btn"
android:text="下一步"
android:textColor="@color/white"
android:textSize="@dimen/sp_17">
</Button>
</LinearLayout>
</LinearLayout>

View File

@ -38,11 +38,13 @@
android:padding="@dimen/dp_12"> android:padding="@dimen/dp_12">
<ImageView <ImageView
android:id="@+id/ivHead"
android:layout_width="@dimen/dp_48" android:layout_width="@dimen/dp_48"
android:layout_height="@dimen/dp_48" android:layout_height="@dimen/dp_48"
android:background="@drawable/head_defaut" /> android:background="@drawable/head_defaut" />
<TextView <TextView
android:id="@+id/tvCapName"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10" android:layout_marginLeft="@dimen/dp_10"
@ -51,6 +53,7 @@
android:textSize="@dimen/sp_14" /> android:textSize="@dimen/sp_14" />
<TextView <TextView
android:id="@+id/tvStatu"
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_6" android:layout_marginLeft="@dimen/dp_6"

View File

@ -0,0 +1,26 @@
<?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/color_F5"
android:orientation="vertical">
<include layout="@layout/common_toolbar"></include>
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_12"
android:layout_width="match_parent"
android:layout_height="match_parent"></androidx.recyclerview.widget.RecyclerView>
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
</LinearLayout>

View File

@ -0,0 +1,197 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<RelativeLayout
android:id="@+id/rlTop"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_237"
android:background="@drawable/wallet_bg">
<include layout="@layout/common_toolbar"></include>
</RelativeLayout>
<LinearLayout
android:id="@+id/llTop"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_100"
android:orientation="vertical">
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="@dimen/dp_75"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_15"
android:background="@color/white"
app:cardCornerRadius="@dimen/dp_8">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="match_parent"
android:gravity="center_vertical"
android:orientation="horizontal"
android:padding="@dimen/dp_12">
<ImageView
android:id="@+id/ivHead"
android:layout_width="@dimen/dp_48"
android:layout_height="@dimen/dp_48"
android:background="@drawable/head_defaut" />
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="vertical">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:gravity="center_vertical"
android:orientation="horizontal">
<TextView
android:id="@+id/tvCapName"
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_14" />
<TextView
android:id="@+id/tvStatu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_6"
android:background="@drawable/shape_orange_5"
android:paddingLeft="@dimen/dp_4"
android:paddingTop="@dimen/dp_2"
android:paddingRight="@dimen/dp_4"
android:paddingBottom="@dimen/dp_2"
android:text="未认证"
android:textColor="#FF4A02"
android:textSize="@dimen/sp_9" />
</LinearLayout>
<TextView
android:id="@+id/tvPhone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:text="司机20 司机20 "
android:textColor="@color/color_9"
android:textSize="@dimen/sp_14" />
</LinearLayout>
<View
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_weight="1" />
<ImageView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:background="@drawable/right_gray" />
</LinearLayout>
</androidx.cardview.widget.CardView>
<androidx.cardview.widget.CardView
android:layout_width="match_parent"
android:layout_height="@dimen/dp_54"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_10"
android:layout_marginRight="@dimen/dp_15"
android:layout_marginBottom="@dimen/dp_14"
android:background="@color/white"
app:cardCornerRadius="@dimen/dp_8">
<net.lucode.hackware.magicindicator.MagicIndicator
android:id="@+id/magicIndicator"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</androidx.cardview.widget.CardView>
</LinearLayout>
</RelativeLayout>
<androidx.viewpager2.widget.ViewPager2
android:id="@+id/viewPager"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:layout_below="@+id/llTop"
android:layout_weight="1" />
<LinearLayout
android:id="@+id/llOk"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_70"
android:layout_below="@+id/viewPager"
android:background="@color/white"
android:gravity="center"
android:paddingLeft="@dimen/dp_15"
android:paddingRight="@dimen/dp_15">
<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<LinearLayout
android:id="@+id/llJoin"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<Button
android:id="@+id/btnReject"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="2"
android:background="@drawable/shape_orange_5"
android:text="拒绝邀请"
android:textColor="@color/main_red"
android:textSize="@dimen/sp_17" />
<Button
android:id="@+id/btnOk"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_12"
android:layout_weight="1"
android:background="@drawable/bg_btn"
android:text="立即加入"
android:textColor="@color/white"
android:textSize="@dimen/sp_17" />
</LinearLayout>
<Button
android:id="@+id/btnQuit"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_btn"
android:text="退出车队"
android:textColor="@color/white"
android:textSize="@dimen/sp_17"
android:visibility="gone">
</Button>
</RelativeLayout>
</LinearLayout>
</LinearLayout>

View File

@ -0,0 +1,62 @@
<?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/color_F5"
android:orientation="vertical">
<include layout="@layout/common_toolbar"></include>
<LinearLayout
android:background="@color/white"
android:paddingBottom="@dimen/dp_12"
android:paddingTop="@dimen/dp_8"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<EditText
android:id="@+id/etPhone"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_36"
android:layout_marginLeft="@dimen/dp_18"
android:layout_weight="1"
android:background="@drawable/shape_gray_5"
android:drawableLeft="@drawable/icon_search"
android:drawablePadding="@dimen/dp_6"
android:hint="请输入司机手机号"
android:inputType="phone"
android:maxLines="1"
android:paddingLeft="@dimen/dp_12"
android:singleLine="true"
android:textSize="@dimen/sp_15" />
<TextView
android:id="@+id/tvSearch"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:paddingLeft="@dimen/dp_18"
android:paddingTop="@dimen/dp_5"
android:paddingRight="@dimen/dp_18"
android:paddingBottom="@dimen/dp_5"
android:text="搜索"
android:textColor="@color/main_red"
android:textSize="@dimen/sp_15" />
</LinearLayout>
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_12"
android:layout_width="match_parent"
android:layout_height="match_parent"></androidx.recyclerview.widget.RecyclerView>
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
</LinearLayout>

View File

@ -0,0 +1,25 @@
<?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/color_F5"
android:orientation="vertical">
<include layout="@layout/common_toolbar"></include>
<com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/refresh"
android:layout_width="match_parent"
android:layout_height="match_parent">
<androidx.recyclerview.widget.RecyclerView
android:id="@+id/recycler"
android:layout_marginLeft="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_15"
android:layout_marginTop="@dimen/dp_12"
android:layout_width="match_parent"
android:layout_height="match_parent"></androidx.recyclerview.widget.RecyclerView>
</com.scwang.smart.refresh.layout.SmartRefreshLayout>
</LinearLayout>

View File

@ -8,7 +8,8 @@
<com.scwang.smart.refresh.layout.SmartRefreshLayout <com.scwang.smart.refresh.layout.SmartRefreshLayout
android:id="@+id/refresh" android:id="@+id/refresh"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="match_parent"> android:layout_height="match_parent"
android:layout_weight="1">
<androidx.recyclerview.widget.RecyclerView <androidx.recyclerview.widget.RecyclerView
android:id="@+id/recyclerView" android:id="@+id/recyclerView"
@ -17,4 +18,26 @@
android:layout_marginLeft="@dimen/dp_12" android:layout_marginLeft="@dimen/dp_12"
android:layout_marginRight="@dimen/dp_12"></androidx.recyclerview.widget.RecyclerView> android:layout_marginRight="@dimen/dp_12"></androidx.recyclerview.widget.RecyclerView>
</com.scwang.smart.refresh.layout.SmartRefreshLayout> </com.scwang.smart.refresh.layout.SmartRefreshLayout>
<LinearLayout
android:id="@+id/llOk"
android:layout_width="match_parent"
android:layout_height="@dimen/dp_70"
android:background="@color/white"
android:gravity="center"
android:paddingLeft="@dimen/dp_15"
android:paddingRight="@dimen/dp_15">
<Button
android:id="@+id/btnOk"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="@drawable/bg_btn"
android:text="邀请队员"
android:textColor="@color/white"
android:textSize="@dimen/sp_17">
</Button>
</LinearLayout>
</LinearLayout> </LinearLayout>

View File

@ -3,6 +3,7 @@
xmlns:app="http://schemas.android.com/apk/res-auto" xmlns:app="http://schemas.android.com/apk/res-auto"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/dp_90" android:layout_height="@dimen/dp_90"
xmlns:tools="http://schemas.android.com/tools"
android:layout_marginLeft="@dimen/dp_15" android:layout_marginLeft="@dimen/dp_15"
android:layout_marginRight="@dimen/dp_15" android:layout_marginRight="@dimen/dp_15"
android:background="@color/white" android:background="@color/white"
@ -57,6 +58,7 @@
android:textSize="@dimen/sp_12" /> android:textSize="@dimen/sp_12" />
<TextView <TextView
android:gravity="center"
android:id="@+id/tvCarLen" android:id="@+id/tvCarLen"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
@ -72,7 +74,8 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_weight="1" android:layout_weight="1"
android:text="30顿" android:gravity="right"
tools:text="30吨"
android:textColor="@color/color_9" android:textColor="@color/color_9"
android:textSize="@dimen/sp_12" /> android:textSize="@dimen/sp_12" />

View File

@ -0,0 +1,74 @@
<?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="@dimen/dp_70"
android:background="@drawable/shape_bg8"
android:gravity="center_vertical"
android:orientation="horizontal">
<ImageView
android:id="@+id/ivHead"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_10"
android:background="@drawable/head_defaut" />
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_weight="1"
android:orientation="vertical">
<LinearLayout
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:orientation="horizontal">
<TextView
android:id="@+id/tvName"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_12"
android:text="王师傅"
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:layout_marginLeft="@dimen/dp_12"
android:background="@drawable/shape_orange_4"
android:paddingLeft="@dimen/dp_8"
android:paddingTop="@dimen/dp_2"
android:paddingRight="@dimen/dp_8"
android:paddingBottom="@dimen/dp_2"
android:text="待加入"
android:textColor="@color/main_red"
android:textSize="@dimen/sp_14"
android:visibility="gone" />
</LinearLayout>
<TextView
android:id="@+id/tvPhone"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_12"
android:layout_marginTop="@dimen/dp_10"
android:text="15835201103"
android:textColor="@color/color_9"
android:textSize="@dimen/sp_12" />
</LinearLayout>
<ImageView
android:layout_width="@dimen/dp_8"
android:layout_height="@dimen/dp_12"
android:layout_marginRight="@dimen/dp_12"
android:background="@drawable/right_gray" />
</LinearLayout>

View File

@ -22,6 +22,22 @@
android:textColor="@color/black" android:textColor="@color/black"
android:textSize="@dimen/sp_16" /> android:textSize="@dimen/sp_16" />
<TextView
android:id="@+id/tvStatu"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginLeft="@dimen/dp_6"
android:layout_marginTop="@dimen/dp_3"
android:layout_toRightOf="@+id/tvName"
android:background="@drawable/shape_orange_5"
android:paddingLeft="@dimen/dp_8"
android:paddingTop="@dimen/dp_2"
android:paddingRight="@dimen/dp_8"
android:paddingBottom="@dimen/dp_2"
android:text="队长"
android:textColor="#FF4A02"
android:textSize="@dimen/sp_9" />
<TextView <TextView
android:id="@+id/tvPhone" android:id="@+id/tvPhone"
android:layout_width="wrap_content" android:layout_width="wrap_content"
@ -33,15 +49,16 @@
android:textColor="@color/color_9" android:textColor="@color/color_9"
android:textSize="@dimen/sp_12" /> android:textSize="@dimen/sp_12" />
<View <View
android:layout_alignBottom="@+id/tvPhone" android:id="@+id/vLine"
android:layout_toRightOf="@+id/tvPhone"
android:layout_marginLeft="@dimen/dp_10"
android:layout_width="@dimen/dp_1" android:layout_width="@dimen/dp_1"
android:layout_marginBottom="@dimen/dp_2"
android:layout_height="@dimen/dp_10" android:layout_height="@dimen/dp_10"
android:background="@color/color_c" android:layout_alignBottom="@+id/tvPhone"
/> android:layout_marginLeft="@dimen/dp_10"
android:layout_marginBottom="@dimen/dp_2"
android:layout_toRightOf="@+id/tvPhone"
android:background="@color/color_c" />
<TextView <TextView
android:id="@+id/tvDays" android:id="@+id/tvDays"
@ -54,4 +71,17 @@
android:textColor="@color/color_9" android:textColor="@color/color_9"
android:textSize="@dimen/sp_12" /> android:textSize="@dimen/sp_12" />
<TextView
android:id="@+id/tvInvite"
android:layout_width="@dimen/dp_60"
android:layout_height="@dimen/dp_27"
android:layout_alignParentRight="true"
android:layout_marginTop="@dimen/dp_12"
android:layout_marginRight="@dimen/dp_14"
android:background="@drawable/shape_orange_4"
android:gravity="center"
android:text="邀请"
android:textColor="@color/main_red"
android:visibility="gone" />
</RelativeLayout> </RelativeLayout>

View File

@ -0,0 +1,40 @@
<?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_bg8"
android:gravity="center_vertical"
android:orientation="vertical"
android:paddingLeft="@dimen/dp_14"
android:paddingTop="@dimen/dp_16"
android:paddingBottom="@dimen/dp_14">
<TextView
android:id="@+id/tvTime"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="2024-03-05 09:36"
android:textColor="@color/color_9"
android:textSize="@dimen/sp_15" />
<TextView
android:id="@+id/tvContent"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_12"
android:text="王师傅"
android:textColor="@color/black"
android:textSize="@dimen/sp_16" />
<TextView
android:id="@+id/tvReason"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="@dimen/dp_10"
android:text="拒绝原因:不认识"
android:textColor="@color/color_9"
android:textSize="@dimen/sp_15"
android:visibility="gone" />
</LinearLayout>

View File

@ -221,6 +221,34 @@ public abstract class BaseActivity<VB extends ViewBinding> extends AppCompatActi
mToolbar.setNavigationOnClickListener(listener); mToolbar.setNavigationOnClickListener(listener);
} }
@RequiresApi(api = Build.VERSION_CODES.LOLLIPOP)
protected void setTitleBar(String title, boolean isWhite,boolean isBack, String right, View.OnClickListener rightListener) {
mToolbar = (Toolbar) findViewById(R.id.common_toolbar);
mToolbar.setBackgroundColor(statusColor == -1 ? Color.TRANSPARENT : ContextCompat.getColor(mContext, statusColor));
if (isBack) {
mToolbar.setNavigationIcon(isWhite ? R.drawable.left : R.drawable.left_black);
mToolbar.setNavigationOnClickListener(view -> finish());
}
if (!TextUtils.isEmpty(title)) {//
((TextView) findViewById(R.id.common_toolBar_title)).setTextColor(isWhite ? getColor(R.color.colorWhite) : getColor(R.color.black));
((TextView) findViewById(R.id.common_toolBar_title)).setText(title);
}
if (!TextUtils.isEmpty(right)) {
TextView mTextRight = (TextView) findViewById(R.id.common_toolBar_text_right);
mTextRight.setTextColor(isWhite ? getColor(R.color.colorWhite) : getColor(R.color.black));
mTextRight.setVisibility(View.VISIBLE);
mTextRight.setText(right);
mTextRight.setOnClickListener(rightListener);
}
if (isWhite) {
StatusBar.cancelLightStatusBar(this);//图标文字白色
}
}
/** /**
* 设置距离顶部距离 * 设置距离顶部距离
*/ */

View File

@ -285,6 +285,31 @@ public class ActivityUtils {
return false; return false;
} }
/**
* 结束到指定Activity,并进入指定页面
*
* @param isIncludeSelf 是否结束该activity自己
*/
public static boolean finishToActivity(Context ctx ,@NonNull final Class<?> clz,@NonNull final Class<?> newclz,
final boolean isIncludeSelf) {
List<Activity> activities = CommonBaseLibrary.activityList;
for (int i = activities.size() - 1; i >= 0; --i) {
Activity aActivity = activities.get(i);
if (aActivity.getClass().equals(clz)) {
if (isIncludeSelf) {
finishActivity(aActivity);
}
startActivity(ctx,newclz);
return true;
} else {
finishActivity(aActivity);
}
// finishActivity(aActivity);
}
return false;
}
/** /**
* 结束除最新之外的同类型Activity * 结束除最新之外的同类型Activity
* <p>也就是让栈中最多只剩下一种类型的Activity</p> * <p>也就是让栈中最多只剩下一种类型的Activity</p>

View File

@ -10,6 +10,8 @@ import com.github.gzuliyujiang.wheelpicker.annotation.DateMode
import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener
import com.github.gzuliyujiang.wheelpicker.contract.OnOptionPickedListener import com.github.gzuliyujiang.wheelpicker.contract.OnOptionPickedListener
import com.github.gzuliyujiang.wheelpicker.entity.DateEntity import com.github.gzuliyujiang.wheelpicker.entity.DateEntity
import com.github.gzuliyujiang.wheelview.contract.TextProvider
import java.util.ArrayList
/** /**
* @ClassName PickUtils * @ClassName PickUtils
@ -57,7 +59,7 @@ class PickerUtils private constructor() {
*/ */
fun showDateSim( fun showDateSim(
activity: AppCompatActivity, activity: AppCompatActivity,
title: String = "", title: String = "日期选择",
listener: OnMyDatePickedListener listener: OnMyDatePickedListener
) { ) {
val picker = DatePicker(activity) val picker = DatePicker(activity)
@ -93,4 +95,28 @@ class PickerUtils private constructor() {
show() show()
} }
} }
/**
* 底部弹框-单选
* @param activity AppCompatActivity
* @param title String
* @param listener OnOptionPickedListener
*/
fun <T:TextProvider> showSelectCarColor(
activity: AppCompatActivity,
title: String = "",
default: String = "",
datas: MutableList<T>,
listener: OnOptionPickedListener
) {
OptionPicker(activity)
.run {
setData(datas)
setDefaultValue(default)
setTitle(title)
setOnOptionPickedListener(listener)
show()
}
}
} }

View File

@ -659,6 +659,21 @@ public final class TimeUtil {
return ""; return "";
} }
/**
* 转换数据类型
* @param date
* @param formart 原始数据类型
* @return yyyy-MM-dd
*/
public static String changeDateNoneFormat(String date, String formart) {
long l = string2Millis(date,new SimpleDateFormat(formart, Locale.getDefault()));
if (l != -1) {
return millis2String(l, DEFAULT_FORMAT_DATE);
}
return "";
}
/** /**
* 获取合适型与当前时间的差 * 获取合适型与当前时间的差
* *