65 lines
2.3 KiB
JavaScript
65 lines
2.3 KiB
JavaScript
/**
|
|
入驻小区
|
|
**/
|
|
(function (vc) {
|
|
var DEFAULT_PAGE = 1;
|
|
var DEFAULT_ROWS = 10;
|
|
vc.extends({
|
|
data: {
|
|
goldDetailInfo: {
|
|
goldDetails: [],
|
|
goldId: '',
|
|
goldName: '',
|
|
}
|
|
},
|
|
_initMethod: function () {
|
|
},
|
|
_initEvent: function () {
|
|
vc.on('goldDetail', 'switch', function (_data) {
|
|
$that.goldDetailInfo.goldId = _data.goldId;
|
|
$that.goldDetailInfo.goldName = _data.goldName;
|
|
$that._loadGoldDetailData(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
});
|
|
vc.on('goldDetail', 'paginationPlus', 'page_event',
|
|
function (_currentPage) {
|
|
$that._loadGoldDetailData(_currentPage, DEFAULT_ROWS);
|
|
});
|
|
vc.on('goldDetail', 'notify', function (_data) {
|
|
$that._loadGoldDetailData(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
})
|
|
},
|
|
methods: {
|
|
_loadGoldDetailData: function (_page, _row) {
|
|
let param = {
|
|
params: {
|
|
communityId: vc.getCurrentCommunity().communityId,
|
|
goldId: $that.goldDetailInfo.goldId,
|
|
mallApiCode:'queryPropertyGoldDetailBmoImpl',
|
|
page: _page,
|
|
row: _row
|
|
}
|
|
};
|
|
//发送get请求
|
|
vc.http.apiGet('/mall.getMallOpenApi',
|
|
param,
|
|
function (json) {
|
|
let _json = JSON.parse(json);
|
|
$that.goldDetailInfo.goldDetails = _json.data;
|
|
vc.emit('goldDetail', 'paginationPlus', 'init', {
|
|
total: _json.records,
|
|
dataCount: _json.total,
|
|
currentPage: _page
|
|
});
|
|
},
|
|
function () {
|
|
console.log('请求失败处理');
|
|
}
|
|
);
|
|
},
|
|
//查询
|
|
_qureyGoldDetail: function () {
|
|
$that._loadGoldDetailData(DEFAULT_PAGE, DEFAULT_ROWS);
|
|
},
|
|
}
|
|
});
|
|
})(window.vc); |