Authored by 梁志锋

Merge branch 'develop' of git.dev.yoho.cn:web/yohobuy into develop

framework @ 75bbc3b0
Subproject commit 119c247f5cf929aa1e059e40609bb16dd6b58f05
Subproject commit 75bbc3b075de19f239532f60c5995d06c5f814e2
... ...
... ... @@ -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);
});
});
... ...