diff --git a/features/Home/src/main/ets/components/ItemComp.ets b/features/Home/src/main/ets/components/ItemComp.ets index 058face..7a20006 100644 --- a/features/Home/src/main/ets/components/ItemComp.ets +++ b/features/Home/src/main/ets/components/ItemComp.ets @@ -1,26 +1,152 @@ import { MeetingItemModel,ItemModel } from '../model/ItemModel' +import { BasicConstant } from '@itcast/basic' @Preview @Component export struct ItemComp { item: MeetingItemModel = new MeetingItemModel({} as ItemModel) + @State timeColor:ResourceStr=$r('app.color.ee432f') + @State status:string='' + aboutToAppear(): void { + this.getMeetingStatus() + } build() { Column() { + Text().height(1).width('100%') 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) + + "月").fontSize(14).fontColor($r('app.color.333333')).height(35) } - else + RelativeContainer() { - Text(this.item.count+'') - } + Text().width(23).backgroundColor(this.timeColor).borderRadius(5).height('100%') + RelativeContainer(){ + + + Column() + { + Text(this.item.title) .maxLines(2).fontSize(15).fontColor(Color.Black).textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }).id('title').width('100%') + RelativeContainer() + { + + Stack() + { + + Image(BasicConstant.urlHtml+this.item.liveimg).width('100%').height(162) + .objectFit(ImageFit.Fill) + if(this.status!=''&&this.status!='已结束'&&this.status!='回访中') + { + Image($r('app.media.bofang')).width(40).height(40) + } + + } + if(this.status!='') + { + Text(this.status) .fontSize(13).margin({top:5,right:5}) + .fontColor(Color.White).padding({left:10,right:10,top:1,bottom:1}) + .alignRules({ + right: { anchor: "__container__", align: HorizontalAlign.End } + }) + .border({ width:1, color:Color.White }) + .borderRadius(30) + } - }.backgroundColor($r('app.color.e4e4e4')).width('100%') + + } + + .height(162).backgroundColor(Color.Orange) + .margin({top:10,right:5}).clip(true).id('rr') + + Row(){ + Image($r('app.media.meetingtime')).width(13).height(13) + Text(this.getTime(this.item.begin_date,this.item.end_date)).fontSize(14) + .fontColor($r('app.color.999999')).margin({left:10}) + Blank() + Image($r('app.media.meetinglocation')).width(15).height(15) + Text(this.item.location).fontSize(14) + .fontColor($r('app.color.999999')).margin({left:10}) + } + .width('100%') + .margin({top:6}) + }.height(247).justifyContent(FlexAlign.Center).margin({left:20,right:5}) + + + } + .height('100%').clip(true) + .margin({left:20,right:5}).backgroundColor(Color.White) + Text(this.item.begin_date.substring(8,10)).width(20).height(20) .alignRules({ + + bottom: { anchor: "__container__", align:VerticalAlign.Center} + }) + .margin({left:10}) + .fontSize(14) + .fontColor(this.timeColor) + .textAlign(TextAlign.Center) + .backgroundColor(Color.White) + .borderRadius(20) + + }.width('100%').height(247).clip(true). + backgroundColor(Color.White).borderRadius(5) + + + + }.backgroundColor($r('app.color.e4e4e4')) + .width('100%').padding({left:10,right:10,bottom:20}).clip(true) + + } + + getTime(str1:string, str2:string) { + if (str1.substring(0, 10)==(str2.substring(0, 10))) { + return str1.replaceAll("-", ".").substring(0, 10).toString(); +} +return str1.replaceAll("-", ".").substring(0, 10)+"-"+str2.replaceAll("-", ".").substring(0, 10) + +} + getMeetingStatus() + { + if(this.item.count%4==0) + { + this.timeColor=$r('app.color.ee432f') + } + else if(this.item.count%4==1) + { + this.timeColor=$r('app.color.f9b928') + } + else if(this.item.count%4==2) + { + this.timeColor=$r('app.color.63ccc7') + } + else + { + this.timeColor=$r('app.color.99d750') + } + + if('1'==this.item.status) + { + this.status='预告' + } + else if('2'==this.item.status) + { + this.status='直播中' + } + else if('3'==this.item.status) + { + this.status='已结束' + } + else if('4'==this.item.status) + { + this.status='回放中' + } + else + { + this.status='' + } } } \ No newline at end of file diff --git a/features/Home/src/main/ets/components/ListComp.ets b/features/Home/src/main/ets/components/ListComp.ets index 2c334e5..45f21ab 100644 --- a/features/Home/src/main/ets/components/ListComp.ets +++ b/features/Home/src/main/ets/components/ListComp.ets @@ -33,21 +33,7 @@ export struct ListComp { onRefresh() { this.page = 1 this.initData(0) - // InterviewService.findInterviewList({ - // questionBankType: 9, - // page: this.page, - // sort: this.sort, - // keyword: this.keyword - // }).then(res => { - // this.list = res.data.rows - // this.controller.refreshed() - // if (this.page >= res.data.pageTotal) { - // this.controller.finished() - // } else { - // this.page++ - // } - // promptAction.showToast({ message: '已更新' }) - // }) + } initData(type:number) diff --git a/features/Home/src/main/ets/pages/VideoPage.ets b/features/Home/src/main/ets/pages/VideoPage.ets index 0611b0f..46e50e6 100644 --- a/features/Home/src/main/ets/pages/VideoPage.ets +++ b/features/Home/src/main/ets/pages/VideoPage.ets @@ -109,7 +109,7 @@ export struct VideoPage { } .width('100%') .height('100%') - + .padding({bottom:50}) } getNowMonth() diff --git a/features/Home/src/main/resources/base/element/color.json b/features/Home/src/main/resources/base/element/color.json index 786b73a..b2990e7 100644 --- a/features/Home/src/main/resources/base/element/color.json +++ b/features/Home/src/main/resources/base/element/color.json @@ -35,6 +35,26 @@ { "name": "333333", "value": "#333333" + }, + { + "name": "ee432f", + "value": "#ee432f" + }, + { + "name": "f9b928", + "value": "#f9b928" + }, + { + "name": "63ccc7", + "value": "#63ccc7" + }, + { + "name": "99d750", + "value": "#99d750" + }, + { + "name": "999999", + "value": "#999999" } ] } \ No newline at end of file diff --git a/features/Home/src/main/resources/base/media/bofang.png b/features/Home/src/main/resources/base/media/bofang.png new file mode 100644 index 0000000..bb4cc29 Binary files /dev/null and b/features/Home/src/main/resources/base/media/bofang.png differ diff --git a/features/Home/src/main/resources/base/media/meetinglocation.png b/features/Home/src/main/resources/base/media/meetinglocation.png new file mode 100644 index 0000000..f7bb489 Binary files /dev/null and b/features/Home/src/main/resources/base/media/meetinglocation.png differ diff --git a/features/Home/src/main/resources/base/media/meetingtime.png b/features/Home/src/main/resources/base/media/meetingtime.png new file mode 100644 index 0000000..af83a2c Binary files /dev/null and b/features/Home/src/main/resources/base/media/meetingtime.png differ