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-05-10 15:59:32 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
9acfbce8dbbbf7f3d705df964b32bb1dd7cc05a0
9acfbce8
1 parent
890f5113
fix:bug[17224] 搜索结果为空,推荐列表没有屏蔽音频
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
70 additions
and
24 deletions
sight_harmony/features/wdComponent/src/main/ets/components/mine/appointment/AppointmentListChildComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/reusable/MyCustomDialog.ets
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchHistoryComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchRelatedComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchResultComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchResultContentComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/mine/appointment/AppointmentListChildComponent.ets
View file @
9acfbce
...
...
@@ -17,9 +17,7 @@ export struct AppointmentListChildComponent{
}),
autoCancel: true,
alignment: DialogAlignment.Center,
offset: { dx: 0, dy: -20 },
gridCount: 4,
customStyle: false
customStyle: true
})
...
...
sight_harmony/features/wdComponent/src/main/ets/components/reusable/MyCustomDialog.ets
View file @
9acfbce
...
...
@@ -4,9 +4,12 @@ export struct MyCustomDialog {
@State titleShow: boolean = true
@State tipValue: string ="提示文字"
@State tipShow: boolean = true
@State cancelIsLeft :boolean = true//取消是否在左边
@State leftText: string = "取消"
@State rightText: string = "确认"
@State leftTextColor: Resource = $r('app.color.color_333333')
@State rightTextColor: Resource = $r('app.color.color_648DF2')
controller: CustomDialogController
cancel: () => void = () => {
...
...
@@ -16,21 +19,25 @@ export struct MyCustomDialog {
build() {
Column() {
Column(){
if(this.titleShow){
Text(this.title)
.fontSize("32lpx")
.margin({ top: "40lpx", bottom: "15lpx" })
.fontColor($r('app.color.color_333333'))
.fontSize('35lpx')
.fontWeight('600lpx')
.lineHeight('50lpx')
.fontWeight(600)
}
if(this.tipShow){
Text(this.tipValue)
.margin({ bottom: "3
0lpx" })
.margin({ top:this.titleShow?"10lpx":"
0lpx" })
.fontSize("27lpx")
.fontColor($r('app.color.color_B0B0B0'))
.fontWeight(400)
.lineHeight('38lpx')
.fontColor($r('app.color.color_999999'))
}
}.padding({top:"48lpx",bottom:"48lpx"})
.alignItems(HorizontalAlign.Center)
Divider()
.width("100%")
...
...
@@ -41,13 +48,21 @@ export struct MyCustomDialog {
Row(){
Text(this.leftText)
.fontSize('35lpx')
.fontWeight('400lpx')
.fontColor($r('app.color.color_333333'))
.fontWeight(400)
.fontColor(this.leftTextColor)
.onClick(() => {
if (this.controller != undefined){
if(this.cancelIsLeft){
this.controller.close()
this.cancel()
}else{
this.controller.close()
this.confirm()
}
}
}).layoutWeight(1)
.textAlign(TextAlign.Center)
Divider()
.width("1lpx")
.strokeWidth('1lpx')
...
...
@@ -58,17 +73,24 @@ export struct MyCustomDialog {
Text(this.rightText)
.fontSize('35lpx')
.textAlign(TextAlign.Center)
.fontWeight('400lpx')
.fontColor($r('app.color.color_648DF2'))
.fontWeight(400)
.fontColor(this.rightTextColor)
.onClick(() => {
if (this.controller != undefined) {
if(this.cancelIsLeft){
this.controller.close()
this.confirm()
}else{
this.controller.close()
this.cancel()
}
}
}).layoutWeight(1)
}
.alignItems(VerticalAlign.Center)
.height('96lpx')
}.borderRadius(10)
.width("518lpx")
.backgroundColor("#FFF")
}
}
\ No newline at end of file
...
...
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchHistoryComponent.ets
View file @
9acfbce
...
...
@@ -21,9 +21,7 @@ export struct SearchHistoryComponent{
}),
autoCancel: true,
alignment: DialogAlignment.Center,
offset: { dx: 0, dy: -20 },
gridCount: 4,
customStyle: false
customStyle: true
})
onAccept(){
...
...
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchRelatedComponent.ets
View file @
9acfbce
...
...
@@ -3,7 +3,7 @@ import { SearchRelatedItem } from '../../viewmodel/SearchRelatedItem'
const TAG = "SearchRelatedComponent"
/**
*
热门
搜索
*
相关
搜索
*/
@Component
export struct SearchRelatedComponent {
...
...
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchResultComponent.ets
View file @
9acfbce
...
...
@@ -40,11 +40,24 @@ export struct SearchResultComponent {
SearcherAboutDataModel.getSearchSuggestData(request, getContext(this)).then((value) => {
value.forEach((item) => {
if(item.appStyle != "13"){
this.data.push(item)
}
})
this.data.notifyDataReload()
this.suggest_count = this.data.totalCount()
this.isLoading = false
if(this.suggest_count === 0 && value.length > 0){
this.suggest_count = -1
if(!this.isLoading){
this.getSuggestData()
}
}else if(this.suggest_count <= 20 && value.length > 0){
if(!this.isLoading){
this.getSuggestData()
}
}
})
}
...
...
@@ -110,6 +123,7 @@ export struct SearchResultComponent {
TabContent() {
SearchResultContentComponent({ keywords: this.searchText, searchType: item })
}.tabBar(this.TabBuilder(index, item))
.layoutWeight(1)
}, (item: string, index: number) => index.toString())
}
.vertical(false)
...
...
@@ -124,6 +138,7 @@ export struct SearchResultComponent {
.layoutWeight(1)
}
}.width('100%')
.layoutWeight(1)
.margin({ top: '12lpx' })
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/search/SearchResultContentComponent.ets
View file @
9acfbce
...
...
@@ -54,6 +54,7 @@ export struct SearchResultContentComponent{
if (!this.data || value.list.length == 0){
this.hasMore = false
this.isLoading = false
this.count = this.count===-1?0:this.count
}else{
if(value.list[0].dataList!=null){
let data_temp: SearchRmhDescription[] = []
...
...
@@ -205,8 +206,10 @@ export struct SearchResultContentComponent{
extra:'',
titleShow:value.data.type == "5"?1:0,
}
if(contentDTO.appStyle != "13"){
this.data.push(contentDTO)
}
})
this.data.notifyDataReload()
this.count = this.data.totalCount()
...
...
@@ -216,6 +219,19 @@ export struct SearchResultContentComponent{
this.hasMore = false
}
this.isLoading = false
if(this.count === 0 && resultData.list.length > 0){
this.count = -1
if(!this.isLoading){
//加载分页数据
this.getNewSearchResultData()
}
}else if(this.count <= 20 && resultData.list.length > 0){
if(!this.isLoading){
//加载分页数据
this.getNewSearchResultData()
}
}
}).catch((err:Error)=>{
console.log(TAG,"请求失败")
this.isLoading = false
...
...
@@ -297,13 +313,10 @@ export struct SearchResultContentComponent{
}
}
}
.onClick(()=>{
//TODO 跳转
})
}, (item: ContentDTO, index: number) => index.toString())
//没有更多数据 显示提示
if(!this.hasMore){
if(!this.hasMore
&& this.data.totalCount() > 0
){
ListItem(){
ListHasNoMoreDataUI()
}
...
...
@@ -319,11 +332,11 @@ export struct SearchResultContentComponent{
this.getNewSearchResultData()
}
})
}
}
.layoutWeight(1)
}
}
.backgroundColor($r('app.color.white'))
.
height('100%'
)
.
layoutWeight(1
)
.width('100%')
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment