yumaochao

fix: 增加标签

@@ -49,8 +49,10 @@ export struct Card2Component { @@ -49,8 +49,10 @@ export struct Card2Component {
49 Column() { 49 Column() {
50 Stack() { 50 Stack() {
51 //新闻标题 51 //新闻标题
52 - if (this.contentDTO.objectType == '5') {  
53 - Notes({ objectType: this.contentDTO.objectType }) 52 + if (this.contentDTO.newTags) {
  53 + Notes({ newTags: this.contentDTO.newTags })
  54 + } else if (this.contentDTO.objectType == '5') {
  55 + Notes({ objectType: this.contentDTO.objectType })
54 } 56 }
55 57
56 Text() { 58 Text() {
@@ -68,9 +70,13 @@ export struct Card2Component { @@ -68,9 +70,13 @@ export struct Card2Component {
68 .maxLines(2) 70 .maxLines(2)
69 .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 71 .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
70 .align(Alignment.Start) 72 .align(Alignment.Start)
71 - .textIndent(this.contentDTO.objectType == '5' ? 35 : 0)  
72 - }  
73 - .alignContent(Alignment.TopStart) 73 + .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 :
  74 + (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||
  75 + this.contentDTO.objectType == '5' ? 30 : 0)
  76 + }.alignContent(Alignment.TopStart)
  77 + //.textIndent(this.contentDTO.objectType == '5' ? 35 : 0)
  78 + // }
  79 + // .alignContent(Alignment.TopStart)
74 80
75 //大图 81 //大图
76 Stack() { 82 Stack() {
@@ -4,7 +4,7 @@ import { ProcessUtils } from 'wdRouter'; @@ -4,7 +4,7 @@ import { ProcessUtils } from 'wdRouter';
4 import { CardSourceInfo } from '../cardCommon/CardSourceInfo' 4 import { CardSourceInfo } from '../cardCommon/CardSourceInfo'
5 import { CardMediaInfo } from '../cardCommon/CardMediaInfo' 5 import { CardMediaInfo } from '../cardCommon/CardMediaInfo'
6 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 6 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
7 - 7 +import { Notes } from './notes';
8 const TAG: string = 'Card4Component'; 8 const TAG: string = 'Card4Component';
9 9
10 /** 10 /**
@@ -43,6 +43,11 @@ export struct Card4Component { @@ -43,6 +43,11 @@ export struct Card4Component {
43 Column() { 43 Column() {
44 //body 44 //body
45 Column() { 45 Column() {
  46 + if (this.contentDTO.newTags) {
  47 + Notes({ newTags: this.contentDTO.newTags })
  48 + } else if (this.contentDTO.objectType == '5') {
  49 + Notes({ objectType: this.contentDTO.objectType })
  50 + }
46 //新闻标题 51 //新闻标题
47 Text() { 52 Text() {
48 if (this.titleMarked) { 53 if (this.titleMarked) {
@@ -96,6 +101,10 @@ export struct Card4Component { @@ -96,6 +101,10 @@ export struct Card4Component {
96 this.clicked = true; 101 this.clicked = true;
97 ProcessUtils.processPage(this.contentDTO) 102 ProcessUtils.processPage(this.contentDTO)
98 }) 103 })
  104 + .textIndent(this.contentDTO.newTags?.length < 5 && this.contentDTO.newTags?.length > 2 ? 58 :
  105 + (this.contentDTO.newTags?.length != 0 && this.contentDTO.newTags?.length) ||
  106 + this.contentDTO.objectType == '5' ? 30 : 0)
  107 + }.alignContent(Alignment.TopStart)
99 //bottom 评论等信息 108 //bottom 评论等信息
100 CardSourceInfo({ compDTO: this.compDTO, contentDTO: this.contentDTO }) 109 CardSourceInfo({ compDTO: this.compDTO, contentDTO: this.contentDTO })
101 } 110 }