driverCertificationNext.vue 27 KB

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