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 27KB

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