Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.

car-change.vue 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612
  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="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="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. <view class="choice-takePhoto-wrap" v-if="state.isTakePhotoModeShow" @click="cancle">
  159. <view class="choice-takePhoto">
  160. <view @click.stop="takePhoto(state.choiceIndex)" style="border-radius: 20rpx 20rpx 0 0;">拍照</view>
  161. <view @click.stop="xiangce(state.choiceIndex)">从手机相册选择</view>
  162. <view @click.stop="cancle">取消</view>
  163. </view>
  164. </view>
  165. <viewfinder v-if="state.phoneType" :phoneType="state.phoneType" :images="state.images"
  166. :showStartPhoto="state.showImg" @confirmReturn="confirmReturn" @camera="camera"></viewfinder>
  167. </template>
  168. <script setup lang="ts">
  169. import {
  170. reactive
  171. } from "vue";
  172. import {
  173. etcCarCardInfoSubmit,
  174. etcCarOcrCard,
  175. fileUpload,
  176. } from "@/utils/network/api.js";
  177. import {
  178. navTo, uploadFile
  179. } from "@/utils/utils";
  180. import viewfinder from "@/components/viewfinder.vue"
  181. import {
  182. request
  183. } from "@/utils/network/request.js";
  184. import {
  185. stringToJson
  186. } from "@/utils/network/encryption";
  187. import {
  188. onLoad,
  189. onShow
  190. } from "@dcloudio/uni-app";
  191. const savaHandle = () => {
  192. // form_ref.value.validate().then(res => { //验证用
  193. // console.log('success', res);
  194. // uni.showToast({
  195. // title: `校验通过`
  196. // })
  197. // }).catch(err => {
  198. // console.log('err', err);
  199. // })
  200. navTo("/subpackage/after-sale/additional-equipment/pay-page");
  201. };
  202. const selectConfirm = (item : any) => {
  203. item.map((val, index) => {
  204. state.form.useUserType = val.value;
  205. state.form.useUserTypeName = val.label;
  206. });
  207. };
  208. const cardFileImageUpdate = () => {
  209. uni.chooseImage({
  210. count: 1, //只能选取一张照片
  211. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  212. sourceType: ["camera", "album"], //从相册选择
  213. success: function (res) {
  214. uploadFile(res.tempFilePaths[0], "", "").then((data) => {
  215. state.form.vehBodyUrl = data;
  216. })
  217. },
  218. });
  219. };
  220. const state = reactive({
  221. phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面
  222. choiceIndex: 1, // 1 身份证正面 2 身份证反面
  223. isTakePhotoModeShow: false, //选择拍照方式是否出来
  224. changeColor: false,
  225. showImg: true,
  226. images: '',
  227. actionSheetShow: false,
  228. actionSheetList: [{
  229. label: "普通车",
  230. value: 0,
  231. },
  232. {
  233. label: "道路运输证经营范围仅有“货物专用运输(集装箱) ”的牵引车办理J类型集装箱",
  234. value: 24,
  235. },
  236. {
  237. label: "道路运输证经营范围不含“货物专用运输(集装箱)”的牵引车",
  238. value: 27,
  239. },
  240. {
  241. label: '道路运输证经营范围除“货物专用运输 (集装 箱)"外,还有“普通货运”等其他项目的牵引车办理J2类型集装箱',
  242. value: 28,
  243. },
  244. ],
  245. form: {
  246. orderId: "", //订单ID
  247. man: "", //所有人
  248. character: "", //使用性质
  249. register: "", //注册日期
  250. customerId: "", //用户编号
  251. vehicleId: "", //车牌编号
  252. issueDate: "", //发证日期
  253. vehPosImgUrl: "", //行驶证正面
  254. vehNegImgUrl: "", //行驶证证反面
  255. type: "0", //0,客车 1.货车
  256. useUserType: 0, //车辆用户类型
  257. useUserTypeName: "普通车",
  258. vehicleSign: 2, //前/后装标识
  259. vin: "", //车辆识别代号
  260. engineNum: "", //发动机号码
  261. vehicleType: "", //车辆类型
  262. vehicleModel: "", //行驶证品牌型号
  263. approvedCount: undefined, //核定人数
  264. totalMass: undefined, //总质量
  265. maintenaceMass: undefined, //整备质量
  266. permittedWeight: "", //核定载质量
  267. vehicleDimensions: "", //车辆尺寸
  268. permittedTowWeight: "", //准牵引总质量
  269. axleCount: "", //车轴数
  270. ownerName: "", //车主姓名
  271. ownerIdType: "", //车主证件类型
  272. ownerIdNum: "", //车主证件号码
  273. ownPosImgUrl: "", //车主证件正面图片
  274. ownNegImgUrl: "", //车主证件反面图片
  275. agreementId: "", //签约编号
  276. channelId: "5201018892300000001", //编号渠道
  277. scenePayType: "", //
  278. transportIdNum: "", //道路运输证编号
  279. licenseIdNum: "", //经营许可证编号
  280. vehBodyUrl: "", //车身照片
  281. proxyUrl: "", //委托书地址
  282. },
  283. orderId: "",
  284. isMyPeopple: true,
  285. });
  286. onLoad((option : any) => {
  287. state.form.orderId = option.orderId;
  288. });
  289. const xiangce = (val) => {
  290. console.log("val", val)
  291. if (state.choiceIndex == 3) {
  292. var imageType = 1;
  293. } else {
  294. var imageType = 2;
  295. }
  296. state.changeColor = true;
  297. uni.chooseImage({
  298. count: 1, //只能选取一张照片
  299. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  300. sourceType: ["album"], //从相册选择
  301. success: function (res) {
  302. console.log("tempFilePaths[0].startsWith('file://')", res.tempFilePaths[0], res.tempFilePaths[0].startsWith('file://'))
  303. if (state.choiceIndex == 3 || state.choiceIndex == 4) {
  304. state.showImg = false
  305. state.images = res.tempFilePaths[0]
  306. state.phoneType = state.choiceIndex
  307. state.isTakePhotoModeShow = false
  308. return
  309. }
  310. },
  311. })
  312. }
  313. const takePhoto = (val) => {
  314. console.log("拍照", val)
  315. state.phoneType = val;
  316. state.showImg = true;
  317. }
  318. const confirmReturn = (val) => {
  319. if (state.choiceIndex == 3) {
  320. var imageType = 1;
  321. } else {
  322. var imageType = 2;
  323. }
  324. state.changeColor = true;
  325. state.phoneType = 0
  326. state.isTakePhotoModeShow = false
  327. uploadFile(val.tempImagePath, imageType, etcCarOcrCard).then((data) => {
  328. if (state.choiceIndex === "3") {
  329. state.form.vehicleId = data.plate_a;
  330. state.form.man = data.man;
  331. state.form.vehicleType = data.vehicle;
  332. state.form.character = data.character;
  333. state.form.vin = data.vin;
  334. state.form.engineNum = data.engine;
  335. state.form.register = data.register;
  336. state.form.issueDate = data.issue;
  337. state.form.vehPosImgUrl = data.imageUrl;
  338. state.form.vehicleModel = data.model;
  339. } else {
  340. state.form.approvedCount = parseFloat(data.apc);
  341. state.form.maintenaceMass = parseFloat(data.unladen);
  342. state.form.vehicleDimensions = data.overall;
  343. state.form.totalMass = parseFloat(data.gross);
  344. state.form.vehNegImgUrl = data.imageUrl;
  345. }
  346. state.isTakePhotoModeShow = false
  347. })
  348. console.log("图片地址val", val.tempImagePath)
  349. }
  350. const takePhotoMode = (index) => {
  351. console.log("index", index)
  352. state.isTakePhotoModeShow = true
  353. state.choiceIndex = index
  354. }
  355. const cancle = () => {
  356. state.isTakePhotoModeShow = false
  357. }
  358. </script>
  359. <style lang="scss" scoped>
  360. .content {
  361. position: relative;
  362. margin-top: 50rpx;
  363. padding: 0rpx 30rpx;
  364. position: relative;
  365. .img-pos {
  366. position: absolute;
  367. left: 270rpx;
  368. top: -38rpx;
  369. right: 50rpx;
  370. .img-flex {
  371. display: flex;
  372. justify-content: space-between;
  373. align-items: center;
  374. .car-img {
  375. width: 86rpx;
  376. height: 42rpx;
  377. }
  378. .flag-img {
  379. width: 30rpx;
  380. height: 35rpx;
  381. }
  382. }
  383. }
  384. .action {
  385. padding-left: 20rpx;
  386. padding-right: 20rpx;
  387. padding-bottom: 30rpx;
  388. .button {
  389. height: 80rpx;
  390. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  391. border-radius: 40rpx;
  392. font-size: 32rpx;
  393. font-weight: 400;
  394. color: #ffffff;
  395. line-height: 80rpx;
  396. }
  397. }
  398. .item-tips {
  399. .title {
  400. font-size: 30rpx;
  401. font-family: Microsoft YaHei;
  402. font-weight: 400;
  403. color: #000000;
  404. line-height: 24rpx;
  405. }
  406. .tip {
  407. margin-top: 16rpx;
  408. font-size: 24rpx;
  409. font-family: Microsoft YaHei;
  410. font-weight: 400;
  411. color: #999999;
  412. line-height: 24rpx;
  413. }
  414. }
  415. .picture-wrapper {
  416. margin-top: 40rpx;
  417. .bg {
  418. background: #ffffff;
  419. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  420. border-radius: 20rpx;
  421. padding: 40rpx;
  422. display: flex;
  423. // align-items: center;
  424. justify-content: space-between;
  425. .name {
  426. font-size: 34rpx;
  427. font-family: Microsoft YaHei;
  428. font-weight: 400;
  429. color: #000000;
  430. line-height: 34rpx;
  431. }
  432. .value {
  433. margin-top: 20rpx;
  434. font-size: 24rpx;
  435. font-family: Microsoft YaHei;
  436. font-weight: 400;
  437. color: #999999;
  438. line-height: 24rpx;
  439. }
  440. .tip {
  441. margin-top: 20rpx;
  442. text-align: center;
  443. width: 110rpx;
  444. height: 40rpx;
  445. background: rgba(33, 190, 177, 0.2);
  446. border-radius: 6rpx;
  447. .tip-value {
  448. font-size: 20rpx;
  449. font-family: Microsoft YaHei;
  450. font-weight: 400;
  451. color: #0a8f8a;
  452. line-height: 40rpx;
  453. opacity: 1;
  454. }
  455. }
  456. }
  457. .icon {
  458. width: 294rpx;
  459. height: 188rpx;
  460. }
  461. }
  462. .shibie-wrapper {
  463. margin-top: 60rpx;
  464. .title {
  465. font-size: 30rpx;
  466. font-family: Microsoft YaHei;
  467. font-weight: 400;
  468. color: #000000;
  469. line-height: 30rpx;
  470. }
  471. ::v-deep .u-form-item {
  472. border-bottom: 1rpx solid #DCDCDC;
  473. padding: 10rpx 0;
  474. }
  475. .from1 {
  476. background-color: #fff;
  477. margin-top: 30rpx;
  478. // padding: 0 30rpx;
  479. ::v-deep .uni-forms-item {
  480. border-bottom: 1rpx solid #ccc;
  481. padding: 15rpx 0;
  482. margin-bottom: 0;
  483. .uni-forms-item__label {
  484. font-size: 28rpx;
  485. height: 50rpx;
  486. }
  487. .uni-forms-item__content {
  488. display: flex;
  489. }
  490. .uni-easyinput__content-input {
  491. font-size: 28rpx;
  492. height: 50rpx;
  493. }
  494. }
  495. .btn {
  496. line-height: 38rpx;
  497. font-size: 24rpx;
  498. font-family: Microsoft YaHei;
  499. font-weight: 400;
  500. color: #FFFFFF;
  501. background: #00B38B;
  502. border-radius: 10rpx;
  503. padding: 10rpx 15rpx
  504. }
  505. }
  506. }
  507. .buchong-wrapper {
  508. margin-top: 60rpx;
  509. .title {
  510. font-size: 30rpx;
  511. font-family: Microsoft YaHei;
  512. font-weight: 400;
  513. color: #000000;
  514. line-height: 30rpx;
  515. }
  516. }
  517. .green-tip {
  518. margin-top: 50rpx;
  519. font-size: 24rpx;
  520. font-family: Microsoft YaHei;
  521. font-weight: 400;
  522. color: #00b38b;
  523. line-height: 24rpx;
  524. margin-bottom: 60rpx;
  525. }
  526. }
  527. .choice-takePhoto {
  528. position: absolute;
  529. bottom: 0;
  530. background-color: white;
  531. width: 100%;
  532. border-radius: 20rpx 20rpx 0 0;
  533. }
  534. .choice-takePhoto>view:first-child {
  535. text-align: center;
  536. height: 80rpx;
  537. line-height: 80rpx;
  538. border-bottom: 1rpx solid rgba(127, 127, 127, 0.3);
  539. background-color: white;
  540. }
  541. .choice-takePhoto>view:last-child {
  542. text-align: center;
  543. height: 80rpx;
  544. line-height: 80rpx;
  545. border-top: 6rpx solid rgba(127, 127, 127, 0.1);
  546. background-color: white;
  547. }
  548. .choice-takePhoto>view {
  549. text-align: center;
  550. height: 80rpx;
  551. line-height: 80rpx;
  552. background-color: white;
  553. }
  554. .choice-takePhoto-wrap {
  555. width: 100%;
  556. height: 100vh;
  557. background-color: rgba(127, 127, 127, 0.2);
  558. position: fixed;
  559. left: 0;
  560. top: 0;
  561. z-index: 11111;
  562. }
  563. </style>