陈剑华

feat: 19239 跳转直播

@@ -50,20 +50,20 @@ export struct CompParser { @@ -50,20 +50,20 @@ export struct CompParser {
50 // 轮播图屏蔽音频类型稿件 50 // 轮播图屏蔽音频类型稿件
51 if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) { 51 if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
52 this.audioItems = this.compDTO.operDataList.filter(item => { 52 this.audioItems = this.compDTO.operDataList.filter(item => {
53 - return item.objectType === '13' || item.linkUrl.includes('audiotopic') 53 + return item.objectType === '13' || item.linkUrl?.includes('audiotopic')
54 }) 54 })
55 this.noneAudioItems = this.compDTO.operDataList.filter(item => { 55 this.noneAudioItems = this.compDTO.operDataList.filter(item => {
56 - return item.objectType !== '13' && !item.linkUrl.includes('audiotopic') 56 + return item.objectType !== '13' && !item.linkUrl?.includes('audiotopic')
57 }) 57 })
58 this.compDTO.operDataList = this.noneAudioItems; 58 this.compDTO.operDataList = this.noneAudioItems;
59 } 59 }
60 // 金刚卡屏蔽音频类型稿件 60 // 金刚卡屏蔽音频类型稿件
61 if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) { 61 if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) {
62 this.audioItems = this.compDTO.operDataList.filter(item => { 62 this.audioItems = this.compDTO.operDataList.filter(item => {
63 - return item.objectType === '13' || item.linkUrl.includes('audiotopic') 63 + return item.objectType === '13' || item.linkUrl?.includes('audiotopic')
64 }) 64 })
65 this.noneAudioItems = this.compDTO.operDataList.filter(item => { 65 this.noneAudioItems = this.compDTO.operDataList.filter(item => {
66 - return item.objectType !== '13' && !item.linkUrl.includes('audiotopic') 66 + return item.objectType !== '13' && !item.linkUrl?.includes('audiotopic')
67 }) 67 })
68 this.compDTO.operDataList = this.noneAudioItems; 68 this.compDTO.operDataList = this.noneAudioItems;
69 } 69 }
@@ -87,7 +87,7 @@ export struct ZhCarouselLayout01 { @@ -87,7 +87,7 @@ export struct ZhCarouselLayout01 {
87 87
88 filterAtv() { 88 filterAtv() {
89 return this.compDTO.operDataList.filter(((item: ContentDTO) => { 89 return this.compDTO.operDataList.filter(((item: ContentDTO) => {
90 - return !item.linkUrl.includes('/h/atv') 90 + return !item.linkUrl?.includes('/h/atv')
91 })) 91 }))
92 } 92 }
93 93
@@ -8,13 +8,14 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter'; @@ -8,13 +8,14 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter';
8 import { DisplayDirection } from 'wdConstant/Index'; 8 import { DisplayDirection } from 'wdConstant/Index';
9 import { CompUtils, GrayManageModel, PageComponent } from 'wdComponent/Index'; 9 import { CompUtils, GrayManageModel, PageComponent } from 'wdComponent/Index';
10 import { TrackingButton, TrackConstants } from 'wdTracking/Index'; 10 import { TrackingButton, TrackConstants } from 'wdTracking/Index';
11 -import { Logger, WindowModel } from 'wdKit';  
12 import { ParamType, Tracking } from 'wdTracking/Index'; 11 import { ParamType, Tracking } from 'wdTracking/Index';
13 import { ColorUtils } from 'wdComponent/src/main/ets/utils/ColorUtils'; 12 import { ColorUtils } from 'wdComponent/src/main/ets/utils/ColorUtils';
14 import { ImageKnifeComponent } from '@ohos/imageknife'; 13 import { ImageKnifeComponent } from '@ohos/imageknife';
15 import { CommonUtils } from 'wdComponent/src/main/ets/utils/CommonUtils'; 14 import { CommonUtils } from 'wdComponent/src/main/ets/utils/CommonUtils';
16 import { AudioSuspensionModel } from 'wdComponent' 15 import { AudioSuspensionModel } from 'wdComponent'
17 import { BusinessError } from '@kit.BasicServicesKit'; 16 import { BusinessError } from '@kit.BasicServicesKit';
  17 +import { EmitterEventId, EmitterUtils } from 'wdKit';
  18 +import { AssignChannelParam } from 'wdRouter/Index';
18 19
19 const TAG = 'VideoChannelPage' 20 const TAG = 'VideoChannelPage'
20 21
@@ -58,6 +59,18 @@ export struct VideoChannelPage { @@ -58,6 +59,18 @@ export struct VideoChannelPage {
58 if (this.currentTopNavSelectedIndex === 0) { 59 if (this.currentTopNavSelectedIndex === 0) {
59 this.handleAudio(this.topNavList[0]) 60 this.handleAudio(this.topNavList[0])
60 } 61 }
  62 +
  63 + EmitterUtils.receiveEvent(EmitterEventId.JUMP_HOME_CHANNEL, (str?: string) => {
  64 + // Logger.debug(TAG, 'receiveEvent JUMP_HOME_CHANNEL: ' + str)
  65 + if (str) {
  66 + // 跳转指定频道场景,传参底导id、频道id
  67 + let assignChannel = JSON.parse(str) as AssignChannelParam
  68 + let index = this.topNavList.findIndex((item: TopNavDTO, index) => {
  69 + return Number(assignChannel.channelId) == item.channelId && Number(assignChannel.pageId) == item.pageId
  70 + }) || 0
  71 + this.clickTopNav(index)
  72 + }
  73 + })
61 } 74 }
62 75
63 /** 76 /**
@@ -149,6 +162,25 @@ export struct VideoChannelPage { @@ -149,6 +162,25 @@ export struct VideoChannelPage {
149 .height('100%') 162 .height('100%')
150 } 163 }
151 164
  165 + clickTopNav(index: number) {
  166 + // 视频tab埋点
  167 + const tab = this.topNavList[index]
  168 + this.handleAudio(tab)
  169 + // Logger.info(TAG, `视频tab埋点: ${JSON.stringify(tab)}`);
  170 + const params: ParamType = {
  171 + "pageName": tab.name,
  172 + "tabName": tab.name,
  173 + "pageId": tab.pageId,
  174 + }
  175 + Tracking.event("video_page_tab_click", params)
  176 +
  177 + if (this.currentTopNavSelectedIndex === index) {
  178 + this.autoRefresh++
  179 + }
  180 + this.currentTopNavSelectedIndex = index
  181 + this.swiperController.changeIndex(index, true)
  182 + }
  183 +
152 @Builder 184 @Builder
153 topNavView() { 185 topNavView() {
154 Stack({ alignContent: Alignment.End }) { 186 Stack({ alignContent: Alignment.End }) {
@@ -202,23 +234,7 @@ export struct VideoChannelPage { @@ -202,23 +234,7 @@ export struct VideoChannelPage {
202 right: item.iconUrl && item.iconCUrl ? 0 : $r('app.float.top_tab_item_padding_horizontal'), 234 right: item.iconUrl && item.iconCUrl ? 0 : $r('app.float.top_tab_item_padding_horizontal'),
203 }) 235 })
204 .onClick(() => { 236 .onClick(() => {
205 - // 视频tab埋点  
206 - const tab = this.topNavList[index]  
207 - this.handleAudio(tab)  
208 - // Logger.info(TAG, `视频tab埋点: ${JSON.stringify(tab)}`);  
209 - const params: ParamType = {  
210 - "pageName": tab.name,  
211 - "tabName": tab.name,  
212 - "pageId": tab.pageId,  
213 - }  
214 - Tracking.event("video_page_tab_click", params)  
215 -  
216 - if (this.currentTopNavSelectedIndex === index) {  
217 - this.autoRefresh++  
218 - }  
219 - this.currentTopNavSelectedIndex = index  
220 - this.swiperController.changeIndex(index, true)  
221 - 237 + this.clickTopNav(index)
222 }) 238 })
223 .grayscale(this.GrayManage.get().isVideoMourning(`${item.channelId}`) ? 1 : 0) 239 .grayscale(this.GrayManage.get().isVideoMourning(`${item.channelId}`) ? 1 : 0)
224 }, (item: TopNavDTO) => item.channelId + '') 240 }, (item: TopNavDTO) => item.channelId + '')