Showing
9 changed files
with
61 additions
and
71 deletions
| @@ -328,6 +328,7 @@ export struct DynamicDetailComponent { | @@ -328,6 +328,7 @@ export struct DynamicDetailComponent { | ||
| 328 | .margin({ left: $r('app.float.margin_2')}) | 328 | .margin({ left: $r('app.float.margin_2')}) |
| 329 | } | 329 | } |
| 330 | .margin({top:$r('app.float.margin_16')}) | 330 | .margin({top:$r('app.float.margin_16')}) |
| 331 | + Blank().layoutWeight(1) | ||
| 331 | //fixme 评论组件 | 332 | //fixme 评论组件 |
| 332 | } | 333 | } |
| 333 | } | 334 | } |
| @@ -27,6 +27,7 @@ const TAG = 'Zh_Single_Row-06' | @@ -27,6 +27,7 @@ const TAG = 'Zh_Single_Row-06' | ||
| 27 | // operDataList: Array<operDataListItem> | 27 | // operDataList: Array<operDataListItem> |
| 28 | // } | 28 | // } |
| 29 | 29 | ||
| 30 | +@Entry | ||
| 30 | @Component | 31 | @Component |
| 31 | export struct ZhSingleRow06 { | 32 | export struct ZhSingleRow06 { |
| 32 | @State compDTO: CompDTO = {} as CompDTO | 33 | @State compDTO: CompDTO = {} as CompDTO |
| @@ -44,9 +45,12 @@ export struct ZhSingleRow06 { | @@ -44,9 +45,12 @@ export struct ZhSingleRow06 { | ||
| 44 | .textOverflow({overflow: TextOverflow.Ellipsis}) | 45 | .textOverflow({overflow: TextOverflow.Ellipsis}) |
| 45 | .lineHeight(23) | 46 | .lineHeight(23) |
| 46 | .fontSize(16) | 47 | .fontSize(16) |
| 47 | - .margin({bottom: 19}) | 48 | + .margin({bottom: 10}) |
| 49 | + .padding({bottom: 10}) | ||
| 48 | .textAlign(TextAlign.Start) | 50 | .textAlign(TextAlign.Start) |
| 49 | .width('100%') | 51 | .width('100%') |
| 52 | + .border({width: {bottom: 1}}) | ||
| 53 | + .borderColor(0xf4f4f4) | ||
| 50 | 54 | ||
| 51 | 55 | ||
| 52 | Row() { | 56 | Row() { |
| @@ -98,8 +102,6 @@ export struct ZhSingleRow06 { | @@ -98,8 +102,6 @@ export struct ZhSingleRow06 { | ||
| 98 | bottom: $r('app.float.card_comp_pagePadding_tb') | 102 | bottom: $r('app.float.card_comp_pagePadding_tb') |
| 99 | }) | 103 | }) |
| 100 | .backgroundColor($r('app.color.white')) | 104 | .backgroundColor($r('app.color.white')) |
| 101 | - .margin({ bottom: 8 }) | ||
| 102 | - .height(251) | ||
| 103 | } | 105 | } |
| 104 | 106 | ||
| 105 | @Builder | 107 | @Builder |
| @@ -121,35 +121,6 @@ export struct LiveHorizontalCardComponent { | @@ -121,35 +121,6 @@ export struct LiveHorizontalCardComponent { | ||
| 121 | } | 121 | } |
| 122 | 122 | ||
| 123 | async gotoLive(content: ContentDTO) { | 123 | async gotoLive(content: ContentDTO) { |
| 124 | - const liveDetail = await LiveModel.getLiveDetails(content?.objectId || '', content?.relId || '', content?.relType || '') | ||
| 125 | - if (content && content.objectType) { | ||
| 126 | - if (content.objectType === ContentConstants.TYPE_LIVE) { | ||
| 127 | - if (liveDetail && liveDetail[0] && liveDetail[0].liveInfo) { | ||
| 128 | - const liveStyle = liveDetail[0].liveInfo.liveStyle | ||
| 129 | - const liveState = liveDetail[0].liveInfo.liveState | ||
| 130 | - | ||
| 131 | - console.error('liveDetail===', liveDetail) | ||
| 132 | - | ||
| 133 | - let taskAction: Action = { | ||
| 134 | - type: 'JUMP_DETAIL_PAGE', | ||
| 135 | - params: { | ||
| 136 | - detailPageType: 2, | ||
| 137 | - contentID: content?.objectId, | ||
| 138 | - liveStyle: liveState === 'wait' ? 0 : liveStyle, | ||
| 139 | - extra: { | ||
| 140 | - relType: content?.relType, | ||
| 141 | - relId: content?.relId, | ||
| 142 | - } as ExtraDTO | ||
| 143 | - } as Params, | ||
| 144 | - }; | ||
| 145 | - WDRouterRule.jumpWithAction(taskAction) | ||
| 146 | - // Logger.debug(TAG, `gotoLive, ${content.objectId}`); | ||
| 147 | - } | ||
| 148 | - } else if (content.objectType === ContentConstants.TYPE_TELETEXT) { | ||
| 149 | - ProcessUtils.processPage(content) | ||
| 150 | - } | ||
| 151 | - } | ||
| 152 | - | ||
| 153 | - | 124 | + ProcessUtils.processPage(content) |
| 154 | } | 125 | } |
| 155 | } | 126 | } |
| @@ -5,6 +5,8 @@ import router from '@ohos.router'; | @@ -5,6 +5,8 @@ import router from '@ohos.router'; | ||
| 5 | import { DetailPlayLivePage } from './DetailPlayLivePage' | 5 | import { DetailPlayLivePage } from './DetailPlayLivePage' |
| 6 | import { DetailPlayVLivePage } from './DetailPlayVLivePage' | 6 | import { DetailPlayVLivePage } from './DetailPlayVLivePage' |
| 7 | 7 | ||
| 8 | +const TAG = 'DetailPlayLiveCommon' | ||
| 9 | + | ||
| 8 | @Entry() | 10 | @Entry() |
| 9 | @Component | 11 | @Component |
| 10 | export struct DetailPlayLiveCommon { | 12 | export struct DetailPlayLiveCommon { |
| @@ -47,7 +49,7 @@ export struct DetailPlayLiveCommon { | @@ -47,7 +49,7 @@ export struct DetailPlayLiveCommon { | ||
| 47 | this.liveDetailsBean = data[0] | 49 | this.liveDetailsBean = data[0] |
| 48 | this.liveState = this.liveDetailsBean.liveInfo?.liveState | 50 | this.liveState = this.liveDetailsBean.liveInfo?.liveState |
| 49 | this.liveStyle = this.liveDetailsBean.liveInfo.liveStyle | 51 | this.liveStyle = this.liveDetailsBean.liveInfo.liveStyle |
| 50 | - console.error('liveDetailsBean===', JSON.stringify((this.liveDetailsBean))) | 52 | + console.log(TAG, 'getLiveDetails:', JSON.stringify((this.liveDetailsBean))) |
| 51 | } | 53 | } |
| 52 | }, | 54 | }, |
| 53 | () => { | 55 | () => { |
| @@ -8,11 +8,11 @@ import { WDPlayerController } from 'wdPlayer/Index'; | @@ -8,11 +8,11 @@ import { WDPlayerController } from 'wdPlayer/Index'; | ||
| 8 | import { DisplayDirection } from 'wdConstant/Index'; | 8 | import { DisplayDirection } from 'wdConstant/Index'; |
| 9 | 9 | ||
| 10 | const storage = LocalStorage.getShared(); | 10 | const storage = LocalStorage.getShared(); |
| 11 | +const TAG = 'DetailPlayVLivePage' | ||
| 11 | 12 | ||
| 12 | @Entry(storage) | 13 | @Entry(storage) |
| 13 | @Component | 14 | @Component |
| 14 | export struct DetailPlayVLivePage { | 15 | export struct DetailPlayVLivePage { |
| 15 | - TAG: string = 'DetailPlayVLivePage'; | ||
| 16 | private liveViewModel: LiveViewModel = new LiveViewModel() | 16 | private liveViewModel: LiveViewModel = new LiveViewModel() |
| 17 | private playerController: WDPlayerController = new WDPlayerController(); | 17 | private playerController: WDPlayerController = new WDPlayerController(); |
| 18 | private swiperController: SwiperController = new SwiperController() | 18 | private swiperController: SwiperController = new SwiperController() |
| @@ -29,6 +29,7 @@ export struct DetailPlayVLivePage { | @@ -29,6 +29,7 @@ export struct DetailPlayVLivePage { | ||
| 29 | @State swiperIndex: number = 1 | 29 | @State swiperIndex: number = 1 |
| 30 | 30 | ||
| 31 | aboutToAppear(): void { | 31 | aboutToAppear(): void { |
| 32 | + console.log(TAG, 'aboutToAppear') | ||
| 32 | WindowModel.shared.setWindowLayoutFullScreen(true) | 33 | WindowModel.shared.setWindowLayoutFullScreen(true) |
| 33 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) | 34 | WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', }) |
| 34 | 35 | ||
| @@ -86,11 +87,11 @@ export struct DetailPlayVLivePage { | @@ -86,11 +87,11 @@ export struct DetailPlayVLivePage { | ||
| 86 | if (data.length > 0) { | 87 | if (data.length > 0) { |
| 87 | this.liveDetailsBean = data[0] | 88 | this.liveDetailsBean = data[0] |
| 88 | this.liveState = this.liveDetailsBean.liveInfo?.liveState | 89 | this.liveState = this.liveDetailsBean.liveInfo?.liveState |
| 89 | - console.error('liveDetailsBean===', JSON.stringify((this.liveDetailsBean))) | 90 | + console.log(TAG, 'getLiveDetails', JSON.stringify((this.liveDetailsBean))) |
| 90 | } | 91 | } |
| 91 | }, | 92 | }, |
| 92 | - () => { | ||
| 93 | - | 93 | + (message: string) => { |
| 94 | + console.error(TAG, 'getLiveDetails catch', message) | ||
| 94 | }) | 95 | }) |
| 95 | } | 96 | } |
| 96 | 97 | ||
| @@ -99,9 +100,10 @@ export struct DetailPlayVLivePage { | @@ -99,9 +100,10 @@ export struct DetailPlayVLivePage { | ||
| 99 | .then( | 100 | .then( |
| 100 | (data) => { | 101 | (data) => { |
| 101 | this.liveRoomDataBean = data | 102 | this.liveRoomDataBean = data |
| 103 | + console.log(TAG, 'getLiveRoomData', JSON.stringify((this.liveRoomDataBean))) | ||
| 102 | }, | 104 | }, |
| 103 | - () => { | ||
| 104 | - | 105 | + (message: string) => { |
| 106 | + console.error(TAG, 'getLiveDetails catch', message) | ||
| 105 | }) | 107 | }) |
| 106 | } | 108 | } |
| 107 | } | 109 | } |
| @@ -2,6 +2,7 @@ import { LiveDetailsBean } from 'wdBean/Index'; | @@ -2,6 +2,7 @@ import { LiveDetailsBean } from 'wdBean/Index'; | ||
| 2 | import { WDPlayerController, WDPlayerRenderVLiveView, WDPlayerRenderView } from 'wdPlayer/Index'; | 2 | import { WDPlayerController, WDPlayerRenderVLiveView, WDPlayerRenderView } from 'wdPlayer/Index'; |
| 3 | import componentUtils from '@ohos.arkui.componentUtils'; | 3 | import componentUtils from '@ohos.arkui.componentUtils'; |
| 4 | 4 | ||
| 5 | +const TAG = 'PlayerComponent' | ||
| 5 | 6 | ||
| 6 | @Component | 7 | @Component |
| 7 | export struct PlayerComponent { | 8 | export struct PlayerComponent { |
| @@ -16,6 +17,7 @@ export struct PlayerComponent { | @@ -16,6 +17,7 @@ export struct PlayerComponent { | ||
| 16 | @State playUrl: string = '' | 17 | @State playUrl: string = '' |
| 17 | 18 | ||
| 18 | aboutToAppear(): void { | 19 | aboutToAppear(): void { |
| 20 | + console.log(TAG, 'aboutToAppear') | ||
| 19 | if (this.playerController) { | 21 | if (this.playerController) { |
| 20 | this.playerController.onCanplay = () => { | 22 | this.playerController.onCanplay = () => { |
| 21 | console.log('可以播放了') | 23 | console.log('可以播放了') |
| @@ -33,7 +35,6 @@ export struct PlayerComponent { | @@ -33,7 +35,6 @@ export struct PlayerComponent { | ||
| 33 | } | 35 | } |
| 34 | 36 | ||
| 35 | updateData() { | 37 | updateData() { |
| 36 | - console.error('updateData=============') | ||
| 37 | //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 | 38 | //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 |
| 38 | if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) { | 39 | if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) { |
| 39 | this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url | 40 | this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url |
| @@ -32,19 +32,32 @@ export struct DetailPlayShortVideoPage { | @@ -32,19 +32,32 @@ export struct DetailPlayShortVideoPage { | ||
| 32 | @Provide followStatus: string = '0' // 关注状态 | 32 | @Provide followStatus: string = '0' // 关注状态 |
| 33 | @Provide isOpenDetail: boolean = false // 查看详情按钮点击 | 33 | @Provide isOpenDetail: boolean = false // 查看详情按钮点击 |
| 34 | @Provide isDragging: boolean = false // 拖动时间进度条 | 34 | @Provide isDragging: boolean = false // 拖动时间进度条 |
| 35 | + @Consume @Watch('videoStatusChange') switchVideoStatus: boolean | ||
| 35 | @Consume @Watch('pageShowChange') pageShow: number | 36 | @Consume @Watch('pageShowChange') pageShow: number |
| 36 | - @Consume @Watch('pageHideChange') pageHide: number | ||
| 37 | 37 | ||
| 38 | + /** | ||
| 39 | + * 页面显示重查用户关注、点赞等信息 | ||
| 40 | + */ | ||
| 38 | pageShowChange() { | 41 | pageShowChange() { |
| 39 | - if (this.currentIndex === this.index && this.playerController.getStatus() === PlayerConstants.STATUS_PAUSE) { | ||
| 40 | - this.playerController.play() | 42 | + if (this.currentIndex === this.index) { |
| 41 | this.queryNewsInfoOfUser() | 43 | this.queryNewsInfoOfUser() |
| 44 | + if (this.switchVideoStatus) { | ||
| 45 | + this.playerController.play() | ||
| 46 | + } | ||
| 42 | } | 47 | } |
| 43 | } | 48 | } |
| 44 | 49 | ||
| 45 | - pageHideChange() { | ||
| 46 | - if (this.currentIndex === this.index && this.playerController.getStatus() === PlayerConstants.STATUS_START) { | ||
| 47 | - this.playerController.pause() | 50 | + /** |
| 51 | + * 频道切换视频暂停、播放 | ||
| 52 | + * 页面显隐视频暂停、播放 | ||
| 53 | + */ | ||
| 54 | + videoStatusChange() { | ||
| 55 | + if (this.currentIndex === this.index) { | ||
| 56 | + if (this.switchVideoStatus) { | ||
| 57 | + this.playerController.play() | ||
| 58 | + } else { | ||
| 59 | + this.playerController.pause() | ||
| 60 | + } | ||
| 48 | } | 61 | } |
| 49 | } | 62 | } |
| 50 | 63 |
| @@ -22,12 +22,12 @@ export struct DetailVideoListPage { | @@ -22,12 +22,12 @@ export struct DetailVideoListPage { | ||
| 22 | @Provide showComment: boolean = true | 22 | @Provide showComment: boolean = true |
| 23 | @Provide pageShow: number = -1 | 23 | @Provide pageShow: number = -1 |
| 24 | @Provide pageHide: number = -1 | 24 | @Provide pageHide: number = -1 |
| 25 | + @Provide switchVideoStatus: boolean = false | ||
| 25 | @State data: ContentDetailDTO[] = [] | 26 | @State data: ContentDetailDTO[] = [] |
| 26 | @State testData: string[] = ['111', '222', '333'] | 27 | @State testData: string[] = ['111', '222', '333'] |
| 27 | @State currentIndex: number = 0 | 28 | @State currentIndex: number = 0 |
| 28 | @State interactDataList: InteractDataDTO[] = [] | 29 | @State interactDataList: InteractDataDTO[] = [] |
| 29 | @State isFullScreen: boolean = false | 30 | @State isFullScreen: boolean = false |
| 30 | - @State switchVideoStatus: boolean = false | ||
| 31 | 31 | ||
| 32 | async aboutToAppear(): Promise<void> { | 32 | async aboutToAppear(): Promise<void> { |
| 33 | this.openFullScreen() | 33 | this.openFullScreen() |
| @@ -57,13 +57,14 @@ export struct DetailVideoListPage { | @@ -57,13 +57,14 @@ export struct DetailVideoListPage { | ||
| 57 | onPageShow(): void { | 57 | onPageShow(): void { |
| 58 | console.log(TAG, 'onPageShow') | 58 | console.log(TAG, 'onPageShow') |
| 59 | this.pageShow = Math.random() | 59 | this.pageShow = Math.random() |
| 60 | + this.switchVideoStatus = true | ||
| 60 | this.openFullScreen() | 61 | this.openFullScreen() |
| 61 | 62 | ||
| 62 | } | 63 | } |
| 63 | 64 | ||
| 64 | onPageHide(): void { | 65 | onPageHide(): void { |
| 65 | console.log(TAG, 'onPageHide') | 66 | console.log(TAG, 'onPageHide') |
| 66 | - this.pageHide = Math.random() | 67 | + this.switchVideoStatus = false |
| 67 | this.closeFullScreen() | 68 | this.closeFullScreen() |
| 68 | } | 69 | } |
| 69 | 70 |
| @@ -46,36 +46,43 @@ export struct VideoChannelDetail { | @@ -46,36 +46,43 @@ export struct VideoChannelDetail { | ||
| 46 | private swiperController: SwiperController = new SwiperController() | 46 | private swiperController: SwiperController = new SwiperController() |
| 47 | @Provide showComment: boolean = false | 47 | @Provide showComment: boolean = false |
| 48 | @Provide windowWidth: number = AppStorage.get<number>('windowWidth') || 0 | 48 | @Provide windowWidth: number = AppStorage.get<number>('windowWidth') || 0 |
| 49 | + @Consume @Watch('pageShowChange') pageShow: number | ||
| 50 | + @Consume @Watch('pageHideChange') pageHide: number | ||
| 51 | + @Provide switchVideoStatus: boolean = false | ||
| 49 | @State data: ContentDetailDTO[] = [] | 52 | @State data: ContentDetailDTO[] = [] |
| 50 | @State currentIndex: number = 0 | 53 | @State currentIndex: number = 0 |
| 51 | @State interactDataList: InteractDataDTO[] = [] | 54 | @State interactDataList: InteractDataDTO[] = [] |
| 52 | @State totalCount: number = 0 | 55 | @State totalCount: number = 0 |
| 53 | - @State switchVideoStatus: boolean = false | ||
| 54 | @State isMouted: boolean = false | 56 | @State isMouted: boolean = false |
| 55 | 57 | ||
| 58 | + pageShowChange() { | ||
| 59 | + if (this.bottomNavIndex === 2 && this.topNavIndex === 0) { | ||
| 60 | + this.barBackgroundColor = Color.Black | ||
| 61 | + this.switchVideoStatus = true | ||
| 62 | + this.openFullScreen() | ||
| 63 | + } | ||
| 64 | + } | ||
| 65 | + | ||
| 66 | + pageHideChange() { | ||
| 67 | + this.barBackgroundColor = Color.Transparent | ||
| 68 | + this.switchVideoStatus = false | ||
| 69 | + this.closeFullScreen() | ||
| 70 | + } | ||
| 71 | + | ||
| 56 | /** | 72 | /** |
| 57 | * 监听视频频道激活或失活 | 73 | * 监听视频频道激活或失活 |
| 58 | */ | 74 | */ |
| 59 | navIndexChange() { | 75 | navIndexChange() { |
| 60 | - // if (timer) clearTimeout(timer) | ||
| 61 | console.log('navIndexChange', this.bottomNavIndex, this.topNavIndex) | 76 | console.log('navIndexChange', this.bottomNavIndex, this.topNavIndex) |
| 62 | - // timer = setTimeout(() => { | ||
| 63 | - | ||
| 64 | if (this.bottomNavIndex === 2 && this.topNavIndex === 0) { | 77 | if (this.bottomNavIndex === 2 && this.topNavIndex === 0) { |
| 65 | - // 如果视频在暂停则播放视频 | ||
| 66 | - this.switchVideoStatus = true | ||
| 67 | this.barBackgroundColor = Color.Black | 78 | this.barBackgroundColor = Color.Black |
| 79 | + this.switchVideoStatus = true | ||
| 68 | this.openFullScreen() | 80 | this.openFullScreen() |
| 69 | } else { | 81 | } else { |
| 70 | - // 如果视频在播放则暂停视频 | ||
| 71 | - this.switchVideoStatus = false | ||
| 72 | this.barBackgroundColor = Color.Transparent | 82 | this.barBackgroundColor = Color.Transparent |
| 83 | + this.switchVideoStatus = false | ||
| 73 | this.closeFullScreen() | 84 | this.closeFullScreen() |
| 74 | } | 85 | } |
| 75 | - // timer = -1 | ||
| 76 | - // }, 100) | ||
| 77 | - | ||
| 78 | - | ||
| 79 | } | 86 | } |
| 80 | 87 | ||
| 81 | aboutToAppear() { | 88 | aboutToAppear() { |
| @@ -90,16 +97,6 @@ export struct VideoChannelDetail { | @@ -90,16 +97,6 @@ export struct VideoChannelDetail { | ||
| 90 | Logger.info(TAG, 'aboutToDisappear'); | 97 | Logger.info(TAG, 'aboutToDisappear'); |
| 91 | } | 98 | } |
| 92 | 99 | ||
| 93 | - onPageShow(): void { | ||
| 94 | - this.openFullScreen() | ||
| 95 | - Logger.info(TAG, 'onPageShow'); | ||
| 96 | - } | ||
| 97 | - | ||
| 98 | - onPageHide(): void { | ||
| 99 | - this.closeFullScreen() | ||
| 100 | - Logger.info(TAG, 'onPageHide'); | ||
| 101 | - } | ||
| 102 | - | ||
| 103 | /** | 100 | /** |
| 104 | * 开启沉浸式 | 101 | * 开启沉浸式 |
| 105 | * TODO:颜色待根据业务接口修改 | 102 | * TODO:颜色待根据业务接口修改 |
-
Please register or login to post a comment