123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149 |
- <template>
- <view>
- <view v-for='(item,index) in cardList' class="">
- <view style='margin:10px;' class='flex justify-space-between'>
- <view>{{item.certificateName}}</view>
- <view class="flex">
- <view v-if='item.personNo'>({{item.personNo1}})</view>
- <view style='margin:0 10rpx;' class='finished' v-if='item.personNo' @click='clip(0,item)'>
- 复制号码
- </view>
- <text v-if='item.bankNo'>({{item.bankNo1}})</text>
- <view class='finished' v-if='item.bankNo' @click='clip(1,item)' >
- 复制号码
- </view>
- <view :class='countdownTime==0?"finished":"unfinished"' @click='imageOCR(item,index)'>{{text}}</view>
- </view>
-
-
- </view>
- <view style='text-align:center;' class="">
- <image style='width:96%;height:190px;border-radius:20rpx;' :src="item.certificateImage" mode="aspectFill"></image>
- </view>
-
- </view>
- <u-toast ref="uToast"></u-toast>
- <u-picker @cancel='show=false' @confirm='pickerConfirm' title='识别类型' :show="show" :columns="columns"></u-picker>
- </view>
- </template>
- <script>
- export default {
- data() {
- return {
- cardList:[],
- show:false,
- countdownTime:0,
- currectData:{},
- index:0,
- columns: [
- ['识别身份证号', '识别银行卡号']
- ],
- text:'识别号码'
- }
- },
- onLoad(options) {
- console.log(11111)
- this.cardList=JSON.parse(options.dataList);
- console.log(this.cardList,11111111)
- },
- methods: {
- clip(status, item) {
- uni.setClipboardData({
- data: status == 1 ? item.bankNo : item.personNo, // e是你要保存的内容
- success: function() {
- uni.showToast({
- title: '复制成功',
- icon: 'none'
- })
- }
- })
- },
- imageOCR(item,index){
- this.currectData=item
- this.index=index
- this.show=true
- },
- getCountdownTime() {
- this.countdownTime = 60
- let timer = setInterval(() => {
- this.countdownTime--;
- this.text='识别号码('+this.countdownTime+'s)'
- if (this.countdownTime < 1) {
- clearInterval(timer)
- this.countdownTime = 0
- this.text='识别号码'
-
- }
- }, 1000)
- },
- pickerConfirm(e){
-
- this.show=false
-
- if(this.countdownTime==0){
- this.getCountdownTime()
- uni.showLoading({
- title: '数据加载中',
- mask:true
- })
- var type='',type1=''
- if(e.value[0]=='识别身份证号'){
- type='admin.unimall.certificateManagementInfo'
- type1='personShibie'
- }else if(e.value[0]=='识别银行卡号'){
- type='admin.unimall.certificateManagementInfo'
- type1='bankShibie'
- }
- this.$request.baseRequest(type, type1,{certificateImage:this.currectData.certificateImage}, failres => {
- console.log('res+++++', failres.errmsg)
- this.$refs.uToast.show({
- type: 'error',
- message: failres.errmsg,
- })
- uni.hideLoading()
- }).then(res => {
- console.log(res.data.recPersonNo,res.data.bankNo)
- this.$refs.uToast.show({
- type: 'success',
- message: '识别成功',
- })
- uni.hideLoading()
- if(e.value[0]=='识别身份证号'){
- this.cardList[this.index].personNo=res.data.recPersonNo
- this.cardList[this.index].personNo1 = '*' + (this.cardList[this.index].personNo.substring(this.cardList[this.index].personNo.length - 4))
-
- }else if(e.value[0]=='识别银行卡号'){
- this.cardList[this.index].bankNo=res.data.bankNo
- this.cardList[this.index].bankNo1 = '*' + (this.cardList[this.index].bankNo.substring(this.cardList[this.index].bankNo.length - 4))
- }
- this.credentialsShow=true
- })
- }
- console.log(e)
-
- },
- }
- }
- </script>
- <style lang="scss" scoped>
- .finished{
- padding: 10rpx 14rpx;
- text-align: center;
- background: #112253;
- border-radius: 10rpx;
- font-size: 28rpx;
- font-weight: bold;
- color: #FFFFFF;
- }
- .unfinished{
- padding: 10rpx 14rpx;
- text-align: center;
- background: rgba(17, 34, 83, 0.3);
- border-radius: 10rpx;
- font-size: 28rpx;
- font-weight: bold;
- color: #FFFFFF;
- }
- </style>
|