Authored by hf

fixes bug to search nav bar

@@ -32,7 +32,7 @@ @@ -32,7 +32,7 @@
32 </header> 32 </header>
33 <div class="search-page yoho-page"> 33 <div class="search-page yoho-page">
34 <div id="search-input" class="search-input"> 34 <div id="search-input" class="search-input">
35 - <form id="search-form" action=http://search.dev.yohobuy.com method="get"> 35 + <form id="search-form" action=http://search.test.yoho.cn method="get">
36 <i class="search-icon iconfont">&#xe60f;</i> 36 <i class="search-icon iconfont">&#xe60f;</i>
37 <input type="text" placeholder="搜索商品" name="query"> 37 <input type="text" placeholder="搜索商品" name="query">
38 <i class="clear-input iconfont hide">&#xe626;</i> 38 <i class="clear-input iconfont hide">&#xe626;</i>
@@ -30,7 +30,7 @@ class BoysController extends AbstractAction @@ -30,7 +30,7 @@ class BoysController extends AbstractAction
30 // 渲染模板并输出 30 // 渲染模板并输出
31 $this->_view->display('index', array( 31 $this->_view->display('index', array(
32 'boysHomePage' => true, 32 'boysHomePage' => true,
33 - 'homeHeader' => array('searchUrl' => Helpers::url('/search.html', null, 'search')), 33 + 'homeHeader' => array('searchUrl' => Helpers::url('/search', null, 'search')),
34 'showFooterTab' => false, 34 'showFooterTab' => false,
35 'maybeLike' => true, 35 'maybeLike' => true,
36 'content' => Index\HomeModel::getBoysFloor(), 36 'content' => Index\HomeModel::getBoysFloor(),
@@ -25,7 +25,7 @@ class GirlsController extends AbstractAction @@ -25,7 +25,7 @@ class GirlsController extends AbstractAction
25 // 渲染模板并输出 25 // 渲染模板并输出
26 $this->_view->display('index', array( 26 $this->_view->display('index', array(
27 'grilsHomePage' => true, 27 'grilsHomePage' => true,
28 - 'homeHeader' => array('searchUrl' => Helpers::url('/search.html', null, 'search')), 28 + 'homeHeader' => array('searchUrl' => Helpers::url('/search', null, 'search')),
29 'showFooterTab' => false, 29 'showFooterTab' => false,
30 'maybeLike' => true, 30 'maybeLike' => true,
31 'content' => Index\HomeModel::getGirlsFloor(), 31 'content' => Index\HomeModel::getGirlsFloor(),
@@ -25,7 +25,7 @@ class KidsController extends AbstractAction @@ -25,7 +25,7 @@ class KidsController extends AbstractAction
25 // 渲染模板并输出 25 // 渲染模板并输出
26 $this->_view->display('index', array( 26 $this->_view->display('index', array(
27 'kidsHomePage' => true, 27 'kidsHomePage' => true,
28 - 'homeHeader' => array('searchUrl' => Helpers::url('/search.html', null, 'search')), 28 + 'homeHeader' => array('searchUrl' => Helpers::url('/search', null, 'search')),
29 'showFooterTab' => false, 29 'showFooterTab' => false,
30 'maybeLike' => true, 30 'maybeLike' => true,
31 'content' => Index\HomeModel::getKidsFloor(), 31 'content' => Index\HomeModel::getKidsFloor(),
@@ -25,7 +25,7 @@ class LifestyleController extends AbstractAction @@ -25,7 +25,7 @@ class LifestyleController extends AbstractAction
25 // 渲染模板并输出 25 // 渲染模板并输出
26 $this->_view->display('index', array( 26 $this->_view->display('index', array(
27 'lifestyleHomePage' => true, 27 'lifestyleHomePage' => true,
28 - 'homeHeader' => array('searchUrl' => Helpers::url('/search.html', null, 'search')), 28 + 'homeHeader' => array('searchUrl' => Helpers::url('/search', null, 'search')),
29 'showFooterTab' => false, 29 'showFooterTab' => false,
30 'maybeLike' => true, 30 'maybeLike' => true,
31 'content' => Index\HomeModel::getLifestyleFloor(), 31 'content' => Index\HomeModel::getLifestyleFloor(),
@@ -17,8 +17,8 @@ class SearchController extends AbstractAction @@ -17,8 +17,8 @@ class SearchController extends AbstractAction
17 public function indexAction() 17 public function indexAction()
18 { 18 {
19 $this->setNavHeader('搜索', true, SITE_MAIN); 19 $this->setNavHeader('搜索', true, SITE_MAIN);
20 -  
21 - $this->_view->html('search'); 20 +
  21 + //$this->_view->html('search');
22 $this->_view->display('index', array( 22 $this->_view->display('index', array(
23 'search' => array('url' => Helpers::url('', null, 'search')), 23 'search' => array('url' => Helpers::url('', null, 'search')),
24 'showDownloadApp' => true, 24 'showDownloadApp' => true,
@@ -125,6 +125,9 @@ class SearchController extends AbstractAction @@ -125,6 +125,9 @@ class SearchController extends AbstractAction
125 } 125 }
126 126
127 $data = array(); 127 $data = array();
  128 + $data['goodListPage'] = true;
  129 + $data['goodList'] = $condition;
  130 + $data['query'] = $query;
128 // 搜索是一级品类 131 // 搜索是一级品类
129 if ($isQueryFirstClass) { 132 if ($isQueryFirstClass) {
130 $this->setTitle('全部' . $query); 133 $this->setTitle('全部' . $query);
@@ -139,16 +142,12 @@ class SearchController extends AbstractAction @@ -139,16 +142,12 @@ class SearchController extends AbstractAction
139 else { 142 else {
140 if ($haveQuery) { 143 if ($haveQuery) {
141 $data['goodList']['search']['default'] = $query; 144 $data['goodList']['search']['default'] = $query;
142 - $data['goodList']['search']['default'] = $query; 145 + $data['goodList']['search']['url'] = Helpers::url('', null, 'search');
143 } 146 }
144 $this->setTitle('搜索'); 147 $this->setTitle('搜索');
145 $this->setNavHeader('搜索', true, SITE_MAIN); 148 $this->setNavHeader('搜索', true, SITE_MAIN);
146 } 149 }
147 150
148 - $data['goodListPage'] = true;  
149 - $data['goodList'] = $condition;  
150 - $data['query'] = $query;  
151 -  
152 // // 查询数据 151 // // 查询数据
153 // if (!isset($condition['query'])) { 152 // if (!isset($condition['query'])) {
154 // $data['goodList'] += Product\ListModel::getClassData($condition); 153 // $data['goodList'] += Product\ListModel::getClassData($condition);