18034727885
2026-07-09 4a7162443d0d94f30c3d887b0c7f3e6908533a85
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
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)
            }
 
 
        }
 
    }
 
 
}