陈剑华

fix: 进入人民号-关注页,查看“赣州消防”人民号-图集卡,鸿蒙版新包未能显示图片数量,

... ... @@ -12,7 +12,8 @@ import { SearchShowRed, titleInitRes, textItem } from '../../utils/searchShowRed
const TAG = 'Card16Component';
interface fullColumnImgUrlItem {
url: string
url: string,
fullUrl: string
}
... ... @@ -81,15 +82,45 @@ export struct Card16Component {
.lineHeight(25)
}
if (this.contentDTO.fullColumnImgUrls?.length > 0) {
Flex() {
ForEach(this.contentDTO.fullColumnImgUrls.slice(0, 3), (item: fullColumnImgUrlItem, index: number) => {
Image(this.loadImg ? item.url : '')
.backgroundColor(0xf5f5f5)
.flexBasis(113)
.height(75)
.margin({ right: index > 1 ? 0 : 2 })
//三图
Stack(){
Row() {
GridRow({ gutter: 2 }) {
ForEach(this.contentDTO.fullColumnImgUrls.slice(0, 3), (item: fullColumnImgUrlItem, index: number) => {
if (index < 3) {
GridCol({ span: { xs: 4 } }) {
Image(this.loadImg ? item.url || item.fullUrl : '')
.backgroundColor(0xf5f5f5)
.width('100%')
.aspectRatio(113 / 75)
.borderRadius({
topLeft: index === 0 ? $r('app.float.image_border_radius') : 0,
topRight: index === 2 ? $r('app.float.image_border_radius') : 0,
bottomLeft: index === 0 ? $r('app.float.image_border_radius') : 0,
bottomRight: index === 2 ? $r('app.float.image_border_radius') : 0,
})
}
}
})
}
}
.width(CommonConstants.FULL_PARENT)
.margin({ top: 8 })
CardMediaInfo({
contentDTO: this.contentDTO
})
}
.width(CommonConstants.FULL_PARENT)
.alignContent(Alignment.BottomEnd)
// Flex() {
// ForEach(this.contentDTO.fullColumnImgUrls.slice(0, 3), (item: fullColumnImgUrlItem, index: number) => {
// Image(this.loadImg ? item.url : '')
// .backgroundColor(0xf5f5f5)
// .flexBasis(113)
// .height(75)
// .margin({ right: index > 1 ? 0 : 2 })
// })
// }
}
CarderInteraction({contentDTO: this.contentDTO})
//TODO 底部的:分享、评论、点赞 功能;需要引用一个公共组件
... ...