Authored by xuqi

Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy into develop

@@ -11,8 +11,6 @@ var $ = require('jquery'), @@ -11,8 +11,6 @@ var $ = require('jquery'),
11 11
12 var swiper, 12 var swiper,
13 $fixTitleBar, 13 $fixTitleBar,
14 - $brandText,  
15 - $brandHref,  
16 $brandList = $('.brand-list'); 14 $brandList = $('.brand-list');
17 var $icon = $('.search-icon'); 15 var $icon = $('.search-icon');
18 16
@@ -21,10 +19,6 @@ var searchH = $('.newbrand-search').outerHeight(), @@ -21,10 +19,6 @@ var searchH = $('.newbrand-search').outerHeight(),
21 brandSwipe = parseInt(searchH) + parseInt(headerH) - 1, 19 brandSwipe = parseInt(searchH) + parseInt(headerH) - 1,
22 minBrandListTop, 20 minBrandListTop,
23 searchArray = [], 21 searchArray = [],
24 - clearTextHammer,  
25 - removeHistory,  
26 - searchList,  
27 - yohoHistory,  
28 minBrandListTop; 22 minBrandListTop;
29 23
30 var brandsData, 24 var brandsData,
@@ -118,21 +112,6 @@ function searchResult() { @@ -118,21 +112,6 @@ function searchResult() {
118 112
119 // 插入 dom,绑定事件 113 // 插入 dom,绑定事件
120 $('.search-result').html(html); 114 $('.search-result').html(html);
121 - $('.search-result .brand-list p').each(function (index) {  
122 - searchList = new Hammer($('.search-result .brand-list p').eq(index)[0]);  
123 - searchList.on('tap', function() {  
124 - $brandText = $('.search-result .brand-list p').eq(index).find('a').html();  
125 - $brandHref = $('.search-result .brand-list p').eq(index).find('a').attr('href');  
126 - if (localStorage.getItem('yohoHistory')) {  
127 - yohoHistory = localStorage.getItem('yohoHistory');  
128 - searchArray.push(yohoHistory);  
129 - }  
130 - if (searchArray.toString().split($brandText).length < 2) {  
131 - searchArray.push('{"searchName":"' + $brandText + '","searchHref":"' + $brandText + '"}');  
132 - }  
133 - localStorage.setItem('yohoHistory', searchArray);  
134 - });  
135 - });  
136 } 115 }
137 116
138 if ($('.brand-search-page').length) { 117 if ($('.brand-search-page').length) {
@@ -156,7 +135,6 @@ if ($('.brand-search-page').length) { @@ -156,7 +135,6 @@ if ($('.brand-search-page').length) {
156 clearTextHammer = new Hammer($('.clear-text')[0]); 135 clearTextHammer = new Hammer($('.clear-text')[0]);
157 clearTextHammer.on('tap', function(e) { 136 clearTextHammer.on('tap', function(e) {
158 e.preventDefault(); 137 e.preventDefault();
159 - $('.search-result').html('');  
160 $('#keyword').val('').trigger('input'); 138 $('#keyword').val('').trigger('input');
161 e.srcEvent.stopPropagation(); 139 e.srcEvent.stopPropagation();
162 }); 140 });
@@ -164,20 +142,4 @@ if ($('.brand-search-page').length) { @@ -164,20 +142,4 @@ if ($('.brand-search-page').length) {
164 $('form.search-box').on('submit', function() { 142 $('form.search-box').on('submit', function() {
165 return false; 143 return false;
166 }); 144 });
167 - if (localStorage && localStorage.getItem('yohoHistory')) {  
168 - yohoHistory = $.parseJSON('[' + localStorage.getItem('yohoHistory') + ']');  
169 - if (yohoHistory) {  
170 - $.each(yohoHistory, function(index, content) {  
171 - $('<a href="' + content.searchHref + '">' + content.searchName + '</a>').appendTo('.historyList');  
172 - });  
173 - }  
174 - } else {  
175 - $('.history').css('display', 'none');  
176 - }  
177 -  
178 - removeHistory = new Hammer($('.removeHistory')[0]);  
179 - removeHistory.on('tap', function(e) {  
180 - $('.historyList').html(' ');  
181 - localStorage.clear();  
182 - });  
183 } 145 }
@@ -196,50 +196,4 @@ @@ -196,50 +196,4 @@
196 .search-result { 196 .search-result {
197 padding-top: 176rem / $pxConvertRem; 197 padding-top: 176rem / $pxConvertRem;
198 } 198 }
199 - .history{  
200 - width: 100%;  
201 - height: auto;  
202 - overflow: hidden;  
203 - position: absolute;  
204 - left: 0;  
205 - top: 176rem / $pxConvertRem;  
206 - > h6{  
207 - width: 100%;  
208 - height: 88rem / $pxConvertRem;  
209 - line-height: 88rem / $pxConvertRem;  
210 - color: #999;  
211 - text-indent: .6rem;  
212 - font-size: 36em / $pxConvertRem;  
213 - }  
214 - .historyList{  
215 - width: 100%;  
216 - height: auto;  
217 - overflow: hidden;  
218 - display: block;  
219 - > a{  
220 - width: auto;  
221 - height: 58rem / $pxConvertRem;  
222 - overflow: hidden;  
223 - line-height: 58rem / $pxConvertRem;  
224 - margin: 0 0 20rem / $pxConvertRem .6rem;  
225 - padding: 0 20rem / $pxConvertRem;  
226 - float: left;  
227 - background-color:#f8f8f8;  
228 - color: #444;  
229 - }  
230 - }  
231 - > span{  
232 - width: auto;  
233 - height: 68rem / $pxConvertRem;  
234 - overflow: hidden;  
235 - display: inline-block;  
236 - line-height: 68rem / $pxConvertRem;  
237 - border:1px solid #e6e6e6;  
238 - padding: 0 28rem / $pxConvertRem;  
239 - font-size: 48em / $pxConvertRem;  
240 - margin-left: .6rem;  
241 - color: #000;  
242 - }  
243 - }  
244 -  
245 } 199 }
@@ -10,11 +10,6 @@ @@ -10,11 +10,6 @@
10 </div> 10 </div>
11 </form> 11 </form>
12 </div> 12 </div>
13 - <div class="history">  
14 - <h6>历史纪录</h6>  
15 - <div class="historyList"></div>  
16 - <span class='removeHistory'>清空搜索历史</span>  
17 - </div>  
18 <div class="search-result"> 13 <div class="search-result">
19 </div> 14 </div>
20 </div> 15 </div>