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

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