...
|
...
|
@@ -17,6 +17,8 @@ var swiper, |
|
|
$genderItem = $('.genderNav li'),
|
|
|
$searchAction = $('.search-action'),
|
|
|
hotBrandsSwiper;
|
|
|
$brandItem = $('.brandNav li'),
|
|
|
$brandWall = $('.branding-wall');
|
|
|
|
|
|
var searchH = $('.newbrand-search').outerHeight(),
|
|
|
headerH = $('.yoho-header').outerHeight(),
|
...
|
...
|
@@ -156,6 +158,8 @@ function searchResult() { |
|
|
// 插入 dom,绑定事件
|
|
|
$('.search-result').html(html);
|
|
|
changeBackground();
|
|
|
var $brandList = $('.brand-list');
|
|
|
writeSearch.bindWirteLocal($brandList);
|
|
|
}
|
|
|
|
|
|
if ($('.brand-search-page').length) {
|
...
|
...
|
@@ -210,3 +214,82 @@ if ($genderItem.length > 0) { |
|
|
setTimeout(reload.bind(this), 100);
|
|
|
});
|
|
|
}
|
|
|
|
|
|
if ($brandItem.length > 0 ) {
|
|
|
$brandItem.on('click', function() {
|
|
|
var index = $(this).data('id');
|
|
|
|
|
|
$('.brandNav ul .active').removeClass('active');
|
|
|
$(this).addClass('active');
|
|
|
|
|
|
|
|
|
if (index === 0){
|
|
|
$brandWall.not('.hide').addClass('hide');
|
|
|
$brandList.removeClass('hide');
|
|
|
}else {
|
|
|
$brandList.not('.hide').addClass('hide');
|
|
|
$brandWall.eq(index).removeClass('hide');
|
|
|
}
|
|
|
|
|
|
});
|
|
|
}
|
|
|
|
|
|
//我添加的
|
|
|
var $ = require('jquery'),
|
|
|
security = require('../plugin/security'),
|
|
|
Hammer = require('yoho.hammer');
|
|
|
|
|
|
var $history = $('.history');
|
|
|
var $historySearch = $('.history-search');
|
|
|
|
|
|
var $clearHistory = $('#clear-history');
|
|
|
|
|
|
var $form = $('#search-form');
|
|
|
|
|
|
var writeSearch = require('./write-search');
|
|
|
|
|
|
var ranToken = writeSearch.getRanToken();
|
|
|
|
|
|
var chHammer, cHammer;
|
|
|
|
|
|
chHammer = new Hammer($clearHistory[0]);
|
|
|
chHammer.on('tap', function() {
|
|
|
localStorage.removeItem('historys-brand');
|
|
|
|
|
|
$history.html('');
|
|
|
$historySearch.hide();
|
|
|
$clearHistory.hide();
|
|
|
|
|
|
window.rePosFooter();
|
|
|
});
|
|
|
|
|
|
//初始化历史搜索的内容
|
|
|
(function() {
|
|
|
var html = '',
|
|
|
history,
|
|
|
historys, i;
|
|
|
|
|
|
if (localStorage) {
|
|
|
historys = localStorage.getItem('historys-brand');
|
|
|
|
|
|
if (historys && historys.length > 0) {
|
|
|
historys = historys.split(ranToken);
|
|
|
for (i = historys.length; i > 0; i--) {
|
|
|
history = historys[i - 1];
|
|
|
|
|
|
if (history === '') {
|
|
|
continue;
|
|
|
}
|
|
|
|
|
|
html += '<li><a href="/?query=' + history + '">' + history + '</li>';
|
|
|
}
|
|
|
|
|
|
$history.html(html);
|
|
|
$clearHistory.removeClass('hide');
|
|
|
$historySearch.removeClass('hide');
|
|
|
window.rePosFooter();
|
|
|
}
|
|
|
}
|
|
|
}());
|
|
|
|
|
|
//writeSearch.bindWirteLocal($form); |
|
|
\ No newline at end of file |
...
|
...
|
|