Authored by 陈峰

Merge branch 'hotfix/bugs' of http://git.yoho.cn/fe/yohobuywap-node into hotfix/bugs

@@ -204,13 +204,14 @@ exports.processProductList = (list, options) => { @@ -204,13 +204,14 @@ exports.processProductList = (list, options) => {
204 */ 204 */
205 exports.termsSuggestion = (list, options) => { 205 exports.termsSuggestion = (list, options) => {
206 let termsSuggestion = []; 206 let termsSuggestion = [];
  207 + let query = options.query && decodeURIComponent(options.query.replace(/\%/g, escape('%'))) || '';
207 208
208 _.each(list, (terms, index) => { 209 _.each(list, (terms, index) => {
209 termsSuggestion.push({ 210 termsSuggestion.push({
210 name: terms, 211 name: terms,
211 link: helpers.urlFormat('/', {needSuggestion: 'Y', query: terms, from: 'search'}, 'search'), 212 link: helpers.urlFormat('/', {needSuggestion: 'Y', query: terms, from: 'search'}, 'search'),
212 select: (options.isChangedQuery && index === 0) || 213 select: (options.isChangedQuery && index === 0) ||
213 - (options.needSuggestion === 'Y' && terms === decodeURIComponent(options.query)) 214 + (options.needSuggestion === 'Y' && terms === query)
214 }); 215 });
215 }); 216 });
216 217