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

car-release.vue 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692
  1. <template>
  2. <navBar title="行驶证信息上传" :scrollTop="scrollTop"></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. <u-popup mode="bottom" v-model="state.show">
  110. <view v-if="state.data.transferLogs&&state.data.transferLogs.length" class="">
  111. <view class="bettwen-center">
  112. <view style="padding: 20rpx;" class="title">
  113. 选择卡签
  114. </view>
  115. <view class="goto">
  116. 直接跳过,不使用此套卡签
  117. </view>
  118. </view>
  119. <view @click="guohuAction(item)" class="card" v-for="(item,index) in state.data.transferLogs"
  120. :key="index" style="margin-top: 30rpx;margin-bottom: 30rpx;">
  121. <view v-if="item.status==='WAITING'" class="card-left">
  122. <image :src="`${$imgUrl}card2.png`" mode=""></image>
  123. <view class="card-center">
  124. <view class="flex">
  125. <view class="">
  126. 卡号:
  127. </view>
  128. <view class="card-center-head">
  129. {{item.cardId}}
  130. </view>
  131. </view>
  132. <view style="margin-top: 10rpx;" class="flex">
  133. <view class="">
  134. OBU编号:
  135. </view>
  136. <view class="card-center-head">
  137. {{item.obuId}}
  138. </view>
  139. </view>
  140. </view>
  141. </view>
  142. </view>
  143. </view>
  144. </u-popup>
  145. </view>
  146. </template>
  147. <script setup lang="ts">
  148. import {
  149. reactive,ref,
  150. } from "vue";
  151. import navBgCar from "./components/nav-bg-car4";
  152. import navBar from "../components/nav-bar/nav-bar2.vue";
  153. import {
  154. pathToBase64
  155. } from "@/utils/util/imageTool.js";
  156. import {
  157. etcCarCardInfoSubmit,
  158. etcCarOcrCard,
  159. fileUpload,
  160. queryGuoHuJianCe,
  161. queryGuoHuCaoZuo
  162. } from "@/utils/network/api.js";
  163. import {
  164. request
  165. } from "@/utils/network/request.js";
  166. import {
  167. stringToJson
  168. } from "@/utils/network/encryption";
  169. import {
  170. onLoad,
  171. onPageScroll
  172. } from "@dcloudio/uni-app";
  173. import {
  174. getObuStatus
  175. } from "@/datas/obuStatus.js";
  176. import {
  177. getEtcCardStatus
  178. } from "@/datas/etcCardStatus.js";
  179. import {
  180. getItem
  181. } from "@/utils/storage";
  182. const scrollTop = ref(0)
  183. //监听页面滚动
  184. onPageScroll((e) => {
  185. scrollTop.value = e.scrollTop;
  186. });
  187. const savaHandle = () => {
  188. state.form.vehicleId =
  189. state.form.vehicleIdNum + "_" + state.vehiclePlateColor;
  190. const options = {
  191. type: 2,
  192. data: state.form,
  193. method: "POST",
  194. showLoading: true,
  195. };
  196. request(etcCarCardInfoSubmit, options)
  197. .then((res) => {
  198. const data = stringToJson(res.bizContent);
  199. queryGuoHuJianCeAction().then(value => {
  200. if (value.transferLogs && value.transferLogs.length > 0) {
  201. state.data.transferLogs = value.transferLogs
  202. state.show = true;
  203. } else {
  204. if(state.type == 1|| state.type == '1'){
  205. uni.redirectTo({
  206. url:`/applyCard/addAddress?orderId=${state.form.orderId}&clientFee=${getItem('clientFee')}&&id=${getItem('productId')}`
  207. })
  208. }else{
  209. uni.redirectTo({
  210. // url: `/applyCard/choice-product?orderId=${state.form.orderId}`,
  211. url: `/applyCard/release-products?orderId=${state.form.orderId}&clientFee=${getItem('clientFee')}&&id=${getItem('productId')}`,
  212. });
  213. }
  214. }
  215. })
  216. })
  217. .catch((res) => {
  218. console.log(res);
  219. });
  220. };
  221. const selectConfirm = (index: any) => {
  222. console.log(index)
  223. state.form.useUserType = state.actionSheetList[index].value
  224. state.form.useUserTypeName = state.actionSheetList[index].text
  225. };
  226. const cardFileImageUpdate = () => {
  227. uni.chooseImage({
  228. count: 1, //只能选取一张照片
  229. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  230. sourceType: ["camera", "album"], //从相册选择
  231. success: function(res) {
  232. pathToBase64(res.tempFilePaths[0])
  233. .then((path) => {
  234. var data = {
  235. fileBase64: path,
  236. };
  237. const options = {
  238. type: 2,
  239. data: data,
  240. method: "POST",
  241. showLoading: true,
  242. };
  243. request(fileUpload, options).then((res) => {
  244. const data = stringToJson(res.bizContent);
  245. console.log(data);
  246. state.form.vehBodyUrl = data.data.url;
  247. });
  248. })
  249. .catch((error) => {});
  250. },
  251. });
  252. };
  253. const state = reactive({
  254. data: {
  255. transferLogs: [],
  256. },
  257. actionSheetShow: false,
  258. actionSheetList: [{
  259. text: "普通车",
  260. value: 0,
  261. },
  262. {
  263. text: "道路运输证经营范围仅有“货物专用运输(集装箱) ”的牵引车办理J类型集装箱",
  264. value: 24,
  265. },
  266. {
  267. text: "道路运输证经营范围不含“货物专用运输(集装箱)”的牵引车",
  268. value: 27,
  269. },
  270. {
  271. text: '道路运输证经营范围除“货物专用运输 (集装 箱)"外,还有“普通货运”等其他项目的牵引车办理J2类型集装箱',
  272. value: 28,
  273. },
  274. ],
  275. form: {
  276. orderId: "", //订单ID
  277. man: "", //所有人
  278. character: "", //使用性质
  279. register: "", //注册日期
  280. customerId: "", //用户编号
  281. vehicleId: "",
  282. vehicleIdNum: "", //车牌编号
  283. issueDate: "", //发证日期
  284. vehPosImgUrl: "", //行驶证正面
  285. vehNegImgUrl: "", //行驶证证反面
  286. type: "0", //0,客车 1.货车
  287. useUserType: 0, //车辆用户类型
  288. useUserTypeName: "普通车",
  289. vehicleSign: 2, //前/后装标识
  290. vin: "", //车辆识别代号
  291. engineNum: "", //发动机号码
  292. vehicleType: "", //车辆类型
  293. vehicleModel: "", //行驶证品牌型号
  294. approvedCount: undefined, //核定人数
  295. totalMass: undefined, //总质量
  296. maintenaceMass: undefined, //整备质量
  297. permittedWeight: "", //核定载质量
  298. vehicleDimensions: "", //车辆尺寸
  299. permittedTowWeight: "", //准牵引总质量
  300. axleCount: "", //车轴数
  301. ownerName: "", //车主姓名
  302. ownerIdType: "", //车主证件类型
  303. ownerIdNum: "", //车主证件号码
  304. ownPosImgUrl: "", //车主证件正面图片
  305. ownNegImgUrl: "", //车主证件反面图片
  306. agreementId: "", //签约编号
  307. channelId: "5201018892300000001", //编号渠道
  308. scenePayType: "", //
  309. transportIdNum: "", //道路运输证编号
  310. licenseIdNum: "", //经营许可证编号
  311. vehBodyUrl: "", //车身照片
  312. proxyUrl: "", //委托书地址
  313. },
  314. vehiclePlateColor: undefined,
  315. orderId: "",
  316. type: undefined,//标记来源是否登录 1为未登录数据 - 需要新增地址
  317. show: false,
  318. isMyPeopple: true,
  319. });
  320. onLoad((option: any) => {
  321. state.form.orderId = option.orderId;
  322. state.type = option.type;
  323. state.vehiclePlateColor = option.vehiclePlateColor;
  324. });
  325. //orc接口调用
  326. const cardImageOcr = (val: any) => {
  327. var imageType = val;
  328. uni.chooseImage({
  329. count: 1, //只能选取一张照片
  330. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  331. sourceType: ["camera", "album"], //从相册选择
  332. success: function(res) {
  333. pathToBase64(res.tempFilePaths[0])
  334. .then((path) => {
  335. var data = {
  336. source: "1",
  337. agencyId: "52010106004",
  338. imageType: imageType,
  339. fileName: res.tempFilePaths[0],
  340. imageBase64: path,
  341. };
  342. const options = {
  343. type: 2,
  344. data: data,
  345. method: "POST",
  346. showLoading: true,
  347. };
  348. request(etcCarOcrCard, options).then((res) => {
  349. const data = stringToJson(res.bizContent);
  350. console.log(data);
  351. if (val === "1") {
  352. state.form.vehicleIdNum = data.plate_a;
  353. state.form.man = data.man;
  354. state.form.vehicleType = data.vehicle;
  355. state.form.character = data.character;
  356. state.form.vin = data.vin;
  357. state.form.engineNum = data.engine;
  358. state.form.register = data.register;
  359. state.form.issueDate = data.issue;
  360. state.form.vehPosImgUrl = data.imageUrl;
  361. state.form.vehicleModel = data.model;
  362. } else {
  363. state.form.approvedCount = parseFloat(data.apc);
  364. state.form.maintenaceMass = parseFloat(data.unladen);
  365. state.form.vehicleDimensions = data.overall;
  366. state.form.totalMass = parseFloat(data.gross);
  367. state.form.vehNegImgUrl = data.imageUrl;
  368. }
  369. });
  370. })
  371. .catch((error) => {});
  372. },
  373. });
  374. };
  375. const queryGuoHuJianCeAction = () => {
  376. var data = {
  377. orderId: state.form.orderId
  378. };
  379. const options = {
  380. type: 2,
  381. data: data,
  382. method: "POST",
  383. showLoading: true,
  384. };
  385. return new Promise(async (resolve, reject) => {
  386. const res = await request(queryGuoHuJianCe, options);
  387. const data = stringToJson(res.bizContent);
  388. resolve(data);
  389. }).catch((error) => {
  390. reject(error);
  391. });
  392. }
  393. const guohuAction = (val) => {
  394. var data = {
  395. orderId: state.form.orderId,
  396. serviceType: 'USE',
  397. obuId: val.obuId,
  398. cardId: val.cardId
  399. };
  400. const options = {
  401. type: 2,
  402. data: data,
  403. method: "POST",
  404. showLoading: true,
  405. };
  406. return new Promise(async (resolve, reject) => {
  407. const res = await request(queryGuoHuCaoZuo, options);
  408. const data = stringToJson(res.bizContent);
  409. state.show = false
  410. uni.navigateTo({
  411. url: `/applyCard/choice-product?orderId=${state.form.orderId}`,
  412. });
  413. }).catch((error) => {
  414. reject(error);
  415. });
  416. }
  417. //替换图片地址
  418. const strReplace = (str: string) => {
  419. return str.replace('192.168.101.145:9000', '222.85.144.89:19002')
  420. }
  421. </script>
  422. <style lang="scss" scoped>
  423. .goto {
  424. margin-right: 20rpx;
  425. padding: 10rpx;
  426. color: #00B38B;
  427. border: 1rpx solid #00B38B;
  428. border-radius: 20rpx;
  429. }
  430. .flex {
  431. display: flex;
  432. align-items: center;
  433. }
  434. .bettwen-center {
  435. display: flex;
  436. align-items: center;
  437. justify-content: space-between;
  438. }
  439. .card {
  440. margin: 20rpx;
  441. height: 150rpx;
  442. background: #FFFFFF;
  443. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  444. border-radius: 20rpx;
  445. padding: 20rpx;
  446. display: flex;
  447. justify-content: space-between;
  448. align-items: center;
  449. margin-bottom: 30rpx;
  450. .card-left {
  451. display: flex;
  452. align-items: center;
  453. image {
  454. width: 100rpx;
  455. height: 90rpx;
  456. }
  457. .card-center {
  458. margin-left: 30rpx;
  459. .card-center-head {
  460. font-size: 32rpx;
  461. font-family: Noto Sans S Chinese;
  462. font-weight: 400;
  463. color: #333333;
  464. }
  465. .tips {
  466. font-size: 26rpx;
  467. font-family: Noto Sans S Chinese;
  468. font-weight: 400;
  469. color: #666666;
  470. .tips-card {
  471. width: 70rpx;
  472. height: 40rpx;
  473. background: #D3F2EF;
  474. border-radius: 6rpx;
  475. font-size: 20rpx;
  476. font-family: Noto Sans S Chinese;
  477. font-weight: 400;
  478. color: #0A8F8A;
  479. padding: 5rpx 10rpx;
  480. margin-left: 20rpx;
  481. }
  482. }
  483. }
  484. }
  485. .choose-item {
  486. margin-right: 20rpx;
  487. width: 50rpx;
  488. height: 50rpx;
  489. border: 1rpx solid #00B38B;
  490. border-radius: 50%;
  491. display: flex;
  492. justify-content: center;
  493. align-items: center;
  494. .active {
  495. width: 38rpx;
  496. height: 38rpx;
  497. background: #00B38B;
  498. border-radius: 50%;
  499. }
  500. }
  501. }
  502. .content {
  503. position: relative;
  504. margin-top: -50rpx;
  505. padding: 0rpx 30rpx;
  506. position: relative;
  507. .img-pos {
  508. position: absolute;
  509. left: 270rpx;
  510. top: -38rpx;
  511. right: 50rpx;
  512. .img-flex {
  513. display: flex;
  514. justify-content: space-between;
  515. align-items: center;
  516. .car-img {
  517. width: 86rpx;
  518. height: 42rpx;
  519. }
  520. .flag-img {
  521. width: 30rpx;
  522. height: 35rpx;
  523. }
  524. }
  525. }
  526. .action {
  527. padding-left: 20rpx;
  528. padding-right: 20rpx;
  529. padding-bottom: 30rpx;
  530. .button {
  531. height: 80rpx;
  532. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  533. border-radius: 40rpx;
  534. font-size: 32rpx;
  535. font-weight: 400;
  536. color: #ffffff;
  537. line-height: 80rpx;
  538. }
  539. }
  540. .item-tips {
  541. .title {
  542. font-size: 30rpx;
  543. font-family: Microsoft YaHei;
  544. font-weight: 400;
  545. color: #000000;
  546. line-height: 24rpx;
  547. }
  548. .tip {
  549. margin-top: 16rpx;
  550. font-size: 24rpx;
  551. font-family: Microsoft YaHei;
  552. font-weight: 400;
  553. color: #999999;
  554. line-height: 24rpx;
  555. }
  556. }
  557. .picture-wrapper {
  558. margin-top: 40rpx;
  559. .bg {
  560. background: #ffffff;
  561. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  562. border-radius: 20rpx;
  563. padding: 40rpx;
  564. display: flex;
  565. // align-items: center;
  566. justify-content: space-between;
  567. .name {
  568. font-size: 34rpx;
  569. font-family: Microsoft YaHei;
  570. font-weight: 400;
  571. color: #000000;
  572. line-height: 34rpx;
  573. }
  574. .value {
  575. margin-top: 20rpx;
  576. font-size: 24rpx;
  577. font-family: Microsoft YaHei;
  578. font-weight: 400;
  579. color: #999999;
  580. line-height: 24rpx;
  581. }
  582. .tip {
  583. margin-top: 20rpx;
  584. text-align: center;
  585. width: 110rpx;
  586. height: 40rpx;
  587. background: rgba(33, 190, 177, 0.2);
  588. border-radius: 6rpx;
  589. .tip-value {
  590. font-size: 20rpx;
  591. font-family: Microsoft YaHei;
  592. font-weight: 400;
  593. color: #0a8f8a;
  594. line-height: 40rpx;
  595. opacity: 1;
  596. }
  597. }
  598. }
  599. .icon {
  600. width: 294rpx;
  601. height: 188rpx;
  602. }
  603. }
  604. .shibie-wrapper {
  605. margin-top: 60rpx;
  606. .title {
  607. font-size: 30rpx;
  608. font-family: Microsoft YaHei;
  609. font-weight: 400;
  610. color: #000000;
  611. line-height: 30rpx;
  612. }
  613. }
  614. .buchong-wrapper {
  615. margin-top: 60rpx;
  616. .title {
  617. font-size: 30rpx;
  618. font-family: Microsoft YaHei;
  619. font-weight: 400;
  620. color: #000000;
  621. line-height: 30rpx;
  622. }
  623. }
  624. .green-tip {
  625. margin-top: 50rpx;
  626. font-size: 24rpx;
  627. font-family: Microsoft YaHei;
  628. font-weight: 400;
  629. color: #00b38b;
  630. line-height: 24rpx;
  631. margin-bottom: 60rpx;
  632. }
  633. }
  634. </style>