editDriverCertificationNext.vue 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837
  1. <template>
  2. <view class="content">
  3. <view class="top-head"></view>
  4. <view class="container">
  5. <u-radio-group v-model="radiovalue" iconPlacement="row" class='radio-group'>
  6. <u-radio :customStyle="{marginBottom: '8px',marginRight:'4px'}" v-for="(item, index) in radiolist" :key="index"
  7. :label="item.name" :name="item.name" @change="radioChange">
  8. </u-radio>
  9. </u-radio-group>
  10. <view class="level1-title">证件信息</view>
  11. <view class="content1">
  12. <view class="title">上传驾驶证主页</view>
  13. <view @click.stop="uploadImg(1)" class="picture picture1" v-if="!dataDetails.driverLicenseHomePage">
  14. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  15. <view class="text">上传驾驶证主页</view>
  16. </view>
  17. <view v-if="dataDetails.driverLicenseHomePage" @click.stop="uploadImg(1)"
  18. class="preview-card-img picture">
  19. <view @click.stop="delCard(1)">
  20. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  21. </image>
  22. </view>
  23. <image class="" :src="dataDetails.driverLicenseHomePage" mode="aspectFit"></image>
  24. </view>
  25. <view class="title">上传驾驶证副页</view>
  26. <view @click.stop="uploadImg(2)" class="picture picture2" v-if="!dataDetails.driverLicenseBackPage">
  27. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  28. <view class="text">上传驾驶证副页</view>
  29. </view>
  30. <view v-if="dataDetails.driverLicenseBackPage" @click.stop="uploadImg(2)"
  31. class="preview-card-img picture">
  32. <view @click.stop="delCard(2)">
  33. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  34. </image>
  35. </view>
  36. <image class="" :src="dataDetails.driverLicenseBackPage" mode="aspectFit"></image>
  37. </view>
  38. <view class="flex row flex-space-between">
  39. <view class="left-text">驾驶证有效期</view>
  40. <!-- <view class="" @click="selectValidityPeriod(0)">
  41. {{dataDetails.driverLicenseValidityDate?dataDetails.driverLicenseValidityDate:'选择有效截止日期>'}}
  42. </view> -->
  43. <view style='font-size:14px;' class="" @click="selectValidityPeriod(0)">
  44. {{dataDetails.driverLicenseValidityStartDate?dataDetails.driverLicenseValidityStartDate:'起始时间'}}
  45. </view>
  46. <view>~</view>
  47. <view style='font-size:14px;' class="" @click="selectValidityPeriod(9)">
  48. {{dataDetails.driverLicenseValidityDate?dataDetails.driverLicenseValidityDate:'结束时间'}}
  49. </view>
  50. </view>
  51. <view class="flex row flex-space-between">
  52. <view class="left-text">准驾车型</view>
  53. <view class="" @click="driveType">
  54. {{dataDetails.quasiDrivingVehicle?dataDetails.quasiDrivingVehicle:'选择准驾车型>'}}
  55. </view>
  56. </view>
  57. <view class="flex row noborder">
  58. <view class="left-text">驾驶证发证机关</view>
  59. <u--input placeholder="请输入驾驶证发证机关" inputAlign='right' border="none" v-model="dataDetails.lssuingAuthority" >
  60. </u--input>
  61. </view>
  62. <view class="title">从业资格证</view>
  63. <view @click="uploadImg(7)" class="picture picture7" v-if="!dataDetails.qualificationCertificate">
  64. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  65. <view class="text">上传从业资格证</view>
  66. </view>
  67. <view v-if="dataDetails.qualificationCertificate" @click.stop="uploadImg(7)"
  68. class="preview-card-img picture">
  69. <view @click.stop="delCard(7)">
  70. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  71. </image>
  72. </view>
  73. <image class="" :src="dataDetails.qualificationCertificate" mode="aspectFit"></image>
  74. </view>
  75. <view class="flex row flex-space-between">
  76. <view class="left-text">从业资格证有效期</view>
  77. <view></view>
  78. <view class="" @click="selectValidityPeriod(3)">
  79. {{dataDetails.qualificationCertificateValidityDate?dataDetails.qualificationCertificateValidityDate:'选择有效期>'}}
  80. </view>
  81. </view>
  82. <view class="flex row">
  83. <view class="left-text">从业资格证号</view>
  84. <u--input maxlength='19' placeholder="请输入从业资格证号" inputAlign='right' border="none" v-model="dataDetails.qualificationCertificateNumber">
  85. </u--input>
  86. </view>
  87. <view class="flex row noborder align-center">
  88. <view class="left-text">通讯地址</view>
  89. <u--textarea v-model="dataDetails.postalAddress" border="none" placeholder="输入通讯地址" autoHeight maxlength="30"></u--textarea>
  90. </view>
  91. </view>
  92. <view class="flex service align-center">
  93. <u--image @click='consent' :src="consentStatus==true?'../../static/images/mine/duihao@2x.png':'../../static/images/mine/wxz.png'"
  94. width="12px" height="12px"></u--image>
  95. 我已阅读并同意
  96. <navigator
  97. url="/pages/sale/webview?can_share=false&url=https://liangxin.zthymaoyi.com/userAgreement.html"
  98. class="path" hover-class="navigator-hover">《服务协议》</navigator>和<navigator
  99. url="/pages/sale/webview?can_share=false&url=https://liangxin.zthymaoyi.com/screctAgreement.html"
  100. class="path" hover-class="navigator-hover">《隐私政策》</navigator>
  101. </view>
  102. <u-button class="btn-color" @click="btnBClick">提交</u-button>
  103. <u-action-sheet :actions="$helper.imgTypeList" :title="$helper.imgType" :show="isShowimgType"
  104. @select="imgTypeSelect" :closeOnClickOverlay="true" :closeOnClickAction="true"
  105. @close="isShowimgType=false">
  106. </u-action-sheet>
  107. <itmister-date-picker :dateStatus="0"
  108. :checkYear="year" :checkMonth="month" :checkDay="day"
  109. ref="datestartEl" :startYear="1980" :futureYear="10"
  110. @dateConfirm="confirmValidityPeriod"></itmister-date-picker>
  111. <itmister-date-picker :overdueContent="overdueContent" :dateStatus="status"
  112. :periodOfValidity="true"
  113. :checkYear="year" :checkMonth="month" :checkDay="day"
  114. ref="dateEl" :startYear="1980" :futureYear="10"
  115. @dateConfirm="confirmValidityPeriod"></itmister-date-picker>
  116. <!-- <u-picker :show="isShowValidity" ref="uPicker" :columns="ValidityPeriodType==9?validityPeriod1:validityPeriod" @confirm="confirmValidityPeriod"
  117. :closeOnClickOverlay='true' @close='isShowValidity=false' @cancel='isShowValidity=false'>
  118. </u-picker> -->
  119. <u-picker :show="isShowDrive" ref="uPicker" :columns="driveList" @confirm="confirmDriveType"
  120. :closeOnClickOverlay='true' @close='isShowDrive=false' @cancel='isShowDrive=false'>
  121. </u-picker>
  122. <u-toast ref="uToast"></u-toast>
  123. </view>
  124. <!-- <u-modal :show="isShowAlert" :title="" :content='修改认证信息需要重新登录!' :closeOnClickOverlay='true' :showCancelButton='true' confirmColor='#22C572' @confirm="confirmClick" @close="cancelClick" @cancel="cancelClick"></u-modal> -->
  125. </view>
  126. </template>
  127. <script>
  128. import uploadImage from '@/components/ossutil/uploadFile.js';
  129. import permision from "@/js_sdk/wa-permission/permission.js"
  130. var _this;
  131. export default {
  132. components: {},
  133. data() {
  134. return {
  135. isShowAlert: false,
  136. consentStatus: false,
  137. isGCar: true,
  138. ValidityPeriodType: '',
  139. validityPeriod: [],
  140. isShowValidity: false,
  141. isShowDrive:false,
  142. driveList:[["A2","B2"]],
  143. uploadType: '',
  144. isShowimgType: false,
  145. dataDetails: {},
  146. year:'',
  147. month:'',
  148. day:'',
  149. radiolist: [{
  150. name: '挂车司机',
  151. disabled: false
  152. },
  153. {
  154. name: '非挂车司机',
  155. disabled: false
  156. }
  157. ],
  158. // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
  159. radiovalue: '',
  160. };
  161. },
  162. onLoad(options) {
  163. _this = this;
  164. this.get_camera_permission()
  165. this.dataDetails = JSON.parse(options.data)
  166. if (this.dataDetails.driverType == 1) {
  167. this.radiovalue = '挂车司机'
  168. } else {
  169. this.radiovalue = '非挂车司机'
  170. }
  171. },
  172. methods: {
  173. async get_camera_permission() {
  174. var photol=await permision.requestAndroidPermission("android.permission.CAMERA")
  175. if(photol == false){
  176. uni.showModal({
  177. title: '提示',
  178. content: '您已经关闭相册权限,去设置',
  179. success: function (res) {
  180. if (res.confirm) {
  181. permision.gotoAppPermissionSetting()
  182. // plus.runtime.openURL("app-settings:");
  183. } else if (res.cancel) {
  184. console.log('用户点击取消');
  185. }
  186. }
  187. });
  188. }
  189. },
  190. delCard(type) {
  191. switch (type) {
  192. case 1:
  193. _this.dataDetails.driverLicenseHomePage = ""
  194. break;
  195. case 2:
  196. _this.dataDetails.driverLicenseBackPage = ""
  197. break;
  198. case 3:
  199. _this.dataDetails.drivingLicenseHomePage = ""
  200. break;
  201. case 4:
  202. _this.dataDetails.drivingLicenseBackPage = ""
  203. break;
  204. case 5:
  205. _this.dataDetails.trailerLicenseHomePage = ""
  206. break;
  207. case 6:
  208. _this.dataDetails.trailerLicenseBackPage = ""
  209. break;
  210. case 7:
  211. _this.dataDetails.qualificationCertificate = ""
  212. break;
  213. case 8:
  214. _this.dataDetails.operationCertificate = ""
  215. break;
  216. case 9:
  217. _this.dataDetails.trailerOperationCertificate = ""
  218. break;
  219. }
  220. },
  221. consent() {
  222. this.consentStatus = !this.consentStatus
  223. // uni.setStorage({
  224. // key: 'policyStorageKey',
  225. // data: this.consentStatus
  226. // });
  227. },
  228. confirmValidityPeriod(date) {
  229. console.log('confirm', date)
  230. switch (this.ValidityPeriodType) {
  231. case 0:
  232. this.dataDetails.driverLicenseValidityStartDate = date.date
  233. break
  234. case 1:
  235. this.dataDetails.drivingLicenseValidityDate = date.date
  236. break
  237. case 2:
  238. this.dataDetails.trailerLicenseValidityDate = date.date
  239. break
  240. case 3:
  241. this.dataDetails.qualificationCertificateValidityDate = date.date
  242. break
  243. case 4:
  244. this.dataDetails.operationCertificateValidityDate = date.date
  245. break
  246. case 5:
  247. this.dataDetails.trailerOperationCertificateValidityDate = date.date
  248. break
  249. case 9:
  250. this.dataDetails.driverLicenseValidityDate = date.date
  251. break
  252. }
  253. this.$forceUpdate()
  254. },
  255. selectValidityPeriod(type) {
  256. this.ValidityPeriodType = type
  257. if(type==0){
  258. if(this.dataDetails.driverLicenseValidityStartDate!='长期'){
  259. var arr=this.dataDetails.driverLicenseValidityStartDate.split('-')
  260. this.year=arr[0]
  261. this.month=arr[1]
  262. this.day=arr[2]
  263. }
  264. console.log()
  265. this.$refs.datestartEl.show()
  266. }else{
  267. switch (this.ValidityPeriodType) {
  268. case 3:
  269. this.status=0
  270. this.overdueContent='从业资格证已过期'
  271. if(this.dataDetails.qualificationCertificateValidityDate!='长期'){
  272. var arr=this.dataDetails.qualificationCertificateValidityDate.split('-')
  273. this.year=arr[0]
  274. this.month=arr[1]
  275. this.day=arr[2]
  276. }
  277. break
  278. case 9:
  279. if(this.dataDetails.driverLicenseValidityDate!='长期'){
  280. var arr=this.dataDetails.driverLicenseValidityDate.split('-')
  281. this.year=arr[0]
  282. this.month=arr[1]
  283. this.day=arr[2]
  284. }
  285. if(this.dataDetails.driverLicenseValidityDate=='长期'){
  286. this.year='长期'
  287. this.month=''
  288. this.day=''
  289. }
  290. this.overdueContent='驾驶证已过期'
  291. break
  292. }
  293. this.$refs.dateEl.show()
  294. }
  295. },
  296. driveType(){
  297. this.isShowDrive = true
  298. },
  299. confirmDriveType(e){
  300. this.dataDetails.quasiDrivingVehicle = e.value[0]
  301. this.isShowDrive = false
  302. },
  303. // 上传图片
  304. imgTypeSelect() {
  305. // if (val.name == '相册') {
  306. uni.chooseImage({
  307. count: 1,
  308. // sourceType: this.$helper.chooseImage.sourceType,
  309. success: function(res) {
  310. console.log(JSON.stringify(res.tempFilePaths));
  311. uploadImage('image', res.tempFilePaths[0], 'appData/',
  312. result => {
  313. // 上传成功回调函数
  314. console.log('图片地址-----', result)
  315. switch (_this.uploadType) {
  316. case 1:
  317. _this.dataDetails.driverLicenseHomePage = result
  318. _this.$request.baseRequest('get',
  319. '/driverInfo/api/driverLicenseShibie', {
  320. image: result
  321. }).then(res => {
  322. if (res.data) {
  323. let date = res.data.driverEndDate.substr(0,4)+"-"+res.data.driverEndDate.substr(4,2)+"-"+res.data.driverEndDate.substr(6,2)
  324. _this.dataDetails.driverLicenseValidityDate = date
  325. if(res.data.allowCar == 'A2' || res.data.allowCar == 'B2'){
  326. _this.dataDetails.quasiDrivingVehicle = res.data.allowCar
  327. }
  328. _this.dataDetails.lssuingAuthority = res.data.issuingAuthority
  329. _this.$forceUpdate()
  330. }
  331. })
  332. .catch(res => {
  333. uni.$u.toast(res.message);
  334. });
  335. break;
  336. case 2:
  337. _this.dataDetails.driverLicenseBackPage = result
  338. break;
  339. case 3:
  340. _this.dataDetails.drivingLicenseHomePage = result
  341. break;
  342. case 4:
  343. _this.dataDetails.drivingLicenseBackPage = result
  344. break;
  345. case 5:
  346. _this.dataDetails.trailerLicenseHomePage = result
  347. break;
  348. case 6:
  349. _this.dataDetails.trailerLicenseBackPage = result
  350. break;
  351. case 7:
  352. _this.dataDetails.qualificationCertificate = result
  353. _this.$request.baseRequest('get',
  354. '/driverInfo/api/qualificationLicenseShibie', {
  355. image: result
  356. }).then(res => {
  357. if (res.data&&res.data.qualificationCertificate) {
  358. _this.dataDetails.qualificationCertificateValidityDate = res.data.qualificationCertificate
  359. }
  360. if(res.data&&res.data.qualificationCertificateNum){
  361. _this.dataDetails.qualificationCertificateNumber = res.data.qualificationCertificateNum
  362. }
  363. _this.$forceUpdate()
  364. })
  365. .catch(res => {
  366. uni.$u.toast(res.message);
  367. });
  368. break;
  369. case 8:
  370. _this.dataDetails.operationCertificate = result
  371. break;
  372. case 9:
  373. _this.dataDetails.trailerOperationCertificate = result
  374. break;
  375. }
  376. }
  377. )
  378. }
  379. });
  380. // } else {
  381. // }
  382. },
  383. uploadImg(type) {
  384. this.uploadType = type
  385. // this.isShowimgType = true
  386. this.imgTypeSelect()
  387. },
  388. validate() {
  389. // true 为校验不通过
  390. if (uni.$u.test.isEmpty(this.dataDetails.driverLicenseHomePage)) {
  391. this.$refs.uToast.show({
  392. type: 'error',
  393. message: "驾驶证主页不能为空!",
  394. })
  395. return true
  396. }
  397. if (uni.$u.test.isEmpty(this.dataDetails.driverLicenseHomePage)) {
  398. this.$refs.uToast.show({
  399. type: 'error',
  400. message: "驾驶证副页不能为空!",
  401. })
  402. return true
  403. }
  404. if (uni.$u.test.isEmpty(this.dataDetails.driverLicenseValidityDate)) {
  405. this.$refs.uToast.show({
  406. type: 'error',
  407. message: "驾驶证有效期不能为空!",
  408. })
  409. return true
  410. }
  411. if (uni.$u.test.isEmpty(this.dataDetails.quasiDrivingVehicle)) {
  412. this.$refs.uToast.show({
  413. type: 'error',
  414. message: "准驾车型不能为空!",
  415. })
  416. return true
  417. }
  418. if (uni.$u.test.isEmpty(this.dataDetails.lssuingAuthority)) {
  419. this.$refs.uToast.show({
  420. type: 'error',
  421. message: "驾驶证发证机关不能为空!",
  422. })
  423. return true
  424. }
  425. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseHomePage)) {
  426. // this.$refs.uToast.show({
  427. // type: 'error',
  428. // message: "行驶证主页不能为空!",
  429. // })
  430. // return true
  431. // }
  432. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseBackPage)) {
  433. // this.$refs.uToast.show({
  434. // type: 'error',
  435. // message: "行驶证副页不能为空!",
  436. // })
  437. // return true
  438. // }
  439. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseValidityDate)) {
  440. // this.$refs.uToast.show({
  441. // type: 'error',
  442. // message: "行驶证有效期不能为空!",
  443. // })
  444. // return true
  445. // }
  446. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseNumber)) {
  447. // this.$refs.uToast.show({
  448. // type: 'error',
  449. // message: "行驶证档案编号不能为空!",
  450. // })
  451. // return true
  452. // }
  453. // if(this.radiovalue=='挂车司机'){
  454. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseHomePage)) {
  455. // this.$refs.uToast.show({
  456. // type: 'error',
  457. // message: "挂车行驶证主页不能为空!",
  458. // })
  459. // return true
  460. // }
  461. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
  462. // this.$refs.uToast.show({
  463. // type: 'error',
  464. // message: "挂车行驶证副页不能为空!",
  465. // })
  466. // return true
  467. // }
  468. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseNumber)) {
  469. // this.$refs.uToast.show({
  470. // type: 'error',
  471. // message: "挂车行驶证档案编号不能为空!",
  472. // })
  473. // return true
  474. // }
  475. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseValidityDate)) {
  476. // this.$refs.uToast.show({
  477. // type: 'error',
  478. // message: "挂车行驶证有效期不能为空!",
  479. // })
  480. // return true
  481. // }
  482. // }
  483. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
  484. // this.$refs.uToast.show({
  485. // type: 'error',
  486. // message: "行驶证副页不能为空!",
  487. // })
  488. // return true
  489. // }
  490. if (uni.$u.test.isEmpty(this.dataDetails.qualificationCertificate)) {
  491. this.$refs.uToast.show({
  492. type: 'error',
  493. message: "从业资格证不能为空!",
  494. })
  495. return true
  496. }
  497. if (uni.$u.test.isEmpty(this.dataDetails.qualificationCertificateValidityDate)) {
  498. this.$refs.uToast.show({
  499. type: 'error',
  500. message: "从业资格证有效期不能为空!",
  501. })
  502. return true
  503. }
  504. if (uni.$u.test.isEmpty(this.dataDetails.qualificationCertificateNumber)) {
  505. this.$refs.uToast.show({
  506. type: 'error',
  507. message: "从业资格证号不能为空!",
  508. })
  509. return true
  510. }
  511. // if (!uni.$u.test.rangeLength(this.dataDetails.qualificationCertificateNumber,[12,19])) {
  512. // this.$refs.uToast.show({
  513. // type: 'error',
  514. // message: "从业资格证号输入错误!",
  515. // })
  516. // return true
  517. // }
  518. if (this.dataDetails.qualificationCertificateNumber.length!=19) {
  519. this.$refs.uToast.show({
  520. type: 'error',
  521. message: "从业资格证号输入错误!",
  522. })
  523. return true
  524. }
  525. // if (uni.$u.test.isEmpty(this.dataDetails.operationCertificate)) {
  526. // this.$refs.uToast.show({
  527. // type: 'error',
  528. // message: "道路运输证不能为空!",
  529. // })
  530. // return true
  531. // }
  532. // if (uni.$u.test.isEmpty(this.dataDetails.operationCertificateNumber)) {
  533. // this.$refs.uToast.show({
  534. // type: 'error',
  535. // message: "道路运输证号不能为空!",
  536. // })
  537. // return true
  538. // }
  539. // if (uni.$u.test.isEmpty(this.dataDetails.operationCertificateValidityDate)) {
  540. // this.$refs.uToast.show({
  541. // type: 'error',
  542. // message: "道路运输证有效期不能为空!",
  543. // })
  544. // return true
  545. // }
  546. // if(this.radiovalue=='挂车司机'){
  547. // if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificate)) {
  548. // this.$refs.uToast.show({
  549. // type: 'error',
  550. // message: "挂车道路运输证不能为空!",
  551. // })
  552. // return true
  553. // }
  554. // if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateNumber)) {
  555. // this.$refs.uToast.show({
  556. // type: 'error',
  557. // message: "挂车道路运输证号不能为空!",
  558. // })
  559. // return true
  560. // }
  561. // if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateValidityDate)) {
  562. // this.$refs.uToast.show({
  563. // type: 'error',
  564. // message: "挂车道路运输证有效期不能为空!",
  565. // })
  566. // return true
  567. // }
  568. // }
  569. if (uni.$u.test.isEmpty(this.dataDetails.postalAddress)) {
  570. this.$refs.uToast.show({
  571. type: 'error',
  572. message: "通讯地址不能为空!",
  573. })
  574. return true
  575. }
  576. return false
  577. },
  578. delSubmitObj() {
  579. delete this.dataDetails.authenticationStatus
  580. delete this.dataDetails.authenticationStatusKey
  581. delete this.dataDetails.compId
  582. delete this.dataDetails.createDate
  583. delete this.dataDetails.createUserId
  584. delete this.dataDetails.deleteFlag
  585. delete this.dataDetails.driverCarInfoList
  586. delete this.dataDetails.driverPayeeInfoList
  587. delete this.dataDetails.firstFlag
  588. delete this.dataDetails.updateDate
  589. },
  590. btnBClick() {
  591. // 此处用法为在js中调用,需要写uni.$u.throttle()
  592. uni.$u.throttle(this.submit(), 5000)
  593. },
  594. submit() {
  595. if (!this.consentStatus) {
  596. uni.showToast({
  597. title: '请勾选协议',
  598. icon: 'none',
  599. duration: 2000
  600. })
  601. return
  602. }
  603. // 校验
  604. if (this.validate()) return
  605. this.delSubmitObj()
  606. this.dataDetails.accountNumber = uni.getStorageSync("userInfo").phone
  607. uni.showLoading({
  608. mask: true,
  609. title: '加载中'
  610. })
  611. this.$request.baseRequest('post', '/driverInfo/api/editInfo', this.dataDetails).then(res => {
  612. if (res.code == 200) {
  613. uni.hideLoading()
  614. this.$refs.uToast.show({
  615. type: 'success',
  616. message: "提交成功,待平台审核!",
  617. complete() {
  618. uni.switchTab({
  619. url: '/pages/mine/index'
  620. })
  621. }
  622. })
  623. } else {
  624. uni.hideLoading()
  625. uni.$u.toast(res.message);
  626. }
  627. })
  628. .catch(res => {
  629. uni.hideLoading()
  630. uni.$u.toast(res.message);
  631. });
  632. },
  633. radioChange(n) {
  634. console.log('radioChange', n);
  635. if (n == '挂车司机') {
  636. this.isGCar = true
  637. this.dataDetails.driverType = 1
  638. } else {
  639. this.dataDetails.driverType = 2
  640. this.isGCar = false
  641. }
  642. },
  643. //设置图片
  644. setImage(e) {
  645. console.log(e);
  646. //显示在页面
  647. //this.imagesrc = e.path;
  648. // if (e.dotype == 'idphoto') {
  649. // _this.zjzClipper(e.path);
  650. // } else if (e.dotype == 'watermark') {
  651. // _this.watermark(e.path);
  652. // } else {
  653. // _this.savePhoto(e.path);
  654. // }
  655. },
  656. }
  657. };
  658. </script>
  659. <style scoped lang="scss">
  660. .u-radio {
  661. margin-bottom: 0px !important;
  662. }
  663. .row4-img {
  664. width: 32rpx;
  665. height: 32rpx;
  666. }
  667. .preview {
  668. width: 100%;
  669. height: 100px;
  670. }
  671. .top-head {
  672. background: #2772FB;
  673. height: 80rpx;
  674. width: 100%;
  675. }
  676. .container {
  677. background: white;
  678. position: relative;
  679. top: -60rpx;
  680. margin: 0 20rpx;
  681. padding: 20rpx;
  682. box-sizing: border-box;
  683. border-radius: 10rpx;
  684. }
  685. .radio-group {
  686. display: flex;
  687. align-items: center;
  688. // justify-content: space-between;
  689. }
  690. .level1-title {
  691. margin: 20rpx 0;
  692. border-bottom: 1px solid #EEEEEE;
  693. padding-bottom: 30rpx;
  694. }
  695. .content1 {
  696. .row {
  697. border-bottom: 1px solid #EEEEEE;
  698. padding-bottom: 28rpx;
  699. margin-top: 26rpx;
  700. }
  701. .left-text {
  702. // background: red;
  703. width: 320rpx;
  704. color: #333333;
  705. display: flex;
  706. align-items: center;
  707. }
  708. .picture {
  709. position: relative;
  710. width: 100%;
  711. height: 440rpx;
  712. display: flex;
  713. justify-content: center;
  714. flex-direction: column;
  715. align-items: center;
  716. .text {
  717. margin-top: 20rpx;
  718. }
  719. }
  720. .picture1 {
  721. background: url(../../static/images/mine/jzz.png);
  722. background-size: 100% 100%;
  723. }
  724. .picture2 {
  725. background: url(../../static/images/mine/jzf.png);
  726. background-size: 100% 100%;
  727. }
  728. .picture3 {
  729. background: url(../../static/images/mine/xsz.png);
  730. background-size: 100% 100%;
  731. }
  732. .picture4 {
  733. background: url(../../static/images/mine/xsf.png);
  734. background-size: 100% 100%;
  735. }
  736. .picture5 {
  737. background: url(../../static/images/mine/gcxsz.png);
  738. background-size: 100% 100%;
  739. }
  740. .picture6 {
  741. background: url(../../static/images/mine/gcxsf.png);
  742. background-size: 100% 100%;
  743. }
  744. .picture7 {
  745. background: url(../../static/images/mine/cy.png);
  746. background-size: 100% 100%;
  747. }
  748. .picture8 {
  749. background: url(../../static/images/mine/cy.png);
  750. background-size: 100% 100%;
  751. }
  752. .picture9 {
  753. background: url(../../static/images/mine/cy.png);
  754. background-size: 100% 100%;
  755. }
  756. .xj-image {
  757. width: 100rpx;
  758. height: 100rpx;
  759. }
  760. .title {
  761. color: #999999;
  762. margin: 20rpx 0;
  763. }
  764. }
  765. .service {
  766. font-size: 24rpx;
  767. margin: 20rpx;
  768. justify-content: center;
  769. /deep/.u-image {
  770. margin: 0 20rpx;
  771. }
  772. }
  773. .del-card {
  774. position: absolute;
  775. top: -10rpx;
  776. right: -6rpx;
  777. width: 80rpx;
  778. height: 80rpx;
  779. z-index: 9;
  780. }
  781. .path {
  782. color: #2772FB;
  783. }
  784. .btn-color {}
  785. /deep/.uni-input-input:disabled {
  786. background: #fff;
  787. }
  788. /deep/.u-textarea{
  789. padding:9px 0;
  790. }
  791. /deep/.u-textarea__field{
  792. color:#000;
  793. text-align:right;
  794. }
  795. </style>