陈剑华

fix: 轮播图只有一条数据时折叠屏展开适配

... ... @@ -87,6 +87,7 @@ export struct ZhCarouselLayout01 {
build() {
if (this.compDTO?.operDataList?.length) {
if (this.compDTO?.operDataList.length > 1) {
Stack() {
Swiper() {
ForEach(this.compDTO?.operDataList, (item: ContentDTO, index: number) => {
... ... @@ -170,6 +171,26 @@ export struct ZhCarouselLayout01 {
.backgroundColor(0xffffff)
.width(CommonConstants.FULL_WIDTH)
} else {
CarouselLayout01CardView({
item: this.compDTO.operDataList[0],
length: 1,
showPicBorderRadius: this.compDTO.operDataList.length == 1
})
.onClick((event: ClickEvent) => {
InfomationCardClick.track(this.compDTO, this.compDTO.operDataList[0], this.pageId, this.pageName)
ProcessUtils.processPage(this.compDTO.operDataList[0])
})
.padding({
left: 10,
right: 10,
top: $r('app.float.card_comp_pagePadding_tb'),
bottom: $r('app.float.card_comp_pagePadding_tb')
})
.backgroundColor(0xffffff)
.width(CommonConstants.FULL_WIDTH)
.borderRadius($r('app.float.image_border_radius'))
}
} else {
EmptyComponent({ emptyHeight: 200 })
}
}
... ...