loading
This commit is contained in:
@@ -44,4 +44,8 @@ export { PositionSelectedSheet } from './src/main/ets/Views/PositionSelectedShee
|
||||
|
||||
export { SpecialitySelectedSheet } from './src/main/ets/Views/SpecialitySelectedSheet'
|
||||
|
||||
export { EmptyViewComp } from './src/main/ets/Views/EmptyViewComp'
|
||||
|
||||
export { HdLoadingDialog } from './src/main/ets/components/HdLoadingDialog'
|
||||
|
||||
export { EditUserDataItem } from './src/main/ets/Views/EditUserDataItem'
|
||||
|
||||
@@ -0,0 +1,26 @@
|
||||
@Preview
|
||||
@Component
|
||||
export struct EmptyViewComp {
|
||||
@Prop promptText: string = '暂无数据' // 默认提示文字
|
||||
@Prop imageSrc: ResourceStr = $r('app.media.zanwushuju') // 默认图片
|
||||
@Prop isVisibility:boolean = false;
|
||||
|
||||
build() {
|
||||
Stack({ alignContent: Alignment.Center }) {
|
||||
Column() {
|
||||
Image(this.imageSrc)
|
||||
.width(100)
|
||||
.height(120)
|
||||
Text(this.promptText)
|
||||
.fontSize(16)
|
||||
.fontColor(Color.Gray)
|
||||
}
|
||||
.width('100%')
|
||||
.height('100%')
|
||||
.justifyContent(FlexAlign.Center)
|
||||
}
|
||||
.width('100%')
|
||||
.height('100%')
|
||||
.visibility(this.isVisibility?Visibility.Visible:Visibility.Hidden)
|
||||
}
|
||||
}
|
||||
@@ -74,6 +74,14 @@ export struct HdGrid {
|
||||
this.listContent()
|
||||
this.loadMoreBuilder()
|
||||
}
|
||||
.edgeEffect(EdgeEffect.Spring, { alwaysEnabled: true })//边缘弹性
|
||||
.onReachStart(()=>{
|
||||
if (this.loading || this.refreshing || this.finished) {
|
||||
return;
|
||||
}
|
||||
this.loading = true
|
||||
this.onLoad()
|
||||
})
|
||||
.columnsTemplate('1fr 1fr')
|
||||
.columnsGap(10)
|
||||
.rowsGap(10)
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
@CustomDialog
|
||||
export struct HdLoadingDialog {
|
||||
@State
|
||||
message: string = ''
|
||||
controller: CustomDialogController
|
||||
|
||||
build() {
|
||||
Column({ space: 10 }) {
|
||||
LoadingProgress()
|
||||
.width(48)
|
||||
.height(48)
|
||||
.color('#ffffff')
|
||||
if (this.message) {
|
||||
Text(this.message)
|
||||
.fontSize(14)
|
||||
.fontColor('#ffffff')
|
||||
}
|
||||
}
|
||||
.justifyContent(FlexAlign.Center)
|
||||
.width(120)
|
||||
.height(120)
|
||||
.backgroundColor('rgba(0,0,0,0.6)')
|
||||
.borderRadius(16)
|
||||
}
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
Reference in New Issue
Block a user