From b3ce8cd7f5ac11dff52a533a0661c9b145e0bbe9 Mon Sep 17 00:00:00 2001 From: wangzhongjie Date: Tue, 11 Feb 2025 10:56:02 +0800 Subject: [PATCH] fix: Settings --- entry/src/main/ets/model/Settings.ets | 99 +++++++++++++++++++++++++++ 1 file changed, 99 insertions(+) diff --git a/entry/src/main/ets/model/Settings.ets b/entry/src/main/ets/model/Settings.ets index e69de29b..d10b3d3c 100644 --- a/entry/src/main/ets/model/Settings.ets +++ b/entry/src/main/ets/model/Settings.ets @@ -0,0 +1,99 @@ +import router from '@ohos.router' +import TopLogo from '../pages/compontents/TopLogo' + +@Entry +@Component +struct Index { + @State ratio: number = 1280 / 960 + @State carNum: string = '' + @State version: string = '' + @State hasAuth: boolean = false; + @State url: string = '' + @State @Watch('outClick') outFlag: boolean = false; + + // private vocObj = null; + + 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: 'button_media.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: 'button_media.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(() => { + // this.vocObj.playAudio({ + // type: 1, + // name: 'button_media.wav' + // }) + this.url = 'pages/TerminalInfos' + 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.carInfo.carNo) + .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() { + // this.vocObj = new voiceService(async (status, val, next) => { + // }); + this.carNum = globalThis.carInfo.plateNo; + this.version = globalThis.version; + this.hasAuth = globalThis.hasAuth; + } + + outClick() { + } +} \ No newline at end of file