driverCertificationNext.vue 25 KB

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