...
|
...
|
@@ -67,7 +67,6 @@ function searchResult() { |
|
|
var keyword = ($keyword.val() + '').toLowerCase();
|
|
|
var result = {},
|
|
|
i = 0,
|
|
|
rightBarHtml,
|
|
|
html = '';
|
|
|
|
|
|
// 遍历首字母搜索
|
...
|
...
|
@@ -85,7 +84,6 @@ function searchResult() { |
|
|
});
|
|
|
|
|
|
// 根据搜索结果生成 HTML
|
|
|
rightBarHtml = '<div id="right-bar" class="right-bar"><div class="con" id="con">';
|
|
|
$.each(result, function(k, v) {
|
|
|
var brandHtml = ['<div class="brand-list bar-', i, '">'];
|
|
|
|
...
|
...
|
@@ -96,8 +94,6 @@ function searchResult() { |
|
|
$.each(v, function(i, brand) {
|
|
|
|
|
|
brandHtml.push('<p><a href="' + brand.url + '">' + brand.name);
|
|
|
|
|
|
// brandHtml.push('<p><span>' + brand.name);
|
|
|
if (brand.isNew) {
|
|
|
brandHtml.push('<i class="icon-hot">HOT</i>');
|
|
|
}
|
...
|
...
|
@@ -109,19 +105,8 @@ function searchResult() { |
|
|
brandHtml.push('</div>');
|
|
|
html += brandHtml.join('');
|
|
|
|
|
|
if (k.indexOf(0) > -1) {
|
|
|
k = '#';
|
|
|
}
|
|
|
|
|
|
rightBarHtml = rightBarHtml + '<b>' + k + '</b>';
|
|
|
});
|
|
|
|
|
|
rightBarHtml += '</div>';
|
|
|
|
|
|
if (Object.keys(result).length > 0) {
|
|
|
html += rightBarHtml;
|
|
|
}
|
|
|
|
|
|
// 插入 dom,绑定事件
|
|
|
$('.search-result').html(html);
|
|
|
}
|
...
|
...
|
|