loading
This commit is contained in:
parent
12bd6efea9
commit
3bdbf49577
@ -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'
|
||||
|
||||
26
commons/basic/src/main/ets/Views/EmptyViewComp.ets
Normal file
26
commons/basic/src/main/ets/Views/EmptyViewComp.ets
Normal file
@ -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)
|
||||
|
||||
25
commons/basic/src/main/ets/components/HdLoadingDialog.ets
Normal file
25
commons/basic/src/main/ets/components/HdLoadingDialog.ets
Normal file
@ -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)
|
||||
}
|
||||
}
|
||||
BIN
commons/basic/src/main/resources/base/media/zanwushuju.png
Normal file
BIN
commons/basic/src/main/resources/base/media/zanwushuju.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
@ -3,7 +3,7 @@ import { MeetingItemModel,MeetingModel,MeetingModels,ItemModel } from '../model/
|
||||
import { HdList, HdListController,BasicConstant,hdHttp, HdResponse ,logger} from '@itcast/basic/Index'
|
||||
import { promptAction, router } from '@kit.ArkUI'
|
||||
import { BusinessError } from '@kit.BasicServicesKit';
|
||||
|
||||
import { HdLoadingDialog } from '@itcast/basic'
|
||||
import HashMap from '@ohos.util.HashMap';
|
||||
|
||||
|
||||
@ -22,6 +22,12 @@ export struct ListComp {
|
||||
timer: number = -1
|
||||
hashMap: HashMap<string, string> = new HashMap();
|
||||
|
||||
dialog: CustomDialogController = new CustomDialogController({
|
||||
builder: HdLoadingDialog({ message: '加载中...' }),
|
||||
customStyle: true,
|
||||
alignment: DialogAlignment.Center
|
||||
})
|
||||
|
||||
onUpdate() {
|
||||
if (this.timer) clearTimeout(this.timer)
|
||||
this.timer = setTimeout(() => {
|
||||
@ -38,12 +44,13 @@ export struct ListComp {
|
||||
|
||||
initData(type:number)
|
||||
{
|
||||
this.dialog.open()
|
||||
this.hashMap.clear();
|
||||
this.hashMap.set('page', this.page+"")
|
||||
hdHttp.httpReq<string>(BasicConstant.meetingListV2,this.hashMap).then(async (res: HdResponse<string>) => {
|
||||
logger.info('Response meetingListV2'+res);
|
||||
let json:MeetingModels = JSON.parse(res+'') as MeetingModels;
|
||||
|
||||
this.dialog.close();
|
||||
if(type==0)
|
||||
{
|
||||
this.controller.refreshed()
|
||||
@ -68,8 +75,7 @@ export struct ListComp {
|
||||
}
|
||||
|
||||
}).catch((err: BusinessError) => {
|
||||
|
||||
|
||||
this.dialog.close();
|
||||
})
|
||||
}
|
||||
getPosition() {
|
||||
|
||||
@ -3,12 +3,14 @@ import { MeetingItemModel,MeetingModel,MeetingModels,ItemModel } from '../model/
|
||||
import { HdList, HdListController,BasicConstant,hdHttp, HdResponse ,logger} from '@itcast/basic/Index'
|
||||
import { promptAction, router } from '@kit.ArkUI'
|
||||
import { BusinessError } from '@kit.BasicServicesKit';
|
||||
|
||||
import { EmptyViewComp,HdLoadingDialog } from '@itcast/basic'
|
||||
import HashMap from '@ohos.util.HashMap';
|
||||
|
||||
|
||||
@Component
|
||||
export struct ListCompBack {
|
||||
@State isEmptyViewVisible: boolean = false; // 控制显隐的状态变量
|
||||
|
||||
@Prop
|
||||
@Watch('onUpdate')
|
||||
year:string=''
|
||||
@ -25,6 +27,12 @@ export struct ListCompBack {
|
||||
// timer: number = -1
|
||||
hashMap: HashMap<string, string> = new HashMap();
|
||||
|
||||
dialog: CustomDialogController = new CustomDialogController({
|
||||
builder: HdLoadingDialog({ message: '加载中...' }),
|
||||
customStyle: true,
|
||||
alignment: DialogAlignment.Center
|
||||
})
|
||||
|
||||
onUpdate() {
|
||||
// console.info('Response onUpdate')
|
||||
// if (this.timer) clearTimeout(this.timer)
|
||||
@ -43,6 +51,7 @@ export struct ListCompBack {
|
||||
|
||||
initData(type:number)
|
||||
{
|
||||
this.dialog.open()
|
||||
console.info('Response type'+type)
|
||||
this.hashMap.clear();
|
||||
this.hashMap.set('page', this.page+"")
|
||||
@ -59,7 +68,7 @@ export struct ListCompBack {
|
||||
hdHttp.httpReq<string>(BasicConstant.meetingV2Video,this.hashMap).then(async (res: HdResponse<string>) => {
|
||||
logger.info('Response meetingListV2'+res);
|
||||
let json:MeetingModels = JSON.parse(res+'') as MeetingModels;
|
||||
|
||||
this.dialog.close();
|
||||
if(type==0)
|
||||
{
|
||||
this.controller.refreshed()
|
||||
@ -88,10 +97,18 @@ export struct ListCompBack {
|
||||
} else {
|
||||
this.page++
|
||||
}
|
||||
|
||||
if (this.list.length > 0) {
|
||||
this.isEmptyViewVisible = false;
|
||||
} else {
|
||||
this.isEmptyViewVisible = true;
|
||||
}
|
||||
}).catch((err: BusinessError) => {
|
||||
|
||||
|
||||
this.dialog.close();
|
||||
if (this.list.length > 0) {
|
||||
this.isEmptyViewVisible = false;
|
||||
} else {
|
||||
this.isEmptyViewVisible = true;
|
||||
}
|
||||
})
|
||||
}
|
||||
getPosition() {
|
||||
@ -111,6 +128,11 @@ export struct ListCompBack {
|
||||
|
||||
}
|
||||
build() {
|
||||
if (this.isEmptyViewVisible){
|
||||
EmptyViewComp({promptText:'暂无回放',isVisibility:this.isEmptyViewVisible})
|
||||
.width('100%')
|
||||
.height('100%')
|
||||
} else {
|
||||
HdList({
|
||||
lw: 1,
|
||||
controller: this.controller,
|
||||
@ -119,15 +141,12 @@ export struct ListCompBack {
|
||||
},
|
||||
onLoad: () => {
|
||||
this.initData(1)
|
||||
|
||||
}
|
||||
}) {
|
||||
ForEach(this.list, (item: MeetingItemModel) => {
|
||||
ListItem() {
|
||||
ItemCompBack({ item })
|
||||
}
|
||||
ListItem() { ItemCompBack({ item }) }
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -3,7 +3,7 @@ import { MeetingItemModel,MeetingModel,MeetingModels,ItemModel } from '../model/
|
||||
import { HdList, HdListController,BasicConstant,hdHttp, HdResponse ,logger} from '@itcast/basic/Index'
|
||||
import { promptAction, router } from '@kit.ArkUI'
|
||||
import { BusinessError } from '@kit.BasicServicesKit';
|
||||
|
||||
import { HdLoadingDialog } from '@itcast/basic'
|
||||
import HashMap from '@ohos.util.HashMap';
|
||||
|
||||
|
||||
@ -25,6 +25,13 @@ export struct ListCompPast {
|
||||
// timer: number = -1
|
||||
hashMap: HashMap<string, string> = new HashMap();
|
||||
|
||||
|
||||
dialog: CustomDialogController = new CustomDialogController({
|
||||
builder: HdLoadingDialog({ message: '加载中...' }),
|
||||
customStyle: true,
|
||||
alignment: DialogAlignment.Center
|
||||
})
|
||||
|
||||
onUpdate() {
|
||||
// console.info('Response onUpdate')
|
||||
// if (this.timer) clearTimeout(this.timer)
|
||||
@ -43,6 +50,7 @@ export struct ListCompPast {
|
||||
|
||||
initData(type:number)
|
||||
{
|
||||
this.dialog.open()
|
||||
console.info('Response type'+type)
|
||||
this.hashMap.clear();
|
||||
this.hashMap.set('page', this.page+"")
|
||||
@ -64,7 +72,7 @@ export struct ListCompPast {
|
||||
}
|
||||
this.hashMap.set('title','')
|
||||
hdHttp.httpReq<string>(BasicConstant.meetingHistoryList,this.hashMap).then(async (res: HdResponse<string>) => {
|
||||
|
||||
this.dialog.close()
|
||||
let json:MeetingModels = JSON.parse(res+'') as MeetingModels;
|
||||
|
||||
if(type==0)
|
||||
@ -97,7 +105,7 @@ export struct ListCompPast {
|
||||
}
|
||||
|
||||
}).catch((err: BusinessError) => {
|
||||
|
||||
this.dialog.close()
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
@ -3,12 +3,14 @@ import { VideoMoreModel,VideoMore } from '../model/VideoMoreModel'
|
||||
import { HdGrid, HdListController,BasicConstant,hdHttp, HdResponse ,logger} from '@itcast/basic/Index'
|
||||
import { promptAction, router } from '@kit.ArkUI'
|
||||
import { BusinessError } from '@kit.BasicServicesKit';
|
||||
|
||||
import { HdLoadingDialog,EmptyViewComp } from '@itcast/basic'
|
||||
import HashMap from '@ohos.util.HashMap';
|
||||
|
||||
|
||||
@Component
|
||||
export struct ListCompVideo {
|
||||
@State isEmptyViewVisible: boolean = false; // 控制显隐的状态变量
|
||||
|
||||
@Prop
|
||||
type_uuid:string=''
|
||||
@State
|
||||
@ -20,23 +22,31 @@ export struct ListCompVideo {
|
||||
keyword: string = ''
|
||||
hashMap: HashMap<string, string> = new HashMap();
|
||||
|
||||
dialog: CustomDialogController = new CustomDialogController({
|
||||
builder: HdLoadingDialog({ message: '加载中...' }),
|
||||
customStyle: true,
|
||||
alignment: DialogAlignment.Center
|
||||
})
|
||||
|
||||
// aboutToAppear(): void {
|
||||
// this.onRefresh();
|
||||
// }
|
||||
|
||||
onRefresh() {
|
||||
this.page = 1
|
||||
this.initData(0)
|
||||
|
||||
}
|
||||
|
||||
initData(type:number)
|
||||
{
|
||||
this.dialog.open()
|
||||
this.hashMap.clear();
|
||||
this.hashMap.set('page', this.page+"")
|
||||
this.hashMap.set('typeUuid', this.type_uuid)
|
||||
hdHttp.httpReq<string>(BasicConstant.videoByTypeNew,this.hashMap).then(async (res: HdResponse<string>) => {
|
||||
logger.info('Response videoByTypeNew'+res);
|
||||
let json:VideoMoreModel = JSON.parse(res+'') as VideoMoreModel;
|
||||
|
||||
this.dialog.close()
|
||||
if(type==0)
|
||||
{
|
||||
this.controller.refreshed()
|
||||
@ -59,14 +69,27 @@ export struct ListCompVideo {
|
||||
} else {
|
||||
this.page++
|
||||
}
|
||||
|
||||
if (this.list.length>0) {
|
||||
this.isEmptyViewVisible = false;
|
||||
} else {
|
||||
this.isEmptyViewVisible = true;
|
||||
}
|
||||
}).catch((err: BusinessError) => {
|
||||
|
||||
|
||||
this.dialog.close()
|
||||
if (this.list.length>0) {
|
||||
this.isEmptyViewVisible = false;
|
||||
} else {
|
||||
this.isEmptyViewVisible = true;
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
build() {
|
||||
if (this.isEmptyViewVisible){
|
||||
EmptyViewComp({promptText:'暂无数据',isVisibility:this.isEmptyViewVisible})
|
||||
.width('100%')
|
||||
.height('100%')
|
||||
} else {
|
||||
HdGrid({
|
||||
lw: 1,
|
||||
controller: this.controller,
|
||||
@ -75,7 +98,6 @@ export struct ListCompVideo {
|
||||
},
|
||||
onLoad: () => {
|
||||
this.initData(1)
|
||||
|
||||
}
|
||||
}) {
|
||||
ForEach(this.list, (items: VideoMore) => {
|
||||
@ -84,6 +106,6 @@ export struct ListCompVideo {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1,15 +1,8 @@
|
||||
import { hdHttp, HdResponse,BasicConstant,ExpertData, authStore, ChangeUtil } from '@itcast/basic'
|
||||
import HashMap from '@ohos.util.HashMap'
|
||||
import { hdHttp, HdResponse,BasicConstant,ExpertData, authStore, ChangeUtil,EditUserDataItem,PhotoActionSheet,DatePickerDialog,OfficeSelectedSheet,PositionSelectedSheet,SpecialitySelectedSheet } from '@itcast/basic'
|
||||
import { BusinessError } from '@kit.BasicServicesKit';
|
||||
import { promptAction, router } from '@kit.ArkUI'
|
||||
import { EditUserDataItem } from '@itcast/basic/src/main/ets/Views/EditUserDataItem'
|
||||
import { PhotoActionSheet } from '@itcast/basic/src/main/ets/Views/PhotoActionSheet'
|
||||
import { DatePickerDialog } from '@itcast/basic/src/main/ets/Views//DatePickerDialog'
|
||||
import { OfficeSelectedSheet } from '@itcast/basic/src/main/ets/Views//OfficeSelectedSheet'
|
||||
import { PositionSelectedSheet } from '@itcast/basic/src/main/ets/Views//PositionSelectedSheet'
|
||||
import { SpecialitySelectedSheet } from '@itcast/basic/src/main/ets/Views//SpecialitySelectedSheet'
|
||||
import { http } from '@kit.NetworkKit';
|
||||
import { rcp } from '@kit.RemoteCommunicationKit';
|
||||
|
||||
interface extraData {
|
||||
uuid: string
|
||||
}
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 4.4 KiB |
Loading…
x
Reference in New Issue
Block a user