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
zhangbo1_wd
2024-05-10 23:35:48 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
eab4352a9a160073c952ae21903a5b481c29de89
eab4352a
1 parent
2634a814
手势滑动触发版面跳转,tab选中修改,【跳过版面,到下一个】
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
1 deletions
sight_harmony/features/wdBean/src/main/ets/bean/navigation/TopNavDTO.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponent.ets
sight_harmony/features/wdBean/src/main/ets/bean/navigation/TopNavDTO.ets
View file @
eab4352
...
...
@@ -4,7 +4,7 @@
export interface TopNavDTO {
channelId: number;
channelStyle: number;
channelType: number;
channelType: number;
// 频道样式;1-沉浸式;2-信息流;3-特殊频道(跳转指定页面的,如版面)
defaultPermitted: number;
delPermitted: number;
fontCColor: string; // 频道展示样式颜色(选中状态)
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponent.ets
View file @
eab4352
...
...
@@ -66,6 +66,8 @@ export struct TopNavigationComponent {
private tabsWidth: number = 0
//定时器延时处理切换至版面、播报tab时 返回上一个tab
@State tabTimmer: number = 0
// 标识,是否为点击触发的tab切换,临时变量
private changeByClick: boolean = false
//处理新闻tab顶导频道数据
topNavListHandle() {
...
...
@@ -170,13 +172,20 @@ export struct TopNavigationComponent {
}
isBroadcast(item: TopNavDTO) {
// TODO 用id channelId = '2066'
return item.name === '播报'
}
isLayout(item: TopNavDTO) {
// TODO 用id channelId = '2006'
return item.name === '版面'
}
isSpecialChannel(item: TopNavDTO) {
// 版面、播报,可以用这个判断
return item.channelType === 3
}
build() {
Column() {
// 顶部搜索、日报logo、早晚报
...
...
@@ -287,7 +296,15 @@ export struct TopNavigationComponent {
if (this.isLayout(this._currentNavIndex === 0 ? this.myChannelList[index] : this.topNavList[index])) {
ProcessUtils.gotoENewsPaper()
this.tabTimmer = setTimeout(() => {
if (!this.changeByClick) {
// 识别左滑右滑,跳过版面,到下一个
let nextIndex = this.currentTopNavSelectedIndex > index ? index - 1 : index + 1
this.tabsController.changeIndex(nextIndex)
} else {
this.tabsController.changeIndex(this.currentTopNavSelectedIndex)
// 重置标识
this.changeByClick = false
}
}, 100)
}
})
...
...
@@ -406,6 +423,7 @@ export struct TopNavigationComponent {
// 当前tab,单击事件
this.doAutoRefresh()
} else {
this.changeByClick = true
this.tabsController.changeIndex(index)
}
})
...
...
Please
register
or
login
to post a comment