Showing
1 changed file
with
27 additions
and
11 deletions
| @@ -35,6 +35,7 @@ export struct TopNavigationComponent { | @@ -35,6 +35,7 @@ export struct TopNavigationComponent { | ||
| 35 | // 地方频道列表 | 35 | // 地方频道列表 |
| 36 | @State localChannelList: TopNavDTO[] = [] | 36 | @State localChannelList: TopNavDTO[] = [] |
| 37 | readonly MAX_LINE: number = 1; | 37 | readonly MAX_LINE: number = 1; |
| 38 | + | ||
| 38 | //处理新闻tab顶导频道数据 | 39 | //处理新闻tab顶导频道数据 |
| 39 | topNavListHandle() { | 40 | topNavListHandle() { |
| 40 | let _channelIds: number [] = [] | 41 | let _channelIds: number [] = [] |
| @@ -120,6 +121,20 @@ export struct TopNavigationComponent { | @@ -120,6 +121,20 @@ export struct TopNavigationComponent { | ||
| 120 | return item.name === '播报' | 121 | return item.name === '播报' |
| 121 | } | 122 | } |
| 122 | 123 | ||
| 124 | + isLayout(item: TopNavDTO) { | ||
| 125 | + return item.name === '版面' | ||
| 126 | + } | ||
| 127 | + | ||
| 128 | + jumpToENewPaper() { | ||
| 129 | + let taskAction: Action = { | ||
| 130 | + type: 'JUMP_INNER_NEW_PAGE', | ||
| 131 | + params: { | ||
| 132 | + pageID: 'E_NEWSPAPER' | ||
| 133 | + } as Params, | ||
| 134 | + }; | ||
| 135 | + WDRouterRule.jumpWithAction(taskAction) | ||
| 136 | + } | ||
| 137 | + | ||
| 123 | build() { | 138 | build() { |
| 124 | Column() { | 139 | Column() { |
| 125 | // 顶部搜索、日报logo、早晚报 | 140 | // 顶部搜索、日报logo、早晚报 |
| @@ -131,13 +146,7 @@ export struct TopNavigationComponent { | @@ -131,13 +146,7 @@ export struct TopNavigationComponent { | ||
| 131 | .width(72) | 146 | .width(72) |
| 132 | .height(29) | 147 | .height(29) |
| 133 | .onClick((event: ClickEvent) => { | 148 | .onClick((event: ClickEvent) => { |
| 134 | - let taskAction: Action = { | ||
| 135 | - type: 'JUMP_INNER_NEW_PAGE', | ||
| 136 | - params: { | ||
| 137 | - pageID: 'E_NEWSPAPER' | ||
| 138 | - } as Params, | ||
| 139 | - }; | ||
| 140 | - WDRouterRule.jumpWithAction(taskAction) | 149 | + this.jumpToENewPaper() |
| 141 | }) | 150 | }) |
| 142 | 151 | ||
| 143 | Stack({ alignContent: Alignment.Center }) { | 152 | Stack({ alignContent: Alignment.Center }) { |
| @@ -172,7 +181,7 @@ export struct TopNavigationComponent { | @@ -172,7 +181,7 @@ export struct TopNavigationComponent { | ||
| 172 | } | 181 | } |
| 173 | .width('100%') | 182 | .width('100%') |
| 174 | .height(40) | 183 | .height(40) |
| 175 | - .padding({top:10}) | 184 | + .padding({ top: 10 }) |
| 176 | .backgroundColor($r('app.color.white')) | 185 | .backgroundColor($r('app.color.white')) |
| 177 | .visibility(this._currentNavIndex == 0 ? Visibility.Visible : Visibility.None) | 186 | .visibility(this._currentNavIndex == 0 ? Visibility.Visible : Visibility.None) |
| 178 | 187 | ||
| @@ -181,7 +190,7 @@ export struct TopNavigationComponent { | @@ -181,7 +190,7 @@ export struct TopNavigationComponent { | ||
| 181 | Tabs({ index: this.currentTopNavSelectedIndex, controller: this.tabsController }) { | 190 | Tabs({ index: this.currentTopNavSelectedIndex, controller: this.tabsController }) { |
| 182 | ForEach(this._currentNavIndex === 0 ? this.myChannelList : this.topNavList, (navItem: TopNavDTO, index: number) => { | 191 | ForEach(this._currentNavIndex === 0 ? this.myChannelList : this.topNavList, (navItem: TopNavDTO, index: number) => { |
| 183 | TabContent() { | 192 | TabContent() { |
| 184 | - if (!this.isBroadcast(navItem)) { | 193 | + if (!this.isBroadcast(navItem) && !this.isLayout(navItem)) { |
| 185 | PageComponent({ | 194 | PageComponent({ |
| 186 | currentTopNavSelectedIndex: $currentTopNavSelectedIndex, | 195 | currentTopNavSelectedIndex: $currentTopNavSelectedIndex, |
| 187 | navIndex: index, | 196 | navIndex: index, |
| @@ -198,9 +207,12 @@ export struct TopNavigationComponent { | @@ -198,9 +207,12 @@ export struct TopNavigationComponent { | ||
| 198 | .vertical(false) | 207 | .vertical(false) |
| 199 | .onChange((index: number) => { | 208 | .onChange((index: number) => { |
| 200 | Logger.info(TAG, `onChange index : ${index}`); | 209 | Logger.info(TAG, `onChange index : ${index}`); |
| 201 | - if (!this.isBroadcast(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) { | 210 | + if (!this.isBroadcast(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index]) && |
| 211 | + !this.isLayout(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index]) | ||
| 212 | + ) { | ||
| 202 | this.currentTopNavSelectedIndex = index; | 213 | this.currentTopNavSelectedIndex = index; |
| 203 | - } else { | 214 | + } |
| 215 | + if (this.isBroadcast(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) { | ||
| 204 | // 跳转到播报页面 | 216 | // 跳转到播报页面 |
| 205 | let taskAction: Action = { | 217 | let taskAction: Action = { |
| 206 | type: 'JUMP_INNER_NEW_PAGE', | 218 | type: 'JUMP_INNER_NEW_PAGE', |
| @@ -212,6 +224,10 @@ export struct TopNavigationComponent { | @@ -212,6 +224,10 @@ export struct TopNavigationComponent { | ||
| 212 | WDRouterRule.jumpWithAction(taskAction) | 224 | WDRouterRule.jumpWithAction(taskAction) |
| 213 | this.tabsController.changeIndex(this.currentTopNavSelectedIndex) | 225 | this.tabsController.changeIndex(this.currentTopNavSelectedIndex) |
| 214 | } | 226 | } |
| 227 | + if (this.isLayout(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) { | ||
| 228 | + this.jumpToENewPaper() | ||
| 229 | + this.tabsController.changeIndex(this.currentTopNavSelectedIndex) | ||
| 230 | + } | ||
| 215 | }) | 231 | }) |
| 216 | 232 | ||
| 217 | // 分类列表最右侧频道设置 | 233 | // 分类列表最右侧频道设置 |
-
Please register or login to post a comment