driverCertification.vue 37 KB

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