lookCard.vue 2.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  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. onShow() {
  26. console.log(11111)
  27. this.cardList=uni.getStorageSync('checkedList');
  28. console.log(this.cardList,11111111)
  29. },
  30. methods: {
  31. imageOCR(item){
  32. this.currectData=item
  33. this.show=true
  34. },
  35. getCountdownTime(e) {
  36. this.countdownTime = 60
  37. let timer = setInterval(() => {
  38. this.countdownTime--;
  39. if (this.countdownTime < 1) {
  40. clearInterval(timer)
  41. this.countdownTime = 0
  42. uni.showLoading({
  43. title: '数据加载中',
  44. mask:true
  45. })
  46. var type='',type1=''
  47. if(e.value[0]=='识别身份证号'){
  48. type='admin.unimall.certificateManagementInfo'
  49. type1='personShibie'
  50. }else if(e.value[0]=='识别银行卡号'){
  51. type='admin.unimall.certificateManagementInfo'
  52. type1='bankShibie'
  53. }
  54. this.$request.baseRequest(type, type1,{certificateImage:this.currectData.certificateImage}, failres => {
  55. console.log('res+++++', failres.errmsg)
  56. this.$refs.uToast.show({
  57. type: 'error',
  58. message: failres.errmsg,
  59. })
  60. uni.hideLoading()
  61. }).then(res => {
  62. console.log(res.data)
  63. this.$refs.uToast.show({
  64. type: 'success',
  65. message: '识别成功',
  66. })
  67. uni.hideLoading()
  68. this.credentials=res.data
  69. this.credentialsShow=true
  70. })
  71. }
  72. }, 1000)
  73. },
  74. pickerConfirm(e){
  75. this.show=false
  76. this.getCountdownTime(e)
  77. console.log(e)
  78. },
  79. }
  80. }
  81. </script>
  82. <style>
  83. </style>