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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659
  1. <template>
  2. <navBar title="ETC开户新办申请-个人"></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="">
  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="cardImageOcr('1')">
  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="cardImageOcr('2')">
  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="200" :model="state.form" ref="uForm">
  50. <u-form-item label="姓名">
  51. <u-input v-model="state.form.userName" placeholder='请输入姓名' />
  52. </u-form-item>
  53. <u-form-item label="性别">
  54. <u-input placeholder='请选择性别' v-model="state.form.gender" @click="userGenderAction()"
  55. type="select" />
  56. </u-form-item>
  57. <u-form-item label="身份证号">
  58. <u-input placeholder='请输入身份证' type="idcard" v-model="state.form.userIdNum" />
  59. </u-form-item>
  60. <u-form-item label="地址">
  61. <u-input placeholder='请输入地址' height='38' type='textarea' :autoHeight='true'
  62. v-model="state.form.address" />
  63. </u-form-item>
  64. <!-- <u-form-item label="证件有效期">
  65. <u-input v-model="state.form.begindate" type="select" />
  66. </u-form-item> -->
  67. <u-form-item label="联系方式">
  68. <u-input placeholder='请输入联系方式' type="number" v-model="state.form.tel" />
  69. </u-form-item>
  70. </u-form>
  71. </view>
  72. <view class="green-tip">
  73. 如识别信息有误,请手动修改,确认无误后,点击下一步!
  74. </view>
  75. <view class="action">
  76. <button type="default" class="button" @click="savaHandle()">
  77. 下一步
  78. </button>
  79. </view>
  80. </view>
  81. <view v-else class="content">
  82. <view class="title"> 车主信息 </view>
  83. <view class="item-tips">
  84. <view class="title"> 上传后请核对识别信息 </view>
  85. <view class="tip"> 如有错误请及时手动修改 </view>
  86. </view>
  87. <view class="picture-wrapper" @click="cardImageOcr('1')">
  88. <view class="bg">
  89. <view class="">
  90. <view class="name"> 人像面 </view>
  91. <view class="value"> 上传身份证的人像面 </view>
  92. <view class="tip">
  93. <view class="tip-value"> 拍摄规范 </view>
  94. </view>
  95. </view>
  96. <image v-if="!state.form.userPosImgUrl" class="icon" :src="`${$imgUrl}applyCard/renxiang.png`">
  97. </image>
  98. <image v-else class="icon" :src="state.form.userPosImgUrl"></image>
  99. </view>
  100. </view>
  101. <view class="picture-wrapper" @click="cardImageOcr('2')">
  102. <view class="bg">
  103. <view class="">
  104. <view class="name"> 国徽面 </view>
  105. <view class="value"> 上传身份证的国徽面 </view>
  106. <view class="tip">
  107. <view class="tip-value"> 拍摄规范 </view>
  108. </view>
  109. </view>
  110. <image v-if="!state.form.userNegImgUrl" class="icon" :src="`${$imgUrl}applyCard/guohui.png`">
  111. </image>
  112. <image v-else class="icon" :src="state.form.userNegImgUrl"></image>
  113. </view>
  114. </view>
  115. <view class="shibie-wrapper">
  116. <view class="title"> 识别内容如下 </view>
  117. <u-form label-width="200" :model="state.form" ref="uForm">
  118. <u-form-item label="姓名">
  119. <u-input inputAlign="right" placeholder='请输入姓名' v-model="state.form.userName" />
  120. </u-form-item>
  121. <u-form-item label="性别">
  122. <u-input inputAlign="right" placeholder='请选择性别' v-model="state.form.gender" type="select" />
  123. </u-form-item>
  124. <u-form-item label="身份证号">
  125. <u-input inputAlign="right" placeholder='请输入身份证号' v-model="state.form.userIdNum" />
  126. </u-form-item>
  127. <!-- <u-form-item label="">
  128. <u-input v-model="state.form.userIdNum" />
  129. </u-form-item> -->
  130. <!-- <u-form-item label="证件有效期">
  131. <u-input v-model="state.form.begindate" type="select" />
  132. </u-form-item> -->
  133. <u-form-item label="联系方式">
  134. <u-input inputAlign="right" placeholder='请输入联系方式' v-model="state.form.tel" />
  135. </u-form-item>
  136. </u-form>
  137. </view>
  138. <view style="margin-top: 30rpx" class="title"> 代办人信息 </view>
  139. <view class="item-tips">
  140. <view class="title"> 上传后请核对识别信息 </view>
  141. <view class="tip"> 如有错误请及时手动修改 </view>
  142. </view>
  143. <view class="picture-wrapper" @click="cardDbImageOcr('1')">
  144. <view class="bg">
  145. <view class="">
  146. <view class="name"> 人像面 </view>
  147. <view class="value"> 上传身份证的人像面 </view>
  148. <view class="tip">
  149. <view class="tip-value"> 拍摄规范 </view>
  150. </view>
  151. </view>
  152. <image v-if="!state.form.agentPosImgUrl" class="icon" :src="`${$imgUrl}applyCard/renxiang.png`">
  153. </image>
  154. <image v-else class="icon" :src="state.form.agentPosImgUrl"></image>
  155. </view>
  156. </view>
  157. <view class="picture-wrapper" @click="cardDbImageOcr('2')">
  158. <view class="bg">
  159. <view class="">
  160. <view class="name"> 国徽面 </view>
  161. <view class="value"> 上传身份证的国徽面 </view>
  162. <view class="tip">
  163. <view class="tip-value"> 拍摄规范 </view>
  164. </view>
  165. </view>
  166. <image v-if="!state.form.agentNegImgUrl" class="icon" :src="`${$imgUrl}applyCard/guohui.png`">
  167. </image>
  168. <image v-else class="icon" :src="state.form.agentNegImgUrl"></image>
  169. </view>
  170. </view>
  171. <view class="picture-wrapper" @click="cardFileImageUpdate()">
  172. <view class="bg">
  173. <view class="">
  174. <view class="name"> 委托书 </view>
  175. <view class="value"> 上传文字清晰的委托书 </view>
  176. <view class="tip">
  177. <view class="tip-value"> 拍摄规范 </view>
  178. </view>
  179. </view>
  180. <image v-if="!state.form.proxyUrl" class="icon" :src="`${$imgUrl}applyCard/weituoshu.png`">
  181. </image>
  182. <image v-else class="icon" :src="state.form.proxyUrl"></image>
  183. </view>
  184. </view>
  185. <view class="shibie-wrapper">
  186. <view class="title"> 识别内容如下 </view>
  187. <u-form label-width="200" :model="state.form" ref="uForm">
  188. <u-form-item label="经办人姓名">
  189. <u-input inputAlign="right" placeholder='请输入经办人姓名' v-model="state.form.agentName" />
  190. </u-form-item>
  191. <!-- <u-form-item label="性别">
  192. <u-input v-model="state.form.agentGender" type="select" />
  193. </u-form-item> -->
  194. <u-form-item label="身份证号">
  195. <u-input inputAlign="right" placeholder='请输入身份证号' v-model="state.form.agentIdNum" />
  196. </u-form-item>
  197. <!-- <u-form-item label="证件有效期">
  198. <u-input v-model="state.form.begindate" type="select" />
  199. </u-form-item> -->
  200. <u-form-item label="联系方式">
  201. <u-input inputAlign="right" placeholder='请输入联系方式' v-model="state.form.agentTel" />
  202. </u-form-item>
  203. </u-form>
  204. </view>
  205. <view class="green-tip">
  206. 如识别信息有误,请手动修改,确认无误后,点击下一步!
  207. </view>
  208. <view class="action">
  209. <button type="default" class="button" @click="savaHandle()">
  210. 下一步
  211. </button>
  212. </view>
  213. </view>
  214. <u-select mode="single-column" :list="state.genderList" v-model="state.genderShow" @confirm="genderSelectConfirm">
  215. </u-select>
  216. </template>
  217. <script setup lang="ts">
  218. import navBgCar from "./components/nav-bg-car3";
  219. import {
  220. pathToBase64
  221. } from "@/utils/image-tools/index.js";
  222. import {
  223. reactive
  224. } from "vue";
  225. import {
  226. msg,
  227. checkStr
  228. } from "@/utils/utils";
  229. import {
  230. onLoad,
  231. onShow
  232. } from "@dcloudio/uni-app";
  233. import {
  234. etcOcrCard,
  235. etcUserCardInfoSubmit,
  236. fileUpload,
  237. } from "@/utils/network/api.js";
  238. import {
  239. request
  240. } from "@/utils/network/request.js";
  241. import {
  242. stringToJson
  243. } from "@/utils/network/encryption";
  244. import navBar from "../components/nav-bar/nav-bar2.vue";
  245. const state = reactive({
  246. genderList: [{
  247. value: '男',
  248. label: '男'
  249. },
  250. {
  251. value: '女',
  252. label: '女'
  253. }
  254. ],
  255. form: {
  256. orderId: "", //订单ID
  257. userName: "", //开户人姓名
  258. userIdType: "101", //用户证件类型 101//身份证
  259. userIdNum: "", //用户证件号码
  260. userPosImgUrl: "", //身份证正面
  261. userNegImgUrl: "", //身份证反面
  262. tel: "", //开户人手机号
  263. address: "", //开户人地址
  264. sceneType: "", //用户协议支撑服务场景(发行服务机构和用户签订的协议)
  265. channelId: "", //渠道id
  266. gender: "",
  267. customerIdVld: "",
  268. agentName: "",
  269. agentGender: "",
  270. agentTel: '',
  271. agentPhone: "",
  272. agentIdType: "101",
  273. agentIdNum: "",
  274. agentPosImgUrl: "",
  275. agentNegImgUrl: "",
  276. proxyUrl: "",
  277. agentAddress: "",
  278. agentIdVld: '',
  279. },
  280. genderShow: false,
  281. orderId: "",
  282. vehiclePlateColor: undefined,
  283. isMyPeopple: true,
  284. });
  285. const userGenderAction = () => {
  286. state.genderShow = true;
  287. };
  288. const genderSelectConfirm = (e) => {
  289. state.form.gender = ''
  290. e.map((val, index) => {
  291. state.form.gender = val.label;
  292. })
  293. };
  294. const savaHandle = () => {
  295. if (!checkStr(state.form.userIdNum, 'card')) {
  296. msg('请输入正确身份证');
  297. return;
  298. }
  299. if (!checkStr(state.form.tel, 'mobile')) {
  300. msg('请输入正确手机号');
  301. return;
  302. }
  303. var data = state.form;
  304. const options = {
  305. type: 2,
  306. data: data,
  307. method: "POST",
  308. showLoading: true,
  309. };
  310. request(etcUserCardInfoSubmit, options).then((res) => {
  311. const data = stringToJson(res.bizContent);
  312. uni.navigateTo({
  313. url: `/applyCard/car-release?orderId=${state.orderId}&vehiclePlateColor=${state.vehiclePlateColor}`,
  314. });
  315. });
  316. };
  317. const cardFileImageUpdate = () => {
  318. uni.chooseImage({
  319. count: 1, //只能选取一张照片
  320. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  321. sourceType: ["camera", "album"], //从相册选择
  322. success: function(res) {
  323. pathToBase64(res.tempFilePaths[0])
  324. .then((path) => {
  325. var data = {
  326. fileBase64: path,
  327. };
  328. const options = {
  329. type: 2,
  330. data: data,
  331. method: "POST",
  332. showLoading: true,
  333. };
  334. request(fileUpload, options).then((res) => {
  335. const data = stringToJson(res.bizContent);
  336. console.log(data);
  337. state.form.proxyUrl = data.data.url;
  338. });
  339. })
  340. .catch((error) => {});
  341. },
  342. });
  343. };
  344. //tab切换
  345. const tabChange = (val: any) => {
  346. if (val) {
  347. state.isMyPeopple = true;
  348. } else {
  349. state.isMyPeopple = false;
  350. }
  351. state.form = {
  352. orderId: state.orderId, //订单ID
  353. userName: "", //开户人姓名
  354. userIdType: "101", //用户证件类型 101//身份证
  355. userIdNum: "", //用户证件号码
  356. userPosImgUrl: "", //身份证正面
  357. userNegImgUrl: "", //身份证反面
  358. tel: "", //开户人手机号
  359. address: "", //开户人地址
  360. sceneType: "", //用户协议支撑服务场景(发行服务机构和用户签订的协议)
  361. channelId: "", //渠道id
  362. gender: "",
  363. customerIdVld: "",
  364. agentName: "",
  365. agentGender: "",
  366. agentTel: '',
  367. agentPhone: "",
  368. agentIdType: "101",
  369. agentIdNum: "",
  370. agentPosImgUrl: "",
  371. agentNegImgUrl: "",
  372. proxyUrl: "",
  373. agentAddress: "",
  374. agentIdVld: '',
  375. };
  376. };
  377. onLoad((option: any) => {
  378. state.form.orderId = option.orderId;
  379. state.orderId = option.orderId;
  380. state.vehiclePlateColor = option.vehiclePlateColor;
  381. //state.fromOrder = option.fromOrder //是否来自订单-修改资料
  382. });
  383. const cardDbImageOcr = (val: any) => {
  384. var imageType = val;
  385. uni.chooseImage({
  386. count: 1, //只能选取一张照片
  387. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  388. sourceType: ["camera", "album"], //从相册选择
  389. success: function(res) {
  390. pathToBase64(res.tempFilePaths[0])
  391. .then((path) => {
  392. var data = {
  393. source: "1",
  394. agencyId: "52010106004",
  395. imageType: imageType,
  396. fileName: res.tempFilePaths[0],
  397. imageBase64: path,
  398. };
  399. const options = {
  400. type: 2,
  401. data: data,
  402. method: "POST",
  403. showLoading: true,
  404. };
  405. request(etcOcrCard, options).then((res) => {
  406. const data = stringToJson(res.bizContent);
  407. if (val === "1") {
  408. state.form.agentName = data.name;
  409. state.form.agentGender = data.gender;
  410. state.form.agentIdNum = data.idno;
  411. state.form.agentPosImgUrl = data.imageUrl;
  412. state.form.agentAddress = data.address;
  413. } else {
  414. state.form.agentIdVld = data.enddate;
  415. state.form.agentNegImgUrl = data.imageUrl;
  416. }
  417. });
  418. })
  419. .catch((error) => {});
  420. },
  421. });
  422. };
  423. //orc接口调用
  424. const cardImageOcr = (val: any) => {
  425. console.log("点击了");
  426. var imageType = val;
  427. uni.chooseImage({
  428. count: 1, //只能选取一张照片
  429. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  430. sourceType: ["camera", "album"], //从相册选择
  431. success: function(res) {
  432. pathToBase64(res.tempFilePaths[0])
  433. .then((path) => {
  434. console.log(path);
  435. console.log("哈哈哈");
  436. var data = {
  437. source: "1",
  438. agencyId: "52010106004",
  439. imageType: imageType,
  440. fileName: res.tempFilePaths[0],
  441. imageBase64: path,
  442. };
  443. const options = {
  444. type: 2,
  445. data: data,
  446. method: "POST",
  447. showLoading: true,
  448. };
  449. request(etcOcrCard, options).then((res) => {
  450. const data = stringToJson(res.bizContent);
  451. if (val === "1") {
  452. state.form.userName = data.name;
  453. state.form.gender = data.gender;
  454. state.form.userIdNum = data.idno;
  455. state.form.userPosImgUrl = data.imageUrl;
  456. state.form.address = data.address;
  457. } else {
  458. state.form.customerIdVld = data.enddate;
  459. state.form.userNegImgUrl = data.imageUrl;
  460. }
  461. });
  462. })
  463. .catch((error) => {});
  464. },
  465. });
  466. };
  467. //替换图片地址
  468. const strReplace = (str: string) => {
  469. return str.replace('192.168.101.145:9000', '222.85.144.89:19002')
  470. }
  471. </script>
  472. <style lang="scss" scoped>
  473. .title {
  474. font-size: 35rpx;
  475. font-family: Microsoft YaHei;
  476. font-weight: 400;
  477. color: #000000;
  478. line-height: 80rpx;
  479. margin-bottom: 10rpx;
  480. }
  481. .content-wrap {
  482. position: relative;
  483. margin-top: -50rpx;
  484. padding: 0rpx 30rpx;
  485. display: flex;
  486. .big {
  487. font-size: 30rpx;
  488. font-family: Microsoft YaHei;
  489. font-weight: 400;
  490. color: #333333;
  491. line-height: 24rpx;
  492. }
  493. .nomal {
  494. font-size: 26rpx;
  495. font-family: Microsoft YaHei;
  496. font-weight: 400;
  497. color: #666666;
  498. line-height: 24rpx;
  499. }
  500. .tip {
  501. margin-top: -5px;
  502. width: 117rpx;
  503. height: 16rpx;
  504. background: #00b38b;
  505. opacity: 0.3;
  506. }
  507. }
  508. .content {
  509. padding: 50rpx 30rpx 50rpx 30rpx;
  510. .action {
  511. padding-left: 20rpx;
  512. padding-right: 20rpx;
  513. padding-bottom: 30rpx;
  514. .button {
  515. height: 80rpx;
  516. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  517. border-radius: 40rpx;
  518. font-size: 32rpx;
  519. font-weight: 400;
  520. color: #ffffff;
  521. line-height: 80rpx;
  522. }
  523. }
  524. .item-tips {
  525. .title {
  526. font-size: 30rpx;
  527. font-family: Microsoft YaHei;
  528. font-weight: 400;
  529. color: #000000;
  530. line-height: 24rpx;
  531. }
  532. .tip {
  533. margin-top: 16rpx;
  534. font-size: 24rpx;
  535. font-family: Microsoft YaHei;
  536. font-weight: 400;
  537. color: #999999;
  538. line-height: 24rpx;
  539. }
  540. }
  541. .picture-wrapper {
  542. margin-top: 40rpx;
  543. .bg {
  544. background: #ffffff;
  545. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  546. border-radius: 20rpx;
  547. padding: 40rpx;
  548. display: flex;
  549. // align-items: center;
  550. justify-content: space-between;
  551. .name {
  552. font-size: 34rpx;
  553. font-family: Microsoft YaHei;
  554. font-weight: 400;
  555. color: #000000;
  556. line-height: 34rpx;
  557. }
  558. .value {
  559. margin-top: 20rpx;
  560. font-size: 24rpx;
  561. font-family: Microsoft YaHei;
  562. font-weight: 400;
  563. color: #999999;
  564. line-height: 24rpx;
  565. }
  566. .tip {
  567. margin-top: 20rpx;
  568. text-align: center;
  569. width: 110rpx;
  570. height: 40rpx;
  571. background: rgba(33, 190, 177, 0.2);
  572. border-radius: 6rpx;
  573. .tip-value {
  574. font-size: 20rpx;
  575. font-family: Microsoft YaHei;
  576. font-weight: 400;
  577. color: #0a8f8a;
  578. line-height: 40rpx;
  579. opacity: 1;
  580. }
  581. }
  582. }
  583. .icon {
  584. width: 294rpx;
  585. height: 188rpx;
  586. }
  587. }
  588. .shibie-wrapper {
  589. margin-top: 60rpx;
  590. .title {
  591. font-size: 30rpx;
  592. font-family: Microsoft YaHei;
  593. font-weight: 400;
  594. color: #000000;
  595. line-height: 30rpx;
  596. }
  597. }
  598. .buchong-wrapper {
  599. margin-top: 60rpx;
  600. .title {
  601. font-size: 30rpx;
  602. font-family: Microsoft YaHei;
  603. font-weight: 400;
  604. color: #000000;
  605. line-height: 30rpx;
  606. }
  607. }
  608. .green-tip {
  609. margin-top: 50rpx;
  610. font-size: 24rpx;
  611. font-family: Microsoft YaHei;
  612. font-weight: 400;
  613. color: #00b38b;
  614. line-height: 24rpx;
  615. margin-bottom: 60rpx;
  616. }
  617. }
  618. </style>