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

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 v-model="state.form.userName" />
  120. </u-form-item>
  121. <u-form-item label="性别">
  122. <u-input v-model="state.form.gender" type="select" />
  123. </u-form-item>
  124. <u-form-item label="身份证号">
  125. <u-input 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 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 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 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 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-car2";
  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. agentIdType: "101",
  367. agentIdNum: "",
  368. agentPosImgUrl: "",
  369. agentNegImgUrl: "",
  370. proxyUrl: "",
  371. agentAddress: "",
  372. agentIdVld: ''
  373. };
  374. };
  375. onLoad((option: any) => {
  376. state.form.orderId = option.orderId;
  377. state.orderId = option.orderId;
  378. state.vehiclePlateColor = option.vehiclePlateColor;
  379. //state.fromOrder = option.fromOrder //是否来自订单-修改资料
  380. });
  381. const cardDbImageOcr = (val: any) => {
  382. var imageType = val;
  383. uni.chooseImage({
  384. count: 1, //只能选取一张照片
  385. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  386. sourceType: ["camera", "album"], //从相册选择
  387. success: function(res) {
  388. pathToBase64(res.tempFilePaths[0])
  389. .then((path) => {
  390. var data = {
  391. source: "1",
  392. agencyId: "52010106004",
  393. imageType: imageType,
  394. fileName: res.tempFilePaths[0],
  395. imageBase64: path,
  396. };
  397. const options = {
  398. type: 2,
  399. data: data,
  400. method: "POST",
  401. showLoading: true,
  402. };
  403. request(etcOcrCard, options).then((res) => {
  404. const data = stringToJson(res.bizContent);
  405. if (val === "1") {
  406. state.form.agentName = data.name;
  407. state.form.agentGender = data.gender;
  408. state.form.agentIdNum = data.idno;
  409. state.form.agentPosImgUrl = data.imageUrl;
  410. state.form.agentAddress = data.address;
  411. } else {
  412. state.form.agentIdVld = data.enddate;
  413. state.form.agentNegImgUrl = data.imageUrl;
  414. }
  415. });
  416. })
  417. .catch((error) => {});
  418. },
  419. });
  420. };
  421. //orc接口调用
  422. const cardImageOcr = (val: any) => {
  423. console.log("点击了");
  424. var imageType = val;
  425. uni.chooseImage({
  426. count: 1, //只能选取一张照片
  427. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  428. sourceType: ["camera", "album"], //从相册选择
  429. success: function(res) {
  430. console.log(res);
  431. pathToBase64(res.tempFilePaths[0])
  432. .then((path) => {
  433. console.log(path);
  434. console.log("哈哈哈");
  435. var data = {
  436. source: "1",
  437. agencyId: "52010106004",
  438. imageType: imageType,
  439. fileName: res.tempFilePaths[0],
  440. imageBase64: path,
  441. };
  442. const options = {
  443. type: 2,
  444. data: data,
  445. method: "POST",
  446. showLoading: true,
  447. };
  448. request(etcOcrCard, options).then((res) => {
  449. const data = stringToJson(res.bizContent);
  450. if (val === "1") {
  451. state.form.userName = data.name;
  452. state.form.gender = data.gender;
  453. state.form.userIdNum = data.idno;
  454. state.form.userPosImgUrl = data.imageUrl;
  455. state.form.address = data.address;
  456. } else {
  457. state.form.customerIdVld = data.enddate;
  458. state.form.userNegImgUrl = data.imageUrl;
  459. }
  460. });
  461. })
  462. .catch((error) => {});
  463. },
  464. });
  465. };
  466. //替换图片地址
  467. const strReplace = (str:string)=>{
  468. return str.replace('192.168.101.145:9000','222.85.144.89:19002')
  469. }
  470. </script>
  471. <style lang="scss" scoped>
  472. .title {
  473. font-size: 35rpx;
  474. font-family: Microsoft YaHei;
  475. font-weight: 400;
  476. color: #000000;
  477. line-height: 80rpx;
  478. margin-bottom: 10rpx;
  479. }
  480. .content-wrap {
  481. position: relative;
  482. margin-top: -50rpx;
  483. padding: 0rpx 30rpx;
  484. display: flex;
  485. .big {
  486. font-size: 30rpx;
  487. font-family: Microsoft YaHei;
  488. font-weight: 400;
  489. color: #333333;
  490. line-height: 24rpx;
  491. }
  492. .nomal {
  493. font-size: 26rpx;
  494. font-family: Microsoft YaHei;
  495. font-weight: 400;
  496. color: #666666;
  497. line-height: 24rpx;
  498. }
  499. .tip {
  500. margin-top: -5px;
  501. width: 117rpx;
  502. height: 16rpx;
  503. background: #00b38b;
  504. opacity: 0.3;
  505. }
  506. }
  507. .content {
  508. padding: 50rpx 30rpx 50rpx 30rpx;
  509. .action {
  510. padding-left: 20rpx;
  511. padding-right: 20rpx;
  512. padding-bottom: 30rpx;
  513. .button {
  514. height: 80rpx;
  515. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  516. border-radius: 40rpx;
  517. font-size: 32rpx;
  518. font-weight: 400;
  519. color: #ffffff;
  520. line-height: 80rpx;
  521. }
  522. }
  523. .item-tips {
  524. .title {
  525. font-size: 30rpx;
  526. font-family: Microsoft YaHei;
  527. font-weight: 400;
  528. color: #000000;
  529. line-height: 24rpx;
  530. }
  531. .tip {
  532. margin-top: 16rpx;
  533. font-size: 24rpx;
  534. font-family: Microsoft YaHei;
  535. font-weight: 400;
  536. color: #999999;
  537. line-height: 24rpx;
  538. }
  539. }
  540. .picture-wrapper {
  541. margin-top: 40rpx;
  542. .bg {
  543. background: #ffffff;
  544. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  545. border-radius: 20rpx;
  546. padding: 40rpx;
  547. display: flex;
  548. // align-items: center;
  549. justify-content: space-between;
  550. .name {
  551. font-size: 34rpx;
  552. font-family: Microsoft YaHei;
  553. font-weight: 400;
  554. color: #000000;
  555. line-height: 34rpx;
  556. }
  557. .value {
  558. margin-top: 20rpx;
  559. font-size: 24rpx;
  560. font-family: Microsoft YaHei;
  561. font-weight: 400;
  562. color: #999999;
  563. line-height: 24rpx;
  564. }
  565. .tip {
  566. margin-top: 20rpx;
  567. text-align: center;
  568. width: 110rpx;
  569. height: 40rpx;
  570. background: rgba(33, 190, 177, 0.2);
  571. border-radius: 6rpx;
  572. .tip-value {
  573. font-size: 20rpx;
  574. font-family: Microsoft YaHei;
  575. font-weight: 400;
  576. color: #0a8f8a;
  577. line-height: 40rpx;
  578. opacity: 1;
  579. }
  580. }
  581. }
  582. .icon {
  583. width: 294rpx;
  584. height: 188rpx;
  585. }
  586. }
  587. .shibie-wrapper {
  588. margin-top: 60rpx;
  589. .title {
  590. font-size: 30rpx;
  591. font-family: Microsoft YaHei;
  592. font-weight: 400;
  593. color: #000000;
  594. line-height: 30rpx;
  595. }
  596. }
  597. .buchong-wrapper {
  598. margin-top: 60rpx;
  599. .title {
  600. font-size: 30rpx;
  601. font-family: Microsoft YaHei;
  602. font-weight: 400;
  603. color: #000000;
  604. line-height: 30rpx;
  605. }
  606. }
  607. .green-tip {
  608. margin-top: 50rpx;
  609. font-size: 24rpx;
  610. font-family: Microsoft YaHei;
  611. font-weight: 400;
  612. color: #00b38b;
  613. line-height: 24rpx;
  614. margin-bottom: 60rpx;
  615. }
  616. }
  617. </style>