diff --git a/pages/resource/search.vue b/pages/resource/search.vue index f2b9113..9d7c8a6 100644 --- a/pages/resource/search.vue +++ b/pages/resource/search.vue @@ -423,8 +423,8 @@ } } uni.setStorageSync(this.hotSaveKey,JSON.stringify(this.historyWords)); - //存储到服务器 - apiHotSearch.save({keyword:this.keyword,type:this.conType}); + //存储到服务器,移到查询里面,查询无记录不存储 + //apiHotSearch.save({keyword:this.keyword,type:this.conType}); }, back(){ let pages =getCurrentPages(); @@ -562,6 +562,10 @@ } else { this.course.loadStatus='more' } + // + if(rs.result.count>0 && this.keyword){ + apiHotSearch.save({keyword:this.keyword,type:this.conType}); + } }else{ this.$refs.messager.show({message:rs.message,type:'error'}); } @@ -588,6 +592,9 @@ } this.article.count=rs.result.count; this.loadUserInfos(rs.result.list,userIds); + if(rs.result.count>0 && this.keyword){ + apiHotSearch.save({keyword:this.keyword,type:this.conType}); + } }else{ this.$refs.messager.show({message:rs.message,type:'error'}); } @@ -614,6 +621,9 @@ } this.qa.count=rs.result.count; this.loadUserInfos(rs.result.list,userIds); + if(rs.result.count>0 && this.keyword){ + apiHotSearch.save({keyword:this.keyword,type:this.conType}); + } }else{ this.$refs.messager.show({message:rs.message,type:'error'}); }