liyubing

feat:换肤

1)优化沉浸式频道检测
@@ -11,7 +11,6 @@ import { ParamType, TrackConstants, Tracking, TrackingButton } from 'wdTracking/ @@ -11,7 +11,6 @@ import { ParamType, TrackConstants, Tracking, TrackingButton } from 'wdTracking/
11 import DailyPaperTopicModel from '../../model/DailyPaperTopicModel'; 11 import DailyPaperTopicModel from '../../model/DailyPaperTopicModel';
12 import { CompUtils } from '../../utils/CompUtils'; 12 import { CompUtils } from '../../utils/CompUtils';
13 import ChannelViewModel from '../../viewmodel/ChannelViewModel'; 13 import ChannelViewModel from '../../viewmodel/ChannelViewModel';
14 -import { common2D, drawing } from '@kit.ArkGraphics2D';  
15 import { ColorUtils } from '../../utils/ColorUtils'; 14 import { ColorUtils } from '../../utils/ColorUtils';
16 15
17 const TAG = 'TopNavigationComponent'; 16 const TAG = 'TopNavigationComponent';
@@ -35,11 +35,9 @@ export struct BottomNavigationComponent { @@ -35,11 +35,9 @@ export struct BottomNavigationComponent {
35 @Provide currentBottomNavInfo: BottomNavDTO = {} as BottomNavDTO; // 当前底导信息 35 @Provide currentBottomNavInfo: BottomNavDTO = {} as BottomNavDTO; // 当前底导信息
36 @Provide currentTopNavInfo: TopNavDTO = {} as TopNavDTO; // 当前顶导信息 36 @Provide currentTopNavInfo: TopNavDTO = {} as TopNavDTO; // 当前顶导信息
37 @Provide barBackgroundColor: Color = Color.Transparent 37 @Provide barBackgroundColor: Color = Color.Transparent
38 - // @State bottomSafeHeight: number = AppStorage.get<number>('bottomSafeHeight') || 0  
39 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0 38 @State topSafeHeight: number = AppStorage.get<number>('topSafeHeight') || 0
40 @State @Watch('onBottomNavigationDataUpdated') bottomNavList: BottomNavDTO[] = [] // 底导/顶导全部数据 39 @State @Watch('onBottomNavigationDataUpdated') bottomNavList: BottomNavDTO[] = [] // 底导/顶导全部数据
41 @State currentNavIndex: number = BottomNavi.NEWS; // 底导当前选中/焦点下标 40 @State currentNavIndex: number = BottomNavi.NEWS; // 底导当前选中/焦点下标
42 - // @State topNavList: TopNavDTO[] = []  
43 // 底导TabsController 41 // 底导TabsController
44 private navController: TabsController = new TabsController(); 42 private navController: TabsController = new TabsController();
45 readonly ASPECT_RATIO_1_1: number = 1 / 1; // 底导图片宽高比 43 readonly ASPECT_RATIO_1_1: number = 1 / 1; // 底导图片宽高比
@@ -281,7 +279,6 @@ export struct BottomNavigationComponent { @@ -281,7 +279,6 @@ export struct BottomNavigationComponent {
281 279
282 onBottomNavigationDataUpdated() { 280 onBottomNavigationDataUpdated() {
283 Logger.error('yyyy', 'onBottomNavigationDataUpdated ' + JSON.stringify(this.bottomNavList)) 281 Logger.error('yyyy', 'onBottomNavigationDataUpdated ' + JSON.stringify(this.bottomNavList))
284 - // Logger.info(TAG, `onBottomNavigationDataUpdated currentNavIndex: ${this.currentNavIndex},length:${this.bottomNavItemList.length}`);  
285 } 282 }
286 283
287 /** 284 /**
@@ -54,9 +54,7 @@ export struct VideoChannelPage { @@ -54,9 +54,7 @@ export struct VideoChannelPage {
54 */ 54 */
55 setBarBackgroundColor() { 55 setBarBackgroundColor() {
56 56
57 - //Logger.debug('setBarBackgroundColor','setBarBackgroundColor '+this.navItem.name+' '+this.navItem.statusBarColor)  
58 -  
59 - if (this.currentTopNavSelectedIndex === 0 && CompUtils.isVideo(this.currentBottomNavInfo)) { 57 + if (this.isImmerseChannel() && CompUtils.isVideo(this.currentBottomNavInfo)) {
60 this.barBackgroundColor = Color.Black 58 this.barBackgroundColor = Color.Black
61 this.isImmersive = true 59 this.isImmersive = true
62 this.changeTopStatusBarColor(0)// 沉浸页面顶部导航栏颜色固定黑色 60 this.changeTopStatusBarColor(0)// 沉浸页面顶部导航栏颜色固定黑色
@@ -180,9 +178,9 @@ export struct VideoChannelPage { @@ -180,9 +178,9 @@ export struct VideoChannelPage {
180 178
181 // 搜索按钮 179 // 搜索按钮
182 Row() { 180 Row() {
183 - Image($r(this.currentTopNavSelectedIndex === 0 ? 'app.media.icon_search_gray_svg' : 181 + Image($r(this.isImmerseChannel() ? 'app.media.icon_search_gray_svg' :
184 'app.media.icon_search')) 182 'app.media.icon_search'))
185 - .colorFilter(this.currentTopNavSelectedIndex === 0 ? undefined : 183 + .colorFilter(this.isImmerseChannel() ? undefined :
186 ColorUtils.getDrawingColorFilter(this.getBothColor(""))) 184 ColorUtils.getDrawingColorFilter(this.getBothColor("")))
187 .width('24vp') 185 .width('24vp')
188 .height('24vp') 186 .height('24vp')
@@ -212,6 +210,15 @@ export struct VideoChannelPage { @@ -212,6 +210,15 @@ export struct VideoChannelPage {
212 } 210 }
213 211
214 /** 212 /**
  213 + * 检测是否是沉浸式频道
  214 + * @returns
  215 + */
  216 + isImmerseChannel():boolean{
  217 +
  218 + return this.navItem.topNavChannelList[this.currentTopNavSelectedIndex].channelStyle === 1;
  219 + }
  220 +
  221 + /**
215 * 两侧文字图标颜色,搜索图标颜色 222 * 两侧文字图标颜色,搜索图标颜色
216 * @returns 223 * @returns
217 */ 224 */
@@ -224,7 +231,7 @@ export struct VideoChannelPage { @@ -224,7 +231,7 @@ export struct VideoChannelPage {
224 pageSwiperView() { 231 pageSwiperView() {
225 Swiper(this.swiperController) { 232 Swiper(this.swiperController) {
226 ForEach(this.topNavList, (item: TopNavDTO, index: number) => { 233 ForEach(this.topNavList, (item: TopNavDTO, index: number) => {
227 - if (index == 0) { 234 + if (item.channelStyle===1) {
228 // 视频 235 // 视频
229 VideoChannelDetail({ 236 VideoChannelDetail({
230 bottomNavIndex: $_currentNavIndex, 237 bottomNavIndex: $_currentNavIndex,
@@ -246,8 +253,7 @@ export struct VideoChannelPage { @@ -246,8 +253,7 @@ export struct VideoChannelPage {
246 pageId: item.pageId + '', 253 pageId: item.pageId + '',
247 channelId: item.channelId + '', 254 channelId: item.channelId + '',
248 autoRefresh: this.autoRefresh 255 autoRefresh: this.autoRefresh
249 - })// .padding({ top: px2vp(this.topSafeHeight) + 44 })  
250 - .backgroundColor(Color.White) 256 + }).backgroundColor(Color.White)
251 } 257 }
252 258
253 } 259 }