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

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