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

opening-account-people.vue 24KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877
  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. compressImage
  226. } from "@/utils/utils";
  227. import {
  228. onLoad,
  229. onPageScroll,
  230. } from "@dcloudio/uni-app";
  231. import {
  232. etcOcrCard,
  233. etcUserCardInfoSubmit,
  234. fileUpload,
  235. register,
  236. envs,
  237. getUserMsg,
  238. ocrAllQuery
  239. } from "@/utils/network/api.js";
  240. import {
  241. request
  242. } from "@/utils/network/request.js";
  243. import {
  244. stringToJson
  245. } from "@/utils/network/encryption";
  246. import {
  247. setItem,
  248. getItem,
  249. } from "@/utils/storage";
  250. import {
  251. getCodeName
  252. } from "@/datas/queryKey.js";
  253. import navBar from "@/components/nav-bar/nav-bar2.vue";
  254. const scrollTop = ref(0)
  255. const state = reactive({
  256. showImg: true,
  257. isMy: "",//自己办理 他人办理
  258. phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面
  259. choiceIndex: 1, // 1 身份证正面 2 身份证反面
  260. isTakePhotoModeShow: false, //选择拍照方式是否出来
  261. images: '',
  262. genderList: [{
  263. value: '男',
  264. label: '男'
  265. },
  266. {
  267. value: '女',
  268. label: '女'
  269. }
  270. ],
  271. form: {
  272. orderId: "", //订单ID
  273. userName: "", //开户人姓名
  274. userIdType: "101", //用户证件类型 101//身份证
  275. userIdNum: "", //用户证件号码
  276. userPosImgUrl: "", //身份证正面
  277. userNegImgUrl: "", //身份证反面
  278. tel: "", //开户人手机号
  279. address: "", //开户人地址
  280. sceneType: "", //用户协议支撑服务场景(发行服务机构和用户签订的协议)
  281. channelId: "", //渠道id
  282. gender: "",
  283. customerIdVld: "",
  284. agentName: "",
  285. agentGender: "",
  286. agentTel: '',
  287. agentPhone: "",
  288. agentIdType: "101",
  289. agentIdNum: "",
  290. agentPosImgUrl: "",
  291. agentNegImgUrl: "",
  292. proxyUrl: "",
  293. agentAddress: "",
  294. agentIdVld: '',
  295. opId: '',
  296. orderSource: 'WECHAT',
  297. },
  298. genderShow: false,
  299. orderId: "",
  300. vehiclePlateColor: undefined,
  301. isMyPeopple: true,
  302. isSign: '',
  303. type: 1,
  304. isEnableOther: true, //小程序是否支持他人办理
  305. isEnableBook: true, //他人办理时是否上传委托书
  306. isEnableInfo: true, //小程序信息带出
  307. isEnableOCRData: true, //允许修改OCR识别出来的数据
  308. });
  309. const userGenderAction = () => {
  310. state.genderShow = true;
  311. };
  312. const genderSelectConfirm = (e) => {
  313. state.form.gender = ''
  314. e.map((val, index) => {
  315. state.form.gender = val.label;
  316. })
  317. };
  318. const camera = () => {
  319. state.phoneType = 0
  320. }
  321. const savaHandle = () => {
  322. if (!state.form.userPosImgUrl) {
  323. msg('请上传身份证的人像面');
  324. return;
  325. }
  326. if (!state.form.userNegImgUrl) {
  327. msg('请上传身份证的国徽面');
  328. return;
  329. }
  330. if (!checkStr(state.form.userIdNum, 'card')) {
  331. msg('请输入正确身份证');
  332. return;
  333. }
  334. if (!checkStr(state.form.tel, 'mobile')) {
  335. msg('请输入正确手机号');
  336. return;
  337. }
  338. // 都要无感注册
  339. // 没登录就存token 登录了就正常走
  340. registerRequest().then((result : any) => {
  341. if (!getItem('openId')) {
  342. setItem('token', result.accessToken)
  343. setItem('openId', result.openId)
  344. } else {
  345. console.log("正常走 ")
  346. // 已经登录
  347. let data = state.form;
  348. const options = {
  349. type: 2,
  350. data: data,
  351. method: "POST",
  352. showLoading: true,
  353. };
  354. request(etcUserCardInfoSubmit, options).then((res) => {
  355. console.log(res);
  356. uni.redirectTo({
  357. url: `/subpackage/orders/car-release?orderId=${state.orderId}&vehiclePlateColor=${state.vehiclePlateColor}&type=${state.type}&isSign=${state.isSign}`,
  358. });
  359. });
  360. }
  361. })
  362. };
  363. const cardFileImageUpdate = () => {
  364. uni.chooseImage({
  365. count: 1, //只能选取一张照片
  366. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  367. sourceType: ["camera", "album"], //从相册选择
  368. success: function (res) {
  369. uploadFile(res.tempFilePaths[0], "", "").then((data) => {
  370. state.form.proxyUrl = data;
  371. })
  372. },
  373. });
  374. };
  375. //tab切换
  376. const tabChange = (val : any) => {
  377. state.isTakePhotoModeShow = false
  378. if (val) {
  379. state.isMyPeopple = true;
  380. } else {
  381. state.isMyPeopple = false;
  382. }
  383. state.form = {
  384. orderId: state.orderId, //订单ID
  385. userName: "", //开户人姓名
  386. userIdType: "101", //用户证件类型 101//身份证
  387. userIdNum: "", //用户证件号码
  388. userPosImgUrl: "", //身份证正面
  389. userNegImgUrl: "", //身份证反面
  390. tel: "", //开户人手机号
  391. address: "", //开户人地址
  392. sceneType: "", //用户协议支撑服务场景(发行服务机构和用户签订的协议)
  393. channelId: "", //渠道id
  394. gender: "",
  395. customerIdVld: "",
  396. agentName: "",
  397. agentGender: "",
  398. agentTel: '',
  399. agentPhone: "",
  400. agentIdType: "101",
  401. agentIdNum: "",
  402. agentPosImgUrl: "",
  403. agentNegImgUrl: "",
  404. proxyUrl: "",
  405. agentAddress: "",
  406. agentIdVld: '',
  407. orderSource: 'WECHAT',
  408. };
  409. };
  410. onLoad((option : any) => {
  411. state.form.orderId = option.orderId;
  412. state.orderId = option.orderId;
  413. state.vehiclePlateColor = option.vehiclePlateColor;
  414. state.form.opId = getItem('openId') ? getItem('openId') : '';
  415. state.isSign = option.isSign;
  416. state.type = option.type;
  417. getGlobalParam(); //全局配置数据
  418. console.log("option", option)
  419. });
  420. //监听页面滚动
  421. onPageScroll((e) => {
  422. scrollTop.value = e.scrollTop;
  423. });
  424. const replaceInput = (event) => {
  425. console.log("event", event)
  426. const screeningStr = /[^\u4E00-\u9FA5]/g; //想禁止什么类型,在这里替换正则就可以了
  427. if (screeningStr.test(event)) {
  428. setTimeout(() => {
  429. state.form.userName = event.replace(screeningStr, '');
  430. }, 100)
  431. } else {
  432. setTimeout(() => {
  433. state.form.userName = event;
  434. }, 100)
  435. }
  436. console.log("event.replace(screeningStr, '')", event.replace(screeningStr, ''), event, state.form.userName)
  437. }
  438. const getGlobalParam = () => {
  439. const data = getItem('globalParam')
  440. console.log("全局配置数据", getCodeName('IS_ENABLE', data.miniSupportOther), getCodeName('IS_ENABLE', data.otherUploadProxy), getCodeName('IS_ENABLE', data.miniInfoShow), getCodeName('IS_ENABLE', data.changeOCRData))
  441. // 小程序是否支持他人办理
  442. if (getCodeName('IS_ENABLE', data.miniSupportOther) == '启用') {
  443. state.isEnableOther = true;
  444. } else {
  445. state.isEnableOther = false;
  446. }
  447. // 他人办理时是否上传委托书
  448. if (getCodeName('IS_ENABLE', data.otherUploadProxy) == '启用') {
  449. state.isEnableBook = true;
  450. } else {
  451. state.isEnableBook = false;
  452. }
  453. // 小程序信息带出
  454. if (getCodeName('IS_ENABLE', data.miniInfoShow) == '启用') {
  455. state.isEnableInfo = true;
  456. uni.showModal({
  457. // title: '提示',
  458. content: '是否允许带出用户信息',
  459. success: function (res) {
  460. if (res.confirm) {
  461. console.log('用户点击确定');
  462. queryUserMsg() //通过opneId查询用户信息
  463. } else if (res.cancel) {
  464. console.log('用户点击取消');
  465. }
  466. }
  467. });
  468. } else {
  469. state.isEnableInfo = false;
  470. }
  471. // 允许修改OCR识别出来的数据
  472. if (getCodeName('IS_ENABLE', data.changeOCRData) == '启用') {
  473. state.isEnableOCRData = false;
  474. } else {
  475. state.isEnableOCRData = true;
  476. }
  477. }
  478. // 通过opneId查询用户信息
  479. const queryUserMsg = () => {
  480. const options = {
  481. type: 2,
  482. data: {
  483. "openId": getItem('openId')
  484. },
  485. method: "POST",
  486. showLoading: true,
  487. };
  488. request(getUserMsg, options).then((res) => {
  489. console.log("通过opneId查询用户信息", stringToJson(res.bizContent))
  490. const data = stringToJson(res.bizContent);
  491. state.form.userPosImgUrl = data.customerPosImgUrl;
  492. state.form.userNegImgUrl = data.customerNegImgUrl;
  493. state.form.userName = data.customerName;
  494. state.form.userIdNum = data.customerIdNum;
  495. state.form.address = data.customerAddress;
  496. state.form.tel = data.customerTel;
  497. })
  498. }
  499. const takePhotoMode = (index, isMy) => {
  500. console.log("index", index, isMy)
  501. state.isTakePhotoModeShow = true
  502. state.choiceIndex = index
  503. state.isMy = isMy
  504. }
  505. const xiangce = (val) => {
  506. console.log("val", val)
  507. var imageType = val;
  508. uni.chooseImage({
  509. count: 1, //只能选取一张照片
  510. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  511. sourceType: ["album"], //从相册选择
  512. success: function (res) {
  513. compressImage(res.tempFilePaths[0], (res) => {
  514. console.log("过来了", res)
  515. // if (state.choiceIndex == 3 || state.choiceIndex == 4) {
  516. // state.showImg = false
  517. // state.images = res.tempFilePath
  518. // state.phoneType = state.choiceIndex
  519. // state.isTakePhotoModeShow = false
  520. // return
  521. // }
  522. state.showImg = false
  523. state.images = res.tempFilePath
  524. state.phoneType = state.choiceIndex
  525. state.isTakePhotoModeShow = false
  526. })
  527. console.log("tempFilePaths[0].startsWith('file://')", res.tempFilePaths[0], res.tempFilePaths[0].startsWith('file://'))
  528. },
  529. })
  530. }
  531. const takePhoto = (val) => {
  532. state.showImg = true
  533. console.log("拍照", val)
  534. state.phoneType = val;
  535. }
  536. const confirmReturn = (val) => {
  537. console.log("图片地址val", val)
  538. state.phoneType = 0
  539. state.isTakePhotoModeShow = false
  540. var imageType = state.choiceIndex;
  541. // uploadFile(val.tempImagePath, imageType, ocrAllQuery).then((data) => {
  542. uploadFile(val.tempImagePath, imageType, etcOcrCard).then((data) => {
  543. console.log("身份证上传", data)
  544. if (state.isMy == "my") {
  545. if (state.choiceIndex == "1") {
  546. state.form.userName = data.name;
  547. state.form.gender = data.gender;
  548. state.form.userIdNum = data.idno;
  549. state.form.userPosImgUrl = data.imageUrl;
  550. state.form.address = data.address;
  551. } else {
  552. state.form.customerIdVld = data.enddate;
  553. state.form.userNegImgUrl = data.imageUrl;
  554. }
  555. state.isTakePhotoModeShow = false
  556. } else {
  557. if (state.choiceIndex == "1") {
  558. state.form.agentName = data.name;
  559. state.form.agentGender = data.gender;
  560. state.form.agentIdNum = data.idno;
  561. state.form.agentPosImgUrl = data.imageUrl;
  562. state.form.agentAddress = data.address;
  563. } else {
  564. console.log("state.isMy", state.isMy, state.choiceIndex, state.choiceIndex == "1", data)
  565. state.form.agentIdVld = data.enddate;
  566. state.form.agentNegImgUrl = data.imageUrl;
  567. }
  568. state.isTakePhotoModeShow = false
  569. }
  570. })
  571. }
  572. const cancle = () => {
  573. state.isTakePhotoModeShow = false
  574. }
  575. const downAuthD = () => {
  576. uni.downloadFile({
  577. url: "https://qtzl.etcjz.cn/default-bucket/20240311/个人委托书.docx",
  578. filePath: uni.env.USER_DATA_PATH + '/' + '个人委托书.docx',
  579. success(res) {
  580. const filePath = res.filePath
  581. uni.openDocument({
  582. filePath: filePath,
  583. fileType: 'docx',
  584. showMenu: true, //关键点
  585. success: function (res) {
  586. // msg("成功查看协议详情");
  587. },
  588. fail: function (err) {
  589. msg("打开文档失败");
  590. }
  591. });
  592. },
  593. fail: function (err) {
  594. msg("下载文档失败");
  595. console.log("err", err)
  596. },
  597. complete(res) {
  598. }
  599. })
  600. }
  601. // 无感注册
  602. const registerRequest = () => {
  603. let data = {
  604. userType: "PERSONAL",
  605. idNum: state.form.userIdNum,
  606. idType: state.form.userIdType,
  607. mobile: state.form.tel,
  608. userName: state.form.userName,
  609. gender: state.form.gender == '男' ? 'MALE' : 'FEMALE',
  610. certifyChannel: "BAIDUOCR",
  611. address: state.form.address,
  612. agentIdNum: state.form.agentIdNum,
  613. agentIdType: state.form.agentIdType,
  614. agentName: state.form.agentName,
  615. department: "",
  616. userIdImgUrl: state.form.userPosImgUrl,
  617. userIdImgBase64: "",
  618. }
  619. const options = {
  620. type: 2,
  621. data: data,
  622. method: "POST",
  623. showLoading: true,
  624. };
  625. return new Promise(async (resolve, reject) => {
  626. const res = await request(register, options);
  627. const data = stringToJson(res.bizContent);
  628. resolve(data);
  629. }).catch((error) => {
  630. reject(error);
  631. });
  632. }
  633. </script>
  634. <style lang="scss" scoped>
  635. .title {
  636. font-size: 35rpx;
  637. font-family: Microsoft YaHei;
  638. font-weight: 400;
  639. color: #000000;
  640. line-height: 80rpx;
  641. margin-bottom: 10rpx;
  642. }
  643. .content-wrap {
  644. position: relative;
  645. margin-top: -50rpx;
  646. padding: 0rpx 30rpx;
  647. display: flex;
  648. .big {
  649. font-size: 30rpx;
  650. font-family: Microsoft YaHei;
  651. font-weight: 400;
  652. color: #333333;
  653. line-height: 24rpx;
  654. }
  655. .nomal {
  656. font-size: 26rpx;
  657. font-family: Microsoft YaHei;
  658. font-weight: 400;
  659. color: #666666;
  660. line-height: 24rpx;
  661. }
  662. .tip {
  663. margin-top: -5px;
  664. width: 117rpx;
  665. height: 16rpx;
  666. background: #00b38b;
  667. opacity: 0.3;
  668. }
  669. }
  670. .content {
  671. padding: 50rpx 30rpx 50rpx 30rpx;
  672. .action {
  673. padding-left: 20rpx;
  674. padding-right: 20rpx;
  675. padding-bottom: 30rpx;
  676. .button {
  677. height: 80rpx;
  678. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  679. border-radius: 40rpx;
  680. font-size: 32rpx;
  681. font-weight: 400;
  682. color: #ffffff;
  683. line-height: 80rpx;
  684. }
  685. }
  686. .item-tips {
  687. .title {
  688. font-size: 30rpx;
  689. font-family: Microsoft YaHei;
  690. font-weight: 400;
  691. color: #000000;
  692. line-height: 24rpx;
  693. }
  694. .tip {
  695. margin-top: 16rpx;
  696. font-size: 24rpx;
  697. font-family: Microsoft YaHei;
  698. font-weight: 400;
  699. color: #999999;
  700. line-height: 24rpx;
  701. }
  702. }
  703. .picture-wrapper {
  704. margin-top: 40rpx;
  705. .bg {
  706. background: #ffffff;
  707. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  708. border-radius: 20rpx;
  709. padding: 40rpx;
  710. display: flex;
  711. // align-items: center;
  712. justify-content: space-between;
  713. .name {
  714. font-size: 34rpx;
  715. font-family: Microsoft YaHei;
  716. font-weight: 400;
  717. color: #000000;
  718. line-height: 34rpx;
  719. }
  720. .value {
  721. margin-top: 20rpx;
  722. font-size: 24rpx;
  723. font-family: Microsoft YaHei;
  724. font-weight: 400;
  725. color: #999999;
  726. line-height: 24rpx;
  727. }
  728. .tip {
  729. margin-top: 20rpx;
  730. text-align: center;
  731. width: 110rpx;
  732. height: 40rpx;
  733. background: rgba(33, 190, 177, 0.2);
  734. border-radius: 6rpx;
  735. .tip-value {
  736. font-size: 20rpx;
  737. font-family: Microsoft YaHei;
  738. font-weight: 400;
  739. color: #0a8f8a;
  740. line-height: 40rpx;
  741. opacity: 1;
  742. }
  743. }
  744. }
  745. .icon {
  746. width: 294rpx;
  747. height: 188rpx;
  748. }
  749. }
  750. .shibie-wrapper {
  751. margin-top: 60rpx;
  752. .title {
  753. font-size: 30rpx;
  754. font-family: Microsoft YaHei;
  755. font-weight: 400;
  756. color: #000000;
  757. line-height: 30rpx;
  758. }
  759. }
  760. .buchong-wrapper {
  761. margin-top: 60rpx;
  762. .title {
  763. font-size: 30rpx;
  764. font-family: Microsoft YaHei;
  765. font-weight: 400;
  766. color: #000000;
  767. line-height: 30rpx;
  768. }
  769. }
  770. .green-tip {
  771. margin-top: 50rpx;
  772. font-size: 24rpx;
  773. font-family: Microsoft YaHei;
  774. font-weight: 400;
  775. color: #00b38b;
  776. line-height: 24rpx;
  777. margin-bottom: 60rpx;
  778. }
  779. }
  780. .choice-takePhoto {
  781. position: absolute;
  782. bottom: 0;
  783. background-color: white;
  784. width: 100%;
  785. border-radius: 20rpx 20rpx 0 0;
  786. }
  787. .choice-takePhoto>view:first-child {
  788. text-align: center;
  789. height: 80rpx;
  790. line-height: 80rpx;
  791. border-bottom: 1rpx solid rgba(127, 127, 127, 0.3);
  792. background-color: white;
  793. }
  794. .choice-takePhoto>view:last-child {
  795. text-align: center;
  796. height: 80rpx;
  797. line-height: 80rpx;
  798. border-top: 6rpx solid rgba(127, 127, 127, 0.1);
  799. background-color: white;
  800. }
  801. .choice-takePhoto>view {
  802. text-align: center;
  803. height: 80rpx;
  804. line-height: 80rpx;
  805. background-color: white;
  806. }
  807. .choice-takePhoto-wrap {
  808. width: 100%;
  809. height: 100vh;
  810. background-color: rgba(127, 127, 127, 0.2);
  811. position: fixed;
  812. left: 0;
  813. top: 0;
  814. z-index: 11111;
  815. }
  816. .down {
  817. background-color: rgba(33, 190, 177, 0.2);
  818. color: #0a8f8a;
  819. border-radius: 10rpx;
  820. padding: 6rpx 10rpx;
  821. font-size: 28rpx;
  822. margin-top: 10rpx;
  823. width: 48%;
  824. }
  825. </style>