提交 e646b989 编写于 作者: Y yaocui

add new page

Signed-off-by: Nyaocui <yaocui2@h-partners.com>
上级 8e5f18f7
...@@ -8,11 +8,22 @@ ...@@ -8,11 +8,22 @@
"shell-timeout": "600000", "shell-timeout": "600000",
"testcase-timeout": 70000 "testcase-timeout": 70000
}, },
"kits": [{ "kits": [
{
"test-file-name": [ "test-file-name": [
"ActsWindowStageTest.hap" "ActsWindowStageTest.hap"
], ],
"type": "AppInstallKit", "type": "AppInstallKit",
"cleanup-apps": true "cleanup-apps": true
}] },
{
"type": "ShellKit",
"run-command": [
"param set persist.ace.testmode.enabled 1",
"reboot",
"uinput -T -d 300 600 -m 300 600 300 100 -u 300 100",
"power-shell setmode 602"
]
}
]
} }
\ No newline at end of file
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@Entry
@Component
struct PageOne {
private content: string = "Page one"
build() {
Row(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
Button() {
Text('点击pageOne')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
console.log("click the button")
})
}
.width('100%')
.height('100%')
}.width('100%')
.height('100%')
.backgroundColor("#69b594")
}
}
\ No newline at end of file
/*
* Copyright (c) 2021 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
@Entry
@Component
struct PageTwo {
private content: string = "Page two"
build() {
Row(){
Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`)
.fontSize(50)
.fontWeight(FontWeight.Bold)
TextInput({ placeholder: '请点击' })
.key('pageTwoinput')
.width(400)
.height(50)
.margin(10)
.borderRadius(0)
.style(TextInputStyle.Inline)
TextInput({ placeholder: '请点击' })
.key('pageTwoinputSecond')
.width(400)
.height(50)
.margin(10)
.borderRadius(0)
.style(TextInputStyle.Inline)
Button() {
Text('点击pageTwo')
.fontSize(20)
.fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule)
.margin({
top: 20
})
.backgroundColor('#0D9FFB')
.onClick(() => {
console.log("click the button")
})
}
.width('100%')
.height('100%')
}.width('100%')
.height('100%')
.backgroundColor("#ccc")
}
}
\ No newline at end of file
...@@ -20,12 +20,12 @@ struct Second { ...@@ -20,12 +20,12 @@ struct Second {
private content: string = "Second Page" private content: string = "Second Page"
build() { build() {
Flex({ direction: FlexDirection.Column,alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) { Flex({ direction: FlexDirection.Column, alignItems: ItemAlign.Center, justifyContent: FlexAlign.Center }) {
Text(`${this.content}`) Text(`${this.content}`)
.fontSize(50) .fontSize(50)
.fontWeight(FontWeight.Bold) .fontWeight(FontWeight.Bold)
Button() { Button() {
Text('back to index') Text('secondPage_BackToIndex')
.fontSize(20) .fontSize(20)
.fontWeight(FontWeight.Bold) .fontWeight(FontWeight.Bold)
}.type(ButtonType.Capsule) }.type(ButtonType.Capsule)
...@@ -39,5 +39,6 @@ struct Second { ...@@ -39,5 +39,6 @@ struct Second {
} }
.width('100%') .width('100%')
.height('100%') .height('100%')
.backgroundColor('#ccc')
} }
} }
\ No newline at end of file
{ {
"src": [ "src": [
"MainAbility/pages/index/index", "MainAbility/pages/index/index",
"MainAbility/pages/second/second" "MainAbility/pages/second/second",
"MainAbility/pages/second/pageOne",
"MainAbility/pages/second/pageTwo"
] ]
} }
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册