陈剑华

fix: 18034 健康频道-时间轴专题_时间节点间距有的偏大有的的偏小

... ... @@ -108,7 +108,7 @@ export struct Card9Component {
// 时间线--后端返回三个,
Column() {
ForEach(this.contentDTO.slideShows, (item: slideShows, index: number) => {
this.timelineItem(item, index)
this.timelineItem(item, index, index === this.contentDTO.slideShows.length - 1)
})
}
... ... @@ -149,24 +149,39 @@ export struct Card9Component {
}
@Builder
timelineItem(item: slideShows, index: number) {
timelineItem(item: slideShows, index: number, isLastOne: boolean) {
Column() {
Stack() {
if (index < this.contentDTO.slideShows.length - 1) {
if (index === 0) {
Divider()
.vertical(true)
.color($r('app.color.color_EDEDED'))
.strokeWidth(1)
.margin({ top: index > 0 ? 0 : 16, left: 4 })
}
if (index > 0 && index == this.contentDTO.slideShows.length - 1) {
.margin({ top: 16, left: 4 })
.height(16)
} else {
Divider()
.vertical(true)
.color($r('app.color.color_EDEDED'))
.strokeWidth(1)
.margin({ top: 0, left: 4 })
.height(16)
if (!isLastOne) {
Divider()
.vertical(true)
.color($r('app.color.color_EDEDED'))
.strokeWidth(1)
.margin({ top: 16, left: 4 })
.height(16)
.margin({ left: 4 })
}
}
// Divider()
// .vertical(true)
// .color($r('app.color.color_EDEDED'))
// .strokeWidth(1)
// .margin({ top: index > 0 ? 0 : 32, left: 4 })
// .height(16)
Column() {
Row() {
... ... @@ -195,21 +210,14 @@ export struct Card9Component {
.maxLines(2)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.alignSelf(ItemAlign.Center)
.margin({ left: 12 })
// .padding({bottom: 20})
// if (item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) {
// Image(this.loadImg? item.fullColumnImgUrls[0].url : '')
// .backgroundColor(0xf5f5f5)
// .width(90)
// .height(60)
// .borderRadius($r('app.float.image_border_radius'))
// }
.margin({ left: 4 })
.padding({ bottom: 20, left: 12 })
.border({ width: { left: isLastOne ? 0 : 1 }, color: 0xededed})
}
}
}
.alignContent(Alignment.TopStart)
}
.height(item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url ? 100 : 50)
.alignItems(HorizontalAlign.Start)
}
}
\ No newline at end of file
... ...