From f962bac7ae51dd51466fb76bf73ec98d800581e1 Mon Sep 17 00:00:00 2001
From: xiaoxiao <xiaoxiao.hao@yoho.cn>
Date: Tue, 14 Jun 2016 15:46:37 +0800
Subject: [PATCH] 历史搜索页面

---
 static/sass/index/_search.css                           | 27 +++++++++++++++++++--------
 template/m.yohobuy.com/actions/index/search/index.phtml | 34 ++++++++++++++++++++--------------
 2 files changed, 39 insertions(+), 22 deletions(-)

diff --git a/static/sass/index/_search.css b/static/sass/index/_search.css
index bb9af8e..458bf9d 100644
--- a/static/sass/index/_search.css
+++ b/static/sass/index/_search.css
@@ -73,14 +73,6 @@
             white-space: nowrap;
         }
 
-        .clear-history {
-            height: 64px;
-            line-height: 64px;
-            border: 1px solid #e6e6e6;
-            background: #fff;
-            font-size: 28px;
-        }
-
         .clear-icon{
             float: right;
             background: #fff;
@@ -89,6 +81,25 @@
         span{
             margin-right: 5px;
         }
+        
+        .search-group{
+            border-bottom: 1px solid #e6e6e6;
+            margin: 15px 0px;
+            
+            .search-content-title{
+                height: 40px;
+                .left{
+                    float: left;
+                }
+                .right{
+                    float: right;
+                }
+            }
+
+            .search-content{
+                clear: both;
+            }
+        }
     }
 }
 
diff --git a/template/m.yohobuy.com/actions/index/search/index.phtml b/template/m.yohobuy.com/actions/index/search/index.phtml
index 76d9880..19ac6ee 100644
--- a/template/m.yohobuy.com/actions/index/search/index.phtml
+++ b/template/m.yohobuy.com/actions/index/search/index.phtml
@@ -11,21 +11,27 @@
             </form>
         </div>
         <div class="search-items">
-            <div class="hot-search hide">
-                <h3>热门搜索</h3>
-                <ul class="hot clearfix">
-                    {{# hot}}
-                        <li>
-                            <a href={{url}}>{{name}}</a>
-                        </li>
-                    {{/ hot}}
-                </ul>
+            <div class="search-group history-search hide">
+                <div class="search-content-title">
+                    <h3 class="left">最近搜索</h3>
+                    <i id="clear-history" class="right iconfont hide"></i>
+                </div>
+                <div class="search-content">
+                    <ul class="history clearfix"></ul>
+                </div>
             </div>
-            <div class="history-search hide">
-                <h3>历史搜索</h3>
-                <ul class="history clearfix"></ul>
-            </div>
-            <button id="clear-history" class="clear-history hide">清空搜索历史</button>
+            {{#if hotTerms}}
+                <div class="search-group hot-search">
+                    <h3>热门搜索</h3>
+                    <ul class="hot clearfix">
+                        {{# hotTerms}}
+                            <li>
+                                <a href='/?query={{content}}'>{{content}}</a>
+                            </li>
+                        {{/ hotTerms}}
+                    </ul>
+                </div>
+            {{/if}}
         </div>
     {{/ search}}
 </div>
--
libgit2 0.24.0