Authored by zhangxiaoru

searchcache

@@ -219,6 +219,8 @@ const getAllBrandNames = () => { @@ -219,6 +219,8 @@ const getAllBrandNames = () => {
219 const getSearchIndex = () => { 219 const getSearchIndex = () => {
220 return api.get('', { 220 return api.get('', {
221 method: 'app.search.getTerms' 221 method: 'app.search.getTerms'
  222 + }, {
  223 + cache: true
222 }).then((result) => { 224 }).then((result) => {
223 if (result && result.code === 200) { 225 if (result && result.code === 200) {
224 return result.data.hotTerms; 226 return result.data.hotTerms;
@@ -100,7 +100,7 @@ function inputAction() { @@ -100,7 +100,7 @@ function inputAction() {
100 var i; 100 var i;
101 101
102 if (data.length > 0) { 102 if (data.length > 0) {
103 - console.log(data.length); 103 +
104 for (i = 0; i < data.length; i++) { 104 for (i = 0; i < data.length; i++) {
105 ajaxHtml += '<li><span class="keyword">' + data[i].keyword + '</span><span class="count">' + 105 ajaxHtml += '<li><span class="keyword">' + data[i].keyword + '</span><span class="count">' +
106 data[i].count + ' items<i class="iconfont">&#xe614;</i></span></li>'; 106 data[i].count + ' items<i class="iconfont">&#xe614;</i></span></li>';