| | |
| | | <h3 class="m-t-none m-b ">添加{{addOwnerInfo.componentTitle}}</h3> |
| | | <div class="ibox-content"> |
| | | <div class="row"> |
| | | <div class="col-sm-5"> |
| | | <video id="ownerPhoto" style="width: 100%;height: 90%;"></video> |
| | | <div class="col-sm-6"> |
| | | <video id="ownerPhoto" style="width: 100%;height: 100%;"></video> |
| | | <canvas id="canvas" style="display:none;"></canvas> |
| | | <button class="btn btn-primary" type="button" v-on:click="_takePhoto()">拍照</button> |
| | | </div> |
| | | <div class="col-sm-7"> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group row"> |
| | | <label class="col-sm-2 col-form-label">名称</label> |
| | | <div class="col-sm-10"><input v-model="addOwnerInfo.name" type="text" |
| | |
| | | sex:'', |
| | | remark:'', |
| | | ownerId:'', |
| | | ownerPhoto:'' |
| | | ownerPhoto:'', |
| | | videoPlaying:false |
| | | } |
| | | }, |
| | | _initMethod:function(){ |
| | |
| | | }, |
| | | _initAddOwnerMedia:function () { |
| | | if(vc.component._addUserMedia()){ |
| | | var videoPlaying = false; |
| | | vc.component.addOwnerInfo.videoPlaying = false; |
| | | var constraints = { |
| | | video: true, |
| | | audio: false |
| | |
| | | video.srcObject = stream; |
| | | } |
| | | video.play(); |
| | | videoPlaying = true; |
| | | vc.component.addOwnerInfo.videoPlaying = true; |
| | | }, function (error) { |
| | | console.log("ERROR"); |
| | | console.log(error); |
| | |
| | | } |
| | | }, |
| | | _takePhoto:function () { |
| | | if (videoPlaying) { |
| | | if (vc.component.addOwnerInfo.videoPlaying) { |
| | | var canvas = document.getElementById('canvas'); |
| | | canvas.width = video.videoWidth; |
| | | canvas.height = video.videoHeight; |