Showing
1 changed file
with
7 additions
and
10 deletions
| @@ -23,7 +23,7 @@ const TAG = 'DetailPlayLiveCommon' | @@ -23,7 +23,7 @@ const TAG = 'DetailPlayLiveCommon' | ||
| 23 | @Component | 23 | @Component |
| 24 | export struct DetailPlayLiveCommon { | 24 | export struct DetailPlayLiveCommon { |
| 25 | private liveViewModel: LiveViewModel = new LiveViewModel() | 25 | private liveViewModel: LiveViewModel = new LiveViewModel() |
| 26 | - pageShowTime:number = 0; | 26 | + pageShowTime: number = 0; |
| 27 | @Provide relId: string = '' | 27 | @Provide relId: string = '' |
| 28 | @Provide contentId: string = '' | 28 | @Provide contentId: string = '' |
| 29 | @Provide relType: string = '' | 29 | @Provide relType: string = '' |
| @@ -38,7 +38,6 @@ export struct DetailPlayLiveCommon { | @@ -38,7 +38,6 @@ export struct DetailPlayLiveCommon { | ||
| 38 | @Provide publishCommentModel: publishCommentModel = new publishCommentModel() | 38 | @Provide publishCommentModel: publishCommentModel = new publishCommentModel() |
| 39 | // 横屏或竖屏 general-竖屏,news-横屏 | 39 | // 横屏或竖屏 general-竖屏,news-横屏 |
| 40 | @State liveLandscape: string = '' | 40 | @State liveLandscape: string = '' |
| 41 | - | ||
| 42 | @State isLoading: boolean = false | 41 | @State isLoading: boolean = false |
| 43 | 42 | ||
| 44 | async aboutToAppear(): Promise<void> { | 43 | async aboutToAppear(): Promise<void> { |
| @@ -56,7 +55,6 @@ export struct DetailPlayLiveCommon { | @@ -56,7 +55,6 @@ export struct DetailPlayLiveCommon { | ||
| 56 | 55 | ||
| 57 | } | 56 | } |
| 58 | 57 | ||
| 59 | - | ||
| 60 | build() { | 58 | build() { |
| 61 | Column() { | 59 | Column() { |
| 62 | // 直播预约或横屏直播统一进横屏直播 | 60 | // 直播预约或横屏直播统一进横屏直播 |
| @@ -66,7 +64,7 @@ export struct DetailPlayLiveCommon { | @@ -66,7 +64,7 @@ export struct DetailPlayLiveCommon { | ||
| 66 | } else if (this.liveLandscape === 'general') { | 64 | } else if (this.liveLandscape === 'general') { |
| 67 | // 沉浸式直播 | 65 | // 沉浸式直播 |
| 68 | DetailPlayVLivePage() | 66 | DetailPlayVLivePage() |
| 69 | - }else { | 67 | + } else { |
| 70 | PictureLoading().visibility(this.isLoading ? Visibility.None : Visibility.Visible) | 68 | PictureLoading().visibility(this.isLoading ? Visibility.None : Visibility.Visible) |
| 71 | } | 69 | } |
| 72 | } | 70 | } |
| @@ -86,7 +84,7 @@ export struct DetailPlayLiveCommon { | @@ -86,7 +84,7 @@ export struct DetailPlayLiveCommon { | ||
| 86 | if (data) { | 84 | if (data) { |
| 87 | let detailData = data[0] | 85 | let detailData = data[0] |
| 88 | //人民号类型单独获取直播地址 | 86 | //人民号类型单独获取直播地址 |
| 89 | - if (detailData.rmhPlatform === 1) { | 87 | + if (detailData.rmhPlatform === 1 && detailData.liveInfo?.liveState === 'running') { |
| 90 | 88 | ||
| 91 | let vliveId = detailData.liveInfo.vlive[0].vliveId as string | 89 | let vliveId = detailData.liveInfo.vlive[0].vliveId as string |
| 92 | console.error(TAG, 'vliveId==' + vliveId) | 90 | console.error(TAG, 'vliveId==' + vliveId) |
| @@ -133,7 +131,7 @@ export struct DetailPlayLiveCommon { | @@ -133,7 +131,7 @@ export struct DetailPlayLiveCommon { | ||
| 133 | ToastUtils.shortToast('内容不存在') | 131 | ToastUtils.shortToast('内容不存在') |
| 134 | router.back() | 132 | router.back() |
| 135 | } | 133 | } |
| 136 | - },()=>{ | 134 | + }, () => { |
| 137 | this.isLoading | 135 | this.isLoading |
| 138 | ToastUtils.shortToast('内容不存在') | 136 | ToastUtils.shortToast('内容不存在') |
| 139 | router.back() | 137 | router.back() |
| @@ -141,8 +139,6 @@ export struct DetailPlayLiveCommon { | @@ -141,8 +139,6 @@ export struct DetailPlayLiveCommon { | ||
| 141 | }) | 139 | }) |
| 142 | } | 140 | } |
| 143 | 141 | ||
| 144 | - | ||
| 145 | - | ||
| 146 | onPageShow() { | 142 | onPageShow() { |
| 147 | this.pageShow = Math.random() | 143 | this.pageShow = Math.random() |
| 148 | Logger.info(TAG, 'onPageShow') | 144 | Logger.info(TAG, 'onPageShow') |
| @@ -154,8 +150,9 @@ export struct DetailPlayLiveCommon { | @@ -154,8 +150,9 @@ export struct DetailPlayLiveCommon { | ||
| 154 | Logger.info(TAG, 'onPageHide') | 150 | Logger.info(TAG, 'onPageHide') |
| 155 | console.error("XXXXZZZZ", '---onPageHide------------') | 151 | console.error("XXXXZZZZ", '---onPageHide------------') |
| 156 | //页面浏览 | 152 | //页面浏览 |
| 157 | - TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Live_Detail,TrackConstants.PageName.Live_Detail | ||
| 158 | - ,Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime)/1000)) | 153 | + TrackingPageBrowse.trackCommonPageExposureEnd(TrackConstants.PageName.Live_Detail, |
| 154 | + TrackConstants.PageName.Live_Detail | ||
| 155 | + , Math.floor((DateTimeUtils.getTimeStamp() - this.pageShowTime) / 1000)) | ||
| 159 | 156 | ||
| 160 | } | 157 | } |
| 161 | 158 |
-
Please register or login to post a comment