unserver-unify
Version:
36 lines (35 loc) • 1.14 kB
JavaScript
angular.module('bamboo.exhibition').controller('ExhibitionCompanysCtrl', function($scope, ApiService, $stateParams) {
var _self = this;
// CommonService.showInfo("news controller");
console.log("---- ExhibitionCompanysCtrl -----");
this.id = $stateParams.nid;
this.defaultPhoto = ApiService.SHOST + "/public/images/details.png";
this.productpath = ApiService.SHOST + '/company/';
this.page = 0;
this.items = [];
this.itemNumber = 10;
$scope.setting = {
hasPhoto: false,
pageSize: _self.itemNumber,
currentPage: (_self.page + 1)
};
function getitems() {
var info = {
page: $scope.setting.currentPage - 1,
limit: $scope.setting.pageSize,
action: "getexhibitioncompanys",
exid: _self.id
};
ApiService.post("/business", info).then(function(result) {
console.log(result);
if (result.data.success) {
if (!_self.items) {
_self.items = [];
}
_self.items = _self.items.concat(result.data.data.items);
_self.totalCount = result.data.data.counter;
}
});
}
getitems();
});