driverCertification.vue 33 KB

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