...
|
...
|
@@ -18,7 +18,8 @@ var swiper, |
|
|
$searchAction = $('.search-action'),
|
|
|
hotBrandsSwiper;
|
|
|
$brandItem = $('.brandNav li'),
|
|
|
$brandWall = $('.branding-wall');
|
|
|
$newBrandWall = $('.recommand-brand-wall'),
|
|
|
$recommandBrandWall = $('.recommand-brand-wall');
|
|
|
|
|
|
var searchH = $('.newbrand-search').outerHeight(),
|
|
|
headerH = $('.yoho-header').outerHeight(),
|
...
|
...
|
@@ -243,62 +244,74 @@ if ($brandItem.length > 0 ) { |
|
|
|
|
|
|
|
|
if (index === 0){
|
|
|
$brandWall.not('.hide').addClass('hide');
|
|
|
$recommandBrandWall.not('.hide').addClass('hide');
|
|
|
$newBrandWall.not('.hide').addClass('hide');
|
|
|
$brandList.removeClass('hide');
|
|
|
}else if (index === 1){
|
|
|
$brandList.not('.hide').addClass('hide');
|
|
|
$newBrandWall.removeClass('hide');
|
|
|
$recommandBrandWall.not('.hide').addClass('hide');
|
|
|
}else {
|
|
|
$brandList.not('.hide').addClass('hide');
|
|
|
$brandWall.eq(index).removeClass('hide');
|
|
|
$recommandBrandWall.removeClass('hide');
|
|
|
$newBrandWall.not('.hide').addClass('hide');
|
|
|
}
|
|
|
|
|
|
});
|
|
|
}
|
|
|
|
|
|
//搜索页面
|
|
|
|
|
|
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,
|
|
|
brand,url,locate;
|
|
|
if ($('.brand-search-page').length) {
|
|
|
|
|
|
if (localStorage) {
|
|
|
historys = localStorage.getItem('historys-brand');
|
|
|
chHammer = new Hammer($clearHistory[0]);
|
|
|
chHammer.on('tap', function() {
|
|
|
localStorage.removeItem('historys-brand');
|
|
|
|
|
|
if (historys && historys.length > 0) {
|
|
|
historys = historys.split(ranToken);
|
|
|
for (i = (historys.length >= 10) ? 10 :historys.length; i > 0; i--) {
|
|
|
history = historys[i - 1];
|
|
|
$history.html('');
|
|
|
$historySearch.hide();
|
|
|
$clearHistory.hide();
|
|
|
|
|
|
if (history === '') {
|
|
|
continue;
|
|
|
}
|
|
|
locate = history.indexOf("http://");
|
|
|
brand = history.substr(0,locate);
|
|
|
url = history.substr(locate,history.length-locate);
|
|
|
window.rePosFooter();
|
|
|
});
|
|
|
|
|
|
html += '<li><a href="' + url + '">' + brand + '</li>';
|
|
|
$historySearch.removeClass('hide');
|
|
|
}
|
|
|
//搜索页面
|
|
|
(function () {
|
|
|
var html = '',
|
|
|
history,
|
|
|
historys, i,
|
|
|
brand, url, locate;
|
|
|
|
|
|
if (localStorage) {
|
|
|
historys = localStorage.getItem('historys-brand');
|
|
|
|
|
|
$history.html(html);
|
|
|
$clearHistory.removeClass('hide');
|
|
|
if (historys && historys.length > 0) {
|
|
|
historys = historys.split(ranToken);
|
|
|
for (i = (historys.length >= 10) ? 10 : historys.length; i > 0; i--) {
|
|
|
history = historys[i - 1];
|
|
|
|
|
|
$hotSearch.removeClass('hide');
|
|
|
window.rePosFooter();
|
|
|
if (history === '') {
|
|
|
continue;
|
|
|
}
|
|
|
locate = history.indexOf("http://");
|
|
|
brand = history.substr(0, locate);
|
|
|
url = history.substr(locate, history.length - locate);
|
|
|
|
|
|
html += '<li><a href="' + url + '">' + brand + '</li>';
|
|
|
$historySearch.removeClass('hide');
|
|
|
}
|
|
|
|
|
|
$history.html(html);
|
|
|
$clearHistory.removeClass('hide');
|
|
|
|
|
|
$hotSearch.removeClass('hide');
|
|
|
window.rePosFooter();
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}());
|
|
|
}());
|
|
|
}
|
|
|
|
|
|
//writeSearch.bindWirteLocal($form); |
|
|
\ No newline at end of file |
...
|
...
|
|