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

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446
  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(state.form.agentGender ==='男'){
  153. state.form.agentGender = 'MAN'
  154. }else{
  155. state.form.agentGender = 'WOMAN'
  156. }
  157. if (!checkStr(state.form.agentIdNum, 'card')) {
  158. msg('请输入正确身份证');
  159. return;
  160. }
  161. if (!checkStr(state.form.tel, 'mobile')) {
  162. msg('请输入正确手机号');
  163. return;
  164. }
  165. var data = state.form;
  166. const options = {
  167. type: 2,
  168. data: data,
  169. method: "POST",
  170. showLoading: true,
  171. };
  172. request(etcCompanyCardInfoSubmit, options).then((res) => {
  173. const data = stringToJson(res.bizContent);
  174. uni.navigateTo({
  175. url: `/applyCard/car-release?orderId=${state.orderId}&&vehiclePlateColor=${state.vehiclePlateColor}`,
  176. });
  177. });
  178. };
  179. onLoad((option: any) => {
  180. state.form.orderId = option.orderId;
  181. state.orderId = option.orderId;
  182. state.vehiclePlateColor = option.vehiclePlateColor;
  183. });
  184. //营业执照Orc接口调用
  185. const cardImageOcrYY = () => {
  186. uni.chooseImage({
  187. count: 1, //只能选取一张照片
  188. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  189. sourceType: ["camera", "album"], //从相册选择
  190. success: function(res) {
  191. pathToBase64(res.tempFilePaths[0])
  192. .then((path) => {
  193. var data = {
  194. type: 'business_license',
  195. base64: path,
  196. };
  197. const options = {
  198. type: 2,
  199. data: data,
  200. method: "POST",
  201. showLoading: true,
  202. };
  203. request(ocrAllQuery, options).then((res) => {
  204. const data = stringToJson(res.bizContent);
  205. state.form.userName = stringToJson(data.result.businessLicense)[
  206. '名称'];
  207. state.form.userIdNum = stringToJson(data.result.businessLicense)[
  208. '统一社会信用代码'];
  209. cardFileImageUpdateyy(path)
  210. });
  211. })
  212. .catch((error) => {});
  213. },
  214. });
  215. };
  216. const cardImageOcr = (val: any) => {
  217. var imageType = val;
  218. uni.chooseImage({
  219. count: 1, //只能选取一张照片
  220. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  221. sourceType: ["camera", "album"], //从相册选择
  222. success: function(res) {
  223. pathToBase64(res.tempFilePaths[0])
  224. .then((path) => {
  225. var data = {
  226. source: "WECHAT",
  227. agencyId: "52010106004",
  228. imageType: imageType,
  229. fileName: res.tempFilePaths[0],
  230. imageBase64: path,
  231. };
  232. const options = {
  233. type: 2,
  234. data: data,
  235. method: "POST",
  236. showLoading: true,
  237. };
  238. request(etcOcrCard, options).then((res) => {
  239. const data = stringToJson(res.bizContent);
  240. if (val === "1") {
  241. state.form.agentName = data.name;
  242. state.form.agentIdNum = data.idno;
  243. state.form.agentPosImgUrl = data.imageUrl;
  244. state.form.address = data.address;
  245. state.form.agentGender = data.gender;
  246. } else {
  247. state.form.agentIdVld = data.enddate;
  248. state.form.agentNegImgUrl = data.imageUrl;
  249. }
  250. });
  251. })
  252. .catch((error) => {});
  253. },
  254. });
  255. };
  256. //营业执照获取图片给后端
  257. const cardFileImageUpdateyy = (val: any) => {
  258. var data = {
  259. fileBase64: val,
  260. };
  261. const options = {
  262. type: 2,
  263. data: data,
  264. method: "POST",
  265. showLoading: true,
  266. };
  267. request(fileUpload, options).then((res) => {
  268. const data = stringToJson(res.bizContent);
  269. state.form.posImgUrl = data.data.url;
  270. });
  271. };
  272. const cardFileImageUpdate = () => {
  273. uni.chooseImage({
  274. count: 1, //只能选取一张照片
  275. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  276. sourceType: ["camera", "album"], //从相册选择
  277. success: function(res) {
  278. pathToBase64(res.tempFilePaths[0])
  279. .then((path) => {
  280. var data = {
  281. fileBase64: path,
  282. };
  283. const options = {
  284. type: 2,
  285. data: data,
  286. method: "POST",
  287. showLoading: true,
  288. };
  289. request(fileUpload, options).then((res) => {
  290. const data = stringToJson(res.bizContent);
  291. state.form.proxyUrl = data.data.url;
  292. });
  293. })
  294. .catch((error) => {});
  295. },
  296. });
  297. };
  298. //替换图片地址
  299. const strReplace = (str: string) => {
  300. return str.replace('192.168.101.145:9000', '222.85.144.89:19002')
  301. }
  302. </script>
  303. <style lang="scss" scoped>
  304. .content-wrap {
  305. position: relative;
  306. margin-top: -50rpx;
  307. padding: 0rpx 30rpx;
  308. position: relative;
  309. .action {
  310. padding-left: 20rpx;
  311. padding-right: 20rpx;
  312. padding-bottom: 30rpx;
  313. .button {
  314. height: 80rpx;
  315. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  316. border-radius: 40rpx;
  317. font-size: 32rpx;
  318. font-weight: 400;
  319. color: #ffffff;
  320. line-height: 80rpx;
  321. }
  322. }
  323. .item-tips {
  324. .title {
  325. font-size: 30rpx;
  326. font-family: Microsoft YaHei;
  327. font-weight: 400;
  328. color: #000000;
  329. line-height: 24rpx;
  330. }
  331. .tip {
  332. margin-top: 16rpx;
  333. font-size: 24rpx;
  334. font-family: Microsoft YaHei;
  335. font-weight: 400;
  336. color: #999999;
  337. line-height: 24rpx;
  338. }
  339. }
  340. .picture-wrapper {
  341. margin-top: 40rpx;
  342. .bg {
  343. background: #ffffff;
  344. box-shadow: 0rpx 4rpx 13rpx 3rpx rgba(223, 223, 223, 0.8);
  345. border-radius: 20rpx;
  346. padding: 40rpx;
  347. display: flex;
  348. // align-items: center;
  349. justify-content: space-between;
  350. .name {
  351. font-size: 34rpx;
  352. font-family: Microsoft YaHei;
  353. font-weight: 400;
  354. color: #000000;
  355. line-height: 34rpx;
  356. }
  357. .value {
  358. margin-top: 20rpx;
  359. font-size: 24rpx;
  360. font-family: Microsoft YaHei;
  361. font-weight: 400;
  362. color: #999999;
  363. line-height: 24rpx;
  364. }
  365. .tip {
  366. margin-top: 20rpx;
  367. text-align: center;
  368. width: 110rpx;
  369. height: 40rpx;
  370. background: rgba(33, 190, 177, 0.2);
  371. border-radius: 6rpx;
  372. .tip-value {
  373. font-size: 20rpx;
  374. font-family: Microsoft YaHei;
  375. font-weight: 400;
  376. color: #0a8f8a;
  377. line-height: 40rpx;
  378. opacity: 1;
  379. }
  380. }
  381. }
  382. .icon {
  383. width: 294rpx;
  384. height: 188rpx;
  385. }
  386. }
  387. .shibie-wrapper {
  388. margin-top: 60rpx;
  389. .title {
  390. font-size: 30rpx;
  391. font-family: Microsoft YaHei;
  392. font-weight: 400;
  393. color: #000000;
  394. line-height: 30rpx;
  395. }
  396. }
  397. .buchong-wrapper {
  398. margin-top: 60rpx;
  399. .title {
  400. font-size: 30rpx;
  401. font-family: Microsoft YaHei;
  402. font-weight: 400;
  403. color: #000000;
  404. line-height: 30rpx;
  405. }
  406. }
  407. .green-tip {
  408. margin-top: 50rpx;
  409. font-size: 24rpx;
  410. font-family: Microsoft YaHei;
  411. font-weight: 400;
  412. color: #00b38b;
  413. line-height: 24rpx;
  414. margin-bottom: 60rpx;
  415. }
  416. }
  417. </style>