driverCertificationNext.vue 28 KB

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