...
|
...
|
@@ -30,9 +30,6 @@ var brandsData, |
|
|
$keyword,
|
|
|
clearTextHammer;
|
|
|
|
|
|
var security = require('../plugin/security'),
|
|
|
Hammer = require('yoho.hammer');
|
|
|
|
|
|
var $history = $('.history');
|
|
|
var $historySearch = $('.history-search');
|
|
|
var $hotSearch = $('.hot-search');
|
...
|
...
|
@@ -157,7 +154,7 @@ function searchResult() { |
|
|
brandHtml.push('</h2></div>');
|
|
|
$.each(v, function(i, brand) {
|
|
|
|
|
|
brandHtml.push('<p><a href="' + brand.url + '" brandname = "'+brand.name+'">' + brand.name);
|
|
|
brandHtml.push('<p><a href="' + brand.url + '" brandName = "'+brand.name+'" brandId = "' + brand.brandId + '">' + brand.name);
|
|
|
if (brand.isNew) {
|
|
|
brandHtml.push('<i class="icon-new">NEW</i>');
|
|
|
}
|
...
|
...
|
@@ -172,7 +169,7 @@ function searchResult() { |
|
|
});
|
|
|
}
|
|
|
|
|
|
//
|
|
|
//没填入关键词时显示最热搜索
|
|
|
if(keyword.length >0){
|
|
|
$('.search-brand-page').addClass('hide');
|
|
|
}else{
|
...
|
...
|
@@ -186,7 +183,7 @@ function searchResult() { |
|
|
writeSearch.bindWirteLocal($brandList);
|
|
|
}
|
|
|
|
|
|
if ($('.brand-search-page').length) {
|
|
|
if ($('.brand-search-page').length > 0) {
|
|
|
brandsData = $.parseJSON($('#brands-data').html());
|
|
|
$keyword = $('#keyword');
|
|
|
|
...
|
...
|
@@ -265,12 +262,8 @@ if ($brandItem.length > 0 ) { |
|
|
});
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//初始化历史搜索的内容
|
|
|
if ($('.brand-search-page').length) {
|
|
|
if ($('.brand-search-page').length >0) {
|
|
|
|
|
|
chHammer = new Hammer($clearHistory[0]);
|
|
|
chHammer.on('tap', function() {
|
...
|
...
|
@@ -280,10 +273,15 @@ if ($('.brand-search-page').length) { |
|
|
$historySearch.hide();
|
|
|
$clearHistory.hide();
|
|
|
|
|
|
if ($('.net-search').length > 0){
|
|
|
removeHistory();
|
|
|
}
|
|
|
|
|
|
window.rePosFooter();
|
|
|
});
|
|
|
|
|
|
//搜索页面
|
|
|
|
|
|
(function () {
|
|
|
var html = '',
|
|
|
history,
|
...
|
...
|
@@ -317,6 +315,23 @@ if ($('.brand-search-page').length) { |
|
|
}
|
|
|
}
|
|
|
}());
|
|
|
|
|
|
}
|
|
|
|
|
|
//writeSearch.bindWirteLocal($form); |
|
|
\ No newline at end of file |
|
|
/**
|
|
|
* 清除记录
|
|
|
*/
|
|
|
function removeHistory()
|
|
|
{
|
|
|
$.ajax({
|
|
|
type: 'GET',
|
|
|
url: '/category/brand/delBrandHistory',
|
|
|
data: '',
|
|
|
success: function (data) {
|
|
|
|
|
|
},
|
|
|
error: function () {
|
|
|
//showTip('网络断开连接啦~');
|
|
|
}
|
|
|
});
|
|
|
} |
|
|
\ No newline at end of file |
...
|
...
|
|