guochunsong

修改13单片卡ui适配

@@ -19,7 +19,8 @@ export struct SingleImageCardComponent { @@ -19,7 +19,8 @@ export struct SingleImageCardComponent {
19 @State titleNumber: number = 3 //标题行数 19 @State titleNumber: number = 3 //标题行数
20 20
21 aboutToAppear() { 21 aboutToAppear() {
22 - if(this.compDTO.operDataList[0].newsTitle.length > 25){ 22 + Logger.debug(TAG + "" + JSON.stringify(this.compDTO.operDataList));
  23 + if(this.compDTO.operDataList[0].newsTitle.length > 26){
23 this.titleNumber = 3; 24 this.titleNumber = 3;
24 } else { 25 } else {
25 this.titleNumber = 2; 26 this.titleNumber = 2;
@@ -35,7 +36,7 @@ export struct SingleImageCardComponent { @@ -35,7 +36,7 @@ export struct SingleImageCardComponent {
35 .maxLines(this.titleNumber)// 36 .maxLines(this.titleNumber)//
36 .alignSelf(ItemAlign.Start) 37 .alignSelf(ItemAlign.Start)
37 .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 38 .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
38 - .height("70%") 39 + .height(this.titleNumber === 3 ?"80%" : '65%')
39 Row() { 40 Row() {
40 Text('人民日报') 41 Text('人民日报')
41 .height(40) 42 .height(40)
@@ -56,20 +57,22 @@ export struct SingleImageCardComponent { @@ -56,20 +57,22 @@ export struct SingleImageCardComponent {
56 left: 10 57 left: 10
57 }) 58 })
58 }.alignSelf(ItemAlign.Start) 59 }.alignSelf(ItemAlign.Start)
59 - .height("30%") 60 + .height(this.titleNumber === 3 ? "20%" : '35%')
  61 + .justifyContent(FlexAlign.SpaceBetween)
60 } 62 }
  63 + .alignItems(HorizontalAlign.Start)
61 .justifyContent(FlexAlign.SpaceBetween) 64 .justifyContent(FlexAlign.SpaceBetween)
62 .width('58%') 65 .width('58%')
63 Blank(16) 66 Blank(16)
64 Image(this.compDTO.operDataList[0].coverUrl) 67 Image(this.compDTO.operDataList[0].coverUrl)
65 - .width('38%') 68 + .height('78vp')
66 .borderRadius(5) 69 .borderRadius(5)
67 .aspectRatio(3 / 2) 70 .aspectRatio(3 / 2)
68 } 71 }
69 .padding( 72 .padding(
70 { top: 16, bottom: 16, left: 14, right: 14 }) 73 { top: 16, bottom: 16, left: 14, right: 14 })
71 .width(FULL_PARENT) 74 .width(FULL_PARENT)
72 - .height(this.titleNumber === 3 ? '152vp' : '106vp') 75 + .height(this.titleNumber === 3 ? '127vp' : '106vp')
73 .justifyContent(FlexAlign.SpaceBetween) 76 .justifyContent(FlexAlign.SpaceBetween)
74 } 77 }
75 } 78 }
@@ -30,11 +30,12 @@ export struct ZhGridLayoutComponent { @@ -30,11 +30,12 @@ export struct ZhGridLayoutComponent {
30 Column() { 30 Column() {
31 Image(item.coverUrl) 31 Image(item.coverUrl)
32 .width(50) 32 .width(50)
  33 + .borderRadius(5)
33 .aspectRatio(1 / 1) 34 .aspectRatio(1 / 1)
34 .autoResize(true) 35 .autoResize(true)
35 Text(item.newsTitle) 36 Text(item.newsTitle)
36 .fontSize(16) 37 .fontSize(16)
37 - .margin({ top: 10 }) 38 + .padding({ top: 10 })
38 }.margin({ 39 }.margin({
39 top:5, 40 top:5,
40 bottom:5, 41 bottom:5,