forked from harmony_car/subject-two
94 lines
3.0 KiB
Plaintext
94 lines
3.0 KiB
Plaintext
|
|
import router from '@ohos.router'
|
||
|
|
import TopLogo from './compontents/topLogo'
|
||
|
|
import { voiceService } from '../common/service/voiceService'
|
||
|
|
|
||
|
|
@Entry
|
||
|
|
@Component
|
||
|
|
struct Index {
|
||
|
|
@State ratio: number = 850 / 960
|
||
|
|
@State carNum: string = ''
|
||
|
|
@State version: string = ''
|
||
|
|
@State hasAuth: boolean = false;
|
||
|
|
private vocObj = null;
|
||
|
|
@State url: string = ''
|
||
|
|
@State @Watch('outClick') outFlag: boolean = false;
|
||
|
|
build() {
|
||
|
|
Column() {
|
||
|
|
TopLogo({outFlag:$outFlag})
|
||
|
|
Column() {
|
||
|
|
Row() {
|
||
|
|
Image($r('app.media.setting_clzc')).width('30.5%').height('74%').onClick(()=>{
|
||
|
|
// this.vocObj.playAudio({
|
||
|
|
// type: 1,
|
||
|
|
// name: 'media_button.wav'
|
||
|
|
// })
|
||
|
|
this.url='pages/register'
|
||
|
|
router.pushUrl({
|
||
|
|
url: this.url,
|
||
|
|
},router.RouterMode.Single);
|
||
|
|
})
|
||
|
|
Image($r('app.media.setting_spjk')).width('30.5%').height('74%').onClick(()=>{
|
||
|
|
// this.vocObj.playAudio({
|
||
|
|
// type: 1,
|
||
|
|
// name: 'media_button.wav'
|
||
|
|
// })
|
||
|
|
this.url='pages/videoConfig'
|
||
|
|
router.pushUrl({
|
||
|
|
url: this.url,
|
||
|
|
},router.RouterMode.Single);
|
||
|
|
})
|
||
|
|
Image($r('app.media.setting_xtts')).width('30.5%').height('74%').onClick(()=>{
|
||
|
|
console.info('jiangsong Button onClick')
|
||
|
|
// this.vocObj.playAudio({
|
||
|
|
// type: 1,
|
||
|
|
// name: 'media_button.wav'
|
||
|
|
// })
|
||
|
|
this.url='pages/TeminalInfos'
|
||
|
|
router.pushUrl({
|
||
|
|
url: this.url,
|
||
|
|
},router.RouterMode.Single);
|
||
|
|
})
|
||
|
|
}
|
||
|
|
.width('100%')
|
||
|
|
.justifyContent(FlexAlign.SpaceAround)
|
||
|
|
}
|
||
|
|
Column() {
|
||
|
|
Row() {
|
||
|
|
Column() {
|
||
|
|
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%')
|
||
|
|
}
|
||
|
|
.margin({left: 24*this.ratio})
|
||
|
|
Text('考车号:' + globalThis.deviceNo).fontColor('#CCAE7A').fontSize(22*this.ratio).margin({right: 24*this.ratio})
|
||
|
|
}
|
||
|
|
.width('100%')
|
||
|
|
.justifyContent(FlexAlign.SpaceBetween)
|
||
|
|
.margin({bottom: 10*this.ratio})
|
||
|
|
}
|
||
|
|
}
|
||
|
|
.width('100%')
|
||
|
|
.height('100%')
|
||
|
|
.justifyContent(FlexAlign.SpaceBetween)
|
||
|
|
.backgroundImagePosition({x: 0, y: 0})
|
||
|
|
.backgroundImage($r('app.media.index_bg'))
|
||
|
|
.backgroundImageSize({ width: '100%', height: '100%' })
|
||
|
|
}
|
||
|
|
aboutToAppear() {
|
||
|
|
console.info('jiangsong:index Index aboutToAppear');
|
||
|
|
this.carNum = globalThis.carInfo.plateNo;
|
||
|
|
this.version = globalThis.version;
|
||
|
|
this.hasAuth = globalThis.hasAuth;
|
||
|
|
}
|
||
|
|
onPageShow() {
|
||
|
|
console.info('Index onPageShow');
|
||
|
|
// tF = new voiceService(async (status,val) => {
|
||
|
|
// if (status == 'idle') {
|
||
|
|
// router.pushUrl({
|
||
|
|
// url: this.url,
|
||
|
|
// });
|
||
|
|
// }
|
||
|
|
// });
|
||
|
|
}
|
||
|
|
outClick(){
|
||
|
|
}
|
||
|
|
}
|