topicInfoView.ets
3.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
import { FrontLinkObject } from 'wdBean';
/**
* 早晚报,topic
*/
@Entry
@Component
export struct topicInfoView {
@State frontLinkObject: FrontLinkObject = {
coverSize: "599*798",
coverUrl: "https://cdnjdphoto.aikan.pdnews.cn/zhbj-20240116/image/content/9a91a96077174087852cf93c5e26acce.jpeg",
newsId: "30002086032",
newsRelId: 500000256225,
summary: "欧尔班多次明确反对欧盟此举。2023年底,匈牙利否决了欧盟对乌克兰的500亿欧元援助计划,认为欧盟不应向乌克兰提供更多资金,而应尽快结束俄乌冲突。因此,欧盟领导人在去年12月欧盟峰会上未能就该计划达成一致。欧尔班多次明确反对欧盟此举。2023年底,匈牙利否决了欧盟对乌克兰的500亿欧元援助计划,认为欧盟不应向乌克兰提供更多资金,而应尽快结束俄乌冲突。因此,欧盟领导人在去年12月欧盟峰会上未能就该计",
title: "匈牙利总理欧尔班妥协,阻碍欧盟向乌克兰援助的最后一个障碍被解"
} as FrontLinkObject
aboutToAppear() {
}
build() {
RelativeContainer() {
Image(this.frontLinkObject?.coverUrl)
.width("100%")
.height("100%")
.alignRules({
top: { anchor: '__container__', align: VerticalAlign.Top },
left: { anchor: '__container__', align: HorizontalAlign.Start }
})
.id('img_cover')
Row() {
Text("查看详情")
.fontSize(16)
.fontColor($r('app.color.white'))
.maxLines(1)
Image($r('app.media.more'))
.height($r('app.float.top_arrow_size'))
.width(20)
}
.margin({ top: 10 })
// .backgroundColor(Color.Red)
.alignRules({
left: { anchor: "__container__", align: HorizontalAlign.Start },
bottom: { anchor: "__container__", align: VerticalAlign.Bottom }
})
.id('row_detail')
Text(this.frontLinkObject?.summary ?? "")
.margin({ top: 10 })
.fontSize(14)
.fontColor($r('app.color.white'))
.maxLines(3)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.alignRules({
left: { anchor: "__container__", align: HorizontalAlign.Start },
bottom: { anchor: "row_detail", align: VerticalAlign.Top }
})
.id('txt_summary')
Text(this.frontLinkObject?.title ?? "")
.fontSize(24)
.fontColor($r('app.color.white'))
.maxLines(2)
.alignRules({
left: { anchor: "__container__", align: HorizontalAlign.Start },
bottom: { anchor: "txt_summary", align: VerticalAlign.Top }
})
.id('txt_title')
}
.width("100%")
.aspectRatio(3 / 4)
// .aspectRatio(1)
// .backgroundColor(Color.Orange)
// .hoverEffect(HoverEffect.Scale)
.onClick((event: ClickEvent) => {
// console.info(TAG, `buildTopicInfoView onClick event`);
// let taskAction: Action = {
// type: 'JUMP_H5_BY_WEB_VIEW',
// params: {
// url: ConfigConstants.DETAIL_URL
// } as Params,
// };
// WDRouterRule.jumpWithAction(taskAction)
// let taskAction: Action = {
// type: 'JUMP_DETAIL_PAGE',
// params: {
// detailPageType: 7, // 沉浸式竖屏详情页
// contentID: '863556812'
// } as Params,
// };
// WDRouterRule.jumpWithAction(taskAction)
})
}
}