PeopleShipRecommendHeadComponent.ets
2 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
import { RmhRecommendDTO } from 'wdBean';
import { ToastUtils } from 'wdKit/Index';
@Component
export struct PeopleShipRecommendHeadComponent {
@State isSelected: boolean = true
@Consume rmhSelectedList: string[]
@State rmhInfo: RmhRecommendDTO = {} as RmhRecommendDTO
build() {
Column(){
Stack({ alignContent: Alignment.BottomEnd }) {
Image(this.rmhInfo.headPhotoUrl.length > 0 ? this.rmhInfo.headPhotoUrl : $r('app.media.WDAccountOwnerHedaerDefaultIcon'))
.width('44vp')
.height('44vp')
.borderRadius('22vp')
.objectFit(ImageFit.Cover)
Image( this.isSelectedRmhInfo() ? $r('app.media.rmh_selected') : $r('app.media.rmh_unselected') )
.width('18vp')
.height('18vp')
.objectFit(ImageFit.Cover)
.margin({
right: '-3vp'
})
}.margin({ top: 4, bottom: 8 })
Row() {
Text(this.rmhInfo.userName)
.fontColor($r('app.color.color_222222'))
.fontSize($r('app.float.vp_14'))
.fontWeight(600)
.maxLines(1)
.textOverflow({overflow: TextOverflow.Ellipsis})
if (this.rmhInfo.authIcon) {
Image(this.rmhInfo.authIcon)
.width('12vp')
.height('12vp')
.borderRadius(6)
.objectFit(ImageFit.Cover)
.margin({
left: '2vp'
})
}
}
.alignItems(VerticalAlign.Center)
.justifyContent(FlexAlign.Center)
Text(this.rmhInfo.introduction)
.fontColor($r('app.color.color_B0B0B0'))
.fontSize($r('app.float.vp_11'))
.margin({ top: 6, bottom: 14 })
.textOverflow({overflow: TextOverflow.Ellipsis})
.maxLines(2)
.height(34)
}
.width('100%')
.height('110vp')
}
private isSelectedRmhInfo() {
if (this.rmhSelectedList.length > 0 && this.rmhInfo ) {
if (this.rmhSelectedList.indexOf(this.rmhInfo.creatorId) != -1) {
return true
}
}
return false
}
}