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
yuzhilin
2024-04-09 09:31:54 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
a457f1309ac2bdcb551d4ee98f1530a7a708ebbb
a457f130
1 parent
3763420a
版面切换
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
27 additions
and
11 deletions
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponent.ets
View file @
a457f13
...
...
@@ -35,6 +35,7 @@ export struct TopNavigationComponent {
// 地方频道列表
@State localChannelList: TopNavDTO[] = []
readonly MAX_LINE: number = 1;
//处理新闻tab顶导频道数据
topNavListHandle() {
let _channelIds: number [] = []
...
...
@@ -120,6 +121,20 @@ export struct TopNavigationComponent {
return item.name === '播报'
}
isLayout(item: TopNavDTO) {
return item.name === '版面'
}
jumpToENewPaper() {
let taskAction: Action = {
type: 'JUMP_INNER_NEW_PAGE',
params: {
pageID: 'E_NEWSPAPER'
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
}
build() {
Column() {
// 顶部搜索、日报logo、早晚报
...
...
@@ -131,13 +146,7 @@ export struct TopNavigationComponent {
.width(72)
.height(29)
.onClick((event: ClickEvent) => {
let taskAction: Action = {
type: 'JUMP_INNER_NEW_PAGE',
params: {
pageID: 'E_NEWSPAPER'
} as Params,
};
WDRouterRule.jumpWithAction(taskAction)
this.jumpToENewPaper()
})
Stack({ alignContent: Alignment.Center }) {
...
...
@@ -172,7 +181,7 @@ export struct TopNavigationComponent {
}
.width('100%')
.height(40)
.padding({
top:10
})
.padding({
top: 10
})
.backgroundColor($r('app.color.white'))
.visibility(this._currentNavIndex == 0 ? Visibility.Visible : Visibility.None)
...
...
@@ -181,7 +190,7 @@ export struct TopNavigationComponent {
Tabs({ index: this.currentTopNavSelectedIndex, controller: this.tabsController }) {
ForEach(this._currentNavIndex === 0 ? this.myChannelList : this.topNavList, (navItem: TopNavDTO, index: number) => {
TabContent() {
if (!this.isBroadcast(navItem)) {
if (!this.isBroadcast(navItem)
&& !this.isLayout(navItem)
) {
PageComponent({
currentTopNavSelectedIndex: $currentTopNavSelectedIndex,
navIndex: index,
...
...
@@ -198,9 +207,12 @@ export struct TopNavigationComponent {
.vertical(false)
.onChange((index: number) => {
Logger.info(TAG, `onChange index : ${index}`);
if (!this.isBroadcast(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) {
if (!this.isBroadcast(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index]) &&
!this.isLayout(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])
) {
this.currentTopNavSelectedIndex = index;
} else {
}
if (this.isBroadcast(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) {
// 跳转到播报页面
let taskAction: Action = {
type: 'JUMP_INNER_NEW_PAGE',
...
...
@@ -212,6 +224,10 @@ export struct TopNavigationComponent {
WDRouterRule.jumpWithAction(taskAction)
this.tabsController.changeIndex(this.currentTopNavSelectedIndex)
}
if (this.isLayout(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) {
this.jumpToENewPaper()
this.tabsController.changeIndex(this.currentTopNavSelectedIndex)
}
})
// 分类列表最右侧频道设置
...
...
Please
register
or
login
to post a comment