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 08:10:42 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
6c453a4c12931eef51cf2634403faa07ffa10405
6c453a4c
1 parent
f363ee71
底导切换修复
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
7 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 @
6c453a4
...
...
@@ -16,7 +16,7 @@ PersistentStorage.persistProp('indexSettingChannelId', 0);
@Component
export struct TopNavigationComponent {
private tabsController: TabsController = new TabsController()
@Prop _currentNavIndex: number;
@Prop _currentNavIndex
?
: number;
// 顶导当前选中/焦点下标
@State currentTopNavSelectedIndex: number = 0;
// 顶导数据
...
...
@@ -35,7 +35,6 @@ export struct TopNavigationComponent {
// 地方频道列表
@State localChannelList: TopNavDTO[] = []
readonly MAX_LINE: number = 1;
//处理新闻tab顶导频道数据
topNavListHandle() {
let _channelIds: number [] = []
...
...
@@ -111,9 +110,11 @@ export struct TopNavigationComponent {
AppStorage.set('indexSettingChannelId', this.homeChannelList[0].channelId)
} else {
let index = this.myChannelList.findIndex(_item => _item.channelId === this.indexSettingChannelId)
if (index > -1) {
this.currentTopNavSelectedIndex = index
}
}
}
isBroadcast(item: TopNavDTO) {
return item.name === '播报'
...
...
@@ -122,8 +123,8 @@ export struct TopNavigationComponent {
build() {
Column() {
// 顶部搜索、日报logo、早晚报
Column(){
Row(){
Column() {
Row() {
FirstTabTopSearchComponent()
Image($r('app.media.icon_ren_min_ri_bao'))
...
...
@@ -168,7 +169,8 @@ export struct TopNavigationComponent {
})
}.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
}.height('73lpx')
}
.height('73lpx')
.width('100%')
.justifyContent(FlexAlign.End)
.backgroundColor($r('app.color.white'))
...
...
@@ -266,10 +268,8 @@ export struct TopNavigationComponent {
aboutToAppear() {
//处理新闻tab顶导频道数据
if (this._currentNavIndex === 0) {
this.topNavListHandle()
}
}
aboutToDisappear() {
AppStorage.set('channelIds', this.channelIds.join(','))
...
...
Please
register
or
login
to post a comment