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-23 14:49:14 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
895a51770910e377e3edcae8c485ce1a7cce70bf
895a5177
1 parent
a15f0c2c
布局优化
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponentNew.ets
View file @
895a517
...
...
@@ -72,6 +72,7 @@ export struct TopNavigationComponentNew {
private tabsWidth: number = 0
build() {
Column() {
// 频道分类list
RelativeContainer() {
this.tabBar()
...
...
@@ -135,6 +136,7 @@ export struct TopNavigationComponentNew {
.width('100%')
.height('100%')
}
}
@Builder
topBar() {
...
...
@@ -316,7 +318,7 @@ export struct TopNavigationComponentNew {
bottom: 2,
})
.id(`col_tabBar${index}`)
.margin({ right: this.myChannelList.length === index + 1 ? 36 : 0 })
//
.margin({ right: this.myChannelList.length === index + 1 ? 36 : 0 })
.onClick(() => {
Logger.debug(TAG, `onClick, index: ${index}`);
if (this.currentTopNavSelectedIndex === index) {
...
...
@@ -487,9 +489,19 @@ export struct TopNavigationComponentNew {
}
/**
* 判断是否当前页面处理逻辑,如消息通知,只需要切换到当前底导的处理,过滤掉非当前。
*/
private isCurrentPage(): boolean {
return this._currentNavIndex === this.bottomNavIndex
}
/**
* 频道id变化,即指定频道跳转场景
*/
onAssignChannelChange() {
if (!this.isCurrentPage()) {
return
}
let channelId = this.assignChannel.channelId
let index = -1
if (this._currentNavIndex === 0) {
...
...
@@ -537,7 +549,7 @@ export struct TopNavigationComponentNew {
private getChannelByMine(channelId: string) {
for (let i = 0; i < this.myChannelList.length; i++) {
let topNavDTO: TopNavDTO = this.myChannelList[i]
if (topNavDTO.channelId?.toString() === channelId) {
if (topNavDTO
?
.channelId?.toString() === channelId) {
return i
}
}
...
...
Please
register
or
login
to post a comment