driverCertification.vue 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324
  1. <template>
  2. <view class="content">
  3. <view class="top-head"></view>
  4. <view class="container">
  5. <view class="content2 content-other">
  6. <view class="title">上传身份证人像面</view>
  7. <view @click.stop="uploadImg(1,index)" class="picture picture1" v-if="!dataDetails.cardAddressUrl">
  8. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  9. <view class="text">上传身份证人像面</view>
  10. </view>
  11. <view v-if="dataDetails.cardAddressUrl" @click.stop="uploadImg(1,index)"
  12. class="preview-card-img picture">
  13. <!-- <image class="card-img" :src="dataDetails.cardAddressUrl"></image> -->
  14. <view @click.stop="delCard(1)">
  15. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  16. </image>
  17. </view>
  18. <image class="" :src="dataDetails.cardAddressUrl" mode="aspectFit" style=""></image>
  19. </view>
  20. <view class="title">上传身份证国徽面</view>
  21. <view @click="uploadImg(2,index)" class="picture picture2" v-if="!dataDetails.cardBackAddressUrl">
  22. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  23. <view class="text">上传身份证国徽面</view>
  24. </view>
  25. <view v-if="dataDetails.cardBackAddressUrl" @click.stop="uploadImg(2,index)"
  26. class="preview-card-img picture">
  27. <!-- <image class="card-img" :src="dataDetails.cardAddressUrl"></image> -->
  28. <view @click.stop="delCard(2)">
  29. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  30. </image>
  31. </view>
  32. <image class="" :src="dataDetails.cardBackAddressUrl" mode="aspectFit"></image>
  33. </view>
  34. <view class="flex row">
  35. <view class="left-text">身份证号</view>
  36. <u--input placeholder="请输入身份证号" inputAlign='left' border="none" v-model="dataDetails.numberCard" maxlength="18">
  37. </u--input>
  38. </view>
  39. <view class="flex row noborder">
  40. <view class="left-text">身份证截止日期</view>
  41. <view class="" @click="selectValidityPeriod">
  42. {{dataDetails.cardValidityDate?dataDetails.cardValidityDate:'选择身份证截止日期>'}}
  43. </view>
  44. </view>
  45. <u-picker :show="isShowcardValidity" ref="uPicker" :columns="validityPeriod"
  46. @confirm="confirmValidityPeriod" @change="changeHandler">
  47. </u-picker>
  48. </view>
  49. <view class="content1 content-other">
  50. <view class="flex row">
  51. <view class="left-text">姓名</view>
  52. <u--input placeholder="输入姓名" inputAlign='left' border="none" v-model="dataDetails.driverName">
  53. </u--input>
  54. </view>
  55. <view class="flex row">
  56. <view class="left-text">性别</view>
  57. <u-radio-group v-model="dataDetails.driverSex" placement="row">
  58. <u-radio :customStyle="{marginBottom: '8px'}" v-for="(item, index) in radiolist1" :key="index"
  59. :label="item.name" :name="item.name" @change="radioChange" style="margin: 0 20rpx;">
  60. </u-radio>
  61. </u-radio-group>
  62. </view>
  63. <view class="flex row row-ch">
  64. <view class="left-text">称呼</view>
  65. <u--input placeholder="输入姓氏" class="ch-style" inputAlign='center' border="none"
  66. v-model="dataDetails.driverCall" maxlength="1">
  67. </u--input>
  68. <view class="flex align-center" v-if="dataDetails.driverSex=='男'">先生</view>
  69. <view class="flex align-center" v-else>女士</view>
  70. </view>
  71. <view class="flex row noborder">
  72. <view class="left-text">联系电话</view>
  73. <u--input placeholder="请输入联系电话" inputAlign='left' border="none" v-model="dataDetails.driverPhone"
  74. maxlength="11">
  75. </u--input>
  76. </view>
  77. <view class="flex row noborder" v-if="dataDetails.driverPhone!=userInfo.phone">
  78. <view class="left-text">验证码</view>
  79. <u--input v-model="dataDetails.verifyCode" border="none" placeholder="请填写验证码"></u--input>
  80. <view class="yzm">
  81. <u-code :seconds="seconds" @end="end" @start="start" ref="uCode" @change="codeChange"></u-code>
  82. <u-button class="yzm-btn" @tap="getCode">{{tips}}</u-button>
  83. </view>
  84. </view>
  85. </view>
  86. <view v-if="isFirstAuthentication" class="content1-car">
  87. <!--<view class="flex s-row carlist-item" v-for="(item,index) in dataDetails.hyDriverCarInfoList"
  88. :key='index'>
  89. <view class="flex row">
  90. <view class="left left-text">
  91. 车牌号-{{index+1}}
  92. </view>
  93. <view class="right flex">
  94. <input class="car-uumber" v-model='item.carNumber' @click.stop="handleShowKeyboard(index)"
  95. :disabled="true" placeholder="输入车牌号" name="input"></input>
  96. <view @click="delCarNumber(dataDetails.hyDriverCarInfoList,index)" class="" v-if="index!=0">
  97. <image class='del-car' src="@/static/images/common/quxiao@2x.png">
  98. </image>
  99. </view>
  100. </view>
  101. </view>
  102. <view class="flex row">
  103. <view class="left-text">车牌颜色</view>
  104. <view class="color" @click="selectNoColor">{{item.carNumberColour}}
  105. </view>
  106. <view>></view>
  107. <u-picker :show="carColor" :columns="colorColumns" :closeOnClickOverlay='true'
  108. @close='colorClose' @cancel='colorClose' @confirm='confirmColor($event,item)'></u-picker>
  109. </view>
  110. <view class="flex row">
  111. <view class="left-text">车型</view>
  112. <view class="color" @click="selectCarModel">{{item.carType}}</view>
  113. <view>></view>
  114. <u-picker ref="carTypePicker" :show="carModel" :columns="carModelColumns"
  115. :closeOnClickOverlay='true' @close='carModelClose' @cancel='carModelClose'
  116. @confirm='confirmCarModel($event,item)' @change="changeCarModel"></u-picker>
  117. </view>
  118. <view class="flex row">
  119. <view class="left-text">总质量(千克)</view>
  120. <u--input placeholder="输入总质量" inputAlign='left' type="number" border="none" v-model="item.carTotalWeight">
  121. </u--input>
  122. </view>
  123. <view class="flex row">
  124. <view class="left-text">核定载质量(千克)</view>
  125. <u--input placeholder="输入核定载质量" inputAlign='left' type="number" border="none"
  126. v-model="item.carApprovedWeight">
  127. </u--input>
  128. </view>
  129. <view class="flex row noborder">
  130. <view class="left-text">外廓尺寸</view>
  131. </view>
  132. <view class="flex row noborder input-ckg">
  133. <view class="input-positon">
  134. <u--input class="input" placeholder="长" type="number" inputAlign='left' border="none"
  135. v-model="item.carLong">
  136. </u--input>
  137. <view class="position-right">
  138. mm
  139. </view>
  140. </view>
  141. <view class="star">*</view>
  142. <view class="input-positon">
  143. <u--input placeholder="宽" type="number" inputAlign='left' border="none" v-model="item.carWidth">
  144. </u--input>
  145. <view class="position-right">
  146. mm
  147. </view>
  148. </view>
  149. <view class="star">*</view>
  150. <view class="input-positon">
  151. <u--input placeholder="高" inputAlign='left' type="number" border="none" v-model="item.carHeight">
  152. </u--input>
  153. <view class="position-right">
  154. mm
  155. </view>
  156. </view>
  157. </view>
  158. <view class="flex row noborder s-row">
  159. <view class="left-text">人车合影-{{index+1}}</view>
  160. <u-upload class="uview-upload" :fileList="item.fileList1" @afterRead="afterRead($event,item)"
  161. @delete="deletePic" name="1" multiple :maxCount="1"></u-upload>
  162. <!-- <view @click="uploadImg(0,index)" class="picture" v-if='!item.addressUrl'>
  163. <image class="xj-image" src="@/static/images/common/tianjiazhaopian@2x.png"
  164. ></image>
  165. </view> -->
  166. <!-- <image class="preview-img" :src="item.addressUrl" v-if='item.addressUrl'></image> -->
  167. <!--</view>
  168. </view> -->
  169. </view>
  170. <!-- <view v-if="isFirstAuthentication" @click="addCarNumber(dataDetails.hyDriverCarInfoList)" class="add-car">
  171. <u-icon class="icon" name="plus-circle-fill" color="#2979ff" size="28"></u-icon>
  172. <view class="car-text">
  173. 添加车辆
  174. </view>
  175. </view> -->
  176. <view class="" style="color: red;font-size: 26rpx;margin-top: 20rpx;">*收款人须为司机本人</view>
  177. <view class="content3 flex s-row" v-for="(item,index) in dataDetails.hyDriverPayeeInfoList" :key='index'>
  178. <view class="flex">
  179. 银行卡-{{index+1}}
  180. </view>
  181. <view @click="delBankNumber(dataDetails.hyDriverPayeeInfoList,index)" class="" v-if="index!=0">
  182. <image class='del-bank' src="@/static/images/common/quxiao@2x.png">
  183. </image>
  184. </view>
  185. <view class="title">上传银行卡卡号页</view>
  186. <view @click="uploadImg(3,index)" class="picture picture3" v-if="!item.payeeAddressUrl">
  187. <image class="xj-image" src="@/static/images/mine/ic_shanchuan@2x.png"></image>
  188. <view class="text">上传银行卡卡号页</view>
  189. </view>
  190. <view v-if="item.payeeAddressUrl" @click.stop="uploadImg(3,index)" class="preview-card-img picture">
  191. <!-- <image class="card-img" :src="dataDetails.cardAddressUrl"></image> -->
  192. <view @click.stop="delCard(3)">
  193. <image class='del-card' src="@/static/images/common/quxiao@2x.png">
  194. </image>
  195. </view>
  196. <image class="" :src="item.payeeAddressUrl" mode="aspectFit"></image>
  197. </view>
  198. <view class="flex row">
  199. <view class="left-text">银行卡卡号</view>
  200. <view class="flex">
  201. <u--input placeholder="输入银行卡号码" inputAlign='left' border="none" v-model="item.bankCard">
  202. </u--input>
  203. </view>
  204. </view>
  205. <view class="flex row">
  206. <view class="left-text">开户行</view>
  207. <u--input placeholder="输入开户行" inputAlign='left' border="none" v-model="item.bankDeposit">
  208. </u--input>
  209. </view>
  210. <view class="flex row">
  211. <view class="left-text khzh-styel">开户支行</view>
  212. <view class="flex" v-if="isShowManualInput">
  213. <u--input class="select-bankzh" placeholder="输入开户支行" inputAlign='left' border="none"
  214. v-model="item.bankDepositBranch">
  215. </u--input>
  216. <view @click="manualInput" class="type">选择支行</view>
  217. </view>
  218. <view class="flex" v-if="!isShowManualInput">
  219. <view class="select-bankzh point" @click="selectZhbank">
  220. {{item.bankDepositBranch?item.bankDepositBranch:'选择开户支行'}}
  221. </view>
  222. <view @click="manualInput" class="type">手动输入</view>
  223. </view>
  224. </view>
  225. <view class="flex row noborder">
  226. <view class="left-text">收款人</view>
  227. <view class="flex">
  228. <u--input placeholder="输入收款人姓名" inputAlign='left' border="none" v-model="item.payeeName">
  229. </u--input>
  230. </view>
  231. </view>
  232. <u-picker :show="isShowBank" :columns="bankType[index]" :closeOnClickOverlay='true' @close='zhBankClose'
  233. @cancel='zhBankClose' @confirm='confirmBank'></u-picker>
  234. </u-picker>
  235. </view>
  236. <view @click="addBankNumber(dataDetails.hyDriverPayeeInfoList)" class="add-car">
  237. <u-icon class="icon" name="plus-circle-fill" color="#2979ff" size="28"></u-icon>
  238. <view class="car-text">
  239. 添加银行卡
  240. </view>
  241. </view>
  242. <master-keyboard ref="keyboard" keyboardtype="car" :show="keyShow" :randomNumber="true" :newCar="false"
  243. :defaultValue="carNumber" @keyboardClick="handleClick"></master-keyboard>
  244. <u-action-sheet :actions="$helper.imgTypeList" :title="$helper.imgType" :show="isShowimgType"
  245. @select="imgTypeSelect" :closeOnClickOverlay="true" :closeOnClickAction="true"
  246. @close="isShowimgType=false">
  247. </u-action-sheet>
  248. <u-toast ref="uToast"></u-toast>
  249. </view>
  250. <view class="content4">
  251. <view class="next-btn" @click="next()">下一步</view>
  252. </view>
  253. </view>
  254. </template>
  255. <script>
  256. import keyboard from "@/components/master-keyboard/master-keyboard.vue";
  257. import permision from "@/js_sdk/wa-permission/permission.js"
  258. import upload from '@/components/upload.vue';
  259. import uploadImage from '@/components/ossutil/uploadFile.js';
  260. var _this
  261. import {
  262. mapState
  263. } from 'vuex';
  264. export default {
  265. components: {
  266. keyboard,
  267. upload
  268. },
  269. data() {
  270. return {
  271. canvasSiz: {
  272. width: 188,
  273. height: 273
  274. },
  275. tips: '',
  276. // refCode: null,
  277. seconds: 30,
  278. carModelColumns: [
  279. ['挂车', '非挂车'],
  280. ['高栏', '集装箱', '自卸车']
  281. ],
  282. carModelColumnData: [
  283. ['高栏', '集装箱', '自卸车'],
  284. ['重型仓栏']
  285. ],
  286. colorColumns: [
  287. ['黄色', '蓝色']
  288. ],
  289. carColor: false,
  290. carModel: false,
  291. radiolist1: [{
  292. name: '男',
  293. disabled: false
  294. },
  295. {
  296. name: '女',
  297. disabled: false
  298. },
  299. ],
  300. isFirstAuthentication: true,
  301. bankType: [],
  302. isShowBank: false,
  303. isShowManualInput: false,
  304. index: '',
  305. validityPeriod: [],
  306. isShowcardValidity: false,
  307. uploadType: '',
  308. isShowimgType: false,
  309. // uploadOptions1: {
  310. // "text": "上传身份证头像页",
  311. // "bgc": "https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/identityup%282%29.png"
  312. // },
  313. // uploadOptions2: {
  314. // "text": "上传身份证国徽页",
  315. // "bgc": "https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/identitylow%282%29.png"
  316. // },
  317. // uploadOptions3: {
  318. // "text": "上传银行卡正面",
  319. // "bgc": "https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/bankup%282%29.png"
  320. // },
  321. dataDetails: {
  322. commonId: '',
  323. driverName: '',
  324. driverSex: '男',
  325. driverCall: '',
  326. driverPhone: '',
  327. numberCard: '',
  328. cardAddressUrl: '',
  329. cardBackAddressUrl: '',
  330. cardValidityDate: '',
  331. driverType: '',
  332. driverLicenseHomePage: '',
  333. driverLicenseBackPage: '',
  334. driverLicenseValidityDate: '',
  335. drivingLicenseHomePage: '',
  336. drivingLicenseBackPage: '',
  337. drivingLicenseValidityDate: '',
  338. trailerLicenseHomePage: '',
  339. trailerLicenseBackPage: '',
  340. trailerLicenseValidityDate: '',
  341. qualificationCertificate: '',
  342. qualificationCertificateValidityDate: '',
  343. operationCertificate: '',
  344. operationCertificateValidityDate: '',
  345. trailerOperationCertificate: '',
  346. trailerOperationCertificateValidityDate: '',
  347. hyDriverCarInfoList: [{
  348. carNumber: '',
  349. addressUrl: '',
  350. carNumberColour: '黄色',
  351. carType: '',
  352. carTotalWeight: '',
  353. carApprovedWeight: '',
  354. carLong: '',
  355. carWidth: '',
  356. carHeight: '',
  357. fileList1: []
  358. }],
  359. hyDriverPayeeInfoList: [{
  360. payeeAddressUrl: '',
  361. bankCard: '',
  362. bankDeposit: '',
  363. bankDepositBranch: '',
  364. payeeName: ''
  365. }],
  366. },
  367. keyShow: false,
  368. carNumber: '',
  369. action: this.$helper.ossUploadUrl,
  370. // maxSize: 50 * 1024 * 1024, //限制文件大小 50M
  371. // isAdd: true,
  372. imagesrc: null,
  373. };
  374. },
  375. onLoad() {
  376. _this = this;
  377. this.get_camera_permission()
  378. console.log(this.userInfo)
  379. //获取截止日期List数据
  380. this.validityPeriod = this.$helper.makeValidityPeriod(0)
  381. this.dataDetails.driverPhone = this.userInfo.phone
  382. this.dataDetails.commonId = this.userInfo.id
  383. //获取认证状态
  384. this.getAuthenticationStatus()
  385. },
  386. computed: {
  387. ...mapState(['hasLogin', 'userInfo']),
  388. },
  389. methods: {
  390. async get_camera_permission() {
  391. var photol=await permision.requestAndroidPermission("android.permission.CAMERA")
  392. if(photol == false){
  393. uni.showModal({
  394. title: '提示',
  395. content: '您已经关闭相册权限,去设置',
  396. success: function (res) {
  397. if (res.confirm) {
  398. permision.gotoAppPermissionSetting()
  399. // plus.runtime.openURL("app-settings:");
  400. } else if (res.cancel) {
  401. console.log('用户点击取消');
  402. }
  403. }
  404. });
  405. }
  406. },
  407. delCard(type) {
  408. switch (type) {
  409. // 人车合影
  410. // case 0:
  411. // //赋值上传图片图片路径
  412. // _this.dataDetails.driverCarInfoList[_this.index].addressUrl =
  413. // result
  414. // break
  415. // 身份正面
  416. case 1:
  417. _this.dataDetails.cardAddressUrl = ''
  418. break
  419. // 身份反面
  420. case 2:
  421. _this.dataDetails.cardBackAddressUrl = ''
  422. break
  423. // 银行卡
  424. case 3:
  425. _this.dataDetails.hyDriverPayeeInfoList[_this.index].payeeAddressUrl = ''
  426. break;
  427. }
  428. },
  429. // 删除图片
  430. deletePic(event, val) {
  431. val[`fileList${event.name}`].splice(event.index, 1)
  432. },
  433. // 新增图片
  434. async afterRead(event, val) {
  435. // 当设置 mutiple 为 true 时, file 为数组格式,否则为对象格式
  436. let lists = [].concat(event.file)
  437. let fileListLen = val[`fileList${event.name}`].length
  438. lists.map((item) => {
  439. val[`fileList${event.name}`].push({
  440. ...item,
  441. status: 'uploading',
  442. message: '上传中'
  443. })
  444. })
  445. for (let i = 0; i < lists.length; i++) {
  446. const result = await this.uploadFilePromise(lists[i].url, val)
  447. let item = val[`fileList${event.name}`][fileListLen]
  448. val[`fileList${event.name}`].splice(fileListLen, 1, Object.assign(item, {
  449. status: 'success',
  450. message: '',
  451. url: result
  452. }))
  453. fileListLen++
  454. }
  455. },
  456. uploadFilePromise(url, val) {
  457. uploadImage(url, 'appData/',
  458. result => {
  459. // 上传成功回调函数
  460. console.log('图片地址', result)
  461. val.addressUrl += result
  462. }
  463. )
  464. // return new Promise((resolve, reject) => {
  465. // let a = uploadImage()
  466. // let a = uni.uploadFile({
  467. // url: 'http://192.168.2.21:7001/upload', // 仅为示例,非真实的接口地址
  468. // filePath: url,
  469. // name: 'file',
  470. // formData: {
  471. // user: 'test'
  472. // },
  473. // success: (res) => {
  474. // setTimeout(() => {
  475. // resolve(res.data.data)
  476. // }, 1000)
  477. // }
  478. // });
  479. // })
  480. },
  481. // 车型切换
  482. changeCarModel(e) {
  483. const {
  484. columnIndex,
  485. index,
  486. // 微信小程序无法将picker实例传出来,只能通过ref操作
  487. picker = this.$refs.carTypePicker
  488. } = e
  489. if (columnIndex === 0) {
  490. // 模拟网络请求
  491. picker.setColumnValues(1, this.carModelColumnData[index])
  492. }
  493. },
  494. codeChange(text) {
  495. this.tips = text;
  496. },
  497. getCode() {
  498. if (/^0?1[3|4|5|6|7|8][0-9]\d{8}$/.test(this.dataDetails.driverPhone)) {
  499. if (this.$refs.uCode.canGetCode) {
  500. // 模拟向后端请求验证码
  501. uni.showLoading({
  502. title: '正在获取验证码'
  503. })
  504. _this.$request.baseRequest('get', '/commonUser/sendVerifyCode', {
  505. phone: this.dataDetails.driverPhone
  506. }).then(res => {
  507. uni.hideLoading();
  508. // 这里此提示会被this.start()方法中的提示覆盖
  509. uni.$u.toast('验证码已发送');
  510. // 通知验证码组件内部开始倒计时
  511. this.$refs.uCode.start();
  512. })
  513. .catch(res => {
  514. uni.$u.toast(res.message);
  515. });
  516. // setTimeout(() => {
  517. // }, 2000);
  518. } else {
  519. uni.$u.toast('倒计时结束后再发送');
  520. }
  521. } else {
  522. uni.$u.toast('请输入正确手机号');
  523. }
  524. },
  525. end() {
  526. // uni.$u.toast('倒计时结束');
  527. },
  528. start() {
  529. // uni.$u.toast('倒计时开始');
  530. },
  531. // 确认颜色
  532. confirmColor(val, val1) {
  533. console.log(val)
  534. val1.carNumberColour = val.value[0]
  535. this.carColor = false
  536. },
  537. colorClose() {
  538. this.carColor = false
  539. },
  540. //选择车牌号颜色
  541. selectNoColor() {
  542. this.carColor = true
  543. },
  544. confirmCarModel(val, val1) {
  545. val1.carType = val.value[0] + ' ' + val.value[1]
  546. this.carModel = false
  547. },
  548. carModelClose() {
  549. this.carModel = false
  550. },
  551. selectCarModel() {
  552. this.carModel = true
  553. },
  554. // 性别切换
  555. radioChange(n) {
  556. console.log('radioChange', n);
  557. this.dataDetails.driverSex = n
  558. },
  559. //判断是否是初次认证
  560. getAuthenticationStatus() {
  561. this.$request.baseRequest('', '/driverInfo/firstAuthentication', {
  562. driverPhone: this.userInfo.phone,
  563. }).then(res => {
  564. if (res.data) {
  565. this.isFirstAuthentication = false
  566. } else {
  567. this.isFirstAuthentication = true
  568. }
  569. //
  570. //
  571. })
  572. .catch(res => {
  573. uni.$u.toast(res.message);
  574. });
  575. },
  576. zhBankClose() {
  577. this.isShowBank = false
  578. },
  579. // 选择支行
  580. selectZhbank() {
  581. if (uni.$u.test.isEmpty(this.bankType[this.index])) {
  582. this.$refs.uToast.show({
  583. type: 'error',
  584. message: "请先上传银行卡!",
  585. })
  586. return true
  587. }
  588. this.isShowBank = true
  589. },
  590. confirmBank(e) {
  591. console.log(e)
  592. this.dataDetails.hyDriverPayeeInfoList[this.index].bankDepositBranch = e.value[0]
  593. this.isShowBank = false
  594. },
  595. manualInput() {
  596. if (this.isShowManualInput) {
  597. if (uni.$u.test.isEmpty(this.bankType[this.index])) {
  598. this.$refs.uToast.show({
  599. type: 'error',
  600. message: "请先上传银行卡!",
  601. })
  602. return true
  603. }
  604. this.isShowBank = true
  605. } else {
  606. this.isShowBank = false
  607. }
  608. this.isShowManualInput = !this.isShowManualInput
  609. },
  610. changeHandler(e) {
  611. const {
  612. columnIndex,
  613. value,
  614. values,
  615. index,
  616. picker = this.$refs.uPicker
  617. } = e
  618. // if (columnIndex === 0) {
  619. // debugger
  620. // if (e.index != 0) {
  621. // picker.setColumnValues(1, this.validityPeriod[1].shift())
  622. // }
  623. // } else if (columnIndex === 1) {
  624. // if (e.index != 0) {
  625. // picker.setColumnValues(2, this.validityPeriod[2].shift())
  626. // }
  627. // }
  628. },
  629. // 回调参数为包含columnIndex、value、values
  630. confirmValidityPeriod(e) {
  631. console.log('confirm', e)
  632. if (e.value[0] == '长期') {
  633. this.dataDetails.cardValidityDate = e.value[0]
  634. } else {
  635. this.dataDetails.cardValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  636. }
  637. this.isShowcardValidity = false
  638. },
  639. selectValidityPeriod() {
  640. this.isShowcardValidity = true
  641. },
  642. //设置图片
  643. setImage(e) {
  644. console.log(e);
  645. //显示在页面
  646. //this.imagesrc = e.path;
  647. if (e.dotype == 'idphoto') {
  648. _this.zjzClipper(e.path);
  649. } else if (e.dotype == 'watermark') {
  650. _this.watermark(e.path);
  651. } else {
  652. _this.savePhoto(e.path);
  653. }
  654. },
  655. //保存图片到相册,方便核查
  656. savePhoto(path) {
  657. this.imagesrc = path;
  658. // this.dataDetails.cardAddressUrl = path
  659. uploadImage(path, 'appData/',
  660. result => {
  661. // 上传成功
  662. console.log('图片地址', result)
  663. this.dataDetails.cardAddressUrl = result
  664. }
  665. )
  666. },
  667. uploadImg(type, index) {
  668. this.uploadType = type
  669. // this.isShowimgType = true
  670. // this.imgTypeSelect()
  671. this.index = index
  672. this.imgTypeSelect()
  673. },
  674. // 上传图片
  675. imgTypeSelect() {
  676. // console.log(val)
  677. uni.chooseImage({
  678. count: 1,
  679. // sourceType: this.$helper.chooseImage.sourceType,
  680. success: function(res) {
  681. console.log(JSON.stringify(res.tempFilePaths));
  682. uploadImage('image', res.tempFilePaths[0], 'appData/',
  683. result => {
  684. // 上传成功回调函数
  685. console.log('图片地址', result)
  686. switch (_this.uploadType) {
  687. // 身份正面
  688. case 1:
  689. _this.dataDetails.cardAddressUrl = result
  690. // 识别
  691. _this.$request.baseRequest('get',
  692. '/driverInfo/personShibie', {
  693. personImg: result,
  694. flag:1
  695. }).then(res => {
  696. if(res.data){
  697. _this.dataDetails.numberCard = res.data.recPersonNo
  698. if (res.data.recPerson) {
  699. _this.dataDetails.driverName = res.data.recPerson
  700. _this.dataDetails.driverCall = res.data.recPerson.substring(0,1)
  701. for (let i = 0; i < _this.dataDetails
  702. .hyDriverPayeeInfoList.length; i++
  703. ) { //收款人需与司机本人一致
  704. _this.dataDetails.hyDriverPayeeInfoList[i]
  705. .payeeName = res.data.recPerson
  706. }
  707. }
  708. _this.dataDetails.driverBirthday=res.data.recPersonBrithday
  709. }
  710. })
  711. .catch(res => {
  712. uni.$u.toast(res.message);
  713. });
  714. break
  715. // 身份反面
  716. case 2:
  717. _this.dataDetails.cardBackAddressUrl = result
  718. // 识别
  719. _this.$request.baseRequest('get',
  720. '/driverInfo/personShibie', {
  721. personImg: result,
  722. flag:2
  723. }).then(res => {
  724. if(res.data.idCardValidity){
  725. let date = res.data.idCardValidity.split("-")[1]
  726. _this.dataDetails.cardValidityDate = date.replace('.', '-').replace('.', '-')
  727. }
  728. })
  729. .catch(res => {
  730. uni.$u.toast(res.message);
  731. });
  732. break
  733. // 银行卡
  734. case 3:
  735. _this.bankType[_this.index] = []
  736. _this.$request.baseRequest('get',
  737. '/driverInfo/bankShibie', {
  738. bankImg: result,
  739. }).then(res => {
  740. _this.dataDetails.hyDriverPayeeInfoList[_this.index].payeeAddressUrl = result
  741. if (res.data.bankNo) {
  742. _this.dataDetails.hyDriverPayeeInfoList[_this
  743. .index].bankCard = res.data.bankNo
  744. }
  745. if (res.data.bankName) {
  746. _this.dataDetails.hyDriverPayeeInfoList[_this
  747. .index].bankDeposit = res.data.bankName
  748. }
  749. // 开户支行LIst
  750. if (res.data.bankNameZhihang) {
  751. _this.bankType[_this.index].push(res.data
  752. .bankNameZhihang)
  753. }
  754. _this.$forceUpdate()
  755. })
  756. .catch(res => {
  757. uni.$u.toast(res.message);
  758. });
  759. break;
  760. }
  761. }
  762. )
  763. }
  764. });
  765. // } else {
  766. // }
  767. // else {
  768. // switch (this.uploadType) {
  769. // // case 0:
  770. // // console.log('人车合影')
  771. // // break
  772. // case 1:
  773. // uni.$u.route('/pages/mine/camera/idcard/idcard?dotype=idcardface');
  774. // console.log('身份正面')
  775. // break
  776. // case 2:
  777. // uni.$u.route('/pages/mine/camera/idcard/idcard?dotype=badge');
  778. // console.log('身份反面')
  779. // break
  780. // case 3:
  781. // uni.$u.route('/pages/mine/camera/idcard/idcard?dotype=bank');
  782. // console.log('银行卡')
  783. // break
  784. // case 4:
  785. // }
  786. // }
  787. },
  788. //车牌号弹出键盘
  789. handleClick(e) {
  790. this.carNumber = e.value
  791. this.dataDetails.hyDriverCarInfoList[this.index].carNumber = e.value //键盘输入值
  792. },
  793. //车牌号弹出键盘
  794. handleShowKeyboard(index) {
  795. if (this.dataDetails.hyDriverCarInfoList[index].carNumber == '') {
  796. this.carNumber = ''
  797. } else {
  798. this.carNumber = this.dataDetails.hyDriverCarInfoList[index].carNumber
  799. }
  800. if (this.$refs.keyboard.open) {
  801. this.$refs.keyboard.open(false) //true 键盘显示 false 键盘隐藏
  802. } else {
  803. this.$refs.keyboard[0].open(false)
  804. }
  805. this.index = index
  806. if (this.$refs.keyboard.open) {
  807. this.$refs.keyboard.open(true) //true 键盘显示 false 键盘隐藏
  808. } else {
  809. this.$refs.keyboard[0].open(true)
  810. }
  811. },
  812. addCarNumber(val) {
  813. val.push({
  814. carNumber: '',
  815. addressUrl: '',
  816. carNumberColour: '',
  817. carType: '',
  818. carTotalWeight: '',
  819. carApprovedWeight: '',
  820. carLong: '',
  821. carWidth: '',
  822. carHeight: '',
  823. fileList1: []
  824. })
  825. },
  826. delCarNumber(val, index) {
  827. if (val.length > 1) {
  828. val.splice(index, 1)
  829. this.$forceUpdate()
  830. } else {
  831. let params = {
  832. type: 'error',
  833. message: "至少保留一个车牌号!",
  834. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  835. }
  836. this.$refs.uToast.show({
  837. ...params
  838. })
  839. }
  840. },
  841. addBankNumber(val) {
  842. val.push({
  843. payeeAddressUrl: '',
  844. bankCard: '',
  845. bankDeposit: '',
  846. bankDepositBranch: '',
  847. payeeName: this.dataDetails.driverName ? this.dataDetails.driverName : ""
  848. })
  849. },
  850. delBankNumber(val, index) {
  851. if (val.length > 1) {
  852. val.splice(index, 1)
  853. this.$forceUpdate()
  854. } else {
  855. let params = {
  856. type: 'error',
  857. message: "至少保留一张银行卡!",
  858. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  859. }
  860. this.$refs.uToast.show({
  861. ...params
  862. })
  863. }
  864. },
  865. next(val) {
  866. if (this.validate()) return
  867. for (let i = 0; i < this.dataDetails.hyDriverPayeeInfoList.length; i++) {
  868. if (this.dataDetails.hyDriverPayeeInfoList[i].payeeName != this.dataDetails.driverName) {
  869. this.$refs.uToast.show({
  870. type: 'error',
  871. message: "收款人需与司机本人一致!",
  872. })
  873. return
  874. } else {
  875. // 银行卡验证
  876. this.$request.baseRequest('get', '/driverPayeeInfo/bankCradShibie', {
  877. name: this.dataDetails.hyDriverPayeeInfoList[i].payeeName,
  878. idCard: this.dataDetails.numberCard,
  879. accountNo: this.dataDetails.hyDriverPayeeInfoList[i].bankCard
  880. }).then(
  881. res => {
  882. if (res.data.distinguishNum != "01") { //不等于01 证明银行卡验证不通过
  883. // this.payCheck = false //验证开关
  884. uni.$u.toast(res.data.distinguish);
  885. }else{
  886. uni.$u.route('/pages/mine/driverCertificationNext', {
  887. data: JSON.stringify(this.dataDetails),
  888. });
  889. }
  890. })
  891. }
  892. }
  893. // if (this.payCheck) {
  894. // uni.$u.route('/pages/mine/driverCertificationNext', {
  895. // data: JSON.stringify(this.dataDetails),
  896. // });
  897. // }
  898. },
  899. validate() {
  900. // true 为校验不通过
  901. if (uni.$u.test.isEmpty(this.dataDetails.driverName)) {
  902. this.$refs.uToast.show({
  903. type: 'error',
  904. message: "司机姓名不能为空!",
  905. })
  906. return true
  907. }
  908. if (!uni.$u.test.chinese(this.dataDetails.driverName)) {
  909. this.$refs.uToast.show({
  910. type: 'error',
  911. message: "姓名为汉字!",
  912. })
  913. return true
  914. }
  915. if (uni.$u.test.isEmpty(this.dataDetails.driverPhone)) {
  916. this.$refs.uToast.show({
  917. type: 'error',
  918. message: "联系电话不能为空!",
  919. })
  920. return true
  921. }
  922. if (!uni.$u.test.mobile(this.dataDetails.driverPhone)) {
  923. this.$refs.uToast.show({
  924. type: 'error',
  925. message: "电话号码格式错误!",
  926. })
  927. return true
  928. }
  929. // for (let i = 0; i < this.dataDetails.hyDriverCarInfoList.length; i++) {
  930. // let _item = this.dataDetails.hyDriverCarInfoList[i]
  931. // if (uni.$u.test.isEmpty(_item.carNumber)) {
  932. // this.$refs.uToast.show({
  933. // type: 'error',
  934. // message: "车牌号不能为空!",
  935. // })
  936. // return true
  937. // }
  938. // if (uni.$u.test.isEmpty(_item.fileList1)) {
  939. // this.$refs.uToast.show({
  940. // type: 'error',
  941. // message: "人车合影不能为空!",
  942. // })
  943. // return true
  944. // }
  945. // }
  946. if (uni.$u.test.isEmpty(this.dataDetails.driverPhone)) {
  947. this.$refs.uToast.show({
  948. type: 'error',
  949. message: "身份证人像页不能为空!",
  950. })
  951. return true
  952. }
  953. if (uni.$u.test.isEmpty(this.dataDetails.driverPhone)) {
  954. this.$refs.uToast.show({
  955. type: 'error',
  956. message: "身份证国徽页不能为空!",
  957. })
  958. return true
  959. }
  960. if (uni.$u.test.isEmpty(this.dataDetails.cardValidityDate)) {
  961. this.$refs.uToast.show({
  962. type: 'error',
  963. message: "身份证人有效截止日期不能为空!",
  964. })
  965. return true
  966. }
  967. for (let i = 0; i < this.dataDetails.hyDriverPayeeInfoList.length; i++) {
  968. let _item = this.dataDetails.hyDriverPayeeInfoList[i]
  969. if (uni.$u.test.isEmpty(_item.payeeAddressUrl)) {
  970. this.$refs.uToast.show({
  971. type: 'error',
  972. message: "银行卡不能为空!",
  973. })
  974. return true
  975. }
  976. if (uni.$u.test.isEmpty(_item.bankCard)) {
  977. this.$refs.uToast.show({
  978. type: 'error',
  979. message: "银行卡号码不能为空!",
  980. })
  981. return true
  982. }
  983. if (uni.$u.test.isEmpty(_item.bankDeposit)) {
  984. this.$refs.uToast.show({
  985. type: 'error',
  986. message: "开户行不能为空!",
  987. })
  988. return true
  989. }
  990. if (uni.$u.test.isEmpty(_item.bankDepositBranch)) {
  991. this.$refs.uToast.show({
  992. type: 'error',
  993. message: "开户支行不能为空!",
  994. })
  995. return true
  996. }
  997. if (uni.$u.test.isEmpty(_item.payeeName)) {
  998. this.$refs.uToast.show({
  999. type: 'error',
  1000. message: "收款人姓名不能为空!",
  1001. })
  1002. return true
  1003. }
  1004. }
  1005. return false
  1006. }
  1007. },
  1008. };
  1009. </script>
  1010. <style scoped lang="scss">
  1011. /deep/.u-radio {
  1012. margin-bottom: 0 !important;
  1013. }
  1014. .top-head {
  1015. background: #2772FB;
  1016. height: 80rpx;
  1017. width: 100%;
  1018. }
  1019. .container {
  1020. position: relative;
  1021. top: -60rpx;
  1022. margin: 0 20rpx;
  1023. }
  1024. .row4-img {
  1025. width: 32rpx;
  1026. height: 32rpx;
  1027. }
  1028. .content1,
  1029. .content2,
  1030. .content3 {
  1031. .left-text {
  1032. // background: red;
  1033. width: 290rpx;
  1034. color: #333333;
  1035. display: flex;
  1036. align-items: center;
  1037. }
  1038. .row {
  1039. border-bottom: 1px solid #EEEEEE;
  1040. padding-bottom: 28rpx;
  1041. margin-top: 26rpx;
  1042. .ch-style {}
  1043. }
  1044. .row-ch {
  1045. padding-right: 180rpx;
  1046. box-sizing: border-box;
  1047. // background-color: red;
  1048. }
  1049. }
  1050. .content1-car {
  1051. margin-top: 20rpx;
  1052. .left-text {
  1053. // background: red;
  1054. width: 290rpx;
  1055. color: #333333;
  1056. display: flex;
  1057. align-items: center;
  1058. }
  1059. .row {
  1060. border-bottom: 1px solid #EEEEEE;
  1061. padding-bottom: 28rpx;
  1062. margin-top: 26rpx;
  1063. .color {
  1064. // background: blue;
  1065. width: 340rpx;
  1066. }
  1067. }
  1068. }
  1069. .input-ckg {
  1070. height: 86rpx;
  1071. margin-top: 0 !important;
  1072. padding-bottom: 0 !important;
  1073. .u-input {
  1074. height: 100%;
  1075. background: #F7F8FA;
  1076. padding-left: 10rpx !important;
  1077. padding-right: 85rpx !important;
  1078. }
  1079. .star {
  1080. display: flex;
  1081. align-items: center;
  1082. margin: 0 10rpx;
  1083. }
  1084. .input-positon {
  1085. position: relative;
  1086. }
  1087. .position-right {
  1088. position: absolute;
  1089. right: 20rpx;
  1090. top: 0;
  1091. width: 60rpx;
  1092. height: 50rpx;
  1093. bottom: 0;
  1094. margin: auto;
  1095. }
  1096. }
  1097. .picture {
  1098. margin-top: 20rpx;
  1099. background: #F5F6FA;
  1100. width: 212rpx;
  1101. height: 212rpx;
  1102. border-radius: 20rpx;
  1103. display: flex;
  1104. flex-direction: column;
  1105. justify-content: center;
  1106. align-items: center;
  1107. color: #6A7282;
  1108. }
  1109. .add-car {
  1110. background: #FFFFFF;
  1111. margin: 20rpx 50rpx;
  1112. border-radius: 50rpx;
  1113. display: flex;
  1114. justify-content: center;
  1115. align-items: center;
  1116. padding: 20rpx 0;
  1117. .icon {
  1118. margin-right: 20rpx;
  1119. }
  1120. .car-text {
  1121. font-size: 36rpx;
  1122. font-weight: 700;
  1123. color: #2772FB;
  1124. }
  1125. }
  1126. .carlist-item {
  1127. margin-top: 20rpx;
  1128. padding: 0 20rpx 20rpx 20rpx;
  1129. background: white;
  1130. border-radius: 10rpx;
  1131. position: relative;
  1132. .del-car {
  1133. position: absolute;
  1134. top: 0;
  1135. right: 0;
  1136. width: 80rpx;
  1137. height: 80rpx;
  1138. }
  1139. }
  1140. .content2,
  1141. .content3 {
  1142. .del-bank {
  1143. position: absolute;
  1144. top: 0;
  1145. right: 0;
  1146. width: 80rpx;
  1147. height: 80rpx;
  1148. }
  1149. .picture {
  1150. width: 100%;
  1151. height: 440rpx;
  1152. // background: red;
  1153. position: relative;
  1154. .text {
  1155. margin-top: 20rpx;
  1156. }
  1157. }
  1158. .picture1 {
  1159. background: url(../../static/images/mine/zm.png);
  1160. background-size: 100% 100%;
  1161. }
  1162. .picture2 {
  1163. background: url(../../static/images/mine/gh.png);
  1164. background-size: 100% 100%;
  1165. }
  1166. .picture3 {
  1167. background: url(../../static/images/mine/yhkzm.png);
  1168. background-size: 100% 100%;
  1169. }
  1170. .xj-image {
  1171. width: 100rpx;
  1172. height: 100rpx;
  1173. }
  1174. .title {
  1175. color: #999999;
  1176. margin: 20rpx 0;
  1177. }
  1178. }
  1179. .content3 {
  1180. position: relative;
  1181. background: white;
  1182. margin: 20rpx 0 0 0;
  1183. border-radius: 10rpx;
  1184. padding: 20rpx;
  1185. .khzh-styel {
  1186. // width: 350rpx;
  1187. }
  1188. .type {
  1189. background: #2772FB;
  1190. border-radius: 10rpx;
  1191. color: white;
  1192. box-sizing: border-box;
  1193. padding: 4rpx 10rpx;
  1194. font-size: 26rpx;
  1195. display: flex;
  1196. justify-content: center;
  1197. align-items: center;
  1198. }
  1199. .select-bankzh {
  1200. width: 230rpx;
  1201. height: 48rpx;
  1202. }
  1203. }
  1204. .content4 {
  1205. display: flex;
  1206. justify-content: center;
  1207. background: white;
  1208. padding: 40rpx 20rpx 50rpx 20rpx;
  1209. .next-btn {
  1210. background: #22C572;
  1211. width: 90%;
  1212. padding: 20rpx 20rpx;
  1213. text-align: center;
  1214. color: #FFFFFF;
  1215. border-radius: 50rpx;
  1216. }
  1217. }
  1218. .yzm {}
  1219. .yzm-btn {
  1220. background: #2772FB;
  1221. color: white;
  1222. height: 60rpx;
  1223. }
  1224. .preview-card-img {
  1225. /deep/uni-image>div,
  1226. uni-image>img {
  1227. // transform: scale(1.5) rotate(-90deg);
  1228. }
  1229. }
  1230. .del-card {
  1231. position: absolute;
  1232. top: -10rpx;
  1233. right: -6rpx;
  1234. width: 80rpx;
  1235. height: 80rpx;
  1236. z-index: 9;
  1237. }
  1238. </style>