您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

car-change.vue 13KB

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