优化代码

This commit is contained in:
java110 2022-04-06 09:31:52 +08:00
parent bcf3ee4e51
commit ae27483ca5
2 changed files with 45 additions and 46 deletions

View File

@ -22,22 +22,21 @@
//vc.component.deleteAppUserBindingOwnerInfo.communityId=vc.getCurrentCommunity().communityId; //vc.component.deleteAppUserBindingOwnerInfo.communityId=vc.getCurrentCommunity().communityId;
vc.http.apiPost( vc.http.apiPost(
'owner.deleteAppUserBindingOwner', 'owner.deleteAppUserBindingOwner',
JSON.stringify(vc.component.deleteAppUserBindingOwnerInfo), JSON.stringify(vc.component.deleteAppUserBindingOwnerInfo), {
{
emulateJSON: true emulateJSON: true
}, },
function(json, res) { function(json, res) {
//vm.menus = vm.refreshMenuActive(JSON.parse(json),0); //vm.menus = vm.refreshMenuActive(JSON.parse(json),0);
//let _json = JSON.parse(json); let _json = JSON.parse(json);
//let data = res.data; //let data = res.data;
if (res.status == 200) { if (_json.code == 0) {
//关闭model //关闭model
$('#deleteAppUserBindingOwnerModel').modal('hide'); $('#deleteAppUserBindingOwnerModel').modal('hide');
//vc.component.clearAddAppUserBindingOwnerInfo(); //vc.component.clearAddAppUserBindingOwnerInfo();
vc.emit('auditAppUserBindingOwnerManage', 'listAuditAppUserBindingOwner', {}); vc.emit('auditAppUserBindingOwnerManage', 'listAuditAppUserBindingOwner', {});
return; return;
} }
vc.toast(json); vc.toast(_json.msg);
}, },
function(errInfo, error) { function(errInfo, error) {
console.log('请求失败处理'); console.log('请求失败处理');

View File

@ -46,11 +46,10 @@
params: vc.component.auditAppUserBindingOwnerManageInfo.conditions params: vc.component.auditAppUserBindingOwnerManageInfo.conditions
}; };
//发送get请求 //发送get请求
vc.http.get('auditAppUserBindingOwnerManage', vc.http.apiGet('/owner.listAuditAppUserBindingOwners',
'list',
param, param,
function(json, res) { function(json, res) {
var _auditAppUserBindingOwnerManageInfo = JSON.parse(json); let _auditAppUserBindingOwnerManageInfo = JSON.parse(json);
vc.component.auditAppUserBindingOwnerManageInfo.total = _auditAppUserBindingOwnerManageInfo.total; vc.component.auditAppUserBindingOwnerManageInfo.total = _auditAppUserBindingOwnerManageInfo.total;
vc.component.auditAppUserBindingOwnerManageInfo.records = _auditAppUserBindingOwnerManageInfo.records; vc.component.auditAppUserBindingOwnerManageInfo.records = _auditAppUserBindingOwnerManageInfo.records;
vc.component.auditAppUserBindingOwnerManageInfo.auditAppUserBindingOwners = _auditAppUserBindingOwnerManageInfo.auditAppUserBindingOwners; vc.component.auditAppUserBindingOwnerManageInfo.auditAppUserBindingOwners = _auditAppUserBindingOwnerManageInfo.auditAppUserBindingOwners;
@ -59,7 +58,8 @@
dataCount: vc.component.auditAppUserBindingOwnerManageInfo.total, dataCount: vc.component.auditAppUserBindingOwnerManageInfo.total,
currentPage: _page currentPage: _page
}); });
}, function (errInfo, error) { },
function(errInfo, error) {
console.log('请求失败处理'); console.log('请求失败处理');
} }
); );
@ -74,14 +74,14 @@
//发送get请求 //发送get请求
vc.http.post('auditAppUserBindingOwnerManage', vc.http.post('auditAppUserBindingOwnerManage',
'audit', 'audit',
JSON.stringify(_auditInfo), JSON.stringify(_auditInfo), {
{
emulateJSON: true emulateJSON: true
}, },
function(json, res) { function(json, res) {
vc.toast("处理成功"); vc.toast("处理成功");
vc.component._listAuditAppUserBindingOwners(DEFAULT_PAGE, DEFAULT_ROWS); vc.component._listAuditAppUserBindingOwners(DEFAULT_PAGE, DEFAULT_ROWS);
}, function (errInfo, error) { },
function(errInfo, error) {
console.log('请求失败处理'); console.log('请求失败处理');
vc.toast("处理失败:" + errInfo); vc.toast("处理失败:" + errInfo);
} }