This commit is contained in:
xiaoxiao
2025-05-21 16:59:39 +08:00
parent 12bd6efea9
commit 3bdbf49577
11 changed files with 170 additions and 59 deletions
@@ -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,23 +128,25 @@ export struct ListCompBack {
}
build() {
HdList({
lw: 1,
controller: this.controller,
onRefresh: () => {
this.onRefresh()
},
onLoad: () => {
this.initData(1)
}
}) {
ForEach(this.list, (item: MeetingItemModel) => {
ListItem() {
ItemCompBack({ item })
if (this.isEmptyViewVisible){
EmptyViewComp({promptText:'暂无回放',isVisibility:this.isEmptyViewVisible})
.width('100%')
.height('100%')
} else {
HdList({
lw: 1,
controller: this.controller,
onRefresh: () => {
this.onRefresh()
},
onLoad: () => {
this.initData(1)
}
})
}) {
ForEach(this.list, (item: MeetingItemModel) => {
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,31 +69,43 @@ 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() {
HdGrid({
lw: 1,
controller: this.controller,
onRefresh: () => {
this.onRefresh()
},
onLoad: () => {
this.initData(1)
}
}) {
ForEach(this.list, (items: VideoMore) => {
GridItem() {
ItemCompVideo({ item:items })
if (this.isEmptyViewVisible){
EmptyViewComp({promptText:'暂无数据',isVisibility:this.isEmptyViewVisible})
.width('100%')
.height('100%')
} else {
HdGrid({
lw: 1,
controller: this.controller,
onRefresh: () => {
this.onRefresh()
},
onLoad: () => {
this.initData(1)
}
})
}) {
ForEach(this.list, (items: VideoMore) => {
GridItem() {
ItemCompVideo({ item:items })
}
})
}
}
}
}