driverCertification.vue 35 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301
  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. this.imgTypeSelect()
  654. },
  655. // 上传图片
  656. imgTypeSelect() {
  657. // console.log(val)
  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('image', 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. flag:1
  676. }).then(res => {
  677. _this.dataDetails.numberCard = res.data.recPersonNo
  678. if (res.data.recPerson) {
  679. _this.dataDetails.driverName = res.data.recPerson
  680. _this.dataDetails.driverCall = res.data.recPerson.substring(0,1)
  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. // 识别
  697. _this.$request.baseRequest('get',
  698. '/driverInfo/personShibie', {
  699. personImg: result,
  700. flag:2
  701. }).then(res => {
  702. if(res.data.idCardValidity){
  703. let date = res.data.idCardValidity.split("-")[1]
  704. _this.dataDetails.cardValidityDate = date.replace('.', '-').replace('.', '-')
  705. }
  706. })
  707. .catch(res => {
  708. uni.$u.toast(res.message);
  709. });
  710. break
  711. // 银行卡
  712. case 3:
  713. _this.bankType[_this.index] = []
  714. _this.$request.baseRequest('get',
  715. '/driverInfo/bankShibie', {
  716. bankImg: result,
  717. }).then(res => {
  718. _this.dataDetails.hyDriverPayeeInfoList[_this.index].payeeAddressUrl = result
  719. if (res.data.bankNo) {
  720. _this.dataDetails.hyDriverPayeeInfoList[_this
  721. .index].bankCard = res.data.bankNo
  722. }
  723. if (res.data.bankName) {
  724. _this.dataDetails.hyDriverPayeeInfoList[_this
  725. .index].bankDeposit = res.data.bankName
  726. }
  727. // 开户支行LIst
  728. if (res.data.bankNameZhihang) {
  729. _this.bankType[_this.index].push(res.data
  730. .bankNameZhihang)
  731. }
  732. _this.$forceUpdate()
  733. })
  734. .catch(res => {
  735. uni.$u.toast(res.message);
  736. });
  737. break;
  738. }
  739. }
  740. )
  741. }
  742. });
  743. // } else {
  744. // }
  745. // else {
  746. // switch (this.uploadType) {
  747. // // case 0:
  748. // // console.log('人车合影')
  749. // // break
  750. // case 1:
  751. // uni.$u.route('/pages/mine/camera/idcard/idcard?dotype=idcardface');
  752. // console.log('身份正面')
  753. // break
  754. // case 2:
  755. // uni.$u.route('/pages/mine/camera/idcard/idcard?dotype=badge');
  756. // console.log('身份反面')
  757. // break
  758. // case 3:
  759. // uni.$u.route('/pages/mine/camera/idcard/idcard?dotype=bank');
  760. // console.log('银行卡')
  761. // break
  762. // case 4:
  763. // }
  764. // }
  765. },
  766. //车牌号弹出键盘
  767. handleClick(e) {
  768. this.carNumber = e.value
  769. this.dataDetails.hyDriverCarInfoList[this.index].carNumber = e.value //键盘输入值
  770. },
  771. //车牌号弹出键盘
  772. handleShowKeyboard(index) {
  773. if (this.dataDetails.hyDriverCarInfoList[index].carNumber == '') {
  774. this.carNumber = ''
  775. } else {
  776. this.carNumber = this.dataDetails.hyDriverCarInfoList[index].carNumber
  777. }
  778. if (this.$refs.keyboard.open) {
  779. this.$refs.keyboard.open(false) //true 键盘显示 false 键盘隐藏
  780. } else {
  781. this.$refs.keyboard[0].open(false)
  782. }
  783. this.index = index
  784. if (this.$refs.keyboard.open) {
  785. this.$refs.keyboard.open(true) //true 键盘显示 false 键盘隐藏
  786. } else {
  787. this.$refs.keyboard[0].open(true)
  788. }
  789. },
  790. addCarNumber(val) {
  791. val.push({
  792. carNumber: '',
  793. addressUrl: '',
  794. carNumberColour: '',
  795. carType: '',
  796. carTotalWeight: '',
  797. carApprovedWeight: '',
  798. carLong: '',
  799. carWidth: '',
  800. carHeight: '',
  801. fileList1: []
  802. })
  803. },
  804. delCarNumber(val, index) {
  805. if (val.length > 1) {
  806. val.splice(index, 1)
  807. this.$forceUpdate()
  808. } else {
  809. let params = {
  810. type: 'error',
  811. message: "至少保留一个车牌号!",
  812. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  813. }
  814. this.$refs.uToast.show({
  815. ...params
  816. })
  817. }
  818. },
  819. addBankNumber(val) {
  820. val.push({
  821. payeeAddressUrl: '',
  822. bankCard: '',
  823. bankDeposit: '',
  824. bankDepositBranch: '',
  825. payeeName: this.dataDetails.driverName ? this.dataDetails.driverName : ""
  826. })
  827. },
  828. delBankNumber(val, index) {
  829. if (val.length > 1) {
  830. val.splice(index, 1)
  831. this.$forceUpdate()
  832. } else {
  833. let params = {
  834. type: 'error',
  835. message: "至少保留一张银行卡!",
  836. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  837. }
  838. this.$refs.uToast.show({
  839. ...params
  840. })
  841. }
  842. },
  843. next(val) {
  844. if (this.validate()) return
  845. for (let i = 0; i < this.dataDetails.hyDriverPayeeInfoList.length; i++) {
  846. if (this.dataDetails.hyDriverPayeeInfoList[i].payeeName != this.dataDetails.driverName) {
  847. this.$refs.uToast.show({
  848. type: 'error',
  849. message: "收款人需与司机本人一致!",
  850. })
  851. return
  852. } else {
  853. // 银行卡验证
  854. this.$request.baseRequest('get', '/driverPayeeInfo/bankCradShibie', {
  855. name: this.dataDetails.hyDriverPayeeInfoList[i].payeeName,
  856. idCard: this.dataDetails.numberCard,
  857. accountNo: this.dataDetails.hyDriverPayeeInfoList[i].bankCard
  858. }).then(
  859. res => {
  860. if (res.data.distinguishNum != "01") { //不等于01 证明银行卡验证不通过
  861. // this.payCheck = false //验证开关
  862. uni.$u.toast(res.data.distinguish);
  863. }else{
  864. uni.$u.route('/pages/mine/driverCertificationNext', {
  865. data: JSON.stringify(this.dataDetails),
  866. });
  867. }
  868. })
  869. }
  870. }
  871. // if (this.payCheck) {
  872. // uni.$u.route('/pages/mine/driverCertificationNext', {
  873. // data: JSON.stringify(this.dataDetails),
  874. // });
  875. // }
  876. },
  877. validate() {
  878. // true 为校验不通过
  879. if (uni.$u.test.isEmpty(this.dataDetails.driverName)) {
  880. this.$refs.uToast.show({
  881. type: 'error',
  882. message: "司机姓名不能为空!",
  883. })
  884. return true
  885. }
  886. if (!uni.$u.test.chinese(this.dataDetails.driverName)) {
  887. this.$refs.uToast.show({
  888. type: 'error',
  889. message: "姓名为汉字!",
  890. })
  891. return true
  892. }
  893. if (uni.$u.test.isEmpty(this.dataDetails.driverPhone)) {
  894. this.$refs.uToast.show({
  895. type: 'error',
  896. message: "联系电话不能为空!",
  897. })
  898. return true
  899. }
  900. if (!uni.$u.test.mobile(this.dataDetails.driverPhone)) {
  901. this.$refs.uToast.show({
  902. type: 'error',
  903. message: "电话号码格式错误!",
  904. })
  905. return true
  906. }
  907. // for (let i = 0; i < this.dataDetails.hyDriverCarInfoList.length; i++) {
  908. // let _item = this.dataDetails.hyDriverCarInfoList[i]
  909. // if (uni.$u.test.isEmpty(_item.carNumber)) {
  910. // this.$refs.uToast.show({
  911. // type: 'error',
  912. // message: "车牌号不能为空!",
  913. // })
  914. // return true
  915. // }
  916. // if (uni.$u.test.isEmpty(_item.fileList1)) {
  917. // this.$refs.uToast.show({
  918. // type: 'error',
  919. // message: "人车合影不能为空!",
  920. // })
  921. // return true
  922. // }
  923. // }
  924. if (uni.$u.test.isEmpty(this.dataDetails.driverPhone)) {
  925. this.$refs.uToast.show({
  926. type: 'error',
  927. message: "身份证人像页不能为空!",
  928. })
  929. return true
  930. }
  931. if (uni.$u.test.isEmpty(this.dataDetails.driverPhone)) {
  932. this.$refs.uToast.show({
  933. type: 'error',
  934. message: "身份证国徽页不能为空!",
  935. })
  936. return true
  937. }
  938. if (uni.$u.test.isEmpty(this.dataDetails.cardValidityDate)) {
  939. this.$refs.uToast.show({
  940. type: 'error',
  941. message: "身份证人有效截止日期不能为空!",
  942. })
  943. return true
  944. }
  945. for (let i = 0; i < this.dataDetails.hyDriverPayeeInfoList.length; i++) {
  946. let _item = this.dataDetails.hyDriverPayeeInfoList[i]
  947. if (uni.$u.test.isEmpty(_item.payeeAddressUrl)) {
  948. this.$refs.uToast.show({
  949. type: 'error',
  950. message: "银行卡不能为空!",
  951. })
  952. return true
  953. }
  954. if (uni.$u.test.isEmpty(_item.bankCard)) {
  955. this.$refs.uToast.show({
  956. type: 'error',
  957. message: "银行卡号码不能为空!",
  958. })
  959. return true
  960. }
  961. if (uni.$u.test.isEmpty(_item.bankDeposit)) {
  962. this.$refs.uToast.show({
  963. type: 'error',
  964. message: "开户行不能为空!",
  965. })
  966. return true
  967. }
  968. if (uni.$u.test.isEmpty(_item.bankDepositBranch)) {
  969. this.$refs.uToast.show({
  970. type: 'error',
  971. message: "开户支行不能为空!",
  972. })
  973. return true
  974. }
  975. if (uni.$u.test.isEmpty(_item.payeeName)) {
  976. this.$refs.uToast.show({
  977. type: 'error',
  978. message: "收款人姓名不能为空!",
  979. })
  980. return true
  981. }
  982. }
  983. return false
  984. }
  985. },
  986. };
  987. </script>
  988. <style scoped lang="scss">
  989. /deep/.u-radio {
  990. margin-bottom: 0 !important;
  991. }
  992. .top-head {
  993. background: #2772FB;
  994. height: 80rpx;
  995. width: 100%;
  996. }
  997. .container {
  998. position: relative;
  999. top: -60rpx;
  1000. margin: 0 20rpx;
  1001. }
  1002. .row4-img {
  1003. width: 32rpx;
  1004. height: 32rpx;
  1005. }
  1006. .content1,
  1007. .content2,
  1008. .content3 {
  1009. .left-text {
  1010. // background: red;
  1011. width: 290rpx;
  1012. color: #333333;
  1013. display: flex;
  1014. align-items: center;
  1015. }
  1016. .row {
  1017. border-bottom: 1px solid #EEEEEE;
  1018. padding-bottom: 28rpx;
  1019. margin-top: 26rpx;
  1020. .ch-style {}
  1021. }
  1022. .row-ch {
  1023. padding-right: 180rpx;
  1024. box-sizing: border-box;
  1025. // background-color: red;
  1026. }
  1027. }
  1028. .content1-car {
  1029. margin-top: 20rpx;
  1030. .left-text {
  1031. // background: red;
  1032. width: 290rpx;
  1033. color: #333333;
  1034. display: flex;
  1035. align-items: center;
  1036. }
  1037. .row {
  1038. border-bottom: 1px solid #EEEEEE;
  1039. padding-bottom: 28rpx;
  1040. margin-top: 26rpx;
  1041. .color {
  1042. // background: blue;
  1043. width: 340rpx;
  1044. }
  1045. }
  1046. }
  1047. .input-ckg {
  1048. height: 86rpx;
  1049. margin-top: 0 !important;
  1050. padding-bottom: 0 !important;
  1051. .u-input {
  1052. height: 100%;
  1053. background: #F7F8FA;
  1054. padding-left: 10rpx !important;
  1055. padding-right: 85rpx !important;
  1056. }
  1057. .star {
  1058. display: flex;
  1059. align-items: center;
  1060. margin: 0 10rpx;
  1061. }
  1062. .input-positon {
  1063. position: relative;
  1064. }
  1065. .position-right {
  1066. position: absolute;
  1067. right: 20rpx;
  1068. top: 0;
  1069. width: 60rpx;
  1070. height: 50rpx;
  1071. bottom: 0;
  1072. margin: auto;
  1073. }
  1074. }
  1075. .picture {
  1076. margin-top: 20rpx;
  1077. background: #F5F6FA;
  1078. width: 212rpx;
  1079. height: 212rpx;
  1080. border-radius: 20rpx;
  1081. display: flex;
  1082. flex-direction: column;
  1083. justify-content: center;
  1084. align-items: center;
  1085. color: #6A7282;
  1086. }
  1087. .add-car {
  1088. background: #FFFFFF;
  1089. margin: 20rpx 50rpx;
  1090. border-radius: 50rpx;
  1091. display: flex;
  1092. justify-content: center;
  1093. align-items: center;
  1094. padding: 20rpx 0;
  1095. .icon {
  1096. margin-right: 20rpx;
  1097. }
  1098. .car-text {
  1099. font-size: 36rpx;
  1100. font-weight: 700;
  1101. color: #2772FB;
  1102. }
  1103. }
  1104. .carlist-item {
  1105. margin-top: 20rpx;
  1106. padding: 0 20rpx 20rpx 20rpx;
  1107. background: white;
  1108. border-radius: 10rpx;
  1109. position: relative;
  1110. .del-car {
  1111. position: absolute;
  1112. top: 0;
  1113. right: 0;
  1114. width: 80rpx;
  1115. height: 80rpx;
  1116. }
  1117. }
  1118. .content2,
  1119. .content3 {
  1120. .del-bank {
  1121. position: absolute;
  1122. top: 0;
  1123. right: 0;
  1124. width: 80rpx;
  1125. height: 80rpx;
  1126. }
  1127. .picture {
  1128. width: 100%;
  1129. height: 440rpx;
  1130. // background: red;
  1131. position: relative;
  1132. .text {
  1133. margin-top: 20rpx;
  1134. }
  1135. }
  1136. .picture1 {
  1137. background: url(../../static/images/mine/zm.png);
  1138. background-size: 100% 100%;
  1139. }
  1140. .picture2 {
  1141. background: url(../../static/images/mine/gh.png);
  1142. background-size: 100% 100%;
  1143. }
  1144. .picture3 {
  1145. background: url(../../static/images/mine/yhkzm.png);
  1146. background-size: 100% 100%;
  1147. }
  1148. .xj-image {
  1149. width: 100rpx;
  1150. height: 100rpx;
  1151. }
  1152. .title {
  1153. color: #999999;
  1154. margin: 20rpx 0;
  1155. }
  1156. }
  1157. .content3 {
  1158. position: relative;
  1159. background: white;
  1160. margin: 20rpx 0 0 0;
  1161. border-radius: 10rpx;
  1162. padding: 20rpx;
  1163. .khzh-styel {
  1164. // width: 350rpx;
  1165. }
  1166. .type {
  1167. background: #2772FB;
  1168. border-radius: 10rpx;
  1169. color: white;
  1170. box-sizing: border-box;
  1171. padding: 4rpx 10rpx;
  1172. font-size: 26rpx;
  1173. display: flex;
  1174. justify-content: center;
  1175. align-items: center;
  1176. }
  1177. .select-bankzh {
  1178. width: 230rpx;
  1179. height: 48rpx;
  1180. }
  1181. }
  1182. .content4 {
  1183. display: flex;
  1184. justify-content: center;
  1185. background: white;
  1186. padding: 40rpx 20rpx 50rpx 20rpx;
  1187. .next-btn {
  1188. background: #22C572;
  1189. width: 90%;
  1190. padding: 20rpx 20rpx;
  1191. text-align: center;
  1192. color: #FFFFFF;
  1193. border-radius: 50rpx;
  1194. }
  1195. }
  1196. .yzm {}
  1197. .yzm-btn {
  1198. background: #2772FB;
  1199. color: white;
  1200. height: 60rpx;
  1201. }
  1202. .preview-card-img {
  1203. /deep/uni-image>div,
  1204. uni-image>img {
  1205. // transform: scale(1.5) rotate(-90deg);
  1206. }
  1207. }
  1208. .del-card {
  1209. position: absolute;
  1210. top: -10rpx;
  1211. right: -6rpx;
  1212. width: 80rpx;
  1213. height: 80rpx;
  1214. z-index: 9;
  1215. }
  1216. </style>