Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

car-release.vue 32KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108
  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="takePhotoMode('3')">
  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="takePhotoMode('4')">
  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. <car-number-input @numberInputResult="carNumber"
  58. :defaultStr="state.form.vehicleIdNum"></car-number-input>
  59. </u-form-item>
  60. <u-form-item label="所有人">
  61. <u-input inputAlign="right" placeholder="请输入所有人" v-model="state.form.man"
  62. :disabled="state.isEnableChangeOCRCarInfo" />
  63. </u-form-item>
  64. <u-form-item label="车辆类型">
  65. <u-input inputAlign="right" placeholder="请输入车辆类型" v-model="state.form.vehicleType"
  66. :disabled="state.isEnableChangeOCRCarInfo" />
  67. </u-form-item>
  68. <u-form-item label="使用性质">
  69. <u-input inputAlign="right" placeholder="请输入使用性质" v-model="state.form.character"
  70. :disabled="state.isEnableChangeOCRCarInfo" />
  71. </u-form-item>
  72. <u-form-item label="车辆识别代号">
  73. <u-input inputAlign="right" placeholder="请输入车辆识别代号" v-model="state.form.vin"
  74. :disabled="state.isEnableChangeOCRCarInfo" />
  75. </u-form-item>
  76. <u-form-item label="发动机号码">
  77. <u-input inputAlign="right" placeholder="请输入发动机号码" v-model="state.form.engineNum"
  78. :disabled="state.isEnableChangeOCRCarInfo" />
  79. </u-form-item>
  80. <u-form-item label="注册日期">
  81. <picker mode="date" :value="state.form.register" @change="bindDateChange1"
  82. :disabled="state.isEnableChangeOCRCarInfo">
  83. <view class="uni-input" style="text-align: right;" :class="state.changeColor?'hei':'hui'">
  84. {{state.form.register}}
  85. </view>
  86. </picker>
  87. <!-- <u-input inputAlign="right" placeholder="请输入注册日期" v-model="state.form.register" :disabled="state.isEnableChangeOCRCarInfo" /> -->
  88. </u-form-item>
  89. <u-form-item label="发证日期">
  90. <picker mode="date" :value="state.form.issueDate" @change="bindDateChange2"
  91. :disabled="state.isEnableChangeOCRCarInfo">
  92. <view class="uni-input" style="text-align: right;" :class="state.changeColor?'hei':'hui'">
  93. {{state.form.issueDate}}
  94. </view>
  95. </picker>
  96. <!-- <u-input inputAlign="right" placeholder="请输入发证日期" v-model="state.form.issueDate" :disabled="state.isEnableChangeOCRCarInfo"/> -->
  97. </u-form-item>
  98. <u-form-item label="核定载人数">
  99. <u-input inputAlign="right" placeholder="请输入核定载人数" v-model="state.form.approvedCountShow"
  100. :disabled="state.isEnableChangeOCRCarInfo" />
  101. </u-form-item>
  102. <u-form-item label="整备质量">
  103. <u-input inputAlign="right" placeholder="请输入整备质量" v-model="state.form.maintenaceMassShow"
  104. :disabled="state.isEnableChangeOCRCarInfo" />
  105. </u-form-item>
  106. <!-- <u-form-item label="外廊尺寸">
  107. <u-input inputAlign="right" placeholder='请输入外廊尺寸' v-model="state.form.vehicleDimensions" />
  108. </u-form-item> -->
  109. <view class="form-item">
  110. <label>外廊尺寸</label>
  111. <view class="input-box">
  112. <text class="sub-label">长</text>
  113. <input v-model="state.outlineL" @input="outlineInput"
  114. :disabled="state.isEnableChangeOCRCarInfo" />
  115. <text class="sub-text">X</text>
  116. <text class="sub-label">宽</text>
  117. <input v-model="state.outlineW" @input="outlineInput"
  118. :disabled="state.isEnableChangeOCRCarInfo" />
  119. <text class="sub-text">X</text>
  120. <text class="sub-label">高</text>
  121. <input v-model="state.outlineH" @input="outlineInput"
  122. :disabled="state.isEnableChangeOCRCarInfo" />
  123. <text class="sub-text">mm</text>
  124. </view>
  125. </view>
  126. <u-form-item label="总质量">
  127. <u-input inputAlign="right" placeholder="请输入总质量" v-model="state.form.totalMassShow"
  128. :disabled="state.isEnableChangeOCRCarInfo" />
  129. </u-form-item>
  130. <u-form-item label="车轴数">
  131. <u-input inputAlign="right" placeholder="请输入车轴数" v-model="state.form.axleCount" type="number"
  132. maxlength="2" />
  133. </u-form-item>
  134. <view class="form-item">
  135. <label>车辆用户类型</label>
  136. <view class="select" @click="state.actionSheetShow = true">{{state.form.useUserTypeName}}</view>
  137. <image :src="`${$imgUrl}common/arror-down.png`" class="icon"
  138. @click="state.actionSheetShow = true"></image>
  139. </view>
  140. <!-- <u-form-item label="车辆用户类型">
  141. <u-input @click="state.actionSheetShow = true" placeholder="请输入车辆用户类型" inputAlign="right"
  142. v-model="state.form.useUserTypeName" height="38" type="textarea" :autoHeight="true" />
  143. </u-form-item> -->
  144. </u-form>
  145. </view>
  146. </view>
  147. <view class="green-tip">
  148. 如识别信息有误,请手动修改,确认无误后,点击下一步!
  149. </view>
  150. <view class="action">
  151. <button type="default" class="button" @click="savaHandle()">
  152. 下一步
  153. </button>
  154. </view>
  155. <!-- <u-select v-model="state.actionSheetShow" :list="state.actionSheetList" @confirm="selectConfirm"></u-select>
  156. <u-action-sheet @click="selectConfirm" :list="state.actionSheetList" v-model="state.actionSheetShow">
  157. </u-action-sheet> -->
  158. <!-- 车辆类型弹窗 -->
  159. <u-popup mode="bottom" v-model="state.actionSheetShow">
  160. <view class="window">
  161. <view class="window-item" v-for="item in state.actionSheetList" :key="item.value"
  162. @click="userType(item)">{{item.text}}</view>
  163. </view>
  164. </u-popup>
  165. <u-popup mode="bottom" v-model="state.show">
  166. <view v-if="state.data.transferLogs && state.data.transferLogs.length" class="">
  167. <view class="bettwen-center">
  168. <view style="padding: 20rpx" class="title"> 选择卡签 </view>
  169. <view class="goto" @click="pass"> 直接跳过,不使用此套卡签 </view>
  170. </view>
  171. <view @click="guohuAction(item)" class="card" v-for="(item, index) in state.data.transferLogs"
  172. :key="index" style="margin-top: 30rpx; margin-bottom: 30rpx">
  173. <view v-if="item.status === 'WAITING'" class="card-left">
  174. <image :src="`${$imgUrl}card2.png`" mode=""></image>
  175. <view class="card-center">
  176. <view class="flex">
  177. <view class=""> 卡号: </view>
  178. <view class="card-center-head">
  179. {{ item.cardId }}
  180. </view>
  181. </view>
  182. <view style="margin-top: 10rpx" class="flex">
  183. <view class=""> OBU编号: </view>
  184. <view class="card-center-head">
  185. {{ item.obuId }}
  186. </view>
  187. </view>
  188. </view>
  189. </view>
  190. </view>
  191. </view>
  192. </u-popup>
  193. </view>
  194. <view class="choice-takePhoto-wrap" v-if="state.isTakePhotoModeShow" @click="cancle">
  195. <view class="choice-takePhoto">
  196. <view @click.stop="takePhoto(state.choiceIndex)" style="border-radius: 20rpx 20rpx 0 0;">拍照</view>
  197. <view @click.stop="xiangce(state.choiceIndex)">从手机相册选择</view>
  198. <view @click.stop="cancle">取消</view>
  199. </view>
  200. </view>
  201. <viewfinder v-if="state.phoneType" :phoneType="state.phoneType" :images="state.images"
  202. :showStartPhoto="state.showImg" @confirmReturn="confirmReturn" @camera="camera"></viewfinder>
  203. </template>
  204. <script setup lang="ts">
  205. import { reactive, ref } from "vue";
  206. import viewfinder from "../../components/viewfinder.vue"
  207. import viewfinderCar from "../../components/viewfinderCar.vue"
  208. import navBgCar from "./components/nav-bg-car4";
  209. import navBar from "@/components/nav-bar/nav-bar2.vue";
  210. import carNumberInput from "@/components/car-number-input/car-number-input.vue";
  211. import { pathToBase64 } from "@/utils/util/imageTool.js";
  212. import {
  213. etcCarCardInfoSubmit,
  214. etcCarOcrCard,
  215. fileUpload,
  216. envs,
  217. queryGuoHuJianCe,
  218. queryGuoHuCaoZuo,
  219. } from "@/utils/network/api.js";
  220. import { request } from "@/utils/network/request.js";
  221. import { stringToJson } from "@/utils/network/encryption";
  222. import { onLoad, onPageScroll } from "@dcloudio/uni-app";
  223. import { getObuStatus } from "@/datas/obuStatus.js";
  224. import { getEtcCardStatus } from "@/datas/etcCardStatus.js";
  225. import { getItem, StorageKeys } from "@/utils/storage";
  226. // import { hasLogin } from "@/utils/utils.ts";
  227. import { msg, strReplace, hasLogin } from "@/utils/utils";
  228. import {
  229. getCodeName
  230. } from "@/datas/queryKey.js";
  231. const scrollTop = ref(0);
  232. //监听页面滚动
  233. onPageScroll((e) => {
  234. scrollTop.value = e.scrollTop;
  235. });
  236. //车牌号输入
  237. const carNumber = (val : any) => {
  238. state.form.vehicleIdNum = val.trim();
  239. };
  240. const camera = () => {
  241. state.phoneType = 0
  242. }
  243. //提交车辆信息
  244. const savaHandle = () => {
  245. if (!state.form.vehBodyUrl) {
  246. msg("请上次车头照");
  247. return;
  248. }
  249. if (state.form.type == 1) {
  250. state.form.axleCount = 2;
  251. } else {
  252. if (!state.form.axleCount) {
  253. msg("请输入车轴数");
  254. return;
  255. }
  256. }
  257. state.form.vehicleId =
  258. state.form.vehicleIdNum + "_" + state.vehiclePlateColor;
  259. state.form.opId = getItem(StorageKeys.OpenId);
  260. state.form.approvedCount = parseFloat(state.form.approvedCount);
  261. state.form.maintenaceMass = parseFloat(state.form.maintenaceMass);
  262. state.form.totalMass = parseFloat(state.form.totalMass);
  263. state.form.permittedWeight = parseFloat(state.form.permittedWeight);
  264. state.form.permittedTowWeight = parseFloat(state.form.permittedTowWeight);
  265. const options = {
  266. type: 2,
  267. data: state.form,
  268. method: "POST",
  269. showLoading: true,
  270. };
  271. request(etcCarCardInfoSubmit, options)
  272. .then((res) => {
  273. const data = stringToJson(res.bizContent);
  274. queryGuoHuJianCeAction().then((value) => {
  275. console.log("过户检测", value)
  276. if (value.transferLogs && value.transferLogs.length > 0) {
  277. state.data.transferLogs = value.transferLogs;
  278. state.show = true;
  279. } else {
  280. // 签约
  281. if (state.isSign == 2 || state.isSign == 3) {
  282. if (!hasLogin()) {
  283. uni.redirectTo({
  284. url: `/subpackage/orders/addAddress?orderId=${state.form.orderId
  285. }&clientFee=${getItem("clientFee")}&&id=${getItem("productId")}`,
  286. });
  287. } else {
  288. // uni.redirectTo({
  289. // url: `/subpackage/orders/release-products?orderId=${state.form.orderId
  290. // }&clientFee=${getItem("clientFee")}&&id=${getItem("productId")}`,
  291. // });
  292. // #ifdef MP-ALIPAY
  293. uni.redirectTo({
  294. url: `/subpackage/orders/order_payment?orderId=${state.form.orderId}`,
  295. });
  296. // #endif
  297. // #ifdef MP-WEIXIN
  298. // uni.redirectTo({
  299. // url: `/subpackage/orders/interestsList?orderId=${state.form.orderId}&&clientFee=${getItem("clientFee")}&&id=${getItem("productId")}`// url: `/subpackage/orders/sign-up?orderId=${state.form.orderId}&&clientFee=${getItem("clientFee")}&&id=${getItem("productId")}`,
  300. // });
  301. uni.redirectTo({
  302. url: `/subpackage/orders/product-detail?orderId=${state.form.orderId}&&clientFee=${getItem("clientFee")}&&id=${getItem("productId")}&&isValueCard=${getItem("isValueCard")}`,
  303. });
  304. // #endif
  305. }
  306. } else {
  307. // 不签约
  308. // uni.redirectTo({
  309. // url: `/subpackage/orders/sign-up?orderId=${state.form.orderId}&&clientFee=${getItem("clientFee")}&&id=${getItem("productId")}`,
  310. // });
  311. // uni.redirectTo({
  312. // url: `/subpackage/orders/interestsList?orderId=${state.form.orderId}&&clientFee=${getItem("clientFee")}&&id=${getItem("productId")}`
  313. // });
  314. uni.redirectTo({
  315. url: `/subpackage/orders/product-detail?orderId=${state.form.orderId}&&clientFee=${getItem("clientFee")}&&id=${getItem("productId")}&&isValueCard=${getItem("isValueCard")}`,
  316. });
  317. // uni.redirectTo({
  318. // url: `/subpackage/orders/release-products?orderId=${state.form.orderId}&clientFee=${getItem('clientFee')}&&id=${getItem('productId')}`,
  319. // });
  320. }
  321. }
  322. });
  323. })
  324. .catch((res) => {
  325. console.log(res);
  326. });
  327. };
  328. const pass = () => {
  329. state.show = false
  330. }
  331. const selectConfirm = (index : any) => {
  332. console.log(index);
  333. state.form.useUserType = state.actionSheetList[index].value;
  334. state.form.useUserTypeName = state.actionSheetList[index].text;
  335. };
  336. //选择车辆用户类型
  337. const userType = (item : any) => {
  338. state.form.useUserType = item.value;
  339. state.form.useUserTypeName = item.text;
  340. state.actionSheetShow = false;
  341. }
  342. //车头照图片上传
  343. const cardFileImageUpdate = () => {
  344. uni.chooseImage({
  345. count: 1, //只能选取一张照片
  346. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  347. sourceType: ["camera", "album"], //从相册选择
  348. success: function (res) {
  349. pathToBase64(res.tempFilePaths[0])
  350. .then((path) => {
  351. var data = {
  352. fileBase64: path,
  353. };
  354. const options = {
  355. type: 2,
  356. data: data,
  357. method: "POST",
  358. showLoading: true,
  359. };
  360. request(fileUpload, options).then((res) => {
  361. const data = stringToJson(res.bizContent);
  362. console.log(data);
  363. state.form.vehBodyUrl = data.data.url;
  364. });
  365. })
  366. .catch((error) => { });
  367. },
  368. });
  369. };
  370. const state = reactive({
  371. phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面
  372. choiceIndex: 1, // 1 身份证正面 2 身份证反面
  373. isTakePhotoModeShow: false, //选择拍照方式是否出来
  374. changeColor: false,
  375. showImg: true,
  376. data: {
  377. transferLogs: [],
  378. },
  379. images: '',
  380. actionSheetShow: false,
  381. actionSheetList: [],
  382. form: {
  383. orderId: "", //订单ID
  384. man: "", //所有人
  385. character: "", //使用性质
  386. register: "请输入注册日期", //注册日期
  387. customerId: "", //用户编号
  388. vehicleId: "",
  389. vehicleIdNum: "", //车牌编号
  390. issueDate: "请输入发证日期", //发证日期
  391. vehPosImgUrl: "", //行驶证正面
  392. vehNegImgUrl: "", //行驶证证反面
  393. type: "0", //0,客车 1.货车
  394. useUserType: 0, //车辆用户类型
  395. useUserTypeName: "普通车",
  396. vehicleSign: 2, //前/后装标识
  397. vin: "", //车辆识别代号
  398. engineNum: "", //发动机号码
  399. vehicleType: "", //车辆类型
  400. vehicleModel: "", //行驶证品牌型号
  401. approvedCount: undefined, //核定人数
  402. approvedCountShow: undefined,//展示的
  403. totalMass: undefined, //总质量
  404. totalMassShow: undefined, //总质量
  405. maintenaceMass: undefined, //整备质量
  406. maintenaceMassShow: undefined, //整备质量展示的
  407. permittedWeight: "", //核定载质量
  408. vehicleDimensions: "", //车辆尺寸
  409. permittedTowWeight: "", //准牵引总质量
  410. axleCount: "", //车轴数
  411. ownerName: "", //车主姓名
  412. ownerIdType: "", //车主证件类型
  413. ownerIdNum: "", //车主证件号码
  414. ownPosImgUrl: "", //车主证件正面图片
  415. ownNegImgUrl: "", //车主证件反面图片
  416. agreementId: "", //签约编号
  417. channelId: "5201018892300000001", //编号渠道
  418. scenePayType: "", //
  419. transportIdNum: "", //道路运输证编号
  420. licenseIdNum: "", //经营许可证编号
  421. vehBodyUrl: "", //车身照片
  422. proxyUrl: "", //委托书地址
  423. opId: "",
  424. },
  425. vehiclePlateColor: undefined,
  426. orderId: "",
  427. // type: undefined, //标记来源是否登录 1为未登录数据 - 需要新增地址
  428. show: false,
  429. isMyPeopple: true,
  430. outlineL: "",
  431. outlineW: "",
  432. outlineH: "",
  433. isSign: '',
  434. isEnableChangeOCRCarInfo: true, //申办时是否允许修改OCR识别出来的车辆信息数据
  435. });
  436. onLoad((option : any) => {
  437. state.form.orderId = option.orderId;
  438. // state.type = option.type;
  439. state.form.type = option.type;
  440. state.vehiclePlateColor = option.vehiclePlateColor;
  441. state.isSign = option.isSign
  442. console.log("option", option)
  443. getGlobalParam();
  444. if (option.type == 1) {
  445. state.actionSheetList = [{
  446. text: "普通车",
  447. value: 0,
  448. }]
  449. } else {
  450. state.actionSheetList = [{
  451. text: "普通车",
  452. value: 0,
  453. },
  454. {
  455. text: "道路运输证经营范围仅有“货物专用运输(集装箱) ”的牵引车办理J类型集装箱",
  456. value: 24,
  457. },
  458. {
  459. text: "道路运输证经营范围不含“货物专用运输(集装箱)”的牵引车",
  460. value: 27,
  461. },
  462. {
  463. text: '道路运输证经营范围除“货物专用运输 (集装 箱)"外,还有“普通货运”等其他项目的牵引车办理J2类型集装箱',
  464. value: 28,
  465. }]
  466. }
  467. });
  468. //外廓尺寸输入框
  469. const outlineInput = (e) => {
  470. state.form.vehicleDimensions =
  471. state.outlineL + "X" + state.outlineW + "X" + state.outlineH + "mm";
  472. };
  473. //orc接口调用
  474. const cardImageOcr = (val : any) => {
  475. state.changeColor = true;
  476. var imageType = val;
  477. uni.chooseImage({
  478. count: 1, //只能选取一张照片
  479. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  480. sourceType: ["camera", "album"], //从相册选择
  481. success: function (res) {
  482. // tempFilePaths[0].startsWith('file://')
  483. pathToBase64(res.tempFilePaths[0])
  484. .then((path) => {
  485. console.log("Base64返回", path)
  486. var data = {
  487. source: "1",
  488. agencyId: "52010106004",
  489. imageType: imageType,
  490. fileName: res.tempFilePaths[0],
  491. imageBase64: path,
  492. };
  493. const options = {
  494. type: 2,
  495. data: data,
  496. method: "POST",
  497. showLoading: true,
  498. };
  499. request(etcCarOcrCard, options).then((res) => {
  500. const data = stringToJson(res.bizContent);
  501. console.log(data);
  502. if (val === "1") {
  503. if (data.plate_a.length > 8) {
  504. state.form.vehicleIdNum = data.plate_a.substring(0, 8);
  505. } else {
  506. state.form.vehicleIdNum = data.plate_a;
  507. }
  508. state.form.man = data.man;
  509. state.form.vehicleType = data.vehicle;
  510. state.form.character = data.character;
  511. state.form.vin = data.vin;
  512. state.form.engineNum = data.engine;
  513. state.form.register = data.register;
  514. state.form.issueDate = data.issue;
  515. state.form.vehPosImgUrl = data.imageUrl;
  516. state.form.vehicleModel = data.model;
  517. } else {
  518. state.form.approvedCount = data.apc;
  519. state.form.approvedCountShow = data.apc;
  520. state.form.maintenaceMass = data.unladen;
  521. state.form.maintenaceMassShow = data.unladen;
  522. state.form.vehicleDimensions = data.overall.replaceAll("x", "X");
  523. let arr = data.overall.split("x");
  524. state.outlineL = arr[0]; //外廓 长
  525. state.outlineW = arr[1]; //外廓 宽
  526. state.outlineH = arr[2].substring(0, arr[2].length - 2); //外廓 高
  527. state.form.totalMass = data.gross;
  528. state.form.totalMassShow = data.gross;
  529. state.form.vehNegImgUrl = data.imageUrl;
  530. state.form.permittedWeight = data.alc ? data.alc : 0;
  531. state.form.permittedTowWeight = data.towing ? data.towing : 0;
  532. }
  533. });
  534. })
  535. .catch((error) => { console.log("Base64异常", error) });
  536. },
  537. });
  538. };
  539. //过户检测
  540. const queryGuoHuJianCeAction = () => {
  541. var data = {
  542. orderId: state.form.orderId,
  543. };
  544. const options = {
  545. type: 2,
  546. data: data,
  547. method: "POST",
  548. showLoading: true,
  549. };
  550. return new Promise(async (resolve, reject) => {
  551. const res = await request(queryGuoHuJianCe, options);
  552. const data = stringToJson(res.bizContent);
  553. console.log("过户检测111", data)
  554. resolve(data);
  555. }).catch((error) => {
  556. reject(error);
  557. });
  558. };
  559. //过户操作
  560. const guohuAction = (val) => {
  561. var data = {
  562. orderId: state.form.orderId,
  563. serviceType: "USE",
  564. obuId: val.obuId,
  565. cardId: val.cardId,
  566. };
  567. const options = {
  568. type: 2,
  569. data: data,
  570. method: "POST",
  571. showLoading: true,
  572. };
  573. return new Promise(async (resolve, reject) => {
  574. const res = await request(queryGuoHuCaoZuo, options);
  575. const data = stringToJson(res.bizContent);
  576. state.show = false;
  577. // uni.navigateTo({
  578. // url: `/subpackage/orders/choice-product?orderId=${state.form.orderId}`,
  579. // });
  580. uni.redirectTo({
  581. url: `/subpackage/orders/product-detail?orderId=${state.form.orderId}&&clientFee=${getItem("clientFee")}&&id=${getItem("productId")}&&isValueCard=${getItem("isValueCard")}`,
  582. });
  583. }).catch((error) => {
  584. reject(error);
  585. });
  586. };
  587. //替换图片地址
  588. // const strReplace = (str : string) => {
  589. // let imgUrl = str.replace("http://192.168.101.145:9000", envs[process.env.NODE_ENV].baseUrl);
  590. // imgUrl = imgUrl.replace("http://100.64.2.113:9000", envs[process.env.NODE_ENV].baseUrl);
  591. // return imgUrl;
  592. // };
  593. const getGlobalParam = () => {
  594. const data = getItem('globalParam')
  595. console.log("全局配置数据", getCodeName('IS_ENABLE', data.applyChangeOCRCarInfo))
  596. // 申办时是否允许修改OCR识别出来的车辆信息数据
  597. if (getCodeName('IS_ENABLE', data.applyChangeOCRCarInfo) == '启用') {
  598. state.isEnableChangeOCRCarInfo = true;
  599. } else {
  600. state.isEnableChangeOCRCarInfo = false;
  601. }
  602. }
  603. const bindDateChange1 = (e) => {
  604. state.form.register = e.detail.value
  605. state.changeColor = true;
  606. }
  607. const bindDateChange2 = (e) => {
  608. state.form.issueDate = e.detail.value
  609. state.changeColor = true;
  610. }
  611. const xiangce = (val) => {
  612. console.log("val", val)
  613. if (state.choiceIndex == 3) {
  614. var imageType = 1;
  615. } else {
  616. var imageType = 2;
  617. }
  618. state.changeColor = true;
  619. uni.chooseImage({
  620. count: 1, //只能选取一张照片
  621. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  622. sourceType: ["album"], //从相册选择
  623. success: function (res) {
  624. console.log("tempFilePaths[0].startsWith('file://')", res.tempFilePaths[0], res.tempFilePaths[0].startsWith('file://'))
  625. if (state.choiceIndex == 3 || state.choiceIndex == 4) {
  626. state.showImg = false
  627. state.images = res.tempFilePaths[0]
  628. state.phoneType = state.choiceIndex
  629. state.isTakePhotoModeShow = false
  630. return
  631. }
  632. },
  633. })
  634. }
  635. const takePhoto = (val) => {
  636. console.log("拍照", val)
  637. state.phoneType = val;
  638. }
  639. const confirmReturn = (val) => {
  640. if (state.choiceIndex == 3) {
  641. var imageType = 1;
  642. } else {
  643. var imageType = 2;
  644. }
  645. state.changeColor = true;
  646. state.phoneType = 0
  647. state.isTakePhotoModeShow = false
  648. // var imageType = state.choiceIndex;
  649. console.log("图片地址val", val.tempImagePath)
  650. uni.uploadFile({
  651. url: 'https://qtzl.etcjz.cn/minIo/upload', //仅为示例,非真实的接口地址
  652. filePath: val.tempImagePath,
  653. name: 'file',
  654. formData: {
  655. 'user': 'test',
  656. "bucket": 'default-bucket'
  657. },
  658. success: (uploadFileRes) => {
  659. let uploadFileImage = 'http://100.64.2.113:9000' + '/default-bucket/' + JSON.parse(uploadFileRes.data).data.ossFilePath
  660. var data = {
  661. source: "1",
  662. agencyId: "52010106004",
  663. imageType: imageType,
  664. fileName: val.tempImagePath,
  665. imageUrl: uploadFileImage
  666. };
  667. const options = {
  668. type: 2,
  669. data: data,
  670. method: "POST",
  671. showLoading: true,
  672. };
  673. request(etcCarOcrCard, options).then((res) => {
  674. const data = stringToJson(res.bizContent);
  675. if (state.choiceIndex === "3") {
  676. if (data.plate_a.length > 8) {
  677. state.form.vehicleIdNum = data.plate_a.substring(0, 8);
  678. } else {
  679. state.form.vehicleIdNum = data.plate_a;
  680. }
  681. state.form.man = data.man;
  682. state.form.vehicleType = data.vehicle;
  683. state.form.character = data.character;
  684. state.form.vin = data.vin;
  685. state.form.engineNum = data.engine;
  686. state.form.register = data.register;
  687. state.form.issueDate = data.issue;
  688. state.form.vehPosImgUrl = data.imageUrl;
  689. state.form.vehicleModel = data.model;
  690. } else {
  691. state.form.approvedCount = data.apc;
  692. state.form.approvedCountShow = data.apc;
  693. state.form.maintenaceMass = data.unladen;
  694. state.form.maintenaceMassShow = data.unladen;
  695. state.form.vehicleDimensions = data.overall.replaceAll("x", "X");
  696. let arr = data.overall.split("x");
  697. state.outlineL = arr[0]; //外廓 长
  698. state.outlineW = arr[1]; //外廓 宽
  699. state.outlineH = arr[2].substring(0, arr[2].length - 2); //外廓 高
  700. state.form.totalMass = data.gross;
  701. state.form.totalMassShow = data.gross;
  702. state.form.vehNegImgUrl = data.imageUrl;
  703. state.form.permittedWeight = data.alc ? data.alc : 0;
  704. state.form.permittedTowWeight = data.towing ? data.towing : 0;
  705. }
  706. state.isTakePhotoModeShow = false
  707. });
  708. },
  709. })
  710. }
  711. const takePhotoMode = (index) => {
  712. console.log("index", index)
  713. state.isTakePhotoModeShow = true
  714. state.choiceIndex = index
  715. }
  716. const cancle = () => {
  717. state.isTakePhotoModeShow = false
  718. }
  719. </script>
  720. <style lang="scss" scoped>
  721. .hui {
  722. color: #ccc;
  723. }
  724. .hei {
  725. color: black;
  726. }
  727. .goto {
  728. margin-right: 20rpx;
  729. padding: 10rpx;
  730. color: #00b38b;
  731. border: 1rpx solid #00b38b;
  732. border-radius: 20rpx;
  733. }
  734. .flex {
  735. display: flex;
  736. align-items: center;
  737. }
  738. .bettwen-center {
  739. display: flex;
  740. align-items: center;
  741. justify-content: space-between;
  742. }
  743. .card {
  744. margin: 20rpx;
  745. height: 150rpx;
  746. background: #ffffff;
  747. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  748. border-radius: 20rpx;
  749. padding: 20rpx;
  750. display: flex;
  751. justify-content: space-between;
  752. align-items: center;
  753. margin-bottom: 30rpx;
  754. .card-left {
  755. display: flex;
  756. align-items: center;
  757. image {
  758. width: 100rpx;
  759. height: 90rpx;
  760. }
  761. .card-center {
  762. margin-left: 30rpx;
  763. .card-center-head {
  764. font-size: 32rpx;
  765. font-family: Noto Sans S Chinese;
  766. font-weight: 400;
  767. color: #333333;
  768. }
  769. .tips {
  770. font-size: 26rpx;
  771. font-family: Noto Sans S Chinese;
  772. font-weight: 400;
  773. color: #666666;
  774. .tips-card {
  775. width: 70rpx;
  776. height: 40rpx;
  777. background: #d3f2ef;
  778. border-radius: 6rpx;
  779. font-size: 20rpx;
  780. font-family: Noto Sans S Chinese;
  781. font-weight: 400;
  782. color: #0a8f8a;
  783. padding: 5rpx 10rpx;
  784. margin-left: 20rpx;
  785. }
  786. }
  787. }
  788. }
  789. .choose-item {
  790. margin-right: 20rpx;
  791. width: 50rpx;
  792. height: 50rpx;
  793. border: 1rpx solid #00b38b;
  794. border-radius: 50%;
  795. display: flex;
  796. justify-content: center;
  797. align-items: center;
  798. .active {
  799. width: 38rpx;
  800. height: 38rpx;
  801. background: #00b38b;
  802. border-radius: 50%;
  803. }
  804. }
  805. }
  806. .content {
  807. position: relative;
  808. margin-top: -50rpx;
  809. padding: 0rpx 30rpx;
  810. position: relative;
  811. .img-pos {
  812. position: absolute;
  813. left: 270rpx;
  814. top: -38rpx;
  815. right: 50rpx;
  816. .img-flex {
  817. display: flex;
  818. justify-content: space-between;
  819. align-items: center;
  820. .car-img {
  821. width: 86rpx;
  822. height: 42rpx;
  823. }
  824. .flag-img {
  825. width: 30rpx;
  826. height: 35rpx;
  827. }
  828. }
  829. }
  830. .action {
  831. padding-left: 20rpx;
  832. padding-right: 20rpx;
  833. padding-bottom: 30rpx;
  834. .button {
  835. height: 80rpx;
  836. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  837. border-radius: 40rpx;
  838. font-size: 32rpx;
  839. font-weight: 400;
  840. color: #ffffff;
  841. line-height: 80rpx;
  842. }
  843. }
  844. .item-tips {
  845. .title {
  846. font-size: 30rpx;
  847. font-family: Microsoft YaHei;
  848. font-weight: 400;
  849. color: #000000;
  850. line-height: 24rpx;
  851. }
  852. .tip {
  853. margin-top: 16rpx;
  854. font-size: 24rpx;
  855. font-family: Microsoft YaHei;
  856. font-weight: 400;
  857. color: #999999;
  858. line-height: 24rpx;
  859. }
  860. }
  861. .picture-wrapper {
  862. margin-top: 40rpx;
  863. .bg {
  864. background: #ffffff;
  865. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  866. border-radius: 20rpx;
  867. padding: 40rpx;
  868. display: flex;
  869. // align-items: center;
  870. justify-content: space-between;
  871. .name {
  872. font-size: 34rpx;
  873. font-family: Microsoft YaHei;
  874. font-weight: 400;
  875. color: #000000;
  876. line-height: 34rpx;
  877. }
  878. .value {
  879. margin-top: 20rpx;
  880. font-size: 24rpx;
  881. font-family: Microsoft YaHei;
  882. font-weight: 400;
  883. color: #999999;
  884. line-height: 24rpx;
  885. }
  886. .tip {
  887. margin-top: 20rpx;
  888. text-align: center;
  889. width: 110rpx;
  890. height: 40rpx;
  891. background: rgba(33, 190, 177, 0.2);
  892. border-radius: 6rpx;
  893. .tip-value {
  894. font-size: 20rpx;
  895. font-family: Microsoft YaHei;
  896. font-weight: 400;
  897. color: #0a8f8a;
  898. line-height: 40rpx;
  899. opacity: 1;
  900. }
  901. }
  902. }
  903. .icon {
  904. width: 294rpx;
  905. height: 188rpx;
  906. }
  907. }
  908. .shibie-wrapper {
  909. margin-top: 60rpx;
  910. .title {
  911. font-size: 30rpx;
  912. font-family: Microsoft YaHei;
  913. font-weight: 400;
  914. color: #000000;
  915. line-height: 30rpx;
  916. }
  917. }
  918. .buchong-wrapper {
  919. margin-top: 60rpx;
  920. .title {
  921. font-size: 30rpx;
  922. font-family: Microsoft YaHei;
  923. font-weight: 400;
  924. color: #000000;
  925. line-height: 30rpx;
  926. }
  927. }
  928. .green-tip {
  929. margin-top: 50rpx;
  930. font-size: 24rpx;
  931. font-family: Microsoft YaHei;
  932. font-weight: 400;
  933. color: #00b38b;
  934. line-height: 24rpx;
  935. margin-bottom: 60rpx;
  936. }
  937. }
  938. .form-item {
  939. display: flex;
  940. font-size: 28rpx;
  941. justify-content: space-between;
  942. align-items: center;
  943. }
  944. .form-item label {}
  945. .form-item .input-box {
  946. display: flex;
  947. align-items: center;
  948. }
  949. .form-item .select {
  950. flex: 1;
  951. background: #f1f1f1;
  952. padding: 6rpx 20rpx;
  953. margin: 0 10rpx;
  954. min-height: 48rpx;
  955. line-height: 48rpx;
  956. border-radius: 8rpx;
  957. }
  958. .form-item .icon {
  959. width: 28rpx;
  960. height: 32rpx;
  961. }
  962. .form-item .input-box input {
  963. width: 90rpx;
  964. background: #f1f1f1;
  965. border-radius: 8rpx;
  966. padding: 0 5rpx;
  967. }
  968. .form-item .sub-text {
  969. color: #808080;
  970. padding-left: 10rpx;
  971. }
  972. .form-item .sub-label {
  973. padding: 0 10rpx;
  974. }
  975. .window {
  976. padding: 60rpx 30rpx;
  977. }
  978. .window .window-item {
  979. border: 1px solid #00b38b;
  980. background: rgba(0, 179, 139, .1);
  981. border-radius: 10rpx;
  982. padding: 16rpx 30rpx;
  983. font-size: 30rpx;
  984. margin-bottom: 10rpx;
  985. }
  986. ::v-deep .u-input__input {
  987. background: transparent;
  988. }
  989. .choice-takePhoto {
  990. position: absolute;
  991. bottom: 0;
  992. background-color: white;
  993. width: 100%;
  994. border-radius: 20rpx 20rpx 0 0;
  995. }
  996. .choice-takePhoto>view:first-child {
  997. text-align: center;
  998. height: 80rpx;
  999. line-height: 80rpx;
  1000. border-bottom: 1rpx solid rgba(127, 127, 127, 0.3);
  1001. background-color: white;
  1002. }
  1003. .choice-takePhoto>view:last-child {
  1004. text-align: center;
  1005. height: 80rpx;
  1006. line-height: 80rpx;
  1007. border-top: 6rpx solid rgba(127, 127, 127, 0.1);
  1008. background-color: white;
  1009. }
  1010. .choice-takePhoto>view {
  1011. text-align: center;
  1012. height: 80rpx;
  1013. line-height: 80rpx;
  1014. background-color: white;
  1015. }
  1016. .choice-takePhoto-wrap {
  1017. width: 100%;
  1018. height: 100vh;
  1019. background-color: rgba(127, 127, 127, 0.2);
  1020. position: fixed;
  1021. left: 0;
  1022. top: 0;
  1023. z-index: 11111;
  1024. }
  1025. </style>