diff --git a/entry/src/main/ets/pages/VideoConfig/Config.ets b/entry/src/main/ets/pages/VideoConfig/Config.ets index 269a84d..9426d3e 100644 --- a/entry/src/main/ets/pages/VideoConfig/Config.ets +++ b/entry/src/main/ets/pages/VideoConfig/Config.ets @@ -1,7 +1,7 @@ import { VideoConfig } from '../../model'; import CheckboxComponent from './CheckBox'; import LabelComponent from './Label'; -import routeSettingComponent from './RouteSetting'; +import RouteSettingComponent from './RouteSetting'; import TextInputComponent from './TextInput'; @@ -131,13 +131,13 @@ export default struct VideoConfigComponent { }.width("75%") Column() { - routeSettingComponent({ + RouteSettingComponent({ videoConfig: this.videoConfig, change: (value: VideoConfig) => { this.videoConfig = value; }, }) - routeSettingComponent({ + RouteSettingComponent({ title: "视频遮挡", videoConfig: this.videoConfig, change: (value: VideoConfig) => { diff --git a/entry/src/main/ets/pages/VideoConfig/RouteSetting.ets b/entry/src/main/ets/pages/VideoConfig/RouteSetting.ets index 4708961..6c1dad0 100644 --- a/entry/src/main/ets/pages/VideoConfig/RouteSetting.ets +++ b/entry/src/main/ets/pages/VideoConfig/RouteSetting.ets @@ -4,7 +4,7 @@ import LabelComponent from './Label' @Component -export default struct routeSettingComponent { +export default struct RouteSettingComponent { @State title: string = "录像范围" @Prop videoConfig: VideoConfig change?: (value: VideoConfig) => void diff --git a/entry/src/main/ets/pages/compontents/Header.ets b/entry/src/main/ets/pages/compontents/Header.ets index 3b0b29d..42595ab 100644 --- a/entry/src/main/ets/pages/compontents/Header.ets +++ b/entry/src/main/ets/pages/compontents/Header.ets @@ -16,6 +16,8 @@ export default struct HeaderComponent { @State shortLogo: boolean = true @State time: string = "" @State timer: number = 0 + @State shouBackArea: boolean = false + @State customizeReturnArea: boolean = false // 自定义返回区域 @BuilderParam backAreaBuilder?: () => void = this.customBuilder @@ -66,44 +68,44 @@ export default struct HeaderComponent { left: 10 }) } - if (this.shortLogo) { - if (this.backAreaBuilder) { - this.backAreaBuilder() - } else { + if (this.customizeReturnArea && this.backAreaBuilder) { + this.backAreaBuilder() + } else { + if (this.shouBackArea) { Image($r('app.media.topB_back')).height(100).onClick(() => { router.back() }) - } - } else { - - Row() { - Image($r('app.media.btn_setting')).height(100).onClick(() => { - console.log("点击设置") - router.pushUrl({ - url: 'pages/Settings', - }, router.RouterMode.Single); - }) - Image($r('app.media.btn_back')).height(100).onClick(() => { - Prompt.showDialog({ - title: "提示", - message: "确定要退出吗?", - buttons: [ - { - text: '取消', - color: '#666666' - }, - { - text: '退出', - color: '#666666' - } - ], - success: () => { - (getContext(this) as common.UIAbilityContext).terminateSelf() - } + } else { + Row() { + Image($r('app.media.btn_setting')).height(100).onClick(() => { + console.log("点击设置") + router.pushUrl({ + url: 'pages/Settings', + }, router.RouterMode.Single); }) - }) + Image($r('app.media.btn_back')).height(100).onClick(() => { + Prompt.showDialog({ + title: "提示", + message: "确定要退出吗?", + buttons: [ + { + text: '取消', + color: '#666666' + }, + { + text: '退出', + color: '#666666' + } + ], + success: () => { + (getContext(this) as common.UIAbilityContext).terminateSelf() + } + }) + }) + } } } + }.width("100%") .height(100) }