From f5da2ba5f670ec2a14082bdaa2492c3735baf181 Mon Sep 17 00:00:00 2001 From: guange <8863824@gmail.com> Date: Tue, 7 Jun 2016 15:40:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=B0=86current=20page=E6=8F=90=E5=89=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/javascripts/wechat/app.js | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) 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);