外殼優化

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?) { onMessage(callback?) {
this.tcp.on('message', value => { this.tcp.on('message', value => {
console.log(TAG, 'Tcponmessage', value.length, value) console.log(TAG, 'Tcponmessage', value.length, value)
globalThis.tcpUdpError = false
// console.log('messageLengt',,value.message.length)) // console.log('messageLengt',,value.message.length))
console.log('testTagtcpmsg') console.log('testTagtcpmsg')
@ -165,6 +166,18 @@ export default class TcpClient {
} else { } else {
callback && callback('') 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) // callback(value.message)
}); });
} }

View File

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

View File

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