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

car-message-change.vue 34KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318
  1. <template>
  2. <view v-if="state.isMyPeopple" 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('1','my')">
  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.userPosImgUrl" class="icon" :src="`${$imgUrl}applyCard/renxiang.png`">
  17. </image>
  18. <image v-else class="icon" :src="strReplace(state.form.userPosImgUrl)"></image>
  19. </view>
  20. </view>
  21. <view class="picture-wrapper" @click="takePhotoMode('2','my')">
  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.userNegImgUrl" class="icon" :src="`${$imgUrl}applyCard/guohui.png`">
  31. </image>
  32. <image v-else class="icon" :src="strReplace(state.form.userNegImgUrl)"></image>
  33. </view>
  34. </view>
  35. <view class="shibie-wrapper">
  36. <view class="title"> 识别内容如下 </view>
  37. <u-form label-width="230" :model="state.form" ref="uForm">
  38. <u-form-item label="姓名">
  39. <u-input v-model="state.form.userName" placeholder='请输入姓名' :disabled="state.isEnableOCRData"
  40. maxlength="20" @input="replaceInput" />
  41. </u-form-item>
  42. <u-form-item label="身份证号">
  43. <u-input placeholder='请输入身份证' type="idcard" v-model="state.form.userIdNum"
  44. :disabled="state.isEnableOCRData" maxlength="18" />
  45. </u-form-item>
  46. <u-form-item label="地址">
  47. <u-input placeholder='请输入地址' :autoHeight='true' v-model="state.form.address"
  48. :disabled="state.isEnableOCRData" maxlength="100" />
  49. </u-form-item>
  50. <u-form-item label="联系方式">
  51. <u-input placeholder='请输入联系方式' type="number" v-model="state.form.tel" maxlength="11" />
  52. </u-form-item>
  53. </u-form>
  54. </view>
  55. <view class="green-tip">
  56. 如识别信息有误,请手动修改,确认无误后,点击下一步!
  57. </view>
  58. <view class="action">
  59. <button type="default" class="button" @click="savaHandle()">
  60. 下一步
  61. </button>
  62. </view>
  63. <view class="picture-wrapper" @click="takePhotoMode('3')">
  64. <view class="bg">
  65. <view class="">
  66. <view class="name"> 行驶证主页 </view>
  67. <view class="value"> 上传行驶证的主页 </view>
  68. <view class="tip">
  69. <view class="tip-value"> 拍摄规范 </view>
  70. </view>
  71. </view>
  72. <image v-if="!state.form.vehPosImgUrl" class="icon" :src="`${$imgUrl}applyCard/car-zhu.png`">
  73. </image>
  74. <image v-else class="icon" :src="strReplace(state.form.vehPosImgUrl)"></image>
  75. </view>
  76. </view>
  77. <view class="picture-wrapper" @click="takePhotoMode('4')">
  78. <view class="bg">
  79. <view class="">
  80. <view class="name"> 行驶证副页 </view>
  81. <view class="value"> 上传行驶证的副页 </view>
  82. <view class="tip">
  83. <view class="tip-value"> 拍摄规范 </view>
  84. </view>
  85. </view>
  86. <image v-if="!state.form.vehNegImgUrl" class="icon" :src="`${$imgUrl}applyCard/car-fu.png`">
  87. </image>
  88. <image v-else class="icon" :src="strReplace(state.form.vehNegImgUrl)"></image>
  89. </view>
  90. </view>
  91. <view class="picture-wrapper" @click="cardFileImageUpdate()">
  92. <view class="bg">
  93. <view class="">
  94. <view class="name"> 车头照 </view>
  95. <view class="value"> 上传汽车的车头照片 </view>
  96. <view class="tip">
  97. <view class="tip-value"> 拍摄规范 </view>
  98. </view>
  99. </view>
  100. <image v-if="!state.form.vehBodyUrl" class="icon" :src="`${$imgUrl}applyCard/chetou.png`">
  101. </image>
  102. <image v-else class="icon" :src="strReplace(state.form.vehBodyUrl)"></image>
  103. </view>
  104. </view>
  105. <view class="shibie-wrapper">
  106. <view class="title"> 识别内容如下 </view>
  107. <view class="">
  108. <u-form label-width="200" :model="state.form" ref="uForm">
  109. <u-form-item label="车牌号">
  110. <!-- <u-input inputAlign="right" placeholder='请输入车牌号' v-model="state.form.vehicleIdNum" /> -->
  111. <car-number-input @numberInputResult="carNumber"
  112. :defaultStr="state.form.vehicleIdNum"></car-number-input>
  113. </u-form-item>
  114. <u-form-item label="所有人">
  115. <u-input inputAlign="right" placeholder="请输入所有人" v-model="state.form.man"
  116. :disabled="state.isEnableChangeOCRCarInfo" />
  117. </u-form-item>
  118. <u-form-item label="车辆类型">
  119. <u-input inputAlign="right" placeholder="请输入车辆类型" v-model="state.form.vehicleType"
  120. :disabled="state.isEnableChangeOCRCarInfo" />
  121. </u-form-item>
  122. <u-form-item label="使用性质">
  123. <u-input inputAlign="right" placeholder="请输入使用性质" v-model="state.form.character"
  124. :disabled="state.isEnableChangeOCRCarInfo" />
  125. </u-form-item>
  126. <u-form-item label="车辆识别代号">
  127. <u-input inputAlign="right" placeholder="请输入车辆识别代号" v-model="state.form.vin"
  128. :disabled="state.isEnableChangeOCRCarInfo" />
  129. </u-form-item>
  130. <u-form-item label="发动机号码">
  131. <u-input inputAlign="right" placeholder="请输入发动机号码" v-model="state.form.engineNum"
  132. :disabled="state.isEnableChangeOCRCarInfo" />
  133. </u-form-item>
  134. <u-form-item label="注册日期">
  135. <picker mode="date" :value="state.form.register" @change="bindDateChange1"
  136. :disabled="state.isEnableChangeOCRCarInfo">
  137. <view class="uni-input" style="text-align: right;" :class="state.changeColor?'hei':'hui'">
  138. {{state.form.register}}
  139. </view>
  140. </picker>
  141. </u-form-item>
  142. <u-form-item label="发证日期">
  143. <picker mode="date" :value="state.form.issueDate" @change="bindDateChange2"
  144. :disabled="state.isEnableChangeOCRCarInfo">
  145. <view class="uni-input" style="text-align: right;" :class="state.changeColor?'hei':'hui'">
  146. {{state.form.issueDate}}
  147. </view>
  148. </picker>
  149. </u-form-item>
  150. <u-form-item label="核定载人数">
  151. <u-input inputAlign="right" placeholder="请输入核定载人数" v-model="state.form.approvedCountShow"
  152. :disabled="state.isEnableChangeOCRCarInfo" />
  153. </u-form-item>
  154. <u-form-item label="整备质量">
  155. <u-input inputAlign="right" placeholder="请输入整备质量" v-model="state.form.maintenaceMassShow"
  156. :disabled="state.isEnableChangeOCRCarInfo" />
  157. </u-form-item>
  158. <view class="form-item">
  159. <label>外廊尺寸</label>
  160. <view class="input-box">
  161. <text class="sub-label">长</text>
  162. <input v-model="state.outlineL" @input="outlineInput"
  163. :disabled="state.isEnableChangeOCRCarInfo" />
  164. <text class="sub-text">X</text>
  165. <text class="sub-label">宽</text>
  166. <input v-model="state.outlineW" @input="outlineInput"
  167. :disabled="state.isEnableChangeOCRCarInfo" />
  168. <text class="sub-text">X</text>
  169. <text class="sub-label">高</text>
  170. <input v-model="state.outlineH" @input="outlineInput"
  171. :disabled="state.isEnableChangeOCRCarInfo" />
  172. <text class="sub-text">mm</text>
  173. </view>
  174. </view>
  175. <u-form-item label="总质量">
  176. <u-input inputAlign="right" placeholder="请输入总质量" v-model="state.form.totalMassShow"
  177. :disabled="state.isEnableChangeOCRCarInfo" />
  178. </u-form-item>
  179. <u-form-item label="车轴数">
  180. <u-input inputAlign="right" placeholder="请输入车轴数" v-model="state.form.axleCount" type="number"
  181. maxlength="2" />
  182. </u-form-item>
  183. <view class="form-item">
  184. <label>车辆用户类型</label>
  185. <view class="select" @click="state.actionSheetShow = true">{{state.form.useUserTypeName}}</view>
  186. <image :src="`${$imgUrl}common/arror-down.png`" class="icon"
  187. @click="state.actionSheetShow = true"></image>
  188. </view>
  189. </u-form>
  190. </view>
  191. </view>
  192. <view class="action">
  193. <button type="default" class="button" @click="savaHandleCar()">
  194. 下一步
  195. </button>
  196. </view>
  197. <!-- 车辆类型弹窗 -->
  198. <u-popup mode="bottom" v-model="state.actionSheetShow">
  199. <view class="window">
  200. <view class="window-item" v-for="item in state.actionSheetList" :key="item.value"
  201. @click="userType(item)">{{item.text}}</view>
  202. </view>
  203. </u-popup>
  204. </view>
  205. <u-select mode="single-column" :list="state.genderList" v-model="state.genderShow" @confirm="genderSelectConfirm">
  206. </u-select>
  207. <view class="choice-takePhoto-wrap" v-if="state.isTakePhotoModeShow" @click="cancle">
  208. <view class="choice-takePhoto">
  209. <view @click.stop="takePhoto(state.choiceIndex)" style="border-radius: 20rpx 20rpx 0 0;">拍照</view>
  210. <view @click.stop="xiangce(state.choiceIndex)">从手机相册选择</view>
  211. <view @click.stop="cancle">取消</view>
  212. </view>
  213. </view>
  214. <viewfinder v-if="state.phoneType" :phoneType="state.phoneType" :images="state.images"
  215. :showStartPhoto="state.showImg" @confirmReturn="confirmReturn" @camera="camera"></viewfinder>
  216. </template>
  217. <script setup lang="ts">
  218. import viewfinder from "../../components/viewfinder.vue"
  219. import {
  220. reactive,
  221. ref,
  222. } from "vue";
  223. import {
  224. msg,
  225. checkStr,
  226. strReplace,
  227. uploadFile, hasLogin
  228. } from "@/utils/utils";
  229. import {
  230. onLoad,
  231. onPageScroll,
  232. } from "@dcloudio/uni-app";
  233. import {
  234. etcOcrCard,
  235. etcUserCardInfoSubmit,
  236. fileUpload,
  237. register,
  238. envs,
  239. getUserMsg,
  240. ocrAllQuery,
  241. etcCarCardInfoSubmit,
  242. etcCarOcrCard,
  243. queryGuoHuJianCe,
  244. queryGuoHuCaoZuo,
  245. searchVehicleInfo
  246. } from "@/utils/network/api.js";
  247. import {
  248. request
  249. } from "@/utils/network/request.js";
  250. import {
  251. stringToJson
  252. } from "@/utils/network/encryption";
  253. import {
  254. setItem,
  255. getItem,
  256. StorageKeys
  257. } from "@/utils/storage";
  258. import {
  259. getCodeName
  260. } from "@/datas/queryKey.js";
  261. import navBar from "@/components/nav-bar/nav-bar2.vue";
  262. import carNumberInput from "@/components/car-number-input/car-number-input.vue";
  263. import { getObuStatus } from "@/datas/obuStatus.js";
  264. import { getEtcCardStatus } from "@/datas/etcCardStatus.js";
  265. const scrollTop = ref(0)
  266. const state = reactive({
  267. showImg: true,
  268. isMy: "",//自己办理 他人办理
  269. phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面
  270. choiceIndex: 1, // 1 身份证正面 2 身份证反面
  271. isTakePhotoModeShow: false, //选择拍照方式是否出来
  272. images: '',
  273. genderList: [{
  274. value: '男',
  275. label: '男'
  276. },
  277. {
  278. value: '女',
  279. label: '女'
  280. }
  281. ],
  282. form: {
  283. orderId: "", //订单ID
  284. userName: "", //开户人姓名
  285. userIdType: "101", //用户证件类型 101//身份证
  286. userIdNum: "", //用户证件号码
  287. userPosImgUrl: "", //身份证正面
  288. userNegImgUrl: "", //身份证反面
  289. tel: "", //开户人手机号
  290. address: "", //开户人地址
  291. sceneType: "", //用户协议支撑服务场景(发行服务机构和用户签订的协议)
  292. channelId: "", //渠道id
  293. gender: "",
  294. customerIdVld: "",
  295. agentName: "",
  296. agentGender: "",
  297. agentTel: '',
  298. agentPhone: "",
  299. agentIdType: "101",
  300. agentIdNum: "",
  301. agentPosImgUrl: "",
  302. agentNegImgUrl: "",
  303. proxyUrl: "",
  304. agentAddress: "",
  305. agentIdVld: '',
  306. opId: '',
  307. orderSource: 'WECHAT',
  308. man: "", //所有人
  309. character: "", //使用性质
  310. register: "请输入注册日期", //注册日期
  311. customerId: "", //用户编号
  312. vehicleId: "",
  313. vehicleIdNum: "", //车牌编号
  314. issueDate: "请输入发证日期", //发证日期
  315. vehPosImgUrl: "", //行驶证正面
  316. vehNegImgUrl: "", //行驶证证反面
  317. type: "0", //0,客车 1.货车
  318. useUserType: 0, //车辆用户类型
  319. useUserTypeName: "普通车",
  320. vehicleSign: 2, //前/后装标识
  321. vin: "", //车辆识别代号
  322. engineNum: "", //发动机号码
  323. vehicleType: "", //车辆类型
  324. vehicleModel: "", //行驶证品牌型号
  325. approvedCount: undefined, //核定人数
  326. approvedCountShow: undefined,//展示的
  327. totalMass: undefined, //总质量
  328. totalMassShow: undefined, //总质量
  329. maintenaceMass: undefined, //整备质量
  330. maintenaceMassShow: undefined, //整备质量展示的
  331. permittedWeight: "", //核定载质量
  332. vehicleDimensions: "", //车辆尺寸
  333. permittedTowWeight: "", //准牵引总质量
  334. axleCount: "", //车轴数
  335. ownerName: "", //车主姓名
  336. ownerIdType: "", //车主证件类型
  337. ownerIdNum: "", //车主证件号码
  338. ownPosImgUrl: "", //车主证件正面图片
  339. ownNegImgUrl: "", //车主证件反面图片
  340. agreementId: "", //签约编号
  341. // channelId: "5201018892300000001", //编号渠道
  342. scenePayType: "", //
  343. transportIdNum: "", //道路运输证编号
  344. licenseIdNum: "", //经营许可证编号
  345. vehBodyUrl: "", //车身照片
  346. // proxyUrl: "", //委托书地址
  347. },
  348. genderShow: false,
  349. orderId: "",
  350. vehiclePlateColor: undefined,
  351. isMyPeopple: true,
  352. isSign: '',
  353. type: 1,
  354. isEnableOther: true, //小程序是否支持他人办理
  355. isEnableBook: true, //他人办理时是否上传委托书
  356. isEnableInfo: true, //小程序信息带出
  357. isEnableOCRData: true, //允许修改OCR识别出来的数据
  358. changeColor: false,
  359. data: {
  360. transferLogs: [],
  361. },
  362. actionSheetShow: false,
  363. actionSheetList: [{
  364. text: "普通车",
  365. value: 0,
  366. },
  367. {
  368. text: "道路运输证经营范围仅有“货物专用运输(集装箱) ”的牵引车办理J类型集装箱",
  369. value: 24,
  370. },
  371. {
  372. text: "道路运输证经营范围不含“货物专用运输(集装箱)”的牵引车",
  373. value: 27,
  374. },
  375. {
  376. text: '道路运输证经营范围除“货物专用运输 (集装 箱)"外,还有“普通货运”等其他项目的牵引车办理J2类型集装箱',
  377. value: 28,
  378. }],
  379. orderId: "",
  380. // type: undefined, //标记来源是否登录 1为未登录数据 - 需要新增地址
  381. show: false,
  382. isMyPeopple: true,
  383. outlineL: "",
  384. outlineW: "",
  385. outlineH: "",
  386. isEnableChangeOCRCarInfo: true, //申办时是否允许修改OCR识别出来的车辆信息数据
  387. // allData: {}
  388. });
  389. const searchVehicleInfoQuery = () => {
  390. const options = {
  391. type: 2,
  392. data: {
  393. vehicleId: state.form.vehicleId
  394. },
  395. method: "POST",
  396. showLoading: true,
  397. };
  398. request(searchVehicleInfo, options).then((res) => {
  399. let result = stringToJson(res.bizContent);
  400. // state.allData = result.vehicles[0]
  401. writeMsg(result.vehicles[0])
  402. });
  403. }
  404. const writeMsg = (allData) => {
  405. console.log("车辆信息", allData);
  406. state.form.userPosImgUrl = allData['ownerPosImgUrl']
  407. state.form.userNegImgUrl = allData['ownerNegImgUrl']
  408. state.form.userName = allData['ownerName']
  409. state.form.userIdNum = allData['ownerIdNum']
  410. state.form.address = allData['ownerAddress']
  411. state.form.tel = allData['ownerTel']
  412. state.form.vehPosImgUrl = allData['vehPosImgUrl']
  413. state.form.vehNegImgUrl = allData['vehNegImgUrl']
  414. state.form.vehBodyUrl = allData['vehBodyUrl']
  415. state.form.vehicleIdNum = allData['vehiclePlate']
  416. // state.form.man = allData['vehNegImgUrl']
  417. // state.form.vehBodyUrl = allData['vehBodyUrl']
  418. }
  419. const userGenderAction = () => {
  420. state.genderShow = true;
  421. };
  422. const genderSelectConfirm = (e) => {
  423. state.form.gender = ''
  424. e.map((val, index) => {
  425. state.form.gender = val.label;
  426. })
  427. };
  428. const camera = () => {
  429. state.phoneType = 0
  430. }
  431. const savaHandle = () => {
  432. if (!checkStr(state.form.userIdNum, 'card')) {
  433. msg('请输入正确身份证');
  434. return;
  435. }
  436. if (!checkStr(state.form.tel, 'mobile')) {
  437. msg('请输入正确手机号');
  438. return;
  439. }
  440. // 已经登录
  441. let data = state.form;
  442. const options = {
  443. type: 2,
  444. data: data,
  445. method: "POST",
  446. showLoading: true,
  447. };
  448. request(etcUserCardInfoSubmit, options).then((res) => {
  449. // let result = stringToJson(res.bizContent);
  450. console.log(res);
  451. });
  452. };
  453. onLoad((option : any) => {
  454. state.form.vehicleId = option.vehicleId;
  455. state.form.opId = getItem('openId') ? getItem('openId') : '';
  456. getGlobalParam(); //全局配置数据
  457. console.log("option", option)
  458. searchVehicleInfoQuery(); //车辆信息查询
  459. });
  460. //监听页面滚动
  461. onPageScroll((e) => {
  462. scrollTop.value = e.scrollTop;
  463. });
  464. const replaceInput = (event) => {
  465. console.log("event", event)
  466. const screeningStr = /[^\u4E00-\u9FA5]/g; //想禁止什么类型,在这里替换正则就可以了
  467. if (screeningStr.test(event)) {
  468. setTimeout(() => {
  469. state.form.userName = event.replace(screeningStr, '');
  470. }, 100)
  471. } else {
  472. setTimeout(() => {
  473. state.form.userName = event;
  474. }, 100)
  475. }
  476. console.log("event.replace(screeningStr, '')", event.replace(screeningStr, ''), event, state.form.userName)
  477. }
  478. const getGlobalParam = () => {
  479. const data = getItem('globalParam')
  480. console.log("全局配置数据", getCodeName('IS_ENABLE', data.miniSupportOther), getCodeName('IS_ENABLE', data.otherUploadProxy), getCodeName('IS_ENABLE', data.miniInfoShow), getCodeName('IS_ENABLE', data.changeOCRData))
  481. // 小程序是否支持他人办理
  482. if (getCodeName('IS_ENABLE', data.miniSupportOther) == '启用') {
  483. state.isEnableOther = true;
  484. } else {
  485. state.isEnableOther = false;
  486. }
  487. // 他人办理时是否上传委托书
  488. if (getCodeName('IS_ENABLE', data.otherUploadProxy) == '启用') {
  489. state.isEnableBook = true;
  490. } else {
  491. state.isEnableBook = false;
  492. }
  493. // 小程序信息带出
  494. if (getCodeName('IS_ENABLE', data.miniInfoShow) == '启用') {
  495. state.isEnableInfo = true;
  496. uni.showModal({
  497. // title: '提示',
  498. content: '是否允许带出用户信息',
  499. success: function (res) {
  500. if (res.confirm) {
  501. console.log('用户点击确定');
  502. queryUserMsg() //通过opneId查询用户信息
  503. } else if (res.cancel) {
  504. console.log('用户点击取消');
  505. }
  506. }
  507. });
  508. } else {
  509. state.isEnableInfo = false;
  510. }
  511. // 允许修改OCR识别出来的数据
  512. if (getCodeName('IS_ENABLE', data.changeOCRData) == '启用') {
  513. state.isEnableOCRData = false;
  514. } else {
  515. state.isEnableOCRData = true;
  516. }
  517. // 申办时是否允许修改OCR识别出来的车辆信息数据
  518. if (getCodeName('IS_ENABLE', data.applyChangeOCRCarInfo) == '启用') {
  519. state.isEnableChangeOCRCarInfo = true;
  520. } else {
  521. state.isEnableChangeOCRCarInfo = false;
  522. }
  523. }
  524. // 通过opneId查询用户信息
  525. const queryUserMsg = () => {
  526. const options = {
  527. type: 2,
  528. data: {
  529. "openId": getItem('openId')
  530. },
  531. method: "POST",
  532. showLoading: true,
  533. };
  534. request(getUserMsg, options).then((res) => {
  535. console.log("通过opneId查询用户信息", stringToJson(res.bizContent))
  536. const data = stringToJson(res.bizContent);
  537. state.form.userPosImgUrl = data.customerPosImgUrl;
  538. state.form.userNegImgUrl = data.customerNegImgUrl;
  539. state.form.userName = data.customerName;
  540. state.form.userIdNum = data.customerIdNum;
  541. state.form.address = data.customerAddress;
  542. state.form.tel = data.customerTel;
  543. })
  544. }
  545. const takePhotoMode = (index, isMy) => {
  546. console.log("index", index, isMy)
  547. state.isTakePhotoModeShow = true
  548. state.choiceIndex = index
  549. state.isMy = isMy
  550. }
  551. const xiangce = (val) => {
  552. console.log("val", val)
  553. var imageType = val;
  554. if (state.choiceIndex == 3) {
  555. var imageType = 1;
  556. } else {
  557. var imageType = 2;
  558. }
  559. uni.chooseImage({
  560. count: 1, //只能选取一张照片
  561. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  562. sourceType: ["album"], //从相册选择
  563. success: function (res) {
  564. state.showImg = false
  565. state.images = res.tempFilePaths[0]
  566. state.phoneType = state.choiceIndex
  567. state.isTakePhotoModeShow = false
  568. if (state.choiceIndex == 3 || state.choiceIndex == 4) {
  569. state.showImg = false
  570. state.images = res.tempFilePaths[0]
  571. state.phoneType = state.choiceIndex
  572. state.isTakePhotoModeShow = false
  573. return
  574. }
  575. console.log("tempFilePaths[0].startsWith('file://')", res.tempFilePaths[0], res.tempFilePaths[0].startsWith('file://'))
  576. },
  577. })
  578. }
  579. const takePhoto = (val) => {
  580. state.showImg = true
  581. console.log("拍照", val)
  582. state.phoneType = val;
  583. }
  584. const confirmReturn = (val) => {
  585. console.log("图片地址val", val)
  586. state.phoneType = 0
  587. state.isTakePhotoModeShow = false
  588. // var imageType = state.choiceIndex;
  589. if (state.choiceIndex == 1) {
  590. var imageType = 1;
  591. var queryCode = etcOcrCard
  592. } else if (state.choiceIndex == 2) {
  593. var imageType = 2;
  594. var queryCode = etcOcrCard
  595. }
  596. if (state.choiceIndex == 3) {
  597. var imageType = 1;
  598. var queryCode = etcCarOcrCard
  599. } else if (state.choiceIndex == 4) {
  600. var imageType = 2;
  601. var queryCode = etcCarOcrCard
  602. }
  603. // uploadFile(val.tempImagePath, imageType, ocrAllQuery).then((data) => {
  604. uploadFile(val.tempImagePath, imageType, queryCode).then((data) => {
  605. console.log("身份证上传", data)
  606. if (state.isMy == "my") {
  607. if (state.choiceIndex == "1") {
  608. state.form.userName = data.name;
  609. state.form.gender = data.gender;
  610. state.form.userIdNum = data.idno;
  611. state.form.userPosImgUrl = data.imageUrl;
  612. state.form.address = data.address;
  613. } else {
  614. state.form.customerIdVld = data.enddate;
  615. state.form.userNegImgUrl = data.imageUrl;
  616. }
  617. state.isTakePhotoModeShow = false
  618. } else {
  619. if (state.choiceIndex == "1") {
  620. state.form.agentName = data.name;
  621. state.form.agentGender = data.gender;
  622. state.form.agentIdNum = data.idno;
  623. state.form.agentPosImgUrl = data.imageUrl;
  624. state.form.agentAddress = data.address;
  625. } else if (state.choiceIndex == "2") {
  626. console.log("state.isMy", state.isMy, state.choiceIndex, state.choiceIndex == "1", data)
  627. state.form.agentIdVld = data.enddate;
  628. state.form.agentNegImgUrl = data.imageUrl;
  629. } else if (state.choiceIndex == "3") {
  630. if (data.plate_a.length > 8) {
  631. state.form.vehicleIdNum = data.plate_a.substring(0, 8);
  632. } else {
  633. state.form.vehicleIdNum = data.plate_a;
  634. }
  635. state.form.man = data.man;
  636. state.form.vehicleType = data.vehicle;
  637. state.form.character = data.character;
  638. state.form.vin = data.vin;
  639. state.form.engineNum = data.engine;
  640. state.form.register = data.register;
  641. state.form.issueDate = data.issue;
  642. state.form.vehPosImgUrl = data.imageUrl;
  643. state.form.vehicleModel = data.model;
  644. } else {
  645. state.form.approvedCount = data.apc;
  646. state.form.approvedCountShow = data.apc;
  647. state.form.maintenaceMass = data.unladen;
  648. state.form.maintenaceMassShow = data.unladen;
  649. // 91接口差
  650. // // #ifdef MP-WEIXIN
  651. // state.form.vehicleDimensions = data.overall.replaceAll("×", "X");
  652. // // #endif
  653. // // #ifdef MP-ALIPAY
  654. // state.form.vehicleDimensions = data.overall.replace(/×/g, "X");
  655. // // #endif
  656. // let arr = data.overall.split("×");
  657. // #ifdef MP-WEIXIN
  658. state.form.vehicleDimensions = data.overall.replaceAll("x", "X");
  659. // #endif
  660. // #ifdef MP-ALIPAY
  661. state.form.vehicleDimensions = data.overall.replace(/x/g, "X");
  662. // #endif
  663. let arr = data.overall.split("x");
  664. state.outlineL = arr[0]; //外廓 长
  665. state.outlineW = arr[1]; //外廓 宽
  666. state.outlineH = arr[2].substring(0, arr[2].length - 2); //外廓 高
  667. state.form.totalMass = data.gross;
  668. state.form.totalMassShow = data.gross;
  669. state.form.vehNegImgUrl = data.imageUrl;
  670. state.form.permittedWeight = data.alc ? data.alc : 0;
  671. state.form.permittedTowWeight = data.towing ? data.towing : 0;
  672. console.log('=====================', state.form.vehNegImgUrl, state)
  673. }
  674. state.isTakePhotoModeShow = false
  675. }
  676. })
  677. }
  678. const cancle = () => {
  679. state.isTakePhotoModeShow = false
  680. }
  681. // 车辆信息
  682. //车牌号输入
  683. const carNumber = (val : any) => {
  684. state.form.vehicleIdNum = val.trim();
  685. };
  686. //提交车辆信息
  687. const savaHandleCar = () => {
  688. if (!state.form.vehBodyUrl) {
  689. msg("请上传车头照");
  690. return;
  691. }
  692. if (state.form.type == 1) {
  693. state.form.axleCount = 2;
  694. } else {
  695. if (!state.form.axleCount) {
  696. msg("请输入车轴数");
  697. return;
  698. }
  699. }
  700. state.form.vehicleId =
  701. state.form.vehicleIdNum + "_" + state.vehiclePlateColor;
  702. state.form.opId = getItem(StorageKeys.OpenId);
  703. state.form.approvedCount = parseFloat(state.form.approvedCount);
  704. state.form.maintenaceMass = parseFloat(state.form.maintenaceMass);
  705. state.form.totalMass = parseFloat(state.form.totalMass);
  706. state.form.permittedWeight = parseFloat(state.form.permittedWeight);
  707. state.form.permittedTowWeight = parseFloat(state.form.permittedTowWeight);
  708. const options = {
  709. type: 2,
  710. data: state.form,
  711. method: "POST",
  712. showLoading: true,
  713. };
  714. request(etcCarCardInfoSubmit, options)
  715. .then((res) => {
  716. const data = stringToJson(res.bizContent);
  717. })
  718. .catch((res) => {
  719. console.log(res);
  720. });
  721. };
  722. const selectConfirm = (index : any) => {
  723. console.log(index);
  724. state.form.useUserType = state.actionSheetList[index].value;
  725. state.form.useUserTypeName = state.actionSheetList[index].text;
  726. };
  727. //选择车辆用户类型
  728. const userType = (item : any) => {
  729. state.form.useUserType = item.value;
  730. state.form.useUserTypeName = item.text;
  731. state.actionSheetShow = false;
  732. }
  733. // 车头照图片上传
  734. const cardFileImageUpdate = () => {
  735. uni.chooseImage({
  736. count: 1, //只能选取一张照片
  737. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  738. sourceType: ["camera", "album"], //从相册选择
  739. success: function (res) {
  740. uploadFile(res.tempFilePaths[0], "", "").then((data) => {
  741. state.form.vehBodyUrl = data;
  742. })
  743. },
  744. });
  745. };
  746. //外廓尺寸输入框
  747. const outlineInput = (e) => {
  748. state.form.vehicleDimensions =
  749. state.outlineL + "X" + state.outlineW + "X" + state.outlineH + "mm";
  750. };
  751. const bindDateChange1 = (e) => {
  752. state.form.register = e.detail.value
  753. state.changeColor = true;
  754. }
  755. const bindDateChange2 = (e) => {
  756. state.form.issueDate = e.detail.value
  757. state.changeColor = true;
  758. }
  759. </script>
  760. <style lang="scss" scoped>
  761. .title {
  762. font-size: 35rpx;
  763. font-family: Microsoft YaHei;
  764. font-weight: 400;
  765. color: #000000;
  766. line-height: 80rpx;
  767. margin-bottom: 10rpx;
  768. }
  769. .content-wrap {
  770. position: relative;
  771. // margin-top: -50rpx;
  772. padding: 0rpx 30rpx;
  773. display: flex;
  774. .big {
  775. font-size: 30rpx;
  776. font-family: Microsoft YaHei;
  777. font-weight: 400;
  778. color: #333333;
  779. line-height: 24rpx;
  780. }
  781. .nomal {
  782. font-size: 26rpx;
  783. font-family: Microsoft YaHei;
  784. font-weight: 400;
  785. color: #666666;
  786. line-height: 24rpx;
  787. }
  788. .tip {
  789. margin-top: -5px;
  790. width: 117rpx;
  791. height: 16rpx;
  792. background: #00b38b;
  793. opacity: 0.3;
  794. }
  795. }
  796. .content {
  797. padding: 50rpx 30rpx 50rpx 30rpx;
  798. .action {
  799. padding-left: 20rpx;
  800. padding-right: 20rpx;
  801. padding-bottom: 30rpx;
  802. .button {
  803. height: 80rpx;
  804. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  805. border-radius: 40rpx;
  806. font-size: 32rpx;
  807. font-weight: 400;
  808. color: #ffffff;
  809. line-height: 80rpx;
  810. }
  811. }
  812. .item-tips {
  813. .title {
  814. font-size: 30rpx;
  815. font-family: Microsoft YaHei;
  816. font-weight: 400;
  817. color: #000000;
  818. line-height: 24rpx;
  819. }
  820. .tip {
  821. margin-top: 16rpx;
  822. font-size: 24rpx;
  823. font-family: Microsoft YaHei;
  824. font-weight: 400;
  825. color: #999999;
  826. line-height: 24rpx;
  827. }
  828. }
  829. .picture-wrapper {
  830. margin-top: 40rpx;
  831. .bg {
  832. background: #ffffff;
  833. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  834. border-radius: 20rpx;
  835. padding: 40rpx;
  836. display: flex;
  837. // align-items: center;
  838. justify-content: space-between;
  839. .name {
  840. font-size: 34rpx;
  841. font-family: Microsoft YaHei;
  842. font-weight: 400;
  843. color: #000000;
  844. line-height: 34rpx;
  845. }
  846. .value {
  847. margin-top: 20rpx;
  848. font-size: 24rpx;
  849. font-family: Microsoft YaHei;
  850. font-weight: 400;
  851. color: #999999;
  852. line-height: 24rpx;
  853. }
  854. .tip {
  855. margin-top: 20rpx;
  856. text-align: center;
  857. width: 110rpx;
  858. height: 40rpx;
  859. background: rgba(33, 190, 177, 0.2);
  860. border-radius: 6rpx;
  861. .tip-value {
  862. font-size: 20rpx;
  863. font-family: Microsoft YaHei;
  864. font-weight: 400;
  865. color: #0a8f8a;
  866. line-height: 40rpx;
  867. opacity: 1;
  868. }
  869. }
  870. }
  871. .icon {
  872. width: 294rpx;
  873. height: 188rpx;
  874. }
  875. }
  876. .shibie-wrapper {
  877. margin-top: 60rpx;
  878. .title {
  879. font-size: 30rpx;
  880. font-family: Microsoft YaHei;
  881. font-weight: 400;
  882. color: #000000;
  883. line-height: 30rpx;
  884. }
  885. }
  886. .buchong-wrapper {
  887. margin-top: 60rpx;
  888. .title {
  889. font-size: 30rpx;
  890. font-family: Microsoft YaHei;
  891. font-weight: 400;
  892. color: #000000;
  893. line-height: 30rpx;
  894. }
  895. }
  896. .green-tip {
  897. margin-top: 50rpx;
  898. font-size: 24rpx;
  899. font-family: Microsoft YaHei;
  900. font-weight: 400;
  901. color: #00b38b;
  902. line-height: 24rpx;
  903. margin-bottom: 60rpx;
  904. }
  905. }
  906. .choice-takePhoto {
  907. position: absolute;
  908. bottom: 0;
  909. background-color: white;
  910. width: 100%;
  911. border-radius: 20rpx 20rpx 0 0;
  912. }
  913. .choice-takePhoto>view:first-child {
  914. text-align: center;
  915. height: 80rpx;
  916. line-height: 80rpx;
  917. border-bottom: 1rpx solid rgba(127, 127, 127, 0.3);
  918. background-color: white;
  919. }
  920. .choice-takePhoto>view:last-child {
  921. text-align: center;
  922. height: 80rpx;
  923. line-height: 80rpx;
  924. border-top: 6rpx solid rgba(127, 127, 127, 0.1);
  925. background-color: white;
  926. }
  927. .choice-takePhoto>view {
  928. text-align: center;
  929. height: 80rpx;
  930. line-height: 80rpx;
  931. background-color: white;
  932. }
  933. .choice-takePhoto-wrap {
  934. width: 100%;
  935. height: 100vh;
  936. background-color: rgba(127, 127, 127, 0.2);
  937. position: fixed;
  938. left: 0;
  939. top: 0;
  940. z-index: 11111;
  941. }
  942. .hui {
  943. color: #ccc;
  944. }
  945. .hei {
  946. color: black;
  947. }
  948. .goto {
  949. margin-right: 20rpx;
  950. padding: 10rpx;
  951. color: #00b38b;
  952. border: 1rpx solid #00b38b;
  953. border-radius: 20rpx;
  954. }
  955. .flex {
  956. display: flex;
  957. align-items: center;
  958. }
  959. .bettwen-center {
  960. display: flex;
  961. align-items: center;
  962. justify-content: space-between;
  963. }
  964. .card {
  965. margin: 20rpx;
  966. height: 150rpx;
  967. background: #ffffff;
  968. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  969. border-radius: 20rpx;
  970. padding: 20rpx;
  971. display: flex;
  972. justify-content: space-between;
  973. align-items: center;
  974. margin-bottom: 30rpx;
  975. .card-left {
  976. display: flex;
  977. align-items: center;
  978. image {
  979. width: 100rpx;
  980. height: 90rpx;
  981. }
  982. .card-center {
  983. margin-left: 30rpx;
  984. .card-center-head {
  985. font-size: 32rpx;
  986. font-family: Noto Sans S Chinese;
  987. font-weight: 400;
  988. color: #333333;
  989. }
  990. .tips {
  991. font-size: 26rpx;
  992. font-family: Noto Sans S Chinese;
  993. font-weight: 400;
  994. color: #666666;
  995. .tips-card {
  996. width: 70rpx;
  997. height: 40rpx;
  998. background: #d3f2ef;
  999. border-radius: 6rpx;
  1000. font-size: 20rpx;
  1001. font-family: Noto Sans S Chinese;
  1002. font-weight: 400;
  1003. color: #0a8f8a;
  1004. padding: 5rpx 10rpx;
  1005. margin-left: 20rpx;
  1006. }
  1007. }
  1008. }
  1009. }
  1010. .choose-item {
  1011. margin-right: 20rpx;
  1012. width: 50rpx;
  1013. height: 50rpx;
  1014. border: 1rpx solid #00b38b;
  1015. border-radius: 50%;
  1016. display: flex;
  1017. justify-content: center;
  1018. align-items: center;
  1019. .active {
  1020. width: 38rpx;
  1021. height: 38rpx;
  1022. background: #00b38b;
  1023. border-radius: 50%;
  1024. }
  1025. }
  1026. }
  1027. .content {
  1028. // position: relative;
  1029. // margin-top: -50rpx;
  1030. // padding: 0rpx 30rpx;
  1031. // position: relative;
  1032. .img-pos {
  1033. position: absolute;
  1034. left: 270rpx;
  1035. top: -38rpx;
  1036. right: 50rpx;
  1037. .img-flex {
  1038. display: flex;
  1039. justify-content: space-between;
  1040. align-items: center;
  1041. .car-img {
  1042. width: 86rpx;
  1043. height: 42rpx;
  1044. }
  1045. .flag-img {
  1046. width: 30rpx;
  1047. height: 35rpx;
  1048. }
  1049. }
  1050. }
  1051. .action {
  1052. padding-left: 20rpx;
  1053. padding-right: 20rpx;
  1054. padding-bottom: 30rpx;
  1055. .button {
  1056. height: 80rpx;
  1057. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  1058. border-radius: 40rpx;
  1059. font-size: 32rpx;
  1060. font-weight: 400;
  1061. color: #ffffff;
  1062. line-height: 80rpx;
  1063. }
  1064. }
  1065. .item-tips {
  1066. .title {
  1067. font-size: 30rpx;
  1068. font-family: Microsoft YaHei;
  1069. font-weight: 400;
  1070. color: #000000;
  1071. line-height: 24rpx;
  1072. }
  1073. .tip {
  1074. margin-top: 16rpx;
  1075. font-size: 24rpx;
  1076. font-family: Microsoft YaHei;
  1077. font-weight: 400;
  1078. color: #999999;
  1079. line-height: 24rpx;
  1080. }
  1081. }
  1082. .picture-wrapper {
  1083. margin-top: 40rpx;
  1084. .bg {
  1085. background: #ffffff;
  1086. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  1087. border-radius: 20rpx;
  1088. padding: 40rpx;
  1089. display: flex;
  1090. // align-items: center;
  1091. justify-content: space-between;
  1092. .name {
  1093. font-size: 34rpx;
  1094. font-family: Microsoft YaHei;
  1095. font-weight: 400;
  1096. color: #000000;
  1097. line-height: 34rpx;
  1098. }
  1099. .value {
  1100. margin-top: 20rpx;
  1101. font-size: 24rpx;
  1102. font-family: Microsoft YaHei;
  1103. font-weight: 400;
  1104. color: #999999;
  1105. line-height: 24rpx;
  1106. }
  1107. .tip {
  1108. margin-top: 20rpx;
  1109. text-align: center;
  1110. width: 110rpx;
  1111. height: 40rpx;
  1112. background: rgba(33, 190, 177, 0.2);
  1113. border-radius: 6rpx;
  1114. .tip-value {
  1115. font-size: 20rpx;
  1116. font-family: Microsoft YaHei;
  1117. font-weight: 400;
  1118. color: #0a8f8a;
  1119. line-height: 40rpx;
  1120. opacity: 1;
  1121. }
  1122. }
  1123. }
  1124. .icon {
  1125. width: 294rpx;
  1126. height: 188rpx;
  1127. }
  1128. }
  1129. .shibie-wrapper {
  1130. margin-top: 60rpx;
  1131. .title {
  1132. font-size: 30rpx;
  1133. font-family: Microsoft YaHei;
  1134. font-weight: 400;
  1135. color: #000000;
  1136. line-height: 30rpx;
  1137. }
  1138. }
  1139. .buchong-wrapper {
  1140. margin-top: 60rpx;
  1141. .title {
  1142. font-size: 30rpx;
  1143. font-family: Microsoft YaHei;
  1144. font-weight: 400;
  1145. color: #000000;
  1146. line-height: 30rpx;
  1147. }
  1148. }
  1149. .green-tip {
  1150. margin-top: 50rpx;
  1151. font-size: 24rpx;
  1152. font-family: Microsoft YaHei;
  1153. font-weight: 400;
  1154. color: #00b38b;
  1155. line-height: 24rpx;
  1156. margin-bottom: 60rpx;
  1157. }
  1158. }
  1159. .form-item {
  1160. display: flex;
  1161. font-size: 28rpx;
  1162. justify-content: space-between;
  1163. align-items: center;
  1164. }
  1165. .form-item label {}
  1166. .form-item .input-box {
  1167. display: flex;
  1168. align-items: center;
  1169. }
  1170. .form-item .select {
  1171. flex: 1;
  1172. background: #f1f1f1;
  1173. padding: 6rpx 20rpx;
  1174. margin: 0 10rpx;
  1175. min-height: 48rpx;
  1176. line-height: 48rpx;
  1177. border-radius: 8rpx;
  1178. }
  1179. .form-item .icon {
  1180. width: 28rpx;
  1181. height: 32rpx;
  1182. }
  1183. .form-item .input-box input {
  1184. width: 90rpx;
  1185. background: #f1f1f1;
  1186. border-radius: 8rpx;
  1187. padding: 0 5rpx;
  1188. }
  1189. .form-item .sub-text {
  1190. color: #808080;
  1191. padding-left: 10rpx;
  1192. }
  1193. .form-item .sub-label {
  1194. padding: 0 10rpx;
  1195. }
  1196. .window {
  1197. padding: 60rpx 30rpx;
  1198. }
  1199. .window .window-item {
  1200. border: 1px solid #00b38b;
  1201. background: rgba(0, 179, 139, .1);
  1202. border-radius: 10rpx;
  1203. padding: 16rpx 30rpx;
  1204. font-size: 30rpx;
  1205. margin-bottom: 10rpx;
  1206. }
  1207. ::v-deep .u-input__input {
  1208. background: transparent;
  1209. }
  1210. </style>