From b76b96e223c164ec121c61c004846b901b7ee11e Mon Sep 17 00:00:00 2001 From: luchenqun Date: Sat, 18 Mar 2017 18:33:14 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BB=8E=E6=95=B0=E6=8D=AE?= =?UTF-8?q?=E5=BA=93=E5=8A=A0=E8=BD=BD=E6=95=B0=E6=8D=AE=E7=9A=84=E6=96=B9?= =?UTF-8?q?=E6=B3=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/scripts/controllers/hot-controller.js | 12 +++++++++++- public/views/hot.html | 6 +++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/public/scripts/controllers/hot-controller.js b/public/scripts/controllers/hot-controller.js index 7cacdeb..f7913bd 100644 --- a/public/scripts/controllers/hot-controller.js +++ b/public/scripts/controllers/hot-controller.js @@ -216,8 +216,14 @@ app.controller('hotCtr', ['$scope', '$state', '$stateParams', '$filter', '$windo } function getHotBookmarksbyCache() { + var date = curentDate($scope.curDay, "yyyyMMdd"); + if (date < "20160715") { + $scope.loadBusy = false; + toastr.info('您已将将所有的热门标签都加载完了!', "提示"); + return; // 这是最早的了。 + } var params = { - date: curentDate($scope.curDay, "yyyyMMdd"), + date: date, } $scope.loadBusy = true; bookmarkService.getHotBookmarks(params) @@ -230,12 +236,16 @@ app.controller('hotCtr', ['$scope', '$state', '$stateParams', '$filter', '$windo }) $scope.curDay--; $scope.loadBusy = false; + if (data && data.length == 0) { + getHotBookmarksbyCache(); // 没有继续请求 + } updateEditPos(); }) .catch((err) => { toastr.error("getHotBookmarksbyCache: " + JSON.stringify(err), "提示"); $scope.curDay--; $scope.loadBusy = false; + getHotBookmarksbyCache(); // 没有继续请求 updateEditPos(); }); } diff --git a/public/views/hot.html b/public/views/hot.html index a7678d9..58a1f29 100644 --- a/public/views/hot.html +++ b/public/views/hot.html @@ -7,13 +7,13 @@
- +
{{ bookmark.created_by }} ·{{ bookmark.fav_count }}人收藏 - +
@@ -26,6 +26,6 @@
-
+
正在加载中...