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
liyubing
2024-05-28 14:51:16 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b1a2ecac32fce535a5a7de04c7cc50574783a6f0
b1a2ecac
1 parent
35debf24
fix:直播详情页面,两次调用相同接口,处理成只调用一次
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
14 deletions
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/DetailPlayLiveCommon.ets
View file @
b1a2eca
...
...
@@ -71,12 +71,23 @@ export struct DetailPlayLiveCommon {
.then((data: Array<ContentDetailDTO>) => {
console.log(TAG, '查询视频详情用于评论展示 getContentDetail:', JSON.stringify(data))
if (data) {
//todo 不加setTimeOut ,接口返回的数据 就没法让PlayerComponent #@Consume @Watch('updateData') liveDetailsBean 的updateData方法运行
setTimeout(() => {
this.contentDetailData = data[0];
}, 50)
let detailData = data[0]
this.liveLandscape =
detailData?.liveInfo?.liveLandScape //String(this.contentDetailData?.liveInfo?.liveLandScape || '')
this.liveState = detailData.liveInfo?.liveState
if (this.liveState === 'wait' || this.liveLandscape === 'news') {
this.contentDetailData = data[0]
} else if (this.liveLandscape === 'general') {
//todo 不加setTimeOut ,接口返回的数据 就没法让PlayerComponent #@Consume @Watch('updateData') liveDetailsBean 的updateData方法运行
setTimeout(() => {
this.contentDetailData = data[0]
}, 10)
}
console.log(TAG, '查询视频详情用于评论展示 openComment:', detailData.openComment)
this.publishCommentModel.targetId = String(detailData?.newsId || '')
this.publishCommentModel.targetRelId = String(detailData?.reLInfo?.relId || '')
...
...
@@ -87,12 +98,6 @@ export struct DetailPlayLiveCommon {
this.publishCommentModel.targetType = String(detailData?.newsType || '')
this.publishCommentModel.visitorComment = String(detailData?.visitorComment || '')
this.publishCommentModel.commentContent = ''
this.liveLandscape =
detailData?.liveInfo?.liveLandScape //String(this.contentDetailData?.liveInfo?.liveLandScape || '')
this.liveState = detailData.liveInfo?.liveState
this.liveStyle = detailData.liveInfo?.liveStyle
if (detailData.fullColumnImgUrls && detailData.fullColumnImgUrls.length > 0) {
...
...
@@ -107,7 +112,6 @@ export struct DetailPlayLiveCommon {
})
}
onPageShow() {
this.pageShow = Math.random()
Logger.info(TAG, 'onPageShow')
...
...
sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
View file @
b1a2eca
...
...
@@ -63,7 +63,7 @@ export struct DetailPlayLivePage {
Column() {
TopPlayComponent({ playerController: this.playerController })
.height(this.displayDirection == DisplayDirection.VERTICAL ?
211:
'100%')
.height(this.displayDirection == DisplayDirection.VERTICAL ?
211 :
'100%')
TabComponent({ tabs: this.tabs, changeToTab: this.changeToTab })
.layoutWeight(1)
...
...
@@ -80,7 +80,7 @@ export struct DetailPlayLivePage {
// 切换到大家聊
this.changeToTab = Math.random()
}
})
.visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
}).visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
// LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum })
// .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None)
...
...
@@ -119,6 +119,8 @@ export struct DetailPlayLivePage {
getLiveDetails() {
const data = this.contentDetailData
console.error("XXXXZZZZ", 'contentDetailData ----liveState==>' + data.liveInfo?.liveState)
console.error("XXXXZZZZ", 'contentDetailData ----liveStyle==>' + data.liveInfo?.liveStyle)
if (data.liveInfo?.liveState == 'wait') {
//直播样式 0-正常模式 , 1-隐藏直播间,2-隐藏大家聊 【人民号发布是竖屏的,为空】
if (data.liveInfo?.liveStyle == 1) {
...
...
@@ -129,7 +131,13 @@ export struct DetailPlayLivePage {
this.tabs = ['简介', '直播间', '大家聊']
}
} else {
this.tabs = ['直播间', '大家聊']
if (data.liveInfo?.liveStyle == 1) {
this.tabs = ['大家聊']
} else if (data.liveInfo?.liveStyle == 2) {
this.tabs = ['直播间',]
} else {
this.tabs = ['直播间', '大家聊']
}
}
}
...
...
Please
register
or
login
to post a comment