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