wangliang_wd

feat:优化早晚报头视图展示

@@ -17,7 +17,7 @@ export struct topicInfoView { @@ -17,7 +17,7 @@ export struct topicInfoView {
17 // } as FrontLinkObject 17 // } as FrontLinkObject
18 18
19 frontLinkObject: FrontLinkObject = {} as FrontLinkObject 19 frontLinkObject: FrontLinkObject = {} as FrontLinkObject
20 - 20 + @State isExpansion:boolean = false
21 aboutToAppear() { 21 aboutToAppear() {
22 } 22 }
23 23
@@ -32,7 +32,7 @@ export struct topicInfoView { @@ -32,7 +32,7 @@ export struct topicInfoView {
32 }) 32 })
33 .id('img_cover') 33 .id('img_cover')
34 34
35 - if (this.frontLinkObject.linkUrl.length > 0) { 35 + if (this.frontLinkObject.linkUrl.length > 0 || this.frontLinkObject?.newsId.length > 0) {
36 Row() { 36 Row() {
37 Text("查看详情") 37 Text("查看详情")
38 .fontSize(14) 38 .fontSize(14)
@@ -54,6 +54,8 @@ export struct topicInfoView { @@ -54,6 +54,8 @@ export struct topicInfoView {
54 contentDTO.objectType = this.frontLinkObject?.newsType.toString() 54 contentDTO.objectType = this.frontLinkObject?.newsType.toString()
55 contentDTO.objectId = this.frontLinkObject?.newsId 55 contentDTO.objectId = this.frontLinkObject?.newsId
56 contentDTO.linkUrl = this.frontLinkObject?.linkUrl 56 contentDTO.linkUrl = this.frontLinkObject?.linkUrl
  57 + contentDTO.relId = this.frontLinkObject?.newsRelId.toString()
  58 + contentDTO.relType = this.frontLinkObject?.newsType.toString()
57 ProcessUtils.processPage(contentDTO) 59 ProcessUtils.processPage(contentDTO)
58 60
59 }) 61 })
@@ -65,17 +67,25 @@ export struct topicInfoView { @@ -65,17 +67,25 @@ export struct topicInfoView {
65 .id('row_detail') 67 .id('row_detail')
66 } 68 }
67 69
68 - Text(this.frontLinkObject?.summary ?? "")  
69 - .margin({ top: 10 }) 70 +
  71 + Row(){
  72 + Text(this.frontLinkObject?.summary ?? "")
70 .fontSize(14) 73 .fontSize(14)
71 - .fontColor($r('app.color.white'))  
72 - .maxLines(3) 74 + .fontColor('#CCFFFFFF')
  75 + .maxLines(this.isExpansion?999:3)
73 .textOverflow({ overflow: TextOverflow.Ellipsis }) 76 .textOverflow({ overflow: TextOverflow.Ellipsis })
  77 +
  78 + Text(this.isExpansion?'收起':'展开').onClick(()=>{
  79 + this.isExpansion = !this.isExpansion
  80 + })
  81 + .fontSize(14)
  82 + .fontColor($r('app.color.white'))
  83 + }.alignItems(VerticalAlign.Bottom)
74 .alignRules({ 84 .alignRules({
75 left: { anchor: "__container__", align: HorizontalAlign.Start }, 85 left: { anchor: "__container__", align: HorizontalAlign.Start },
76 - bottom: this.frontLinkObject.linkUrl.length > 0?{ anchor: "row_detail", align: VerticalAlign.Top }:{ anchor: "__container__", align: VerticalAlign.Bottom } 86 + bottom: this.frontLinkObject.linkUrl.length > 0 || this.frontLinkObject?.newsId.length > 0 ?{ anchor: "row_detail", align: VerticalAlign.Top }:{ anchor: "__container__", align: VerticalAlign.Bottom }
77 }) 87 })
78 - .margin({ left: 16, right: 16, bottom: this.frontLinkObject.linkUrl.length > 0?0:16}) 88 + .margin({top: 10 , left: 16, right: 16, bottom: this.frontLinkObject.linkUrl.length > 0 || this.frontLinkObject?.newsId.length > 0 ?0:16})
79 .id('txt_summary') 89 .id('txt_summary')
80 90
81 Text(this.frontLinkObject?.title ?? "") 91 Text(this.frontLinkObject?.title ?? "")