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

opening-account-people.vue 24KB

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