Compare commits

..

No commits in common. "468f966a7ea63e93354a00dae29e32b450a938db" and "b11b4b65dbf1f6abb1e4793f0186963f48ea8ca7" have entirely different histories.

8 changed files with 92 additions and 205 deletions

View File

@ -86,10 +86,10 @@ export struct HdList {
.width('100%')
.height('100%')
.padding({ left: BasicConstant.SPACE_LG, right: BasicConstant.SPACE_LG })
// .divider({
// strokeWidth: $r('app.float.common_border_width'),
// color: $r('app.color.common_gray_border')
// })
.divider({
strokeWidth: $r('app.float.common_border_width'),
color: $r('app.color.common_gray_border')
})
.onReachEnd(() => {
if (this.loading || this.refreshing || this.finished) {
return;

View File

@ -15,5 +15,4 @@ export class BasicConstant {
static readonly getStartpage=BasicConstant.urlapp + "startpage";
static readonly meetingListV2=BasicConstant.urlmyLan + "meetingListV2";
}

View File

@ -30,7 +30,7 @@
},
{
"name": "hd_list_finished",
"value": ""
"value": "没有更多了~"
},
{
"name": "hd_clock_in",

View File

@ -1,26 +1,13 @@
import { MeetingItemModel,ItemModel } from '../model/ItemModel'
@Preview
@Component
export struct ItemComp {
item: MeetingItemModel = new MeetingItemModel({} as ItemModel)
build() {
Column() {
if(this.item.count==0)
{
Text(this.item.begin_date.substring(0, 4)
+ "年"
+ this.item.begin_date.substring(5, 7)
+ "月").fontSize(14).fontColor('app.color.333333').height(35)
}
else
{
Text(this.item.count+'')
}
Column({ space: 12 }) {
}.backgroundColor($r('app.color.e4e4e4')).width('100%')
}
}
}

View File

@ -1,16 +1,14 @@
import { ItemComp } from './ItemComp'
import { MeetingItemModel,MeetingModel,MeetingModels,ItemModel } from '../model/ItemModel'
import { HdList, HdListController,BasicConstant,hdHttp, HdResponse ,logger} from '@itcast/basic/Index'
import { promptAction, router } from '@kit.ArkUI'
import { BusinessError } from '@kit.BasicServicesKit';
import { MeetingItemModel } from '../model/ItemModel'
import { HdList, HdListController,BasicConstant } from '@itcast/basic/Index'
import promptAction from '@ohos.promptAction'
import HashMap from '@ohos.util.HashMap';
import { hdHttp } from '@itcast/basic'
@Component
export struct ListComp {
@State
list: ItemModel[] = []
list: MeetingItemModel[] = []
controller = new HdListController()
@State
page: number = 1
@ -32,7 +30,29 @@ export struct ListComp {
onRefresh() {
this.page = 1
this.initData(0)
this.hashMap.clear();
// this.hashMap.set('mobile',this.mobile)
//
// this.hashMap.set('current_spec','hongmeng')
// hdHttp.httpReq<string>(this.loginUrl,this.hashMap).then(async (res: HdResponse<string>) => {
// this.loading = false
// logger.info('Response login'+res);
// console.info(`Response login succeeded: ${res}`);
// let json:LoginInfo = JSON.parse(res+'') as LoginInfo;
//
// if(json.code=='1')
// {
// this.getSaveUserInfor(1,json)
// }
// else
// {
// promptAction.showToast({ message: json.message, duration: 1000 })
// }
//
// }).catch((err: BusinessError) => {
// this.loading = false
// console.info(`Response login fail: ${err}`);
// })
// InterviewService.findInterviewList({
// questionBankType: 9,
// page: this.page,
@ -50,58 +70,6 @@ export struct ListComp {
// })
}
initData(type:number)
{
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;
if(type==0)
{
this.controller.refreshed()
}
else
{
this.controller.loaded()
}
if(this.page==1&&json.data.list!=null&&json.data.list.length>0)
{
this.list = json.data.list
}
else if(this.page>1)
{
this.list.push(...json.data.list)
}
this.getPosition()
if (this.page >= json.data.pages) {
this.controller.finished()
} else {
this.page++
}
}).catch((err: BusinessError) => {
})
}
getPosition() {
let DatasList:string[] = [];
let count = 0;
for (let i = 0; i <this.list.length; i++) {
if (!DatasList.includes(this.list[i].begin_date
.substring(0, 7))) {
DatasList.push(this.list[i].begin_date.substring(0, 7));
count = 0;
this.list[i].count=count;
} else {
count++;
this.list[i].count=count;
}
}
}
build() {
HdList({
lw: 1,
@ -110,8 +78,20 @@ export struct ListComp {
this.onRefresh()
},
onLoad: () => {
this.initData(1)
// InterviewService.findInterviewList({
// questionBankType: 9,
// page: this.page,
// sort: this.sort,
// keyword: this.keyword
// }).then(res => {
// this.list.push(...res.data.rows)
// this.controller.loaded()
// if (this.page >= res.data.pageTotal) {
// this.controller.finished()
// } else {
// this.page++
// }
// })
}
}) {
ForEach(this.list, (item: MeetingItemModel) => {

View File

@ -1,76 +0,0 @@
import { List } from '@kit.ArkTS';
export interface ItemModel {
count:number;
title:string;
uuid:string;
end_date:string;
begin_date:string;
sort:string;
// status 0 无直播 1 待直播 2 直播中 3 已结束)
status:string;
location:string;
type:string;
path:string;
content:string;
// liveimg (直播图片)
liveimg:string;
// liveurl (直播地址)
liveurl:string;
// spareurl (备用地址)
spareurl:string;
tags:string;
}
export interface MeetingModel {
code:string;
message:string;
totalPage:number;
pageNumber:number;
pageSize:number;
totalRow:number;
pages:number;
list: ItemModel[] ;
}
export interface MeetingModels {
code:string;
message:string;
data:MeetingModel
}
export class MeetingItemModel implements ItemModel
{
count: number=0;
title: string='';
uuid: string='';
end_date: string='';
begin_date: string='';
sort: string='';
status: string='';
location: string='';
type: string='';
path: string='';
content: string='';
liveimg: string='';
liveurl: string='';
spareurl: string='';
tags: string='';
constructor(model:ItemModel) {
this.count = model.count;
this.title = model.title;
this.uuid = model.uuid;
this.end_date = model.end_date;
this.begin_date = model.begin_date;
this.sort = model.sort;
this.status = model.status;
this.location = model.location;
this.type = model.type;
this.path = model.path;
this.content = model.content;
this.liveimg = model.liveimg;
this.liveurl = model.liveurl;
this.spareurl = model.spareurl;
this.tags = model.tags;
}
}

View File

@ -1,5 +1,15 @@
import { HdNav } from '@itcast/basic'
import { ListComp } from '../components/ListComp'
class RdbData{
key:string = ''
value:string = ''
constructor(key:string,value:string) {
this.key = key
this.value = value
}
}
@Entry
@Component
@ -11,7 +21,7 @@ export struct VideoPage {
@State timePosition:number=-1;
@State tlistStatus:boolean=false;
@State timeText:string='会议时间';
@State rdbDataArray:RdbData[] = []
onPageShow(): void {
console.log('VideoPage onPageShow!');
}
@ -62,48 +72,43 @@ export struct VideoPage {
Blank()
}.width('100%').height(45)
Text().Line()
Stack({ }) {
ListComp()
if(this.tlistStatus)
{
List() {
ForEach(this.monthWords, (item: string,index:number) => {
ListItem() {
Column() {
if(this.tlistStatus)
{
List() {
ForEach(this.monthWords, (item: string,index:number) => {
ListItem() {
Column() {
if(this.timePosition==index)
if(this.timePosition==index)
{
Row()
{
Row()
{
Text(item).customStyle().height(40).fontColor($r('app.color.top_title'))
Blank()
Image($r('app.media.chose_card')).width(22).margin({right:25})
Text(item).customStyle().height(40).fontColor($r('app.color.top_title'))
Blank()
Image($r('app.media.chose_card')).width(22).margin({right:25})
}
.width('100%')
.alignSelf(ItemAlign.Start)
Text().Line().backgroundColor($r('app.color.top_title'))
}
else
{
Text(item).customStyle().height(40).alignSelf(ItemAlign.Start)
Text().Line()
}
.width('100%')
.alignSelf(ItemAlign.Start)
Text().Line().backgroundColor($r('app.color.top_title'))
}
else
{
Text(item).customStyle().height(40).alignSelf(ItemAlign.Start)
Text().Line()
}
}.padding({left:22})
.width('100%')
.justifyContent(FlexAlign.Start)
.onClick(()=>{
this.timePosition=index
this.tlistStatus=false
this.timeText=item
})
}
}, (item: string) => JSON.stringify(item))
} .width('100%')
.height('100%').backgroundColor(Color.White)
}.padding({left:22})
.width('100%')
.justifyContent(FlexAlign.Start)
.onClick(()=>{
this.timePosition=index
this.tlistStatus=false
this.timeText=item
})
}
}, (item: string) => JSON.stringify(item))
}
}
}

View File

@ -27,14 +27,6 @@
{
"name": "top_bg",
"value": "#FFEFEFEF"
},
{
"name": "e4e4e4",
"value": "#e4e4e4"
},
{
"name": "333333",
"value": "#333333"
}
]
}