diff --git a/public/javascripts/wechat/app.js b/public/javascripts/wechat/app.js index 641e95bed..edd8b5386 100644 --- a/public/javascripts/wechat/app.js +++ b/public/javascripts/wechat/app.js @@ -75,6 +75,11 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h console.log("ActivityController load"); $scope.page = 0; + var current_page = rms.get('current_page'); + if(typeof current_page !== 'undefined'){ + $scope.page = current_page; + } + $scope.activities = rms.get("activities") || []; var savePageConfig = function(){ @@ -84,13 +89,11 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h } var loadPageConfig = function(){ - var current_page = rms.get('current_page'); + var has_more = rms.get('has_more'); var activities = rms.get('activities'); - if(typeof current_page !== 'undefined'){ - $scope.page = current_page; - } + if(typeof has_more !== 'undefined'){ $scope.has_more = has_more; } @@ -98,7 +101,7 @@ app.controller('ActivityController',function($anchorScroll, $location,$scope, $h } var loadActData = function(page){ - if (page <= 0 && $scope.activities.length >0){ //应该是返回过来的 + if (page > 0 && $scope.activities.length >0){ //应该是返回过来的 loadPageConfig(); var yOffset = rms.get("yoffset"); $location.hash(yOffset);