您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

opening-account-people.vue 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862
  1. <template>
  2. <navBar title="ETC开户新办申请-个人" :scrollTop="scrollTop"></navBar>
  3. <navBgCar></navBgCar>
  4. <view class="content-wrap">
  5. <view @click="tabChange(true)">
  6. <view :class="state.isMyPeopple ? 'big' : 'nomal'"> 本人车辆 </view>
  7. <view :class="state.isMyPeopple ? 'tip' : ''"> </view>
  8. </view>
  9. <view @click="tabChange(false)" style="margin-left: 60rpx" class="" v-if="state.isEnableOther">
  10. <view :class="state.isMyPeopple ? 'nomal' : 'big'"> 他人车辆 </view>
  11. <view :class="state.isMyPeopple ? '' : 'tip'"> </view>
  12. </view>
  13. </view>
  14. <view v-if="state.isMyPeopple" class="content">
  15. <view class="item-tips">
  16. <view class="title"> 上传后请核对识别信息 </view>
  17. <view class="tip"> 如有错误请及时手动修改 </view>
  18. </view>
  19. <view class="picture-wrapper" @click="takePhotoMode('1','my')">
  20. <view class="bg">
  21. <view class="">
  22. <view class="name"> 人像面 </view>
  23. <view class="value"> 上传身份证的人像面 </view>
  24. <view class="tip">
  25. <view class="tip-value"> 拍摄规范 </view>
  26. </view>
  27. </view>
  28. <image v-if="!state.form.userPosImgUrl" class="icon" :src="`${$imgUrl}applyCard/renxiang.png`">
  29. </image>
  30. <image v-else class="icon" :src="strReplace(state.form.userPosImgUrl)"></image>
  31. </view>
  32. </view>
  33. <view class="picture-wrapper" @click="takePhotoMode('2','my')">
  34. <view class="bg">
  35. <view class="">
  36. <view class="name"> 国徽面 </view>
  37. <view class="value"> 上传身份证的国徽面 </view>
  38. <view class="tip">
  39. <view class="tip-value"> 拍摄规范 </view>
  40. </view>
  41. </view>
  42. <image v-if="!state.form.userNegImgUrl" class="icon" :src="`${$imgUrl}applyCard/guohui.png`">
  43. </image>
  44. <image v-else class="icon" :src="strReplace(state.form.userNegImgUrl)"></image>
  45. </view>
  46. </view>
  47. <view class="shibie-wrapper">
  48. <view class="title"> 识别内容如下 </view>
  49. <u-form label-width="230" :model="state.form" ref="uForm">
  50. <u-form-item label="姓名">
  51. <u-input v-model="state.form.userName" placeholder='请输入姓名' :disabled="state.isEnableOCRData"
  52. maxlength="20" @input="replaceInput" />
  53. </u-form-item>
  54. <!-- <u-form-item label="性别">
  55. <u-input placeholder='请选择性别' v-model="state.form.gender" @click="userGenderAction()"
  56. type="select" />
  57. </u-form-item> -->
  58. <u-form-item label="身份证号">
  59. <u-input placeholder='请输入身份证' type="idcard" v-model="state.form.userIdNum"
  60. :disabled="state.isEnableOCRData" maxlength="18" />
  61. </u-form-item>
  62. <u-form-item label="地址">
  63. <u-input placeholder='请输入地址' :autoHeight='true' v-model="state.form.address"
  64. :disabled="state.isEnableOCRData" maxlength="100" />
  65. </u-form-item>
  66. <!-- <u-form-item label="证件有效期">
  67. <u-input v-model="state.form.begindate" type="select" />
  68. </u-form-item> -->
  69. <u-form-item label="联系方式">
  70. <u-input placeholder='请输入联系方式' type="number" v-model="state.form.tel" maxlength="11" />
  71. </u-form-item>
  72. </u-form>
  73. </view>
  74. <view class="green-tip">
  75. 如识别信息有误,请手动修改,确认无误后,点击下一步!
  76. </view>
  77. <view class="action">
  78. <button type="default" class="button" @click="savaHandle()">
  79. 下一步
  80. </button>
  81. </view>
  82. </view>
  83. <view v-else class="content">
  84. <view class="title"> 车主信息 </view>
  85. <view class="item-tips">
  86. <view class="title"> 上传后请核对识别信息 </view>
  87. <view class="tip"> 如有错误请及时手动修改 </view>
  88. </view>
  89. <view class="picture-wrapper" @click="takePhotoMode('1','my')">
  90. <view class="bg">
  91. <view class="">
  92. <view class="name"> 人像面 </view>
  93. <view class="value"> 上传身份证的人像面 </view>
  94. <view class="tip">
  95. <view class="tip-value"> 拍摄规范 </view>
  96. </view>
  97. </view>
  98. <image v-if="!state.form.userPosImgUrl" class="icon" :src="`${$imgUrl}applyCard/renxiang.png`">
  99. </image>
  100. <image v-else class="icon" :src="strReplace(state.form.userPosImgUrl)"></image>
  101. </view>
  102. </view>
  103. <view class="picture-wrapper" @click="takePhotoMode('2','my')">
  104. <view class="bg">
  105. <view class="">
  106. <view class="name"> 国徽面 </view>
  107. <view class="value"> 上传身份证的国徽面 </view>
  108. <view class="tip">
  109. <view class="tip-value"> 拍摄规范 </view>
  110. </view>
  111. </view>
  112. <image v-if="!state.form.userNegImgUrl" class="icon" :src="`${$imgUrl}applyCard/guohui.png`">
  113. </image>
  114. <image v-else class="icon" :src="strReplace(state.form.userNegImgUrl)"></image>
  115. </view>
  116. </view>
  117. <view class="shibie-wrapper">
  118. <view class="title"> 识别内容如下 </view>
  119. <u-form label-width="200" :model="state.form" ref="uForm">
  120. <u-form-item label="姓名">
  121. <u-input inputAlign="right" placeholder='请输入姓名' v-model="state.form.userName"
  122. :disabled="state.isEnableOCRData" maxlength="20" />
  123. </u-form-item>
  124. <!-- <u-form-item label="性别">
  125. <u-input inputAlign="right" placeholder='请选择性别' v-model="state.form.gender" type="select" />
  126. </u-form-item> -->
  127. <u-form-item label="身份证号">
  128. <u-input inputAlign="right" placeholder='请输入身份证号' v-model="state.form.userIdNum"
  129. :disabled="state.isEnableOCRData" type="idcard" />
  130. </u-form-item>
  131. <!-- <u-form-item label="">
  132. <u-input v-model="state.form.userIdNum" />
  133. </u-form-item> -->
  134. <!-- <u-form-item label="证件有效期">
  135. <u-input v-model="state.form.begindate" type="select" />
  136. </u-form-item> -->
  137. <u-form-item label="联系方式">
  138. <u-input inputAlign="right" placeholder='请输入联系方式' v-model="state.form.tel" maxlength="11" />
  139. </u-form-item>
  140. </u-form>
  141. </view>
  142. <view style="margin-top: 30rpx" class="title"> 代办人信息 </view>
  143. <view class="item-tips">
  144. <view class="title"> 上传后请核对识别信息 </view>
  145. <view class="tip"> 如有错误请及时手动修改 </view>
  146. </view>
  147. <view class="picture-wrapper" @click="takePhotoMode('1','other')">
  148. <view class="bg">
  149. <view class="">
  150. <view class="name"> 人像面 </view>
  151. <view class="value"> 上传身份证的人像面 </view>
  152. <view class="tip">
  153. <view class="tip-value"> 拍摄规范 </view>
  154. </view>
  155. </view>
  156. <image v-if="!state.form.agentPosImgUrl" class="icon" :src="`${$imgUrl}applyCard/renxiang.png`">
  157. </image>
  158. <image v-else class="icon" :src="strReplace(state.form.agentPosImgUrl)"></image>
  159. </view>
  160. </view>
  161. <view class="picture-wrapper" @click="takePhotoMode('2','other')">
  162. <view class="bg">
  163. <view class="">
  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.agentNegImgUrl" class="icon" :src="`${$imgUrl}applyCard/guohui.png`">
  171. </image>
  172. <image v-else class="icon" :src="strReplace(state.form.agentNegImgUrl)"></image>
  173. </view>
  174. </view>
  175. <view class="picture-wrapper" @click="cardFileImageUpdate()" v-if='state.isEnableBook'>
  176. <view class="bg">
  177. <view class="">
  178. <view class="name"> 委托书 </view>
  179. <view class="value"> 上传文字清晰的委托书 </view>
  180. <view class="tip">
  181. <view class="tip-value"> 拍摄规范 </view>
  182. </view>
  183. </view>
  184. <image v-if="!state.form.proxyUrl" class="icon" :src="`${$imgUrl}applyCard/weituoshu.png`">
  185. </image>
  186. <image v-else class="icon" :src="strReplace(state.form.proxyUrl)"></image>
  187. </view>
  188. </view>
  189. <view class="shibie-wrapper">
  190. <view class="title"> 识别内容如下 </view>
  191. <u-form label-width="200" :model="state.form" ref="uForm">
  192. <u-form-item label="经办人姓名">
  193. <u-input inputAlign="right" placeholder='请输入经办人姓名' v-model="state.form.agentName"
  194. :disabled="state.isEnableOCRData" maxlength="20" />
  195. </u-form-item>
  196. <!-- <u-form-item label="性别">
  197. <u-input v-model="state.form.agentGender" type="select" />
  198. </u-form-item> -->
  199. <u-form-item label="身份证号">
  200. <u-input inputAlign="right" placeholder='请输入身份证号' v-model="state.form.agentIdNum"
  201. :disabled="state.isEnableOCRData" maxlength="18" type="idcard" />
  202. </u-form-item>
  203. <!-- <u-form-item label="证件有效期">
  204. <u-input v-model="state.form.begindate" type="select" />
  205. </u-form-item> -->
  206. <u-form-item label="联系方式">
  207. <u-input inputAlign="right" placeholder='请输入联系方式' v-model="state.form.agentTel" type="number"
  208. maxlength="11" />
  209. </u-form-item>
  210. </u-form>
  211. </view>
  212. <view class="green-tip">
  213. 如识别信息有误,请手动修改,确认无误后,点击下一步!
  214. </view>
  215. <view class="action">
  216. <button type="default" class="button" @click="savaHandle()">
  217. 下一步
  218. </button>
  219. </view>
  220. </view>
  221. <u-select mode="single-column" :list="state.genderList" v-model="state.genderShow" @confirm="genderSelectConfirm">
  222. </u-select>
  223. <view class="choice-takePhoto-wrap" v-if="state.isTakePhotoModeShow" @click="cancle">
  224. <view class="choice-takePhoto">
  225. <view @click.stop="takePhoto(state.choiceIndex)" style="border-radius: 20rpx 20rpx 0 0;">拍照</view>
  226. <view @click.stop="xiangce(state.choiceIndex)">从手机相册选择</view>
  227. <view @click.stop="cancle">取消</view>
  228. </view>
  229. </view>
  230. <viewfinder v-if="state.phoneType" :phoneType="state.phoneType" :images="state.images"
  231. :showStartPhoto="state.showImg" @confirmReturn="confirmReturn" @camera="camera"></viewfinder>
  232. </template>
  233. <script setup lang="ts">
  234. import viewfinder from "../../components/viewfinder.vue"
  235. import navBgCar from "./components/nav-bg-car3";
  236. import {
  237. reactive,
  238. ref,
  239. } from "vue";
  240. import {
  241. msg,
  242. checkStr,
  243. strReplace,
  244. uploadFile,
  245. hasLogin
  246. } from "@/utils/utils";
  247. import {
  248. onLoad,
  249. onPageScroll,
  250. } from "@dcloudio/uni-app";
  251. import {
  252. etcOcrCard,
  253. etcUserCardInfoSubmit,
  254. fileUpload,
  255. register,
  256. envs,
  257. getUserMsg,
  258. ocrAllQuery
  259. } from "@/utils/network/api.js";
  260. import {
  261. request
  262. } from "@/utils/network/request.js";
  263. import {
  264. stringToJson
  265. } from "@/utils/network/encryption";
  266. import {
  267. setItem,
  268. getItem,
  269. } from "@/utils/storage";
  270. import {
  271. getCodeName
  272. } from "@/datas/queryKey.js";
  273. import navBar from "@/components/nav-bar/nav-bar2.vue";
  274. const scrollTop = ref(0)
  275. const state = reactive({
  276. showImg: true,
  277. isMy: "",//自己办理 他人办理
  278. phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面
  279. choiceIndex: 1, // 1 身份证正面 2 身份证反面
  280. isTakePhotoModeShow: false, //选择拍照方式是否出来
  281. images: '',
  282. genderList: [{
  283. value: '男',
  284. label: '男'
  285. },
  286. {
  287. value: '女',
  288. label: '女'
  289. }
  290. ],
  291. form: {
  292. orderId: "", //订单ID
  293. userName: "", //开户人姓名
  294. userIdType: "101", //用户证件类型 101//身份证
  295. userIdNum: "", //用户证件号码
  296. userPosImgUrl: "", //身份证正面
  297. userNegImgUrl: "", //身份证反面
  298. tel: "", //开户人手机号
  299. address: "", //开户人地址
  300. sceneType: "", //用户协议支撑服务场景(发行服务机构和用户签订的协议)
  301. channelId: "", //渠道id
  302. gender: "",
  303. customerIdVld: "",
  304. agentName: "",
  305. agentGender: "",
  306. agentTel: '',
  307. agentPhone: "",
  308. agentIdType: "101",
  309. agentIdNum: "",
  310. agentPosImgUrl: "",
  311. agentNegImgUrl: "",
  312. proxyUrl: "",
  313. agentAddress: "",
  314. agentIdVld: '',
  315. opId: '',
  316. orderSource: 'WECHAT',
  317. },
  318. genderShow: false,
  319. orderId: "",
  320. vehiclePlateColor: undefined,
  321. isMyPeopple: true,
  322. isSign: '',
  323. type: 1,
  324. isEnableOther: true, //小程序是否支持他人办理
  325. isEnableBook: true, //他人办理时是否上传委托书
  326. isEnableInfo: true, //小程序信息带出
  327. isEnableOCRData: true, //允许修改OCR识别出来的数据
  328. });
  329. const userGenderAction = () => {
  330. state.genderShow = true;
  331. };
  332. const genderSelectConfirm = (e) => {
  333. state.form.gender = ''
  334. e.map((val, index) => {
  335. state.form.gender = val.label;
  336. })
  337. };
  338. const camera = () => {
  339. state.phoneType = 0
  340. }
  341. const savaHandle = () => {
  342. if (!state.form.userPosImgUrl) {
  343. msg('请上传身份证的人像面');
  344. return;
  345. }
  346. if (!state.form.userNegImgUrl) {
  347. msg('请上传身份证的国徽面');
  348. return;
  349. }
  350. if (!checkStr(state.form.userIdNum, 'card')) {
  351. msg('请输入正确身份证');
  352. return;
  353. }
  354. if (!checkStr(state.form.tel, 'mobile')) {
  355. msg('请输入正确手机号');
  356. return;
  357. }
  358. //如果未登录||新用户
  359. // 手机号不一致,无感登录 不刷新toKen
  360. // 没登录 无感登录 刷新token
  361. if (!getItem('openId')) {
  362. console.log("没登录无感登录刷新toKen ")
  363. let data = {
  364. userType: "PERSONAL",
  365. idNum: state.form.userIdNum,
  366. idType: state.form.userIdType,
  367. mobile: state.form.tel,
  368. userName: state.form.userName,
  369. gender: state.form.gender == '男' ? 'MALE' : 'FEMALE',
  370. certifyChannel: "BAIDUOCR",
  371. address: state.form.address,
  372. agentIdNum: state.form.agentIdNum,
  373. agentIdType: state.form.agentIdType,
  374. agentName: state.form.agentName,
  375. department: "",
  376. userIdImgUrl: state.form.userPosImgUrl,
  377. userIdImgBase64: "",
  378. }
  379. const options = {
  380. type: 2,
  381. data: data,
  382. method: "POST",
  383. showLoading: true,
  384. };
  385. request(register, options).then((res) => {
  386. let result = stringToJson(res.bizContent);
  387. if (result.accessToken && result.openId) {
  388. setItem('token', result.accessToken)
  389. setItem('openId', result.openId)
  390. state.form.opId = result.openId;
  391. let data = state.form;
  392. const options = {
  393. type: 2,
  394. data: data,
  395. method: "POST",
  396. showLoading: true,
  397. };
  398. request(etcUserCardInfoSubmit, options).then((res) => {
  399. console.log(res);
  400. uni.redirectTo({
  401. url: `/subpackage/orders/car-release?orderId=${state.orderId}&vehiclePlateColor=${state.vehiclePlateColor}&type=${state.type}&isSign=${state.isSign}`,
  402. });
  403. });
  404. }
  405. })
  406. } else {
  407. console.log("正常走 ")
  408. // 已经登录
  409. let data = state.form;
  410. const options = {
  411. type: 2,
  412. data: data,
  413. method: "POST",
  414. showLoading: true,
  415. };
  416. request(etcUserCardInfoSubmit, options).then((res) => {
  417. // let result = stringToJson(res.bizContent);
  418. console.log(res);
  419. uni.redirectTo({
  420. url: `/subpackage/orders/car-release?orderId=${state.orderId}&vehiclePlateColor=${state.vehiclePlateColor}&type=${state.type}&isSign=${state.isSign}`,
  421. });
  422. });
  423. }
  424. };
  425. const cardFileImageUpdate = () => {
  426. uni.chooseImage({
  427. count: 1, //只能选取一张照片
  428. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  429. sourceType: ["camera", "album"], //从相册选择
  430. success: function (res) {
  431. uploadFile(res.tempFilePaths[0], "", "").then((data) => {
  432. state.form.proxyUrl = data;
  433. })
  434. },
  435. });
  436. };
  437. //tab切换
  438. const tabChange = (val : any) => {
  439. state.isTakePhotoModeShow = false
  440. if (val) {
  441. state.isMyPeopple = true;
  442. } else {
  443. state.isMyPeopple = false;
  444. }
  445. state.form = {
  446. orderId: state.orderId, //订单ID
  447. userName: "", //开户人姓名
  448. userIdType: "101", //用户证件类型 101//身份证
  449. userIdNum: "", //用户证件号码
  450. userPosImgUrl: "", //身份证正面
  451. userNegImgUrl: "", //身份证反面
  452. tel: "", //开户人手机号
  453. address: "", //开户人地址
  454. sceneType: "", //用户协议支撑服务场景(发行服务机构和用户签订的协议)
  455. channelId: "", //渠道id
  456. gender: "",
  457. customerIdVld: "",
  458. agentName: "",
  459. agentGender: "",
  460. agentTel: '',
  461. agentPhone: "",
  462. agentIdType: "101",
  463. agentIdNum: "",
  464. agentPosImgUrl: "",
  465. agentNegImgUrl: "",
  466. proxyUrl: "",
  467. agentAddress: "",
  468. agentIdVld: '',
  469. };
  470. };
  471. onLoad((option : any) => {
  472. state.form.orderId = option.orderId;
  473. state.orderId = option.orderId;
  474. state.vehiclePlateColor = option.vehiclePlateColor;
  475. state.form.opId = getItem('openId') ? getItem('openId') : '';
  476. state.isSign = option.isSign;
  477. state.type = option.type;
  478. //state.fromOrder = option.fromOrder //是否来自订单-修改资料
  479. getGlobalParam(); //全局配置数据
  480. console.log("option", option)
  481. });
  482. //监听页面滚动
  483. onPageScroll((e) => {
  484. scrollTop.value = e.scrollTop;
  485. });
  486. const replaceInput = (event) => {
  487. console.log("event", event)
  488. const screeningStr = /[^\u4E00-\u9FA5]/g; //想禁止什么类型,在这里替换正则就可以了
  489. if (screeningStr.test(event)) {
  490. setTimeout(() => {
  491. state.form.userName = event.replace(screeningStr, '');
  492. }, 100)
  493. } else {
  494. setTimeout(() => {
  495. state.form.userName = event;
  496. }, 100)
  497. }
  498. console.log("event.replace(screeningStr, '')", event.replace(screeningStr, ''), event, state.form.userName)
  499. }
  500. const getGlobalParam = () => {
  501. const data = getItem('globalParam')
  502. console.log("全局配置数据", getCodeName('IS_ENABLE', data.miniSupportOther), getCodeName('IS_ENABLE', data.otherUploadProxy), getCodeName('IS_ENABLE', data.miniInfoShow), getCodeName('IS_ENABLE', data.changeOCRData))
  503. // 小程序是否支持他人办理
  504. if (getCodeName('IS_ENABLE', data.miniSupportOther) == '启用') {
  505. state.isEnableOther = true;
  506. } else {
  507. state.isEnableOther = false;
  508. }
  509. // 他人办理时是否上传委托书
  510. if (getCodeName('IS_ENABLE', data.otherUploadProxy) == '启用') {
  511. state.isEnableBook = true;
  512. } else {
  513. state.isEnableBook = false;
  514. }
  515. // 小程序信息带出
  516. if (getCodeName('IS_ENABLE', data.miniInfoShow) == '启用') {
  517. state.isEnableInfo = true;
  518. uni.showModal({
  519. // title: '提示',
  520. content: '是否允许带出用户信息',
  521. success: function (res) {
  522. if (res.confirm) {
  523. console.log('用户点击确定');
  524. queryUserMsg() //通过opneId查询用户信息
  525. } else if (res.cancel) {
  526. console.log('用户点击取消');
  527. }
  528. }
  529. });
  530. } else {
  531. state.isEnableInfo = false;
  532. }
  533. // 允许修改OCR识别出来的数据
  534. if (getCodeName('IS_ENABLE', data.changeOCRData) == '启用') {
  535. state.isEnableOCRData = false;
  536. } else {
  537. state.isEnableOCRData = true;
  538. }
  539. }
  540. // 通过opneId查询用户信息
  541. const queryUserMsg = () => {
  542. const options = {
  543. type: 2,
  544. data: {
  545. "openId": getItem('openId')
  546. },
  547. method: "POST",
  548. showLoading: true,
  549. };
  550. request(getUserMsg, options).then((res) => {
  551. console.log("通过opneId查询用户信息", stringToJson(res.bizContent))
  552. const data = stringToJson(res.bizContent);
  553. state.form.userPosImgUrl = data.customerPosImgUrl;
  554. state.form.userNegImgUrl = data.customerNegImgUrl;
  555. state.form.userName = data.customerName;
  556. state.form.userIdNum = data.customerIdNum;
  557. state.form.address = data.customerAddress;
  558. state.form.tel = data.customerTel;
  559. })
  560. }
  561. const takePhotoMode = (index, isMy) => {
  562. console.log("index", index, isMy)
  563. state.isTakePhotoModeShow = true
  564. state.choiceIndex = index
  565. state.isMy = isMy
  566. }
  567. const xiangce = (val) => {
  568. console.log("val", val)
  569. var imageType = val;
  570. uni.chooseImage({
  571. count: 1, //只能选取一张照片
  572. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  573. sourceType: ["album"], //从相册选择
  574. success: function (res) {
  575. state.showImg = false
  576. state.images = res.tempFilePaths[0]
  577. state.phoneType = state.choiceIndex
  578. state.isTakePhotoModeShow = false
  579. console.log("tempFilePaths[0].startsWith('file://')", res.tempFilePaths[0], res.tempFilePaths[0].startsWith('file://'))
  580. },
  581. })
  582. }
  583. const takePhoto = (val) => {
  584. state.showImg = true
  585. console.log("拍照", val)
  586. state.phoneType = val;
  587. }
  588. const confirmReturn = (val) => {
  589. console.log("图片地址val", val)
  590. state.phoneType = 0
  591. state.isTakePhotoModeShow = false
  592. var imageType = state.choiceIndex;
  593. // uploadFile(val.tempImagePath, imageType, ocrAllQuery).then((data) => {
  594. uploadFile(val.tempImagePath, imageType, etcOcrCard).then((data) => {
  595. console.log("身份证上传", data)
  596. if (state.isMy == "my") {
  597. if (state.choiceIndex == "1") {
  598. state.form.userName = data.name;
  599. state.form.gender = data.gender;
  600. state.form.userIdNum = data.idno;
  601. state.form.userPosImgUrl = data.imageUrl;
  602. state.form.address = data.address;
  603. } else {
  604. state.form.customerIdVld = data.enddate;
  605. state.form.userNegImgUrl = data.imageUrl;
  606. }
  607. state.isTakePhotoModeShow = false
  608. } else {
  609. if (state.choiceIndex == "1") {
  610. state.form.agentName = data.name;
  611. state.form.agentGender = data.gender;
  612. state.form.agentIdNum = data.idno;
  613. state.form.agentPosImgUrl = data.imageUrl;
  614. state.form.agentAddress = data.address;
  615. } else {
  616. console.log("state.isMy", state.isMy, state.choiceIndex, state.choiceIndex == "1", data)
  617. state.form.agentIdVld = data.enddate;
  618. state.form.agentNegImgUrl = data.imageUrl;
  619. }
  620. state.isTakePhotoModeShow = false
  621. }
  622. })
  623. }
  624. const cancle = () => {
  625. state.isTakePhotoModeShow = false
  626. }
  627. </script>
  628. <style lang="scss" scoped>
  629. .title {
  630. font-size: 35rpx;
  631. font-family: Microsoft YaHei;
  632. font-weight: 400;
  633. color: #000000;
  634. line-height: 80rpx;
  635. margin-bottom: 10rpx;
  636. }
  637. .content-wrap {
  638. position: relative;
  639. margin-top: -50rpx;
  640. padding: 0rpx 30rpx;
  641. display: flex;
  642. .big {
  643. font-size: 30rpx;
  644. font-family: Microsoft YaHei;
  645. font-weight: 400;
  646. color: #333333;
  647. line-height: 24rpx;
  648. }
  649. .nomal {
  650. font-size: 26rpx;
  651. font-family: Microsoft YaHei;
  652. font-weight: 400;
  653. color: #666666;
  654. line-height: 24rpx;
  655. }
  656. .tip {
  657. margin-top: -5px;
  658. width: 117rpx;
  659. height: 16rpx;
  660. background: #00b38b;
  661. opacity: 0.3;
  662. }
  663. }
  664. .content {
  665. padding: 50rpx 30rpx 50rpx 30rpx;
  666. .action {
  667. padding-left: 20rpx;
  668. padding-right: 20rpx;
  669. padding-bottom: 30rpx;
  670. .button {
  671. height: 80rpx;
  672. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  673. border-radius: 40rpx;
  674. font-size: 32rpx;
  675. font-weight: 400;
  676. color: #ffffff;
  677. line-height: 80rpx;
  678. }
  679. }
  680. .item-tips {
  681. .title {
  682. font-size: 30rpx;
  683. font-family: Microsoft YaHei;
  684. font-weight: 400;
  685. color: #000000;
  686. line-height: 24rpx;
  687. }
  688. .tip {
  689. margin-top: 16rpx;
  690. font-size: 24rpx;
  691. font-family: Microsoft YaHei;
  692. font-weight: 400;
  693. color: #999999;
  694. line-height: 24rpx;
  695. }
  696. }
  697. .picture-wrapper {
  698. margin-top: 40rpx;
  699. .bg {
  700. background: #ffffff;
  701. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  702. border-radius: 20rpx;
  703. padding: 40rpx;
  704. display: flex;
  705. // align-items: center;
  706. justify-content: space-between;
  707. .name {
  708. font-size: 34rpx;
  709. font-family: Microsoft YaHei;
  710. font-weight: 400;
  711. color: #000000;
  712. line-height: 34rpx;
  713. }
  714. .value {
  715. margin-top: 20rpx;
  716. font-size: 24rpx;
  717. font-family: Microsoft YaHei;
  718. font-weight: 400;
  719. color: #999999;
  720. line-height: 24rpx;
  721. }
  722. .tip {
  723. margin-top: 20rpx;
  724. text-align: center;
  725. width: 110rpx;
  726. height: 40rpx;
  727. background: rgba(33, 190, 177, 0.2);
  728. border-radius: 6rpx;
  729. .tip-value {
  730. font-size: 20rpx;
  731. font-family: Microsoft YaHei;
  732. font-weight: 400;
  733. color: #0a8f8a;
  734. line-height: 40rpx;
  735. opacity: 1;
  736. }
  737. }
  738. }
  739. .icon {
  740. width: 294rpx;
  741. height: 188rpx;
  742. }
  743. }
  744. .shibie-wrapper {
  745. margin-top: 60rpx;
  746. .title {
  747. font-size: 30rpx;
  748. font-family: Microsoft YaHei;
  749. font-weight: 400;
  750. color: #000000;
  751. line-height: 30rpx;
  752. }
  753. }
  754. .buchong-wrapper {
  755. margin-top: 60rpx;
  756. .title {
  757. font-size: 30rpx;
  758. font-family: Microsoft YaHei;
  759. font-weight: 400;
  760. color: #000000;
  761. line-height: 30rpx;
  762. }
  763. }
  764. .green-tip {
  765. margin-top: 50rpx;
  766. font-size: 24rpx;
  767. font-family: Microsoft YaHei;
  768. font-weight: 400;
  769. color: #00b38b;
  770. line-height: 24rpx;
  771. margin-bottom: 60rpx;
  772. }
  773. }
  774. .choice-takePhoto {
  775. position: absolute;
  776. bottom: 0;
  777. background-color: white;
  778. width: 100%;
  779. border-radius: 20rpx 20rpx 0 0;
  780. }
  781. .choice-takePhoto>view:first-child {
  782. text-align: center;
  783. height: 80rpx;
  784. line-height: 80rpx;
  785. border-bottom: 1rpx solid rgba(127, 127, 127, 0.3);
  786. background-color: white;
  787. }
  788. .choice-takePhoto>view:last-child {
  789. text-align: center;
  790. height: 80rpx;
  791. line-height: 80rpx;
  792. border-top: 6rpx solid rgba(127, 127, 127, 0.1);
  793. background-color: white;
  794. }
  795. .choice-takePhoto>view {
  796. text-align: center;
  797. height: 80rpx;
  798. line-height: 80rpx;
  799. background-color: white;
  800. }
  801. .choice-takePhoto-wrap {
  802. width: 100%;
  803. height: 100vh;
  804. background-color: rgba(127, 127, 127, 0.2);
  805. position: fixed;
  806. left: 0;
  807. top: 0;
  808. z-index: 11111;
  809. }
  810. </style>