driverCertification.vue 33 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250
  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. </u--input>
  31. </view>
  32. <view class="flex row noborder" v-if="dataDetails.driverPhone!=userInfo.phone">
  33. <view class="left-text">验证码</view>
  34. <u--input v-model="dataDetails.verifyCode" border="none" placeholder="请填写验证码"></u--input>
  35. <view class="yzm">
  36. <u-code :seconds="seconds" @end="end" @start="start" ref="uCode" @change="codeChange"></u-code>
  37. <u-button class="yzm-btn" @tap="getCode">{{tips}}</u-button>
  38. </view>
  39. </view>
  40. </view>
  41. <view v-if="isFirstAuthentication" class="content1-car">
  42. <view class="flex s-row carlist-item" v-for="(item,index) in dataDetails.driverCarInfoList"
  43. :key='index'>
  44. <view class="flex row">
  45. <view class="left left-text">
  46. 车牌号-{{index+1}}
  47. </view>
  48. <view class="right flex">
  49. <input class="car-uumber" v-model='item.carNumber' @click.stop="handleShowKeyboard(index)"
  50. :disabled="true" placeholder="输入车牌号" name="input"></input>
  51. <view @click="delCarNumber(dataDetails.driverCarInfoList,index)" class="" v-if="index!=0">
  52. <image class='del-car' src="@/static/images/common/quxiao@2x.png">
  53. </image>
  54. </view>
  55. </view>
  56. </view>
  57. <view class="flex row">
  58. <view class="left-text">车牌颜色</view>
  59. <view class="color" @click="selectNoColor">{{item.carNumberColour}}
  60. </view>
  61. <view>></view>
  62. <u-picker :show="carColor" :columns="colorColumns" :closeOnClickOverlay='true'
  63. @close='colorClose' @cancel='colorClose' @confirm='confirmColor($event,item)'></u-picker>
  64. </view>
  65. <view class="flex row">
  66. <view class="left-text">车型</view>
  67. <view class="color" @click="selectCarModel">{{item.carType}}</view>
  68. <view>></view>
  69. <u-picker ref="carTypePicker" :show="carModel" :columns="carModelColumns"
  70. :closeOnClickOverlay='true' @close='carModelClose' @cancel='carModelClose'
  71. @confirm='confirmCarModel($event,item)' @change="changeCarModel"></u-picker>
  72. </view>
  73. <view class="flex row">
  74. <view class="left-text">总质量(千克)</view>
  75. <u--input placeholder="输入总质量" inputAlign='left' type="number" border="none" v-model="item.carTotalWeight">
  76. </u--input>
  77. </view>
  78. <view class="flex row">
  79. <view class="left-text">核定载质量(千克)</view>
  80. <u--input placeholder="输入核定载质量" inputAlign='left' type="number" border="none"
  81. v-model="item.carApprovedWeight">
  82. </u--input>
  83. </view>
  84. <view class="flex row noborder">
  85. <view class="left-text">外廓尺寸</view>
  86. </view>
  87. <view class="flex row noborder input-ckg">
  88. <view class="input-positon">
  89. <u--input class="input" placeholder="长" type="number" inputAlign='left' border="none"
  90. v-model="item.carLong">
  91. </u--input>
  92. <view class="position-right">
  93. mm
  94. </view>
  95. </view>
  96. <view class="star">*</view>
  97. <view class="input-positon">
  98. <u--input placeholder="宽" type="number" inputAlign='left' border="none" v-model="item.carWidth">
  99. </u--input>
  100. <view class="position-right">
  101. mm
  102. </view>
  103. </view>
  104. <view class="star">*</view>
  105. <view class="input-positon">
  106. <u--input placeholder="高" inputAlign='left' type="number" border="none" v-model="item.carHeight">
  107. </u--input>
  108. <view class="position-right">
  109. mm
  110. </view>
  111. </view>
  112. </view>
  113. <view class="flex row noborder s-row">
  114. <view class="left-text">人车合影-{{index+1}}</view>
  115. <u-upload class="uview-upload" :fileList="item.fileList1" @afterRead="afterRead($event,item)"
  116. @delete="deletePic" name="1" multiple :maxCount="1"></u-upload>
  117. <!-- <view @click="uploadImg(0,index)" class="picture" v-if='!item.addressUrl'>
  118. <image class="xj-image" src="@/static/images/common/tianjiazhaopian@2x.png"
  119. ></image>
  120. </view> -->
  121. <!-- <image class="preview-img" :src="item.addressUrl" v-if='item.addressUrl'></image> -->
  122. </view>
  123. </view>
  124. </view>
  125. <view v-if="isFirstAuthentication" @click="addCarNumber(dataDetails.driverCarInfoList)" class="add-car">
  126. <u-icon class="icon" name="plus-circle-fill" color="#2979ff" size="28"></u-icon>
  127. <view class="car-text">
  128. 添加车辆
  129. </view>
  130. </view>
  131. <view class="content2 content-other">
  132. <view class="title">上传身份证人像面</view>
  133. <view @click.stop="uploadImg(1,index)" class="picture picture1" v-if="!dataDetails.cardAddressUrl">
  134. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  135. <view class="text">上传身份证人像面</view>
  136. </view>
  137. <view v-if="dataDetails.cardAddressUrl" @click.stop="uploadImg(1,index)"
  138. class="preview-card-img picture">
  139. <!-- <image class="card-img" :src="dataDetails.cardAddressUrl"></image> -->
  140. <view @click.stop="delCard(1)">
  141. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  142. </image>
  143. </view>
  144. <image class="" :src="dataDetails.cardAddressUrl" mode="aspectFit" style=""></image>
  145. </view>
  146. <view class="title">上传身份证国徽面</view>
  147. <view @click="uploadImg(2,index)" class="picture picture2" v-if="!dataDetails.cardBackAddressUrl">
  148. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  149. <view class="text">上传身份证国徽面</view>
  150. </view>
  151. <view v-if="dataDetails.cardBackAddressUrl" @click.stop="uploadImg(2,index)"
  152. class="preview-card-img picture">
  153. <!-- <image class="card-img" :src="dataDetails.cardAddressUrl"></image> -->
  154. <view @click.stop="delCard(2)">
  155. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  156. </image>
  157. </view>
  158. <image class="" :src="dataDetails.cardBackAddressUrl" mode="aspectFit"></image>
  159. </view>
  160. <view class="flex row">
  161. <view class="left-text">身份证号</view>
  162. <u--input placeholder="请输入身份证号" inputAlign='left' border="none" v-model="dataDetails.numberCard">
  163. </u--input>
  164. </view>
  165. <view class="flex row noborder">
  166. <view class="left-text">身份证截止日期</view>
  167. <view class="" @click="selectValidityPeriod">
  168. {{dataDetails.cardValidityDate?dataDetails.cardValidityDate:'选择身份证截止日期>'}}
  169. </view>
  170. </view>
  171. <u-picker :show="isShowcardValidity" ref="uPicker" :columns="validityPeriod"
  172. @confirm="confirmValidityPeriod" @change="changeHandler">
  173. </u-picker>
  174. </view>
  175. <view class="content3 flex s-row" v-for="(item,index) in dataDetails.driverPayeeInfoList" :key='index'>
  176. <view class="flex">
  177. 银行卡-{{index+1}}
  178. </view>
  179. <view @click="delBankNumber(dataDetails.driverPayeeInfoList,index)" class="" v-if="index!=0">
  180. <image class='del-bank' src="@/static/images/common/quxiao@2x.png">
  181. </image>
  182. </view>
  183. <view class="title">上传银行卡卡号页</view>
  184. <view @click="uploadImg(3,index)" class="picture picture3" v-if="!item.payeeAddressUrl">
  185. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  186. <view class="text">上传银行卡卡号页</view>
  187. </view>
  188. <view v-if="item.payeeAddressUrl" @click.stop="uploadImg(3,index)" class="preview-card-img picture">
  189. <!-- <image class="card-img" :src="dataDetails.cardAddressUrl"></image> -->
  190. <view @click.stop="delCard(3)">
  191. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  192. </image>
  193. </view>
  194. <image class="" :src="item.payeeAddressUrl" mode="aspectFit"></image>
  195. </view>
  196. <view class="flex row">
  197. <view class="left-text">银行卡卡号</view>
  198. <view class="flex">
  199. <u--input placeholder="输入银行卡号码" inputAlign='left' border="none" v-model="item.bankCard">
  200. </u--input>
  201. </view>
  202. </view>
  203. <view class="flex row">
  204. <view class="left-text">开户行</view>
  205. <u--input placeholder="输入开户行" inputAlign='left' border="none" v-model="item.bankDeposit">
  206. </u--input>
  207. </view>
  208. <view class="flex row">
  209. <view class="left-text khzh-styel">开户支行</view>
  210. <view class="flex" v-if="isShowManualInput">
  211. <u--input class="select-bankzh" placeholder="输入开户支行" inputAlign='left' border="none"
  212. v-model="item.bankDepositBranch">
  213. </u--input>
  214. <view @click="manualInput" class="type">选择支行</view>
  215. </view>
  216. <view class="flex" v-if="!isShowManualInput">
  217. <view class="select-bankzh point" @click="selectZhbank">
  218. {{item.bankDepositBranch?item.bankDepositBranch:'选择开户支行'}}
  219. </view>
  220. <view @click="manualInput" class="type">手动输入</view>
  221. </view>
  222. </view>
  223. <view class="flex row noborder">
  224. <view class="left-text">收款人</view>
  225. <view class="flex">
  226. <u--input placeholder="输入收款人姓名" inputAlign='left' border="none" v-model="item.payeeName">
  227. </u--input>
  228. </view>
  229. </view>
  230. <u-picker :show="isShowBank" :columns="bankType[index]" :closeOnClickOverlay='true' @close='zhBankClose'
  231. @cancel='zhBankClose' @confirm='confirmBank'></u-picker>
  232. </u-picker>
  233. </view>
  234. <view @click="addBankNumber(dataDetails.driverPayeeInfoList)" class="add-car">
  235. <u-icon class="icon" name="plus-circle-fill" color="#2979ff" size="28"></u-icon>
  236. <view class="car-text">
  237. 添加银行卡
  238. </view>
  239. </view>
  240. <master-keyboard ref="keyboard" keyboardtype="car" :show="keyShow" :randomNumber="true" :newCar="false"
  241. :defaultValue="carNumber" @keyboardClick="handleClick"></master-keyboard>
  242. <u-action-sheet :actions="$helper.imgTypeList" :title="$helper.imgType" :show="isShowimgType"
  243. @select="imgTypeSelect" :closeOnClickOverlay="true" :closeOnClickAction="true"
  244. @close="isShowimgType=false">
  245. </u-action-sheet>
  246. <u-toast ref="uToast"></u-toast>
  247. </view>
  248. <view class="content4">
  249. <view class="next-btn" @click="next()">
  250. 下一步
  251. </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. driverCarInfoList: [{
  347. carNumber: '',
  348. addressUrl: '',
  349. carNumberColour: '黄色',
  350. carType: '',
  351. carTotalWeight: '',
  352. carApprovedWeight: '',
  353. carLong: '',
  354. carWidth: '',
  355. carHeight: '',
  356. fileList1: []
  357. }],
  358. driverPayeeInfoList: [{
  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.driverPayeeInfoList[_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.driverPayeeInfoList[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.index = index
  652. },
  653. // 上传图片
  654. imgTypeSelect(val) {
  655. console.log(val)
  656. console.log(this.uploadType)
  657. if (val.name == '相册') {
  658. uni.chooseImage({
  659. count: 1,
  660. sourceType: this.$helper.chooseImage.sourceType,
  661. success: function(res) {
  662. console.log(JSON.stringify(res.tempFilePaths));
  663. uploadImage(res.tempFilePaths[0], 'appData/',
  664. result => {
  665. // 上传成功回调函数
  666. console.log('图片地址', result)
  667. switch (_this.uploadType) {
  668. // 身份正面
  669. case 1:
  670. _this.dataDetails.cardAddressUrl = result
  671. // 识别
  672. _this.$request.baseRequest('get',
  673. '/driverInfo/personShibie', {
  674. personImg: result,
  675. }).then(res => {
  676. _this.dataDetails.numberCard = res.data.recPersonNo
  677. })
  678. .catch(res => {
  679. uni.$u.toast(res.message);
  680. });
  681. break
  682. // 身份反面
  683. case 2:
  684. _this.dataDetails.cardBackAddressUrl = result
  685. break
  686. // 银行卡
  687. case 3:
  688. _this.bankType[_this.index] = []
  689. _this.$request.baseRequest('get',
  690. '/driverInfo/bankShibie', {
  691. bankImg: result,
  692. }).then(res => {
  693. console.log(res)
  694. _this.dataDetails.driverPayeeInfoList[_this.index]
  695. .payeeAddressUrl = result
  696. if (res.data.bankNo) {
  697. _this.dataDetails.driverPayeeInfoList[_this
  698. .index].bankCard = res.data.bankNo
  699. }
  700. if (res.data.bankName) {
  701. _this.dataDetails.driverPayeeInfoList[_this
  702. .index].bankDeposit = res.data.bankName
  703. }
  704. // 开户支行LIst
  705. if (res.data.bankNameZhihang) {
  706. _this.bankType[_this.index].push(res.data
  707. .bankNameZhihang)
  708. }
  709. _this.$forceUpdate()
  710. })
  711. .catch(res => {
  712. uni.$u.toast(res.message);
  713. });
  714. break;
  715. }
  716. }
  717. )
  718. }
  719. });
  720. } else {
  721. switch (this.uploadType) {
  722. // case 0:
  723. // console.log('人车合影')
  724. // break
  725. case 1:
  726. uni.$u.route('/pages/mine/camera/idcard/idcard?dotype=idcardface');
  727. console.log('身份正面')
  728. break
  729. case 2:
  730. uni.$u.route('/pages/mine/camera/idcard/idcard?dotype=badge');
  731. console.log('身份反面')
  732. break
  733. case 3:
  734. uni.$u.route('/pages/mine/camera/idcard/idcard?dotype=bank');
  735. console.log('银行卡')
  736. break
  737. case 4:
  738. }
  739. }
  740. },
  741. //车牌号弹出键盘
  742. handleClick(e) {
  743. this.carNumber = e.value
  744. this.dataDetails.driverCarInfoList[this.index].carNumber = e.value //键盘输入值
  745. },
  746. //车牌号弹出键盘
  747. handleShowKeyboard(index) {
  748. if (this.dataDetails.driverCarInfoList[index].carNumber == '') {
  749. this.carNumber = ''
  750. } else {
  751. this.carNumber = this.dataDetails.driverCarInfoList[index].carNumber
  752. }
  753. if (this.$refs.keyboard.open) {
  754. this.$refs.keyboard.open(false) //true 键盘显示 false 键盘隐藏
  755. } else {
  756. this.$refs.keyboard[0].open(false)
  757. }
  758. this.index = index
  759. if (this.$refs.keyboard.open) {
  760. this.$refs.keyboard.open(true) //true 键盘显示 false 键盘隐藏
  761. } else {
  762. this.$refs.keyboard[0].open(true)
  763. }
  764. },
  765. addCarNumber(val) {
  766. val.push({
  767. carNumber: '',
  768. addressUrl: '',
  769. carNumberColour: '',
  770. carType: '',
  771. carTotalWeight: '',
  772. carApprovedWeight: '',
  773. carLong: '',
  774. carWidth: '',
  775. carHeight: '',
  776. fileList1: []
  777. })
  778. },
  779. delCarNumber(val, index) {
  780. if (val.length > 1) {
  781. val.splice(index, 1)
  782. this.$forceUpdate()
  783. } else {
  784. let params = {
  785. type: 'error',
  786. message: "至少保留一个车牌号!",
  787. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  788. }
  789. this.$refs.uToast.show({
  790. ...params
  791. })
  792. }
  793. },
  794. addBankNumber(val) {
  795. val.push({
  796. payeeAddressUrl: '',
  797. bankCard: '',
  798. bankDeposit: '',
  799. bankDepositBranch: '',
  800. payeeName: ''
  801. })
  802. },
  803. delBankNumber(val, index) {
  804. if (val.length > 1) {
  805. val.splice(index, 1)
  806. this.$forceUpdate()
  807. } else {
  808. let params = {
  809. type: 'error',
  810. message: "至少保留一张银行卡!",
  811. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  812. }
  813. this.$refs.uToast.show({
  814. ...params
  815. })
  816. }
  817. },
  818. next(val) {
  819. // if (this.validate()) return
  820. uni.$u.route('/pages/mine/driverCertificationNext', {
  821. data: JSON.stringify(this.dataDetails),
  822. });
  823. },
  824. validate() {
  825. // true 为校验不通过
  826. if (uni.$u.test.isEmpty(this.dataDetails.driverName)) {
  827. this.$refs.uToast.show({
  828. type: 'error',
  829. message: "司机姓名不能为空!",
  830. })
  831. return true
  832. }
  833. if (!uni.$u.test.chinese(this.dataDetails.driverName)) {
  834. this.$refs.uToast.show({
  835. type: 'error',
  836. message: "姓名为汉字!",
  837. })
  838. return true
  839. }
  840. if (uni.$u.test.isEmpty(this.dataDetails.driverPhone)) {
  841. this.$refs.uToast.show({
  842. type: 'error',
  843. message: "联系电话不能为空!",
  844. })
  845. return true
  846. }
  847. if (!uni.$u.test.mobile(this.dataDetails.driverPhone)) {
  848. this.$refs.uToast.show({
  849. type: 'error',
  850. message: "电话号码格式错误!",
  851. })
  852. return true
  853. }
  854. for (let i = 0; i < this.dataDetails.driverCarInfoList.length; i++) {
  855. let _item = this.dataDetails.driverCarInfoList[i]
  856. if (uni.$u.test.isEmpty(_item.carNumber)) {
  857. this.$refs.uToast.show({
  858. type: 'error',
  859. message: "车牌号不能为空!",
  860. })
  861. return true
  862. }
  863. if (uni.$u.test.isEmpty(_item.addressUrl)) {
  864. this.$refs.uToast.show({
  865. type: 'error',
  866. message: "人车合影不能为空!",
  867. })
  868. return true
  869. }
  870. }
  871. if (uni.$u.test.isEmpty(this.dataDetails.driverPhone)) {
  872. this.$refs.uToast.show({
  873. type: 'error',
  874. message: "身份证人像页不能为空!",
  875. })
  876. return true
  877. }
  878. if (uni.$u.test.isEmpty(this.dataDetails.driverPhone)) {
  879. this.$refs.uToast.show({
  880. type: 'error',
  881. message: "身份证国徽页不能为空!",
  882. })
  883. return true
  884. }
  885. if (uni.$u.test.isEmpty(this.dataDetails.cardValidityDate)) {
  886. this.$refs.uToast.show({
  887. type: 'error',
  888. message: "身份证人有效截止日期不能为空!",
  889. })
  890. return true
  891. }
  892. for (let i = 0; i < this.dataDetails.driverPayeeInfoList.length; i++) {
  893. let _item = this.dataDetails.driverPayeeInfoList[i]
  894. if (uni.$u.test.isEmpty(_item.payeeAddressUrl)) {
  895. this.$refs.uToast.show({
  896. type: 'error',
  897. message: "银行卡不能为空!",
  898. })
  899. return true
  900. }
  901. if (uni.$u.test.isEmpty(_item.bankCard)) {
  902. this.$refs.uToast.show({
  903. type: 'error',
  904. message: "银行卡号码不能为空!",
  905. })
  906. return true
  907. }
  908. if (uni.$u.test.isEmpty(_item.bankDeposit)) {
  909. this.$refs.uToast.show({
  910. type: 'error',
  911. message: "开户行不能为空!",
  912. })
  913. return true
  914. }
  915. if (uni.$u.test.isEmpty(_item.bankDepositBranch)) {
  916. this.$refs.uToast.show({
  917. type: 'error',
  918. message: "开户支行不能为空!",
  919. })
  920. return true
  921. }
  922. if (uni.$u.test.isEmpty(_item.payeeName)) {
  923. this.$refs.uToast.show({
  924. type: 'error',
  925. message: "收款人姓名不能为空!",
  926. })
  927. return true
  928. }
  929. }
  930. return false
  931. }
  932. },
  933. };
  934. </script>
  935. <style scoped lang="scss">
  936. /deep/.u-radio {
  937. margin-bottom: 0 !important;
  938. }
  939. .top-head {
  940. background: #2772FB;
  941. height: 80rpx;
  942. width: 100%;
  943. }
  944. .container {
  945. position: relative;
  946. top: -60rpx;
  947. margin: 0 20rpx;
  948. }
  949. .row4-img {
  950. width: 32rpx;
  951. height: 32rpx;
  952. }
  953. .content1,
  954. .content2,
  955. .content3 {
  956. .left-text {
  957. // background: red;
  958. width: 290rpx;
  959. color: #333333;
  960. display: flex;
  961. align-items: center;
  962. }
  963. .row {
  964. border-bottom: 1px solid #EEEEEE;
  965. padding-bottom: 28rpx;
  966. margin-top: 26rpx;
  967. .ch-style {}
  968. }
  969. .row-ch {
  970. padding-right: 180rpx;
  971. box-sizing: border-box;
  972. // background-color: red;
  973. }
  974. }
  975. .content1-car {
  976. margin-top: 20rpx;
  977. .left-text {
  978. // background: red;
  979. width: 290rpx;
  980. color: #333333;
  981. display: flex;
  982. align-items: center;
  983. }
  984. .row {
  985. border-bottom: 1px solid #EEEEEE;
  986. padding-bottom: 28rpx;
  987. margin-top: 26rpx;
  988. .color {
  989. // background: blue;
  990. width: 340rpx;
  991. }
  992. }
  993. }
  994. .input-ckg {
  995. height: 86rpx;
  996. margin-top: 0 !important;
  997. padding-bottom: 0 !important;
  998. .u-input {
  999. height: 100%;
  1000. background: #F7F8FA;
  1001. padding-left: 10rpx !important;
  1002. padding-right: 85rpx !important;
  1003. }
  1004. .star {
  1005. display: flex;
  1006. align-items: center;
  1007. margin: 0 10rpx;
  1008. }
  1009. .input-positon {
  1010. position: relative;
  1011. }
  1012. .position-right {
  1013. position: absolute;
  1014. right: 20rpx;
  1015. top: 0;
  1016. width: 60rpx;
  1017. height: 50rpx;
  1018. bottom: 0;
  1019. margin: auto;
  1020. }
  1021. }
  1022. .picture {
  1023. margin-top: 20rpx;
  1024. background: #F5F6FA;
  1025. width: 212rpx;
  1026. height: 212rpx;
  1027. border-radius: 20rpx;
  1028. display: flex;
  1029. flex-direction: column;
  1030. justify-content: center;
  1031. align-items: center;
  1032. color: #6A7282;
  1033. }
  1034. .add-car {
  1035. background: #FFFFFF;
  1036. margin: 20rpx 50rpx;
  1037. border-radius: 50rpx;
  1038. display: flex;
  1039. justify-content: center;
  1040. align-items: center;
  1041. padding: 20rpx 0;
  1042. .icon {
  1043. margin-right: 20rpx;
  1044. }
  1045. .car-text {
  1046. font-size: 36rpx;
  1047. font-weight: 700;
  1048. color: #2772FB;
  1049. }
  1050. }
  1051. .carlist-item {
  1052. margin-top: 20rpx;
  1053. padding: 0 20rpx 20rpx 20rpx;
  1054. background: white;
  1055. border-radius: 10rpx;
  1056. position: relative;
  1057. .del-car {
  1058. position: absolute;
  1059. top: 0;
  1060. right: 0;
  1061. width: 80rpx;
  1062. height: 80rpx;
  1063. }
  1064. }
  1065. .content2,
  1066. .content3 {
  1067. .del-bank {
  1068. position: absolute;
  1069. top: 0;
  1070. right: 0;
  1071. width: 80rpx;
  1072. height: 80rpx;
  1073. }
  1074. .picture {
  1075. width: 100%;
  1076. height: 440rpx;
  1077. // background: red;
  1078. position: relative;
  1079. .text {
  1080. margin-top: 20rpx;
  1081. }
  1082. }
  1083. .picture1 {
  1084. background: url(../../static/images/mine/zm.png);
  1085. background-size: 100% 100%;
  1086. }
  1087. .picture2 {
  1088. background: url(../../static/images/mine/gh.png);
  1089. background-size: 100% 100%;
  1090. }
  1091. .picture3 {
  1092. background: url(../../static/images/mine/yhkzm.png);
  1093. background-size: 100% 100%;
  1094. }
  1095. .xj-image {
  1096. width: 100rpx;
  1097. height: 100rpx;
  1098. }
  1099. .title {
  1100. color: #999999;
  1101. margin: 20rpx 0;
  1102. }
  1103. }
  1104. .content3 {
  1105. position: relative;
  1106. background: white;
  1107. margin: 20rpx 0 0 0;
  1108. border-radius: 10rpx;
  1109. padding: 20rpx;
  1110. .khzh-styel {
  1111. // width: 350rpx;
  1112. }
  1113. .type {
  1114. background: #2772FB;
  1115. border-radius: 10rpx;
  1116. color: white;
  1117. box-sizing: border-box;
  1118. padding: 4rpx 10rpx;
  1119. font-size: 26rpx;
  1120. display: flex;
  1121. justify-content: center;
  1122. align-items: center;
  1123. }
  1124. .select-bankzh {
  1125. width: 230rpx;
  1126. height: 48rpx;
  1127. }
  1128. }
  1129. .content4 {
  1130. display: flex;
  1131. justify-content: center;
  1132. background: white;
  1133. padding: 40rpx 20rpx 50rpx 20rpx;
  1134. .next-btn {
  1135. background: #22C572;
  1136. width: 90%;
  1137. padding: 20rpx 20rpx;
  1138. text-align: center;
  1139. color: #FFFFFF;
  1140. border-radius: 50rpx;
  1141. }
  1142. }
  1143. .yzm {}
  1144. .yzm-btn {
  1145. background: #2772FB;
  1146. color: white;
  1147. height: 60rpx;
  1148. }
  1149. .preview-card-img {
  1150. /deep/uni-image>div, uni-image>img {
  1151. // transform: scale(1.5) rotate(-90deg);
  1152. }
  1153. }
  1154. .del-card {
  1155. position: absolute;
  1156. top: -10rpx;
  1157. right: -6rpx;
  1158. width: 80rpx;
  1159. height: 80rpx;
  1160. z-index: 9;
  1161. }
  1162. </style>