driverCertificationNext.vue 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971
  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(1)"
  31. class="preview-card-img picture">
  32. <view @click.stop="delCard(1)">
  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(1)"
  147. class="preview-card-img picture">
  148. <view @click.stop="delCard(1)">
  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="submit">提交</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. switch (this.ValidityPeriodType) {
  353. case 0:
  354. this.dataDetails.driverLicenseValidityStartDate = e.value[0]
  355. break
  356. case 1:
  357. this.dataDetails.drivingLicenseValidityDate = e.value[0]
  358. break
  359. case 2:
  360. this.dataDetails.trailerLicenseValidityDate = e.value[0]
  361. break
  362. case 3:
  363. this.dataDetails.qualificationCertificateValidityDate = e.value[0]
  364. break
  365. case 4:
  366. this.dataDetails.operationCertificateValidityDate = e.value[0]
  367. break
  368. case 5:
  369. this.dataDetails.trailerOperationCertificateValidityDate = e.value[0]
  370. break
  371. case 9:
  372. this.dataDetails.driverLicenseValidityDate = e.value[0]
  373. break
  374. }
  375. }else{
  376. if(e.value[0]==''){
  377. this.$refs.uToast.show({
  378. type: 'error',
  379. message: "年份不能为空!",
  380. })
  381. return
  382. }else if(e.value[1]==''){
  383. this.$refs.uToast.show({
  384. type: 'error',
  385. message: "月份不能为空!",
  386. })
  387. return
  388. }else if(e.value[2]==''){
  389. this.$refs.uToast.show({
  390. type: 'error',
  391. message: "日期不能为空!",
  392. })
  393. return
  394. }
  395. var date=new Date()
  396. var text=''
  397. switch (this.ValidityPeriodType) {
  398. case 3:
  399. text='驾驶证已过期!'
  400. break
  401. case 9:
  402. text='从业资格证已过期!'
  403. break
  404. }
  405. if(this.ValidityPeriodType==3||this.ValidityPeriodType==9){
  406. if(e.value[0]<date.getFullYear()){
  407. this.$refs.uToast.show({
  408. type: 'error',
  409. message: text,
  410. })
  411. return
  412. }
  413. if(e.value[0]==date.getFullYear()&&Number(e.value[1])<(date.getMonth()+1)){
  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)&&Number(e.value[2])<=(date.getDate())){
  421. this.$refs.uToast.show({
  422. type: 'error',
  423. message: text,
  424. })
  425. return
  426. }
  427. }
  428. switch (this.ValidityPeriodType) {
  429. case 0:
  430. this.dataDetails.driverLicenseValidityStartDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  431. break
  432. case 1:
  433. this.dataDetails.drivingLicenseValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  434. break
  435. case 2:
  436. this.dataDetails.trailerLicenseValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  437. break
  438. case 3:
  439. this.dataDetails.qualificationCertificateValidityDate = e.value[0] + '-' + e.value[1] + '-' + e
  440. .value[2]
  441. break
  442. case 4:
  443. this.dataDetails.operationCertificateValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[
  444. 2]
  445. break
  446. case 5:
  447. this.dataDetails.trailerOperationCertificateValidityDate = e.value[0] + '-' + e.value[1] + '-' + e
  448. .value[2]
  449. break
  450. case 9:
  451. this.dataDetails.driverLicenseValidityDate = e.value[0] + '-' + e.value[1] + '-' + e
  452. .value[2]
  453. break
  454. }
  455. }
  456. this.isShowValidity = false
  457. },
  458. selectValidityPeriod(type) {
  459. this.ValidityPeriodType = type
  460. this.isShowValidity = true
  461. },
  462. driveType(){
  463. this.isShowDrive = true
  464. },
  465. confirmDriveType(e){
  466. this.dataDetails.quasiDrivingVehicle = e.value[0]
  467. this.isShowDrive = false
  468. },
  469. // 上传图片
  470. imgTypeSelect(val) {
  471. // console.log(val)
  472. console.log(this.uploadType)
  473. // if (val.name == '相册') {
  474. uni.chooseImage({
  475. count: 1,
  476. // sourceType: this.$helper.chooseImage.sourceType,
  477. success: function(res) {
  478. console.log(JSON.stringify(res.tempFilePaths));
  479. uploadImage("images",res.tempFilePaths[0], 'appData/',
  480. result => {
  481. // 上传成功回调函数
  482. console.log('图片地址-----', result)
  483. switch (_this.uploadType) {
  484. case 1:
  485. _this.dataDetails.driverLicenseHomePage = result
  486. _this.$request.baseRequest('get',
  487. '/driverInfo/api/driverLicenseShibie', {
  488. image: result
  489. }).then(res => {
  490. if (res.data) {
  491. let date = res.data.driverEndDate.substr(0,4)+"-"+res.data.driverEndDate.substr(4,2)+"-"+res.data.driverEndDate.substr(6,2)
  492. _this.dataDetails.driverLicenseValidityDate = date
  493. if(res.data.allowCar == 'A2' || res.data.allowCar == 'B2'){
  494. _this.dataDetails.quasiDrivingVehicle = res.data.allowCar
  495. }
  496. _this.dataDetails.lssuingAuthority = res.data.issuingAuthority
  497. _this.$forceUpdate()
  498. }
  499. })
  500. .catch(res => {
  501. uni.$u.toast(res.message);
  502. });
  503. break;
  504. case 2:
  505. _this.dataDetails.driverLicenseBackPage = result
  506. break;
  507. case 3:
  508. _this.dataDetails.drivingLicenseHomePage = result
  509. break;
  510. case 4:
  511. _this.dataDetails.drivingLicenseBackPage = result
  512. break;
  513. case 5:
  514. _this.dataDetails.trailerLicenseHomePage = result
  515. break;
  516. case 6:
  517. _this.dataDetails.trailerLicenseBackPage = result
  518. break;
  519. case 7:
  520. _this.dataDetails.qualificationCertificate = result
  521. _this.$request.baseRequest('get',
  522. '/driverInfo/api/qualificationLicenseShibie', {
  523. image: result
  524. }).then(res => {
  525. if (res.data&&res.data.qualificationCertificate) {
  526. _this.dataDetails.qualificationCertificateValidityDate = res.data.qualificationCertificate
  527. // _this.dataDetails.driverLicenseValidityDate =
  528. // res.data.driverEndDate
  529. }
  530. if(res.data&&res.data.qualificationCertificateNum){
  531. _this.dataDetails.qualificationCertificateNumber = res.data.qualificationCertificateNum
  532. }
  533. _this.$forceUpdate()
  534. })
  535. .catch(res => {
  536. uni.$u.toast(res.message);
  537. });
  538. break;
  539. case 8:
  540. _this.dataDetails.operationCertificate = result
  541. break;
  542. case 9:
  543. _this.dataDetails.trailerOperationCertificate = result
  544. break;
  545. }
  546. _this.$forceUpdate()
  547. }
  548. )
  549. }
  550. });
  551. // } else {
  552. // }
  553. },
  554. uploadImg(type) {
  555. this.uploadType = type
  556. this.imgTypeSelect()
  557. // this.isShowimgType = true
  558. },
  559. validate() {
  560. // true 为校验不通过
  561. if (uni.$u.test.isEmpty(this.dataDetails.driverLicenseHomePage)) {
  562. this.$refs.uToast.show({
  563. type: 'error',
  564. message: "驾驶证主页不能为空!",
  565. })
  566. return true
  567. }
  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.driverLicenseValidityDate)) {
  576. this.$refs.uToast.show({
  577. type: 'error',
  578. message: "驾驶证有效期不能为空!",
  579. })
  580. return true
  581. }
  582. if (uni.$u.test.isEmpty(this.dataDetails.quasiDrivingVehicle)) {
  583. this.$refs.uToast.show({
  584. type: 'error',
  585. message: "准驾车型不能为空!",
  586. })
  587. return true
  588. }
  589. if (uni.$u.test.isEmpty(this.dataDetails.lssuingAuthority)) {
  590. this.$refs.uToast.show({
  591. type: 'error',
  592. message: "驾驶证发证机关不能为空!",
  593. })
  594. return true
  595. }
  596. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseHomePage)) {
  597. // this.$refs.uToast.show({
  598. // type: 'error',
  599. // message: "行驶证主页不能为空!",
  600. // })
  601. // return true
  602. // }
  603. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseBackPage)) {
  604. // this.$refs.uToast.show({
  605. // type: 'error',
  606. // message: "行驶证副页不能为空!",
  607. // })
  608. // return true
  609. // }
  610. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseValidityDate)) {
  611. // this.$refs.uToast.show({
  612. // type: 'error',
  613. // message: "行驶证有效期不能为空!",
  614. // })
  615. // return true
  616. // }
  617. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseNumber)) {
  618. // this.$refs.uToast.show({
  619. // type: 'error',
  620. // message: "行驶证档案编号不能为空!",
  621. // })
  622. // return true
  623. // }
  624. // if(this.radiovalue=='挂车司机'){
  625. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseHomePage)) {
  626. // this.$refs.uToast.show({
  627. // type: 'error',
  628. // message: "挂车行驶证主页不能为空!",
  629. // })
  630. // return true
  631. // }
  632. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
  633. // this.$refs.uToast.show({
  634. // type: 'error',
  635. // message: "挂车行驶证副页不能为空!",
  636. // })
  637. // return true
  638. // }
  639. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseNumber)) {
  640. // this.$refs.uToast.show({
  641. // type: 'error',
  642. // message: "挂车行驶证档案编号不能为空!",
  643. // })
  644. // return true
  645. // }
  646. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseValidityDate)) {
  647. // this.$refs.uToast.show({
  648. // type: 'error',
  649. // message: "挂车行驶证有效期不能为空!",
  650. // })
  651. // return true
  652. // }
  653. // }
  654. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
  655. // this.$refs.uToast.show({
  656. // type: 'error',
  657. // message: "行驶证副页不能为空!",
  658. // })
  659. // return true
  660. // }
  661. if (uni.$u.test.isEmpty(this.dataDetails.qualificationCertificate)) {
  662. this.$refs.uToast.show({
  663. type: 'error',
  664. message: "从业资格证不能为空!",
  665. })
  666. return true
  667. }
  668. if (uni.$u.test.isEmpty(this.dataDetails.qualificationCertificateValidityDate)) {
  669. this.$refs.uToast.show({
  670. type: 'error',
  671. message: "从业资格证有效期不能为空!",
  672. })
  673. return true
  674. }
  675. if (uni.$u.test.isEmpty(this.dataDetails.qualificationCertificateNumber)) {
  676. this.$refs.uToast.show({
  677. type: 'error',
  678. message: "从业资格证号不能为空!",
  679. })
  680. return true
  681. }
  682. if (!uni.$u.test.rangeLength(this.dataDetails.qualificationCertificateNumber,[12,19])) {
  683. this.$refs.uToast.show({
  684. type: 'error',
  685. message: "从业资格证号输入错误!",
  686. })
  687. return true
  688. }
  689. // if (uni.$u.test.isEmpty(this.dataDetails.operationCertificate)) {
  690. // this.$refs.uToast.show({
  691. // type: 'error',
  692. // message: "道路运输证不能为空!",
  693. // })
  694. // return true
  695. // }
  696. // if (uni.$u.test.isEmpty(this.dataDetails.operationCertificateNumber)) {
  697. // this.$refs.uToast.show({
  698. // type: 'error',
  699. // message: "道路运输证号不能为空!",
  700. // })
  701. // return true
  702. // }
  703. // if (uni.$u.test.isEmpty(this.dataDetails.operationCertificateValidityDate)) {
  704. // this.$refs.uToast.show({
  705. // type: 'error',
  706. // message: "道路运输证有效期不能为空!",
  707. // })
  708. // return true
  709. // }
  710. // if(this.radiovalue=='挂车司机'){
  711. // if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificate)) {
  712. // this.$refs.uToast.show({
  713. // type: 'error',
  714. // message: "挂车道路运输证不能为空!",
  715. // })
  716. // return true
  717. // }
  718. // if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateNumber)) {
  719. // this.$refs.uToast.show({
  720. // type: 'error',
  721. // message: "挂车道路运输证号不能为空!",
  722. // })
  723. // return true
  724. // }
  725. // if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateValidityDate)) {
  726. // this.$refs.uToast.show({
  727. // type: 'error',
  728. // message: "挂车道路运输证有效期不能为空!",
  729. // })
  730. // return true
  731. // }
  732. // }
  733. if (uni.$u.test.isEmpty(this.dataDetails.postalAddress)) {
  734. this.$refs.uToast.show({
  735. type: 'error',
  736. message: "通讯地址不能为空!",
  737. })
  738. return true
  739. }
  740. return false
  741. },
  742. submit() {
  743. // 校验
  744. if (this.validate()) return
  745. // if(this.dataDetails.driverSex=='男'){
  746. // this.dataDetails.driverCall = this.dataDetails.driverCall+'先生'
  747. // }else{
  748. // this.dataDetails.driverCall = this.dataDetails.driverCall+'女士'
  749. // }
  750. if(!this.consentStatus){
  751. this.$refs.uToast.show({
  752. type: 'error',
  753. message: "请勾选协议!",
  754. })
  755. return
  756. }
  757. this.$request.baseRequest('post', '/driverInfo/api/addInfo', this.dataDetails).then(res => {
  758. if(res.code==200){
  759. this.$refs.uToast.show({
  760. type: 'success',
  761. message: "提交成功,待平台审核!",
  762. complete() {
  763. uni.switchTab({
  764. url: '/pages/mine/index'
  765. })
  766. }
  767. })
  768. // uni.$u.route('/pages/mine/index');
  769. }else{
  770. uni.$u.toast(res.message);
  771. }
  772. })
  773. .catch(res => {
  774. uni.$u.toast(res.message);
  775. });
  776. },
  777. radioChange(n) {
  778. if (n == '挂车司机') {
  779. this.isGCar = true
  780. this.dataDetails.driverType = 1
  781. } else {
  782. this.dataDetails.driverType = 2
  783. this.isGCar = false
  784. }
  785. },
  786. //设置图片
  787. setImage(e) {
  788. console.log(e);
  789. //显示在页面
  790. //this.imagesrc = e.path;
  791. // if (e.dotype == 'idphoto') {
  792. // _this.zjzClipper(e.path);
  793. // } else if (e.dotype == 'watermark') {
  794. // _this.watermark(e.path);
  795. // } else {
  796. // _this.savePhoto(e.path);
  797. // }
  798. },
  799. }
  800. };
  801. </script>
  802. <style scoped lang="scss">
  803. .u-radio {
  804. margin-bottom: 0px !important;
  805. }
  806. .row4-img {
  807. width: 32rpx;
  808. height: 32rpx;
  809. }
  810. .preview {
  811. width: 100%;
  812. height: 100px;
  813. }
  814. .top-head {
  815. background: #2772FB;
  816. height: 80rpx;
  817. width: 100%;
  818. }
  819. .container {
  820. background: white;
  821. position: relative;
  822. top: -60rpx;
  823. margin: 0 20rpx;
  824. padding: 20rpx;
  825. box-sizing: border-box;
  826. border-radius: 10rpx;
  827. }
  828. .radio-group {
  829. display: flex;
  830. align-items: center;
  831. }
  832. .level1-title {
  833. margin: 20rpx 0;
  834. border-bottom: 1px solid #EEEEEE;
  835. padding-bottom: 30rpx;
  836. }
  837. .content1 {
  838. .row {
  839. border-bottom: 1px solid #EEEEEE;
  840. padding-bottom: 28rpx;
  841. margin-top: 26rpx;
  842. }
  843. .left-text {
  844. // background: red;
  845. width: 320rpx;
  846. color: #333333;
  847. display: flex;
  848. align-items: center;
  849. }
  850. .picture {
  851. position: relative;
  852. width: 100%;
  853. height: 440rpx;
  854. display: flex;
  855. justify-content: center;
  856. flex-direction: column;
  857. align-items: center;
  858. .text {
  859. margin-top: 20rpx;
  860. }
  861. }
  862. .picture1 {
  863. background: url(../../static/images/mine/jzz.png);
  864. background-size: 100% 100%;
  865. }
  866. .picture2 {
  867. background: url(../../static/images/mine/jzf.png);
  868. background-size: 100% 100%;
  869. }
  870. .picture3 {
  871. background: url(../../static/images/mine/xsz.png);
  872. background-size: 100% 100%;
  873. }
  874. .picture4 {
  875. background: url(../../static/images/mine/xsf.png);
  876. background-size: 100% 100%;
  877. }
  878. .picture5 {
  879. background: url(../../static/images/mine/gcxsz.png);
  880. background-size: 100% 100%;
  881. }
  882. .picture6 {
  883. background: url(../../static/images/mine/gcxsf.png);
  884. background-size: 100% 100%;
  885. }
  886. .picture7 {
  887. background: url(../../static/images/mine/cy.png);
  888. background-size: 100% 100%;
  889. }
  890. .picture8 {
  891. background: url(../../static/images/mine/cy.png);
  892. background-size: 100% 100%;
  893. }
  894. .picture9 {
  895. background: url(../../static/images/mine/cy.png);
  896. background-size: 100% 100%;
  897. }
  898. .xj-image {
  899. width: 100rpx;
  900. height: 100rpx;
  901. }
  902. .title {
  903. color: #999999;
  904. margin: 20rpx 0;
  905. }
  906. }
  907. .service {
  908. font-size: 24rpx;
  909. margin: 20rpx;
  910. justify-content: center;
  911. /deep/.u-image {
  912. margin: 0 20rpx;
  913. }
  914. }
  915. .del-card {
  916. position: absolute;
  917. top: -10rpx;
  918. right: -6rpx;
  919. width: 80rpx;
  920. height: 80rpx;
  921. z-index: 9;
  922. }
  923. .path{
  924. color: #2772FB;
  925. }
  926. </style>