Files
PropertyDeployment/resources/Web/MicroCommunityWeb/html/components/community/aRoomDetailCar/aRoomDetailCar.js
2025-12-09 20:22:03 +08:00

70 lines
2.4 KiB
JavaScript

/**
入驻小区
**/
(function (vc) {
var DEFAULT_PAGE = 1;
var DEFAULT_ROWS = 10;
vc.extends({
data: {
aRoomDetailCarInfo: {
cars: [],
ownerId: '',
ownerName:'',
carNum: '',
memberId:'',
}
},
_initMethod: function () {
},
_initEvent: function () {
vc.on('aRoomDetailCar', 'switch', function (_data) {
$that.aRoomDetailCarInfo.ownerId = _data.ownerId;
$that.aRoomDetailCarInfo.memberId = _data.carId;
$that.aRoomDetailCarInfo.ownerName = _data.ownerName;
$that._loadARoomDetailCarData(DEFAULT_PAGE, DEFAULT_ROWS);
});
vc.on('aRoomDetailCar', 'paginationPlus', 'page_event',
function (_currentPage) {
$that._loadARoomDetailCarData(_currentPage, DEFAULT_ROWS);
});
vc.on('aRoomDetailCar', 'notify', function (_data) {
$that._loadARoomDetailCarData(DEFAULT_PAGE,DEFAULT_ROWS);
})
},
methods: {
_loadARoomDetailCarData: function (_page, _row) {
let param = {
params: {
ownerId: $that.aRoomDetailCarInfo.ownerId,
carNum: $that.aRoomDetailCarInfo.carNum,
memberId: $that.aRoomDetailCarInfo.memberId,
page: _page,
row: _row
}
};
//发送get请求
vc.http.apiGet('/owner.queryAdminOwnerCars',
param,
function (json) {
let _json = JSON.parse(json);
$that.aRoomDetailCarInfo.cars = _json.data;
vc.emit('aRoomDetailCar', 'paginationPlus', 'init', {
total: _json.records,
dataCount: _json.total,
currentPage: _page
});
},
function () {
console.log('请求失败处理');
}
);
},
//查询
_qureyARoomDetailCar: function () {
$that._loadARoomDetailCarData(DEFAULT_PAGE, DEFAULT_ROWS);
},
}
});
})(window.vc);