liujian1_wd

图文详情页面

import { Action, CompDTO, ContentDTO, Params } from 'wdBean';
import { CompStyle } from 'wdConstant';
import { Logger } from 'wdKit';
import { WDRouterRule } from 'wdRouter';
import { CompDTO } from 'wdBean';
import { ProcessUtils } from '../../utils/ProcessUtils';
const TAG = 'SingleImageCardComponent';
... ... @@ -21,7 +18,7 @@ export struct SingleImageCardComponent {
aboutToAppear() {
// Logger.debug(TAG + "" + JSON.stringify(this.compDTO.operDataList));
if(this.compDTO.operDataList[0].newsTitle.length > 26){
if (this.compDTO.operDataList[0].newsTitle.length > 26) {
this.titleNumber = 3;
} else {
this.titleNumber = 2;
... ... @@ -33,11 +30,11 @@ export struct SingleImageCardComponent {
Column() {
Text(this.compDTO.operDataList[0].newsTitle)
.fontSize(16)
.fontWeight(FontWeight.Bold)
.fontWeight(FontWeight.Normal)
.maxLines(this.titleNumber)//
.alignSelf(ItemAlign.Start)
.textOverflow({ overflow: TextOverflow.Ellipsis })// 超出的部分显示省略号。
.height(this.titleNumber === 3 ?"80%" : '65%')
.height(this.titleNumber === 3 ? "80%" : '65%')
Row() {
Text('人民日报')
.height(40)
... ... @@ -64,13 +61,14 @@ export struct SingleImageCardComponent {
.alignItems(HorizontalAlign.Start)
.justifyContent(FlexAlign.SpaceBetween)
.width('58%')
Blank(16)
Image(this.compDTO.operDataList[0].coverUrl)
.height('78vp')
.borderRadius(5)
.aspectRatio(3 / 2)
}
.onClick((event: ClickEvent)=>{
.onClick((event: ClickEvent) => {
ProcessUtils.processPage(this.compDTO?.operDataList[0])
})
.padding(
... ...