外殼優化

This commit is contained in:
lvyuankang 2024-08-14 13:15:03 +08:00
parent d743f22889
commit 3b121ed5b2
3 changed files with 22 additions and 8 deletions

View File

@ -152,6 +152,7 @@ export default class TcpClient {
onMessage(callback?) {
this.tcp.on('message', value => {
console.log(TAG, 'Tcponmessage', value.length, value)
globalThis.tcpUdpError = false
// console.log('messageLengt',,value.message.length))
console.log('testTagtcpmsg')
@ -165,6 +166,18 @@ export default class TcpClient {
} else {
callback && callback('')
}
setTimeout(async () => {
//程序断开
if (globalThis.tcpUdpError) {
this.num++
console.log(TAG,'tcp信号丢失')
if(this.num==3){
getTCP()
this.num=0
}
}
globalThis.tcpUdpError = true;
}, 2000)
// callback(value.message)
});
}

View File

@ -319,6 +319,7 @@ struct Index {
}
async onPageShow() {
this.userAuth();
this.vocObj = new voiceService(async (status, val, next) => {
});
@ -332,7 +333,6 @@ struct Index {
}
this.isSingle = globalThis.singlePlay
this.loading = false
this.userAuth();
this.createAlbum()
this.num=0
@ -385,13 +385,14 @@ struct Index {
}
async initParams() {
//设置plc udp 同步requesthost
await getUDP(this.context,false)
this.loading = false
takePhotoFn(this.context)
await getDeviceInfo(this.context)
await getCarInfo()
await getUDP(this.context,false)
await getUDP2(this.context,false)
getTCP()
// await getCarInfo()
// await getUDP2(this.context,false)
// getTCP()
this.deviceId= globalThis.carInfo.carNo
await setCurrentTime();
this.carNum = globalThis.carInfo.plateNo;

View File

@ -45,7 +45,7 @@ export default struct FaceCompare {
Column() {
Column() {
Text('照片比对')
.lineHeight('16%')
// .lineHeight('16%')
.height('16%')
.fontWeight(FontWeight.Bold)
.fontSize(24)
@ -78,11 +78,11 @@ export default struct FaceCompare {
.height('100%')
}
.width('88.9%')
.height('53.2%')
.height('52%')
.justifyContent(FlexAlign.SpaceBetween)
Text('正在等待拍照…')
.lineHeight('16%')
// .lineHeight('16%')
.height('16%')
.fontWeight(FontWeight.Bold)
.fontColor('#CC7E00')