driverCertification.vue 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251
  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' 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' 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="长" 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="宽" 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' 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. console.log(111111111111)
  820. // if (this.validate()) return
  821. uni.$u.route('/pages/mine/driverCertificationNext', {
  822. data: JSON.stringify(this.dataDetails),
  823. });
  824. },
  825. validate() {
  826. // true 为校验不通过
  827. if (uni.$u.test.isEmpty(this.dataDetails.driverName)) {
  828. this.$refs.uToast.show({
  829. type: 'error',
  830. message: "司机姓名不能为空!",
  831. })
  832. return true
  833. }
  834. if (!uni.$u.test.chinese(this.dataDetails.driverName)) {
  835. this.$refs.uToast.show({
  836. type: 'error',
  837. message: "姓名为汉字!",
  838. })
  839. return true
  840. }
  841. if (uni.$u.test.isEmpty(this.dataDetails.driverPhone)) {
  842. this.$refs.uToast.show({
  843. type: 'error',
  844. message: "联系电话不能为空!",
  845. })
  846. return true
  847. }
  848. if (!uni.$u.test.mobile(this.dataDetails.driverPhone)) {
  849. this.$refs.uToast.show({
  850. type: 'error',
  851. message: "电话号码格式错误!",
  852. })
  853. return true
  854. }
  855. for (let i = 0; i < this.dataDetails.driverCarInfoList.length; i++) {
  856. let _item = this.dataDetails.driverCarInfoList[i]
  857. if (uni.$u.test.isEmpty(_item.carNumber)) {
  858. this.$refs.uToast.show({
  859. type: 'error',
  860. message: "车牌号不能为空!",
  861. })
  862. return true
  863. }
  864. if (uni.$u.test.isEmpty(_item.addressUrl)) {
  865. this.$refs.uToast.show({
  866. type: 'error',
  867. message: "人车合影不能为空!",
  868. })
  869. return true
  870. }
  871. }
  872. if (uni.$u.test.isEmpty(this.dataDetails.driverPhone)) {
  873. this.$refs.uToast.show({
  874. type: 'error',
  875. message: "身份证人像页不能为空!",
  876. })
  877. return true
  878. }
  879. if (uni.$u.test.isEmpty(this.dataDetails.driverPhone)) {
  880. this.$refs.uToast.show({
  881. type: 'error',
  882. message: "身份证国徽页不能为空!",
  883. })
  884. return true
  885. }
  886. if (uni.$u.test.isEmpty(this.dataDetails.cardValidityDate)) {
  887. this.$refs.uToast.show({
  888. type: 'error',
  889. message: "身份证人有效截止日期不能为空!",
  890. })
  891. return true
  892. }
  893. for (let i = 0; i < this.dataDetails.driverPayeeInfoList.length; i++) {
  894. let _item = this.dataDetails.driverPayeeInfoList[i]
  895. if (uni.$u.test.isEmpty(_item.payeeAddressUrl)) {
  896. this.$refs.uToast.show({
  897. type: 'error',
  898. message: "银行卡不能为空!",
  899. })
  900. return true
  901. }
  902. if (uni.$u.test.isEmpty(_item.bankCard)) {
  903. this.$refs.uToast.show({
  904. type: 'error',
  905. message: "银行卡号码不能为空!",
  906. })
  907. return true
  908. }
  909. if (uni.$u.test.isEmpty(_item.bankDeposit)) {
  910. this.$refs.uToast.show({
  911. type: 'error',
  912. message: "开户行不能为空!",
  913. })
  914. return true
  915. }
  916. if (uni.$u.test.isEmpty(_item.bankDepositBranch)) {
  917. this.$refs.uToast.show({
  918. type: 'error',
  919. message: "开户支行不能为空!",
  920. })
  921. return true
  922. }
  923. if (uni.$u.test.isEmpty(_item.payeeName)) {
  924. this.$refs.uToast.show({
  925. type: 'error',
  926. message: "收款人姓名不能为空!",
  927. })
  928. return true
  929. }
  930. }
  931. return false
  932. }
  933. },
  934. };
  935. </script>
  936. <style scoped lang="scss">
  937. /deep/.u-radio {
  938. margin-bottom: 0 !important;
  939. }
  940. .top-head {
  941. background: #2772FB;
  942. height: 80rpx;
  943. width: 100%;
  944. }
  945. .container {
  946. position: relative;
  947. top: -60rpx;
  948. margin: 0 20rpx;
  949. }
  950. .row4-img {
  951. width: 32rpx;
  952. height: 32rpx;
  953. }
  954. .content1,
  955. .content2,
  956. .content3 {
  957. .left-text {
  958. // background: red;
  959. width: 290rpx;
  960. color: #333333;
  961. display: flex;
  962. align-items: center;
  963. }
  964. .row {
  965. border-bottom: 1px solid #EEEEEE;
  966. padding-bottom: 28rpx;
  967. margin-top: 26rpx;
  968. .ch-style {}
  969. }
  970. .row-ch {
  971. padding-right: 180rpx;
  972. box-sizing: border-box;
  973. // background-color: red;
  974. }
  975. }
  976. .content1-car {
  977. margin-top: 20rpx;
  978. .left-text {
  979. // background: red;
  980. width: 290rpx;
  981. color: #333333;
  982. display: flex;
  983. align-items: center;
  984. }
  985. .row {
  986. border-bottom: 1px solid #EEEEEE;
  987. padding-bottom: 28rpx;
  988. margin-top: 26rpx;
  989. .color {
  990. // background: blue;
  991. width: 340rpx;
  992. }
  993. }
  994. }
  995. .input-ckg {
  996. height: 86rpx;
  997. margin-top: 0 !important;
  998. padding-bottom: 0 !important;
  999. .u-input {
  1000. height: 100%;
  1001. background: #F7F8FA;
  1002. padding-left: 10rpx !important;
  1003. padding-right: 85rpx !important;
  1004. }
  1005. .star {
  1006. display: flex;
  1007. align-items: center;
  1008. margin: 0 10rpx;
  1009. }
  1010. .input-positon {
  1011. position: relative;
  1012. }
  1013. .position-right {
  1014. position: absolute;
  1015. right: 20rpx;
  1016. top: 0;
  1017. width: 60rpx;
  1018. height: 50rpx;
  1019. bottom: 0;
  1020. margin: auto;
  1021. }
  1022. }
  1023. .picture {
  1024. margin-top: 20rpx;
  1025. background: #F5F6FA;
  1026. width: 212rpx;
  1027. height: 212rpx;
  1028. border-radius: 20rpx;
  1029. display: flex;
  1030. flex-direction: column;
  1031. justify-content: center;
  1032. align-items: center;
  1033. color: #6A7282;
  1034. }
  1035. .add-car {
  1036. background: #FFFFFF;
  1037. margin: 20rpx 50rpx;
  1038. border-radius: 50rpx;
  1039. display: flex;
  1040. justify-content: center;
  1041. align-items: center;
  1042. padding: 20rpx 0;
  1043. .icon {
  1044. margin-right: 20rpx;
  1045. }
  1046. .car-text {
  1047. font-size: 36rpx;
  1048. font-weight: 700;
  1049. color: #2772FB;
  1050. }
  1051. }
  1052. .carlist-item {
  1053. margin-top: 20rpx;
  1054. padding: 0 20rpx 20rpx 20rpx;
  1055. background: white;
  1056. border-radius: 10rpx;
  1057. position: relative;
  1058. .del-car {
  1059. position: absolute;
  1060. top: 0;
  1061. right: 0;
  1062. width: 80rpx;
  1063. height: 80rpx;
  1064. }
  1065. }
  1066. .content2,
  1067. .content3 {
  1068. .del-bank {
  1069. position: absolute;
  1070. top: 0;
  1071. right: 0;
  1072. width: 80rpx;
  1073. height: 80rpx;
  1074. }
  1075. .picture {
  1076. width: 100%;
  1077. height: 440rpx;
  1078. background: red;
  1079. position: relative;
  1080. .text {
  1081. margin-top: 20rpx;
  1082. }
  1083. }
  1084. .picture1 {
  1085. background: url(../../static/images/mine/zm.png);
  1086. background-size: 100% 100%;
  1087. }
  1088. .picture2 {
  1089. background: url(../../static/images/mine/gh.png);
  1090. background-size: 100% 100%;
  1091. }
  1092. .picture3 {
  1093. background: url(../../static/images/mine/yhkzm.png);
  1094. background-size: 100% 100%;
  1095. }
  1096. .xj-image {
  1097. width: 100rpx;
  1098. height: 100rpx;
  1099. }
  1100. .title {
  1101. color: #999999;
  1102. margin: 20rpx 0;
  1103. }
  1104. }
  1105. .content3 {
  1106. position: relative;
  1107. background: white;
  1108. margin: 20rpx 0 0 0;
  1109. border-radius: 10rpx;
  1110. padding: 20rpx;
  1111. .khzh-styel {
  1112. // width: 350rpx;
  1113. }
  1114. .type {
  1115. background: #2772FB;
  1116. border-radius: 10rpx;
  1117. color: white;
  1118. box-sizing: border-box;
  1119. padding: 4rpx 10rpx;
  1120. font-size: 26rpx;
  1121. display: flex;
  1122. justify-content: center;
  1123. align-items: center;
  1124. }
  1125. .select-bankzh {
  1126. width: 230rpx;
  1127. height: 48rpx;
  1128. }
  1129. }
  1130. .content4 {
  1131. display: flex;
  1132. justify-content: center;
  1133. background: white;
  1134. padding: 40rpx 20rpx 50rpx 20rpx;
  1135. .next-btn {
  1136. background: #F1F3F6;
  1137. width: 90%;
  1138. padding: 20rpx 20rpx;
  1139. text-align: center;
  1140. color: #C5CAD4;
  1141. border-radius: 50rpx;
  1142. }
  1143. }
  1144. .yzm {}
  1145. .yzm-btn {
  1146. background: #2772FB;
  1147. color: white;
  1148. height: 60rpx;
  1149. }
  1150. .preview-card-img {
  1151. /deep/uni-image>div, uni-image>img {
  1152. // transform: scale(1.5) rotate(-90deg);
  1153. }
  1154. }
  1155. .del-card {
  1156. position: absolute;
  1157. top: -10rpx;
  1158. right: -6rpx;
  1159. width: 80rpx;
  1160. height: 80rpx;
  1161. z-index: 9;
  1162. }
  1163. </style>