陈剑华

feat: 19239 直播跳转频道

... ... @@ -94,7 +94,8 @@ export struct BottomNavigationComponent {
_currentNavIndex: $currentNavIndex,
bottomNavIndex: index,
autoRefresh: this.autoRefresh,
navItem: navItem
navItem: navItem,
assignChannel: this.assignChannel
})
} else {
// 其它带顶导的页面,如 新闻、人民号、服务
... ...
... ... @@ -25,6 +25,7 @@ export struct VideoChannelPage {
private groupId: number = 0
private swiperController: SwiperController = new SwiperController()
// 自动刷新触发(双击tab自动刷新)
@Prop @Watch('setTabbarActive') assignChannel: AssignChannelParam
@Prop autoRefresh: number = 0
@Prop topNavList: TopNavDTO[]
@Link _currentNavIndex?: number;
... ... @@ -59,18 +60,16 @@ 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)
}
})
/**
* 切换顶部导航index
*/
setTabbarActive() {
let index = this.topNavList.findIndex((item: TopNavDTO, index) => {
return Number(this.assignChannel.channelId) == item.channelId && Number(this.assignChannel.pageId) == item.pageId
}) || 0
this.clickTopNav(index)
}
/**
... ...