Feat: 添加跳转计算 BMI 按钮
This commit is contained in:
@@ -29,7 +29,7 @@ struct Hello {
|
|||||||
let uiContext: UIContext = this.getUIContext();
|
let uiContext: UIContext = this.getUIContext();
|
||||||
let router = uiContext.getRouter();
|
let router = uiContext.getRouter();
|
||||||
router.pushUrl({
|
router.pushUrl({
|
||||||
url: 'pages/Second'
|
url: 'pages/Text'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
console.log('系统提示:跳转成功')
|
console.log('系统提示:跳转成功')
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -7,6 +7,7 @@ struct Index {
|
|||||||
private scroller: Scroller = new Scroller();
|
private scroller: Scroller = new Scroller();
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
|
Stack() {
|
||||||
Scroll(this.scroller) {
|
Scroll(this.scroller) {
|
||||||
Column() {
|
Column() {
|
||||||
Module0()
|
Module0()
|
||||||
@@ -20,5 +21,24 @@ struct Index {
|
|||||||
.height('100%')
|
.height('100%')
|
||||||
.align(Alignment.Top)
|
.align(Alignment.Top)
|
||||||
.backgroundColor($r('app.color.page_bg_color'))
|
.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%')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user