unserver-unify
Version:
39 lines (38 loc) • 1.33 kB
JavaScript
angular.module('bamboo.exhibition').controller('ExhibitionProductLisCtrl', function($scope,loginService, ApiService, $stateParams) {
var _self = this;
// CommonService.showInfo("news controller");
console.log("---- ExhibitionProductsCtrl -----");
this.id = $stateParams.nid;
this.defaultPhoto = ApiService.SHOST + "/public/images/details.png";
this.productpath = ApiService.SHOST + '/product/';
this.page = 0;
this.items = [];
this.itemNumber = 10;
_self.currency = (loginService.school.currency&&loginService.school.currency.sign)?loginService.school.currency.sign:'$';
$scope.setting = {
hasPhoto: false,
listName: "survey",
pageSize: _self.itemNumber,
currentPage: (_self.page + 1)
};
function getitems() {
var info = {
page: $scope.setting.currentPage - 1,
limit: $scope.setting.pageSize,
action: "getexhibitionproducts",
exId: _self.id
};
console.log(info);
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();
});