driverCertification.vue 36 KB

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