mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-23 21:36:37 +08:00
优化代码
This commit is contained in:
parent
bcf3ee4e51
commit
ae27483ca5
@ -1,54 +1,53 @@
|
||||
(function(vc,vm){
|
||||
(function(vc, vm) {
|
||||
|
||||
vc.extends({
|
||||
data:{
|
||||
deleteAppUserBindingOwnerInfo:{
|
||||
data: {
|
||||
deleteAppUserBindingOwnerInfo: {
|
||||
|
||||
}
|
||||
},
|
||||
_initMethod:function(){
|
||||
_initMethod: function() {
|
||||
|
||||
},
|
||||
_initEvent:function(){
|
||||
vc.on('deleteAppUserBindingOwner','openDeleteAppUserBindingOwnerModal',function(_params){
|
||||
},
|
||||
_initEvent: function() {
|
||||
vc.on('deleteAppUserBindingOwner', 'openDeleteAppUserBindingOwnerModal', function(_params) {
|
||||
|
||||
vc.component.deleteAppUserBindingOwnerInfo = _params;
|
||||
$('#deleteAppUserBindingOwnerModel').modal('show');
|
||||
|
||||
});
|
||||
},
|
||||
methods:{
|
||||
deleteAppUserBindingOwner:function(){
|
||||
methods: {
|
||||
deleteAppUserBindingOwner: function() {
|
||||
//vc.component.deleteAppUserBindingOwnerInfo.communityId=vc.getCurrentCommunity().communityId;
|
||||
vc.http.apiPost(
|
||||
'owner.deleteAppUserBindingOwner',
|
||||
JSON.stringify(vc.component.deleteAppUserBindingOwnerInfo),
|
||||
{
|
||||
emulateJSON:true
|
||||
},
|
||||
function(json,res){
|
||||
JSON.stringify(vc.component.deleteAppUserBindingOwnerInfo), {
|
||||
emulateJSON: true
|
||||
},
|
||||
function(json, res) {
|
||||
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
|
||||
//let _json = JSON.parse(json);
|
||||
let _json = JSON.parse(json);
|
||||
//let data = res.data;
|
||||
if (res.status == 200) {
|
||||
if (_json.code == 0) {
|
||||
//关闭model
|
||||
$('#deleteAppUserBindingOwnerModel').modal('hide');
|
||||
//vc.component.clearAddAppUserBindingOwnerInfo();
|
||||
vc.emit('auditAppUserBindingOwnerManage','listAuditAppUserBindingOwner', {});
|
||||
vc.emit('auditAppUserBindingOwnerManage', 'listAuditAppUserBindingOwner', {});
|
||||
return;
|
||||
}
|
||||
vc.toast(json);
|
||||
},
|
||||
function(errInfo,error){
|
||||
vc.toast(_json.msg);
|
||||
},
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
vc.toast(errInfo);
|
||||
|
||||
});
|
||||
});
|
||||
},
|
||||
closeDeleteAppUserBindingOwnerModel:function(){
|
||||
closeDeleteAppUserBindingOwnerModel: function() {
|
||||
$('#deleteAppUserBindingOwnerModel').modal('hide');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
})(window.vc,window.vc.component);
|
||||
})(window.vc, window.vc.component);
|
||||
@ -1,7 +1,7 @@
|
||||
/**
|
||||
入驻小区
|
||||
**/
|
||||
(function (vc) {
|
||||
(function(vc) {
|
||||
var DEFAULT_PAGE = 1;
|
||||
var DEFAULT_ROWS = 10;
|
||||
vc.extends({
|
||||
@ -23,22 +23,22 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
_initMethod: function () {
|
||||
_initMethod: function() {
|
||||
vc.component._listAuditAppUserBindingOwners(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
},
|
||||
_initEvent: function () {
|
||||
vc.on('auditAppUserBindingOwnerManage', 'listAuditAppUserBindingOwner', function (_param) {
|
||||
_initEvent: function() {
|
||||
vc.on('auditAppUserBindingOwnerManage', 'listAuditAppUserBindingOwner', function(_param) {
|
||||
vc.component._listAuditAppUserBindingOwners(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
});
|
||||
vc.on('auditAppUserBindingOwnerManage', 'auditMessage', function (_auditInfo) {
|
||||
vc.on('auditAppUserBindingOwnerManage', 'auditMessage', function(_auditInfo) {
|
||||
vc.component._auditAppUserBindingOwner(_auditInfo);
|
||||
});
|
||||
vc.on('pagination', 'page_event', function (_currentPage) {
|
||||
vc.on('pagination', 'page_event', function(_currentPage) {
|
||||
vc.component._listAuditAppUserBindingOwners(_currentPage, DEFAULT_ROWS);
|
||||
});
|
||||
},
|
||||
methods: {
|
||||
_listAuditAppUserBindingOwners: function (_page, _rows) {
|
||||
_listAuditAppUserBindingOwners: function(_page, _rows) {
|
||||
vc.component.auditAppUserBindingOwnerManageInfo.conditions.page = _page;
|
||||
vc.component.auditAppUserBindingOwnerManageInfo.conditions.row = _rows;
|
||||
vc.component.auditAppUserBindingOwnerManageInfo.conditions.communityId = vc.getCurrentCommunity().communityId;
|
||||
@ -46,11 +46,10 @@
|
||||
params: vc.component.auditAppUserBindingOwnerManageInfo.conditions
|
||||
};
|
||||
//发送get请求
|
||||
vc.http.get('auditAppUserBindingOwnerManage',
|
||||
'list',
|
||||
vc.http.apiGet('/owner.listAuditAppUserBindingOwners',
|
||||
param,
|
||||
function (json, res) {
|
||||
var _auditAppUserBindingOwnerManageInfo = JSON.parse(json);
|
||||
function(json, res) {
|
||||
let _auditAppUserBindingOwnerManageInfo = JSON.parse(json);
|
||||
vc.component.auditAppUserBindingOwnerManageInfo.total = _auditAppUserBindingOwnerManageInfo.total;
|
||||
vc.component.auditAppUserBindingOwnerManageInfo.records = _auditAppUserBindingOwnerManageInfo.records;
|
||||
vc.component.auditAppUserBindingOwnerManageInfo.auditAppUserBindingOwners = _auditAppUserBindingOwnerManageInfo.auditAppUserBindingOwners;
|
||||
@ -59,50 +58,51 @@
|
||||
dataCount: vc.component.auditAppUserBindingOwnerManageInfo.total,
|
||||
currentPage: _page
|
||||
});
|
||||
}, function (errInfo, error) {
|
||||
},
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
}
|
||||
);
|
||||
},
|
||||
_openAuditAppUserBindingOwnerModel: function (_auditAppUserBindingOwner) {
|
||||
_openAuditAppUserBindingOwnerModel: function(_auditAppUserBindingOwner) {
|
||||
vc.component.auditAppUserBindingOwnerManageInfo.currentAppUserId = _auditAppUserBindingOwner.appUserId;
|
||||
vc.emit('audit', 'openAuditModal', {});
|
||||
},
|
||||
_auditAppUserBindingOwner: function (_auditInfo) {
|
||||
_auditAppUserBindingOwner: function(_auditInfo) {
|
||||
_auditInfo.communityId = vc.getCurrentCommunity().communityId;
|
||||
_auditInfo.appUserId = vc.component.auditAppUserBindingOwnerManageInfo.currentAppUserId;
|
||||
//发送get请求
|
||||
vc.http.post('auditAppUserBindingOwnerManage',
|
||||
'audit',
|
||||
JSON.stringify(_auditInfo),
|
||||
{
|
||||
JSON.stringify(_auditInfo), {
|
||||
emulateJSON: true
|
||||
},
|
||||
function (json, res) {
|
||||
function(json, res) {
|
||||
vc.toast("处理成功");
|
||||
vc.component._listAuditAppUserBindingOwners(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
}, function (errInfo, error) {
|
||||
},
|
||||
function(errInfo, error) {
|
||||
console.log('请求失败处理');
|
||||
vc.toast("处理失败:" + errInfo);
|
||||
}
|
||||
);
|
||||
},
|
||||
_moreCondition: function () {
|
||||
_moreCondition: function() {
|
||||
if (vc.component.auditAppUserBindingOwnerManageInfo.moreCondition) {
|
||||
vc.component.auditAppUserBindingOwnerManageInfo.moreCondition = false;
|
||||
} else {
|
||||
vc.component.auditAppUserBindingOwnerManageInfo.moreCondition = true;
|
||||
}
|
||||
},
|
||||
_queryAuditAppUserBindingOwnerMethod: function () {
|
||||
_queryAuditAppUserBindingOwnerMethod: function() {
|
||||
vc.component._listAuditAppUserBindingOwners(DEFAULT_PAGE, DEFAULT_ROWS);
|
||||
},
|
||||
_deleteAppUserBindingOwnerModel: function (_auditAppUserBindingOwner) {
|
||||
_deleteAppUserBindingOwnerModel: function(_auditAppUserBindingOwner) {
|
||||
vc.emit('deleteAppUserBindingOwner', 'openDeleteAppUserBindingOwnerModal', _auditAppUserBindingOwner);
|
||||
},
|
||||
_resetUserPwdModel: function (_staff) {
|
||||
_resetUserPwdModel: function(_staff) {
|
||||
vc.emit('resetStaffPwd', 'openResetStaffPwd', _staff);
|
||||
}
|
||||
}
|
||||
});
|
||||
})(window.vc);
|
||||
})(window.vc);
|
||||
Loading…
Reference in New Issue
Block a user