Вы не можете выбрать более 25 тем Темы должны начинаться с буквы или цифры, могут содержать дефисы(-) и должны содержать не более 35 символов.

opening-account-unit.vue 12KB

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