wangliang_wd

Merge branch 'main' of http://192.168.1.42/developOne/harmonyPool into main

* 'main' of http://192.168.1.42/developOne/harmonyPool:
  fix(18831): UI还原问题-【uat】进入竖屏直播直播间。点击会显示播放和全屏按钮---新版本3.0.025-老版本无问题
  fix: 18694 UI还原问题-【uat】新闻-健康-多图详情页,文本左右间距样式问题,看图
  fix(18875): 功能缺陷-必修-【生产】 专题页点击返回按钮,没有反应
  feat: 1)我的频道栏目,点击跳转功能,遇到特殊频道需要直接跳转
  fix: 18873 UI还原问题-【生产】进入特点,广告轮播图,显示问题,看图---新版本
  feat: 1)我的频道栏目,点击跳转功能,遇到特殊频道需要直接跳转
  feat: 1)频道编辑页面,删除的频道留存的索引值无法指引顶导频道时,使用默认频道
@@ -204,14 +204,14 @@ export struct SpacialTopicPageComponent { @@ -204,14 +204,14 @@ export struct SpacialTopicPageComponent {
204 this.showCommentList = true 204 this.showCommentList = true
205 } 205 }
206 }) 206 })
207 - //全部评论  
208 - CommentDialogView({  
209 - index: $index,  
210 - currentIndex: $currentIndex,  
211 - showCommentList: $showCommentList,  
212 - publishCommentModel: $publishCommentModel,  
213 - interactData: $interactData,  
214 - }) 207 + // //全部评论
  208 + // CommentDialogView({
  209 + // index: $index,
  210 + // currentIndex: $currentIndex,
  211 + // showCommentList: $showCommentList,
  212 + // publishCommentModel: $publishCommentModel,
  213 + // interactData: $interactData,
  214 + // })
215 } 215 }
216 }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT) 216 }.width(CommonConstants.FULL_WIDTH).height(CommonConstants.FULL_HEIGHT)
217 } 217 }
@@ -8,6 +8,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo'; @@ -8,6 +8,7 @@ import { CardMediaInfo } from '../cardCommon/CardMediaInfo';
8 import { onlyWifiLoadImg } from '../../utils/lazyloadImg'; 8 import { onlyWifiLoadImg } from '../../utils/lazyloadImg';
9 import { Notes } from '../cardview/notes'; 9 import { Notes } from '../cardview/notes';
10 import { InfomationCardClick } from '../../utils/infomationCardClick' 10 import { InfomationCardClick } from '../../utils/infomationCardClick'
  11 +import font from '@ohos.font';
11 12
12 const TAG = 'Zh_Carousel_Layout-01'; 13 const TAG = 'Zh_Carousel_Layout-01';
13 14
@@ -67,6 +68,11 @@ export struct ZhCarouselLayout01 { @@ -67,6 +68,11 @@ export struct ZhCarouselLayout01 {
67 list.push(i); 68 list.push(i);
68 } 69 }
69 this.data = new MyDataSource(list) 70 this.data = new MyDataSource(list)
  71 +
  72 + font.registerFont({
  73 + familyName: 'BebasNeue',
  74 + familySrc: $rawfile('font/BebasNeue.ttf')
  75 + })
