driverCertificationNext.vue 25 KB

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