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

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