zhaoxiaoqiang
2022-08-05 110a4a1e4bff178eab5b5c2bd90a8cda632dc4c1
src/components/upload/uploadIdCard.vue
@@ -24,8 +24,8 @@
        <input
          style="cursor:pointer"
          type="file"
          id="androidInputFileImage"
          ref="androidInputFileImage"
          ref="uploadImg"
          @change="handlePhotoChange($event, 1)"
          accept="image/jpg, image/jpeg, image/png"
        />
@@ -34,7 +34,7 @@
        <input
          style="cursor:pointer"
          type="file"
          id="androidInputFileCapture"
          ref="androidInputFileCapture"
          @change="handlePhotoChange($event, 2)"
          accept="image/*"
@@ -319,16 +319,20 @@
    handleMenuSelect(item, index) {
      console.log(this.$refs);
      console.log(this.$refs.androidInputFileCapture);
      console.log(this.$refs.androidInputFileImage);
      console.log(this.$refs.uploadImg);
      console.log(document.getElementById('androidInputFileCapture'));
      if (index === 0) {
        // this.$refs.androidInputFileCapture.dispatchEvent(
        //   new MouseEvent("click")
        // );
        this.$refs.androidInputFileCapture._proto_.click();
         this.$nextTick(()=>{
          this.$refs.androidInputFileCapture.click();
         })
      } else {
        // this.$refs.androidInputFileImage.dispatchEvent(new MouseEvent("click"));
        this.$refs.androidInputFileImage.click();
         this.$nextTick(()=>{
            this.$refs.uploadImg.click();
         })
      }
      this.selectModel = false;
    },
@@ -363,11 +367,7 @@
        return "default";
      }
    },
  },
  created() {
    //  let
    //  console.log(shebei);
  },
  }
};
</script>