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
chenqs
2024-07-25 16:01:42 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ab6d7396de911c63bd46c1348d93653f49178517
ab6d7396
1 parent
ce341989
fix |> 修复沉浸式TAB换肤时未能使用CMS后台配置的文字颜色
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
31 additions
and
4 deletions
sight_harmony/products/phone/src/main/ets/pages/view/BottomNavigationComponent.ets
sight_harmony/products/phone/src/main/ets/pages/view/BottomNavigationComponent.ets
View file @
ab6d739
...
...
@@ -49,7 +49,7 @@ export struct BottomNavigationComponent {
/**
* Component opacity value: 0.6.
*/
readonly SIXTY_OPACITY: number = 0.
6
;
readonly SIXTY_OPACITY: number = 0.
8
;
// 用于传参到顶导组件,【不用channelParam,主要是时序问题,需要先底导处理完,再延时触发顶导处理】
@State assignChannel: AssignChannelParam = new AssignChannelParam()
// 自动刷新触发(双击tab自动刷新)
...
...
@@ -140,7 +140,7 @@ export struct BottomNavigationComponent {
.fontWeight(this.currentNavIndex === index ? FontWeight.Bold : FontWeight.Normal)
.textAlign(TextAlign.Center)
.fontSize($r('app.float.font_size_10'))// .fontColor(this.currentNavIndex === index ? Color.Red : Color.Gray)
.fontColor(this.currentNavIndex === index ?
navItem.nameCColor : navItem.nameColor
)
.fontColor(this.currentNavIndex === index ?
this.setTabbarNameCColor(navItem) : this.setTabbarNameColor(navItem)
)
.opacity(this.currentNavIndex === index ? this.FULL_OPACITY : this.SIXTY_OPACITY)
}
.zIndex(10)
...
...
@@ -167,10 +167,34 @@ export struct BottomNavigationComponent {
}
private setTabbarNameCColor(navItem:BottomNavDTO) {
if (this.isImmersive) {
return navItem.immersiveNameCColor
}
if (this.isNight) {
return navItem.nightNameCColor
}
return navItem.nameCColor
}
private setTabbarNameColor(navItem:BottomNavDTO) {
if (this.isImmersive) {
return navItem.immersiveNameColor
}
if (this.isNight) {
return navItem.nightNameColor
}
return navItem.nameColor
}
getBottomImageKnifeOption(navItem: BottomNavDTO, isSelect: boolean): ImageKnifeOption {
let defaultIcon = this.getBottomLocalIcon(navItem, isSelect)
let url = this.getBottomIcon(navItem, isSelect)
let imageKnifeOption: ImageKnifeOption = {
loadSrc: url,
// 占位图使用本地资源
...
...
@@ -196,6 +220,9 @@ export struct BottomNavigationComponent {
if (this.isImmersive) {
// 获取沉浸式icon
icon = isSelect ? navItem.immersiveIconCUrl : navItem.immersiveIconUrl
} else if (this.isNight) {
// 获取暗黑模式 icon
icon = isSelect ? navItem.nightIconCUrl : navItem.nightIconUrl
} else {
// 获取常规icon
icon = isSelect ? navItem.iconC : navItem.icon
...
...
@@ -259,7 +286,7 @@ export struct BottomNavigationComponent {
// 底导切换函数
async onBottomNavigationIndexChange(navItem: BottomNavDTO, index: number) {
Logger.info(TAG, `onBottomNavigationIndexChange this.currentNavIndex: ${this.currentNavIndex}`);
Logger.info(TAG, `onBottomNavigationIndexChange t
o Index:${index},t
his.currentNavIndex: ${this.currentNavIndex}`);
if (navItem.name === '我的') {
this.barBackgroundColor = Color.White
...
...
Please
register
or
login
to post a comment