!3182 add deviceinfo pages of haptest

Merge pull request !3182 from 陈诺/0926
This commit is contained in:
openharmony_ci 2024-09-26 09:22:29 +00:00 committed by Gitee
commit 422a2f59ff
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
9 changed files with 611 additions and 0 deletions

View File

@ -0,0 +1,79 @@
/*
* Copyright (c) 2024 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.
*/
import router from '@ohos.router';
@Entry
@Component
struct AccessInfo {
@State message: string = '设备信息列表';
build() {
RelativeContainer() {
Column() {
Text(this.message)
.id('AccessInfoHelloWorld')
.fontWeight(FontWeight.Bold)
.alignRules({
center: { anchor: '__container__', align: VerticalAlign.Center },
middle: { anchor: '__container__', align: HorizontalAlign.Center }
})
//button
Button('获取设备类型')
.width('50%')
.height('50vp')
.onClick(()=>{
router.pushUrl({
url:"pages/deviceType"
})
})
Button('获取产品系列')
.width('50%')
.height('50vp')
.onClick(()=>{
router.pushUrl({
url:"pages/productSeries"
})
})
Button('获取设备生产厂家名称')
.width('50%')
.height('50vp')
.onClick(()=>{
router.pushUrl({
url:"pages/manufacture"
})
})
Button('获取设备品牌')
.width('50%')
.height('50vp')
.onClick(()=>{
router.pushUrl({
url:"pages/brand"
})
})
Button('获取设备序列号')
.width('50%')
.height('50vp')
.onClick(()=>{
router.pushUrl({
url:"pages/serial"
})
})
}
}
.height('100%')
.width('100%')
}
}

View File

@ -0,0 +1,50 @@
/*
* Copyright (c) 2024 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.
*/
import deviceInfo from '@ohos.deviceInfo';
import router from '@ohos.router';
@Entry
@Component
struct DeviceType {
@State message: string = '设备品牌';
build() {
RelativeContainer() {
Column() {
Text(deviceInfo.brand)
.id('brand')
.fontSize(50)
.fontWeight(FontWeight.Bold)
.alignRules({
center: { anchor: '__container__', align: VerticalAlign.Center },
middle: { anchor: '__container__', align: HorizontalAlign.Center }
})
Button('返回主界面')
.fontSize(30)
.width('50%')
.height('50vp')
.onClick(()=>{
router.pushUrl({
url:"pages/accessInfo"
})
})
}
}
.height('100%')
.width('100%')
}
}

View File

@ -0,0 +1,50 @@
/*
* Copyright (c) 2024 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.
*/
import deviceInfo from '@ohos.deviceInfo';
import router from '@ohos.router';
@Entry
@Component
struct DeviceType {
@State message: string = '设备类型';
build() {
RelativeContainer() {
Column() {
Text(deviceInfo.deviceType)
.id('DeviceTypeHelloWorld')
.fontSize(50)
.fontWeight(FontWeight.Bold)
.alignRules({
center: { anchor: '__container__', align: VerticalAlign.Center },
middle: { anchor: '__container__', align: HorizontalAlign.Center }
})
Button('返回主界面')
.fontSize(30)
.width('50%')
.height('50vp')
.onClick(()=>{
router.pushUrl({
url:"pages/accessInfo"
})
})
}
}
.height('100%')
.width('100%')
}
}

View File

@ -0,0 +1,50 @@
/*
* Copyright (c) 2024 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.
*/
import deviceInfo from '@ohos.deviceInfo';
import router from '@ohos.router';
@Entry
@Component
struct DeviceType {
@State message: string = '设备生产厂家';
build() {
RelativeContainer() {
Column() {
Text(deviceInfo.manufacture)
.id('manufacture')
.fontSize(50)
.fontWeight(FontWeight.Bold)
.alignRules({
center: { anchor: '__container__', align: VerticalAlign.Center },
middle: { anchor: '__container__', align: HorizontalAlign.Center }
})
Button('返回主界面')
.fontSize(30)
.width('50%')
.height('50vp')
.onClick(()=>{
router.pushUrl({
url:"pages/accessInfo"
})
})
}
}
.height('100%')
.width('100%')
}
}

View File

