Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

rescind-carId-select.vue 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688
  1. <template>
  2. <view class="content-wrap">
  3. <view @click="tabChange(true)">
  4. <view :class="state.isMyPeopple ? 'big' : 'nomal'"> 本人车辆 </view>
  5. <view :class="state.isMyPeopple ? 'tip' : ''"> </view>
  6. </view>
  7. <view @click="tabChange(false)" style="margin-left: 60rpx" class="">
  8. <view :class="state.isMyPeopple ? 'nomal' : 'big'"> 他人车辆 </view>
  9. <view :class="state.isMyPeopple ? '' : 'tip'"> </view>
  10. </view>
  11. </view>
  12. <view v-if="state.isMyPeopple" class="content">
  13. <view class="item" v-for="(item, i) in list" :key="i">
  14. <view class="iten-left">
  15. <image :src="`${$imgUrl}che.png`" mode=""></image>
  16. <text>{{ item.name }}</text>
  17. </view>
  18. <view class="choose-item" @click="choose(i, item)">
  19. <view class="active" v-if="flag == i"> </view>
  20. </view>
  21. </view>
  22. </view>
  23. <view v-else class="content">
  24. <view class="title"> 车主信息 </view>
  25. <view class="item-tips">
  26. <view class="title"> 上传后请核对识别信息 </view>
  27. <view class="tip"> 如有错误请及时手动修改 </view>
  28. </view>
  29. <view class="picture-wrapper" @click="cardImageOcr('1')">
  30. <view class="bg">
  31. <view class="">
  32. <view class="name"> 人像面 </view>
  33. <view class="value"> 上传身份证的人像面 </view>
  34. <view class="tip">
  35. <view class="tip-value"> 拍摄规范 </view>
  36. </view>
  37. </view>
  38. <image
  39. v-if="!state.form.userPosImgUrl"
  40. class="icon"
  41. :src="`${$imgUrl}applyCard/renxiang.png`"
  42. >
  43. </image>
  44. <image v-else class="icon" :src="state.form.userPosImgUrl"></image>
  45. </view>
  46. </view>
  47. <view class="picture-wrapper" @click="cardImageOcr('2')">
  48. <view class="bg">
  49. <view class="">
  50. <view class="name"> 国徽面 </view>
  51. <view class="value"> 上传身份证的国徽面 </view>
  52. <view class="tip">
  53. <view class="tip-value"> 拍摄规范 </view>
  54. </view>
  55. </view>
  56. <image
  57. v-if="!state.form.userNegImgUrl"
  58. class="icon"
  59. :src="`${$imgUrl}applyCard/guohui.png`"
  60. >
  61. </image>
  62. <image v-else class="icon" :src="state.form.userNegImgUrl"></image>
  63. </view>
  64. </view>
  65. <view class="shibie-wrapper">
  66. <view class="title"> 识别内容如下 </view>
  67. <u-form label-width="200" :model="state.form" ref="uForm">
  68. <u-form-item label="姓名">
  69. <u-input v-model="state.form.userName" />
  70. </u-form-item>
  71. <u-form-item label="性别">
  72. <u-input v-model="state.form.gender" type="select" />
  73. </u-form-item>
  74. <u-form-item label="身份证号">
  75. <u-input v-model="state.form.userIdNum" />
  76. </u-form-item>
  77. <u-form-item label="证件有效期">
  78. <u-input v-model="state.form.tmerValidity" type="select" />
  79. </u-form-item>
  80. <u-form-item label="地址">
  81. <u-input v-model="state.form.address" />
  82. </u-form-item>
  83. </u-form>
  84. </view>
  85. <view style="margin-top: 30rpx" class="title"> 行驶证信息 </view>
  86. <view class="item-tips">
  87. <view class="title"> 上传后请核对识别信息 </view>
  88. <view class="tip"> 如有错误请及时手动修改 </view>
  89. </view>
  90. <view class="picture-wrapper" @click="cardDbImageOcr('1')">
  91. <view class="bg">
  92. <view class="">
  93. <view class="name"> 行驶证正页 </view>
  94. <view class="value"> 上传 行驶证正页 </view>
  95. <view class="tip">
  96. <view class="tip-value"> 拍摄规范 </view>
  97. </view>
  98. </view>
  99. <image
  100. v-if="!state.form.vehPosImgUrl"
  101. class="icon"
  102. :src="`${$imgUrl}applyCard/car-zhu.png`"
  103. >
  104. </image>
  105. <image v-else class="icon" :src="state.form.vehPosImgUrl"></image>
  106. </view>
  107. </view>
  108. <view class="picture-wrapper" @click="cardDbImageOcr('2')">
  109. <view class="bg">
  110. <view class="">
  111. <view class="name"> 行驶证副业 </view>
  112. <view class="value"> 上传行驶证副业 </view>
  113. <view class="tip">
  114. <view class="tip-value"> 拍摄规范 </view>
  115. </view>
  116. </view>
  117. <image
  118. v-if="!state.form.vehNegImgUrl"
  119. class="icon"
  120. :src="`${$imgUrl}applyCard/car-fu.png`"
  121. >
  122. </image>
  123. <image v-else class="icon" :src="state.form.vehNegImgUrl"></image>
  124. </view>
  125. </view>
  126. <view class="shibie-wrapper">
  127. <view class="title"> 识别内容如下 </view>
  128. <u-form label-width="200" :model="state.form" ref="uForm">
  129. <u-form-item label="车牌号">
  130. <u-input v-model="state.form.vehicleId" />
  131. </u-form-item>
  132. <u-form-item label="所有人">
  133. <u-input v-model="state.form.man" />
  134. </u-form-item>
  135. <u-form-item label="车辆类型">
  136. <u-input v-model="state.form.vehicleType" />
  137. </u-form-item>
  138. <u-form-item label="使用性质">
  139. <u-input v-model="state.form.character" />
  140. </u-form-item>
  141. <u-form-item label="车辆识别代码">
  142. <u-input v-model="state.form.vin" />
  143. </u-form-item>
  144. <u-form-item label="发动机号码">
  145. <u-input v-model="state.form.engineNum" />
  146. </u-form-item>
  147. <u-form-item label="注册日期">
  148. <u-input v-model="state.form.register" />
  149. </u-form-item>
  150. <u-form-item label="发证日期">
  151. <u-input v-model="state.form.issueDate" />
  152. </u-form-item>
  153. <u-form-item label="核定载人数">
  154. <u-input v-model="state.form.approvedCount" />
  155. </u-form-item>
  156. <u-form-item label="整备质量">
  157. <u-input v-model="state.form.maintenaceMass" />
  158. </u-form-item>
  159. <u-form-item label="外廓尺寸">
  160. <u-input v-model="state.form.vehicleDimensions" />
  161. </u-form-item>
  162. <u-form-item label="总质量">
  163. <u-input v-model="state.form.totalMass" />
  164. </u-form-item>
  165. </u-form>
  166. </view>
  167. <view class="green-tip">
  168. 如识别信息有误,请手动修改,确认无误后,点击下一步!
  169. </view>
  170. <view class="action">
  171. <button type="default" class="button" @click="savaHandle()">
  172. 下一步
  173. </button>
  174. </view>
  175. </view>
  176. </template>
  177. <script setup lang="ts">
  178. import selectCar from "./select-car.vue";
  179. import { pathToBase64 } from "@/utils/image-tools/index.js";
  180. import { reactive } from "vue";
  181. import { onLoad, onShow } from "@dcloudio/uni-app";
  182. import {
  183. etcOcrCard,
  184. etcUserCardInfoSubmit,
  185. fileUpload,
  186. etcCarOcrCard,
  187. } from "@/utils/network/api.js";
  188. import { request } from "@/utils/network/request.js";
  189. import { stringToJson } from "@/utils/network/encryption";
  190. import navBar from "../../components/nav-bar/nav-bar2.vue";
  191. // ##################
  192. import { ref } from "vue";
  193. import { navTo } from "../../utils/utils";
  194. const list = reactive([
  195. {
  196. name: "A12345",
  197. },
  198. {
  199. name: "B12345",
  200. },
  201. {
  202. name: "C12345",
  203. },
  204. ]);
  205. const flag = ref("0");
  206. const choose = (i, item) => {
  207. flag.value = i;
  208. console.log("选择得数据", item);
  209. navTo("/after-sale/rescind-carId/base-change-people");
  210. };
  211. // ######################
  212. const state = reactive({
  213. ocrData: {
  214. name: "",
  215. gender: "",
  216. idno: "",
  217. address: "",
  218. begindate: "",
  219. enddate: "",
  220. tel: "",
  221. tmerValidity: "",
  222. },
  223. form: {
  224. userName: "", //开户人姓名
  225. userIdNum: "", //用户证件号码
  226. userPosImgUrl: "", //身份证正面
  227. userNegImgUrl: "", //身份证反面
  228. address: "", //开户人地址
  229. gender: "",
  230. tmerValidity: "",
  231. man: "", //所有人
  232. character: "", //使用性质
  233. register: "", //注册日期
  234. customerId: "", //用户编号
  235. vehicleId: "", //车牌编号
  236. issueDate: "", //发证日期
  237. vehPosImgUrl: "", //行驶证正面
  238. vehNegImgUrl: "", //行驶证证反面
  239. type: "0", //0,客车 1.货车
  240. useUserType: 0, //车辆用户类型
  241. useUserTypeName: "普通车",
  242. vehicleSign: 2, //前/后装标识
  243. vin: "", //车辆识别代号
  244. engineNum: "", //发动机号码
  245. vehicleType: "", //车辆类型
  246. vehicleModel: "", //行驶证品牌型号
  247. approvedCount: undefined, //核定人数
  248. totalMass: undefined, //总质量
  249. maintenaceMass: undefined, //整备质量
  250. permittedWeight: "", //核定载质量
  251. vehicleDimensions: "", //车辆尺寸
  252. permittedTowWeight: "", //准牵引总质量
  253. axleCount: "", //车轴数
  254. ownerName: "", //车主姓名
  255. ownerIdType: "", //车主证件类型
  256. ownerIdNum: "", //车主证件号码
  257. ownPosImgUrl: "", //车主证件正面图片
  258. ownNegImgUrl: "", //车主证件反面图片
  259. agreementId: "", //签约编号
  260. channelId: "5201018892300000001",
  261. },
  262. orderId: "",
  263. isMyPeopple: true,
  264. buchongData: {
  265. conmpany: "李某一",
  266. type: "居民身份证",
  267. card: "23728347626342332",
  268. phone: "",
  269. },
  270. });
  271. const savaHandle = () => {
  272. navTo("/after-sale/rescind-carId/result");
  273. // var data = state.form
  274. // const options = {navTo
  275. // type: 2,
  276. // data: data,
  277. // method: 'POST',
  278. // showLoading: true,
  279. // }
  280. // request(etcUserCardInfoSubmit, options).then((res) => {
  281. // const data = stringToJson(res.bizContent);
  282. // uni.navigateTo({
  283. // url: `/pages/applyCard/car-release?orderId=${state.orderId}`
  284. // })
  285. // })
  286. };
  287. const cardFileImageUpdate = () => {
  288. uni.chooseImage({
  289. count: 1, //只能选取一张照片
  290. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  291. sourceType: ["camera", "album"], //从相册选择
  292. success: function (res) {
  293. pathToBase64(res.tempFilePaths[0])
  294. .then((path) => {
  295. var data = {
  296. fileBase64: path,
  297. };
  298. const options = {
  299. type: 2,
  300. data: data,
  301. method: "POST",
  302. showLoading: true,
  303. };
  304. request(fileUpload, options).then((res) => {
  305. const data = stringToJson(res.bizContent);
  306. console.log(data);
  307. state.form.proxyUrl = data.data.url;
  308. });
  309. })
  310. .catch((error) => {});
  311. },
  312. });
  313. };
  314. //tab切换
  315. const tabChange = (val: any) => {
  316. if (val) {
  317. state.isMyPeopple = true;
  318. } else {
  319. state.isMyPeopple = false;
  320. }
  321. state.form = {
  322. orderId: state.orderId, //订单ID
  323. userName: "", //开户人姓名
  324. userIdType: "101", //用户证件类型 101//身份证
  325. userIdNum: "", //用户证件号码
  326. userPosImgUrl: "", //身份证正面
  327. userNegImgUrl: "", //身份证反面
  328. tel: "", //开户人手机号
  329. address: "", //开户人地址
  330. sceneType: "", //用户协议支撑服务场景(发行服务机构和用户签订的协议)
  331. channelId: "", //渠道id
  332. gender: "",
  333. customerIdVld: "",
  334. agentName: "",
  335. agentgender: "",
  336. agentIdType: "101",
  337. agentIdNum: "",
  338. agentPosImgUrl: "",
  339. agentNegImgUrl: "",
  340. proxyUrl: "",
  341. agentAddress: "",
  342. tmerValidity: "",
  343. };
  344. };
  345. onLoad((option: any) => {
  346. state.form.orderId = option.orderId;
  347. state.orderId = option.orderId;
  348. });
  349. const cardDbImageOcr = (val: any) => {
  350. var imageType = val;
  351. uni.chooseImage({
  352. count: 1, //只能选取一张照片
  353. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  354. sourceType: ["camera", "album"], //从相册选择
  355. success: function (res) {
  356. pathToBase64(res.tempFilePaths[0])
  357. .then((path) => {
  358. var data = {
  359. source: "1",
  360. agencyId: "52010106004",
  361. imageType: imageType,
  362. fileName: res.tempFilePaths[0],
  363. imageBase64: path,
  364. };
  365. const options = {
  366. type: 2,
  367. data: data,
  368. method: "POST",
  369. showLoading: true,
  370. };
  371. request(etcCarOcrCard, options).then((res) => {
  372. const data = stringToJson(res.bizContent);
  373. console.log(data);
  374. if (val === "1") {
  375. state.form.vehicleId = data.plate_a;
  376. state.form.man = data.man;
  377. state.form.vehicleType = data.vehicle;
  378. state.form.character = data.character;
  379. state.form.vin = data.vin;
  380. state.form.engineNum = data.engine;
  381. state.form.register = data.register;
  382. state.form.issueDate = data.issue;
  383. state.form.vehPosImgUrl = data.imageUrl;
  384. state.form.vehicleModel = data.model;
  385. } else {
  386. state.form.approvedCount = parseFloat(data.apc);
  387. state.form.maintenaceMass = parseFloat(data.unladen);
  388. state.form.vehicleDimensions = data.overall;
  389. state.form.totalMass = parseFloat(data.gross);
  390. state.form.vehNegImgUrl = data.imageUrl;
  391. }
  392. });
  393. })
  394. .catch((error) => {});
  395. },
  396. });
  397. };
  398. //orc接口调用
  399. const cardImageOcr = (val: any) => {
  400. console.log("点击了");
  401. var imageType = val;
  402. uni.chooseImage({
  403. count: 1, //只能选取一张照片
  404. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  405. sourceType: ["camera", "album"], //从相册选择
  406. success: function (res) {
  407. console.log(res);
  408. pathToBase64(res.tempFilePaths[0])
  409. .then((path) => {
  410. console.log(path);
  411. console.log("哈哈哈");
  412. var data = {
  413. source: "1",
  414. agencyId: "52010106004",
  415. imageType: imageType,
  416. fileName: res.tempFilePaths[0],
  417. imageBase64: path,
  418. };
  419. const options = {
  420. type: 2,
  421. data: data,
  422. method: "POST",
  423. showLoading: true,
  424. };
  425. request(etcOcrCard, options).then((res) => {
  426. console.log(res);
  427. const data = stringToJson(res.bizContent);
  428. if (val === "1") {
  429. state.form.userName = data.name;
  430. state.form.gender = data.gender;
  431. state.form.userIdNum = data.idno;
  432. state.form.userPosImgUrl = data.imageUrl;
  433. state.form.address = data.address;
  434. } else {
  435. state.form.tmerValidity = data.begindate + "-" + data.enddate;
  436. state.form.userNegImgUrl = data.imageUrl;
  437. }
  438. });
  439. })
  440. .catch((error) => {});
  441. },
  442. });
  443. };
  444. </script>
  445. <style lang="scss" scoped>
  446. .title {
  447. font-size: 35rpx;
  448. font-family: Microsoft YaHei;
  449. font-weight: 400;
  450. color: #000000;
  451. line-height: 80rpx;
  452. margin-bottom: 10rpx;
  453. }
  454. .content-wrap {
  455. position: relative;
  456. margin-top: 50rpx;
  457. padding: 0rpx 30rpx;
  458. display: flex;
  459. .big {
  460. font-size: 30rpx;
  461. font-family: Microsoft YaHei;
  462. font-weight: 400;
  463. color: #333333;
  464. line-height: 24rpx;
  465. }
  466. .nomal {
  467. font-size: 26rpx;
  468. font-family: Microsoft YaHei;
  469. font-weight: 400;
  470. color: #666666;
  471. line-height: 24rpx;
  472. }
  473. .tip {
  474. margin-top: -5px;
  475. width: 117rpx;
  476. height: 16rpx;
  477. background: #00b38b;
  478. opacity: 0.3;
  479. }
  480. }
  481. .content {
  482. padding: 50rpx 30rpx 50rpx 30rpx;
  483. .item {
  484. padding: 20rpx;
  485. display: flex;
  486. justify-content: space-between;
  487. align-items: center;
  488. height: 130rpx;
  489. background: #ffffff;
  490. box-shadow: 0rpx 2rpx 6rpx 0rpx rgba(223, 223, 223, 0.8);
  491. border-radius: 20rpx;
  492. margin-bottom: 30rpx;
  493. .iten-left {
  494. display: flex;
  495. align-items: center;
  496. image {
  497. width: 150rpx;
  498. height: 90rpx;
  499. }
  500. text {
  501. margin-left: 20rpx;
  502. font-size: 32rpx;
  503. font-family: Noto Sans S Chinese;
  504. font-weight: 400;
  505. color: #333333;
  506. }
  507. }
  508. .choose-item {
  509. width: 44rpx;
  510. height: 44rpx;
  511. background: #ffffff;
  512. border: 2rpx solid #00b38b;
  513. border-radius: 50%;
  514. margin-right: 20rpx;
  515. display: flex;
  516. justify-content: center;
  517. align-items: center;
  518. box-sizing: content-box;
  519. }
  520. .active {
  521. width: 34rpx;
  522. height: 34rpx;
  523. background: #00b38b;
  524. border-radius: 50%;
  525. }
  526. }
  527. .action {
  528. padding-left: 20rpx;
  529. padding-right: 20rpx;
  530. padding-bottom: 30rpx;
  531. .button {
  532. height: 80rpx;
  533. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  534. border-radius: 40rpx;
  535. font-size: 32rpx;
  536. font-weight: 400;
  537. color: #ffffff;
  538. line-height: 80rpx;
  539. }
  540. }
  541. .item-tips {
  542. .title {
  543. font-size: 30rpx;
  544. font-family: Microsoft YaHei;
  545. font-weight: 400;
  546. color: #000000;
  547. line-height: 24rpx;
  548. }
  549. .tip {
  550. margin-top: 16rpx;
  551. font-size: 24rpx;
  552. font-family: Microsoft YaHei;
  553. font-weight: 400;
  554. color: #999999;
  555. line-height: 24rpx;
  556. }
  557. }
  558. .picture-wrapper {
  559. margin-top: 40rpx;
  560. .bg {
  561. background: #ffffff;
  562. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  563. border-radius: 20rpx;
  564. padding: 40rpx;
  565. display: flex;
  566. // align-items: center;
  567. justify-content: space-between;
  568. .name {
  569. font-size: 34rpx;
  570. font-family: Microsoft YaHei;
  571. font-weight: 400;
  572. color: #000000;
  573. line-height: 34rpx;
  574. }
  575. .value {
  576. margin-top: 20rpx;
  577. font-size: 24rpx;
  578. font-family: Microsoft YaHei;
  579. font-weight: 400;
  580. color: #999999;
  581. line-height: 24rpx;
  582. }
  583. .tip {
  584. margin-top: 20rpx;
  585. text-align: center;
  586. width: 110rpx;
  587. height: 40rpx;
  588. background: rgba(33, 190, 177, 0.2);
  589. border-radius: 6rpx;
  590. .tip-value {
  591. font-size: 20rpx;
  592. font-family: Microsoft YaHei;
  593. font-weight: 400;
  594. color: #0a8f8a;
  595. line-height: 40rpx;
  596. opacity: 1;
  597. }
  598. }
  599. }
  600. .icon {
  601. width: 294rpx;
  602. height: 188rpx;
  603. }
  604. }
  605. .shibie-wrapper {
  606. margin-top: 60rpx;
  607. .title {
  608. font-size: 30rpx;
  609. font-family: Microsoft YaHei;
  610. font-weight: 400;
  611. color: #000000;
  612. line-height: 30rpx;
  613. }
  614. ::v-deep .u-form-item {
  615. border-bottom: 1rpx solid #DCDCDC;
  616. padding: 10rpx 0;
  617. }
  618. }
  619. .buchong-wrapper {
  620. margin-top: 60rpx;
  621. .title {
  622. font-size: 30rpx;
  623. font-family: Microsoft YaHei;
  624. font-weight: 400;
  625. color: #000000;
  626. line-height: 30rpx;
  627. }
  628. }
  629. .green-tip {
  630. margin-top: 50rpx;
  631. font-size: 24rpx;
  632. font-family: Microsoft YaHei;
  633. font-weight: 400;
  634. color: #00b38b;
  635. line-height: 24rpx;
  636. margin-bottom: 60rpx;
  637. }
  638. }
  639. </style>