Toggle navigation
Toggle navigation
This project
Loading...
Sign in
developOne
/
harmonyPool
Go to a project
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation pinning
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
陈剑华
2024-10-09 18:00:05 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
b28a44d94675c1b540aed1d867065a1a2d0e26fa
b28a44d9
1 parent
6791f2d5
feat: 19239 跳转直播
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
39 additions
and
23 deletions
sight_harmony/features/wdComponent/src/main/ets/components/CompParser.ets
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhCarouselLayout01.ets
sight_harmony/products/phone/src/main/ets/pages/view/VideoChannelPage.ets
sight_harmony/features/wdComponent/src/main/ets/components/CompParser.ets
View file @
b28a44d
...
...
@@ -50,20 +50,20 @@ export struct CompParser {
// 轮播图屏蔽音频类型稿件
if (this.compDTO.compStyle === CompStyle.Zh_Carousel_Layout_01) {
this.audioItems = this.compDTO.operDataList.filter(item => {
return item.objectType === '13' || item.linkUrl.includes('audiotopic')
return item.objectType === '13' || item.linkUrl
?
.includes('audiotopic')
})
this.noneAudioItems = this.compDTO.operDataList.filter(item => {
return item.objectType !== '13' && !item.linkUrl.includes('audiotopic')
return item.objectType !== '13' && !item.linkUrl
?
.includes('audiotopic')
})
this.compDTO.operDataList = this.noneAudioItems;
}
// 金刚卡屏蔽音频类型稿件
if (this.compDTO.compStyle === CompStyle.Zh_Grid_Layout_03) {
this.audioItems = this.compDTO.operDataList.filter(item => {
return item.objectType === '13' || item.linkUrl.includes('audiotopic')
return item.objectType === '13' || item.linkUrl
?
.includes('audiotopic')
})
this.noneAudioItems = this.compDTO.operDataList.filter(item => {
return item.objectType !== '13' && !item.linkUrl.includes('audiotopic')
return item.objectType !== '13' && !item.linkUrl
?
.includes('audiotopic')
})
this.compDTO.operDataList = this.noneAudioItems;
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/compview/ZhCarouselLayout01.ets
View file @
b28a44d
...
...
@@ -87,7 +87,7 @@ export struct ZhCarouselLayout01 {
filterAtv() {
return this.compDTO.operDataList.filter(((item: ContentDTO) => {
return !item.linkUrl.includes('/h/atv')
return !item.linkUrl
?
.includes('/h/atv')
}))
}
...
...
sight_harmony/products/phone/src/main/ets/pages/view/VideoChannelPage.ets
View file @
b28a44d
...
...
@@ -8,13 +8,14 @@ import { WDRouterPage, WDRouterRule } from 'wdRouter';
import { DisplayDirection } from 'wdConstant/Index';
import { CompUtils, GrayManageModel, PageComponent } from 'wdComponent/Index';
import { TrackingButton, TrackConstants } from 'wdTracking/Index';
import { Logger, WindowModel } from 'wdKit';
import { ParamType, Tracking } from 'wdTracking/Index';
import { ColorUtils } from 'wdComponent/src/main/ets/utils/ColorUtils';
import { ImageKnifeComponent } from '@ohos/imageknife';
import { CommonUtils } from 'wdComponent/src/main/ets/utils/CommonUtils';
import { AudioSuspensionModel } from 'wdComponent'
import { BusinessError } from '@kit.BasicServicesKit';
import { EmitterEventId, EmitterUtils } from 'wdKit';
import { AssignChannelParam } from 'wdRouter/Index';
const TAG = 'VideoChannelPage'
...
...
@@ -58,6 +59,18 @@ export struct VideoChannelPage {
if (this.currentTopNavSelectedIndex === 0) {
this.handleAudio(this.topNavList[0])
}
EmitterUtils.receiveEvent(EmitterEventId.JUMP_HOME_CHANNEL, (str?: string) => {
// Logger.debug(TAG, 'receiveEvent JUMP_HOME_CHANNEL: ' + str)
if (str) {
// 跳转指定频道场景,传参底导id、频道id
let assignChannel = JSON.parse(str) as AssignChannelParam
let index = this.topNavList.findIndex((item: TopNavDTO, index) => {
return Number(assignChannel.channelId) == item.channelId && Number(assignChannel.pageId) == item.pageId
}) || 0
this.clickTopNav(index)
}
})
}
/**
...
...
@@ -149,6 +162,25 @@ export struct VideoChannelPage {
.height('100%')
}
clickTopNav(index: number) {
// 视频tab埋点
const tab = this.topNavList[index]
this.handleAudio(tab)
// Logger.info(TAG, `视频tab埋点: ${JSON.stringify(tab)}`);
const params: ParamType = {
"pageName": tab.name,
"tabName": tab.name,
"pageId": tab.pageId,
}
Tracking.event("video_page_tab_click", params)
if (this.currentTopNavSelectedIndex === index) {
this.autoRefresh++
}
this.currentTopNavSelectedIndex = index
this.swiperController.changeIndex(index, true)
}
@Builder
topNavView() {
Stack({ alignContent: Alignment.End }) {
...
...
@@ -202,23 +234,7 @@ export struct VideoChannelPage {
right: item.iconUrl && item.iconCUrl ? 0 : $r('app.float.top_tab_item_padding_horizontal'),
})
.onClick(() => {
// 视频tab埋点
const tab = this.topNavList[index]
this.handleAudio(tab)
// Logger.info(TAG, `视频tab埋点: ${JSON.stringify(tab)}`);
const params: ParamType = {
"pageName": tab.name,
"tabName": tab.name,
"pageId": tab.pageId,
}
Tracking.event("video_page_tab_click", params)
if (this.currentTopNavSelectedIndex === index) {
this.autoRefresh++
}
this.currentTopNavSelectedIndex = index
this.swiperController.changeIndex(index, true)
this.clickTopNav(index)
})
.grayscale(this.GrayManage.get().isVideoMourning(`${item.channelId}`) ? 1 : 0)
}, (item: TopNavDTO) => item.channelId + '')
...
...
Please
register
or
login
to post a comment