lookCard.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586
  1. <template>
  2. <view>
  3. <view v-for='(item,index) in cardList' class="">
  4. {{item.certificateName}}
  5. <text v-if='item.personNo'>({{item.personNo1}})</text>
  6. <u-icon v-if='item.personNo' @click='clip(0,item)' name="file-text-fill" color="#2979ff" size="28"></u-icon>
  7. <text v-if='item.bankNo'>({{item.bankNo1}})</text>
  8. <u-icon v-if='item.bankNo' @click='clip(1,item)' name="file-text-fill" color="#2979ff" size="28"></u-icon>
  9. <view @click='imageOCR(item)'>{{text}}</view>
  10. <image :src="item.certificateImage" mode=""></image>
  11. </view>
  12. <u-picker @cancel='show=false' @confirm='pickerConfirm' title='识别类型' :show="show" :columns="columns"></u-picker>
  13. </view>
  14. </template>
  15. <script>
  16. export default {
  17. data() {
  18. return {
  19. cardList:[],
  20. show:false,
  21. currectData:{},
  22. text:'识别号码'
  23. }
  24. },
  25. onLoad(options) {
  26. this.cardList=options.cardList
  27. },
  28. methods: {
  29. imageOCR(item){
  30. this.currectData=item
  31. this.show=true
  32. },
  33. getCountdownTime(e) {
  34. this.countdownTime = 60
  35. let timer = setInterval(() => {
  36. this.countdownTime--;
  37. if (this.countdownTime < 1) {
  38. clearInterval(timer)
  39. this.countdownTime = 0
  40. uni.showLoading({
  41. title: '数据加载中',
  42. mask:true
  43. })
  44. var type='',type1=''
  45. if(e.value[0]=='识别身份证号'){
  46. type='admin.unimall.certificateManagementInfo'
  47. type1='personShibie'
  48. }else if(e.value[0]=='识别银行卡号'){
  49. type='admin.unimall.certificateManagementInfo'
  50. type1='bankShibie'
  51. }
  52. this.$request.baseRequest(type, type1,{certificateImage:this.currectData.certificateImage}, failres => {
  53. console.log('res+++++', failres.errmsg)
  54. this.$refs.uToast.show({
  55. type: 'error',
  56. message: failres.errmsg,
  57. })
  58. uni.hideLoading()
  59. }).then(res => {
  60. console.log(res.data)
  61. this.$refs.uToast.show({
  62. type: 'success',
  63. message: '识别成功',
  64. })
  65. uni.hideLoading()
  66. this.credentials=res.data
  67. this.credentialsShow=true
  68. })
  69. }
  70. }, 1000)
  71. },
  72. pickerConfirm(e){
  73. this.show=false
  74. this.getCountdownTime(e)
  75. console.log(e)
  76. },
  77. }
  78. }
  79. </script>
  80. <style>
  81. </style>