Authored by htoooth

merge feature/searchTerms

@@ -106,7 +106,7 @@ @@ -106,7 +106,7 @@
106 \{{#hotTerms}} 106 \{{#hotTerms}}
107 <li> 107 <li>
108 <a style="display: block;" href="\{{href}}" title="\{{content}}" 108 <a style="display: block;" href="\{{href}}" title="\{{content}}"
109 - act="\{{href}}"> 109 + act="\{{href}}" target="_blank">
110 <span class="searchvalue">\{{content}}</span> 110 <span class="searchvalue">\{{content}}</span>
111 </a> 111 </a>
112 </li> 112 </li>
@@ -114,7 +114,7 @@ @@ -114,7 +114,7 @@
114 \{{#guessTerms}} 114 \{{#guessTerms}}
115 <li> 115 <li>
116 <a style="display: block;" href="\{{href}}" title="\{{content}}" 116 <a style="display: block;" href="\{{href}}" title="\{{content}}"
117 - act="\{{href}}"> 117 + act="\{{href}}" target="_blank">
118 <span class="searchvalue">\{{content}}</span> 118 <span class="searchvalue">\{{content}}</span>
119 </a> 119 </a>
120 </li> 120 </li>
@@ -713,6 +713,8 @@ if ($miniCart && $miniCart.length) { @@ -713,6 +713,8 @@ if ($miniCart && $miniCart.length) {
713 $goCart.hover(function() { 713 $goCart.hover(function() {
714 var data, _html = ''; 714 var data, _html = '';
715 715
  716 + $searchHistory.hide();
  717 +
716 if ($goCart.hasClass('on-hover')) { 718 if ($goCart.hasClass('on-hover')) {
717 return; 719 return;
718 } 720 }
@@ -735,6 +737,8 @@ if ($miniCart && $miniCart.length) { @@ -735,6 +737,8 @@ if ($miniCart && $miniCart.length) {
735 data = $dom.data(), 737 data = $dom.data(),
736 callback; 738 callback;
737 739
  740 + $searchHistory.hide();
  741 +
738 if (data) { 742 if (data) {
739 callback = function() { 743 callback = function() {
740 $dom.closest('.goods-item').remove(); 744 $dom.closest('.goods-item').remove();
@@ -923,7 +927,7 @@ function actionAddKeyWords() { @@ -923,7 +927,7 @@ function actionAddKeyWords() {
923 function searchSuggestHistory() { 927 function searchSuggestHistory() {
924 var param = { 928 var param = {
925 return_type: 'jsonp', 929 return_type: 'jsonp',
926 - query: encodeURIComponent($searchKey.val()) || '' 930 + query: encodeURIComponent(window.queryString().query) || ''
927 }; 931 };
928 932
929 $.getJSON('//search.yohobuy.com/product/search/history?callback=?', param, function(jsonData) { 933 $.getJSON('//search.yohobuy.com/product/search/history?callback=?', param, function(jsonData) {
@@ -970,7 +974,7 @@ $searchKey.focus(function() { @@ -970,7 +974,7 @@ $searchKey.focus(function() {
970 }); 974 });
971 975
972 /** 976 /**
973 - * 搜索 热门搜索和默认搜索 api 977 + * 搜索 热门搜索 api
974 * @return {[type]} [description] 978 * @return {[type]} [description]
975 */ 979 */
976 function searchSuggestRecommend(channel, key) { 980 function searchSuggestRecommend(channel, key) {
@@ -995,6 +999,7 @@ function searchSuggestRecommend(channel, key) { @@ -995,6 +999,7 @@ function searchSuggestRecommend(channel, key) {
995 } 999 }
996 1000
997 }); 1001 });
  1002 +
998 } 1003 }
999 1004
1000 /** 1005 /**
@@ -1003,8 +1008,10 @@ function searchSuggestRecommend(channel, key) { @@ -1003,8 +1008,10 @@ function searchSuggestRecommend(channel, key) {
1003 */ 1008 */
1004 $(function() { 1009 $(function() {
1005 searchSuggestRecommend(); 1010 searchSuggestRecommend();
  1011 + searchSuggestHistory();
1006 }); 1012 });
1007 1013
1008 actionCover(); 1014 actionCover();
1009 actionAddKeyWords(); 1015 actionAddKeyWords();
1010 setTimeout(emailUserCertTip, 0); 1016 setTimeout(emailUserCertTip, 0);
  1017 +