driverCertification.vue 34 KB

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