diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index b1b1f3858..91dc41015 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -67,7 +67,7 @@ app.factory('rms', function(){ 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){ return url; }; @@ -78,6 +78,12 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h $scope.activities = rms.get("activities") || []; if($scope.activities.length>0){ + + $timeout(function () { + $window.scroll(0,rms.get("yoffset")); + }); + + return; } @@ -101,6 +107,8 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h 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; console.log(response.data);