driverCertificationNext.vue 31 KB

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