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
陈剑华
2024-06-04 10:19:35 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
162895485ccae45749843a78fc2ed18a5c30a9bf
16289548
1 parent
7692594d
fix: 18381 搜索结果页-无法加载出动态图片
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
3 deletions
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card19Component.ets
sight_harmony/features/wdComponent/src/main/ets/components/cardview/Card19Component.ets
View file @
1628954
...
...
@@ -112,6 +112,8 @@ interface picProps {
struct createImg {
@Prop fullColumnImgUrls: FullColumnImgUrlDTO[]
@State loadImg: boolean = false;
@State onePicW: number = 0; // 只有一张图时候图片的宽度
@State onePicH: number = 0; // 只有一张图时候图片的高度
async aboutToAppear(): Promise<void> {
if (this.fullColumnImgUrls.length === 4) { // 为了使用栅格布局以便于占用三分之二的宽度,加一个占位
...
...
@@ -177,7 +179,7 @@ struct createImg {
Image(this.loadImg ? item.fullUrl || item.url : '')
.backgroundColor(0xf5f5f5)
.width('100%')
.height(1
72
)
.height(1
98
)
.autoResize(true)
.borderRadius(this.caclImageRadius(index))
} else if (this.getPicType(item.weight, item.height) === 2) {
...
...
@@ -215,14 +217,18 @@ struct createImg {
}
} else {
GridCol({
span:
item.landscape === 1
? 12 : 8
span:
this.onePicW > this.onePicH
? 12 : 8
}) {
Image(this.loadImg ? item.fullUrl : '')
.backgroundColor(0xf5f5f5)
.aspectRatio(
item.landscape === 1 ? 343 / 172
: 228 / 305)
.aspectRatio(
this.onePicW > this.onePicH ? 343 / 198
: 228 / 305)
.autoResize(true)
.borderRadius(this.caclImageRadius(index))
.opacity(!item.weight && !item.height ? 0 : 1)
.onComplete((event?) => {
this.onePicW = event?.width || 0;
this.onePicH = event?.height || 0;
})
}
}
} else if (this.fullColumnImgUrls.length === 4) {
...
...
Please
register
or
login
to post a comment