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.

opening-account-people.vue 24KB

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