CustomBottomFuctionUI.ets
1.68 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
@Component
export struct CustomBottomFuctionUI {
@Consume deleteNum: number
@Consume isAllSelect: boolean
selectAllCallback: (isOn: boolean) => void = () => {
}
confirmCallback: () => void = () => {
}
build() {
RelativeContainer(){
Row(){
Image(this.isAllSelect?$r("app.media.MyCollection_selected_icon"):$r("app.media.MyCollection_unselected_icon"))
.width(20)
.height(20)
// .margin({right:'31lpx' })
.margin({right: 31 })
Text(this.isAllSelect?'取消全选':'全选')
.fontColor($r('app.color.color_222222'))
.backgroundColor(Color.White)
}
.id("allSelect_Button")
// .margin({left:'31lpx'})
.margin({left: 31})
.alignRules({
center: {anchor: "__container__", align: VerticalAlign.Center},
left: {anchor: "__container__", align: HorizontalAlign.Start}
})
.onClick(()=>{
this.isAllSelect = !this.isAllSelect;
this.selectAllCallback(this.isAllSelect)
})
Button('删除'+ (this.deleteNum === 0 ? '':'('+this.deleteNum.toString()+')'))
.type(ButtonType.Normal)
.fontColor(this.deleteNum === 0?$r('app.color.color_B0B0B0'):$r('app.color.color_ED2800'))
.backgroundColor(Color.White)
.id("delete_Button")
.alignRules({
center: {anchor: "__container__", align: VerticalAlign.Center},
right: {anchor: "__container__", align: HorizontalAlign.End}
})
// .margin({right:'31lpx'})
.margin({right: 31})
.onClick(()=>{
this.confirmCallback()
})
}
.height('6%')
.width('100%')
.backgroundColor(Color.White)
}
}