...
|
...
|
@@ -10,6 +10,8 @@ var $ = require('jquery'), |
|
|
lazyLoad = require('yoho.lazyload');
|
|
|
|
|
|
var swiper,
|
|
|
$brandText,
|
|
|
$brandHref,
|
|
|
$brandList = $('.brand-list');
|
|
|
|
|
|
var searchH = $('.newbrand-search').outerHeight(),
|
...
|
...
|
@@ -137,14 +139,15 @@ function searchResult() { |
|
|
$('.search-result .brand-list p').each(function (index) {
|
|
|
searchList = new Hammer($('.search-result .brand-list p').eq(index)[0]);
|
|
|
searchList.on('tap', function() {
|
|
|
$brandText = $('.search-result .brand-list p').eq(index).find('a').html();
|
|
|
$brandHref = $('.search-result .brand-list p').eq(index).find('a').attr('href');
|
|
|
if (localStorage.getItem('yohoHistory')) {
|
|
|
yohoHistory = localStorage.getItem('yohoHistory');
|
|
|
searchArray.push(yohoHistory);
|
|
|
}
|
|
|
searchArray.push('{"searchName":"' +
|
|
|
$('.search-result .brand-list p').eq(index).find('a').html() +
|
|
|
'","searchHref":"' + $('.search-result .brand-list p')
|
|
|
.eq(index).find('a').attr('href') + '"}');
|
|
|
if (searchArray.toString().split($brandText).length < 2) {
|
|
|
searchArray.push('{"searchName":"' + $brandText + '","searchHref":"' + $brandText + '"}');
|
|
|
}
|
|
|
localStorage.setItem('yohoHistory', searchArray);
|
|
|
});
|
|
|
});
|
...
|
...
|
|