修改备忘录的一些小bug

This commit is contained in:
luchenqun 2017-05-05 13:24:54 +08:00
parent beb03e04e8
commit 25b182a84e
2 changed files with 5 additions and 2 deletions

View File

@ -13,6 +13,8 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
$scope.totalPages = 0; $scope.totalPages = 0;
$scope.currentPage = 1; $scope.currentPage = 1;
$scope.inputPage = ''; $scope.inputPage = '';
$scope.searchWord = $stateParams.searchWord
$scope.totalItems = 0;
var timeagoInstance = timeago(); var timeagoInstance = timeago();
@ -188,12 +190,13 @@ app.controller('noteCtr', ['$scope', '$state', '$stateParams', '$filter', '$wind
var params = { var params = {
currentPage: $scope.currentPage, currentPage: $scope.currentPage,
perPageItems: perPageItems, perPageItems: perPageItems,
searchWord: $stateParams.searchWord, searchWord: $scope.searchWord,
}; };
bookmarkService.getNotes(params) bookmarkService.getNotes(params)
.then((data) => { .then((data) => {
$scope.notes = data.notes; $scope.notes = data.notes;
$scope.totalPages = Math.ceil(data.totalItems / perPageItems); $scope.totalPages = Math.ceil(data.totalItems / perPageItems);
$scope.totalItems = data.totalItems;
$timeout(function() { $timeout(function() {
timeagoInstance.cancel(); timeagoInstance.cancel();
timeagoInstance.render(document.querySelectorAll('.need_to_be_rendered'), 'zh_CN'); timeagoInstance.render(document.querySelectorAll('.need_to_be_rendered'), 'zh_CN');

View File

@ -44,7 +44,7 @@
</div> </div>
<div class="ui divider"></div> <div class="ui divider"></div>
<div class="ui grid"> <div class="ui grid">
<div class="eight wide column" style="margin-top:10px;">共找到备忘一共约{{notes.length}}个</div> <div class="eight wide column" style="margin-top:10px;"><span ng-show="searchWord">通过搜索关键字"{{searchWord}}"</span>共找到备忘一共约{{totalItems}}个</div>
<div class="eight wide column"> <div class="eight wide column">
<pagination></pagination> <pagination></pagination>
</div> </div>