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.

open-account.vue 13KB

2 年之前
1 年之前
2 年之前
1 年之前
2 年之前
1 年之前
2 年之前
2 年之前
1 年之前
1 年之前
2 年之前
1 年之前
1 年之前
1 年之前
1 年之前
2 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
1 年之前
2 年之前
2 年之前
2 年之前
1 年之前
1 年之前
1 年之前
2 年之前
1 年之前
1 年之前
1 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
2 年之前
1 年之前
1 年之前
1 年之前
2 年之前
1 年之前
1 年之前
2 年之前
2 年之前
1 年之前
2 年之前
2 年之前
1 年之前
1 年之前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420
  1. <template>
  2. <view class='content'>
  3. <view class='up_img_wrap'>
  4. <view class='title'>请上传图片</view>
  5. <view class='tips'>注意事项:1.请上传有效图片;2.图片大小不超过2M</view>
  6. <view class='item_wrap'>
  7. <view class='item' @click="cardImageOcrYY()">
  8. <image v-if="!state.form.url1" class="icon" :src="`${$imgUrl}applyCard/zhizhao.png`">
  9. </image>
  10. <image v-else class="icon" :src="state.form.url1"></image>
  11. <view>公司营业执照</view>
  12. </view>
  13. <view class='item' @click="cardDbImageOcr('2')">
  14. <image v-if="!state.form.url2" class="icon" :src="`${$imgUrl}applyCard/weituoshu.png`">
  15. </image>
  16. <image v-else class="icon" :src="state.form.url2"></image>
  17. <view>单位授权书</view>
  18. </view>
  19. <view class='item' @click="takePhotoMode('1')">
  20. <image v-if="!state.form.url3" class="icon" :src="`${$imgUrl}applyCard/renxiang.png`">
  21. </image>
  22. <image v-else class="icon" :src="state.form.url3"></image>
  23. <view>被委托人身份证正页照</view>
  24. </view>
  25. <view class='item' @click="takePhotoMode('2')">
  26. <image v-if="!state.form.url4" class="icon" :src="`${$imgUrl}applyCard/guohui.png`">
  27. </image>
  28. <image v-else class="icon" :src="state.form.url4"></image>
  29. <view>被委托人身份证副页</view>
  30. </view>
  31. </view>
  32. </view>
  33. <view class='up_img_wrap message'>
  34. <u-form :model="form" ref="form1" label-width=210 border-bottom=false>
  35. <u-form-item label="对公用户登录名 " border-bottom=true>
  36. <u-input placeholder='请输入8-16位字母加数字组成的账号' type="text" v-model="state.form.name" />
  37. </u-form-item>
  38. <u-form-item label="对公用户密码">
  39. <view class="form-input">
  40. <input class="input" v-model="state.form.passWord" placeholder="请输入对公用户密码"
  41. placeholder-class="color: #c0c4cc;" :password="state.isPwdType ? true : false"
  42. type="text" />
  43. <image :src="`${$imgUrl}login/${
  44. state.isPwdType ? 'icon_eye_close' : 'icon_eye_open'
  45. }.png`" class="eye" @click="state.isPwdType = !state.isPwdType" mode="aspectFill"></image>
  46. </view>
  47. </u-form-item>
  48. <view class="tips" style="margin-top: -36rpx;font-size: 24rpx;"><text> *
  49. </text>密码必须包含至少一个数字、一个小写字母、一个大写字母,并且长度至少为8个字符
  50. </view>
  51. <u-form-item label="支付密码">
  52. <view class="form-input">
  53. <input class="input" v-model="state.form.consumePassword" placeholder="请输入6位数字组成支付密码"
  54. placeholder-class="color: #c0c4cc;" :password="state.isAffirmPwdType ? true : false"
  55. type="number" />
  56. <image :src="`${$imgUrl}login/${
  57. state.isAffirmPwdType ? 'icon_eye_close' : 'icon_eye_open'
  58. }.png`" class="eye" @click="state.isAffirmPwdType = !state.isAffirmPwdType" mode="aspectFill"></image>
  59. </view>
  60. </u-form-item>
  61. <u-form-item label="公司证件编码 ">
  62. <u-input placeholder='请输入公司证件编码' type="text" v-model="state.form.code" />
  63. </u-form-item>
  64. <u-form-item label="公司名称">
  65. <u-input placeholder='请输入公司名称' type="text" v-model="state.form.companyName" />
  66. </u-form-item>
  67. <u-form-item label="经办人姓名">
  68. <u-input placeholder='请输入经办人姓名' type="text" v-model="state.form.handlerName" />
  69. </u-form-item>
  70. <u-form-item label="经办人手机号">
  71. <u-input placeholder='请输入经办人手机号' type="text" v-model="state.form.handlerPhone" />
  72. </u-form-item>
  73. <u-form-item label="银行卡号">
  74. <u-input placeholder='请输入银行卡号' type="text" v-model="state.form.bankCardId" />
  75. </u-form-item>
  76. <u-form-item label="开户行">
  77. <u-input placeholder='请输入开户行' type="text" v-model="state.form.bankAddress" />
  78. </u-form-item>
  79. </u-form>
  80. </view>
  81. <view class='attention'>
  82. <view>注意事项:</view>
  83. <view>1.开户成功后,请先设置密码,否则不能进行圈存操作</view>
  84. <view>2.付款账户:贵单位打款银行卡</view>
  85. <view>3.开户申请审核结果将于两个工作日发送短信告知</view>
  86. <view>4.只支持黔通卡充值</view>
  87. </view>
  88. <button class='open' type="success" @click='open()'>开户</button>
  89. </view>
  90. <view class="choice-takePhoto-wrap" v-if="state.isTakePhotoModeShow" @click="cancle">
  91. <view class="choice-takePhoto">
  92. <view @click.stop="takePhoto(state.choiceIndex)" style="border-radius: 20rpx 20rpx 0 0;">拍照</view>
  93. <view @click.stop="xiangce(state.choiceIndex)">从手机相册选择</view>
  94. <view @click.stop="cancle">取消</view>
  95. </view>
  96. </view>
  97. <viewfinder v-if="state.phoneType" :phoneType="state.phoneType" :images="state.images"
  98. :showStartPhoto="state.showImg" @confirmReturn="confirmReturn" @camera="camera"></viewfinder>
  99. </template>
  100. <script setup lang="ts">
  101. import { reactive } from "vue";
  102. import { etcOcrCard, envs, ocrAllQuery, fileUpload, openRecharge } from "@/utils/network/api.js";
  103. import { navTo } from "@/utils/utils";
  104. import { request } from "@/utils/network/request.js";
  105. import { stringToJson } from "@/utils/network/encryption.js";
  106. import { msg, checkStr, strReplace, uploadFile } from "@/utils/utils";
  107. import viewfinder from "../../../components/viewfinder.vue"
  108. const state = reactive({
  109. showImg: true,
  110. images: '',
  111. isMy: "",//自己办理 他人办理
  112. phoneType: 0, // 1 身份证正面 2 身份证反面 3行驶证正面 4行驶证反面
  113. choiceIndex: 1, // 1 身份证正面 2 身份证反面
  114. isTakePhotoModeShow: false, //选择拍照方式是否出来
  115. isBusinessLicense: false, //是否上传公司营业执照
  116. form: {
  117. url1: '', //公司营业执照
  118. url2: '', //
  119. url3: '', //
  120. url4: '', //
  121. name: '',//对公用户登录名
  122. passWord: '',//对公用户登录密码
  123. consumePassword: '', //支付密码
  124. // type:'',//公司证件类型
  125. code: '', //公司证件编码
  126. companyName: '',
  127. handlerName: '',
  128. handlerPhone: '',
  129. bankAddress: "", //开户行
  130. bankCardId: "", //充值银行卡号
  131. },
  132. isPwdType: true,
  133. isAffirmPwdType: true
  134. })
  135. const cardDbImageOcr = (val : any) => {
  136. var imageType = val;
  137. uni.chooseImage({
  138. count: 1, //只能选取一张照片
  139. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  140. sourceType: ["camera", "album"], //从相册选择
  141. success: function (res) {
  142. uploadFile(res.tempFilePaths[0], "", "").then((data) => {
  143. state.form.url2 = data;
  144. })
  145. },
  146. });
  147. };
  148. const takePhotoMode = (index) => {
  149. state.isTakePhotoModeShow = true
  150. state.choiceIndex = index
  151. }
  152. const xiangce = (val) => {
  153. console.log("val", val)
  154. var imageType = val;
  155. uni.chooseImage({
  156. count: 1, //只能选取一张照片
  157. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  158. sourceType: ["album"], //从相册选择
  159. success: function (res) {
  160. state.showImg = false
  161. state.images = res.tempFilePaths[0]
  162. state.phoneType = state.choiceIndex
  163. state.isTakePhotoModeShow = false
  164. console.log("tempFilePaths[0].startsWith('file://')", res.tempFilePaths[0], res.tempFilePaths[0].startsWith('file://'))
  165. },
  166. })
  167. }
  168. const takePhoto = (val) => {
  169. state.showImg = true
  170. console.log("拍照", val)
  171. state.phoneType = val;
  172. }
  173. const confirmReturn = (val) => {
  174. state.phoneType = 0
  175. state.isTakePhotoModeShow = false
  176. var imageType = state.choiceIndex;
  177. console.log("图片地址val", val.tempImagePath)
  178. uploadFile(val.tempImagePath, imageType, etcOcrCard).then((data) => {
  179. console.log("身份证上传", data, imageType)
  180. if (imageType === "1") {
  181. state.form.url3 = data.imageUrl;
  182. } else if (imageType === "2") {
  183. state.form.url4 = data.imageUrl;
  184. }
  185. state.isTakePhotoModeShow = false
  186. })
  187. }
  188. const cancle = () => {
  189. state.isTakePhotoModeShow = false
  190. }
  191. const camera = () => {
  192. state.phoneType = 0
  193. }
  194. const goBankCard = () => {
  195. navTo(`/subpackage/personal-center/setting/bank-card/bank-card`);
  196. }
  197. const open = () => {
  198. if (state.form.name == state.form.passWord) {
  199. msg('对公用户登录名和对公用户密码不能相同')
  200. return;
  201. }
  202. for (var i in state.form) {
  203. if (!state.form[i]) {
  204. msg('请把信息填写完整!')
  205. return;
  206. }
  207. }
  208. if (!checkStr(state.form.handlerPhone, 'mobile')) {
  209. msg('请输入正确手机号');
  210. return;
  211. }
  212. const options = {
  213. type: 2,
  214. data: {
  215. 'accountId': state.form.name, //账户编号
  216. 'corporateIdNum': state.form.code, //公司营业执照统一社会信用代码
  217. 'corporateName': state.form.companyName, //对公名称
  218. 'photoUrl': state.form.url1, //营业执照图片路径
  219. 'authBookUrl': state.form.url2, //授权书图片路径
  220. 'agentName': state.form.handlerName, //经办人姓名
  221. 'agentTel': state.form.handlerPhone, //经办人手机号
  222. 'idCardImageUrl': state.form.url3, //经办人身份证正面
  223. 'idCardBackImageUrl': state.form.url4, //经办人身份证反面
  224. 'bankAddress': state.form.bankAddress, //开户行
  225. 'bankCardId': state.form.bankCardId, //充值银行卡号
  226. 'passWord': state.form.passWord, //密码
  227. 'consumePassword': state.form.consumePassword,//支付密码
  228. },
  229. method: "POST",
  230. showLoading: true,
  231. };
  232. request(openRecharge, options)
  233. .then((res) => {
  234. let data = stringToJson(res.bizContent)
  235. console.log("开户成功", data.status)
  236. uni.showModal({
  237. content: '申请已受理,请等待审核,请到【查询服务】的【对公账户查询】查看进度',
  238. showCancel: false,
  239. success: function (res) {
  240. if (res.confirm) {
  241. uni.navigateBack({
  242. delta: 2
  243. })
  244. } else if (res.cancel) {
  245. console.log('用户点击取消');
  246. }
  247. }
  248. });
  249. })
  250. .catch((err) => {
  251. console.log(err);
  252. });
  253. }
  254. //营业执照Orc接口调用
  255. const cardImageOcrYY = () => {
  256. uni.chooseImage({
  257. count: 1, //只能选取一张照片
  258. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  259. sourceType: ["camera", "album"], //从相册选择
  260. success: function (res) {
  261. uploadFile(res.tempFilePaths[0], "", ocrAllQuery).then((data) => {
  262. state.form.url2 = '';
  263. state.form.companyName =data.unitName;
  264. state.form.code = data.screditCode;
  265. uploadFile(res.tempFilePaths[0], "", "").then((data) => {
  266. state.form.url1 = data;
  267. })
  268. })
  269. },
  270. });
  271. };
  272. const shiqu = () => {
  273. console.log("state.form.handlerPhone", state.form.handlerPhone)
  274. }
  275. </script>
  276. <style scoped lang="scss">
  277. .content {
  278. background-color: rgb(246, 246, 246);
  279. font-size: 30rpx;
  280. padding-bottom: 30rpx;
  281. }
  282. .up_img_wrap {
  283. background-color: white;
  284. padding: 0 20rpx;
  285. }
  286. .title {
  287. margin: 0 0 20rpx 0;
  288. }
  289. .tips {
  290. color: red;
  291. font-size: 30rpx;
  292. }
  293. .item_wrap {
  294. display: flex;
  295. flex-shrink: 1;
  296. flex-wrap: wrap;
  297. justify-content: space-between;
  298. padding: 10rpx 0 20rpx 0;
  299. }
  300. .item {
  301. width: 45%;
  302. height: 250rpx;
  303. margin-top: 20rpx;
  304. }
  305. .item image {
  306. width: 100%;
  307. height: 80%;
  308. }
  309. .item view {
  310. text-align: center;
  311. }
  312. .message {
  313. margin-top: 30rpx;
  314. }
  315. .pay_msg {
  316. border-bottom: 2px dotted rgb(75, 217, 97);
  317. padding: 30rpx 0;
  318. }
  319. .company {
  320. padding: 20rpx 50rpx 20rpx 6rpx;
  321. display: flex;
  322. align-items: center;
  323. justify-content: space-between;
  324. }
  325. .phone {
  326. margin-top: 20rpx;
  327. }
  328. .attention {
  329. background-color: rgb(246, 246, 246);
  330. color: red;
  331. font-size: 30rpx;
  332. padding: 30rpx 20rpx 20rpx 20rpx;
  333. }
  334. .open {
  335. height: 80rpx;
  336. background: linear-gradient(-90deg, #43a1e0 0%, #13e7c1 100%);
  337. border-radius: 40rpx;
  338. font-size: 32rpx;
  339. font-weight: 400;
  340. color: #ffffff;
  341. margin: 0 30rpx;
  342. }
  343. .choice-takePhoto {
  344. position: absolute;
  345. bottom: 0;
  346. background-color: white;
  347. width: 100%;
  348. border-radius: 20rpx 20rpx 0 0;
  349. }
  350. .choice-takePhoto>view:first-child {
  351. text-align: center;
  352. height: 80rpx;
  353. line-height: 80rpx;
  354. border-bottom: 1rpx solid rgba(127, 127, 127, 0.3);
  355. background-color: white;
  356. }
  357. .choice-takePhoto>view:last-child {
  358. text-align: center;
  359. height: 80rpx;
  360. line-height: 80rpx;
  361. border-top: 6rpx solid rgba(127, 127, 127, 0.1);
  362. background-color: white;
  363. }
  364. .choice-takePhoto>view {
  365. text-align: center;
  366. height: 80rpx;
  367. line-height: 80rpx;
  368. background-color: white;
  369. }
  370. .choice-takePhoto-wrap {
  371. width: 100%;
  372. height: 100vh;
  373. background-color: rgba(127, 127, 127, 0.2);
  374. position: fixed;
  375. left: 0;
  376. top: 0;
  377. z-index: 11111;
  378. }
  379. .form-input {
  380. display: flex;
  381. flex-direction: row;
  382. align-items: center;
  383. height: 90rpx;
  384. .input {
  385. flex: 1;
  386. padding-right: 48rpx;
  387. font-size: 26rpx;
  388. }
  389. .eye {
  390. width: 48rpx;
  391. height: 48rpx;
  392. }
  393. }
  394. </style>