driverCertificationNext.vue 24 KB

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