chenqs

fix |> 修复沉浸式TAB换肤时未能使用CMS后台配置的文字颜色

... ... @@ -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 to Index:${index},this.currentNavIndex: ${this.currentNavIndex}`);
if (navItem.name === '我的') {
this.barBackgroundColor = Color.White
... ...