Showing
2 changed files
with
11 additions
and
7 deletions
| @@ -29,7 +29,8 @@ import { JSON } from '@kit.ArkTS' | @@ -29,7 +29,8 @@ import { JSON } from '@kit.ArkTS' | ||
| 29 | import { MoreComponent } from '../cardview/MoreComponent' | 29 | import { MoreComponent } from '../cardview/MoreComponent' |
| 30 | import { Card9Component } from '../cardview/Card9Component' | 30 | import { Card9Component } from '../cardview/Card9Component' |
| 31 | import { WDRouterRule, WDRouterPage } from 'wdRouter/Index' | 31 | import { WDRouterRule, WDRouterPage } from 'wdRouter/Index' |
| 32 | -import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent' | 32 | +import { EmptyComponent, WDViewDefaultType } from '../view/EmptyComponent' |
| 33 | + | ||
| 33 | const TAG = "SearchResultContentComponent" | 34 | const TAG = "SearchResultContentComponent" |
| 34 | 35 | ||
| 35 | @Component | 36 | @Component |
| @@ -148,7 +149,7 @@ export struct SearchResultContentComponent { | @@ -148,7 +149,7 @@ export struct SearchResultContentComponent { | ||
| 148 | this.data_rmh.push(data) | 149 | this.data_rmh.push(data) |
| 149 | }) | 150 | }) |
| 150 | 151 | ||
| 151 | - if(this.data_rmh.length > 0){ | 152 | + if (this.data_rmh.length > 0) { |
| 152 | this.count = 1 | 153 | this.count = 1 |
| 153 | } | 154 | } |
| 154 | //只有一条创作者,获取 创作者信息 | 155 | //只有一条创作者,获取 创作者信息 |
| @@ -262,7 +263,7 @@ export struct SearchResultContentComponent { | @@ -262,7 +263,7 @@ export struct SearchResultContentComponent { | ||
| 262 | this.isLoading = false | 263 | this.isLoading = false |
| 263 | this.count = this.count === -1 ? 0 : this.count | 264 | this.count = this.count === -1 ? 0 : this.count |
| 264 | }) | 265 | }) |
| 265 | - }else { | 266 | + } else { |
| 266 | this.hasMore = false | 267 | this.hasMore = false |
| 267 | } | 268 | } |
| 268 | } | 269 | } |
| @@ -270,12 +271,12 @@ export struct SearchResultContentComponent { | @@ -270,12 +271,12 @@ export struct SearchResultContentComponent { | ||
| 270 | build() { | 271 | build() { |
| 271 | Column() { | 272 | Column() { |
| 272 | if (this.count == 0) { | 273 | if (this.count == 0) { |
| 273 | - // ListHasNoMoreDataUI({ style: 2 }) | 274 | + |
| 274 | EmptyComponent({ | 275 | EmptyComponent({ |
| 275 | emptyType: WDViewDefaultType.WDViewDefaultType_NoSearchResult, | 276 | emptyType: WDViewDefaultType.WDViewDefaultType_NoSearchResult, |
| 276 | emptyButton: false, | 277 | emptyButton: false, |
| 278 | + }).height('70%') | ||
| 277 | 279 | ||
| 278 | - }) | ||
| 279 | } else { | 280 | } else { |
| 280 | List({ scroller: this.scroller2 }) { | 281 | List({ scroller: this.scroller2 }) { |
| 281 | if (this.data_rmh != null && this.data_rmh.length > 0) { | 282 | if (this.data_rmh != null && this.data_rmh.length > 0) { |
| @@ -326,12 +327,13 @@ export struct SearchResultContentComponent { | @@ -326,12 +327,13 @@ export struct SearchResultContentComponent { | ||
| 326 | }, (item: ContentDTO, index: number) => index.toString()) | 327 | }, (item: ContentDTO, index: number) => index.toString()) |
| 327 | 328 | ||
| 328 | //没有更多数据 显示提示 | 329 | //没有更多数据 显示提示 |
| 329 | - if (!this.hasMore && (this.data.totalCount() > 0|| (this.data_rmh != null && this.data_rmh.length > 0))) { | 330 | + if (!this.hasMore && (this.data.totalCount() > 0 || (this.data_rmh != null && this.data_rmh.length > 0))) { |
| 330 | ListItem() { | 331 | ListItem() { |
| 331 | ListHasNoMoreDataUI() | 332 | ListHasNoMoreDataUI() |
| 332 | } | 333 | } |
| 333 | } | 334 | } |
| 334 | - }.cachedCount(5) | 335 | + } |
| 336 | + .cachedCount(5) | ||
| 335 | .edgeEffect(EdgeEffect.None) | 337 | .edgeEffect(EdgeEffect.None) |
| 336 | .scrollBar(BarState.Off) | 338 | .scrollBar(BarState.Off) |
| 337 | .height('100%') | 339 | .height('100%') |
| @@ -344,6 +346,7 @@ export struct SearchResultContentComponent { | @@ -344,6 +346,7 @@ export struct SearchResultContentComponent { | ||
| 344 | } | 346 | } |
| 345 | } | 347 | } |
| 346 | .backgroundColor($r('app.color.white')) | 348 | .backgroundColor($r('app.color.white')) |
| 349 | + .height('100%') | ||
| 347 | .width('100%') | 350 | .width('100%') |
| 348 | } | 351 | } |
| 349 | 352 |
| @@ -60,6 +60,7 @@ export struct EmptyComponent { | @@ -60,6 +60,7 @@ export struct EmptyComponent { | ||
| 60 | @State emptyButton: boolean = false | 60 | @State emptyButton: boolean = false |
| 61 | @State isBlack: boolean = false // 背景是否为黑色 默认白色 | 61 | @State isBlack: boolean = false // 背景是否为黑色 默认白色 |
| 62 | @State timeNum: number = 10 | 62 | @State timeNum: number = 10 |
| 63 | + | ||
| 63 | /** | 64 | /** |
| 64 | * The empty image width percentage setting. | 65 | * The empty image width percentage setting. |
| 65 | */ | 66 | */ |
-
Please register or login to post a comment