...
|
...
|
@@ -21,7 +21,8 @@ var brandsData, |
|
|
searchBtnHammer,
|
|
|
clearTextHammer,
|
|
|
removeHistory,
|
|
|
searchList;
|
|
|
searchList,
|
|
|
yohoHistory;
|
|
|
|
|
|
swiper = new Swiper('.swiper-container', {
|
|
|
lazyLoading: true,
|
...
|
...
|
@@ -134,12 +135,14 @@ function searchResult() { |
|
|
}
|
|
|
console.log($('.search-result .brand-list p').length);
|
|
|
$('.search-result .brand-list p').each(function (index) {
|
|
|
|
|
|
// $('.search-result .brand-list').eq(index).find('p span').click(function () {
|
|
|
// console.log(index);
|
|
|
// })
|
|
|
|
|
|
searchList = new Hammer($('.search-result .brand-list p').eq(index)[0]);
|
|
|
searchList.on('tap',function(){
|
|
|
searchList.on('tap', function() {
|
|
|
|
|
|
// var $el = $(e.target);
|
|
|
// console.log($el.closest('sapn')).html();
|
|
|
console.log($('.search-result .brand-list p').eq(index).find('span').html());
|
...
|
...
|
@@ -180,19 +183,18 @@ if ($('.brand-search-page').length) { |
|
|
return false;
|
|
|
});
|
|
|
if (localStorage) {
|
|
|
var yohoHistory = localStorage.getItem("yohoHistory");
|
|
|
|
|
|
if (yohoHistory) {
|
|
|
for (var i = 1; i < yohoHistory.split(" ").length - 1; i++) {
|
|
|
$("<a href='#'>" + yohoHistory.split(" ")[i] + "</a>").appendTo(".historyList");
|
|
|
}
|
|
|
}
|
|
|
yohoHistory = localStorage.getItem('yohoHistory');
|
|
|
|
|
|
};
|
|
|
// if (yohoHistory) {
|
|
|
// for (var i = 1; i < yohoHistory.split(" ").length - 1; i++) {
|
|
|
// $("<a href='#'>" + yohoHistory.split(" ")[i] + "</a>").appendTo(".historyList");
|
|
|
// }
|
|
|
// }
|
|
|
}
|
|
|
|
|
|
removeHistory = new Hammer($('.removeHistory')[0]);
|
|
|
removeHistory.on('tap', function(e) {
|
|
|
$(".historyList").html(" ");
|
|
|
$('.historyList').html(' ');
|
|
|
localStorage.clear();
|
|
|
});
|
|
|
|
...
|
...
|
|