Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

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