Browse Source

图像识别

zhujindu 1 năm trước cách đây
mục cha
commit
698e5a3423
2 tập tin đã thay đổi với 21 bổ sung5 xóa
  1. 14 3
      src/components/imageAIVerifyErr.vue
  2. 7 2
      src/components/uploadImgVStore.vue

+ 14 - 3
src/components/imageAIVerifyErr.vue

@@ -1,10 +1,10 @@
 <template>
   <div class="imageAIVerifyErr">
-    <van-popup v-model="imageAIVerifyFlag">
+    <van-popup v-model="true" @close="close">
       <div class="title">图像识别结果</div>
       <div class="content">
         <div class="AIVerify">{{ contentMessage }}</div>
-        <van-cell>
+        <van-cell @uploadImg="uploadImg">
           <template #title> <span class="van-f-red">*</span>重新拍照上传</template>
           <template #right-icon>
             <van-icon
@@ -107,12 +107,15 @@ export default {
     },
     // 重新拍照
     uploadImg() {
-      this.$emit('uploadImg');
+      this.$emit('uploadImgFun');
     },
     // 仍要上传
     confirmUpload() {
       this.$emit('confirmUpload', { data: this.imageAIVerifyData });
     },
+    close() {
+      this.$emit('close');
+    },
   },
 };
 </script>
@@ -137,5 +140,13 @@ export default {
     text-align: center;
     padding: 5px;
   }
+  .content {
+    .AIVerify {
+      padding: 5px;
+      font-size: 12px;
+      color: red;
+      text-align: center;
+    }
+  }
 }
 </style>

+ 7 - 2
src/components/uploadImgVStore.vue

@@ -25,10 +25,12 @@
         :format="format"></el-progress>
     </div>
     <imageAIVerifyErr
+      v-if="imageAIVerifyFlag"
       :imageAIVerifyFlag="imageAIVerifyFlag"
       :imageAIVerifyData="imageAIVerifyData"
       @confirmUpload="confirmUpload"
-      @uploadImg="uploadImg"></imageAIVerifyErr>
+      @uploadImgFun="uploadImg"
+      @close="close"></imageAIVerifyErr>
   </div>
 </template>
 
@@ -201,8 +203,8 @@ export default {
       this.progressFlag = true;
       this.percentage = 10;
       this.timeFlag = setInterval(() => {
-        if (this.percentage == 90) clearInterval(this.timeFlag);
         this.percentage = this.percentage + 10;
+        if (this.percentage == 90) clearInterval(this.timeFlag);
       }, 1000);
     },
     format(percentage) {
@@ -250,6 +252,9 @@ export default {
     confirmUpload(res) {
       this.normalFlow(res);
     },
+    close() {
+      this.imageAIVerifyFlag = false;
+    },
   },
 };
 </script>