Feat: 添加跳转计算 BMI 按钮

This commit is contained in:
2025-12-23 17:06:02 +08:00
parent a6a0d26737
commit a66c7d2d85
2 changed files with 28 additions and 8 deletions
+1 -1
View File
@@ -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('系统提示:跳转成功')
})
+20
View File
@@ -7,6 +7,7 @@ struct Index {
private scroller: Scroller = new Scroller();
build() {
Stack() {
Scroll(this.scroller) {
Column() {
Module0()
@@ -20,5 +21,24 @@ struct Index {
.height('100%')
.align(Alignment.Top)
.backgroundColor($r('app.color.page_bg_color'))
// 底部按钮
Column() {
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)
}
.width('100%')
.height('100%')
}
}