wangyong_wd

样式卡bug修复

@@ -72,5 +72,6 @@ export interface ContentDTO { @@ -72,5 +72,6 @@ export interface ContentDTO {
72 corner: string; 72 corner: string;
73 rmhPlatform: number; 73 rmhPlatform: number;
74 newTags: string; 74 newTags: string;
  75 + titleShow?: number;
75 isSearch?: boolean; // 是否是搜索的结果,区分搜索和主页的数据 76 isSearch?: boolean; // 是否是搜索的结果,区分搜索和主页的数据
76 } 77 }
@@ -20,12 +20,18 @@ export struct CardSourceInfo { @@ -20,12 +20,18 @@ export struct CardSourceInfo {
20 .fontColor($r("app.color.color_B0B0B0")) 20 .fontColor($r("app.color.color_B0B0B0"))
21 .maxLines(1) 21 .maxLines(1)
22 .textOverflow({ overflow: TextOverflow.Ellipsis }) 22 .textOverflow({ overflow: TextOverflow.Ellipsis })
  23 + Image($r("app.media.point"))
  24 + .width(16)
  25 + .height(16)
23 } else if (this.contentDTO.source) { 26 } else if (this.contentDTO.source) {
24 Text(`${this.contentDTO.source}`) 27 Text(`${this.contentDTO.source}`)
25 .fontSize($r("app.float.font_size_12")) 28 .fontSize($r("app.float.font_size_12"))
26 .fontColor($r("app.color.color_B0B0B0")) 29 .fontColor($r("app.color.color_B0B0B0"))
27 .maxLines(1) 30 .maxLines(1)
28 .textOverflow({ overflow: TextOverflow.Ellipsis }) 31 .textOverflow({ overflow: TextOverflow.Ellipsis })
  32 + Image($r("app.media.point"))
  33 + .width(16)
  34 + .height(16)
29 } 35 }
30 // 新闻tab下的卡片,2天之前的不显示时间。但是如果是搜索情况下展示的卡片,显示时间 36 // 新闻tab下的卡片,2天之前的不显示时间。但是如果是搜索情况下展示的卡片,显示时间
31 if (this.contentDTO.isSearch || !this.contentDTO.isSearch && DateTimeUtils.getCommentTime 37 if (this.contentDTO.isSearch || !this.contentDTO.isSearch && DateTimeUtils.getCommentTime
@@ -34,9 +40,6 @@ export struct CardSourceInfo { @@ -34,9 +40,6 @@ export struct CardSourceInfo {
34 .contentDTO.publishTime)) 40 .contentDTO.publishTime))
35 .indexOf 41 .indexOf
36 ('-') === -1) { 42 ('-') === -1) {
37 - Image($r("app.media.point"))  
38 - .width(16)  
39 - .height(16)  
40 Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime))) 43 Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.contentDTO.publishTime)))
41 .fontSize($r("app.float.font_size_12")) 44 .fontSize($r("app.float.font_size_12"))
42 .fontColor($r("app.color.color_B0B0B0")) 45 .fontColor($r("app.color.color_B0B0B0"))
@@ -17,7 +17,7 @@ export struct Card10Component { @@ -17,7 +17,7 @@ export struct Card10Component {
17 build() { 17 build() {
18 Column() { 18 Column() {
19 // 顶部标题,最多两行 19 // 顶部标题,最多两行
20 - if (this.contentDTO.newsTitle) { 20 + if (this.contentDTO.titleShow === 1 && this.contentDTO.newsTitle) {
21 Text(this.contentDTO.newsTitle) 21 Text(this.contentDTO.newsTitle)
22 .width(CommonConstants.FULL_WIDTH) 22 .width(CommonConstants.FULL_WIDTH)
23 .fontSize($r('app.float.font_size_17')) 23 .fontSize($r('app.float.font_size_17'))
@@ -42,16 +42,15 @@ export struct Card6Component { @@ -42,16 +42,15 @@ export struct Card6Component {
42 .alignItems(HorizontalAlign.Start) 42 .alignItems(HorizontalAlign.Start)
43 .justifyContent(FlexAlign.Start) 43 .justifyContent(FlexAlign.Start)
44 .width('58%') 44 .width('58%')
45 - if (this.contentDTO.coverUrl) {  
46 - Stack() {  
47 - Image(this.contentDTO.coverUrl)  
48 - .borderRadius(5)  
49 - .aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4)  
50 - .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 90 : 180)  
51 - CardMediaInfo({ contentDTO: this.contentDTO })  
52 - }  
53 - .alignContent(Alignment.BottomEnd) 45 + Stack() {
  46 + Image(this.contentDTO.coverUrl)
  47 + .backgroundColor($r('app.color.color_B0B0B0'))
  48 + .borderRadius(5)
  49 + .aspectRatio(this.contentDTO.appStyle === CompStyle.Card_13 ? 3 / 2 : 3 / 4)
  50 + .height(this.contentDTO.appStyle === CompStyle.Card_13 ? 90 : 180)
  51 + CardMediaInfo({ contentDTO: this.contentDTO })
54 } 52 }
  53 + .alignContent(Alignment.BottomEnd)
55 } 54 }
56 .onClick((event: ClickEvent) => { 55 .onClick((event: ClickEvent) => {
57 ProcessUtils.processPage(this.contentDTO) 56 ProcessUtils.processPage(this.contentDTO)
@@ -15,7 +15,7 @@ export struct Card9Component { @@ -15,7 +15,7 @@ export struct Card9Component {
15 build() { 15 build() {
16 Column() { 16 Column() {
17 // 顶部标题,最多两行 17 // 顶部标题,最多两行
18 - if (this.contentDTO.newsTitle) { 18 + if (this.contentDTO.titleShow === 1 && this.contentDTO.newsTitle) {
19 Text(this.contentDTO.newsTitle) 19 Text(this.contentDTO.newsTitle)
20 .width(CommonConstants.FULL_WIDTH) 20 .width(CommonConstants.FULL_WIDTH)
21 .fontSize($r('app.float.font_size_17')) 21 .fontSize($r('app.float.font_size_17'))