Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

open-account.vue 6.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211
  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="cardDbImageOcr('1')">
  8. <image v-if="!state.isBusinessLicense" class="icon" :src="`${$imgUrl}applyCard/renxiang.png`">
  9. </image>
  10. <image v-else class="icon" :src="strReplace(state.form.url1)"></image>
  11. <view>公司营业执照</view>
  12. </view>
  13. <view class='item' @click="cardDbImageOcr('2')">
  14. <image v-if="!state.isBusinessLicense" class="icon" :src="`${$imgUrl}applyCard/renxiang.png`">
  15. </image>
  16. <image v-else class="icon" :src="strReplace(state.form.url2)"></image>
  17. <view>单位授权书</view>
  18. </view>
  19. <view class='item' @click="cardDbImageOcr('3')">
  20. <image v-if="!state.isBusinessLicense" class="icon" :src="`${$imgUrl}applyCard/renxiang.png`">
  21. </image>
  22. <image v-else class="icon" :src="strReplace(state.form.url3)"></image>
  23. <view>被委托人身份证正页照</view>
  24. </view>
  25. <view class='item' @click="cardDbImageOcr('4')">
  26. <image v-if="!state.isBusinessLicense" class="icon" :src="`${$imgUrl}applyCard/renxiang.png`">
  27. </image>
  28. <image v-else class="icon" :src="strReplace(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='请输入6-12位字母加数字组成的账号' type="text" v-model="state.form.name"/>
  37. </u-form-item>
  38. <u-form-item label="公司证件类型 ">
  39. <u-input v-model="state.form.type" type="select" :select-open="state.showType" @click="state.showType = true" placeholder='请选择'/>
  40. </u-form-item>
  41. <u-form-item label="公司证件编码 " >
  42. <u-input placeholder='请输入公司证件编码' type="text" v-model="state.form.code"/>
  43. </u-form-item>
  44. <u-form-item label="公司名称" >
  45. <u-input placeholder='请输入公司名称' type="text" v-model="state.form.companyName"/>
  46. </u-form-item>
  47. <u-form-item label="经办人姓名" >
  48. <u-input placeholder='请输入经办人姓名' type="text" v-model="state.form.handlerName"/>
  49. </u-form-item>
  50. <u-form-item label="经办人手机号" >
  51. <u-input placeholder='请输入经办人手机号' type="text" v-model="state.form.handlerPhone"/>
  52. </u-form-item>
  53. </u-form>
  54. <view class='pay_msg'>付款银行账户信息</view>
  55. <view class='company' @click='goBankCard()'>
  56. <view>
  57. <view><text>123456</text><text>贵阳银行股份有限公司</text></view>
  58. <view class='phone'>123****5678</view>
  59. </view>
  60. <u-icon name="arrow-right" color='#ccc' size='40'></u-icon>
  61. </view>
  62. </view>
  63. <view class='attention'>
  64. <view>注意事项:</view>
  65. <view>1.开户成功后,请先设置密码,否则不能进行圈存操作</view>
  66. <view>2.付款账户:贵单位打款银行卡</view>
  67. <view>3.开户申请审核结果将于两个工作日发送短信告知</view>
  68. <view>4.只支持黔通卡充值</view>
  69. </view>
  70. <u-button class='open' type="success">开户</u-button>
  71. </view>
  72. <u-picker mode="selector" :range="state.typeList" v-model="state.showType" @confirm="regionConfirmType"></u-picker>
  73. </template>
  74. <script setup lang="ts">
  75. import {reactive} from "vue";
  76. import {etcOcrCard,envs} from "@/utils/network/api.js";
  77. import {pathToBase64} from "@/utils/image-tools/index.js";
  78. import { navTo } from "@/utils/utils";
  79. const state = reactive({
  80. isBusinessLicense:false, //是否上传公司营业执照
  81. form:{
  82. url1:'', //公司营业执照
  83. url2:'', //
  84. url3:'', //
  85. url4:'', //
  86. name:'',//对公用户登录名
  87. type:'',//公司证件类型
  88. code:'', //公司证件编码
  89. companyName:'',
  90. handlerName:'',
  91. handlerPhone:'',
  92. },
  93. showType:false, //公司证件类型下拉
  94. typeList:['营业执照','统一社会信用代码证','组织结构代码证'],
  95. })
  96. const cardDbImageOcr = (val : any) => {
  97. var imageType = val;
  98. uni.chooseImage({
  99. count: 1, //只能选取一张照片
  100. sizeType: ["original", "compressed"], //可以指定是原图还是压缩图,默认二者都有
  101. sourceType: ["camera", "album"], //从相册选择
  102. success: function (res) {
  103. pathToBase64(res.tempFilePaths[0])
  104. .then((path) => {
  105. var data = {
  106. source: "1",
  107. agencyId: "52010106004",
  108. imageType: imageType,
  109. fileName: res.tempFilePaths[0],
  110. imageBase64: path,
  111. };
  112. const options = {
  113. type: 2,
  114. data: data,
  115. method: "POST",
  116. showLoading: true,
  117. };
  118. request(etcOcrCard, options).then((res) => {
  119. const data = stringToJson(res.bizContent);
  120. console.log("图片信息",data)
  121. if (val === "1") {
  122. state.form.url1 = data.name;
  123. } else if (val === "2"){
  124. state.form.url1 = data.name;
  125. }else if (val === "3"){
  126. state.form.url1 = data.name;
  127. }else if (val === "4"){
  128. state.form.url1 = data.name;
  129. }
  130. });
  131. })
  132. .catch((error) => { });
  133. },
  134. });
  135. };
  136. // 选择公司证件类型的回调
  137. const regionConfirmType=(e : any)=>{
  138. state.form.type=state.typeList[e]
  139. }
  140. //替换图片地址
  141. const strReplace = (str : string) => {
  142. return str.replace('192.168.101.145:9000', envs[process.env.NODE_ENV].baseUrl)
  143. }
  144. const goBankCard=()=>{
  145. navTo(`/subpackage/personal-center/setting/bank-card/bank-card`);
  146. }
  147. </script>
  148. <style scoped>
  149. .content{
  150. background-color:rgb(246,246,246);
  151. font-size:30rpx;
  152. padding-bottom: 30rpx;
  153. }
  154. .up_img_wrap{
  155. background-color:white;
  156. padding:0 20rpx;
  157. }
  158. .title{
  159. margin:0 0 20rpx 0;
  160. }
  161. .tips{
  162. color:red;
  163. font-size:30rpx;
  164. }
  165. .item_wrap{
  166. display: flex;
  167. flex-shrink: 1;
  168. flex-wrap: wrap;
  169. justify-content: space-between;
  170. padding:10rpx 0 20rpx 0;
  171. }
  172. .item{
  173. width:45%;
  174. height:250rpx;
  175. margin-top:20rpx;
  176. }
  177. .item image{
  178. width:100%;
  179. height:80%;
  180. }
  181. .item view{
  182. text-aline:center;
  183. text-align: center;
  184. }
  185. .message{
  186. margin-top:30rpx;
  187. }
  188. .pay_msg{
  189. border-bottom: 2px dotted rgb(75,217,97);
  190. padding:30rpx 0;
  191. }
  192. .company{
  193. padding: 20rpx 50rpx 20rpx 6rpx;
  194. display:flex;
  195. align-items: center;
  196. justify-content: space-between;
  197. }
  198. .phone{
  199. margin-top:20rpx;
  200. }
  201. .attention{
  202. background-color:rgb(246,246,246);
  203. color:red;
  204. font-size:30rpx;
  205. padding:30rpx 20rpx 20rpx 20rpx;
  206. }
  207. </style>