diff --git a/entry/src/main/ets/common/utils/UdpClientByCenter.ts b/entry/src/main/ets/common/utils/UdpClientByCenter.ts index 7e2ad8b0..ba6fd391 100644 --- a/entry/src/main/ets/common/utils/UdpClientByCenter.ts +++ b/entry/src/main/ets/common/utils/UdpClientByCenter.ts @@ -246,6 +246,9 @@ export default class UdpClientByCenter { for (let i = 0; i < dataView?.byteLength; ++i) { arr[i] = dataView?.getUint8(i) } + if(!arr.length){ + return + } let idNum = '0x' + fillZero(arr[1].toString(16), 2) + fillZero(arr[0].toString(16), 2); let id = Math.floor(+idNum / 1000) diff --git a/entry/src/main/ets/pages/UserInfo.ets b/entry/src/main/ets/pages/UserInfo.ets index 6a675a73..72a4a17b 100644 --- a/entry/src/main/ets/pages/UserInfo.ets +++ b/entry/src/main/ets/pages/UserInfo.ets @@ -90,6 +90,7 @@ struct UserInfo { 'Param364': '0', //考前上车准备 'Param398': '0', //考前上车准备 'Param835': '0', //考前上车准备 + 'Param850': '0', //考前上车准备 } @State startExam: boolean = false // 过程照片拍照 @@ -540,6 +541,10 @@ struct UserInfo { if (sys.v_no === '835') { that.systemParam.Param835 = sys.v_value; } + //盲考 + if (sys.v_no === '850') { + that.systemParam.Param850 = sys.v_value; + } // 开始考试前必须解开安全带或关车门 if (sys.v_no === '803') { that.systemParam.Param803Str = sys.v_value + ''; @@ -1138,12 +1143,12 @@ struct UserInfo { CommText({ ratio: this.ratio, color: item.sfzmhm != this.currentUser.sfzmhm ? '#FFFFFF' : '#000000', - text: item.lsh + text: this.systemParam.Param850&&Number(this.systemParam.Param850)>0?"*****":item.lsh }) CommText({ ratio: this.ratio, color: item.sfzmhm != this.currentUser.sfzmhm ? '#FFFFFF' : '#000000', - text: decodeURIComponent(item.xm) + text: this.systemParam.Param850&&Number(this.systemParam.Param850)>0?"*****":decodeURIComponent(item.xm) }) } } @@ -1212,7 +1217,42 @@ struct UserInfo { Column() { ForEach(this.labelBlocks, (item) => { - LabelBlock({ label: item.label, ratio: this.ratio, value: this.currentUser[item.key] }) + if(this.systemParam.Param850=='1'){ + LabelBlock({ label: item.label, ratio: this.ratio, value:'*****'}) + } + else if(this.systemParam.Param850=='2'){ + if(item.key=='xm'){ + LabelBlock({ label: item.label, ratio: this.ratio, value: this.currentUser.xh }) + }else if(item.key=='ksxl'){ + LabelBlock({ label: item.label, ratio: this.ratio, value: this.currentUser[item.key] }) + }else{ + LabelBlock({ label: item.label, ratio: this.ratio, value: '*****' }) + } + }else if(this.systemParam.Param850=='4'){ + if(item.key=='ksxl'){ + LabelBlock({ label: item.label, ratio: this.ratio, value: '*****' }) + }else{ + LabelBlock({ label: item.label, ratio: this.ratio, value: this.currentUser[item.key] }) + } + }else if(this.systemParam.Param850=='5'){ + if(item.key=='xm'){ + LabelBlock({ label: item.label, ratio: this.ratio, value: this.currentUser.xh }) + }else{ + LabelBlock({ label: item.label, ratio: this.ratio, value: '*****' }) + } + }else if(this.systemParam.Param850=='6'){ + if(item.key=='ksxl'){ + LabelBlock({ label: item.label, ratio: this.ratio, value: this.currentUser.ksxl }) + }else if(item.key=='sfzmhm'){ + LabelBlock({ label: item.label, ratio: this.ratio, value: this.currentUser.sfzmhm.slice(-6) }) + }else{ + LabelBlock({ label: item.label, ratio: this.ratio, value: '*****' }) + } + } + else{ + LabelBlock({ label: item.label, ratio: this.ratio, value: this.currentUser[item.key] }) + + } }) } } @@ -1441,4 +1481,5 @@ type systemParam = { 'Param364': string, //考前上车准备 'Param398': string, //考前上车准备 'Param835': string, //考前上车准备 + 'Param850': string, //考前上车准备 } \ No newline at end of file