@ -0,0 +1,94 @@
/*
* Copyright (c) 2024 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.
*/
import deviceInfo from '@ohos.deviceInfo';
import router from '@ohos.router';
@Entry
@Component
struct Index {
@State DispalyText: string = '';
@State TitleText: string = '显示内容';
build() {
Column() {
Text()
.width('100%')
.height(100)
.fontSize(24)
.fontWeight(FontWeight.Bold)
.margin({ left: '30vp'})
Column() {
Text(this.TitleText)
.fontColor('#99182431')
.fontSize($r('sys.float.ohos_id_text_size_sub_title3'))
.margin({ top: '30vp', left: '24vp', bottom: '9.5vp' })
}
.width('100%')
.height('60vp')
.alignItems(HorizontalAlign.Start)
Column() {
Column() {
Scroll() {
Text(this.DispalyText)
.fontColor('#182431')
.fontSize($r('sys.float.ohos_id_text_size_body1'))
.lineHeight('19vp')
.textAlign(TextAlign.Start)
.width('100%')
}
.margin({ top: '8vp', left: '16vp', right: '16vp', bottom: '21vp' })
}
.height('350vp')
.backgroundColor('#FFFFFF')
.borderRadius($r('sys.float.ohos_id_corner_radius_default_l'))
.margin({ left: '12vp', right: '12vp' })
.align(Alignment.TopStart)
}
.width('100%')
.height('139vp')
.alignItems(HorizontalAlign.Center)
Row() {
Button('CheckSysIntegrity', { type: ButtonType.Capsule, stateEffect: true })
.borderRadius(8)
.backgroundColor(0x317aff)
.width('40%')
.height('7%')
.margin({ top: '10vp', left: '16vp', right: '16vp', bottom: '21vp' })
.onClick(() => {
this.TitleText = '认证型号';
this.DispalyText = deviceInfo.productModel;
})
Button('CheckUrlThreat', { type: ButtonType.Capsule, stateEffect: true })
.borderRadius(8)
.backgroundColor(0x317aff)
.width('40%')
.height('7%')
.margin({ top: '10vp', left: '16vp', right: '16vp', bottom: '21vp' })
.onClick(() => {
this.TitleText = '设备类型';
this.DispalyText = deviceInfo.deviceType;
})
}
.height('600vp')
.width('100%')
}
.height('100%')
.backgroundColor('#F1F3F5')
}
}

View File

@ -0,0 +1,50 @@
/*
* Copyright (c) 2024 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.
*/
import deviceInfo from '@ohos.deviceInfo';
import router from '@ohos.router';
@Entry
@Component
struct DeviceType {
@State message: string = '设备产品序列';
build() {
RelativeContainer() {
Column() {
Text(deviceInfo.productSeries)
.id('productSeries')
.fontSize(50)
.fontWeight(FontWeight.Bold)
.alignRules({
center: { anchor: '__container__', align: VerticalAlign.Center },
middle: { anchor: '__container__', align: HorizontalAlign.Center }
})
Button('返回主界面')
.fontSize(30)
.width('50%')
.height('50vp')
.onClick(()=>{
router.pushUrl({
url:"pages/accessInfo"
})
})
}
}
.height('100%')
.width('100%')
}
}

View File

@ -0,0 +1,50 @@
/*
* Copyright (c) 2024 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.
*/
import deviceInfo from '@ohos.deviceInfo';
import router from '@ohos.router';
@Entry
@Component
struct DeviceType {
@State message: string = '设备序列';
build() {
RelativeContainer() {
Column() {
Text(deviceInfo.serial)
.id('serial')
.fontSize(50)
.fontWeight(FontWeight.Bold)
.alignRules({
center: { anchor: '__container__', align: VerticalAlign.Center },
middle: { anchor: '__container__', align: HorizontalAlign.Center }
})
Button('返回主界面')
.fontSize(30)
.width('50%')
.height('50vp')
.onClick(()=>{
router.pushUrl({
url:"pages/accessInfo"
})
})
}
}
.height('100%')
.width('100%')
}
}

View File

