Showing
20 changed files
with
178 additions
and
363 deletions
| @@ -6,6 +6,7 @@ import { VideoInfoDTO } from './VideoInfoDTO'; | @@ -6,6 +6,7 @@ import { VideoInfoDTO } from './VideoInfoDTO'; | ||
| 6 | import { RmhInfoDTO } from './RmhInfoDTO' | 6 | import { RmhInfoDTO } from './RmhInfoDTO' |
| 7 | import { UserInfoDTO } from './UserInfoDTO' | 7 | import { UserInfoDTO } from './UserInfoDTO' |
| 8 | 8 | ||
| 9 | + | ||
| 9 | /** | 10 | /** |
| 10 | * 接口定义: | 11 | * 接口定义: |
| 11 | * http://192.168.1.3:3300/project/3802/interface/api/200915 | 12 | * http://192.168.1.3:3300/project/3802/interface/api/200915 |
| @@ -40,7 +41,7 @@ export interface ContentDetailDTO { | @@ -40,7 +41,7 @@ export interface ContentDetailDTO { | ||
| 40 | shareInfo: ShareInfoDTO; | 41 | shareInfo: ShareInfoDTO; |
| 41 | photoList: any[]; | 42 | photoList: any[]; |
| 42 | videoInfo: VideoInfoDTO[]; | 43 | videoInfo: VideoInfoDTO[]; |
| 43 | - liveInfo?: any; | 44 | + liveInfo?: any ; |
| 44 | voteInfo?: any; | 45 | voteInfo?: any; |
| 45 | rmhInfo?: RmhInfoDTO | null; | 46 | rmhInfo?: RmhInfoDTO | null; |
| 46 | userInfo?: UserInfoDTO | null; | 47 | userInfo?: UserInfoDTO | null; |
| 1 | +import { FullColumnImgUrlDTO } from '../detail/FullColumnImgUrlDTO' | ||
| 2 | +import { ReLInfoDTO } from '../detail/ReLInfoDTO' | ||
| 1 | import { RmhInfoDTO } from '../detail/RmhInfoDTO' | 3 | import { RmhInfoDTO } from '../detail/RmhInfoDTO' |
| 2 | 4 | ||
| 3 | export interface LiveDetailsBean { | 5 | export interface LiveDetailsBean { |
| 4 | - /** | ||
| 5 | - * { | ||
| 6 | - "code": "0", | ||
| 7 | - "data": [ | ||
| 8 | - { | ||
| 9 | - "activityInfos": [], | ||
| 10 | - "appstyle": 2, | ||
| 11 | - "audioList": [], | ||
| 12 | - "authorList": [ | ||
| 13 | - { | ||
| 14 | - "authorName": "雷崔捷" | ||
| 15 | - } | ||
| 16 | - ], | ||
| 17 | - "bestNoticer": null, | ||
| 18 | - "commentDisplay": 0, | ||
| 19 | - "editorName": "", | ||
| 20 | - "firstFrameImageUri": "", | ||
| 21 | - "fullColumnImgUrls": [ | ||
| 22 | - { | ||
| 23 | - "format": null, | ||
| 24 | - "height": null, | ||
| 25 | - "landscape": null, | ||
| 26 | - "size": null, | ||
| 27 | - "url": "https://rmrbcmsonline.peopleapp.com/upload/image/202404/rmrb_71671711971849.png", | ||
| 28 | - "weight": null | ||
| 29 | - } | ||
| 30 | - ], | ||
| 31 | - "hasPopUp": null, | ||
| 32 | - "isNewspaper": false, | ||
| 33 | - "itemId": "", | ||
| 34 | - "itemTypeCode": "", | ||
| 35 | - "keyArticle": 0, | ||
| 36 | - "likesStyle": null, | ||
| 37 | - "liveInfo": { | ||
| 38 | - "background": { | ||
| 39 | - "imageUrl": "", | ||
| 40 | - "name": "" | ||
| 41 | - }, | ||
| 42 | - "backgroundStyle": null, | ||
| 43 | - "cornerFlag": 0, | ||
| 44 | - "cornerImgUrl": "", | ||
| 45 | - "cornerLinkUrl": "", | ||
| 46 | - "createUserId": "", | ||
| 47 | - "createUserName": "", | ||
| 48 | - "endTime": "2024-04-03 11:08:00", | ||
| 49 | - "handAngleImageUri": "", | ||
| 50 | - "handAngleLink": "", | ||
| 51 | - "handAngleSwitch": false, | ||
| 52 | - "likeEnable": 1, | ||
| 53 | - "likesStyle": "thumb", | ||
| 54 | - "liveExperience": 1, | ||
| 55 | - "liveExperienceTime": 3, | ||
| 56 | - "liveLandScape": "news", | ||
| 57 | - "liveState": "end", | ||
| 58 | - "liveStyle": 0, | ||
| 59 | - "liveWay": 0, | ||
| 60 | - "mlive": { | ||
| 61 | - "barrageShowEnable": false, | ||
| 62 | - "giftEnable": false, | ||
| 63 | - "mliveId": 20000016257, | ||
| 64 | - "roomId": "5381b934-cea8-4338-bd12-5bf70af43e0c" | ||
| 65 | - }, | ||
| 66 | - "notice": "", | ||
| 67 | - "openComment": 1, | ||
| 68 | - "padImageUri": "", | ||
| 69 | - "planStartTime": "2024-04-03 05:00:00", | ||
| 70 | - "playbackSwitch": true, | ||
| 71 | - "preCommentFlag": 1, | ||
| 72 | - "previewType": 1, | ||
| 73 | - "previewUrl": "", | ||
| 74 | - "shareSwitch": "", | ||
| 75 | - "startTime": "2024-04-03 05:03:23", | ||
| 76 | - "tplId": 5, | ||
| 77 | - "vlive": [ | ||
| 78 | - { | ||
| 79 | - "coverImageUrl": "", | ||
| 80 | - "definition": [], | ||
| 81 | - "liveStreamManagerId": null, | ||
| 82 | - "liveStreamType": 1, | ||
| 83 | - "liveUrl": "https://plwbthird.live.weibo.com/alicdn/5018938748437049.m3u8", | ||
| 84 | - "name": "线路1", | ||
| 85 | - "replayUri": "http://mlive3.video.weibocdn.com/record/alicdn/5018726527666338/index.m3u8", | ||
| 86 | - "serialNum": null, | ||
| 87 | - "shiftEnable": false, | ||
| 88 | - "showPad": false, | ||
| 89 | - "type": "play", | ||
| 90 | - "vliveId": 186728 | ||
| 91 | - } | ||
| 92 | - ], | ||
| 93 | - "vrType": 0 | ||
| 94 | - }, | ||
| 95 | - "menuShow": 1, | ||
| 96 | - "newIntroduction": "眼前有山河,心中有家国!每年清明节前夕,宁夏固原市第二中学和固原市弘文中学会组织入学新生,一天之内徒步54公里从学校往返任山河烈士陵园,用这种方式缅怀烈士们,这份坚定与执着已经延续了29年。", | ||
| 97 | - "newLinkObject": null, | ||
| 98 | - "newsBodyTitle": "", | ||
| 99 | - "newsContent": "", | ||
| 100 | - "newsContentBak": "", | ||
| 101 | - "newsDownTitle": "", | ||
| 102 | - "newsId": 20000016229, | ||
| 103 | - "newsLinkUrl": "", | ||
| 104 | - "newsShortTitle": "", | ||
| 105 | - "newsSource": "41", | ||
| 106 | - "newsSourceName": "", | ||
| 107 | - "newsSummary": "", | ||
| 108 | - "newsTags": "", | ||
| 109 | - "newsTitle": "徒步54公里的思政课,坚守29年的薪火传承", | ||
| 110 | - "newsType": 2, | ||
| 111 | - "oldNewsId": "7218507", | ||
| 112 | - "openAudio": 0, | ||
| 113 | - "openComment": null, | ||
| 114 | - "openLikes": null, | ||
| 115 | - "photoList": [], | ||
| 116 | - "popUps": [], | ||
| 117 | - "preCommentFlag": null, | ||
| 118 | - "publishTime": "2024-04-01 19:44:00", | ||
| 119 | - "reLInfo": { | ||
| 120 | - "channelId": 2061, | ||
| 121 | - "relId": "500005272745", | ||
| 122 | - "relObjectId": 2061, | ||
| 123 | - "relType": "1" | ||
| 124 | - }, | ||
| 125 | - "readFlag": 0, | ||
| 126 | - "recommendShow": null, | ||
| 127 | - "rmhInfo": null, | ||
| 128 | - "rmhPlatform": 0, | ||
| 129 | - "sceneId": "", | ||
| 130 | - "serials": null, | ||
| 131 | - "shareInfo": { | ||
| 132 | - "shareCoverUrl": "https://rmrbcmsonline.peopleapp.com/upload/image/202404/202404011944259539.png?x-oss-process=image/resize,w_400", | ||
| 133 | - "shareOpen": 1, | ||
| 134 | - "sharePosterCoverUrl": "https://rmrbcmsonline.peopleapp.com/upload/image/202404/rmrb_71671711971849.png?x-oss-process=image/resize,m_fill,h_450,w_800,limit_0/quality,q_90", | ||
| 135 | - "sharePosterOpen": 1, | ||
| 136 | - "shareSummary": "人民日报,有品质的新闻", | ||
| 137 | - "shareTitle": "徒步54公里的思政课,坚守29年的薪火传承", | ||
| 138 | - "shareUrl": "https://people.pdnews.cn/column/20000016229-500005272745" | ||
| 139 | - }, | ||
| 140 | - "specialColumnId": null, | ||
| 141 | - "specialColumnName": "", | ||
| 142 | - "subSceneId": "", | ||
| 143 | - "timeline": null, | ||
| 144 | - "topicInfo": null, | ||
| 145 | - "traceId": "", | ||
| 146 | - "traceInfo": "", | ||
| 147 | - "userInfo": null, | ||
| 148 | - "videoInfo": [], | ||
| 149 | - "viewCount": 0, | ||
| 150 | - "visitorComment": 1, | ||
| 151 | - "voteInfo": null | ||
| 152 | - } | ||
| 153 | - ], | ||
| 154 | - "message": "Success", | ||
| 155 | - "meta": null, | ||
| 156 | - "requestId": "", | ||
| 157 | - "success": true, | ||
| 158 | - "timestamp": 1712807514322 | ||
| 159 | - } | ||
| 160 | - */ | 6 | + |
| 7 | + | ||
| 8 | + visitorComment: number | ||
| 9 | + newsType: number; | ||
| 10 | + keyArticle: number | ||
| 161 | liveInfo: LiveInfo | 11 | liveInfo: LiveInfo |
| 162 | - fullColumnImgUrls: Array<FullColumnImgUrlBean> | 12 | + fullColumnImgUrls: Array<FullColumnImgUrlDTO> |
| 163 | newsTitle: string | 13 | newsTitle: string |
| 164 | newsId: string | 14 | newsId: string |
| 165 | newIntroduction: string | 15 | newIntroduction: string |
| 166 | //迁移id | 16 | //迁移id |
| 167 | oldNewsId: string | 17 | oldNewsId: string |
| 168 | - reLInfo: ReLInfo | 18 | + reLInfo: ReLInfoDTO |
| 169 | rmhInfo: RmhInfoDTO | 19 | rmhInfo: RmhInfoDTO |
| 170 | } | 20 | } |
| 171 | 21 | ||
| @@ -188,13 +38,6 @@ export interface MLive { | @@ -188,13 +38,6 @@ export interface MLive { | ||
| 188 | mliveId: string | 38 | mliveId: string |
| 189 | } | 39 | } |
| 190 | 40 | ||
| 191 | -export interface FullColumnImgUrlBean { | ||
| 192 | - url: string | ||
| 193 | - height: string | ||
| 194 | - landscape: number | ||
| 195 | - size: string | ||
| 196 | - weight: string | ||
| 197 | -} | ||
| 198 | 41 | ||
| 199 | export interface Vlive { | 42 | export interface Vlive { |
| 200 | //拉流直播 url | 43 | //拉流直播 url |
| @@ -205,9 +48,7 @@ export interface Vlive { | @@ -205,9 +48,7 @@ export interface Vlive { | ||
| 205 | liveStreamType: number | null | 48 | liveStreamType: number | null |
| 206 | } | 49 | } |
| 207 | 50 | ||
| 208 | -export interface ReLInfo { | ||
| 209 | - relId: string | ||
| 210 | -} | 51 | + |
| 211 | 52 | ||
| 212 | export interface joinPeopleNum { | 53 | export interface joinPeopleNum { |
| 213 | barrageNum: number, | 54 | barrageNum: number, |
| 1 | -import { FullColumnImgUrlBean } from './LiveDetailsBean' | ||
| 2 | - | 1 | +import { FullColumnImgUrlDTO } from '../detail/FullColumnImgUrlDTO' |
| 3 | export interface LiveRoomBean { | 2 | export interface LiveRoomBean { |
| 4 | pageNum: number | 3 | pageNum: number |
| 5 | pageSize: number | 4 | pageSize: number |
| @@ -32,6 +31,6 @@ export interface LiveRoomItemBean { | @@ -32,6 +31,6 @@ export interface LiveRoomItemBean { | ||
| 32 | //音频地址 | 31 | //音频地址 |
| 33 | audioUrl: string | 32 | audioUrl: string |
| 34 | //详情页面插入数据bean | 33 | //详情页面插入数据bean |
| 35 | - fullColumnImgUrlDto: FullColumnImgUrlBean | 34 | + fullColumnImgUrlDto: FullColumnImgUrlDTO |
| 36 | 35 | ||
| 37 | } | 36 | } |
| @@ -49,7 +49,7 @@ export struct LikeComponent { | @@ -49,7 +49,7 @@ export struct LikeComponent { | ||
| 49 | // 2:竖屏直播页 3:图集 4:横屏直播页 | 49 | // 2:竖屏直播页 3:图集 4:横屏直播页 |
| 50 | if(this.pageComponentType == 2 || this.pageComponentType == 4) { | 50 | if(this.pageComponentType == 2 || this.pageComponentType == 4) { |
| 51 | // 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福 | 51 | // 点赞样式 love爱心型 thumb点赞手势 mourning 蜡烛(默哀) pray 祈福 |
| 52 | - this.likesStyle = this.contentDetailData?.liveInfo?.likesStyle | 52 | + this.likesStyle = String(this.contentDetailData?.liveInfo?.likesStyle) |
| 53 | this.openLikes = this.contentDetailData?.liveInfo?.likeEnable == 1 ? true : false | 53 | this.openLikes = this.contentDetailData?.liveInfo?.likeEnable == 1 ? true : false |
| 54 | } else { | 54 | } else { |
| 55 | // 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 | 55 | // 内容用 点赞样式 1红心(点赞) 2大拇指(祈福) 3蜡烛(默哀) 4置空 |
| 1 | -import { ToastUtils, Logger, NumberFormatterUtils, SPHelper } from 'wdKit'; | 1 | +import { NumberFormatterUtils, SPHelper } from 'wdKit'; |
| 2 | import promptAction from '@ohos.promptAction'; | 2 | import promptAction from '@ohos.promptAction'; |
| 3 | import { | 3 | import { |
| 4 | - InputMethodProperty, | ||
| 5 | - batchLikeAndCollectResult, | ||
| 6 | batchLikeAndCollectParams, | 4 | batchLikeAndCollectParams, |
| 5 | + batchLikeAndCollectResult, | ||
| 7 | ContentDetailDTO, | 6 | ContentDetailDTO, |
| 8 | - postExecuteLikeParams, | ||
| 9 | contentListParams, | 7 | contentListParams, |
| 10 | InteractDataDTO, | 8 | InteractDataDTO, |
| 11 | postExecuteCollectRecordParams | 9 | postExecuteCollectRecordParams |
| @@ -13,16 +11,15 @@ import { | @@ -13,16 +11,15 @@ import { | ||
| 13 | import router from '@ohos.router'; | 11 | import router from '@ohos.router'; |
| 14 | import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel'; | 12 | import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel'; |
| 15 | import { LikeComponent } from './LikeComponent'; | 13 | import { LikeComponent } from './LikeComponent'; |
| 16 | -import { CommentTabComponent, CommentIconComponent, } from '../comment/view/CommentTabComponent'; | ||
| 17 | -import { publishCommentModel } from '../comment/model/PublishCommentModel' | ||
| 18 | -import { HttpUrlUtils } from 'wdNetwork/Index'; | 14 | +import { CommentIconComponent, CommentTabComponent, } from '../comment/view/CommentTabComponent'; |
| 15 | +import { publishCommentModel } from '../comment/model/PublishCommentModel'; | ||
| 19 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; | 16 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index'; |
| 20 | import { PageRepository } from '../../repository/PageRepository'; | 17 | import { PageRepository } from '../../repository/PageRepository'; |
| 21 | import { SpConstants } from 'wdConstant/Index'; | 18 | import { SpConstants } from 'wdConstant/Index'; |
| 22 | import { WDShare } from 'wdShare/Index'; | 19 | import { WDShare } from 'wdShare/Index'; |
| 23 | -import { AudioSuspensionModel } from '../../viewmodel/AudioSuspensionModel' | ||
| 24 | -import { EmitterEventId, EmitterUtils } from 'wdKit/Index' | ||
| 25 | -import { PlayerConstants } from 'wdPlayer' | 20 | +import { AudioSuspensionModel } from '../../viewmodel/AudioSuspensionModel'; |
| 21 | +import { EmitterEventId, EmitterUtils } from 'wdKit/Index'; | ||
| 22 | +import { PlayerConstants } from 'wdPlayer'; | ||
| 26 | import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index'; | 23 | import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index'; |
| 27 | 24 | ||
| 28 | const TAG = 'OperRowListView'; | 25 | const TAG = 'OperRowListView'; |
| 1 | -import { Action, ContentDetailDTO, LiveDetailsBean } from 'wdBean/Index'; | 1 | +import { Action, ContentDetailDTO } from 'wdBean/Index'; |
| 2 | import { LiveViewModel } from '../viewModel/LiveViewModel'; | 2 | import { LiveViewModel } from '../viewModel/LiveViewModel'; |
| 3 | import router from '@ohos.router'; | 3 | import router from '@ohos.router'; |
| 4 | 4 | ||
| @@ -31,9 +31,10 @@ export struct DetailPlayLiveCommon { | @@ -31,9 +31,10 @@ export struct DetailPlayLiveCommon { | ||
| 31 | @Provide pageShow: number = -1 | 31 | @Provide pageShow: number = -1 |
| 32 | @Provide pageHide: number = -1 | 32 | @Provide pageHide: number = -1 |
| 33 | @Provide pageBackPress: number = -1 | 33 | @Provide pageBackPress: number = -1 |
| 34 | - @Provide liveDetailsBean: LiveDetailsBean = {} as LiveDetailsBean | ||
| 35 | @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO | 34 | @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO |
| 36 | @Provide publishCommentModel: publishCommentModel = new publishCommentModel() | 35 | @Provide publishCommentModel: publishCommentModel = new publishCommentModel() |
| 36 | + // 横屏或竖屏 general-竖屏,news-横屏 | ||
| 37 | + @State liveLandscape: string = '' | ||
| 37 | 38 | ||
| 38 | async aboutToAppear(): Promise<void> { | 39 | async aboutToAppear(): Promise<void> { |
| 39 | const par: Action = router.getParams() as Action; | 40 | const par: Action = router.getParams() as Action; |
| @@ -48,11 +49,11 @@ export struct DetailPlayLiveCommon { | @@ -48,11 +49,11 @@ export struct DetailPlayLiveCommon { | ||
| 48 | build() { | 49 | build() { |
| 49 | Column() { | 50 | Column() { |
| 50 | // 直播预约或横屏直播统一进横屏直播 | 51 | // 直播预约或横屏直播统一进横屏直播 |
| 51 | - if (this.liveState === 'wait' || this.liveStyle === 0) { | ||
| 52 | - // 非沉浸式 | 52 | + if (this.liveState === 'wait' || this.liveLandscape === 'news') { |
| 53 | + // 非沉浸式直播 | ||
| 53 | DetailPlayLivePage({ contentId: this.contentId, relId: this.relId, relType: this.relType }) | 54 | DetailPlayLivePage({ contentId: this.contentId, relId: this.relId, relType: this.relType }) |
| 54 | - } else if (this.liveStyle === 1) { | ||
| 55 | - // 沉浸式 | 55 | + } else if (this.liveLandscape === 'general') { |
| 56 | + // 沉浸式直播 | ||
| 56 | DetailPlayVLivePage() | 57 | DetailPlayVLivePage() |
| 57 | } | 58 | } |
| 58 | } | 59 | } |
| @@ -70,60 +71,43 @@ export struct DetailPlayLiveCommon { | @@ -70,60 +71,43 @@ export struct DetailPlayLiveCommon { | ||
| 70 | .then((data: Array<ContentDetailDTO>) => { | 71 | .then((data: Array<ContentDetailDTO>) => { |
| 71 | console.log(TAG, '查询视频详情用于评论展示 getContentDetail:', JSON.stringify(data)) | 72 | console.log(TAG, '查询视频详情用于评论展示 getContentDetail:', JSON.stringify(data)) |
| 72 | if (data) { | 73 | if (data) { |
| 74 | + //todo 不加setTimeOut ,接口返回的数据 就没法让PlayerComponent #@Consume @Watch('updateData') liveDetailsBean 的updateData方法运行 | ||
| 75 | + setTimeout(() => { | ||
| 73 | this.contentDetailData = data[0]; | 76 | this.contentDetailData = data[0]; |
| 74 | - | ||
| 75 | - // if (this.contentDetailData.openComment === 1) { | ||
| 76 | - console.log(TAG, '查询视频详情用于评论展示 openComment:', this.contentDetailData.openComment) | ||
| 77 | - this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '') | ||
| 78 | - this.publishCommentModel.targetRelId = String(this.contentDetailData?.reLInfo?.relId || '') | ||
| 79 | - this.publishCommentModel.targetTitle = this.contentDetailData?.newsTitle | ||
| 80 | - this.publishCommentModel.targetRelType = String(this.contentDetailData?.reLInfo?.relType || '') | ||
| 81 | - this.publishCommentModel.targetRelObjectId = String(this.contentDetailData?.reLInfo?.relObjectId || '') | ||
| 82 | - this.publishCommentModel.keyArticle = String(this.contentDetailData?.keyArticle || '') | ||
| 83 | - this.publishCommentModel.targetType = String(this.contentDetailData?.newsType || '') | ||
| 84 | - this.publishCommentModel.visitorComment = String(this.contentDetailData?.visitorComment || '') | 77 | + }, 50) |
| 78 | + | ||
| 79 | + let detailData = data[0] | ||
| 80 | + console.log(TAG, '查询视频详情用于评论展示 openComment:', detailData.openComment) | ||
| 81 | + this.publishCommentModel.targetId = String(detailData?.newsId || '') | ||
| 82 | + this.publishCommentModel.targetRelId = String(detailData?.reLInfo?.relId || '') | ||
| 83 | + this.publishCommentModel.targetTitle = detailData?.newsTitle | ||
| 84 | + this.publishCommentModel.targetRelType = String(detailData?.reLInfo?.relType || '') | ||
| 85 | + this.publishCommentModel.targetRelObjectId = String(detailData?.reLInfo?.relObjectId || '') | ||
| 86 | + this.publishCommentModel.keyArticle = String(detailData?.keyArticle || '') | ||
| 87 | + this.publishCommentModel.targetType = String(detailData?.newsType || '') | ||
| 88 | + this.publishCommentModel.visitorComment = String(detailData?.visitorComment || '') | ||
| 85 | this.publishCommentModel.commentContent = '' | 89 | this.publishCommentModel.commentContent = '' |
| 86 | 90 | ||
| 87 | - this.getLiveDetails() | ||
| 88 | - // } | ||
| 89 | - } | ||
| 90 | - }) | ||
| 91 | - } | 91 | + this.liveLandscape = |
| 92 | + detailData?.liveInfo?.liveLandScape //String(this.contentDetailData?.liveInfo?.liveLandScape || '') | ||
| 92 | 93 | ||
| 93 | - /** | ||
| 94 | - * 获取直播信息,可区分横竖屏直播 | ||
| 95 | - */ | ||
| 96 | - getLiveDetails() { | ||
| 97 | 94 | ||
| 98 | - this.liveViewModel.getLiveDetails(this.contentId, this.relId, this.relType) | ||
| 99 | - .then( | ||
| 100 | - (data) => { | ||
| 101 | - if (data.length > 0) { | 95 | + this.liveState = detailData.liveInfo?.liveState |
| 96 | + this.liveStyle = detailData.liveInfo?.liveStyle | ||
| 102 | 97 | ||
| 103 | - //todo 不加setTimeOut ,接口返回的数据 就没法让PlayerComponent #@Consume @Watch('updateData') liveDetailsBean 的updateData方法运行 | ||
| 104 | - setTimeout(() => { | ||
| 105 | - this.liveDetailsBean = data[0] | ||
| 106 | - }, 10) | ||
| 107 | - | ||
| 108 | - this.liveState = data[0].liveInfo?.liveState | ||
| 109 | - this.liveStyle = data[0].liveInfo.liveStyle | ||
| 110 | - | ||
| 111 | - if (data[0].fullColumnImgUrls && data[0].fullColumnImgUrls.length > 0) { | ||
| 112 | - this.imgUrl = data[0].fullColumnImgUrls[0].url | 98 | + if (detailData.fullColumnImgUrls && detailData.fullColumnImgUrls.length > 0) { |
| 99 | + this.imgUrl = detailData.fullColumnImgUrls[0].url | ||
| 113 | } | 100 | } |
| 114 | 101 | ||
| 115 | - if (data[0].liveInfo.liveState == 'end') { | ||
| 116 | - this.playUrl = data[0].liveInfo.vlive[0].replayUri | 102 | + if (detailData.liveInfo.liveState == 'end') { |
| 103 | + this.playUrl = detailData.liveInfo.vlive[0].replayUri | ||
| 117 | } | 104 | } |
| 118 | - | ||
| 119 | - // console.log(TAG, 'getLiveDetails:', JSON.stringify((this.liveDetailsBean))) | 105 | + //console.error('XXXXZZZZ', "liveLandscape =" + this.liveLandscape + ' this.liveState =' + this.liveState) |
| 120 | } | 106 | } |
| 121 | - }, | ||
| 122 | - () => { | ||
| 123 | - | ||
| 124 | }) | 107 | }) |
| 125 | } | 108 | } |
| 126 | 109 | ||
| 110 | + | ||
| 127 | onPageShow() { | 111 | onPageShow() { |
| 128 | this.pageShow = Math.random() | 112 | this.pageShow = Math.random() |
| 129 | Logger.info(TAG, 'onPageShow') | 113 | Logger.info(TAG, 'onPageShow') |
| 1 | -import { ContentDetailDTO, LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'; | 1 | +import { ContentDetailDTO, LiveRoomDataBean } from 'wdBean/Index'; |
| 2 | import { LiveViewModel } from '../viewModel/LiveViewModel'; | 2 | import { LiveViewModel } from '../viewModel/LiveViewModel'; |
| 3 | import { TabComponent } from '../widgets/details/TabComponent'; | 3 | import { TabComponent } from '../widgets/details/TabComponent'; |
| 4 | import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet'; | 4 | import { TopPlayComponent } from '../widgets/details/video/TopPlayComponet'; |
| @@ -6,12 +6,9 @@ import { DisplayDirection } from 'wdConstant/Index'; | @@ -6,12 +6,9 @@ import { DisplayDirection } from 'wdConstant/Index'; | ||
| 6 | import mediaquery from '@ohos.mediaquery'; | 6 | import mediaquery from '@ohos.mediaquery'; |
| 7 | import { Logger, WindowModel } from 'wdKit/Index'; | 7 | import { Logger, WindowModel } from 'wdKit/Index'; |
| 8 | import { router, window } from '@kit.ArkUI'; | 8 | import { router, window } from '@kit.ArkUI'; |
| 9 | -import { devicePLSensorManager } from 'wdDetailPlayApi/Index'; | ||
| 10 | -import { LiveCommentComponent } from 'wdComponent/Index'; | ||
| 11 | -import { WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index'; | 9 | +import { WDAliPlayerController } from 'wdPlayer/Index'; |
| 12 | import { OperRowListView } from 'wdComponent/src/main/ets/components/view/OperRowListView'; | 10 | import { OperRowListView } from 'wdComponent/src/main/ets/components/view/OperRowListView'; |
| 13 | import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; | 11 | import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; |
| 14 | -import { ResponseDTO } from 'wdNetwork/Index'; | ||
| 15 | 12 | ||
| 16 | let TAG: string = 'DetailPlayLivePage'; | 13 | let TAG: string = 'DetailPlayLivePage'; |
| 17 | 14 | ||
| @@ -37,7 +34,6 @@ export struct DetailPlayLivePage { | @@ -37,7 +34,6 @@ export struct DetailPlayLivePage { | ||
| 37 | @Consume @Watch('onBackPressCus') pageBackPress: number | 34 | @Consume @Watch('onBackPressCus') pageBackPress: number |
| 38 | @Consume contentDetailData: ContentDetailDTO | 35 | @Consume contentDetailData: ContentDetailDTO |
| 39 | @Consume publishCommentModel: publishCommentModel | 36 | @Consume publishCommentModel: publishCommentModel |
| 40 | - @Consume liveDetailsBean: LiveDetailsBean | ||
| 41 | 37 | ||
| 42 | aboutToAppear(): void { | 38 | aboutToAppear(): void { |
| 43 | Logger.info(TAG, `wyj-aboutToAppear`) | 39 | Logger.info(TAG, `wyj-aboutToAppear`) |
| @@ -65,11 +61,14 @@ export struct DetailPlayLivePage { | @@ -65,11 +61,14 @@ export struct DetailPlayLivePage { | ||
| 65 | 61 | ||
| 66 | build() { | 62 | build() { |
| 67 | Column() { | 63 | Column() { |
| 64 | + | ||
| 68 | TopPlayComponent({ playerController: this.playerController }) | 65 | TopPlayComponent({ playerController: this.playerController }) |
| 69 | .height(this.displayDirection == DisplayDirection.VERTICAL ?211:'100%') | 66 | .height(this.displayDirection == DisplayDirection.VERTICAL ?211:'100%') |
| 67 | + | ||
| 70 | TabComponent({ tabs: this.tabs, changeToTab: this.changeToTab }) | 68 | TabComponent({ tabs: this.tabs, changeToTab: this.changeToTab }) |
| 71 | .layoutWeight(1) | 69 | .layoutWeight(1) |
| 72 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 70 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| 71 | + | ||
| 73 | OperRowListView({ | 72 | OperRowListView({ |
| 74 | componentType: 4, | 73 | componentType: 4, |
| 75 | operationButtonList: ['comment', 'collect', 'share', 'like'], | 74 | operationButtonList: ['comment', 'collect', 'share', 'like'], |
| @@ -81,8 +80,7 @@ export struct DetailPlayLivePage { | @@ -81,8 +80,7 @@ export struct DetailPlayLivePage { | ||
| 81 | // 切换到大家聊 | 80 | // 切换到大家聊 |
| 82 | this.changeToTab = Math.random() | 81 | this.changeToTab = Math.random() |
| 83 | } | 82 | } |
| 84 | - }) | ||
| 85 | - .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 83 | + }) .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| 86 | 84 | ||
| 87 | // LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum }) | 85 | // LiveCommentComponent({ heartNum: this.liveRoomDataBean.likeNum }) |
| 88 | // .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 86 | // .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| @@ -120,7 +118,7 @@ export struct DetailPlayLivePage { | @@ -120,7 +118,7 @@ export struct DetailPlayLivePage { | ||
| 120 | } | 118 | } |
| 121 | 119 | ||
| 122 | getLiveDetails() { | 120 | getLiveDetails() { |
| 123 | - const data = this.liveDetailsBean | 121 | + const data = this.contentDetailData |
| 124 | if (data.liveInfo?.liveState == 'wait') { | 122 | if (data.liveInfo?.liveState == 'wait') { |
| 125 | //直播样式 0-正常模式 , 1-隐藏直播间,2-隐藏大家聊 【人民号发布是竖屏的,为空】 | 123 | //直播样式 0-正常模式 , 1-隐藏直播间,2-隐藏大家聊 【人民号发布是竖屏的,为空】 |
| 126 | if (data.liveInfo?.liveStyle == 1) { | 124 | if (data.liveInfo?.liveStyle == 1) { |
| 1 | -import { Action, LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index'; | 1 | +import { LiveRoomDataBean } from 'wdBean/Index'; |
| 2 | import { LiveViewModel } from '../viewModel/LiveViewModel'; | 2 | import { LiveViewModel } from '../viewModel/LiveViewModel'; |
| 3 | -import router from '@ohos.router'; | ||
| 4 | import { WindowModel } from 'wdKit/Index'; | 3 | import { WindowModel } from 'wdKit/Index'; |
| 5 | import { PlayerComponent } from '../widgets/vertical/PlayerComponent'; | 4 | import { PlayerComponent } from '../widgets/vertical/PlayerComponent'; |
| 6 | import { PlayerInfoComponent } from '../widgets/vertical/PlayerInfoComponent'; | 5 | import { PlayerInfoComponent } from '../widgets/vertical/PlayerInfoComponent'; |
| 7 | -import { WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index'; | 6 | +import { WDAliPlayerController } from 'wdPlayer/Index'; |
| 8 | import { DisplayDirection } from 'wdConstant/Index'; | 7 | import { DisplayDirection } from 'wdConstant/Index'; |
| 9 | import { LiveEmptyComponent, WDLiveViewDefaultType } from 'wdComponent/Index'; | 8 | import { LiveEmptyComponent, WDLiveViewDefaultType } from 'wdComponent/Index'; |
| 10 | import { PlayerEndView } from '../widgets/vertical/PlayerEndView'; | 9 | import { PlayerEndView } from '../widgets/vertical/PlayerEndView'; |
| @@ -33,7 +32,6 @@ export struct DetailPlayVLivePage { | @@ -33,7 +32,6 @@ export struct DetailPlayVLivePage { | ||
| 33 | @Consume @Watch('openFullScreen') pageShow: number | 32 | @Consume @Watch('openFullScreen') pageShow: number |
| 34 | @Consume @Watch('closeFullScreen') pageHide: number | 33 | @Consume @Watch('closeFullScreen') pageHide: number |
| 35 | @Consume contentId: string | 34 | @Consume contentId: string |
| 36 | - @Consume liveDetailsBean: LiveDetailsBean | ||
| 37 | @State swiperIndex: number = 1 | 35 | @State swiperIndex: number = 1 |
| 38 | 36 | ||
| 39 | aboutToAppear(): void { | 37 | aboutToAppear(): void { |
| @@ -117,5 +115,7 @@ export struct DetailPlayVLivePage { | @@ -117,5 +115,7 @@ export struct DetailPlayVLivePage { | ||
| 117 | console.error(TAG, 'getLiveDetails catch', message) | 115 | console.error(TAG, 'getLiveDetails catch', message) |
| 118 | }) | 116 | }) |
| 119 | } | 117 | } |
| 118 | + | ||
| 119 | + | ||
| 120 | } | 120 | } |
| 121 | 121 |
| 1 | import font from '@ohos.font' | 1 | import font from '@ohos.font' |
| 2 | -import { LiveDetailsBean } from 'wdBean/Index' | 2 | +import { ContentDetailDTO } from 'wdBean/Index' |
| 3 | import { DateTimeUtils, StringUtils, ToastUtils } from 'wdKit/Index' | 3 | import { DateTimeUtils, StringUtils, ToastUtils } from 'wdKit/Index' |
| 4 | import { LiveViewModel } from '../../viewModel/LiveViewModel' | 4 | import { LiveViewModel } from '../../viewModel/LiveViewModel' |
| 5 | import { HttpUtils } from 'wdNetwork/Index' | 5 | import { HttpUtils } from 'wdNetwork/Index' |
| @@ -7,7 +7,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | @@ -7,7 +7,7 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | ||
| 7 | 7 | ||
| 8 | @Component | 8 | @Component |
| 9 | export struct LiveCountdownComponent { | 9 | export struct LiveCountdownComponent { |
| 10 | - @State liveDetailsBean: LiveDetailsBean = {} as LiveDetailsBean | 10 | + @State liveDetailsBean: ContentDetailDTO = {} as ContentDetailDTO |
| 11 | textTimerController: TextTimerController = new TextTimerController() | 11 | textTimerController: TextTimerController = new TextTimerController() |
| 12 | @State format: string = 'HH:mm:ss' | 12 | @State format: string = 'HH:mm:ss' |
| 13 | @State month: string = '' | 13 | @State month: string = '' |
| @@ -141,7 +141,7 @@ export struct LiveCountdownComponent { | @@ -141,7 +141,7 @@ export struct LiveCountdownComponent { | ||
| 141 | } | 141 | } |
| 142 | //2024-04-01 19:44:00-trim->2024-04-0119:44:00 | 142 | //2024-04-01 19:44:00-trim->2024-04-0119:44:00 |
| 143 | if (StringUtils.isNotEmpty(this.liveDetailsBean.liveInfo?.planStartTime)) { | 143 | if (StringUtils.isNotEmpty(this.liveDetailsBean.liveInfo?.planStartTime)) { |
| 144 | - let playStartTimeTmp = this.liveDetailsBean.liveInfo?.planStartTime?.trim() | 144 | + let playStartTimeTmp = this.liveDetailsBean.liveInfo?.planStartTime+'' |
| 145 | this.month = Number(playStartTimeTmp.substring(5, 7)).toString() | 145 | this.month = Number(playStartTimeTmp.substring(5, 7)).toString() |
| 146 | this.day = playStartTimeTmp.substring(8, 10) | 146 | this.day = playStartTimeTmp.substring(8, 10) |
| 147 | this.hour = playStartTimeTmp.substring(11, 13) | 147 | this.hour = playStartTimeTmp.substring(11, 13) |
| @@ -152,7 +152,7 @@ export struct LiveCountdownComponent { | @@ -152,7 +152,7 @@ export struct LiveCountdownComponent { | ||
| 152 | getLiveAppointmentStatus() { | 152 | getLiveAppointmentStatus() { |
| 153 | this.liveViewModel.getLiveAppointmentStatus( | 153 | this.liveViewModel.getLiveAppointmentStatus( |
| 154 | this.liveDetailsBean.reLInfo ? this.liveDetailsBean.reLInfo.relId : '', | 154 | this.liveDetailsBean.reLInfo ? this.liveDetailsBean.reLInfo.relId : '', |
| 155 | - this.liveDetailsBean.newsId | 155 | + this.liveDetailsBean.newsId+'' |
| 156 | ).then( | 156 | ).then( |
| 157 | (data) => { | 157 | (data) => { |
| 158 | this.isAppointmentLive = data | 158 | this.isAppointmentLive = data |
| @@ -165,7 +165,7 @@ export struct LiveCountdownComponent { | @@ -165,7 +165,7 @@ export struct LiveCountdownComponent { | ||
| 165 | liveAppointment() { | 165 | liveAppointment() { |
| 166 | this.liveViewModel.liveAppointment( | 166 | this.liveViewModel.liveAppointment( |
| 167 | this.liveDetailsBean.reLInfo ? this.liveDetailsBean.reLInfo.relId : '', | 167 | this.liveDetailsBean.reLInfo ? this.liveDetailsBean.reLInfo.relId : '', |
| 168 | - this.liveDetailsBean.newsId, | 168 | + this.liveDetailsBean.newsId+'', |
| 169 | !this.isAppointmentLive).then( | 169 | !this.isAppointmentLive).then( |
| 170 | (data) => { | 170 | (data) => { |
| 171 | if (data.success) { | 171 | if (data.success) { |
| 1 | -import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index' | 1 | +import { ContentDetailDTO, LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index' |
| 2 | import { EmptyComponent, ErrorComponent, WDViewDefaultType } from 'wdComponent/Index' | 2 | import { EmptyComponent, ErrorComponent, WDViewDefaultType } from 'wdComponent/Index' |
| 3 | import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout' | 3 | import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout' |
| 4 | import RefreshLayout from 'wdComponent/src/main/ets/components/page/RefreshLayout' | 4 | import RefreshLayout from 'wdComponent/src/main/ets/components/page/RefreshLayout' |
| @@ -17,7 +17,7 @@ export struct TabChatComponent { | @@ -17,7 +17,7 @@ export struct TabChatComponent { | ||
| 17 | @State private pageModel: PageModel = new PageModel() | 17 | @State private pageModel: PageModel = new PageModel() |
| 18 | liveViewModel: LiveViewModel = new LiveViewModel() | 18 | liveViewModel: LiveViewModel = new LiveViewModel() |
| 19 | @State liveChatList: Array<LiveRoomItemBean> = [] | 19 | @State liveChatList: Array<LiveRoomItemBean> = [] |
| 20 | - @Consume liveDetailsBean: LiveDetailsBean | 20 | + @Consume contentDetailData: ContentDetailDTO |
| 21 | @Consume publishCommentModel: publishCommentModel | 21 | @Consume publishCommentModel: publishCommentModel |
| 22 | 22 | ||
| 23 | aboutToAppear(): void { | 23 | aboutToAppear(): void { |
| @@ -102,8 +102,8 @@ export struct TabChatComponent { | @@ -102,8 +102,8 @@ export struct TabChatComponent { | ||
| 102 | this.pageModel.currentPage = 1 | 102 | this.pageModel.currentPage = 1 |
| 103 | this.liveViewModel.getLiveChatList( | 103 | this.liveViewModel.getLiveChatList( |
| 104 | this.pageModel.currentPage, | 104 | this.pageModel.currentPage, |
| 105 | - this.liveDetailsBean?.liveInfo?.mlive?.mliveId, | ||
| 106 | - this.liveDetailsBean?.newsId, | 105 | + this.contentDetailData?.liveInfo?.mlive?.mliveId, |
| 106 | + String( this.contentDetailData.newsId), | ||
| 107 | 20,) | 107 | 20,) |
| 108 | .then( | 108 | .then( |
| 109 | (data) => { | 109 | (data) => { |
| 1 | -import { LiveDetailsBean } from 'wdBean/Index' | 1 | +import { ContentDetailDTO, LiveDetailsBean } from 'wdBean/Index' |
| 2 | import { LiveCountdownComponent } from './LiveCountdownComponent' | 2 | import { LiveCountdownComponent } from './LiveCountdownComponent' |
| 3 | 3 | ||
| 4 | @Component | 4 | @Component |
| 5 | export struct TabInfoComponent { | 5 | export struct TabInfoComponent { |
| 6 | - @Consume liveDetailsBean: LiveDetailsBean | ||
| 7 | - | 6 | + @Consume contentDetailData: ContentDetailDTO |
| 8 | aboutToAppear(): void { | 7 | aboutToAppear(): void { |
| 9 | } | 8 | } |
| 10 | 9 | ||
| @@ -12,7 +11,7 @@ export struct TabInfoComponent { | @@ -12,7 +11,7 @@ export struct TabInfoComponent { | ||
| 12 | Column() { | 11 | Column() { |
| 13 | this.showLiveTitle() | 12 | this.showLiveTitle() |
| 14 | this.showLiveDetails() | 13 | this.showLiveDetails() |
| 15 | - LiveCountdownComponent({liveDetailsBean:this.liveDetailsBean}) | 14 | + LiveCountdownComponent({liveDetailsBean:this.contentDetailData}) |
| 16 | }.margin({ | 15 | }.margin({ |
| 17 | top: 13, | 16 | top: 13, |
| 18 | left: 16, | 17 | left: 16, |
| @@ -27,7 +26,7 @@ export struct TabInfoComponent { | @@ -27,7 +26,7 @@ export struct TabInfoComponent { | ||
| 27 | 26 | ||
| 28 | @Builder | 27 | @Builder |
| 29 | showLiveTitle() { | 28 | showLiveTitle() { |
| 30 | - Text(this.liveDetailsBean.newsTitle) | 29 | + Text(this.contentDetailData.newsTitle) |
| 31 | .maxLines(2) | 30 | .maxLines(2) |
| 32 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 31 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 33 | .fontSize('18vp') | 32 | .fontSize('18vp') |
| @@ -38,7 +37,7 @@ export struct TabInfoComponent { | @@ -38,7 +37,7 @@ export struct TabInfoComponent { | ||
| 38 | 37 | ||
| 39 | @Builder | 38 | @Builder |
| 40 | showLiveDetails() { | 39 | showLiveDetails() { |
| 41 | - Text(this.liveDetailsBean.newIntroduction) | 40 | + Text(this.contentDetailData.newIntroduction) |
| 42 | .maxLines(5) | 41 | .maxLines(5) |
| 43 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 42 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 44 | .fontSize('14vp') | 43 | .fontSize('14vp') |
| 1 | -import { LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index' | 1 | +import { ContentDetailDTO, LiveDetailsBean, LiveRoomItemBean } from 'wdBean/Index' |
| 2 | import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI, WDViewDefaultType } from 'wdComponent/Index' | 2 | import { EmptyComponent, ErrorComponent, ListHasNoMoreDataUI, WDViewDefaultType } from 'wdComponent/Index' |
| 3 | import { TabLiveItemComponent } from './TabLiveItemComponent' | 3 | import { TabLiveItemComponent } from './TabLiveItemComponent' |
| 4 | import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout' | 4 | import CustomRefreshLoadLayout from 'wdComponent/src/main/ets/components/page/CustomRefreshLoadLayout' |
| @@ -12,12 +12,14 @@ import { Logger } from 'wdKit' | @@ -12,12 +12,14 @@ import { Logger } from 'wdKit' | ||
| 12 | 12 | ||
| 13 | const TAG: string = 'TabLiveComponent'; | 13 | const TAG: string = 'TabLiveComponent'; |
| 14 | 14 | ||
| 15 | - | 15 | +/** |
| 16 | + * 非沉浸式直播间组件 | ||
| 17 | + */ | ||
| 16 | @Component | 18 | @Component |
| 17 | export struct TabLiveComponent { | 19 | export struct TabLiveComponent { |
| 18 | liveViewModel: LiveViewModel = new LiveViewModel() | 20 | liveViewModel: LiveViewModel = new LiveViewModel() |
| 19 | @State liveList: Array<LiveRoomItemBean> = [] | 21 | @State liveList: Array<LiveRoomItemBean> = [] |
| 20 | - @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean | 22 | + @Consume @Watch('updateData') contentDetailData: ContentDetailDTO |
| 21 | @State private pageModel: PageModel = new PageModel() | 23 | @State private pageModel: PageModel = new PageModel() |
| 22 | 24 | ||
| 23 | aboutToAppear(): void { | 25 | aboutToAppear(): void { |
| @@ -81,15 +83,15 @@ export struct TabLiveComponent { | @@ -81,15 +83,15 @@ export struct TabLiveComponent { | ||
| 81 | } | 83 | } |
| 82 | 84 | ||
| 83 | getLiveList() { | 85 | getLiveList() { |
| 84 | - if (!this.liveDetailsBean || !this.liveDetailsBean.newsId) { | 86 | + if (!this.contentDetailData || !this.contentDetailData.newsId) { |
| 85 | // 参数不够,直接拦截接口 | 87 | // 参数不够,直接拦截接口 |
| 86 | return | 88 | return |
| 87 | } | 89 | } |
| 88 | this.pageModel.currentPage = 1 | 90 | this.pageModel.currentPage = 1 |
| 89 | this.liveViewModel.getLiveList( | 91 | this.liveViewModel.getLiveList( |
| 90 | this.pageModel.currentPage, | 92 | this.pageModel.currentPage, |
| 91 | - this.liveDetailsBean?.liveInfo?.mlive?.mliveId, | ||
| 92 | - this.liveDetailsBean?.newsId, | 93 | + this.contentDetailData?.liveInfo?.mlive?.mliveId, |
| 94 | + this.contentDetailData?.newsId+'', | ||
| 93 | 20) | 95 | 20) |
| 94 | .then( | 96 | .then( |
| 95 | (data) => { | 97 | (data) => { |
| @@ -110,16 +112,16 @@ export struct TabLiveComponent { | @@ -110,16 +112,16 @@ export struct TabLiveComponent { | ||
| 110 | this.pageModel.hasMore = true; | 112 | this.pageModel.hasMore = true; |
| 111 | } else { | 113 | } else { |
| 112 | this.pageModel.hasMore = false; | 114 | this.pageModel.hasMore = false; |
| 113 | - if (StringUtils.isEmpty(this.liveDetailsBean.oldNewsId) | ||
| 114 | - && this.liveDetailsBean | ||
| 115 | - && this.liveDetailsBean.liveInfo.liveState != 'wait') { | 115 | + if (StringUtils.isEmpty(this.contentDetailData.oldNewsId) |
| 116 | + && this.contentDetailData | ||
| 117 | + && this.contentDetailData.liveInfo.liveState != 'wait') { | ||
| 116 | this.updateLiveListData() | 118 | this.updateLiveListData() |
| 117 | } | 119 | } |
| 118 | } | 120 | } |
| 119 | } else { | 121 | } else { |
| 120 | - if (StringUtils.isEmpty(this.liveDetailsBean.oldNewsId) | ||
| 121 | - && this.liveDetailsBean | ||
| 122 | - && this.liveDetailsBean.liveInfo.liveState != 'wait') { | 122 | + if (StringUtils.isEmpty(this.contentDetailData.oldNewsId) |
| 123 | + && this.contentDetailData | ||
| 124 | + && this.contentDetailData.liveInfo.liveState != 'wait') { | ||
| 123 | this.pageModel.viewType = ViewType.LOADED; | 125 | this.pageModel.viewType = ViewType.LOADED; |
| 124 | this.updateLiveListData() | 126 | this.updateLiveListData() |
| 125 | } else { | 127 | } else { |
| @@ -136,12 +138,12 @@ export struct TabLiveComponent { | @@ -136,12 +138,12 @@ export struct TabLiveComponent { | ||
| 136 | 138 | ||
| 137 | updateLiveListData() { | 139 | updateLiveListData() { |
| 138 | let liveRoomItemBeanTemp: LiveRoomItemBean = {} as LiveRoomItemBean | 140 | let liveRoomItemBeanTemp: LiveRoomItemBean = {} as LiveRoomItemBean |
| 139 | - liveRoomItemBeanTemp.text = this.liveDetailsBean.newIntroduction | 141 | + liveRoomItemBeanTemp.text = this.contentDetailData.newIntroduction |
| 140 | liveRoomItemBeanTemp.senderUserName = '人民日报主持人' | 142 | liveRoomItemBeanTemp.senderUserName = '人民日报主持人' |
| 141 | liveRoomItemBeanTemp.pictureUrls = [] | 143 | liveRoomItemBeanTemp.pictureUrls = [] |
| 142 | - liveRoomItemBeanTemp.pictureUrls.push(this.liveDetailsBean?.fullColumnImgUrls[0]?.url) | 144 | + liveRoomItemBeanTemp.pictureUrls.push(this.contentDetailData?.fullColumnImgUrls[0]?.url) |
| 143 | liveRoomItemBeanTemp.dataType = 'ZH_TEXT_AND_IMAGE_MSG' | 145 | liveRoomItemBeanTemp.dataType = 'ZH_TEXT_AND_IMAGE_MSG' |
| 144 | - let temp = this.liveDetailsBean?.fullColumnImgUrls[0] | 146 | + let temp = this.contentDetailData?.fullColumnImgUrls[0] |
| 145 | if (temp) { | 147 | if (temp) { |
| 146 | liveRoomItemBeanTemp.pictureResolutions = [] | 148 | liveRoomItemBeanTemp.pictureResolutions = [] |
| 147 | liveRoomItemBeanTemp.pictureResolutions.push(`${temp.height}*${temp.weight}`) | 149 | liveRoomItemBeanTemp.pictureResolutions.push(`${temp.height}*${temp.weight}`) |
| @@ -3,7 +3,7 @@ import lottie from '@ohos/lottie'; | @@ -3,7 +3,7 @@ import lottie from '@ohos/lottie'; | ||
| 3 | 3 | ||
| 4 | import { NumberFormatterUtils, StringUtils, WindowModel } from 'wdKit/Index' | 4 | import { NumberFormatterUtils, StringUtils, WindowModel } from 'wdKit/Index' |
| 5 | import { DateFormatUtil, WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index' | 5 | import { DateFormatUtil, WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index' |
| 6 | -import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index' | 6 | +import { ContentDetailDTO, LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index' |
| 7 | import { DisplayDirection } from 'wdConstant/Index' | 7 | import { DisplayDirection } from 'wdConstant/Index' |
| 8 | import { LiveFollowComponent, LottieView } from 'wdComponent/Index' | 8 | import { LiveFollowComponent, LottieView } from 'wdComponent/Index' |
| 9 | 9 | ||
| @@ -12,7 +12,8 @@ export struct PlayUIComponent { | @@ -12,7 +12,8 @@ export struct PlayUIComponent { | ||
| 12 | playerController?: WDAliPlayerController; | 12 | playerController?: WDAliPlayerController; |
| 13 | //菜单键是否可见 | 13 | //菜单键是否可见 |
| 14 | @State @Watch('onChangeMenuVisible') isMenuVisible: boolean = true | 14 | @State @Watch('onChangeMenuVisible') isMenuVisible: boolean = true |
| 15 | - @Consume liveDetailsBean: LiveDetailsBean | 15 | +// @Consume liveDetailsBean: LiveDetailsBean |
| 16 | + @Consume contentDetailData: ContentDetailDTO | ||
| 16 | @Consume liveRoomDataBean: LiveRoomDataBean | 17 | @Consume liveRoomDataBean: LiveRoomDataBean |
| 17 | @State currentTime: string = '' | 18 | @State currentTime: string = '' |
| 18 | @State totalTime: string = '' | 19 | @State totalTime: string = '' |
| @@ -24,8 +25,8 @@ export struct PlayUIComponent { | @@ -24,8 +25,8 @@ export struct PlayUIComponent { | ||
| 24 | @Prop isShowBottom: boolean | 25 | @Prop isShowBottom: boolean |
| 25 | 26 | ||
| 26 | onChangeMenuVisible() { | 27 | onChangeMenuVisible() { |
| 27 | - if (!this.liveDetailsBean || !this.liveDetailsBean.liveInfo || | ||
| 28 | - this.liveDetailsBean?.liveInfo?.liveState === 'wait') { | 28 | + if (!this.contentDetailData || !this.contentDetailData.liveInfo || |
| 29 | + this.contentDetailData?.liveInfo?.liveState === 'wait') { | ||
| 29 | return | 30 | return |
| 30 | } | 31 | } |
| 31 | let time: number = 0 | 32 | let time: number = 0 |
| @@ -51,14 +52,14 @@ export struct PlayUIComponent { | @@ -51,14 +52,14 @@ export struct PlayUIComponent { | ||
| 51 | } | 52 | } |
| 52 | 53 | ||
| 53 | aboutToDisappear(): void { | 54 | aboutToDisappear(): void { |
| 54 | - if (this.liveDetailsBean.liveInfo?.liveState == 'running') { | 55 | + if (this.contentDetailData.liveInfo?.liveState == 'running') { |
| 55 | lottie.destroy('live_status_wait') | 56 | lottie.destroy('live_status_wait') |
| 56 | } | 57 | } |
| 57 | } | 58 | } |
| 58 | 59 | ||
| 59 | build() { | 60 | build() { |
| 60 | Column() { | 61 | Column() { |
| 61 | - if (this.liveDetailsBean && this.liveDetailsBean.liveInfo) { | 62 | + if (this.contentDetailData && this.contentDetailData.liveInfo) { |
| 62 | this.getTopUIComponent() | 63 | this.getTopUIComponent() |
| 63 | this.getMiddleUIComponent() | 64 | this.getMiddleUIComponent() |
| 64 | if(this.isShowBottom){ | 65 | if(this.isShowBottom){ |
| @@ -92,8 +93,8 @@ export struct PlayUIComponent { | @@ -92,8 +93,8 @@ export struct PlayUIComponent { | ||
| 92 | // window.Orientation.PORTRAIT : | 93 | // window.Orientation.PORTRAIT : |
| 93 | // window.Orientation.LANDSCAPE); | 94 | // window.Orientation.LANDSCAPE); |
| 94 | }) | 95 | }) |
| 95 | - if (this.liveDetailsBean.liveInfo?.liveState != 'wait') { | ||
| 96 | - Text(this.liveDetailsBean.newsTitle) | 96 | + if (this.contentDetailData.liveInfo?.liveState != 'wait') { |
| 97 | + Text(this.contentDetailData.newsTitle) | ||
| 97 | .maxLines(1) | 98 | .maxLines(1) |
| 98 | .textOverflow({ overflow: TextOverflow.MARQUEE }) | 99 | .textOverflow({ overflow: TextOverflow.MARQUEE }) |
| 99 | .fontSize(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? '18vp' : '16vp') | 100 | .fontSize(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? '18vp' : '16vp') |
| @@ -116,9 +117,9 @@ export struct PlayUIComponent { | @@ -116,9 +117,9 @@ export struct PlayUIComponent { | ||
| 116 | }) | 117 | }) |
| 117 | 118 | ||
| 118 | Row() { | 119 | Row() { |
| 119 | - if (this.liveDetailsBean?.rmhInfo) { | 120 | + if (this.contentDetailData?.rmhInfo) { |
| 120 | LiveFollowComponent({ | 121 | LiveFollowComponent({ |
| 121 | - rmhInfo: this.liveDetailsBean.rmhInfo | 122 | + rmhInfo: this.contentDetailData.rmhInfo |
| 122 | }) | 123 | }) |
| 123 | .margin({ | 124 | .margin({ |
| 124 | right: 10 | 125 | right: 10 |
| @@ -144,7 +145,7 @@ export struct PlayUIComponent { | @@ -144,7 +145,7 @@ export struct PlayUIComponent { | ||
| 144 | getLiveStatusView() { | 145 | getLiveStatusView() { |
| 145 | // 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 | 146 | // 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 |
| 146 | // 预约 | 147 | // 预约 |
| 147 | - if (this.liveDetailsBean.liveInfo?.liveState == 'wait') { | 148 | + if (this.contentDetailData.liveInfo?.liveState == 'wait') { |
| 148 | Row() { | 149 | Row() { |
| 149 | 150 | ||
| 150 | Image($r('app.media.icon_live_status_wait')) | 151 | Image($r('app.media.icon_live_status_wait')) |
| @@ -163,7 +164,7 @@ export struct PlayUIComponent { | @@ -163,7 +164,7 @@ export struct PlayUIComponent { | ||
| 163 | }) | 164 | }) |
| 164 | } | 165 | } |
| 165 | // 直播中 | 166 | // 直播中 |
| 166 | - else if (this.liveDetailsBean.liveInfo?.liveState == 'running') { | 167 | + else if (this.contentDetailData.liveInfo?.liveState == 'running') { |
| 167 | Row() { | 168 | Row() { |
| 168 | Stack() { | 169 | Stack() { |
| 169 | Image($r('app.media.icon_live_status_running_back')) | 170 | Image($r('app.media.icon_live_status_running_back')) |
| @@ -204,7 +205,7 @@ export struct PlayUIComponent { | @@ -204,7 +205,7 @@ export struct PlayUIComponent { | ||
| 204 | }) | 205 | }) |
| 205 | } | 206 | } |
| 206 | //回看 | 207 | //回看 |
| 207 | - else if (this.liveDetailsBean.liveInfo?.liveState == 'end') { | 208 | + else if (this.contentDetailData.liveInfo?.liveState == 'end') { |
| 208 | Row() { | 209 | Row() { |
| 209 | Text('回看') | 210 | Text('回看') |
| 210 | .fontSize('11vp') | 211 | .fontSize('11vp') |
| @@ -240,7 +241,7 @@ export struct PlayUIComponent { | @@ -240,7 +241,7 @@ export struct PlayUIComponent { | ||
| 240 | .layoutWeight(1) | 241 | .layoutWeight(1) |
| 241 | .width('100%') | 242 | .width('100%') |
| 242 | .onClick(() => { | 243 | .onClick(() => { |
| 243 | - if (this.liveDetailsBean?.liveInfo?.liveState === 'wait') { | 244 | + if (this.contentDetailData?.liveInfo?.liveState === 'wait') { |
| 244 | return | 245 | return |
| 245 | } | 246 | } |
| 246 | this.isMenuVisible = !this.isMenuVisible | 247 | this.isMenuVisible = !this.isMenuVisible |
| @@ -250,13 +251,13 @@ export struct PlayUIComponent { | @@ -250,13 +251,13 @@ export struct PlayUIComponent { | ||
| 250 | @Builder | 251 | @Builder |
| 251 | getBottomUIComponent() { | 252 | getBottomUIComponent() { |
| 252 | Row() { | 253 | Row() { |
| 253 | - if (this.liveDetailsBean?.liveInfo?.liveState == 'wait') { | 254 | + if (this.contentDetailData?.liveInfo?.liveState == 'wait') { |
| 254 | Blank() | 255 | Blank() |
| 255 | - } else if (this.liveDetailsBean?.liveInfo?.liveState == 'running') { | 256 | + } else if (this.contentDetailData?.liveInfo?.liveState == 'running') { |
| 256 | this.playOrPauseBtn() | 257 | this.playOrPauseBtn() |
| 257 | Blank() | 258 | Blank() |
| 258 | - } else if (this.liveDetailsBean?.liveInfo?.liveState == 'end') { | ||
| 259 | - if (StringUtils.isEmpty(this.liveDetailsBean?.liveInfo?.vlive[0]?.replayUri)) { | 259 | + } else if (this.contentDetailData?.liveInfo?.liveState == 'end') { |
| 260 | + if (StringUtils.isEmpty(this.contentDetailData?.liveInfo?.vlive[0]?.replayUri)) { | ||
| 260 | Blank() | 261 | Blank() |
| 261 | } else { | 262 | } else { |
| 262 | this.playOrPauseBtn() | 263 | this.playOrPauseBtn() |
| @@ -277,9 +278,9 @@ export struct PlayUIComponent { | @@ -277,9 +278,9 @@ export struct PlayUIComponent { | ||
| 277 | }) | 278 | }) |
| 278 | } | 279 | } |
| 279 | } | 280 | } |
| 280 | - if (this.liveDetailsBean?.liveInfo?.liveState == 'running' | ||
| 281 | - || (this.liveDetailsBean?.liveInfo?.liveState == 'end' && | ||
| 282 | - StringUtils.isNotEmpty(this.liveDetailsBean?.liveInfo?.vlive[0]?.replayUri)) | 281 | + if (this.contentDetailData?.liveInfo?.liveState == 'running' |
| 282 | + || (this.contentDetailData?.liveInfo?.liveState == 'end' && | ||
| 283 | + StringUtils.isNotEmpty(this.contentDetailData?.liveInfo?.vlive[0]?.replayUri)) | ||
| 283 | ) { | 284 | ) { |
| 284 | Image($r('app.media.icon_live_player_full_screen')) | 285 | Image($r('app.media.icon_live_player_full_screen')) |
| 285 | .width(24) | 286 | .width(24) |
| 1 | -import { LiveDetailsBean } from 'wdBean/Index'; | 1 | +import { ContentDetailDTO, LiveDetailsBean } from 'wdBean/Index'; |
| 2 | import { Logger, StringUtils } from 'wdKit/Index'; | 2 | import { Logger, StringUtils } from 'wdKit/Index'; |
| 3 | import { PlayerConstants, WDAliPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index'; | 3 | import { PlayerConstants, WDAliPlayerController, WDPlayerRenderLiveView } from 'wdPlayer/Index'; |
| 4 | import { PlayUIComponent } from './PlayUIComponent'; | 4 | import { PlayUIComponent } from './PlayUIComponent'; |
| @@ -6,10 +6,12 @@ import { PictureLoading } from '../../vertical/PictureLoading'; | @@ -6,10 +6,12 @@ import { PictureLoading } from '../../vertical/PictureLoading'; | ||
| 6 | 6 | ||
| 7 | const TAG: string = 'TopPlayComponent' | 7 | const TAG: string = 'TopPlayComponent' |
| 8 | 8 | ||
| 9 | - | 9 | +/** |
| 10 | + * 非沉浸式直播 --- 顶部播放器组件 | ||
| 11 | + */ | ||
| 10 | @Component | 12 | @Component |
| 11 | export struct TopPlayComponent { | 13 | export struct TopPlayComponent { |
| 12 | - @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean | 14 | + @Consume @Watch('updateData') contentDetailData: ContentDetailDTO |
| 13 | playerController?: WDAliPlayerController | 15 | playerController?: WDAliPlayerController |
| 14 | @State imgUrl: string = '' | 16 | @State imgUrl: string = '' |
| 15 | //未开始 | 17 | //未开始 |
| @@ -55,26 +57,26 @@ export struct TopPlayComponent { | @@ -55,26 +57,26 @@ export struct TopPlayComponent { | ||
| 55 | 57 | ||
| 56 | updateData() { | 58 | updateData() { |
| 57 | //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 | 59 | //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 |
| 58 | - if (this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.previewUrl && | ||
| 59 | - this.liveDetailsBean.liveInfo.previewUrl.length > 0) { | ||
| 60 | - this.imgUrl = this.liveDetailsBean.liveInfo.previewUrl | 60 | + if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewUrl && |
| 61 | + this.contentDetailData.liveInfo.previewUrl.length > 0) { | ||
| 62 | + this.imgUrl = this.contentDetailData.liveInfo.previewUrl | ||
| 61 | Logger.debug(TAG, 'ok+' + `${this.imgUrl}`) | 63 | Logger.debug(TAG, 'ok+' + `${this.imgUrl}`) |
| 62 | - } else if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) { | ||
| 63 | - this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url | 64 | + } else if (this.contentDetailData.fullColumnImgUrls && this.contentDetailData.fullColumnImgUrls.length > 0) { |
| 65 | + this.imgUrl = this.contentDetailData.fullColumnImgUrls[0].url | ||
| 64 | Logger.debug(TAG, 'ok-' + `${this.imgUrl}`) | 66 | Logger.debug(TAG, 'ok-' + `${this.imgUrl}`) |
| 65 | } | 67 | } |
| 66 | - this.isWait = this.liveDetailsBean?.liveInfo?.liveState == 'wait' | 68 | + this.isWait = this.contentDetailData?.liveInfo?.liveState == 'wait' |
| 67 | if(this.isWait ){ | 69 | if(this.isWait ){ |
| 68 | this.isLoading = true | 70 | this.isLoading = true |
| 69 | } | 71 | } |
| 70 | - this.isEnd = this.liveDetailsBean?.liveInfo?.liveState === 'end' && | ||
| 71 | - StringUtils.isEmpty(this.liveDetailsBean?.liveInfo?.vlive[0]?.replayUri) | ||
| 72 | - if (!this.isWait && this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.vlive.length > 0) { | 72 | + this.isEnd = this.contentDetailData?.liveInfo?.liveState === 'end' && |
| 73 | + StringUtils.isEmpty(this.contentDetailData?.liveInfo?.vlive[0]?.replayUri) | ||
| 74 | + if (!this.isWait && this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.vlive.length > 0) { | ||
| 73 | let playUrl = '' | 75 | let playUrl = '' |
| 74 | - if (this.liveDetailsBean.liveInfo.liveState == 'running') { | ||
| 75 | - playUrl = this.liveDetailsBean.liveInfo.vlive[0].liveUrl | ||
| 76 | - } else if (this.liveDetailsBean.liveInfo.liveState == 'end') { | ||
| 77 | - playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri | 76 | + if (this.contentDetailData.liveInfo.liveState == 'running') { |
| 77 | + playUrl = this.contentDetailData.liveInfo.vlive[0].liveUrl | ||
| 78 | + } else if (this.contentDetailData.liveInfo.liveState == 'end') { | ||
| 79 | + playUrl = this.contentDetailData.liveInfo.vlive[0].replayUri | ||
| 78 | } | 80 | } |
| 79 | // this.playerController?.firstPlay('https://rmrbcmsonline.peopleapp.com/upload/rmh/video/mp4/202404/1713752415708fb81d0b8f137b.mp4'); | 81 | // this.playerController?.firstPlay('https://rmrbcmsonline.peopleapp.com/upload/rmh/video/mp4/202404/1713752415708fb81d0b8f137b.mp4'); |
| 80 | if (StringUtils.isNotEmpty(playUrl)) { | 82 | if (StringUtils.isNotEmpty(playUrl)) { |
| 1 | -import { LiveDetailsBean } from 'wdBean/Index' | 1 | +import { ContentDetailDTO } from 'wdBean/Index' |
| 2 | 2 | ||
| 3 | @Component | 3 | @Component |
| 4 | export struct ChartItemCompereComponent { | 4 | export struct ChartItemCompereComponent { |
| 5 | - @Consume liveDetailsBean: LiveDetailsBean | ||
| 6 | - | 5 | + // @Consume liveDetailsBean: LiveDetailsBean |
| 6 | + @Consume contentDetailData: ContentDetailDTO | ||
| 7 | aboutToAppear(): void { | 7 | aboutToAppear(): void { |
| 8 | } | 8 | } |
| 9 | 9 | ||
| @@ -32,7 +32,7 @@ export struct ChartItemCompereComponent { | @@ -32,7 +32,7 @@ export struct ChartItemCompereComponent { | ||
| 32 | .margin({ bottom: 8 }) | 32 | .margin({ bottom: 8 }) |
| 33 | .justifyContent(FlexAlign.Start) | 33 | .justifyContent(FlexAlign.Start) |
| 34 | 34 | ||
| 35 | - Text(this.liveDetailsBean.newIntroduction).lineHeight(22).fontColor('#FFFFFFFF').fontSize(14) | 35 | + Text(this.contentDetailData.newIntroduction).lineHeight(22).fontColor('#FFFFFFFF').fontSize(14) |
| 36 | } | 36 | } |
| 37 | .backgroundColor('#4D000000') | 37 | .backgroundColor('#4D000000') |
| 38 | .borderRadius(3) | 38 | .borderRadius(3) |
| @@ -17,12 +17,11 @@ const TAG = "PlayerCommentComponent" | @@ -17,12 +17,11 @@ const TAG = "PlayerCommentComponent" | ||
| 17 | @Component | 17 | @Component |
| 18 | export struct PlayerCommentComponent { | 18 | export struct PlayerCommentComponent { |
| 19 | liveViewModel: LiveViewModel = new LiveViewModel() | 19 | liveViewModel: LiveViewModel = new LiveViewModel() |
| 20 | - @Consume @Watch('liveDetailsBeanChange') liveDetailsBean: LiveDetailsBean | ||
| 21 | @Consume liveRoomDataBean: LiveRoomDataBean | 20 | @Consume liveRoomDataBean: LiveRoomDataBean |
| 22 | @Consume displayDirection: DisplayDirection | 21 | @Consume displayDirection: DisplayDirection |
| 23 | @State private pageModel: PageModel = new PageModel() | 22 | @State private pageModel: PageModel = new PageModel() |
| 24 | @State liveChatList: Array<LiveRoomItemBean> = [] | 23 | @State liveChatList: Array<LiveRoomItemBean> = [] |
| 25 | - @Consume contentDetailData: ContentDetailDTO | 24 | + @Consume @Watch('liveDetailsBeanChange') contentDetailData: ContentDetailDTO |
| 26 | @Consume publishCommentModel: publishCommentModel | 25 | @Consume publishCommentModel: publishCommentModel |
| 27 | scroller: Scroller = new Scroller() | 26 | scroller: Scroller = new Scroller() |
| 28 | 27 | ||
| @@ -65,8 +64,8 @@ export struct PlayerCommentComponent { | @@ -65,8 +64,8 @@ export struct PlayerCommentComponent { | ||
| 65 | this.pageModel.currentPage = 1 | 64 | this.pageModel.currentPage = 1 |
| 66 | this.liveViewModel.getLiveChatList( | 65 | this.liveViewModel.getLiveChatList( |
| 67 | 1, | 66 | 1, |
| 68 | - this.liveDetailsBean?.liveInfo?.mlive?.mliveId, | ||
| 69 | - this.liveDetailsBean?.newsId, | 67 | + this.contentDetailData?.liveInfo?.mlive?.mliveId, |
| 68 | + this.contentDetailData?.newsId+'', | ||
| 70 | 20,) | 69 | 20,) |
| 71 | .then( | 70 | .then( |
| 72 | (data) => { | 71 | (data) => { |
| @@ -98,7 +97,7 @@ export struct PlayerCommentComponent { | @@ -98,7 +97,7 @@ export struct PlayerCommentComponent { | ||
| 98 | Column() { | 97 | Column() { |
| 99 | List({ scroller: this.scroller }) { | 98 | List({ scroller: this.scroller }) { |
| 100 | // 主持人 | 99 | // 主持人 |
| 101 | - if (this.liveDetailsBean.oldNewsId) { | 100 | + if (this.contentDetailData.oldNewsId) { |
| 102 | ChartItemCompereComponent() | 101 | ChartItemCompereComponent() |
| 103 | } | 102 | } |
| 104 | ForEach(this.liveChatList, (item: LiveRoomItemBean) => { | 103 | ForEach(this.liveChatList, (item: LiveRoomItemBean) => { |
| 1 | -import { LiveDetailsBean } from 'wdBean/Index'; | ||
| 2 | -import { WDPlayerController, WDPlayerRenderVLiveView, WDPlayerRenderView, WDAliPlayerController, | ||
| 3 | - AliPlayerRenderView } from 'wdPlayer/Index'; | 1 | +import { ContentDetailDTO } from 'wdBean/Index'; |
| 2 | +import { AliPlayerRenderView, WDAliPlayerController, WDPlayerRenderVLiveView } from 'wdPlayer/Index'; | ||
| 4 | import { PictureLoading } from './PictureLoading'; | 3 | import { PictureLoading } from './PictureLoading'; |
| 5 | 4 | ||
| 6 | const TAG = 'PlayerComponent' | 5 | const TAG = 'PlayerComponent' |
| @@ -8,7 +7,7 @@ const TAG = 'PlayerComponent' | @@ -8,7 +7,7 @@ const TAG = 'PlayerComponent' | ||
| 8 | @Component | 7 | @Component |
| 9 | export struct PlayerComponent { | 8 | export struct PlayerComponent { |
| 10 | @Prop playerController: WDAliPlayerController; | 9 | @Prop playerController: WDAliPlayerController; |
| 11 | - @Consume @Watch('updateData') liveDetailsBean: LiveDetailsBean | 10 | + @Consume @Watch('updateData') contentDetailData: ContentDetailDTO |
| 12 | @Consume @Watch('pageShowChange') pageShow: number | 11 | @Consume @Watch('pageShowChange') pageShow: number |
| 13 | @Consume @Watch('pageHideChange') pageHide: number | 12 | @Consume @Watch('pageHideChange') pageHide: number |
| 14 | @Consume isShowControl: boolean | 13 | @Consume isShowControl: boolean |
| @@ -21,7 +20,6 @@ export struct PlayerComponent { | @@ -21,7 +20,6 @@ export struct PlayerComponent { | ||
| 21 | @State playUrl: string = '' | 20 | @State playUrl: string = '' |
| 22 | @State isCanplay: boolean = false | 21 | @State isCanplay: boolean = false |
| 23 | 22 | ||
| 24 | - | ||
| 25 | pageShowChange() { | 23 | pageShowChange() { |
| 26 | this.playerController?.play() | 24 | this.playerController?.play() |
| 27 | } | 25 | } |
| @@ -42,19 +40,19 @@ export struct PlayerComponent { | @@ -42,19 +40,19 @@ export struct PlayerComponent { | ||
| 42 | 40 | ||
| 43 | updateData() { | 41 | updateData() { |
| 44 | //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 | 42 | //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 |
| 45 | - if (this.liveDetailsBean.fullColumnImgUrls && this.liveDetailsBean.fullColumnImgUrls.length > 0) { | ||
| 46 | - this.imgUrl = this.liveDetailsBean.fullColumnImgUrls[0].url | 43 | + if (this.contentDetailData.fullColumnImgUrls && this.contentDetailData.fullColumnImgUrls.length > 0) { |
| 44 | + this.imgUrl = this.contentDetailData.fullColumnImgUrls[0].url | ||
| 47 | } | 45 | } |
| 48 | - this.isWait = this.liveDetailsBean?.liveInfo?.liveState == 'wait' | ||
| 49 | - if (this.liveDetailsBean.liveInfo && this.liveDetailsBean.liveInfo.vlive.length > 0) { | 46 | + this.isWait = this.contentDetailData?.liveInfo?.liveState == 'wait' |
| 47 | + if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.vlive.length > 0) { | ||
| 50 | let playUrl = '' | 48 | let playUrl = '' |
| 51 | let liveStreamType: number | null = null | 49 | let liveStreamType: number | null = null |
| 52 | - if (this.liveDetailsBean.liveInfo.liveState == 'running') { | ||
| 53 | - playUrl = this.liveDetailsBean.liveInfo.vlive[0].liveUrl | ||
| 54 | - liveStreamType = this.liveDetailsBean.liveInfo.vlive[0].liveStreamType | ||
| 55 | - } else if (this.liveDetailsBean.liveInfo.liveState == 'end') { | ||
| 56 | - playUrl = this.liveDetailsBean.liveInfo.vlive[0].replayUri | ||
| 57 | - liveStreamType = this.liveDetailsBean.liveInfo.vlive[0].liveStreamType | 50 | + if (this.contentDetailData.liveInfo.liveState == 'running') { |
| 51 | + playUrl = this.contentDetailData.liveInfo.vlive[0].liveUrl | ||
| 52 | + liveStreamType = this.contentDetailData.liveInfo.vlive[0].liveStreamType | ||
| 53 | + } else if (this.contentDetailData.liveInfo.liveState == 'end') { | ||
| 54 | + playUrl = this.contentDetailData.liveInfo.vlive[0].replayUri | ||
| 55 | + liveStreamType = this.contentDetailData.liveInfo.vlive[0].liveStreamType | ||
| 58 | } | 56 | } |
| 59 | 57 | ||
| 60 | this.liveStreamType = liveStreamType | 58 | this.liveStreamType = liveStreamType |
| @@ -79,7 +77,7 @@ export struct PlayerComponent { | @@ -79,7 +77,7 @@ export struct PlayerComponent { | ||
| 79 | playerController: this.playerController, | 77 | playerController: this.playerController, |
| 80 | onLoad: () => { | 78 | onLoad: () => { |
| 81 | this.isCanplay = true | 79 | this.isCanplay = true |
| 82 | - console.error('WDAliPlayerController','------1------------') | 80 | + console.error('WDAliPlayerController', '------1------------') |
| 83 | this.playerController?.firstPlay(this.playUrl); | 81 | this.playerController?.firstPlay(this.playUrl); |
| 84 | } | 82 | } |
| 85 | }).margin({ top: 195 }).height(211) | 83 | }).margin({ top: 195 }).height(211) |
| @@ -102,6 +100,4 @@ export struct PlayerComponent { | @@ -102,6 +100,4 @@ export struct PlayerComponent { | ||
| 102 | .height('100%') | 100 | .height('100%') |
| 103 | .width('100%') | 101 | .width('100%') |
| 104 | } | 102 | } |
| 105 | - | ||
| 106 | - | ||
| 107 | } | 103 | } |
| 1 | -import { LiveDetailsBean, LiveRoomDataBean, postBatchAttentionStatusParams, } from 'wdBean/Index' | 1 | +import { ContentDetailDTO, LiveDetailsBean, LiveRoomDataBean, postBatchAttentionStatusParams, } from 'wdBean/Index' |
| 2 | import { MultiPictureDetailViewModel } from 'wdComponent/src/main/ets/viewmodel/MultiPictureDetailViewModel' | 2 | import { MultiPictureDetailViewModel } from 'wdComponent/src/main/ets/viewmodel/MultiPictureDetailViewModel' |
| 3 | import { SpConstants } from 'wdConstant/Index' | 3 | import { SpConstants } from 'wdConstant/Index' |
| 4 | import { ContentDetailRequest, postInteractAccentionOperateParams } from 'wdDetailPlayApi/Index' | 4 | import { ContentDetailRequest, postInteractAccentionOperateParams } from 'wdDetailPlayApi/Index' |
| @@ -10,14 +10,15 @@ const TAG = 'PlayerEndView' | @@ -10,14 +10,15 @@ const TAG = 'PlayerEndView' | ||
| 10 | @Preview | 10 | @Preview |
| 11 | @Component | 11 | @Component |
| 12 | export struct PlayerEndView { | 12 | export struct PlayerEndView { |
| 13 | - @Consume liveDetailsBean: LiveDetailsBean | 13 | + // @Consume liveDetailsBean: LiveDetailsBean |
| 14 | + @Consume contentDetailData: ContentDetailDTO | ||
| 14 | @Consume liveRoomDataBean: LiveRoomDataBean | 15 | @Consume liveRoomDataBean: LiveRoomDataBean |
| 15 | @State duration: string = '' | 16 | @State duration: string = '' |
| 16 | @State followStatus: String = '0'; | 17 | @State followStatus: String = '0'; |
| 17 | 18 | ||
| 18 | aboutToAppear(): void { | 19 | aboutToAppear(): void { |
| 19 | - const sn = DateTimeUtils.parseDate(this.liveDetailsBean.liveInfo.startTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN) | ||
| 20 | - const en = DateTimeUtils.parseDate(this.liveDetailsBean.liveInfo.endTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN) | 20 | + const sn = DateTimeUtils.parseDate(this.contentDetailData.liveInfo.startTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN) |
| 21 | + const en = DateTimeUtils.parseDate(this.contentDetailData.liveInfo.endTime, DateTimeUtils.PATTERN_DATE_TIME_HYPHEN) | ||
| 21 | const sd = DateTimeUtils.getDuration(sn, en) | 22 | const sd = DateTimeUtils.getDuration(sn, en) |
| 22 | this.duration = DateTimeUtils.secondToTime(sd / 1000) | 23 | this.duration = DateTimeUtils.secondToTime(sd / 1000) |
| 23 | this.getBatchAttentionStatus() | 24 | this.getBatchAttentionStatus() |
| @@ -29,7 +30,7 @@ export struct PlayerEndView { | @@ -29,7 +30,7 @@ export struct PlayerEndView { | ||
| 29 | async getBatchAttentionStatus() { | 30 | async getBatchAttentionStatus() { |
| 30 | try { | 31 | try { |
| 31 | const params: postBatchAttentionStatusParams = { | 32 | const params: postBatchAttentionStatusParams = { |
| 32 | - creatorIds: [{ creatorId: this.liveDetailsBean?.rmhInfo?.rmhId ?? '' }] | 33 | + creatorIds: [{ creatorId: this.contentDetailData?.rmhInfo?.rmhId ?? '' }] |
| 33 | } | 34 | } |
| 34 | let data = await MultiPictureDetailViewModel.getBatchAttentionStatus(params) | 35 | let data = await MultiPictureDetailViewModel.getBatchAttentionStatus(params) |
| 35 | this.followStatus = data[0]?.status; | 36 | this.followStatus = data[0]?.status; |
| @@ -51,9 +52,9 @@ export struct PlayerEndView { | @@ -51,9 +52,9 @@ export struct PlayerEndView { | ||
| 51 | } | 52 | } |
| 52 | // TODO:直播间没有携带人民号信息 | 53 | // TODO:直播间没有携带人民号信息 |
| 53 | const params2: postInteractAccentionOperateParams = { | 54 | const params2: postInteractAccentionOperateParams = { |
| 54 | - attentionUserType: this.liveDetailsBean?.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号) | ||
| 55 | - attentionUserId: this.liveDetailsBean?.rmhInfo?.userId || '', // 被关注用户号主id | ||
| 56 | - attentionCreatorId: this.liveDetailsBean?.rmhInfo?.rmhId || '', // 被关注用户号主id | 55 | + attentionUserType: this.contentDetailData?.rmhInfo?.userType || '', //被关注用户类型(1 普通用户 2 视频号 3 矩阵号) |
| 56 | + attentionUserId: this.contentDetailData?.rmhInfo?.userId || '', // 被关注用户号主id | ||
| 57 | + attentionCreatorId: this.contentDetailData?.rmhInfo?.rmhId || '', // 被关注用户号主id | ||
| 57 | status: this.followStatus == '0' ? 1 : 0, | 58 | status: this.followStatus == '0' ? 1 : 0, |
| 58 | } | 59 | } |
| 59 | 60 | ||
| @@ -79,12 +80,12 @@ export struct PlayerEndView { | @@ -79,12 +80,12 @@ export struct PlayerEndView { | ||
| 79 | 80 | ||
| 80 | Stack() { | 81 | Stack() { |
| 81 | Column() { | 82 | Column() { |
| 82 | - Text(this.liveDetailsBean?.rmhInfo?.rmhName) | 83 | + Text(this.contentDetailData?.rmhInfo?.rmhName) |
| 83 | .fontWeight(400) | 84 | .fontWeight(400) |
| 84 | .fontSize(18) | 85 | .fontSize(18) |
| 85 | .fontColor(Color.White) | 86 | .fontColor(Color.White) |
| 86 | .padding({ top: 52 }) | 87 | .padding({ top: 52 }) |
| 87 | - Text(this.liveDetailsBean?.rmhInfo?.rmhDesc || '') | 88 | + Text(this.contentDetailData?.rmhInfo?.rmhDesc || '') |
| 88 | .fontWeight(400) | 89 | .fontWeight(400) |
| 89 | .fontSize(13) | 90 | .fontSize(13) |
| 90 | .fontColor('#B2FFFFFF') | 91 | .fontColor('#B2FFFFFF') |
| @@ -127,7 +128,7 @@ export struct PlayerEndView { | @@ -127,7 +128,7 @@ export struct PlayerEndView { | ||
| 127 | .backgroundColor('#999999') | 128 | .backgroundColor('#999999') |
| 128 | .borderRadius(4) | 129 | .borderRadius(4) |
| 129 | 130 | ||
| 130 | - Image(this.liveDetailsBean?.fullColumnImgUrls[0]?.url) | 131 | + Image(this.contentDetailData?.fullColumnImgUrls[0]?.url) |
| 131 | .width(80) | 132 | .width(80) |
| 132 | .height(80) | 133 | .height(80) |
| 133 | .borderRadius(40) | 134 | .borderRadius(40) |
| 1 | import lottie from '@ohos/lottie' | 1 | import lottie from '@ohos/lottie' |
| 2 | -import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index' | 2 | +import { ContentDetailDTO, LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index' |
| 3 | import { LiveFollowComponent, LottieView } from 'wdComponent/Index' | 3 | import { LiveFollowComponent, LottieView } from 'wdComponent/Index' |
| 4 | import { NumberFormatterUtils } from 'wdKit/Index' | 4 | import { NumberFormatterUtils } from 'wdKit/Index' |
| 5 | 5 | ||
| 6 | @Preview | 6 | @Preview |
| 7 | @Component | 7 | @Component |
| 8 | export struct PlayerTitleComponent { | 8 | export struct PlayerTitleComponent { |
| 9 | - @Consume liveDetailsBean: LiveDetailsBean | 9 | +// @Consume liveDetailsBean: LiveDetailsBean |
| 10 | @Consume liveRoomDataBean: LiveRoomDataBean | 10 | @Consume liveRoomDataBean: LiveRoomDataBean |
| 11 | @Consume liveState: string | 11 | @Consume liveState: string |
| 12 | - | 12 | + @Consume contentDetailData: ContentDetailDTO |
| 13 | aboutToDisappear(): void { | 13 | aboutToDisappear(): void { |
| 14 | - if (this.liveDetailsBean.liveInfo?.liveState == 'running') { | 14 | + if (this.contentDetailData.liveInfo?.liveState == 'running') { |
| 15 | lottie.destroy('live_status_wait') | 15 | lottie.destroy('live_status_wait') |
| 16 | } | 16 | } |
| 17 | } | 17 | } |
| @@ -19,7 +19,7 @@ export struct PlayerTitleComponent { | @@ -19,7 +19,7 @@ export struct PlayerTitleComponent { | ||
| 19 | build() { | 19 | build() { |
| 20 | Column() { | 20 | Column() { |
| 21 | Row() { | 21 | Row() { |
| 22 | - Text(this.liveDetailsBean.newsTitle || '') | 22 | + Text(this.contentDetailData.newsTitle || '') |
| 23 | .maxLines(2) | 23 | .maxLines(2) |
| 24 | .fontSize(16) | 24 | .fontSize(16) |
| 25 | .fontWeight(500) | 25 | .fontWeight(500) |
| @@ -42,9 +42,9 @@ export struct PlayerTitleComponent { | @@ -42,9 +42,9 @@ export struct PlayerTitleComponent { | ||
| 42 | 42 | ||
| 43 | @Builder | 43 | @Builder |
| 44 | getLiveStatusView() { | 44 | getLiveStatusView() { |
| 45 | - if (this.liveDetailsBean.rmhInfo?.rmhName) { | 45 | + if (this.contentDetailData.rmhInfo?.rmhName) { |
| 46 | LiveFollowComponent({ | 46 | LiveFollowComponent({ |
| 47 | - rmhInfo: this.liveDetailsBean.rmhInfo | 47 | + rmhInfo: this.contentDetailData.rmhInfo |
| 48 | }).margin({ | 48 | }).margin({ |
| 49 | right: 10 | 49 | right: 10 |
| 50 | }) | 50 | }) |
| 1 | -import { window } from '@kit.ArkUI' | ||
| 2 | -import { NumberFormatterUtils, WindowModel } from 'wdKit/Index' | ||
| 3 | - | ||
| 4 | -import { devicePLSensorManager } from 'wdDetailPlayApi/Index' | ||
| 5 | -import { DateFormatUtil, WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index' | ||
| 6 | -import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index' | 1 | +import { DateFormatUtil, WDAliPlayerController } from 'wdPlayer/Index' |
| 2 | +import { LiveRoomDataBean } from 'wdBean/Index' | ||
| 7 | 3 | ||
| 8 | 4 | ||
| 9 | @Component | 5 | @Component |
| 10 | export struct PlayerVideoControlComponent { | 6 | export struct PlayerVideoControlComponent { |
| 11 | private playerController?: WDAliPlayerController | 7 | private playerController?: WDAliPlayerController |
| 12 | - @Consume liveDetailsBean: LiveDetailsBean | ||
| 13 | @Consume liveRoomDataBean: LiveRoomDataBean | 8 | @Consume liveRoomDataBean: LiveRoomDataBean |
| 14 | @State currentTime: string = '' | 9 | @State currentTime: string = '' |
| 15 | @State totalTime: string = '' | 10 | @State totalTime: string = '' |
-
Please register or login to post a comment