From a66c7d2d85538f1a1d860385e19d073cdd81cdc7 Mon Sep 17 00:00:00 2001 From: wonder Date: Tue, 23 Dec 2025 17:06:02 +0800 Subject: [PATCH] =?UTF-8?q?Feat:=20=E6=B7=BB=E5=8A=A0=E8=B7=B3=E8=BD=AC?= =?UTF-8?q?=E8=AE=A1=E7=AE=97=20BMI=20=E6=8C=89=E9=92=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/pages/Hello.ets | 2 +- entry/src/main/ets/pages/Index.ets | 34 ++++++++++++++++++++++++------ 2 files changed, 28 insertions(+), 8 deletions(-) diff --git a/entry/src/main/ets/pages/Hello.ets b/entry/src/main/ets/pages/Hello.ets index 7cad5d0..2964f9b 100644 --- a/entry/src/main/ets/pages/Hello.ets +++ b/entry/src/main/ets/pages/Hello.ets @@ -29,7 +29,7 @@ struct Hello { let uiContext: UIContext = this.getUIContext(); let router = uiContext.getRouter(); router.pushUrl({ - url: 'pages/Second' + url: 'pages/Text' }).then(() => { console.log('系统提示:跳转成功') }) diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index a90bd63..8d370a8 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -7,18 +7,38 @@ struct Index { private scroller: Scroller = new Scroller(); build() { - Scroll(this.scroller) { + Stack() { + Scroll(this.scroller) { + Column() { + Module0() + Module1() + } + .width('100%') + } + .scrollable(ScrollDirection.Vertical) + .scrollBar(BarState.Off) + .width('100%') + .height('100%') + .align(Alignment.Top) + .backgroundColor($r('app.color.page_bg_color')) + + // 底部按钮 Column() { - Module0() - Module1() + Button('[前往] 计算我的 BMI') + .width('80%') + .height(50) + .type(ButtonType.Capsule) + .fontSize(18) + .fontWeight(FontWeight.Medium) + .backgroundColor('#4C61E4') + .margin({ bottom: 20 }) } .width('100%') + .height('100%') + .justifyContent(FlexAlign.End) + .alignItems(HorizontalAlign.Center) } - .scrollable(ScrollDirection.Vertical) - .scrollBar(BarState.Off) .width('100%') .height('100%') - .align(Alignment.Top) - .backgroundColor($r('app.color.page_bg_color')) } }