From d64d951f1e667c65c9fc3d1c9cebe39316d63df4 Mon Sep 17 00:00:00 2001 From: wangzhongjie Date: Fri, 22 Aug 2025 10:11:02 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E6=94=B9=E8=B0=83=E8=AF=95?= =?UTF-8?q?=E6=A8=A1=E5=BC=8F=E9=87=8D=E5=90=AFapp=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/model/Common.ets | 2 ++ entry/src/main/ets/pages/TerminalInfo.ets | 25 ++++++++++++++----- .../ets/utils/business/SerialPortService.ets | 4 +++ 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/entry/src/main/ets/model/Common.ets b/entry/src/main/ets/model/Common.ets index 72404f5..f3446f1 100644 --- a/entry/src/main/ets/model/Common.ets +++ b/entry/src/main/ets/model/Common.ets @@ -169,6 +169,8 @@ export interface EnvironmentConfigurationType { version?: string // 评判版本 judgeVersion?: string + // 是否使用网络摄像头 + isUseNetworkCamera?: string } //全局配置 diff --git a/entry/src/main/ets/pages/TerminalInfo.ets b/entry/src/main/ets/pages/TerminalInfo.ets index 1ff452e..4ea80a5 100644 --- a/entry/src/main/ets/pages/TerminalInfo.ets +++ b/entry/src/main/ets/pages/TerminalInfo.ets @@ -7,14 +7,15 @@ import ethernet from '@ohos.net.ethernet'; import { BusinessError } from '@ohos.base'; import Prompt from '@system.prompt'; import { dConsole } from '../utils/LogWorker'; +import window from '@ohos.window'; @Entry @Component struct TerminalInfoPage { @State config: EnvironmentConfigurationType = {} + @State isProcessing: boolean = false; private fileUtil!: FileUtils private context = getContext(this) as common.UIAbilityContext; - @State isProcessing: boolean = false; async aboutToAppear() { this.fileUtil = new FileUtils(this.context) @@ -186,6 +187,14 @@ struct TerminalInfoPage { this.config.isOpenFiniteDifference = value; } }) + blockComponent({ + label: "开启网络摄像头", + type: 7, + value: this.config.isUseNetworkCamera, + change: (value: string) => { + this.config.isUseNetworkCamera = value; + } + }) blockComponent({ label: "是否开启日志", type: 2, @@ -203,15 +212,20 @@ struct TerminalInfoPage { } }) blockComponent({ - label: "开启调试(重启APP)", + label: "开启调试", type: 6, value: this.config.isOpenDebugger, - change: (value: string) => { + change: async (value: string) => { this.config.isOpenDebugger = value; + const win = await window.getLastWindow(this.context); + if (value === "1") { + win.setWindowSystemBarEnable(['status', 'navigation']) + } else { + win.setWindowSystemBarEnable([]) + } } }) }.margin(20) - } .height(650) .width("100%") @@ -222,7 +236,6 @@ struct TerminalInfoPage { top: 10 }) - Row() { Image($r('app.media.bc')).height(80).objectFit(ImageFit.Contain).onClick(() => { if (this.isProcessing) { @@ -396,7 +409,7 @@ struct blockComponent { }) } else { ForEach(this.type === 1 ? this.rearMachineModelList : - this.type === 2 || this.type === 5 || this.type === 6 ? this.logList : + this.type === 2 || this.type === 5 || this.type === 6 || this.type === 7 ? this.logList : this.type === 3 ? this.boardList : this.carTypeList, (item: CommonListType, index) => { Radio({ value: item.label, group: 'terRadioGroup' + this.type }) .borderColor('#E5CBA1') diff --git a/entry/src/main/ets/utils/business/SerialPortService.ets b/entry/src/main/ets/utils/business/SerialPortService.ets index 2c46c66..c7dda54 100644 --- a/entry/src/main/ets/utils/business/SerialPortService.ets +++ b/entry/src/main/ets/utils/business/SerialPortService.ets @@ -72,6 +72,10 @@ class serialPortService { } } + offMsg() { + this.events = []; + } + async closed() { const res = await CancelReceiveSerialPortData(this.fd); this.events = [];