资料修改-车辆资料编辑功能
This commit is contained in:
parent
69276f7a58
commit
64d235dfc0
@ -199,17 +199,32 @@
|
||||
android:launchMode="singleTop"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||
<activity
|
||||
android:name=".ui.account.authperson.EditDrivingActivity"
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||
<activity
|
||||
android:name=".ui.account.authperson.AuthTrailerActivity"
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||
<activity
|
||||
android:name=".ui.account.authperson.EditTrailerActivity"
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||
|
||||
<activity
|
||||
android:name=".ui.account.authperson.AuthRoadActivity"
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||
<activity
|
||||
android:name=".ui.account.authperson.EditRoadActivity"
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
android:screenOrientation="portrait"
|
||||
android:windowSoftInputMode="adjustPan|stateHidden" />
|
||||
<activity
|
||||
android:name=".ui.account.authteam.AuthTeamActivity"
|
||||
android:configChanges="keyboardHidden|orientation|locale"
|
||||
|
@ -30,4 +30,29 @@ data class CarBean(
|
||||
val vehicleType: String="",
|
||||
val vehicleTypeCode: String="",
|
||||
var isSelect: Boolean = false
|
||||
)
|
||||
|
||||
data class CarDetail(
|
||||
val approvedLoad: Int,
|
||||
val carId: Int,
|
||||
val carUrl: String,
|
||||
val isTrailer: String,
|
||||
val licenseFaceUrl: String,
|
||||
val owner: String,
|
||||
val registerImageUrl: String,
|
||||
val roadLicense: String,
|
||||
val roadLicensePhotoUrl: String,
|
||||
val roadLicenseValidity: String,
|
||||
val trailerApprovedLoad: Int,
|
||||
val trailerId: Int,
|
||||
val trailerLicenseFaceUrl: String,
|
||||
val trailerOwner: String,
|
||||
val trailerRegisterImageUrl: String,
|
||||
val trailerRoadLicensePhotoUrl: String,
|
||||
val trailerVehicleNum: String,
|
||||
val trailerVehicleType: String,
|
||||
val trailerVehicleTypeCode: String,
|
||||
val vehicleNum: String,
|
||||
val vehicleType: String,
|
||||
val vehicleTypeCode: String
|
||||
)
|
@ -47,6 +47,7 @@ data class UpDrivingInfoBean(
|
||||
var carLong: String = "",
|
||||
var carUrl: String = "",
|
||||
var carId: String = "",
|
||||
var trailerId: String = "",
|
||||
var carWidth: String = "",
|
||||
var curbWeight: String = "",
|
||||
var energySign: String = "",
|
||||
|
@ -5,6 +5,7 @@ import com.dahe.gldriver.BuildConfig.BASE_URL
|
||||
import com.dahe.gldriver.bean.AuthTeamBean
|
||||
import com.dahe.gldriver.bean.CaptainBean
|
||||
import com.dahe.gldriver.bean.CarBean
|
||||
import com.dahe.gldriver.bean.CarDetail
|
||||
import com.dahe.gldriver.bean.DiCarColor
|
||||
import com.dahe.gldriver.bean.DriverBean
|
||||
import com.dahe.gldriver.bean.InviteRecord
|
||||
@ -316,6 +317,22 @@ interface Api {
|
||||
@POST(BASE_URL + "driver/car/addCar")
|
||||
fun addCar(@Body upDrivingInfoBean: UpDrivingInfoBean): Observable<CommonResponseBean<UpDrivingInfoBean>>
|
||||
|
||||
/**
|
||||
*
|
||||
* 修改车辆信息
|
||||
* */
|
||||
@POST(BASE_URL + "driver/car/editCar")
|
||||
fun editCar(@Body upDrivingInfoBean: UpDrivingInfoBean): Observable<CommonResponseBean<UpDrivingInfoBean>>
|
||||
|
||||
|
||||
/**
|
||||
* 根据挂车车牌号查询挂车信息
|
||||
* @param vehicleNum String
|
||||
* @return Observable<CommonResponseBean<UpDrivingInfoBean>>
|
||||
*/
|
||||
@GET(BASE_URL + "driver/car/getTrailerByVehicleNum")
|
||||
fun getTrailerByVehicleNum(@Query("vehicleNum") vehicleNum: String): Observable<CommonResponseBean<UpDrivingInfoBean>>
|
||||
|
||||
/**
|
||||
*
|
||||
* 新增挂车信息
|
||||
@ -323,6 +340,13 @@ interface Api {
|
||||
@POST(BASE_URL + "driver/car/addTrailer")
|
||||
fun addTrailer(@Body upDrivingInfoBean: UpDrivingInfoBean): Observable<CommonResponseBean<Int>>
|
||||
|
||||
/**
|
||||
*
|
||||
* 修改挂车信息
|
||||
* */
|
||||
@POST(BASE_URL + "driver/car/editTrailer")
|
||||
fun editTrailer(@Body upDrivingInfoBean: UpDrivingInfoBean): Observable<CommonResponseBean<Int>>
|
||||
|
||||
/**
|
||||
*
|
||||
*邀请司机加入车队
|
||||
@ -400,6 +424,14 @@ interface Api {
|
||||
@GET(BASE_URL + "driver/captain/getCaptainById")
|
||||
fun getCaptainById(@Query("captainId") captainId: String): Observable<CommonResponseBean<CaptainBean>>
|
||||
|
||||
/**
|
||||
* 查询车辆证件完整度
|
||||
* @param captainId String
|
||||
* @return Observable<CommonResponseBean<MutableList<DriverBean>>>
|
||||
*/
|
||||
@GET(BASE_URL + "driver/car/getCarDocIntegrity")
|
||||
fun getCarDocIntegrity(@Query("carId") carId: String): Observable<CommonResponseBean<CarDetail>>
|
||||
|
||||
|
||||
/**
|
||||
* 查询运单评价信息列表
|
||||
|
@ -25,7 +25,7 @@ import io.reactivex.rxjava3.schedulers.Schedulers
|
||||
* @ClassName AuthTrailerActivity
|
||||
* @Author john
|
||||
* @Date 2024/3/11 10:00
|
||||
* @Description TODO
|
||||
* @Description 挂车认证
|
||||
*/
|
||||
class AuthTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
|
||||
|
||||
@ -69,12 +69,12 @@ class AuthTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
|
||||
}
|
||||
}
|
||||
|
||||
tvEnd.setOnClickListener {
|
||||
PickerUtils.getInstance().showDateSim(this@AuthTrailerActivity) {
|
||||
tvEnd.text = it
|
||||
upDrivingInfoBean.licenseValidity = it
|
||||
}
|
||||
}
|
||||
// tvEnd.setOnClickListener {
|
||||
// PickerUtils.getInstance().showDateSim(this@AuthTrailerActivity) {
|
||||
// tvEnd.text = it
|
||||
// upDrivingInfoBean.licenseValidity = it
|
||||
// }
|
||||
// }
|
||||
|
||||
btnOk.setOnClickListener {
|
||||
subMint()
|
||||
@ -129,14 +129,14 @@ class AuthTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
|
||||
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
|
||||
}
|
||||
// val changeDateNoneFormat = TimeUtil.changeDateNoneFormat(
|
||||
// it.inspectionRecord.substring(12, 19),
|
||||
// "yyyy年MM月"
|
||||
// )
|
||||
// if (!changeDateNoneFormat.isNullOrEmpty()) {
|
||||
// upDrivingInfoBean.licenseValidity = changeDateNoneFormat
|
||||
// binding.tvEnd.text = changeDateNoneFormat
|
||||
// }
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -148,8 +148,7 @@ class AuthTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
|
||||
binding.etCarNum.text.isNullOrEmpty() ||
|
||||
binding.tvCarColor.text.isNullOrEmpty() ||
|
||||
upDrivingInfoBean.licenseFaceUrl.isNullOrEmpty() ||
|
||||
upDrivingInfoBean.licenseBackUrl.isNullOrEmpty() ||
|
||||
binding.tvEnd.text.isNullOrEmpty()
|
||||
upDrivingInfoBean.licenseBackUrl.isNullOrEmpty()
|
||||
) {
|
||||
showToast("请完善证件信息")
|
||||
return
|
||||
@ -159,7 +158,6 @@ class AuthTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
|
||||
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
|
||||
}
|
||||
|
@ -0,0 +1,317 @@
|
||||
package com.dahe.gldriver.ui.account.authperson
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
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.ActivityAuthDrivingBinding
|
||||
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
|
||||
import java.text.Bidi
|
||||
|
||||
/**
|
||||
* @ClassName AuthRoleActivity
|
||||
* @Author 用户
|
||||
* @Date 2024/1/25 11:15
|
||||
* @Description 行驶证认证-编辑
|
||||
*/
|
||||
class EditDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
|
||||
|
||||
|
||||
var upDrivingInfoBean = UpDrivingInfoBean()
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusBarColor(R.color.white)
|
||||
setTitleBar("实名认证", true)
|
||||
binding.btnOk.setOnClickListener {
|
||||
subMit()
|
||||
}
|
||||
binding.run {
|
||||
btnOk.text = "确定"
|
||||
ivFront.setOnClickListener {
|
||||
selFrontPic()
|
||||
}
|
||||
|
||||
ivBack.setOnClickListener {
|
||||
selBackPic()
|
||||
}
|
||||
ivRoadFront.setOnClickListener {
|
||||
OcrUtils.getInstance()
|
||||
.noOcrUpPic(mContext, this@EditDrivingActivity) { picPath, ocrResult ->
|
||||
ImageLoader.getInstance()
|
||||
.loadRoundImage(mContext, picPath.locPic, 12, ivRoadFront)
|
||||
upDrivingInfoBean.roadLicensePhotoUrl = picPath.picPath
|
||||
}
|
||||
}
|
||||
ivCar.setOnClickListener {
|
||||
OcrUtils.getInstance()
|
||||
.noOcrUpPic(mContext, this@EditDrivingActivity) { picPath, ocrResult ->
|
||||
ImageLoader.getInstance()
|
||||
.loadRoundImage(mContext, picPath.locPic, 12, ivCar)
|
||||
upDrivingInfoBean.carUrl = picPath.picPath
|
||||
}
|
||||
}
|
||||
|
||||
tvDate.setOnClickListener {
|
||||
PickerUtils.getInstance().showDateSim(this@EditDrivingActivity) {
|
||||
tvDate.text = it
|
||||
}
|
||||
}
|
||||
//车辆类型
|
||||
tvCarType.setOnClickListener {
|
||||
//车辆类型
|
||||
DicUtils.getInstance()
|
||||
.selectDicCarType(
|
||||
mContext,
|
||||
this@EditDrivingActivity,
|
||||
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@EditDrivingActivity) {
|
||||
tvEnd.text = it
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
tvCarColor.setOnClickListener {
|
||||
DicUtils.getInstance()
|
||||
.getCarColor(mContext, this@EditDrivingActivity) { position, item ->
|
||||
var data = item as DiCarColor
|
||||
tvCarColor.text = data.dictLabel
|
||||
upDrivingInfoBean.run {
|
||||
plateColorCode = data.dictValue
|
||||
plateColor = data.dictLabel
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun initDate() {
|
||||
var carId = intent.extras?.getString(AppConfig.CAR_ID).toString()
|
||||
DataManager.getInstance().getCarByCarVehicleNum(carId)
|
||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<UpDrivingInfoBean>() {
|
||||
override fun onSuccess(t: CommonResponseBean<UpDrivingInfoBean>) {
|
||||
super.onSuccess(t)
|
||||
initViewByData(t.data)
|
||||
}
|
||||
}))
|
||||
|
||||
}
|
||||
|
||||
private fun initViewByData(data: UpDrivingInfoBean) {
|
||||
upDrivingInfoBean = data
|
||||
var isOnlyShow =
|
||||
intent.extras?.getBoolean(AppConfig.IS_ONLY_SHOW, false) == true
|
||||
if (isOnlyShow) {
|
||||
binding.run {
|
||||
llBtn.visibility = View.GONE
|
||||
etCarNum.isEnabled = false
|
||||
etID.isEnabled = false
|
||||
tvCarType.isEnabled = false
|
||||
etOwner.isEnabled = false
|
||||
etUseNature.isEnabled = false
|
||||
tvEnd.isEnabled = false
|
||||
tvDate.isEnabled = false
|
||||
tvCarColor.isEnabled = false
|
||||
ivRoadFront.isEnabled = false
|
||||
ivCar.isEnabled = false
|
||||
ivFront.isEnabled = false
|
||||
ivBack.isEnabled = false
|
||||
}
|
||||
}
|
||||
binding.run {
|
||||
ImageLoader.getInstance()
|
||||
.loadRoundImage(mContext, data.licenseFaceUrl, 12, ivFront)
|
||||
ImageLoader.getInstance()
|
||||
.loadRoundImage(mContext, data.licenseBackUrl, 12, ivBack)
|
||||
ImageLoader.getInstance()
|
||||
.loadRoundImage(mContext, data.carUrl, 12, ivCar)
|
||||
ImageLoader.getInstance()
|
||||
.loadRoundImage(mContext, data.roadLicensePhotoUrl, 12, ivRoadFront)
|
||||
|
||||
etCarNum.setText(data.vehicleNum)
|
||||
tvCarType.text = data.vehicleType
|
||||
|
||||
etOwner.setText(data.owner)
|
||||
etUseNature.setText(data.useNature)
|
||||
tvCarColor.text = data.plateColor
|
||||
tvEnd.text = data.licenseValidity
|
||||
|
||||
|
||||
etID.setText(data.roadLicense)
|
||||
tvDate.text = data.roadLicenseValidity
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 行驶证正面
|
||||
*/
|
||||
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 {
|
||||
var isHasFow = it.vehicleType.contains("牵引车")
|
||||
upDrivingInfoBean.isTrailer = if (isHasFow) "1" else "0"//是否有挂车(0否 1是)
|
||||
|
||||
|
||||
//识别车辆类型后,调用接口匹配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)
|
||||
etOwner.setText(it.owner)
|
||||
etUseNature.setText(it.useNature)
|
||||
etCurbWeight.setText(it.curbWeight)
|
||||
etPermittedWeight.setText(it.permittedWeight)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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 > 13) {
|
||||
val changeDateNoneFormat = TimeUtil.changeDateNoneFormat(
|
||||
it.inspectionRecord.substring(6, 14),
|
||||
"yyyy年MM月"
|
||||
)
|
||||
if (!changeDateNoneFormat.isNullOrEmpty()) {
|
||||
upDrivingInfoBean.licenseValidity = changeDateNoneFormat//行驶证到期时间
|
||||
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)//核定载质量
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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().editCar(upDrivingInfoBean)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<UpDrivingInfoBean>() {
|
||||
override fun onSuccess(t: CommonResponseBean<UpDrivingInfoBean>) {
|
||||
super.onSuccess(t)
|
||||
showToast("修改成功")
|
||||
setResult(RESULT_OK)
|
||||
finish()
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 根据车牌号查询车辆信任
|
||||
* @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
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,123 @@
|
||||
package com.dahe.gldriver.ui.account.authperson
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import com.dahe.gldriver.R
|
||||
import com.dahe.gldriver.base.AppConfig
|
||||
import com.dahe.gldriver.bean.UpDrivingInfoBean
|
||||
import com.dahe.gldriver.bean.UpQualiInfoBean
|
||||
import com.dahe.gldriver.bean.UpRoadInfoBean
|
||||
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.ui.account.AuthSuccActivity
|
||||
import com.dahe.gldriver.ui.account.SelectRoleActivity
|
||||
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.PopsUtils
|
||||
import com.github.gzuliyujiang.wheelpicker.contract.OnDatePickedListener
|
||||
import com.mobile.auth.gatewayauth.model.popsdkconfig.UploadData
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||
|
||||
/**
|
||||
* @ClassName AuthRoadActivity
|
||||
* @Author john
|
||||
* @Date 2024/1/25 16:02
|
||||
* @Description 道路运输许可证认证-编辑
|
||||
*/
|
||||
class EditRoadActivity : BaseActivity<ActivityAuthRoadBinding>() {
|
||||
|
||||
var upRoad = UpDrivingInfoBean()
|
||||
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusBarColor(R.color.white)
|
||||
setTitleBar("实名认证", true)
|
||||
binding.run {
|
||||
btnOk.text = "确定"
|
||||
btnOk.setOnClickListener {
|
||||
subMit()
|
||||
}
|
||||
|
||||
tvDate.setOnClickListener {
|
||||
PickerUtils.getInstance().showDateSim(this@EditRoadActivity) {
|
||||
upRoad.roadLicenseValidity = it
|
||||
binding.tvDate.text = it
|
||||
}
|
||||
}
|
||||
ivFront.setOnClickListener {
|
||||
OcrUtils.getInstance()
|
||||
.noOcrUpPic(mContext, this@EditRoadActivity) { picPath, ocrResult ->
|
||||
ImageLoader.getInstance()
|
||||
.loadRoundImage(mContext, picPath.locPic, 12, ivFront)
|
||||
upRoad.roadLicensePhotoUrl = picPath.picPath
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun initDate() {
|
||||
var carId = intent.extras?.getString(AppConfig.CAR_ID).toString()
|
||||
DataManager.getInstance().getCarByCarVehicleNum(carId)
|
||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<UpDrivingInfoBean>() {
|
||||
override fun onSuccess(t: CommonResponseBean<UpDrivingInfoBean>) {
|
||||
super.onSuccess(t)
|
||||
initViewByData(t.data)
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
private fun initViewByData(data: UpDrivingInfoBean) {
|
||||
upRoad = data
|
||||
var isOnlyShow =
|
||||
intent.extras?.getBoolean(AppConfig.IS_ONLY_SHOW, false) == true
|
||||
if (isOnlyShow) {
|
||||
binding.run {
|
||||
llBtn.visibility = View.GONE
|
||||
etID.isEnabled = false
|
||||
tvDate.isEnabled = false
|
||||
ivFront.isEnabled = false
|
||||
}
|
||||
}
|
||||
binding.run {
|
||||
ImageLoader.getInstance()
|
||||
.loadRoundImage(mContext, data.licenseFaceUrl, 12, ivFront)
|
||||
|
||||
etID.setText(data.roadLicense)
|
||||
tvDate.text = data.roadLicenseValidity
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private fun subMit() {
|
||||
upRoad.run {
|
||||
roadLicense = binding.etID.text.trim().toString()
|
||||
roadLicenseValidity = binding.tvDate.text.toString()
|
||||
|
||||
if (upRoad.roadLicense.isNullOrEmpty() || upRoad.roadLicenseValidity.isNullOrEmpty() || upRoad.roadLicensePhotoUrl.isNullOrEmpty()) {
|
||||
showToast("请完善信息")
|
||||
return
|
||||
}
|
||||
|
||||
DataManager.getInstance().editCar(upRoad)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<UpDrivingInfoBean>() {
|
||||
override fun onSuccess(t: CommonResponseBean<UpDrivingInfoBean>) {
|
||||
super.onSuccess(t)
|
||||
showToast("修改成功")
|
||||
setResult(RESULT_OK)
|
||||
finish()
|
||||
}
|
||||
}))
|
||||
}
|
||||
}
|
||||
}
|
@ -0,0 +1,226 @@
|
||||
package com.dahe.gldriver.ui.account.authperson
|
||||
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
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/25 10:00
|
||||
* @Description 挂车认证-编辑
|
||||
*/
|
||||
class EditTrailerActivity : 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 {
|
||||
btnOk.text = "确定"
|
||||
ivFront.setOnClickListener {
|
||||
selFrontPic()
|
||||
}
|
||||
|
||||
ivBack.setOnClickListener {
|
||||
selBackPic()
|
||||
}
|
||||
tvCarType.setOnClickListener {
|
||||
//车辆类型
|
||||
DicUtils.getInstance()
|
||||
.selectDicCarType(
|
||||
mContext,
|
||||
this@EditTrailerActivity,
|
||||
"重型自卸半挂车",
|
||||
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@EditTrailerActivity, 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@EditTrailerActivity) {
|
||||
// tvEnd.text = it
|
||||
// upDrivingInfoBean.licenseValidity = it
|
||||
// }
|
||||
// }
|
||||
|
||||
btnOk.setOnClickListener {
|
||||
subMint()
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun initDate() {
|
||||
var carId = intent.extras?.getString(AppConfig.CAR_ID).toString()
|
||||
DataManager.getInstance().getTrailerByVehicleNum(carId)
|
||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<UpDrivingInfoBean>() {
|
||||
override fun onSuccess(t: CommonResponseBean<UpDrivingInfoBean>) {
|
||||
super.onSuccess(t)
|
||||
initViewByData(t.data)
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
private fun initViewByData(data: UpDrivingInfoBean) {
|
||||
upDrivingInfoBean = data
|
||||
var isOnlyShow =
|
||||
intent.extras?.getBoolean(AppConfig.IS_ONLY_SHOW, false) == true
|
||||
if (isOnlyShow) {
|
||||
binding.run {
|
||||
llBtn.visibility = View.GONE
|
||||
etCarNum.isEnabled = false
|
||||
tvCarType.isEnabled = false
|
||||
etUseNature.isEnabled = false
|
||||
tvEnd.isEnabled = false
|
||||
tvCarColor.isEnabled = false
|
||||
ivFront.isEnabled = false
|
||||
ivBack.isEnabled = false
|
||||
}
|
||||
}
|
||||
binding.run {
|
||||
ImageLoader.getInstance()
|
||||
.loadRoundImage(mContext, data.licenseFaceUrl, 12, ivFront)
|
||||
ImageLoader.getInstance()
|
||||
.loadRoundImage(mContext, data.licenseBackUrl, 12, ivBack)
|
||||
ImageLoader.getInstance()
|
||||
|
||||
etCarNum.setText(data.vehicleNum)
|
||||
tvCarType.text = data.vehicleType
|
||||
|
||||
etUseNature.setText(data.useNature)
|
||||
tvCarColor.text = data.trailerPlateColor
|
||||
// tvEnd.text = data.licenseValidity
|
||||
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 行驶证正面
|
||||
*/
|
||||
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()
|
||||
) {
|
||||
showToast("请完善证件信息")
|
||||
return
|
||||
}
|
||||
|
||||
|
||||
upDrivingInfoBean.run {
|
||||
vehicleNum = binding.etCarNum.text.trim().toString()
|
||||
vehicleType = binding.tvCarType.text.trim().toString()//车辆类型
|
||||
trailerPlateColor = binding.tvCarColor.text.trim().toString()
|
||||
}
|
||||
|
||||
DataManager.getInstance().editTrailer(upDrivingInfoBean)
|
||||
.subscribeOn(Schedulers.io())
|
||||
.observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Int>() {
|
||||
override fun onSuccess(t: CommonResponseBean<Int>) {
|
||||
super.onSuccess(t)
|
||||
showToast("修改成功")
|
||||
setResult(RESULT_OK)
|
||||
finish()
|
||||
}
|
||||
}))
|
||||
}
|
||||
}
|
@ -1,16 +1,26 @@
|
||||
package com.dahe.gldriver.ui.mine.activity
|
||||
|
||||
import android.content.Intent
|
||||
import android.os.Bundle
|
||||
import android.view.View
|
||||
import com.dahe.gldriver.base.AppConfig
|
||||
import com.dahe.gldriver.bean.CarDetail
|
||||
import com.dahe.gldriver.databinding.ActivityCarDetailBinding
|
||||
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.account.authperson.EditDriverActivity
|
||||
import com.dahe.gldriver.ui.account.authperson.EditDrivingActivity
|
||||
import com.dahe.gldriver.ui.account.authperson.EditPersonActivity
|
||||
import com.dahe.gldriver.ui.account.authperson.EditQualificationActivity
|
||||
import com.dahe.gldriver.ui.account.authperson.EditRoadActivity
|
||||
import com.dahe.gldriver.ui.account.authperson.EditTrailerActivity
|
||||
import com.dahe.gldriver.utils.SPUtils
|
||||
import com.dahe.glex.bean.UserDetail
|
||||
import com.dahe.mylibrary.base.BaseActivity
|
||||
import com.dahe.mylibrary.net.CommonResponseBean
|
||||
import com.dahe.mylibrary.utils.ActivityUtils
|
||||
import io.reactivex.rxjava3.android.schedulers.AndroidSchedulers
|
||||
import io.reactivex.rxjava3.schedulers.Schedulers
|
||||
|
||||
@ -18,53 +28,132 @@ import io.reactivex.rxjava3.schedulers.Schedulers
|
||||
* @ClassName CarDetailActivity
|
||||
* @Author john
|
||||
* @Date 2024/3/21 11:24
|
||||
* @Description TODO
|
||||
* @Description 车辆详情
|
||||
*/
|
||||
class CarDetailActivity : BaseActivity<ActivityCarDetailBinding>() {
|
||||
class CarDetailActivity : BaseActivity<ActivityCarDetailBinding>(), View.OnClickListener {
|
||||
|
||||
var doneInfoCount = 0
|
||||
|
||||
lateinit var CarDetail: CarDetail
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusHeightParams(binding.rlTop)
|
||||
setTitleBar("车辆详情", true)
|
||||
binding.run {
|
||||
circleBarView2.run {
|
||||
text = "完成度"
|
||||
unitText = "%"
|
||||
progress = 0
|
||||
}
|
||||
|
||||
btnId.setOnClickListener(this@CarDetailActivity)
|
||||
llAgainId.setOnClickListener(this@CarDetailActivity)
|
||||
llSeeId.setOnClickListener(this@CarDetailActivity)
|
||||
|
||||
btnDriver.setOnClickListener(this@CarDetailActivity)
|
||||
llAgainDriver.setOnClickListener(this@CarDetailActivity)
|
||||
llSeeDriver.setOnClickListener(this@CarDetailActivity)
|
||||
|
||||
|
||||
btnQua.setOnClickListener(this@CarDetailActivity)
|
||||
llAgainQua.setOnClickListener(this@CarDetailActivity)
|
||||
llSeeQua.setOnClickListener(this@CarDetailActivity)
|
||||
}
|
||||
}
|
||||
|
||||
override fun onClick(view: View?) {
|
||||
super.onClick(view)
|
||||
if (!::CarDetail.isInitialized) {
|
||||
showToast("车辆信息未查到")
|
||||
return
|
||||
}
|
||||
|
||||
binding.run {
|
||||
when (view?.id) {
|
||||
btnId.id, llAgainId.id -> ActivityUtils.startActivityForResult(
|
||||
this@CarDetailActivity,
|
||||
EditDrivingActivity::class.java, Bundle().apply {
|
||||
putString(AppConfig.CAR_ID, CarDetail.vehicleNum)
|
||||
}, 1
|
||||
)
|
||||
|
||||
llSeeId.id -> ActivityUtils.startActivity(
|
||||
mContext,
|
||||
EditDrivingActivity::class.java,
|
||||
Bundle().apply {
|
||||
putBoolean(AppConfig.IS_ONLY_SHOW, true)
|
||||
putString(AppConfig.CAR_ID, CarDetail.vehicleNum)
|
||||
})
|
||||
|
||||
btnDriver.id, llAgainDriver.id -> ActivityUtils.startActivityForResult(
|
||||
this@CarDetailActivity,
|
||||
EditTrailerActivity::class.java, Bundle().apply {
|
||||
putString(AppConfig.CAR_ID, CarDetail.trailerVehicleNum)
|
||||
}, 1
|
||||
)
|
||||
|
||||
llSeeDriver.id -> ActivityUtils.startActivity(
|
||||
mContext,
|
||||
EditTrailerActivity::class.java,
|
||||
Bundle().apply {
|
||||
putBoolean(AppConfig.IS_ONLY_SHOW, true)
|
||||
putString(AppConfig.CAR_ID, CarDetail.trailerVehicleNum)
|
||||
})
|
||||
|
||||
btnQua.id, llAgainQua.id -> ActivityUtils.startActivityForResult(
|
||||
this@CarDetailActivity,
|
||||
EditRoadActivity::class.java, Bundle().apply {
|
||||
putString(AppConfig.CAR_ID, CarDetail.vehicleNum)
|
||||
}, 1
|
||||
)
|
||||
|
||||
llSeeQua.id -> ActivityUtils.startActivity(
|
||||
mContext,
|
||||
EditRoadActivity::class.java,
|
||||
Bundle().apply {
|
||||
putBoolean(AppConfig.IS_ONLY_SHOW, true)
|
||||
putString(AppConfig.CAR_ID, CarDetail.vehicleNum)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
override fun initDate() {
|
||||
DataManager.getInstance().getUserDetail()
|
||||
var carId = intent.extras?.getString(AppConfig.CAR_ID).toString()
|
||||
DataManager.getInstance().getCarDocIntegrity(carId)
|
||||
.subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<UserDetail>() {
|
||||
override fun onSuccess(t: CommonResponseBean<UserDetail>) {
|
||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<CarDetail>() {
|
||||
override fun onSuccess(t: CommonResponseBean<CarDetail>) {
|
||||
super.onSuccess(t)
|
||||
initViewByData(t.data)
|
||||
}
|
||||
}))
|
||||
}
|
||||
|
||||
private fun initViewByData(data: UserDetail) {
|
||||
// userDetail = data
|
||||
private fun initViewByData(data: CarDetail) {
|
||||
var doneInfoCount = 0
|
||||
CarDetail = data
|
||||
binding.run {
|
||||
val userInfo = SPUtils.instance.getUserInfo(mContext)
|
||||
var missInfo = ""
|
||||
|
||||
if (data.idcardNo.isNullOrEmpty()) {
|
||||
if (data.vehicleNum.isNullOrEmpty()) {
|
||||
tvInfo.text = "证件缺失将无法进行接单"
|
||||
missInfo.plus("行驶证、")
|
||||
} else {
|
||||
doneInfoCount++
|
||||
tvInfo.text = """${data.idcardName} ${data.idcardNo}"""
|
||||
tvInfo.text = """${data.vehicleNum} ${data.vehicleType}"""
|
||||
}
|
||||
if (data.licenseNo.isNullOrEmpty()) {
|
||||
if (data.trailerVehicleNum.isNullOrEmpty()) {
|
||||
tvDriverInfo.text = "证件缺失将无法进行接单"
|
||||
missInfo.plus("挂车行驶证、")
|
||||
} else {
|
||||
doneInfoCount++
|
||||
tvDriverInfo.text = """${data.licenseName} ${data.licenseNo}"""
|
||||
tvDriverInfo.text = """${data.trailerVehicleNum} ${data.trailerVehicleType}"""
|
||||
}
|
||||
if (data.qualificationCertificateNo.isNullOrEmpty()) {
|
||||
if (data.roadLicense.isNullOrEmpty()) {
|
||||
tvQualiInfo.text = "证件缺失将无法进行接单"
|
||||
missInfo.plus("道路运输许可证、")
|
||||
} else {
|
||||
doneInfoCount++
|
||||
tvQualiInfo.text = """${data.qualificationCertificateNo}"""
|
||||
tvQualiInfo.text = """${data.roadLicense}"""
|
||||
}
|
||||
|
||||
|
||||
@ -72,18 +161,27 @@ class CarDetailActivity : BaseActivity<ActivityCarDetailBinding>() {
|
||||
tvContent.text = if (missInfo.isNullOrEmpty()) "认证成功,请接单把!!!" else missInfo
|
||||
|
||||
|
||||
llId.visibility = if (data.idcardNo.isNullOrEmpty()) View.GONE else View.VISIBLE
|
||||
btnId.visibility = if (data.idcardNo.isNullOrEmpty()) View.VISIBLE else View.GONE
|
||||
llId.visibility = if (data.vehicleNum.isNullOrEmpty()) View.GONE else View.VISIBLE
|
||||
btnId.visibility = if (data.vehicleNum.isNullOrEmpty()) View.VISIBLE else View.GONE
|
||||
|
||||
llDriver.visibility = if (data.licenseNo.isNullOrEmpty()) View.GONE else View.VISIBLE
|
||||
btnDriver.visibility = if (data.licenseNo.isNullOrEmpty()) View.VISIBLE else View.GONE
|
||||
llDriver.visibility =
|
||||
if (data.trailerVehicleNum.isNullOrEmpty()) View.GONE else View.VISIBLE
|
||||
btnDriver.visibility =
|
||||
if (data.trailerVehicleNum.isNullOrEmpty()) View.VISIBLE else View.GONE
|
||||
llQua.visibility =
|
||||
if (data.qualificationCertificateNo.isNullOrEmpty()) View.GONE else View.VISIBLE
|
||||
if (data.roadLicense.isNullOrEmpty()) View.GONE else View.VISIBLE
|
||||
btnQua.visibility =
|
||||
if (data.qualificationCertificateNo.isNullOrEmpty()) View.VISIBLE else View.GONE
|
||||
if (data.roadLicense.isNullOrEmpty()) View.VISIBLE else View.GONE
|
||||
|
||||
circleBarView2.progress = doneInfoCount * 100 / 3
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
override fun onActivityResult(requestCode: Int, resultCode: Int, data: Intent?) {
|
||||
super.onActivityResult(requestCode, resultCode, data)
|
||||
if (resultCode == RESULT_OK && requestCode == 1) {
|
||||
initDate()
|
||||
}
|
||||
}
|
||||
}
|
@ -7,6 +7,7 @@ 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.base.AppConfig
|
||||
import com.dahe.gldriver.bean.CarBean
|
||||
import com.dahe.gldriver.databinding.ActivityCarsManBinding
|
||||
import com.dahe.gldriver.net.BaseObserver
|
||||
@ -50,8 +51,12 @@ class CarsManActivity : BaseActivity<ActivityCarsManBinding>() {
|
||||
adapter as CarsAdapter
|
||||
}.apply {
|
||||
isStateViewEnable = true
|
||||
setOnItemClickListener{_,_,position->
|
||||
ActivityUtils.startActivity(mContext,CarDetailActivity::class.java)
|
||||
setOnItemClickListener { _, _, position ->
|
||||
|
||||
ActivityUtils.startActivity(
|
||||
mContext,
|
||||
CarDetailActivity::class.java,
|
||||
Bundle().apply { putString(AppConfig.CAR_ID, items[position].carId) })
|
||||
}
|
||||
addOnItemChildClickListener(R.id.tvUnbind) { adapter, view, position ->
|
||||
CommonPopUtils.getInstance()
|
||||
|
@ -33,7 +33,6 @@ import io.reactivex.rxjava3.schedulers.Schedulers
|
||||
*/
|
||||
class PersonInfoActivity : BaseActivity<ActivityPersonInfoBinding>(), View.OnClickListener {
|
||||
var doneInfoCount = 0
|
||||
var userDetail: UserDetail? = null
|
||||
override fun initView(savedInstanceState: Bundle?) {
|
||||
setStatusHeightParams(binding.rlTop)
|
||||
setTitleBar("实名认证", true)
|
||||
@ -121,7 +120,6 @@ class PersonInfoActivity : BaseActivity<ActivityPersonInfoBinding>(), View.OnCli
|
||||
|
||||
private fun initViewByData(data: UserDetail) {
|
||||
doneInfoCount = 0
|
||||
userDetail = data
|
||||
binding.run {
|
||||
var missInfo = ""
|
||||
|
||||
|
@ -520,6 +520,7 @@
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llBtn"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_70"
|
||||
android:background="@color/white"
|
||||
|
@ -152,6 +152,7 @@
|
||||
android:background="@color/white" />
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llBtn"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_70"
|
||||
android:background="@color/white"
|
||||
|
@ -233,6 +233,7 @@
|
||||
</LinearLayout>
|
||||
|
||||
<LinearLayout
|
||||
android:visibility="gone"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="wrap_content"
|
||||
android:layout_marginTop="@dimen/dp_12"
|
||||
@ -277,6 +278,7 @@
|
||||
|
||||
|
||||
<LinearLayout
|
||||
android:id="@+id/llBtn"
|
||||
android:layout_width="match_parent"
|
||||
android:layout_height="@dimen/dp_70"
|
||||
android:background="@color/white"
|
||||
|
Loading…
Reference in New Issue
Block a user