Feat: 添加跳转计算 BMI 按钮
This commit is contained in:
@@ -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('系统提示:跳转成功')
|
||||
})
|
||||
|
||||
@@ -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'))
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user