douaojie

fix: 添加标签

1 import { ContentDTO } from 'wdBean'; 1 import { ContentDTO } from 'wdBean';
2 import { CommonConstants } from 'wdConstant'; 2 import { CommonConstants } from 'wdConstant';
3 import { ProcessUtils } from 'wdRouter'; 3 import { ProcessUtils } from 'wdRouter';
  4 +import { Notes } from './notes';
4 5
5 const TAG: string = 'Card5Component'; 6 const TAG: string = 'Card5Component';
6 7
@@ -29,29 +30,31 @@ export struct Card5Component { @@ -29,29 +30,31 @@ export struct Card5Component {
29 .autoResize(true) 30 .autoResize(true)
30 .borderRadius($r('app.float.image_border_radius')) 31 .borderRadius($r('app.float.image_border_radius'))
31 if ((this.titleShowPolicy === 1 || this.contentDTO.titleShow === 1) && this.contentDTO.newsTitle) { 32 if ((this.titleShowPolicy === 1 || this.contentDTO.titleShow === 1) && this.contentDTO.newsTitle) {
32 - Row()  
33 - .width(CommonConstants.FULL_WIDTH)  
34 - .height(59)  
35 - .linearGradient({  
36 - colors: [  
37 - ['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]  
38 - ]  
39 - }) 33 + // Row()
  34 + // .width(CommonConstants.FULL_WIDTH)
  35 + // .height(59)
  36 + // .linearGradient({
  37 + // colors: [
  38 + // ['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0]
  39 + // ]
  40 + // })
40 Row() { 41 Row() {
41 - if (this.titleShowPolicy === 1) { 42 + Stack() {
  43 + if (this.contentDTO.objectType == '5') {
  44 + Notes({ objectType: this.contentDTO.objectType })
  45 + }
42 Text(this.contentDTO.newsTitle) 46 Text(this.contentDTO.newsTitle)
43 - .width(CommonConstants.FULL_WIDTH)  
44 - .height(CommonConstants.FULL_HEIGHT) 47 + .width(CommonConstants.FULL_WIDTH)// .height(CommonConstants.FULL_HEIGHT)
45 .fontColor(Color.White) 48 .fontColor(Color.White)
46 .fontSize($r('app.float.normal_text_size')) 49 .fontSize($r('app.float.normal_text_size'))
47 .fontWeight(FontWeight.Bold) 50 .fontWeight(FontWeight.Bold)
48 .maxLines(2) 51 .maxLines(2)
49 - .align(Alignment.Bottom)  
50 - }  
51 - 52 + .align(Alignment.TopStart)
  53 + .textIndent(this.contentDTO.objectType == '5' ? 40 : 0)
  54 + }.alignContent(Alignment.TopStart)
52 } 55 }
53 .justifyContent(FlexAlign.Start) 56 .justifyContent(FlexAlign.Start)
54 - .height(40) 57 + // .height(40)
55 .margin({ left: 12, bottom: 10, right: 12 }) 58 .margin({ left: 12, bottom: 10, right: 12 })
56 } 59 }
57 } 60 }
@@ -39,8 +39,10 @@ export struct Card6Component { @@ -39,8 +39,10 @@ export struct Card6Component {
39 .maxLines(3) 39 .maxLines(3)
40 .alignSelf(ItemAlign.Start) 40 .alignSelf(ItemAlign.Start)
41 .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 41 .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
42 - .textIndent(this.contentDTO.newTags.length < 5 && this.contentDTO.newTags.length > 2 ? 60 :  
43 - this.contentDTO.newTags.length != 0 && this.contentDTO.newTags.length < 3 ? 30 : 0) 42 + .textIndent(
  43 + this.contentDTO.newTags.length < 5 && this.contentDTO.newTags.length > 2 ?
  44 + 60 : this.contentDTO.newTags.length != 0 && this.contentDTO.newTags.length < 3 ?
  45 + 30 : 0)
44 }.alignContent(Alignment.TopStart) 46 }.alignContent(Alignment.TopStart)
45 47
46 }.height("80%") 48 }.height("80%")