editDriverCertificationNext.vue 25 KB

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