司机注册跳转优化
This commit is contained in:
parent
34bff03c52
commit
720d580685
@ -13,6 +13,8 @@ import com.dahe.mylibrary.net.CommonResponseBean
|
|||||||
import com.dahe.mylibrary.utils.ActivityUtils
|
import com.dahe.mylibrary.utils.ActivityUtils
|
||||||
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
|
||||||
|
import java.util.Timer
|
||||||
|
import java.util.TimerTask
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @ClassName AuthRoleActivity
|
* @ClassName AuthRoleActivity
|
||||||
@ -23,7 +25,9 @@ import io.reactivex.rxjava3.schedulers.Schedulers
|
|||||||
class SelectRoleActivity : BaseActivity<ActivitySelectRoleBinding>() {
|
class SelectRoleActivity : BaseActivity<ActivitySelectRoleBinding>() {
|
||||||
override fun initView(savedInstanceState: Bundle?) {
|
override fun initView(savedInstanceState: Bundle?) {
|
||||||
setStatusBarColor(R.color.white)
|
setStatusBarColor(R.color.white)
|
||||||
setTitleBar("选择角色", true)
|
setTitleBar("选择角色"){
|
||||||
|
ActivityUtils.startActivity(mContext,LoginActivity::class.java)
|
||||||
|
}
|
||||||
binding.rlPerson.setOnClickListener {
|
binding.rlPerson.setOnClickListener {
|
||||||
|
|
||||||
|
|
||||||
@ -58,4 +62,8 @@ class SelectRoleActivity : BaseActivity<ActivitySelectRoleBinding>() {
|
|||||||
|
|
||||||
override fun initDate() {
|
override fun initDate() {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onBackPressed() {
|
||||||
|
ActivityUtils.startActivity(mContext,LoginActivity::class.java)
|
||||||
|
}
|
||||||
}
|
}
|
@ -104,33 +104,39 @@ class AuthDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
|
|||||||
|
|
||||||
if (driverInfoBean.licenseName != backLicName) {
|
if (driverInfoBean.licenseName != backLicName) {
|
||||||
CommonPopUtils.getInstance().showCommCenterPop(mContext, content = "检测到主副页识别姓名不一致,是否继续上传?") {
|
CommonPopUtils.getInstance().showCommCenterPop(mContext, content = "检测到主副页识别姓名不一致,是否继续上传?") {
|
||||||
DataManager.getInstance().setUpDriverLicense(driverInfoBean)
|
upApi()
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
|
|
||||||
override fun onSuccess(t: CommonResponseBean<Any>) {
|
|
||||||
super.onSuccess(t)
|
|
||||||
if (driverInfoBean.licenseType.contains("C")) {//C证
|
|
||||||
ActivityUtils.startActivity(
|
|
||||||
mContext,
|
|
||||||
AuthBankCardActivity::class.java
|
|
||||||
)
|
|
||||||
} else {
|
|
||||||
ActivityUtils.startActivity(
|
|
||||||
mContext,
|
|
||||||
AuthQualificationActivity::class.java
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
finish()
|
|
||||||
}
|
|
||||||
}))
|
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
upApi()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun upApi(){
|
||||||
|
DataManager.getInstance().setUpDriverLicense(driverInfoBean)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
|
||||||
|
override fun onSuccess(t: CommonResponseBean<Any>) {
|
||||||
|
super.onSuccess(t)
|
||||||
|
if (driverInfoBean.licenseType.contains("C")) {//C证
|
||||||
|
ActivityUtils.startActivity(
|
||||||
|
mContext,
|
||||||
|
AuthBankCardActivity::class.java
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
ActivityUtils.startActivity(
|
||||||
|
mContext,
|
||||||
|
AuthQualificationActivity::class.java
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
private fun selFrontPic() {
|
private fun selFrontPic() {
|
||||||
|
|
||||||
OcrUtils.getInstance().ocrDriver(mContext, this) { picPath, result ->
|
OcrUtils.getInstance().ocrDriver(mContext, this) { picPath, result ->
|
||||||
|
@ -274,34 +274,40 @@ class AuthDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
|
|||||||
|
|
||||||
if (upDrivingInfoBean.vehicleNum!=backLicCarNum){
|
if (upDrivingInfoBean.vehicleNum!=backLicCarNum){
|
||||||
CommonPopUtils.getInstance().showCommCenterPop(mContext, content = "检测到主副页识别车牌号内容不一致,是否继续上传?"){
|
CommonPopUtils.getInstance().showCommCenterPop(mContext, content = "检测到主副页识别车牌号内容不一致,是否继续上传?"){
|
||||||
DataManager.getInstance().addCar(upDrivingInfoBean)
|
upApi()
|
||||||
.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)
|
|
||||||
putBoolean(AppConfig.IS_GO_MINE,true)
|
|
||||||
})
|
|
||||||
} else {
|
|
||||||
ActivityUtils.startActivity(mContext, AuthSuccActivity::class.java,Bundle().apply {
|
|
||||||
putBoolean(AppConfig.IS_GO_MINE,true)
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}))
|
|
||||||
}
|
}
|
||||||
|
}else{
|
||||||
|
upApi()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun upApi(){
|
||||||
|
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)
|
||||||
|
putBoolean(AppConfig.IS_GO_MINE,true)
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
ActivityUtils.startActivity(mContext, AuthSuccActivity::class.java,Bundle().apply {
|
||||||
|
putBoolean(AppConfig.IS_GO_MINE,true)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据车牌号查询车辆信任
|
* 根据车牌号查询车辆信任
|
||||||
|
@ -33,7 +33,7 @@ class AuthFaceActivity : BaseActivity<ActivityAuthFaceBinding>() {
|
|||||||
isSupp = intent.extras?.getBoolean(AppConfig.IS_SUPPLEMENT, false)
|
isSupp = intent.extras?.getBoolean(AppConfig.IS_SUPPLEMENT, false)
|
||||||
setTitleBar("实名认证") {
|
setTitleBar("实名认证") {
|
||||||
if (isSupp == true) {//个人中心进来
|
if (isSupp == true) {//个人中心进来
|
||||||
finish()
|
setResult(RESULT_OK)
|
||||||
} else {
|
} else {
|
||||||
ActivityUtils.startActivity(mContext, HomeActivity::class.java)
|
ActivityUtils.startActivity(mContext, HomeActivity::class.java)
|
||||||
}
|
}
|
||||||
@ -94,6 +94,10 @@ class AuthFaceActivity : BaseActivity<ActivityAuthFaceBinding>() {
|
|||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
override fun onBackPressed() {
|
||||||
|
super.onBackPressed()
|
||||||
|
setResult(RESULT_OK)
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -219,19 +219,27 @@ class AuthTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (upDrivingInfoBean.vehicleNum != backLicCarNum) {
|
if (upDrivingInfoBean.vehicleNum != backLicCarNum) {
|
||||||
CommonPopUtils.getInstance().showCommCenterPop(mContext, content = "检测到主副页识别车牌号内容不一致,是否继续上传?") {
|
CommonPopUtils.getInstance().showCommCenterPop(
|
||||||
DataManager.getInstance().addTrailer(upDrivingInfoBean)
|
mContext,
|
||||||
.subscribeOn(Schedulers.io())
|
content = "检测到主副页识别车牌号内容不一致,是否继续上传?"
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
) {
|
||||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
|
upApi()
|
||||||
override fun onSuccess(t: CommonResponseBean<Any>) {
|
|
||||||
super.onSuccess(t)
|
|
||||||
ActivityUtils.startActivity(mContext, AuthSuccActivity::class.java)
|
|
||||||
}
|
|
||||||
}))
|
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
|
upApi()
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun upApi() {
|
||||||
|
DataManager.getInstance().addTrailer(upDrivingInfoBean)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
|
||||||
|
override fun onSuccess(t: CommonResponseBean<Any>) {
|
||||||
|
super.onSuccess(t)
|
||||||
|
ActivityUtils.startActivity(mContext, AuthSuccActivity::class.java)
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
}
|
||||||
}
|
}
|
@ -11,6 +11,8 @@ 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.oss.OssServiceUtil
|
||||||
|
import com.dahe.gldriver.ui.mine.activity.PersonInfoActivity
|
||||||
|
import com.dahe.gldriver.utils.UserUtils
|
||||||
import com.dahe.glex.bean.UserDetail
|
import com.dahe.glex.bean.UserDetail
|
||||||
import com.dahe.mylibrary.base.BaseActivity
|
import com.dahe.mylibrary.base.BaseActivity
|
||||||
import com.dahe.mylibrary.net.CommonResponseBean
|
import com.dahe.mylibrary.net.CommonResponseBean
|
||||||
@ -33,7 +35,10 @@ class EditBankCardActivity : BaseActivity<ActivityAuthBankcardBinding>() {
|
|||||||
var perInfoBean: UserDetail = UserDetail()
|
var perInfoBean: UserDetail = UserDetail()
|
||||||
override fun initView(savedInstanceState: Bundle?) {
|
override fun initView(savedInstanceState: Bundle?) {
|
||||||
setStatusBarColor(R.color.white)
|
setStatusBarColor(R.color.white)
|
||||||
setTitleBar("更换银行卡", true)
|
setTitleBar("更换银行卡"){
|
||||||
|
setResult(RESULT_OK)
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
|
||||||
binding.run {
|
binding.run {
|
||||||
tvNote.visibility = View.GONE
|
tvNote.visibility = View.GONE
|
||||||
@ -92,7 +97,12 @@ class EditBankCardActivity : BaseActivity<ActivityAuthBankcardBinding>() {
|
|||||||
override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) {
|
override fun onSuccess(t: CommonResponseBean<OcrPersonBean>) {
|
||||||
super.onSuccess(t)
|
super.onSuccess(t)
|
||||||
t.data?.data?.run {
|
t.data?.data?.run {
|
||||||
ImageLoader.getInstance().loadRoundImage(mContext, data1.realPath, 12, binding.ivFront)
|
ImageLoader.getInstance().loadRoundImage(
|
||||||
|
mContext,
|
||||||
|
data1.realPath,
|
||||||
|
12,
|
||||||
|
binding.ivFront
|
||||||
|
)
|
||||||
perInfoBean.driverBankcardPhotoUrl = oldPath
|
perInfoBean.driverBankcardPhotoUrl = oldPath
|
||||||
|
|
||||||
binding.let {
|
binding.let {
|
||||||
@ -127,10 +137,21 @@ class EditBankCardActivity : BaseActivity<ActivityAuthBankcardBinding>() {
|
|||||||
override fun onSuccess(t: CommonResponseBean<Any>) {
|
override fun onSuccess(t: CommonResponseBean<Any>) {
|
||||||
super.onSuccess(t)
|
super.onSuccess(t)
|
||||||
showToast("修改成功")
|
showToast("修改成功")
|
||||||
|
val goNextPersonInfo = UserUtils.instance.goNextPersonInfo(perInfoBean)
|
||||||
|
if (goNextPersonInfo != null) {
|
||||||
|
ActivityUtils.startActivity(mContext,goNextPersonInfo)
|
||||||
|
}
|
||||||
setResult(RESULT_OK)
|
setResult(RESULT_OK)
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onBackPressed() {
|
||||||
|
super.onBackPressed()
|
||||||
|
setResult(RESULT_OK)
|
||||||
|
finish()
|
||||||
|
}
|
||||||
}
|
}
|
@ -11,8 +11,10 @@ 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.oss.OssServiceUtil
|
||||||
|
import com.dahe.gldriver.ui.mine.activity.PersonInfoActivity
|
||||||
import com.dahe.gldriver.utils.CommonPopUtils
|
import com.dahe.gldriver.utils.CommonPopUtils
|
||||||
import com.dahe.gldriver.utils.OcrUtils
|
import com.dahe.gldriver.utils.OcrUtils
|
||||||
|
import com.dahe.gldriver.utils.UserUtils
|
||||||
import com.dahe.glex.bean.UserDetail
|
import com.dahe.glex.bean.UserDetail
|
||||||
import com.dahe.mylibrary.utils.PickerUtils
|
import com.dahe.mylibrary.utils.PickerUtils
|
||||||
import com.dahe.mylibrary.base.BaseActivity
|
import com.dahe.mylibrary.base.BaseActivity
|
||||||
@ -38,7 +40,10 @@ class EditDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
|
|||||||
var backLicName = ""
|
var backLicName = ""
|
||||||
override fun initView(savedInstanceState: Bundle?) {
|
override fun initView(savedInstanceState: Bundle?) {
|
||||||
setStatusBarColor(R.color.white)
|
setStatusBarColor(R.color.white)
|
||||||
setTitleBar("实名认证", true)
|
setTitleBar("实名认证") {
|
||||||
|
setResult(RESULT_OK)
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
|
||||||
binding.run {
|
binding.run {
|
||||||
btnOk.text = "确定"
|
btnOk.text = "确定"
|
||||||
@ -148,23 +153,33 @@ class EditDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
|
|||||||
if (driverInfoBean.licenseName != backLicName) {
|
if (driverInfoBean.licenseName != backLicName) {
|
||||||
CommonPopUtils.getInstance()
|
CommonPopUtils.getInstance()
|
||||||
.showCommCenterPop(mContext, content = "检测到主副页识别姓名不一致,是否继续上传?") {
|
.showCommCenterPop(mContext, content = "检测到主副页识别姓名不一致,是否继续上传?") {
|
||||||
DataManager.getInstance().reUpDriverLicense(driverInfoBean)
|
upApi()
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
|
|
||||||
override fun onSuccess(t: CommonResponseBean<Any>) {
|
|
||||||
super.onSuccess(t)
|
|
||||||
showToast("修改成功")
|
|
||||||
setResult(RESULT_OK)
|
|
||||||
finish()
|
|
||||||
}
|
|
||||||
}))
|
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
|
upApi()
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun upApi() {
|
||||||
|
DataManager.getInstance().reUpDriverLicense(driverInfoBean)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
|
||||||
|
override fun onSuccess(t: CommonResponseBean<Any>) {
|
||||||
|
super.onSuccess(t)
|
||||||
|
showToast("修改成功")
|
||||||
|
val goNextPersonInfo =
|
||||||
|
UserUtils.instance.goNextPersonInfo(driverInfoBean)
|
||||||
|
if (goNextPersonInfo != null) {
|
||||||
|
ActivityUtils.startActivity(mContext, goNextPersonInfo)
|
||||||
|
}
|
||||||
|
setResult(RESULT_OK)
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
private fun selFrontPic() {
|
private fun selFrontPic() {
|
||||||
|
|
||||||
OcrUtils.getInstance().ocrDriver(mContext, this) { picPath, result ->
|
OcrUtils.getInstance().ocrDriver(mContext, this) { picPath, result ->
|
||||||
@ -213,10 +228,17 @@ class EditDriverActivity : BaseActivity<ActivityAuthDriverBinding>() {
|
|||||||
.loadRoundImage(mContext, picPath.locPic, 12, binding.ivBack)
|
.loadRoundImage(mContext, picPath.locPic, 12, binding.ivBack)
|
||||||
driverInfoBean.licensePhotoBackUrl = picPath.picPath
|
driverInfoBean.licensePhotoBackUrl = picPath.picPath
|
||||||
it?.run {
|
it?.run {
|
||||||
|
backLicName = it.name
|
||||||
driverInfoBean.licenseRecordNumber = recordNumber
|
driverInfoBean.licenseRecordNumber = recordNumber
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
override fun onBackPressed() {
|
||||||
|
super.onBackPressed()
|
||||||
|
setResult(RESULT_OK)
|
||||||
|
finish()
|
||||||
|
}
|
||||||
}
|
}
|
@ -4,6 +4,7 @@ import android.os.Bundle
|
|||||||
import android.view.View
|
import android.view.View
|
||||||
import com.dahe.gldriver.R
|
import com.dahe.gldriver.R
|
||||||
import com.dahe.gldriver.base.AppConfig
|
import com.dahe.gldriver.base.AppConfig
|
||||||
|
import com.dahe.gldriver.bean.CarDetail
|
||||||
import com.dahe.gldriver.bean.DiCarColor
|
import com.dahe.gldriver.bean.DiCarColor
|
||||||
import com.dahe.gldriver.bean.UpDrivingInfoBean
|
import com.dahe.gldriver.bean.UpDrivingInfoBean
|
||||||
import com.dahe.gldriver.databinding.ActivityAuthDrivingBinding
|
import com.dahe.gldriver.databinding.ActivityAuthDrivingBinding
|
||||||
@ -14,6 +15,7 @@ import com.dahe.gldriver.ui.account.AuthSuccActivity
|
|||||||
import com.dahe.gldriver.utils.CommonPopUtils
|
import com.dahe.gldriver.utils.CommonPopUtils
|
||||||
import com.dahe.gldriver.utils.DicUtils
|
import com.dahe.gldriver.utils.DicUtils
|
||||||
import com.dahe.gldriver.utils.OcrUtils
|
import com.dahe.gldriver.utils.OcrUtils
|
||||||
|
import com.dahe.gldriver.utils.UserUtils
|
||||||
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
|
||||||
@ -328,23 +330,28 @@ class EditDrivingActivity : BaseActivity<ActivityAuthDrivingBinding>() {
|
|||||||
mContext,
|
mContext,
|
||||||
content = "检测到主副页识别车牌号内容不一致,是否继续上传?"
|
content = "检测到主副页识别车牌号内容不一致,是否继续上传?"
|
||||||
) {
|
) {
|
||||||
DataManager.getInstance().editCar(upDrivingInfoBean)
|
upApi()
|
||||||
.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()
|
|
||||||
}
|
|
||||||
}))
|
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
|
upApi()
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun upApi() {
|
||||||
|
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()
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据车牌号查询车辆信任
|
* 根据车牌号查询车辆信任
|
||||||
|
@ -11,7 +11,9 @@ import com.dahe.gldriver.databinding.ActivityAuthPersonBinding
|
|||||||
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.activity.PersonInfoActivity
|
||||||
import com.dahe.gldriver.utils.OcrUtils
|
import com.dahe.gldriver.utils.OcrUtils
|
||||||
|
import com.dahe.gldriver.utils.UserUtils
|
||||||
import com.dahe.glex.bean.UserDetail
|
import com.dahe.glex.bean.UserDetail
|
||||||
import com.dahe.mylibrary.base.BaseActivity
|
import com.dahe.mylibrary.base.BaseActivity
|
||||||
import com.dahe.mylibrary.net.CommonResponseBean
|
import com.dahe.mylibrary.net.CommonResponseBean
|
||||||
@ -35,12 +37,17 @@ import java.io.File
|
|||||||
* @Date 2024/1/25 11:15
|
* @Date 2024/1/25 11:15
|
||||||
* @Description 身份证认证-编辑
|
* @Description 身份证认证-编辑
|
||||||
*/
|
*/
|
||||||
|
@Suppress("ALWAYS_NULL")
|
||||||
class EditPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
|
class EditPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
|
||||||
|
|
||||||
var perInfoBean: UserDetail = UserDetail()
|
var perInfoBean: UserDetail = UserDetail()
|
||||||
|
private var firstMissingInfo = -1
|
||||||
override fun initView(savedInstanceState: Bundle?) {
|
override fun initView(savedInstanceState: Bundle?) {
|
||||||
setStatusBarColor(R.color.white)
|
setStatusBarColor(R.color.white)
|
||||||
setTitleBar("实名认证", true)
|
setTitleBar("实名认证"){
|
||||||
|
setResult(RESULT_OK)
|
||||||
|
finish()
|
||||||
|
}
|
||||||
binding.run {
|
binding.run {
|
||||||
btnOk.text = "确定"
|
btnOk.text = "确定"
|
||||||
|
|
||||||
@ -71,6 +78,10 @@ class EditPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
|
|||||||
override fun onSuccess(t: CommonResponseBean<Any>) {
|
override fun onSuccess(t: CommonResponseBean<Any>) {
|
||||||
super.onSuccess(t)
|
super.onSuccess(t)
|
||||||
showToast("修改成功")
|
showToast("修改成功")
|
||||||
|
val goNextPersonInfo = UserUtils.instance.goNextPersonInfo(perInfoBean)
|
||||||
|
if (goNextPersonInfo != null) {
|
||||||
|
ActivityUtils.startActivity(mContext,goNextPersonInfo)
|
||||||
|
}
|
||||||
setResult(RESULT_OK)
|
setResult(RESULT_OK)
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
@ -170,7 +181,7 @@ class EditPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
|
|||||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<UserDetail>() {
|
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<UserDetail>() {
|
||||||
override fun onSuccess(t: CommonResponseBean<UserDetail>) {
|
override fun onSuccess(t: CommonResponseBean<UserDetail>) {
|
||||||
super.onSuccess(t)
|
super.onSuccess(t)
|
||||||
if (t.data==null)
|
if (t.data == null)
|
||||||
return
|
return
|
||||||
perInfoBean = t.data
|
perInfoBean = t.data
|
||||||
var isOnlyShow =
|
var isOnlyShow =
|
||||||
@ -199,7 +210,11 @@ class EditPersonActivity : BaseActivity<ActivityAuthPersonBinding>() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onBackPressed() {
|
||||||
|
super.onBackPressed()
|
||||||
|
setResult(RESULT_OK)
|
||||||
|
finish()
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -9,8 +9,10 @@ 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.oss.OssServiceUtil
|
||||||
|
import com.dahe.gldriver.ui.mine.activity.PersonInfoActivity
|
||||||
import com.dahe.gldriver.utils.OcrUtils
|
import com.dahe.gldriver.utils.OcrUtils
|
||||||
import com.dahe.gldriver.utils.SPUtils
|
import com.dahe.gldriver.utils.SPUtils
|
||||||
|
import com.dahe.gldriver.utils.UserUtils
|
||||||
import com.dahe.glex.bean.UserDetail
|
import com.dahe.glex.bean.UserDetail
|
||||||
import com.dahe.mylibrary.utils.PickerUtils
|
import com.dahe.mylibrary.utils.PickerUtils
|
||||||
import com.dahe.mylibrary.base.BaseActivity
|
import com.dahe.mylibrary.base.BaseActivity
|
||||||
@ -32,7 +34,10 @@ class EditQualificationActivity : BaseActivity<ActivityAuthQualificationBinding>
|
|||||||
var upQuaInfo = UserDetail()
|
var upQuaInfo = UserDetail()
|
||||||
override fun initView(savedInstanceState: Bundle?) {
|
override fun initView(savedInstanceState: Bundle?) {
|
||||||
setStatusBarColor(R.color.white)
|
setStatusBarColor(R.color.white)
|
||||||
setTitleBar("实名认证", true)
|
setTitleBar("实名认证"){
|
||||||
|
setResult(RESULT_OK)
|
||||||
|
finish()
|
||||||
|
}
|
||||||
binding.btnOk.setOnClickListener {
|
binding.btnOk.setOnClickListener {
|
||||||
subMit()
|
subMit()
|
||||||
}
|
}
|
||||||
@ -112,10 +117,20 @@ class EditQualificationActivity : BaseActivity<ActivityAuthQualificationBinding>
|
|||||||
override fun onSuccess(t: CommonResponseBean<Any>) {
|
override fun onSuccess(t: CommonResponseBean<Any>) {
|
||||||
super.onSuccess(t)
|
super.onSuccess(t)
|
||||||
showToast("修改成功")
|
showToast("修改成功")
|
||||||
|
val goNextPersonInfo = UserUtils.instance.goNextPersonInfo(upQuaInfo)
|
||||||
|
if (goNextPersonInfo != null) {
|
||||||
|
ActivityUtils.startActivity(mContext,goNextPersonInfo)
|
||||||
|
}
|
||||||
setResult(RESULT_OK)
|
setResult(RESULT_OK)
|
||||||
finish()
|
finish()
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
override fun onBackPressed() {
|
||||||
|
super.onBackPressed()
|
||||||
|
setResult(RESULT_OK)
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -275,34 +275,39 @@ class EditTrailerActivity : BaseActivity<ActivityAuthTrailerBinding>() {
|
|||||||
mContext,
|
mContext,
|
||||||
content = "检测到主副页识别车牌号内容不一致,是否继续上传?"
|
content = "检测到主副页识别车牌号内容不一致,是否继续上传?"
|
||||||
) {
|
) {
|
||||||
if (this@EditTrailerActivity.carId.toIntOrNull() != null) {
|
upApi()
|
||||||
DataManager.getInstance().addTrailer(upDrivingInfoBean)
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
|
|
||||||
override fun onSuccess(t: CommonResponseBean<Any>) {
|
|
||||||
super.onSuccess(t)
|
|
||||||
showToast("修改成功")
|
|
||||||
setResult(RESULT_OK)
|
|
||||||
finish()
|
|
||||||
}
|
|
||||||
}))
|
|
||||||
} else {
|
|
||||||
DataManager.getInstance().editTrailer(upDrivingInfoBean)
|
|
||||||
.subscribeOn(Schedulers.io())
|
|
||||||
.observeOn(AndroidSchedulers.mainThread())
|
|
||||||
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
|
|
||||||
override fun onSuccess(t: CommonResponseBean<Any>) {
|
|
||||||
super.onSuccess(t)
|
|
||||||
showToast("修改成功")
|
|
||||||
setResult(RESULT_OK)
|
|
||||||
finish()
|
|
||||||
}
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
} else
|
||||||
|
upApi()
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun upApi() {
|
||||||
|
if (this@EditTrailerActivity.carId.toIntOrNull() != null) {
|
||||||
|
DataManager.getInstance().addTrailer(upDrivingInfoBean)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
|
||||||
|
override fun onSuccess(t: CommonResponseBean<Any>) {
|
||||||
|
super.onSuccess(t)
|
||||||
|
showToast("修改成功")
|
||||||
|
setResult(RESULT_OK)
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
} else {
|
||||||
|
DataManager.getInstance().editTrailer(upDrivingInfoBean)
|
||||||
|
.subscribeOn(Schedulers.io())
|
||||||
|
.observeOn(AndroidSchedulers.mainThread())
|
||||||
|
.subscribe(BaseObserver(mContext, object : RxHttpCallBack<Any>() {
|
||||||
|
override fun onSuccess(t: CommonResponseBean<Any>) {
|
||||||
|
super.onSuccess(t)
|
||||||
|
showToast("修改成功")
|
||||||
|
setResult(RESULT_OK)
|
||||||
|
finish()
|
||||||
|
}
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
@ -2,20 +2,34 @@ package com.dahe.gldriver.utils
|
|||||||
|
|
||||||
import android.content.Context
|
import android.content.Context
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
import androidx.appcompat.app.AppCompatActivity
|
||||||
|
import androidx.viewbinding.ViewBinding
|
||||||
|
import com.dahe.gldriver.bean.CarDetail
|
||||||
|
import com.dahe.gldriver.bean.UpDrivingInfoBean
|
||||||
import com.dahe.gldriver.push.PushHelper
|
import com.dahe.gldriver.push.PushHelper
|
||||||
import com.dahe.gldriver.ui.HomeActivity
|
import com.dahe.gldriver.ui.HomeActivity
|
||||||
import com.dahe.gldriver.ui.LauncherActivity
|
import com.dahe.gldriver.ui.LauncherActivity
|
||||||
import com.dahe.gldriver.ui.account.LoginActivity
|
import com.dahe.gldriver.ui.account.LoginActivity
|
||||||
import com.dahe.gldriver.ui.account.SelectRoleActivity
|
import com.dahe.gldriver.ui.account.SelectRoleActivity
|
||||||
|
import com.dahe.gldriver.ui.account.authperson.AuthFaceActivity
|
||||||
|
import com.dahe.gldriver.ui.account.authperson.EditBankCardActivity
|
||||||
|
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.glex.bean.UserBean
|
import com.dahe.glex.bean.UserBean
|
||||||
|
import com.dahe.glex.bean.UserDetail
|
||||||
|
import com.dahe.mylibrary.base.BaseActivity
|
||||||
import com.dahe.mylibrary.utils.ActivityUtils
|
import com.dahe.mylibrary.utils.ActivityUtils
|
||||||
import com.dahe.mylibrary.utils.BaseSPUtils
|
import com.dahe.mylibrary.utils.BaseSPUtils
|
||||||
import com.dahe.mylibrary.utils.ToastUtils
|
import com.dahe.mylibrary.utils.ToastUtils
|
||||||
import com.google.gson.Gson
|
import com.google.gson.Gson
|
||||||
|
|
||||||
class UserUtils private constructor(){
|
class UserUtils private constructor() {
|
||||||
|
|
||||||
companion object{
|
companion object {
|
||||||
val instance = Holder.holder
|
val instance = Holder.holder
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -23,9 +37,9 @@ class UserUtils private constructor(){
|
|||||||
val holder = UserUtils()
|
val holder = UserUtils()
|
||||||
}
|
}
|
||||||
|
|
||||||
fun loginOut(context : Context){
|
fun loginOut(context: Context) {
|
||||||
SPUtils.instance.removeUserToken(context)
|
SPUtils.instance.removeUserToken(context)
|
||||||
if (null== SPUtils.instance.getUserInfo(context))
|
if (null == SPUtils.instance.getUserInfo(context))
|
||||||
return
|
return
|
||||||
//删除推送别名
|
//删除推送别名
|
||||||
PushHelper.delete(context)
|
PushHelper.delete(context)
|
||||||
@ -36,10 +50,10 @@ class UserUtils private constructor(){
|
|||||||
// ToastUtils.showToast(context, "您的账号再异地登录,请重新登录")
|
// ToastUtils.showToast(context, "您的账号再异地登录,请重新登录")
|
||||||
}
|
}
|
||||||
|
|
||||||
fun loginIn(context: Context,userBean: UserBean){
|
fun loginIn(context: Context, userBean: UserBean) {
|
||||||
SPUtils.instance.setUserInfo(context, Gson().toJson(userBean))
|
SPUtils.instance.setUserInfo(context, Gson().toJson(userBean))
|
||||||
//设置推送别名
|
//设置推送别名
|
||||||
PushHelper.setAlias(context,userBean)
|
PushHelper.setAlias(context, userBean)
|
||||||
|
|
||||||
// ActivityUtils.startActivity(
|
// ActivityUtils.startActivity(
|
||||||
// context,
|
// context,
|
||||||
@ -57,7 +71,7 @@ class UserUtils private constructor(){
|
|||||||
HomeActivity::class.java
|
HomeActivity::class.java
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
ActivityUtils.finishToActivity(LoginActivity::class.java,true)
|
ActivityUtils.finishToActivity(LoginActivity::class.java, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -66,9 +80,49 @@ class UserUtils private constructor(){
|
|||||||
* @param context Context
|
* @param context Context
|
||||||
* @param userBean UserBean
|
* @param userBean UserBean
|
||||||
*/
|
*/
|
||||||
fun updateUser(context: Context,userBean: UserBean){
|
fun updateUser(context: Context, userBean: UserBean) {
|
||||||
SPUtils.instance.setUserInfo(context, Gson().toJson(userBean))
|
SPUtils.instance.setUserInfo(context, Gson().toJson(userBean))
|
||||||
//设置推送别名
|
//设置推送别名
|
||||||
PushHelper.setAlias(context,userBean)
|
PushHelper.setAlias(context, userBean)
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 司机证件跳转
|
||||||
|
* @param userBean UserDetail
|
||||||
|
* @return Class<out BaseActivity<out ViewBinding>>?
|
||||||
|
*/
|
||||||
|
fun goNextPersonInfo(userBean: UserDetail): Class<out BaseActivity<out ViewBinding>>? {
|
||||||
|
|
||||||
|
if (userBean.idcardNo.isNullOrBlank()) {
|
||||||
|
return EditPersonActivity::class.java
|
||||||
|
} else if (userBean.licenseNo.isNullOrEmpty()) {
|
||||||
|
return EditDriverActivity::class.java
|
||||||
|
} else if (userBean.qualificationCertificateEffectiveEnd.isNullOrEmpty()) {
|
||||||
|
return EditQualificationActivity::class.java
|
||||||
|
} else if (userBean.driverBankcardNumber.isNullOrEmpty()) {
|
||||||
|
return EditBankCardActivity::class.java
|
||||||
|
} else if (userBean.isRealName == "0") {
|
||||||
|
return AuthFaceActivity::class.java
|
||||||
|
} else {
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 车辆证件跳转
|
||||||
|
* @param carDetail CarDetail
|
||||||
|
* @return Class<out BaseActivity<out ViewBinding>>?
|
||||||
|
*/
|
||||||
|
fun goNextCarInfo(carDetail: CarDetail): Class<out BaseActivity<out ViewBinding>>? {
|
||||||
|
if (carDetail.vehicleNum.isNullOrEmpty()) {
|
||||||
|
return EditDrivingActivity::class.java
|
||||||
|
} else if (carDetail.isTrailer == "1" && carDetail.trailerVehicleNum.isNullOrEmpty()) {
|
||||||
|
return EditTrailerActivity::class.java
|
||||||
|
}else if (carDetail.roadLicense.isNullOrEmpty()){
|
||||||
|
return EditRoadActivity::class.java
|
||||||
|
}else
|
||||||
|
return null
|
||||||
}
|
}
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user