Showing
2 changed files
with
12 additions
and
12 deletions
| @@ -94,7 +94,8 @@ export struct BottomNavigationComponent { | @@ -94,7 +94,8 @@ export struct BottomNavigationComponent { | ||
| 94 | _currentNavIndex: $currentNavIndex, | 94 | _currentNavIndex: $currentNavIndex, |
| 95 | bottomNavIndex: index, | 95 | bottomNavIndex: index, |
| 96 | autoRefresh: this.autoRefresh, | 96 | autoRefresh: this.autoRefresh, |
| 97 | - navItem: navItem | 97 | + navItem: navItem, |
| 98 | + assignChannel: this.assignChannel | ||
| 98 | }) | 99 | }) |
| 99 | } else { | 100 | } else { |
| 100 | // 其它带顶导的页面,如 新闻、人民号、服务 | 101 | // 其它带顶导的页面,如 新闻、人民号、服务 |
| @@ -25,6 +25,7 @@ export struct VideoChannelPage { | @@ -25,6 +25,7 @@ export struct VideoChannelPage { | ||
| 25 | private groupId: number = 0 | 25 | private groupId: number = 0 |
| 26 | private swiperController: SwiperController = new SwiperController() | 26 | private swiperController: SwiperController = new SwiperController() |
| 27 | // 自动刷新触发(双击tab自动刷新) | 27 | // 自动刷新触发(双击tab自动刷新) |
| 28 | + @Prop @Watch('setTabbarActive') assignChannel: AssignChannelParam | ||
| 28 | @Prop autoRefresh: number = 0 | 29 | @Prop autoRefresh: number = 0 |
| 29 | @Prop topNavList: TopNavDTO[] | 30 | @Prop topNavList: TopNavDTO[] |
| 30 | @Link _currentNavIndex?: number; | 31 | @Link _currentNavIndex?: number; |
| @@ -59,18 +60,16 @@ export struct VideoChannelPage { | @@ -59,18 +60,16 @@ export struct VideoChannelPage { | ||
| 59 | if (this.currentTopNavSelectedIndex === 0) { | 60 | if (this.currentTopNavSelectedIndex === 0) { |
| 60 | this.handleAudio(this.topNavList[0]) | 61 | this.handleAudio(this.topNavList[0]) |
| 61 | } | 62 | } |
| 63 | + } | ||
| 62 | 64 | ||
| 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 | - }) | 65 | + /** |
| 66 | + * 切换顶部导航index | ||
| 67 | + */ | ||
| 68 | + setTabbarActive() { | ||
| 69 | + let index = this.topNavList.findIndex((item: TopNavDTO, index) => { | ||
| 70 | + return Number(this.assignChannel.channelId) == item.channelId && Number(this.assignChannel.pageId) == item.pageId | ||
| 71 | + }) || 0 | ||
| 72 | + this.clickTopNav(index) | ||
| 74 | } | 73 | } |
| 75 | 74 | ||
| 76 | /** | 75 | /** |
-
Please register or login to post a comment