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.

пре 2 година
пре 2 година
пре 1 година
пре 2 година
пре 2 година
пре 2 година
пре 1 година
пре 2 година
пре 1 година
пре 2 година
пре 2 година
пре 2 година
пре 1 година
пре 2 година
пре 1 година
пре 2 година
пре 1 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 1 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 1 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 1 година
пре 2 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 1 година
пре 2 година
пре 1 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 1 година
пре 2 година
пре 1 година
пре 2 година
пре 2 година
пре 1 година
пре 1 година
пре 2 година
пре 1 година
пре 2 година
пре 1 година
пре 2 година
пре 2 година
пре 1 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 2 година
пре 1 година
пре 2 година
пре 1 година
пре 2 година
пре 1 година
пре 2 година
пре 1 година
пре 2 година
пре 1 година
пре 2 година
пре 1 година
пре 1 година
пре 1 година
пре 2 година
пре 1 година
пре 1 година
пре 1 година
пре 2 година
пре 2 година
пре 1 година
пре 1 година
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600
  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="takePhotoMode('3')">
  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="strReplace(state.form.vehPosImgUrl)"></image>
  19. </view>
  20. </view>
  21. <view class="picture-wrapper" @click="takePhotoMode('4')">
  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="strReplace(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"> 上传汽车的45度车头照片 </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="strReplace(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="true" />
  55. </u-form-item>
  56. <u-form-item label="车主姓名">
  57. <u-input inputAlign="right" v-model="state.form.ownerName" />
  58. </u-form-item>
  59. <u-form-item label="车辆类型">
  60. <u-input inputAlign="right" v-model="state.form.vehicleType" />
  61. </u-form-item>
  62. <!-- <u-form-item label="使用性质">
  63. <u-input inputAlign="right" v-model="state.form.useCharacter" />
  64. </u-form-item> -->
  65. <u-form-item label="车辆识别代号">
  66. <u-input inputAlign="right" v-model="state.form.vin" />
  67. </u-form-item>
  68. <u-form-item label="发动机号码">
  69. <u-input inputAlign="right" v-model="state.form.engineNum" />
  70. </u-form-item>
  71. <u-form-item label="注册日期">
  72. <u-input inputAlign="right" v-model="state.form.registerDate" />
  73. </u-form-item>
  74. <u-form-item label="发证日期">
  75. <u-input inputAlign="right" v-model="state.form.issueDate" />
  76. </u-form-item>
  77. <u-form-item label="核定载人数">
  78. <u-input inputAlign="right" v-model="state.form.approvedCount" />
  79. </u-form-item>
  80. <u-form-item label="整备质量">
  81. <u-input inputAlign="right" v-model="state.form.maintenaceMass" />
  82. </u-form-item>
  83. <u-form-item label="外廊尺寸">
  84. <u-input inputAlign="right" v-model="state.form.vehicleDimensions" />
  85. </u-form-item>
  86. <u-form-item label="总质量">
  87. <u-input inputAlign="right" v-model="state.form.totalMass" />
  88. </u-form-item>
  89. </u-form>
  90. </view>
  91. </view>
  92. <view class="green-tip">
  93. 如识别信息有误,请手动修改,确认无误后,点击下一步!
  94. </view>
  95. <view class="action">
  96. <button type="default" class="button" @click="savaHandle()">
  97. 下一步
  98. </button>
  99. </view>
  100. <u-select v-model="state.actionSheetShow" :list="state.actionSheetList" @confirm="selectConfirm"></u-select>
  101. </view>
  102. <view class="choice-takePhoto-wrap" v-if="state.isTakePhotoModeShow" @click="cancle">
  103. <view class="choice-takePhoto">
  104. <view @click.stop="takePhoto(state.choiceIndex)" style="border-radius: 20rpx 20rpx 0 0;">拍照</view>
  105. <view @click.stop="xiangce(state.choiceIndex)">从手机相册选择</view>
  106. <view @click.stop="cancle">取消</view>
  107. </view>
  108. </view>
  109. <viewfinder v-if="state.phoneType" :phoneType="state.phoneType" :images="state.images"
  110. :showStartPhoto="state.showImg" @confirmReturn="confirmReturn" @camera="camera"></viewfinder>
  111. </template>
  112. <script setup lang="ts">
  113. import {
  114. reactive
  115. } from "vue";
  116. import {
  117. getItem
  118. } from "@/utils/storage.ts"
  119. import {
  120. etcCarCardInfoSubmit,
  121. etcCarOcrCard,
  122. fileUpload,
  123. changeCarInfo,
  124. envs
  125. } from "@/utils/network/api.js";
  126. import {
  127. request
  128. } from "@/utils/network/request.js";
  129. import {
  130. stringToJson
  131. } from "@/utils/network/encryption";
  132. import {
  133. onLoad,
  134. onShow
  135. } from "@dcloudio/uni-app";
  136. import {
  137. strReplace, uploadFile
  138. } from "@/utils/utils";
  139. import viewfinder from "@/components/viewfinder.vue"
  140. let cacachCarid = ''
  141. // 修改
  142. const savaHandle = () => {
  143. state.form.vehicleId = cacachCarid
  144. var data = state.form;
  145. console.log(data, "##########");
  146. const options = {
  147. type: 2,
  148. data: data,
  149. method: "POST",
  150. showLoading: true,
  151. };
  152. request(changeCarInfo, options).then((res) => {
  153. const data = stringToJson(res.bizContent);
  154. console.log(data)
  155. if (data.info == '成功.') {
  156. uni.reLaunch({
  157. url: "/subpackage/personal-center/setting/car-information/car-manage"
  158. })
  159. }
  160. });
  161. };
  162. const selectConfirm = (item : any) => {
  163. // item.map((val, index) => {
  164. // state.form.useUserType = val.value;
  165. // state.form.useUserTypeName = val.label;
  166. // });
  167. console.log(item);
  168. if (state.form.vehicleId) {
  169. state.showCaridCorlor = item[0].label
  170. state.carIdcorlorCode = item[0].value
  171. console.log(state.form);
  172. } else {
  173. uni.showToast({
  174. title: '请先填写车牌号',
  175. icon: 'none'
  176. })
  177. }
  178. };
  179. const cardFileImageUpdate = () => {
  180. uni.chooseImage({
  181. count: 1, //只能选取一张照片
  182. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  183. sourceType: ["camera", "album"], //从相册选择
  184. success: function (res) {
  185. uploadFile(res.tempFilePaths[0], "", "").then((data) => {
  186. state.form.vehBodyUrl = data;
  187. })
  188. },
  189. });
  190. };
  191. const state = reactive({
  192. phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面
  193. choiceIndex: 1, // 1 身份证正面 2 身份证反面
  194. isTakePhotoModeShow: false, //选择拍照方式是否出来
  195. changeColor: false,
  196. showImg: true,
  197. images: '',
  198. actionSheetShow: false,
  199. actionSheetList: [{
  200. label: "蓝色",
  201. value: 0,
  202. }, {
  203. label: "黄色",
  204. value: 1,
  205. },
  206. {
  207. label: "黑色",
  208. value: 2,
  209. },
  210. {
  211. label: "白色",
  212. value: 3,
  213. },
  214. {
  215. label: "渐变绿色",
  216. value: 4,
  217. },
  218. {
  219. label: "黄绿双拼色",
  220. value: 5,
  221. },
  222. {
  223. label: "蓝白渐变色",
  224. value: 6,
  225. },
  226. {
  227. label: "未确定",
  228. value: 9,
  229. },
  230. {
  231. label: "绿色",
  232. value: 11,
  233. },
  234. {
  235. label: "红色",
  236. value: 12,
  237. },
  238. ],
  239. showCaridCorlor: '',
  240. carIdcorlorCode: '',
  241. form: {
  242. openId: getItem('openId'), //用户标识.
  243. // man: "", //所有人
  244. // character: "", //使用性质
  245. register: "", //注册日期
  246. customerId: "", //用户编号 .
  247. vehicleId: "", //车牌编号 .
  248. issueDate: "", //发证日期 .
  249. vehPosImgUrl: "", //行驶证正面 .
  250. vehNegImgUrl: "", //行驶证证反面 .
  251. type: "0", //0,客车 1.货车 .
  252. useUserType: 0, //车辆用户类型 .
  253. // useUserTypeName: "普通车",
  254. vehicleSign: 2, //前/后装标识 .
  255. vin: "", //车辆识别代号 .
  256. engineNum: "", //发动机号码 .
  257. vehicleType: "", //车辆类型 .
  258. vehicleModel: "", //行驶证品牌型号 .
  259. approvedCount: undefined, //核定人数 .
  260. totalMass: undefined, //总质量 .
  261. maintenaceMass: undefined, //整备质量.
  262. permittedWeight: "", //核定载质量 .
  263. vehicleDimensions: "", //车辆尺寸 .
  264. permittedTowWeight: "", //准牵引总质量 .
  265. axleCount: "", //车轴数 .
  266. ownerName: "", //车主姓名
  267. ownerIdType: "", //车主证件类型
  268. ownerIdNum: "", //车主证件号码
  269. ownPosImgUrl: "", //车主证件正面图片
  270. ownNegImgUrl: "", //车主证件反面图片
  271. agreementId: "", //签约编号
  272. channelId: "", //编号渠道
  273. scenePayType: "", //
  274. transportIdNum: "", //道路运输证编号
  275. licenseIdNum: "", //经营许可证编号
  276. vehBodyUrl: "", //车身照片
  277. proxyUrl: "", //委托书地址,
  278. emergencyFlag: '', //应急车辆标识 0-非应急车辆 1-应急车辆
  279. contacts: '', //指定联系人列表
  280. ownerAddress: '', //所有人联系地址
  281. axisType: '', //轴型
  282. ownerTel: '', //所有人联系方式
  283. axleDistance: '', //轴距
  284. testRecord: '', //检验记录
  285. fileNum: '', //档案编号
  286. useCharacter: '', //车辆使用性质
  287. registerDate: '',//注册日期
  288. status: ""//车辆信息状态
  289. },
  290. orderId: "",
  291. isMyPeopple: true,
  292. });
  293. onLoad((option : any) => {
  294. // state.form.orderId = option.orderId;
  295. console.log(JSON.parse(option.data), "RRRRRRRRRRRRRRRRRRR");
  296. let data = JSON.parse(option.data)
  297. cacachCarid = data.vehicleId
  298. state.form.vehPosImgUrl = data.vehPosImgUrl
  299. state.form.vehNegImgUrl = data.vehNegImgUrl
  300. state.form.vehBodyUrl = data.vehBodyUrl
  301. state.form.vehicleId = data.vehiclePlate
  302. state.form.vehicleType = data.vehicleType
  303. // state.form.useCharacter=data.useCharacter
  304. state.form.vin = data.vin
  305. state.form.ownerName = data.ownerName
  306. state.form.engineNum = data.engineNum
  307. state.form.registerDate = data.registerDate
  308. state.form.issueDate = data.issueDate
  309. state.form.approvedCount = data.approvedCount
  310. state.form.maintenaceMass = data.maintenaceMass
  311. state.form.vehicleDimensions = data.vehicleDimensions
  312. state.form.totalMass = data.totalMass
  313. state.form.status = data.status
  314. if (data.status == '使用') {
  315. state.form.status = 1
  316. } else if (data.status == '未使用') {
  317. state.form.status = 2
  318. } else {
  319. state.form.status = 3
  320. }
  321. });
  322. const xiangce = (val) => {
  323. console.log("val", val)
  324. if (state.choiceIndex == 3) {
  325. var imageType = 1;
  326. } else {
  327. var imageType = 2;
  328. }
  329. state.changeColor = true;
  330. uni.chooseImage({
  331. count: 1, //只能选取一张照片
  332. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  333. sourceType: ["album"], //从相册选择
  334. success: function (res) {
  335. console.log("tempFilePaths[0].startsWith('file://')", res.tempFilePaths[0], res.tempFilePaths[0].startsWith('file://'))
  336. if (state.choiceIndex == 3 || state.choiceIndex == 4) {
  337. state.showImg = false
  338. state.images = res.tempFilePaths[0]
  339. state.phoneType = state.choiceIndex
  340. state.isTakePhotoModeShow = false
  341. return
  342. }
  343. },
  344. })
  345. }
  346. const takePhoto = (val) => {
  347. console.log("拍照", val)
  348. state.phoneType = val;
  349. state.showImg = true;
  350. }
  351. const confirmReturn = (val) => {
  352. if (state.choiceIndex == 3) {
  353. var imageType = 1;
  354. } else {
  355. var imageType = 2;
  356. }
  357. state.changeColor = true;
  358. state.phoneType = 0
  359. state.isTakePhotoModeShow = false
  360. uploadFile(val.tempImagePath, imageType, etcCarOcrCard).then((data) => {
  361. if (state.choiceIndex === "3") {
  362. // state.form.vehicleId = data.plate_a;
  363. state.form.ownerName = data.man;
  364. state.form.vehicleType = data.vehicle;
  365. // state.form.useCharacter = data.character;
  366. state.form.vin = data.vin;
  367. state.form.engineNum = data.engine;
  368. state.form.registerDate = data.register;
  369. state.form.issueDate = data.issue;
  370. state.form.vehPosImgUrl = data.imageUrl;
  371. state.form.vehicleModel = data.model;
  372. } else {
  373. state.form.approvedCount = parseFloat(data.apc);
  374. state.form.maintenaceMass = parseFloat(data.unladen);
  375. state.form.vehicleDimensions = data.overall;
  376. state.form.totalMass = parseFloat(data.gross);
  377. state.form.vehNegImgUrl = data.imageUrl;
  378. }
  379. state.isTakePhotoModeShow = false
  380. })
  381. console.log("图片地址val", val.tempImagePath)
  382. }
  383. const takePhotoMode = (index) => {
  384. console.log("index", index)
  385. state.isTakePhotoModeShow = true
  386. state.choiceIndex = index
  387. }
  388. const cancle = () => {
  389. state.isTakePhotoModeShow = false
  390. }
  391. const camera = () => {
  392. state.phoneType = 0
  393. }
  394. </script>
  395. <style lang="scss" scoped>
  396. .content {
  397. position: relative;
  398. padding: 0rpx 30rpx;
  399. position: relative;
  400. .img-pos {
  401. position: absolute;
  402. left: 270rpx;
  403. top: -38rpx;
  404. right: 50rpx;
  405. .img-flex {
  406. display: flex;
  407. justify-content: space-between;
  408. align-items: center;
  409. .car-img {
  410. width: 86rpx;
  411. height: 42rpx;
  412. }
  413. .flag-img {
  414. width: 30rpx;
  415. height: 35rpx;
  416. }
  417. }
  418. }
  419. .action {
  420. padding-left: 20rpx;
  421. padding-right: 20rpx;
  422. padding-bottom: 30rpx;
  423. .button {
  424. height: 80rpx;
  425. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  426. border-radius: 40rpx;
  427. font-size: 32rpx;
  428. font-weight: 400;
  429. color: #ffffff;
  430. line-height: 80rpx;
  431. }
  432. }
  433. .item-tips {
  434. .title {
  435. font-size: 30rpx;
  436. font-family: Microsoft YaHei;
  437. font-weight: 400;
  438. color: #000000;
  439. line-height: 24rpx;
  440. }
  441. .tip {
  442. margin-top: 16rpx;
  443. font-size: 24rpx;
  444. font-family: Microsoft YaHei;
  445. font-weight: 400;
  446. color: #999999;
  447. line-height: 24rpx;
  448. }
  449. }
  450. .picture-wrapper {
  451. margin-top: 40rpx;
  452. .bg {
  453. background: #ffffff;
  454. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  455. border-radius: 20rpx;
  456. padding: 40rpx;
  457. display: flex;
  458. justify-content: space-between;
  459. .name {
  460. font-size: 34rpx;
  461. font-family: Microsoft YaHei;
  462. font-weight: 400;
  463. color: #000000;
  464. line-height: 34rpx;
  465. }
  466. .value {
  467. margin-top: 20rpx;
  468. font-size: 24rpx;
  469. font-family: Microsoft YaHei;
  470. font-weight: 400;
  471. color: #999999;
  472. line-height: 24rpx;
  473. }
  474. .tip {
  475. margin-top: 20rpx;
  476. text-align: center;
  477. width: 110rpx;
  478. height: 40rpx;
  479. background: rgba(33, 190, 177, 0.2);
  480. border-radius: 6rpx;
  481. .tip-value {
  482. font-size: 20rpx;
  483. font-family: Microsoft YaHei;
  484. font-weight: 400;
  485. color: #0a8f8a;
  486. line-height: 40rpx;
  487. opacity: 1;
  488. }
  489. }
  490. }
  491. .icon {
  492. width: 294rpx;
  493. height: 188rpx;
  494. }
  495. }
  496. .shibie-wrapper {
  497. margin-top: 60rpx;
  498. .title {
  499. font-size: 30rpx;
  500. font-family: Microsoft YaHei;
  501. font-weight: 400;
  502. color: #000000;
  503. line-height: 30rpx;
  504. }
  505. }
  506. .buchong-wrapper {
  507. margin-top: 60rpx;
  508. .title {
  509. font-size: 30rpx;
  510. font-family: Microsoft YaHei;
  511. font-weight: 400;
  512. color: #000000;
  513. line-height: 30rpx;
  514. }
  515. }
  516. .green-tip {
  517. margin-top: 50rpx;
  518. font-size: 24rpx;
  519. font-family: Microsoft YaHei;
  520. font-weight: 400;
  521. color: #00b38b;
  522. line-height: 24rpx;
  523. margin-bottom: 60rpx;
  524. }
  525. }
  526. .choice-takePhoto {
  527. position: absolute;
  528. bottom: 0;
  529. background-color: white;
  530. width: 100%;
  531. border-radius: 20rpx 20rpx 0 0;
  532. }
  533. .choice-takePhoto>view:first-child {
  534. text-align: center;
  535. height: 80rpx;
  536. line-height: 80rpx;
  537. border-bottom: 1rpx solid rgba(127, 127, 127, 0.3);
  538. background-color: white;
  539. }
  540. .choice-takePhoto>view:last-child {
  541. text-align: center;
  542. height: 80rpx;
  543. line-height: 80rpx;
  544. border-top: 6rpx solid rgba(127, 127, 127, 0.1);
  545. background-color: white;
  546. }
  547. .choice-takePhoto>view {
  548. text-align: center;
  549. height: 80rpx;
  550. line-height: 80rpx;
  551. background-color: white;
  552. }
  553. .choice-takePhoto-wrap {
  554. width: 100%;
  555. height: 100vh;
  556. background-color: rgba(127, 127, 127, 0.2);
  557. position: fixed;
  558. left: 0;
  559. top: 0;
  560. z-index: 11111;
  561. }
  562. </style>