Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

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