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
zhangbo1_wd
2024-05-20 19:11:09 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ce69f4b1de2445056b4b88d926480ea341d5ab87
ce69f4b1
1 parent
fe57160c
底导换肤修改
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
35 additions
and
10 deletions
sight_harmony/features/wdBean/src/main/ets/bean/navigation/NavigationBodyDTO.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/BottomNavigationComponent.ets
sight_harmony/features/wdBean/src/main/ets/bean/navigation/NavigationBodyDTO.ets
View file @
ce69f4b
...
...
@@ -7,17 +7,20 @@ import { TopNavDTO } from './TopNavDTO';
export class NavigationBodyDTO {
backgroundColor: string = ''; // 迭代二新增-底部导航背景色(信息流频道)
bottomNavList: BottomNavDTO[] = [];
// greyBottomNav: GreyBottomNav; // 灰度皮肤
immersiveBackgroundColor: string = ''; // 迭代二新增-底部导航背景色(沉浸式频道)
nightBackgroundColor: string = ''; // 迭代三新增-底部导航背景色(夜间模式)
greyBottomNav?: GreyBottomNavBean; // 灰度皮肤
md5: string = ''
}
export class GreyBottomNavBean {
bottomNavList: BottomNavDTO[] = [];
greyUserList: string[] = [];
}
export class NavigationDetailDTO {
id: string = ''; // 迭代二新增-底部导航背景色(信息流频道)
bottomNavCompList: BottomNavCompDTO[] = [];
topNavChannelList: TopNavDTO[] = [];
md5: string = ''
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/BottomNavigationComponent.ets
View file @
ce69f4b
import { BottomNavi, CommonConstants } from 'wdConstant';
import { BottomNavDTO, NavigationBodyDTO, TopNavDTO } from 'wdBean';
import { EmitterEventId, EmitterUtils, Logger } from 'wdKit';
import { BottomNavDTO, NavigationBodyDTO, NavigationDetailDTO, TopNavDTO } from 'wdBean';
import { EmitterEventId, EmitterUtils, Logger, StringUtils } from 'wdKit';
import { TopNavigationComponent } from './TopNavigationComponent';
import { MinePageComponent } from './MinePageComponent';
import { CompUtils } from '../../utils/CompUtils';
import ChannelViewModel from '../../viewmodel/ChannelViewModel';
import HomeChannelUtils, { AssignChannelParam } from 'wdRouter';
import { VideoChannelPage } from './VideoChannelPage';
import { HttpUtils } from 'wdNetwork/Index';
const TAG = 'BottomNavigationComponent';
let storage = LocalStorage.getShared();
...
...
@@ -225,7 +226,7 @@ export struct BottomNavigationComponent {
}
private getBottomDetail() {
// 1、获取顶导缓存数据
//
//
1、获取顶导缓存数据
// this.bottomNavList.forEach((value) => {
// // 先用底导带回的list初始化
// this.topNavMap[value.id] = value.topNavChannelList
...
...
@@ -249,11 +250,32 @@ export struct BottomNavigationComponent {
private setData(data: NavigationBodyDTO) {
Logger.debug(TAG, 'setData')
if (data && data.bottomNavList != null) {
Logger.info(TAG, `setData, bottomNav.length: ${data.bottomNavList.length}`);
if (data == null) {
return
}
let list: BottomNavDTO[] = []
let userId: string = HttpUtils.getUserId()
// 先匹配换肤
if (data.greyBottomNav != null && data.greyBottomNav.greyUserList != null &&
data.greyBottomNav.greyUserList.length > 0) {
// data.greyBottomNav.greyUserList.includes(userId)不生效,直接用循环匹配
for (let i = 0; i < data.greyBottomNav.greyUserList.length; i++) {
let id = data.greyBottomNav.greyUserList[i]
if (id == userId) {
list = data.greyBottomNav.bottomNavList
break
}
}
}
// 没有匹配到换肤,则直接用data.bottomNavList
if (list.length <= 0) {
list = data.bottomNavList
}
if (list.length > 0) {
Logger.info(TAG, `setData, bottomNav.length: ${list.length}`);
// 使用filter方法移除name为'服务'的项
data.bottomNavList = data.bottomNavList.filter(item => item.name !== '服务');
this.bottomNavList = data.bottomNavList
list = list.filter(item => item.name !== '服务');
this.bottomNavList = list
}
}
}
\ No newline at end of file
...
...
Please
register
or
login
to post a comment