liyubing

fix:1)搜索 输入wuhuhuan,缺省图和android不一致,位置未居中,看图

... ... @@ -29,7 +29,8 @@ import { JSON } from '@kit.ArkTS'
import { MoreComponent } from '../cardview/MoreComponent'
import { Card9Component } from '../cardview/Card9Component'
import { WDRouterRule, WDRouterPage } from 'wdRouter/Index'
import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent'
import { EmptyComponent, WDViewDefaultType } from '../view/EmptyComponent'
const TAG = "SearchResultContentComponent"
@Component
... ... @@ -148,7 +149,7 @@ export struct SearchResultContentComponent {
this.data_rmh.push(data)
})
if(this.data_rmh.length > 0){
if (this.data_rmh.length > 0) {
this.count = 1
}
//只有一条创作者,获取 创作者信息
... ... @@ -262,7 +263,7 @@ export struct SearchResultContentComponent {
this.isLoading = false
this.count = this.count === -1 ? 0 : this.count
})
}else {
} else {
this.hasMore = false
}
}
... ... @@ -270,12 +271,12 @@ export struct SearchResultContentComponent {
build() {
Column() {
if (this.count == 0) {
// ListHasNoMoreDataUI({ style: 2 })
EmptyComponent({
emptyType: WDViewDefaultType.WDViewDefaultType_NoSearchResult,
emptyButton: false,
}).height('70%')
})
} else {
List({ scroller: this.scroller2 }) {
if (this.data_rmh != null && this.data_rmh.length > 0) {
... ... @@ -326,12 +327,13 @@ export struct SearchResultContentComponent {
}, (item: ContentDTO, index: number) => index.toString())
//没有更多数据 显示提示
if (!this.hasMore && (this.data.totalCount() > 0|| (this.data_rmh != null && this.data_rmh.length > 0))) {
if (!this.hasMore && (this.data.totalCount() > 0 || (this.data_rmh != null && this.data_rmh.length > 0))) {
ListItem() {
ListHasNoMoreDataUI()
}
}
}.cachedCount(5)
}
.cachedCount(5)
.edgeEffect(EdgeEffect.None)
.scrollBar(BarState.Off)
.height('100%')
... ... @@ -344,6 +346,7 @@ export struct SearchResultContentComponent {
}
}
.backgroundColor($r('app.color.white'))
.height('100%')
.width('100%')
}
... ...
... ... @@ -60,6 +60,7 @@ export struct EmptyComponent {
@State emptyButton: boolean = false
@State isBlack: boolean = false // 背景是否为黑色 默认白色
@State timeNum: number = 10
/**
* The empty image width percentage setting.
*/
... ...