更新从数据库加载数据的方法
This commit is contained in:
parent
2f9b6ddd64
commit
b76b96e223
|
|
@ -216,8 +216,14 @@ app.controller('hotCtr', ['$scope', '$state', '$stateParams', '$filter', '$windo
|
||||||
}
|
}
|
||||||
|
|
||||||
function getHotBookmarksbyCache() {
|
function getHotBookmarksbyCache() {
|
||||||
|
var date = curentDate($scope.curDay, "yyyyMMdd");
|
||||||
|
if (date < "20160715") {
|
||||||
|
$scope.loadBusy = false;
|
||||||
|
toastr.info('您已将将所有的热门标签都加载完了!', "提示");
|
||||||
|
return; // 这是最早的了。
|
||||||
|
}
|
||||||
var params = {
|
var params = {
|
||||||
date: curentDate($scope.curDay, "yyyyMMdd"),
|
date: date,
|
||||||
}
|
}
|
||||||
$scope.loadBusy = true;
|
$scope.loadBusy = true;
|
||||||
bookmarkService.getHotBookmarks(params)
|
bookmarkService.getHotBookmarks(params)
|
||||||
|
|
@ -230,12 +236,16 @@ app.controller('hotCtr', ['$scope', '$state', '$stateParams', '$filter', '$windo
|
||||||
})
|
})
|
||||||
$scope.curDay--;
|
$scope.curDay--;
|
||||||
$scope.loadBusy = false;
|
$scope.loadBusy = false;
|
||||||
|
if (data && data.length == 0) {
|
||||||
|
getHotBookmarksbyCache(); // 没有继续请求
|
||||||
|
}
|
||||||
updateEditPos();
|
updateEditPos();
|
||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
toastr.error("getHotBookmarksbyCache: " + JSON.stringify(err), "提示");
|
toastr.error("getHotBookmarksbyCache: " + JSON.stringify(err), "提示");
|
||||||
$scope.curDay--;
|
$scope.curDay--;
|
||||||
$scope.loadBusy = false;
|
$scope.loadBusy = false;
|
||||||
|
getHotBookmarksbyCache(); // 没有继续请求
|
||||||
updateEditPos();
|
updateEditPos();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -26,6 +26,6 @@
|
||||||
<div style="width:22px;height:22px;" class="js-hot-random" ng-click="randomHotBookmarks()" title="随机查看热门收藏,如需回到最新热门收藏,请点击菜单按钮热门收藏" ng-show="!loadBusy">
|
<div style="width:22px;height:22px;" class="js-hot-random" ng-click="randomHotBookmarks()" title="随机查看热门收藏,如需回到最新热门收藏,请点击菜单按钮热门收藏" ng-show="!loadBusy">
|
||||||
<img class="ui ui middle aligned tiny image" ng-src="./images/random.png">
|
<img class="ui ui middle aligned tiny image" ng-src="./images/random.png">
|
||||||
</div>
|
</div>
|
||||||
<div class="ui massive text centered inline loader" ng-class="{active:loadBusy, disabled:!loadBusy}" style="top:15px;">
|
<div class="ui massive text centered inline loader js-hot-loader" ng-class="{active:loadBusy, disabled:!loadBusy}" style="top:15px;">
|
||||||
正在加载中...</div>
|
正在加载中...</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue