Authored by yyq

search recomend

@@ -82,7 +82,7 @@ @@ -82,7 +82,7 @@
82 {{#if changedQuery}} 82 {{#if changedQuery}}
83 <div class="search-suggest-less"> 83 <div class="search-suggest-less">
84 没有找到&nbsp;<em>"{{name}}"</em>&nbsp;相关的商品, 84 没有找到&nbsp;<em>"{{name}}"</em>&nbsp;相关的商品,
85 - 为您推荐&nbsp;"<a href="/?query={{suggestFirst}}&is_rec=Y">{{suggestFirst}}</a>"&nbsp;的搜索结果。{{#if suggestSecond}}或者试试{{#suggestSecond}}&nbsp;"<a href="/?query={{.}}&is_rec=Y">{{.}}</a>"&nbsp;{{/suggestSecond}}{{/if}} 85 + 为您推荐&nbsp;"<a href="/?query={{suggestFirst}}&is_rec=Y" id="rec-query-key">{{suggestFirst}}</a>"&nbsp;的搜索结果。{{#if suggestSecond}}或者试试{{#suggestSecond}}&nbsp;"<a href="/?query={{.}}&is_rec=Y">{{.}}</a>"&nbsp;{{/suggestSecond}}{{/if}}
86 </div> 86 </div>
87 {{/if}} 87 {{/if}}
88 88
@@ -167,12 +167,12 @@ if ($brandMore.length > 0) { @@ -167,12 +167,12 @@ if ($brandMore.length > 0) {
167 167
168 // 【品牌】加载更多品牌数据 168 // 【品牌】加载更多品牌数据
169 function checkMoreBrands(callback) { 169 function checkMoreBrands(callback) {
170 - var squery = window.location.search;  
171 170
172 // /product/search/filter/brands?callback=? 171 // /product/search/filter/brands?callback=?
173 - var url = '//search.yohobuy.com/product/search/filter/brands'; 172 + var url = '//search.yohobuy.com/product/search/filter/brands?callback=?';
174 var brandsHtml; 173 var brandsHtml;
175 - var params = (location.search || '').substr(1); 174 + var params = window.queryString();
  175 + var $changeKey = $('#rec-query-key');
176 176
177 // 直出brands list取消异步加载,目前只用于5.6全球购商品列表 177 // 直出brands list取消异步加载,目前只用于5.6全球购商品列表
178 if (!moreBrandLoaded && $filterBrands.find('.brand-panel').length) { 178 if (!moreBrandLoaded && $filterBrands.find('.brand-panel').length) {
@@ -185,10 +185,8 @@ function checkMoreBrands(callback) { @@ -185,10 +185,8 @@ function checkMoreBrands(callback) {
185 $brandsIndex = $('.brands-index'); 185 $brandsIndex = $('.brands-index');
186 } 186 }
187 187
188 - if (squery && squery.length > 0) {  
189 - url += squery + '&callback=?';  
190 - } else {  
191 - url += '?callback=?'; 188 + if (params.query && $changeKey.length) {
  189 + params.query = $changeKey.text();
192 } 190 }
193 191
194 if (hideInfo) { 192 if (hideInfo) {