陈剑华

fix: 20118 【生产环境】进入热点-查看卡片,多了专题 标签和“2024年中非合作论坛峰会”,ios 不展示,只展示图片

@@ -66,7 +66,7 @@ export struct Card5Component { @@ -66,7 +66,7 @@ export struct Card5Component {
66 ) 66 )
67 .height(this.loadImg ? '' : 114) 67 .height(this.loadImg ? '' : 114)
68 .autoResize(true) 68 .autoResize(true)
69 - if (this.contentDTO.titleShow == 1 || this.contentDTO.titleShow == null) { 69 + if (this.titleShowPolicy == 1) {
70 Row() 70 Row()
71 .borderRadius( 71 .borderRadius(
72 { 72 {
@@ -85,50 +85,52 @@ export struct Card5Component { @@ -85,50 +85,52 @@ export struct Card5Component {
85 }) 85 })
86 86
87 Row() { 87 Row() {
88 - Stack() {  
89 - if(this.contentDTO.objectType == '5'){  
90 - Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(20).align(Alignment.Center)  
91 - } else {  
92 - if (this.contentDTO.seoTags) {  
93 - Notes({ newTags: this.contentDTO.seoTags }).height(20).align(Alignment.Center)  
94 - }  
95 - if (this.contentDTO.newTags) {  
96 - Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center)  
97 - }  
98 - if (this.contentDTO.top === 1) {  
99 - Notes({ newTags: '置顶' }).height(20).align(Alignment.Center) 88 + if (this.titleShowPolicy == 1 && this.contentDTO.newsTitle) {
  89 + Stack() {
  90 + if(this.contentDTO.objectType == '5'){
  91 + Notes({ objectType: this.contentDTO.objectType,objectLevel:this.contentDTO.objectLevel }).height(20).align(Alignment.Center)
  92 + } else {
  93 + if (this.contentDTO.seoTags) {
  94 + Notes({ newTags: this.contentDTO.seoTags }).height(20).align(Alignment.Center)
  95 + }
  96 + if (this.contentDTO.newTags) {
  97 + Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center)
  98 + }
  99 + if (this.contentDTO.top === 1) {
  100 + Notes({ newTags: '置顶' }).height(20).align(Alignment.Center)
  101 + }
100 } 102 }
101 - }  
102 103
103 - Text() { 104 + Text() {
104 if (this.titleMarked) { 105 if (this.titleMarked) {
105 - ForEach(this.textArr, (textItem: textItem) => {  
106 - if (textItem.isRed) {  
107 - Span(textItem.content)  
108 - .fontColor(0xED2800)  
109 - } else {  
110 - Span(textItem.content)  
111 - }  
112 - })  
113 - } else {  
114 - Span(this.contentDTO.newsTitle) 106 + ForEach(this.textArr, (textItem: textItem) => {
  107 + if (textItem.isRed) {
  108 + Span(textItem.content)
  109 + .fontColor(0xED2800)
  110 + } else {
  111 + Span(textItem.content)
  112 + }
  113 + })
  114 + } else {
  115 + Span(this.contentDTO.newsTitle)
  116 + }
115 } 117 }
116 - }  
117 - .width(CommonConstants.FULL_WIDTH)  
118 - .fontColor(Color.White)  
119 - .fontSize($r('app.float.font_size_18'))  
120 - .maxLines(2)  
121 - .align(Alignment.TopStart)  
122 - .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。  
123 - .textIndent(  
124 - getNotesContentWidth(  
125 - this.contentDTO.seoTags || this.contentDTO.newTags,  
126 - this.contentDTO.objectType,  
127 - this.contentDTO.objectLevel,  
128 - this.contentDTO.top 118 + .width(CommonConstants.FULL_WIDTH)
  119 + .fontColor(Color.White)
  120 + .fontSize($r('app.float.font_size_18'))
  121 + .maxLines(2)
  122 + .align(Alignment.TopStart)
  123 + .textOverflow({ overflow: TextOverflow.Ellipsis }) // 超出的部分显示省略号。
  124 + .textIndent(
  125 + getNotesContentWidth(
  126 + this.contentDTO.seoTags || this.contentDTO.newTags,
  127 + this.contentDTO.objectType,
  128 + this.contentDTO.objectLevel,
  129 + this.contentDTO.top
  130 + )
129 ) 131 )
130 - )  
131 - }.alignContent(Alignment.TopStart) 132 + }.alignContent(Alignment.TopStart)
  133 + }
132 } 134 }
133 .justifyContent(FlexAlign.Start) 135 .justifyContent(FlexAlign.Start)
134 .margin({ left: 12, bottom: 10, right: 12 }) 136 .margin({ left: 12, bottom: 10, right: 12 })