driverCertification.vue 37 KB

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