Commit cf6e6249 authored by Steven杜宇's avatar Steven杜宇

// 搜索

parent fd233090
...@@ -45,19 +45,25 @@ class YHHomePageViewController: YHBaseViewController { ...@@ -45,19 +45,25 @@ class YHHomePageViewController: YHBaseViewController {
lazy var searchView: YHHomeSearchView = { lazy var searchView: YHHomeSearchView = {
let view = YHHomeSearchView() let view = YHHomeSearchView()
let tap = UITapGestureRecognizer(target: self, action: #selector(didSearchBarClicked))
view.addGestureRecognizer(tap)
return view return view
}() }()
lazy var homeHeaderView: YHHomeHeadView = { lazy var homeHeaderView: YHHomeHeadView = {
let view = YHHomeHeadView() let view = YHHomeHeadView()
return view return view
}() }()
@objc func didSearchBarClicked() {
let vc = YHSearchInfomationVC()
self.navigationController?.pushViewController(vc)
}
} }
private extension YHHomePageViewController { private extension YHHomePageViewController {
func setupUI() { func setupUI() {
gk_navTitle = "" gk_navigationBar.isHidden = true
view.backgroundColor = .white view.backgroundColor = .white
view.addSubview(searchView) view.addSubview(searchView)
......
...@@ -20,6 +20,7 @@ class YHSearchInfomationVC: YHBaseViewController { ...@@ -20,6 +20,7 @@ class YHSearchInfomationVC: YHBaseViewController {
lazy var searchHistoryView: YHSearchInfoHistoryView = { lazy var searchHistoryView: YHSearchInfoHistoryView = {
let view = YHSearchInfoHistoryView(frame: CGRect(x: 0, y: searchBar.frame.maxY+8, width: KScreenWidth, height: KScreenHeight-searchBar.frame.maxY-8)) let view = YHSearchInfoHistoryView(frame: CGRect(x: 0, y: searchBar.frame.maxY+8, width: KScreenWidth, height: KScreenHeight-searchBar.frame.maxY-8))
view.isHidden = true
view.selectBlock = { view.selectBlock = {
[weak self] text in [weak self] text in
guard let self = self else { return } guard let self = self else { return }
......
...@@ -198,12 +198,6 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource { ...@@ -198,12 +198,6 @@ extension YHMyViewController : UITableViewDelegate, UITableViewDataSource {
if (indexPath.row >= items.count) { return } if (indexPath.row >= items.count) { return }
// if true {
// let vc = YHSearchInfomationVC()
// self.navigationController?.pushViewController(vc)
// return
// }
if !checkLogin() { if !checkLogin() {
let vc = UINavigationController(rootVC: YHPhoneLoginViewController()) let vc = UINavigationController(rootVC: YHPhoneLoginViewController())
vc.modalPresentationStyle = .custom vc.modalPresentationStyle = .custom
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment