97 lines
3.0 KiB
Plaintext
Raw Normal View History

2024-01-05 11:11:15 +08:00
import router from '@ohos.router'
2025-02-17 14:20:40 +08:00
import { CarCheckDataType } from '../model/CarCheck'
import { BaseInfoType, CarInfoType } from '../model/Common'
2024-06-04 12:08:32 +08:00
import TopLogo from './compontents/TopLogo'
2024-01-05 11:11:15 +08:00
@Entry
@Component
2025-02-11 09:09:34 +08:00
struct Index {
2024-05-09 13:42:56 +08:00
@State ratio: number = 1280 / 960
2024-01-05 11:11:15 +08:00
@State url: string = ''
2025-02-17 14:20:40 +08:00
@State baseInfo: BaseInfoType = {}
@State carInfo: CarInfoType = {}
2024-01-05 11:11:15 +08:00
@State @Watch('outClick') outFlag: boolean = false;
2025-02-11 09:09:34 +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() {
2025-02-17 14:20:40 +08:00
Text('V ' + this.baseInfo.version)
2024-06-04 11:19:22 +08:00
.fontColor('#CCAE7A')
.fontSize(22 * this.ratio)
.width('30%')
.margin({ bottom: 10 * this.ratio })
2025-02-17 14:20:40 +08:00
Text('授权信息:' + (this.baseInfo.hasAuth ? '已授权' : '未授权'))
2024-06-04 11:19:22 +08:00
.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 })
2025-02-12 13:17:00 +08:00
Text('考车号:' + this.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) => {
// });
this.carInfo = AppStorage.get<CarInfoType>('carInfo')
this.baseInfo = AppStorage.get<BaseInfoType>('baseInfo')
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
}
}