From 4ee1c95f3b8050fdbcab841c5911e3029b267777 Mon Sep 17 00:00:00 2001 From: lvyuankang <1344032923@qq.com> Date: Fri, 1 Nov 2024 10:30:10 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E6=9C=9F=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/pages/Index.ets | 1 - .../ets/pages/compontents/SignDisplayCom.ets | 28 +++++++++++-------- 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index b95daba7..a53c2797 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -388,7 +388,6 @@ struct Index { console.log('globalThis.singlePlay', globalThis.singlePlay) if (globalThis.singlePlay == undefined || globalThis.singlePlay == null) { this.context.resourceManager.getRawFileContent("welcome.wav").then(value => { - console.log('tttttttt') this.vocObj.playAudio({ type: 1, name: 'welcome.wav' diff --git a/entry/src/main/ets/pages/compontents/SignDisplayCom.ets b/entry/src/main/ets/pages/compontents/SignDisplayCom.ets index 2b394e88..c7cbc606 100644 --- a/entry/src/main/ets/pages/compontents/SignDisplayCom.ets +++ b/entry/src/main/ets/pages/compontents/SignDisplayCom.ets @@ -4,6 +4,8 @@ import FileLog from '../judgeSDK/utils/fileLog'; import RealTime from '../compontents/judge/RealTime'; import { GPSData, SignalData } from '../../mock'; import { SignalDataType } from '../../model'; +// import { getSyncData } from '../../common/service/initable'; +import common from '@ohos.app.ability.common'; @Component export default struct SignDisplayCom { @@ -22,10 +24,13 @@ export default struct SignDisplayCom { @State url: string = '' @State date: string = '' @State time: string = '' + // @State sd: string = '' + @State param350Str: string = '' private timer = null private udpClient: UdpClient = null private FileLog: FileLog private vocObj = null; + private context = getContext(this) as common.UIAbilityContext; constructor() { super() @@ -168,7 +173,7 @@ export default struct SignDisplayCom { }.justifyContent(FlexAlign.Start).padding({ left: 10 * this.ratio }).margin({ top: 8 * this.ratio }) Row() { - Text("本机IP:" + this.signArr[53] || '0') + Text("后置机IP:" + this.signArr[53] || '0') .fontColor('#FFF5E5') .fontSize(14 * this.ratio) .width('25%') @@ -218,7 +223,7 @@ export default struct SignDisplayCom { .fontSize(14 * this.ratio) .height(18 * this.ratio) Text('年月日:' + this.date).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) - Text('时分秒:' + this.time]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) + Text('时分秒:' + this.time).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) Text('经度:' + this.signArr[95]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) Text('纬度:' + this.signArr[96]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) Text('速度:' + this.signArr[97]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) @@ -348,8 +353,6 @@ export default struct SignDisplayCom { } onPageShow() { - console.info('SURENJUN', 123) - const getSignal = this.getSignal; const that = this const showBack = this.showBack; @@ -416,15 +419,16 @@ export default struct SignDisplayCom { this.sjxhColum = JSON.parse(JSON.stringify((this.sjxhColum))) that.signArr = JSON.parse(JSON.stringify((this.signArr))) that.GPSColum = JSON.parse(JSON.stringify((this.GPSColum))) - if(this.signArr.length){ - this.date=this.signArr[93].substr(4,2)+this.signArr[93].substr(2,2)+this.signArr[93].substr(0,2) - const hours=(Number(this.signArr[94].substr(0,2))+8).toString() - if(hours.length<2){ - this.time='0'+hours+this.signArr[93].substr(2,this.signArr[93].length) - }else{ - this.time=hours+this.signArr[93].substr(2,this.signArr[93].length) + if(this.signArr.length) { + this.date = this.signArr[93].substr(4, 2) + this.signArr[93].substr(2, 2) + this.signArr[93].substr(0, 2) + const hours = (Number(this.signArr[94].substr(0, 2)) + 8).toString() + if (hours.length < 2) { + this.time = '0' + hours + this.signArr[93].substr(2, this.signArr[93].length) + } else { + this.time = hours + this.signArr[93].substr(2, this.signArr[93].length) } - + } + // this.sd=this.param350Str=='0'? this.signArr[97]: this.signArr[23] }