Showing
4 changed files
with
10 additions
and
41 deletions
| @@ -222,13 +222,7 @@ export struct Card10ComponentTimelineItem { | @@ -222,13 +222,7 @@ export struct Card10ComponentTimelineItem { | ||
| 222 | .fontColor(this.isRead ? 0x848484 : '#222222') | 222 | .fontColor(this.isRead ? 0x848484 : '#222222') |
| 223 | .maxLines(2) | 223 | .maxLines(2) |
| 224 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 224 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 225 | - .textIndent( | ||
| 226 | - getNotesContentWidth( | ||
| 227 | - this.contentDTO.seoTags || this.contentDTO.newTags, | ||
| 228 | - this.contentDTO.objectType, | ||
| 229 | - this.contentDTO.objectLevel | ||
| 230 | - ) | ||
| 231 | - ) | 225 | + .textIndent(this.slideItem.objectType == '5' ? 38 : 0) |
| 232 | }.alignContent(Alignment.TopStart) | 226 | }.alignContent(Alignment.TopStart) |
| 233 | 227 | ||
| 234 | Blank() | 228 | Blank() |
| @@ -271,13 +265,7 @@ export struct Card10ComponentTimelineItem { | @@ -271,13 +265,7 @@ export struct Card10ComponentTimelineItem { | ||
| 271 | .fontColor($r('app.color.color_222222')) | 265 | .fontColor($r('app.color.color_222222')) |
| 272 | .maxLines(2) | 266 | .maxLines(2) |
| 273 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 267 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 274 | - .textIndent( | ||
| 275 | - getNotesContentWidth( | ||
| 276 | - this.contentDTO.seoTags || this.contentDTO.newTags, | ||
| 277 | - this.contentDTO.objectType, | ||
| 278 | - this.contentDTO.objectLevel | ||
| 279 | - ) | ||
| 280 | - ) | 268 | + .textIndent(this.slideItem.objectType == '5' ? 38 : 0) |
| 281 | }.alignContent(Alignment.TopStart) | 269 | }.alignContent(Alignment.TopStart) |
| 282 | 270 | ||
| 283 | //bottom 评论等信息 | 271 | //bottom 评论等信息 |
| @@ -13,10 +13,10 @@ export struct Notes { | @@ -13,10 +13,10 @@ export struct Notes { | ||
| 13 | @State objectLevel: number | string = -1 | 13 | @State objectLevel: number | string = -1 |
| 14 | @State newTags: string = '' | 14 | @State newTags: string = '' |
| 15 | @State seoTags: string = '' | 15 | @State seoTags: string = '' |
| 16 | - @State marginTop: number = 0; | 16 | + @State marginTop: number = -1; |
| 17 | 17 | ||
| 18 | build() { | 18 | build() { |
| 19 | - if (this.returnTypeTitleFn()) { | 19 | + if (returnTypeTitleFn(this.newTags, this.objectType, this.objectLevel)) { |
| 20 | Text(returnTypeTitleFn(this.newTags, this.objectType, this.objectLevel)) | 20 | Text(returnTypeTitleFn(this.newTags, this.objectType, this.objectLevel)) |
| 21 | .fontSize($r('app.float.font_size_11')) | 21 | .fontSize($r('app.float.font_size_11')) |
| 22 | .padding({ | 22 | .padding({ |
| @@ -31,23 +31,4 @@ export struct Notes { | @@ -31,23 +31,4 @@ export struct Notes { | ||
| 31 | .margin({ top: this.marginTop}) | 31 | .margin({ top: this.marginTop}) |
| 32 | } | 32 | } |
| 33 | } | 33 | } |
| 34 | - | ||
| 35 | - returnTypeTitleFn(): string { | ||
| 36 | - if (this.newTags) { | ||
| 37 | - return this.newTags | ||
| 38 | - } | ||
| 39 | - if (this.objectType == 5) { | ||
| 40 | - if (this.objectLevel == 24) { | ||
| 41 | - return '调查' | ||
| 42 | - } | ||
| 43 | - return '专题' | ||
| 44 | - } | ||
| 45 | - if (this.objectType == 10) { | ||
| 46 | - return 'H5' | ||
| 47 | - } | ||
| 48 | - if (this.objectType == 8) { | ||
| 49 | - return '文章' | ||
| 50 | - } | ||
| 51 | - return '' | ||
| 52 | - } | ||
| 53 | } | 34 | } |
| @@ -223,13 +223,13 @@ struct CarouselLayout01CardView { | @@ -223,13 +223,13 @@ struct CarouselLayout01CardView { | ||
| 223 | // 文本信息 | 223 | // 文本信息 |
| 224 | Stack() { | 224 | Stack() { |
| 225 | if(this.item.objectType == '5'){ | 225 | if(this.item.objectType == '5'){ |
| 226 | - Notes({ objectType: this.item.objectType,objectLevel:this.item.objectLevel }) | 226 | + Notes({ objectType: this.item.objectType,objectLevel:this.item.objectLevel, marginTop: 4 }) |
| 227 | } else { | 227 | } else { |
| 228 | if (this.item.seoTags) { | 228 | if (this.item.seoTags) { |
| 229 | - Notes({ newTags: this.item.seoTags }) | 229 | + Notes({ newTags: this.item.seoTags, marginTop: 4 }) |
| 230 | } | 230 | } |
| 231 | if (this.item.newTags) { | 231 | if (this.item.newTags) { |
| 232 | - Notes({ newTags: this.item.newTags }) | 232 | + Notes({ newTags: this.item.newTags, marginTop: 4 }) |
| 233 | } | 233 | } |
| 234 | } | 234 | } |
| 235 | Text(`${this.item.newsTitle}`) | 235 | Text(`${this.item.newsTitle}`) |
| @@ -17,9 +17,9 @@ export function runWithAnimation( | @@ -17,9 +17,9 @@ export function runWithAnimation( | ||
| 17 | } | 17 | } |
| 18 | 18 | ||
| 19 | export function getNotesContentWidth( | 19 | export function getNotesContentWidth( |
| 20 | - newTags: string, | ||
| 21 | - objectType: number | string, | ||
| 22 | - objectLevel: number | string, | 20 | + newTags?: string, |
| 21 | + objectType?: number | string, | ||
| 22 | + objectLevel?: number | string, | ||
| 23 | fontSize?: string | number | Resource | 23 | fontSize?: string | number | Resource |
| 24 | ) { | 24 | ) { |
| 25 | let textContent: string = returnTypeTitleFn(newTags, objectType, objectLevel) | 25 | let textContent: string = returnTypeTitleFn(newTags, objectType, objectLevel) |
-
Please register or login to post a comment