From bfd07cc94c66d62d2dafdd7c779a453c9f4da6b7 Mon Sep 17 00:00:00 2001 From: yxk2026 <10178404+yxk2026@user.noreply.gitee.com> Date: Wed, 10 Jul 2024 11:38:20 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=80=E5=A4=9A=E8=82=A1=E7=A5=A8=E7=B1=BBro?= =?UTF-8?q?uter=E6=94=B9=E4=B8=BAnavigation?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../main/ets/constants/ListDataConstants.ets | 6 +- .../ets/pages/AdaptiveTabCenteringIndex.ets | 132 +++++----- .../pages/DoubleTabAdaptiveCenteringIndex.ets | 245 +++++++++--------- entry/src/main/ets/pages/Index.ets | 22 +- .../ets/pages/TableAdaptiveExtensionIndex.ets | 216 +++++++-------- .../resources/base/profile/main_pages.json | 5 +- 6 files changed, 321 insertions(+), 305 deletions(-) diff --git a/entry/src/main/ets/constants/ListDataConstants.ets b/entry/src/main/ets/constants/ListDataConstants.ets index 68f34f9..dff5924 100644 --- a/entry/src/main/ets/constants/ListDataConstants.ets +++ b/entry/src/main/ets/constants/ListDataConstants.ets @@ -20,17 +20,17 @@ export class ListDataConstants { /** * Tab adaptive uri. */ - static readonly TAB_ADAPTIVE_URI: string = 'pages/AdaptiveTabCenteringIndex'; + static readonly TAB_ADAPTIVE_URI: string = 'AdaptiveTabCenteringIndex'; /** * Table adaptive uri. */ - static readonly TABLE_ADAPTIVE_URI: string = 'pages/TableAdaptiveExtensionIndex'; + static readonly TABLE_ADAPTIVE_URI: string = 'TableAdaptiveExtensionIndex'; /** * Double tab adaptive uri. */ - static readonly DOUBLE_TAB_ADAPTIVE_URI: string = 'pages/DoubleTabAdaptiveCenteringIndex'; + static readonly DOUBLE_TAB_ADAPTIVE_URI: string = 'DoubleTabAdaptiveCenteringIndex'; /** * Recommendation tab list. diff --git a/entry/src/main/ets/pages/AdaptiveTabCenteringIndex.ets b/entry/src/main/ets/pages/AdaptiveTabCenteringIndex.ets index 1b8673c..d3ed4fd 100644 --- a/entry/src/main/ets/pages/AdaptiveTabCenteringIndex.ets +++ b/entry/src/main/ets/pages/AdaptiveTabCenteringIndex.ets @@ -13,89 +13,91 @@ * limitations under the License. */ -import { router } from '@kit.ArkUI'; import { ListDataConstants } from '../constants/ListDataConstants'; import { CommonConstants } from '../constants/CommonConstants'; import { BreakpointType } from '../utils/BreakpointType'; -@Entry @Component export struct AdaptiveTabCenteringIndex { @StorageLink('breakPoint') breakPoint: string = CommonConstants.BREAK_POINT_SM; + @Consume('pageInfos') pageInfos: NavPathStack; @State tabIndexSelected: number = 0; build() { - Column() { - Row() { - Image($r('app.media.icon_back')) - .width($r('app.float.image_width')) - .height($r('app.float.image_height')) - .onClick(() => { - router.back(); - }) - } - .width(CommonConstants.FULL_WIDTH_PERCENT) - .margin({ - left: $r('app.float.back_margin_left'), - top: $r('app.float.back_margin_top') - }) - .justifyContent(FlexAlign.Start) - + NavDestination() { Column() { Row() { - Column() { - List({ - space: new BreakpointType(CommonConstants.TAB_PADDING_SM, CommonConstants.TAB_PADDING_MD, - CommonConstants.TAB_PADDING_LG).getValue(this.breakPoint) - }) { - ForEach(ListDataConstants.RECOMMENDATION_TAB_LIST, (item: string, index: number) => { - ListItem() { - Column() { - Text(item) - .fontSize($r('app.float.font_size_16')) - .fontWeight(CommonConstants.FONT_WEIGHT_500) - .fontColor(this.tabIndexSelected === index ? $r('app.color.red') : $r('app.color.black')) - .height($r('app.float.text_height')) - .focusable(true) - .groupDefaultFocus(index === 0 ? true : false) - } - } - .margin({ - top: $r('app.float.recommendation_margin_top'), - bottom: $r('app.float.recommendation_margin_bottom') - }) - .border({ - width: { - bottom: this.tabIndexSelected === index ? - $r('app.float.bottom_width_2') : $r('app.float.bottom_width_0') - }, - color: { - bottom: this.tabIndexSelected === index ? $r('app.color.red') : '' - }, - style: { - bottom: BorderStyle.Solid + Image($r('app.media.icon_back')) + .width($r('app.float.image_width')) + .height($r('app.float.image_height')) + .onClick(() => { + this.pageInfos.pop(); + }) + } + .width(CommonConstants.FULL_WIDTH_PERCENT) + .margin({ + left: $r('app.float.back_margin_left'), + top: $r('app.float.back_margin_top') + }) + .justifyContent(FlexAlign.Start) + + Column() { + Row() { + Column() { + List({ + space: new BreakpointType(CommonConstants.TAB_PADDING_SM, CommonConstants.TAB_PADDING_MD, + CommonConstants.TAB_PADDING_LG).getValue(this.breakPoint) + }) { + ForEach(ListDataConstants.RECOMMENDATION_TAB_LIST, (item: string, index: number) => { + ListItem() { + Column() { + Text(item) + .fontSize($r('app.float.font_size_16')) + .fontWeight(CommonConstants.FONT_WEIGHT_500) + .fontColor(this.tabIndexSelected === index ? $r('app.color.red') : $r('app.color.black')) + .height($r('app.float.text_height')) + .focusable(true) + .groupDefaultFocus(index === 0 ? true : false) + } } - }) - .onClick(() => { - this.tabIndexSelected = index; - }) - }, (item: string, index: number) => index + JSON.stringify(item)) + .margin({ + top: $r('app.float.recommendation_margin_top'), + bottom: $r('app.float.recommendation_margin_bottom') + }) + .border({ + width: { + bottom: this.tabIndexSelected === index ? + $r('app.float.bottom_width_2') : $r('app.float.bottom_width_0') + }, + color: { + bottom: this.tabIndexSelected === index ? $r('app.color.red') : '' + }, + style: { + bottom: BorderStyle.Solid + } + }) + .onClick(() => { + this.tabIndexSelected = index; + }) + }, (item: string, index: number) => index + JSON.stringify(item)) + } + .scrollBar(BarState.Off) + .listDirection(Axis.Horizontal) } - .scrollBar(BarState.Off) - .listDirection(Axis.Horizontal) + .width($r('app.float.width_296')) + .height($r('app.float.height_56')) + .backgroundColor($r('app.color.adaptive_tab_background')) + .justifyContent(FlexAlign.Center) + .alignItems(HorizontalAlign.Center) + .layoutWeight(CommonConstants.COMMON_FAL_1) } - .width($r('app.float.width_296')) .height($r('app.float.height_56')) - .backgroundColor($r('app.color.adaptive_tab_background')) - .justifyContent(FlexAlign.Center) - .alignItems(HorizontalAlign.Center) - .layoutWeight(CommonConstants.COMMON_FAL_1) + .width(CommonConstants.FULL_WIDTH_PERCENT) } - .height($r('app.float.height_56')) - .width(CommonConstants.FULL_WIDTH_PERCENT) + .height(CommonConstants.NINETY_PERCENT) + .justifyContent(FlexAlign.Center) } - .height(CommonConstants.NINETY_PERCENT) - .justifyContent(FlexAlign.Center) } + .hideTitleBar(true) } } \ No newline at end of file diff --git a/entry/src/main/ets/pages/DoubleTabAdaptiveCenteringIndex.ets b/entry/src/main/ets/pages/DoubleTabAdaptiveCenteringIndex.ets index f48fedd..8793b52 100644 --- a/entry/src/main/ets/pages/DoubleTabAdaptiveCenteringIndex.ets +++ b/entry/src/main/ets/pages/DoubleTabAdaptiveCenteringIndex.ets @@ -13,152 +13,155 @@ * limitations under the License. */ -import { router } from '@kit.ArkUI'; import { ListDataConstants } from '../constants/ListDataConstants'; import { CommonConstants } from '../constants/CommonConstants'; import { BreakpointType } from '../utils/BreakpointType'; -@Entry @Component -export struct AdaptiveTabCenteringIndex { +export struct DoubleTabAdaptiveCenteringIndex { @StorageLink('breakPoint') breakPoint: string = CommonConstants.BREAK_POINT_SM; + @Consume('pageInfos') pageInfos: NavPathStack; @State tabIndexSelected: number = 0; @State tabIndexSelected2: number = 0; build() { - Column() { - Row() { - Image($r('app.media.icon_back')) - .width($r('app.float.image_width')) - .height($r('app.float.image_height')) - .onClick(() => { - router.back(); - }) - } - .width(CommonConstants.FULL_WIDTH_PERCENT) - .margin({ - left: $r('app.float.back_margin_left'), - top: $r('app.float.back_margin_top') - }) - .justifyContent(FlexAlign.Start) - + NavDestination() { Column() { Row() { - Column() { - List({ - space: new BreakpointType(CommonConstants.DOUBLE_TAB_PADDING_SM, CommonConstants.DOUBLE_TAB_PADDING_MD1, - CommonConstants.DOUBLE_TAB_PADDING_LG1).getValue(this.breakPoint) - }) { - ForEach(ListDataConstants.STOCK_OPTIONS_LIST1, (item: string, index: number) => { - ListItem() { - Column() { - Text(item) - .fontSize($r('app.float.font_size_16')) - .fontWeight(CommonConstants.FONT_WEIGHT_500) - .fontColor(this.tabIndexSelected === index ? $r('app.color.red') : $r('app.color.black')) - .height($r('app.float.text_height')) - .width($r('app.float.text_width')) - .focusable(true) - .groupDefaultFocus(index === 0 ? true : false) - } - } - .margin({ top: $r('app.float.stock_options_margin') }) - .border({ - width: { - bottom: this.tabIndexSelected === index ? - $r('app.float.bottom_width_2') : $r('app.float.bottom_width_0') - }, - color: { - bottom: this.tabIndexSelected === index ? $r('app.color.red') : '' - }, - style: { - bottom: BorderStyle.Solid - } - }) - .onClick(() => { - this.tabIndexSelected = index; - }) - }, (item: string, index: number) => index + JSON.stringify(item)) - - ListItem() { - Image($r('app.media.ic_public_more')) - .width($r('app.float.image_width')) - .height($r('app.float.image_height')) - } - .margin({ top: $r('app.float.more_margin_top') }) - .visibility(this.breakPoint === CommonConstants.BREAK_POINT_LG ? Visibility.Visible : Visibility.Hidden) - } - .scrollBar(BarState.Off) - .listDirection(Axis.Horizontal) - } - .width($r('app.float.width_296')) - .height($r('app.float.height_56')) - .margin({ left: $r('app.float.stock_column_margin') }) - .justifyContent(FlexAlign.Center) - .alignItems(HorizontalAlign.Center) - .layoutWeight(CommonConstants.COMMON_FAL_1) - - Image($r('app.media.ic_public_more')) + Image($r('app.media.icon_back')) .width($r('app.float.image_width')) .height($r('app.float.image_height')) - .margin({ - left: $r('app.float.more_margin_left'), - right: $r('app.float.more_margin_right') + .onClick(() => { + this.pageInfos.pop(); }) - .visibility(this.breakPoint === CommonConstants.BREAK_POINT_LG ? Visibility.Hidden : Visibility.Visible) } - .height($r('app.float.height_56')) .width(CommonConstants.FULL_WIDTH_PERCENT) + .margin({ + left: $r('app.float.back_margin_left'), + top: $r('app.float.back_margin_top') + }) + .justifyContent(FlexAlign.Start) - Row() { - Column() { - List({ - space: new BreakpointType(CommonConstants.DOUBLE_TAB_PADDING_SM, CommonConstants.DOUBLE_TAB_PADDING_MD2, - CommonConstants.DOUBLE_TAB_PADDING_LG2).getValue(this.breakPoint) - }) { - ForEach(ListDataConstants.STOCK_OPTIONS_LIST2, (item: string, index: number) => { - ListItem() { - Column() { - Text(item) - .fontSize($r('app.float.font_size_14')) - .fontWeight(CommonConstants.FONT_WEIGHT_500) - .fontColor( - this.tabIndexSelected2 === index ? $r('app.color.selected_text_color') : $r('app.color.black') - ) - .margin({ - top: $r('app.float.text_margin_top_and_bottom'), - bottom: $r('app.float.text_margin_top_and_bottom'), - left: $r('app.float.text_margin_left_and_right'), - right: $r('app.float.text_margin_left_and_right') - }) - .textAlign(TextAlign.Center) - .focusable(true) - .groupDefaultFocus(index === 0 ? true : false) + Column() { + Row() { + Column() { + List({ + space: new BreakpointType(CommonConstants.DOUBLE_TAB_PADDING_SM, CommonConstants.DOUBLE_TAB_PADDING_MD1, + CommonConstants.DOUBLE_TAB_PADDING_LG1).getValue(this.breakPoint) + }) { + ForEach(ListDataConstants.STOCK_OPTIONS_LIST1, (item: string, index: number) => { + ListItem() { + Column() { + Text(item) + .fontSize($r('app.float.font_size_16')) + .fontWeight(CommonConstants.FONT_WEIGHT_500) + .fontColor(this.tabIndexSelected === index ? $r('app.color.red') : $r('app.color.black')) + .height($r('app.float.text_height')) + .width($r('app.float.text_width')) + .focusable(true) + .groupDefaultFocus(index === 0 ? true : false) + } } + .margin({ top: $r('app.float.stock_options_margin') }) + .border({ + width: { + bottom: this.tabIndexSelected === index ? + $r('app.float.bottom_width_2') : $r('app.float.bottom_width_0') + }, + color: { + bottom: this.tabIndexSelected === index ? $r('app.color.red') : '' + }, + style: { + bottom: BorderStyle.Solid + } + }) + .onClick(() => { + this.tabIndexSelected = index; + }) + }, (item: string, index: number) => index + JSON.stringify(item)) + + ListItem() { + Image($r('app.media.ic_public_more')) + .width($r('app.float.image_width')) + .height($r('app.float.image_height')) } - .backgroundColor( - this.tabIndexSelected2 === index ? $r('app.color.selected_text_background') : $r('app.color.text_background') - ) - .border({ radius: CommonConstants.BORDER_RADIUS }) - .onClick(() => { - this.tabIndexSelected2 = index; - }) - }, (item: string, index: number) => index + JSON.stringify(item)) + .margin({ top: $r('app.float.more_margin_top') }) + .visibility(this.breakPoint === CommonConstants.BREAK_POINT_LG ? Visibility.Visible : Visibility.Hidden) + } + .scrollBar(BarState.Off) + .listDirection(Axis.Horizontal) + } + .width($r('app.float.width_296')) + .height($r('app.float.height_56')) + .margin({ left: $r('app.float.stock_column_margin') }) + .justifyContent(FlexAlign.Center) + .alignItems(HorizontalAlign.Center) + .layoutWeight(CommonConstants.COMMON_FAL_1) + + Image($r('app.media.ic_public_more')) + .width($r('app.float.image_width')) + .height($r('app.float.image_height')) + .margin({ + left: $r('app.float.more_margin_left'), + right: $r('app.float.more_margin_right') + }) + .visibility(this.breakPoint === CommonConstants.BREAK_POINT_LG ? Visibility.Hidden : Visibility.Visible) + } + .height($r('app.float.height_56')) + .width(CommonConstants.FULL_WIDTH_PERCENT) + + Row() { + Column() { + List({ + space: new BreakpointType(CommonConstants.DOUBLE_TAB_PADDING_SM, CommonConstants.DOUBLE_TAB_PADDING_MD2, + CommonConstants.DOUBLE_TAB_PADDING_LG2).getValue(this.breakPoint) + }) { + ForEach(ListDataConstants.STOCK_OPTIONS_LIST2, (item: string, index: number) => { + ListItem() { + Column() { + Text(item) + .fontSize($r('app.float.font_size_14')) + .fontWeight(CommonConstants.FONT_WEIGHT_500) + .fontColor( + this.tabIndexSelected2 === index ? $r('app.color.selected_text_color') : $r('app.color.black') + ) + .margin({ + top: $r('app.float.text_margin_top_and_bottom'), + bottom: $r('app.float.text_margin_top_and_bottom'), + left: $r('app.float.text_margin_left_and_right'), + right: $r('app.float.text_margin_left_and_right') + }) + .textAlign(TextAlign.Center) + .focusable(true) + .groupDefaultFocus(index === 0 ? true : false) + } + } + .backgroundColor( + this.tabIndexSelected2 === index ? $r('app.color.selected_text_background') : + $r('app.color.text_background') + ) + .border({ radius: CommonConstants.BORDER_RADIUS }) + .onClick(() => { + this.tabIndexSelected2 = index; + }) + }, (item: string, index: number) => index + JSON.stringify(item)) + } + .scrollBar(BarState.Off) + .listDirection(Axis.Horizontal) } - .scrollBar(BarState.Off) - .listDirection(Axis.Horizontal) + .width($r('app.float.width_296')) + .height($r('app.float.height_56')) + .justifyContent(FlexAlign.Center) + .alignItems(HorizontalAlign.Center) + .layoutWeight(CommonConstants.COMMON_FAL_1) } - .width($r('app.float.width_296')) .height($r('app.float.height_56')) - .justifyContent(FlexAlign.Center) - .alignItems(HorizontalAlign.Center) - .layoutWeight(CommonConstants.COMMON_FAL_1) + .width(CommonConstants.FULL_WIDTH_PERCENT) } - .height($r('app.float.height_56')) - .width(CommonConstants.FULL_WIDTH_PERCENT) + .height(CommonConstants.NINETY_PERCENT) + .justifyContent(FlexAlign.Center) } - .height(CommonConstants.NINETY_PERCENT) - .justifyContent(FlexAlign.Center) } + .hideTitleBar(true) } } \ No newline at end of file diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index f770cd5..75fb8f9 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -13,9 +13,11 @@ * limitations under the License. */ -import { router } from '@kit.ArkUI'; import { CommonConstants } from '../constants/CommonConstants'; import { ListDataConstants } from '../constants/ListDataConstants'; +import { AdaptiveTabCenteringIndex } from './AdaptiveTabCenteringIndex'; +import { TableAdaptiveExtensionIndex } from './TableAdaptiveExtensionIndex'; +import { DoubleTabAdaptiveCenteringIndex } from './DoubleTabAdaptiveCenteringIndex'; class DirectoryItem { title: ResourceStr = ''; @@ -27,6 +29,7 @@ class DirectoryItem { @Component struct Index { @StorageLink('breakPoint') breakPoint: string = CommonConstants.BREAK_POINT_SM; + @Provide('pageInfos') pageInfos : NavPathStack = new NavPathStack(); private title: string | Resource = $r('app.string.title'); private directory: DirectoryItem[] = [ { @@ -46,6 +49,16 @@ struct Index { } ]; + @Builder PageMap(name : string){ + if(name === ListDataConstants.TAB_ADAPTIVE_URI){ + AdaptiveTabCenteringIndex() + }else if(name === ListDataConstants.TABLE_ADAPTIVE_URI){ + TableAdaptiveExtensionIndex() + }else{ + DoubleTabAdaptiveCenteringIndex() + } + } + build() { GridRow({ breakpoints: { @@ -67,7 +80,7 @@ struct Index { } }) { Column() { - Navigation() { + Navigation(this.pageInfos) { Column() { Text(this.title) @@ -80,14 +93,13 @@ struct Index { .margin($r('app.float.button_margin')) .backgroundColor($r('app.color.button_background')) .onClick(() => { - router.pushUrl({ - url: item.uri - }); + this.pageInfos.pushPath(new NavPathInfo(item.uri,[])); }) }, (item: DirectoryItem) => JSON.stringify(item)) } .width(CommonConstants.FULL_WIDTH_PERCENT) } + .navDestination(this.PageMap) .mode(NavigationMode.Stack) .hideBackButton(true) .titleMode(NavigationTitleMode.Mini) diff --git a/entry/src/main/ets/pages/TableAdaptiveExtensionIndex.ets b/entry/src/main/ets/pages/TableAdaptiveExtensionIndex.ets index 3d4e6b2..f4d6f97 100644 --- a/entry/src/main/ets/pages/TableAdaptiveExtensionIndex.ets +++ b/entry/src/main/ets/pages/TableAdaptiveExtensionIndex.ets @@ -13,14 +13,13 @@ * limitations under the License. */ -import { router } from '@kit.ArkUI'; import { ListDataConstants } from '../constants/ListDataConstants'; import { CommonConstants } from '../constants/CommonConstants'; -@Entry @Component -export struct AdaptiveTabCenteringIndex { +export struct TableAdaptiveExtensionIndex { @StorageLink('breakPoint') breakPoint: string = CommonConstants.BREAK_POINT_SM; + @Consume('pageInfos') pageInfos: NavPathStack; @State tabIndexSelected: number = 0; @Builder @@ -37,130 +36,133 @@ export struct AdaptiveTabCenteringIndex { } build() { - Column() { - Row() { - Image($r('app.media.icon_back')) - .width($r('app.float.image_width')) - .height($r('app.float.image_height')) - .onClick(() => { - router.back(); - }) - } - .width(CommonConstants.FULL_WIDTH_PERCENT) - .margin({ - left: $r('app.float.back_margin_left'), - top: $r('app.float.back_margin_top') - }) - .justifyContent(FlexAlign.Start) - - Row() { - if (this.breakPoint === CommonConstants.BREAK_POINT_LG) { - Column() { - // Left Placeholder Area - } - .width(CommonConstants.FIFTY_PERCENT) - .height(CommonConstants.FULL_WIDTH_PERCENT) - .border({ - width: { right: 1 }, - color: { right: Color.Gray }, - style: { right: BorderStyle.Solid } - }) + NavDestination() { + Column() { + Row() { + Image($r('app.media.icon_back')) + .width($r('app.float.image_width')) + .height($r('app.float.image_height')) + .onClick(() => { + this.pageInfos.pop(); + }) } - Column() { - Row() { + .width(CommonConstants.FULL_WIDTH_PERCENT) + .margin({ + left: $r('app.float.back_margin_left'), + top: $r('app.float.back_margin_top') + }) + .justifyContent(FlexAlign.Start) + + Row() { + if (this.breakPoint === CommonConstants.BREAK_POINT_LG) { Column() { - Row() { - ForEach(ListDataConstants.INDICATOR_NAME_LIST, (item: string, index: number) => { - Column() { - Row() { - Text(item) - .fontSize($r('app.float.font_size_14')) - .fontWeight(CommonConstants.FONT_WEIGHT_500) - .fontColor(Color.Black) - .height($r('app.float.text_height')) - Image(index > 0 ? $r('app.media.ic_public_right') : $r('app.media.ic_public_info')) - .width($r('app.float.icon_size')) - .height($r('app.float.icon_size')) + // Left Placeholder Area + } + .width(CommonConstants.FIFTY_PERCENT) + .height(CommonConstants.FULL_WIDTH_PERCENT) + .border({ + width: { right: 1 }, + color: { right: Color.Gray }, + style: { right: BorderStyle.Solid } + }) + } + Column() { + Row() { + Column() { + Row() { + ForEach(ListDataConstants.INDICATOR_NAME_LIST, (item: string, index: number) => { + Column() { + Row() { + Text(item) + .fontSize($r('app.float.font_size_14')) + .fontWeight(CommonConstants.FONT_WEIGHT_500) + .fontColor(Color.Black) + .height($r('app.float.text_height')) + Image(index > 0 ? $r('app.media.ic_public_right') : $r('app.media.ic_public_info')) + .width($r('app.float.icon_size')) + .height($r('app.float.icon_size')) + } + + if (index > 0) { + Text('60**39') + .fontSize(CommonConstants.TEXT_FONT_SIZE) + .fontWeight(CommonConstants.FONT_WEIGHT_500) + .fontColor($r('app.color.text_font_color')) + .height($r('app.float.text_height')) + } } + .flexShrink(CommonConstants.COMMON_FAL_1) + .width(index === 0 ? $r('app.float.indicator_name_width') : 'auto') + .alignItems(HorizontalAlign.Start) - if (index > 0) { - Text('60**39') - .fontSize(CommonConstants.TEXT_FONT_SIZE) - .fontWeight(CommonConstants.FONT_WEIGHT_500) - .fontColor($r('app.color.text_font_color')) - .height($r('app.float.text_height')) + if (index < 3) { + Blank() } - } - .flexShrink(CommonConstants.COMMON_FAL_1) - .width(index === 0 ? $r('app.float.indicator_name_width') : 'auto') - .alignItems(HorizontalAlign.Start) - - if (index < 3) { - Blank() - } - }, (item: string, index: number) => index + JSON.stringify(item)) - } - .height($r('app.float.indicator_name_height')) - .width(CommonConstants.FULL_WIDTH_PERCENT) - .justifyContent(FlexAlign.SpaceBetween) - - Divider() - .color($r('app.color.text_font_color')) - - Row() { - Column() { - ForEach(ListDataConstants.INDICATOR_NAME_COLUMN, (item: string, index: number) => { - this.Item(item, index, CommonConstants.GRAY_FONT_FLAG) }, (item: string, index: number) => index + JSON.stringify(item)) } - .alignItems(HorizontalAlign.Start) + .height($r('app.float.indicator_name_height')) + .width(CommonConstants.FULL_WIDTH_PERCENT) + .justifyContent(FlexAlign.SpaceBetween) - Blank() + Divider() + .color($r('app.color.text_font_color')) - Column() { - ForEach(ListDataConstants.STOCK_INDEX_DATA1, (item: string, index: number) => { - this.Item(item, index, CommonConstants.RED_FONT_FLAG) - }, (item: string, index: number) => index + JSON.stringify(item)) - } - .width($r('app.float.stock_data_width')) - .alignItems(HorizontalAlign.End) + Row() { + Column() { + ForEach(ListDataConstants.INDICATOR_NAME_COLUMN, (item: string, index: number) => { + this.Item(item, index, CommonConstants.GRAY_FONT_FLAG) + }, (item: string, index: number) => index + JSON.stringify(item)) + } + .alignItems(HorizontalAlign.Start) - Blank() + Blank() - Column() { - ForEach(ListDataConstants.STOCK_INDEX_DATA2, (item: string, index: number) => { - this.Item(item, index, CommonConstants.RED_FONT_FLAG) - }, (item: string, index: number) => index + JSON.stringify(item)) - } - .width($r('app.float.stock_data_width')) - .alignItems(HorizontalAlign.End) + Column() { + ForEach(ListDataConstants.STOCK_INDEX_DATA1, (item: string, index: number) => { + this.Item(item, index, CommonConstants.RED_FONT_FLAG) + }, (item: string, index: number) => index + JSON.stringify(item)) + } + .width($r('app.float.stock_data_width')) + .alignItems(HorizontalAlign.End) - Blank() + Blank() - Column() { - ForEach(ListDataConstants.STOCK_INDEX_DATA3, (item: string, index: number) => { - this.Item(item, index, CommonConstants.RED_FONT_FLAG) - }, (item: string, index: number) => index + JSON.stringify(item)) + Column() { + ForEach(ListDataConstants.STOCK_INDEX_DATA2, (item: string, index: number) => { + this.Item(item, index, CommonConstants.RED_FONT_FLAG) + }, (item: string, index: number) => index + JSON.stringify(item)) + } + .width($r('app.float.stock_data_width')) + .alignItems(HorizontalAlign.End) + + Blank() + + Column() { + ForEach(ListDataConstants.STOCK_INDEX_DATA3, (item: string, index: number) => { + this.Item(item, index, CommonConstants.RED_FONT_FLAG) + }, (item: string, index: number) => index + JSON.stringify(item)) + } + .width($r('app.float.stock_data_width')) + .alignItems(HorizontalAlign.End) } - .width($r('app.float.stock_data_width')) - .alignItems(HorizontalAlign.End) + .width(CommonConstants.FULL_WIDTH_PERCENT) + .margin({ top: $r('app.float.indicator_name_margin') }) } - .width(CommonConstants.FULL_WIDTH_PERCENT) - .margin({ top: $r('app.float.indicator_name_margin') }) } } - } - .height(CommonConstants.EIGHTY_PERCENT) - .width(this.breakPoint === CommonConstants.BREAK_POINT_LG ? + .height(CommonConstants.EIGHTY_PERCENT) + .width(this.breakPoint === CommonConstants.BREAK_POINT_LG ? CommonConstants.FIFTY_PERCENT : CommonConstants.FULL_WIDTH_PERCENT) - .justifyContent(this.breakPoint === CommonConstants.BREAK_POINT_LG ? FlexAlign.End : FlexAlign.Center) - .padding({ - left: $r('app.float.stock_data_margin'), - right: $r('app.float.stock_data_margin') - }) + .justifyContent(this.breakPoint === CommonConstants.BREAK_POINT_LG ? FlexAlign.End : FlexAlign.Center) + .padding({ + left: $r('app.float.stock_data_margin'), + right: $r('app.float.stock_data_margin') + }) + } + .width(CommonConstants.FULL_WIDTH_PERCENT) } - .width(CommonConstants.FULL_WIDTH_PERCENT) } + .hideTitleBar(true) } } \ No newline at end of file diff --git a/entry/src/main/resources/base/profile/main_pages.json b/entry/src/main/resources/base/profile/main_pages.json index c9c0e0f..1898d94 100644 --- a/entry/src/main/resources/base/profile/main_pages.json +++ b/entry/src/main/resources/base/profile/main_pages.json @@ -1,8 +1,5 @@ { "src": [ - "pages/Index", - "pages/AdaptiveTabCenteringIndex", - "pages/TableAdaptiveExtensionIndex", - "pages/DoubleTabAdaptiveCenteringIndex" + "pages/Index" ] } -- Gitee