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() {