Showing
1 changed file
with
12 additions
and
16 deletions
| @@ -36,18 +36,7 @@ export struct Card2Component { | @@ -36,18 +36,7 @@ export struct Card2Component { | ||
| 36 | this.titleInit(); | 36 | this.titleInit(); |
| 37 | this.loadImg = await onlyWifiLoadImg(); | 37 | this.loadImg = await onlyWifiLoadImg(); |
| 38 | } | 38 | } |
| 39 | - calculateTextIndent() { | ||
| 40 | - if (this.contentDTO?.newTags?.length < 5 && this.contentDTO?.newTags?.length > 2) { | ||
| 41 | - return 58; | ||
| 42 | - } else if ((this.contentDTO.newTags?.length !== 0) || (this.contentDTO.seoTags?.length !== 0)) { | ||
| 43 | - // 当newTags或seoTags存在时,应用相同的缩进 | ||
| 44 | - return 35; | ||
| 45 | - } else if (this.contentDTO.objectType == '5') { | ||
| 46 | - return 35; | ||
| 47 | - } else { | ||
| 48 | - return 0; | ||
| 49 | - } | ||
| 50 | - } | 39 | + |
| 51 | titleInit() { | 40 | titleInit() { |
| 52 | if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) { | 41 | if (this.contentDTO.title?.includes('<em>') && this.contentDTO.title?.includes('</em>')) { |
| 53 | this.titleMarked = true; | 42 | this.titleMarked = true; |
| @@ -75,6 +64,15 @@ export struct Card2Component { | @@ -75,6 +64,15 @@ export struct Card2Component { | ||
| 75 | Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center) | 64 | Notes({ newTags: this.contentDTO.newTags }).height(30).align(Alignment.Center) |
| 76 | } | 65 | } |
| 77 | } | 66 | } |
| 67 | + //新闻标题 | ||
| 68 | + // if (this.contentDTO.newTags) { | ||
| 69 | + // | ||
| 70 | + // //Notes({ newTags: this.contentDTO.newTags }) | ||
| 71 | + // } else if (this.contentDTO.objectType == '5') { | ||
| 72 | + // | ||
| 73 | + // //Notes({ objectType: this.contentDTO.objectType }) | ||
| 74 | + // } | ||
| 75 | + | ||
| 78 | Text() { | 76 | Text() { |
| 79 | if (this.titleMarked) { | 77 | if (this.titleMarked) { |
| 80 | Span(this.str01) | 78 | Span(this.str01) |
| @@ -91,11 +89,9 @@ export struct Card2Component { | @@ -91,11 +89,9 @@ export struct Card2Component { | ||
| 91 | .lineHeight(27) | 89 | .lineHeight(27) |
| 92 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 | 90 | .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。 |
| 93 | .align(Alignment.Start) | 91 | .align(Alignment.Start) |
| 94 | - .textIndent( | ||
| 95 | - (this.contentDTO.objectType === '2' && (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5) ? 58 : | 92 | + .textIndent( (this.contentDTO.objectType === '2' && (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5) ? 58 : |
| 96 | (this.contentDTO.objectType === '2' && (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 0 || this.contentDTO.objectType === '5') ? 35 : | 93 | (this.contentDTO.objectType === '2' && (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 0 || this.contentDTO.objectType === '5') ? 35 : |
| 97 | - 0 | ||
| 98 | - ) | 94 | + 0 ) |
| 99 | }.alignContent(Alignment.TopStart) | 95 | }.alignContent(Alignment.TopStart) |
| 100 | 96 | ||
| 101 | //.textIndent(this.contentDTO.objectType == '5' ? 35 : 0) | 97 | //.textIndent(this.contentDTO.objectType == '5' ? 35 : 0) |
-
Please register or login to post a comment