Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool
# Conflicts: # sight_harmony/features/wdDetailPlayLive/src/main/ets/pages/DetailPlayLivePage.ets
Showing
86 changed files
with
915 additions
and
599 deletions
| @@ -203,6 +203,7 @@ export class ProcessUtils { | @@ -203,6 +203,7 @@ export class ProcessUtils { | ||
| 203 | relType: content?.relType, | 203 | relType: content?.relType, |
| 204 | relId: content?.relId, | 204 | relId: content?.relId, |
| 205 | channelId: content?.channelId, | 205 | channelId: content?.channelId, |
| 206 | + pageId: content?.pageId | ||
| 206 | } as ExtraDTO | 207 | } as ExtraDTO |
| 207 | } as Params, | 208 | } as Params, |
| 208 | }; | 209 | }; |
| @@ -10,6 +10,7 @@ export interface ExtraDTO extends ItemDTO { | @@ -10,6 +10,7 @@ export interface ExtraDTO extends ItemDTO { | ||
| 10 | topicId: string; | 10 | topicId: string; |
| 11 | channelId: string; | 11 | channelId: string; |
| 12 | compId: string; | 12 | compId: string; |
| 13 | + pageId: string; | ||
| 13 | sourcePage: string; | 14 | sourcePage: string; |
| 14 | relId: string; | 15 | relId: string; |
| 15 | relType: string; | 16 | relType: string; |
| @@ -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(); |
| @@ -25,5 +25,6 @@ export interface Params { | @@ -25,5 +25,6 @@ export interface Params { | ||
| 25 | creatorId?: string; //号主id | 25 | creatorId?: string; //号主id |
| 26 | videoUrl?: string; | 26 | videoUrl?: string; |
| 27 | videoCoverUrl?: string; | 27 | videoCoverUrl?: string; |
| 28 | + pageId?: string; | ||
| 28 | backVisibility?: boolean; //展示顶部返回栏 | 29 | backVisibility?: boolean; //展示顶部返回栏 |
| 29 | } | 30 | } |
| @@ -6,11 +6,12 @@ import { VideoInfoDTO } from './VideoInfoDTO'; | @@ -6,11 +6,12 @@ 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 |
| 12 | */ | 13 | */ |
| 13 | -export interface ContentDetailDTO { | 14 | +export class ContentDetailDTO { |
| 14 | newsId: number; | 15 | newsId: number; |
| 15 | newsTitle: string; | 16 | newsTitle: string; |
| 16 | newsShortTitle: string; | 17 | newsShortTitle: string; |
| @@ -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; |
| @@ -71,4 +72,8 @@ export interface ContentDetailDTO { | @@ -71,4 +72,8 @@ export interface ContentDetailDTO { | ||
| 71 | isNewspaper: boolean; | 72 | isNewspaper: boolean; |
| 72 | oldNewsId: string; | 73 | oldNewsId: string; |
| 73 | serials: any; | 74 | serials: any; |
| 75 | + | ||
| 76 | + | ||
| 77 | + // 本地字段 | ||
| 78 | + showTime:boolean = false; | ||
| 74 | } | 79 | } |
| 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 | } |
| @@ -32,12 +32,6 @@ export struct CardParser { | @@ -32,12 +32,6 @@ export struct CardParser { | ||
| 32 | pageShowTime:number = 0; | 32 | pageShowTime:number = 0; |
| 33 | pageHideTime:number = 0; | 33 | pageHideTime:number = 0; |
| 34 | 34 | ||
| 35 | - aboutToAppear(): void { | ||
| 36 | - | ||
| 37 | - console.log('CardParser-contentDTO', JSON.stringify(this.contentDTO)) | ||
| 38 | - console.log('CardParser-compDTO', JSON.stringify(this.compDTO)) | ||
| 39 | - } | ||
| 40 | - | ||
| 41 | onPageShow() { | 35 | onPageShow() { |
| 42 | this.pageShowTime = DateTimeUtils.getTimeStamp() | 36 | this.pageShowTime = DateTimeUtils.getTimeStamp() |
| 43 | } | 37 | } |
| @@ -42,6 +42,9 @@ export struct CompParser { | @@ -42,6 +42,9 @@ export struct CompParser { | ||
| 42 | @State noneAudioItems: ContentDTO[] = []; | 42 | @State noneAudioItems: ContentDTO[] = []; |
| 43 | 43 | ||
| 44 | aboutToAppear(): void { | 44 | aboutToAppear(): void { |
| 45 | + | ||
| 46 | + | ||
| 47 | + console.log('CompParser-compDTO', JSON.stringify(this.compDTO)) | ||
| 45 | // 轮播图屏蔽音频类型稿件 | 48 | // 轮播图屏蔽音频类型稿件 |
| 46 | if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { | 49 | if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { |
| 47 | this.audioItems = this.compDTO.operDataList.filter(item => { | 50 | this.audioItems = this.compDTO.operDataList.filter(item => { |
| 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 | } |
| @@ -15,7 +15,7 @@ export struct InteractMComponent { | @@ -15,7 +15,7 @@ export struct InteractMComponent { | ||
| 15 | build() { | 15 | build() { |
| 16 | Row(){ | 16 | Row(){ |
| 17 | Image(this.messageModel.InteractMsubM.headUrl) | 17 | Image(this.messageModel.InteractMsubM.headUrl) |
| 18 | - .alt($r('app.media.default_head')) | 18 | + .alt(this.messageModel.InteractMsubM.userType === '1'?$r('app.media.default_head'):$r('app.media.AccountOwner_DefaultIcon')) |
| 19 | .width(36) | 19 | .width(36) |
| 20 | .height(36) | 20 | .height(36) |
| 21 | .borderRadius(18) | 21 | .borderRadius(18) |
| @@ -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 | } |
| @@ -3,7 +3,7 @@ import { CompList, ContentDTO, InteractDataDTO} from 'wdBean'; | @@ -3,7 +3,7 @@ import { CompList, ContentDTO, InteractDataDTO} from 'wdBean'; | ||
| 3 | import { BreakpointConstants } from 'wdConstant'; | 3 | import { BreakpointConstants } from 'wdConstant'; |
| 4 | import { Logger } from 'wdKit'; | 4 | import { Logger } from 'wdKit'; |
| 5 | import { PaperSingleColumn999CardView } from '../page/CardView'; | 5 | import { PaperSingleColumn999CardView } from '../page/CardView'; |
| 6 | -import { EmptyComponent } from '../view/EmptyComponent'; | 6 | +import { EmptyComponent,WDViewDefaultType } from '../view/EmptyComponent'; |
| 7 | 7 | ||
| 8 | const TAG = 'SingleColumn999Component'; | 8 | const TAG = 'SingleColumn999Component'; |
| 9 | 9 | ||
| @@ -153,9 +153,8 @@ export struct SingleColumn999Component { | @@ -153,9 +153,8 @@ export struct SingleColumn999Component { | ||
| 153 | }) | 153 | }) |
| 154 | } else { | 154 | } else { |
| 155 | if (this.compListItem && this.compListItem?.operDataList) { | 155 | if (this.compListItem && this.compListItem?.operDataList) { |
| 156 | - EmptyComponent({ emptyHeight: 200 }) | 156 | + EmptyComponent({emptyType:WDViewDefaultType.WDViewDefaultType_NoListContent}) |
| 157 | } | 157 | } |
| 158 | - | ||
| 159 | } | 158 | } |
| 160 | } | 159 | } |
| 161 | 160 | ||
| @@ -170,9 +169,13 @@ export struct SingleColumn999Component { | @@ -170,9 +169,13 @@ export struct SingleColumn999Component { | ||
| 170 | */ | 169 | */ |
| 171 | @Builder | 170 | @Builder |
| 172 | buildPaperItem(item: ContentDTO, index: number) { | 171 | buildPaperItem(item: ContentDTO, index: number) { |
| 172 | + ///屏蔽早晚报 音频 | ||
| 173 | + if (item.objectType != '13'){ | ||
| 173 | PaperSingleColumn999CardView({ | 174 | PaperSingleColumn999CardView({ |
| 174 | item: item, | 175 | item: item, |
| 175 | index: index, | 176 | index: index, |
| 176 | }) | 177 | }) |
| 177 | } | 178 | } |
| 179 | + | ||
| 180 | + } | ||
| 178 | } | 181 | } |
| @@ -12,6 +12,7 @@ import { EmptyComponent } from '../components/view/EmptyComponent'; | @@ -12,6 +12,7 @@ import { EmptyComponent } from '../components/view/EmptyComponent'; | ||
| 12 | import { NetworkUtil, WindowModel } from 'wdKit'; | 12 | import { NetworkUtil, WindowModel } from 'wdKit'; |
| 13 | import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare' | 13 | import { viewBlogItemInsightIntentShare } from '../utils/InsightIntentShare' |
| 14 | import { common } from '@kit.AbilityKit'; | 14 | import { common } from '@kit.AbilityKit'; |
| 15 | +import { PageRepository } from '../repository/PageRepository'; | ||
| 15 | 16 | ||
| 16 | const TAG: string = 'SpacialTopicPageComponent' | 17 | const TAG: string = 'SpacialTopicPageComponent' |
| 17 | 18 | ||
| @@ -59,7 +60,6 @@ export struct SpacialTopicPageComponent { | @@ -59,7 +60,6 @@ export struct SpacialTopicPageComponent { | ||
| 59 | 60 | ||
| 60 | private async getDetail() { | 61 | private async getDetail() { |
| 61 | this.isNetConnected = NetworkUtil.isNetConnected() | 62 | this.isNetConnected = NetworkUtil.isNetConnected() |
| 62 | - | ||
| 63 | let contentId: string = '' | 63 | let contentId: string = '' |
| 64 | let relId: string = '' | 64 | let relId: string = '' |
| 65 | let relType: string = '' | 65 | let relType: string = '' |
| @@ -74,11 +74,14 @@ export struct SpacialTopicPageComponent { | @@ -74,11 +74,14 @@ export struct SpacialTopicPageComponent { | ||
| 74 | if (this.action.params.extra.relType) { | 74 | if (this.action.params.extra.relType) { |
| 75 | relType = this.action.params.extra.relType | 75 | relType = this.action.params.extra.relType |
| 76 | } | 76 | } |
| 77 | - | ||
| 78 | } | 77 | } |
| 78 | + let pageId = this.action.params.extra?.pageId | ||
| 79 | + console.log('pageIdpageId',pageId) | ||
| 80 | + if(pageId){ | ||
| 81 | + let pageInfoMsg = await PageRepository.fetchMorningEveningPageInfo(pageId) | ||
| 79 | let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType) | 82 | let detailBeans = await DetailViewModel.getDetailPageData(relId, contentId, relType) |
| 80 | - if (detailBeans && detailBeans.length > 0) { | ||
| 81 | - this.contentDetailData = detailBeans[0]; | 83 | + if (detailBeans?.length > 0) { |
| 84 | + this.contentDetailData = JSON.parse(JSON.stringify(detailBeans[0])); | ||
| 82 | this.viewBlogInsightIntentShare() | 85 | this.viewBlogInsightIntentShare() |
| 83 | // if (this.contentDetailData[0]?.openComment) { | 86 | // if (this.contentDetailData[0]?.openComment) { |
| 84 | this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '') | 87 | this.publishCommentModel.targetId = String(this.contentDetailData?.newsId || '') |
| @@ -92,6 +95,11 @@ export struct SpacialTopicPageComponent { | @@ -92,6 +95,11 @@ export struct SpacialTopicPageComponent { | ||
| 92 | // } | 95 | // } |
| 93 | this.trySendData2H5() | 96 | this.trySendData2H5() |
| 94 | } | 97 | } |
| 98 | + if(pageInfoMsg && pageInfoMsg.data){ | ||
| 99 | + this.contentDetailData.openComment = Number(pageInfoMsg.data.topicInfo.commentFlag) | ||
| 100 | + this.contentDetailData.commentDisplay = Number(pageInfoMsg.data.topicInfo.commentShowFlag) | ||
| 101 | + } | ||
| 102 | + } | ||
| 95 | } | 103 | } |
| 96 | } | 104 | } |
| 97 | 105 |
| @@ -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')) |
| @@ -5,7 +5,7 @@ import { | @@ -5,7 +5,7 @@ import { | ||
| 5 | ContentDetailRequest, | 5 | ContentDetailRequest, |
| 6 | postInteractAccentionOperateParams | 6 | postInteractAccentionOperateParams |
| 7 | } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; | 7 | } from 'wdDetailPlayApi/src/main/ets/request/ContentDetailRequest'; |
| 8 | -import { RmhInfoDTO } from 'wdBean' | 8 | +import { RmhInfoDTO, CompDTO, ContentDTO } from 'wdBean' |
| 9 | import { CommonConstants } from 'wdConstant/Index'; | 9 | import { CommonConstants } from 'wdConstant/Index'; |
| 10 | import { DateTimeUtils, SPHelper, Logger, ToastUtils } from 'wdKit'; | 10 | import { DateTimeUtils, SPHelper, Logger, ToastUtils } from 'wdKit'; |
| 11 | import { SpConstants } from 'wdConstant/Index' | 11 | import { SpConstants } from 'wdConstant/Index' |
| @@ -14,9 +14,14 @@ import router from '@ohos.router' | @@ -14,9 +14,14 @@ import router from '@ohos.router' | ||
| 14 | import { postBatchAttentionStatusParams } from 'wdBean/Index'; | 14 | import { postBatchAttentionStatusParams } from 'wdBean/Index'; |
| 15 | import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel' | 15 | import { MultiPictureDetailViewModel } from '../../viewmodel/MultiPictureDetailViewModel' |
| 16 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; | 16 | import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; |
| 17 | +import { InfomationCardClick } from '../../utils/infomationCardClick' | ||
| 17 | 18 | ||
| 18 | @Component | 19 | @Component |
| 19 | export struct RmhTitle { | 20 | export struct RmhTitle { |
| 21 | + @State compDTO: CompDTO = new CompDTO() | ||
| 22 | + @State contentDTO: ContentDTO = new ContentDTO(); | ||
| 23 | + @State pageId: string = ''; | ||
| 24 | + @State pageName: string = ''; | ||
| 20 | @Prop rmhInfo: RmhInfoDTO | 25 | @Prop rmhInfo: RmhInfoDTO |
| 21 | @Prop publishTime: string | undefined | 26 | @Prop publishTime: string | undefined |
| 22 | @State loadImg: boolean = false; | 27 | @State loadImg: boolean = false; |
| @@ -48,6 +53,16 @@ export struct RmhTitle { | @@ -48,6 +53,16 @@ export struct RmhTitle { | ||
| 48 | } | 53 | } |
| 49 | ContentDetailRequest.postInteractAccentionOperate(params2).then(res => { | 54 | ContentDetailRequest.postInteractAccentionOperate(params2).then(res => { |
| 50 | console.log('rmhTitle-data', JSON.stringify(res.data)) | 55 | console.log('rmhTitle-data', JSON.stringify(res.data)) |
| 56 | + | ||
| 57 | + InfomationCardClick.track( | ||
| 58 | + this.compDTO, | ||
| 59 | + this.contentDTO, | ||
| 60 | + this.pageId, | ||
| 61 | + this.pageName, | ||
| 62 | + 'follow', // like, commentClick, follow | ||
| 63 | + this.followStatus == '0' ? true : false, | ||
| 64 | + ) | ||
| 65 | + | ||
| 51 | if (this.followStatus == '1') { | 66 | if (this.followStatus == '1') { |
| 52 | this.followStatus = '0' | 67 | this.followStatus = '0' |
| 53 | } else { | 68 | } else { |
| @@ -77,15 +77,8 @@ export struct Card10Component { | @@ -77,15 +77,8 @@ export struct Card10Component { | ||
| 77 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) | 77 | InfomationCardClick.track(this.compDTO, this.contentDTO, this.pageId, this.pageName) |
| 78 | ProcessUtils.processPage(this.contentDTO) | 78 | ProcessUtils.processPage(this.contentDTO) |
| 79 | }) | 79 | }) |
| 80 | - if(this.contentDTO.objectType == '5'){ | ||
| 81 | - Notes({ objectType: this.contentDTO.objectType }).align(Alignment.Center).margin({ left: 5, bottom: 5 }) | ||
| 82 | - } else { | ||
| 83 | - if (this.contentDTO.seoTags) { | ||
| 84 | - Notes({ newTags: this.contentDTO.seoTags }).align(Alignment.Center) | ||
| 85 | - } | ||
| 86 | - if (this.contentDTO.newTags) { | ||
| 87 | - Notes({ newTags: this.contentDTO.newTags }).align(Alignment.Center) | ||
| 88 | - } | 80 | + if (this.contentDTO.objectType == '5') { |
| 81 | + Notes({ objectType: 5 }).margin({ left: 5, bottom: 5 }) | ||
| 89 | } | 82 | } |
| 90 | }.alignContent(Alignment.BottomStart) | 83 | }.alignContent(Alignment.BottomStart) |
| 91 | 84 | ||
| @@ -135,15 +128,8 @@ export struct Card10Component { | @@ -135,15 +128,8 @@ export struct Card10Component { | ||
| 135 | Row() { | 128 | Row() { |
| 136 | Column() { | 129 | Column() { |
| 137 | Stack() { | 130 | Stack() { |
| 138 | - if(this.contentDTO.objectType == '5'){ | ||
| 139 | - Notes({ objectType: this.contentDTO.objectType }).align(Alignment.Center) | ||
| 140 | - } else { | ||
| 141 | - if (this.contentDTO.seoTags) { | ||
| 142 | - Notes({ newTags: this.contentDTO.seoTags }).align(Alignment.Center) | ||
| 143 | - } | ||
| 144 | - if (this.contentDTO.newTags) { | ||
| 145 | - Notes({ newTags: this.contentDTO.newTags }).align(Alignment.Center) | ||
| 146 | - } | 131 | + if (item.objectType == '5') { |
| 132 | + Notes({ objectType: 5 }) | ||
| 147 | } | 133 | } |
| 148 | Text(item.newsTitle) | 134 | Text(item.newsTitle) |
| 149 | .fontSize($r('app.float.font_size_17')) | 135 | .fontSize($r('app.float.font_size_17')) |
| @@ -151,12 +137,10 @@ export struct Card10Component { | @@ -151,12 +137,10 @@ export struct Card10Component { | ||
| 151 | .fontColor($r('app.color.color_222222')) | 137 | .fontColor($r('app.color.color_222222')) |
| 152 | .maxLines(2) | 138 | .maxLines(2) |
| 153 | .textOverflow({ overflow: TextOverflow.Ellipsis }) | 139 | .textOverflow({ overflow: TextOverflow.Ellipsis }) |
| 154 | - .textIndent((this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) > 2 && | ||
| 155 | - (this.contentDTO.newTags?.length || this.contentDTO.seoTags?.length) < 5 ? 58 : | ||
| 156 | - ((this.contentDTO.newTags?.length > 0 || this.contentDTO.seoTags?.length > 0) || this.contentDTO.objectType == '5') ? 35 : | ||
| 157 | - 0 ) | 140 | + .textIndent(item.objectType == '5' ? 38 : 0) |
| 158 | }.alignContent(Alignment.TopStart) | 141 | }.alignContent(Alignment.TopStart) |
| 159 | 142 | ||
| 143 | + Blank() | ||
| 160 | //bottom 评论等信息 | 144 | //bottom 评论等信息 |
| 161 | CardSourceInfo( | 145 | CardSourceInfo( |
| 162 | { | 146 | { |
| @@ -166,6 +150,7 @@ export struct Card10Component { | @@ -166,6 +150,7 @@ export struct Card10Component { | ||
| 166 | ) | 150 | ) |
| 167 | } | 151 | } |
| 168 | .layoutWeight(1) | 152 | .layoutWeight(1) |
| 153 | + .height(78) | ||
| 169 | .alignItems(HorizontalAlign.Start) | 154 | .alignItems(HorizontalAlign.Start) |
| 170 | 155 | ||
| 171 | // 右侧图片 | 156 | // 右侧图片 |
| @@ -183,6 +168,7 @@ export struct Card10Component { | @@ -183,6 +168,7 @@ export struct Card10Component { | ||
| 183 | }) | 168 | }) |
| 184 | } | 169 | } |
| 185 | .alignContent(Alignment.BottomEnd) | 170 | .alignContent(Alignment.BottomEnd) |
| 171 | + .height(78) | ||
| 186 | } | 172 | } |
| 187 | } | 173 | } |
| 188 | .padding({ top: 10, bottom: 10 }) | 174 | .padding({ top: 10, bottom: 10 }) |
| @@ -39,13 +39,13 @@ export struct Card11Component { | @@ -39,13 +39,13 @@ export struct Card11Component { | ||
| 39 | Column() { | 39 | Column() { |
| 40 | Stack() { | 40 | Stack() { |
| 41 | if(this.contentDTO.objectType == '5'){ | 41 | if(this.contentDTO.objectType == '5'){ |
| 42 | - Notes({ objectType: this.contentDTO.objectType }).align(Alignment.Center) | 42 | + Notes({ objectType: this.contentDTO.objectType }).height(20).align(Alignment.Center) |
| 43 | } else { | 43 | } else { |
| 44 | if (this.contentDTO.seoTags) { | 44 | if (this.contentDTO.seoTags) { |
| 45 | - Notes({ newTags: this.contentDTO.seoTags }).align(Alignment.Center) | 45 | + Notes({ newTags: this.contentDTO.seoTags }).height(20).align(Alignment.Center) |
| 46 | } | 46 | } |
| 47 | if (this.contentDTO.newTags) { | 47 | if (this.contentDTO.newTags) { |
| 48 | - Notes({ newTags: this.contentDTO.newTags }).align(Alignment.Center) | 48 | + Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center) |
| 49 | } | 49 | } |
| 50 | } | 50 | } |
| 51 | Text() { | 51 | Text() { |
| @@ -38,7 +38,16 @@ export struct Card12Component { | @@ -38,7 +38,16 @@ export struct Card12Component { | ||
| 38 | Column() { | 38 | Column() { |
| 39 | // rmh信息 | 39 | // rmh信息 |
| 40 | if (this.contentDTO.rmhInfo) { | 40 | if (this.contentDTO.rmhInfo) { |
| 41 | - RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime }) | 41 | + RmhTitle( |
| 42 | + { | ||
| 43 | + rmhInfo: this.contentDTO.rmhInfo, | ||
| 44 | + publishTime: this.contentDTO.publishTime, | ||
| 45 | + contentDTO: this.contentDTO, | ||
| 46 | + compDTO: this.compDTO, | ||
| 47 | + pageId: this.pageId, | ||
| 48 | + pageName: this.pageName | ||
| 49 | + } | ||
| 50 | + ) | ||
| 42 | } | 51 | } |
| 43 | // 标题 | 52 | // 标题 |
| 44 | if (this.contentDTO.newsTitle) { | 53 | if (this.contentDTO.newsTitle) { |
| @@ -41,7 +41,16 @@ export struct Card14Component { | @@ -41,7 +41,16 @@ export struct Card14Component { | ||
| 41 | Column() { | 41 | Column() { |
| 42 | // rmh信息 | 42 | // rmh信息 |
| 43 | if (this.contentDTO.rmhInfo) { | 43 | if (this.contentDTO.rmhInfo) { |
| 44 | - RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime }) | 44 | + RmhTitle( |
| 45 | + { | ||
| 46 | + rmhInfo: this.contentDTO.rmhInfo, | ||
| 47 | + publishTime: this.contentDTO.publishTime, | ||
| 48 | + contentDTO: this.contentDTO, | ||
| 49 | + compDTO: this.compDTO, | ||
| 50 | + pageId: this.pageId, | ||
| 51 | + pageName: this.pageName | ||
| 52 | + } | ||
| 53 | + ) | ||
| 45 | } | 54 | } |
| 46 | // 左标题,右图 | 55 | // 左标题,右图 |
| 47 | Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween }) { | 56 | Flex({ direction: FlexDirection.Row, justifyContent: FlexAlign.SpaceBetween }) { |
| @@ -44,8 +44,16 @@ export struct Card15Component { | @@ -44,8 +44,16 @@ export struct Card15Component { | ||
| 44 | build() { | 44 | build() { |
| 45 | Column() { | 45 | Column() { |
| 46 | // rmh信息 | 46 | // rmh信息 |
| 47 | - RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime }) | ||
| 48 | - //新闻标题 | 47 | + RmhTitle( |
| 48 | + { | ||
| 49 | + rmhInfo: this.contentDTO.rmhInfo, | ||
| 50 | + publishTime: this.contentDTO.publishTime, | ||
| 51 | + contentDTO: this.contentDTO, | ||
| 52 | + compDTO: this.compDTO, | ||
| 53 | + pageId: this.pageId, | ||
| 54 | + pageName: this.pageName | ||
| 55 | + } | ||
| 56 | + ) //新闻标题 | ||
| 49 | if (this.contentDTO.newsTitle) { | 57 | if (this.contentDTO.newsTitle) { |
| 50 | Text() { | 58 | Text() { |
| 51 | if (this.titleMarked) { | 59 | if (this.titleMarked) { |
| @@ -46,7 +46,16 @@ export struct Card16Component { | @@ -46,7 +46,16 @@ export struct Card16Component { | ||
| 46 | Column() { | 46 | Column() { |
| 47 | // rmh信息 | 47 | // rmh信息 |
| 48 | if (this.contentDTO.rmhInfo) { | 48 | if (this.contentDTO.rmhInfo) { |
| 49 | - RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime }) | 49 | + RmhTitle( |
| 50 | + { | ||
| 51 | + rmhInfo: this.contentDTO.rmhInfo, | ||
| 52 | + publishTime: this.contentDTO.publishTime, | ||
| 53 | + contentDTO: this.contentDTO, | ||
| 54 | + compDTO: this.compDTO, | ||
| 55 | + pageId: this.pageId, | ||
| 56 | + pageName: this.pageName | ||
| 57 | + } | ||
| 58 | + ) | ||
| 50 | } | 59 | } |
| 51 | // 标题 | 60 | // 标题 |
| 52 | if (this.contentDTO.newsTitle) { | 61 | if (this.contentDTO.newsTitle) { |
| @@ -38,8 +38,16 @@ export struct Card19Component { | @@ -38,8 +38,16 @@ export struct Card19Component { | ||
| 38 | build() { | 38 | build() { |
| 39 | Column() { | 39 | Column() { |
| 40 | // rmh信息 | 40 | // rmh信息 |
| 41 | - RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime }) | ||
| 42 | - // 标题 | 41 | + RmhTitle( |
| 42 | + { | ||
| 43 | + rmhInfo: this.contentDTO.rmhInfo, | ||
| 44 | + publishTime: this.contentDTO.publishTime, | ||
| 45 | + contentDTO: this.contentDTO, | ||
| 46 | + compDTO: this.compDTO, | ||
| 47 | + pageId: this.pageId, | ||
| 48 | + pageName: this.pageName | ||
| 49 | + } | ||
| 50 | + ) // 标题 | ||
| 43 | if (this.contentDTO.newsTitle) { | 51 | if (this.contentDTO.newsTitle) { |
| 44 | Text() { | 52 | Text() { |
| 45 | if (this.titleMarked) { | 53 | if (this.titleMarked) { |
| @@ -38,8 +38,16 @@ export struct Card20Component { | @@ -38,8 +38,16 @@ export struct Card20Component { | ||
| 38 | build() { | 38 | build() { |
| 39 | Column() { | 39 | Column() { |
| 40 | // rmh信息 | 40 | // rmh信息 |
| 41 | - RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime }) | ||
| 42 | - // 标题 | 41 | + RmhTitle( |
| 42 | + { | ||
| 43 | + rmhInfo: this.contentDTO.rmhInfo, | ||
| 44 | + publishTime: this.contentDTO.publishTime, | ||
| 45 | + contentDTO: this.contentDTO, | ||
| 46 | + compDTO: this.compDTO, | ||
| 47 | + pageId: this.pageId, | ||
| 48 | + pageName: this.pageName | ||
| 49 | + } | ||
| 50 | + ) // 标题 | ||
| 43 | if (this.contentDTO.newsTitle) { | 51 | if (this.contentDTO.newsTitle) { |
| 44 | Text() { | 52 | Text() { |
| 45 | 53 |
| @@ -40,8 +40,16 @@ export struct Card21Component { | @@ -40,8 +40,16 @@ export struct Card21Component { | ||
| 40 | build() { | 40 | build() { |
| 41 | Column() { | 41 | Column() { |
| 42 | // 顶部 rmh信息 | 42 | // 顶部 rmh信息 |
| 43 | - RmhTitle({ rmhInfo: this.contentDTO.rmhInfo, publishTime: this.contentDTO.publishTime }) | ||
| 44 | - // 中间内容 | 43 | + RmhTitle( |
| 44 | + { | ||
| 45 | + rmhInfo: this.contentDTO.rmhInfo, | ||
| 46 | + publishTime: this.contentDTO.publishTime, | ||
| 47 | + contentDTO: this.contentDTO, | ||
| 48 | + compDTO: this.compDTO, | ||
| 49 | + pageId: this.pageId, | ||
| 50 | + pageName: this.pageName | ||
| 51 | + } | ||
| 52 | + ) // 中间内容 | ||
| 45 | Grid() { | 53 | Grid() { |
| 46 | GridItem() { | 54 | GridItem() { |
| 47 | Text() { | 55 | Text() { |
| @@ -61,13 +61,13 @@ export struct Card2Component { | @@ -61,13 +61,13 @@ export struct Card2Component { | ||
| 61 | // } | 61 | // } |
| 62 | // } | 62 | // } |
| 63 | if(this.contentDTO.objectType == '5'){ | 63 | if(this.contentDTO.objectType == '5'){ |
| 64 | - Notes({ objectType: this.contentDTO.objectType }).align(Alignment.Center) | 64 | + Notes({ objectType: this.contentDTO.objectType }).height(20).align(Alignment.Center) |
| 65 | } else { | 65 | } else { |
| 66 | if (this.contentDTO.seoTags) { | 66 | if (this.contentDTO.seoTags) { |
| 67 | - Notes({ newTags: this.contentDTO.seoTags }).align(Alignment.Center) | 67 | + Notes({ newTags: this.contentDTO.seoTags }).height(20).align(Alignment.Center) |
| 68 | } | 68 | } |
| 69 | if (this.contentDTO.newTags) { | 69 | if (this.contentDTO.newTags) { |
| 70 | - Notes({ newTags: this.contentDTO.newTags }).align(Alignment.Center) | 70 | + Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center) |
| 71 | } | 71 | } |
| 72 | } | 72 | } |
| 73 | //新闻标题 | 73 | //新闻标题 |
| @@ -42,13 +42,13 @@ export struct Card3Component { | @@ -42,13 +42,13 @@ export struct Card3Component { | ||
| 42 | // Notes({ objectType: this.contentDTO.objectType }).height(27).align(Alignment.Center) | 42 | // Notes({ objectType: this.contentDTO.objectType }).height(27).align(Alignment.Center) |
| 43 | // } | 43 | // } |
| 44 | if(this.contentDTO.objectType == '5'){ | 44 | if(this.contentDTO.objectType == '5'){ |
| 45 | - Notes({ objectType: this.contentDTO.objectType }).align(Alignment.Center) | 45 | + Notes({ objectType: this.contentDTO.objectType }).height(20).align(Alignment.Center) |
| 46 | } else { | 46 | } else { |
| 47 | if (this.contentDTO.seoTags) { | 47 | if (this.contentDTO.seoTags) { |
| 48 | - Notes({ newTags: this.contentDTO.seoTags }).align(Alignment.Center) | 48 | + Notes({ newTags: this.contentDTO.seoTags }).height(20).align(Alignment.Center) |
| 49 | } | 49 | } |
| 50 | if (this.contentDTO.newTags) { | 50 | if (this.contentDTO.newTags) { |
| 51 | - Notes({ newTags: this.contentDTO.newTags }).align(Alignment.Center) | 51 | + Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center) |
| 52 | } | 52 | } |
| 53 | } | 53 | } |
| 54 | Text() { | 54 | Text() { |
| @@ -44,10 +44,25 @@ export struct Card5Component { | @@ -44,10 +44,25 @@ export struct Card5Component { | ||
| 44 | Image(this.loadImg ? this.contentDTO.coverUrl : '') | 44 | Image(this.loadImg ? this.contentDTO.coverUrl : '') |
| 45 | .backgroundColor(0xf5f5f5) | 45 | .backgroundColor(0xf5f5f5) |
| 46 | .width(CommonConstants.FULL_WIDTH) | 46 | .width(CommonConstants.FULL_WIDTH) |
| 47 | - .borderRadius($r('app.float.image_border_radius')) | 47 | + .borderRadius( |
| 48 | + { | ||
| 49 | + topLeft: $r('app.float.image_border_radius'), | ||
| 50 | + topRight: $r('app.float.image_border_radius'), | ||
| 51 | + bottomLeft: $r('app.float.image_border_radius'), | ||
| 52 | + bottomRight: $r('app.float.image_border_radius') | ||
| 53 | + } | ||
| 54 | + ) | ||
| 48 | .aspectRatio(343 / 225) | 55 | .aspectRatio(343 / 225) |
| 49 | if (this.titleShowPolicy === 1 || this.titleShowPolicy === null || this.titleShowPolicy === '') { | 56 | if (this.titleShowPolicy === 1 || this.titleShowPolicy === null || this.titleShowPolicy === '') { |
| 50 | Row() | 57 | Row() |
| 58 | + .borderRadius( | ||
| 59 | + { | ||
| 60 | + topLeft: $r('app.float.image_border_radius'), | ||
| 61 | + topRight: $r('app.float.image_border_radius'), | ||
| 62 | + bottomLeft: $r('app.float.image_border_radius'), | ||
| 63 | + bottomRight: $r('app.float.image_border_radius') | ||
| 64 | + } | ||
| 65 | + ) | ||
| 51 | .width(CommonConstants.FULL_WIDTH) | 66 | .width(CommonConstants.FULL_WIDTH) |
| 52 | .height(59) | 67 | .height(59) |
| 53 | .linearGradient({ | 68 | .linearGradient({ |
| @@ -55,16 +70,17 @@ export struct Card5Component { | @@ -55,16 +70,17 @@ export struct Card5Component { | ||
| 55 | ['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0] | 70 | ['rgba(0, 0, 0, 0.0)', 0.0], ['rgba(0, 0, 0, 0.3)', 1.0] |
| 56 | ] | 71 | ] |
| 57 | }) | 72 | }) |
| 73 | + | ||
| 58 | Row() { | 74 | Row() { |
| 59 | Stack() { | 75 | Stack() { |
| 60 | if(this.contentDTO.objectType == '5'){ | 76 | if(this.contentDTO.objectType == '5'){ |
| 61 | - Notes({ objectType: this.contentDTO.objectType }).align(Alignment.Center) | 77 | + Notes({ objectType: this.contentDTO.objectType }).height(20).align(Alignment.Center) |
| 62 | } else { | 78 | } else { |
| 63 | if (this.contentDTO.seoTags) { | 79 | if (this.contentDTO.seoTags) { |
| 64 | - Notes({ newTags: this.contentDTO.seoTags }).align(Alignment.Center) | 80 | + Notes({ newTags: this.contentDTO.seoTags }).height(20).align(Alignment.Center) |
| 65 | } | 81 | } |
| 66 | if (this.contentDTO.newTags) { | 82 | if (this.contentDTO.newTags) { |
| 67 | - Notes({ newTags: this.contentDTO.newTags }).align(Alignment.Center) | 83 | + Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center) |
| 68 | } | 84 | } |
| 69 | } | 85 | } |
| 70 | 86 |
| @@ -53,17 +53,16 @@ export struct Card6Component { | @@ -53,17 +53,16 @@ export struct Card6Component { | ||
| 53 | // } | 53 | // } |
| 54 | Stack() { | 54 | Stack() { |
| 55 | if(this.contentDTO.objectType == '5'){ | 55 | if(this.contentDTO.objectType == '5'){ |
| 56 | - Notes({ objectType: this.contentDTO.objectType }).align(Alignment.Center) | 56 | + Notes({ objectType: this.contentDTO.objectType }).height(28).align(Alignment.Center) |
| 57 | } else { | 57 | } else { |
| 58 | if (this.contentDTO.seoTags) { | 58 | if (this.contentDTO.seoTags) { |
| 59 | - Notes({ newTags: this.contentDTO.seoTags }).align(Alignment.Center) | 59 | + Notes({ newTags: this.contentDTO.seoTags }).height(28).align(Alignment.Center) |
| 60 | } | 60 | } |
| 61 | if (this.contentDTO.newTags) { | 61 | if (this.contentDTO.newTags) { |
| 62 | - Notes({ newTags: this.contentDTO.newTags }).align(Alignment.Center) | 62 | + Notes({ newTags: this.contentDTO.newTags }).height(28).align(Alignment.Center) |
| 63 | } | 63 | } |
| 64 | } | 64 | } |
| 65 | 65 | ||
| 66 | - | ||
| 67 | Text() { | 66 | Text() { |
| 68 | if (this.titleMarked) { | 67 | if (this.titleMarked) { |
| 69 | ForEach(this.textArr, (textItem: textItem) => { | 68 | ForEach(this.textArr, (textItem: textItem) => { |
| @@ -89,14 +89,14 @@ export struct Card9Component { | @@ -89,14 +89,14 @@ export struct Card9Component { | ||
| 89 | topRight: $r('app.float.image_border_radius') | 89 | topRight: $r('app.float.image_border_radius') |
| 90 | }) | 90 | }) |
| 91 | if(this.contentDTO.objectType == '5'){ | 91 | if(this.contentDTO.objectType == '5'){ |
| 92 | - Notes({ objectType: this.contentDTO.objectType }).align(Alignment.Center) | 92 | + Notes({ objectType: this.contentDTO.objectType }).height(20).align(Alignment.Center) |
| 93 | .margin({ left: 5, bottom: 5 }) | 93 | .margin({ left: 5, bottom: 5 }) |
| 94 | } else { | 94 | } else { |
| 95 | if (this.contentDTO.seoTags) { | 95 | if (this.contentDTO.seoTags) { |
| 96 | - Notes({ newTags: this.contentDTO.seoTags }).align(Alignment.Center) | 96 | + Notes({ newTags: this.contentDTO.seoTags }).height(20).align(Alignment.Center) |
| 97 | } | 97 | } |
| 98 | if (this.contentDTO.newTags) { | 98 | if (this.contentDTO.newTags) { |
| 99 | - Notes({ newTags: this.contentDTO.newTags }).align(Alignment.Center) | 99 | + Notes({ newTags: this.contentDTO.newTags }).height(20).align(Alignment.Center) |
| 100 | } | 100 | } |
| 101 | } | 101 | } |
| 102 | 102 |
| @@ -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() { |
| @@ -256,12 +256,14 @@ export struct CommentComponent { | @@ -256,12 +256,14 @@ export struct CommentComponent { | ||
| 256 | 256 | ||
| 257 | //获取数据 | 257 | //获取数据 |
| 258 | async getData() { | 258 | async getData() { |
| 259 | - commentViewModel.fetchContentCommentList(this.currentPage + '', this.publishCommentModel.targetId, | 259 | + let pageIndex = this.currentPage |
| 260 | + commentViewModel.fetchContentCommentList(pageIndex + '', this.publishCommentModel.targetId, | ||
| 260 | this.publishCommentModel.targetType) | 261 | this.publishCommentModel.targetType) |
| 261 | .then(commentListModel => { | 262 | .then(commentListModel => { |
| 262 | console.log('评论:', JSON.stringify(commentListModel.list)) | 263 | console.log('评论:', JSON.stringify(commentListModel.list)) |
| 263 | - this.currentPage++ | ||
| 264 | 264 | ||
| 265 | + // 这里需要先赋值,否则下次UI刷新可能重复进入第1页两次 | ||
| 266 | + this.currentPage = pageIndex + 1 | ||
| 265 | if (Number.parseInt(commentListModel.totalCommentNum) > | 267 | if (Number.parseInt(commentListModel.totalCommentNum) > |
| 266 | Number.parseInt(this.publishCommentModel.totalCommentNumer)) { | 268 | Number.parseInt(this.publishCommentModel.totalCommentNumer)) { |
| 267 | this.publishCommentModel.totalCommentNumer = commentListModel.totalCommentNum + '' | 269 | this.publishCommentModel.totalCommentNumer = commentListModel.totalCommentNum + '' |
| @@ -279,7 +281,9 @@ export struct CommentComponent { | @@ -279,7 +281,9 @@ export struct CommentComponent { | ||
| 279 | 281 | ||
| 280 | if (commentListModel && commentListModel.list && commentListModel.list.length > 0) { | 282 | if (commentListModel && commentListModel.list && commentListModel.list.length > 0) { |
| 281 | 283 | ||
| 284 | + if (pageIndex == 1) { | ||
| 282 | this.allDatas.clearAllData() // 防止数据重复问题 | 285 | this.allDatas.clearAllData() // 防止数据重复问题 |
| 286 | + } | ||
| 283 | commentListModel.list.forEach(element => { | 287 | commentListModel.list.forEach(element => { |
| 284 | element.hasMore = Number.parseInt(element.childCommentNum) ? true : false | 288 | element.hasMore = Number.parseInt(element.childCommentNum) ? true : false |
| 285 | let newModel = commentViewModel.deepCopyCommentItemModel(element) | 289 | let newModel = commentViewModel.deepCopyCommentItemModel(element) |
| @@ -289,7 +293,6 @@ export struct CommentComponent { | @@ -289,7 +293,6 @@ export struct CommentComponent { | ||
| 289 | this.allDatas.push(newModel) | 293 | this.allDatas.push(newModel) |
| 290 | }); | 294 | }); |
| 291 | 295 | ||
| 292 | - | ||
| 293 | } else { | 296 | } else { |
| 294 | this.hasMore = false | 297 | this.hasMore = false |
| 295 | } | 298 | } |
| @@ -327,7 +330,7 @@ struct ChildCommentItem { | @@ -327,7 +330,7 @@ struct ChildCommentItem { | ||
| 327 | } | 330 | } |
| 328 | } | 331 | } |
| 329 | .maxLines(1) | 332 | .maxLines(1) |
| 330 | - .layoutWeight(1) | 333 | + .flexShrink(1) |
| 331 | .fontSize(14) | 334 | .fontSize(14) |
| 332 | .fontColor($r('app.color.color_222222')) | 335 | .fontColor($r('app.color.color_222222')) |
| 333 | .fontWeight(FontWeight.Medium) | 336 | .fontWeight(FontWeight.Medium) |
| @@ -338,7 +341,7 @@ struct ChildCommentItem { | @@ -338,7 +341,7 @@ struct ChildCommentItem { | ||
| 338 | /// 人民号>置顶>作者 | 341 | /// 人民号>置顶>作者 |
| 339 | 342 | ||
| 340 | //人民号 | 343 | //人民号 |
| 341 | - if (this.item.fromUserType !== 1) { | 344 | + if (this.item.fromUserType == 2) { |
| 342 | Image($r('app.media.comment_rmh_tag')).width(20).height(20).margin({ left: 5 }); | 345 | Image($r('app.media.comment_rmh_tag')).width(20).height(20).margin({ left: 5 }); |
| 343 | } | 346 | } |
| 344 | //置顶 | 347 | //置顶 |
| @@ -541,6 +544,8 @@ struct commentHeaderView { | @@ -541,6 +544,8 @@ struct commentHeaderView { | ||
| 541 | //昵称 | 544 | //昵称 |
| 542 | Text(this.item.fromUserName) | 545 | Text(this.item.fromUserName) |
| 543 | .fontSize(14) | 546 | .fontSize(14) |
| 547 | + .maxLines(1) | ||
| 548 | + .flexShrink(1) | ||
| 544 | .fontColor($r('app.color.color_222222')) | 549 | .fontColor($r('app.color.color_222222')) |
| 545 | .fontWeight(FontWeight.Medium) | 550 | .fontWeight(FontWeight.Medium) |
| 546 | .margin({ left: 5 }) | 551 | .margin({ left: 5 }) |
| @@ -550,7 +555,7 @@ struct commentHeaderView { | @@ -550,7 +555,7 @@ struct commentHeaderView { | ||
| 550 | /// 人民号>置顶>作者 | 555 | /// 人民号>置顶>作者 |
| 551 | 556 | ||
| 552 | //人民号 | 557 | //人民号 |
| 553 | - if (this.item.fromUserType !== 1) { | 558 | + if (this.item.fromUserType == 2) { |
| 554 | Image($r('app.media.comment_rmh_tag')).width(20).height(20).margin({ left: 5 }); | 559 | Image($r('app.media.comment_rmh_tag')).width(20).height(20).margin({ left: 5 }); |
| 555 | } | 560 | } |
| 556 | //置顶 | 561 | //置顶 |
| @@ -11,6 +11,7 @@ export struct CommentListDialogView { | @@ -11,6 +11,7 @@ export struct CommentListDialogView { | ||
| 11 | @Link @Watch('showCommentListChange') showCommentList: boolean | 11 | @Link @Watch('showCommentListChange') showCommentList: boolean |
| 12 | @Link contentDetailData: ContentDetailDTO // 详情页传 | 12 | @Link contentDetailData: ContentDetailDTO // 详情页传 |
| 13 | @Link pageInfo: PageInfoDTO // 专题页传 | 13 | @Link pageInfo: PageInfoDTO // 专题页传 |
| 14 | + @Link publishCommentModel: publishCommentModel | ||
| 14 | onClose?: () => void | 15 | onClose?: () => void |
| 15 | 16 | ||
| 16 | // @Consume pageId: TrackConstants.PageName | 17 | // @Consume pageId: TrackConstants.PageName |
| @@ -19,6 +20,7 @@ export struct CommentListDialogView { | @@ -19,6 +20,7 @@ export struct CommentListDialogView { | ||
| 19 | private dialogController: CustomDialogController = new CustomDialogController({ | 20 | private dialogController: CustomDialogController = new CustomDialogController({ |
| 20 | builder: CommentListDialog({ | 21 | builder: CommentListDialog({ |
| 21 | contentDetailData: this.contentDetailData, | 22 | contentDetailData: this.contentDetailData, |
| 23 | + publishCommentModel:this.publishCommentModel, | ||
| 22 | pageInfo: this.pageInfo, | 24 | pageInfo: this.pageInfo, |
| 23 | onClose: this.onClose | 25 | onClose: this.onClose |
| 24 | }), | 26 | }), |
| @@ -47,7 +49,7 @@ export struct CommentListDialogView { | @@ -47,7 +49,7 @@ export struct CommentListDialogView { | ||
| 47 | struct CommentListDialog { | 49 | struct CommentListDialog { |
| 48 | 50 | ||
| 49 | /// 内部使用 | 51 | /// 内部使用 |
| 50 | - @State private publishCommentModel: publishCommentModel = new publishCommentModel() | 52 | + @Link publishCommentModel: publishCommentModel |
| 51 | @State private operationButtonList: string[] = [] | 53 | @State private operationButtonList: string[] = [] |
| 52 | controller?: CustomDialogController | 54 | controller?: CustomDialogController |
| 53 | @State windowWidth: number = AppStorage.get<number>('windowWidth') || 0 | 55 | @State windowWidth: number = AppStorage.get<number>('windowWidth') || 0 |
| @@ -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() |
| @@ -223,7 +224,8 @@ struct CarouselLayout01CardView { | @@ -223,7 +224,8 @@ struct CarouselLayout01CardView { | ||
| 223 | // if (this.item.objectType == '5' || this.item.objectType == '6') { | 224 | // if (this.item.objectType == '5' || this.item.objectType == '6') { |
| 224 | // Notes({ objectType: this.item.objectType }) | 225 | // Notes({ objectType: this.item.objectType }) |
| 225 | // } | 226 | // } |
| 226 | - Text(`${this.item.corner}${this.item.newsTitle}`) | 227 | + //Text(`${this.item.corner}${this.item.newsTitle}`) |
| 228 | + Text(`${this.item.newsTitle}`) | ||
| 227 | .width(CommonConstants.FULL_PARENT) | 229 | .width(CommonConstants.FULL_PARENT) |
| 228 | .fontColor(Color.White) | 230 | .fontColor(Color.White) |
| 229 | .fontSize($r('app.float.font_size_18')) | 231 | .fontSize($r('app.float.font_size_18')) |
| @@ -16,7 +16,7 @@ export default struct MinePagePersonFunctionUI { | @@ -16,7 +16,7 @@ export default struct MinePagePersonFunctionUI { | ||
| 16 | Grid(){ | 16 | Grid(){ |
| 17 | ForEach(this.personalData,(item:MinePagePersonalFunctionsItem,index:number)=>{ | 17 | ForEach(this.personalData,(item:MinePagePersonalFunctionsItem,index:number)=>{ |
| 18 | GridItem(){ | 18 | GridItem(){ |
| 19 | - PagePersonFunction({ item: item, noDivider : (index % 4 < 3 && index != this.personalData.length-1) ? false : true}) | 19 | + PagePersonFunction({ item: item, noDivider : (index % 5 < 4 && index != this.personalData.length-1) ? false : true}) |
| 20 | }.onClick(()=>{ | 20 | }.onClick(()=>{ |
| 21 | console.log(index+"") | 21 | console.log(index+"") |
| 22 | switch (item.msg){ | 22 | switch (item.msg){ |
| @@ -77,14 +77,14 @@ export default struct MinePagePersonFunctionUI { | @@ -77,14 +77,14 @@ export default struct MinePagePersonFunctionUI { | ||
| 77 | break; | 77 | break; |
| 78 | } | 78 | } |
| 79 | } | 79 | } |
| 80 | - }).width('169lpx') | 80 | + }).width('142lpx') |
| 81 | .height('117lpx') | 81 | .height('117lpx') |
| 82 | }) | 82 | }) |
| 83 | } | 83 | } |
| 84 | - .rowsTemplate('1fr 1fr') | ||
| 85 | - .columnsTemplate('1fr 1fr 1fr 1fr') | ||
| 86 | - .height('234lpx') | ||
| 87 | - .margin({top:'31lpx',left:'23lpx',right:'23lpx' }) | 84 | + .rowsTemplate('1fr') |
| 85 | + .columnsTemplate('1fr 1fr 1fr 1fr 1fr') | ||
| 86 | + .height('117lpx') | ||
| 87 | + .margin({top:'31lpx'}) | ||
| 88 | } | 88 | } |
| 89 | 89 | ||
| 90 | messageClick(){ | 90 | messageClick(){ |
| @@ -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{ |
| @@ -102,7 +102,8 @@ export struct FollowListDetailUI { | @@ -102,7 +102,8 @@ export struct FollowListDetailUI { | ||
| 102 | } | 102 | } |
| 103 | } | 103 | } |
| 104 | } | 104 | } |
| 105 | - .cachedCount(10) | 105 | + .edgeEffect(EdgeEffect.None) |
| 106 | + .cachedCount(5) | ||
| 106 | .padding({ left: '31lpx', right: '31lpx' }) | 107 | .padding({ left: '31lpx', right: '31lpx' }) |
| 107 | .layoutWeight(1) | 108 | .layoutWeight(1) |
| 108 | .scrollBar(BarState.Off) | 109 | .scrollBar(BarState.Off) |
| @@ -109,7 +109,7 @@ export struct HomePageBottomCommentComponent { | @@ -109,7 +109,7 @@ export struct HomePageBottomCommentComponent { | ||
| 109 | } | 109 | } |
| 110 | } | 110 | } |
| 111 | } | 111 | } |
| 112 | - .cachedCount(15) | 112 | + .cachedCount(5) |
| 113 | .layoutWeight(1) | 113 | .layoutWeight(1) |
| 114 | .scrollBar(BarState.Off) | 114 | .scrollBar(BarState.Off) |
| 115 | .edgeEffect(EdgeEffect.None) | 115 | .edgeEffect(EdgeEffect.None) |
| @@ -177,7 +177,7 @@ export struct HomePageBottomFollowComponent { | @@ -177,7 +177,7 @@ export struct HomePageBottomFollowComponent { | ||
| 177 | } | 177 | } |
| 178 | } | 178 | } |
| 179 | } | 179 | } |
| 180 | - .cachedCount(15) | 180 | + .cachedCount(5) |
| 181 | .padding({ left: '31lpx', right: '31lpx' }) | 181 | .padding({ left: '31lpx', right: '31lpx' }) |
| 182 | .layoutWeight(1) | 182 | .layoutWeight(1) |
| 183 | .scrollBar(BarState.Off) | 183 | .scrollBar(BarState.Off) |
| @@ -109,7 +109,7 @@ export struct OtherHomePageBottomCommentComponent { | @@ -109,7 +109,7 @@ export struct OtherHomePageBottomCommentComponent { | ||
| 109 | } | 109 | } |
| 110 | } | 110 | } |
| 111 | } | 111 | } |
| 112 | - .cachedCount(15) | 112 | + .cachedCount(5) |
| 113 | .layoutWeight(1) | 113 | .layoutWeight(1) |
| 114 | .scrollBar(BarState.Off) | 114 | .scrollBar(BarState.Off) |
| 115 | .edgeEffect(EdgeEffect.None) | 115 | .edgeEffect(EdgeEffect.None) |
| @@ -138,7 +138,7 @@ export struct OtherHomePageBottomFollowComponent{ | @@ -138,7 +138,7 @@ export struct OtherHomePageBottomFollowComponent{ | ||
| 138 | ListHasNoMoreDataUI() | 138 | ListHasNoMoreDataUI() |
| 139 | } | 139 | } |
| 140 | } | 140 | } |
| 141 | - }.cachedCount(15) | 141 | + }.cachedCount(5) |
| 142 | .padding({left:'31lpx',right:'31lpx'}) | 142 | .padding({left:'31lpx',right:'31lpx'}) |
| 143 | .layoutWeight(1) | 143 | .layoutWeight(1) |
| 144 | .scrollBar(BarState.Off) | 144 | .scrollBar(BarState.Off) |
| @@ -542,11 +542,19 @@ export struct PaperSingleColumn999CardView { | @@ -542,11 +542,19 @@ export struct PaperSingleColumn999CardView { | ||
| 542 | if (this.item) { | 542 | if (this.item) { |
| 543 | Row() { | 543 | Row() { |
| 544 | Row() { | 544 | Row() { |
| 545 | + | ||
| 546 | + if (this.item.corner.length > 0){ | ||
| 547 | + Text(this.item.corner) | ||
| 548 | + .fontSize(12) | ||
| 549 | + .fontColor('#ED2800') | ||
| 550 | + .margin({ left: 16 }) | ||
| 551 | + } | ||
| 552 | + | ||
| 545 | if (this.buildSourceString().length > 0) { | 553 | if (this.buildSourceString().length > 0) { |
| 546 | Text(this.buildSourceString()) | 554 | Text(this.buildSourceString()) |
| 547 | .fontSize(12) | 555 | .fontSize(12) |
| 548 | .fontColor('#B0B0B0') | 556 | .fontColor('#B0B0B0') |
| 549 | - .margin({ left: 16 }) | 557 | + .margin({ left: this.item.corner.length > 0?10:16 }) |
| 550 | 558 | ||
| 551 | ///不显示时间或者不显示评论 | 559 | ///不显示时间或者不显示评论 |
| 552 | if (this.getPublishTime().length > 0 || this.item.objectType != '2' && this.interactData && this.interactData.commentNum && Number(this.interactData.commentNum) > 0) { | 560 | if (this.getPublishTime().length > 0 || this.item.objectType != '2' && this.interactData && this.interactData.commentNum && Number(this.interactData.commentNum) > 0) { |
| @@ -4,10 +4,13 @@ import { EditListInfo, editModel, editModelParams, WDEditDataModelType } from '. | @@ -4,10 +4,13 @@ import { EditListInfo, editModel, editModelParams, WDEditDataModelType } from '. | ||
| 4 | import EditInfoViewModel from '../../viewmodel/EditInfoViewModel'; | 4 | import EditInfoViewModel from '../../viewmodel/EditInfoViewModel'; |
| 5 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; | 5 | import { WDRouterPage, WDRouterRule } from 'wdRouter'; |
| 6 | import {AreaPickerDialog} from '../view/areaPickerDialog/AreaPickerDialog' | 6 | import {AreaPickerDialog} from '../view/areaPickerDialog/AreaPickerDialog' |
| 7 | +import {EditUserInfoCustomDialog} from '../view/areaPickerDialog/EditUserInfoCustomDialog' | ||
| 8 | +import {EditUserSexCustomDialog} from '../view/areaPickerDialog/EditUserSexCustomDialog' | ||
| 7 | import { AreaListModel } from '../../model/AreaListModel'; | 9 | import { AreaListModel } from '../../model/AreaListModel'; |
| 8 | import router from '@ohos.router'; | 10 | import router from '@ohos.router'; |
| 9 | import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils' | 11 | import TrackingPageBrowseUtils from '../../utils/TrackingPageBrowseUtils' |
| 10 | import { TrackConstants } from 'wdTracking/Index'; | 12 | import { TrackConstants } from 'wdTracking/Index'; |
| 13 | +import { window } from '@kit.ArkUI'; | ||
| 11 | 14 | ||
| 12 | @Entry | 15 | @Entry |
| 13 | @Component | 16 | @Component |
| @@ -16,6 +19,7 @@ struct EditUserInfoPage { | @@ -16,6 +19,7 @@ struct EditUserInfoPage { | ||
| 16 | @State headerImg: string = '' | 19 | @State headerImg: string = '' |
| 17 | @State dataSource: AreaListModel[] = [] | 20 | @State dataSource: AreaListModel[] = [] |
| 18 | @State currentUserInfo: editModel = new editModel() | 21 | @State currentUserInfo: editModel = new editModel() |
| 22 | + @State bottomSafeHeight: number = 0; | ||
| 19 | 23 | ||
| 20 | dialogController: CustomDialogController = new CustomDialogController({ | 24 | dialogController: CustomDialogController = new CustomDialogController({ |
| 21 | builder: AreaPickerDialog({dataSource:this.dataSource, | 25 | builder: AreaPickerDialog({dataSource:this.dataSource, |
| @@ -29,10 +33,51 @@ struct EditUserInfoPage { | @@ -29,10 +33,51 @@ struct EditUserInfoPage { | ||
| 29 | } | 33 | } |
| 30 | }), | 34 | }), |
| 31 | alignment: DialogAlignment.Bottom, | 35 | alignment: DialogAlignment.Bottom, |
| 32 | - offset:{dx:0,dy:0}, | 36 | + customStyle: true, |
| 37 | + offset: { | ||
| 38 | + dx: 0, | ||
| 39 | + dy: -this.bottomSafeHeight | ||
| 40 | + }, | ||
| 33 | }) | 41 | }) |
| 34 | 42 | ||
| 35 | - aboutToAppear() { | 43 | + dateDialogController: CustomDialogController = new CustomDialogController({ |
| 44 | + builder: EditUserInfoCustomDialog({ | ||
| 45 | + confirmCallback:(selectDate:Date)=>{ | ||
| 46 | + let mon = selectDate.getUTCMonth() as number + 1 | ||
| 47 | + let monStr = mon < 10? '0'+mon.toString():mon.toString(); | ||
| 48 | + let dayStr = selectDate.getUTCDate() as number < 10? '0'+selectDate.getUTCDate():selectDate.getUTCDate(); | ||
| 49 | + this.currentUserInfo.userExtend.birthday = selectDate.getUTCFullYear()+'-'+monStr+'-'+dayStr; | ||
| 50 | + this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_birthday | ||
| 51 | + this.updateEditModel() | ||
| 52 | + } | ||
| 53 | + }), | ||
| 54 | + alignment: DialogAlignment.Bottom, | ||
| 55 | + customStyle: true, | ||
| 56 | + offset: { | ||
| 57 | + dx: 0, | ||
| 58 | + dy: -this.bottomSafeHeight | ||
| 59 | + }, | ||
| 60 | + }) | ||
| 61 | + | ||
| 62 | + sexDialogController: CustomDialogController = new CustomDialogController({ | ||
| 63 | + builder: EditUserSexCustomDialog({ | ||
| 64 | + confirmCallback:(index)=>{ | ||
| 65 | + this.currentUserInfo.userExtend.sex = index; | ||
| 66 | + this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_sex | ||
| 67 | + this.updateEditModel() | ||
| 68 | + } | ||
| 69 | + }), | ||
| 70 | + alignment: DialogAlignment.Bottom, | ||
| 71 | + customStyle: true, | ||
| 72 | + offset: { | ||
| 73 | + dx: 0, | ||
| 74 | + dy: -this.bottomSafeHeight | ||
| 75 | + }, | ||
| 76 | + }) | ||
| 77 | + | ||
| 78 | + async aboutToAppear() { | ||
| 79 | + let windowHight: window.Window = await window.getLastWindow(getContext(this)); | ||
| 80 | + this.bottomSafeHeight = px2vp(windowHight.getWindowAvoidArea(window.AvoidAreaType.TYPE_SYSTEM).bottomRect.height) | ||
| 36 | this.getAccountOwnerInfo() | 81 | this.getAccountOwnerInfo() |
| 37 | this.getAreaList() | 82 | this.getAreaList() |
| 38 | } | 83 | } |
| @@ -145,31 +190,9 @@ struct EditUserInfoPage { | @@ -145,31 +190,9 @@ struct EditUserInfoPage { | ||
| 145 | }else if (i === 3){ | 190 | }else if (i === 3){ |
| 146 | this.dialogController.open() | 191 | this.dialogController.open() |
| 147 | } else if (i === 4) { | 192 | } else if (i === 4) { |
| 148 | - DatePickerDialog.show({ | ||
| 149 | - start:new Date('1900-1-1'), | ||
| 150 | - end:new Date(), | ||
| 151 | - selected:new Date, | ||
| 152 | - lunar:false, | ||
| 153 | - onAccept:(value:DatePickerResult) => { | ||
| 154 | - let mon = value.month as number + 1 | ||
| 155 | - let monStr = mon < 10? '0'+mon.toString():mon.toString(); | ||
| 156 | - let dayStr = value.day as number < 10? '0'+value.day:value.day; | ||
| 157 | - this.currentUserInfo.userExtend.birthday = value.year+'-'+monStr+'-'+dayStr; | ||
| 158 | - this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_birthday | ||
| 159 | - this.updateEditModel() | ||
| 160 | - } | ||
| 161 | - }) | 193 | + this.dateDialogController.open() |
| 162 | }else if(i === 5){ | 194 | }else if(i === 5){ |
| 163 | - TextPickerDialog.show({ | ||
| 164 | - range:['男','女'], | ||
| 165 | - canLoop:false, | ||
| 166 | - selected:this.currentUserInfo.userExtend.sex === 0?1:0, | ||
| 167 | - onAccept:(value:TextPickerResult) => { | ||
| 168 | - this.currentUserInfo.userExtend.sex = value.index == 0?1:0; | ||
| 169 | - this.currentUserInfo.editDataType = WDEditDataModelType.WDEditDataModelType_sex | ||
| 170 | - this.updateEditModel() | ||
| 171 | - } | ||
| 172 | - }) | 195 | + this.sexDialogController.open() |
| 173 | } | 196 | } |
| 174 | }) | 197 | }) |
| 175 | } | 198 | } |
| @@ -114,6 +114,7 @@ struct MyCollectionListPage { | @@ -114,6 +114,7 @@ struct MyCollectionListPage { | ||
| 114 | .height(CommonConstants.FULL_HEIGHT) | 114 | .height(CommonConstants.FULL_HEIGHT) |
| 115 | } | 115 | } |
| 116 | } | 116 | } |
| 117 | + .backgroundColor('#FFFFFF') | ||
| 117 | .width(CommonConstants.FULL_WIDTH) | 118 | .width(CommonConstants.FULL_WIDTH) |
| 118 | .height(CommonConstants.FULL_HEIGHT) | 119 | .height(CommonConstants.FULL_HEIGHT) |
| 119 | } | 120 | } |
| 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 | } |
| @@ -284,7 +289,7 @@ export struct SearchResultContentComponent { | @@ -284,7 +289,7 @@ export struct SearchResultContentComponent { | ||
| 284 | ListHasNoMoreDataUI() | 289 | ListHasNoMoreDataUI() |
| 285 | } | 290 | } |
| 286 | } | 291 | } |
| 287 | - }.cachedCount(10) | 292 | + }.cachedCount(5) |
| 288 | .edgeEffect(EdgeEffect.None) | 293 | .edgeEffect(EdgeEffect.None) |
| 289 | .scrollBar(BarState.Off) | 294 | .scrollBar(BarState.Off) |
| 290 | .onReachEnd(() => { | 295 | .onReachEnd(() => { |
| @@ -300,57 +305,6 @@ export struct SearchResultContentComponent { | @@ -300,57 +305,6 @@ export struct SearchResultContentComponent { | ||
| 300 | } | 305 | } |
| 301 | 306 | ||
| 302 | @Builder | 307 | @Builder |
| 303 | - multiCreatorUI() { | ||
| 304 | - Column() { | ||
| 305 | - List() { | ||
| 306 | - ForEach(this.data_rmh, (item: SearchRmhDescription, index: number) => { | ||
| 307 | - ListItem() { | ||
| 308 | - SearchCreatorComponent({ item: item }) | ||
| 309 | - } | ||
| 310 | - .width('150lpx') | ||
| 311 | - .height('100%') | ||
| 312 | - }) | ||
| 313 | - | ||
| 314 | - ListItem() { | ||
| 315 | - Column() { | ||
| 316 | - Text("查看更多") | ||
| 317 | - .width('19lpx') | ||
| 318 | - .fontSize('19lpx') | ||
| 319 | - .fontWeight('400lpx') | ||
| 320 | - .lineHeight('27lpx') | ||
| 321 | - .fontColor($r('app.color.color_9E9E9E')) | ||
| 322 | - } | ||
| 323 | - .borderRadius({ topLeft: '4lpx', bottomLeft: '4lpx' }) | ||
| 324 | - .height('180lpx') | ||
| 325 | - .width('77lpx') | ||
| 326 | - .backgroundColor($r('app.color.color_EDEDED')) | ||
| 327 | - .justifyContent(FlexAlign.Center) | ||
| 328 | - | ||
| 329 | - }.height('100%') | ||
| 330 | - .margin({ left: '23lpx' }) | ||
| 331 | - .onClick(() => { | ||
| 332 | - let params: Params = { | ||
| 333 | - pageID: this.keywords | ||
| 334 | - } | ||
| 335 | - WDRouterRule.jumpWithPage(WDRouterPage.searchCreatorPage, params) | ||
| 336 | - }) | ||
| 337 | - } | ||
| 338 | - .cachedCount(6) | ||
| 339 | - .edgeEffect(EdgeEffect.None) | ||
| 340 | - .scrollBar(BarState.Off) | ||
| 341 | - .listDirection(Axis.Horizontal) | ||
| 342 | - .width('100%') | ||
| 343 | - .height('219lpx') | ||
| 344 | - | ||
| 345 | - Divider() | ||
| 346 | - .width('100%') | ||
| 347 | - .height('12lpx') | ||
| 348 | - .color($r('app.color.color_F5F5F5')) | ||
| 349 | - .strokeWidth('12lpx') | ||
| 350 | - } | ||
| 351 | - } | ||
| 352 | - | ||
| 353 | - @Builder | ||
| 354 | SearchListUI() { | 308 | SearchListUI() { |
| 355 | List({space:'8lpx'}) { | 309 | List({space:'8lpx'}) { |
| 356 | ForEach(this.data_rmh, (item: SearchRmhDescription, index: number) => { | 310 | ForEach(this.data_rmh, (item: SearchRmhDescription, index: number) => { |
| @@ -459,7 +413,7 @@ export struct SearchResultContentComponent { | @@ -459,7 +413,7 @@ export struct SearchResultContentComponent { | ||
| 459 | contentDTO.tagWord = -1 | 413 | contentDTO.tagWord = -1 |
| 460 | contentDTO.isSelect = true | 414 | contentDTO.isSelect = true |
| 461 | contentDTO.rmhInfo = {} as RmhInfoDTO | 415 | contentDTO.rmhInfo = {} as RmhInfoDTO |
| 462 | - contentDTO.photoNum = -1 | 416 | + contentDTO.photoNum = StringUtils.isEmpty(value.data.picCount) ? 0 : Number(value.data.picCount) |
| 463 | contentDTO.liveInfo = {} as LiveInfoDTO; | 417 | contentDTO.liveInfo = {} as LiveInfoDTO; |
| 464 | contentDTO.videoInfo = { | 418 | contentDTO.videoInfo = { |
| 465 | videoDuration: Number.parseInt(value.data.duration) | 419 | videoDuration: Number.parseInt(value.data.duration) |
| @@ -482,7 +436,7 @@ export struct SearchResultContentComponent { | @@ -482,7 +436,7 @@ export struct SearchResultContentComponent { | ||
| 482 | contentDTO.bottomNavId = ''; | 436 | contentDTO.bottomNavId = ''; |
| 483 | contentDTO.openType = ''; | 437 | contentDTO.openType = ''; |
| 484 | contentDTO.extra = ''; | 438 | contentDTO.extra = ''; |
| 485 | - contentDTO.titleShow = value.data.type == "5" ? 1 : 0; | 439 | + contentDTO.titleShow = value.data.titleShow == "1" ? 0 : 1 |
| 486 | contentDTO.rmhInfo = rmhInfo | 440 | contentDTO.rmhInfo = rmhInfo |
| 487 | contentDTO.shareFlag = value.data.shareFlag | 441 | contentDTO.shareFlag = value.data.shareFlag |
| 488 | contentDTO.contentText = value.data.contentText | 442 | 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'; |
| @@ -508,7 +505,7 @@ export struct OperRowListView { | @@ -508,7 +505,7 @@ export struct OperRowListView { | ||
| 508 | // 评论组件需要数据 | 505 | // 评论组件需要数据 |
| 509 | if (Number.parseInt(this.interactData.commentNum) > | 506 | if (Number.parseInt(this.interactData.commentNum) > |
| 510 | Number.parseInt(this.publishCommentModel.totalCommentNumer)) { | 507 | Number.parseInt(this.publishCommentModel.totalCommentNumer)) { |
| 511 | - this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + '' || '0' | 508 | + this.publishCommentModel.totalCommentNumer = this.interactData.commentNum + '' |
| 512 | } | 509 | } |
| 513 | } | 510 | } |
| 514 | // console.log(TAG, '获取互动点赞等数据===', JSON.stringify(res)) | 511 | // console.log(TAG, '获取互动点赞等数据===', JSON.stringify(res)) |
| @@ -13,6 +13,7 @@ export struct AreaPickerDialog { | @@ -13,6 +13,7 @@ export struct AreaPickerDialog { | ||
| 13 | @Provide dataSource: AreaListModel[] = [] | 13 | @Provide dataSource: AreaListModel[] = [] |
| 14 | result: JSON[] = []; | 14 | result: JSON[] = []; |
| 15 | confirmCallback: (province:string,city:string,county:string,address:string) => void = () => { | 15 | confirmCallback: (province:string,city:string,county:string,address:string) => void = () => { |
| 16 | + | ||
| 16 | } | 17 | } |
| 17 | 18 | ||
| 18 | build() { | 19 | build() { |
| @@ -22,27 +23,33 @@ export struct AreaPickerDialog { | @@ -22,27 +23,33 @@ export struct AreaPickerDialog { | ||
| 22 | .onClick(()=> { | 23 | .onClick(()=> { |
| 23 | this.controller.close() | 24 | this.controller.close() |
| 24 | }) | 25 | }) |
| 26 | + .width(60) | ||
| 25 | .backgroundColor(0xffffff) | 27 | .backgroundColor(0xffffff) |
| 26 | .fontColor(Color.Black) | 28 | .fontColor(Color.Black) |
| 27 | .layoutWeight(1) | 29 | .layoutWeight(1) |
| 28 | 30 | ||
| 29 | - Blank() | 31 | + Blank().width(80) |
| 30 | 32 | ||
| 31 | Text(this.title) | 33 | Text(this.title) |
| 32 | .fontSize(18).textAlign(TextAlign.Center).margin({top:10,bottom:10}) | 34 | .fontSize(18).textAlign(TextAlign.Center).margin({top:10,bottom:10}) |
| 33 | 35 | ||
| 34 | - Blank() | 36 | + Blank().width(80) |
| 35 | 37 | ||
| 36 | Button('提交',{type:ButtonType.Normal}) | 38 | Button('提交',{type:ButtonType.Normal}) |
| 37 | .onClick(()=> { | 39 | .onClick(()=> { |
| 38 | this.controller.close() | 40 | this.controller.close() |
| 39 | this.confirmCallback(this.currentFirst.label,this.currentSecondBean.label,this.currentThirdBean.label,this.currentFirst.label+this.currentSecondBean.label+this.currentThirdBean.label); | 41 | this.confirmCallback(this.currentFirst.label,this.currentSecondBean.label,this.currentThirdBean.label,this.currentFirst.label+this.currentSecondBean.label+this.currentThirdBean.label); |
| 40 | }) | 42 | }) |
| 43 | + .width(60) | ||
| 41 | .backgroundColor(0xffffff) | 44 | .backgroundColor(0xffffff) |
| 42 | .fontColor('#ED2800') | 45 | .fontColor('#ED2800') |
| 43 | .layoutWeight(1) | 46 | .layoutWeight(1) |
| 44 | - } | ||
| 45 | - .margin({top:0,bottom:10}) | 47 | + }.backgroundColor(0xffffff) |
| 48 | + | ||
| 49 | + Divider() | ||
| 50 | + .color('#f5f5f5') | ||
| 51 | + .width('100%') | ||
| 52 | + .strokeWidth(1) | ||
| 46 | 53 | ||
| 47 | Row(){ | 54 | Row(){ |
| 48 | FirstLevelComponent().width('33%') | 55 | FirstLevelComponent().width('33%') |
| @@ -50,7 +57,8 @@ export struct AreaPickerDialog { | @@ -50,7 +57,8 @@ export struct AreaPickerDialog { | ||
| 50 | ThirdLevelComponent().width('33%') | 57 | ThirdLevelComponent().width('33%') |
| 51 | } | 58 | } |
| 52 | } | 59 | } |
| 53 | - .height('40%') | 60 | + .backgroundColor(0xffffff) |
| 61 | + .height('35%') | ||
| 54 | .width('100%') | 62 | .width('100%') |
| 55 | } | 63 | } |
| 56 | } | 64 | } |
| 1 | + | ||
| 2 | +@Component | ||
| 3 | +export struct DateCustomComponent { | ||
| 4 | + @Consume selectDate: Date | ||
| 5 | + build() { | ||
| 6 | + Column(){ | ||
| 7 | + Column(){ | ||
| 8 | + DatePicker({ | ||
| 9 | + start:new Date('1900-1-1'), | ||
| 10 | + end:new Date(), | ||
| 11 | + selected:new Date, | ||
| 12 | + }).selectedTextStyle({color:'#666666'}) | ||
| 13 | + .textStyle({color:'#999999'}) | ||
| 14 | + .onDateChange((value) => { | ||
| 15 | + this.selectDate = value as Date | ||
| 16 | + }) | ||
| 17 | + }.justifyContent(FlexAlign.Center) | ||
| 18 | + }.height('100%') | ||
| 19 | + } | ||
| 20 | +} |
| 1 | +import { DateCustomComponent } from './DateCustomComponent' | ||
| 2 | + | ||
| 3 | +@CustomDialog | ||
| 4 | + | ||
| 5 | +export struct EditUserInfoCustomDialog{ | ||
| 6 | + @Provide selectDate: Date = new Date | ||
| 7 | + controller: CustomDialogController | ||
| 8 | + confirmCallback: (selectDate:Date) => void = () => { | ||
| 9 | + | ||
| 10 | + } | ||
| 11 | + build() { | ||
| 12 | + Column(){ | ||
| 13 | + Row(){ | ||
| 14 | + Button('取消',{type:ButtonType.Normal}) | ||
| 15 | + .onClick(()=> { | ||
| 16 | + this.controller.close() | ||
| 17 | + }) | ||
| 18 | + .width(60) | ||
| 19 | + .backgroundColor(0xffffff) | ||
| 20 | + .fontColor(Color.Black) | ||
| 21 | + .layoutWeight(1) | ||
| 22 | + | ||
| 23 | + Blank().width(80) | ||
| 24 | + | ||
| 25 | + Text('修改生日') | ||
| 26 | + .fontSize(18).textAlign(TextAlign.Center).margin({top:10,bottom:10}) | ||
| 27 | + | ||
| 28 | + Blank().width(80) | ||
| 29 | + | ||
| 30 | + Button('提交',{type:ButtonType.Normal}) | ||
| 31 | + .onClick(()=> { | ||
| 32 | + this.controller.close() | ||
| 33 | + this.confirmCallback(this.selectDate); | ||
| 34 | + }) | ||
| 35 | + .width(60) | ||
| 36 | + .backgroundColor(0xffffff) | ||
| 37 | + .fontColor('#ED2800') | ||
| 38 | + .layoutWeight(1) | ||
| 39 | + }.backgroundColor(0xffffff) | ||
| 40 | + | ||
| 41 | + Divider() | ||
| 42 | + .color('#f5f5f5') | ||
| 43 | + .width('100%') | ||
| 44 | + .strokeWidth(1) | ||
| 45 | + | ||
| 46 | + DateCustomComponent().width('70%') | ||
| 47 | + } | ||
| 48 | + .backgroundColor(0xffffff) | ||
| 49 | + .height('35%') | ||
| 50 | + .width('100%') | ||
| 51 | + } | ||
| 52 | +} |
| 1 | +@CustomDialog | ||
| 2 | + | ||
| 3 | +export struct EditUserSexCustomDialog { | ||
| 4 | + controller: CustomDialogController | ||
| 5 | + confirmCallback: (selectIndex:number) => void = () => { | ||
| 6 | + } | ||
| 7 | + build() { | ||
| 8 | + Column(){ | ||
| 9 | + Button('男',{type:ButtonType.Normal}).height(45).width('100%').fontSize(14).fontColor('#222222').backgroundColor(0xffffff) | ||
| 10 | + .onClick(()=>{ | ||
| 11 | + this.confirmCallback(1) | ||
| 12 | + this.controller.close() | ||
| 13 | + }) | ||
| 14 | + Divider() | ||
| 15 | + .color('#f5f5f5') | ||
| 16 | + .width('100%') | ||
| 17 | + .strokeWidth(1) | ||
| 18 | + Button('女',{type:ButtonType.Normal}).height(45).width('100%').fontSize(14).fontColor('#222222').backgroundColor(0xffffff) | ||
| 19 | + .onClick(()=>{ | ||
| 20 | + this.confirmCallback(0) | ||
| 21 | + this.controller.close() | ||
| 22 | + }) | ||
| 23 | + Divider() | ||
| 24 | + .color('#f5f5f5') | ||
| 25 | + .width('100%') | ||
| 26 | + .strokeWidth(5) | ||
| 27 | + Button('取消',{type:ButtonType.Normal}).height(80).width('100%').fontSize(14).fontColor('#222222').backgroundColor(0xffffff) | ||
| 28 | + .onClick(()=>{ | ||
| 29 | + this.controller.close() | ||
| 30 | + }) | ||
| 31 | + }.height(176).width('100%').backgroundColor(Color.White) | ||
| 32 | + } | ||
| 33 | +} |
| @@ -28,7 +28,6 @@ export struct FirstLevelComponent { | @@ -28,7 +28,6 @@ export struct FirstLevelComponent { | ||
| 28 | this.currentFirst = EditInfoViewModel.getAreaListManageModel(this.dataSource[index as number]) | 28 | this.currentFirst = EditInfoViewModel.getAreaListManageModel(this.dataSource[index as number]) |
| 29 | }) | 29 | }) |
| 30 | .backgroundColor(Color.White) | 30 | .backgroundColor(Color.White) |
| 31 | - // .border({color:'#e2e2e2',width:{right:0.5}}) | ||
| 32 | .width('100%') | 31 | .width('100%') |
| 33 | .layoutWeight(1) | 32 | .layoutWeight(1) |
| 34 | .selectedTextStyle({color:'#666666'}) | 33 | .selectedTextStyle({color:'#666666'}) |
| @@ -38,6 +37,5 @@ export struct FirstLevelComponent { | @@ -38,6 +37,5 @@ export struct FirstLevelComponent { | ||
| 38 | .justifyContent(FlexAlign.Center) | 37 | .justifyContent(FlexAlign.Center) |
| 39 | } | 38 | } |
| 40 | .height('100%') | 39 | .height('100%') |
| 41 | - | ||
| 42 | } | 40 | } |
| 43 | } | 41 | } |
| @@ -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 |
| @@ -182,7 +182,7 @@ struct SearchCreatorPage { | @@ -182,7 +182,7 @@ struct SearchCreatorPage { | ||
| 182 | ListHasNoMoreDataUI() | 182 | ListHasNoMoreDataUI() |
| 183 | } | 183 | } |
| 184 | } | 184 | } |
| 185 | - }.cachedCount(10) | 185 | + }.cachedCount(5) |
| 186 | .padding({left:'31lpx',right:'31lpx'}) | 186 | .padding({left:'31lpx',right:'31lpx'}) |
| 187 | .layoutWeight(1) | 187 | .layoutWeight(1) |
| 188 | .scrollBar(BarState.Off) | 188 | .scrollBar(BarState.Off) |
| @@ -62,8 +62,7 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent | @@ -62,8 +62,7 @@ export function viewBlogInsightIntentShare(context: common.UIAbilityContext, ent | ||
| 62 | commentCount: _item?.interactData?.commentNum || 0, | 62 | commentCount: _item?.interactData?.commentNum || 0, |
| 63 | favorites: _item?.interactData?.collectNum || 0, | 63 | favorites: _item?.interactData?.collectNum || 0, |
| 64 | viewCount: _item?.interactData?.readNum || 0, | 64 | viewCount: _item?.interactData?.readNum || 0, |
| 65 | - rankingHint: 99, | ||
| 66 | - isPublicData: true | 65 | + rankingHint: 99 |
| 67 | } | 66 | } |
| 68 | } | 67 | } |
| 69 | insightIntentArray.push(viewBlogInsightIntentItem) | 68 | insightIntentArray.push(viewBlogInsightIntentItem) |
| @@ -113,8 +112,7 @@ export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext, | @@ -113,8 +112,7 @@ export function viewBlogItemInsightIntentShare(context: common.UIAbilityContext, | ||
| 113 | forwardCount: interactData?.shareNum || 0, | 112 | forwardCount: interactData?.shareNum || 0, |
| 114 | commentCount: interactData?.commentNum || 0, | 113 | commentCount: interactData?.commentNum || 0, |
| 115 | favorites: interactData?.collectNum || 0, | 114 | favorites: interactData?.collectNum || 0, |
| 116 | - rankingHint: 99, | ||
| 117 | - isPublicData: true | 115 | + rankingHint: 99 |
| 118 | } | 116 | } |
| 119 | } | 117 | } |
| 120 | 118 | ||
| @@ -147,8 +145,7 @@ export function viewColumInsightIntentShare(context: common.UIAbilityContext, en | @@ -147,8 +145,7 @@ export function viewColumInsightIntentShare(context: common.UIAbilityContext, en | ||
| 147 | activityType: ['RecentViews'], | 145 | activityType: ['RecentViews'], |
| 148 | columnTitle: pageInfoBean?.topicInfo?.title, | 146 | columnTitle: pageInfoBean?.topicInfo?.title, |
| 149 | columnSubTitle: pageInfoBean?.shareSummary, | 147 | columnSubTitle: pageInfoBean?.shareSummary, |
| 150 | - rankingHint: 99, | ||
| 151 | - isPublicData: true | 148 | + rankingHint: 99 |
| 152 | } | 149 | } |
| 153 | } | 150 | } |
| 154 | console.log('yzl viewColumInsightIntentShare', JSON.stringify(viewColumInsightIntentItem)) | 151 | console.log('yzl viewColumInsightIntentShare', JSON.stringify(viewColumInsightIntentItem)) |
| @@ -43,10 +43,19 @@ export class InfomationCardClick { | @@ -43,10 +43,19 @@ export class InfomationCardClick { | ||
| 43 | return summaryType; | 43 | return summaryType; |
| 44 | } | 44 | } |
| 45 | 45 | ||
| 46 | - public static track(compDTO: CompDTO, contentDTO: ContentDTO, pageId: string, pageName: string): void { | 46 | + public static track( |
| 47 | + compDTO: CompDTO, | ||
| 48 | + contentDTO: ContentDTO, | ||
| 49 | + pageId: string, | ||
| 50 | + pageName: string, | ||
| 51 | + action = 'detailPageShow', // like, commentClick, follow | ||
| 52 | + bl = false, | ||
| 53 | + followUserId = '', | ||
| 54 | + followUserName = '' | ||
| 55 | + ): void { | ||
| 47 | try { | 56 | try { |
| 48 | const extParams: ParamType = { | 57 | const extParams: ParamType = { |
| 49 | - 'action': 'detailPageShow', | 58 | + 'action': action, |
| 50 | 'shareChannel': '', | 59 | 'shareChannel': '', |
| 51 | 'duration': 0, | 60 | 'duration': 0, |
| 52 | 'contentName': contentDTO.newsTitle, | 61 | 'contentName': contentDTO.newsTitle, |
| @@ -87,7 +96,15 @@ export class InfomationCardClick { | @@ -87,7 +96,15 @@ export class InfomationCardClick { | ||
| 87 | extParams['saAuthorName'] = contentDTO.source; | 96 | extParams['saAuthorName'] = contentDTO.source; |
| 88 | } | 97 | } |
| 89 | console.log('InfomationCardClick-params:', JSON.stringify(extParams)) | 98 | console.log('InfomationCardClick-params:', JSON.stringify(extParams)) |
| 90 | - TrackingContent.common(TrackConstants.EventType.Click, pageId, pageName, extParams) | 99 | + if (action === 'detailPageShow') { |
| 100 | + TrackingContent.common(TrackConstants.EventType.Click, pageId, pageName, extParams); | ||
| 101 | + } else if (action === 'like') { | ||
| 102 | + TrackingContent.like(bl, pageId, pageName, extParams); | ||
| 103 | + } else if (action === 'commentClick') { | ||
| 104 | + TrackingContent.commentClick(pageId, pageName, extParams); | ||
| 105 | + } else if (action === 'follow') { | ||
| 106 | + TrackingContent.follow(bl, followUserId, followUserName, pageId, pageName, extParams) | ||
| 107 | + } | ||
| 91 | } catch (err) { | 108 | } catch (err) { |
| 92 | console.log('InfomationCardClick-err', JSON.stringify(err)) | 109 | console.log('InfomationCardClick-err', JSON.stringify(err)) |
| 93 | } | 110 | } |
sight_harmony/features/wdComponent/src/main/resources/base/media/AccountOwner_DefaultIcon.png
0 → 100644
4.68 KB
| 1 | -import { Action, ContentDetailDTO, LiveDetailsBean } from 'wdBean/Index'; | 1 | +import { Action, ContentDetailDTO } from 'wdBean/Index'; |
| 2 | import { LiveViewModel } from '../viewModel/LiveViewModel'; | 2 | import { LiveViewModel } from '../viewModel/LiveViewModel'; |
| 3 | import router from '@ohos.router'; | 3 | import router from '@ohos.router'; |
| 4 | 4 | ||
| @@ -31,9 +31,10 @@ export struct DetailPlayLiveCommon { | @@ -31,9 +31,10 @@ export struct DetailPlayLiveCommon { | ||
| 31 | @Provide pageShow: number = -1 | 31 | @Provide pageShow: number = -1 |
| 32 | @Provide pageHide: number = -1 | 32 | @Provide pageHide: number = -1 |
| 33 | @Provide pageBackPress: number = -1 | 33 | @Provide pageBackPress: number = -1 |
| 34 | - @Provide liveDetailsBean: LiveDetailsBean = {} as LiveDetailsBean | ||
| 35 | @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO | 34 | @Provide contentDetailData: ContentDetailDTO = {} as ContentDetailDTO |
| 36 | @Provide publishCommentModel: publishCommentModel = new publishCommentModel() | 35 | @Provide publishCommentModel: publishCommentModel = new publishCommentModel() |
| 36 | + // 横屏或竖屏 general-竖屏,news-横屏 | ||
| 37 | + @State liveLandscape: string = '' | ||
| 37 | 38 | ||
| 38 | async aboutToAppear(): Promise<void> { | 39 | async aboutToAppear(): Promise<void> { |
| 39 | const par: Action = router.getParams() as Action; | 40 | const par: Action = router.getParams() as Action; |
| @@ -48,11 +49,11 @@ export struct DetailPlayLiveCommon { | @@ -48,11 +49,11 @@ export struct DetailPlayLiveCommon { | ||
| 48 | build() { | 49 | build() { |
| 49 | Column() { | 50 | Column() { |
| 50 | // 直播预约或横屏直播统一进横屏直播 | 51 | // 直播预约或横屏直播统一进横屏直播 |
| 51 | - if (this.liveState === 'wait' || this.liveStyle === 0) { | ||
| 52 | - // 非沉浸式 | 52 | + if (this.liveState === 'wait' || this.liveLandscape === 'news') { |
| 53 | + // 非沉浸式直播 | ||
| 53 | DetailPlayLivePage({ contentId: this.contentId, relId: this.relId, relType: this.relType }) | 54 | DetailPlayLivePage({ contentId: this.contentId, relId: this.relId, relType: this.relType }) |
| 54 | - } else if (this.liveStyle === 1) { | ||
| 55 | - // 沉浸式 | 55 | + } else if (this.liveLandscape === 'general') { |
| 56 | + // 沉浸式直播 | ||
| 56 | DetailPlayVLivePage() | 57 | DetailPlayVLivePage() |
| 57 | } | 58 | } |
| 58 | } | 59 | } |
| @@ -70,60 +71,64 @@ export struct DetailPlayLiveCommon { | @@ -70,60 +71,64 @@ 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 | ||
| 115 | + // /** | ||
| 116 | + // * | ||
| 117 | + // * @returns true : 沉浸式;false : 非沉浸式 | ||
| 118 | + // */ | ||
| 119 | + // isImmersionLive(): boolean { | ||
| 120 | + // | ||
| 121 | + // let flag = false | ||
| 122 | + // | ||
| 123 | + // if (this.liveState === 'wait' || this.liveLandscape === 'news') { | ||
| 124 | + // flag = false | ||
| 125 | + // } else if (this.liveLandscape === 'general') { | ||
| 126 | + // flag = true | ||
| 127 | + // } | ||
| 128 | + // | ||
| 129 | + // return flag | ||
| 130 | + // } | ||
| 131 | + | ||
| 127 | onPageShow() { | 132 | onPageShow() { |
| 128 | this.pageShow = Math.random() | 133 | this.pageShow = Math.random() |
| 129 | Logger.info(TAG, 'onPageShow') | 134 | Logger.info(TAG, 'onPageShow') |
| @@ -7,8 +7,9 @@ import mediaquery from '@ohos.mediaquery'; | @@ -7,8 +7,9 @@ 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'; | 9 | import { devicePLSensorManager } from 'wdDetailPlayApi/Index'; |
| 10 | -import { LiveCommentComponent, LiveOperRowListView } from 'wdComponent/Index'; | 10 | +import { LiveCommentComponent } from 'wdComponent/Index'; |
| 11 | import { WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index'; | 11 | import { WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index'; |
| 12 | +import { OperRowListView } from 'wdComponent/src/main/ets/components/view/OperRowListView'; | ||
| 12 | import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; | 13 | import { publishCommentModel } from 'wdComponent/src/main/ets/components/comment/model/PublishCommentModel'; |
| 13 | import { ResponseDTO } from 'wdNetwork/Index'; | 14 | import { ResponseDTO } from 'wdNetwork/Index'; |
| 14 | 15 | ||
| @@ -69,8 +70,8 @@ export struct DetailPlayLivePage { | @@ -69,8 +70,8 @@ export struct DetailPlayLivePage { | ||
| 69 | TabComponent({ tabs: this.tabs, changeToTab: this.changeToTab }) | 70 | TabComponent({ tabs: this.tabs, changeToTab: this.changeToTab }) |
| 70 | .layoutWeight(1) | 71 | .layoutWeight(1) |
| 71 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 72 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| 72 | - LiveOperRowListView({ | ||
| 73 | - pageComponentType: 4, // 4:横屏直播页 | 73 | + OperRowListView({ |
| 74 | + componentType: 4, | ||
| 74 | operationButtonList: ['comment', 'collect', 'share', 'like'], | 75 | operationButtonList: ['comment', 'collect', 'share', 'like'], |
| 75 | styleType: 1, | 76 | styleType: 1, |
| 76 | contentDetailData: this.contentDetailData, | 77 | contentDetailData: this.contentDetailData, |
| 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}`) |
| 1 | -import { window } from '@kit.ArkUI' | 1 | +import { window } from '@kit.ArkUI'; |
| 2 | import lottie from '@ohos/lottie'; | 2 | import lottie from '@ohos/lottie'; |
| 3 | 3 | ||
| 4 | -import { NumberFormatterUtils, StringUtils, WindowModel } from 'wdKit/Index' | ||
| 5 | -import { DateFormatUtil, WDAliPlayerController, WDPlayerController } from 'wdPlayer/Index' | ||
| 6 | -import { LiveDetailsBean, LiveRoomDataBean } from 'wdBean/Index' | ||
| 7 | -import { DisplayDirection } from 'wdConstant/Index' | ||
| 8 | -import { LiveFollowComponent, LottieView } from 'wdComponent/Index' | 4 | +import { NumberFormatterUtils, StringUtils, WindowModel } from 'wdKit/Index'; |
| 5 | +import { DateFormatUtil, PlayerConstants, WDAliPlayerController } from 'wdPlayer/Index'; | ||
| 6 | +import { ContentDetailDTO, LiveRoomDataBean } from 'wdBean/Index'; | ||
| 7 | +import { DisplayDirection } from 'wdConstant/Index'; | ||
| 8 | +import { LiveFollowComponent, LottieView } from 'wdComponent/Index'; | ||
| 9 | 9 | ||
| 10 | @Component | 10 | @Component |
| 11 | export struct PlayUIComponent { | 11 | 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 contentDetailData: ContentDetailDTO |
| 16 | @Consume liveRoomDataBean: LiveRoomDataBean | 16 | @Consume liveRoomDataBean: LiveRoomDataBean |
| 17 | @State currentTime: string = '' | 17 | @State currentTime: string = '' |
| 18 | @State totalTime: string = '' | 18 | @State totalTime: string = '' |
| @@ -20,12 +20,15 @@ export struct PlayUIComponent { | @@ -20,12 +20,15 @@ export struct PlayUIComponent { | ||
| 20 | //是否处于播放状态中 | 20 | //是否处于播放状态中 |
| 21 | @State isPlayStatus: boolean = true | 21 | @State isPlayStatus: boolean = true |
| 22 | @Consume displayDirection: DisplayDirection | 22 | @Consume displayDirection: DisplayDirection |
| 23 | - | ||
| 24 | @Prop isShowBottom: boolean | 23 | @Prop isShowBottom: boolean |
| 24 | + // 播放地址 (视频或者 直播地址) | ||
| 25 | + @Prop liveUrl: string | ||
| 26 | + // 当前播放资源的状态 | ||
| 27 | + @Consume playSourceState: number | ||
| 25 | 28 | ||
| 26 | onChangeMenuVisible() { | 29 | onChangeMenuVisible() { |
| 27 | - if (!this.liveDetailsBean || !this.liveDetailsBean.liveInfo || | ||
| 28 | - this.liveDetailsBean?.liveInfo?.liveState === 'wait') { | 30 | + if (!this.contentDetailData || !this.contentDetailData.liveInfo || |
| 31 | + this.contentDetailData?.liveInfo?.liveState === 'wait') { | ||
| 29 | return | 32 | return |
| 30 | } | 33 | } |
| 31 | let time: number = 0 | 34 | let time: number = 0 |
| @@ -40,6 +43,21 @@ export struct PlayUIComponent { | @@ -40,6 +43,21 @@ export struct PlayUIComponent { | ||
| 40 | 43 | ||
| 41 | aboutToAppear(): void { | 44 | aboutToAppear(): void { |
| 42 | this.onChangeMenuVisible() | 45 | this.onChangeMenuVisible() |
| 46 | + | ||
| 47 | + this.initPlayerSet() | ||
| 48 | + } | ||
| 49 | + | ||
| 50 | + aboutToDisappear(): void { | ||
| 51 | + if (this.contentDetailData.liveInfo?.liveState == 'running') { | ||
| 52 | + lottie.destroy('live_status_wait') | ||
| 53 | + } | ||
| 54 | + } | ||
| 55 | + | ||
| 56 | + /* | ||
| 57 | + 初始话播放器设置 | ||
| 58 | + */ | ||
| 59 | + initPlayerSet(){ | ||
| 60 | + | ||
| 43 | //播放进度监听 | 61 | //播放进度监听 |
| 44 | if (this.playerController) { | 62 | if (this.playerController) { |
| 45 | this.playerController.onTimeUpdate = (position: number, duration: number) => { | 63 | this.playerController.onTimeUpdate = (position: number, duration: number) => { |
| @@ -48,20 +66,15 @@ export struct PlayUIComponent { | @@ -48,20 +66,15 @@ export struct PlayUIComponent { | ||
| 48 | this.progressVal = Math.floor(position * 100 / duration); | 66 | this.progressVal = Math.floor(position * 100 / duration); |
| 49 | } | 67 | } |
| 50 | } | 68 | } |
| 51 | - } | ||
| 52 | 69 | ||
| 53 | - aboutToDisappear(): void { | ||
| 54 | - if (this.liveDetailsBean.liveInfo?.liveState == 'running') { | ||
| 55 | - lottie.destroy('live_status_wait') | ||
| 56 | - } | ||
| 57 | } | 70 | } |
| 58 | 71 | ||
| 59 | build() { | 72 | build() { |
| 60 | Column() { | 73 | Column() { |
| 61 | - if (this.liveDetailsBean && this.liveDetailsBean.liveInfo) { | 74 | + if (this.contentDetailData && this.contentDetailData.liveInfo) { |
| 62 | this.getTopUIComponent() | 75 | this.getTopUIComponent() |
| 63 | this.getMiddleUIComponent() | 76 | this.getMiddleUIComponent() |
| 64 | - if(this.isShowBottom){ | 77 | + if (this.isShowBottom) { |
| 65 | this.getBottomUIComponent() | 78 | this.getBottomUIComponent() |
| 66 | } | 79 | } |
| 67 | 80 | ||
| @@ -92,8 +105,8 @@ export struct PlayUIComponent { | @@ -92,8 +105,8 @@ export struct PlayUIComponent { | ||
| 92 | // window.Orientation.PORTRAIT : | 105 | // window.Orientation.PORTRAIT : |
| 93 | // window.Orientation.LANDSCAPE); | 106 | // window.Orientation.LANDSCAPE); |
| 94 | }) | 107 | }) |
| 95 | - if (this.liveDetailsBean.liveInfo?.liveState != 'wait') { | ||
| 96 | - Text(this.liveDetailsBean.newsTitle) | 108 | + if (this.contentDetailData.liveInfo?.liveState != 'wait') { |
| 109 | + Text(this.contentDetailData.newsTitle) | ||
| 97 | .maxLines(1) | 110 | .maxLines(1) |
| 98 | .textOverflow({ overflow: TextOverflow.MARQUEE }) | 111 | .textOverflow({ overflow: TextOverflow.MARQUEE }) |
| 99 | .fontSize(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? '18vp' : '16vp') | 112 | .fontSize(this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL ? '18vp' : '16vp') |
| @@ -116,9 +129,9 @@ export struct PlayUIComponent { | @@ -116,9 +129,9 @@ export struct PlayUIComponent { | ||
| 116 | }) | 129 | }) |
| 117 | 130 | ||
| 118 | Row() { | 131 | Row() { |
| 119 | - if (this.liveDetailsBean?.rmhInfo) { | 132 | + if (this.contentDetailData?.rmhInfo) { |
| 120 | LiveFollowComponent({ | 133 | LiveFollowComponent({ |
| 121 | - rmhInfo: this.liveDetailsBean.rmhInfo | 134 | + rmhInfo: this.contentDetailData.rmhInfo |
| 122 | }) | 135 | }) |
| 123 | .margin({ | 136 | .margin({ |
| 124 | right: 10 | 137 | right: 10 |
| @@ -144,7 +157,7 @@ export struct PlayUIComponent { | @@ -144,7 +157,7 @@ export struct PlayUIComponent { | ||
| 144 | getLiveStatusView() { | 157 | getLiveStatusView() { |
| 145 | // 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 | 158 | // 直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 |
| 146 | // 预约 | 159 | // 预约 |
| 147 | - if (this.liveDetailsBean.liveInfo?.liveState == 'wait') { | 160 | + if (this.contentDetailData.liveInfo?.liveState == 'wait') { |
| 148 | Row() { | 161 | Row() { |
| 149 | 162 | ||
| 150 | Image($r('app.media.icon_live_status_wait')) | 163 | Image($r('app.media.icon_live_status_wait')) |
| @@ -163,7 +176,7 @@ export struct PlayUIComponent { | @@ -163,7 +176,7 @@ export struct PlayUIComponent { | ||
| 163 | }) | 176 | }) |
| 164 | } | 177 | } |
| 165 | // 直播中 | 178 | // 直播中 |
| 166 | - else if (this.liveDetailsBean.liveInfo?.liveState == 'running') { | 179 | + else if (this.contentDetailData.liveInfo?.liveState == 'running') { |
| 167 | Row() { | 180 | Row() { |
| 168 | Stack() { | 181 | Stack() { |
| 169 | Image($r('app.media.icon_live_status_running_back')) | 182 | Image($r('app.media.icon_live_status_running_back')) |
| @@ -204,7 +217,7 @@ export struct PlayUIComponent { | @@ -204,7 +217,7 @@ export struct PlayUIComponent { | ||
| 204 | }) | 217 | }) |
| 205 | } | 218 | } |
| 206 | //回看 | 219 | //回看 |
| 207 | - else if (this.liveDetailsBean.liveInfo?.liveState == 'end') { | 220 | + else if (this.contentDetailData.liveInfo?.liveState == 'end') { |
| 208 | Row() { | 221 | Row() { |
| 209 | Text('回看') | 222 | Text('回看') |
| 210 | .fontSize('11vp') | 223 | .fontSize('11vp') |
| @@ -240,7 +253,7 @@ export struct PlayUIComponent { | @@ -240,7 +253,7 @@ export struct PlayUIComponent { | ||
| 240 | .layoutWeight(1) | 253 | .layoutWeight(1) |
| 241 | .width('100%') | 254 | .width('100%') |
| 242 | .onClick(() => { | 255 | .onClick(() => { |
| 243 | - if (this.liveDetailsBean?.liveInfo?.liveState === 'wait') { | 256 | + if (this.contentDetailData?.liveInfo?.liveState === 'wait') { |
| 244 | return | 257 | return |
| 245 | } | 258 | } |
| 246 | this.isMenuVisible = !this.isMenuVisible | 259 | this.isMenuVisible = !this.isMenuVisible |
| @@ -250,16 +263,13 @@ export struct PlayUIComponent { | @@ -250,16 +263,13 @@ export struct PlayUIComponent { | ||
| 250 | @Builder | 263 | @Builder |
| 251 | getBottomUIComponent() { | 264 | getBottomUIComponent() { |
| 252 | Row() { | 265 | Row() { |
| 253 | - if (this.liveDetailsBean?.liveInfo?.liveState == 'wait') { | ||
| 254 | - Blank() | ||
| 255 | - } else if (this.liveDetailsBean?.liveInfo?.liveState == 'running') { | ||
| 256 | - this.playOrPauseBtn() | ||
| 257 | - Blank() | ||
| 258 | - } else if (this.liveDetailsBean?.liveInfo?.liveState == 'end') { | ||
| 259 | - if (StringUtils.isEmpty(this.liveDetailsBean?.liveInfo?.vlive[0]?.replayUri)) { | ||
| 260 | - Blank() | ||
| 261 | - } else { | 266 | + |
| 267 | + // 视频资源 | ||
| 268 | + if (!StringUtils.isEmpty(this.liveUrl)) { | ||
| 269 | + // 暂定和播放按钮 | ||
| 262 | this.playOrPauseBtn() | 270 | this.playOrPauseBtn() |
| 271 | + // 开始时间 | ||
| 272 | + if (this.contentDetailData?.liveInfo?.liveState != 'running' || this.contentDetailData.showTime) { | ||
| 263 | Text(this.currentTime) | 273 | Text(this.currentTime) |
| 264 | .fontColor(Color.White) | 274 | .fontColor(Color.White) |
| 265 | .fontWeight(600) | 275 | .fontWeight(600) |
| @@ -267,7 +277,12 @@ export struct PlayUIComponent { | @@ -267,7 +277,12 @@ export struct PlayUIComponent { | ||
| 267 | .margin({ | 277 | .margin({ |
| 268 | left: 16 | 278 | left: 16 |
| 269 | }) | 279 | }) |
| 280 | + } | ||
| 281 | + | ||
| 282 | + // 进度条 | ||
| 270 | this.playProgressView() | 283 | this.playProgressView() |
| 284 | + // 总的播放时间 | ||
| 285 | + if (this.contentDetailData?.liveInfo?.liveState != 'running' || this.contentDetailData.showTime) { | ||
| 271 | Text(this.totalTime) | 286 | Text(this.totalTime) |
| 272 | .fontColor(Color.White) | 287 | .fontColor(Color.White) |
| 273 | .fontWeight(600) | 288 | .fontWeight(600) |
| @@ -276,11 +291,13 @@ export struct PlayUIComponent { | @@ -276,11 +291,13 @@ export struct PlayUIComponent { | ||
| 276 | right: 16 | 291 | right: 16 |
| 277 | }) | 292 | }) |
| 278 | } | 293 | } |
| 294 | + | ||
| 295 | + } else { | ||
| 296 | + Blank() | ||
| 279 | } | 297 | } |
| 280 | - if (this.liveDetailsBean?.liveInfo?.liveState == 'running' | ||
| 281 | - || (this.liveDetailsBean?.liveInfo?.liveState == 'end' && | ||
| 282 | - StringUtils.isNotEmpty(this.liveDetailsBean?.liveInfo?.vlive[0]?.replayUri)) | ||
| 283 | - ) { | 298 | + |
| 299 | + // 全屏按钮 | ||
| 300 | + if (!StringUtils.isEmpty(this.liveUrl)) { | ||
| 284 | Image($r('app.media.icon_live_player_full_screen')) | 301 | Image($r('app.media.icon_live_player_full_screen')) |
| 285 | .width(24) | 302 | .width(24) |
| 286 | .height(24) | 303 | .height(24) |
| @@ -297,6 +314,7 @@ export struct PlayUIComponent { | @@ -297,6 +314,7 @@ export struct PlayUIComponent { | ||
| 297 | }) | 314 | }) |
| 298 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) | 315 | .visibility(this.displayDirection == DisplayDirection.VERTICAL ? Visibility.Visible : Visibility.None) |
| 299 | } | 316 | } |
| 317 | + | ||
| 300 | } | 318 | } |
| 301 | .alignItems(VerticalAlign.Center) | 319 | .alignItems(VerticalAlign.Center) |
| 302 | .linearGradient({ angle: 0, colors: [['#99000000', 0], ['#00000000', 1]] }) | 320 | .linearGradient({ angle: 0, colors: [['#99000000', 0], ['#00000000', 1]] }) |
| @@ -312,6 +330,19 @@ export struct PlayUIComponent { | @@ -312,6 +330,19 @@ export struct PlayUIComponent { | ||
| 312 | 330 | ||
| 313 | @Builder | 331 | @Builder |
| 314 | playOrPauseBtn() { | 332 | playOrPauseBtn() { |
| 333 | + | ||
| 334 | + if (this.playSourceState === PlayerConstants.STATUS_COMPLETION) { | ||
| 335 | + //资源播放完成 | ||
| 336 | + Image($r('app.media.player_play_ic')) | ||
| 337 | + .width(24) | ||
| 338 | + .height(24) | ||
| 339 | + .onClick(() => { | ||
| 340 | + this.isPlayStatus = true | ||
| 341 | + this.initPlayerSet() | ||
| 342 | + this.playerController?.firstPlay(this.liveUrl) | ||
| 343 | + this.playerController?.play() | ||
| 344 | + }) | ||
| 345 | + } else { | ||
| 315 | //暂停、播放 | 346 | //暂停、播放 |
| 316 | Image(this.isPlayStatus ? $r('app.media.icon_live_player_pause') : $r('app.media.player_play_ic')) | 347 | Image(this.isPlayStatus ? $r('app.media.icon_live_player_pause') : $r('app.media.player_play_ic')) |
| 317 | .width(24) | 348 | .width(24) |
| @@ -327,6 +358,8 @@ export struct PlayUIComponent { | @@ -327,6 +358,8 @@ export struct PlayUIComponent { | ||
| 327 | }) | 358 | }) |
| 328 | } | 359 | } |
| 329 | 360 | ||
| 361 | + } | ||
| 362 | + | ||
| 330 | @Builder | 363 | @Builder |
| 331 | playProgressView() { | 364 | playProgressView() { |
| 332 | Slider({ | 365 | Slider({ |
| 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,12 +6,16 @@ import { PictureLoading } from '../../vertical/PictureLoading'; | @@ -6,12 +6,16 @@ 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 | + // 预告片图片/视频url |
| 17 | + @State previewUrl: string = '' | ||
| 18 | + @State isVideoSource: boolean = false | ||
| 15 | //未开始 | 19 | //未开始 |
| 16 | @State isWait: boolean = false | 20 | @State isWait: boolean = false |
| 17 | //已结束直播 | 21 | //已结束直播 |
| @@ -22,14 +26,15 @@ export struct TopPlayComponent { | @@ -22,14 +26,15 @@ export struct TopPlayComponent { | ||
| 22 | @State isLoading: boolean = false | 26 | @State isLoading: boolean = false |
| 23 | // 获取播放资源能播放了 | 27 | // 获取播放资源能播放了 |
| 24 | @State isCanPlay: boolean = false | 28 | @State isCanPlay: boolean = false |
| 25 | - | 29 | + // 当前播放资源的状态 |
| 30 | + @Provide playSourceState: number = 0 | ||
| 26 | private playUrl: string = "" | 31 | private playUrl: string = "" |
| 27 | private xComponentIsLoaded: boolean = false | 32 | private xComponentIsLoaded: boolean = false |
| 28 | 33 | ||
| 29 | aboutToAppear(): void { | 34 | aboutToAppear(): void { |
| 30 | if (this.playerController) { | 35 | if (this.playerController) { |
| 31 | this.playerController.onCanplay = () => { | 36 | this.playerController.onCanplay = () => { |
| 32 | - | 37 | + Logger.debug(TAG, 'onCanplay==>') |
| 33 | this.isCanPlay = true | 38 | this.isCanPlay = true |
| 34 | this.isLoading = true | 39 | this.isLoading = true |
| 35 | this.playerController?.play() | 40 | this.playerController?.play() |
| @@ -38,51 +43,78 @@ export struct TopPlayComponent { | @@ -38,51 +43,78 @@ export struct TopPlayComponent { | ||
| 38 | 43 | ||
| 39 | this.playerController.onStatusChange = (status: number) => { | 44 | this.playerController.onStatusChange = (status: number) => { |
| 40 | 45 | ||
| 46 | + this.playSourceState = status | ||
| 47 | + Logger.debug(TAG, 'status==>' + status) | ||
| 41 | if (status === PlayerConstants.STATUS_ERROR) { | 48 | if (status === PlayerConstants.STATUS_ERROR) { |
| 42 | this.isError = true | 49 | this.isError = true |
| 43 | this.isLoading = true | 50 | this.isLoading = true |
| 44 | - | ||
| 45 | this.isCanPlay = false | 51 | this.isCanPlay = false |
| 52 | + } else if (status === PlayerConstants.STATUS_COMPLETION) { | ||
| 53 | + // 播放完成 | ||
| 54 | + | ||
| 55 | + | ||
| 46 | } else { | 56 | } else { |
| 47 | this.isError = false | 57 | this.isError = false |
| 48 | } | 58 | } |
| 49 | 59 | ||
| 50 | - | ||
| 51 | } | 60 | } |
| 52 | } | 61 | } |
| 53 | this.updateData() | 62 | this.updateData() |
| 54 | } | 63 | } |
| 55 | 64 | ||
| 56 | updateData() { | 65 | updateData() { |
| 66 | + | ||
| 67 | + // 检测等待中的直播预告是否视频资源 | ||
| 68 | + if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewType === 1 | ||
| 69 | + && this.contentDetailData.liveInfo.previewUrl && | ||
| 70 | + this.contentDetailData.liveInfo.previewUrl.length > 0) { | ||
| 71 | + // 预告资源是视频 | ||
| 72 | + this.isVideoSource = true | ||
| 73 | + this.contentDetailData.showTime = true | ||
| 74 | + } | ||
| 57 | //直播新闻-直播状态 wait待开播running直播中end已结束cancel已取消paused暂停 | 75 | //直播新闻-直播状态 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 | ||
| 61 | - 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 | - Logger.debug(TAG, 'ok-' + `${this.imgUrl}`) | ||
| 65 | - } | ||
| 66 | - this.isWait = this.liveDetailsBean?.liveInfo?.liveState == 'wait' | ||
| 67 | - if(this.isWait ){ | 76 | + if (this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.previewUrl && |
| 77 | + this.contentDetailData.liveInfo.previewUrl.length > 0) { | ||
| 78 | + this.previewUrl = this.contentDetailData.liveInfo.previewUrl | ||
| 79 | + | ||
| 80 | + } else if (this.contentDetailData.fullColumnImgUrls && this.contentDetailData.fullColumnImgUrls.length > 0) { | ||
| 81 | + this.previewUrl = this.contentDetailData.fullColumnImgUrls[0].url | ||
| 82 | + } | ||
| 83 | + | ||
| 84 | + Logger.debug(TAG, 'ok+' + `${this.previewUrl}`) | ||
| 85 | + | ||
| 86 | + if (this.isVideoSource) { | ||
| 87 | + this.isWait = false | ||
| 88 | + this.isLoading = false | ||
| 89 | + } else { | ||
| 90 | + this.isWait = this.contentDetailData?.liveInfo?.liveState == 'wait' | ||
| 91 | + if (this.isWait) { | ||
| 68 | this.isLoading = true | 92 | this.isLoading = true |
| 69 | } | 93 | } |
| 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) { | 94 | + } |
| 95 | + | ||
| 96 | + this.isEnd = this.contentDetailData?.liveInfo?.liveState === 'end' && | ||
| 97 | + StringUtils.isEmpty(this.contentDetailData?.liveInfo?.vlive[0]?.replayUri) | ||
| 98 | + if (!this.isWait && this.contentDetailData.liveInfo && this.contentDetailData.liveInfo.vlive.length > 0) { | ||
| 73 | let playUrl = '' | 99 | 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 | 100 | + if (this.contentDetailData.liveInfo.liveState == 'running') { |
| 101 | + playUrl = this.contentDetailData.liveInfo.vlive[0].liveUrl | ||
| 102 | + } else if (this.contentDetailData.liveInfo.liveState == 'end') { | ||
| 103 | + playUrl = this.contentDetailData.liveInfo.vlive[0].replayUri | ||
| 78 | } | 104 | } |
| 79 | - // this.playerController?.firstPlay('https://rmrbcmsonline.peopleapp.com/upload/rmh/video/mp4/202404/1713752415708fb81d0b8f137b.mp4'); | 105 | + |
| 106 | + if (this.isVideoSource) { | ||
| 107 | + this.playUrl = this.previewUrl | ||
| 108 | + this.tryToPlay() | ||
| 109 | + } else { | ||
| 80 | if (StringUtils.isNotEmpty(playUrl)) { | 110 | if (StringUtils.isNotEmpty(playUrl)) { |
| 81 | Logger.debug(TAG, `${playUrl}`) | 111 | Logger.debug(TAG, `${playUrl}`) |
| 82 | this.playUrl = playUrl | 112 | this.playUrl = playUrl |
| 83 | this.tryToPlay() | 113 | this.tryToPlay() |
| 84 | } | 114 | } |
| 85 | } | 115 | } |
| 116 | + | ||
| 117 | + } | ||
| 86 | } | 118 | } |
| 87 | 119 | ||
| 88 | tryToPlay() { | 120 | tryToPlay() { |
| @@ -113,18 +145,22 @@ export struct TopPlayComponent { | @@ -113,18 +145,22 @@ export struct TopPlayComponent { | ||
| 113 | .width('100%') | 145 | .width('100%') |
| 114 | .visibility(this.isWait ? Visibility.None : Visibility.Visible) | 146 | .visibility(this.isWait ? Visibility.None : Visibility.Visible) |
| 115 | 147 | ||
| 148 | + if (this.isVideoSource) { | ||
| 149 | + | ||
| 150 | + } else { | ||
| 116 | // 直播房间图 | 151 | // 直播房间图 |
| 117 | - Image(this.imgUrl) | 152 | + Image(this.previewUrl) |
| 118 | .objectFit(ImageFit.Cover) | 153 | .objectFit(ImageFit.Cover) |
| 119 | .visibility(this.isWait || this.isEnd ? Visibility.Visible : Visibility.None) | 154 | .visibility(this.isWait || this.isEnd ? Visibility.Visible : Visibility.None) |
| 120 | .contrast(this.isEnd ? 0.2 : 1) | 155 | .contrast(this.isEnd ? 0.2 : 1) |
| 121 | .width('100%') | 156 | .width('100%') |
| 157 | + } | ||
| 122 | 158 | ||
| 123 | // loading | 159 | // loading |
| 124 | PictureLoading().visibility(this.isLoading ? Visibility.None : Visibility.Visible) | 160 | PictureLoading().visibility(this.isLoading ? Visibility.None : Visibility.Visible) |
| 125 | 161 | ||
| 126 | // 视频播放器上的控制面板和信息 | 162 | // 视频播放器上的控制面板和信息 |
| 127 | - PlayUIComponent({ playerController: this.playerController, isShowBottom: this.isCanPlay }) | 163 | + PlayUIComponent({ playerController: this.playerController, isShowBottom: this.isCanPlay, liveUrl: this.playUrl }) |
| 128 | 164 | ||
| 129 | // 直播结束 | 165 | // 直播结束 |
| 130 | Text('直播已结束') | 166 | Text('直播已结束') |
| 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 = '' |
| @@ -182,7 +182,7 @@ export struct DetailPlayShortVideoPage { | @@ -182,7 +182,7 @@ export struct DetailPlayShortVideoPage { | ||
| 182 | index: $index, | 182 | index: $index, |
| 183 | currentIndex: $currentIndex, | 183 | currentIndex: $currentIndex, |
| 184 | showCommentList: $showCommentList, | 184 | showCommentList: $showCommentList, |
| 185 | - // publishCommentModel: $publishCommentModel | 185 | + publishCommentModel: $publishCommentModel |
| 186 | }) | 186 | }) |
| 187 | this.playerViewBuilder() | 187 | this.playerViewBuilder() |
| 188 | 188 |
| 1 | import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index' | 1 | import { ContentDetailDTO, PageInfoDTO } from 'wdBean/Index' |
| 2 | 2 | ||
| 3 | -import { CommentListDialogView } from 'wdComponent/Index' | 3 | +import { CommentListDialogView, publishCommentModel } from 'wdComponent/Index' |
| 4 | 4 | ||
| 5 | @Component | 5 | @Component |
| 6 | export struct CommentDialogView { | 6 | export struct CommentDialogView { |
| 7 | @Link @Watch('showCommentListChange') showCommentList: boolean | 7 | @Link @Watch('showCommentListChange') showCommentList: boolean |
| 8 | @Link index: number | 8 | @Link index: number |
| 9 | @Link currentIndex: number | 9 | @Link currentIndex: number |
| 10 | + @Link publishCommentModel: publishCommentModel | ||
| 10 | @Consume contentDetailData: ContentDetailDTO | 11 | @Consume contentDetailData: ContentDetailDTO |
| 11 | @State fakePageInfo: PageInfoDTO = {} as PageInfoDTO | 12 | @State fakePageInfo: PageInfoDTO = {} as PageInfoDTO |
| 12 | @State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16) | 13 | @State dialogOffsetY: number = 0 // (this.windowHeight - this.windowWidth * 9 / 16) |
| @@ -29,6 +30,7 @@ export struct CommentDialogView { | @@ -29,6 +30,7 @@ export struct CommentDialogView { | ||
| 29 | CommentListDialogView({ | 30 | CommentListDialogView({ |
| 30 | showCommentList: this.innerShowComment, | 31 | showCommentList: this.innerShowComment, |
| 31 | contentDetailData: this.contentDetailData, | 32 | contentDetailData: this.contentDetailData, |
| 33 | + publishCommentModel: this.publishCommentModel, | ||
| 32 | pageInfo: this.fakePageInfo, | 34 | pageInfo: this.fakePageInfo, |
| 33 | onClose: () => { | 35 | onClose: () => { |
| 34 | this.showCommentList = false | 36 | this.showCommentList = false |
| @@ -50,8 +50,6 @@ export struct WDPlayerRenderLiveView { | @@ -50,8 +50,6 @@ export struct WDPlayerRenderLiveView { | ||
| 50 | 50 | ||
| 51 | aboutToAppear() { | 51 | aboutToAppear() { |
| 52 | MGPlayRenderViewIns.add(); | 52 | MGPlayRenderViewIns.add(); |
| 53 | - | ||
| 54 | - console.log('playerController', this.playerController) | ||
| 55 | insIndex++; | 53 | insIndex++; |
| 56 | if (!this.playerController) { | 54 | if (!this.playerController) { |
| 57 | return | 55 | return |
| @@ -59,7 +57,6 @@ export struct WDPlayerRenderLiveView { | @@ -59,7 +57,6 @@ export struct WDPlayerRenderLiveView { | ||
| 59 | 57 | ||
| 60 | this.playerController.onVideoSizeChange = (width: number, height: number) => { | 58 | this.playerController.onVideoSizeChange = (width: number, height: number) => { |
| 61 | // console.log(`WDPlayerRenderView onVideoSizeChange width:${width} videoTop:${height}`) | 59 | // console.log(`WDPlayerRenderView onVideoSizeChange width:${width} videoTop:${height}`) |
| 62 | - Logger.info(TAG, ` onVideoSizeChange width:${width} videoTop:${height}`) | ||
| 63 | this.videoWidth = width; | 60 | this.videoWidth = width; |
| 64 | this.videoHeight = height; | 61 | this.videoHeight = height; |
| 65 | this.updateLayout() | 62 | this.updateLayout() |
| @@ -83,8 +80,6 @@ export struct WDPlayerRenderLiveView { | @@ -83,8 +80,6 @@ export struct WDPlayerRenderLiveView { | ||
| 83 | .onLoad(async (event) => { | 80 | .onLoad(async (event) => { |
| 84 | Logger.info(TAG, 'onLoad') | 81 | Logger.info(TAG, 'onLoad') |
| 85 | let surfaceId = this.xComponentController.getXComponentSurfaceId() | 82 | let surfaceId = this.xComponentController.getXComponentSurfaceId() |
| 86 | - console.log('surfaceId===', surfaceId) | ||
| 87 | - console.log('insId===', this.insId) | ||
| 88 | this.xComponentController.setXComponentSurfaceSize({ | 83 | this.xComponentController.setXComponentSurfaceSize({ |
| 89 | surfaceWidth: 1920, | 84 | surfaceWidth: 1920, |
| 90 | surfaceHeight: 720 | 85 | surfaceHeight: 720 |
| 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 { |
| @@ -116,7 +116,7 @@ export struct MultiPictureDetailPageComponent { | @@ -116,7 +116,7 @@ export struct MultiPictureDetailPageComponent { | ||
| 116 | index: $index, | 116 | index: $index, |
| 117 | currentIndex: $currentIndex, | 117 | currentIndex: $currentIndex, |
| 118 | showCommentList: $showCommentList, | 118 | showCommentList: $showCommentList, |
| 119 | - // publishCommentModel: $publishCommentModel | 119 | + publishCommentModel: $publishCommentModel |
| 120 | }) | 120 | }) |
| 121 | 121 | ||
| 122 | } | 122 | } |
-
Please register or login to post a comment