driverCertificationNext.vue 28 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871
  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>
  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. import permision from "@/js_sdk/wa-permission/permission.js"
  246. var _this;
  247. export default {
  248. components: {},
  249. data() {
  250. return {
  251. consentStatus: false,
  252. isGCar: true,
  253. ValidityPeriodType: '',
  254. validityPeriod: [],
  255. isShowValidity: false,
  256. isShowDrive:false,
  257. driveList:[["A2","B2"]],
  258. uploadType: '',
  259. isShowimgType: false,
  260. dataDetails: {},
  261. radiolist: [{
  262. name: '挂车司机',
  263. disabled: false
  264. },
  265. {
  266. name: '非挂车司机',
  267. disabled: false
  268. }
  269. ],
  270. // u-radio-group的v-model绑定的值如果设置为某个radio的name,就会被默认选中
  271. radiovalue: '挂车司机',
  272. };
  273. },
  274. onLoad(options) {
  275. _this = this;
  276. console.log(options)
  277. this.get_camera_permission()
  278. this.dataDetails = JSON.parse(options.data)
  279. this.dataDetails.driverType = 1
  280. this.validityPeriod = this.$helper.makeValidityPeriod()
  281. },
  282. methods: {
  283. async get_camera_permission() {
  284. var photol=await permision.requestAndroidPermission("android.permission.CAMERA")
  285. if(photol == false){
  286. uni.showModal({
  287. title: '提示',
  288. content: '您已经关闭相册权限,去设置',
  289. success: function (res) {
  290. if (res.confirm) {
  291. permision.gotoAppPermissionSetting()
  292. // plus.runtime.openURL("app-settings:");
  293. } else if (res.cancel) {
  294. console.log('用户点击取消');
  295. }
  296. }
  297. });
  298. }
  299. },
  300. delCard(type) {
  301. switch (type) {
  302. case 1:
  303. _this.dataDetails.driverLicenseHomePage = ""
  304. break;
  305. case 2:
  306. _this.dataDetails.driverLicenseBackPage = ""
  307. break;
  308. case 3:
  309. _this.dataDetails.drivingLicenseHomePage = ""
  310. break;
  311. case 4:
  312. _this.dataDetails.drivingLicenseBackPage = ""
  313. break;
  314. case 5:
  315. _this.dataDetails.trailerLicenseHomePage = ""
  316. break;
  317. case 6:
  318. _this.dataDetails.trailerLicenseBackPage = ""
  319. break;
  320. case 7:
  321. _this.dataDetails.qualificationCertificate = ""
  322. break;
  323. case 8:
  324. _this.dataDetails.operationCertificate = ""
  325. break;
  326. case 9:
  327. _this.dataDetails.trailerOperationCertificate = ""
  328. break;
  329. }
  330. },
  331. consent() {
  332. this.consentStatus = !this.consentStatus
  333. // uni.setStorage({
  334. // key: 'policyStorageKey',
  335. // data: this.consentStatus
  336. // });
  337. },
  338. validate(data) {},
  339. confirmValidityPeriod(e) {
  340. console.log('confirm', e)
  341. switch (this.ValidityPeriodType) {
  342. case 0:
  343. this.dataDetails.driverLicenseValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  344. break
  345. case 1:
  346. this.dataDetails.drivingLicenseValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  347. break
  348. case 2:
  349. this.dataDetails.trailerLicenseValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  350. break
  351. case 3:
  352. this.dataDetails.qualificationCertificateValidityDate = e.value[0] + '-' + e.value[1] + '-' + e
  353. .value[2]
  354. break
  355. case 4:
  356. this.dataDetails.operationCertificateValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[
  357. 2]
  358. break
  359. case 5:
  360. this.dataDetails.trailerOperationCertificateValidityDate = e.value[0] + '-' + e.value[1] + '-' + e
  361. .value[2]
  362. break
  363. }
  364. this.isShowValidity = false
  365. },
  366. selectValidityPeriod(type) {
  367. this.ValidityPeriodType = type
  368. this.isShowValidity = true
  369. },
  370. driveType(){
  371. this.isShowDrive = true
  372. },
  373. confirmDriveType(e){
  374. this.dataDetails.quasiDrivingVehicle = e.value[0]
  375. this.isShowDrive = false
  376. },
  377. // 上传图片
  378. imgTypeSelect(val) {
  379. // console.log(val)
  380. console.log(this.uploadType)
  381. // if (val.name == '相册') {
  382. uni.chooseImage({
  383. count: 1,
  384. // sourceType: this.$helper.chooseImage.sourceType,
  385. success: function(res) {
  386. console.log(JSON.stringify(res.tempFilePaths));
  387. uploadImage("images",res.tempFilePaths[0], 'appData/',
  388. result => {
  389. // 上传成功回调函数
  390. console.log('图片地址-----', result)
  391. switch (_this.uploadType) {
  392. case 1:
  393. _this.dataDetails.driverLicenseHomePage = result
  394. _this.$request.baseRequest('get',
  395. '/driverInfo/api/driverLicenseShibie', {
  396. image: result
  397. }).then(res => {
  398. if (res.data) {
  399. let date = res.data.driverEndDate.substr(0,4)+"-"+res.data.driverEndDate.substr(4,2)+"-"+res.data.driverEndDate.substr(6,2)
  400. _this.dataDetails.driverLicenseValidityDate = date
  401. if(res.data.allowCar == 'A2' || res.data.allowCar == 'B2'){
  402. _this.dataDetails.quasiDrivingVehicle = res.data.allowCar
  403. }
  404. _this.dataDetails.lssuingAuthority = res.data.issuingAuthority
  405. _this.$forceUpdate()
  406. }
  407. })
  408. .catch(res => {
  409. uni.$u.toast(res.message);
  410. });
  411. break;
  412. case 2:
  413. _this.dataDetails.driverLicenseBackPage = result
  414. break;
  415. case 3:
  416. _this.dataDetails.drivingLicenseHomePage = result
  417. break;
  418. case 4:
  419. _this.dataDetails.drivingLicenseBackPage = result
  420. break;
  421. case 5:
  422. _this.dataDetails.trailerLicenseHomePage = result
  423. break;
  424. case 6:
  425. _this.dataDetails.trailerLicenseBackPage = result
  426. break;
  427. case 7:
  428. _this.dataDetails.qualificationCertificate = result
  429. _this.$request.baseRequest('get',
  430. '/driverInfo/api/qualificationLicenseShibie', {
  431. image: result
  432. }).then(res => {
  433. if (res.data&&res.data.qualificationCertificate) {
  434. _this.dataDetails.qualificationCertificateValidityDate = res.data.qualificationCertificate
  435. // _this.dataDetails.driverLicenseValidityDate =
  436. // res.data.driverEndDate
  437. }
  438. if(res.data&&res.data.qualificationCertificateNum){
  439. _this.dataDetails.qualificationCertificateNumber = res.data.qualificationCertificateNum
  440. }
  441. _this.$forceUpdate()
  442. })
  443. .catch(res => {
  444. uni.$u.toast(res.message);
  445. });
  446. break;
  447. case 8:
  448. _this.dataDetails.operationCertificate = result
  449. break;
  450. case 9:
  451. _this.dataDetails.trailerOperationCertificate = result
  452. break;
  453. }
  454. _this.$forceUpdate()
  455. }
  456. )
  457. }
  458. });
  459. // } else {
  460. // }
  461. },
  462. uploadImg(type) {
  463. this.uploadType = type
  464. this.imgTypeSelect()
  465. // this.isShowimgType = true
  466. },
  467. validate() {
  468. // true 为校验不通过
  469. if (uni.$u.test.isEmpty(this.dataDetails.driverLicenseHomePage)) {
  470. this.$refs.uToast.show({
  471. type: 'error',
  472. message: "驾驶证主页不能为空!",
  473. })
  474. return true
  475. }
  476. if (uni.$u.test.isEmpty(this.dataDetails.driverLicenseHomePage)) {
  477. this.$refs.uToast.show({
  478. type: 'error',
  479. message: "驾驶证副页不能为空!",
  480. })
  481. return true
  482. }
  483. if (uni.$u.test.isEmpty(this.dataDetails.driverLicenseValidityDate)) {
  484. this.$refs.uToast.show({
  485. type: 'error',
  486. message: "驾驶证有效期不能为空!",
  487. })
  488. return true
  489. }
  490. if (uni.$u.test.isEmpty(this.dataDetails.quasiDrivingVehicle)) {
  491. this.$refs.uToast.show({
  492. type: 'error',
  493. message: "准驾车型不能为空!",
  494. })
  495. return true
  496. }
  497. if (uni.$u.test.isEmpty(this.dataDetails.lssuingAuthority)) {
  498. this.$refs.uToast.show({
  499. type: 'error',
  500. message: "驾驶证发证机关不能为空!",
  501. })
  502. return true
  503. }
  504. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseHomePage)) {
  505. // this.$refs.uToast.show({
  506. // type: 'error',
  507. // message: "行驶证主页不能为空!",
  508. // })
  509. // return true
  510. // }
  511. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseBackPage)) {
  512. // this.$refs.uToast.show({
  513. // type: 'error',
  514. // message: "行驶证副页不能为空!",
  515. // })
  516. // return true
  517. // }
  518. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseValidityDate)) {
  519. // this.$refs.uToast.show({
  520. // type: 'error',
  521. // message: "行驶证有效期不能为空!",
  522. // })
  523. // return true
  524. // }
  525. // if (uni.$u.test.isEmpty(this.dataDetails.drivingLicenseNumber)) {
  526. // this.$refs.uToast.show({
  527. // type: 'error',
  528. // message: "行驶证档案编号不能为空!",
  529. // })
  530. // return true
  531. // }
  532. // if(this.radiovalue=='挂车司机'){
  533. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseHomePage)) {
  534. // this.$refs.uToast.show({
  535. // type: 'error',
  536. // message: "挂车行驶证主页不能为空!",
  537. // })
  538. // return true
  539. // }
  540. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
  541. // this.$refs.uToast.show({
  542. // type: 'error',
  543. // message: "挂车行驶证副页不能为空!",
  544. // })
  545. // return true
  546. // }
  547. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseNumber)) {
  548. // this.$refs.uToast.show({
  549. // type: 'error',
  550. // message: "挂车行驶证档案编号不能为空!",
  551. // })
  552. // return true
  553. // }
  554. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseValidityDate)) {
  555. // this.$refs.uToast.show({
  556. // type: 'error',
  557. // message: "挂车行驶证有效期不能为空!",
  558. // })
  559. // return true
  560. // }
  561. // }
  562. // if (uni.$u.test.isEmpty(this.dataDetails.trailerLicenseBackPage)) {
  563. // this.$refs.uToast.show({
  564. // type: 'error',
  565. // message: "行驶证副页不能为空!",
  566. // })
  567. // return true
  568. // }
  569. if (uni.$u.test.isEmpty(this.dataDetails.qualificationCertificate)) {
  570. this.$refs.uToast.show({
  571. type: 'error',
  572. message: "从业资格证不能为空!",
  573. })
  574. return true
  575. }
  576. if (uni.$u.test.isEmpty(this.dataDetails.qualificationCertificateValidityDate)) {
  577. this.$refs.uToast.show({
  578. type: 'error',
  579. message: "从业资格证有效期不能为空!",
  580. })
  581. return true
  582. }
  583. if (uni.$u.test.isEmpty(this.dataDetails.qualificationCertificateNumber)) {
  584. this.$refs.uToast.show({
  585. type: 'error',
  586. message: "从业资格证号不能为空!",
  587. })
  588. return true
  589. }
  590. // if (uni.$u.test.isEmpty(this.dataDetails.operationCertificate)) {
  591. // this.$refs.uToast.show({
  592. // type: 'error',
  593. // message: "道路运输证不能为空!",
  594. // })
  595. // return true
  596. // }
  597. // if (uni.$u.test.isEmpty(this.dataDetails.operationCertificateNumber)) {
  598. // this.$refs.uToast.show({
  599. // type: 'error',
  600. // message: "道路运输证号不能为空!",
  601. // })
  602. // return true
  603. // }
  604. // if (uni.$u.test.isEmpty(this.dataDetails.operationCertificateValidityDate)) {
  605. // this.$refs.uToast.show({
  606. // type: 'error',
  607. // message: "道路运输证有效期不能为空!",
  608. // })
  609. // return true
  610. // }
  611. // if(this.radiovalue=='挂车司机'){
  612. // if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificate)) {
  613. // this.$refs.uToast.show({
  614. // type: 'error',
  615. // message: "挂车道路运输证不能为空!",
  616. // })
  617. // return true
  618. // }
  619. // if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateNumber)) {
  620. // this.$refs.uToast.show({
  621. // type: 'error',
  622. // message: "挂车道路运输证号不能为空!",
  623. // })
  624. // return true
  625. // }
  626. // if (uni.$u.test.isEmpty(this.dataDetails.trailerOperationCertificateValidityDate)) {
  627. // this.$refs.uToast.show({
  628. // type: 'error',
  629. // message: "挂车道路运输证有效期不能为空!",
  630. // })
  631. // return true
  632. // }
  633. // }
  634. if (uni.$u.test.isEmpty(this.dataDetails.postalAddress)) {
  635. this.$refs.uToast.show({
  636. type: 'error',
  637. message: "通讯地址不能为空!",
  638. })
  639. return true
  640. }
  641. return false
  642. },
  643. submit() {
  644. // 校验
  645. if (this.validate()) return
  646. // if(this.dataDetails.driverSex=='男'){
  647. // this.dataDetails.driverCall = this.dataDetails.driverCall+'先生'
  648. // }else{
  649. // this.dataDetails.driverCall = this.dataDetails.driverCall+'女士'
  650. // }
  651. if(!this.consentStatus){
  652. this.$refs.uToast.show({
  653. type: 'error',
  654. message: "请勾选协议!",
  655. })
  656. return
  657. }
  658. this.$request.baseRequest('post', '/driverInfo/api/addInfo', this.dataDetails).then(res => {
  659. if(res.code==200){
  660. this.$refs.uToast.show({
  661. type: 'success',
  662. message: "提交成功,待平台审核!",
  663. complete() {
  664. uni.switchTab({
  665. url: '/pages/mine/index'
  666. })
  667. }
  668. })
  669. // uni.$u.route('/pages/mine/index');
  670. }else{
  671. uni.$u.toast(res.message);
  672. }
  673. })
  674. .catch(res => {
  675. uni.$u.toast(res.message);
  676. });
  677. },
  678. radioChange(n) {
  679. if (n == '挂车司机') {
  680. this.isGCar = true
  681. this.dataDetails.driverType = 1
  682. } else {
  683. this.dataDetails.driverType = 2
  684. this.isGCar = false
  685. }
  686. },
  687. //设置图片
  688. setImage(e) {
  689. console.log(e);
  690. //显示在页面
  691. //this.imagesrc = e.path;
  692. // if (e.dotype == 'idphoto') {
  693. // _this.zjzClipper(e.path);
  694. // } else if (e.dotype == 'watermark') {
  695. // _this.watermark(e.path);
  696. // } else {
  697. // _this.savePhoto(e.path);
  698. // }
  699. },
  700. }
  701. };
  702. </script>
  703. <style scoped lang="scss">
  704. .u-radio {
  705. margin-bottom: 0px !important;
  706. }
  707. .row4-img {
  708. width: 32rpx;
  709. height: 32rpx;
  710. }
  711. .preview {
  712. width: 100%;
  713. height: 100px;
  714. }
  715. .top-head {
  716. background: #2772FB;
  717. height: 80rpx;
  718. width: 100%;
  719. }
  720. .container {
  721. background: white;
  722. position: relative;
  723. top: -60rpx;
  724. margin: 0 20rpx;
  725. padding: 20rpx;
  726. box-sizing: border-box;
  727. border-radius: 10rpx;
  728. }
  729. .radio-group {
  730. display: flex;
  731. align-items: center;
  732. }
  733. .level1-title {
  734. margin: 20rpx 0;
  735. border-bottom: 1px solid #EEEEEE;
  736. padding-bottom: 30rpx;
  737. }
  738. .content1 {
  739. .row {
  740. border-bottom: 1px solid #EEEEEE;
  741. padding-bottom: 28rpx;
  742. margin-top: 26rpx;
  743. }
  744. .left-text {
  745. // background: red;
  746. width: 320rpx;
  747. color: #333333;
  748. display: flex;
  749. align-items: center;
  750. }
  751. .picture {
  752. position: relative;
  753. width: 100%;
  754. height: 440rpx;
  755. display: flex;
  756. justify-content: center;
  757. flex-direction: column;
  758. align-items: center;
  759. .text {
  760. margin-top: 20rpx;
  761. }
  762. }
  763. .picture1 {
  764. background: url(../../static/images/mine/jzz.png);
  765. background-size: 100% 100%;
  766. }
  767. .picture2 {
  768. background: url(../../static/images/mine/jzf.png);
  769. background-size: 100% 100%;
  770. }
  771. .picture3 {
  772. background: url(../../static/images/mine/xsz.png);
  773. background-size: 100% 100%;
  774. }
  775. .picture4 {
  776. background: url(../../static/images/mine/xsf.png);
  777. background-size: 100% 100%;
  778. }
  779. .picture5 {
  780. background: url(../../static/images/mine/gcxsz.png);
  781. background-size: 100% 100%;
  782. }
  783. .picture6 {
  784. background: url(../../static/images/mine/gcxsf.png);
  785. background-size: 100% 100%;
  786. }
  787. .picture7 {
  788. background: url(../../static/images/mine/cy.png);
  789. background-size: 100% 100%;
  790. }
  791. .picture8 {
  792. background: url(../../static/images/mine/cy.png);
  793. background-size: 100% 100%;
  794. }
  795. .picture9 {
  796. background: url(../../static/images/mine/cy.png);
  797. background-size: 100% 100%;
  798. }
  799. .xj-image {
  800. width: 100rpx;
  801. height: 100rpx;
  802. }
  803. .title {
  804. color: #999999;
  805. margin: 20rpx 0;
  806. }
  807. }
  808. .service {
  809. font-size: 24rpx;
  810. margin: 20rpx;
  811. justify-content: center;
  812. /deep/.u-image {
  813. margin: 0 20rpx;
  814. }
  815. }
  816. .del-card {
  817. position: absolute;
  818. top: -10rpx;
  819. right: -6rpx;
  820. width: 80rpx;
  821. height: 80rpx;
  822. z-index: 9;
  823. }
  824. .path{
  825. color: #2772FB;
  826. }
  827. </style>