Showing
1 changed file
with
25 additions
and
17 deletions
| @@ -108,7 +108,7 @@ export struct Card9Component { | @@ -108,7 +108,7 @@ export struct Card9Component { | ||
| 108 | // 时间线--后端返回三个, | 108 | // 时间线--后端返回三个, |
| 109 | Column() { | 109 | Column() { |
| 110 | ForEach(this.contentDTO.slideShows, (item: slideShows, index: number) => { | 110 | ForEach(this.contentDTO.slideShows, (item: slideShows, index: number) => { |
| 111 | - this.timelineItem(item, index) | 111 | + this.timelineItem(item, index, index === this.contentDTO.slideShows.length - 1) |
| 112 | }) | 112 | }) |
| 113 | } | 113 | } |
| 114 | 114 | ||
| @@ -149,25 +149,40 @@ export struct Card9Component { | @@ -149,25 +149,40 @@ export struct Card9Component { | ||
| 149 | } | 149 | } |
| 150 | 150 | ||
| 151 | @Builder | 151 | @Builder |
| 152 | - timelineItem(item: slideShows, index: number) { | 152 | + timelineItem(item: slideShows, index: number, isLastOne: boolean) { |
| 153 | Column() { | 153 | Column() { |
| 154 | Stack() { | 154 | Stack() { |
| 155 | - if (index < this.contentDTO.slideShows.length - 1) { | 155 | + if (index === 0) { |
| 156 | Divider() | 156 | Divider() |
| 157 | .vertical(true) | 157 | .vertical(true) |
| 158 | .color($r('app.color.color_EDEDED')) | 158 | .color($r('app.color.color_EDEDED')) |
| 159 | .strokeWidth(1) | 159 | .strokeWidth(1) |
| 160 | - .margin({ top: index > 0 ? 0 : 16, left: 4 }) | ||
| 161 | - } | ||
| 162 | - if (index > 0 && index == this.contentDTO.slideShows.length - 1) { | 160 | + .margin({ top: 16, left: 4 }) |
| 161 | + .height(16) | ||
| 162 | + } else { | ||
| 163 | Divider() | 163 | Divider() |
| 164 | .vertical(true) | 164 | .vertical(true) |
| 165 | .color($r('app.color.color_EDEDED')) | 165 | .color($r('app.color.color_EDEDED')) |
| 166 | .strokeWidth(1) | 166 | .strokeWidth(1) |
| 167 | + .margin({ top: 0, left: 4 }) | ||
| 167 | .height(16) | 168 | .height(16) |
| 168 | - .margin({ left: 4 }) | 169 | + if (!isLastOne) { |
| 170 | + Divider() | ||
| 171 | + .vertical(true) | ||
| 172 | + .color($r('app.color.color_EDEDED')) | ||
| 173 | + .strokeWidth(1) | ||
| 174 | + .margin({ top: 16, left: 4 }) | ||
| 175 | + .height(16) | ||
| 176 | + } | ||
| 169 | } | 177 | } |
| 170 | 178 | ||
| 179 | + // Divider() | ||
| 180 | + // .vertical(true) | ||
| 181 | + // .color($r('app.color.color_EDEDED')) | ||
| 182 | + // .strokeWidth(1) | ||
| 183 | + // .margin({ top: index > 0 ? 0 : 32, left: 4 }) | ||
| 184 | + // .height(16) | ||
| 185 | + | ||
| 171 | Column() { | 186 | Column() { |
| 172 | Row() { | 187 | Row() { |
| 173 | // 标题 | 188 | // 标题 |
| @@ -195,21 +210,14 @@ export struct Card9Component { | @@ -195,21 +210,14 @@ export struct Card9Component { | ||
| 195 | .maxLines(2) | 210 | .maxLines(2) |
| 196 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 211 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 197 | .alignSelf(ItemAlign.Center) | 212 | .alignSelf(ItemAlign.Center) |
| 198 | - .margin({ left: 12 }) | ||
| 199 | - // .padding({bottom: 20}) | ||
| 200 | - // if (item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url) { | ||
| 201 | - // Image(this.loadImg? item.fullColumnImgUrls[0].url : '') | ||
| 202 | - // .backgroundColor(0xf5f5f5) | ||
| 203 | - // .width(90) | ||
| 204 | - // .height(60) | ||
| 205 | - // .borderRadius($r('app.float.image_border_radius')) | ||
| 206 | - // } | 213 | + .margin({ left: 4 }) |
| 214 | + .padding({ bottom: 20, left: 12 }) | ||
| 215 | + .border({ width: { left: isLastOne ? 0 : 1 }, color: 0xededed}) | ||
| 207 | } | 216 | } |
| 208 | } | 217 | } |
| 209 | } | 218 | } |
| 210 | .alignContent(Alignment.TopStart) | 219 | .alignContent(Alignment.TopStart) |
| 211 | } | 220 | } |
| 212 | - .height(item.fullColumnImgUrls[0] && item.fullColumnImgUrls[0].url ? 100 : 50) | ||
| 213 | .alignItems(HorizontalAlign.Start) | 221 | .alignItems(HorizontalAlign.Start) |
| 214 | } | 222 | } |
| 215 | } | 223 | } |
-
Please register or login to post a comment