Procházet zdrojové kódy

加入 拍照页面优化功能

wuxw před 6 roky
rodič
revize
7ab28c8584

+ 2 - 2
WebService/src/main/resources/components/ownerPackage/add-owner/addOwner.html

@@ -11,10 +11,10 @@
                             <canvas id="canvas" style="display:none;"></canvas>
                             <div style="margin-top:20px">
                                 <button class="btn btn-primary" type="button" v-on:click="_takePhoto()"><span class="glyphicon glyphicon-camera"></span> 拍照</button>
-                                <span class="btn btn-default btn-file">
+                                <span class="btn btn-default btn-file" v-on:click="_uploadPhoto($event)">
                                     <span class="fileinput-new" >上传照片</span>
                                 </span>
-                                <input type="file" class="file" accept="images/*" name="..." v-on:change="_choosePhoto($event)">
+                                <input type="file" class="file" accept="images/*" id="uploadOwnerPhoto" hidden v-on:change="_choosePhoto($event)">
                             </div>
                         </div>
                         <div class="col-sm-6">

+ 3 - 0
WebService/src/main/resources/components/ownerPackage/add-owner/addOwner.js

@@ -190,6 +190,9 @@
                     //document.getElementById('photo').setAttribute('src', data);
                 }
             },
+            _uploadPhoto:function(event){
+                $("#uploadOwnerPhoto").trigger("click")
+            },
             _choosePhoto:function(event){
                 var photoFiles = event.target.files;
                 if (photoFiles && photoFiles.length > 0) {