优化业主编辑

This commit is contained in:
java110 2020-06-22 16:20:49 +08:00
parent 9206c7518d
commit 10f45db35d
2 changed files with 9 additions and 5 deletions

View File

@ -197,6 +197,7 @@
} }
}, },
_uploadPhoto: function (event) { _uploadPhoto: function (event) {
console.log('上传图片');
$("#uploadOwnerPhoto").trigger("click") $("#uploadOwnerPhoto").trigger("click")
}, },
_choosePhoto: function (event) { _choosePhoto: function (event) {

View File

@ -142,16 +142,19 @@
}); });
}, },
clearEditOwnerInfo: function () { clearEditOwnerInfo: function () {
let _componentTitle = $that.editOwnerInfo.componentTitle;
vc.component.editOwnerInfo = { vc.component.editOwnerInfo = {
componentTitle: _componentTitle,
ownerId: '', ownerId: '',
memberId: '', memberId: '',
ownerTypeCd: '',
name: '', name: '',
age: '', age: '',
link: '', link: '',
sex: '', sex: '',
remark: '', remark: '',
idCard: '',
ownerPhoto: '', ownerPhoto: '',
idCard: '',
videoPlaying: false videoPlaying: false
}; };
}, },
@ -166,8 +169,8 @@
vc.component.editOwnerInfo.videoPlaying = false; vc.component.editOwnerInfo.videoPlaying = false;
var constraints = { var constraints = {
video: { video: {
width:208, width: 208,
height:208 height: 208
}, },
audio: false audio: false
}; };
@ -196,8 +199,8 @@
var video = document.getElementById('ownerPhotoForEdit'); var video = document.getElementById('ownerPhotoForEdit');
canvas.width = 208; canvas.width = 208;
canvas.height = 208; canvas.height = 208;
canvas.getContext('2d').drawImage(video, 0,0,208,208); canvas.getContext('2d').drawImage(video, 0, 0, 208, 208);
var data = canvas.toDataURL('image/jpeg',1.0); var data = canvas.toDataURL('image/jpeg', 1.0);
vc.component.editOwnerInfo.ownerPhoto = data; vc.component.editOwnerInfo.ownerPhoto = data;
//document.getElementById('photo').setAttribute('src', data); //document.getElementById('photo').setAttribute('src', data);
} }