PeopleShipHomePageHeadComponent.ets
1.25 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
@Component
//人民号-我的关注横划卡-头像
export struct PeopleShipHomePageHeadComponent {
@State diameter: number = 30
@State iconDiameter: number = 10
@Prop headPhotoUrl: string | ResourceStr = ''
@Prop authIcon: string = ''
build() {
Stack({ alignContent: Alignment.BottomEnd }) {
// 头像
Image( this.headPhotoUrl )
.alt($r('app.media.WDAccountOwnerHedaerDefaultIcon'))
.width(this.diameter)
.height(this.diameter)
.borderRadius(this.diameter/2)
// .borderWidth('0.5vp')
.border({
width: 0.5,
color: '#0D000000', // 5% 透明度的黑色
style: BorderStyle.Solid
})
// .borderStyle(BorderStyle.Solid)
// .shadow({radius: 10, color: '#222226bd'})
// .borderColor(Color.White)
.objectFit(ImageFit.Cover)
.backgroundColor(Color.White)
if(this.authIcon.length > 0 ) {
Image( this.authIcon )
.width(this.iconDiameter)
.height(this.iconDiameter)
.borderRadius(this.iconDiameter/2)
.objectFit(ImageFit.Cover)
.margin({
right: '-3vp'
})
}
}
}
}