mirror of
https://gitee.com/java110/MicroCommunityWeb.git
synced 2026-02-26 16:19:44 +08:00
98 lines
3.9 KiB
JavaScript
98 lines
3.9 KiB
JavaScript
/**
|
|
入驻小区
|
|
**/
|
|
(function (vc) {
|
|
var DEFAULT_PAGE = 1;
|
|
var DEFAULT_ROWS = 10;
|
|
vc.extends({
|
|
data: {
|
|
aOwnerDetailAppUserInfo: {
|
|
appUsers: [],
|
|
ownerId: '',
|
|
name: '',
|
|
currentAppUserId: ''
|
|
}
|
|
},
|
|
_initMethod: function () {
|
|
},
|
|
_initEvent: function () {
|
|
vc.on('aOwnerDetailAppUser', 'switch', function (_data) {
|
|
$that.aOwnerDetailAppUserInfo.ownerId = _data.ownerId;
|
|
$that._loadAOwnerDetailAppUserData(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
});
|
|
vc.on('aOwnerDetailAppUser', 'paginationPlus', 'page_event',
|
|
function (_currentPage) {
|
|
$that._loadAOwnerDetailAppUserData(_currentPage, DEFAULT_ROWS);
|
|
});
|
|
vc.on('aOwnerDetailAppUser', 'listAuditAppUserBindingOwner', function (_param) {
|
|
$that._loadAOwnerDetailAppUserData(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
});
|
|
vc.on('aOwnerDetailAppUser', 'auditMessage', function (_auditInfo) {
|
|
$that._auditAppUserBindingOwner(_auditInfo);
|
|
});
|
|
},
|
|
methods: {
|
|
_loadAOwnerDetailAppUserData: function (_page, _row) {
|
|
let param = {
|
|
params: {
|
|
memberId: $that.aOwnerDetailAppUserInfo.ownerId,
|
|
name: $that.aOwnerDetailAppUserInfo.name,
|
|
page: _page,
|
|
row: _row
|
|
}
|
|
};
|
|
|
|
//发送get请求
|
|
vc.http.apiGet('/owner.listAdminAppUserOwners',
|
|
param,
|
|
function (json) {
|
|
let _roomInfo = JSON.parse(json);
|
|
$that.aOwnerDetailAppUserInfo.appUsers = _roomInfo.data;
|
|
vc.emit('aOwnerDetailAppUser', 'paginationPlus', 'init', {
|
|
total: _roomInfo.records,
|
|
dataCount: _roomInfo.total,
|
|
currentPage: _page
|
|
});
|
|
},
|
|
function () {
|
|
console.log('请求失败处理');
|
|
}
|
|
);
|
|
},
|
|
//查询
|
|
_qureyAOwnerDetailAppUser: function () {
|
|
$that._loadAOwnerDetailAppUserData(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
},
|
|
|
|
_openAuditAppUserBindingOwnerModel: function (_auditAppUserBindingOwner) {
|
|
$that.aOwnerDetailAppUserInfo.currentAppUserId = _auditAppUserBindingOwner.appUserId;
|
|
vc.emit('audit', 'openAuditModal', {});
|
|
},
|
|
_auditAppUserBindingOwner: function (_auditInfo) {
|
|
_auditInfo.communityId = vc.getCurrentCommunity().communityId;
|
|
_auditInfo.appUserId = $that.aOwnerDetailAppUserInfo.currentAppUserId;
|
|
//发送get请求
|
|
vc.http.apiPost('/owner.updateAppUserBindingOwner',
|
|
JSON.stringify(_auditInfo), {
|
|
emulateJSON: true
|
|
},
|
|
function (json, res) {
|
|
vc.toast("处理成功");
|
|
$that._loadAOwnerDetailAppUserData(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
},
|
|
function (errInfo, error) {
|
|
console.log('请求失败处理');
|
|
vc.toast("处理失败:" + errInfo);
|
|
}
|
|
);
|
|
},
|
|
_deleteAppUserBindingOwnerModel: function (_auditAppUserBindingOwner) {
|
|
vc.emit('deleteAppUserBindingOwner', 'openDeleteAppUserBindingOwnerModal', _auditAppUserBindingOwner);
|
|
},
|
|
_resetUserPwdModel: function (_staff) {
|
|
vc.emit('resetStaffPwd', 'openResetStaffPwd', _staff);
|
|
}
|
|
|
|
}
|
|
});
|
|
})(window.vc); |