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