fix: 设置界面优化

This commit is contained in:
wangzhongjie 2025-06-26 18:10:55 +08:00
parent 608ffca139
commit bc74a62c85

View File

@ -1,6 +1,7 @@
import router from '@ohos.router' import router from '@ohos.router'
import { BaseInfoType, CarInfoType } from '../model/Common' import { BaseInfoType, CarInfoType } from '../model/Common'
import TopLogo from './compontents/TopLogo' import HeaderComponent from './compontents/Header'
import BottomMessageComponent from './Index/BottomMessage'
@Entry @Entry
@Component @Component
@ -9,38 +10,33 @@ struct SettingPage {
@State url: string = '' @State url: string = ''
@State baseInfo: BaseInfoType = {} @State baseInfo: BaseInfoType = {}
@State carInfo: CarInfoType = {} @State carInfo: CarInfoType = {}
@State @Watch('outClick') outFlag: boolean = false;
aboutToAppear() {
this.carInfo = AppStorage.get<CarInfoType>('carInfo')!
this.baseInfo = AppStorage.get<BaseInfoType>('baseInfo')!
}
build() { build() {
Column() { Column() {
TopLogo({ outFlag: $outFlag }) HeaderComponent({
shortLogo: true,
shouBackArea: true
})
Column() { Column() {
Row() { Row() {
Image($r('app.media.setting_clzc')).width('30.5%').height('74%').onClick(() => { 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' this.url = 'pages/Register'
router.pushUrl({ router.pushUrl({
url: this.url, url: this.url,
}, router.RouterMode.Single); }, router.RouterMode.Single);
}) })
Image($r('app.media.setting_spjk')).width('30.5%').height('74%').onClick(() => { 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' this.url = 'pages/VideoConfig'
router.pushUrl({ router.pushUrl({
url: this.url, url: this.url,
}, router.RouterMode.Single); }, router.RouterMode.Single);
}) })
Image($r('app.media.setting_xtts')).width('30.5%').height('74%').onClick(() => { Image($r('app.media.setting_xtts')).width('30.5%').height('74%').onClick(() => {
// this.vocObj.playAudio({
// type: 1,
// name: 'button_media.wav'
// })
this.url = 'pages/TerminalInfo' this.url = 'pages/TerminalInfo'
router.pushUrl({ router.pushUrl({
url: this.url, url: this.url,
@ -52,28 +48,12 @@ struct SettingPage {
} }
Column() { Column() {
Row() { BottomMessageComponent({
Column() { version: this.baseInfo.version,
Text('V ' + this.baseInfo.version) judgeVersion: this.baseInfo.judgeVersion,
.fontColor('#CCAE7A') hasAuth: this.baseInfo.hasAuth,
.fontSize(22 * this.ratio) examCarNumber: this.carInfo.carNo,
.width('30%') })
.margin({ bottom: 10 * this.ratio })
Text('授权信息:' + (this.baseInfo.hasAuth ? '已授权' : '未授权'))
.fontColor('#CCAE7A')
.fontSize(22 * this.ratio)
.width('30%')
}
.margin({ left: 24 * this.ratio })
Text('考车号:' + this.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%') .width('100%')
@ -83,14 +63,4 @@ struct SettingPage {
.backgroundImage($r('app.media.index_bg')) .backgroundImage($r('app.media.index_bg'))
.backgroundImageSize({ width: '100%', height: '100%' }) .backgroundImageSize({ width: '100%', height: '100%' })
} }
aboutToAppear() {
// this.vocObj = new voiceService(async (status, val, next) => {
// });
this.carInfo = AppStorage.get<CarInfoType>('carInfo')!
this.baseInfo = AppStorage.get<BaseInfoType>('baseInfo')!
}
outClick() {
}
} }