Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
yangchenggong1_wd
2024-10-14 14:44:13 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
747a30341fb276b04c7f3938a33d2f7a84b7ec90
747a3034
1 parent
a718de3b
fix |> 20785 【偶现】搜索结果,数据重复展示
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletions
sight_harmony/features/wdBean/src/main/ets/bean/content/ContentDTO.ets
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchResultContentComponent.ets
sight_harmony/features/wdBean/src/main/ets/bean/content/ContentDTO.ets
View file @
747a303
...
...
@@ -112,6 +112,7 @@ export class ContentDTO implements BaseDTO {
sameContentList:ContentDTO[] = []
sameContentListJson:string = ""
sameContentListSize:number = 0
sameContentListId:string = ""
/*
本地辅助字段
*/
...
...
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchResultContentComponent.ets
View file @
747a303
...
...
@@ -62,7 +62,6 @@ export struct SearchResultContentComponent {
this.curPageNum = 1
this.hasMore = true
this.isLoading = false
this.getNewSearchResultData()
}
...
...
@@ -86,6 +85,10 @@ export struct SearchResultContentComponent {
}
getNewSearchResultData() {
if (this.isLoading){
return
}
this.isLoading = true
if (this.hasMore) {
SearcherAboutDataModel.getSearchResultListData("20", `${this.curPageNum}`, this.searchType, this.keywords,
...
...
@@ -178,6 +181,8 @@ export struct SearchResultContentComponent {
this.isLoading = false
this.count = this.count === -1 ? 0 : this.count
})
}else{
this.isLoading = false
}
}
...
...
@@ -236,14 +241,25 @@ export struct SearchResultContentComponent {
// }
let contentDTO = this.dataTransform(rem, value, photos);
if (value.data.type != "13") {
//避免 重复(偶现bug 暂时处理)
let index = this.data.getDataArray().findIndex(obj => obj.objectId == contentDTO.objectId);
if (index === -1) {
this.data.push(contentDTO)
if (value.data.sameContentList != null && value.data.sameContentList.length > 0) {
let contentDTO2 = new ContentDTO();
contentDTO2.sameContentListId = contentDTO.objectId + value.data.sameContentList[0].id
contentDTO2.sameContentListJson = JSON.stringify(value.data.sameContentList)
contentDTO2.sameContentListSize = value.data.sameContentList.length
let index = this.data.getDataArray().findIndex(obj => obj.sameContentListId == contentDTO2.sameContentListId)
if (index === -1){
this.data.push(contentDTO2)
}
}
}
}
})
this.tempList = []
...
...
@@ -256,6 +272,7 @@ export struct SearchResultContentComponent {
}
this.isLoading = false
}).catch((err: Error) => {
this.isLoading = false
console.log(TAG, JSON.stringify(err))
})
}).catch((err: Error) => {
...
...
@@ -265,6 +282,7 @@ export struct SearchResultContentComponent {
})
} else {
this.hasMore = false
this.isLoading = false
}
}
...
...
Please
register
or
login
to post a comment