Showing
1 changed file
with
6 additions
and
8 deletions
| 1 | -import { Action, CompDTO, ContentDTO, Params } from 'wdBean'; | ||
| 2 | -import { CompStyle } from 'wdConstant'; | ||
| 3 | -import { Logger } from 'wdKit'; | ||
| 4 | -import { WDRouterRule } from 'wdRouter'; | 1 | +import { CompDTO } from 'wdBean'; |
| 5 | import { ProcessUtils } from '../../utils/ProcessUtils'; | 2 | import { ProcessUtils } from '../../utils/ProcessUtils'; |
| 6 | 3 | ||
| 7 | const TAG = 'SingleImageCardComponent'; | 4 | const TAG = 'SingleImageCardComponent'; |
| @@ -21,7 +18,7 @@ export struct SingleImageCardComponent { | @@ -21,7 +18,7 @@ export struct SingleImageCardComponent { | ||
| 21 | 18 | ||
| 22 | aboutToAppear() { | 19 | aboutToAppear() { |
| 23 | // Logger.debug(TAG + "" + JSON.stringify(this.compDTO.operDataList)); | 20 | // Logger.debug(TAG + "" + JSON.stringify(this.compDTO.operDataList)); |
| 24 | - if(this.compDTO.operDataList[0].newsTitle.length > 26){ | 21 | + if (this.compDTO.operDataList[0].newsTitle.length > 26) { |
| 25 | this.titleNumber = 3; | 22 | this.titleNumber = 3; |
| 26 | } else { | 23 | } else { |
| 27 | this.titleNumber = 2; | 24 | this.titleNumber = 2; |
| @@ -33,11 +30,11 @@ export struct SingleImageCardComponent { | @@ -33,11 +30,11 @@ export struct SingleImageCardComponent { | ||
| 33 | Column() { | 30 | Column() { |
| 34 | Text(this.compDTO.operDataList[0].newsTitle) | 31 | Text(this.compDTO.operDataList[0].newsTitle) |
| 35 | .fontSize(16) | 32 | .fontSize(16) |
| 36 | - .fontWeight(FontWeight.Bold) | 33 | + .fontWeight(FontWeight.Normal) |
| 37 | .maxLines(this.titleNumber)// | 34 | .maxLines(this.titleNumber)// |
| 38 | .alignSelf(ItemAlign.Start) | 35 | .alignSelf(ItemAlign.Start) |
| 39 | .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 | 36 | .textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。 |
| 40 | - .height(this.titleNumber === 3 ?"80%" : '65%') | 37 | + .height(this.titleNumber === 3 ? "80%" : '65%') |
| 41 | Row() { | 38 | Row() { |
| 42 | Text('人民日报') | 39 | Text('人民日报') |
| 43 | .height(40) | 40 | .height(40) |
| @@ -64,13 +61,14 @@ export struct SingleImageCardComponent { | @@ -64,13 +61,14 @@ export struct SingleImageCardComponent { | ||
| 64 | .alignItems(HorizontalAlign.Start) | 61 | .alignItems(HorizontalAlign.Start) |
| 65 | .justifyContent(FlexAlign.SpaceBetween) | 62 | .justifyContent(FlexAlign.SpaceBetween) |
| 66 | .width('58%') | 63 | .width('58%') |
| 64 | + | ||
| 67 | Blank(16) | 65 | Blank(16) |
| 68 | Image(this.compDTO.operDataList[0].coverUrl) | 66 | Image(this.compDTO.operDataList[0].coverUrl) |
| 69 | .height('78vp') | 67 | .height('78vp') |
| 70 | .borderRadius(5) | 68 | .borderRadius(5) |
| 71 | .aspectRatio(3 / 2) | 69 | .aspectRatio(3 / 2) |
| 72 | } | 70 | } |
| 73 | - .onClick((event: ClickEvent)=>{ | 71 | + .onClick((event: ClickEvent) => { |
| 74 | ProcessUtils.processPage(this.compDTO?.operDataList[0]) | 72 | ProcessUtils.processPage(this.compDTO?.operDataList[0]) |
| 75 | }) | 73 | }) |
| 76 | .padding( | 74 | .padding( |
-
Please register or login to post a comment