Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main
* 'main' of http://192.168.1.42/developOne/harmonyPool: fix |> 修复搜索页面点击tab没有loading加载效果
Showing
1 changed file
with
38 additions
and
17 deletions
| @@ -30,6 +30,7 @@ import { MoreComponent } from '../cardview/MoreComponent' | @@ -30,6 +30,7 @@ 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 | +import { LottieView } from '../../components/lottie/LottieView' | ||
| 33 | 34 | ||
| 34 | const TAG = "SearchResultContentComponent" | 35 | const TAG = "SearchResultContentComponent" |
| 35 | 36 | ||
| @@ -288,8 +289,19 @@ export struct SearchResultContentComponent { | @@ -288,8 +289,19 @@ export struct SearchResultContentComponent { | ||
| 288 | 289 | ||
| 289 | build() { | 290 | build() { |
| 290 | Column() { | 291 | Column() { |
| 291 | - if (this.count == 0) { | ||
| 292 | 292 | ||
| 293 | + // 添加动效refresh | ||
| 294 | + if (this.isLoading){ | ||
| 295 | + LottieView({ | ||
| 296 | + name: 'refreshing', | ||
| 297 | + path: "lottie/refresh_step2.json", | ||
| 298 | + lottieWidth: 87, | ||
| 299 | + lottieHeight: 87, | ||
| 300 | + autoplay: true, | ||
| 301 | + loop: true | ||
| 302 | + }).margin({top:180}) | ||
| 303 | + }else { | ||
| 304 | + if (this.count == 0) { | ||
| 293 | EmptyComponent({ | 305 | EmptyComponent({ |
| 294 | emptyType: WDViewDefaultType.WDViewDefaultType_NoSearchResult, | 306 | emptyType: WDViewDefaultType.WDViewDefaultType_NoSearchResult, |
| 295 | emptyButton: false, | 307 | emptyButton: false, |
| @@ -300,14 +312,14 @@ export struct SearchResultContentComponent { | @@ -300,14 +312,14 @@ export struct SearchResultContentComponent { | ||
| 300 | if (this.data_rmh != null && this.data_rmh.length > 0) { | 312 | if (this.data_rmh != null && this.data_rmh.length > 0) { |
| 301 | if (this.data_rmh.length === 1) { | 313 | if (this.data_rmh.length === 1) { |
| 302 | ListItem() { | 314 | ListItem() { |
| 303 | - FollowChildComponent({ data: this.bean, type: 1 ,searchText: decodeURI(this.keywords)}) | ||
| 304 | - }.padding({ left: 10 + 6 , right: 10 + 6}) | 315 | + FollowChildComponent({ data: this.bean, type: 1, searchText: decodeURI(this.keywords) }) |
| 316 | + }.padding({ left: 10 + 6, right: 10 + 6 }) | ||
| 305 | } else { | 317 | } else { |
| 306 | ListItem() { | 318 | ListItem() { |
| 307 | Column() { | 319 | Column() { |
| 308 | this.SearchListUI() | 320 | this.SearchListUI() |
| 309 | } | 321 | } |
| 310 | - }.padding({left: 6, right: 6}) | 322 | + }.padding({ left: 6, right: 6 }) |
| 311 | } | 323 | } |
| 312 | } | 324 | } |
| 313 | LazyForEach(this.data, (item: ContentDTO, index: number) => { | 325 | LazyForEach(this.data, (item: ContentDTO, index: number) => { |
| @@ -315,15 +327,18 @@ export struct SearchResultContentComponent { | @@ -315,15 +327,18 @@ export struct SearchResultContentComponent { | ||
| 315 | Column() { | 327 | Column() { |
| 316 | if (this.searchType == "activity") { | 328 | if (this.searchType == "activity") { |
| 317 | ActivityItemComponent({ contentDTO: item }) | 329 | ActivityItemComponent({ contentDTO: item }) |
| 318 | - .padding({left: 6, right: 6}) | 330 | + .padding({ left: 6, right: 6 }) |
| 319 | } else if (item.sameContentListSize > 0) { | 331 | } else if (item.sameContentListSize > 0) { |
| 320 | - MoreComponent({ contentDTO: item , | ||
| 321 | - nextIsAggregateData:(index+1 < this.data.totalCount() && this.data.get(index+1).isAggregateData)}) | 332 | + MoreComponent({ |
| 333 | + contentDTO: item, | ||
| 334 | + nextIsAggregateData: (index + 1 < this.data.totalCount() && | ||
| 335 | + this.data.get(index + 1).isAggregateData) | ||
| 336 | + }) | ||
| 322 | } else if (item.appStyle == "9") { | 337 | } else if (item.appStyle == "9") { |
| 323 | - Column(){ | ||
| 324 | - if(item.isAggregateData && index != 0){ | 338 | + Column() { |
| 339 | + if (item.isAggregateData && index != 0) { | ||
| 325 | Divider() | 340 | Divider() |
| 326 | - .width('100%' ) | 341 | + .width('100%') |
| 327 | .color($r('app.color.color_F5F5F5')) | 342 | .color($r('app.color.color_F5F5F5')) |
| 328 | .strokeWidth(5) | 343 | .strokeWidth(5) |
| 329 | } | 344 | } |
| @@ -337,18 +352,23 @@ export struct SearchResultContentComponent { | @@ -337,18 +352,23 @@ export struct SearchResultContentComponent { | ||
| 337 | }) | 352 | }) |
| 338 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | 353 | Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) |
| 339 | } | 354 | } |
| 340 | - .padding({left: 6, right: 6}) | 355 | + .padding({ left: 6, right: 6 }) |
| 341 | } | 356 | } |
| 342 | } else { | 357 | } else { |
| 343 | - Column(){ | ||
| 344 | - if(item.isAggregateData && index != 0){ | 358 | + Column() { |
| 359 | + if (item.isAggregateData && index != 0) { | ||
| 345 | Divider() | 360 | Divider() |
| 346 | - .width('100%' ) | 361 | + .width('100%') |
| 347 | .color($r('app.color.color_F5F5F5')) | 362 | .color($r('app.color.color_F5F5F5')) |
| 348 | .strokeWidth(5) | 363 | .strokeWidth(5) |
| 349 | } | 364 | } |
| 350 | - CardParser({ compDTO: new CompDTO, contentDTO: item ,isNeedDivider: (index+1 < this.data.totalCount() && this.data.get(index+1).isAggregateData) ? false : true}) | ||
| 351 | - .padding({left: 6, right: 6}) | 365 | + CardParser({ |
| 366 | + compDTO: new CompDTO, | ||
| 367 | + contentDTO: item, | ||
| 368 | + isNeedDivider: (index + 1 < this.data.totalCount() && | ||
| 369 | + this.data.get(index + 1).isAggregateData) ? false : true | ||
| 370 | + }) | ||
| 371 | + .padding({ left: 6, right: 6 }) | ||
| 352 | } | 372 | } |
| 353 | 373 | ||
| 354 | } | 374 | } |
| @@ -361,7 +381,7 @@ export struct SearchResultContentComponent { | @@ -361,7 +381,7 @@ export struct SearchResultContentComponent { | ||
| 361 | ListItem() { | 381 | ListItem() { |
| 362 | ListHasNoMoreDataUI() | 382 | ListHasNoMoreDataUI() |
| 363 | } | 383 | } |
| 364 | - .padding({left: 6, right: 6}) | 384 | + .padding({ left: 6, right: 6 }) |
| 365 | } | 385 | } |
| 366 | } | 386 | } |
| 367 | .cachedCount(5) | 387 | .cachedCount(5) |
| @@ -376,6 +396,7 @@ export struct SearchResultContentComponent { | @@ -376,6 +396,7 @@ export struct SearchResultContentComponent { | ||
| 376 | }) | 396 | }) |
| 377 | } | 397 | } |
| 378 | } | 398 | } |
| 399 | + } | ||
| 379 | .backgroundColor($r('app.color.white')) | 400 | .backgroundColor($r('app.color.white')) |
| 380 | .height('100%') | 401 | .height('100%') |
| 381 | .width('100%') | 402 | .width('100%') |
-
Please register or login to post a comment