Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
liujian1_wd
2024-02-03 18:47:48 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
db6cab4804bbfa5e2348c784af8056fd87da6189
db6cab48
1 parent
0c343ae8
图文详情页面
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
8 deletions
sight_harmony/wdComponent/src/main/ets/components/view/SingleImageCardComponent.ets
sight_harmony/wdComponent/src/main/ets/components/view/SingleImageCardComponent.ets
View file @
db6cab4
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(
...
...
Please
register
or
login
to post a comment