index.vue 6.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. <template>
  2. <view class="rzbox">
  3. <view class="f15 co23 fw5 mb24">请使用注册人身份证</view>
  4. <view class="flexcj mb20">
  5. <view class="carbox" @click="getaddImage('front')">
  6. <image :src="frontimg" class="img" v-if="frontimg"></image>
  7. <image :src="cardz" class="img" v-else></image>
  8. <view class="tit">拍摄正面</view>
  9. <!-- <view class="tit">身份证正面</view> -->
  10. </view>
  11. <view class="carbox" @click="getaddImage('back')">
  12. <image :src="backimg" class="img" v-if="backimg"></image>
  13. <image :src="cardf" class="img" v-else></image>
  14. <view class="tit">拍摄反面</view>
  15. <!-- <view class="tit">身份证反面</view> -->
  16. </view>
  17. </view>
  18. <view class="mb28">
  19. <view class="cardtip">身份信息会跟进上传的证件照片自动识别,支持手动输入</view>
  20. <view class="cardtip">如果识别错误,可尝试再次拍照</view>
  21. </view>
  22. <!-- 身份信息 -->
  23. <uni-forms ref="form" :model="user">
  24. <uni-forms-item label="真实姓名" name="realName">
  25. <uni-easyinput v-model="user.realName" disabled :inputBorder='false' placeholder="自动识别" />
  26. </uni-forms-item>
  27. <uni-forms-item label="身份证号" name="idCard">
  28. <uni-easyinput v-model="user.idCard" disabled :inputBorder='false' placeholder="自动识别" />
  29. </uni-forms-item>
  30. <uni-forms-item label="证件有效期" name="expirationDate">
  31. <uni-easyinput v-model="user.expirationDate" disabled :inputBorder='false' placeholder="自动识别" />
  32. </uni-forms-item>
  33. <uni-forms-item label="居住地址" name="address">
  34. <uni-easyinput type="textarea" :autoHeight="true" disabled v-model="user.address" :inputBorder='false' placeholder="自动识别" />
  35. </uni-forms-item>
  36. <uni-forms-item label="手机号码" name="phone">
  37. <uni-easyinput v-model="user.phone" :inputBorder='false' placeholder="请输入手机号码,以便接收短信" />
  38. </uni-forms-item>
  39. </uni-forms>
  40. <view class="formtip">* 请确保填写的信息准确无误</view>
  41. <view class="rzbtn mt38" @click="getNext">下一步</view>
  42. </view>
  43. </template>
  44. <script>
  45. import config from '@/config'
  46. const baseUrl = config.baseUrl
  47. import {uploadmore} from '@/utils/common.js'
  48. import {getOcrIdCard} from "@/api/mine/card.js"
  49. import { checkPermi, checkRole } from "@/utils/permission"; // 权限判断函数
  50. export default{
  51. components:{},
  52. data(){
  53. return{
  54. cardz:require('@/work/static/images/prove/cardz.png'),
  55. cardf:require('@/work/static/images/prove/cardf.png'),
  56. faceimg:require('@/work/static/images/prove/faceimg.png'),
  57. ftipa:require('@/work/static/images/prove/ftipa.png'),
  58. ftipb:require('@/work/static/images/prove/ftipb.png'),
  59. ftipc:require('@/work/static/images/prove/ftipc.png'),
  60. frontimg:'',
  61. backimg:'',
  62. count:1,
  63. file:[],
  64. user:{
  65. }
  66. }
  67. },
  68. methods:{
  69. checkPermi, checkRole,
  70. getNext(){
  71. this.$tab.navigateTo("/work/pages/prove/face")
  72. },
  73. getaddImage(e){
  74. let that = this;
  75. var rs=['D:\\idcard.png']
  76. if(rs&&rs.length>0){
  77. var obj={
  78. type:e,
  79. // url:baseUrl+rs.join(',')
  80. url:rs.join(',')
  81. }
  82. that.getOcrIdCard(obj)
  83. }
  84. return
  85. let file =[],count=9
  86. // if(e=='zj'){
  87. // file = that.zjfile;
  88. // count=9
  89. // }else{
  90. // file = that.mjfile;
  91. // count=9
  92. // }
  93. uni.chooseImage({
  94. count: 1,
  95. success:function(res){
  96. let img= res.tempFilePaths;
  97. if(img.length + file.length > count){
  98. uni.showToast({
  99. title: '最多上传'+count+'张图片',
  100. icon: 'none',
  101. duration: 2000
  102. })
  103. }else{
  104. let imglen = res.tempFilePaths.length;
  105. var fuwufile = [];
  106. uploadmore('/common/upload',img,0,0,0,imglen,fuwufile,function(rs){
  107. console.log(rs)
  108. // /profile/upload/2024/04/24/a_20240424105401A004.png
  109. // http://192.168.101.168:8056/profile/upload/2024/04/24/a_20240424105401A004.png
  110. if(rs&&rs.length>0){
  111. var obj={
  112. type:e,
  113. url:baseUrl+rs.join(',')
  114. }
  115. that.getOcrIdCard(obj)
  116. }
  117. // if(e=='zj'){
  118. // that.zjfile = that.zjfile.concat(rs);
  119. // that.datainfo.identificationPhoto=that.zjfile.join(',')
  120. // }
  121. })
  122. }
  123. }
  124. });
  125. },
  126. getOcrIdCard(obj){
  127. var params={
  128. image:obj.url,
  129. idCardSide:obj.type
  130. }
  131. getOcrIdCard(params).then(res=>{
  132. if(res.code==200){
  133. this.user=res.data
  134. }
  135. })
  136. }
  137. }
  138. }
  139. </script>
  140. <style>
  141. page{background:#ffffff;}
  142. </style>
  143. <style lang="scss" scoped>
  144. .rzbox /deep/ .uni-forms-item{min-height: 116rpx;box-sizing: border-box;display: flex;align-items: center;margin-bottom: 0;border-bottom: 2rpx solid #E6E6E6;padding:22rpx 0;}
  145. .rzbox /deep/ .uni-forms-item__label{font-weight: bold;font-size: 30rpx;color: #222327;flex: 0 0 auto;width: auto !important;}
  146. .rzbox /deep/ .uni-easyinput{flex: 1;text-align: right;font-size: 30rpx;color: #222327;}
  147. .rzbox /deep/ .uni-easyinput__content-textarea{min-height: 40rpx;font-size: 30rpx;}
  148. .rzbox /deep/ .uni-easyinput__placeholder-class{font-size: 30rpx;color: #AAAAAA;}
  149. .rzbox /deep/ .uni-input-input{font-size: 30rpx;}
  150. .rzbox /deep/ .uni-textarea-textarea{font-size: 30rpx;}
  151. .rzbox /deep/ .is-disabled{color: #222327;background-color: #ffffff !important;}
  152. .rzbox{padding: 44rpx 34rpx 76rpx;
  153. .carbox{width: 320rpx;border-radius: 14rpx;overflow: hidden;
  154. .img{width: 320rpx;height: 216rpx;}
  155. .tit{width: 100%;height: 60rpx;background: #A0C6D5;text-align: center;font-weight: 500;
  156. font-size: 26rpx;line-height: 60rpx;
  157. color: #FFFFFF;}
  158. }
  159. .cardtip{font-weight: 500;font-size: 24rpx;color: #999999;line-height: 40rpx;}
  160. .inttxet{font-weight: 500;font-size: 30rpx;flex: 1;text-align: right;color: #222327;}
  161. .formtip{font-weight: 500;font-size: 24rpx;color: #FF6969;margin-top: 40rpx;text-align: right;}
  162. .rzbtn{width: 100%;background: #00A9F0;border-radius:10rpx;height: 100rpx;display: flex;align-items: center;justify-content: center;font-weight: bold;font-size: 30rpx;color: #FFFFFF;}
  163. }
  164. </style>