热门搜索词无记录时不保存

This commit is contained in:
daihh
2022-11-24 19:55:59 +08:00
parent 93a880e6e8
commit 545259de16

View File

@@ -423,8 +423,8 @@
}else{
this.historyWords.unshift(this.keyword);
if(this.historyWords.length>50){
this.historyWords.splice(this.historyWords.length-1,1);
}
this.historyWords.splice(this.historyWords.length-1,1);
}
}
uni.setStorageSync(this.hotSaveKey,JSON.stringify(this.historyWords));
//存储到服务器,移到查询里面,查询无记录不存储
@@ -562,6 +562,10 @@
this.course.list.push(...rs.result.list);
this.course.count=rs.result.count;
if(rs.result.list.length == 0) {
this.course.loadStatus='noMore';
} else {
this.course.loadStatus='more'
}
//
if(rs.result.count>0 && this.keyword){
apiHotSearch.save({keyword:this.keyword,type:this.conType});
@@ -588,6 +592,9 @@
userIds.push(item.sysCreateAid)
});
if(this.article.params.pageIndex>=rs.result.totalPages){
this.article.loadStatus='noMore';
}
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});
@@ -614,6 +621,9 @@
userIds.push(item.sysCreateAid)
})
if(this.qa.params.pageIndex>=rs.result.totalPages){
this.qa.loadStatus='noMore';
}
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});