driverCertification.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. <template>
  2. <view class="content">
  3. <view class="content1 content-other">
  4. <view class="flex flex-space-between">
  5. <view>姓名</view>
  6. <u--input placeholder="请输入内容" inputAlign='right' border="none" v-model="dataDetails.driverName">
  7. </u--input>
  8. </view>
  9. <view class="flex flex-space-between">
  10. <view>联系电话</view>
  11. <u--input placeholder="请输入联系电话" inputAlign='right' border="none" v-model="dataDetails.driverPhone">
  12. </u--input>
  13. </view>
  14. <view class="flex s-row" v-for="(item,index) in dataDetails.driverCarInfoList" :key='index'>
  15. <view class="flex flex-space-between width100">
  16. <view class="left">
  17. 车牌号-{{index+1}}
  18. </view>
  19. <view class="right flex">
  20. <input class="car-uumber" v-model='item.carNumber' @click.stop="handleShowKeyboard(index)"
  21. :disabled="true" placeholder="输入7位车牌号" name="input"></input>
  22. <!-- <u-input v-model="item1.carNo" placeholder="输入7位车牌号" /> -->
  23. <view class="flex">
  24. <view @click="addCarNumber(dataDetails.driverCarInfoList)" style="margin-right: 20rpx;">
  25. <image class='row4-img'
  26. src="https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/jia%402x.png">
  27. </image>
  28. </view>
  29. <view @click="delCarNumber(dataDetails.driverCarInfoList,index)">
  30. <image class='row4-img'
  31. src="https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/jian%402x.png">
  32. </image>
  33. </view>
  34. </view>
  35. </view>
  36. </view>
  37. <view class="width100">
  38. <view class="">人车合影-{{index+1}}</view>
  39. <u-button type="primary" @click="uploadImg(0,item)">上传人车合影</u-button>
  40. <image class="preview" :src="item.addressUrl" mode="aspectFit"
  41. style="width:710rpx:height:710rpx;margin: 20rpx;">
  42. <!-- <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
  43. :size-type="['compressed']" @on-success="getImgUrl" @on-error="onError" @on-remove="onRemove"
  44. @on-uploaded="isAdd = true" :before-upload="filterFileType" @on-progress="onProgress"></upload> -->
  45. </view>
  46. </view>
  47. </view>
  48. <u-divider text="分割线"></u-divider>
  49. <view class="content2 content-other">
  50. <u-button type="primary" @click="uploadImg(1)">上传身份证人像</u-button>
  51. <!-- <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
  52. :size-type="['compressed']" @on-success="getImgUrl1" @on-error="onError" @on-remove="onRemove"
  53. @on-uploaded="isAdd = true" :before-upload="filterFileType" :options="uploadOptions1"
  54. :custom="uploadCustom1" @on-progress="onProgress"></upload> -->
  55. <!-- <navigator class="buttons" url="./camera/idcard/idcard?dotype=face"><button type="primary">打开身份证人像面采集相机</button></navigator> -->
  56. <!-- <view>拍摄结果预览图,见下方</view> -->
  57. <image class="preview" :src="dataDetails.cardAddressUrl" mode="aspectFit"
  58. style="width:710rpx:height:710rpx;margin: 20rpx;">
  59. </image>
  60. <view class="flex flex-space-between">
  61. <view>身份证号</view>
  62. <u--input placeholder="请输入身份证号" inputAlign='right' border="none" v-model="dataDetails.numberCard">
  63. </u--input>
  64. </view>
  65. <u-button type="primary" @click="uploadImg(2)">上传身份证国徽页</u-button>
  66. <image class="preview" :src="dataDetails.cardBackAddressUrl" mode="aspectFit"
  67. style="width:710rpx:height:710rpx;margin: 20rpx;">
  68. </image>
  69. <view class="flex flex-space-between">
  70. <view>身份证截止日期</view>
  71. <view class="" @click="selectValidityPeriod">
  72. {{dataDetails.cardValidityDate?dataDetails.cardValidityDate:'选择身份证截止日期'}}</view>
  73. </view>
  74. <u-picker :show="isShowcardValidity" ref="uPicker" :columns="validityPeriod"
  75. @confirm="confirmValidityPeriod" @change="changeHandler">
  76. </u-picker>
  77. </view>
  78. <u-divider text="分割线"></u-divider>
  79. <view class="content3 flex s-row" v-for="(item,index) in dataDetails.bankList" :key='index'>
  80. <view class="flex flex-space-between width100">
  81. <view class="left">
  82. 银行卡-{{index+1}}
  83. </view>
  84. <view class="right flex">
  85. <view class="flex">
  86. <view @click="addBankNumber(dataDetails.bankList)" style="margin-right: 20rpx;">
  87. <image class='row4-img'
  88. src="https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/jia%402x.png">
  89. </image>
  90. </view>
  91. <view @click="delBankNumber(dataDetails.bankList,index)">
  92. <image class='row4-img'
  93. src="https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/jian%402x.png">
  94. </image>
  95. </view>
  96. </view>
  97. </view>
  98. </view>
  99. <!-- <view class="width100">
  100. <view class="">上传银行卡号面</view>
  101. <upload class="upload" ref="upload" :action="action" :max-size="maxSize" :max-count="1"
  102. :size-type="['compressed']" @on-success="getImgUrl" @on-remove="onRemove" delIconSize='30'
  103. delBgColor='rgba(0,0,0,0.4)' delIcon="trash" @on-uploaded="isAdd = true"
  104. :before-upload="filterFileType" :options="uploadOptions3" :custom="uploadCustom3"></upload>
  105. </view> -->
  106. <u-button type="primary" @click="uploadImg(3)">上传银行卡号页</u-button>
  107. <view class="flex flex-space-between width100">
  108. <view>银行卡卡号</view>
  109. <view class="flex">
  110. <u--input placeholder="输入银行卡号码" inputAlign='right' border="none" v-model="dataDetails.name">
  111. </u--input>
  112. <u--image src="../../static/images/xiangji-2.png" width="40px" height="40px" @click='photograph'>
  113. </u--image>
  114. </view>
  115. </view>
  116. <view class="flex flex-space-between width100">
  117. <view>开户行</view>
  118. <view class="flex">
  119. <u--input placeholder="输入开户行" inputAlign='right' border="none" v-model="dataDetails.name">
  120. </u--input>
  121. </view>
  122. </view>
  123. <view class="flex flex-space-between width100">
  124. <view>开户支行</view>
  125. <view class="flex">
  126. <u--input placeholder="选择开户支行" inputAlign='right' border="none" v-model="dataDetails.name">
  127. </u--input>
  128. <view>手动输入</view>
  129. </view>
  130. </view>
  131. <view class="flex flex-space-between width100">
  132. <view>收款人</view>
  133. <view class="flex">
  134. <u--input placeholder="输入收款人姓名" inputAlign='right' border="none" v-model="dataDetails.name">
  135. </u--input>
  136. </view>
  137. </view>
  138. </view>
  139. <view class="content4">
  140. <u-button type="primary" @click="next()">
  141. 下一步
  142. </u-button>
  143. </view>
  144. <master-keyboard ref="keyboard" keyboardtype="car" :show="keyShow" :randomNumber="true" :newCar="false"
  145. :defaultValue="carNumber" @keyboardClick="handleClick"></master-keyboard>
  146. <u-toast ref="uToast"></u-toast>
  147. <u-action-sheet :actions="$helper.imgTypeList" :title="$helper.imgType" :show="isShowimgType"
  148. @select="imgTypeSelect" :closeOnClickOverlay="true" :closeOnClickAction="true" @close="isShowimgType=false">
  149. </u-action-sheet>
  150. </view>
  151. </template>
  152. <script>
  153. import keyboard from "@/components/master-keyboard/master-keyboard.vue";
  154. import upload from '@/components/upload.vue';
  155. import uploadImage from '@/components/ossutil/uploadFile.js';
  156. var _this;
  157. export default {
  158. components: {
  159. keyboard,
  160. upload
  161. },
  162. data() {
  163. return {
  164. index:'',
  165. validityPeriod: [],
  166. isShowcardValidity: false,
  167. uploadType: '',
  168. isShowimgType: false,
  169. // uploadOptions1: {
  170. // "text": "上传身份证头像页",
  171. // "bgc": "https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/identityup%282%29.png"
  172. // },
  173. // uploadOptions2: {
  174. // "text": "上传身份证国徽页",
  175. // "bgc": "https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/identitylow%282%29.png"
  176. // },
  177. // uploadOptions3: {
  178. // "text": "上传银行卡正面",
  179. // "bgc": "https://taohaoliang.oss-cn-beijing.aliyuncs.com/app/tmp/bankup%282%29.png"
  180. // },
  181. carInfo: '',
  182. dataDetails: {
  183. commonId: '',
  184. driverName: '',
  185. driverPhone: '',
  186. cardAddressUrl: '',
  187. cardBackAddressUrl: '',
  188. cardValidityDate: '',
  189. driverType: '',
  190. driverLicenseHomePage: '',
  191. driverLicenseBackPage: '',
  192. driverLicenseValidityDate: '',
  193. drivingLicenseHomePage: '',
  194. drivingLicenseBackPage: '',
  195. drivingLicenseValidityDate: '',
  196. trailerLicenseHomePage: '',
  197. trailerLicenseBackPage: '',
  198. trailerLicenseValidityDate: '',
  199. qualificationCertificate: '',
  200. qualificationCertificateValidityDate: '',
  201. operationCertificate: '',
  202. operationCertificateValidityDate: '',
  203. trailerOperationCertificate: '',
  204. trailerOperationCertificateValidityDate: '',
  205. numberCard: '',
  206. numberCard: '',
  207. numberCard: '',
  208. numberCard: '',
  209. numberCard: '',
  210. numberCard: '',
  211. numberCard: '',
  212. numberCard: '',
  213. numberCard: '',
  214. numberCard: '',
  215. numberCard: '',
  216. numberCard: '',
  217. numberCard: '',
  218. driverCarInfoList: [{
  219. carNumber: '',
  220. addressUrl: ''
  221. }],
  222. driverPayeeInfoList: [{
  223. payeeAddressUrl: '',
  224. bankCard: '',
  225. bankDeposit: '',
  226. bankDepositBranch: '',
  227. payeeName: ''
  228. }],
  229. },
  230. keyShow: false,
  231. carNumber: '',
  232. action: this.$helper.ossUploadUrl,
  233. maxSize: 50 * 1024 * 1024, //限制文件大小 50M
  234. isAdd: true,
  235. imagesrc: ''
  236. };
  237. },
  238. onLoad() {
  239. _this = this;
  240. this.makeValidityPeriod()
  241. },
  242. methods: {
  243. changeHandler(e) {
  244. const {
  245. columnIndex,
  246. value,
  247. values,
  248. index,
  249. picker = this.$refs.uPicker
  250. } = e
  251. // if (columnIndex === 0) {
  252. // debugger
  253. // if (e.index != 0) {
  254. // picker.setColumnValues(1, this.validityPeriod[1].shift())
  255. // }
  256. // } else if (columnIndex === 1) {
  257. // if (e.index != 0) {
  258. // picker.setColumnValues(2, this.validityPeriod[2].shift())
  259. // }
  260. // }
  261. },
  262. // 回调参数为包含columnIndex、value、values
  263. confirmValidityPeriod(e) {
  264. debugger
  265. console.log('confirm', e)
  266. if (e.value[0] == '长期') {
  267. this.dataDetails.cardValidityDate = e.value[0]
  268. } else {
  269. this.dataDetails.cardValidityDate = e.value[0] + '-' + e.value[1] + '-' + e.value[2]
  270. }
  271. this.isShowcardValidity = false
  272. },
  273. makeValidityPeriod() {
  274. //获取当前年
  275. let nowDate = new Date();
  276. let year = nowDate.getFullYear()
  277. let _list1 = ['长期']
  278. // let _list2 = ["一月","二月","三月","四月","五月","六月","七月","八月","九月","十月","十一月","十二月"]
  279. let _list2 = ['长期', "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12"]
  280. let _list3 = ['长期', "01", "02", "03", "04", "05", "06", "07", "08", "09", "10", "11", "12", "13", "14",
  281. "15", "16", "17", "18", "19", "20", "21", "22", "23", "24", "25", "26", "27", "28", "29", "30",
  282. "31"
  283. ]
  284. let _ValidityPeriod = []
  285. for (let i = 0; i < 30; i++) {
  286. _list1.push(year + i)
  287. }
  288. this.validityPeriod.push(_list1, _list2, _list3)
  289. },
  290. selectValidityPeriod() {
  291. this.isShowcardValidity = true
  292. },
  293. //设置图片
  294. setImage(e) {
  295. debugger
  296. console.log(e);
  297. //显示在页面
  298. //this.imagesrc = e.path;
  299. if (e.dotype == 'idphoto') {
  300. _this.zjzClipper(e.path);
  301. } else if (e.dotype == 'watermark') {
  302. _this.watermark(e.path);
  303. } else {
  304. _this.savePhoto(e.path);
  305. }
  306. },
  307. //保存图片到相册,方便核查
  308. savePhoto(path) {
  309. debugger
  310. this.imagesrc = path;
  311. uploadImage(path, 'appData/',
  312. result => {
  313. // 上传成功
  314. console.log('图片地址', result)
  315. }
  316. )
  317. //保存到相册
  318. // uni.saveImageToPhotosAlbum({
  319. // filePath: path,
  320. // success: () => {
  321. // uni.showToast({
  322. // title: '已保存至相册',
  323. // duration: 2000
  324. // });
  325. // }
  326. // });
  327. },
  328. uploadImg(type, val) {
  329. debugger
  330. this.uploadType = type
  331. this.isShowimgType = true
  332. this.carInfo = val
  333. },
  334. photograph() {
  335. console.log('拍照')
  336. let that = this;
  337. uni.chooseImage({
  338. count: 1,
  339. success: function(res) {
  340. console.log(JSON.stringify(res.tempFilePaths));
  341. uploadImage(res.tempFilePaths[0], 'appData/',
  342. result => {
  343. // 上传成功
  344. console.log('图片地址', result)
  345. }
  346. )
  347. }
  348. });
  349. },
  350. imgTypeSelect(val) {
  351. debugger
  352. console.log(val)
  353. console.log(this.uploadType)
  354. if (val.name == '相册') {
  355. uni.chooseImage({
  356. count: 1,
  357. sourceType: this.$helper.chooseImage.sourceType,
  358. success: function(res) {
  359. console.log(JSON.stringify(res.tempFilePaths));
  360. uploadImage(res.tempFilePaths[0], 'appData/',
  361. result => {
  362. // 上传成功
  363. console.log('图片地址', result)
  364. switch (_this.uploadType) {
  365. case 0:
  366. //赋值上传图片图片路径
  367. for (let i = 0; i < _this.dataDetails.driverCarInfoList
  368. .length; i++) {
  369. let _item = _this.dataDetails.driverCarInfoList[i]
  370. if (_item.carNumber == _this.carInfo.carNumber) {
  371. _item.addressUrl = result
  372. }
  373. }
  374. console.log('人车合影')
  375. break
  376. case 1:
  377. console.log('身份正面')
  378. break
  379. case 2:
  380. console.log('身份反面')
  381. break
  382. case 3:
  383. console.log('银行卡')
  384. break
  385. case 4:
  386. }
  387. }
  388. )
  389. }
  390. });
  391. } else {
  392. switch (this.uploadType) {
  393. case 0:
  394. console.log('人车合影')
  395. break
  396. case 1:
  397. uni.$u.route('/pages/mine/camera/idcard/idcard?dotype=face');
  398. console.log('身份正面')
  399. break
  400. case 2:
  401. console.log('身份反面')
  402. break
  403. case 3:
  404. console.log('银行卡')
  405. break
  406. case 4:
  407. }
  408. }
  409. },
  410. //身份证正面
  411. getImgUrl1(src) {
  412. // console.log(src)
  413. // console.log('------------res-----------')
  414. // let that = this;
  415. // that.id[0] = src
  416. // that.id1 = src
  417. // that.certificates = false
  418. // that.personImgs.personImg = that.id[0]
  419. // that.$api.doRequest('get', '/driverViewInfo/personShibie', that
  420. // .personImgs).then(res => {
  421. // if (res.data.data.recPerson != null) {
  422. // if (res.data.data.recPerson != "") {
  423. // that.$set(that.DriverViewInfo, 'driverName', res
  424. // .data.data.recPerson)
  425. // }
  426. // }
  427. // if (res.data.data.recPersonNo != null) {
  428. // if (res.data.data.recPersonNo != "") {
  429. // that.$set(that.DriverViewInfo, 'numberCard', res
  430. // .data.data.recPersonNo)
  431. // }
  432. // }
  433. // }).catch(res => {
  434. // uni.showToast({
  435. // title: res.data.message,
  436. // icon: 'none',
  437. // duration: 2000
  438. // })
  439. // })
  440. },
  441. handleClick(e) {debugger
  442. this.carNumber = e.value
  443. this.dataDetails.driverCarInfoList[this.index].carNumber = e.value //键盘输入值
  444. },
  445. handleShowKeyboard(index) {
  446. debugger
  447. if (this.dataDetails.driverCarInfoList[index].carNumber == '') {
  448. this.carNumber = ''
  449. } else {
  450. this.carNumber = this.dataDetails.driverCarInfoList[index].carNumber
  451. }
  452. if (this.$refs.keyboard.open) {
  453. this.$refs.keyboard.open(false) //true 键盘显示 false 键盘隐藏
  454. } else {
  455. this.$refs.keyboard[0].open(false)
  456. }
  457. this.index = index
  458. if (this.$refs.keyboard.open) {
  459. this.$refs.keyboard.open(true) //true 键盘显示 false 键盘隐藏
  460. } else {
  461. this.$refs.keyboard[0].open(true)
  462. }
  463. },
  464. addCarNumber(val) {
  465. val.push({
  466. carNo: ''
  467. })
  468. },
  469. delCarNumber(val, index) {
  470. if (val.length > 1) {
  471. val.splice(index, 1)
  472. this.$forceUpdate()
  473. } else {
  474. let params = {
  475. type: 'error',
  476. message: "至少保留一个车牌号!",
  477. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  478. }
  479. this.$refs.uToast.show({
  480. ...params
  481. })
  482. }
  483. },
  484. addBankNumber(val) {
  485. val.push({
  486. bankNo: ''
  487. })
  488. },
  489. delBankNumber(val, index) {
  490. if (val.length > 1) {
  491. val.splice(index, 1)
  492. this.$forceUpdate()
  493. } else {
  494. let params = {
  495. type: 'error',
  496. message: "至少保留一张银行卡!",
  497. iconUrl: 'https://cdn.uviewui.com/uview/demo/toast/success.png'
  498. }
  499. this.$refs.uToast.show({
  500. ...params
  501. })
  502. }
  503. },
  504. next(val) {
  505. console.log(111111111111)
  506. uni.$u.route('/pages/mine/driverCertificationNext', {
  507. id: 1,
  508. });
  509. }
  510. },
  511. };
  512. </script>
  513. <style scoped lang="scss">
  514. .row4-img {
  515. width: 32rpx;
  516. height: 32rpx;
  517. }
  518. </style>