Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main
* 'main' of http://192.168.1.42/developOne/harmonyPool: fix(版面):点击内容崩溃处理 fix:bug[17463] 无网络时进入人民号号主主页,鸿蒙与安卓的缺省图不一致 fix(早晚报/版面):分享 fix:bug[18039] 搜索结果-号主图集>图片数量为负数 fix:bug[18108] 搜索结果-图集卡封面图加载不出,图片数量是-1,见截图 fix:搜索异常 fix:somebug fix:直播详情页面,两次调用相同接口,处理成只调用一次 feat: 更多组件添加card9Component 时间链卡片 fix:bug[18022] 搜索结果-时间轴专题样式卡,隐藏专题时间轴不应展示标题信息,见截图 fix:直播详情页面,两次调用相同接口,处理成只调用一次
Showing
39 changed files
with
420 additions
and
384 deletions
| @@ -100,6 +100,8 @@ export class ContentDTO implements BaseDTO { | @@ -100,6 +100,8 @@ export class ContentDTO implements BaseDTO { | ||
| 100 | 本地辅助字段 | 100 | 本地辅助字段 |
| 101 | */ | 101 | */ |
| 102 | liveRoomDataBean : LiveRoomDataBean = {} as LiveRoomDataBean// 批查获取到的直播观看人数 | 102 | liveRoomDataBean : LiveRoomDataBean = {} as LiveRoomDataBean// 批查获取到的直播观看人数 |
| 103 | + //本地字段:时间轴专题页节点组件时间;【如果开启模糊则显示时间->左右;0:否,1:是】 | ||
| 104 | + timeBlurred:number = 0 | ||
| 103 | 105 | ||
| 104 | static clone(old: ContentDTO): ContentDTO { | 106 | static clone(old: ContentDTO): ContentDTO { |
| 105 | let content = new ContentDTO(); | 107 | let content = new ContentDTO(); |
| @@ -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 { ArrayList } from '@kit.ArkTS'; | ||
| 2 | +import { SharePosterItemBean } from './SharePosterItemBean'; | ||
| 3 | + | ||
| 1 | export interface ShareInfoDTO { | 4 | export interface ShareInfoDTO { |
| 2 | shareCoverUrl: string; | 5 | shareCoverUrl: string; |
| 3 | shareOpen: number; | 6 | shareOpen: number; |
| 7 | + //海报图片地址 | ||
| 4 | sharePosterCoverUrl: string; | 8 | sharePosterCoverUrl: string; |
| 9 | + //海报报分享开关 0:关闭,1:开启 | ||
| 5 | sharePosterOpen: number; | 10 | sharePosterOpen: number; |
| 6 | shareSummary: string; | 11 | shareSummary: string; |
| 12 | + //标题 | ||
| 7 | shareTitle: string; | 13 | shareTitle: string; |
| 14 | + //分享链接 | ||
| 8 | shareUrl: string; | 15 | shareUrl: string; |
| 16 | + //首发时间 | ||
| 17 | + publishTime:string; | ||
| 18 | + //图片 | ||
| 19 | + imageUrl:string; | ||
| 20 | + //直播和内容的举报,仅针对人民号发布的才能举报,cms创建的没有举报按钮 | ||
| 21 | + showReport:boolean; | ||
| 22 | + //点赞按钮显示 -1:不展示 0:未点赞 1:已点赞 | ||
| 23 | + showLike:number; | ||
| 24 | + //0 分享海报关闭,1 分享海报开启 | ||
| 25 | + posterShareControl:string; | ||
| 26 | + //是否展示海报 -1-不展示图标 | ||
| 27 | + showPoster:number; | ||
| 28 | + //海报展示类型 1:专题、文章、图文、视频、直播 2:人民号 3:评论 4:电子报海报 5:音频专题海报 6:早晚报专题海报 7:榜单H5 8:H5普通文章专题,包含时间链 | ||
| 29 | + showPosterType:number; | ||
| 30 | + //接口返回: 内容id、内容类型 | ||
| 31 | + contentId:string; | ||
| 32 | + //内容类型,分享的类型 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频,14动态图文,15动态视频 | ||
| 33 | + contentType:string; | ||
| 34 | + //关系id | ||
| 35 | + targetRelId:string; | ||
| 36 | + //关系类型,1.频道关系;2.专题关系 | ||
| 37 | + targetRelType:string; | ||
| 38 | + //21:文章专题,22:音频专题,23:直播专题,24:话题专题,25:早晚报专题 | ||
| 39 | + topicType:string; | ||
| 40 | + //早晚报;1-早报;2-午报;3-晚报 | ||
| 41 | + topicPattern:number; | ||
| 42 | + //是否有头版 | ||
| 43 | + isFrontDaily:boolean; | ||
| 44 | + //分享海报简介 | ||
| 45 | + posterSummary:string; | ||
| 46 | + sharePosterItemList: SharePosterItemBean[] | ||
| 47 | + //分享海报标题 | ||
| 48 | + posterTitle:string; | ||
| 49 | + | ||
| 9 | } | 50 | } |
| 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 | } |
| 1 | import { FrontLinkObject } from '../component/FrontLinkObject'; | 1 | import { FrontLinkObject } from '../component/FrontLinkObject'; |
| 2 | +import { ArrayList } from '@kit.ArkTS'; | ||
| 3 | +import { ContentDTO } from '../content/ContentDTO'; | ||
| 2 | 4 | ||
| 3 | export interface TopicInfo { | 5 | export interface TopicInfo { |
| 4 | axisColor: string; | 6 | axisColor: string; |
| @@ -28,8 +30,17 @@ export interface TopicInfo { | @@ -28,8 +30,17 @@ export interface TopicInfo { | ||
| 28 | topicId: string; | 30 | topicId: string; |
| 29 | topicPattern: number; | 31 | topicPattern: number; |
| 30 | // topicTemplate?: any; | 32 | // topicTemplate?: any; |
| 33 | + //21:文章专题,22:音频专题,23:直播专题,24:话题专题,25:早晚报专题,26:时间链 | ||
| 31 | topicType: number; | 34 | topicType: number; |
| 32 | transluceImgUrl: string; | 35 | transluceImgUrl: string; |
| 33 | visitorComment: number; | 36 | visitorComment: number; |
| 34 | // voteInfo?: any; | 37 | // voteInfo?: any; |
| 38 | + //频道、专题页关系id; | ||
| 39 | + relId:string; | ||
| 40 | + //关系类型:1.频道关系;2.专题关系; | ||
| 41 | + relType:string; | ||
| 42 | + //本地字段 --》分享页面需要展示的数据 | ||
| 43 | + shareContentList: ContentDTO[] | ||
| 44 | + //专题背景图 | ||
| 45 | + backgroundImgUrl: string | ||
| 35 | } | 46 | } |
| 1 | -import { NewspaperListBean, NewspaperListItemBean } from 'wdBean'; | 1 | +import { ContentDetailDTO, NewspaperListBean, NewspaperListItemBean } from 'wdBean'; |
| 2 | import { NewspaperViewModel } from '../viewmodel/NewspaperViewModel'; | 2 | import { NewspaperViewModel } from '../viewmodel/NewspaperViewModel'; |
| 3 | import router from '@ohos.router'; | 3 | import router from '@ohos.router'; |
| 4 | import { ENewspaperItemComponent } from './ENewspaperItemComponent'; | 4 | import { ENewspaperItemComponent } from './ENewspaperItemComponent'; |
| @@ -11,7 +11,8 @@ import { RMCalendarBean } from './calendar/RMCalendarBean'; | @@ -11,7 +11,8 @@ import { RMCalendarBean } from './calendar/RMCalendarBean'; | ||
| 11 | import { newsSkeleton } from './skeleton/newsSkeleton'; | 11 | import { newsSkeleton } from './skeleton/newsSkeleton'; |
| 12 | import { Logger, ToastUtils, NetworkUtil } from 'wdKit/Index'; | 12 | import { Logger, ToastUtils, NetworkUtil } from 'wdKit/Index'; |
| 13 | import { TrackingContent,TrackConstants, TrackingButton } from 'wdTracking/Index'; | 13 | import { TrackingContent,TrackConstants, TrackingButton } from 'wdTracking/Index'; |
| 14 | - | 14 | +import { WDShare } from 'wdShare/Index'; |
| 15 | +//电子报UI | ||
| 15 | @Component | 16 | @Component |
| 16 | export struct ENewspaperPageComponent { | 17 | export struct ENewspaperPageComponent { |
| 17 | private displayTool = display.getDefaultDisplaySync() | 18 | private displayTool = display.getDefaultDisplaySync() |
| @@ -179,7 +180,7 @@ export struct ENewspaperPageComponent { | @@ -179,7 +180,7 @@ export struct ENewspaperPageComponent { | ||
| 179 | }) | 180 | }) |
| 180 | .id('e_newspaper_share') | 181 | .id('e_newspaper_share') |
| 181 | .onClick(() => { | 182 | .onClick(() => { |
| 182 | - ToastUtils.showToast('分享为公共方法,待开发', 1000); | 183 | + this.share() |
| 183 | }) | 184 | }) |
| 184 | } | 185 | } |
| 185 | } | 186 | } |
| @@ -392,4 +393,24 @@ export struct ENewspaperPageComponent { | @@ -392,4 +393,24 @@ export struct ENewspaperPageComponent { | ||
| 392 | 393 | ||
| 393 | } | 394 | } |
| 394 | } | 395 | } |
| 396 | + | ||
| 397 | + share() { | ||
| 398 | + let contentDetailData: ContentDetailDTO = { | ||
| 399 | + shareInfo:{ | ||
| 400 | + shareTitle:this.newspaperListBean?.list[this.swiperIndex].pageName, | ||
| 401 | + publishTime:this.newspaperListBean?.list[this.swiperIndex].periodNum, | ||
| 402 | + imageUrl:this.newspaperListBean?.list[this.swiperIndex].pagePic, | ||
| 403 | + shareUrl:this.newspaperListBean?.list[this.swiperIndex].sharePagePic.shareUrl, | ||
| 404 | + sharePosterCoverUrl:this.newspaperListBean?.list[this.swiperIndex].sharePagePic.sharePosterCoverUrl, | ||
| 405 | + showReport:false, | ||
| 406 | + showLike:-1, | ||
| 407 | + shareOpen:1, | ||
| 408 | + sharePosterOpen:1, | ||
| 409 | + posterShareControl:'-1', | ||
| 410 | + showPoster:-1, | ||
| 411 | + showPosterType:4, | ||
| 412 | + } | ||
| 413 | + } as ContentDetailDTO | ||
| 414 | + WDShare.shareContent(contentDetailData,TrackConstants.PageName.NewsPaperPage,TrackConstants.PageName.NewsPaperPage) | ||
| 415 | + } | ||
| 395 | } | 416 | } |
| @@ -294,7 +294,7 @@ export struct MorningEveningPaperComponent { | @@ -294,7 +294,7 @@ export struct MorningEveningPaperComponent { | ||
| 294 | @Builder | 294 | @Builder |
| 295 | topPaperTitle(){ | 295 | topPaperTitle(){ |
| 296 | Column(){ | 296 | Column(){ |
| 297 | - PaperTitleComponent().margin({top:this.topSafeHeight}) | 297 | + PaperTitleComponent({topicInfo:this.pageInfoBean?.topicInfo}).margin({top:this.topSafeHeight}) |
| 298 | }.height(44+this.topSafeHeight).backgroundColor(this.isHasTopView?(this.scrollOffset > 100?this.mixedBgColor:''):this.mixedBgColor) | 298 | }.height(44+this.topSafeHeight).backgroundColor(this.isHasTopView?(this.scrollOffset > 100?this.mixedBgColor:''):this.mixedBgColor) |
| 299 | } | 299 | } |
| 300 | 300 |
| 1 | import router from '@ohos.router'; | 1 | import router from '@ohos.router'; |
| 2 | +import { ContentDetailDTO, TopicInfo } from 'wdBean/Index'; | ||
| 2 | import { ToastUtils } from 'wdKit'; | 3 | import { ToastUtils } from 'wdKit'; |
| 4 | +import { WDShare } from 'wdShare/Index'; | ||
| 5 | +import { TrackConstants } from 'wdTracking/Index'; | ||
| 3 | 6 | ||
| 4 | /** | 7 | /** |
| 5 | * 早晚报页面标题bar | 8 | * 早晚报页面标题bar |
| @@ -9,7 +12,7 @@ import { ToastUtils } from 'wdKit'; | @@ -9,7 +12,7 @@ import { ToastUtils } from 'wdKit'; | ||
| 9 | export struct PaperTitleComponent { | 12 | export struct PaperTitleComponent { |
| 10 | @Consume title?: string | 13 | @Consume title?: string |
| 11 | @Consume subTitle?: string | 14 | @Consume subTitle?: string |
| 12 | - | 15 | + topicInfo: TopicInfo = {} as TopicInfo |
| 13 | aboutToAppear() { | 16 | aboutToAppear() { |
| 14 | } | 17 | } |
| 15 | 18 | ||
| @@ -105,7 +108,7 @@ export struct PaperTitleComponent { | @@ -105,7 +108,7 @@ export struct PaperTitleComponent { | ||
| 105 | .id('img_share') | 108 | .id('img_share') |
| 106 | .margin({ right: 16 }) | 109 | .margin({ right: 16 }) |
| 107 | .onClick(() => { | 110 | .onClick(() => { |
| 108 | - ToastUtils.showToast('分享为公共方法,待开发', 1000) | 111 | + this.share() |
| 109 | }) | 112 | }) |
| 110 | } | 113 | } |
| 111 | // .margin({ left: 14, right: 14 }) | 114 | // .margin({ left: 14, right: 14 }) |
| @@ -149,4 +152,28 @@ export struct PaperTitleComponent { | @@ -149,4 +152,28 @@ export struct PaperTitleComponent { | ||
| 149 | // } | 152 | // } |
| 150 | // .margin({ left: 6 }) | 153 | // .margin({ left: 6 }) |
| 151 | } | 154 | } |
| 155 | + | ||
| 156 | + share() { | ||
| 157 | + let contentDetailData: ContentDetailDTO = { | ||
| 158 | + newsId:Number.parseInt(this.topicInfo.topicId), | ||
| 159 | + shareInfo:{ | ||
| 160 | + contentId:this.topicInfo.topicId, | ||
| 161 | + contentType:this.topicInfo.topicType+'', | ||
| 162 | + shareTitle:this.topicInfo.shareTitle, | ||
| 163 | + shareSummary:this.topicInfo.shareSummary, | ||
| 164 | + imageUrl:this.topicInfo.shareCoverUrl, | ||
| 165 | + sharePosterCoverUrl:this.topicInfo.sharePosterCoverUrl, | ||
| 166 | + shareUrl:this.topicInfo.shareUrl, | ||
| 167 | + targetRelId:this.topicInfo.relId, | ||
| 168 | + targetRelType:this.topicInfo.relType, | ||
| 169 | + showReport:false, | ||
| 170 | + showLike:-1, | ||
| 171 | + shareOpen:1, | ||
| 172 | + sharePosterOpen:this.topicInfo.posterFlag, | ||
| 173 | + showPoster:this.topicInfo.posterFlag>0?1:-1, | ||
| 174 | + } | ||
| 175 | + } as ContentDetailDTO | ||
| 176 | + WDShare.setTopicBeanToShareBean(contentDetailData.shareInfo,this.topicInfo) | ||
| 177 | + WDShare.shareContent(contentDetailData,TrackConstants.PageName.Eletronic_Paper,TrackConstants.PageName.Eletronic_Paper) | ||
| 178 | + } | ||
| 152 | } | 179 | } |
| @@ -14,6 +14,8 @@ import font from '@ohos.font'; | @@ -14,6 +14,8 @@ import font from '@ohos.font'; | ||
| 14 | export struct CardMediaInfo { | 14 | export struct CardMediaInfo { |
| 15 | 15 | ||
| 16 | @State livePeopleNum :boolean = true | 16 | @State livePeopleNum :boolean = true |
| 17 | + //@ObjectLink compDTO: CompDTO | ||
| 18 | + @State beused: string = ''; // 2024-05-28 给CardMediaInfo组件添加beused的字段让其知道被哪个组件使用,不传默认为空 | ||
| 17 | @State contentDTO: ContentDTO = new ContentDTO() // 如果有duraion,代表点播,显示时长;如果不传或者传0,显示直播中 | 19 | @State contentDTO: ContentDTO = new ContentDTO() // 如果有duraion,代表点播,显示时长;如果不传或者传0,显示直播中 |
| 18 | @State joinPeopleNum: number = 0; | 20 | @State joinPeopleNum: number = 0; |
| 19 | // objectType 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频, | 21 | // objectType 0:不跳转 1:点播,2:直播,3:活动,4:广告,5:专题,6:链接,7:榜单,8:图文,9:组图,10:H5新闻,11:频道,12:组件,13:音频, |
| @@ -154,12 +156,17 @@ export struct CardMediaInfo { | @@ -154,12 +156,17 @@ export struct CardMediaInfo { | ||
| 154 | } | 156 | } |
| 155 | 157 | ||
| 156 | } | 158 | } |
| 159 | + // 备注直播间观看人数在轮播图卡不显示 | ||
| 160 | + if(this.beused !== 'Zh_Carousel_Layout_01'){ | ||
| 157 | if (!!this.joinPeopleNum) { | 161 | if (!!this.joinPeopleNum) { |
| 158 | Text(' | ') | 162 | Text(' | ') |
| 159 | .mediaText() | 163 | .mediaText() |
| 160 | Text(`${this.handlerNum(this.joinPeopleNum.toString())}人参加`) | 164 | Text(`${this.handlerNum(this.joinPeopleNum.toString())}人参加`) |
| 161 | .mediaText() | 165 | .mediaText() |
| 162 | } | 166 | } |
| 167 | + } | ||
| 168 | + | ||
| 169 | + | ||
| 163 | // } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo | 170 | // } else if (this.contentDTO?.liveInfo?.liveState === 'end' && this.contentDTO?.liveInfo |
| 164 | // ?.replayUri) { | 171 | // ?.replayUri) { |
| 165 | // // Image($r('app.media.card_live')) | 172 | // // Image($r('app.media.card_live')) |
| @@ -7,6 +7,7 @@ import MinePageDatasModel from '../../model/MinePageDatasModel'; | @@ -7,6 +7,7 @@ import MinePageDatasModel from '../../model/MinePageDatasModel'; | ||
| 7 | import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'; | 7 | import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'; |
| 8 | import { SearchDescription } from '../../viewmodel/SearchResultContentItem'; | 8 | import { SearchDescription } from '../../viewmodel/SearchResultContentItem'; |
| 9 | import { CardParser } from '../CardParser' | 9 | import { CardParser } from '../CardParser' |
| 10 | +import { Card9Component } from './Card9Component'; | ||
| 10 | 11 | ||
| 11 | const TAG: string = 'More_Comp'; | 12 | const TAG: string = 'More_Comp'; |
| 12 | 13 | ||
| @@ -23,7 +24,11 @@ export struct MoreComponent { | @@ -23,7 +24,11 @@ export struct MoreComponent { | ||
| 23 | build() { | 24 | build() { |
| 24 | if (this.showDetail) { | 25 | if (this.showDetail) { |
| 25 | ForEach(this.contentDTO.sameContentList, (item: ContentDTO, index: number) => { | 26 | ForEach(this.contentDTO.sameContentList, (item: ContentDTO, index: number) => { |
| 27 | + if (item.appStyle !== "9") { | ||
| 26 | CardParser({compDTO:new CompDTO, contentDTO: item }) | 28 | CardParser({compDTO:new CompDTO, contentDTO: item }) |
| 29 | + } else { | ||
| 30 | + Card9Component({ compDTO: new CompDTO, contentDTO:item, pageId: "", pageName: "" }) | ||
| 31 | + } | ||
| 27 | }) | 32 | }) |
| 28 | } else { | 33 | } else { |
| 29 | Column() { | 34 | Column() { |
| @@ -204,7 +204,8 @@ struct CarouselLayout01CardView { | @@ -204,7 +204,8 @@ struct CarouselLayout01CardView { | ||
| 204 | Column() { | 204 | Column() { |
| 205 | // 这里用于展示轮播图右上角信息,这里只对直播类型的展示 | 205 | // 这里用于展示轮播图右上角信息,这里只对直播类型的展示 |
| 206 | if (this.item.objectType === '2' || this.item.objectType === '4') { | 206 | if (this.item.objectType === '2' || this.item.objectType === '4') { |
| 207 | - CardMediaInfo({ contentDTO: this.item,livePeopleNum:false }) | 207 | + // 2024-05-28 给CardMediaInfo组件添加beused的字段让其知道被哪个组件使用,不传默认为空 |
| 208 | + CardMediaInfo({ contentDTO: this.item,livePeopleNum:false ,beused:'Zh_Carousel_Layout_01'}) | ||
| 208 | .width(CommonConstants.FULL_PARENT) | 209 | .width(CommonConstants.FULL_PARENT) |
| 209 | } | 210 | } |
| 210 | Blank() | 211 | Blank() |
| @@ -86,7 +86,7 @@ export struct FollowFirstTabsComponent{ | @@ -86,7 +86,7 @@ export struct FollowFirstTabsComponent{ | ||
| 86 | if(!this.isConnectNetwork){ | 86 | if(!this.isConnectNetwork){ |
| 87 | EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => { | 87 | EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => { |
| 88 | this.reloadNetWork() | 88 | this.reloadNetWork() |
| 89 | - },}) | 89 | + }}) |
| 90 | .layoutWeight(1) | 90 | .layoutWeight(1) |
| 91 | .width('100%') | 91 | .width('100%') |
| 92 | }else{ | 92 | }else{ |
| 1 | import router from '@ohos.router' | 1 | import router from '@ohos.router' |
| 2 | import { PeopleShipHomePageNavComponent } from '../peopleShipHomePage/PeopleShipHomeNavComponent' | 2 | import { PeopleShipHomePageNavComponent } from '../peopleShipHomePage/PeopleShipHomeNavComponent' |
| 3 | import { PeopleShipHomePageTopComponent } from '../peopleShipHomePage/PeopleShipHomePageTopComponent' | 3 | import { PeopleShipHomePageTopComponent } from '../peopleShipHomePage/PeopleShipHomePageTopComponent' |
| 4 | -import { Logger, WindowModel } from 'wdKit' | 4 | +import { Logger, NetworkUtil, WindowModel } from 'wdKit' |
| 5 | import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel' | 5 | import { PeopleShipHomePageDataModel } from '../../viewmodel/PeopleShipHomePageDataModel' |
| 6 | import { PeopleShipHomeListComponent } from '../peopleShipHomePage/PeopleShipHomeListComponent' | 6 | import { PeopleShipHomeListComponent } from '../peopleShipHomePage/PeopleShipHomeListComponent' |
| 7 | import { QueryListIsFollowedItem } from '../../viewmodel/QueryListIsFollowedItem' | 7 | import { QueryListIsFollowedItem } from '../../viewmodel/QueryListIsFollowedItem' |
| @@ -14,6 +14,7 @@ import { | @@ -14,6 +14,7 @@ import { | ||
| 14 | ArticleCountData | 14 | ArticleCountData |
| 15 | } from 'wdBean' | 15 | } from 'wdBean' |
| 16 | import { EmptyComponent } from '../view/EmptyComponent' | 16 | import { EmptyComponent } from '../view/EmptyComponent' |
| 17 | +import { CustomTitleUI } from '../reusable/CustomTitleUI' | ||
| 17 | 18 | ||
| 18 | @Entry | 19 | @Entry |
| 19 | @Component | 20 | @Component |
| @@ -39,8 +40,10 @@ struct PeopleShipHomePage { | @@ -39,8 +40,10 @@ struct PeopleShipHomePage { | ||
| 39 | @Provide topHeight: number = 214 | 40 | @Provide topHeight: number = 214 |
| 40 | @State isLoading: boolean = true | 41 | @State isLoading: boolean = true |
| 41 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 | 42 | @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 |
| 43 | + @State isConnectNetwork : boolean = NetworkUtil.isNetConnected() | ||
| 42 | 44 | ||
| 43 | build() { | 45 | build() { |
| 46 | + if(this.isConnectNetwork){ | ||
| 44 | Stack({ alignContent: Alignment.TopStart }) { | 47 | Stack({ alignContent: Alignment.TopStart }) { |
| 45 | Stack({ alignContent: Alignment.Top }){ | 48 | Stack({ alignContent: Alignment.Top }){ |
| 46 | // 顶部图片 | 49 | // 顶部图片 |
| @@ -61,8 +64,6 @@ struct PeopleShipHomePage { | @@ -61,8 +64,6 @@ struct PeopleShipHomePage { | ||
| 61 | .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) | 64 | .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.TOP]) |
| 62 | } | 65 | } |
| 63 | 66 | ||
| 64 | - | ||
| 65 | - | ||
| 66 | Column(){ | 67 | Column(){ |
| 67 | // 头部返回 | 68 | // 头部返回 |
| 68 | PeopleShipHomePageNavComponent({ | 69 | PeopleShipHomePageNavComponent({ |
| @@ -122,7 +123,6 @@ struct PeopleShipHomePage { | @@ -122,7 +123,6 @@ struct PeopleShipHomePage { | ||
| 122 | 123 | ||
| 123 | }) | 124 | }) |
| 124 | } | 125 | } |
| 125 | - | ||
| 126 | } | 126 | } |
| 127 | .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) | 127 | .expandSafeArea([SafeAreaType.SYSTEM], [SafeAreaEdge.BOTTOM]) |
| 128 | .alignItems(HorizontalAlign.Start) | 128 | .alignItems(HorizontalAlign.Start) |
| @@ -130,7 +130,21 @@ struct PeopleShipHomePage { | @@ -130,7 +130,21 @@ struct PeopleShipHomePage { | ||
| 130 | .width('100%') | 130 | .width('100%') |
| 131 | } | 131 | } |
| 132 | .width('100%') | 132 | .width('100%') |
| 133 | - | 133 | + }else{ |
| 134 | + Column(){ | ||
| 135 | + CustomTitleUI({ titleName: "" }) | ||
| 136 | + EmptyComponent({ emptyType: 1,emptyHeight:"100%" ,retry: () => { | ||
| 137 | + this.isConnectNetwork = NetworkUtil.isNetConnected() | ||
| 138 | + if(this.isConnectNetwork){ | ||
| 139 | + this.detailModel = {} as PeopleShipUserDetailData | ||
| 140 | + this.getData() | ||
| 141 | + } | ||
| 142 | + }}) | ||
| 143 | + .height('calc(100% - 84lpx)') | ||
| 144 | + .width('100%') | ||
| 145 | + }.width("100%") | ||
| 146 | + .height("100%") | ||
| 147 | + } | ||
| 134 | } | 148 | } |
| 135 | 149 | ||
| 136 | aboutToAppear() { | 150 | aboutToAppear() { |
| @@ -43,7 +43,8 @@ export struct SearchComponent { | @@ -43,7 +43,8 @@ export struct SearchComponent { | ||
| 43 | this.getSearchHistoryData() | 43 | this.getSearchHistoryData() |
| 44 | 44 | ||
| 45 | let intervalID = setInterval(() => { | 45 | let intervalID = setInterval(() => { |
| 46 | - sendEventByKey("searchId", 10, "") | 46 | + // sendEventByKey("searchId", 10, "") //这个报错 暂时替换下面这个 |
| 47 | + focusControl.requestFocus('searchId') | ||
| 47 | clearInterval(intervalID); | 48 | clearInterval(intervalID); |
| 48 | }, 1000); | 49 | }, 1000); |
| 49 | } | 50 | } |
| @@ -180,6 +181,11 @@ export struct SearchComponent { | @@ -180,6 +181,11 @@ export struct SearchComponent { | ||
| 180 | trackSearchClick(this.fromTabName,content) | 181 | trackSearchClick(this.fromTabName,content) |
| 181 | //赋值 | 182 | //赋值 |
| 182 | this.searchText = content | 183 | this.searchText = content |
| 184 | + | ||
| 185 | + if(StringUtils.isNotEmpty(this.searchText)){ | ||
| 186 | + this.hasInputContent = true | ||
| 187 | + } | ||
| 188 | + | ||
| 183 | //保存搜索记录 | 189 | //保存搜索记录 |
| 184 | SearcherAboutDataModel.putSearchHistoryData(this.searchText) | 190 | SearcherAboutDataModel.putSearchHistoryData(this.searchText) |
| 185 | //获取搜索记录 | 191 | //获取搜索记录 |
| @@ -10,7 +10,7 @@ import { | @@ -10,7 +10,7 @@ import { | ||
| 10 | } from 'wdBean/Index' | 10 | } from 'wdBean/Index' |
| 11 | import { LiveInfoDTO } from 'wdBean/src/main/ets/bean/detail/LiveInfoDTO' | 11 | import { LiveInfoDTO } from 'wdBean/src/main/ets/bean/detail/LiveInfoDTO' |
| 12 | import { VoiceInfoDTO } from 'wdBean/src/main/ets/bean/detail/VoiceInfoDTO' | 12 | import { VoiceInfoDTO } from 'wdBean/src/main/ets/bean/detail/VoiceInfoDTO' |
| 13 | -import { LazyDataSource, Logger, StringUtils, ToastUtils, UserDataLocal } from 'wdKit/Index' | 13 | +import { LazyDataSource, StringUtils, UserDataLocal } from 'wdKit/Index' |
| 14 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' | 14 | import { WDRouterPage, WDRouterRule } from 'wdRouter/Index' |
| 15 | import MinePageDatasModel from '../../model/MinePageDatasModel' | 15 | import MinePageDatasModel from '../../model/MinePageDatasModel' |
| 16 | import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' | 16 | import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' |
| @@ -21,7 +21,6 @@ import { FollowListStatusRequestItem } from '../../viewmodel/FollowListStatusReq | @@ -21,7 +21,6 @@ import { FollowListStatusRequestItem } from '../../viewmodel/FollowListStatusReq | ||
| 21 | import { QueryListIsFollowedItem } from '../../viewmodel/QueryListIsFollowedItem' | 21 | import { QueryListIsFollowedItem } from '../../viewmodel/QueryListIsFollowedItem' |
| 22 | import { SearchResultContentData } from '../../viewmodel/SearchResultContentData' | 22 | import { SearchResultContentData } from '../../viewmodel/SearchResultContentData' |
| 23 | import { | 23 | import { |
| 24 | - SearchDescription, | ||
| 25 | SearchResultContentItem, SearchRmhDescription } from '../../viewmodel/SearchResultContentItem' | 24 | SearchResultContentItem, SearchRmhDescription } from '../../viewmodel/SearchResultContentItem' |
| 26 | import { CardParser } from '../CardParser' | 25 | import { CardParser } from '../CardParser' |
| 27 | import { FollowChildComponent } from '../mine/follow/FollowChildComponent' | 26 | import { FollowChildComponent } from '../mine/follow/FollowChildComponent' |
| @@ -30,6 +29,7 @@ import { ActivityItemComponent } from './ActivityItemComponent' | @@ -30,6 +29,7 @@ import { ActivityItemComponent } from './ActivityItemComponent' | ||
| 30 | import { SearchCreatorComponent } from './SearchCreatorComponent' | 29 | import { SearchCreatorComponent } from './SearchCreatorComponent' |
| 31 | import { JSON } from '@kit.ArkTS' | 30 | import { JSON } from '@kit.ArkTS' |
| 32 | import { MoreComponent } from '../cardview/MoreComponent' | 31 | import { MoreComponent } from '../cardview/MoreComponent' |
| 32 | +import { Card9Component } from '../cardview/Card9Component' | ||
| 33 | 33 | ||
| 34 | const TAG = "SearchResultContentComponent" | 34 | const TAG = "SearchResultContentComponent" |
| 35 | 35 | ||
| @@ -264,6 +264,11 @@ export struct SearchResultContentComponent { | @@ -264,6 +264,11 @@ export struct SearchResultContentComponent { | ||
| 264 | ActivityItemComponent({ contentDTO: item }) | 264 | ActivityItemComponent({ contentDTO: item }) |
| 265 | }else if(item.sameContentListSize > 0){ | 265 | }else if(item.sameContentListSize > 0){ |
| 266 | MoreComponent({ contentDTO: item }) | 266 | MoreComponent({ contentDTO: item }) |
| 267 | + }else if(item.appStyle == "9"){ | ||
| 268 | + Column(){ | ||
| 269 | + Card9Component({ compDTO: new CompDTO, contentDTO:item, pageId: "", pageName: "" }) | ||
| 270 | + Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) | ||
| 271 | + } | ||
| 267 | } else { | 272 | } else { |
| 268 | CardParser({compDTO:new CompDTO, contentDTO: item }) | 273 | CardParser({compDTO:new CompDTO, contentDTO: item }) |
| 269 | } | 274 | } |
| @@ -459,7 +464,7 @@ export struct SearchResultContentComponent { | @@ -459,7 +464,7 @@ export struct SearchResultContentComponent { | ||
| 459 | contentDTO.tagWord = -1 | 464 | contentDTO.tagWord = -1 |
| 460 | contentDTO.isSelect = true | 465 | contentDTO.isSelect = true |
| 461 | contentDTO.rmhInfo = {} as RmhInfoDTO | 466 | contentDTO.rmhInfo = {} as RmhInfoDTO |
| 462 | - contentDTO.photoNum = -1 | 467 | + contentDTO.photoNum = StringUtils.isEmpty(value.data.picCount) ? 0 : Number(value.data.picCount) |
| 463 | contentDTO.liveInfo = {} as LiveInfoDTO; | 468 | contentDTO.liveInfo = {} as LiveInfoDTO; |
| 464 | contentDTO.videoInfo = { | 469 | contentDTO.videoInfo = { |
| 465 | videoDuration: Number.parseInt(value.data.duration) | 470 | videoDuration: Number.parseInt(value.data.duration) |
| @@ -482,7 +487,7 @@ export struct SearchResultContentComponent { | @@ -482,7 +487,7 @@ export struct SearchResultContentComponent { | ||
| 482 | contentDTO.bottomNavId = ''; | 487 | contentDTO.bottomNavId = ''; |
| 483 | contentDTO.openType = ''; | 488 | contentDTO.openType = ''; |
| 484 | contentDTO.extra = ''; | 489 | contentDTO.extra = ''; |
| 485 | - contentDTO.titleShow = value.data.type == "5" ? 1 : 0; | 490 | + contentDTO.titleShow = value.data.titleShow == "1" ? 0 : 1 |
| 486 | contentDTO.rmhInfo = rmhInfo | 491 | contentDTO.rmhInfo = rmhInfo |
| 487 | contentDTO.shareFlag = value.data.shareFlag | 492 | contentDTO.shareFlag = value.data.shareFlag |
| 488 | contentDTO.contentText = value.data.contentText | 493 | contentDTO.contentText = value.data.contentText |
| @@ -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'; |
| @@ -830,7 +830,7 @@ class MinePageDatasModel{ | @@ -830,7 +830,7 @@ class MinePageDatasModel{ | ||
| 830 | contentDTO.tagWord = -1 | 830 | contentDTO.tagWord = -1 |
| 831 | contentDTO.isSelect = true | 831 | contentDTO.isSelect = true |
| 832 | contentDTO.rmhInfo = {} as RmhInfoDTO | 832 | contentDTO.rmhInfo = {} as RmhInfoDTO |
| 833 | - contentDTO.photoNum = -1 | 833 | + contentDTO.photoNum = StringUtils.isEmpty(value.picCount) ? 0 : Number(value.picCount) |
| 834 | contentDTO.liveInfo = {} as LiveInfoDTO; | 834 | contentDTO.liveInfo = {} as LiveInfoDTO; |
| 835 | contentDTO.videoInfo = { | 835 | contentDTO.videoInfo = { |
| 836 | videoDuration: Number.parseInt(value.duration) | 836 | videoDuration: Number.parseInt(value.duration) |
| @@ -853,7 +853,7 @@ class MinePageDatasModel{ | @@ -853,7 +853,7 @@ class MinePageDatasModel{ | ||
| 853 | contentDTO.bottomNavId = ''; | 853 | contentDTO.bottomNavId = ''; |
| 854 | contentDTO.openType = ''; | 854 | contentDTO.openType = ''; |
| 855 | contentDTO.extra = ''; | 855 | contentDTO.extra = ''; |
| 856 | - contentDTO.titleShow = value.type == "5" ? 1 : 0; | 856 | + contentDTO.titleShow = value.titleShow == "1" ? 0 : 1 |
| 857 | contentDTO.rmhInfo = rmhInfo | 857 | contentDTO.rmhInfo = rmhInfo |
| 858 | contentDTO.shareFlag = value.shareFlag | 858 | contentDTO.shareFlag = value.shareFlag |
| 859 | contentDTO.contentText = value.contentText | 859 | contentDTO.contentText = value.contentText |
| 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,57 +71,44 @@ export struct DetailPlayLiveCommon { | @@ -70,57 +71,44 @@ 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) { |
| 73 | - 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 || '') | ||
| 85 | - this.publishCommentModel.commentContent = '' | ||
| 86 | 74 | ||
| 87 | - this.getLiveDetails() | ||
| 88 | - // } | ||
| 89 | - } | ||
| 90 | - }) | ||
| 91 | - } | 75 | + let detailData = data[0] |
| 76 | + this.liveLandscape = | ||
| 77 | + detailData?.liveInfo?.liveLandScape //String(this.contentDetailData?.liveInfo?.liveLandScape || '') | ||
| 92 | 78 | ||
| 93 | - /** | ||
| 94 | - * 获取直播信息,可区分横竖屏直播 | ||
| 95 | - */ | ||
| 96 | - getLiveDetails() { | 79 | + this.liveState = detailData.liveInfo?.liveState |
| 97 | 80 | ||
| 98 | - this.liveViewModel.getLiveDetails(this.contentId, this.relId, this.relType) | ||
| 99 | - .then( | ||
| 100 | - (data) => { | ||
| 101 | - if (data.length > 0) { | ||
| 102 | 81 | ||
| 82 | + if (this.liveState === 'wait' || this.liveLandscape === 'news') { | ||
| 83 | + this.contentDetailData = data[0] | ||
| 84 | + } else if (this.liveLandscape === 'general') { | ||
| 103 | //todo 不加setTimeOut ,接口返回的数据 就没法让PlayerComponent #@Consume @Watch('updateData') liveDetailsBean 的updateData方法运行 | 85 | //todo 不加setTimeOut ,接口返回的数据 就没法让PlayerComponent #@Consume @Watch('updateData') liveDetailsBean 的updateData方法运行 |
| 104 | setTimeout(() => { | 86 | setTimeout(() => { |
| 105 | - this.liveDetailsBean = data[0] | 87 | + this.contentDetailData = data[0] |
| 106 | }, 10) | 88 | }, 10) |
| 89 | + } | ||
| 107 | 90 | ||
| 108 | - this.liveState = data[0].liveInfo?.liveState | ||
| 109 | - this.liveStyle = data[0].liveInfo.liveStyle | 91 | + console.log(TAG, '查询视频详情用于评论展示 openComment:', detailData.openComment) |
| 92 | + this.publishCommentModel.targetId = String(detailData?.newsId || '') | ||
| 93 | + this.publishCommentModel.targetRelId = String(detailData?.reLInfo?.relId || '') | ||
| 94 | + this.publishCommentModel.targetTitle = detailData?.newsTitle | ||
| 95 | + this.publishCommentModel.targetRelType = String(detailData?.reLInfo?.relType || '') | ||
| 96 | + this.publishCommentModel.targetRelObjectId = String(detailData?.reLInfo?.relObjectId || '') | ||
| 97 | + this.publishCommentModel.keyArticle = String(detailData?.keyArticle || '') | ||
| 98 | + this.publishCommentModel.targetType = String(detailData?.newsType || '') | ||
| 99 | + this.publishCommentModel.visitorComment = String(detailData?.visitorComment || '') | ||
| 100 | + this.publishCommentModel.commentContent = '' | ||
| 101 | + this.liveStyle = detailData.liveInfo?.liveStyle | ||
| 110 | 102 | ||
| 111 | - if (data[0].fullColumnImgUrls && data[0].fullColumnImgUrls.length > 0) { | ||
| 112 | - this.imgUrl = data[0].fullColumnImgUrls[0].url | 103 | + if (detailData.fullColumnImgUrls && detailData.fullColumnImgUrls.length > 0) { |
| 104 | + this.imgUrl = detailData.fullColumnImgUrls[0].url | ||
| 113 | } | 105 | } |
| 114 | 106 | ||
| 115 | - if (data[0].liveInfo.liveState == 'end') { | ||
| 116 | - this.playUrl = data[0].liveInfo.vlive[0].replayUri | 107 | + if (detailData.liveInfo.liveState == 'end') { |
| 108 | + this.playUrl = detailData.liveInfo.vlive[0].replayUri | ||
| 117 | } | 109 | } |
| 118 | - | ||
| 119 | - // console.log(TAG, 'getLiveDetails:', JSON.stringify((this.liveDetailsBean))) | 110 | + //console.error('XXXXZZZZ', "liveLandscape =" + this.liveLandscape + ' this.liveState =' + this.liveState) |
| 120 | } | 111 | } |
| 121 | - }, | ||
| 122 | - () => { | ||
| 123 | - | ||
| 124 | }) | 112 | }) |
| 125 | } | 113 | } |
| 126 | 114 |
| 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,9 @@ export struct DetailPlayLivePage { | @@ -120,7 +118,9 @@ export struct DetailPlayLivePage { | ||
| 120 | } | 118 | } |
| 121 | 119 | ||
| 122 | getLiveDetails() { | 120 | getLiveDetails() { |
| 123 | - const data = this.liveDetailsBean | 121 | + const data = this.contentDetailData |
| 122 | + console.error("XXXXZZZZ", 'contentDetailData ----liveState==>' + data.liveInfo?.liveState) | ||
| 123 | + console.error("XXXXZZZZ", 'contentDetailData ----liveStyle==>' + data.liveInfo?.liveStyle) | ||
| 124 | if (data.liveInfo?.liveState == 'wait') { | 124 | if (data.liveInfo?.liveState == 'wait') { |
| 125 | //直播样式 0-正常模式 , 1-隐藏直播间,2-隐藏大家聊 【人民号发布是竖屏的,为空】 | 125 | //直播样式 0-正常模式 , 1-隐藏直播间,2-隐藏大家聊 【人民号发布是竖屏的,为空】 |
| 126 | if (data.liveInfo?.liveStyle == 1) { | 126 | if (data.liveInfo?.liveStyle == 1) { |
| @@ -131,8 +131,14 @@ export struct DetailPlayLivePage { | @@ -131,8 +131,14 @@ export struct DetailPlayLivePage { | ||
| 131 | this.tabs = ['简介', '直播间', '大家聊'] | 131 | this.tabs = ['简介', '直播间', '大家聊'] |
| 132 | } | 132 | } |
| 133 | } else { | 133 | } else { |
| 134 | + if (data.liveInfo?.liveStyle == 1) { | ||
| 135 | + this.tabs = ['大家聊'] | ||
| 136 | + } else if (data.liveInfo?.liveStyle == 2) { | ||
| 137 | + this.tabs = ['直播间',] | ||
| 138 | + } else { | ||
| 134 | this.tabs = ['直播间', '大家聊'] | 139 | this.tabs = ['直播间', '大家聊'] |
| 135 | } | 140 | } |
| 141 | + } | ||
| 136 | 142 | ||
| 137 | } | 143 | } |
| 138 | 144 |
| 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 = '' |
| 1 | -import { ContentDetailDTO, ContentDTO, PageInfoDTO } from 'wdBean/Index'; | 1 | +import { ContentDetailDTO, ContentDTO, PageInfoDTO, ShareInfoDTO, TopicInfo } from 'wdBean/Index'; |
| 2 | +import { SharePosterItemBean } from 'wdBean/src/main/ets/bean/detail/SharePosterItemBean'; | ||
| 2 | import { ShareScene, ShareType, WDShareBase } from 'wdShareBase/Index'; | 3 | import { ShareScene, ShareType, WDShareBase } from 'wdShareBase/Index'; |
| 3 | import { ShareContentType } from 'wdShareBase/src/main/ets/Constant'; | 4 | import { ShareContentType } from 'wdShareBase/src/main/ets/Constant'; |
| 4 | 5 | ||
| @@ -29,4 +30,58 @@ export class WDShare { | @@ -29,4 +30,58 @@ export class WDShare { | ||
| 29 | 30 | ||
| 30 | } | 31 | } |
| 31 | 32 | ||
| 33 | + //专题分享数据转换 | ||
| 34 | + static setTopicBeanToShareBean(shareBean: ShareInfoDTO, topicInfoBean: TopicInfo){ | ||
| 35 | + shareBean.topicType = topicInfoBean.topicType+'' | ||
| 36 | + //21:文章专题,22:音频专题,23:直播专题,24:话题专题,25:早晚报专题,26:时间链 | ||
| 37 | + if(25 == topicInfoBean.topicType){ | ||
| 38 | + shareBean.showPosterType = 6 | ||
| 39 | + shareBean.topicPattern = topicInfoBean.topicPattern | ||
| 40 | + shareBean.publishTime = topicInfoBean.topicDate | ||
| 41 | + if(topicInfoBean.frontLinkObject == null){ | ||
| 42 | + shareBean.isFrontDaily = false | ||
| 43 | + if(topicInfoBean.shareContentList != null && topicInfoBean.shareContentList.length>0){ | ||
| 44 | + shareBean.sharePosterItemList = [] as SharePosterItemBean[] | ||
| 45 | + shareBean.sharePosterItemList.length = topicInfoBean.shareContentList.length | ||
| 46 | + for (let index = 0; index < topicInfoBean.shareContentList.length; index++) { | ||
| 47 | + let element = topicInfoBean.shareContentList[index] | ||
| 48 | + if(element != null){ | ||
| 49 | + shareBean.sharePosterItemList[index] = { | ||
| 50 | + title:topicInfoBean.shareContentList[index].newsTitle, | ||
| 51 | + imageUrl:topicInfoBean.shareContentList[index].coverUrl, | ||
| 52 | + } as SharePosterItemBean | ||
| 53 | + } | ||
| 54 | + } | ||
| 55 | + } | ||
| 56 | + }else{ | ||
| 57 | + shareBean.isFrontDaily = true | ||
| 58 | + shareBean.sharePosterCoverUrl = topicInfoBean.frontLinkObject.coverUrl | ||
| 59 | + shareBean.posterSummary = topicInfoBean.frontLinkObject.summary | ||
| 60 | + } | ||
| 61 | + }else{ | ||
| 62 | + //文章/直播/话题专题(H5普通文章专题,包含时间链) | ||
| 63 | + shareBean.showPosterType = 8 | ||
| 64 | + //海报的头图 | ||
| 65 | + shareBean.sharePosterCoverUrl = topicInfoBean.backgroundImgUrl | ||
| 66 | + shareBean.isFrontDaily = false | ||
| 67 | + shareBean.posterTitle = topicInfoBean.title | ||
| 68 | + shareBean.posterSummary = topicInfoBean.summary | ||
| 69 | + if(topicInfoBean.shareContentList != null && topicInfoBean.shareContentList.length>0){ | ||
| 70 | + shareBean.sharePosterItemList = [] as SharePosterItemBean[] | ||
| 71 | + shareBean.sharePosterItemList.length = topicInfoBean.shareContentList.length | ||
| 72 | + for (let index = 0; index < topicInfoBean.shareContentList.length; index++) { | ||
| 73 | + let element = topicInfoBean.shareContentList[index] | ||
| 74 | + if(element != null){ | ||
| 75 | + shareBean.sharePosterItemList[index] = { | ||
| 76 | + title:topicInfoBean.shareContentList[index].newsTitle, | ||
| 77 | + imageUrl:topicInfoBean.shareContentList[index].coverUrl, | ||
| 78 | + timeNode:topicInfoBean.shareContentList[index].publishTime, | ||
| 79 | + timeBlurred:topicInfoBean.shareContentList[index].timeBlurred | ||
| 80 | + } as SharePosterItemBean | ||
| 81 | + } | ||
| 82 | + } | ||
| 83 | + } | ||
| 84 | + } | ||
| 85 | + } | ||
| 86 | + | ||
| 32 | } | 87 | } |
| @@ -17,7 +17,7 @@ export class TrackingUtils { | @@ -17,7 +17,7 @@ export class TrackingUtils { | ||
| 17 | static fillPositionWith(attr: ParamType) { | 17 | static fillPositionWith(attr: ParamType) { |
| 18 | let pageName = attr["pageName"] as string | 18 | let pageName = attr["pageName"] as string |
| 19 | let action = attr["action"] as string | 19 | let action = attr["action"] as string |
| 20 | - if (action.length > 0) { | 20 | + if (action != null && action.length > 0) { |
| 21 | attr["saPosition"] = pageName + "_" + action | 21 | attr["saPosition"] = pageName + "_" + action |
| 22 | return | 22 | return |
| 23 | } | 23 | } |
| @@ -5,7 +5,7 @@ import window from '@ohos.window'; | @@ -5,7 +5,7 @@ import window from '@ohos.window'; | ||
| 5 | import { TrackingPageBrowse ,TrackConstants} from 'wdTracking/Index'; | 5 | import { TrackingPageBrowse ,TrackConstants} from 'wdTracking/Index'; |
| 6 | 6 | ||
| 7 | const TAG = 'ENewspaper'; | 7 | const TAG = 'ENewspaper'; |
| 8 | - | 8 | +//电子报主页面 |
| 9 | @Entry | 9 | @Entry |
| 10 | @Component | 10 | @Component |
| 11 | struct ENewspaper { | 11 | struct ENewspaper { |
-
Please register or login to post a comment