mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-24 05:46:03 +08:00
优化采购提示消息不准确问题
This commit is contained in:
parent
3028f2156e
commit
56996d2063
@ -29,16 +29,16 @@
|
||||
_initEvent: function () {
|
||||
vc.on('addOwner', 'openAddOwnerModal', function (_ownerId) {
|
||||
if (_ownerId != null || _ownerId != -1) {
|
||||
vc.component.addOwnerInfo.ownerId = _ownerId;
|
||||
$that.addOwnerInfo.ownerId = _ownerId;
|
||||
}
|
||||
$('#addOwnerModel').modal('show');
|
||||
vc.component._initAddOwnerMedia();
|
||||
$that._initAddOwnerMedia();
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
addOwnerValidate: function () {
|
||||
return vc.validate.validate({
|
||||
addOwnerInfo: vc.component.addOwnerInfo
|
||||
addOwnerInfo: $that.addOwnerInfo
|
||||
}, {
|
||||
'addOwnerInfo.name': [
|
||||
{
|
||||
@ -96,23 +96,23 @@
|
||||
},
|
||||
saveOwnerInfo: function () {
|
||||
let _url = "/owner.saveOwner";
|
||||
if (!vc.component.addOwnerValidate()) {
|
||||
if (!$that.addOwnerValidate()) {
|
||||
vc.toast(vc.validate.errInfo);
|
||||
return;
|
||||
}
|
||||
if (vc.component.addOwnerInfo.componentTitle == '成员' && vc.component.addOwnerInfo.ownerTypeCd == '') {
|
||||
if ($that.addOwnerInfo.componentTitle == '成员' && $that.addOwnerInfo.ownerTypeCd == '') {
|
||||
vc.toast("人员类型不能为空");
|
||||
return;
|
||||
}
|
||||
if (vc.component.addOwnerInfo.componentTitle == '业主') {
|
||||
vc.component.addOwnerInfo.ownerTypeCd = '1001';
|
||||
if ($that.addOwnerInfo.componentTitle == '业主') {
|
||||
$that.addOwnerInfo.ownerTypeCd = '1001';
|
||||
}
|
||||
if ($that.addOwnerInfo.ownerTypeCd && $that.addOwnerInfo.ownerTypeCd != '1001') {
|
||||
_url = "/owner.saveOwnerMember"
|
||||
}
|
||||
vc.component.addOwnerInfo.communityId = vc.getCurrentCommunity().communityId;
|
||||
$that.addOwnerInfo.communityId = vc.getCurrentCommunity().communityId;
|
||||
vc.http.apiPost(_url,
|
||||
JSON.stringify(vc.component.addOwnerInfo), {
|
||||
JSON.stringify($that.addOwnerInfo), {
|
||||
emulateJSON: true
|
||||
},
|
||||
function (json, res) {
|
||||
@ -121,9 +121,9 @@
|
||||
if (_json.code == 0) {
|
||||
//关闭model
|
||||
$('#addOwnerModel').modal('hide');
|
||||
//vc.component.clearAddOwnerInfo();
|
||||
//$that.clearAddOwnerInfo();
|
||||
vc.toast("添加成功");
|
||||
vc.emit($props.notifyLoadDataComponentName, 'listOwnerData', vc.component.addOwnerInfo);
|
||||
vc.emit($props.notifyLoadDataComponentName, 'listOwnerData', $that.addOwnerInfo);
|
||||
return;
|
||||
} else {
|
||||
vc.toast(_json.msg);
|
||||
@ -136,7 +136,7 @@
|
||||
},
|
||||
clearAddOwnerInfo: function () {
|
||||
let _componentTitle = $that.addOwnerInfo.componentTitle;
|
||||
vc.component.addOwnerInfo = {
|
||||
$that.addOwnerInfo = {
|
||||
componentTitle: _componentTitle,
|
||||
name: '',
|
||||
age: '',
|
||||
@ -162,7 +162,7 @@
|
||||
navigator.msGetUserMedia || null;
|
||||
},
|
||||
_initAddOwnerMedia: function () {
|
||||
if (vc.component._addUserMedia()) {
|
||||
if ($that._addUserMedia()) {
|
||||
var constraints = {
|
||||
video: true,
|
||||
audio: false
|
||||
@ -177,17 +177,17 @@
|
||||
video.srcObject = stream;
|
||||
}
|
||||
video.play();
|
||||
vc.component.addOwnerInfo.videoPlaying = true;
|
||||
$that.addOwnerInfo.videoPlaying = true;
|
||||
}, function (error) {
|
||||
vc.component.addOwnerInfo.videoPlaying = false;
|
||||
$that.addOwnerInfo.videoPlaying = false;
|
||||
});
|
||||
} else {
|
||||
vc.component.addOwnerInfo.videoPlaying = false;
|
||||
$that.addOwnerInfo.videoPlaying = false;
|
||||
console.log("初始化视频失败");
|
||||
}
|
||||
},
|
||||
_takePhoto: function () {
|
||||
if (vc.component.addOwnerInfo.videoPlaying) {
|
||||
if ($that.addOwnerInfo.videoPlaying) {
|
||||
var canvas = document.getElementById('canvas');
|
||||
var video = document.getElementById('ownerPhoto');
|
||||
let w = video.videoWidth;
|
||||
@ -211,7 +211,7 @@
|
||||
let data = canvas.toDataURL('image/jpeg', 0.3);
|
||||
// 改为异步上传图片
|
||||
this._doUploadImageAddOwner(vc.dataURLtoFile(data, $that.addOwnerInfo.name));
|
||||
// vc.component.addOwnerInfo.ownerPhoto = data;
|
||||
// $that.addOwnerInfo.ownerPhoto = data;
|
||||
//document.getElementById('photo').setAttribute('src', data);
|
||||
//关闭拍照摄像头
|
||||
$that._closeVedio();
|
||||
@ -220,7 +220,7 @@
|
||||
}
|
||||
},
|
||||
_uploadPhoto: function (event) {
|
||||
//vc.component.addOwnerInfo.ownerPhoto = "";
|
||||
//$that.addOwnerInfo.ownerPhoto = "";
|
||||
$("#uploadOwnerPhoto").trigger("click")
|
||||
},
|
||||
_choosePhoto: function (event) {
|
||||
@ -238,7 +238,7 @@
|
||||
// reader.readAsDataURL(file); //读取为base64
|
||||
// reader.onloadend = function (e) {
|
||||
// vc.translate(reader.result, function (_data) {
|
||||
// vc.component.addOwnerInfo.ownerPhoto = _data;
|
||||
// $that.addOwnerInfo.ownerPhoto = _data;
|
||||
// })
|
||||
// }
|
||||
}
|
||||
@ -266,9 +266,9 @@
|
||||
// }
|
||||
var data = JSON.parse(json);
|
||||
console.log(data);
|
||||
vc.component.addOwnerInfo.ownerPhoto = data.fileId;
|
||||
vc.component.addOwnerInfo.ownerPhotoUrl = data.url;
|
||||
console.log(vc.component.addOwnerInfo.ownerPhotoUrl)
|
||||
$that.addOwnerInfo.ownerPhoto = data.fileId;
|
||||
$that.addOwnerInfo.ownerPhotoUrl = data.url;
|
||||
console.log($that.addOwnerInfo.ownerPhotoUrl)
|
||||
},
|
||||
function (errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
@ -277,13 +277,13 @@
|
||||
);
|
||||
},
|
||||
_reOpenVedio: function () {
|
||||
vc.component.addOwnerInfo.ownerPhoto = "";
|
||||
vc.component.addOwnerInfo.ownerPhotoUrl = "";
|
||||
vc.component._initAddOwnerMedia();
|
||||
$that.addOwnerInfo.ownerPhoto = "";
|
||||
$that.addOwnerInfo.ownerPhotoUrl = "";
|
||||
$that._initAddOwnerMedia();
|
||||
},
|
||||
_closeVedio: function () {
|
||||
if (vc.component.addOwnerInfo.mediaStreamTrack != null) {
|
||||
vc.component.addOwnerInfo.mediaStreamTrack.stop();
|
||||
if ($that.addOwnerInfo.mediaStreamTrack != null) {
|
||||
$that.addOwnerInfo.mediaStreamTrack.stop();
|
||||
}
|
||||
},
|
||||
_loadOwnerAttrSpec: function () {
|
||||
|
||||
@ -89,7 +89,7 @@
|
||||
//关闭model
|
||||
$('#buyCarMonthCardModel').modal('hide');
|
||||
|
||||
vc.emit('carMonthOrder', 'listCarMonthOrder', {});
|
||||
vc.goBack();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user