Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

car-change.vue 12KB

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