driverCertification.vue 35 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306
  1. <template>
  2. <view class="content">
  3. <view class="top-head"></view>
  4. <view class="container">
  5. <view class="content2 content-other">
  6. <view class="title">上传身份证人像面</view>
  7. <view @click.stop="uploadImg(1,index)" class="picture picture1" v-if="!dataDetails.cardAddressUrl">
  8. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  9. <view class="text">上传身份证人像面</view>
  10. </view>
  11. <view v-if="dataDetails.cardAddressUrl" @click.stop="uploadImg(1,index)"
  12. class="preview-card-img picture">
  13. <!-- <image class="card-img" :src="dataDetails.cardAddressUrl"></image> -->
  14. <view @click.stop="delCard(1)">
  15. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  16. </image>
  17. </view>
  18. <image class="" :src="dataDetails.cardAddressUrl" mode="aspectFit" style=""></image>
  19. </view>
  20. <view class="title">上传身份证国徽面</view>
  21. <view @click="uploadImg(2,index)" class="picture picture2" v-if="!dataDetails.cardBackAddressUrl">
  22. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  23. <view class="text">上传身份证国徽面</view>
  24. </view>
  25. <view v-if="dataDetails.cardBackAddressUrl" @click.stop="uploadImg(2,index)"
  26. class="preview-card-img picture">
  27. <!-- <image class="card-img" :src="dataDetails.cardAddressUrl"></image> -->
  28. <view @click.stop="delCard(2)">
  29. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  30. </image>
  31. </view>
  32. <image class="" :src="dataDetails.cardBackAddressUrl" mode="aspectFit"></image>
  33. </view>
  34. <view class="flex row">
  35. <view class="left-text">身份证号</view>
  36. <u--input placeholder="请输入身份证号" inputAlign='left' border="none" v-model="dataDetails.numberCard" maxlength="18">
  37. </u--input>
  38. </view>
  39. <view class="flex row noborder">
  40. <view class="left-text">身份证截止日期</view>
  41. <view class="" @click="selectValidityPeriod">
  42. {{dataDetails.cardValidityDate?dataDetails.cardValidityDate:'选择身份证截止日期>'}}
  43. </view>
  44. </view>
  45. <u-picker :show="isShowcardValidity" ref="uPicker" :columns="validityPeriod"
  46. @confirm="confirmValidityPeriod" @change="changeHandler">
  47. </u-picker>
  48. </view>
  49. <view class="content1 content-other">
  50. <view class="flex row">
  51. <view class="left-text">姓名</view>
  52. <u--input placeholder="输入姓名" inputAlign='left' border="none" v-model="dataDetails.driverName">
  53. </u--input>
  54. </view>
  55. <view class="flex row">
  56. <view class="left-text">性别</view>
  57. <u-radio-group v-model="dataDetails.driverSex" placement="row">
  58. <u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in radiolist1" :key="index"
  59. :label="item.name" :name="item.name" @change="radioChange" style="margin: 0 20rpx;">
  60. </u-radio>
  61. </u-radio-group>
  62. </view>
  63. <view class="flex row row-ch">
  64. <view class="left-text">称呼</view>
  65. <u--input placeholder="输入姓氏" class="ch-style" inputAlign='center' border="none"
  66. v-model="dataDetails.driverCall" maxlength="1">
  67. </u--input>
  68. <view class="flex align-center" v-if="dataDetails.driverSex=='男'">先生</view>
  69. <view class="flex align-center" v-else>女士</view>
  70. </view>
  71. <view class="flex row noborder">
  72. <view class="left-text">联系电话</view>
  73. <u--input placeholder="请输入联系电话" inputAlign='left' border="none" v-model="dataDetails.driverPhone"
  74. maxlength="11">
  75. </u--input>
  76. </view>
  77. <view class="flex row noborder" v-if="dataDetails.driverPhone!=userInfo.phone">
  78. <view class="left-text">验证码</view>
  79. <u--input v-model="dataDetails.verifyCode" border="none" placeholder="请填写验证码"></u--input>
  80. <view class="yzm">
  81. <u-code :seconds="seconds" @end="end" @start="start" ref="uCode" @change="codeChange"></u-code>
  82. <u-button class="yzm-btn" @tap="getCode">{{tips}}</u-button>
  83. </view>
  84. </view>
  85. </view>
  86. <view v-if="isFirstAuthentication" class="content1-car">
  87. <!--<view class="flex s-row carlist-item" v-for="(item,index) in dataDetails.hyDriverCarInfoList"
  88. :key='index'>
  89. <view class="flex row">
  90. <view class="left left-text">
  91. 车牌号-{{index+1}}
  92. </view>
  93. <view class="right flex">
  94. <input class="car-uumber" v-model='item.carNumber' @click.stop="handleShowKeyboard(index)"
  95. :disabled="true" placeholder="输入车牌号" name="input"></input>
  96. <view @click="delCarNumber(dataDetails.hyDriverCarInfoList,index)" class="" v-if="index!=0">
  97. <image class='del-car' src="@/static/images/common/quxiao@2x.png">
  98. </image>
  99. </view>
  100. </view>
  101. </view>
  102. <view class="flex row">
  103. <view class="left-text">车牌颜色</view>
  104. <view class="color" @click="selectNoColor">{{item.carNumberColour}}
  105. </view>
  106. <view>></view>
  107. <u-picker :show="carColor" :columns="colorColumns" :closeOnClickOverlay='true'
  108. @close='colorClose' @cancel='colorClose' @confirm='confirmColor($event,item)'></u-picker>
  109. </view>
  110. <view class="flex row">
  111. <view class="left-text">车型</view>
  112. <view class="color" @click="selectCarModel">{{item.carType}}</view>
  113. <view>></view>
  114. <u-picker ref="carTypePicker" :show="carModel" :columns="carModelColumns"
  115. :closeOnClickOverlay='true' @close='carModelClose' @cancel='carModelClose'
  116. @confirm='confirmCarModel($event,item)' @change="changeCarModel"></u-picker>
  117. </view>
  118. <view class="flex row">
  119. <view class="left-text">总质量(千克)</view>
  120. <u--input placeholder="输入总质量" inputAlign='left' type="number" border="none" v-model="item.carTotalWeight">
  121. </u--input>
  122. </view>
  123. <view class="flex row">
  124. <view class="left-text">核定载质量(千克)</view>
  125. <u--input placeholder="输入核定载质量" inputAlign='left' type="number" border="none"
  126. v-model="item.carApprovedWeight">
  127. </u--input>
  128. </view>
  129. <view class="flex row noborder">
  130. <view class="left-text">外廓尺寸</view>
  131. </view>
  132. <view class="flex row noborder input-ckg">
  133. <view class="input-positon">
  134. <u--input class="input" placeholder="长" type="number" inputAlign='left' border="none"
  135. v-model="item.carLong">
  136. </u--input>
  137. <view class="position-right">
  138. mm
  139. </view>
  140. </view>
  141. <view class="star">*</view>
  142. <view class="input-positon">
  143. <u--input placeholder="宽" type="number" inputAlign='left' border="none" v-model="item.carWidth">
  144. </u--input>
  145. <view class="position-right">
  146. mm
  147. </view>
  148. </view>
  149. <view class="star">*</view>
  150. <view class="input-positon">
  151. <u--input placeholder="高" inputAlign='left' type="number" border="none" v-model="item.carHeight">
  152. </u--input>
  153. <view class="position-right">
  154. mm
  155. </view>
  156. </view>
  157. </view>
  158. <view class="flex row noborder s-row">
  159. <view class="left-text">人车合影-{{index+1}}</view>
  160. <u-upload class="uview-upload" :fileList="item.fileList1" @afterRead="afterRead($event,item)"
  161. @delete="deletePic" name="1" multiple :maxCount="1"></u-upload>
  162. <!-- <view @click="uploadImg(0,index)" class="picture" v-if='!item.addressUrl'>
  163. <image class="xj-image" src="@/static/images/common/tianjiazhaopian@2x.png"
  164. ></image>
  165. </view> -->
  166. <!-- <image class="preview-img" :src="item.addressUrl" v-if='item.addressUrl'></image> -->
  167. <!--</view>
  168. </view> -->
  169. </view>
  170. <!-- <view v-if="isFirstAuthentication" @click="addCarNumber(dataDetails.hyDriverCarInfoList)" class="add-car">
  171. <u-icon class="icon" name="plus-circle-fill" color="#2979ff" size="28"></u-icon>
  172. <view class="car-text">
  173. 添加车辆
  174. </view>
  175. </view> -->
  176. <view class="" style="color: red;font-size: 26rpx;margin-top: 20rpx;">*收款人须为司机本人</view>
  177. <view class="content3 flex s-row" v-for="(item,index) in dataDetails.hyDriverPayeeInfoList" :key='index'>
  178. <view class="flex">
  179. 银行卡-{{index+1}}
  180. </view>
  181. <view @click="delBankNumber(dataDetails.hyDriverPayeeInfoList,index)" class="" v-if="index!=0">
  182. <image class='del-bank' src="@/static/images/common/quxiao@2x.png">
  183. </image>
  184. </view>
  185. <view class="title">上传银行卡卡号页</view>
  186. <view @click="uploadImg(3,index)" class="picture picture3" v-if="!item.payeeAddressUrl">
  187. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  188. <view class="text">上传银行卡卡号页</view>
  189. </view>
  190. <view v-if="item.payeeAddressUrl" @click.stop="uploadImg(3,index)" class="preview-card-img picture">
  191. <!-- <image class="card-img" :src="dataDetails.cardAddressUrl"></image> -->
  192. <view @click.stop="delCard(3)">
  193. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  194. </image>
  195. </view>
  196. <image class="" :src="item.payeeAddressUrl" mode="aspectFit"></image>
  197. </view>
  198. <view class="flex row">
  199. <view class="left-text">银行卡卡号</view>
  200. <view class="flex">
  201. <u--input placeholder="输入银行卡号码" inputAlign='left' border="none" v-model="item.bankCard">
  202. </u--input>
  203. </view>
  204. </view>
  205. <view class="flex row">
  206. <view class="left-text">开户行</view>
  207. <u--input placeholder="输入开户行" inputAlign='left' border="none" v-model="item.bankDeposit">
  208. </u--input>
  209. </view>
  210. <view class="flex row">
  211. <view class="left-text khzh-styel">开户支行</view>
  212. <view class="flex" v-if="isShowManualInput">
  213. <u--input class="select-bankzh" placeholder="输入开户支行" inputAlign='left' border="none"
  214. v-model="item.bankDepositBranch">
  215. </u--input>
  216. <view @click="manualInput" class="type">选择支行</view>
  217. </view>
  218. <view class="flex" v-if="!isShowManualInput">
  219. <view class="select-bankzh point" @click="selectZhbank">
  220. {{item.bankDepositBranch?item.bankDepositBranch:'选择开户支行'}}
  221. </view>
  222. <view @click="manualInput" class="type">手动输入</view>
  223. </view>
  224. </view>
  225. <view class="flex row noborder">
  226. <view class="left-text">收款人</view>
  227. <view class="flex">
  228. <u--input placeholder="输入收款人姓名" inputAlign='left' border="none" v-model="item.payeeName">
  229. </u--input>
  230. </view>
  231. </view>
  232. <u-picker :show="isShowBank" :columns="bankType[index]" :closeOnClickOverlay='true' @close='zhBankClose'
  233. @cancel='zhBankClose' @confirm='confirmBank'></u-picker>
  234. </u-picker>
  235. </view>
  236. <view @click="addBankNumber(dataDetails.hyDriverPayeeInfoList)" class="add-car">
  237. <u-icon class="icon" name="plus-circle-fill" color="#2979ff" size="28"></u-icon>
  238. <view class="car-text">
  239. 添加银行卡
  240. </view>
  241. </view>
  242. <master-keyboard ref="keyboard" keyboardtype="car" :show="keyShow" :randomNumber="true" :newCar="false"
  243. :defaultValue="carNumber" @keyboardClick="handleClick"></master-keyboard>
  244. <u-action-sheet :actions="$helper.imgTypeList" :title="$helper.imgType" :show="isShowimgType"
  245. @select="imgTypeSelect" :closeOnClickOverlay="true" :closeOnClickAction="true"
  246. @close="isShowimgType=false">
  247. </u-action-sheet>
  248. <u-toast ref="uToast"></u-toast>
  249. </view>
  250. <view class="content4">
  251. <view class="next-btn" @click="next()">下一步</view>
  252. </view>
  253. </view>
  254. </template>
  255. <script>
  256. import keyboard from "@/components/master-keyboard/master-keyboard.vue";
  257. import upload from '@/components/upload.vue';
  258. import uploadImage from '@/components/ossutil/uploadFile.js';
  259. var _this
  260. import {
  261. mapState
  262. } from 'vuex';
  263. export default {
  264. components: {
  265. keyboard,
  266. upload
  267. },
  268. data() {
  269. return {
  270. canvasSiz: {
  271. width: 188,
  272. height: 273
  273. },
  274. tips: '',
  275. // refCode: null,
  276. seconds: 30,
  277. carModelColumns: [
  278. ['挂车', '非挂车'],
  279. ['高栏', '集装箱', '自卸车']
  280. ],
  281. carModelColumnData: [
  282. ['高栏', '集装箱', '自卸车'],
  283. ['重型仓栏']
  284. ],
  285. colorColumns: [
  286. ['黄色', '蓝色']
  287. ],
  288. carColor: false,
  289. carModel: false,
  290. radiolist1: [{
  291. name: '男',
  292. disabled: false
  293. },
  294. {
  295. name: '女',
  296. disabled: false
  297. },
  298. ],
  299. isFirstAuthentication: true,
  300. bankType: [],
  301. isShowBank: false,
  302. isShowManualInput: false,
  303. index: '',
  304. validityPeriod: [],
  305. isShowcardValidity: false,
  306. uploadType: '',
  307. isShowimgType: false,
  308. // uploadOptions1: {
  309. // "text": "上传身份证头像页",
  310. // "bgc": "https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/identityup%282%29.png"
  311. // },
  312. // uploadOptions2: {
  313. // "text": "上传身份证国徽页",
  314. // "bgc": "https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/identitylow%282%29.png"
  315. // },
  316. // uploadOptions3: {
  317. // "text": "上传银行卡正面",
  318. // "bgc": "https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/bankup%282%29.png"
  319. // },
  320. dataDetails: {
  321. commonId: '',
  322. driverName: '',
  323. driverSex: '男',
  324. driverCall: '',
  325. driverPhone: '',
  326. numberCard: '',
  327. cardAddressUrl: '',
  328. cardBackAddressUrl: '',
  329. cardValidityDate: '',
  330. driverType: '',
  331. driverLicenseHomePage: '',
  332. driverLicenseBackPage: '',
  333. driverLicenseValidityDate: '',
  334. drivingLicenseHomePage: '',
  335. drivingLicenseBackPage: '',
  336. drivingLicenseValidityDate: '',
  337. trailerLicenseHomePage: '',
  338. trailerLicenseBackPage: '',
  339. trailerLicenseValidityDate: '',
  340. qualificationCertificate: '',
  341. qualificationCertificateValidityDate: '',
  342. operationCertificate: '',
  343. operationCertificateValidityDate: '',
  344. trailerOperationCertificate: '',
  345. trailerOperationCertificateValidityDate: '',
  346. hyDriverCarInfoList: [{
  347. carNumber: '',
  348. addressUrl: '',
  349. carNumberColour: '黄色',
  350. carType: '',
  351. carTotalWeight: '',
  352. carApprovedWeight: '',
  353. carLong: '',
  354. carWidth: '',
  355. carHeight: '',
  356. fileList1: []
  357. }],
  358. hyDriverPayeeInfoList: [{
  359. payeeAddressUrl: '',
  360. bankCard: '',
  361. bankDeposit: '',
  362. bankDepositBranch: '',
  363. payeeName: ''
  364. }],
  365. },
  366. keyShow: false,
  367. carNumber: '',
  368. action: this.$helper.ossUploadUrl,
  369. // maxSize: 50 * 1024 * 1024, //限制文件大小 50M
  370. // isAdd: true,
  371. imagesrc: null,
  372. };
  373. },
  374. onLoad() {
  375. _this = this;
  376. console.log(this.userInfo)
  377. //获取截止日期List数据
  378. this.validityPeriod = this.$helper.makeValidityPeriod(0)
  379. this.dataDetails.driverPhone = this.userInfo.phone
  380. this.dataDetails.commonId = this.userInfo.id
  381. //获取认证状态
  382. this.getAuthenticationStatus()
  383. },
  384. computed: {
  385. ...mapState(['hasLogin', 'userInfo']),
  386. },
  387. methods: {
  388. delCard(type) {
  389. switch (type) {
  390. // 人车合影
  391. // case 0:
  392. // //赋值上传图片图片路径
  393. // _this.dataDetails.driverCarInfoList[_this.index].addressUrl =
  394. // result
  395. // break
  396. // 身份正面
  397. case 1:
  398. _this.dataDetails.cardAddressUrl = ''
  399. break
  400. // 身份反面
  401. case 2:
  402. _this.dataDetails.cardBackAddressUrl = ''
  403. break
  404. // 银行卡
  405. case 3:
  406. _this.dataDetails.hyDriverPayeeInfoList[_this.index].payeeAddressUrl = ''
  407. break;
  408. }
  409. },
  410. // 删除图片
  411. deletePic(event, val) {
  412. val[`fileList${event.name}`].splice(event.index, 1)
  413. },
  414. // 新增图片
  415. async afterRead(event, val) {
  416. // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
  417. let lists = [].concat(event.file)
  418. let fileListLen = val[`fileList${event.name}`].length
  419. lists.map((item) => {
  420. val[`fileList${event.name}`].push({
  421. ...item,
  422. status: 'uploading',
  423. message: '上传中'
  424. })
  425. })
  426. for (let i = 0; i < lists.length; i++) {
  427. const result = await this.uploadFilePromise(lists[i].url, val)
  428. let item = val[`fileList${event.name}`][fileListLen]
  429. val[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
  430. status: 'success',
  431. message: '',
  432. url: result
  433. }))
  434. fileListLen++
  435. }
  436. },
  437. uploadFilePromise(url, val) {
  438. uploadImage(url, 'appData/',
  439. result => {
  440. // 上传成功回调函数
  441. console.log('图片地址', result)
  442. val.addressUrl += result
  443. }
  444. )
  445. // return new Promise((resolve, reject) => {
  446. // let a = uploadImage()
  447. // let a = uni.uploadFile({
  448. // url: 'http://192.168.2.21:7001/upload', // 仅为示例,非真实的接口地址
  449. // filePath: url,
  450. // name: 'file',
  451. // formData: {
  452. // user: 'test'
  453. // },
  454. // success: (res) => {
  455. // setTimeout(() => {
  456. // resolve(res.data.data)
  457. // }, 1000)
  458. // }
  459. // });
  460. // })
  461. },
  462. // 车型切换
  463. changeCarModel(e) {
  464. const {
  465. columnIndex,
  466. index,
  467. // 微信小程序无法将picker实例传出来,只能通过ref操作
  468. picker = this.$refs.carTypePicker
  469. } = e
  470. if (columnIndex === 0) {
  471. // 模拟网络请求
  472. picker.setColumnValues(1, this.carModelColumnData[index])
  473. }
  474. },
  475. codeChange(text) {
  476. this.tips = text;
  477. },
  478. getCode() {
  479. if (/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.dataDetails.driverPhone)) {
  480. if (this.$refs.uCode.canGetCode) {
  481. // 模拟向后端请求验证码
  482. uni.showLoading({
  483. title: '正在获取验证码'
  484. })
  485. _this.$request.baseRequest('get', '/commonUser/sendVerifyCode', {
  486. phone: this.dataDetails.driverPhone
  487. }).then(res => {
  488. uni.hideLoading();
  489. // 这里此提示会被this.start()方法中的提示覆盖
  490. uni.$u.toast('验证码已发送');
  491. // 通知验证码组件内部开始倒计时
  492. this.$refs.uCode.start();
  493. })
  494. .catch(res => {
  495. uni.$u.toast(res.message);
  496. });
  497. // setTimeout(() => {
  498. // }, 2000);
  499. } else {
  500. uni.$u.toast('倒计时结束后再发送');
  501. }
  502. } else {
  503. uni.$u.toast('请输入正确手机号');
  504. }
  505. },
  506. end() {
  507. // uni.$u.toast('倒计时结束');
  508. },
  509. start() {
  510. // uni.$u.toast('倒计时开始');
  511. },
  512. // 确认颜色
  513. confirmColor(val, val1) {
  514. console.log(val)
  515. val1.carNumberColour = val.value[0]
  516. this.carColor = false
  517. },
  518. colorClose() {
  519. this.carColor = false
  520. },
  521. //选择车牌号颜色
  522. selectNoColor() {
  523. this.carColor = true
  524. },
  525. confirmCarModel(val, val1) {
  526. val1.carType = val.value[0] + ' ' + val.value[1]
  527. this.carModel = false
  528. },
  529. carModelClose() {
  530. this.carModel = false
  531. },
  532. selectCarModel() {
  533. this.carModel = true
  534. },
  535. // 性别切换
  536. radioChange(n) {
  537. console.log('radioChange', n);
  538. this.dataDetails.driverSex = n
  539. },
  540. //判断是否是初次认证
  541. getAuthenticationStatus() {
  542. this.$request.baseRequest('', '/driverInfo/firstAuthentication', {
  543. driverPhone: this.userInfo.phone,
  544. }).then(res => {
  545. if (res.data) {
  546. this.isFirstAuthentication = false
  547. } else {
  548. this.isFirstAuthentication = true
  549. }
  550. //
  551. //
  552. })
  553. .catch(res => {
  554. uni.$u.toast(res.message);
  555. });
  556. },
  557. zhBankClose() {
  558. this.isShowBank = false
  559. },
  560. // 选择支行
  561. selectZhbank() {
  562. if (uni.$u.test.isEmpty(this.bankType[this.index])) {
  563. this.$refs.uToast.show({
  564. type: 'error',
  565. message: "请先上传银行卡!",
  566. })
  567. return true
  568. }
  569. this.isShowBank = true
  570. },
  571. confirmBank(e) {
  572. console.log(e)
  573. this.dataDetails.hyDriverPayeeInfoList[this.index].bankDepositBranch = e.value[0]
  574. this.isShowBank = false
  575. },
  576. manualInput() {
  577. if (this.isShowManualInput) {
  578. if (uni.$u.test.isEmpty(this.bankType[this.index])) {
  579. this.$refs.uToast.show({
  580. type: 'error',
  581. message: "请先上传银行卡!",
  582. })
  583. return true
  584. }
  585. this.isShowBank = true
  586. } else {
  587. this.isShowBank = false
  588. }
  589. this.isShowManualInput = !this.isShowManualInput
  590. },
  591. changeHandler(e) {
  592. const {
  593. columnIndex,
  594. value,
  595. values,
  596. index,
  597. picker = this.$refs.uPicker
  598. } = e
  599. // if (columnIndex === 0) {
  600. // debugger
  601. // if (e.index != 0) {
  602. // picker.setColumnValues(1, this.validityPeriod[1].shift())
  603. // }
  604. // } else if (columnIndex === 1) {
  605. // if (e.index != 0) {
  606. // picker.setColumnValues(2, this.validityPeriod[2].shift())
  607. // }
  608. // }
  609. },
  610. // 回调参数为包含columnIndex、value、values
  611. confirmValidityPeriod(e) {
  612. console.log('confirm', e)
  613. if (e.value[0] == '长期') {
  614. this.dataDetails.cardValidityDate = e.value[0]
  615. } else {
  616. this.dataDetails.cardValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  617. }
  618. this.isShowcardValidity = false
  619. },
  620. selectValidityPeriod() {
  621. this.isShowcardValidity = true
  622. },
  623. //设置图片
  624. setImage(e) {
  625. console.log(e);
  626. //显示在页面
  627. //this.imagesrc = e.path;
  628. if (e.dotype == 'idphoto') {
  629. _this.zjzClipper(e.path);
  630. } else if (e.dotype == 'watermark') {
  631. _this.watermark(e.path);
  632. } else {
  633. _this.savePhoto(e.path);
  634. }
  635. },
  636. //保存图片到相册,方便核查
  637. savePhoto(path) {
  638. this.imagesrc = path;
  639. // this.dataDetails.cardAddressUrl = path
  640. uploadImage(path, 'appData/',
  641. result => {
  642. // 上传成功
  643. console.log('图片地址', result)
  644. this.dataDetails.cardAddressUrl = result
  645. }
  646. )
  647. },
  648. uploadImg(type, index) {
  649. this.uploadType = type
  650. // this.isShowimgType = true
  651. this.imgTypeSelect()
  652. this.index = index
  653. },
  654. // 上传图片
  655. imgTypeSelect(val) {
  656. // if (val.name == '相册') {
  657. uni.chooseImage({
  658. count: 1,
  659. // sourceType: this.$helper.chooseImage.sourceType,
  660. success: function(res) {
  661. console.log(JSON.stringify(res.tempFilePaths));
  662. uploadImage('image', res.tempFilePaths[0], 'appData/',
  663. result => {
  664. // 上传成功回调函数
  665. console.log('图片地址', result)
  666. switch (_this.uploadType) {
  667. // 身份正面
  668. case 1:
  669. _this.dataDetails.cardAddressUrl = result
  670. // 识别
  671. _this.$request.baseRequest('get',
  672. '/driverInfo/personShibie', {
  673. personImg: result,
  674. flag:1
  675. }).then(res => {
  676. _this.dataDetails.numberCard = res.data.recPersonNo
  677. if (res.data.recPerson) {
  678. _this.dataDetails.driverName = res.data.recPerson
  679. _this.dataDetails.driverCall = res.data.recPerson.substring(0,1)
  680. for (let i = 0; i < _this.dataDetails
  681. .hyDriverPayeeInfoList.length; i++
  682. ) { //收款人需与司机本人一致
  683. _this.dataDetails.hyDriverPayeeInfoList[i]
  684. .payeeName = res.data.recPerson
  685. }
  686. }
  687. })
  688. .catch(res => {
  689. uni.$u.toast(res.message);
  690. });
  691. break
  692. // 身份反面
  693. case 2:
  694. _this.dataDetails.cardBackAddressUrl = result
  695. // 识别
  696. _this.$request.baseRequest('get',
  697. '/driverInfo/personShibie', {
  698. personImg: result,
  699. flag:2
  700. }).then(res => {
  701. if(res.data.idCardValidity){
  702. let date = res.data.idCardValidity.split("-")[1]
  703. _this.dataDetails.cardValidityDate = date.replace('.', '-').replace('.', '-')
  704. }
  705. })
  706. .catch(res => {
  707. uni.$u.toast(res.message);
  708. });
  709. break
  710. // 银行卡
  711. case 3:
  712. _this.bankType[_this.index] = []
  713. _this.$request.baseRequest('get',
  714. '/driverInfo/bankShibie', {
  715. bankImg: result,
  716. }).then(res => {
  717. console.log(res)
  718. _this.dataDetails.hyDriverPayeeInfoList[_this
  719. .index]
  720. .payeeAddressUrl = result
  721. if (res.data.bankNo) {
  722. _this.dataDetails.hyDriverPayeeInfoList[_this
  723. .index].bankCard = res.data.bankNo
  724. }
  725. if (res.data.bankName) {
  726. _this.dataDetails.hyDriverPayeeInfoList[_this
  727. .index].bankDeposit = res.data.bankName
  728. }
  729. // 开户支行LIst
  730. if (res.data.bankNameZhihang) {
  731. _this.bankType[_this.index].push(res.data
  732. .bankNameZhihang)
  733. }
  734. _this.$forceUpdate()
  735. })
  736. .catch(res => {
  737. uni.$u.toast(res.message);
  738. });
  739. break;
  740. }
  741. }
  742. )
  743. }
  744. });
  745. // }
  746. // else {
  747. // switch (this.uploadType) {
  748. // // case 0:
  749. // // console.log('人车合影')
  750. // // break
  751. // case 1:
  752. // uni.$u.route('/pages/mine/camera/idcard/idcard?dotype=idcardface');
  753. // console.log('身份正面')
  754. // break
  755. // case 2:
  756. // uni.$u.route('/pages/mine/camera/idcard/idcard?dotype=badge');
  757. // console.log('身份反面')
  758. // break
  759. // case 3:
  760. // uni.$u.route('/pages/mine/camera/idcard/idcard?dotype=bank');
  761. // console.log('银行卡')
  762. // break
  763. // case 4:
  764. // }
  765. // }
  766. },
  767. //车牌号弹出键盘
  768. handleClick(e) {
  769. this.carNumber = e.value
  770. this.dataDetails.hyDriverCarInfoList[this.index].carNumber = e.value //键盘输入值
  771. },
  772. //车牌号弹出键盘
  773. handleShowKeyboard(index) {
  774. if (this.dataDetails.hyDriverCarInfoList[index].carNumber == '') {
  775. this.carNumber = ''
  776. } else {
  777. this.carNumber = this.dataDetails.hyDriverCarInfoList[index].carNumber
  778. }
  779. if (this.$refs.keyboard.open) {
  780. this.$refs.keyboard.open(false) //true 键盘显示 false 键盘隐藏
  781. } else {
  782. this.$refs.keyboard[0].open(false)
  783. }
  784. this.index = index
  785. if (this.$refs.keyboard.open) {
  786. this.$refs.keyboard.open(true) //true 键盘显示 false 键盘隐藏
  787. } else {
  788. this.$refs.keyboard[0].open(true)
  789. }
  790. },
  791. addCarNumber(val) {
  792. val.push({
  793. carNumber: '',
  794. addressUrl: '',
  795. carNumberColour: '',
  796. carType: '',
  797. carTotalWeight: '',
  798. carApprovedWeight: '',
  799. carLong: '',
  800. carWidth: '',
  801. carHeight: '',
  802. fileList1: []
  803. })
  804. },
  805. delCarNumber(val, index) {
  806. if (val.length > 1) {
  807. val.splice(index, 1)
  808. this.$forceUpdate()
  809. } else {
  810. let params = {
  811. type: 'error',
  812. message: "至少保留一个车牌号!",
  813. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  814. }
  815. this.$refs.uToast.show({
  816. ...params
  817. })
  818. }
  819. },
  820. addBankNumber(val) {
  821. val.push({
  822. payeeAddressUrl: '',
  823. bankCard: '',
  824. bankDeposit: '',
  825. bankDepositBranch: '',
  826. payeeName: this.dataDetails.driverName ? this.dataDetails.driverName : ""
  827. })
  828. },
  829. delBankNumber(val, index) {
  830. if (val.length > 1) {
  831. val.splice(index, 1)
  832. this.$forceUpdate()
  833. } else {
  834. let params = {
  835. type: 'error',
  836. message: "至少保留一张银行卡!",
  837. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  838. }
  839. this.$refs.uToast.show({
  840. ...params
  841. })
  842. }
  843. },
  844. next(val) {
  845. if (this.validate()) return
  846. for (let i = 0; i < this.dataDetails.hyDriverPayeeInfoList.length; i++) {
  847. if (this.dataDetails.hyDriverPayeeInfoList[i].payeeName != this.dataDetails.driverName) {
  848. this.$refs.uToast.show({
  849. type: 'error',
  850. message: "收款人需与司机本人一致!",
  851. })
  852. return
  853. } else {
  854. // 银行卡验证
  855. this.$request.baseRequest('get', '/driverPayeeInfo/bankCradShibie', {
  856. name: this.dataDetails.hyDriverPayeeInfoList[i].payeeName,
  857. idCard: this.dataDetails.numberCard,
  858. accountNo: this.dataDetails.hyDriverPayeeInfoList[i].bankCard
  859. }).then(
  860. res => {
  861. if (res.data.distinguishNum != "01") { //不等于01 证明银行卡验证不通过
  862. // this.payCheck = false //验证开关
  863. uni.$u.toast(res.data.distinguish);
  864. }else{
  865. uni.$u.route('/pages/mine/driverCertificationNext', {
  866. data: JSON.stringify(this.dataDetails),
  867. });
  868. }
  869. })
  870. }
  871. }
  872. // if (this.payCheck) {
  873. // uni.$u.route('/pages/mine/driverCertificationNext', {
  874. // data: JSON.stringify(this.dataDetails),
  875. // });
  876. // }
  877. },
  878. validate() {
  879. // true 为校验不通过
  880. if (uni.$u.test.isEmpty(this.dataDetails.driverName)) {
  881. this.$refs.uToast.show({
  882. type: 'error',
  883. message: "司机姓名不能为空!",
  884. })
  885. return true
  886. }
  887. if (!uni.$u.test.chinese(this.dataDetails.driverName)) {
  888. this.$refs.uToast.show({
  889. type: 'error',
  890. message: "姓名为汉字!",
  891. })
  892. return true
  893. }
  894. if (uni.$u.test.isEmpty(this.dataDetails.driverPhone)) {
  895. this.$refs.uToast.show({
  896. type: 'error',
  897. message: "联系电话不能为空!",
  898. })
  899. return true
  900. }
  901. if (!uni.$u.test.mobile(this.dataDetails.driverPhone)) {
  902. this.$refs.uToast.show({
  903. type: 'error',
  904. message: "电话号码格式错误!",
  905. })
  906. return true
  907. }
  908. // for (let i = 0; i < this.dataDetails.hyDriverCarInfoList.length; i++) {
  909. // let _item = this.dataDetails.hyDriverCarInfoList[i]
  910. // if (uni.$u.test.isEmpty(_item.carNumber)) {
  911. // this.$refs.uToast.show({
  912. // type: 'error',
  913. // message: "车牌号不能为空!",
  914. // })
  915. // return true
  916. // }
  917. // if (uni.$u.test.isEmpty(_item.fileList1)) {
  918. // this.$refs.uToast.show({
  919. // type: 'error',
  920. // message: "人车合影不能为空!",
  921. // })
  922. // return true
  923. // }
  924. // }
  925. if (uni.$u.test.isEmpty(this.dataDetails.driverPhone)) {
  926. this.$refs.uToast.show({
  927. type: 'error',
  928. message: "身份证人像页不能为空!",
  929. })
  930. return true
  931. }
  932. if (uni.$u.test.isEmpty(this.dataDetails.driverPhone)) {
  933. this.$refs.uToast.show({
  934. type: 'error',
  935. message: "身份证国徽页不能为空!",
  936. })
  937. return true
  938. }
  939. if (uni.$u.test.isEmpty(this.dataDetails.cardValidityDate)) {
  940. this.$refs.uToast.show({
  941. type: 'error',
  942. message: "身份证人有效截止日期不能为空!",
  943. })
  944. return true
  945. }
  946. for (let i = 0; i < this.dataDetails.hyDriverPayeeInfoList.length; i++) {
  947. let _item = this.dataDetails.hyDriverPayeeInfoList[i]
  948. if (uni.$u.test.isEmpty(_item.payeeAddressUrl)) {
  949. this.$refs.uToast.show({
  950. type: 'error',
  951. message: "银行卡不能为空!",
  952. })
  953. return true
  954. }
  955. if (uni.$u.test.isEmpty(_item.bankCard)) {
  956. this.$refs.uToast.show({
  957. type: 'error',
  958. message: "银行卡号码不能为空!",
  959. })
  960. return true
  961. }
  962. if (uni.$u.test.isEmpty(_item.bankDeposit)) {
  963. this.$refs.uToast.show({
  964. type: 'error',
  965. message: "开户行不能为空!",
  966. })
  967. return true
  968. }
  969. if (uni.$u.test.isEmpty(_item.bankDepositBranch)) {
  970. this.$refs.uToast.show({
  971. type: 'error',
  972. message: "开户支行不能为空!",
  973. })
  974. return true
  975. }
  976. if (uni.$u.test.isEmpty(_item.payeeName)) {
  977. this.$refs.uToast.show({
  978. type: 'error',
  979. message: "收款人姓名不能为空!",
  980. })
  981. return true
  982. }
  983. }
  984. return false
  985. }
  986. },
  987. };
  988. </script>
  989. <style scoped lang="scss">
  990. /deep/.u-radio {
  991. margin-bottom: 0 !important;
  992. }
  993. .top-head {
  994. background: #2772FB;
  995. height: 80rpx;
  996. width: 100%;
  997. }
  998. .container {
  999. position: relative;
  1000. top: -60rpx;
  1001. margin: 0 20rpx;
  1002. }
  1003. .row4-img {
  1004. width: 32rpx;
  1005. height: 32rpx;
  1006. }
  1007. .content1,
  1008. .content2,
  1009. .content3 {
  1010. .left-text {
  1011. // background: red;
  1012. width: 290rpx;
  1013. color: #333333;
  1014. display: flex;
  1015. align-items: center;
  1016. }
  1017. .row {
  1018. border-bottom: 1px solid #EEEEEE;
  1019. padding-bottom: 28rpx;
  1020. margin-top: 26rpx;
  1021. .ch-style {}
  1022. }
  1023. .row-ch {
  1024. padding-right: 180rpx;
  1025. box-sizing: border-box;
  1026. // background-color: red;
  1027. }
  1028. }
  1029. .content1-car {
  1030. margin-top: 20rpx;
  1031. .left-text {
  1032. // background: red;
  1033. width: 290rpx;
  1034. color: #333333;
  1035. display: flex;
  1036. align-items: center;
  1037. }
  1038. .row {
  1039. border-bottom: 1px solid #EEEEEE;
  1040. padding-bottom: 28rpx;
  1041. margin-top: 26rpx;
  1042. .color {
  1043. // background: blue;
  1044. width: 340rpx;
  1045. }
  1046. }
  1047. }
  1048. .input-ckg {
  1049. height: 86rpx;
  1050. margin-top: 0 !important;
  1051. padding-bottom: 0 !important;
  1052. .u-input {
  1053. height: 100%;
  1054. background: #F7F8FA;
  1055. padding-left: 10rpx !important;
  1056. padding-right: 85rpx !important;
  1057. }
  1058. .star {
  1059. display: flex;
  1060. align-items: center;
  1061. margin: 0 10rpx;
  1062. }
  1063. .input-positon {
  1064. position: relative;
  1065. }
  1066. .position-right {
  1067. position: absolute;
  1068. right: 20rpx;
  1069. top: 0;
  1070. width: 60rpx;
  1071. height: 50rpx;
  1072. bottom: 0;
  1073. margin: auto;
  1074. }
  1075. }
  1076. .picture {
  1077. margin-top: 20rpx;
  1078. background: #F5F6FA;
  1079. width: 212rpx;
  1080. height: 212rpx;
  1081. border-radius: 20rpx;
  1082. display: flex;
  1083. flex-direction: column;
  1084. justify-content: center;
  1085. align-items: center;
  1086. color: #6A7282;
  1087. }
  1088. .add-car {
  1089. background: #FFFFFF;
  1090. margin: 20rpx 50rpx;
  1091. border-radius: 50rpx;
  1092. display: flex;
  1093. justify-content: center;
  1094. align-items: center;
  1095. padding: 20rpx 0;
  1096. .icon {
  1097. margin-right: 20rpx;
  1098. }
  1099. .car-text {
  1100. font-size: 36rpx;
  1101. font-weight: 700;
  1102. color: #2772FB;
  1103. }
  1104. }
  1105. .carlist-item {
  1106. margin-top: 20rpx;
  1107. padding: 0 20rpx 20rpx 20rpx;
  1108. background: white;
  1109. border-radius: 10rpx;
  1110. position: relative;
  1111. .del-car {
  1112. position: absolute;
  1113. top: 0;
  1114. right: 0;
  1115. width: 80rpx;
  1116. height: 80rpx;
  1117. }
  1118. }
  1119. .content2,
  1120. .content3 {
  1121. .del-bank {
  1122. position: absolute;
  1123. top: 0;
  1124. right: 0;
  1125. width: 80rpx;
  1126. height: 80rpx;
  1127. }
  1128. .picture {
  1129. width: 100%;
  1130. height: 440rpx;
  1131. // background: red;
  1132. position: relative;
  1133. .text {
  1134. margin-top: 20rpx;
  1135. }
  1136. }
  1137. .picture1 {
  1138. background: url(../../static/images/mine/zm.png);
  1139. background-size: 100% 100%;
  1140. }
  1141. .picture2 {
  1142. background: url(../../static/images/mine/gh.png);
  1143. background-size: 100% 100%;
  1144. }
  1145. .picture3 {
  1146. background: url(../../static/images/mine/yhkzm.png);
  1147. background-size: 100% 100%;
  1148. }
  1149. .xj-image {
  1150. width: 100rpx;
  1151. height: 100rpx;
  1152. }
  1153. .title {
  1154. color: #999999;
  1155. margin: 20rpx 0;
  1156. }
  1157. }
  1158. .content3 {
  1159. position: relative;
  1160. background: white;
  1161. margin: 20rpx 0 0 0;
  1162. border-radius: 10rpx;
  1163. padding: 20rpx;
  1164. .khzh-styel {
  1165. // width: 350rpx;
  1166. }
  1167. .type {
  1168. background: #2772FB;
  1169. border-radius: 10rpx;
  1170. color: white;
  1171. box-sizing: border-box;
  1172. padding: 4rpx 10rpx;
  1173. font-size: 26rpx;
  1174. display: flex;
  1175. justify-content: center;
  1176. align-items: center;
  1177. }
  1178. .select-bankzh {
  1179. width: 230rpx;
  1180. height: 48rpx;
  1181. }
  1182. }
  1183. .content4 {
  1184. display: flex;
  1185. justify-content: center;
  1186. background: white;
  1187. padding: 40rpx 20rpx 50rpx 20rpx;
  1188. .next-btn {
  1189. background: #22C572;
  1190. width: 90%;
  1191. padding: 20rpx 20rpx;
  1192. text-align: center;
  1193. color: #FFFFFF;
  1194. border-radius: 50rpx;
  1195. }
  1196. }
  1197. .yzm {}
  1198. .yzm-btn {
  1199. background: #2772FB;
  1200. color: white;
  1201. height: 60rpx;
  1202. }
  1203. .preview-card-img {
  1204. /deep/uni-image>div,
  1205. uni-image>img {
  1206. // transform: scale(1.5) rotate(-90deg);
  1207. }
  1208. }
  1209. .del-card {
  1210. position: absolute;
  1211. top: -10rpx;
  1212. right: -6rpx;
  1213. width: 80rpx;
  1214. height: 80rpx;
  1215. z-index: 9;
  1216. }
  1217. </style>