99 lines
3.0 KiB
Plaintext
Raw Normal View History

2024-01-05 11:11:15 +08:00
import router from '@ohos.router'
2024-12-29 21:43:12 +08:00
import { voiceService } from '../common/service/voiceService'
2024-06-04 12:08:32 +08:00
import TopLogo from './compontents/TopLogo'
2024-01-05 11:11:15 +08:00
@Entry
@Component
2024-06-04 11:19:22 +08:00
export default struct Index {
2024-05-09 13:42:56 +08:00
@State ratio: number = 1280 / 960
2024-01-05 11:11:15 +08:00
@State carNum: string = ''
@State version: string = ''
@State hasAuth: boolean = false;
@State url: string = ''
@State @Watch('outClick') outFlag: boolean = false;
2025-01-02 11:01:09 +08:00
// private vocObj = null;
2024-06-04 11:19:22 +08:00
2024-01-05 11:11:15 +08:00
build() {
Column() {
2024-06-04 11:19:22 +08:00
TopLogo({ outFlag: $outFlag })
2024-01-05 11:11:15 +08:00
Column() {
Row() {
2024-06-04 11:19:22 +08:00
Image($r('app.media.setting_clzc')).width('30.5%').height('74%').onClick(() => {
2024-12-29 21:43:12 +08:00
// this.vocObj.playAudio({
// type: 1,
// name: 'button_media.wav'
// })
2024-06-04 11:19:22 +08:00
this.url = 'pages/Register'
2024-01-05 11:11:15 +08:00
router.pushUrl({
url: this.url,
2024-06-04 11:19:22 +08:00
}, router.RouterMode.Single);
2024-01-05 11:11:15 +08:00
})
2024-06-04 11:19:22 +08:00
Image($r('app.media.setting_spjk')).width('30.5%').height('74%').onClick(() => {
2024-12-29 21:43:12 +08:00
// this.vocObj.playAudio({
// type: 1,
// name: 'button_media.wav'
// })
2024-06-04 11:19:22 +08:00
this.url = 'pages/VideoConfig'
2024-01-05 11:11:15 +08:00
router.pushUrl({
url: this.url,
2024-06-04 11:19:22 +08:00
}, router.RouterMode.Single);
2024-01-05 11:11:15 +08:00
})
2024-06-04 11:19:22 +08:00
Image($r('app.media.setting_xtts')).width('30.5%').height('74%').onClick(() => {
2024-12-29 21:43:12 +08:00
// this.vocObj.playAudio({
// type: 1,
// name: 'button_media.wav'
// })
2024-06-04 11:19:22 +08:00
this.url = 'pages/TerminalInfos'
2024-01-05 11:11:15 +08:00
router.pushUrl({
url: this.url,
2024-06-04 11:19:22 +08:00
}, router.RouterMode.Single);
2024-01-05 11:11:15 +08:00
})
}
.width('100%')
.justifyContent(FlexAlign.SpaceAround)
}
2024-06-04 11:19:22 +08:00
2024-01-05 11:11:15 +08:00
Column() {
Row() {
Column() {
2024-06-04 11:19:22 +08:00
Text('V ' + this.version)
.fontColor('#CCAE7A')
.fontSize(22 * this.ratio)
.width('30%')
.margin({ bottom: 10 * this.ratio })
Text('授权信息:' + (this.hasAuth ? '已授权' : '未授权'))
.fontColor('#CCAE7A')
.fontSize(22 * this.ratio)
.width('30%')
2024-01-05 11:11:15 +08:00
}
2024-06-04 11:19:22 +08:00
.margin({ left: 24 * this.ratio })
2024-08-14 09:18:33 +08:00
Text('考车号:' + globalThis.carInfo.carNo)
2024-06-04 11:19:22 +08:00
.fontColor('#CCAE7A')
.fontSize(22 * this.ratio)
.margin({ right: 24 * this.ratio })
2024-01-05 11:11:15 +08:00
}
.width('100%')
.justifyContent(FlexAlign.SpaceBetween)
2024-06-04 11:19:22 +08:00
.margin({ bottom: 10 * this.ratio })
2024-01-05 11:11:15 +08:00
}
}
.width('100%')
.height('100%')
.justifyContent(FlexAlign.SpaceBetween)
2024-06-04 11:19:22 +08:00
.backgroundImagePosition({ x: 0, y: 0 })
2024-01-05 11:11:15 +08:00
.backgroundImage($r('app.media.index_bg'))
.backgroundImageSize({ width: '100%', height: '100%' })
}
2024-06-04 11:19:22 +08:00
aboutToAppear() {
2025-01-02 11:01:09 +08:00
// this.vocObj = new voiceService(async (status, val, next) => {
// });
2024-06-04 11:19:22 +08:00
this.carNum = globalThis.carInfo.plateNo;
this.version = globalThis.version;
this.hasAuth = globalThis.hasAuth;
2024-01-05 11:11:15 +08:00
}
2024-02-23 15:23:48 +08:00
2024-06-04 11:19:22 +08:00
outClick() {
2024-01-05 11:11:15 +08:00
}
}