This commit is contained in:
guange 2016-06-07 17:17:14 +08:00
parent 5fe41d80e9
commit 8fb88dfdea
1 changed files with 9 additions and 1 deletions

View File

@ -67,7 +67,7 @@ app.factory('rms', function(){
return {save: save, get: get}; return {save: save, get: get};
}); });
app.controller('ActivityController',function($anchorScroll, $location,$scope, $http, auth, rms, common){ app.controller('ActivityController',function($anchorScroll, $location,$scope, $http, $document,$window, auth, rms, common){
$scope.replaceUrl = function(url){ $scope.replaceUrl = function(url){
return url; return url;
}; };
@ -78,6 +78,12 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h
$scope.activities = rms.get("activities") || []; $scope.activities = rms.get("activities") || [];
if($scope.activities.length>0){ if($scope.activities.length>0){
$timeout(function () {
$window.scroll(0,rms.get("yoffset"));
});
return; return;
} }
@ -101,6 +107,8 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h
rms.save("activities", $scope.activities); rms.save("activities", $scope.activities);
rms.save("yoffset", $document.body.scrollHeight);
$scope.has_more = (response.data.count + response.data.page * 10) < response.data.all_count; $scope.has_more = (response.data.count + response.data.page * 10) < response.data.all_count;
console.log(response.data); console.log(response.data);