|
@@ -870,9 +870,6 @@ function searchSuggestHistory() { |
|
@@ -870,9 +870,6 @@ function searchSuggestHistory() { |
870
|
// $searchKey.val($('#defaultsearch').val());
|
870
|
// $searchKey.val($('#defaultsearch').val());
|
871
|
// }
|
871
|
// }
|
872
|
|
872
|
|
873
|
- // 保存搜索的内容
|
|
|
874
|
- // writeSearch.setHistoryValFun($searchKey.val());
|
|
|
875
|
- // exeCookieMap();
|
|
|
876
|
|
873
|
|
877
|
let $queryKey = $('#query-key');
|
874
|
let $queryKey = $('#query-key');
|
878
|
$.getJSON('//search.yohobuy.com/product/search/history?query=' + $queryKey.val(), function(jsonData) {
|
875
|
$.getJSON('//search.yohobuy.com/product/search/history?query=' + $queryKey.val(), function(jsonData) {
|
|
@@ -881,14 +878,19 @@ function searchSuggestHistory() { |
|
@@ -881,14 +878,19 @@ function searchSuggestHistory() { |
881
|
// if (jsonData.code === 200) {
|
878
|
// if (jsonData.code === 200) {
|
882
|
// if (jsonData.data && jsonData.data.length) {
|
879
|
// if (jsonData.data && jsonData.data.length) {
|
883
|
|
880
|
|
884
|
- searchSuggestHistoryHtml = handlebars.compile($searchHistoryHbs.html() || '');
|
|
|
885
|
- console.log(jsonData);
|
|
|
886
|
- $searchHistory.html(searchSuggestHistoryHtml(jsonData)).show();
|
881
|
+ searchSuggestHistoryHtml = handlebars.compile($searchHistoryHbs.html() || '');
|
|
|
882
|
+ $searchHistory.html(searchSuggestHistoryHtml(jsonData)).show();
|
887
|
|
883
|
|
888
|
// } else {
|
884
|
// } else {
|
889
|
// $searchHistory.hide();
|
885
|
// $searchHistory.hide();
|
890
|
// }
|
886
|
// }
|
891
|
// }
|
887
|
// }
|
|
|
888
|
+
|
|
|
889
|
+ $(".search-suggest-title .searchDel").click(function(){
|
|
|
890
|
+ console.log("****&&&&&&&&&&&");
|
|
|
891
|
+ $.cookie('_History',null,{path:'/'});
|
|
|
892
|
+ return false;
|
|
|
893
|
+ });
|
892
|
});
|
894
|
});
|
893
|
}
|
895
|
}
|
894
|
|
896
|
|
|
@@ -921,27 +923,24 @@ function searchSuggestRecommend(key) { |
|
@@ -921,27 +923,24 @@ function searchSuggestRecommend(key) { |
921
|
};
|
923
|
};
|
922
|
|
924
|
|
923
|
$.getJSON('//search.yohobuy.com/product/search/recommend?callback=?', param, function(jsonData) {
|
925
|
$.getJSON('//search.yohobuy.com/product/search/recommend?callback=?', param, function(jsonData) {
|
924
|
- console.log("*********************");
|
|
|
925
|
- console.log(jsonData);
|
|
|
926
|
- console.log("*********************");
|
926
|
+ // console.log("*********************");
|
|
|
927
|
+ // console.log(jsonData);
|
|
|
928
|
+ // console.log("*********************");
|
927
|
var searchSuggestRecommendHtml;
|
929
|
var searchSuggestRecommendHtml;
|
928
|
|
930
|
|
929
|
if (jsonData.code === 200) {
|
931
|
if (jsonData.code === 200) {
|
930
|
if (jsonData.data && jsonData.data.hotTerms.length) {
|
932
|
if (jsonData.data && jsonData.data.hotTerms.length) {
|
931
|
|
933
|
|
932
|
- searchSuggestRecommendHtml = handlebars.compile($searchRecommendHbs.html() || '');
|
|
|
933
|
- console.log(searchSuggestRecommendHtml(jsonData));
|
|
|
934
|
-
|
934
|
+ searchSuggestRecommendHtml = handlebars.compile($searchRecommendHbs.html() || '');
|
935
|
$searchRecommend.html(searchSuggestRecommendHtml(jsonData)).show();
|
935
|
$searchRecommend.html(searchSuggestRecommendHtml(jsonData)).show();
|
936
|
|
936
|
|
|
|
937
|
+
|
|
|
938
|
+
|
937
|
} else {
|
939
|
} else {
|
938
|
$searchRecommend.hide();
|
940
|
$searchRecommend.hide();
|
939
|
}
|
941
|
}
|
940
|
-
|
|
|
941
|
}
|
942
|
}
|
942
|
|
943
|
|
943
|
-
|
|
|
944
|
-
|
|
|
945
|
});
|
944
|
});
|
946
|
}
|
945
|
}
|
947
|
|
946
|
|