You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

rescind-carId-select - 副本.vue 23KB

1 tydzień temu
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763
  1. <template>
  2. <view class="bg">
  3. <view class="title">基本信息</view>
  4. <view class="car-type">
  5. <view class="car-type-item" :class="{active: state.form.applyType == '1'}" @click="toggleApplyType('1')">个人车辆</view>
  6. <view class="car-type-item" :class="{active: state.form.applyType == '2'}" @click="toggleApplyType('2')">单位车辆</view>
  7. </view>
  8. <u-form label-width="230" :model="state.form" ref="uForm" :label-style='labelStyle' v-if="state.form.applyType == '1'">
  9. <u-form-item label="是否本人" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon' borderBottom>
  10. <u-input v-model="state.form.isSelfStr" type="select" @click="isSelfSelect = true" input-align='right'/>
  11. </u-form-item>
  12. </u-form>
  13. </view>
  14. <view class="bg">
  15. <view class="title"> 身份证信息 </view>
  16. <view class="picture-wrapper" @click="takePhotoMode('1',false)">
  17. <view class="bg">
  18. <view class="">
  19. <view class="name"> 人像面 </view>
  20. <view class="value"> 上传身份证的人像面 </view>
  21. <view class="tip">
  22. <view class="tip-value"> 拍摄规范 </view>
  23. </view>
  24. </view>
  25. <image v-if="!state.form.userPosImagesUrl" class="icon" :src="`${$imgUrl}issuance/sfz.png`"
  26. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}">
  27. </image>
  28. <image v-else class="icon" :src="getFullImageUrl(state.form.userPosImagesUrl)"
  29. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png`}"></image>
  30. </view>
  31. </view>
  32. <view class="picture-wrapper" @click="takePhotoMode('2',false)">
  33. <view class="bg">
  34. <view class="">
  35. <view class="name"> 国徽面 </view>
  36. <view class="value"> 上传身份证的国徽面 </view>
  37. <view class="tip">
  38. <view class="tip-value"> 拍摄规范 </view>
  39. </view>
  40. </view>
  41. <image v-if="!state.form.userNegImagesUrl" class="icon" :src="`${$imgUrl}issuance/sff.png`"
  42. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png`}">
  43. </image>
  44. <image v-else class="icon" :src="getFullImageUrl(state.form.userNegImagesUrl)"
  45. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png`}"></image>
  46. </view>
  47. </view>
  48. <u-form label-width="230" :model="state.form" ref="uForm" :label-style='labelStyle'>
  49. <u-form-item label="申请人姓名" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon' borderBottom>
  50. <u-input v-model="state.form.name" placeholder='请输入姓名'
  51. maxlength="20" @blur="replaceInput($event,1)" inputAlign="right"/>
  52. </u-form-item>
  53. <u-form-item label="证号号码" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon' borderBottom>
  54. <u-input placeholder='请输入证件号码' type="idcard" v-model="state.form.customerIdNum"
  55. maxlength="18" inputAlign="right"/>
  56. </u-form-item>
  57. <u-form-item label="手机号" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon' borderBottom>
  58. <u-input placeholder='请输入手机号' type="number" v-model="state.form.mobile"
  59. maxlength="11" inputAlign="right"/>
  60. </u-form-item>
  61. </u-form>
  62. </view>
  63. <view class="bg">
  64. <view class="title"> 行驶证信息 </view>
  65. <view class="picture-wrapper" @click="takePhotoMode('3')">
  66. <view class="bg">
  67. <view class="">
  68. <view class="name"> 行驶证主页 </view>
  69. <view class="value"> 上传行驶证的主页 </view>
  70. <view class="tip">
  71. <view class="tip-value"> 拍摄规范 </view>
  72. </view>
  73. </view>
  74. <image v-if="!state.form.vehPosImgUrl" class="icon" :src="`${$imgUrl}issuance/xz.png`"
  75. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}">
  76. </image>
  77. <image v-else class="icon" :src="getFullImageUrl(state.form.vehPosImgUrl)"
  78. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}"></image>
  79. </view>
  80. </view>
  81. <view class="picture-wrapper" @click="takePhotoMode('4')">
  82. <view class="bg">
  83. <view class="">
  84. <view class="name"> 行驶证副页 </view>
  85. <view class="value"> 上传行驶证的副页 </view>
  86. <view class="tip">
  87. <view class="tip-value"> 拍摄规范 </view>
  88. </view>
  89. </view>
  90. <image v-if="!state.form.vehNegImgUrl" class="icon" :src="`${$imgUrl}issuance/xf.png`"
  91. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}">
  92. </image>
  93. <image v-else class="icon" :src="getFullImageUrl(state.form.vehNegImgUrl)"
  94. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}"></image>
  95. </view>
  96. </view>
  97. <u-form label-width="200" :model="state.form" ref="uForm" :label-style='labelStyle'>
  98. <u-form-item label="车牌号" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'>
  99. <car-number-input @numberInputResult="carNumber" :defaultStr="state.form.vehiclePlate"></car-number-input>
  100. </u-form-item>
  101. <u-form-item label="所有人" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'>
  102. <u-input inputAlign="right" placeholder="请输入所有人" v-model="state.form.vehicleOwnerName" maxlength="20" />
  103. </u-form-item>
  104. <u-form-item label="车牌颜色" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon'>
  105. <!-- <uni-data-select v-model="state.form.vehiclePlateColor" :localdata="state.colorRange" @change="changeColor"
  106. :clear="false"></uni-data-select> -->
  107. <u-input v-model="state.form.vehiclePlateColorStr" type="select" @click="show1 = true" input-align='right'/>
  108. </u-form-item>
  109. </u-form>
  110. </view>
  111. <view class="bg" v-if="state.form.applyType=='2'">
  112. <view class="title"> 单位资料信息 </view>
  113. <view class="picture-wrapper" @click="cardImageOcrYY()">
  114. <view class="bg">
  115. <view class="">
  116. <view class="name"> 营业执照 </view>
  117. <view class="value"> 上传企业的营业执照 </view>
  118. <view class="tip">
  119. <view class="tip-value"> 拍摄规范 </view>
  120. </view>
  121. </view>
  122. <image v-if="!state.form.unitImagesUrl" class="icon" :src="`${$imgUrl}applyCard/zhizhao.png`"
  123. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}">
  124. </image>
  125. <image v-else class="icon" :src="getFullImageUrl(state.form.unitImagesUrl)"
  126. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}"></image>
  127. </view>
  128. </view>
  129. <view class="picture-wrapper" @click="cardFileImageUpdate()">
  130. <view class="bg">
  131. <view class="">
  132. <view class="name"> 授权书 </view>
  133. <view class="value"> 上传授权书 </view>
  134. <view class="tip">
  135. <view class="tip-value"> 拍摄规范 </view>
  136. </view>
  137. <!-- <view class="down" @click="downAuthD">模板下载</view> -->
  138. </view>
  139. <image v-if="!state.form.proxyUrl" class="icon" :src="`${$imgUrl}issuance/weituo.png`"
  140. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}">
  141. </image>
  142. <image v-else class="icon" :src="getFullImageUrl(state.form.proxyUrl)"
  143. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}"></image>
  144. </view>
  145. </view>
  146. <u-form label-width="230" :model="state.form" ref="uForm" :label-style='labelStyle'>
  147. <u-form-item label="单位名称" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon' border-bottom=true>
  148. <u-input v-model="state.form.orgName" placeholder='请输入单位名称'
  149. maxlength="20" @blur="replaceInput($event,2)" inputAlign="right"/>
  150. </u-form-item>
  151. <u-form-item label="证号号码" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon' border-bottom=true>
  152. <u-input placeholder='请输入证件号码' type="idcard" v-model="state.form.unitId"
  153. maxlength="18" inputAlign="right"/>
  154. </u-form-item>
  155. </u-form>
  156. </view>
  157. <!-- 个人 非本人 展示 -->
  158. <view class="bg" v-if="state.form.applyType=='1' && state.form.isSelf=='2'">
  159. <view class="title"> 车主信息 </view>
  160. <view class="picture-wrapper" @click="takePhotoMode('1',true)">
  161. <view class="bg">
  162. <view class="">
  163. <view class="name"> 车主身份证 </view>
  164. <view class="name"> 人像面 </view>
  165. <view class="value"> 上传身份证的人像面 </view>
  166. <view class="tip">
  167. <view class="tip-value"> 拍摄规范 </view>
  168. </view>
  169. </view>
  170. <image v-if="!state.form.ownerPosImgUrl" class="icon" :src="`${$imgUrl}issuance/sfz.png`"
  171. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}">
  172. </image>
  173. <image v-else class="icon" :src="getFullImageUrl(state.form.ownerPosImgUrl)"
  174. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png`}"></image>
  175. </view>
  176. </view>
  177. <view class="picture-wrapper" @click="takePhotoMode('2',true)">
  178. <view class="bg">
  179. <view class="">
  180. <view class="name"> 车主身份证 </view>
  181. <view class="name"> 国徽面 </view>
  182. <view class="value"> 上传身份证的国徽面 </view>
  183. <view class="tip">
  184. <view class="tip-value"> 拍摄规范 </view>
  185. </view>
  186. </view>
  187. <image v-if="!state.form.ownerNegImgUrl" class="icon" :src="`${$imgUrl}issuance/sff.png`"
  188. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png`}">
  189. </image>
  190. <image v-else class="icon" :src="getFullImageUrl(state.form.ownerNegImgUrl)"
  191. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png`}"></image>
  192. </view>
  193. </view>
  194. <u-form label-width="230" :model="state.form" ref="uForm" :label-style='labelStyle'>
  195. <u-form-item label="车主姓名" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon' border-bottom=true>
  196. <u-input v-model="state.form.ownerName" placeholder='请输入车主姓名'
  197. maxlength="20" @blur="replaceInput($event,3)" inputAlign="right"/>
  198. </u-form-item>
  199. <u-form-item label="证号号码" :left-icon='`${$imgUrl}issuance/point-form.png`' :left-icon-style='leftIcon' border-bottom=true>
  200. <u-input placeholder='请输入证件号码' type="idcard" v-model="state.form.ownerIdNum"
  201. maxlength="18" inputAlign="right"/>
  202. </u-form-item>
  203. </u-form>
  204. <view class="picture-wrapper" @click="cardFileImageUpdate()">
  205. <view class="bg">
  206. <view class="">
  207. <view class="name"> 授权书 </view>
  208. <view class="value"> 上传授权书 </view>
  209. <view class="tip">
  210. <view class="tip-value"> 拍摄规范 </view>
  211. </view>
  212. <!-- <view class="down" @click="downAuthD">模板下载</view> -->
  213. </view>
  214. <image v-if="!state.form.proxyUrl" class="icon" :src="`${$imgUrl}issuance/weituo.png`"
  215. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}">
  216. </image>
  217. <image v-else class="icon" :src="getFullImageUrl(state.form.proxyUrl)"
  218. :style="{'--bgimg':`url(${$imgUrl}issuance/bg-border.png)`}"></image>
  219. </view>
  220. </view>
  221. </view>
  222. <view class="action">
  223. <button type="default" class="ui-btn" @click="savaHandle()">
  224. 提交
  225. </button>
  226. </view>
  227. <view class="choice-takePhoto-wrap" v-if="state.isTakePhotoModeShow" @click="cancle">
  228. <view class="choice-takePhoto">
  229. <view @click.stop="takePhoto(state.choiceIndex)" style="border-radius: 20rpx 20rpx 0 0;">拍照</view>
  230. <view @click.stop="xiangce(state.choiceIndex)">从手机相册选择</view>
  231. <view @click.stop="cancle">取消</view>
  232. </view>
  233. </view>
  234. <viewfinder v-if="state.phoneType" :phoneType="state.phoneType" :images="state.images"
  235. :showStartPhoto="state.showImg" @confirmReturn="confirmReturn" @camera="camera"></viewfinder>
  236. <!-- 选择车牌颜色 -->
  237. <u-select v-model="show1" :list="state.colorRange" @confirm="changeColor"></u-select>
  238. <!-- 选择是否是本人 -->
  239. <u-select v-model="isSelfSelect" :list="state.isSelfRange" @confirm="changeIsSelf"></u-select>
  240. </template>
  241. <script setup lang="ts">
  242. import {
  243. reactive,
  244. ref
  245. } from "vue";
  246. import {
  247. onLoad
  248. } from "@dcloudio/uni-app";
  249. import {
  250. idCardOcr,
  251. vehicleLicenseOcr,
  252. releasePlateaApply,
  253. ocrAllQuery
  254. } from "@/utils/network/api.js";
  255. import {requestNew} from "@/utils/network/request.js";
  256. import { getItem } from "@/utils/storage.ts"
  257. import viewfinder from "@/components/viewfinder.vue"
  258. import carNumberInput from "@/components/car-number-input/car-number-input.vue";
  259. import {
  260. navTo, uploadFile,msg, getFullImageUrl
  261. } from "@/utils/utils";
  262. // ########
  263. const labelStyle = {
  264. color: "#004576",
  265. fontSize: "28rpx",
  266. }
  267. const leftIcon = {
  268. height: '100%',
  269. width: '8rpx',
  270. display: 'flex',
  271. 'align-items': 'center',
  272. 'margin-right': '4rpx',
  273. }
  274. const show1 = ref(false)
  275. const isSelfSelect = ref(false)
  276. const state = reactive({
  277. applyTypeRange:[{
  278. value: "1",
  279. text: "个人车辆"
  280. }, {
  281. value: "2",
  282. text: "单位车辆"
  283. }],
  284. isSelfRange:[
  285. {
  286. value: "1",
  287. label: "是"
  288. }, {
  289. value: "2",
  290. label: "否"
  291. }
  292. ],
  293. showImg: true,
  294. phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面
  295. choiceIndex: 1, // 1 身份证正面 2 身份证反面
  296. isTakePhotoModeShow: false, //选择拍照方式是否出来
  297. images: '',
  298. form: {
  299. applyType: "1",//1个人,2单位
  300. isSelf: "1",//是否本人 1是,2否
  301. isSelfStr: '是',
  302. mobile:"",
  303. name: "", //开户人姓名
  304. customerIdNum: "", //用户证件号码
  305. userPosImagesUrl: "", //身份证正面
  306. userNegImagesUrl: "", //身份证反面
  307. vehPosImgUrl: "", //行驶证正面
  308. vehNegImgUrl: "", //行驶证证反面
  309. vehiclePlate:"",
  310. vehiclePlateColor:"",
  311. vehicleOwnerName:"", //车主姓名,ocr识别行驶证
  312. ownerPosImgUrl:"",//车主身份证件人面地址
  313. ownerNegImgUrl:"",//车主身份证件国徽地址
  314. ownerIdNum:"",//车主证件号
  315. ownerName:"",//车主姓名
  316. proxyUrl:"",//授权书图片地址
  317. unitImagesUrl:"",//营业执照图片地址
  318. unitId:"",//单位证件编号
  319. orgName:"",
  320. unitIdType:"", // 单位证件类型,营业执照:字典code:203
  321. vehiclePlateColorStr:""
  322. },
  323. colorRange: [],
  324. ownerInfo:false,//非本人 个人 车主信息true ==== 本人 个人 false
  325. });
  326. const changeapplyType = (e) => {
  327. state.form.applyType = e
  328. console.log("111",e,state.applyTypeRange)
  329. }
  330. const changeColor = (item: any) => {
  331. state.form.vehiclePlateColor = item[0].value
  332. state.form.vehiclePlateColorStr = item[0].label
  333. }
  334. const changeIsSelf = (item: any) => {
  335. if (item && item.length > 0) {
  336. state.form.isSelf = item[0].value
  337. state.form.isSelfStr = item[0].label
  338. // 如果是本人,对非本人信息进行个清空
  339. if (item[0].value == '1') {
  340. state.form.ownerPosImgUrl = ''
  341. state.form.ownerNegImgUrl = ''
  342. state.form.ownerName = ''
  343. state.form.ownerIdNum = ''
  344. state.form.proxyUrl = ''
  345. }
  346. }
  347. }
  348. //车牌号输入
  349. const carNumber = (val : any) => {
  350. state.form.vehiclePlate = val.trim();
  351. };
  352. const replaceInput = (event,val) => {
  353. if(val==1){
  354. state.form.name=event.replace(/\s/g, "")
  355. }else if(val==2){
  356. state.form.orgName=event.replace(/\s/g, "")
  357. }else if(val==3){
  358. state.form.ownerName=event.replace(/\s/g, "")
  359. }
  360. console.log("event", event,val,state.form.name)
  361. }
  362. const savaHandle = () => {
  363. if (!paramsVerify()) return;
  364. // 单位
  365. if(state.form.applyType=='2'){
  366. // 非本人办理
  367. state.form.isSelf='2'
  368. state.form.unitIdType='203'
  369. }
  370. let params = state.form
  371. const options = {
  372. type: 2,
  373. data: params,
  374. method: "POST",
  375. showLoading: true,
  376. };
  377. requestNew(releasePlateaApply, options).then((res) => {
  378. console.log(res);
  379. navTo(`/subpackage/after-sale/rescind-carId/result`);
  380. });
  381. };
  382. // 必填字段校验
  383. const paramsVerify = () => {
  384. let isVerify = true;
  385. if(!state.form.applyType){
  386. msg('请选择车辆类型');
  387. isVerify = false;
  388. }
  389. if(state.form.applyType=='1'){
  390. if(!state.form.isSelf){
  391. msg('请选择是否本人');
  392. isVerify = false;
  393. }
  394. }
  395. if(!state.form.userPosImagesUrl){
  396. msg('请上传身份证正面');
  397. isVerify = false;
  398. }
  399. if(!state.form.userNegImagesUrl){
  400. msg('请上传身份证反面');
  401. isVerify = false;
  402. }
  403. if(!state.form.name){
  404. msg('请输入姓名');
  405. isVerify = false;
  406. }
  407. if(!state.form.customerIdNum){
  408. msg('请输入证件号码');
  409. isVerify = false;
  410. }
  411. if(!state.form.mobile){
  412. msg('请输入手机号');
  413. isVerify = false;
  414. }
  415. if(!state.form.vehPosImgUrl){
  416. msg('请上传行驶证主页');
  417. isVerify = false;
  418. }
  419. if(!state.form.vehNegImgUrl){
  420. msg('请上传行驶证副页');
  421. isVerify = false;
  422. }
  423. if(!state.form.vehiclePlate){
  424. msg('请输入车牌号');
  425. isVerify = false;
  426. }
  427. if(!state.form.vehicleOwnerName){
  428. msg('请输入所有人');
  429. isVerify = false;
  430. }
  431. if(!state.form.vehiclePlateColor){
  432. msg('请选择车牌颜色');
  433. isVerify = false
  434. }
  435. return isVerify;
  436. }
  437. onLoad((option : any) => {
  438. // navTo(`/subpackage/after-sale/rescind-carId/result`);
  439. let getColor = getItem('key')['VEHICLE_COLOR_TYPE'];
  440. for (var k = 0; k < getColor.length; k++) {
  441. let obj = {};
  442. obj['value'] = getColor[k]['code']
  443. obj['label'] = getColor[k]['name']
  444. state.colorRange.push(obj)
  445. }
  446. });
  447. const cardFileImageUpdate = () => {
  448. uni.chooseImage({
  449. count: 1, //只能选取一张照片
  450. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  451. sourceType: ["camera", "album"], //从相册选择
  452. success: function (res) {
  453. uploadFile(res.tempFilePaths[0], "", "").then((data) => {
  454. state.form.proxyUrl = data;
  455. })
  456. },
  457. });
  458. };
  459. const xiangce = (val) => {
  460. console.log("val", val)
  461. var imageType = val;
  462. uni.chooseImage({
  463. count: 1, //只能选取一张照片
  464. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  465. sourceType: ["album"], //从相册选择
  466. success: function (res) {
  467. state.showImg = false
  468. state.images = res.tempFilePaths[0]
  469. state.phoneType = state.choiceIndex
  470. state.isTakePhotoModeShow = false
  471. console.log("tempFilePaths[0].startsWith('file://')", res.tempFilePaths[0], res.tempFilePaths[0].startsWith('file://'))
  472. },
  473. })
  474. }
  475. const takePhoto = (val) => {
  476. state.showImg = true
  477. console.log("拍照", val)
  478. state.phoneType = val;
  479. }
  480. const confirmReturn = (val) => {
  481. state.phoneType = 0
  482. state.isTakePhotoModeShow = false
  483. var imageType = 1;
  484. // state.choiceIndex 1: 身份证中面 2:身份证反面 3:行驶证正面 4:行驶证反面
  485. if (state.choiceIndex == 1) {
  486. imageType = 1
  487. } else if (state.choiceIndex == 2) {
  488. imageType = 100
  489. } else if (state.choiceIndex == 3) {
  490. imageType = 3
  491. } else if (state.choiceIndex == 4) {
  492. imageType = 100
  493. }
  494. uploadFile(val.tempImagePath, imageType).then((data) => {
  495. console.log(data)
  496. if (state.choiceIndex == 1) {
  497. if(state.ownerInfo){
  498. state.form.ownerPosImgUrl = data.imageUrl;
  499. state.form.ownerName = data.name;
  500. state.form.ownerIdNum = data.idno;
  501. }else{
  502. // 谁上传就是谁的信息
  503. state.form.name = data.name;
  504. state.form.customerIdNum = data.idno;
  505. state.form.userPosImagesUrl = data.imageUrl;
  506. }
  507. } else if (state.choiceIndex == 2) {
  508. if(state.ownerInfo){
  509. state.form.ownerNegImgUrl = data.imageUrl;
  510. }else{
  511. state.form.userNegImagesUrl = data.imageUrl;
  512. }
  513. } else if (state.choiceIndex == 3) {
  514. state.form.vehiclePlate = data.plate_a;
  515. state.form.vehicleOwnerName = data.man;
  516. state.form.vehPosImgUrl = data.imageUrl;
  517. } else if (state.choiceIndex == 4) {
  518. state.form.vehNegImgUrl = data.imageUrl;
  519. }
  520. state.isTakePhotoModeShow = false
  521. })
  522. }
  523. const takePhotoMode = (index,ownerInfo) => {
  524. console.log("index", index)
  525. state.isTakePhotoModeShow = true
  526. state.choiceIndex = index
  527. state.ownerInfo=ownerInfo
  528. }
  529. const cancle = () => {
  530. state.isTakePhotoModeShow = false
  531. }
  532. const camera = () => {
  533. state.phoneType = 0
  534. }
  535. //营业执照Orc接口调用
  536. const cardImageOcrYY = () => {
  537. uni.chooseImage({
  538. count: 1, //只能选取一张照片
  539. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  540. sourceType: ["camera", "album"], //从相册选择
  541. success: function (res) {
  542. uploadFile(res.tempFilePaths[0], 5).then((data) => {
  543. state.form.orgName =data.unitName;
  544. state.form.unitId =data.screditCode;
  545. state.form.unitImagesUrl =data.imageUrl;
  546. })
  547. },
  548. });
  549. };
  550. // 切换车辆类型
  551. const toggleApplyType = (type:string) => {
  552. state.form.applyType = type;
  553. if (type == '2') {
  554. state.form.ownerPosImgUrl = ''
  555. state.form.ownerNegImgUrl = ''
  556. state.form.ownerName = ''
  557. state.form.ownerIdNum = ''
  558. state.form.proxyUrl = ''
  559. } else if (type == '1') {
  560. state.form.unitImagesUrl = ''
  561. state.form.proxyUrl = ''
  562. state.form.orgName = ''
  563. state.form.unitId = ''
  564. }
  565. }
  566. </script>
  567. <style lang="scss" scoped>
  568. .bg{
  569. background-color: white;
  570. width: 88%;
  571. margin:0 auto;
  572. margin-top: 20rpx;
  573. border-radius: 12rpx;
  574. border: 1px solid #FFFFFF;
  575. padding: 20rpx;
  576. }
  577. .card {
  578. display: flex;
  579. margin: 0 20rpx;
  580. align-items: center;
  581. }
  582. .picture-wrapper {
  583. margin-top: 30rpx;
  584. .bg {
  585. background: #F5F9FB;
  586. border-radius: 10rpx;
  587. padding: 40rpx 30rpx;
  588. display: flex;
  589. // align-items: center;
  590. justify-content: space-between;
  591. .name {
  592. padding-top: 30rpx;
  593. font-size: 32rpx;
  594. font-family: SourceHanSansSC, SourceHanSansSC;
  595. font-weight: 500;
  596. color: #111;
  597. line-height: 34rpx;
  598. }
  599. .value {
  600. margin-top: 20rpx;
  601. font-size: 22rpx;
  602. font-family: SourceHanSansSC, SourceHanSansSC;
  603. font-weight: 400;
  604. color: #999999;
  605. line-height: 24rpx;
  606. }
  607. .tip {
  608. margin-top: 20rpx;
  609. text-align: center;
  610. width: 100rpx;
  611. height: 30rpx;
  612. border-radius: 6rpx;
  613. border: 1rpx solid #CCB375;
  614. .tip-value {
  615. font-size: 20rpx;
  616. font-family: Microsoft YaHei;
  617. font-weight: 400;
  618. color: #CCB375;
  619. line-height: 30rpx;
  620. opacity: 1;
  621. }
  622. }
  623. }
  624. .icon {
  625. width: 304rpx;
  626. height: 190rpx;
  627. background-image: var(--bgimg);
  628. background-size: 100% 100%;
  629. background-repeat: no-repeat;
  630. }
  631. }
  632. .action {
  633. position: absolute;
  634. left: 0;
  635. height: 188rpx;
  636. background-color: #fff;
  637. border-radius: 30rpx 30rpx 0 0;
  638. width: 100vw;
  639. display: flex;
  640. align-items: center;
  641. justify-content: center;
  642. flex-direction: column;
  643. margin-top: 20rpx;
  644. }
  645. ::deep.uni-select {
  646. font-size: 13px;
  647. height: 30px;
  648. line-height: 30px;
  649. }
  650. .choice-takePhoto-wrap {
  651. width: 100%;
  652. height: 100vh;
  653. background-color: rgba(127, 127, 127, 0.2);
  654. position: fixed;
  655. left: 0;
  656. top: 0;
  657. z-index: 11111;
  658. }
  659. .choice-takePhoto {
  660. position: absolute;
  661. bottom: 0;
  662. background-color: white;
  663. width: 100%;
  664. border-radius: 20rpx 20rpx 0 0;
  665. }
  666. .choice-takePhoto>view:first-child {
  667. text-align: center;
  668. height: 80rpx;
  669. line-height: 80rpx;
  670. border-bottom: 1rpx solid rgba(127, 127, 127, 0.3);
  671. background-color: white;
  672. }
  673. .choice-takePhoto>view:last-child {
  674. text-align: center;
  675. height: 80rpx;
  676. line-height: 80rpx;
  677. border-top: 6rpx solid rgba(127, 127, 127, 0.1);
  678. background-color: white;
  679. }
  680. .choice-takePhoto>view {
  681. text-align: center;
  682. height: 80rpx;
  683. line-height: 80rpx;
  684. background-color: white;
  685. }
  686. .choice-takePhoto-wrap {
  687. width: 100%;
  688. height: 100vh;
  689. background-color: rgba(127, 127, 127, 0.2);
  690. position: fixed;
  691. left: 0;
  692. top: 0;
  693. z-index: 11111;
  694. }
  695. .car-type{
  696. width: 400rpx;
  697. height: 68rpx;
  698. margin: 50rpx auto;
  699. border-radius: 68rpx;
  700. border: 1px #CCB375 solid;
  701. font-size: 28rpx;
  702. overflow: hidden;
  703. display: flex;
  704. .car-type-item{
  705. width: 50%;
  706. height: 100%;
  707. line-height: 68rpx;
  708. text-align: center;
  709. color: #CCB375;
  710. flex-shrink: 0;
  711. flex-grow: 0;
  712. }
  713. .active{
  714. color: #FFFFFF;
  715. background-color: #CCB375;
  716. }
  717. }
  718. </style>