无更多动态时不显示更多

This commit is contained in:
cxt 2016-04-08 10:09:45 +08:00
parent bb71d1c322
commit 1503686ddb
2 changed files with 6 additions and 2 deletions

View File

@ -219,7 +219,9 @@
</div>
<div id="more_activities" class="more-events mt10" ng-click="loadActData(page+1);">更多</div>
<div ng-if="(count + page * 10) < all_count">
<div id="more_activities" class="more-events mt10" ng-click="loadActData(page+1);">更多</div>
</div>
</div>

View File

@ -68,7 +68,7 @@ app.controller('ActivityController',function($scope, $http, auth, rms, common){
console.log("ActivityController load");
$scope.activities = rms.get("activities") || [];
$scope.page = 1;
$scope.page = 0;
var loadActData = function(page){
$scope.page = page;
@ -78,6 +78,8 @@ app.controller('ActivityController',function($scope, $http, auth, rms, common){
data: {openid: auth.openid(), page: page}
}).then(function successCallback(response) {
$scope.activities = $scope.activities.concat(response.data.data);
$scope.all_count = response.data.all_count;
$scope.count = response.data.count;
rms.save('activities', $scope.activities);
}, function errorCallback(response) {
});