@ -0,0 +1,94 @@
/*
* Copyright (c) 2024 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.
*/
import deviceInfo from '@ohos.deviceInfo';
import router from '@ohos.router';
@Entry
@Component
struct Index {
@State DispalyText: string = '';
@State TitleText: string = '显示内容';
build() {
Column() {
Text()
.width('100%')
.height(100)
.fontSize(24)
.fontWeight(FontWeight.Bold)
.margin({ left: '30vp'})
Column() {
Text(this.TitleText)
.fontColor('#99182431')
.fontSize($r('sys.float.ohos_id_text_size_sub_title3'))
.margin({ top: '30vp', left: '24vp', bottom: '9.5vp' })
}
.width('100%')
.height('60vp')
.alignItems(HorizontalAlign.Start)
Column() {
Column() {
Scroll() {
Text(this.DispalyText)
.fontColor('#182431')
.fontSize($r('sys.float.ohos_id_text_size_body1'))
.lineHeight('19vp')
.textAlign(TextAlign.Start)
.width('100%')
}
.margin({ top: '8vp', left: '16vp', right: '16vp', bottom: '21vp' })
}
.height('350vp')
.backgroundColor('#FFFFFF')
.borderRadius($r('sys.float.ohos_id_corner_radius_default_l'))
.margin({ left: '12vp', right: '12vp' })
.align(Alignment.TopStart)
}
.width('100%')
.height('139vp')
.alignItems(HorizontalAlign.Center)
Row() {
Button('CheckSysIntegrity', { type: ButtonType.Capsule, stateEffect: true })
.borderRadius(8)
.backgroundColor(0x317aff)
.width('40%')
.height('7%')
.margin({ top: '10vp', left: '16vp', right: '16vp', bottom: '21vp' })
.onClick(() => {
this.TitleText = '软件型号';
this.DispalyText = deviceInfo.softwareModel;
})
Button('CheckUrlThreat', { type: ButtonType.Capsule, stateEffect: true })
.borderRadius(8)
.backgroundColor(0x317aff)
.width('40%')
.height('7%')
.margin({ top: '10vp', left: '16vp', right: '16vp', bottom: '21vp' })
.onClick(() => {
this.TitleText = '设备类型';
this.DispalyText = deviceInfo.deviceType;
})
}
.height('600vp')
.width('100%')
}
.height('100%')
.backgroundColor('#F1F3F5')
}
}

View File

@ -0,0 +1,94 @@
/*
* Copyright (c) 2024 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.
*/
import deviceInfo from '@ohos.deviceInfo';
import router from '@ohos.router';
@Entry
@Component
struct Index {
@State DispalyText: string = '';
@State TitleText: string = '显示内容';
build() {
Column() {
Text()
.width('100%')
.height(100)
.fontSize(24)
.fontWeight(FontWeight.Bold)
.margin({ left: '30vp'})
Column() {
Text(this.TitleText)
.fontColor('#99182431')
.fontSize($r('sys.float.ohos_id_text_size_sub_title3'))
.margin({ top: '30vp', left: '24vp', bottom: '9.5vp' })
}
.width('100%')
.height('60vp')
.alignItems(HorizontalAlign.Start)
Column() {
Column() {
Scroll() {
Text(this.DispalyText)
.fontColor('#182431')
.fontSize($r('sys.float.ohos_id_text_size_body1'))
.lineHeight('19vp')
.textAlign(TextAlign.Start)
.width('100%')
}
.margin({ top: '8vp', left: '16vp', right: '16vp', bottom: '21vp' })
}
.height('350vp')
.backgroundColor('#FFFFFF')
.borderRadius($r('sys.float.ohos_id_corner_radius_default_l'))
.margin({ left: '12vp', right: '12vp' })
.align(Alignment.TopStart)
}
.width('100%')
.height('139vp')
.alignItems(HorizontalAlign.Center)
Row() {
Button('CheckSysIntegrity', { type: ButtonType.Capsule, stateEffect: true })
.borderRadius(8)
.backgroundColor(0x317aff)
.width('40%')
.height('7%')
.margin({ top: '10vp', left: '16vp', right: '16vp', bottom: '21vp' })
.onClick(() => {
this.TitleText = '设备类型';
this.DispalyText = deviceInfo.deviceType;
})
Button('CheckUrlThreat', { type: ButtonType.Capsule, stateEffect: true })
.borderRadius(8)
.backgroundColor(0x317aff)
.width('40%')
.height('7%')
.margin({ top: '10vp', left: '16vp', right: '16vp', bottom: '21vp' })
.onClick(() => {
this.TitleText = '设备类型';
this.DispalyText = deviceInfo.deviceType;
})
}
.height('600vp')
.width('100%')
}
.height('100%')
.backgroundColor('#F1F3F5')
}
}