From d2063ed3fa6eca739b8f760e2d3c1f61f65b2ba7 Mon Sep 17 00:00:00 2001 From: zhaoxiaoqiang <l287285524@qq.com> Date: Fri, 05 Aug 2022 00:25:45 +0800 Subject: [PATCH] 67 --- src/components/upload/uploadIdCard.vue | 21 +++++++++++---------- 1 files changed, 11 insertions(+), 10 deletions(-) diff --git a/src/components/upload/uploadIdCard.vue b/src/components/upload/uploadIdCard.vue index 16682d3..22fcf62 100644 --- a/src/components/upload/uploadIdCard.vue +++ b/src/components/upload/uploadIdCard.vue @@ -20,21 +20,19 @@ </div> <!-- 真正的上传按钮--> <div> - <label class="upload"> + <!-- <label class="upload" > --> <input - class="sr-only" - style="display: none; cursor: pointer" + style="cursor:pointer" type="file" id="androidInputFileImage" ref="androidInputFileImage" @change="handlePhotoChange($event, 1)" accept="image/jpg, image/jpeg, image/png" /> - </label> - <label class="upload"> + <!-- </label> --> + <!-- <label class="upload" > --> <input - class="sr-only" - style="display: none; cursor: pointer" + style="cursor:pointer" type="file" id="androidInputFileCapture" ref="androidInputFileCapture" @@ -42,7 +40,7 @@ accept="image/*" capture="camera" /> - </label> + <!-- </label> --> </div> <!--选择上传图片还是拍照--> <van-action-sheet @@ -319,12 +317,15 @@ }, // 选择拍照或者相册选项 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(); + this.$refs.androidInputFileCapture._proto_.click(); } else { // this.$refs.androidInputFileImage.dispatchEvent(new MouseEvent("click")); this.$refs.androidInputFileImage.click(); -- Gitblit v1.8.0