Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

car-change.vue 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547
  1. <template>
  2. <view class="content">
  3. <view class="item-tips">
  4. <view class="title"> 上传后请核对识别信息 </view>
  5. <view class="tip"> 如有错误请及时手动修改 </view>
  6. </view>
  7. <view class="picture-wrapper" @click="cardImageOcr('1')">
  8. <view class="bg">
  9. <view class="">
  10. <view class="name"> 行驶证主页 </view>
  11. <view class="value"> 上传行驶证的主页 </view>
  12. <view class="tip">
  13. <view class="tip-value"> 拍摄规范 </view>
  14. </view>
  15. </view>
  16. <image v-if="!state.form.vehPosImgUrl" class="icon" :src="`${$imgUrl}applyCard/car-zhu.png`">
  17. </image>
  18. <image v-else class="icon" :src="state.form.vehPosImgUrl"></image>
  19. </view>
  20. </view>
  21. <view class="picture-wrapper" @click="cardImageOcr('2')">
  22. <view class="bg">
  23. <view class="">
  24. <view class="name"> 行驶证副页 </view>
  25. <view class="value"> 上传行驶证的副页 </view>
  26. <view class="tip">
  27. <view class="tip-value"> 拍摄规范 </view>
  28. </view>
  29. </view>
  30. <image v-if="!state.form.vehNegImgUrl" class="icon" :src="`${$imgUrl}applyCard/car-fu.png`">
  31. </image>
  32. <image v-else class="icon" :src="state.form.vehNegImgUrl"></image>
  33. </view>
  34. </view>
  35. <view class="picture-wrapper" @click="cardFileImageUpdate()">
  36. <view class="bg">
  37. <view class="">
  38. <view class="name"> 车头照 </view>
  39. <view class="value"> 上传汽车的车头照片 </view>
  40. <view class="tip">
  41. <view class="tip-value"> 拍摄规范 </view>
  42. </view>
  43. </view>
  44. <image v-if="!state.form.vehBodyUrl" class="icon" :src="`${$imgUrl}applyCard/chetou.png`">
  45. </image>
  46. <image v-else class="icon" :src="state.form.vehBodyUrl"></image>
  47. </view>
  48. </view>
  49. <view class="shibie-wrapper">
  50. <view class="title"> 识别内容如下 </view>
  51. <view class="">
  52. <u-form label-width="200" :model="state.form" ref="uForm">
  53. <u-form-item label="车牌号">
  54. <u-input inputAlign="right" v-model="state.form.vehicleId" disabled="true" />
  55. </u-form-item>
  56. <u-form-item label="车主姓名">
  57. <u-input inputAlign="right" v-model="state.form.ownerName" />
  58. </u-form-item>
  59. <u-form-item label="车辆类型">
  60. <u-input inputAlign="right" v-model="state.form.vehicleType" />
  61. </u-form-item>
  62. <!-- <u-form-item label="使用性质">
  63. <u-input inputAlign="right" v-model="state.form.useCharacter" />
  64. </u-form-item> -->
  65. <u-form-item label="车辆识别代号">
  66. <u-input inputAlign="right" v-model="state.form.vin" />
  67. </u-form-item>
  68. <u-form-item label="发动机号码">
  69. <u-input inputAlign="right" v-model="state.form.engineNum" />
  70. </u-form-item>
  71. <u-form-item label="注册日期">
  72. <u-input inputAlign="right" v-model="state.form.registerDate" />
  73. </u-form-item>
  74. <u-form-item label="发证日期">
  75. <u-input inputAlign="right" v-model="state.form.issueDate" />
  76. </u-form-item>
  77. <u-form-item label="核定载人数">
  78. <u-input inputAlign="right" v-model="state.form.approvedCount" />
  79. </u-form-item>
  80. <u-form-item label="整备质量">
  81. <u-input inputAlign="right" v-model="state.form.maintenaceMass" />
  82. </u-form-item>
  83. <u-form-item label="外廊尺寸">
  84. <u-input inputAlign="right" v-model="state.form.vehicleDimensions" />
  85. </u-form-item>
  86. <u-form-item label="总质量">
  87. <u-input inputAlign="right" v-model="state.form.totalMass" />
  88. </u-form-item>
  89. <!-- <u-form-item label="车牌颜色">
  90. <u-input inputAlign="right"
  91. v-model="state.showCaridCorlor" type="select" disabled="ture" />
  92. </u-form-item> -->
  93. </u-form>
  94. </view>
  95. </view>
  96. <view class="green-tip">
  97. 如识别信息有误,请手动修改,确认无误后,点击下一步!
  98. </view>
  99. <view class="action">
  100. <button type="default" class="button" @click="savaHandle()">
  101. 下一步
  102. </button>
  103. </view>
  104. <u-select v-model="state.actionSheetShow" :list="state.actionSheetList" @confirm="selectConfirm"></u-select>
  105. </view>
  106. </template>
  107. <script setup lang="ts">
  108. import {
  109. reactive
  110. } from "vue";
  111. import navBgCar from "./components/nav-bg-car3";
  112. import navBar from "../../components/nav-bar/nav-bar2.vue";
  113. import {
  114. pathToBase64
  115. } from "@/utils/util/imageTool.js";
  116. import {
  117. getItem
  118. } from "@/utils/storage.ts"
  119. import {
  120. etcCarCardInfoSubmit,
  121. etcCarOcrCard,
  122. fileUpload,
  123. changeCarInfo,
  124. } from "@/utils/network/api.js";
  125. import {
  126. request
  127. } from "@/utils/network/request.js";
  128. import {
  129. stringToJson
  130. } from "@/utils/network/encryption";
  131. import {
  132. onLoad,
  133. onShow
  134. } from "@dcloudio/uni-app";
  135. let cacachCarid=''
  136. // 修改
  137. const savaHandle = () => {
  138. state.form.vehicleId=cacachCarid
  139. var data = state.form;
  140. console.log(data, "##########");
  141. const options = {
  142. type: 2,
  143. data: data,
  144. method: "POST",
  145. showLoading: true,
  146. };
  147. request(changeCarInfo, options).then((res) => {
  148. const data = stringToJson(res.bizContent);
  149. console.log(data)
  150. if (data.info == '成功.') {
  151. uni.reLaunch({
  152. url: "/personal-center/setting/car-information/car-manage"
  153. })
  154. }
  155. });
  156. };
  157. const selectConfirm = (item: any) => {
  158. // item.map((val, index) => {
  159. // state.form.useUserType = val.value;
  160. // state.form.useUserTypeName = val.label;
  161. // });
  162. console.log(item);
  163. if (state.form.vehicleId) {
  164. state.showCaridCorlor=item[0].label
  165. state.carIdcorlorCode= item[0].value
  166. console.log(state.form);
  167. } else {
  168. uni.showToast({
  169. title: '请先填写车牌号',
  170. icon: 'none'
  171. })
  172. }
  173. };
  174. const cardFileImageUpdate = () => {
  175. uni.chooseImage({
  176. count: 1, //只能选取一张照片
  177. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  178. sourceType: ["camera", "album"], //从相册选择
  179. success: function(res) {
  180. pathToBase64(res.tempFilePaths[0])
  181. .then((path) => {
  182. var data = {
  183. fileBase64: path,
  184. };
  185. const options = {
  186. type: 2,
  187. data: data,
  188. method: "POST",
  189. showLoading: true,
  190. };
  191. request(fileUpload, options).then((res) => {
  192. const data = stringToJson(res.bizContent);
  193. console.log(data);
  194. state.form.vehBodyUrl = data.data.url;
  195. });
  196. })
  197. .catch((error) => {});
  198. },
  199. });
  200. };
  201. const state = reactive({
  202. actionSheetShow: false,
  203. actionSheetList: [{
  204. label: "蓝色",
  205. value: 0,
  206. }, {
  207. label: "黄色",
  208. value: 1,
  209. },
  210. {
  211. label: "黑色",
  212. value: 2,
  213. },
  214. {
  215. label: "白色",
  216. value: 3,
  217. },
  218. {
  219. label: "渐变绿色",
  220. value: 4,
  221. },
  222. {
  223. label: "黄绿双拼色",
  224. value: 5,
  225. },
  226. {
  227. label: "蓝白渐变色",
  228. value: 6,
  229. },
  230. {
  231. label: "未确定",
  232. value: 9,
  233. },
  234. {
  235. label: "绿色",
  236. value: 11,
  237. },
  238. {
  239. label: "红色",
  240. value: 12,
  241. },
  242. ],
  243. showCaridCorlor: '',
  244. carIdcorlorCode:'',
  245. form: {
  246. openId: getItem('openId'), //用户标识.
  247. // man: "", //所有人
  248. // character: "", //使用性质
  249. register: "", //注册日期
  250. customerId: "", //用户编号 .
  251. vehicleId: "", //车牌编号 .
  252. issueDate: "", //发证日期 .
  253. vehPosImgUrl: "", //行驶证正面 .
  254. vehNegImgUrl: "", //行驶证证反面 .
  255. type: "0", //0,客车 1.货车 .
  256. useUserType: 0, //车辆用户类型 .
  257. // useUserTypeName: "普通车",
  258. vehicleSign: 2, //前/后装标识 .
  259. vin: "", //车辆识别代号 .
  260. engineNum: "", //发动机号码 .
  261. vehicleType: "", //车辆类型 .
  262. vehicleModel: "", //行驶证品牌型号 .
  263. approvedCount: undefined, //核定人数 .
  264. totalMass: undefined, //总质量 .
  265. maintenaceMass: undefined, //整备质量.
  266. permittedWeight: "", //核定载质量 .
  267. vehicleDimensions: "", //车辆尺寸 .
  268. permittedTowWeight: "", //准牵引总质量 .
  269. axleCount: "", //车轴数 .
  270. ownerName: "", //车主姓名
  271. ownerIdType: "", //车主证件类型
  272. ownerIdNum: "", //车主证件号码
  273. ownPosImgUrl: "", //车主证件正面图片
  274. ownNegImgUrl: "", //车主证件反面图片
  275. agreementId: "", //签约编号
  276. channelId: "", //编号渠道
  277. scenePayType: "", //
  278. transportIdNum: "", //道路运输证编号
  279. licenseIdNum: "", //经营许可证编号
  280. vehBodyUrl: "", //车身照片
  281. proxyUrl: "", //委托书地址,
  282. emergencyFlag: '', //应急车辆标识 0-非应急车辆 1-应急车辆
  283. contacts: '', //指定联系人列表
  284. ownerAddress: '', //所有人联系地址
  285. axisType: '', //轴型
  286. ownerTel: '', //所有人联系方式
  287. axleDistance: '', //轴距
  288. testRecord: '', //检验记录
  289. fileNum: '', //档案编号
  290. useCharacter: '', //车辆使用性质
  291. registerDate: '' ,//注册日期
  292. status:""//车辆信息状态
  293. },
  294. orderId: "",
  295. isMyPeopple: true,
  296. });
  297. onLoad((option: any) => {
  298. // state.form.orderId = option.orderId;
  299. console.log(JSON.parse(option.data),"RRRRRRRRRRRRRRRRRRR");
  300. let data=JSON.parse(option.data)
  301. cacachCarid=data.vehicleId
  302. state.form.vehPosImgUrl=data.vehPosImgUrl
  303. state.form.vehNegImgUrl=data.vehNegImgUrl
  304. state.form.vehBodyUrl=data.vehBodyUrl
  305. state.form.vehicleId=data.vehiclePlate
  306. state.form.vehicleType=data.vehicleType
  307. // state.form.useCharacter=data.useCharacter
  308. state.form.vin=data.vin
  309. state.form.ownerName=data.ownerName
  310. state.form.engineNum=data.engineNum
  311. state.form.registerDate=data.registerDate
  312. state.form.issueDate=data.issueDate
  313. state.form.approvedCount=data.approvedCount
  314. state.form.maintenaceMass=data.maintenaceMass
  315. state.form.vehicleDimensions=data.vehicleDimensions
  316. state.form.totalMass=data.totalMass
  317. state.form.status=data.status
  318. if(data.status=='使用'){
  319. state.form.status=1
  320. }else if(data.status=='未使用'){
  321. state.form.status=2
  322. }else{
  323. state.form.status=3
  324. }
  325. });
  326. //orc接口调用
  327. const cardImageOcr = (val: any) => {
  328. var imageType = val;
  329. uni.chooseImage({
  330. count: 1, //只能选取一张照片
  331. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  332. sourceType: ["camera", "album"], //从相册选择
  333. success: function(res) {
  334. pathToBase64(res.tempFilePaths[0])
  335. .then((path) => {
  336. var data = {
  337. source: "1",
  338. agencyId: "52010106004",
  339. imageType: imageType,
  340. fileName: res.tempFilePaths[0],
  341. imageBase64: path,
  342. };
  343. const options = {
  344. type: 2,
  345. data: data,
  346. method: "POST",
  347. showLoading: true,
  348. };
  349. request(etcCarOcrCard, options).then((res) => {
  350. const data = stringToJson(res.bizContent);
  351. console.log(data);
  352. if (val === "1") {
  353. // state.form.vehicleId = data.plate_a;
  354. state.form.ownerName = data.man;
  355. state.form.vehicleType = data.vehicle;
  356. // state.form.useCharacter = data.character;
  357. state.form.vin = data.vin;
  358. state.form.engineNum = data.engine;
  359. state.form.registerDate = data.register;
  360. state.form.issueDate = data.issue;
  361. state.form.vehPosImgUrl = data.imageUrl;
  362. state.form.vehicleModel = data.model;
  363. } else {
  364. state.form.approvedCount = parseFloat(data.apc);
  365. state.form.maintenaceMass = parseFloat(data.unladen);
  366. state.form.vehicleDimensions = data.overall;
  367. state.form.totalMass = parseFloat(data.gross);
  368. state.form.vehNegImgUrl = data.imageUrl;
  369. }
  370. });
  371. })
  372. .catch((error) => {});
  373. },
  374. });
  375. };
  376. </script>
  377. <style lang="scss" scoped>
  378. .content {
  379. position: relative;
  380. // margin-top: -50rpx;
  381. padding: 0rpx 30rpx;
  382. position: relative;
  383. .img-pos {
  384. position: absolute;
  385. left: 270rpx;
  386. top: -38rpx;
  387. right: 50rpx;
  388. .img-flex {
  389. display: flex;
  390. justify-content: space-between;
  391. align-items: center;
  392. .car-img {
  393. width: 86rpx;
  394. height: 42rpx;
  395. }
  396. .flag-img {
  397. width: 30rpx;
  398. height: 35rpx;
  399. }
  400. }
  401. }
  402. .action {
  403. padding-left: 20rpx;
  404. padding-right: 20rpx;
  405. padding-bottom: 30rpx;
  406. .button {
  407. height: 80rpx;
  408. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  409. border-radius: 40rpx;
  410. font-size: 32rpx;
  411. font-weight: 400;
  412. color: #ffffff;
  413. line-height: 80rpx;
  414. }
  415. }
  416. .item-tips {
  417. .title {
  418. font-size: 30rpx;
  419. font-family: Microsoft YaHei;
  420. font-weight: 400;
  421. color: #000000;
  422. line-height: 24rpx;
  423. }
  424. .tip {
  425. margin-top: 16rpx;
  426. font-size: 24rpx;
  427. font-family: Microsoft YaHei;
  428. font-weight: 400;
  429. color: #999999;
  430. line-height: 24rpx;
  431. }
  432. }
  433. .picture-wrapper {
  434. margin-top: 40rpx;
  435. .bg {
  436. background: #ffffff;
  437. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  438. border-radius: 20rpx;
  439. padding: 40rpx;
  440. display: flex;
  441. // align-items: center;
  442. justify-content: space-between;
  443. .name {
  444. font-size: 34rpx;
  445. font-family: Microsoft YaHei;
  446. font-weight: 400;
  447. color: #000000;
  448. line-height: 34rpx;
  449. }
  450. .value {
  451. margin-top: 20rpx;
  452. font-size: 24rpx;
  453. font-family: Microsoft YaHei;
  454. font-weight: 400;
  455. color: #999999;
  456. line-height: 24rpx;
  457. }
  458. .tip {
  459. margin-top: 20rpx;
  460. text-align: center;
  461. width: 110rpx;
  462. height: 40rpx;
  463. background: rgba(33, 190, 177, 0.2);
  464. border-radius: 6rpx;
  465. .tip-value {
  466. font-size: 20rpx;
  467. font-family: Microsoft YaHei;
  468. font-weight: 400;
  469. color: #0a8f8a;
  470. line-height: 40rpx;
  471. opacity: 1;
  472. }
  473. }
  474. }
  475. .icon {
  476. width: 294rpx;
  477. height: 188rpx;
  478. }
  479. }
  480. .shibie-wrapper {
  481. margin-top: 60rpx;
  482. .title {
  483. font-size: 30rpx;
  484. font-family: Microsoft YaHei;
  485. font-weight: 400;
  486. color: #000000;
  487. line-height: 30rpx;
  488. }
  489. }
  490. .buchong-wrapper {
  491. margin-top: 60rpx;
  492. .title {
  493. font-size: 30rpx;
  494. font-family: Microsoft YaHei;
  495. font-weight: 400;
  496. color: #000000;
  497. line-height: 30rpx;
  498. }
  499. }
  500. .green-tip {
  501. margin-top: 50rpx;
  502. font-size: 24rpx;
  503. font-family: Microsoft YaHei;
  504. font-weight: 400;
  505. color: #00b38b;
  506. line-height: 24rpx;
  507. margin-bottom: 60rpx;
  508. }
  509. }
  510. </style>