Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
zhenghy
2024-05-08 15:13:21 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6a848c2184c1b4219a80c71be5978d39469ae94e
6a848c21
1 parent
fe441abd
直播评论接入
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
110 additions
and
9 deletions
sight_harmony/features/wdComponent/oh-package.json5
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLiveCommon.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayVLivePage.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/viewModel/LiveModel.ets
sight_harmony/features/wdDetailPlayLive/src/main/ets/viewModel/LiveViewModel.ets
sight_harmony/features/wdComponent/oh-package.json5
View file @
6a848c2
...
...
@@ -18,7 +18,8 @@
"wdRouter"
:
"file:../../commons/wdRouter"
,
"wdNetwork"
:
"file:../../commons/wdNetwork"
,
"wdJsBridge"
:
"file:../../commons/wdJsBridge"
,
"wdDetailPlayApi"
:
"file:../../features/wdDetailPlayApi"
,
"wdHwAbility"
:
"file:../../features/wdHwAbility"
"wdDetailPlayApi"
:
"file:../../features/wdDetailPlayApi"
,
"wdHwAbility"
:
"file:../../features/wdHwAbility"
,
"wdShare"
:
"file:../../features/wdShare"
}
}
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLiveCommon.ets
View file @
6a848c2
...
...
@@ -43,6 +43,8 @@ export struct DetailPlayLiveCommon {
}
.height('100%')
.width('100%')
.backgroundColor(Color.Black)
.expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP])
}
getLiveDetails() {
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
View file @
6a848c2
import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index';
import {
ContentDetailDTO,
LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index';
import { LiveViewModel } from '../viewModel/LiveViewModel';
import { TabComponent } from '../widgets/details/TabComponent';
import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet';
...
...
@@ -9,6 +9,9 @@ import { router, window } from '@kit.ArkUI';
import { devicePLSensorManager } from 'wdDetailPlayApi/Index';
import { LiveCommentComponent } from 'wdComponent/Index';
import { WDPlayerController } from 'wdPlayer/Index';
import { OperRowListView } from 'wdComponent/src/main/ets/components/view/OperRowListView';
import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel';
import { ResponseDTO } from 'wdNetwork/Index';
let TAG: string = 'DetailPlayLivePage';
...
...
@@ -29,6 +32,8 @@ export struct DetailPlayLivePage {
@Consume @Watch('onPageShowCus') pageShow: number
@Consume @Watch('onPageHideCus') pageHide: number
@Consume @Watch('onBackPressCus') pageBackPress: number
@State contentDetailData: ContentDetailDTO = {} as ContentDetailDTO
@State publishCommentModel: publishCommentModel = new publishCommentModel()
aboutToAppear(): void {
Logger.info(TAG, `wyj-aboutToAppear`)
...
...
@@ -43,6 +48,7 @@ export struct DetailPlayLivePage {
})
this.getLiveDetails()
this.getLiveRoomData()
this.getContentDetail()
}
build() {
...
...
@@ -52,8 +58,17 @@ export struct DetailPlayLivePage {
TabComponent({ tabs: this.tabs })
.layoutWeight(503)
.visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum })
OperRowListView({
operationButtonList: ['comment', 'collect', 'share', 'like'],
contentDetailData: this.contentDetailData,
publishCommentModel: this.publishCommentModel,
})
.visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
// LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum })
// .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
}
.height('100%')
.width('100%')
...
...
@@ -91,6 +106,28 @@ export struct DetailPlayLivePage {
return true
}
/**
* 查询视频详情用于评论展示
*/
getContentDetail() {
this.liveViewModel.getContentDetail(this.contentId, this.relId, this.relType)
.then((data: Array<ContentDetailDTO>) => {
console.log(TAG, 'getContentDetail:', JSON.stringify(data))
if (data) {
this.contentDetailData = data?.[0];
if (this.contentDetailData?.openComment) {
this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId)
this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType)
this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId)
this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle)
this.publishCommentModel.targetType = String(this.contentDetailData?.newsType)
}
}
})
}
getLiveDetails() {
this.liveViewModel.getLiveDetails(this.contentId, this.relId, this.relType)
.then(
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayVLivePage.ets
View file @
6a848c2
...
...
@@ -34,7 +34,7 @@ export struct DetailPlayVLivePage {
aboutToAppear(): void {
console.log(TAG, 'aboutToAppear')
WindowModel.shared.setWindowLayoutFullScreen(true)
//
WindowModel.shared.setWindowLayoutFullScreen(true)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#ffffff', })
//https://pdapis.pdnews.cn/api/rmrb-bff-display-zh/content/zh/c/content/detail?relId=500005302448&relType=1&contentId=20000016340
...
...
@@ -48,7 +48,7 @@ export struct DetailPlayVLivePage {
}
aboutToDisappear(): void {
WindowModel.shared.setWindowLayoutFullScreen(false)
//
WindowModel.shared.setWindowLayoutFullScreen(false)
WindowModel.shared.setWindowSystemBarProperties({ statusBarContentColor: '#000000', })
}
...
...
@@ -107,7 +107,8 @@ export struct DetailPlayVLivePage {
(data) => {
if (data.length > 0) {
this.liveDetailsBean = data[0]
this.liveState = this.liveDetailsBean.liveInfo?.liveState //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
this.liveState =
this.liveDetailsBean.liveInfo?.liveState //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停
if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) {
this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url
}
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/viewModel/LiveModel.ets
View file @
6a848c2
import { HttpUrlUtils, ResponseDTO } from 'wdNetwork';
import { HttpRequest } from 'wdNetwork/src/main/ets/http/HttpRequest';
import { Logger, ToastUtils } from 'wdKit';
import { LiveDetailsBean, LiveRoomBean, LiveRoomDataBean } from 'wdBean/Index';
import { ContentDetailDTO, LiveDetailsBean, LiveRoomBean, LiveRoomDataBean } from 'wdBean/Index';
import { ContentDetailRequest } from 'wdDetailPlayApi/Index';
const TAG = 'LiveModel'
export class LiveModel {
getContentDetail(contentId: string, relId: string, relType: string) {
return new Promise<Array<ContentDetailDTO>>((success, fail) => {
ContentDetailRequest.getContentDetail({
contentId: contentId,
relId: relId,
relType: relType
}).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
if (resDTO.data) {
success(resDTO.data)
}
}).catch(() => {
fail("数据为空")
})
})
}
/**
* 直播内容详情
* @param contentId
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/viewModel/LiveViewModel.ets
View file @
6a848c2
import { LiveDetailsBean, LiveRoomBean, LiveRoomDataBean } from 'wdBean/Index'
import { ContentDetailDTO, LiveDetailsBean, LiveRoomBean, LiveRoomDataBean } from 'wdBean/Index'
import { ResponseDTO } from 'wdNetwork/Index'
import { LiveModel } from './LiveModel'
...
...
@@ -11,6 +12,45 @@ export class LiveViewModel {
this.liveModel = new LiveModel()
}
// 视频信息
getContentDetail(contentId: string, relId: string, relType: string) {
return new Promise<Array<ContentDetailDTO>>((success, fail) => {
this.liveModel.getContentDetail(contentId, relId, relType).then((data) => {
success(data)
}).catch((message: string) => {
fail(message)
})
})
}
// async getContentDetail(contentId: string, relId: string, relType: string) {
// return ContentDetailRequest.getContentDetail({
// contentId: contentId,
// relId: relId,
// relType: relType
// }).then(async (resDTO: ResponseDTO<ContentDetailDTO[]>) => {
// console.log(TAG, 'getContentDetail:', JSON.stringify(resDTO.data))
// if (resDTO.data) {
//
// this.contentDetailData = resDTO.data?.[0];
//
// if (this.contentDetailData?.openComment) {
// this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '')
// this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId)
// this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle
// this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType)
// this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId)
// this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle)
// this.publishCommentModel.targetType = String(this.contentDetailData?.newsType)
// }
//
//
// }
// })
// }
//直播详情
getLiveDetails(contentId: string, relId: string, relType: string) {
return new Promise<Array<LiveDetailsBean>>((success, fail) => {
...
...
Please
register
or
login
to post a comment