liyubing

Merge remote-tracking branch 'origin/main'

Showing 22 changed files with 205 additions and 49 deletions
@@ -60,7 +60,7 @@ export struct CarderInteraction { @@ -60,7 +60,7 @@ export struct CarderInteraction {
60 }) 60 })
61 } 61 }
62 62
63 - if(this.contentDetailData?.openComment == 1){ 63 + if(this.contentDetailData?.openComment == 1 || router.getState().name === 'PeopleShipHomePage'){
64 this.commentLayout() 64 this.commentLayout()
65 } 65 }
66 this.builderLike() 66 this.builderLike()
@@ -784,13 +784,13 @@ export struct DynamicDetailComponent { @@ -784,13 +784,13 @@ export struct DynamicDetailComponent {
784 return 784 return
785 } 785 }
786 const params: postExecuteLikeParams = { 786 const params: postExecuteLikeParams = {
787 - status: this.newsStatusOfUser?.likeStatus === '1' ? 0 : 1, 787 + status: this.newsStatusOfUser?.likeStatus == '1' ? 0 : 1,
788 contentId: this.contentDetailData?.newsId + '', 788 contentId: this.contentDetailData?.newsId + '',
789 contentType: this.contentDetailData?.newsType + '', 789 contentType: this.contentDetailData?.newsType + '',
790 } 790 }
791 ContentDetailRequest.postExecuteLike(params).then(res => { 791 ContentDetailRequest.postExecuteLike(params).then(res => {
792 - this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus === '1' ? '0' : '1'  
793 - if (this.newsStatusOfUser.likeStatus === '1') { 792 + this.newsStatusOfUser.likeStatus = this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1'
  793 + if (this.newsStatusOfUser.likeStatus == '1') {
794 this.interactDataDTO.likeNum = Number(this.interactDataDTO.likeNum) + 1 794 this.interactDataDTO.likeNum = Number(this.interactDataDTO.likeNum) + 1
795 } else { 795 } else {
796 this.interactDataDTO.likeNum = Number(this.interactDataDTO.likeNum) - 1 796 this.interactDataDTO.likeNum = Number(this.interactDataDTO.likeNum) - 1
@@ -798,7 +798,7 @@ export struct DynamicDetailComponent { @@ -798,7 +798,7 @@ export struct DynamicDetailComponent {
798 console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactDataDTO?.likeNum) 798 console.log('点赞、取消点赞==', this.newsStatusOfUser?.likeStatus, this.interactDataDTO?.likeNum)
799 799
800 //内容点赞、取消点赞Tracking 1点赞 0取消点赞 800 //内容点赞、取消点赞Tracking 1点赞 0取消点赞
801 - TrackingContent.like(this.newsStatusOfUser?.likeStatus === '1', TrackConstants.PageName.DynamicDetail, TrackConstants.PageName.DynamicDetail, 801 + TrackingContent.like(this.newsStatusOfUser?.likeStatus == '1', TrackConstants.PageName.DynamicDetail, TrackConstants.PageName.DynamicDetail,
802 { 802 {
803 'contentType': `${this.contentDetailData.newsType}`, 803 'contentType': `${this.contentDetailData.newsType}`,
804 'contentId': `${this.contentDetailData.newsId}`, 804 'contentId': `${this.contentDetailData.newsId}`,
@@ -373,8 +373,11 @@ export struct ImageAndTextPageComponent { @@ -373,8 +373,11 @@ export struct ImageAndTextPageComponent {
373 status: this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1', 373 status: this.newsStatusOfUser?.likeStatus == '1' ? '0' : '1',
374 contentId: this.contentDetailData?.newsId + '', 374 contentId: this.contentDetailData?.newsId + '',
375 contentType: this.contentDetailData?.newsType + '', 375 contentType: this.contentDetailData?.newsType + '',
  376 + contentRelId: this.contentDetailData?.reLInfo?.relId || '' + '',
376 } 377 }
  378 + console.log(TAG, '点赞、取消点赞params', JSON.stringify(params))
377 PageRepository.postExecuteLike(params).then(res => { 379 PageRepository.postExecuteLike(params).then(res => {
  380 + console.log(TAG, '点赞、res', JSON.stringify(res))
378 console.log(TAG, '点赞、取消点赞', 'toggleLikeStatus==',) 381 console.log(TAG, '点赞、取消点赞', 'toggleLikeStatus==',)
379 if (this.newsStatusOfUser) { 382 if (this.newsStatusOfUser) {
380 //内容点赞、取消点赞Tracking 1点赞 0取消点赞 383 //内容点赞、取消点赞Tracking 1点赞 0取消点赞
@@ -30,13 +30,14 @@ export struct MoreComponent { @@ -30,13 +30,14 @@ export struct MoreComponent {
30 Card9Component({ compDTO: new CompDTO, contentDTO:item, pageId: "", pageName: "" }) 30 Card9Component({ compDTO: new CompDTO, contentDTO:item, pageId: "", pageName: "" })
31 } 31 }
32 }) 32 })
33 - } else {  
34 - Column() {  
35 33
36 Divider() 34 Divider()
37 .width('100%') 35 .width('100%')
38 .color($r('app.color.color_F5F5F5')) 36 .color($r('app.color.color_F5F5F5'))
39 - .strokeWidth(5) 37 + .strokeWidth(4)
  38 +
  39 + } else {
  40 + Column() {
40 41
41 Row() { 42 Row() {
42 Text('点击展开更多相似') 43 Text('点击展开更多相似')
@@ -34,7 +34,7 @@ export struct SearchContentComponent { @@ -34,7 +34,7 @@ export struct SearchContentComponent {
34 } 34 }
35 35
36 titleInit() { 36 titleInit() {
37 - const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.title); 37 + const titleInitRes:titleInitRes = SearchShowRed.titleInit(this.contentDTO.contentText || '');
38 // this.titleMarked = titleInitRes.titleMarked; 38 // this.titleMarked = titleInitRes.titleMarked;
39 this.textArr = titleInitRes.textArr; 39 this.textArr = titleInitRes.textArr;
40 } 40 }
@@ -79,15 +79,17 @@ export struct ZhGridLayout03 { @@ -79,15 +79,17 @@ export struct ZhGridLayout03 {
79 .onClick((event: ClickEvent) => { 79 .onClick((event: ClickEvent) => {
80 console.log('333rt',JSON.stringify(item)) 80 console.log('333rt',JSON.stringify(item))
81 InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName) 81 InfomationCardClick.track(this.compDTO, item, this.pageId, this.pageName)
82 - if (item.objectType === '11') {  
83 - ProcessUtils.jumpExternalWebPage  
84 - ProcessUtils.jumpChannelTab(item.objectId, item.pageId, item.newsTitle)  
85 - } else if(item.objectType === '6'){  
86 - ProcessUtils.jumpExternalWebPage(item.linkUrl)  
87 - //ProcessUtils.gotoWeb(item);  
88 - }else{ 82 +
89 ProcessUtils.processPage(item) 83 ProcessUtils.processPage(item)
90 - } 84 + // if (item.objectType === '11') {
  85 + // ProcessUtils.jumpExternalWebPage
  86 + // ProcessUtils.jumpChannelTab(item.objectId, item.pageId, item.newsTitle)
  87 + // } else if(item.objectType === '6'){
  88 + // ProcessUtils.jumpExternalWebPage(item.linkUrl)
  89 + // //ProcessUtils.gotoWeb(item);
  90 + // }else{
  91 + // ProcessUtils.processPage(item)
  92 + // }
91 }) 93 })
92 } 94 }
93 } 95 }
@@ -90,7 +90,9 @@ export struct ZhSingleRow03 { @@ -90,7 +90,9 @@ export struct ZhSingleRow03 {
90 } 90 }
91 91
92 async aboutToAppear(): Promise<void> { 92 async aboutToAppear(): Promise<void> {
  93 + if (HttpUtils.getUserId()) {
93 this.getReserveState(); 94 this.getReserveState();
  95 + }
94 this.loadImg = await onlyWifiLoadImg(); 96 this.loadImg = await onlyWifiLoadImg();
95 } 97 }
96 98
@@ -117,7 +117,7 @@ struct localCard { @@ -117,7 +117,7 @@ struct localCard {
117 .fontSize($r('app.float.font_size_18')) 117 .fontSize($r('app.float.font_size_18'))
118 .fontColor('#000000') 118 .fontColor('#000000')
119 .align(Alignment.TopStart) 119 .align(Alignment.TopStart)
120 - .maxLines(3) 120 + .maxLines(1)
121 .textOverflow({ overflow: TextOverflow.Ellipsis }) 121 .textOverflow({ overflow: TextOverflow.Ellipsis })
122 .lineHeight(25) 122 .lineHeight(25)
123 .fontWeight(500) 123 .fontWeight(500)
@@ -256,6 +256,7 @@ export struct TopNavigationComponentNew { @@ -256,6 +256,7 @@ export struct TopNavigationComponentNew {
256 'right': { 'anchor': '__container__', 'align': HorizontalAlign.End } 256 'right': { 'anchor': '__container__', 'align': HorizontalAlign.End }
257 }) 257 })
258 .onClick(() => { 258 .onClick(() => {
  259 + Logger.info(TAG, `搜索按钮点击: 人民号`);
259 TrackingButton.searchClick(TrackConstants.PageName.Search, "PEOPLE") 260 TrackingButton.searchClick(TrackConstants.PageName.Search, "PEOPLE")
260 let params = { 'tabName': "PEOPLE" } as Record<string, string> 261 let params = { 'tabName': "PEOPLE" } as Record<string, string>
261 WDRouterRule.jumpWithPage(WDRouterPage.searchPage, params) 262 WDRouterRule.jumpWithPage(WDRouterPage.searchPage, params)
@@ -487,9 +488,10 @@ export struct TopNavigationComponentNew { @@ -487,9 +488,10 @@ export struct TopNavigationComponentNew {
487 } 488 }
488 489
489 updateCurrentTopNavSelectedIndex() { 490 updateCurrentTopNavSelectedIndex() {
  491 + Logger.info(TAG, `this.navItem 埋点参数topStyle: ${this.navItem.topStyle}`);
490 492
491 // 顶部tab埋点 493 // 顶部tab埋点
492 - if (CompUtils.isVideo(this.navItem)) { 494 + if (CompUtils.isNews(this.navItem)) {
493 const tab = this.myChannelList[this.currentTopNavSelectedIndex] 495 const tab = this.myChannelList[this.currentTopNavSelectedIndex]
494 Logger.info(TAG, `新闻tab埋点: ${JSON.stringify(tab)}`); 496 Logger.info(TAG, `新闻tab埋点: ${JSON.stringify(tab)}`);
495 497
@@ -498,7 +500,7 @@ export struct TopNavigationComponentNew { @@ -498,7 +500,7 @@ export struct TopNavigationComponentNew {
498 "tabName": tab.name, 500 "tabName": tab.name,
499 "pageId": tab.pageId, 501 "pageId": tab.pageId,
500 } 502 }
501 - Tracking.event("home_page_tab_click ", params) 503 + Tracking.event("home_page_tab_click", params)
502 } else if (CompUtils.isRMH(this.navItem)) { 504 } else if (CompUtils.isRMH(this.navItem)) {
503 const tab = this.topNavList[this.currentTopNavSelectedIndex] 505 const tab = this.topNavList[this.currentTopNavSelectedIndex]
504 Logger.info(TAG, `人民号tab埋点: ${JSON.stringify(tab)}`); 506 Logger.info(TAG, `人民号tab埋点: ${JSON.stringify(tab)}`);
@@ -48,19 +48,26 @@ export struct PeopleShipHomeArticleListComponent { @@ -48,19 +48,26 @@ export struct PeopleShipHomeArticleListComponent {
48 } else if (this.viewType == 2) { 48 } else if (this.viewType == 2) {
49 ErrorComponent() 49 ErrorComponent()
50 } else { 50 } else {
  51 + CustomPullToRefresh({
  52 + alldata:this.arr,
  53 + scroller:this.scroller,
  54 + hasMore:this.hasMore,
  55 + customList:()=>{
51 this.ListLayout() 56 this.ListLayout()
52 - // CustomPullToRefresh({  
53 - // alldata:this.arr,  
54 - // scroller:this.scroller,  
55 - // hasMore: false,  
56 - // customList:()=>{  
57 - // this.ListLayout()  
58 - // },  
59 - // onRefresh:(resolve)=>{  
60 - // this.currentPage = 1  
61 - // this.getPeopleShipPageArticleList(resolve)  
62 - // },  
63 - // }) 57 + },
  58 + onRefresh:(resolve)=>{
  59 + this.currentPage = 1
  60 + this.getPeopleShipPageArticleList(resolve)
  61 + },
  62 + onLoadMore:(resolve)=> {
  63 + if (this.hasMore === false) {
  64 + if(resolve) resolve('')
  65 + return
  66 + }
  67 + this.currentPage++
  68 + this.getPeopleShipPageArticleList(resolve)
  69 + }
  70 + })
64 } 71 }
65 72
66 } 73 }
@@ -90,14 +97,16 @@ export struct PeopleShipHomeArticleListComponent { @@ -90,14 +97,16 @@ export struct PeopleShipHomeArticleListComponent {
90 97
91 // 加载更多 98 // 加载更多
92 ListItem() { 99 ListItem() {
93 - if (this.hasMore && this.arr && this.arr.length > 0) {  
94 - LoadMoreLayout({ isVisible: this.hasMore })  
95 - } else if (!this.hasMore && !this.isLoading) { 100 + // if (this.hasMore && this.arr && this.arr.length > 0) {
  101 + // LoadMoreLayout({ isVisible: this.hasMore })
  102 + // } else
  103 + if (!this.hasMore && !this.isLoading) {
96 PeopleShipNoMoreData() 104 PeopleShipNoMoreData()
97 } 105 }
98 } 106 }
99 } 107 }
100 .cachedCount(4) 108 .cachedCount(4)
  109 + .scrollBar(BarState.Off)
101 .backgroundColor(Color.Transparent) 110 .backgroundColor(Color.Transparent)
102 .width("100%") 111 .width("100%")
103 .height("100%") 112 .height("100%")
@@ -8,6 +8,7 @@ import { SPHelper } from 'wdKit/Index' @@ -8,6 +8,7 @@ import { SPHelper } from 'wdKit/Index'
8 import { WDRouterPage, WDRouterRule } from 'wdRouter' 8 import { WDRouterPage, WDRouterRule } from 'wdRouter'
9 import { TrackingButton, TrackConstants } from 'wdTracking/Index' 9 import { TrackingButton, TrackConstants } from 'wdTracking/Index'
10 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel' 10 import SearcherAboutDataModel from '../../model/SearcherAboutDataModel'
  11 +import { Logger } from 'wdKit';
11 12
12 const TAG = "FirstTabTopSearchComponent" 13 const TAG = "FirstTabTopSearchComponent"
13 14
@@ -73,6 +74,7 @@ export struct FirstTabTopSearchComponent { @@ -73,6 +74,7 @@ export struct FirstTabTopSearchComponent {
73 .backgroundImage($r('app.media.background_search')) 74 .backgroundImage($r('app.media.background_search'))
74 .backgroundImageSize(ImageSize.Cover) 75 .backgroundImageSize(ImageSize.Cover)
75 .onClick(() => { 76 .onClick(() => {
  77 + Logger.info(TAG, `搜索按钮点击: 新闻`);
76 TrackingButton.searchClick( TrackConstants.PageName.Search, "NEWS") 78 TrackingButton.searchClick( TrackConstants.PageName.Search, "NEWS")
77 let params = { 'tabName': "NEWS" } as Record<string, string> 79 let params = { 'tabName': "NEWS" } as Record<string, string>
78 WDRouterRule.jumpWithPage(WDRouterPage.searchPage,params) 80 WDRouterRule.jumpWithPage(WDRouterPage.searchPage,params)
@@ -291,6 +291,12 @@ export struct SearchResultContentComponent { @@ -291,6 +291,12 @@ export struct SearchResultContentComponent {
291 Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 }) 291 Divider().strokeWidth(5).color('#f5f5f5').padding({ left: 0, right: 0 })
292 } 292 }
293 } else { 293 } else {
  294 + if(this.data.get(index + 1).sameContentListSize > 0) {
  295 + Divider()
  296 + .width('100%')
  297 + .color($r('app.color.color_F5F5F5'))
  298 + .strokeWidth(4)
  299 + }
294 CardParser({compDTO:new CompDTO, contentDTO: item }) 300 CardParser({compDTO:new CompDTO, contentDTO: item })
295 } 301 }
296 if (index != this.data.totalCount() - 1) { 302 if (index != this.data.totalCount() - 1) {
@@ -33,6 +33,7 @@ export interface recommentVideoListParams { @@ -33,6 +33,7 @@ export interface recommentVideoListParams {
33 interface contentListItem { 33 interface contentListItem {
34 contentId: string; 34 contentId: string;
35 contentType: number; 35 contentType: number;
  36 + contentRelId?:string
36 } 37 }
37 38
38 export interface contentListParams { 39 export interface contentListParams {
@@ -43,6 +43,7 @@ export struct DetailPlayVLivePage { @@ -43,6 +43,7 @@ export struct DetailPlayVLivePage {
43 @State isPlayerError: boolean = false 43 @State isPlayerError: boolean = false
44 @State isCanplay: boolean = false 44 @State isCanplay: boolean = false
45 @State toastText: ResourceStr = "这是一个非Wi-Fi环境。请注意流量消耗" 45 @State toastText: ResourceStr = "这是一个非Wi-Fi环境。请注意流量消耗"
  46 +
46 dialogToast: CustomDialogController = new CustomDialogController({ 47 dialogToast: CustomDialogController = new CustomDialogController({
47 builder: CustomToast({ 48 builder: CustomToast({
48 bgColor: 0xB3000000, 49 bgColor: 0xB3000000,
@@ -135,7 +136,7 @@ export struct DetailPlayVLivePage { @@ -135,7 +136,7 @@ export struct DetailPlayVLivePage {
135 PlayerInfoComponent({ 136 PlayerInfoComponent({
136 playerController: this.playerController, 137 playerController: this.playerController,
137 swiperController: this.swiperController, 138 swiperController: this.swiperController,
138 - swiperIndex: $swiperIndex 139 + swiperIndex: $swiperIndex,
139 }) 140 })
140 141
141 // 直播资源加载失败 142 // 直播资源加载失败
@@ -24,7 +24,7 @@ export struct PlayerComponent { @@ -24,7 +24,7 @@ export struct PlayerComponent {
24 // 播放失败 24 // 播放失败
25 @Link isPlayerError: boolean 25 @Link isPlayerError: boolean
26 @Link isCanplay: boolean 26 @Link isCanplay: boolean
27 - 27 + @State isLarge:boolean = false
28 pageShowChange() { 28 pageShowChange() {
29 this.playerController?.play() 29 this.playerController?.play()
30 } 30 }
@@ -34,7 +34,6 @@ export struct PlayerComponent { @@ -34,7 +34,6 @@ export struct PlayerComponent {
34 } 34 }
35 35
36 aboutToAppear(){ 36 aboutToAppear(){
37 -  
38 if (this.playerController) { 37 if (this.playerController) {
39 this.playerController.onCanplay = () => { 38 this.playerController.onCanplay = () => {
40 this.isCanplay = true 39 this.isCanplay = true
@@ -52,6 +51,13 @@ export struct PlayerComponent { @@ -52,6 +51,13 @@ export struct PlayerComponent {
52 } 51 }
53 52
54 } 53 }
  54 + this.playerController.onVideoSizePlayerComponentBack = (width: number, height: number) => {
  55 + if(width>height){
  56 + this.isLarge = false
  57 + }else{
  58 + this.isLarge = true
  59 + }
  60 + }
55 } 61 }
56 62
57 63
@@ -113,7 +119,7 @@ export struct PlayerComponent { @@ -113,7 +119,7 @@ export struct PlayerComponent {
113 this.contentTrackingDict() 119 this.contentTrackingDict()
114 this.playerController?.firstPlay(this.playUrl, TrackConstants.PageName.Live_Detail, this.pageParam); 120 this.playerController?.firstPlay(this.playUrl, TrackConstants.PageName.Live_Detail, this.pageParam);
115 } 121 }
116 - }).margin({ top: 195 }).height(211) 122 + }).margin({ top: this.isLarge?0:195 }).height(this.isLarge?'100%': 211)
117 } 123 }
118 124
119 PictureLoading().visibility(this.isCanplay ? Visibility.None : Visibility.Visible) 125 PictureLoading().visibility(this.isCanplay ? Visibility.None : Visibility.Visible)
@@ -11,6 +11,7 @@ export struct PlayerInfoComponent { @@ -11,6 +11,7 @@ export struct PlayerInfoComponent {
11 @Consume isShowControl: boolean 11 @Consume isShowControl: boolean
12 @Link swiperIndex: number 12 @Link swiperIndex: number
13 13
  14 +
14 build() { 15 build() {
15 Column() { 16 Column() {
16 Swiper(this.swiperController) { 17 Swiper(this.swiperController) {
1 import lottie from '@ohos/lottie' 1 import lottie from '@ohos/lottie'
2 import { ContentDetailDTO, 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, WindowModel } from 'wdKit/Index'
  5 +import { window } from '@kit.ArkUI'
  6 +import { WDAliPlayerController } from 'wdPlayer/Index'
  7 +import { DisplayDirection } from 'wdConstant/Index'
5 8
6 /** 9 /**
7 * 沉浸式直播--- 头部标题 10 * 沉浸式直播--- 头部标题
@@ -12,6 +15,22 @@ export struct PlayerTitleComponent { @@ -12,6 +15,22 @@ export struct PlayerTitleComponent {
12 @Consume liveRoomDataBean: LiveRoomDataBean 15 @Consume liveRoomDataBean: LiveRoomDataBean
13 @Consume liveState: string 16 @Consume liveState: string
14 @Consume contentDetailData: ContentDetailDTO 17 @Consume contentDetailData: ContentDetailDTO
  18 + @Consume displayDirection: DisplayDirection
  19 + @State isLarge:boolean = false
  20 + private playerController?: WDAliPlayerController
  21 +
  22 + aboutToAppear(): void {
  23 + if (!this.playerController) {
  24 + return
  25 + }
  26 + this.playerController.onVideoSizePlayerTitleComponentBack = (width: number, height: number) => {
  27 + if(width>height){
  28 + this.isLarge = false
  29 + }else{
  30 + this.isLarge = true
  31 + }
  32 + }
  33 + }
15 aboutToDisappear(): void { 34 aboutToDisappear(): void {
16 if (this.contentDetailData.liveInfo?.liveState == 'running') { 35 if (this.contentDetailData.liveInfo?.liveState == 'running') {
17 lottie.destroy('live_status_wait') 36 lottie.destroy('live_status_wait')
@@ -21,11 +40,42 @@ export struct PlayerTitleComponent { @@ -21,11 +40,42 @@ export struct PlayerTitleComponent {
21 build() { 40 build() {
22 Column() { 41 Column() {
23 Row() { 42 Row() {
  43 + //返回键
  44 + Image($r('app.media.icon_arrow_left_white'))
  45 + .width(24)
  46 + .aspectRatio(1)
  47 + .visibility(this.isLarge ? Visibility.Visible : Visibility.None)
  48 + .margin({
  49 + right: 10
  50 + })
  51 + .onClick(() => {
  52 + WindowModel.shared.setPreferredOrientation(this.isLarge ?
  53 + window.Orientation.PORTRAIT :
  54 + window.Orientation.LANDSCAPE_INVERTED)
  55 + WindowModel.shared.setSpecificSystemBarEnabled(true)
  56 + this.isLarge = false
  57 + this.displayDirection = DisplayDirection.VERTICAL
  58 + if(this.playerController){
  59 + if(this.playerController.onVideoSizePlayerComponentBack){
  60 + this.playerController.onVideoSizePlayerComponentBack(2,1);
  61 + }
  62 + if(this.playerController.onVideoSizePlayerUIComponentMethod){
  63 + this.playerController.onVideoSizePlayerUIComponentMethod(2,1);
  64 + }
  65 + }
  66 + })
24 Text(this.contentDetailData.newsTitle || '') 67 Text(this.contentDetailData.newsTitle || '')
25 .maxLines(2) 68 .maxLines(2)
26 .fontSize(16) 69 .fontSize(16)
27 .fontWeight(500) 70 .fontWeight(500)
28 .fontColor(Color.White) 71 .fontColor(Color.White)
  72 + Blank().layoutWeight(1)
  73 + //分享按钮
  74 + Image($r('app.media.icon_share'))
  75 + .width(24)
  76 + .aspectRatio(1)
  77 + .visibility(this.isLarge ? Visibility.Visible : Visibility.None)
  78 + .margin({right:16})
29 }.margin({ bottom: 10 }) 79 }.margin({ bottom: 10 })
30 80
31 Row() { 81 Row() {
@@ -9,12 +9,24 @@ import { PlayerVideoControlComponent } from './PlayerVideoControlComponent'; @@ -9,12 +9,24 @@ import { PlayerVideoControlComponent } from './PlayerVideoControlComponent';
9 @Component 9 @Component
10 export struct PlayerUIComponent { 10 export struct PlayerUIComponent {
11 private playerController?: WDAliPlayerController 11 private playerController?: WDAliPlayerController
  12 + @State isSmall:boolean = false
12 @Consume isShowControl: boolean 13 @Consume isShowControl: boolean
13 - 14 + aboutToAppear() {
  15 + if (!this.playerController) {
  16 + return
  17 + }
  18 + this.playerController.onVideoSizePlayerUIComponentMethod = (width: number, height: number) => {
  19 + if(width>height){
  20 + this.isSmall = true
  21 + }else{
  22 + this.isSmall = false
  23 + }
  24 + }
  25 + }
14 build() { 26 build() {
15 Stack() { 27 Stack() {
16 // 标题 28 // 标题
17 - PlayerTitleComponent() 29 + PlayerTitleComponent({ playerController: this.playerController })
18 30
19 PlayerCommentComponent() 31 PlayerCommentComponent()
20 .visibility(this.isShowControl ? Visibility.Hidden : Visibility.Visible) 32 .visibility(this.isShowControl ? Visibility.Hidden : Visibility.Visible)
@@ -23,11 +35,11 @@ export struct PlayerUIComponent { @@ -23,11 +35,11 @@ export struct PlayerUIComponent {
23 .markAnchor({ y: '100%' }) 35 .markAnchor({ y: '100%' })
24 36
25 PlayerVideoControlComponent({ playerController: this.playerController }) 37 PlayerVideoControlComponent({ playerController: this.playerController })
26 - .visibility(this.isShowControl ? Visibility.Visible : Visibility.Hidden) 38 + .visibility(this.isShowControl ? Visibility.Visible : this.isSmall? Visibility.Visible:Visibility.Hidden)
27 .animation({ duration: 500 }) 39 .animation({ duration: 500 })
28 - .position({ y: '100%' })  
29 - .markAnchor({ y: '100%' })  
30 - 40 + // .position({ y: '100%' })
  41 + // .markAnchor({ y: '100%' })
  42 + .margin({ top: this.isSmall?195 +211 - 105:0})
31 } 43 }
32 .height('100%') 44 .height('100%')
33 .width('100%') 45 .width('100%')
1 import { DateFormatUtil, WDAliPlayerController } from 'wdPlayer/Index' 1 import { DateFormatUtil, WDAliPlayerController } from 'wdPlayer/Index'
2 import { LiveRoomDataBean } from 'wdBean/Index' 2 import { LiveRoomDataBean } from 'wdBean/Index'
  3 +import { WindowModel } from 'wdKit/Index'
  4 +import { window } from '@kit.ArkUI'
  5 +import { DisplayDirection } from 'wdConstant/Index'
3 6
4 7
5 @Component 8 @Component
@@ -11,6 +14,8 @@ export struct PlayerVideoControlComponent { @@ -11,6 +14,8 @@ export struct PlayerVideoControlComponent {
11 @State progressVal: number = 0; 14 @State progressVal: number = 0;
12 //是否处于播放状态中 15 //是否处于播放状态中
13 @State isPlayStatus: boolean = true 16 @State isPlayStatus: boolean = true
  17 + @Consume displayDirection: DisplayDirection
  18 +
14 19
15 aboutToAppear(): void { 20 aboutToAppear(): void {
16 if (this.playerController) { 21 if (this.playerController) {
@@ -51,7 +56,34 @@ export struct PlayerVideoControlComponent { @@ -51,7 +56,34 @@ export struct PlayerVideoControlComponent {
51 .margin({ 56 .margin({
52 right: 16 57 right: 16
53 }) 58 })
  59 + //全屏按钮
  60 + Image($r('app.media.icon_live_player_full_screen'))
  61 + .height(32)
  62 + .width(32)
  63 + .padding(5)
  64 + .borderRadius($r('app.float.vp_16'))
  65 + .border({width:0.5})
  66 + .borderColor(0x4DFFFFFF)
  67 + .backgroundColor(0x4D222222)
  68 + .margin({right:10})
  69 + .onClick(() => {
  70 + WindowModel.shared.setSpecificSystemBarEnabled(false)
  71 + this.displayDirection = DisplayDirection.VIDEO_HORIZONTAL
  72 + WindowModel.shared.setPreferredOrientation(
  73 + window.Orientation.LANDSCAPE_INVERTED)
  74 + if(this.playerController){
  75 + if(this.playerController.onVideoSizePlayerUIComponentMethod){
  76 + this.playerController.onVideoSizePlayerUIComponentMethod(1,2)
  77 + }
  78 + if(this.playerController.onVideoSizePlayerComponentBack){
  79 + this.playerController.onVideoSizePlayerComponentBack(1,2)
  80 + }
54 81
  82 + if(this.playerController.onVideoSizePlayerTitleComponentBack){
  83 + this.playerController.onVideoSizePlayerTitleComponentBack(1,2)
  84 + }
  85 + }
  86 + })
55 } 87 }
56 .alignItems(VerticalAlign.Center) 88 .alignItems(VerticalAlign.Center)
57 // .linearGradient({ angle: 0, colors: [['#99000000', 0], ['#00000000', 1]] }) 89 // .linearGradient({ angle: 0, colors: [['#99000000', 0], ['#00000000', 1]] })
@@ -41,7 +41,17 @@ export class WDAliPlayerController { @@ -41,7 +41,17 @@ export class WDAliPlayerController {
41 private startTime: number = 0 41 private startTime: number = 0
42 public errorCode?: number 42 public errorCode?: number
43 public errorMesage?: string 43 public errorMesage?: string
  44 +
  45 + //onVideoSizeChange , onVideoSizeMethod同样的方法,不同地方使用
  46 + //AliPlayerRenderView回调
44 public onVideoSizeChange?: (width: number, height: number) => void; 47 public onVideoSizeChange?: (width: number, height: number) => void;
  48 + //PlayerUIComponent回调
  49 + public onVideoSizePlayerUIComponentMethod?: (width: number, height: number) => void;
  50 + //PlayerComponent
  51 + public onVideoSizePlayerComponentBack?: (width: number, height: number) => void;
  52 + //PlayerTitleComponent
  53 + public onVideoSizePlayerTitleComponentBack?: (width: number, height: number) => void;
  54 +
45 public onBufferUpdate?: (buffered: number, duration: number) => void; 55 public onBufferUpdate?: (buffered: number, duration: number) => void;
46 public onTimeUpdate?: (position: number, duration: number) => void; 56 public onTimeUpdate?: (position: number, duration: number) => void;
47 public onVolumeUpdate?: (volume: number) => void; 57 public onVolumeUpdate?: (volume: number) => void;
@@ -170,6 +180,13 @@ export class WDAliPlayerController { @@ -170,6 +180,13 @@ export class WDAliPlayerController {
170 if (this.onVideoSizeChange) { 180 if (this.onVideoSizeChange) {
171 this.onVideoSizeChange(this.avPlayer?.getVideoWidth(), this.avPlayer?.getVideoHeight()); 181 this.onVideoSizeChange(this.avPlayer?.getVideoWidth(), this.avPlayer?.getVideoHeight());
172 } 182 }
  183 + if(this.onVideoSizePlayerUIComponentMethod){
  184 + this.onVideoSizePlayerUIComponentMethod(this.avPlayer?.getVideoWidth(), this.avPlayer?.getVideoHeight());
  185 + }
  186 +
  187 + if(this.onVideoSizePlayerTitleComponentBack){
  188 + this.onVideoSizePlayerTitleComponentBack(this.avPlayer?.getVideoWidth(), this.avPlayer?.getVideoHeight());
  189 + }
173 if (this.onCanplay) { 190 if (this.onCanplay) {
174 this.onCanplay() 191 this.onCanplay()
175 } else { 192 } else {
@@ -22,7 +22,7 @@ export class TrackingButton { @@ -22,7 +22,7 @@ export class TrackingButton {
22 params["pageId"] = pageId 22 params["pageId"] = pageId
23 params["pageName"] = pageName 23 params["pageName"] = pageName
24 24
25 - Tracking.event("search_button_click ", params) 25 + Tracking.event("search_button_click", params)
26 } 26 }
27 27
28 } 28 }
@@ -7,7 +7,6 @@ import LaunchDataModel, { defaultLaunchModel } from '../viewModel/LaunchDataMode @@ -7,7 +7,6 @@ import LaunchDataModel, { defaultLaunchModel } from '../viewModel/LaunchDataMode
7 7
8 import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index'; 8 import { ParamType, TrackConstants, TrackingButton, TrackingContent } from 'wdTracking/Index';
9 import { ContentDTO } from 'wdBean/Index'; 9 import { ContentDTO } from 'wdBean/Index';
10 -import { Core } from '@ohos/hypium';  
11 10
12 11
13 @Entry 12 @Entry
@@ -19,6 +18,8 @@ struct LaunchAdvertisingPage { @@ -19,6 +18,8 @@ struct LaunchAdvertisingPage {
19 18
20 @State defaultModel:defaultLaunchModel = new defaultLaunchModel() 19 @State defaultModel:defaultLaunchModel = new defaultLaunchModel()
21 20
  21 + private controller:VideoController | undefined;
  22 +
22 enter() { 23 enter() {
23 WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage) 24 WDRouterRule.jumpWithReplacePage(WDRouterPage.mainPage)
24 clearInterval(this.timer) 25 clearInterval(this.timer)
@@ -60,6 +61,14 @@ struct LaunchAdvertisingPage { @@ -60,6 +61,14 @@ struct LaunchAdvertisingPage {
60 Column(){ 61 Column(){
61 if(this.defaultModel.showType === '1'){ 62 if(this.defaultModel.showType === '1'){
62 //显示视频播放 63 //显示视频播放
  64 + Video({
  65 + src: this.defaultModel.bootVideoUrl,
  66 + previewUri: this.defaultModel.bootVideoScreenUrl,
  67 + controller: this.controller
  68 + })
  69 + .objectFit(ImageFit.Contain) //设置视频适配模式
  70 + .width('100%')
  71 + .height('100%')
63 }else { 72 }else {
64 //显示图片 73 //显示图片
65 Image(this.defaultModel.bootScreenUrl) 74 Image(this.defaultModel.bootScreenUrl)
@@ -104,8 +113,8 @@ struct LaunchAdvertisingPage { @@ -104,8 +113,8 @@ struct LaunchAdvertisingPage {
104 .margin({top:'10lpx',right:'19lpx'}) 113 .margin({top:'10lpx',right:'19lpx'})
105 .backgroundColor('#80000000') 114 .backgroundColor('#80000000')
106 .onClick(() => { 115 .onClick(() => {
107 - this.enter()  
108 this.trackingLaunchJumpOver() 116 this.trackingLaunchJumpOver()
  117 + this.enter()
109 }).margin({right:16}) 118 }).margin({right:16})
110 119
111 }.margin({top:50}).width('100%').height('56lpx') 120 }.margin({top:50}).width('100%').height('56lpx')