RmhTitle.ets
2.07 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
/**
* 这里是人民号动态中的顶部信息:人民号logo,名字,描述,关注等
*/
import { RmhInfoDTO } from 'wdBean'
import { CommonConstants } from 'wdConstant/Index';
import { DateTimeUtils } from 'wdKit';
@Component
export struct RmhTitle {
@Prop rmhInfo: RmhInfoDTO
@Prop publishTime: string | undefined
build() {
Flex() {
Stack() {
Image(this.rmhInfo.rmhHeadUrl)
.width(36)
.height(36).borderRadius(50)
Image(this.rmhInfo.authIcon)
.width(14)
.height(14)
.borderRadius(50)
}
.margin({ right: 8 })
.alignContent(Alignment.BottomEnd)
.flexShrink(0)
Column() {
Text(this.rmhInfo.rmhName)
.fontSize($r('app.float.font_size_13'))
.fontColor($r('app.color.color_222222'))
.fontWeight(600)
.alignSelf(ItemAlign.Start)
Row() {
if (this.publishTime) {
Text(DateTimeUtils.getCommentTime(Number.parseFloat(this.publishTime)))
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
Image($r('app.media.point'))
.width(16)
.height(16)
}
Text(this.rmhInfo.rmhDesc)
.fontSize($r("app.float.font_size_12"))
.fontColor($r("app.color.color_B0B0B0"))
.maxLines(1)
.alignSelf(ItemAlign.Start)
.textOverflow({ overflow: TextOverflow.Ellipsis })
.textAlign(TextAlign.Start)
.width('70%')
}
}
Blank()
if (this.rmhInfo.cnIsAttention) {
Row() {
Image($r('app.media.rmh_follow'))
.width(16)
.height(16)
Text('关注')
.fontSize($r('app.float.font_size_13'))
.fontColor($r('app.color.color_ED2800'))
}
.flexShrink(0)
.alignSelf(ItemAlign.Center)
.onClick(() => {
// TODO 调用关注接口
})
}
}
.width(CommonConstants.FULL_WIDTH)
.margin({ bottom: 10 })
}
}