更新一下搜索

This commit is contained in:
luchenqun 2017-03-01 12:41:21 +08:00
parent 36f73ecb76
commit cdc35c22cd
2 changed files with 7 additions and 7 deletions

View File

@ -44,6 +44,7 @@ app.controller('menuCtr', ['$scope', '$stateParams', '$state', 'pubSubService',
$state.go('search', { $state.go('search', {
searchWord: searchWord, searchWord: searchWord,
}) })
$scope.login = true;
updateMenuActive($scope.selectLoginIndex = 0); updateMenuActive($scope.selectLoginIndex = 0);
} }

View File

@ -36,6 +36,11 @@ app.controller('searchCtr', ['$scope', '$state', '$stateParams', '$filter', '$wi
$scope.tags = data; $scope.tags = data;
}) })
.catch((err) => console.log('getTags err', err)); .catch((err) => console.log('getTags err', err));
// 默认登陆
pubSubService.publish('Common.menuActive', {
login: true,
index: 0
});
var searchParams = { var searchParams = {
searchWord: $scope.searchWord, searchWord: $scope.searchWord,
@ -46,7 +51,7 @@ app.controller('searchCtr', ['$scope', '$state', '$stateParams', '$filter', '$wi
if ($scope.searchWord) { if ($scope.searchWord) {
searchBookmarks(searchParams); searchBookmarks(searchParams);
} else { } else {
$state.go('/', {}) toastr.warning("请先登录然后再输入关键字进行查询", "提示");
} }
$scope.jumpToUrl = function(url, id) { $scope.jumpToUrl = function(url, id) {
@ -171,12 +176,6 @@ app.controller('searchCtr', ['$scope', '$state', '$stateParams', '$filter', '$wi
$scope.bookmarkCount = data.totalItems; $scope.bookmarkCount = data.totalItems;
$scope.totalPages = Math.ceil($scope.bookmarkCount / perPageItems); $scope.totalPages = Math.ceil($scope.bookmarkCount / perPageItems);
$scope.loading = false; $scope.loading = false;
// 有点问题,暂时留在这里
// pubSubService.publish('Common.menuActive', {
// login: true,
// index: 0
// });
}) })
.catch((err) => { .catch((err) => {
console.log('getBookmarks err', err); console.log('getBookmarks err', err);