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-unit.vue 13KB

2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
2 yıl önce
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522
  1. <template>
  2. <navBar title="ETC开户新办申请-单位" :scrollTop="scrollTop"></navBar>
  3. <navBgCar></navBgCar>
  4. <view class="content-wrap">
  5. <view class="item-tips">
  6. <view class="title"> 上传后请核对识别信息 </view>
  7. <view class="tip"> 如有错误请及时手动修改 </view>
  8. </view>
  9. <view class="picture-wrapper" @click="cardImageOcrYY()">
  10. <view class="bg">
  11. <view class="">
  12. <view class="name"> 营业执照 </view>
  13. <view class="value"> 上传企业的营业执照 </view>
  14. <view class="tip">
  15. <view class="tip-value"> 拍摄规范 </view>
  16. </view>
  17. </view>
  18. <image v-if="!state.form.posImgUrl" class="icon" :src="`${$imgUrl}applyCard/zhizhao.png`">
  19. </image>
  20. <image v-else class="icon" :src="strReplace(state.form.posImgUrl)"></image>
  21. </view>
  22. </view>
  23. <view class="picture-wrapper" @click="cardImageOcr('1')">
  24. <view class="bg">
  25. <view class="">
  26. <view class="name"> 人像面 </view>
  27. <view class="value"> 上传身份证的人像面 </view>
  28. <view class="tip">
  29. <view class="tip-value"> 拍摄规范 </view>
  30. </view>
  31. </view>
  32. <image v-if="!state.form.agentPosImgUrl" class="icon" :src="`${$imgUrl}applyCard/renxiang.png`">
  33. </image>
  34. <image v-else class="icon" :src="strReplace(state.form.agentPosImgUrl)"></image>
  35. </view>
  36. </view>
  37. <view class="picture-wrapper" @click="cardImageOcr('2')">
  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.agentNegImgUrl" class="icon" :src="`${$imgUrl}applyCard/guohui.png`">
  47. </image>
  48. <image v-else class="icon" :src="strReplace(state.form.agentNegImgUrl)"></image>
  49. </view>
  50. </view>
  51. <view class="picture-wrapper" @click="cardFileImageUpdate()">
  52. <view class="bg">
  53. <view class="">
  54. <view class="name"> 委托书 </view>
  55. <view class="value"> 上传文字清晰的委托书 </view>
  56. <view class="tip">
  57. <view class="tip-value"> 拍摄规范 </view>
  58. </view>
  59. </view>
  60. <image v-if="!state.form.proxyUrl" class="icon" :src="`${$imgUrl}applyCard/weituoshu.png`">
  61. </image>
  62. <image v-else class="icon" :src="strReplace(state.form.proxyUrl)"></image>
  63. </view>
  64. </view>
  65. <view class="shibie-wrapper">
  66. <view class="title"> 识别内容如下 </view>
  67. <u-form label-width="200" :model="state.form" ref="uForm">
  68. <u-form-item label="公司名称">
  69. <u-input inputAlign="right" placeholder='请输入公司名称' v-model="state.form.userName" />
  70. </u-form-item>
  71. <u-form-item label="部门名称">
  72. <u-input inputAlign="right" placeholder='请输入部门名称' v-model="state.form.department" />
  73. </u-form-item>
  74. <u-form-item label="社会信用代码">
  75. <u-input inputAlign="right" placeholder='请输入社会信用代码' v-model="state.form.userIdNum" />
  76. </u-form-item>
  77. <u-form-item label="经办人姓名">
  78. <u-input inputAlign="right" placeholder='请输入经办人姓名' v-model="state.form.agentName" />
  79. </u-form-item>
  80. <u-form-item label="经办人身份证号">
  81. <u-input inputAlign="right" placeholder='请输入经办人身份证号' v-model="state.form.agentIdNum" />
  82. </u-form-item>
  83. <u-form-item label="经办人联系方式">
  84. <u-input inputAlign="right" placeholder='请输入经办人联系方式' v-model="state.form.tel" />
  85. </u-form-item>
  86. </u-form>
  87. </view>
  88. <view class="green-tip">
  89. 如识别信息有误,请手动修改,确认无误后,点击下一步!
  90. </view>
  91. <view class="action">
  92. <button type="default" class="button" @click="savaHandle()">
  93. 下一步
  94. </button>
  95. </view>
  96. </view>
  97. </template>
  98. <script setup lang="ts">
  99. import {
  100. reactive, ref
  101. } from "vue";
  102. import navBgCar from "./components/nav-bg-car3";
  103. import navBar from "@/components/nav-bar/nav-bar2.vue";
  104. import {
  105. pathToBase64
  106. } from "@/utils/image-tools/index.js";
  107. import {
  108. ocrAllQuery,
  109. fileUpload,
  110. etcOcrCard,
  111. etcCompanyCardInfoSubmit,
  112. register,
  113. } from "@/utils/network/api.js";
  114. import {
  115. request
  116. } from "@/utils/network/request.js";
  117. import {
  118. stringToJson
  119. } from "@/utils/network/encryption";
  120. import {
  121. onLoad,
  122. onPageScroll,
  123. } from "@dcloudio/uni-app";
  124. import {
  125. setItem,
  126. getItem,
  127. } from "@/utils/storage";
  128. import {
  129. msg,
  130. checkStr
  131. } from "@/utils/utils";
  132. const scrollTop =ref(0);//滚动距离
  133. const state = reactive({
  134. form: {
  135. orderId: "", //订单ID
  136. //营业执照信息
  137. userName: "", //开户名称/账户名称
  138. userIdType: "203", //用户证件类型 203//营业执照
  139. userIdNum: "", //营业执照号码
  140. posImgUrl: "", //营业执照证明
  141. department: '本部', //不超过50个字符,若单位仅开一个账户,填写“本部”
  142. address: "", //单位地址
  143. //经办人信息
  144. agentName: "",
  145. agentIdType: "101",
  146. agentIdNum: "",
  147. agentAddress: "",
  148. agentPhone: "",
  149. agentIdVld: '',
  150. tel: '',
  151. agentGender: '',
  152. agentPosImgUrl: "",
  153. agentNegImgUrl: "",
  154. proxyUrl: "",
  155. sceneType: "", //用户协议支撑服务场景(发行服务机构和用户签订的协议)
  156. channelId: "", //渠道id
  157. opId: '',
  158. orderSource: 'WECHAT',
  159. },
  160. orderId: "",
  161. vehiclePlateColor: '',
  162. isSign:''
  163. });
  164. const savaHandle = () => {
  165. if (state.form.agentGender === '男') {
  166. state.form.agentGender = 'MAN'
  167. } else {
  168. state.form.agentGender = 'WOMAN'
  169. }
  170. if (!checkStr(state.form.agentIdNum, 'card')) {
  171. msg('请输入正确身份证');
  172. return;
  173. }
  174. if (!checkStr(state.form.tel, 'mobile')) {
  175. msg('请输入正确手机号');
  176. return;
  177. }
  178. //如果未登录||新用户
  179. // if (!getItem('openId')) {
  180. let data = {
  181. userType: "ENTERPRISE",
  182. idNum: state.form.userIdNum,
  183. idType: state.form.userIdType,
  184. mobile: state.form.tel,
  185. name: state.form.userName,
  186. gender: 'UNKOWN',
  187. certifyChannel: "BAIDUOCR",
  188. address: state.form.address,
  189. agentIdNum: state.form.agentIdNum,
  190. agentIdType: state.form.agentIdType,
  191. agentName: state.form.agentName,
  192. department: state.form.department,
  193. userIdImgUrl: state.form.posImgUrl,
  194. userIdImgBase64: "",
  195. }
  196. const options = {
  197. type: 2,
  198. data: data,
  199. method: "POST",
  200. showLoading: true,
  201. };
  202. request(register, options).then((res) => {
  203. let result = stringToJson(res.bizContent);
  204. if (result.accessToken && result.openId) {
  205. setItem('token', result.accessToken)
  206. setItem('openId', result.openId)
  207. state.form.opId = result.openId;
  208. let data = state.form;
  209. const options = {
  210. type: 2,
  211. data: data,
  212. method: "POST",
  213. showLoading: true,
  214. };
  215. request(etcCompanyCardInfoSubmit, options).then((res) => {
  216. // let result = stringToJson(res.bizContent);
  217. console.log(res);
  218. uni.redirectTo({
  219. url: `/subpackage/applyCard/car-release?orderId=${state.orderId}&vehiclePlateColor=${state.vehiclePlateColor}&type=1&isSign=${state.isSign}`,
  220. });
  221. });
  222. }
  223. })
  224. // }else{
  225. // var data = state.form;
  226. // const options = {
  227. // type: 2,
  228. // data: data,
  229. // method: "POST",
  230. // showLoading: true,
  231. // };
  232. // request(etcCompanyCardInfoSubmit, options).then((res) => {
  233. // const data = stringToJson(res.bizContent);
  234. // uni.redirectTo({
  235. // url: `/subpackage/applyCard/car-release?orderId=${state.orderId}&&vehiclePlateColor=${state.vehiclePlateColor}&isSign=${state.isSign}`,
  236. // });
  237. // });
  238. // }
  239. };
  240. onLoad((option: any) => {
  241. state.form.orderId = option.orderId;
  242. state.orderId = option.orderId;
  243. state.vehiclePlateColor = option.vehiclePlateColor;
  244. state.form.opId = getItem('openId')??'';
  245. state.isSign=option.isSign;
  246. });
  247. //监听页面滚动
  248. onPageScroll((e) => {
  249. scrollTop.value = e.scrollTop;
  250. });
  251. //营业执照Orc接口调用
  252. const cardImageOcrYY = () => {
  253. uni.chooseImage({
  254. count: 1, //只能选取一张照片
  255. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  256. sourceType: ["camera", "album"], //从相册选择
  257. success: function(res) {
  258. pathToBase64(res.tempFilePaths[0])
  259. .then((path) => {
  260. var data = {
  261. type: 'business_license',
  262. base64: path,
  263. };
  264. const options = {
  265. type: 2,
  266. data: data,
  267. method: "POST",
  268. showLoading: true,
  269. };
  270. request(ocrAllQuery, options).then((res) => {
  271. const data = stringToJson(res.bizContent);
  272. if (data.result) {
  273. state.form.userName = stringToJson(data.result
  274. .businessLicense)[
  275. '名称'];
  276. state.form.userIdNum = stringToJson(data.result
  277. .businessLicense)[
  278. '统一社会信用代码'];
  279. cardFileImageUpdateyy(path)
  280. }
  281. });
  282. })
  283. .catch((error) => {});
  284. },
  285. });
  286. };
  287. const cardImageOcr = (val: any) => {
  288. var imageType = val;
  289. uni.chooseImage({
  290. count: 1, //只能选取一张照片
  291. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  292. sourceType: ["camera", "album"], //从相册选择
  293. success: function(res) {
  294. pathToBase64(res.tempFilePaths[0])
  295. .then((path) => {
  296. var data = {
  297. source: "WECHAT",
  298. agencyId: "52010106004",
  299. imageType: imageType,
  300. fileName: res.tempFilePaths[0],
  301. imageBase64: path,
  302. };
  303. const options = {
  304. type: 2,
  305. data: data,
  306. method: "POST",
  307. showLoading: true,
  308. };
  309. request(etcOcrCard, options).then((res) => {
  310. const data = stringToJson(res.bizContent);
  311. if (val === "1") {
  312. state.form.agentName = data.name;
  313. state.form.agentIdNum = data.idno;
  314. state.form.agentPosImgUrl = data.imageUrl;
  315. state.form.address = data.address;
  316. state.form.agentGender = data.gender;
  317. } else {
  318. state.form.agentIdVld = data.enddate;
  319. state.form.agentNegImgUrl = data.imageUrl;
  320. }
  321. });
  322. })
  323. .catch((error) => {});
  324. },
  325. });
  326. };
  327. //委托书获取图片给后端
  328. const cardFileImageUpdateyy = (val: any) => {
  329. var data = {
  330. fileBase64: val,
  331. };
  332. const options = {
  333. type: 2,
  334. data: data,
  335. method: "POST",
  336. showLoading: true,
  337. };
  338. request(fileUpload, options).then((res) => {
  339. const data = stringToJson(res.bizContent);
  340. state.form.posImgUrl = data.data.url;
  341. });
  342. };
  343. const cardFileImageUpdate = () => {
  344. uni.chooseImage({
  345. count: 1, //只能选取一张照片
  346. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  347. sourceType: ["camera", "album"], //从相册选择
  348. success: function(res) {
  349. pathToBase64(res.tempFilePaths[0])
  350. .then((path) => {
  351. var data = {
  352. fileBase64: path,
  353. };
  354. const options = {
  355. type: 2,
  356. data: data,
  357. method: "POST",
  358. showLoading: true,
  359. };
  360. request(fileUpload, options).then((res) => {
  361. const data = stringToJson(res.bizContent);
  362. state.form.proxyUrl = data.data.url;
  363. });
  364. })
  365. .catch((error) => {});
  366. },
  367. });
  368. };
  369. //替换图片地址
  370. const strReplace = (str: string) => {
  371. return str.replace('192.168.101.145:9000', '222.85.144.89:19002')
  372. }
  373. </script>
  374. <style lang="scss" scoped>
  375. .content-wrap {
  376. position: relative;
  377. margin-top: -50rpx;
  378. padding: 0rpx 30rpx;
  379. position: relative;
  380. .action {
  381. padding-left: 20rpx;
  382. padding-right: 20rpx;
  383. padding-bottom: 30rpx;
  384. .button {
  385. height: 80rpx;
  386. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  387. border-radius: 40rpx;
  388. font-size: 32rpx;
  389. font-weight: 400;
  390. color: #ffffff;
  391. line-height: 80rpx;
  392. }
  393. }
  394. .item-tips {
  395. .title {
  396. font-size: 30rpx;
  397. font-family: Microsoft YaHei;
  398. font-weight: 400;
  399. color: #000000;
  400. line-height: 24rpx;
  401. }
  402. .tip {
  403. margin-top: 16rpx;
  404. font-size: 24rpx;
  405. font-family: Microsoft YaHei;
  406. font-weight: 400;
  407. color: #999999;
  408. line-height: 24rpx;
  409. }
  410. }
  411. .picture-wrapper {
  412. margin-top: 40rpx;
  413. .bg {
  414. background: #ffffff;
  415. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  416. border-radius: 20rpx;
  417. padding: 40rpx;
  418. display: flex;
  419. // align-items: center;
  420. justify-content: space-between;
  421. .name {
  422. font-size: 34rpx;
  423. font-family: Microsoft YaHei;
  424. font-weight: 400;
  425. color: #000000;
  426. line-height: 34rpx;
  427. }
  428. .value {
  429. margin-top: 20rpx;
  430. font-size: 24rpx;
  431. font-family: Microsoft YaHei;
  432. font-weight: 400;
  433. color: #999999;
  434. line-height: 24rpx;
  435. }
  436. .tip {
  437. margin-top: 20rpx;
  438. text-align: center;
  439. width: 110rpx;
  440. height: 40rpx;
  441. background: rgba(33, 190, 177, 0.2);
  442. border-radius: 6rpx;
  443. .tip-value {
  444. font-size: 20rpx;
  445. font-family: Microsoft YaHei;
  446. font-weight: 400;
  447. color: #0a8f8a;
  448. line-height: 40rpx;
  449. opacity: 1;
  450. }
  451. }
  452. }
  453. .icon {
  454. width: 294rpx;
  455. height: 188rpx;
  456. }
  457. }
  458. .shibie-wrapper {
  459. margin-top: 60rpx;
  460. .title {
  461. font-size: 30rpx;
  462. font-family: Microsoft YaHei;
  463. font-weight: 400;
  464. color: #000000;
  465. line-height: 30rpx;
  466. }
  467. }
  468. .buchong-wrapper {
  469. margin-top: 60rpx;
  470. .title {
  471. font-size: 30rpx;
  472. font-family: Microsoft YaHei;
  473. font-weight: 400;
  474. color: #000000;
  475. line-height: 30rpx;
  476. }
  477. }
  478. .green-tip {
  479. margin-top: 50rpx;
  480. font-size: 24rpx;
  481. font-family: Microsoft YaHei;
  482. font-weight: 400;
  483. color: #00b38b;
  484. line-height: 24rpx;
  485. margin-bottom: 60rpx;
  486. }
  487. }
  488. </style>