70 } 76 }
71 77
72 isAutoPlay() { 78 isAutoPlay() {
@@ -19,10 +19,15 @@ struct ChannelSubscriptionLayout { @@ -19,10 +19,15 @@ struct ChannelSubscriptionLayout {
19 //当前选中的频道 19 //当前选中的频道
20 @Link currentTopNavSelectedIndex: number; 20 @Link currentTopNavSelectedIndex: number;
21 @Prop homeChannelList: TopNavDTO [] 21 @Prop homeChannelList: TopNavDTO []
  22 + // 我的频道栏目的频道信息数组
22 @Link myChannelList: TopNavDTO [] 23 @Link myChannelList: TopNavDTO []
  24 + // 更多频道栏目频道信息数组
23 @Link moreChannelList: TopNavDTO [] 25 @Link moreChannelList: TopNavDTO []
  26 + // 地方频道栏目频道信息数组
24 @Link localChannelList: TopNavDTO [] 27 @Link localChannelList: TopNavDTO []
  28 + // 收集到的我的频道栏目中的频道id
25 @State channelIds: number [] = [] 29 @State channelIds: number [] = []
  30 +
26 @State isShow: boolean = false 31 @State isShow: boolean = false
27 @State dragItem: number = -1 32 @State dragItem: number = -1
28 private dragRefOffsetX: number = 0 33 private dragRefOffsetX: number = 0
@@ -33,12 +38,12 @@ struct ChannelSubscriptionLayout { @@ -33,12 +38,12 @@ struct ChannelSubscriptionLayout {
33 private FIX_VP_Y: number = 48 38 private FIX_VP_Y: number = 48
34 @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002 39 @State indexSettingChannelId: number = AppStorage.get<number>('indexSettingChannelId') || 2002
35 @State isEditIng: boolean = false 40 @State isEditIng: boolean = false
36 - @State currentTopNavSelectedItem: TopNavDTO = {} as TopNavDTO 41 + // @State currentTopNavSelectedItem: TopNavDTO = {} as TopNavDTO
37 changeTab: (index: number) => void = () => { 42 changeTab: (index: number) => void = () => {
38 } 43 }
39 44
40 aboutToAppear() { 45 aboutToAppear() {
41 - this.currentTopNavSelectedItem = this.myChannelList[this.currentTopNavSelectedIndex] 46 + // this.currentTopNavSelectedItem = this.myChannelList[this.currentTopNavSelectedIndex]
42 this.myChannelList.forEach(item => { 47 this.myChannelList.forEach(item => {
43 if(item != undefined && item.channelId != undefined){ 48 if(item != undefined && item.channelId != undefined){
44 this.channelIds.push(item.channelId) 49 this.channelIds.push(item.channelId)
@@ -57,15 +62,66 @@ struct ChannelSubscriptionLayout { @@ -57,15 +62,66 @@ struct ChannelSubscriptionLayout {
57 62
58 //删除频道 63 //删除频道
59 delChannelItem(index: number) { 64 delChannelItem(index: number) {
  65 +
60 let item = this.myChannelList.splice(index, 1)[0] 66 let item = this.myChannelList.splice(index, 1)[0]
61 this.channelIds.splice(index, 1) 67 this.channelIds.splice(index, 1)
62 AppStorage.setOrCreate('channelIds', JSON.stringify(this.channelIds)) 68 AppStorage.setOrCreate('channelIds', JSON.stringify(this.channelIds))
  69 +
  70 + /*
  71 + 删除的频道信息回到原栏目中去
  72 + */
63 if (item.moreChannel === '1') { 73 if (item.moreChannel === '1') {
64 this.moreChannelList.unshift(item) 74 this.moreChannelList.unshift(item)
65 } 75 }
66 if (item.localChannel === '1') { 76 if (item.localChannel === '1') {
67 this.localChannelList.unshift(item) 77 this.localChannelList.unshift(item)
68 } 78 }
  79 +
  80 +
  81 + // 删除频道的索引值大于 我的栏目中频道最大索引值
  82 + if(this.currentTopNavSelectedIndex > this.channelIds.length-1){
  83 + //使用默认频道
  84 + //缓存首页频道
  85 + let index = this.myChannelList.findIndex(_item => _item?.channelId === this.indexSettingChannelId)
  86 + console.debug('TopNavigationComponent','index='+index)
  87 + if (index > -1) {
  88 + this.currentTopNavSelectedIndex = index
  89 + }
  90 + }else {
  91 + //检测删除频道后的当前频道是否是特殊频道
  92 + let item = this.myChannelList[this.currentTopNavSelectedIndex]
  93 + if(this.isBroadcast(item) || this.isLayout(item)){
  94 +
  95 + this.changeTab(this.currentTopNavSelectedIndex)
  96 + this.isShow = false
  97 +
  98 + let index = this.myChannelList.findIndex(_item => _item?.channelId === this.indexSettingChannelId)
  99 + console.debug('TopNavigationComponent','index='+index)
  100 + if (index > -1) {
  101 + this.currentTopNavSelectedIndex = index
  102 + this.changeTab(this.currentTopNavSelectedIndex)
  103 + }
  104 + }
  105 +
  106 + }
  107 + }
  108 +
  109 + /**
  110 + * 频道是播报
  111 + * @param item
  112 + * @returns
  113 + */
  114 + private isBroadcast(item?: TopNavDTO): boolean {
  115 + return item?.channelId === 2066
  116 + }
  117 +
  118 + /**
  119 + * 频道是电子报
  120 + * @param item
  121 + * @returns
  122 + */
  123 + private isLayout(item?: TopNavDTO): boolean {
  124 + return item?.channelId === 2006
69 } 125 }
70 126
71 // 添加频道 127 // 添加频道
@@ -12,8 +12,6 @@ import { ParamType, TrackConstants, Tracking, TrackingButton } from 'wdTracking/ @@ -12,8 +12,6 @@ import { ParamType, TrackConstants, Tracking, TrackingButton } from 'wdTracking/
12 import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'; 12 import DailyPaperTopicModel from '../../model/DailyPaperTopicModel';
13 import { CompUtils } from '../../utils/CompUtils'; 13 import { CompUtils } from '../../utils/CompUtils';
14 import ChannelViewModel from '../../viewmodel/ChannelViewModel'; 14 import ChannelViewModel from '../../viewmodel/ChannelViewModel';
15 -import { JSON } from '@kit.ArkTS';  
16 -import text from '@ohos.graphics.text';  
17 15
18 const TAG = 'TopNavigationComponent'; 16 const TAG = 'TopNavigationComponent';
19 17
@@ -95,7 +93,6 @@ export struct TopNavigationComponentNew { @@ -95,7 +93,6 @@ export struct TopNavigationComponentNew {
95 }) 93 })
96 } else { 94 } else {
97 channelSkeleton() 95 channelSkeleton()
98 - //Text('特殊频道').fontColor(Color.Red).fontSize(20).width('100%').height('100%')  
99 } 96 }
100 } 97 }
101 }) 98 })
@@ -117,17 +114,8 @@ export struct TopNavigationComponentNew { @@ -117,17 +114,8 @@ export struct TopNavigationComponentNew {
117 return 114 return
118 } 115 }
119 116
120 - if (this.isBroadcastByIndex(index)) {  
121 - // 跳转到播报页面  
122 - ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId) 117 + this.channelJumpToPage(index)
123 118
124 - } else if (this.isLayoutByIndex(index)) {  
125 - // 跳转到电子报页面  
126 - ProcessUtils.gotoENewsPaper()  
127 -  
128 - } else {  
129 - this.changePage(index)  
130 - }  
131 }) 119 })
132 .onAnimationEnd((index: number) => { 120 .onAnimationEnd((index: number) => {
133 Logger.info(TAG, `onAnimationEnd ${index}`); 121 Logger.info(TAG, `onAnimationEnd ${index}`);
@@ -153,6 +141,7 @@ export struct TopNavigationComponentNew { @@ -153,6 +141,7 @@ export struct TopNavigationComponentNew {
153 // 极左极右有特殊频道,用旧值 141 // 极左极右有特殊频道,用旧值
154 this.changePage(this.currentTopNavSelectedIndex) 142 this.changePage(this.currentTopNavSelectedIndex)
155 } 143 }
  144 + } else {
156 } 145 }
157 146
158 }) 147 })
@@ -227,7 +216,7 @@ export struct TopNavigationComponentNew { @@ -227,7 +216,7 @@ export struct TopNavigationComponentNew {
227 moreChannelList: $moreChannelList, 216 moreChannelList: $moreChannelList,
228 localChannelList: $localChannelList, 217 localChannelList: $localChannelList,
229 changeTab: (index) => { 218 changeTab: (index) => {
230 - this.changePage(index) 219 + this.channelJumpToPage(index)
231 } 220 }
232 }) 221 })
233 .id('channelManageBtn') 222 .id('channelManageBtn')
@@ -352,23 +341,35 @@ export struct TopNavigationComponentNew { @@ -352,23 +341,35 @@ export struct TopNavigationComponentNew {
352 // 当前tab,单击事件 341 // 当前tab,单击事件
353 this.doAutoRefresh() 342 this.doAutoRefresh()
354 } else { 343 } else {
355 - if (this.isBroadcastByIndex(index)) {  
356 - // 跳转到播报页面  
357 - ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId)  
358 - } else if (this.isLayoutByIndex(index)) {  
359 - ProcessUtils.gotoENewsPaper()  
360 - } else {  
361 - this.changePage(index)  
362 - } 344 + this.channelJumpToPage(index)
363 } 345 }
364 }) 346 })
365 } 347 }
366 348
  349 +
  350 + /**
  351 + * 频道信息跳转页面方法
  352 + * @param index
  353 + */
  354 + private channelJumpToPage(index :number){
  355 + if (this.isBroadcastByIndex(index)) {
  356 + // 跳转到播报页面
  357 + ProcessUtils.gotoBroadcastPage(this.myChannelList[index].pageId)
  358 + } else if (this.isLayoutByIndex(index)) {
  359 + // 跳转到电子报页面
  360 + ProcessUtils.gotoENewsPaper()
  361 + } else {
  362 + this.changePage(index)
  363 + }
  364 +
  365 + }
  366 +
