Showing
17 changed files
with
416 additions
and
68 deletions
| 1 | +{ | ||
| 2 | + "code":"0", | ||
| 3 | + "data":[ | ||
| 4 | + { | ||
| 5 | + "activityInfos":[ | ||
| 6 | + | ||
| 7 | + ], | ||
| 8 | + "appstyle":2, | ||
| 9 | + "audioList":[ | ||
| 10 | + | ||
| 11 | + ], | ||
| 12 | + "authorList":[ | ||
| 13 | + { | ||
| 14 | + "authorName":"" | ||
| 15 | + } | ||
| 16 | + ], | ||
| 17 | + "bestNoticer":1, | ||
| 18 | + "commentDisplay":1, | ||
| 19 | + "editorName":"舒健", | ||
| 20 | + "firstFrameImageUri":"https://cdnjdout.aikan.pdnews.cn/zhbj-20240116/vod/content/output/c72f4170db2c4d34befa453f60d39a69_opt.png", | ||
| 21 | + "fullColumnImgUrls":[ | ||
| 22 | + { | ||
| 23 | + "format":null, | ||
| 24 | + "height":534, | ||
| 25 | + "landscape":1, | ||
| 26 | + "size":479486, | ||
| 27 | + "url":"https://cdnjdphoto.aikan.pdnews.cn/sjbj-20240116/image/display/2ec7bccff2324b05ac4b6503d868a381.png", | ||
| 28 | + "weight":949 | ||
| 29 | + } | ||
| 30 | + ], | ||
| 31 | + "hasPopUp":null, | ||
| 32 | + "itemId":"", | ||
| 33 | + "itemTypeCode":"", | ||
| 34 | + "keyArticle":0, | ||
| 35 | + "likesStyle":1, | ||
| 36 | + "liveInfo":null, | ||
| 37 | + "menuShow":1, | ||
| 38 | + "newIntroduction":"我是生活在长江里的一头江豚,是长江中唯一的水生哺乳动物,更是国家一级保护动物。但曾几何时,我和我的江中小伙伴出现了生存危机……直到有一天,我突然发现,打渔人变成护渔人,江水变清澈了,长江逐渐恢复了生机,我的家族数量上升到了1249头。当长江之水再一次悠悠流淌,我们相拥在清澈波光中起舞。长江,我的家园。", | ||
| 39 | + "newLinkObject":null, | ||
| 40 | + "newsBodyTitle":"", | ||
| 41 | + "newsContent":"", | ||
| 42 | + "newsContentBak":"", | ||
| 43 | + "newsDownTitle":"", | ||
| 44 | + "newsId":30002089437, | ||
| 45 | + "newsLinkUrl":"", | ||
| 46 | + "newsShortTitle":"", | ||
| 47 | + "newsSource":"", | ||
| 48 | + "newsSourceName":"", | ||
| 49 | + "newsSummary":"我是生活在长江里的一头江豚,是长江中唯一的水生哺乳动物,更是国家一级保护动物。但曾几何时,我和我的江中小伙伴出现了生存危机……直到有一天,我突然发现,打渔人变成护渔人,江水变清澈了,长江逐渐恢复了生机,我的家族数量上升到了1249头。当长江之水再一次悠悠流淌,我们相拥在清澈波光中起舞。长江,我的家园。", | ||
| 50 | + "newsTags":"", | ||
| 51 | + "newsTitle":"一头江豚的自述", | ||
| 52 | + "newsType":1, | ||
| 53 | + "openAudio":1, | ||
| 54 | + "openComment":1, | ||
| 55 | + "openLikes":1, | ||
| 56 | + "photoList":[ | ||
| 57 | + | ||
| 58 | + ], | ||
| 59 | + "popUps":[ | ||
| 60 | + | ||
| 61 | + ], | ||
| 62 | + "preCommentFlag":0, | ||
| 63 | + "publishTime":"2024-01-16 17:34:29", | ||
| 64 | + "reLInfo":{ | ||
| 65 | + "channelId":2002, | ||
| 66 | + "relId":"500000259325", | ||
| 67 | + "relObjectId":2002, | ||
| 68 | + "relType":"1" | ||
| 69 | + }, | ||
| 70 | + "readFlag":0, | ||
| 71 | + "recommendShow":1, | ||
| 72 | + "rmhInfo":null, | ||
| 73 | + "rmhPlatform":0, | ||
| 74 | + "sceneId":"", | ||
| 75 | + "shareInfo":{ | ||
| 76 | + "shareCoverUrl":"https://cdnjdphoto.aikan.pdnews.cn/zhbj-20240116/image/content/7e0e58dc57a743f1b1b4904811f2a231.png?x-oss-process=image/resize,w_200", | ||
| 77 | + "shareOpen":1, | ||
| 78 | + "sharePosterCoverUrl":"https://cdnjdphoto.aikan.pdnews.cn/sjbj-20240116/image/display/2ec7bccff2324b05ac4b6503d868a381.png", | ||
| 79 | + "sharePosterOpen":0, | ||
| 80 | + "shareSummary":"我是生活在长江里的一头江豚,是长江中唯一的水生哺乳动物,更是国家一级保护动物。但曾几何时,我和我的江中小伙伴出现了生存危机……直到有一天,我突然发现,打渔人变成护渔人,江水变清澈了,长江逐渐恢复了生机,我的家族数量上升到了1249头。当长江之水再一次悠悠流淌,我们相拥在清澈波光中起舞。长江,我的家园。", | ||
| 81 | + "shareTitle":"一头江豚的自述", | ||
| 82 | + "shareUrl":"https://people.pdnews.cn/column/30002089437-500000259325" | ||
| 83 | + }, | ||
| 84 | + "specialColumnId":null, | ||
| 85 | + "specialColumnName":"", | ||
| 86 | + "subSceneId":"", | ||
| 87 | + "timeline":null, | ||
| 88 | + "topicInfo":null, | ||
| 89 | + "traceId":"", | ||
| 90 | + "traceInfo":"", | ||
| 91 | + "userInfo":null, | ||
| 92 | + "videoInfo":[ | ||
| 93 | + { | ||
| 94 | + "clarity":5, | ||
| 95 | + "resolutionHeight":720, | ||
| 96 | + "resolutionWidth":1280, | ||
| 97 | + "videoDuration":229, | ||
| 98 | + "videoLandScape":1, | ||
| 99 | + "videoType":1, | ||
| 100 | + "videoUrl":"https://cdnjdout.aikan.pdnews.cn/zhbj-20240116/vod/content/output/c72f4170db2c4d34befa453f60d39a69_opt.mp4" | ||
| 101 | + } | ||
| 102 | + ], | ||
| 103 | + "viewCount":0, | ||
| 104 | + "visitorComment":1, | ||
| 105 | + "voteInfo":null | ||
| 106 | + } | ||
| 107 | + ], | ||
| 108 | + "message":"Success", | ||
| 109 | + "meta":null, | ||
| 110 | + "requestId":"", | ||
| 111 | + "success":true, | ||
| 112 | + "timestamp":1707029290421 | ||
| 113 | +} |
| @@ -16,20 +16,20 @@ export interface ContentDetailRequestParams { | @@ -16,20 +16,20 @@ export interface ContentDetailRequestParams { | ||
| 16 | export class ContentDetailRequest { | 16 | export class ContentDetailRequest { |
| 17 | static getContentDetailDataMock(context: Context): Promise<ResponseDTO<ContentDetailDTO[]>> { | 17 | static getContentDetailDataMock(context: Context): Promise<ResponseDTO<ContentDetailDTO[]>> { |
| 18 | Logger.info(TAG, `getContentDetailDataMock start`); | 18 | Logger.info(TAG, `getContentDetailDataMock start`); |
| 19 | - return ResourcesUtils.getResourcesJson<ResponseDTO<ContentDetailDTO[]>>(context, 'content_detail.json') | 19 | + return ResourcesUtils.getResourcesJson<ResponseDTO<ContentDetailDTO[]>>(context, 'content_detail2.json') |
| 20 | } | 20 | } |
| 21 | 21 | ||
| 22 | - /** | ||
| 23 | - * 现网-新闻内容详情域名 | ||
| 24 | - */ | ||
| 25 | - static readonly HOST2: string = "https://pdapis.pdnews.cn"; | 22 | + // /** |
| 23 | + // * 现网-新闻内容详情域名 | ||
| 24 | + // */ | ||
| 25 | + // static readonly HOST2: string = "https://pdapis.pdnews.cn"; | ||
| 26 | /** | 26 | /** |
| 27 | * 新闻内容详情【get】接口 | 27 | * 新闻内容详情【get】接口 |
| 28 | */ | 28 | */ |
| 29 | static readonly CONTENT_DETAIL_PATH: string = "/api/rmrb-bff-display-zh/content/zh/c/content/detail"; | 29 | static readonly CONTENT_DETAIL_PATH: string = "/api/rmrb-bff-display-zh/content/zh/c/content/detail"; |
| 30 | 30 | ||
| 31 | static getContentDetailUrl(contentId: string, relId: string, relType: string) { | 31 | static getContentDetailUrl(contentId: string, relId: string, relType: string) { |
| 32 | - let url = ContentDetailRequest.HOST2 + ContentDetailRequest.CONTENT_DETAIL_PATH | 32 | + let url = HttpUrlUtils.getHost() + ContentDetailRequest.CONTENT_DETAIL_PATH |
| 33 | url = url + "?&contentId=" + contentId | 33 | url = url + "?&contentId=" + contentId |
| 34 | + "&relId=" + relId | 34 | + "&relId=" + relId |
| 35 | + "&relType=" + relType; | 35 | + "&relType=" + relType; |
| @@ -19,8 +19,8 @@ const TAG = 'DetailPlayShortVideoPage'; | @@ -19,8 +19,8 @@ const TAG = 'DetailPlayShortVideoPage'; | ||
| 19 | @Component | 19 | @Component |
| 20 | export struct DetailPlayShortVideoPage { | 20 | export struct DetailPlayShortVideoPage { |
| 21 | private contentId?: string = undefined | 21 | private contentId?: string = undefined |
| 22 | - private relId?:string = undefined | ||
| 23 | - private relType?:string = undefined | 22 | + private relId?: string = undefined |
| 23 | + private relType?: string = undefined | ||
| 24 | private playerController: WDPlayerController = new WDPlayerController(); | 24 | private playerController: WDPlayerController = new WDPlayerController(); |
| 25 | @Watch("urlChanged") @State url?: string = undefined | 25 | @Watch("urlChanged") @State url?: string = undefined |
| 26 | @Watch('changeContinue') @Provide nextContId?: string = ''; | 26 | @Watch('changeContinue') @Provide nextContId?: string = ''; |
| @@ -32,6 +32,8 @@ export struct DetailPlayShortVideoPage { | @@ -32,6 +32,8 @@ export struct DetailPlayShortVideoPage { | ||
| 32 | @Provide userId: string = ''; | 32 | @Provide userId: string = ''; |
| 33 | @Provide title?: string = undefined | 33 | @Provide title?: string = undefined |
| 34 | @Provide message?: string = undefined | 34 | @Provide message?: string = undefined |
| 35 | + @Provide newsSummary?: string = undefined | ||
| 36 | + @Provide progressVal: number = 0; | ||
| 35 | 37 | ||
| 36 | playVMChanged(name: string) { | 38 | playVMChanged(name: string) { |
| 37 | this.url = this.playVM.url | 39 | this.url = this.playVM.url |
| @@ -40,13 +42,14 @@ export struct DetailPlayShortVideoPage { | @@ -40,13 +42,14 @@ export struct DetailPlayShortVideoPage { | ||
| 40 | this.nextContId = this.playVM.nextContId | 42 | this.nextContId = this.playVM.nextContId |
| 41 | this.canStart = this.playVM.canStart; | 43 | this.canStart = this.playVM.canStart; |
| 42 | this.message = this.playVM.message | 44 | this.message = this.playVM.message |
| 45 | + this.newsSummary = this.playVM.newsSummary | ||
| 43 | } | 46 | } |
| 44 | 47 | ||
| 45 | aboutToAppear() { | 48 | aboutToAppear() { |
| 46 | let action: Action = router.getParams() as Action | 49 | let action: Action = router.getParams() as Action |
| 47 | if (action) { | 50 | if (action) { |
| 48 | this.contentId = action.params?.contentID | 51 | this.contentId = action.params?.contentID |
| 49 | - if (action.params && action.params.extra){ | 52 | + if (action.params && action.params.extra) { |
| 50 | this.relId = action.params.extra.relId | 53 | this.relId = action.params.extra.relId |
| 51 | this.relType = action.params.extra.relType | 54 | this.relType = action.params.extra.relType |
| 52 | } | 55 | } |
| @@ -104,7 +107,9 @@ export struct DetailPlayShortVideoPage { | @@ -104,7 +107,9 @@ export struct DetailPlayShortVideoPage { | ||
| 104 | @Builder | 107 | @Builder |
| 105 | detailContainer() { | 108 | detailContainer() { |
| 106 | // DetailTabBarPageComponent({ pageId: this.pageId }).backgroundColor(Color.Black) | 109 | // DetailTabBarPageComponent({ pageId: this.pageId }).backgroundColor(Color.Black) |
| 107 | - DetailContainer() | 110 | + DetailContainer({ |
| 111 | + playerController: this.playerController | ||
| 112 | + }) | ||
| 108 | } | 113 | } |
| 109 | 114 | ||
| 110 | build() { | 115 | build() { |
| 1 | +import { WDPlayerController } from 'wdPlayer'; | ||
| 1 | import { PlayerTitleComment } from './PlayerTitleComment' | 2 | import { PlayerTitleComment } from './PlayerTitleComment' |
| 2 | 3 | ||
| 3 | /** | 4 | /** |
| @@ -5,8 +6,12 @@ import { PlayerTitleComment } from './PlayerTitleComment' | @@ -5,8 +6,12 @@ import { PlayerTitleComment } from './PlayerTitleComment' | ||
| 5 | */ | 6 | */ |
| 6 | @Component | 7 | @Component |
| 7 | export struct DetailContainer { | 8 | export struct DetailContainer { |
| 9 | + private playerController?: WDPlayerController; | ||
| 10 | + | ||
| 8 | build() { | 11 | build() { |
| 9 | - PlayerTitleComment() | 12 | + PlayerTitleComment({ |
| 13 | + playerController: this.playerController | ||
| 14 | + }) | ||
| 10 | .width('100%') | 15 | .width('100%') |
| 11 | } | 16 | } |
| 12 | } | 17 | } |
| 1 | +import router from '@ohos.router'; | ||
| 2 | + | ||
| 3 | +const FULL_PARENT: string = '100%'; | ||
| 4 | + | ||
| 5 | +const TAG = 'DetailTitleSummaryView'; | ||
| 6 | + | ||
| 7 | +@Entry | ||
| 8 | +@Component | ||
| 9 | +export struct DetailTitleSummaryView { | ||
| 10 | + @State title: string = 'title' | ||
| 11 | + @State newsSummary: string = 'newsSummary' | ||
| 12 | + | ||
| 13 | + aboutToAppear() { | ||
| 14 | + this.newsSummary = 'newsSummary 0 newsSummary newsSummary newsSummary newsSummary newsSummary 0 newsSummary newsSummary newsSummary newsSummary' | ||
| 15 | + } | ||
| 16 | + | ||
| 17 | + build() { | ||
| 18 | + Stack() { | ||
| 19 | + Text('1') | ||
| 20 | + .width('100%') | ||
| 21 | + .margin({ top: 10 }) | ||
| 22 | + .fontColor(Color.White) | ||
| 23 | + .fontSize(30) | ||
| 24 | + .maxLines(1) | ||
| 25 | + | ||
| 26 | + } | ||
| 27 | + .height('60%') | ||
| 28 | + .backgroundColor(Color.Black) | ||
| 29 | + | ||
| 30 | + // Column() { | ||
| 31 | + // Text(this.title) | ||
| 32 | + // .width('100%') | ||
| 33 | + // .margin({ top: 10 }) | ||
| 34 | + // .fontColor(Color.White) | ||
| 35 | + // .fontSize(30) | ||
| 36 | + // .maxLines(1) | ||
| 37 | + // | ||
| 38 | + // List() { | ||
| 39 | + // ListItem() { | ||
| 40 | + // Text(this.newsSummary) | ||
| 41 | + // .width(FULL_PARENT) | ||
| 42 | + // .fontWeight(FontWeight.Bold) | ||
| 43 | + // .fontColor(Color.White) | ||
| 44 | + // .maxLines(10) | ||
| 45 | + // .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 46 | + // } | ||
| 47 | + // } | ||
| 48 | + // .constraintSize({ maxHeight: '40%' }) | ||
| 49 | + // .margin({ top: 5 }) | ||
| 50 | + // | ||
| 51 | + // Image($r('app.media.ic_close')) | ||
| 52 | + // .height(24) | ||
| 53 | + // .width(24) | ||
| 54 | + // .margin({ top: 10 }) | ||
| 55 | + // .alignRules({ | ||
| 56 | + // right: { anchor: "__container__", align: HorizontalAlign.End }, | ||
| 57 | + // center: { anchor: "__container__", align: VerticalAlign.Center } }) | ||
| 58 | + // .id('img_close') | ||
| 59 | + // .onClick((event: ClickEvent) => { | ||
| 60 | + // // console.info(TAG, "img_close") | ||
| 61 | + // router.back() | ||
| 62 | + // }) | ||
| 63 | + // } | ||
| 64 | + // .margin({ left: 14, right: 14 }) | ||
| 65 | + // .backgroundColor(Color.Black) | ||
| 66 | + } | ||
| 67 | +} |
| 1 | +import router from '@ohos.router'; | ||
| 2 | +import { ToastUtils } from 'wdKit'; | ||
| 3 | + | ||
| 4 | +export interface OperationItem { | ||
| 5 | + icon: Resource; | ||
| 6 | + | ||
| 7 | + // icon_selected: Resource; | ||
| 8 | + text: string | Resource; | ||
| 9 | + num?: number; // 个数 | ||
| 10 | +} | ||
| 11 | + | ||
| 12 | +const FULL_PARENT: string = '100%'; | ||
| 13 | + | ||
| 14 | +const TAG = 'OperationListView'; | ||
| 15 | + | ||
| 16 | +@Entry | ||
| 17 | +@Component | ||
| 18 | +export struct OperationListView { | ||
| 19 | + @State operationList: OperationItem[] = [ | ||
| 20 | + { | ||
| 21 | + icon: $r('app.media.ic_like_uncheck'), | ||
| 22 | + text: "点赞", | ||
| 23 | + num: 6622 | ||
| 24 | + }, | ||
| 25 | + { | ||
| 26 | + icon: $r('app.media.ic_collect_uncheck'), | ||
| 27 | + text: "收藏", | ||
| 28 | + num: 662, | ||
| 29 | + }, | ||
| 30 | + { | ||
| 31 | + icon: $r('app.media.ic_comment'), | ||
| 32 | + text: "评论", | ||
| 33 | + num: 500, | ||
| 34 | + }, | ||
| 35 | + { | ||
| 36 | + icon: $r('app.media.ic_share'), | ||
| 37 | + text: "分享" | ||
| 38 | + } | ||
| 39 | + ] | ||
| 40 | + | ||
| 41 | + aboutToAppear() { | ||
| 42 | + } | ||
| 43 | + | ||
| 44 | + build() { | ||
| 45 | + | ||
| 46 | + List({ space: 0, initialIndex: 0 }) { | ||
| 47 | + ForEach(this.operationList, (item: OperationItem, index: number) => { | ||
| 48 | + ListItem() { | ||
| 49 | + this.buildOperationItem(item, index) | ||
| 50 | + } | ||
| 51 | + }, (item: OperationItem, index: number) => JSON.stringify(item)) | ||
| 52 | + } | ||
| 53 | + .width(48) | ||
| 54 | + // .margin({ bottom: 100 }) | ||
| 55 | + //.backgroundColor(Color.Red) | ||
| 56 | + // .listDirection(Axis.Vertical) // 默认值:Axis.Vertical | ||
| 57 | + // .lanes(this.buildLanes()) // 行/列数,一列 // 默认值:1 | ||
| 58 | + .cachedCount(2) | ||
| 59 | + .scrollBar(BarState.Off) | ||
| 60 | + .nestedScroll({ | ||
| 61 | + scrollForward: NestedScrollMode.PARENT_FIRST, | ||
| 62 | + scrollBackward: NestedScrollMode.SELF_FIRST | ||
| 63 | + }) | ||
| 64 | + // Stack({alignContent:Alignment.End}) { | ||
| 65 | + // } | ||
| 66 | + // .width('100%') | ||
| 67 | + } | ||
| 68 | + | ||
| 69 | + /** | ||
| 70 | + * 组件项 | ||
| 71 | + * | ||
| 72 | + * @param programmeBean item 组件项 | ||
| 73 | + */ | ||
| 74 | + @Builder | ||
| 75 | + buildOperationItem(item: OperationItem, index: number) { | ||
| 76 | + Column() { | ||
| 77 | + Image(item.icon) | ||
| 78 | + .width('100%') | ||
| 79 | + .aspectRatio(1) | ||
| 80 | + // .borderRadius(6) | ||
| 81 | + | ||
| 82 | + Text(item.text) | ||
| 83 | + .width('100%') | ||
| 84 | + // .margin({ top: 4, left: 6, right: 6 })// .backgroundColor(Color.Brown) | ||
| 85 | + .fontWeight(FontWeight.Normal) | ||
| 86 | + .textAlign(TextAlign.Center) | ||
| 87 | + .fontSize(13) | ||
| 88 | + .fontColor('#FFFFFF') | ||
| 89 | + .maxLines(1) | ||
| 90 | + .textOverflow({ overflow: TextOverflow.Ellipsis }) | ||
| 91 | + } | ||
| 92 | + .margin(10) | ||
| 93 | + // .backgroundColor(Color.Black) | ||
| 94 | + .alignItems(HorizontalAlign.Center) | ||
| 95 | + .hoverEffect(HoverEffect.Scale) | ||
| 96 | + .onClick((event: ClickEvent) => { | ||
| 97 | + console.info(TAG, `buildOperationItem onClick event index: ${index}`); | ||
| 98 | + ToastUtils.showToast('体验版本功能暂未开放', 1000); | ||
| 99 | + }) | ||
| 100 | + } | ||
| 101 | +} |
| @@ -14,7 +14,7 @@ export struct PlayControlViewContainer { | @@ -14,7 +14,7 @@ export struct PlayControlViewContainer { | ||
| 14 | @Consume status: number; | 14 | @Consume status: number; |
| 15 | @Provide currentTime: string = "00:00"; | 15 | @Provide currentTime: string = "00:00"; |
| 16 | @Provide totalTime: string = "00:00"; | 16 | @Provide totalTime: string = "00:00"; |
| 17 | - @Provide progressVal: number = 0; | 17 | + @Consume progressVal: number; |
| 18 | @Provide isShowVolume: boolean = false; | 18 | @Provide isShowVolume: boolean = false; |
| 19 | @Provide volumeProgress: number = 1; | 19 | @Provide volumeProgress: number = 1; |
| 20 | @Consume isFullScreen: boolean; | 20 | @Consume isFullScreen: boolean; |
| @@ -51,60 +51,60 @@ export struct PlayerProgressBar { | @@ -51,60 +51,60 @@ export struct PlayerProgressBar { | ||
| 51 | 51 | ||
| 52 | build() { | 52 | build() { |
| 53 | Column() { | 53 | Column() { |
| 54 | - Row() { | ||
| 55 | - Column() { | ||
| 56 | - Image(this.status === PlayerConstants.STATUS_START ? | ||
| 57 | - $r('app.media.ic_pause') : $r('app.media.ic_play')) | ||
| 58 | - .width($r('app.float.control_image_width')) | ||
| 59 | - .aspectRatio(1) | ||
| 60 | - .onClick(() => { | ||
| 61 | - let curStatus = (this.status === PlayerConstants.STATUS_START); | ||
| 62 | - this.status = curStatus ? PlayerConstants.STATUS_PAUSE : PlayerConstants.STATUS_START; | ||
| 63 | - this.playerController?.switchPlayOrPause(); | ||
| 64 | - }) | ||
| 65 | - } | ||
| 66 | - .justifyContent(FlexAlign.Center) | ||
| 67 | - .alignItems(HorizontalAlign.Center) | ||
| 68 | - .width(44) | ||
| 69 | - .height('100%') | ||
| 70 | - | ||
| 71 | - Text(this.currentTime) | ||
| 72 | - .fontSize($r("app.float.font_size_14")) | ||
| 73 | - .fontColor(Color.White) | ||
| 74 | - Slider({ | ||
| 75 | - value: this.progressVal, | ||
| 76 | - step: 1, | ||
| 77 | - style: SliderStyle.OutSet | ||
| 78 | - }) | ||
| 79 | - .blockColor(Color.White) | ||
| 80 | - .trackColor($r('app.color.track_color')) | ||
| 81 | - .selectedColor($r('app.color.index_tab_selected_font_color')) | ||
| 82 | - .trackThickness(1) | ||
| 83 | - .layoutWeight(1) | ||
| 84 | - .onChange((value: number, mode: SliderChangeMode) => { | ||
| 85 | - this.playerController?.setSeekTime(value, mode); | ||
| 86 | - }) | ||
| 87 | - Text(this.totalTime) | ||
| 88 | - .fontSize($r("app.float.font_size_14")) | ||
| 89 | - .fontColor(Color.White) | ||
| 90 | - | ||
| 91 | - Column() { | ||
| 92 | - Image($r('app.media.ic_fullscreen')) | ||
| 93 | - .width($r('app.float.control_image_width')) | ||
| 94 | - .aspectRatio(1) | ||
| 95 | - .onClick(() => { | ||
| 96 | - this.isFullScreen = !this.isFullScreen; | ||
| 97 | - WindowModel.shared.setPreferredOrientation(window.Orientation.LANDSCAPE); | ||
| 98 | - devicePLSensorManager.devicePLSensorOn(window.Orientation.LANDSCAPE); | ||
| 99 | - }) | ||
| 100 | - } | ||
| 101 | - .justifyContent(FlexAlign.Center) | ||
| 102 | - .alignItems(HorizontalAlign.Center) | ||
| 103 | - .width(44) | ||
| 104 | - .height('100%') | ||
| 105 | - } | ||
| 106 | - .width('100%') | ||
| 107 | - .visibility(this.isFullScreen ? Visibility.None : Visibility.Visible) | 54 | + // Row() { |
| 55 | + // Column() { | ||
| 56 | + // Image(this.status === PlayerConstants.STATUS_START ? | ||
| 57 | + // $r('app.media.ic_pause') : $r('app.media.ic_play')) | ||
| 58 | + // .width($r('app.float.control_image_width')) | ||
| 59 | + // .aspectRatio(1) | ||
| 60 | + // .onClick(() => { | ||
| 61 | + // let curStatus = (this.status === PlayerConstants.STATUS_START); | ||
| 62 | + // this.status = curStatus ? PlayerConstants.STATUS_PAUSE : PlayerConstants.STATUS_START; | ||
| 63 | + // this.playerController?.switchPlayOrPause(); | ||
| 64 | + // }) | ||
| 65 | + // } | ||
| 66 | + // .justifyContent(FlexAlign.Center) | ||
| 67 | + // .alignItems(HorizontalAlign.Center) | ||
| 68 | + // .width(44) | ||
| 69 | + // .height('100%') | ||
| 70 | + // | ||
| 71 | + // Text(this.currentTime) | ||
| 72 | + // .fontSize($r("app.float.font_size_14")) | ||
| 73 | + // .fontColor(Color.White) | ||
| 74 | + // Slider({ | ||
| 75 | + // value: this.progressVal, | ||
| 76 | + // step: 1, | ||
| 77 | + // style: SliderStyle.OutSet | ||
| 78 | + // }) | ||
| 79 | + // .blockColor(Color.White) | ||
| 80 | + // .trackColor($r('app.color.track_color')) | ||
| 81 | + // .selectedColor($r('app.color.index_tab_selected_font_color')) | ||
| 82 | + // .trackThickness(1) | ||
| 83 | + // .layoutWeight(1) | ||
| 84 | + // .onChange((value: number, mode: SliderChangeMode) => { | ||
| 85 | + // this.playerController?.setSeekTime(value, mode); | ||
| 86 | + // }) | ||
| 87 | + // Text(this.totalTime) | ||
| 88 | + // .fontSize($r("app.float.font_size_14")) | ||
| 89 | + // .fontColor(Color.White) | ||
| 90 | + // | ||
| 91 | + // Column() { | ||
| 92 | + // Image($r('app.media.ic_fullscreen')) | ||
| 93 | + // .width($r('app.float.control_image_width')) | ||
| 94 | + // .aspectRatio(1) | ||
| 95 | + // .onClick(() => { | ||
| 96 | + // this.isFullScreen = !this.isFullScreen; | ||
| 97 | + // WindowModel.shared.setPreferredOrientation(window.Orientation.LANDSCAPE); | ||
| 98 | + // devicePLSensorManager.devicePLSensorOn(window.Orientation.LANDSCAPE); | ||
| 99 | + // }) | ||
| 100 | + // } | ||
| 101 | + // .justifyContent(FlexAlign.Center) | ||
| 102 | + // .alignItems(HorizontalAlign.Center) | ||
| 103 | + // .width(44) | ||
| 104 | + // .height('100%') | ||
| 105 | + // } | ||
| 106 | + // .width('100%') | ||
| 107 | + // .visibility(this.isFullScreen ? Visibility.None : Visibility.Visible) | ||
| 108 | 108 | ||
| 109 | Column() { | 109 | Column() { |
| 110 | Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { | 110 | Flex({ direction: FlexDirection.Row, alignItems: ItemAlign.Center }) { |
| @@ -4,14 +4,17 @@ import deviceInfo from '@ohos.deviceInfo' | @@ -4,14 +4,17 @@ import deviceInfo from '@ohos.deviceInfo' | ||
| 4 | import { WindowModel } from 'wdKit'; | 4 | import { WindowModel } from 'wdKit'; |
| 5 | import { WDPlayerController } from 'wdPlayer'; | 5 | import { WDPlayerController } from 'wdPlayer'; |
| 6 | import { devicePLSensorManager } from 'wdDetailPlayApi'; | 6 | import { devicePLSensorManager } from 'wdDetailPlayApi'; |
| 7 | +import { OperationListView } from './OperationListView'; | ||
| 7 | 8 | ||
| 8 | @Component | 9 | @Component |
| 9 | export struct PlayerTitleComment { | 10 | export struct PlayerTitleComment { |
| 10 | private playerController?: WDPlayerController; | 11 | private playerController?: WDPlayerController; |
| 11 | @Consume title?: string | 12 | @Consume title?: string |
| 13 | + @Consume newsSummary?: string; | ||
| 12 | @State @Watch('watchSpeed') playSpeed: number = 1; | 14 | @State @Watch('watchSpeed') playSpeed: number = 1; |
| 13 | @Consume isFullScreen: boolean; | 15 | @Consume isFullScreen: boolean; |
| 14 | @State comment: string = ''; | 16 | @State comment: string = ''; |
| 17 | + @Consume progressVal: number; | ||
| 15 | 18 | ||
| 16 | aboutToAppear() { | 19 | aboutToAppear() { |
| 17 | } | 20 | } |
| @@ -22,6 +25,35 @@ export struct PlayerTitleComment { | @@ -22,6 +25,35 @@ export struct PlayerTitleComment { | ||
| 22 | 25 | ||
| 23 | build() { | 26 | build() { |
| 24 | Column() { | 27 | Column() { |
| 28 | + Column() { | ||
| 29 | + Row() { | ||
| 30 | + Image($r('app.media.ic_switch_orientation')) | ||
| 31 | + .width(34) | ||
| 32 | + .aspectRatio(1) | ||
| 33 | + .objectFit(ImageFit.Contain) | ||
| 34 | + .padding({ left: 10, right: 5 }) | ||
| 35 | + Text("全屏观看") | ||
| 36 | + .fontColor(Color.White) | ||
| 37 | + .fontSize('14fp') | ||
| 38 | + .maxLines(2) | ||
| 39 | + .layoutWeight(1) | ||
| 40 | + } | ||
| 41 | + .width(100) | ||
| 42 | + .backgroundColor(Color.Gray) | ||
| 43 | + .borderRadius(10) | ||
| 44 | + .alignItems(VerticalAlign.Center) | ||
| 45 | + .onClick(() => { | ||
| 46 | + this.isFullScreen = !this.isFullScreen; | ||
| 47 | + WindowModel.shared.setPreferredOrientation(window.Orientation.LANDSCAPE); | ||
| 48 | + devicePLSensorManager.devicePLSensorOn(window.Orientation.LANDSCAPE); | ||
| 49 | + }) | ||
| 50 | + } | ||
| 51 | + .width('100%') | ||
| 52 | + .margin({ bottom: 120 }) | ||
| 53 | + .alignItems(HorizontalAlign.Center) | ||
| 54 | + | ||
| 55 | + Row() { | ||
| 56 | + Column() { | ||
| 25 | Text(this.title) | 57 | Text(this.title) |
| 26 | .fontColor(Color.White) | 58 | .fontColor(Color.White) |
| 27 | .fontSize(14) | 59 | .fontSize(14) |
| @@ -31,8 +63,30 @@ export struct PlayerTitleComment { | @@ -31,8 +63,30 @@ export struct PlayerTitleComment { | ||
| 31 | .fontColor(Color.White) | 63 | .fontColor(Color.White) |
| 32 | .fontSize('14fp') | 64 | .fontSize('14fp') |
| 33 | .maxLines(2) | 65 | .maxLines(2) |
| 66 | + } | ||
| 67 | + .layoutWeight(1) | ||
| 68 | + .alignItems(HorizontalAlign.Start) | ||
| 34 | 69 | ||
| 35 | - Divider().height(30) | 70 | + // OperationListView() |
| 71 | + // .width(48) | ||
| 72 | + // .height(150) | ||
| 73 | + // .zIndex(3) | ||
| 74 | + } | ||
| 75 | + .width('100%') | ||
| 76 | + | ||
| 77 | + Slider({ | ||
| 78 | + value: this.progressVal, | ||
| 79 | + step: 1, | ||
| 80 | + style: SliderStyle.OutSet | ||
| 81 | + }) | ||
| 82 | + .blockColor(Color.White) | ||
| 83 | + .trackColor($r('app.color.track_color')) | ||
| 84 | + .selectedColor($r('app.color.index_tab_selected_font_color')) | ||
| 85 | + .trackThickness(1) | ||
| 86 | + .width('100%') | ||
| 87 | + .onChange((value: number, mode: SliderChangeMode) => { | ||
| 88 | + this.playerController?.setSeekTime(value, mode); | ||
| 89 | + }) | ||
| 36 | 90 | ||
| 37 | Row() { | 91 | Row() { |
| 38 | Image($r('app.media.ic_back')) | 92 | Image($r('app.media.ic_back')) |
| @@ -72,6 +126,7 @@ export struct PlayerTitleComment { | @@ -72,6 +126,7 @@ export struct PlayerTitleComment { | ||
| 72 | }.alignItems(VerticalAlign.Center) | 126 | }.alignItems(VerticalAlign.Center) |
| 73 | } | 127 | } |
| 74 | .width('100%') | 128 | .width('100%') |
| 129 | + // .height('40%') | ||
| 75 | .alignItems(HorizontalAlign.Start) | 130 | .alignItems(HorizontalAlign.Start) |
| 76 | } | 131 | } |
| 77 | } | 132 | } |
| 1 | import { BusinessError } from '@ohos.base' | 1 | import { BusinessError } from '@ohos.base' |
| 2 | import { Logger, ToastUtils } from 'wdKit' | 2 | import { Logger, ToastUtils } from 'wdKit' |
| 3 | -import { ResponseDTO} from 'wdNetwork' | 3 | +import { ResponseDTO } from 'wdNetwork' |
| 4 | import { ContentDetailRequest } from 'wdDetailPlayApi' | 4 | import { ContentDetailRequest } from 'wdDetailPlayApi' |
| 5 | import { ContentDetailDTO } from 'wdBean' | 5 | import { ContentDetailDTO } from 'wdBean' |
| 6 | 6 | ||
| @@ -16,6 +16,7 @@ export class PlayViewModel { | @@ -16,6 +16,7 @@ export class PlayViewModel { | ||
| 16 | nextContId?: string | 16 | nextContId?: string |
| 17 | canStart?: boolean | 17 | canStart?: boolean |
| 18 | message?: string | 18 | message?: string |
| 19 | + newsSummary?: string | ||
| 19 | 20 | ||
| 20 | constructor() { | 21 | constructor() { |
| 21 | // todo: | 22 | // todo: |
| @@ -57,6 +58,7 @@ export class PlayViewModel { | @@ -57,6 +58,7 @@ export class PlayViewModel { | ||
| 57 | this.url = resDTO.data[0].videoInfo[0].videoUrl | 58 | this.url = resDTO.data[0].videoInfo[0].videoUrl |
| 58 | this.canStart = true; | 59 | this.canStart = true; |
| 59 | this.message = ''; | 60 | this.message = ''; |
| 61 | + this.newsSummary = resDTO.data[0].newsSummary | ||
| 60 | }).catch((err: BusinessError) => { | 62 | }).catch((err: BusinessError) => { |
| 61 | Logger.error(TAG, `getContentDetailData catch, error.code : ${err.code}, error.message:${err.message}`); | 63 | Logger.error(TAG, `getContentDetailData catch, error.code : ${err.code}, error.message:${err.message}`); |
| 62 | // todo: | 64 | // todo: |
908 Bytes
sight_harmony/wdDetailPlayShortVideo/src/main/resources/base/media/ic_collect_uncheck.png
0 → 100644
4.37 KB
2.21 KB
2.97 KB
-
Please register or login to post a comment