Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
wangliang_wd
2024-09-11 10:18:28 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
cdeabe39fa3483ffbff98d532b196a5b2ad85e14
cdeabe39
1 parent
d418f81e
feat:优化动态详情页图片展示
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
28 additions
and
5 deletions
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/DynamicDetailComponent.ets
View file @
cdeabe3
...
...
@@ -86,6 +86,9 @@ export struct DynamicDetailComponent {
@State isScrollTop: boolean = true
@State executedStartTime: number = new Date().getTime()
@State onePicW: number = 0; // 只有一张图时候图片的宽度
@State onePicH: number = 0; // 只有一张图时候图片的高度
pageParam: ParamType = {}
commentListAreaInfo?: Area
lastTimeoutId?: number
...
...
@@ -361,17 +364,37 @@ export struct DynamicDetailComponent {
ProcessUtils.gotoMultiPictureListPage(this.contentDetailData.photoList, index)
})
} else {
// GridCol({
// span: { xs: 8 }
// }) {
// Image(item.picPath)
// .width('100%')
// .borderRadius(this.caclImageRadius(index))
// .autoResize(true)
// .opacity(!item.width && !item.height ? 0 : 1)
// .onComplete(callback => {
// item.width = callback?.width || 0;
// item.height = callback?.height || 0;
// })
// }
GridCol({
span:
{ xs: 8 }
span:
this.onePicW > this.onePicH ? 12 : 8
}) {
Image(item.picPath)
.backgroundColor(0xf5f5f5)
.width('100%')
.borderRadius(this.caclImageRadius(index))
.autoResize(true)
.objectFit(ImageFit.Cover)
.autoResize(true)
.aspectRatio(3/4)
.borderRadius(this.caclImageRadius(index))
.borderStyle(BorderStyle.Solid)
.borderWidth(0.5)
.borderColor($r('app.color.color_0D000000'))
.opacity(!item.width && !item.height ? 0 : 1)
.onComplete(callback => {
item.width = callback?.width || 0;
item.height = callback?.height || 0;
.onComplete((event?) => {
this.onePicW = event?.width || 0;
this.onePicH = event?.height || 0;
})
}
.onClick(async (event: ClickEvent) => {
...
...
Please
register
or
login
to post a comment