zhaoxiaoqiang
2022-08-05 6d01c9373f912f46fc10b25a5096152d2794ade5
src/components/upload/uploadIdCard.vue
@@ -24,7 +24,7 @@
        <input
          style="cursor:pointer"
          type="file"
          id="androidInputFileImage"
          ref="androidInputFileImage"
          @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/*"
@@ -317,15 +317,22 @@
    },
    // 选择拍照或者相册选项
    handleMenuSelect(item, index) {
      console.log(this.$refs.androidInputFileCapture, index);
      console.log(this.$refs);
      console.log(this.$refs.androidInputFileCapture);
      console.log(this.$refs.androidInputFileImage);
      console.log(document.getElementById('androidInputFileCapture'));
      if (index === 0) {
        // this.$refs.androidInputFileCapture.dispatchEvent(
        //   new MouseEvent("click")
        // );
        this.$refs.androidInputFileCapture.click();
         this.$nextTick(()=>{
          this.$refs.androidInputFileCapture.click();
         })
      } else {
        // this.$refs.androidInputFileImage.dispatchEvent(new MouseEvent("click"));
        this.$refs.androidInputFileImage.click();
         this.$nextTick(()=>{
            this.$refs.androidInputFileImage.click();
         })
      }
      this.selectModel = false;
    },