driverCertificationNext.vue 24 KB

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