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-change.vue 16KB

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