Showing
2 changed files
with
14 additions
and
12 deletions
| @@ -22,7 +22,7 @@ export struct CompStyle_10 { | @@ -22,7 +22,7 @@ export struct CompStyle_10 { | ||
| 22 | .margin({ bottom: 19 }) | 22 | .margin({ bottom: 19 }) |
| 23 | } | 23 | } |
| 24 | // 大图 | 24 | // 大图 |
| 25 | - Image(this.compDTO.operDataList[0].coverUrl) | 25 | + Image(this.compDTO.operDataList[0] && this.compDTO.operDataList[0].coverUrl) |
| 26 | .width('100%') | 26 | .width('100%') |
| 27 | // 专题列表--后端返回三个, | 27 | // 专题列表--后端返回三个, |
| 28 | Column(){ | 28 | Column(){ |
| @@ -74,18 +74,20 @@ export struct CompStyle_10 { | @@ -74,18 +74,20 @@ export struct CompStyle_10 { | ||
| 74 | .fontColor($r('app.color.color_222222')) | 74 | .fontColor($r('app.color.color_222222')) |
| 75 | .maxLines(2) | 75 | .maxLines(2) |
| 76 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 76 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 77 | - .alignSelf(ItemAlign.Center) | ||
| 78 | Row(){ | 77 | Row(){ |
| 79 | // 展示发稿人 | 78 | // 展示发稿人 |
| 80 | - Text(item.source) | ||
| 81 | - .fontSize($r('app.float.font_size_12')) | ||
| 82 | - .fontColor($r('app.color.color_B0B0B0')) | ||
| 83 | - .layoutWeight(1) | ||
| 84 | - .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 85 | - .maxLines(1) | ||
| 86 | - Image($r('app.media.point')) | ||
| 87 | - .width(16) | ||
| 88 | - .height(16) | 79 | + if(item.source) { |
| 80 | + Text(item.source) | ||
| 81 | + .fontSize($r('app.float.font_size_12')) | ||
| 82 | + .fontColor($r('app.color.color_B0B0B0')) | ||
| 83 | + .textOverflow({overflow: TextOverflow.Ellipsis}) | ||
| 84 | + .maxLines(1) | ||
| 85 | + .width(item.source.length > 10 ? '60%' : '') | ||
| 86 | + | ||
| 87 | + Image($r('app.media.point')) | ||
| 88 | + .width(16) | ||
| 89 | + .height(16) | ||
| 90 | + } | ||
| 89 | Text(DateTimeUtils.getCommentTime(Number.parseFloat(String(item.publishTime)))) | 91 | Text(DateTimeUtils.getCommentTime(Number.parseFloat(String(item.publishTime)))) |
| 90 | .fontSize($r("app.float.font_size_12")) | 92 | .fontSize($r("app.float.font_size_12")) |
| 91 | .fontColor($r("app.color.color_B0B0B0")) | 93 | .fontColor($r("app.color.color_B0B0B0")) |
| @@ -67,9 +67,9 @@ export struct ZhSingleRow04 { | @@ -67,9 +67,9 @@ export struct ZhSingleRow04 { | ||
| 67 | Text(item.source) | 67 | Text(item.source) |
| 68 | .fontSize($r('app.float.font_size_12')) | 68 | .fontSize($r('app.float.font_size_12')) |
| 69 | .fontColor($r('app.color.color_B0B0B0')) | 69 | .fontColor($r('app.color.color_B0B0B0')) |
| 70 | - .layoutWeight(1) | ||
| 71 | .textOverflow({overflow: TextOverflow.Ellipsis}) | 70 | .textOverflow({overflow: TextOverflow.Ellipsis}) |
| 72 | .maxLines(1) | 71 | .maxLines(1) |
| 72 | + .width(item.source.length > 10 ? '60%' : '') | ||
| 73 | Image($r("app.media.point")) | 73 | Image($r("app.media.point")) |
| 74 | .width(16) | 74 | .width(16) |
| 75 | .height(16) | 75 | .height(16) |
-
Please register or login to post a comment