-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
11 changed files
with
142 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,9 @@ | ||
|
||
<header ng-controller="SearchController"> | ||
<div> | ||
<input id="search_input" ng-model="keywords" type="text" placeholder="请输入关键字"/> | ||
<input id="search_input" ng-model="keywords" type="text" placeholder="请输入关键字" ng-click="goToSearch()"/> | ||
</div> | ||
<div> | ||
<input type="button" id="search_btn" ng-click="search()" value="搜索"/> | ||
<input type="button" id="search_btn" value="搜索"/> | ||
</div> | ||
</header> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<header ng-controller="Search"> | ||
<div> | ||
<input id="search_input" ng-model="keywords" type="text" placeholder="请输入关键字"/> | ||
</div> | ||
<div> | ||
<input type="button" id="search_btn" ng-click="search()" value="搜索"/> | ||
</div> | ||
</header> |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/*负责搜索结果的导向*/ | ||
var Search = function($scope, $rootScope, $location, bookList, musicList, movieList){ | ||
var path = $location.path(); | ||
$rootScope.isNoLoaded = false; | ||
//跳回列表页 | ||
$scope.search = function(){ | ||
var keywords = $scope.keywords; | ||
if(path.indexOf('/book') !== -1){ | ||
if(keywords){ | ||
$rootScope.keywordsObj.book = keywords; | ||
} | ||
$location.path('/book'); | ||
|
||
}else if(path.indexOf('/music') !== -1){ | ||
if(keywords){ | ||
$rootScope.keywordsObj.music = keywords; | ||
} | ||
$location.path('/music'); | ||
|
||
}else if(path.indexOf('/movie') !== -1){ | ||
if(keywords){ | ||
$rootScope.keywordsObj.movie = keywords; | ||
} | ||
$location.path('/movie'); | ||
} | ||
}; | ||
}; | ||
Search.$inject = ['$scope', '$rootScope', '$location', 'bookList', 'musicList', 'movieList']; | ||
app.controller('Search', Search); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
/*仅负责搜索页面的打开*/ | ||
var SearchController = function($scope, $rootScope, $location){ | ||
var path = $location.path(); | ||
$scope.goToSearch = function(){ | ||
if(path.indexOf('/book') !== -1 || path === '/'){ | ||
$location.path('/search/book'); | ||
|
||
}else if(path.indexOf('/music') !== -1 || path === '/music'){ | ||
$location.path('/search/music'); | ||
|
||
|
||
}else if(path.indexOf('/movie') !== -1 || path === '/movie'){ | ||
$location.path('/search/movie'); | ||
} | ||
}; | ||
|
||
}; | ||
|
||
SearchController.$inject = ['$scope', '$rootScope', '$location']; | ||
app.controller('SearchController', SearchController); |