From 5fe7427421961e8d15b2b6e5d41240939185f954 Mon Sep 17 00:00:00 2001
From: zhaoxiaoqiang <287285524@qq.com>
Date: Fri, 05 Aug 2022 14:57:34 +0800
Subject: [PATCH] 上传

---
 src/components/upload/uploadIdCard.vue |   72 ++++++++++++++++++++++++------------
 1 files changed, 48 insertions(+), 24 deletions(-)

diff --git a/src/components/upload/uploadIdCard.vue b/src/components/upload/uploadIdCard.vue
index c624e71..a21ddc4 100644
--- a/src/components/upload/uploadIdCard.vue
+++ b/src/components/upload/uploadIdCard.vue
@@ -1,7 +1,7 @@
 <!--
  * @Date: 2019-08-30 18:04:49
  * @LastEditors: zxq
- * @LastEditTime: 2022-08-04 15:18:51
+ * @LastEditTime: 2022-08-05 14:56:46
  * @Description:
  -->
 <template>
@@ -20,32 +20,44 @@
     </div>
     <!-- 真正的上传按钮-->
     <div>
-      <input
-        style="display: none;cursor:pointer"
-        type="file"
-        id='androidInputFileImage'
-        ref="androidInputFileImage"
-        @change="handlePhotoChange($event,1)"
-        accept="image/jpg, image/jpeg, image/png"
-      />
-      <input
-        style="display: none;cursor:pointer;"
-        type="file"
-        id='androidInputFileCapture'
-        ref="androidInputFileCapture"
-        @change="handlePhotoChange($event,2)"
-        accept="image/*"
-        capture="camera"
-      />
+    
+      
     </div>
     <!--选择上传图片还是拍照-->
-    <van-action-sheet
+    <!-- <van-action-sheet
       v-model="selectModel"
       :close-on-click-overlay="false"
       cancel-text="取消"
       :actions="nav"
       @select="handleMenuSelect"
-    ></van-action-sheet>
+    ></van-action-sheet> -->
+    <van-action-sheet v-model="selectModel" cancel-text="取消" title="标题">
+      <div class="content">
+        <div class="upload_input">
+                <div>拍照</div>
+                <input
+                  style="cursor:pointer;width:100%;opacity:0;"
+                  type="file"
+                  id='inputFileCapture'
+                  ref="androidInputFileCapture"
+                  @change="handlePhotoChange($event,2)"
+                  accept="image/*"
+                  capture="camera"
+                />
+          </div>
+          <div class="upload_input">
+              <div>本地相册上传</div>
+              <input
+                  style="cursor:pointer;width:100%;opacity: 0;"
+                  type="file"
+                  id='inputFileImage'
+                  ref="androidInputFileImage"
+                  @change="handlePhotoChange($event,1)"
+                  accept="image/jpg, image/jpeg, image/png"
+                />
+          </div>
+      </div>
+    </van-action-sheet>
     <!-- <button @click="onclick">aa</button> -->
   </div>
 </template>
@@ -64,7 +76,7 @@
   data() {
     return {
       selectModel: false, // 模态窗选择拍照还是相册
-      nav: [{ name: "拍照" }, { name: "从手机相册选择" }],
+      nav: [{ name: "拍照",code:0 }, { name: "从手机相册选择",code:1 }],
       picList: [{}, {}],
       picZ: {},
       picF: {},
@@ -312,8 +324,8 @@
       this.selectModel = true;
     },
     // 选择拍照或者相册选项
-    handleMenuSelect(item, index) {
-      console.log(this.$refs)
+    handleMenuSelect(index) {
+      console.log( this.$children[0]  )
       if (index === 0) {
         this.$refs.androidInputFileCapture.click();
       } else {
@@ -360,8 +372,20 @@
 };
 </script>
 
-<style lang="less" scoped >
+<style lang="less"  >
 .component-photo-upload {
+  .upload_input{
+    font-size: 14px;
+    width: 100%;
+    height: 45px;
+    position: relative;
+    text-align: center;
+    input{
+      position: absolute;
+      left: 0;
+      top: 0;
+    }
+  }
   .pic-title {
     h4 {
       padding: 10px 0;

--
Gitblit v1.8.0