You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

car-release.vue 13KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477
  1. <template>
  2. <navBar title="行驶证信息上传"></navBar>
  3. <navBgCar></navBgCar>
  4. <view class="content">
  5. <view class="item-tips">
  6. <view class="title"> 上传后请核对识别信息 </view>
  7. <view class="tip"> 如有错误请及时手动修改 </view>
  8. </view>
  9. <view class="picture-wrapper" @click="cardImageOcr('1')">
  10. <view class="bg">
  11. <view class="">
  12. <view class="name"> 行驶证主页 </view>
  13. <view class="value"> 上传行驶证的主页 </view>
  14. <view class="tip">
  15. <view class="tip-value"> 拍摄规范 </view>
  16. </view>
  17. </view>
  18. <image v-if="!state.form.vehPosImgUrl" class="icon" :src="`${$imgUrl}applyCard/car-zhu.png`">
  19. </image>
  20. <image v-else class="icon" :src="strReplace(state.form.vehPosImgUrl)"></image>
  21. </view>
  22. </view>
  23. <view class="picture-wrapper" @click="cardImageOcr('2')">
  24. <view class="bg">
  25. <view class="">
  26. <view class="name"> 行驶证副页 </view>
  27. <view class="value"> 上传行驶证的副页 </view>
  28. <view class="tip">
  29. <view class="tip-value"> 拍摄规范 </view>
  30. </view>
  31. </view>
  32. <image v-if="!state.form.vehNegImgUrl" class="icon" :src="`${$imgUrl}applyCard/car-fu.png`">
  33. </image>
  34. <image v-else class="icon" :src="strReplace(state.form.vehNegImgUrl)"></image>
  35. </view>
  36. </view>
  37. <view class="picture-wrapper" @click="cardFileImageUpdate()">
  38. <view class="bg">
  39. <view class="">
  40. <view class="name"> 车头照 </view>
  41. <view class="value"> 上传汽车的车头照片 </view>
  42. <view class="tip">
  43. <view class="tip-value"> 拍摄规范 </view>
  44. </view>
  45. </view>
  46. <image v-if="!state.form.vehBodyUrl" class="icon" :src="`${$imgUrl}applyCard/chetou.png`">
  47. </image>
  48. <image v-else class="icon" :src="strReplace(state.form.vehBodyUrl)"></image>
  49. </view>
  50. </view>
  51. <view class="shibie-wrapper">
  52. <view class="title"> 识别内容如下 </view>
  53. <view class="">
  54. <u-form label-width="200" :model="state.form" ref="uForm">
  55. <u-form-item label="车牌号">
  56. <u-input inputAlign="right" placeholder='请输入车牌号' v-model="state.form.vehicleIdNum" />
  57. </u-form-item>
  58. <u-form-item label="所有人">
  59. <u-input inputAlign="right" placeholder='请输入所有人' v-model="state.form.man" />
  60. </u-form-item>
  61. <u-form-item label="车辆类型">
  62. <u-input inputAlign="right" placeholder='请输入车辆类型' v-model="state.form.vehicleType" />
  63. </u-form-item>
  64. <u-form-item label="使用性质">
  65. <u-input inputAlign="right" placeholder='请输入使用性质' v-model="state.form.character" />
  66. </u-form-item>
  67. <u-form-item label="车辆识别代号">
  68. <u-input inputAlign="right" placeholder='请输入车辆识别代号' v-model="state.form.vin" />
  69. </u-form-item>
  70. <u-form-item label="发动机号码">
  71. <u-input inputAlign="right" placeholder='请输入发动机号码' v-model="state.form.engineNum" />
  72. </u-form-item>
  73. <u-form-item label="注册日期">
  74. <u-input inputAlign="right" placeholder='请输入注册日期' v-model="state.form.register" />
  75. </u-form-item>
  76. <u-form-item label="发证日期">
  77. <u-input inputAlign="right" placeholder='请输入发证日期' v-model="state.form.issueDate" />
  78. </u-form-item>
  79. <u-form-item label="核定载人数">
  80. <u-input inputAlign="right" placeholder='请输入核定载人数' v-model="state.form.approvedCount" />
  81. </u-form-item>
  82. <u-form-item label="整备质量">
  83. <u-input inputAlign="right" placeholder='请输入整备质量' v-model="state.form.maintenaceMass" />
  84. </u-form-item>
  85. <u-form-item label="外廊尺寸">
  86. <u-input inputAlign="right" placeholder='请输入外廊尺寸' v-model="state.form.vehicleDimensions" />
  87. </u-form-item>
  88. <u-form-item label="总质量">
  89. <u-input inputAlign="right" placeholder='请输入总质量' v-model="state.form.totalMass" />
  90. </u-form-item>
  91. <u-form-item label="车辆用户类型">
  92. <u-input @click="state.actionSheetShow = true" placeholder='请输入车辆用户类型' inputAlign="right"
  93. v-model="state.form.useUserTypeName" height='38' type='textarea' :autoHeight='true' />
  94. </u-form-item>
  95. </u-form>
  96. </view>
  97. </view>
  98. <view class="green-tip">
  99. 如识别信息有误,请手动修改,确认无误后,点击下一步!
  100. </view>
  101. <view class="action">
  102. <button type="default" class="button" @click="savaHandle()">
  103. 下一步
  104. </button>
  105. </view>
  106. <!-- <u-select v-model="state.actionSheetShow" :list="state.actionSheetList" @confirm="selectConfirm"></u-select> -->
  107. <u-action-sheet @click="selectConfirm" :list="state.actionSheetList" v-model="state.actionSheetShow">
  108. </u-action-sheet>
  109. </view>
  110. </template>
  111. <script setup lang="ts">
  112. import {
  113. reactive
  114. } from "vue";
  115. import navBgCar from "./components/nav-bg-car3";
  116. import navBar from "../components/nav-bar/nav-bar2.vue";
  117. import {
  118. pathToBase64
  119. } from "@/utils/util/imageTool.js";
  120. import {
  121. etcCarCardInfoSubmit,
  122. etcCarOcrCard,
  123. fileUpload,
  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. const savaHandle = () => {
  136. state.form.vehicleId =
  137. state.form.vehicleIdNum + "_" + state.vehiclePlateColor;
  138. const options = {
  139. type: 2,
  140. data: state.form,
  141. method: "POST",
  142. showLoading: true,
  143. };
  144. request(etcCarCardInfoSubmit, options)
  145. .then((res) => {
  146. const data = stringToJson(res.bizContent);
  147. uni.navigateTo({
  148. url: `/applyCard/choice-product?orderId=${state.form.orderId}`,
  149. });
  150. })
  151. .catch((res) => {
  152. console.log(res);
  153. });
  154. };
  155. const selectConfirm = (index: any) => {
  156. console.log(index)
  157. state.form.useUserType = state.actionSheetList[index].value
  158. state.form.useUserTypeName = state.actionSheetList[index].text
  159. };
  160. const cardFileImageUpdate = () => {
  161. uni.chooseImage({
  162. count: 1, //只能选取一张照片
  163. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  164. sourceType: ["camera", "album"], //从相册选择
  165. success: function(res) {
  166. pathToBase64(res.tempFilePaths[0])
  167. .then((path) => {
  168. var data = {
  169. fileBase64: path,
  170. };
  171. const options = {
  172. type: 2,
  173. data: data,
  174. method: "POST",
  175. showLoading: true,
  176. };
  177. request(fileUpload, options).then((res) => {
  178. const data = stringToJson(res.bizContent);
  179. console.log(data);
  180. state.form.vehBodyUrl = data.data.url;
  181. });
  182. })
  183. .catch((error) => {});
  184. },
  185. });
  186. };
  187. const state = reactive({
  188. actionSheetShow: false,
  189. actionSheetList: [{
  190. text: "普通车",
  191. value: 0,
  192. },
  193. {
  194. text: "道路运输证经营范围仅有“货物专用运输(集装箱) ”的牵引车办理J类型集装箱",
  195. value: 24,
  196. },
  197. {
  198. text: "道路运输证经营范围不含“货物专用运输(集装箱)”的牵引车",
  199. value: 27,
  200. },
  201. {
  202. text: '道路运输证经营范围除“货物专用运输 (集装 箱)"外,还有“普通货运”等其他项目的牵引车办理J2类型集装箱',
  203. value: 28,
  204. },
  205. ],
  206. form: {
  207. orderId: "", //订单ID
  208. man: "", //所有人
  209. character: "", //使用性质
  210. register: "", //注册日期
  211. customerId: "", //用户编号
  212. vehicleId: "",
  213. vehicleIdNum: "", //车牌编号
  214. issueDate: "", //发证日期
  215. vehPosImgUrl: "", //行驶证正面
  216. vehNegImgUrl: "", //行驶证证反面
  217. type: "0", //0,客车 1.货车
  218. useUserType: 0, //车辆用户类型
  219. useUserTypeName: "普通车",
  220. vehicleSign: 2, //前/后装标识
  221. vin: "", //车辆识别代号
  222. engineNum: "", //发动机号码
  223. vehicleType: "", //车辆类型
  224. vehicleModel: "", //行驶证品牌型号
  225. approvedCount: undefined, //核定人数
  226. totalMass: undefined, //总质量
  227. maintenaceMass: undefined, //整备质量
  228. permittedWeight: "", //核定载质量
  229. vehicleDimensions: "", //车辆尺寸
  230. permittedTowWeight: "", //准牵引总质量
  231. axleCount: "", //车轴数
  232. ownerName: "", //车主姓名
  233. ownerIdType: "", //车主证件类型
  234. ownerIdNum: "", //车主证件号码
  235. ownPosImgUrl: "", //车主证件正面图片
  236. ownNegImgUrl: "", //车主证件反面图片
  237. agreementId: "", //签约编号
  238. channelId: "5201018892300000001", //编号渠道
  239. scenePayType: "", //
  240. transportIdNum: "", //道路运输证编号
  241. licenseIdNum: "", //经营许可证编号
  242. vehBodyUrl: "", //车身照片
  243. proxyUrl: "", //委托书地址
  244. },
  245. vehiclePlateColor: undefined,
  246. orderId: "",
  247. isMyPeopple: true,
  248. });
  249. onLoad((option: any) => {
  250. state.form.orderId = option.orderId;
  251. state.vehiclePlateColor = option.vehiclePlateColor;
  252. });
  253. //orc接口调用
  254. const cardImageOcr = (val: any) => {
  255. var imageType = val;
  256. uni.chooseImage({
  257. count: 1, //只能选取一张照片
  258. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  259. sourceType: ["camera", "album"], //从相册选择
  260. success: function(res) {
  261. pathToBase64(res.tempFilePaths[0])
  262. .then((path) => {
  263. var data = {
  264. source: "1",
  265. agencyId: "52010106004",
  266. imageType: imageType,
  267. fileName: res.tempFilePaths[0],
  268. imageBase64: path,
  269. };
  270. const options = {
  271. type: 2,
  272. data: data,
  273. method: "POST",
  274. showLoading: true,
  275. };
  276. request(etcCarOcrCard, options).then((res) => {
  277. const data = stringToJson(res.bizContent);
  278. console.log(data);
  279. if (val === "1") {
  280. state.form.vehicleIdNum = data.plate_a;
  281. state.form.man = data.man;
  282. state.form.vehicleType = data.vehicle;
  283. state.form.character = data.character;
  284. state.form.vin = data.vin;
  285. state.form.engineNum = data.engine;
  286. state.form.register = data.register;
  287. state.form.issueDate = data.issue;
  288. state.form.vehPosImgUrl = data.imageUrl;
  289. state.form.vehicleModel = data.model;
  290. } else {
  291. state.form.approvedCount = parseFloat(data.apc);
  292. state.form.maintenaceMass = parseFloat(data.unladen);
  293. state.form.vehicleDimensions = data.overall;
  294. state.form.totalMass = parseFloat(data.gross);
  295. state.form.vehNegImgUrl = data.imageUrl;
  296. }
  297. });
  298. })
  299. .catch((error) => {});
  300. },
  301. });
  302. };
  303. //替换图片地址
  304. const strReplace = (str:string)=>{
  305. return str.replace('192.168.101.145:9000','222.85.144.89:19002')
  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>