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