liyubing

feat:换肤

1)优化沉浸式频道检测
... ... @@ -11,7 +11,6 @@ import { ParamType, TrackConstants, Tracking, TrackingButton } from 'wdTracking/
import DailyPaperTopicModel from '../../model/DailyPaperTopicModel';
import { CompUtils } from '../../utils/CompUtils';
import ChannelViewModel from '../../viewmodel/ChannelViewModel';
import { common2D, drawing } from '@kit.ArkGraphics2D';
import { ColorUtils } from '../../utils/ColorUtils';
const TAG = 'TopNavigationComponent';
... ...
... ... @@ -35,11 +35,9 @@ export struct BottomNavigationComponent {
@Provide currentBottomNavInfo: BottomNavDTO = {} as BottomNavDTO; // 当前底导信息
@Provide currentTopNavInfo: TopNavDTO = {} as TopNavDTO; // 当前顶导信息
@Provide barBackgroundColor: Color = Color.Transparent
// @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0
@State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
@State @Watch('onBottomNavigationDataUpdated') bottomNavList: BottomNavDTO[] = [] // 底导/顶导全部数据
@State currentNavIndex: number = BottomNavi.NEWS; // 底导当前选中/焦点下标
// @State topNavList: TopNavDTO[] = []
// 底导TabsController
private navController: TabsController = new TabsController();
readonly ASPECT_RATIO_1_1: number = 1 / 1; // 底导图片宽高比
... ... @@ -281,7 +279,6 @@ export struct BottomNavigationComponent {
onBottomNavigationDataUpdated() {
Logger.error('yyyy', 'onBottomNavigationDataUpdated ' + JSON.stringify(this.bottomNavList))
// Logger.info(TAG, `onBottomNavigationDataUpdated currentNavIndex: ${this.currentNavIndex},length:${this.bottomNavItemList.length}`);
}
/**
... ...
... ... @@ -54,9 +54,7 @@ export struct VideoChannelPage {
*/
setBarBackgroundColor() {
//Logger.debug('setBarBackgroundColor','setBarBackgroundColor '+this.navItem.name+' '+this.navItem.statusBarColor)
if (this.currentTopNavSelectedIndex === 0 && CompUtils.isVideo(this.currentBottomNavInfo)) {
if (this.isImmerseChannel() && CompUtils.isVideo(this.currentBottomNavInfo)) {
this.barBackgroundColor = Color.Black
this.isImmersive = true
this.changeTopStatusBarColor(0)// 沉浸页面顶部导航栏颜色固定黑色
... ... @@ -180,9 +178,9 @@ export struct VideoChannelPage {
// 搜索按钮
Row() {
Image($r(this.currentTopNavSelectedIndex === 0 ? 'app.media.icon_search_gray_svg' :
Image($r(this.isImmerseChannel() ? 'app.media.icon_search_gray_svg' :
'app.media.icon_search'))
.colorFilter(this.currentTopNavSelectedIndex === 0 ? undefined :
.colorFilter(this.isImmerseChannel() ? undefined :
ColorUtils.getDrawingColorFilter(this.getBothColor("")))
.width('24vp')
.height('24vp')
... ... @@ -212,6 +210,15 @@ export struct VideoChannelPage {
}
/**
* 检测是否是沉浸式频道
* @returns
*/
isImmerseChannel():boolean{
return this.navItem.topNavChannelList[this.currentTopNavSelectedIndex].channelStyle === 1;
}
/**
* 两侧文字图标颜色,搜索图标颜色
* @returns
*/
... ... @@ -224,7 +231,7 @@ export struct VideoChannelPage {
pageSwiperView() {
Swiper(this.swiperController) {
ForEach(this.topNavList, (item: TopNavDTO, index: number) => {
if (index == 0) {
if (item.channelStyle===1) {
// 视频
VideoChannelDetail({
bottomNavIndex: $_currentNavIndex,
... ... @@ -246,8 +253,7 @@ export struct VideoChannelPage {
pageId: item.pageId + '',
channelId: item.channelId + '',
autoRefresh: this.autoRefresh
})// .padding({ top: px2vp(this.topSafeHeight) + 44 })
.backgroundColor(Color.White)
}).backgroundColor(Color.White)
}
}
... ...