Showing
1 changed file
with
6 additions
and
2 deletions
| @@ -13,11 +13,13 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | @@ -13,11 +13,13 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | ||
| 13 | import router from '@ohos.router' | 13 | import router from '@ohos.router' |
| 14 | import { postBatchAttentionStatusParams } from 'wdBean/Index'; | 14 | import { postBatchAttentionStatusParams } from 'wdBean/Index'; |
| 15 | import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel' | 15 | import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel' |
| 16 | +import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | ||
| 16 | 17 | ||
| 17 | @Component | 18 | @Component |
| 18 | export struct RmhTitle { | 19 | export struct RmhTitle { |
| 19 | @Prop rmhInfo: RmhInfoDTO | 20 | @Prop rmhInfo: RmhInfoDTO |
| 20 | @Prop publishTime: string | undefined | 21 | @Prop publishTime: string | undefined |
| 22 | + @State loadImg: boolean = false; | ||
| 21 | /** | 23 | /** |
| 22 | * 是否需要隐藏发布时间超过2天的时间展示,默认不隐藏 | 24 | * 是否需要隐藏发布时间超过2天的时间展示,默认不隐藏 |
| 23 | */ | 25 | */ |
| @@ -76,13 +78,15 @@ export struct RmhTitle { | @@ -76,13 +78,15 @@ export struct RmhTitle { | ||
| 76 | } | 78 | } |
| 77 | } | 79 | } |
| 78 | 80 | ||
| 79 | - aboutToAppear(): void { | 81 | + async aboutToAppear(): Promise<void> { |
| 80 | this.getBatchAttentionStatus() | 82 | this.getBatchAttentionStatus() |
| 81 | 83 | ||
| 82 | let page = router.getState(); | 84 | let page = router.getState(); |
| 83 | if (page.path.includes('/page/PeopleShipHomePage') || page.path.includes('/pages/MainPage')) { | 85 | if (page.path.includes('/page/PeopleShipHomePage') || page.path.includes('/pages/MainPage')) { |
| 84 | this.hideTime = true; | 86 | this.hideTime = true; |
| 85 | } | 87 | } |
| 88 | + | ||
| 89 | + this.loadImg = await onlyWifiLoadImg(); | ||
| 86 | } | 90 | } |
| 87 | 91 | ||
| 88 | getDaysBetweenDates(date: number) { | 92 | getDaysBetweenDates(date: number) { |
| @@ -96,7 +100,7 @@ export struct RmhTitle { | @@ -96,7 +100,7 @@ export struct RmhTitle { | ||
| 96 | build() { | 100 | build() { |
| 97 | Flex() { | 101 | Flex() { |
| 98 | Stack() { | 102 | Stack() { |
| 99 | - Image(this.rmhInfo?.rmhHeadUrl) | 103 | + Image(this.loadImg ? this.rmhInfo?.rmhHeadUrl : $r('app.media.comment_rmh_tag')) |
| 100 | .width(36) | 104 | .width(36) |
| 101 | .height(36).borderRadius(50) | 105 | .height(36).borderRadius(50) |
| 102 | Image(this.rmhInfo?.authIcon) | 106 | Image(this.rmhInfo?.authIcon) |
-
Please register or login to post a comment