Authored by 阿达

搜索bug fix

... ... @@ -353,8 +353,16 @@ if ($('.brand-search-page').length > 0) {
continue;
}
locate = history.indexOf('http://');
brand = history.substr(0, locate);
url = history.substr(locate, history.length - locate);
if (locate === -1) {
brand = history;
url = '';
} else {
brand = history.substr(0, locate);
url = history.substr(locate, history.length - locate);
}
html += '<li><a href="' + url + '">' + brand + '</li>';
$historySearch.removeClass('hide');
... ...
... ... @@ -45,7 +45,7 @@ function bindWirteLocal($brandList) {
e.preventDefault();
if ($('.net-search').length > 0) {
if ($('.net-history').length > 0) {
addHistory(brandName, brandId, brandDomain);
location.href = url;
return;
... ...
... ... @@ -17,17 +17,19 @@
<div class="search-brand-page">
<div class="search-items">
{{#if history}}
<div class="history-search net-search">
<h3><span class="iconfont">&#xe64a;</span>最近搜索
<button id="clear-history" class="clear-icon iconfont">&#xe64c;</button>
</h3>
<ul class="history clearfix">
{{# history}}
<li>
<a href="{{url}}" brandName="{{name}}" brandId="{{brandId}}" brandDomain="{{brandDomain}}">{{name}}</a>
</li>
{{/ history}}
</ul>
<div class="net-history">
<div class="history-search net-search">
<h3><span class="iconfont">&#xe64a;</span>最近搜索
<button id="clear-history" class="clear-icon iconfont">&#xe64c;</button>
</h3>
<ul class="history clearfix">
{{# history}}
<li>
<a href="{{url}}" brandName="{{name}}" brandId="{{brandId}}" brandDomain="{{brandDomain}}">{{name}}</a>
</li>
{{/ history}}
</ul>
</div>
</div>
{{else}}
<div class="history-search local-search hide">
... ...