Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.

opening-account-unit.vue 12KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442
  1. <template>
  2. <navBar title="ETC开户新办申请-单位"></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="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.userIdNum" />
  73. </u-form-item>
  74. <u-form-item label="经办人姓名">
  75. <u-input inputAlign="right" placeholder='请输入经办人姓名' v-model="state.form.agentName" />
  76. </u-form-item>
  77. <u-form-item label="经办人身份证号">
  78. <u-input inputAlign="right" placeholder='请输入经办人身份证号' v-model="state.form.agentIdNum" />
  79. </u-form-item>
  80. <u-form-item label="经办人联系方式">
  81. <u-input inputAlign="right" placeholder='请输入经办人联系方式' v-model="state.form.tel" />
  82. </u-form-item>
  83. </u-form>
  84. </view>
  85. <view class="green-tip">
  86. 如识别信息有误,请手动修改,确认无误后,点击下一步!
  87. </view>
  88. <view class="action">
  89. <button type="default" class="button" @click="savaHandle()">
  90. 下一步
  91. </button>
  92. </view>
  93. </view>
  94. </template>
  95. <script setup lang="ts">
  96. import {
  97. reactive
  98. } from "vue";
  99. import navBgCar from "./components/nav-bg-car2";
  100. import navBar from "../components/nav-bar/nav-bar2.vue";
  101. import {
  102. pathToBase64
  103. } from "@/utils/image-tools/index.js";
  104. import {
  105. ocrAllQuery,
  106. fileUpload,
  107. etcOcrCard,
  108. etcCompanyCardInfoSubmit
  109. } from "@/utils/network/api.js";
  110. import {
  111. request
  112. } from "@/utils/network/request.js";
  113. import {
  114. stringToJson
  115. } from "@/utils/network/encryption";
  116. import {
  117. onLoad
  118. } from "@dcloudio/uni-app";
  119. import {
  120. msg,
  121. checkStr
  122. } from "@/utils/utils";
  123. const state = reactive({
  124. form: {
  125. orderId: "", //订单ID
  126. //营业执照信息
  127. userName: "", //开户名称/账户名称
  128. userIdType: "203", //用户证件类型 203//营业执照
  129. userIdNum: "", //营业执照号码
  130. posImgUrl: "", //营业执照证明
  131. department: '本部', //不超过50个字符,若单位仅开一个账户,填写“本部”
  132. address: "", //单位地址
  133. //经办人信息
  134. agentName: "",
  135. agentIdType: "101",
  136. agentIdNum: "",
  137. agentAddress: "",
  138. agentPhone: "",
  139. agentIdVld: '',
  140. tel: '',
  141. agentGender: '',
  142. agentPosImgUrl: "",
  143. agentNegImgUrl: "",
  144. proxyUrl: "",
  145. sceneType: "", //用户协议支撑服务场景(发行服务机构和用户签订的协议)
  146. channelId: "", //渠道id
  147. },
  148. orderId: "",
  149. vehiclePlateColor: ''
  150. });
  151. const savaHandle = () => {
  152. if (!checkStr(state.form.agentIdNum, 'card')) {
  153. msg('请输入正确身份证');
  154. return;
  155. }
  156. if (!checkStr(state.form.tel, 'mobile')) {
  157. msg('请输入正确手机号');
  158. return;
  159. }
  160. var data = state.form;
  161. const options = {
  162. type: 2,
  163. data: data,
  164. method: "POST",
  165. showLoading: true,
  166. };
  167. request(etcCompanyCardInfoSubmit, options).then((res) => {
  168. const data = stringToJson(res.bizContent);
  169. uni.navigateTo({
  170. url: `/applyCard/car-release?orderId=${state.orderId}&&vehiclePlateColor=${state.vehiclePlateColor}`,
  171. });
  172. });
  173. };
  174. onLoad((option: any) => {
  175. state.form.orderId = option.orderId;
  176. state.orderId = option.orderId;
  177. state.vehiclePlateColor = option.vehiclePlateColor;
  178. });
  179. //营业执照Orc接口调用
  180. const cardImageOcrYY = () => {
  181. uni.chooseImage({
  182. count: 1, //只能选取一张照片
  183. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  184. sourceType: ["camera", "album"], //从相册选择
  185. success: function(res) {
  186. pathToBase64(res.tempFilePaths[0])
  187. .then((path) => {
  188. var data = {
  189. type: 'business_license',
  190. base64: path,
  191. };
  192. const options = {
  193. type: 2,
  194. data: data,
  195. method: "POST",
  196. showLoading: true,
  197. };
  198. request(ocrAllQuery, options).then((res) => {
  199. const data = stringToJson(res.bizContent);
  200. state.form.userName = stringToJson(data.result.businessLicense)[
  201. '名称'];
  202. state.form.userIdNum = stringToJson(data.result.businessLicense)[
  203. '统一社会信用代码'];
  204. cardFileImageUpdateyy(path)
  205. });
  206. })
  207. .catch((error) => {});
  208. },
  209. });
  210. };
  211. const cardImageOcr = (val: any) => {
  212. var imageType = val;
  213. uni.chooseImage({
  214. count: 1, //只能选取一张照片
  215. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  216. sourceType: ["camera", "album"], //从相册选择
  217. success: function(res) {
  218. pathToBase64(res.tempFilePaths[0])
  219. .then((path) => {
  220. var data = {
  221. source: "WECHAT",
  222. agencyId: "52010106004",
  223. imageType: imageType,
  224. fileName: res.tempFilePaths[0],
  225. imageBase64: path,
  226. };
  227. const options = {
  228. type: 2,
  229. data: data,
  230. method: "POST",
  231. showLoading: true,
  232. };
  233. request(etcOcrCard, options).then((res) => {
  234. const data = stringToJson(res.bizContent);
  235. if (val === "1") {
  236. state.form.agentName = data.name;
  237. state.form.agentIdNum = data.idno;
  238. state.form.agentPosImgUrl = data.imageUrl;
  239. state.form.address = data.address;
  240. state.form.agentGender = data.gender;
  241. } else {
  242. state.form.agentIdVld = data.enddate;
  243. state.form.agentNegImgUrl = data.imageUrl;
  244. }
  245. });
  246. })
  247. .catch((error) => {});
  248. },
  249. });
  250. };
  251. //营业执照获取图片给后端
  252. const cardFileImageUpdateyy = (val: any) => {
  253. var data = {
  254. fileBase64: val,
  255. };
  256. const options = {
  257. type: 2,
  258. data: data,
  259. method: "POST",
  260. showLoading: true,
  261. };
  262. request(fileUpload, options).then((res) => {
  263. const data = stringToJson(res.bizContent);
  264. state.form.posImgUrl = data.data.url;
  265. });
  266. };
  267. const cardFileImageUpdate = () => {
  268. uni.chooseImage({
  269. count: 1, //只能选取一张照片
  270. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  271. sourceType: ["camera", "album"], //从相册选择
  272. success: function(res) {
  273. pathToBase64(res.tempFilePaths[0])
  274. .then((path) => {
  275. var data = {
  276. fileBase64: path,
  277. };
  278. const options = {
  279. type: 2,
  280. data: data,
  281. method: "POST",
  282. showLoading: true,
  283. };
  284. request(fileUpload, options).then((res) => {
  285. const data = stringToJson(res.bizContent);
  286. state.form.proxyUrl = data.data.url;
  287. });
  288. })
  289. .catch((error) => {});
  290. },
  291. });
  292. };
  293. //替换图片地址
  294. const strReplace = (str: string) => {
  295. return str.replace('192.168.101.145:9000', '222.85.144.89:19002')
  296. }
  297. </script>
  298. <style lang="scss" scoped>
  299. .content-wrap {
  300. position: relative;
  301. margin-top: -50rpx;
  302. padding: 0rpx 30rpx;
  303. position: relative;
  304. .action {
  305. padding-left: 20rpx;
  306. padding-right: 20rpx;
  307. padding-bottom: 30rpx;
  308. .button {
  309. height: 80rpx;
  310. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  311. border-radius: 40rpx;
  312. font-size: 32rpx;
  313. font-weight: 400;
  314. color: #ffffff;
  315. line-height: 80rpx;
  316. }
  317. }
  318. .item-tips {
  319. .title {
  320. font-size: 30rpx;
  321. font-family: Microsoft YaHei;
  322. font-weight: 400;
  323. color: #000000;
  324. line-height: 24rpx;
  325. }
  326. .tip {
  327. margin-top: 16rpx;
  328. font-size: 24rpx;
  329. font-family: Microsoft YaHei;
  330. font-weight: 400;
  331. color: #999999;
  332. line-height: 24rpx;
  333. }
  334. }
  335. .picture-wrapper {
  336. margin-top: 40rpx;
  337. .bg {
  338. background: #ffffff;
  339. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  340. border-radius: 20rpx;
  341. padding: 40rpx;
  342. display: flex;
  343. // align-items: center;
  344. justify-content: space-between;
  345. .name {
  346. font-size: 34rpx;
  347. font-family: Microsoft YaHei;
  348. font-weight: 400;
  349. color: #000000;
  350. line-height: 34rpx;
  351. }
  352. .value {
  353. margin-top: 20rpx;
  354. font-size: 24rpx;
  355. font-family: Microsoft YaHei;
  356. font-weight: 400;
  357. color: #999999;
  358. line-height: 24rpx;
  359. }
  360. .tip {
  361. margin-top: 20rpx;
  362. text-align: center;
  363. width: 110rpx;
  364. height: 40rpx;
  365. background: rgba(33, 190, 177, 0.2);
  366. border-radius: 6rpx;
  367. .tip-value {
  368. font-size: 20rpx;
  369. font-family: Microsoft YaHei;
  370. font-weight: 400;
  371. color: #0a8f8a;
  372. line-height: 40rpx;
  373. opacity: 1;
  374. }
  375. }
  376. }
  377. .icon {
  378. width: 294rpx;
  379. height: 188rpx;
  380. }
  381. }
  382. .shibie-wrapper {
  383. margin-top: 60rpx;
  384. .title {
  385. font-size: 30rpx;
  386. font-family: Microsoft YaHei;
  387. font-weight: 400;
  388. color: #000000;
  389. line-height: 30rpx;
  390. }
  391. }
  392. .buchong-wrapper {
  393. margin-top: 60rpx;
  394. .title {
  395. font-size: 30rpx;
  396. font-family: Microsoft YaHei;
  397. font-weight: 400;
  398. color: #000000;
  399. line-height: 30rpx;
  400. }
  401. }
  402. .green-tip {
  403. margin-top: 50rpx;
  404. font-size: 24rpx;
  405. font-family: Microsoft YaHei;
  406. font-weight: 400;
  407. color: #00b38b;
  408. line-height: 24rpx;
  409. margin-bottom: 60rpx;
  410. }
  411. }
  412. </style>