driverCertification.vue 34 KB

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