Showing
1 changed file
with
10 additions
and
2 deletions
| @@ -9,6 +9,7 @@ import { | @@ -9,6 +9,7 @@ import { | ||
| 9 | import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel'; | 9 | import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel'; |
| 10 | import commentViewModel from '../../components/comment/viewmodel/CommentViewModel'; | 10 | import commentViewModel from '../../components/comment/viewmodel/CommentViewModel'; |
| 11 | import { commentItemModel } from '../../components/comment/model/CommentModel' | 11 | import { commentItemModel } from '../../components/comment/model/CommentModel' |
| 12 | +import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | ||
| 12 | 13 | ||
| 13 | /** | 14 | /** |
| 14 | * 精选评论卡 | 15 | * 精选评论卡 |
| @@ -22,9 +23,11 @@ export struct ZhSingleRow06 { | @@ -22,9 +23,11 @@ export struct ZhSingleRow06 { | ||
| 22 | @State newsStatusOfUser: batchLikeAndCollectResult = { | 23 | @State newsStatusOfUser: batchLikeAndCollectResult = { |
| 23 | likeStatus: '0' | 24 | likeStatus: '0' |
| 24 | } as batchLikeAndCollectResult // 点赞、收藏状态 | 25 | } as batchLikeAndCollectResult // 点赞、收藏状态 |
| 26 | + @State loadImg: boolean = false; | ||
| 25 | 27 | ||
| 26 | - aboutToAppear(): void { | 28 | + async aboutToAppear(): Promise<void> { |
| 27 | this.getInteractDataStatus() | 29 | this.getInteractDataStatus() |
| 30 | + this.loadImg = await onlyWifiLoadImg(); | ||
| 28 | } | 31 | } |
| 29 | 32 | ||
| 30 | /** | 33 | /** |
| @@ -160,7 +163,12 @@ export struct ZhSingleRow06 { | @@ -160,7 +163,12 @@ export struct ZhSingleRow06 { | ||
| 160 | CompHeader(item: CompDTO) { | 163 | CompHeader(item: CompDTO) { |
| 161 | Row() { | 164 | Row() { |
| 162 | Row() { | 165 | Row() { |
| 163 | - Image(item.operDataList[0]?.commentInfo?.userHeaderUrl ? item.operDataList[0].commentInfo.userHeaderUrl : $r('app.media.default_head')) | 166 | + Image( |
| 167 | + this.loadImg | ||
| 168 | + ? item.operDataList[0]?.commentInfo?.userHeaderUrl | ||
| 169 | + ? item.operDataList[0].commentInfo.userHeaderUrl | ||
| 170 | + : $r('app.media.default_head') | ||
| 171 | + : '') | ||
| 164 | .width(32) | 172 | .width(32) |
| 165 | .height(32) | 173 | .height(32) |
| 166 | .borderRadius(16) | 174 | .borderRadius(16) |
-
Please register or login to post a comment