MicroCommunityWeb/public/pages/owner/adminAuthOwner/adminAuthOwner.js
2025-03-15 10:17:27 +08:00

111 lines
4.3 KiB
JavaScript

/**
入驻小区
**/
(function (vc) {
var DEFAULT_PAGE = 1;
var DEFAULT_ROWS = 10;
vc.extends({
data: {
adminAuthOwnerInfo: {
appUsers: [],
total: 0,
records: 1,
moreCondition: false,
currentAppUserId: '',
name: '',
states: [{
name: '全部',
statusCd: ''
}, {
name: '待审核',
statusCd: '10000'
}, {
name: '审核成功',
statusCd: '12000'
}, {
name: '审核失败',
statusCd: '13000'
}],
conditions: {
appUserName: '',
idCard: '',
link: '',
state: '',
appType: '',
appTypeName: '',
memberId: '',
communityId:''
}
}
},
_initMethod: function () {
$that._listAdminAuthOwners(DEFAULT_PAGE, DEFAULT_ROWS);
},
_initEvent: function () {
vc.on('selectAdminCommunity','changeCommunity',function(_community){
$that.adminAuthOwnerInfo.conditions.communityId = _community.communityId;
$that._listAdminAuthOwners(DEFAULT_PAGE, DEFAULT_ROWS);
})
vc.on('adminAuthOwner', 'listAdminAuthOwner', function (_param) {
$that._listAdminAuthOwners(DEFAULT_PAGE, DEFAULT_ROWS);
});
vc.on('adminAuthOwner', 'auditMessage', function (_auditInfo) {
$that._auditAppUserBindingOwner(_auditInfo);
});
vc.on('pagination', 'page_event', function (_currentPage) {
$that._listAdminAuthOwners(_currentPage, DEFAULT_ROWS);
});
},
methods: {
_listAdminAuthOwners: function (_page, _rows) {
$that.adminAuthOwnerInfo.conditions.page = _page;
$that.adminAuthOwnerInfo.conditions.row = _rows;
let param = {
params: $that.adminAuthOwnerInfo.conditions
};
//发送get请求
vc.http.apiGet('/owner.listAdminAppUserOwners',
param,
function (json, res) {
let _json = JSON.parse(json);
$that.adminAuthOwnerInfo.total = _json.total;
$that.adminAuthOwnerInfo.records = _json.records;
$that.adminAuthOwnerInfo.appUsers = _json.data;
vc.emit('pagination', 'init', {
total: $that.adminAuthOwnerInfo.records,
dataCount: $that.adminAuthOwnerInfo.total,
currentPage: _page
});
},
function (errInfo, error) {
console.log('请求失败处理');
}
);
},
_moreCondition: function () {
if ($that.adminAuthOwnerInfo.moreCondition) {
$that.adminAuthOwnerInfo.moreCondition = false;
} else {
$that.adminAuthOwnerInfo.moreCondition = true;
}
},
//查询
_queryAdminAuthOwnerMethod: function () {
$that._listAdminAuthOwners(DEFAULT_PAGE, DEFAULT_ROWS);
},
//重置
_resetAdminAuthOwnerMethod: function () {
$that.adminAuthOwnerInfo.conditions.appUserName = "";
$that.adminAuthOwnerInfo.conditions.idCard = "";
$that.adminAuthOwnerInfo.conditions.state = "";
$that.adminAuthOwnerInfo.conditions.link = "";
$that.adminAuthOwnerInfo.conditions.memberId = "";
$that._listAdminAuthOwners(DEFAULT_PAGE, DEFAULT_ROWS);
},
_swatchState: function (_item) {
$that.adminAuthOwnerInfo.conditions.state = _item.statusCd;
$that._listAdminAuthOwners(DEFAULT_PAGE, DEFAULT_ROWS);
}
}
});
})(window.vc);