From 8732b4f9ccf5a7cd7718282c01f393a315585df1 Mon Sep 17 00:00:00 2001 From: lvyuankang <1344032923@qq.com> Date: Thu, 31 Oct 2024 15:59:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=97=A5=E6=9C=9F=E6=98=BE=E7=A4=BA=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ets/pages/compontents/SignDisplayCom.ets | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/entry/src/main/ets/pages/compontents/SignDisplayCom.ets b/entry/src/main/ets/pages/compontents/SignDisplayCom.ets index 4e85bf27..2b394e88 100644 --- a/entry/src/main/ets/pages/compontents/SignDisplayCom.ets +++ b/entry/src/main/ets/pages/compontents/SignDisplayCom.ets @@ -20,6 +20,8 @@ export default struct SignDisplayCom { @State interval: number = 0 @State @Watch('outClick') outFlag: boolean = false; @State url: string = '' + @State date: string = '' + @State time: string = '' private timer = null private udpClient: UdpClient = null private FileLog: FileLog @@ -215,8 +217,8 @@ export default struct SignDisplayCom { .fontColor('#FFB433') .fontSize(14 * this.ratio) .height(18 * this.ratio) - Text('年月日:' + this.signArr[93]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio) - Text('时分秒:' + this.signArr[94]).fontColor('#FFB433').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.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) @@ -414,6 +416,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) + } + + } outClick() {