From 545259de1624aae328b64973ef803c5ad2eb0871 Mon Sep 17 00:00:00 2001 From: daihh Date: Thu, 24 Nov 2022 19:55:59 +0800 Subject: [PATCH] =?UTF-8?q?=E7=83=AD=E9=97=A8=E6=90=9C=E7=B4=A2=E8=AF=8D?= =?UTF-8?q?=E6=97=A0=E8=AE=B0=E5=BD=95=E6=97=B6=E4=B8=8D=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/resource/search.vue | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) 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'}); }