367 /** 367 /**
368 * 改变频道页 368 * 改变频道页
369 * @param index 频道所在的序列号 369 * @param index 频道所在的序列号
370 */ 370 */
371 private changePage(index: number) { 371 private changePage(index: number) {
  372 + Logger.info(TAG, `修改页面 changePage index : ${index}`);
372 this.currentTopNavSelectedIndex = index 373 this.currentTopNavSelectedIndex = index
373 this.swiperController.changeIndex(index) 374 this.swiperController.changeIndex(index)
374 this.listScroller.scrollToIndex(index, true, ScrollAlign.CENTER) 375 this.listScroller.scrollToIndex(index, true, ScrollAlign.CENTER)
@@ -521,7 +522,6 @@ export struct TopNavigationComponentNew { @@ -521,7 +522,6 @@ export struct TopNavigationComponentNew {
521 this.topNavListHandle() 522 this.topNavListHandle()
522 this.changePage(this.currentTopNavSelectedIndex) 523 this.changePage(this.currentTopNavSelectedIndex)
523 524
524 - console.log('XY', '----TopNavigation-------aboutToAppear' + this.navItem.name)  
525 this.getTopNavList(this.navItem.id) 525 this.getTopNavList(this.navItem.id)
526 } 526 }
527 527
@@ -534,11 +534,9 @@ export struct TopNavigationComponentNew { @@ -534,11 +534,9 @@ export struct TopNavigationComponentNew {
534 * 534 *
535 */ 535 */
536 updateCurrentTopNavSelectedIndex() { 536 updateCurrentTopNavSelectedIndex() {
537 - 537 + console.debug(TAG, 'updateCurrentTopNavSelectedIndex=>' + this.currentTopNavSelectedIndex)
538 if (CompUtils.isNews(this.navItem)) { 538 if (CompUtils.isNews(this.navItem)) {
539 const tab = this.myChannelList[this.currentTopNavSelectedIndex] 539 const tab = this.myChannelList[this.currentTopNavSelectedIndex]
540 - //Logger.info(TAG, `新闻tab埋点: ${JSON.stringify(tab)}`);  
541 -  
542 // 埋点 540 // 埋点
543 const params: ParamType = { 541 const params: ParamType = {
544 "pageName": tab.name, 542 "pageName": tab.name,
@@ -548,8 +546,6 @@ export struct TopNavigationComponentNew { @@ -548,8 +546,6 @@ export struct TopNavigationComponentNew {
548 Tracking.event("home_page_tab_click", params) 546 Tracking.event("home_page_tab_click", params)
549 } else if (CompUtils.isRMH(this.navItem)) { 547 } else if (CompUtils.isRMH(this.navItem)) {
550 const tab = this.topNavList[this.currentTopNavSelectedIndex] 548 const tab = this.topNavList[this.currentTopNavSelectedIndex]
551 - Logger.info(TAG, `人民号tab埋点: ${JSON.stringify(tab)}`);  
552 -  
553 // 埋点 549 // 埋点
554 const params: ParamType = { 550 const params: ParamType = {
555 "pageName": tab.name, 551 "pageName": tab.name,
@@ -663,21 +659,6 @@ export struct TopNavigationComponentNew { @@ -663,21 +659,6 @@ export struct TopNavigationComponentNew {
663 return null 659 return null
664 } 660 }
665 661
666 - //  
667 - // private startAnimateTo(duration: number, leftMargin: number, width: number) {  
668 - // animateTo({  
669 - // duration: duration, // 动画时长  
670 - // curve: Curve.Linear, // 动画曲线  
671 - // iterations: 1, // 播放次数  
672 - // playMode: PlayMode.Normal, // 动画模式  
673 - // onFinish: () => {  
674 - // console.info('play end')  
675 - // }  
676 - // }, () => {  
677 - // this.indicatorLeftMargin = leftMargin  
678 - // this.indicatorWidth = width  
679 - // })  
680 - // }  
681 662
682 /** 663 /**
683 * 进入早晚报专题 664 * 进入早晚报专题
@@ -725,9 +706,9 @@ export struct TopNavigationComponentNew { @@ -725,9 +706,9 @@ export struct TopNavigationComponentNew {
725 async getTopNavList(id: number) { 706 async getTopNavList(id: number) {
726 let bottomNavDetail = await ChannelViewModel.getBottomNavDetailData(id) 707 let bottomNavDetail = await ChannelViewModel.getBottomNavDetailData(id)
727 let topNavList = bottomNavDetail?.topNavChannelList || [] 708 let topNavList = bottomNavDetail?.topNavChannelList || []
728 - for (let topNav of topNavList) {  
729 - console.debug(TAG, 'getTopNavList=>' + JSON.stringify(topNav))  
730 -  
731 - } 709 + // for (let topNav of topNavList) {
  710 + // console.debug(TAG, 'getTopNavList=>' + JSON.stringify(topNav))
  711 + //
  712 + // }
732 } 713 }
733 } 714 }
@@ -44,12 +44,12 @@ export struct PlayerTitleComponent { @@ -44,12 +44,12 @@ export struct PlayerTitleComponent {
44 Image($r('app.media.icon_arrow_left_white')) 44 Image($r('app.media.icon_arrow_left_white'))
45 .width(24) 45 .width(24)
46 .aspectRatio(1) 46 .aspectRatio(1)
47 - .visibility(this.isLarge ? Visibility.Visible : Visibility.None) 47 + .visibility((this.isLarge && this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) ? Visibility.Visible : Visibility.None)
48 .margin({ 48 .margin({
49 right: 10 49 right: 10
50 }) 50 })
51 .onClick(() => { 51 .onClick(() => {
52 - WindowModel.shared.setPreferredOrientation(this.isLarge ? 52 + WindowModel.shared.setPreferredOrientation((this.isLarge && this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) ?
53 window.Orientation.PORTRAIT : 53 window.Orientation.PORTRAIT :
54 window.Orientation.LANDSCAPE_INVERTED) 54 window.Orientation.LANDSCAPE_INVERTED)
55 WindowModel.shared.setSpecificSystemBarEnabled(true) 55 WindowModel.shared.setSpecificSystemBarEnabled(true)
@@ -74,7 +74,7 @@ export struct PlayerTitleComponent { @@ -74,7 +74,7 @@ export struct PlayerTitleComponent {
74 Image($r('app.media.icon_share')) 74 Image($r('app.media.icon_share'))
75 .width(24) 75 .width(24)
76 .aspectRatio(1) 76 .aspectRatio(1)
77 - .visibility(this.isLarge ? Visibility.Visible : Visibility.None) 77 + .visibility((this.isLarge && this.displayDirection == DisplayDirection.VIDEO_HORIZONTAL) ? Visibility.Visible : Visibility.None)
78 .margin({right:16}) 78 .margin({right:16})
79 }.margin({ bottom: 10 }) 79 }.margin({ bottom: 10 })
80 80
@@ -24,17 +24,17 @@ export class Tracking { @@ -24,17 +24,17 @@ export class Tracking {
24 // Logger.error('yyyy','event track failed') 24 // Logger.error('yyyy','event track failed')
25 // }) 25 // })
26 26
27 - let publicParams = new PublicParams()  
28 - publicParams.getPublicParams().then((pubParams) => {  
29 -  
30 - if (params) {  
31 - for (const obj of Object.entries(params)) {  
32 - // Logger.info(TAG, ` ${obj[0]} => ` + `${obj[1]}`);  
33 - pubParams[obj[0]] = obj[1]  
34 - }  
35 - }  
36 - sensors.track(eventId, pubParams)  
37 - }) 27 + // let publicParams = new PublicParams()
  28 + // publicParams.getPublicParams().then((pubParams) => {
  29 + //
  30 + // if (params) {
  31 + // for (const obj of Object.entries(params)) {
  32 + // // Logger.info(TAG, ` ${obj[0]} => ` + `${obj[1]}`);
  33 + // pubParams[obj[0]] = obj[1]
  34 + // }
  35 + // }
  36 + // sensors.track(eventId, pubParams)
  37 + // })
38 } 38 }
39 } 39 }
40 40
@@ -394,6 +394,7 @@ export struct MultiPictureDetailPageComponent { @@ -394,6 +394,7 @@ export struct MultiPictureDetailPageComponent {
394 bottom: 4, 394 bottom: 4,
395 right: 18 395 right: 18
396 }) 396 })
  397 + .width('92%')
397 } 398 }
398 if (this.contentDetailData.photoList?.[this.swiperIndex].picDesc) { 399 if (this.contentDetailData.photoList?.[this.swiperIndex].picDesc) {
399 Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`) 400 Text(`${this.contentDetailData.photoList?.[this.swiperIndex].picDesc}`)
@@ -405,11 +406,12 @@ export struct MultiPictureDetailPageComponent { @@ -405,11 +406,12 @@ export struct MultiPictureDetailPageComponent {
405 .textOverflow({ overflow: TextOverflow.Ellipsis }) 406 .textOverflow({ overflow: TextOverflow.Ellipsis })
406 .margin({ 407 .margin({
407 top: 4, 408 top: 4,
408 - left: 0, 409 + left: 18,
409 bottom: 4, 410 bottom: 4,
410 right: 18 411 right: 18
411 }) 412 })
412 .maxLines(32) 413 .maxLines(32)
  414 + .width('92%')
413 } 415 }
414 } 416 }
415 } 417 }