76 lines
2.6 KiB
JavaScript
76 lines
2.6 KiB
JavaScript
/**
|
|
入驻小区
|
|
**/
|
|
(function (vc) {
|
|
var DEFAULT_PAGE = 1;
|
|
var DEFAULT_ROWS = 10;
|
|
vc.extends({
|
|
data: {
|
|
carDetailOwnerInfo: {
|
|
owners: [],
|
|
ownerId: '',
|
|
|
|
}
|
|
},
|
|
_initMethod: function () {
|
|
},
|
|
_initEvent: function () {
|
|
vc.on('carDetailOwner', 'switch', function (_data) {
|
|
$that.carDetailOwnerInfo.ownerId = _data.ownerId;
|
|
$that._loadCarDetailOwnerData(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
});
|
|
vc.on('carDetailOwner', 'notify',
|
|
function (_data) {
|
|
$that._loadCarDetailOwnerData(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
});
|
|
vc.on('carDetailOwner', 'paginationPlus', 'page_event',
|
|
function (_currentPage) {
|
|
vc.component._loadCarDetailOwnerData(_currentPage, DEFAULT_ROWS);
|
|
});
|
|
},
|
|
methods: {
|
|
_loadCarDetailOwnerData: function (_page, _row) {
|
|
let param = {
|
|
params: {
|
|
ownerId: $that.carDetailOwnerInfo.ownerId,
|
|
communityId: vc.getCurrentCommunity().communityId,
|
|
ownerTypeCd: '1001',
|
|
page: _page,
|
|
row: _row
|
|
}
|
|
};
|
|
|
|
//发送get请求
|
|
vc.http.apiGet('/owner.queryOwners',
|
|
param,
|
|
function (json) {
|
|
let _roomInfo = JSON.parse(json);
|
|
$that.carDetailOwnerInfo.owners = _roomInfo.data;
|
|
vc.emit('carDetailOwner', 'paginationPlus', 'init', {
|
|
total: _roomInfo.records,
|
|
dataCount: _roomInfo.total,
|
|
currentPage: _page
|
|
});
|
|
},
|
|
function () {
|
|
console.log('请求失败处理');
|
|
}
|
|
);
|
|
},
|
|
//查询
|
|
_qureyCarDetailOwner: function () {
|
|
$that._loadCarDetailOwnerData(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
},
|
|
|
|
|
|
_viewOwnerFace: function (_url) {
|
|
vc.emit('viewImage', 'showImage', {
|
|
url: _url
|
|
});
|
|
},
|
|
_toCarDetailOwnerDetail:function(_owner){
|
|
window.open('/#/pages/owner/ownerDetail?ownerId='+_owner.ownerId);
|
|
}
|
|
}
|
|
});
|
|
})(window.vc); |