Showing
1 changed file
with
5 additions
and
6 deletions
| @@ -34,7 +34,7 @@ export struct Card19Component { | @@ -34,7 +34,7 @@ export struct Card19Component { | ||
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | titleInit() { | 36 | titleInit() { |
| 37 | - const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title); | 37 | + const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title || this.contentDTO.newsTitle); |
| 38 | this.titleMarked = titleInitRes.titleMarked; | 38 | this.titleMarked = titleInitRes.titleMarked; |
| 39 | this.textArr = titleInitRes.textArr; | 39 | this.textArr = titleInitRes.textArr; |
| 40 | } | 40 | } |
| @@ -52,8 +52,9 @@ export struct Card19Component { | @@ -52,8 +52,9 @@ export struct Card19Component { | ||
| 52 | pageName: this.pageName, | 52 | pageName: this.pageName, |
| 53 | isPeopleShipHome:this.isPeopleShipHome, loadImg: this.loadImg | 53 | isPeopleShipHome:this.isPeopleShipHome, loadImg: this.loadImg |
| 54 | } | 54 | } |
| 55 | - ) // 标题 | ||
| 56 | - if (this.contentDTO.newsTitle) { | 55 | + ) |
| 56 | + // 标题 | ||
| 57 | + if (this.contentDTO.title || this.contentDTO.newsTitle ) { | ||
| 57 | Text() { | 58 | Text() { |
| 58 | if (this.titleMarked) { | 59 | if (this.titleMarked) { |
| 59 | ForEach(this.textArr, (textItem: textItem) => { | 60 | ForEach(this.textArr, (textItem: textItem) => { |
| @@ -292,9 +293,7 @@ struct createImg { | @@ -292,9 +293,7 @@ struct createImg { | ||
| 292 | .backgroundColor(0xf5f5f5) | 293 | .backgroundColor(0xf5f5f5) |
| 293 | // .aspectRatio(this.onePicW > this.onePicH ? 343 / 198 : 228 / 305) | 294 | // .aspectRatio(this.onePicW > this.onePicH ? 343 / 198 : 228 / 305) |
| 294 | .width('100%') | 295 | .width('100%') |
| 295 | - .constraintSize({ | ||
| 296 | - maxHeight: this.onePicW > this.onePicH ? 198 : 305 | ||
| 297 | - }) | 296 | + .aspectRatio(this.onePicW / this.onePicH < 1.5 ? 343 / 198 : 343 / 305) |
| 298 | .autoResize(true) | 297 | .autoResize(true) |
| 299 | .borderRadius(this.caclImageRadius(index)) | 298 | .borderRadius(this.caclImageRadius(index)) |
| 300 | .borderStyle(BorderStyle.Solid) | 299 | .borderStyle(BorderStyle.Solid) |
-
Please register or login to post a comment