package com.fangxinxing.xxfxx.ui.pub
|
|
import android.view.View
|
import android.widget.TextView
|
import androidx.core.content.ContextCompat
|
import androidx.core.os.bundleOf
|
import cn.sinata.xldutils.utils.Md5
|
import com.fangxinxing.xxfxx.CompanyDialog
|
import com.fangxinxing.xxfxx.R
|
import com.fangxinxing.xxfxx.base.local.BasePhotoActivity
|
import com.fangxinxing.xxfxx.bean.AgreeBean
|
import com.fangxinxing.xxfxx.bean.CerNeedBean
|
import com.fangxinxing.xxfxx.bean.DriverBean
|
import com.fangxinxing.xxfxx.bean.FaceBean
|
import com.fangxinxing.xxfxx.bean.LoginBean
|
import com.fangxinxing.xxfxx.bean.UserBean
|
import com.fangxinxing.xxfxx.netUtls.Api
|
import com.fangxinxing.xxfxx.netUtls.FaceHttpManager
|
import com.fangxinxing.xxfxx.netUtls.FaceObserver
|
import com.fangxinxing.xxfxx.netUtls.callNet
|
import com.fangxinxing.xxfxx.netUtls.callNetDriver
|
import com.fangxinxing.xxfxx.netUtls.getMapByAny
|
import com.fangxinxing.xxfxx.ui.DialogUtil
|
import com.fangxinxing.xxfxx.utils.DateUtil
|
import com.fangxinxing.xxfxx.utils.HtmlUtils
|
import com.fangxinxing.xxfxx.utils.ImageUtils
|
import com.fangxinxing.xxfxx.utils.MyUtils
|
import com.fangxinxing.xxfxx.utils.PhoneCheckUtil
|
import com.fangxinxing.xxfxx.utils.clickDelay
|
import com.fangxinxing.xxfxx.utils.getContent
|
import com.fangxinxing.xxfxx.utils.getString
|
import com.fangxinxing.xxfxx.utils.glide.GlideUtil
|
import com.fangxinxing.xxfxx.utils.gone
|
import com.fangxinxing.xxfxx.utils.picker.widget.builder.TimePickerBuilder
|
import com.fangxinxing.xxfxx.utils.picker.widget.listener.OnTimeSelectListener
|
import com.fangxinxing.xxfxx.utils.setColor
|
import com.fangxinxing.xxfxx.utils.visible
|
import com.google.gson.Gson
|
import com.zlzf.zl_payaccount.citypicker.Interface.OnCityItemClickListener
|
import com.zlzf.zl_payaccount.citypicker.bean.CityBean
|
import com.zlzf.zl_payaccount.citypicker.bean.DistrictBean
|
import com.zlzf.zl_payaccount.citypicker.bean.ProvinceBean
|
import kotlinx.android.synthetic.main.activity_become_driver.tv_three
|
import kotlinx.android.synthetic.main.activity_become_driver.tv_two
|
import kotlinx.android.synthetic.main.dialog_sex_show.view.tv_cancel
|
import kotlinx.android.synthetic.main.dialog_sex_show.view.tv_ok_sex
|
import kotlinx.android.synthetic.main.dialog_sex_show.view.tv_select_boy
|
import kotlinx.android.synthetic.main.dialog_sex_show.view.tv_select_girl
|
import kotlinx.android.synthetic.main.dialog_show_car_num.view.et_num_zg
|
import kotlinx.android.synthetic.main.dialog_show_car_num.view.tv_car_num_close
|
import kotlinx.android.synthetic.main.dialog_show_car_num.view.tv_sure_car_num
|
import kotlinx.android.synthetic.main.dialog_show_car_num.view.view_hint_close_car
|
import kotlinx.android.synthetic.main.driver_one.ll_driver_one
|
import kotlinx.android.synthetic.main.driver_three.ll_driver_three
|
import kotlinx.android.synthetic.main.driver_three.tv_hint_three
|
import kotlinx.android.synthetic.main.driver_three.tv_sure
|
import kotlinx.android.synthetic.main.driver_two.et_name
|
import kotlinx.android.synthetic.main.driver_two.et_people_code
|
import kotlinx.android.synthetic.main.driver_two.iv_car_business_img
|
import kotlinx.android.synthetic.main.driver_two.iv_car_people_img
|
import kotlinx.android.synthetic.main.driver_two.iv_driver_img
|
import kotlinx.android.synthetic.main.driver_two.iv_head
|
import kotlinx.android.synthetic.main.driver_two.iv_id_card
|
import kotlinx.android.synthetic.main.driver_two.iv_id_card_two
|
import kotlinx.android.synthetic.main.driver_two.iv_net_img
|
import kotlinx.android.synthetic.main.driver_two.ll_busness_city
|
import kotlinx.android.synthetic.main.driver_two.ll_city_dwell
|
import kotlinx.android.synthetic.main.driver_two.ll_driver_two
|
import kotlinx.android.synthetic.main.driver_two.ll_select_driver_time
|
import kotlinx.android.synthetic.main.driver_two.ll_server_company
|
import kotlinx.android.synthetic.main.driver_two.ll_server_mode
|
import kotlinx.android.synthetic.main.driver_two.rl_net_img
|
import kotlinx.android.synthetic.main.driver_two.tv_area
|
import kotlinx.android.synthetic.main.driver_two.tv_city
|
import kotlinx.android.synthetic.main.driver_two.tv_dwell_area
|
import kotlinx.android.synthetic.main.driver_two.tv_dwell_city
|
import kotlinx.android.synthetic.main.driver_two.tv_dwell_province
|
import kotlinx.android.synthetic.main.driver_two.tv_mode
|
import kotlinx.android.synthetic.main.driver_two.tv_next_2
|
import kotlinx.android.synthetic.main.driver_two.tv_province
|
import kotlinx.android.synthetic.main.driver_two.tv_select_company
|
import kotlinx.android.synthetic.main.driver_two.tv_select_driver_time
|
import kotlinx.android.synthetic.main.driver_two.tv_select_sex
|
import kotlinx.android.synthetic.main.include_login_code.et_login_code
|
import kotlinx.android.synthetic.main.include_login_code.et_login_code_send
|
import kotlinx.android.synthetic.main.include_login_phone.et_login_phone
|
import kotlinx.android.synthetic.main.include_login_pwd.et_login_pwd
|
import kotlinx.android.synthetic.main.include_login_pwd.iv_eye
|
import org.jetbrains.anko.toast
|
import java.util.Calendar
|
|
|
class BecomeDriverActivity : BasePhotoActivity() {
|
|
val cuurentNumIn by lazy {
|
intent.getIntExtra("cuurentNum", 1)
|
}
|
|
val uuid by lazy {
|
intent.getStringExtra("uid")
|
}
|
|
val phones by lazy {
|
intent.getStringExtra("phone")
|
}
|
val pwds by lazy {
|
intent.getStringExtra("pwds")
|
}
|
val isEdit by lazy {
|
intent.getBooleanExtra("isEdit", false)
|
}
|
|
|
var currentNum = 1
|
|
var selectPhone = 0 //1 身份证 2:头像 3:驾驶证 4:网约车资格证 5:身份证背面 6:车辆营运证 7:人车合照
|
|
var serverMode = "" //商户的服务
|
|
var array = arrayListOf(
|
"专车", "出租车", "城际出行"
|
// , "跨城小件物流", "同城小件物流"
|
)
|
|
val upBean by lazy {
|
DriverBean()
|
}
|
|
|
override fun tvInit(tv_code: TextView) {
|
et_login_code_send.text = "获取验证码"
|
}
|
|
override fun tvIniting(tv_code: TextView, time: String) {
|
et_login_code_send.text = time + "秒后重新获取"
|
}
|
|
override fun setContentView() {
|
setContentView(R.layout.activity_become_driver)
|
}
|
|
override fun initView() {
|
setTitleText(if (isEdit) "修改资料" else "填写资料")
|
tv_Right.text = "下一步"
|
currentNum = cuurentNumIn
|
if (currentNum == 2) {
|
ll_driver_one.gone()
|
ll_driver_two.visible()
|
tv_Right.gone()
|
tv_two.isSelected = true
|
upBean.phone = phones
|
upBean.password = pwds
|
uid = uuid
|
if (isEdit) {
|
getUserInfo()
|
} else {
|
callPersionInfo()
|
}
|
}
|
}
|
|
override fun setOnclick() {
|
tv_Right.setOnClickListener {
|
next()
|
}
|
|
et_login_code_send.clickDelay {
|
if (et_login_phone.getString().isEmpty()) {
|
toast("请输入手机号")
|
return@clickDelay
|
}
|
if (!PhoneCheckUtil.phoneCheck(et_login_phone.getString())) {
|
toast("手机号格式错误")
|
return@clickDelay
|
}
|
var map = getMapByAny()
|
map["phone"] = et_login_phone.getString()
|
map["type"] = 3
|
callNet(Api.queryCaptcha, map) {
|
toast("发送成功")
|
}
|
refreshTime(et_login_code_send)
|
}
|
|
iv_eye.setOnClickListener {
|
showEye(iv_eye, et_login_pwd)
|
}
|
|
iv_id_card.setOnClickListener {
|
selectPhone = 1
|
MyUtils.getInstans().hideKeyboard(ll_driver_two)
|
showSelectPhone()
|
}
|
|
iv_head.setOnClickListener {
|
selectPhone = 2
|
MyUtils.getInstans().hideKeyboard(ll_driver_two)
|
showSelectPhone()
|
|
}
|
|
iv_driver_img.setOnClickListener {
|
selectPhone = 3
|
MyUtils.getInstans().hideKeyboard(ll_driver_two)
|
showSelectPhone()
|
|
}
|
|
iv_net_img.setOnClickListener {
|
selectPhone = 4
|
MyUtils.getInstans().hideKeyboard(ll_driver_two)
|
showSelectPhone()
|
|
}
|
|
iv_car_business_img.setOnClickListener {
|
selectPhone = 6
|
MyUtils.getInstans().hideKeyboard(ll_driver_two)
|
showSelectPhone()
|
|
}
|
|
iv_car_people_img.setOnClickListener {
|
selectPhone = 7
|
MyUtils.getInstans().hideKeyboard(ll_driver_two)
|
showSelectPhone()
|
|
}
|
|
iv_id_card_two.clickDelay {
|
selectPhone = 5
|
MyUtils.getInstans().hideKeyboard(ll_driver_two)
|
showSelectPhone()
|
}
|
|
tv_select_sex.setOnClickListener {
|
MyUtils.getInstans().hideKeyboard(ll_driver_two)
|
showSex()
|
|
}
|
|
ll_select_driver_time.setOnClickListener {
|
MyUtils.getInstans().hideKeyboard(ll_driver_two)
|
showTimePicker()
|
}
|
|
ll_server_mode.setOnClickListener {
|
MyUtils.getInstans().hideKeyboard(ll_driver_two)
|
if (serverMode.isEmpty())
|
showToast("请先选择服务商")
|
else
|
showServerMode()
|
}
|
|
ll_city_dwell.setOnClickListener {
|
MyUtils.getInstans().hideKeyboard(ll_driver_two)
|
showCityPop(object : (String, String, String, String) -> Unit {
|
override fun invoke(
|
province: String,
|
city: String,
|
area: String,
|
areaCode: String
|
) {
|
tv_dwell_province.text = province
|
tv_dwell_city.text = city
|
tv_dwell_area.text = area
|
upBean.driverContactAddress = province + city + area
|
upBean.driverContactAddress_ = "$province,$city,$area"
|
}
|
})
|
}
|
|
tv_sure.setOnClickListener {
|
onBackPressed()
|
}
|
|
tv_next_2.setOnClickListener {
|
tv_Right.callOnClick()
|
}
|
|
ll_busness_city.setOnClickListener {
|
MyUtils.getInstans().hideKeyboard(ll_driver_two)
|
showCityPop(object : (String, String, String, String) -> Unit {
|
override fun invoke(
|
province: String,
|
city: String,
|
area: String,
|
areaCode: String
|
) {
|
tv_province.text = province
|
tv_city.text = city
|
tv_area.text = area
|
upBean.placeOfEmployment = areaCode
|
upBean.placeOfPractice = "$province,$city,$area"
|
callNetImg(areaCode)
|
}
|
})
|
}
|
|
ll_server_company.clickDelay {
|
MyUtils.getInstans().hideKeyboard(ll_driver_two)
|
if (upBean.placeOfEmployment.isNullOrEmpty())
|
toast("请先选择从业地")
|
else {
|
val companyDialog = CompanyDialog()
|
companyDialog.arguments = bundleOf("code" to upBean.placeOfEmployment)
|
companyDialog.setCallback(object : CompanyDialog.Callback {
|
override fun onOk(name: String, id: String, serverMode: String) {
|
upBean.companyId = id
|
tv_select_company.text = name
|
this@BecomeDriverActivity.serverMode = serverMode
|
tv_mode.text = ""
|
upBean.type = ""
|
}
|
})
|
companyDialog.show(supportFragmentManager, "company")
|
}
|
}
|
}
|
|
private fun callNetImg(areaCode: String) {
|
var map = getMapByAny()
|
map["code"] = areaCode
|
callNet(Api.queryNeedCertificate, map) {
|
var bean = gson.fromJson<CerNeedBean>(it, CerNeedBean::class.java)
|
if (bean.data == 1) {
|
rl_net_img.visible()
|
} else {
|
rl_net_img.gone()
|
}
|
}
|
}
|
|
|
private fun showServerMode() {
|
val list = arrayListOf<String>()
|
list.addAll(serverMode.split(",").map { array[it.toInt() - 1] })
|
var pop = DialogUtil.getNetListDialog(list, window.decorView, this) {
|
val checked = arrayListOf<String>()
|
checked.addAll(it.split(",").map { serverMode.split(",")[it.toInt()] })
|
if (checked.contains("2")) {
|
showHintCarNumDialog(checked.joinToString(",") { it })
|
} else {
|
upBean.type = checked.joinToString(",") { it }
|
tv_mode.text = checked.joinToString(",") { array[it.toInt() - 1] }
|
}
|
}
|
}
|
|
private fun showHintCarNumDialog(allmode: String) {
|
phoneDialog = DialogUtil.getDialog(this, R.layout.dialog_show_car_num)
|
var view = DialogUtil.getView(phoneDialog!!)
|
view.view_hint_close_car.setOnClickListener {
|
phoneDialog?.dismiss()
|
}
|
view.tv_car_num_close.setOnClickListener {
|
phoneDialog?.dismiss()
|
}
|
|
view.tv_sure_car_num.setOnClickListener {
|
if (view.et_num_zg.getContent().isEmpty()) {
|
toast("请输入资格证号")
|
return@setOnClickListener
|
}
|
upBean.type = allmode
|
tv_mode.text = allmode.split(",").joinToString(",") { array[it.toInt() - 1] }
|
upBean.taxiAptitudeCard = view.et_num_zg.getContent()
|
phoneDialog?.dismiss()
|
}
|
|
}
|
|
|
private fun showSex() {
|
var pop = DialogUtil.getPopupwindow(this, R.layout.dialog_sex_show)
|
pop.showDown(window.decorView)
|
pop.contentView.tv_select_girl.isSelected = false
|
pop.contentView.tv_select_boy.isSelected = true
|
pop.contentView.tv_cancel.setOnClickListener {
|
pop.dismiss()
|
}
|
pop.contentView.tv_ok_sex.setOnClickListener {
|
upBean.sex = if (pop.contentView.tv_select_girl.isSelected) 2 else 1
|
tv_select_sex.text = upBean.sexStr
|
pop.dismiss()
|
}
|
pop.contentView.tv_select_girl.setOnClickListener {
|
pop.contentView.tv_select_girl.alpha = 1f
|
pop.contentView.tv_select_girl.setColor(this, R.color.main_yellow)
|
pop.contentView.tv_select_boy.setColor(this, R.color.black)
|
pop.contentView.tv_select_boy.alpha = 0.6f
|
pop.contentView.tv_select_girl.isSelected = true
|
pop.contentView.tv_select_boy.isSelected = false
|
}
|
pop.contentView.tv_select_boy.setOnClickListener {
|
pop.contentView.tv_select_girl.setColor(this, R.color.black)
|
pop.contentView.tv_select_boy.setColor(this, R.color.main_yellow)
|
pop.contentView.tv_select_girl.alpha = 0.6f
|
pop.contentView.tv_select_boy.alpha = 1f
|
pop.contentView.tv_select_girl.isSelected = false
|
pop.contentView.tv_select_boy.isSelected = true
|
}
|
}
|
|
fun showTimePicker() {
|
var startCalendar = Calendar.getInstance()
|
var endCalendar = Calendar.getInstance()
|
startCalendar.set(1900, 1, 1)
|
endCalendar.timeInMillis = (System.currentTimeMillis() - (1000L * 3600L * 24L * 365L * 3L))
|
var timePic = TimePickerBuilder(this,
|
OnTimeSelectListener { date, v ->
|
upBean.getDriverLicenseDate = DateUtil.getTime(DateUtil.TYPE1, date.time)
|
tv_select_driver_time.text = DateUtil.getTime(DateUtil.TYPE1, date.time)
|
})
|
.setTitleText("")
|
.setBgColor(ContextCompat.getColor(this, R.color.white))
|
.setCancelColor(ContextCompat.getColor(this, R.color.black_333333))
|
.setSubmitColor(ContextCompat.getColor(this, R.color.main_yellow))
|
.setRangDate(startCalendar, endCalendar)
|
.setDate(endCalendar)
|
.setSubmitText("确认")
|
.setLineSpacingMultiplier(2f)
|
.build()
|
timePic.show()
|
}
|
|
fun next() {
|
currentNum++
|
if (currentNum == 2) {
|
if (et_login_phone.getString().isEmpty()) {
|
toast("请输入手机号")
|
currentNum--
|
return
|
}
|
if (!PhoneCheckUtil.phoneCheck(et_login_phone.getString())) {
|
toast("手机号格式错误")
|
currentNum--
|
return
|
}
|
if (et_login_pwd.getString().isEmpty()) {
|
toast("请输入密码")
|
currentNum--
|
return
|
}
|
if (et_login_pwd.getString().length < 6) {
|
toast("密码不能小于6位")
|
currentNum--
|
return
|
}
|
if (et_login_code.getString().isEmpty()) {
|
toast("请输入验证码")
|
currentNum--
|
return
|
}
|
|
var map = getMapByAny()
|
map["code"] = et_login_code.getString()
|
map["phone"] = et_login_phone.getString()
|
callNet(Api.checkCaptcha, map, {
|
upBean.phone = et_login_phone.getString()
|
upBean.password = et_login_pwd.getString()
|
ll_driver_one.gone()
|
ll_driver_two.visible()
|
tv_Right.gone()
|
tv_two.isSelected = true
|
callPersionInfo()
|
}, {
|
currentNum--
|
})
|
}
|
|
if (currentNum == 3) {
|
calldriver()
|
}
|
if (currentNum == 4) {
|
onBackPressed()
|
}
|
}
|
|
public fun getIDCardDetail(imgPath: String) {
|
val bodys = getMapByAny()
|
bodys["src"] = ImageUtils.imageToBase64(imgPath)
|
FaceHttpManager.getInstance().post("sfzread", bodys, object : FaceObserver(this) {
|
override fun success(responseString: String?) {
|
// success(responseString);
|
val baseBean =
|
Gson().fromJson(responseString, FaceBean::class.java)
|
if (!baseBean.msg.id.isNullOrEmpty()) {
|
upBean.name = baseBean.msg.name
|
upBean.idCard = baseBean.msg.id
|
upBean.sex = if (baseBean.msg.sex == "男") 1 else 2
|
et_name.setText(upBean.name)
|
tv_select_sex.text = baseBean.msg.sex
|
et_people_code.setText(upBean.idCard)
|
et_people_code.setSelection(upBean.idCard.length)
|
}
|
dismissDialog()
|
}
|
|
override fun onError(code: Int, msg: String?, resposeString: String?) {
|
|
}
|
})
|
|
|
try {
|
/**
|
* 重要提示如下:
|
* HttpUtils请从
|
* https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/src/main/java/com/aliyun/api/gateway/demo/util/HttpUtils.java
|
* 下载
|
*
|
* 相应的依赖请参照
|
* https://github.com/aliyun/api-gateway-demo-sign-java/blob/master/pom.xml
|
*/
|
// val response: HttpResponse =
|
// HttpUtils.doPost(host, path, method, headers, querys, bodys)
|
// System.out.println(response.toString())
|
// System.out.println(EntityUtils.toString(response.getEntity()));
|
} catch (e: Exception) {
|
e.printStackTrace()
|
}
|
}
|
|
var uid: String = ""
|
|
private fun callPersionInfo() {
|
var map = getMapByAny()
|
map["code"] = et_login_code.getString()
|
map["phone"] = et_login_phone.getString()
|
map["password"] = et_login_pwd.getString()
|
callNetDriver(Api.registeredDriver_two, map, {
|
var bean = gson.fromJson<LoginBean>(it, LoginBean::class.java)
|
uid = bean.data.id.toString()
|
}, {
|
var bean = gson.fromJson<LoginBean>(it, LoginBean::class.java)
|
if (uid == "") {
|
uid = bean.data.id.toString()
|
}
|
if (bean.msg == "电话号码已使用") {
|
getUserInfo()
|
}
|
})
|
}
|
|
//获取用户信息
|
private fun getUserInfo() {
|
var mapId = getMapByAny()
|
mapId["uid"] = uid
|
callNet(Api.queryInfo_By_id, mapId) { s ->
|
var user = gson.fromJson<UserBean>(s, UserBean::class.java)
|
setUI(user)
|
}
|
}
|
|
private fun setUI(user: UserBean) {
|
user.data.let {
|
if (it.avatar.isNullOrEmpty()) {
|
return@let
|
}
|
upBean.headImgUrl = it.avatar
|
upBean.name = it.name
|
upBean.driveCardImgUrl = it.driveCardImgUrl
|
upBean.driverContactAddress = it.driverContactAddress_.replace(",", "")
|
upBean.getDriverLicenseDate = it.getDriverLicenseDate
|
upBean.idCard = it.idCard
|
upBean.idCardImgUrl1 = it.idCardImgUrl1
|
upBean.idCardImgUrl2 = it.idCardImgUrl2
|
upBean.networkCarlssueImg = it.networkCarlssueImg
|
upBean.password = et_login_pwd.getString()
|
upBean.phone = et_login_phone.getString()
|
upBean.placeOfEmployment = it.placeOfEmployment
|
upBean.companyId = it.companyId
|
upBean.sex = it.sex
|
upBean.taxiAptitudeCard = it.taxiAptitudeCard
|
upBean.type = it.type
|
upBean.placeOfPractice = it.placeOfPractice
|
upBean.driverContactAddress_ = it.driverContactAddress_
|
upBean.vehicleOperationCertificateImg = it.vehicleOperationCertificateImg
|
upBean.peopleAndVehiclesImg = it.peopleAndVehiclesImg
|
GlideUtil.load(this, upBean.idCardImgUrl1, iv_id_card, 0)
|
GlideUtil.load(this, upBean.idCardImgUrl2, iv_id_card_two, 0)
|
et_name.setText(upBean.name)
|
tv_select_company.setText(it.companyName)
|
et_name.setSelection(upBean.name.length)
|
tv_select_sex.text = upBean.sexStr
|
var dwell = upBean.driverContactAddress_.split(",")
|
if (dwell.size >= 3) {
|
tv_dwell_province.text = dwell[0]
|
tv_dwell_city.text = dwell[1]
|
tv_dwell_area.text = dwell[2]
|
}
|
et_people_code.setText(upBean.idCard)
|
et_people_code.setSelection(upBean.idCard.length)
|
tv_select_driver_time.text = upBean.getDriverLicenseDate
|
var content = ""
|
for (item in upBean.type.split(",").filter { it.isNotEmpty() }) {
|
content += array[item.toInt() - 1] + " "
|
}
|
tv_mode.text = content
|
var cityList = upBean.placeOfPractice.split(",")
|
if (cityList.size >= 3) {
|
tv_province.text = cityList[0]
|
tv_city.text = cityList[1]
|
tv_area.text = cityList[2]
|
}
|
GlideUtil.load(this, upBean.headImgUrl, iv_head, 0)
|
GlideUtil.load(this, upBean.driveCardImgUrl, iv_driver_img, 0)
|
GlideUtil.load(this, upBean.networkCarlssueImg, iv_net_img, 0)
|
GlideUtil.load(this, upBean.vehicleOperationCertificateImg, iv_car_business_img, 0)
|
GlideUtil.load(this, upBean.peopleAndVehiclesImg, iv_car_people_img, 0)
|
|
}
|
}
|
|
private fun calldriver() {
|
if (et_name.getString().isEmpty()) {
|
toast("请输入姓名")
|
currentNum--
|
return
|
}
|
if (et_people_code.getString().isEmpty()) {
|
toast("请输入身份证")
|
currentNum--
|
return
|
}
|
if (!PhoneCheckUtil.isLegalId(et_people_code.getContent())) {
|
toast("身份证格式错误")
|
currentNum--
|
return
|
}
|
if (upBean.driveCardImgUrl.isNullOrEmpty()) {
|
toast("请上传驾驶证照片")
|
currentNum--
|
return
|
}
|
if (upBean.driverContactAddress.isNullOrEmpty()) {
|
toast("请选择居住地")
|
currentNum--
|
return
|
}
|
if (upBean.getDriverLicenseDate.isNullOrEmpty()) {
|
toast("请选择驾龄")
|
currentNum--
|
return
|
}
|
if (upBean.headImgUrl.isNullOrEmpty()) {
|
toast("请上传头像")
|
currentNum--
|
return
|
}
|
if (rl_net_img.visibility == View.VISIBLE && upBean.networkCarlssueImg.isNullOrEmpty()) {
|
toast("请上传网约车资格证照片")
|
currentNum--
|
return
|
}
|
if (upBean.placeOfEmployment.isNullOrEmpty()) {
|
toast("请选择从业地")
|
currentNum--
|
return
|
}
|
if (upBean.companyId.isNullOrEmpty()) {
|
toast("请选择所属服务商")
|
currentNum--
|
return
|
}
|
if (upBean.sex == -1) {
|
toast("请选择性别")
|
currentNum--
|
return
|
}
|
if (upBean.type.isNullOrEmpty()) {
|
toast("请选择服务模式")
|
currentNum--
|
return
|
}
|
if (upBean.idCardImgUrl1.isNullOrEmpty()) {
|
toast("请上传身份证正面照")
|
currentNum--
|
return
|
}
|
if (upBean.idCardImgUrl2.isNullOrEmpty()) {
|
toast("请上传身份证反面照")
|
currentNum--
|
return
|
}
|
if (upBean.vehicleOperationCertificateImg.isNullOrEmpty()) {
|
toast("请上传车辆营运证")
|
currentNum--
|
return
|
}
|
if (upBean.peopleAndVehiclesImg.isNullOrEmpty()) {
|
toast("请上传人车合照")
|
currentNum--
|
return
|
}
|
|
upBean.name = et_name.getString()
|
upBean.idCard = et_people_code.getString()
|
|
var map = getMapByAny()
|
map["driveCardImgUrl"] = upBean.driveCardImgUrl
|
map["driverContactAddress"] = upBean.driverContactAddress
|
map["driverContactAddress_"] = upBean.driverContactAddress_
|
map["getDriverLicenseDate"] = upBean.getDriverLicenseDate
|
map["headImgUrl"] = upBean.headImgUrl
|
map["idCard"] = upBean.idCard
|
map["placeOfPractice"] = upBean.placeOfPractice
|
map["idCardImgUrl1"] = upBean.idCardImgUrl1
|
map["idCardImgUrl2"] = upBean.idCardImgUrl2
|
map["name"] = upBean.name
|
map["networkCarlssueImg"] = upBean.networkCarlssueImg
|
map["password"] = Md5.getMd5Value(upBean.password)
|
map["phone"] = upBean.phone
|
map["placeOfEmployment"] = upBean.placeOfEmployment
|
map["companyId"] = upBean.companyId
|
map["sex"] = upBean.sex
|
if (!upBean.taxiAptitudeCard.isNullOrEmpty()) {
|
map["taxiAptitudeCard"] = upBean.taxiAptitudeCard
|
}
|
map["type"] = upBean.type
|
map["uid"] = uid
|
map["vehicleOperationCertificateImg"] = upBean.vehicleOperationCertificateImg
|
map["peopleAndVehiclesImg"] = upBean.peopleAndVehiclesImg
|
callNet(Api.updateDriver, map, {
|
toast("已提交,待审核")
|
ll_driver_one.gone()
|
ll_driver_two.gone()
|
ll_driver_three.visible()
|
callHtml {
|
tv_hint_three.text = HtmlUtils.getTextFromHtml(it)
|
}
|
tv_three.isSelected = true
|
setTitleText("提交成功")
|
tv_Right.gone()
|
}, {
|
currentNum--
|
})
|
|
|
}
|
|
fun callHtml(click: (s: String) -> Unit) {
|
var map = getMapByAny()
|
map["type"] = 9
|
callNet(Api.queryByType, map) {
|
var data = gson.fromJson<AgreeBean>(it, AgreeBean::class.java)
|
click(data.data.content)
|
}
|
}
|
|
/***
|
* type 1 2 3 省市县
|
*/
|
private fun showCityPop(onclick: (province: String, city: String, area: String, areaCode: String) -> Unit) {
|
DialogUtil.getCityDialog(this, object : OnCityItemClickListener() {
|
override fun onSelected(
|
province: ProvinceBean?,
|
city: CityBean?,
|
district: DistrictBean?
|
) {
|
super.onSelected(province, city, district)
|
onclick(
|
province!!.name,
|
city!!.name,
|
district!!.name,
|
district.id
|
)
|
}
|
})
|
}
|
|
override fun getPhoneUrl(url: String, type: Int, path: String) {
|
super.getPhoneUrl(url, type, path)
|
when (selectPhone) {
|
1 -> {
|
upBean.idCardImgUrl1 = url
|
GlideUtil.load(this, url, iv_id_card, 1)
|
getIDCardDetail(path)
|
}
|
|
2 -> {
|
upBean.headImgUrl = url
|
GlideUtil.load(this, url, iv_head, 1)
|
}
|
|
3 -> {
|
upBean.driveCardImgUrl = url
|
GlideUtil.load(this, url, iv_driver_img, 1)
|
}
|
|
4 -> {
|
upBean.networkCarlssueImg = url
|
GlideUtil.load(this, url, iv_net_img, 1)
|
}
|
|
5 -> {
|
upBean.idCardImgUrl2 = url
|
GlideUtil.load(this, url, iv_id_card_two, 1)
|
// getIDCardDetail(path)
|
}
|
6 -> {
|
upBean.vehicleOperationCertificateImg = url
|
GlideUtil.load(this, url, iv_car_business_img, 1)
|
// getIDCardDetail(path)
|
}
|
7 -> {
|
upBean.peopleAndVehiclesImg = url
|
GlideUtil.load(this, url, iv_car_people_img, 1)
|
// getIDCardDetail(path)
|
}
|
|
|
}
|
|
}
|
|
|
}
|