Merge branch 'hotfix/bugs' of http://git.yoho.cn/fe/yohobuywap-node into hotfix/bugs
Showing
1 changed file
with
2 additions
and
1 deletions
@@ -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 |
-
Please register or login to post a comment