driverCertificationNext.vue 32 KB

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