caohuahui

头图卡宽高比例计算

... ... @@ -39,7 +39,19 @@ export struct HeadPictureCardComponent {
}
.alignContent(Alignment.Bottom)
.width(CommonConstants.FULL_WIDTH)
.aspectRatio(imageSizeRatio(this.compDTO.operDataList[0].coverSize))
.height(200)
}
}
function imageSizeRatio(size: string): number {
if (size != null) {
let parts: string[] = size.split("*");
let f = Number(parts[0])
let s = Number(parts[1])
return f / s;
} else {
return 1.0
}
}
... ...