選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。

car-release.vue 29KB

2年前
2年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
1年前
2年前
2年前
1年前
1年前
1年前
1年前
1年前
2年前
2年前
2年前
2年前
1年前
1年前
1年前
1年前
2年前
2年前
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021
  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 navBgCar from "./components/nav-bg-car4";
  208. import navBar from "@/components/nav-bar/nav-bar2.vue";
  209. import carNumberInput from "@/components/car-number-input/car-number-input.vue";
  210. import {
  211. etcCarCardInfoSubmit,
  212. etcCarOcrCard,
  213. fileUpload,
  214. envs,
  215. queryGuoHuJianCe,
  216. queryGuoHuCaoZuo,
  217. ocrAllQuery
  218. } from "@/utils/network/api.js";
  219. import { request } from "@/utils/network/request.js";
  220. import { stringToJson } from "@/utils/network/encryption";
  221. import { onLoad, onPageScroll } from "@dcloudio/uni-app";
  222. import { getObuStatus } from "@/datas/obuStatus.js";
  223. import { getEtcCardStatus } from "@/datas/etcCardStatus.js";
  224. import { getItem, StorageKeys } from "@/utils/storage";
  225. // import { hasLogin } from "@/utils/utils.ts";
  226. import { msg, strReplace, hasLogin, uploadFile } from "@/utils/utils";
  227. import {
  228. getCodeName
  229. } from "@/datas/queryKey.js";
  230. const scrollTop = ref(0);
  231. //监听页面滚动
  232. onPageScroll((e) => {
  233. scrollTop.value = e.scrollTop;
  234. });
  235. //车牌号输入
  236. const carNumber = (val : any) => {
  237. state.form.vehicleIdNum = val.trim();
  238. };
  239. const camera = () => {
  240. state.phoneType = 0
  241. }
  242. //提交车辆信息
  243. const savaHandle = () => {
  244. if (!state.form.vehBodyUrl) {
  245. msg("请上传车头照");
  246. return;
  247. }
  248. if (state.form.type == 1) {
  249. state.form.axleCount = 2;
  250. } else {
  251. if (!state.form.axleCount) {
  252. msg("请输入车轴数");
  253. return;
  254. }
  255. }
  256. state.form.vehicleId =
  257. state.form.vehicleIdNum + "_" + state.vehiclePlateColor;
  258. state.form.opId = getItem(StorageKeys.OpenId);
  259. state.form.approvedCount = parseFloat(state.form.approvedCount);
  260. state.form.maintenaceMass = parseFloat(state.form.maintenaceMass);
  261. state.form.totalMass = parseFloat(state.form.totalMass);
  262. state.form.permittedWeight = parseFloat(state.form.permittedWeight);
  263. state.form.permittedTowWeight = parseFloat(state.form.permittedTowWeight);
  264. const options = {
  265. type: 2,
  266. data: state.form,
  267. method: "POST",
  268. showLoading: true,
  269. };
  270. request(etcCarCardInfoSubmit, options)
  271. .then((res) => {
  272. const data = stringToJson(res.bizContent);
  273. queryGuoHuJianCeAction().then((value) => {
  274. console.log("过户检测", value)
  275. if (value.transferLogs && value.transferLogs.length > 0) {
  276. let arr = value.transferLogs;
  277. state.data.transferLogs=[]
  278. for (var k = 0; k < arr.length; k++) {
  279. if (arr[k]['status'] == "WAITING") {
  280. state.data.transferLogs.push(arr[k])
  281. }
  282. }
  283. console.log("state.data.transferLogs", state.data.transferLogs)
  284. console.log("state.data.transferLogs", state.data.transferLogs.length)
  285. setTimeout(() => {
  286. if (state.data.transferLogs.length > 0) {
  287. state.show = true;
  288. } else {
  289. uni.redirectTo({
  290. url: `/subpackage/orders/product-detail?orderId=${state.form.orderId}&&clientFee=${getItem("clientFee")}&&id=${getItem("productId")}&&isValueCard=${getItem("isValueCard")}`,
  291. });
  292. }
  293. }, 1000)
  294. } else {
  295. if (!hasLogin()) {
  296. uni.redirectTo({
  297. url: `/subpackage/orders/addAddress?orderId=${state.form.orderId
  298. }&clientFee=${getItem("clientFee")}&&id=${getItem("productId")}`,
  299. });
  300. } else {
  301. uni.redirectTo({
  302. url: `/subpackage/orders/product-detail?orderId=${state.form.orderId}&&clientFee=${getItem("clientFee")}&&id=${getItem("productId")}&&isValueCard=${getItem("isValueCard")}`,
  303. });
  304. }
  305. }
  306. });
  307. })
  308. .catch((res) => {
  309. console.log(res);
  310. });
  311. };
  312. const pass = () => {
  313. state.show = false
  314. if (!state.form.vehBodyUrl) {
  315. msg("请上传车头照");
  316. return;
  317. }
  318. if (state.form.type == 1) {
  319. state.form.axleCount = 2;
  320. } else {
  321. if (!state.form.axleCount) {
  322. msg("请输入车轴数");
  323. return;
  324. }
  325. }
  326. state.form.vehicleId =
  327. state.form.vehicleIdNum + "_" + state.vehiclePlateColor;
  328. state.form.opId = getItem(StorageKeys.OpenId);
  329. state.form.approvedCount = parseFloat(state.form.approvedCount);
  330. state.form.maintenaceMass = parseFloat(state.form.maintenaceMass);
  331. state.form.totalMass = parseFloat(state.form.totalMass);
  332. state.form.permittedWeight = parseFloat(state.form.permittedWeight);
  333. state.form.permittedTowWeight = parseFloat(state.form.permittedTowWeight);
  334. const options = {
  335. type: 2,
  336. data: state.form,
  337. method: "POST",
  338. showLoading: true,
  339. };
  340. request(etcCarCardInfoSubmit, options).then((res) => {
  341. uni.redirectTo({
  342. url: `/subpackage/orders/product-detail?orderId=${state.form.orderId}&&clientFee=${getItem("clientFee")}&&id=${getItem("productId")}&&isValueCard=${getItem("isValueCard")}`,
  343. });
  344. })
  345. }
  346. const selectConfirm = (index : any) => {
  347. console.log(index);
  348. state.form.useUserType = state.actionSheetList[index].value;
  349. state.form.useUserTypeName = state.actionSheetList[index].text;
  350. };
  351. //选择车辆用户类型
  352. const userType = (item : any) => {
  353. state.form.useUserType = item.value;
  354. state.form.useUserTypeName = item.text;
  355. state.actionSheetShow = false;
  356. }
  357. //车头照图片上传
  358. const cardFileImageUpdate = () => {
  359. uni.chooseImage({
  360. count: 1, //只能选取一张照片
  361. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  362. sourceType: ["camera", "album"], //从相册选择
  363. success: function (res) {
  364. uploadFile(res.tempFilePaths[0], "", "").then((data) => {
  365. state.form.vehBodyUrl = data;
  366. })
  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. images: '',
  377. data: {
  378. transferLogs: [],
  379. },
  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. //过户检测
  474. const queryGuoHuJianCeAction = () => {
  475. var data = {
  476. orderId: state.form.orderId,
  477. };
  478. const options = {
  479. type: 2,
  480. data: data,
  481. method: "POST",
  482. showLoading: true,
  483. };
  484. return new Promise(async (resolve, reject) => {
  485. const res = await request(queryGuoHuJianCe, options);
  486. const data = stringToJson(res.bizContent);
  487. console.log("过户检测111", data)
  488. resolve(data);
  489. }).catch((error) => {
  490. reject(error);
  491. });
  492. };
  493. //过户操作
  494. const guohuAction = (val) => {
  495. var data = {
  496. orderId: state.form.orderId,
  497. serviceType: "USE",
  498. obuId: val.obuId,
  499. cardId: val.cardId,
  500. };
  501. const options = {
  502. type: 2,
  503. data: data,
  504. method: "POST",
  505. showLoading: true,
  506. };
  507. return new Promise(async (resolve, reject) => {
  508. const res = await request(queryGuoHuCaoZuo, options);
  509. const data = stringToJson(res.bizContent);
  510. state.show = false;
  511. uni.redirectTo({
  512. url: `/subpackage/orders/product-detail?orderId=${state.form.orderId}&&clientFee=${getItem("clientFee")}&&id=${getItem("productId")}&&isValueCard=${getItem("isValueCard")}`,
  513. });
  514. }).catch((error) => {
  515. reject(error);
  516. });
  517. };
  518. const getGlobalParam = () => {
  519. const data = getItem('globalParam')
  520. console.log("全局配置数据", getCodeName('IS_ENABLE', data.applyChangeOCRCarInfo))
  521. // 申办时是否允许修改OCR识别出来的车辆信息数据
  522. if (getCodeName('IS_ENABLE', data.applyChangeOCRCarInfo) == '启用') {
  523. state.isEnableChangeOCRCarInfo = true;
  524. } else {
  525. state.isEnableChangeOCRCarInfo = false;
  526. }
  527. }
  528. const bindDateChange1 = (e) => {
  529. state.form.register = e.detail.value
  530. state.changeColor = true;
  531. }
  532. const bindDateChange2 = (e) => {
  533. state.form.issueDate = e.detail.value
  534. state.changeColor = true;
  535. }
  536. const xiangce = (val) => {
  537. console.log("val", val)
  538. if (state.choiceIndex == 3) {
  539. var imageType = 1;
  540. } else {
  541. var imageType = 2;
  542. }
  543. state.changeColor = true;
  544. uni.chooseImage({
  545. count: 1, //只能选取一张照片
  546. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  547. sourceType: ["album"], //从相册选择
  548. success: function (res) {
  549. console.log("tempFilePaths[0].startsWith('file://')", res.tempFilePaths[0], res.tempFilePaths[0].startsWith('file://'))
  550. if (state.choiceIndex == 3 || state.choiceIndex == 4) {
  551. state.showImg = false
  552. state.images = res.tempFilePaths[0]
  553. state.phoneType = state.choiceIndex
  554. state.isTakePhotoModeShow = false
  555. return
  556. }
  557. },
  558. })
  559. }
  560. const takePhoto = (val) => {
  561. console.log("拍照", val)
  562. state.phoneType = val;
  563. state.showImg = true;
  564. }
  565. const confirmReturn = (val) => {
  566. if (state.choiceIndex == 3) {
  567. var imageType = 1;
  568. } else {
  569. var imageType = 2;
  570. }
  571. state.changeColor = true;
  572. state.phoneType = 0
  573. state.isTakePhotoModeShow = false
  574. uploadFile(val.tempImagePath, imageType, etcCarOcrCard).then((data) => {
  575. // uploadFile(val.tempImagePath, state.choiceIndex, ocrAllQuery).then((data) => {
  576. console.log('输出内容=====================', state.choiceIndex)
  577. if (state.choiceIndex === "3") {
  578. if (data.plate_a.length > 8) {
  579. state.form.vehicleIdNum = data.plate_a.substring(0, 8);
  580. } else {
  581. state.form.vehicleIdNum = data.plate_a;
  582. }
  583. state.form.man = data.man;
  584. state.form.vehicleType = data.vehicle;
  585. state.form.character = data.character;
  586. state.form.vin = data.vin;
  587. state.form.engineNum = data.engine;
  588. state.form.register = data.register;
  589. state.form.issueDate = data.issue;
  590. state.form.vehPosImgUrl = data.imageUrl;
  591. state.form.vehicleModel = data.model;
  592. } else {
  593. state.form.approvedCount = data.apc;
  594. state.form.approvedCountShow = data.apc;
  595. state.form.maintenaceMass = data.unladen;
  596. state.form.maintenaceMassShow = data.unladen;
  597. // 91接口差
  598. // // #ifdef MP-WEIXIN
  599. // state.form.vehicleDimensions = data.overall.replaceAll("×", "X");
  600. // // #endif
  601. // // #ifdef MP-ALIPAY
  602. // state.form.vehicleDimensions = data.overall.replace(/×/g, "X");
  603. // // #endif
  604. // let arr = data.overall.split("×");
  605. // #ifdef MP-WEIXIN
  606. state.form.vehicleDimensions = data.overall.replaceAll("x", "X");
  607. // #endif
  608. // #ifdef MP-ALIPAY
  609. state.form.vehicleDimensions = data.overall.replace(/x/g, "X");
  610. // #endif
  611. let arr = data.overall.split("x");
  612. state.outlineL = arr[0]; //外廓 长
  613. state.outlineW = arr[1]; //外廓 宽
  614. state.outlineH = arr[2].substring(0, arr[2].length - 2); //外廓 高
  615. state.form.totalMass = data.gross;
  616. state.form.totalMassShow = data.gross;
  617. state.form.vehNegImgUrl = data.imageUrl;
  618. state.form.permittedWeight = data.alc ? data.alc : 0;
  619. state.form.permittedTowWeight = data.towing ? data.towing : 0;
  620. console.log('=====================', state.form.vehNegImgUrl, state)
  621. }
  622. state.isTakePhotoModeShow = false
  623. })
  624. console.log("图片地址val", val.tempImagePath)
  625. }
  626. const takePhotoMode = (index) => {
  627. console.log("index", index)
  628. state.isTakePhotoModeShow = true
  629. state.choiceIndex = index
  630. }
  631. const cancle = () => {
  632. state.isTakePhotoModeShow = false
  633. }
  634. </script>
  635. <style lang="scss" scoped>
  636. .hui {
  637. color: #ccc;
  638. }
  639. .hei {
  640. color: black;
  641. }
  642. .goto {
  643. margin-right: 20rpx;
  644. padding: 10rpx;
  645. color: #00b38b;
  646. border: 1rpx solid #00b38b;
  647. border-radius: 20rpx;
  648. }
  649. .flex {
  650. display: flex;
  651. align-items: center;
  652. }
  653. .bettwen-center {
  654. display: flex;
  655. align-items: center;
  656. justify-content: space-between;
  657. }
  658. .card {
  659. margin: 20rpx;
  660. height: 150rpx;
  661. background: #ffffff;
  662. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  663. border-radius: 20rpx;
  664. padding: 20rpx;
  665. display: flex;
  666. justify-content: space-between;
  667. align-items: center;
  668. margin-bottom: 30rpx;
  669. .card-left {
  670. display: flex;
  671. align-items: center;
  672. image {
  673. width: 100rpx;
  674. height: 90rpx;
  675. }
  676. .card-center {
  677. margin-left: 30rpx;
  678. .card-center-head {
  679. font-size: 32rpx;
  680. font-family: Noto Sans S Chinese;
  681. font-weight: 400;
  682. color: #333333;
  683. }
  684. .tips {
  685. font-size: 26rpx;
  686. font-family: Noto Sans S Chinese;
  687. font-weight: 400;
  688. color: #666666;
  689. .tips-card {
  690. width: 70rpx;
  691. height: 40rpx;
  692. background: #d3f2ef;
  693. border-radius: 6rpx;
  694. font-size: 20rpx;
  695. font-family: Noto Sans S Chinese;
  696. font-weight: 400;
  697. color: #0a8f8a;
  698. padding: 5rpx 10rpx;
  699. margin-left: 20rpx;
  700. }
  701. }
  702. }
  703. }
  704. .choose-item {
  705. margin-right: 20rpx;
  706. width: 50rpx;
  707. height: 50rpx;
  708. border: 1rpx solid #00b38b;
  709. border-radius: 50%;
  710. display: flex;
  711. justify-content: center;
  712. align-items: center;
  713. .active {
  714. width: 38rpx;
  715. height: 38rpx;
  716. background: #00b38b;
  717. border-radius: 50%;
  718. }
  719. }
  720. }
  721. .content {
  722. position: relative;
  723. margin-top: -50rpx;
  724. padding: 0rpx 30rpx;
  725. position: relative;
  726. .img-pos {
  727. position: absolute;
  728. left: 270rpx;
  729. top: -38rpx;
  730. right: 50rpx;
  731. .img-flex {
  732. display: flex;
  733. justify-content: space-between;
  734. align-items: center;
  735. .car-img {
  736. width: 86rpx;
  737. height: 42rpx;
  738. }
  739. .flag-img {
  740. width: 30rpx;
  741. height: 35rpx;
  742. }
  743. }
  744. }
  745. .action {
  746. padding-left: 20rpx;
  747. padding-right: 20rpx;
  748. padding-bottom: 30rpx;
  749. .button {
  750. height: 80rpx;
  751. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  752. border-radius: 40rpx;
  753. font-size: 32rpx;
  754. font-weight: 400;
  755. color: #ffffff;
  756. line-height: 80rpx;
  757. }
  758. }
  759. .item-tips {
  760. .title {
  761. font-size: 30rpx;
  762. font-family: Microsoft YaHei;
  763. font-weight: 400;
  764. color: #000000;
  765. line-height: 24rpx;
  766. }
  767. .tip {
  768. margin-top: 16rpx;
  769. font-size: 24rpx;
  770. font-family: Microsoft YaHei;
  771. font-weight: 400;
  772. color: #999999;
  773. line-height: 24rpx;
  774. }
  775. }
  776. .picture-wrapper {
  777. margin-top: 40rpx;
  778. .bg {
  779. background: #ffffff;
  780. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  781. border-radius: 20rpx;
  782. padding: 40rpx;
  783. display: flex;
  784. // align-items: center;
  785. justify-content: space-between;
  786. .name {
  787. font-size: 34rpx;
  788. font-family: Microsoft YaHei;
  789. font-weight: 400;
  790. color: #000000;
  791. line-height: 34rpx;
  792. }
  793. .value {
  794. margin-top: 20rpx;
  795. font-size: 24rpx;
  796. font-family: Microsoft YaHei;
  797. font-weight: 400;
  798. color: #999999;
  799. line-height: 24rpx;
  800. }
  801. .tip {
  802. margin-top: 20rpx;
  803. text-align: center;
  804. width: 110rpx;
  805. height: 40rpx;
  806. background: rgba(33, 190, 177, 0.2);
  807. border-radius: 6rpx;
  808. .tip-value {
  809. font-size: 20rpx;
  810. font-family: Microsoft YaHei;
  811. font-weight: 400;
  812. color: #0a8f8a;
  813. line-height: 40rpx;
  814. opacity: 1;
  815. }
  816. }
  817. }
  818. .icon {
  819. width: 294rpx;
  820. height: 188rpx;
  821. }
  822. }
  823. .shibie-wrapper {
  824. margin-top: 60rpx;
  825. .title {
  826. font-size: 30rpx;
  827. font-family: Microsoft YaHei;
  828. font-weight: 400;
  829. color: #000000;
  830. line-height: 30rpx;
  831. }
  832. }
  833. .buchong-wrapper {
  834. margin-top: 60rpx;
  835. .title {
  836. font-size: 30rpx;
  837. font-family: Microsoft YaHei;
  838. font-weight: 400;
  839. color: #000000;
  840. line-height: 30rpx;
  841. }
  842. }
  843. .green-tip {
  844. margin-top: 50rpx;
  845. font-size: 24rpx;
  846. font-family: Microsoft YaHei;
  847. font-weight: 400;
  848. color: #00b38b;
  849. line-height: 24rpx;
  850. margin-bottom: 60rpx;
  851. }
  852. }
  853. .form-item {
  854. display: flex;
  855. font-size: 28rpx;
  856. justify-content: space-between;
  857. align-items: center;
  858. }
  859. .form-item label {}
  860. .form-item .input-box {
  861. display: flex;
  862. align-items: center;
  863. }
  864. .form-item .select {
  865. flex: 1;
  866. background: #f1f1f1;
  867. padding: 6rpx 20rpx;
  868. margin: 0 10rpx;
  869. min-height: 48rpx;
  870. line-height: 48rpx;
  871. border-radius: 8rpx;
  872. }
  873. .form-item .icon {
  874. width: 28rpx;
  875. height: 32rpx;
  876. }
  877. .form-item .input-box input {
  878. width: 90rpx;
  879. background: #f1f1f1;
  880. border-radius: 8rpx;
  881. padding: 0 5rpx;
  882. }
  883. .form-item .sub-text {
  884. color: #808080;
  885. padding-left: 10rpx;
  886. }
  887. .form-item .sub-label {
  888. padding: 0 10rpx;
  889. }
  890. .window {
  891. padding: 60rpx 30rpx;
  892. }
  893. .window .window-item {
  894. border: 1px solid #00b38b;
  895. background: rgba(0, 179, 139, .1);
  896. border-radius: 10rpx;
  897. padding: 16rpx 30rpx;
  898. font-size: 30rpx;
  899. margin-bottom: 10rpx;
  900. }
  901. ::v-deep .u-input__input {
  902. background: transparent;
  903. }
  904. .choice-takePhoto {
  905. position: absolute;
  906. bottom: 0;
  907. background-color: white;
  908. width: 100%;
  909. border-radius: 20rpx 20rpx 0 0;
  910. }
  911. .choice-takePhoto>view:first-child {
  912. text-align: center;
  913. height: 80rpx;
  914. line-height: 80rpx;
  915. border-bottom: 1rpx solid rgba(127, 127, 127, 0.3);
  916. background-color: white;
  917. }
  918. .choice-takePhoto>view:last-child {
  919. text-align: center;
  920. height: 80rpx;
  921. line-height: 80rpx;
  922. border-top: 6rpx solid rgba(127, 127, 127, 0.1);
  923. background-color: white;
  924. }
  925. .choice-takePhoto>view {
  926. text-align: center;
  927. height: 80rpx;
  928. line-height: 80rpx;
  929. background-color: white;
  930. }
  931. .choice-takePhoto-wrap {
  932. width: 100%;
  933. height: 100vh;
  934. background-color: rgba(127, 127, 127, 0.2);
  935. position: fixed;
  936. left: 0;
  937. top: 0;
  938. z-index: 11111;
  939. }
  940. </style>