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
wangyujian_wd
2024-03-20 16:29:12 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
27c47e7964b388ce044c600ab19604733fdb4406
27c47e79
1 parent
bd775e4d
feat:1)底部tab为视频模块时,隐藏顶部搜索/人民日报/早晚报栏;
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
13 deletions
sight_harmony/commons/wdConstant/src/main/ets/enum/BottomNavi.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/BottomNavigationComponent.ets
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponent.ets
sight_harmony/commons/wdConstant/src/main/ets/enum/BottomNavi.ets
View file @
27c47e7
...
...
@@ -4,8 +4,8 @@
*/
export const enum BottomNavi {
NEWS = 0,
PEOPLE,
VIDEO,
SERVICE,
MINE,
PEOPLE=1,
VIDEO=2,
SERVICE=3,
MINE=4,
}
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/BottomNavigationComponent.ets
View file @
27c47e7
...
...
@@ -16,7 +16,7 @@ export struct BottomNavigationComponent {
// 底导/顶导全部数据
@State @Watch('onBottomNavigationDataUpdated') bottomNavList: BottomNavDTO[] = []
// 底导当前选中/焦点下标
@
Provid
e currentNavIndex: number = BottomNavi.NEWS;
@
Stat
e currentNavIndex: number = BottomNavi.NEWS;
// 底导TabsController
private navController: TabsController = new TabsController();
readonly ASPECT_RATIO_1_1: number = 1 / 1; // 底导图片宽高比
...
...
@@ -51,7 +51,7 @@ export struct BottomNavigationComponent {
// 我的页面组件数据列表
MinePageComponent()
} else {
TopNavigationComponent({ topNavList: navItem.topNavChannelList })
TopNavigationComponent({ topNavList: navItem.topNavChannelList
, _currentNavIndex: this.currentNavIndex
})
}
}
}
...
...
@@ -85,6 +85,7 @@ export struct BottomNavigationComponent {
}
.height($r('app.float.bottom_navigation_barHeight'))
.hoverEffect(HoverEffect.Highlight)
// .justifyContent(FlexAlign.Center)
// .onClick(() => {
// Logger.info(TAG, `onClick, index: ${index}`);
...
...
sight_harmony/features/wdComponent/src/main/ets/components/page/TopNavigationComponent.ets
View file @
27c47e7
...
...
@@ -10,6 +10,7 @@ const TAG = 'TopNavigationComponent';
*/
@Component
export struct TopNavigationComponent {
@Prop _currentNavIndex?: number;
// 顶导当前选中/焦点下标
@State currentTopNavSelectedIndex: number = 0;
// 顶导数据
...
...
@@ -19,15 +20,15 @@ export struct TopNavigationComponent {
build() {
Column() {
RelativeContainer(){
Stack({ alignContent: Alignment.Center }){
RelativeContainer() {
Stack({ alignContent: Alignment.Center }) {
Image($r('app.media.background_search'))
.width('100%')
.height('100%')
.objectFit(ImageFit.Contain)
Row(){
Row()
{
Image($r('app.media.icon_search'))
.width(18)
.height(18)
...
...
@@ -62,12 +63,12 @@ export struct TopNavigationComponent {
.alignRules({ middle: { anchor: "__container__", align: HorizontalAlign.Center },
center: { anchor: "__container__", align: VerticalAlign.Center } })
Stack({ alignContent: Alignment.Center }){
Stack({ alignContent: Alignment.Center })
{
Image($r('app.media.background_read_paper_home'))
.width('100%')
.height('100%')
.objectFit(ImageFit.Contain)
Row(){
Row()
{
Image($r('app.media.icon_read_paper_home'))
.width(18)
.height(18)
...
...
@@ -84,7 +85,7 @@ export struct TopNavigationComponent {
.id('read')
.alignRules({ right: { anchor: "__container__", align: HorizontalAlign.End },
center: { anchor: "__container__", align: VerticalAlign.Center } })
.onClick((event: ClickEvent)
=>
{
.onClick((event: ClickEvent)
=>
{
let taskAction: Action = {
type: 'JUMP_INNER_NEW_PAGE',
...
...
@@ -97,6 +98,7 @@ export struct TopNavigationComponent {
}
.width('100%')
.height(40)
.visibility(this._currentNavIndex != 2 ? Visibility.Visible : Visibility.None)
Tabs() {
ForEach(this.topNavList, (navItem: TopNavDTO, index: number) => {
...
...
@@ -132,7 +134,7 @@ export struct TopNavigationComponent {
.maxLines(this.MAX_LINE)
Divider()
.width(16)
.strokeWidth(2)
// 分割线粗细度。
.strokeWidth(2)// 分割线粗细度。
.padding({ top: 2 })
.color(Color.Red)
.opacity(this.currentTopNavSelectedIndex === index ? 1 : 0)
...
...
Please
register
or
login
to post a comment