diff --git a/commons/basic/oh-package.json5 b/commons/basic/oh-package.json5 index 1353439..65b9b86 100644 --- a/commons/basic/oh-package.json5 +++ b/commons/basic/oh-package.json5 @@ -6,6 +6,6 @@ "author": "", "license": "Apache-2.0", "dependencies": { - "mypage": "file:../../features/mypage" + } } diff --git a/commons/basic/src/main/ets/constants/BasicConstant.ets b/commons/basic/src/main/ets/constants/BasicConstant.ets index cf83ae3..a310f22 100644 --- a/commons/basic/src/main/ets/constants/BasicConstant.ets +++ b/commons/basic/src/main/ets/constants/BasicConstant.ets @@ -29,4 +29,6 @@ export class BasicConstant { static readonly zhibourl = BasicConstant.wxUrl+"hcp/setInfo"; static readonly videoByTypeNew = BasicConstant.urlExpertApp + 'videoByTypeNew' static readonly videoDetail = BasicConstant.urlExpertAPI + "videoDetail"; + static readonly meetingHistoryList = BasicConstant.urlExpertAPI + "meetingHistoryList"; + } \ No newline at end of file diff --git a/features/Home/Index.ets b/features/Home/Index.ets index 0bd5bc0..303f2fd 100644 --- a/features/Home/Index.ets +++ b/features/Home/Index.ets @@ -7,3 +7,5 @@ export { PlayBack } from './src/main/ets/pages/PlayBack'; export { VideoMore } from './src/main/ets/pages/VideoMore' export { VideoDetailModel } from './src/main/ets/model/VideoDetailModel' + +export { PastVideo } from './src/main/ets/pages/PastVideo'; diff --git a/features/Home/src/main/ets/components/ItemCompPastk.ets b/features/Home/src/main/ets/components/ItemCompPastk.ets new file mode 100644 index 0000000..15e14da --- /dev/null +++ b/features/Home/src/main/ets/components/ItemCompPastk.ets @@ -0,0 +1,109 @@ + +import { MeetingItemModel,ItemModel } from '../model/ItemModel' +import { router } from '@kit.ArkUI' + + +@Preview +@Component +export struct ItemCompPast { + 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%') + + + RelativeContainer(){ + + + Column() + { + Text(this.item.title) .maxLines(2).fontSize(15).fontColor(Color.Black).textAlign(TextAlign.Start) + .textOverflow({ overflow: TextOverflow.Ellipsis }).id('title').width('100%') + 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(75).justifyContent(FlexAlign.Center).margin({left:15,right:15}) + + + } + .height(75).clip(true) + .backgroundColor(Color.White) + + + }.backgroundColor($r('app.color.e4e4e4')) + .width('100%').clip(true) + .onClick(() => { + router.pushUrl({ + url: 'pages/WebView/WebPage', + params: { url: this.item.path ,title:'会议详情'} + }); + }) + } + + + + 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='' + } + } +} + +interface extraData { + name: string +} \ No newline at end of file diff --git a/features/Home/src/main/ets/components/ListCompPast.ets b/features/Home/src/main/ets/components/ListCompPast.ets new file mode 100644 index 0000000..8718220 --- /dev/null +++ b/features/Home/src/main/ets/components/ListCompPast.ets @@ -0,0 +1,140 @@ +import { ItemCompPast } from './ItemCompPastk' +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 HashMap from '@ohos.util.HashMap'; + + +@Component +export struct ListCompPast { + @Prop + @Watch('onUpdate') + year:string='' + @Prop + @Watch('onUpdate') + month:string='' + @State + list: ItemModel[] = [] + controller = new HdListController() + @State + page: number = 1 + @State + keyword: string = '' + // timer: number = -1 + hashMap: HashMap = new HashMap(); + + onUpdate() { + // console.info('Response onUpdate') + // if (this.timer) clearTimeout(this.timer) + // this.timer = setTimeout(() => { + // this.controller.reload() + this.onRefresh() + // }, 500) + + } + + onRefresh() { + this.page = 1 + this.initData(0) + + } + + initData(type:number) + { + console.info('Response type'+type) + this.hashMap.clear(); + this.hashMap.set('page', this.page+"") + if(this.year=='会议年份') + { + this.hashMap.set('year','') + } + else + { + this.hashMap.set('year',this.year) + } + if(this.month=='会议月份') + { + this.hashMap.set('month','') + } + else + { + this.hashMap.set('month',this.month) + } + this.hashMap.set('title','') + hdHttp.httpReq(BasicConstant.meetingHistoryList,this.hashMap).then(async (res: HdResponse) => { + + 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) + if(this.page==1) + { + this.list=[] + if(json.data!=null&&json.data.list!) + { + this.list = json.data.list + } + + } + else if(this.page>1&&json.data!=null&&json.data.list!=null&&json.data.list.length>0) + { + 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.onRefresh() + }, + onLoad: () => { + this.initData(1) + + } + }) { + ForEach(this.list, (item: MeetingItemModel) => { + ListItem() { + ItemCompPast({ item }) + } + }) + } + + } +} \ No newline at end of file diff --git a/features/Home/src/main/ets/pages/PastVideo.ets b/features/Home/src/main/ets/pages/PastVideo.ets new file mode 100644 index 0000000..d04c414 --- /dev/null +++ b/features/Home/src/main/ets/pages/PastVideo.ets @@ -0,0 +1,230 @@ +import { HdNav } from '@itcast/basic' +import { ListCompPast } from '../components/ListCompPast' +import { promptAction } from '@kit.ArkUI' +@Entry +@Component +export struct PastVideo { + + @State notselectImg: ResourceStr = $r('app.media.triangle_normal'); + @State selectImg: ResourceStr = $r('app.media.triangle_green_theme'); + @State yearWords:Array =[] + @State monthWords:Array =[] + @State timePosition:number=-1; + @State typePosition:number=-1; + @State tlistStatus:boolean=false; + @State typelistStatus:boolean=false; + @State timeText:string='会议年份'; + @State monthText:string='会议月份'; + @State type:string=''; + onPageShow(): void { + console.log('VideoPage onPageShow!'); + } + + onPageHide(): void { + console.log('VideoPage onPageHide!'); + } + aboutToAppear(): void { + this.getYears() + + } + + build() { + Column() + { + HdNav({ title: '过往会议', showRightIcon: false, showLeftIcon: true}) + Row() { + Blank() + .onClick(()=>{ + this.tlistStatus=!this.tlistStatus + }) + Row() { + if(this.timePosition!=-1) + { + Text(this.timeText).customStyle().fontColor($r('app.color.top_title')) + Image(this.selectImg).width(13).margin({left:5}) + } + else { + Text(this.timeText).customStyle() + Image(this.notselectImg).width(13).margin({left:5}) + } + + } + .onClick(()=>{ + this.tlistStatus=!this.tlistStatus + }) + Blank() + .onClick(()=>{ + this.tlistStatus=!this.tlistStatus + }) + Text('|').customStyle() + Blank() + .onClick(()=>{ + this.getSelectMonth() + + }) + Row() { + if(this.typePosition!=-1) + { + Text(this.monthText).customStyle().fontColor($r('app.color.top_title')) + Image(this.selectImg).width(13).margin({left:5}) + } + else { + Text(this.monthText).customStyle() + Image(this.notselectImg).width(13).margin({left:5}) + } + } + .onClick(()=>{ + this.getSelectMonth() + }) + Blank() + .onClick(()=>{ + this.getSelectMonth() + }) + }.width('100%').height(45) + Text().Line() + Stack({ }) { + ListCompPast({year:this.timeText,month:this.type}).padding({bottom:20}).backgroundColor($r('app.color.e4e4e4')) + if(this.tlistStatus) + { + List() { + ForEach(this.yearWords, (item: string,index:number) => { + ListItem() { + Column() { + + if(this.timePosition==index) + { + Row() + { + 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() + } + + }.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) + } + if(this.typelistStatus) + { + List() { + ForEach(this.monthWords, (item: string,index:number) => { + ListItem() { + Column() { + + if(this.typePosition==index) + { + Row() + { + 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() + } + + }.padding({left:22}) + .width('100%') + .justifyContent(FlexAlign.Start) + .onClick(()=>{ + this.typePosition=index + this.typelistStatus=false + this.monthText=item + this.type=index+1+'' + + }) + } + }, (item: string) => JSON.stringify(item)) + } .width('100%') + .height('100%').backgroundColor(Color.White) + } + } + + } + .width('100%') + .height('100%') + .padding({bottom:50}) + } + + getYears() + { + + + let year:number= new Date().getFullYear(); + for(let i =year;i>=2016;i--){ + this.yearWords.push(i+""); + } + + } + + getSelectMonth() + { + if(this.timeText=='会议年份') + { + promptAction.showToast({message:'请先选择年份'}) + } + else + { + this.typelistStatus=!this.typelistStatus + if(this.typelistStatus==true) + { + this.monthWords=[] + if(this.timePosition==0) + { + let nowmonth:number= new Date().getMonth(); + for (let i = 1; i<=nowmonth+1; i++) { + this.monthWords.push(i+"月"); + } + } + else + { + for (let i = 1; i <=12; i++) { + this.monthWords.push(i+"月"); + } + } + } + } + } + + +} +@Extend(Text) +function customStyle() { + + .fontColor($r('app.color.tab_text_nor')) + .fontSize(13) + +} +@Extend(Text) +function Line() { + + .height(0.5).width('100%').backgroundColor($r('app.color.devider_line')) +} + + diff --git a/features/Home/src/main/ets/pages/VideoPage.ets b/features/Home/src/main/ets/pages/VideoPage.ets index 8786090..81e6ccb 100644 --- a/features/Home/src/main/ets/pages/VideoPage.ets +++ b/features/Home/src/main/ets/pages/VideoPage.ets @@ -27,107 +27,121 @@ export struct VideoPage { } build() { - Column() + RelativeContainer() { - HdNav({ title: '肝胆会议', showRightIcon: false, showLeftIcon: true,showRightText:true,rightText:'扫一扫' }) - Row() { - Blank() + Column() + { + HdNav({ title: '肝胆会议', showRightIcon: false, showLeftIcon: true,showRightText:true,rightText:'扫一扫' }) + Row() { + Blank() + .onClick(()=>{ + this.tlistStatus=!this.tlistStatus + }) + Row() { + if(this.timePosition!=-1) + { + Text(this.timeText).customStyle().fontColor($r('app.color.top_title')) + Image(this.selectImg).width(13).margin({left:5}) + } + else { + Text(this.timeText).customStyle() + Image(this.notselectImg).width(13).margin({left:5}) + } + + } .onClick(()=>{ this.tlistStatus=!this.tlistStatus }) - Row() { - if(this.timePosition!=-1) - { - Text(this.timeText).customStyle().fontColor($r('app.color.top_title')) - Image(this.selectImg).width(13).margin({left:5}) - } - else { - Text(this.timeText).customStyle() + Blank() + .onClick(()=>{ + this.tlistStatus=!this.tlistStatus + }) + Text('|').customStyle() + Blank() + Row() { + Text('会议地点').customStyle() Image(this.notselectImg).width(13).margin({left:5}) } + Blank() + Text('|').customStyle() + Blank() + .onClick(() => { + router.pushUrl({url:'pages/VideoPage/PlayBackPage'}) + }) + Row() { + Text('会议回放').customStyle() - } - .onClick(()=>{ - this.tlistStatus=!this.tlistStatus - }) - Blank() - .onClick(()=>{ - this.tlistStatus=!this.tlistStatus - }) - Text('|').customStyle() - Blank() - Row() { - Text('会议地点').customStyle() - Image(this.notselectImg).width(13).margin({left:5}) - } - Blank() - Text('|').customStyle() - Blank() + } .onClick(() => { router.pushUrl({url:'pages/VideoPage/PlayBackPage'}) }) - Row() { - Text('会议回放').customStyle() + Blank() + .onClick(() => { + router.pushUrl({url:'pages/VideoPage/PlayBackPage'}) + }) + }.width('100%').height(45) + Text().Line() + Stack({ }) { + ListComp().padding({bottom:20}).backgroundColor($r('app.color.e4e4e4')) + if(this.tlistStatus) + { + List() { + ForEach(this.monthWords, (item: string,index:number) => { + ListItem() { + Column() { - } - .onClick(() => { - router.pushUrl({url:'pages/VideoPage/PlayBackPage'}) - }) - Blank() - .onClick(() => { - router.pushUrl({url:'pages/VideoPage/PlayBackPage'}) - }) - }.width('100%').height(45) - Text().Line() - Stack({ }) { - ListComp().padding({bottom:20}).backgroundColor($r('app.color.e4e4e4')) - if(this.tlistStatus) - { - List() { - ForEach(this.monthWords, (item: string,index:number) => { - ListItem() { - Column() { - - if(this.timePosition==index) - { - Row() + if(this.timePosition==index) { - Text(item).customStyle().height(40).fontColor($r('app.color.top_title')) - Blank() - Image($r('app.media.chose_card')).width(22).margin({right:25}) + Row() + { + 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 + }.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) + } - }) - } - }, (item: string) => JSON.stringify(item)) - } .width('100%') - .height('100%').backgroundColor(Color.White) } } + .width('100%') + .height('100%') + .padding({bottom:50}) + Image($r('app.media.past_metting')).width(76).height(40) + .alignRules({ + right: { anchor: "__container__", align: HorizontalAlign.End }, + bottom:{ anchor: "__container__", align:VerticalAlign.Bottom} + }) + .margin({bottom:120}) + .onClick(() => { + router.pushUrl({url:'pages/VideoPage/PastVideoPage'}) + }) } - .width('100%') - .height('100%') - .padding({bottom:50}) + } getNowMonth() diff --git a/features/Home/src/main/resources/base/media/past_metting.png b/features/Home/src/main/resources/base/media/past_metting.png new file mode 100644 index 0000000..88eddfc Binary files /dev/null and b/features/Home/src/main/resources/base/media/past_metting.png differ diff --git a/features/mypage/src/main/ets/view/EditUserDataComp.ets b/features/mypage/src/main/ets/view/EditUserDataComp.ets index 9bc279f..e7682a9 100644 --- a/features/mypage/src/main/ets/view/EditUserDataComp.ets +++ b/features/mypage/src/main/ets/view/EditUserDataComp.ets @@ -2,7 +2,7 @@ import { hdHttp, HdResponse,BasicConstant,ExpertData, authStore, ChangeUtil } f import HashMap from '@ohos.util.HashMap' import { BusinessError } from '@kit.BasicServicesKit'; import { promptAction, router } from '@kit.ArkUI' -import { EditUserDataItem } from './EditUserDataItem' +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' diff --git a/features/register/oh-package-lock.json5 b/features/register/oh-package-lock.json5 index e1df1ae..cc3bce5 100644 --- a/features/register/oh-package-lock.json5 +++ b/features/register/oh-package-lock.json5 @@ -5,8 +5,7 @@ "lockfileVersion": 3, "ATTENTION": "THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY.", "specifiers": { - "@itcast/basic@../../commons/basic": "@itcast/basic@../../commons/basic", - "mypage@../mypage": "mypage@../mypage" + "@itcast/basic@../../commons/basic": "@itcast/basic@../../commons/basic" }, "packages": { "@itcast/basic@../../commons/basic": { @@ -14,15 +13,6 @@ "version": "1.0.0", "resolved": "../../commons/basic", "registryType": "local" - }, - "mypage@../mypage": { - "name": "mypage", - "version": "1.0.0", - "resolved": "../mypage", - "registryType": "local", - "dependencies": { - "@itcast/basic": "file:../../commons/basic" - } } } } \ No newline at end of file diff --git a/products/expert/oh-package-lock.json5 b/products/expert/oh-package-lock.json5 index 3bf4886..4ba637f 100644 --- a/products/expert/oh-package-lock.json5 +++ b/products/expert/oh-package-lock.json5 @@ -232,8 +232,7 @@ "resolved": "../../features/register", "registryType": "local", "dependencies": { - "@itcast/basic": "file:../../commons/basic", - "mypage": "file:../../features/mypage" + "@itcast/basic": "file:../../commons/basic" } }, "scene_single_video@../../scene_single_video": { diff --git a/products/expert/src/main/ets/pages/VideoPage/PastVideoPage.ets b/products/expert/src/main/ets/pages/VideoPage/PastVideoPage.ets new file mode 100644 index 0000000..27dc76a --- /dev/null +++ b/products/expert/src/main/ets/pages/VideoPage/PastVideoPage.ets @@ -0,0 +1,14 @@ +import { PastVideo } from 'home' +@Entry +@Component +struct PastVideoPage { + + + build() { + RelativeContainer() { + PastVideo() + } + .height('100%') + .width('100%') + } +} \ No newline at end of file diff --git a/products/expert/src/main/resources/base/profile/main_pages.json b/products/expert/src/main/resources/base/profile/main_pages.json index 8ca7ade..61560dc 100644 --- a/products/expert/src/main/resources/base/profile/main_pages.json +++ b/products/expert/src/main/resources/base/profile/main_pages.json @@ -22,6 +22,7 @@ "pages/VideoPage/PlayBackPage", "pages/VideoPage/VideoMorePage", "pages/VideoPage/PLVMediaPlayerSingleVideoPage", - "pages/WebView/LivebroadcastPages" + "pages/WebView/LivebroadcastPages", + "pages/VideoPage/PastVideoPage" ] } \ No newline at end of file