rabbit-harmony/common/src/main/ets/dialog/GlobalDownloadingDialog.ets

43 lines
1.1 KiB
Plaintext

@CustomDialog
export struct GlobalDownloadingDialog {
controller: CustomDialogController;
@State show: boolean = false;
@Link progress: number;
build() {
Stack() {
if(this.progress > 0){
Column(){
Progress({
value: this.progress,
total: 100,
type: ProgressType.Linear
})
.width('100%')
.height(10)
.color('#ff4f8af6')
.backgroundColor('#ebebeb')
.style({ strokeWidth: 10, enableSmoothEffect: true })
Text('下载中,请稍后:' + this.progress + '%').fontColor(Color.White).fontSize(12).margin({ top: 4})
}
.margin({ left:8, right:8 })
}else{
Column(){
LoadingProgress()
.width(60)
.color('#ff4f8af6')
Text('加载中,请稍后...').fontColor(Color.White).fontSize(12).margin({ top: 12})
}
.margin({ left:8, right:8 })
}
}
.width('100%')
.height('100%')
.backgroundColor('#99000000')
.borderRadius(12)
}
}