From 56f6a671ebd4c81b531a2c498fb2812cc9ae9431 Mon Sep 17 00:00:00 2001 From: surenjun Date: Tue, 26 Nov 2024 15:35:05 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E6=9D=AD=E5=B7=9E&=E6=B5=8E?= =?UTF-8?q?=E5=8D=97=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/pages/Judge.ets | 23 +++++++++++-- entry/src/main/ets/pages/UserInfo.ets | 5 +++ .../judge/BoardPrePareSetPopup.ets | 14 +++++--- .../compontents/judge/DeductionPopup.ets | 25 +++++++++++--- .../ets/pages/compontents/judge/EndPopup.ets | 8 ++--- .../pages/compontents/judge/LoadingPopup.ets | 4 +-- entry/src/main/ets/pages/judgeSDK/judge.ts | 34 +++++++++++-------- 7 files changed, 82 insertions(+), 31 deletions(-) diff --git a/entry/src/main/ets/pages/Judge.ets b/entry/src/main/ets/pages/Judge.ets index 9eec1563..3197af3d 100644 --- a/entry/src/main/ets/pages/Judge.ets +++ b/entry/src/main/ets/pages/Judge.ets @@ -304,9 +304,12 @@ struct Index { this.projectsObj[no2*1] = currentProject this.projectsCenterObj[txt2] = currentProject this.projects.push(currentProject); + console.info('surenjun kStringArr',JSON.stringify(kStringArr)) //真实监管下发考试项目 - if(isInExam && !kStringArr.includes(txt2)){ + if(isInExam && !(kStringArr.includes(txt2) || kStringArr.includes(no2+''))){ + console.info('surenjun =>',txt2) + console.info('surenjun => no2',no2) this.projectsObj[no2*1].type = '3' this.projectsObj[no2*1].isUpload = true this.projectsObj[no2*1].isEnd = true @@ -806,7 +809,7 @@ struct Index { } Column() { - if (this.examSubject == 3 && this.judgeConfigObj['342'] == '0') { + if (this.getIsManualKf()) { Row() { Row() { } @@ -1218,6 +1221,22 @@ struct Index { return (type == '3' || type == '4') ? `${projectName}_red` : `${projectName}_green`; } + // 获取是否能进行人工评判 + getIsManualKf = () =>{ + const {examSubject} = this; + if(examSubject == 3){ + //杭州训练模式不允许人工评判 + if(globalThis.singlePlay && this.judgeConfigObj['211'] == 'zjhz'){ + return false + } + if(this.judgeConfigObj['342'] == '0'){ + return true + } + }else{ + return false + } + } + scroller: Scroller = new Scroller() //页面通用字体大小 @State wayno: number = 0 diff --git a/entry/src/main/ets/pages/UserInfo.ets b/entry/src/main/ets/pages/UserInfo.ets index 2ba45dc4..c5dd1482 100644 --- a/entry/src/main/ets/pages/UserInfo.ets +++ b/entry/src/main/ets/pages/UserInfo.ets @@ -435,6 +435,11 @@ struct UserInfo { that.isBoardPrePareSetPopupOpen = true; } + //398参数为1 第二场考试上车准备不考 + if(sys.v_no === '398' && decodeURIComponent(sys.v_value) == '1' && this.currentUser.kssycs == '1'){ + that.isBoardPrePareSetPopupOpen = false; + } + // 车上没有缺考功能 if (sys.v_no === '770') { that.systemParam.Param770Str = sys.v_value; diff --git a/entry/src/main/ets/pages/compontents/judge/BoardPrePareSetPopup.ets b/entry/src/main/ets/pages/compontents/judge/BoardPrePareSetPopup.ets index f0df1d70..804deb2b 100644 --- a/entry/src/main/ets/pages/compontents/judge/BoardPrePareSetPopup.ets +++ b/entry/src/main/ets/pages/compontents/judge/BoardPrePareSetPopup.ets @@ -127,7 +127,13 @@ export default struct DeductedPopup { const index = this.currentIndex ? this.currentUniversalPageIndex : this.currentPageIndex; const mark = this.universalMarkRules[index * 7 + this.selectedLine]; const {judgeConfigObj,kssycs,avPlayer,judgeTask} = this; - this.kfdmArr.push({ xmdm: 1, kfdm: mark.markserial, markreal: mark.markreal, markcatalog: mark.markcatalog ,score:mark.score}) + this.kfdmArr.push({ + xmdm: 1, + kfdm: mark.markserial, + markreal: mark.markreal, + markcatalog: mark.markcatalog , + score:mark.score + }) const kfdmArr = this.kfdmArr //计算总扣分 @@ -566,9 +572,9 @@ export default struct DeductedPopup { //没有扣分项目通过 this.closePopup(this.kfdmArr.length ? true : false) - // judgeTask.addTask(async () => { - // await this.endProject() - // }, { isDelay: true }) + // judgeTask.addTask(async () => { + // await this.endProject() + // }, { isDelay: true }) }) }.width('100%').height('100%').position({ y: 0 }).backgroundColor('rgba(0,0,0,0.7)') diff --git a/entry/src/main/ets/pages/compontents/judge/DeductionPopup.ets b/entry/src/main/ets/pages/compontents/judge/DeductionPopup.ets index 97dac1f8..4d9ef0f4 100644 --- a/entry/src/main/ets/pages/compontents/judge/DeductionPopup.ets +++ b/entry/src/main/ets/pages/compontents/judge/DeductionPopup.ets @@ -1,4 +1,6 @@ import {MarkRule} from '../../judgeSDK/api/judgeSDK' +import EndPoPup from './EndPopup'; + interface SEL{ fontColor:string bgColor:string @@ -25,6 +27,7 @@ export default struct DeductedPopup { @Prop defaultTabIndex:number = 0 @State lineBg:Array = ['#4D4136','#26231E'] @State selectedLine:number = undefined + @State endPopupVisible:boolean = false private closePopup:Function = ()=> {} private confirmMark:Function = (itemno:number,serial:string) => {} @State selectedLineStyle:SEL = { @@ -110,7 +113,7 @@ export default struct DeductedPopup { Row(){ Image($rawfile(`judge/km3/zuo_nor.png`)).height(15).margin({left:20,top:0}) Text('上一页'){}.fontColor('#FFF').fontSize(this.fontSize) - }.width(120).height(60).justifyContent(FlexAlign.Start).alignItems(VerticalAlign.Center).backgroundImage($rawfile(`judge/km3/button_nor.png`)).backgroundImageSize({width:'100%',height:'100%'}) + }.width(120).height(60).justifyContent(FlexAlign.Start).alignItems(VerticalAlign.Center).backgroundImage($rawfile(`judge/km3/button_nor.png`)).backgroundImageSize({width:'100%',height:'100%'}).margin({right:15}) .onClick(()=>{this.goPage(0)}) } @@ -120,7 +123,7 @@ export default struct DeductedPopup { Row(){ Text('下一页'){}.fontColor('#FFF').fontSize(this.fontSize).padding({left:30}) Image($rawfile(`judge/km3/you_nor.png`)).height(15).margin({right:6,top:0}) - }.width(120).height(60).justifyContent(FlexAlign.Start).alignItems(VerticalAlign.Center).backgroundImage($rawfile(`judge/km3/button_nor.png`)).backgroundImageSize({width:'100%',height:'100%'}) + }.width(120).height(60).justifyContent(FlexAlign.Start).alignItems(VerticalAlign.Center).backgroundImage($rawfile(`judge/km3/button_nor.png`)).backgroundImageSize({width:'100%',height:'100%'}).margin({right:15}) .onClick(()=>{this.goPage(1)}) } @@ -128,9 +131,7 @@ export default struct DeductedPopup { Text('扣 分'){}.fontColor('#FFF').fontSize(this.fontSize).padding({left:35}) }.width(120).height(60).justifyContent(FlexAlign.Start).alignItems(VerticalAlign.Center).backgroundImage($rawfile(`judge/km3/button_nor.png`)).backgroundImageSize({width:'100%',height:'100%'}) .onClick(()=>{ - const index = this.currentIndex ? this.currentUniversalPageIndex: this.currentPageIndex; - const mark = this.universalMarkRules[index * 7 + this.selectedLine] - mark && this.confirmMark(mark.itemno,mark.markserial) + this.endPopupVisible = true }) } }.width('100%').justifyContent(FlexAlign.SpaceBetween) @@ -151,6 +152,20 @@ export default struct DeductedPopup { } }.width(1200).height(620).position({x:30,y:315}).backgroundColor('#E6E3DF').padding({top:15,bottom:15,left:25,right:25}).borderRadius(20) // Row(){}.width(100).height(100).position({y:'85%',x:'50%'}).backgroundImage($rawfile('judge/km3/close_nor.png')).backgroundImageSize({width:'100%',height:'100%'}) + //结束考试弹窗 + if (this.endPopupVisible) { + EndPoPup({ + title: '确定扣分吗?', + cancelFn: () => { + this.endPopupVisible = false; + }, + confirmFn: async () => { + const index = this.currentIndex ? this.currentUniversalPageIndex: this.currentPageIndex; + const mark = this.universalMarkRules[index * 7 + this.selectedLine] + mark && this.confirmMark(mark.itemno,mark.markserial) + } + }) + } }.width('100%').height('100%').position({y:0}).onClick(()=>{this.closePopup()}) } } \ No newline at end of file diff --git a/entry/src/main/ets/pages/compontents/judge/EndPopup.ets b/entry/src/main/ets/pages/compontents/judge/EndPopup.ets index 9b24b1a8..138cdb60 100644 --- a/entry/src/main/ets/pages/compontents/judge/EndPopup.ets +++ b/entry/src/main/ets/pages/compontents/judge/EndPopup.ets @@ -12,13 +12,13 @@ export default struct EndPopup { build(){ Column(){ Column(){ - Text(this.title).fontSize(36).margin({bottom:20}) + Text(this.title).fontSize(32).margin({bottom:20}) Row(){}.height(100) Row(){ - Text('取消').backgroundImage($rawfile('judge/end-btn.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width(250).height(95).fontSize(28).fontColor('#FFF').textAlign(TextAlign.Center).onClick(this.cancelFn) - Text('确定').backgroundImage($rawfile('judge/end-btn.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width(250).height(95).fontSize(28).fontColor('#FFF').textAlign(TextAlign.Center).margin({left:45}).onClick(this.confirmFn) + Text('取消').backgroundImage($rawfile('judge/end-btn.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width(230).height(80).fontSize(28).fontColor('#FFF').textAlign(TextAlign.Center).onClick(this.cancelFn) + Text('确定').backgroundImage($rawfile('judge/end-btn.png'),ImageRepeat.NoRepeat).backgroundImageSize({width:'100%',height:'100%'}).width(230).height(80).fontSize(28).fontColor('#FFF').textAlign(TextAlign.Center).margin({left:45}).onClick(this.confirmFn) } - }.width('75%').height('70%').backgroundColor('#E6E3DF').borderRadius(38).position({y:'12%',x:'12.5%'}).justifyContent(FlexAlign.Center) + }.width('50%').height('50%').backgroundColor('#E6E3DF').borderRadius(38).position({y:'25%',x:'25%'}).justifyContent(FlexAlign.Center) }.width('100%').height('100%').position({y:0}).backgroundColor('rgba(0,0,0,0.7)') } diff --git a/entry/src/main/ets/pages/compontents/judge/LoadingPopup.ets b/entry/src/main/ets/pages/compontents/judge/LoadingPopup.ets index c80fd6ac..39edd9f8 100644 --- a/entry/src/main/ets/pages/compontents/judge/LoadingPopup.ets +++ b/entry/src/main/ets/pages/compontents/judge/LoadingPopup.ets @@ -10,8 +10,8 @@ export default struct LoadingPopup { Column(){ Column(){ Image($rawfile('judge/loading-car.gif')).width(250).margin({top:20,bottom:20}) - Text(this.title).fontSize(32).margin({top:70}) - }.width('70%').height('70%').backgroundColor('#E6E3DF').borderRadius(38).position({y:'15%',x:'15%'}).justifyContent(FlexAlign.Center) + Text(this.title).fontSize(32).margin({top:15}) + }.width('45%').height('50%').backgroundColor('#E6E3DF').borderRadius(38).position({y:'27.5%',x:'25%'}).justifyContent(FlexAlign.Center) }.width('100%').height('100%').position({y:0}).backgroundColor('rgba(0,0,0,0.7)') } diff --git a/entry/src/main/ets/pages/judgeSDK/judge.ts b/entry/src/main/ets/pages/judgeSDK/judge.ts index 29beb6ee..38e547c0 100644 --- a/entry/src/main/ets/pages/judgeSDK/judge.ts +++ b/entry/src/main/ets/pages/judgeSDK/judge.ts @@ -176,16 +176,16 @@ export default class Judge { } const {examSubject,projectsObj} = this.judgeUI - if(examSubject == 3){ - //不做模拟灯光,需要做上车准备 =>(请上车准备) - if(projectsObj[41]?.type == 3 && projectsObj[1]?.type != 3){ - avPlayer.playAudio(['voice/上车准备.mp3']) - } - //不做模拟灯光,不做上车准备 =>(请起步,完成考试) - if(projectsObj[41]?.type == 3 && projectsObj[1]?.type == 3){ - avPlayer.playAudio(['voice/402001.mp3']) - } - } + // if(examSubject == 3){ + // //不做模拟灯光,需要做上车准备 =>(请上车准备) + // if(projectsObj[41]?.type == 3 && projectsObj[1]?.type != 3){ + // avPlayer.playAudio(['voice/上车准备.mp3']) + // } + // //不做模拟灯光,不做上车准备 =>(请起步,完成考试) + // if(projectsObj[41]?.type == 3 && projectsObj[1]?.type == 3){ + // avPlayer.playAudio(['voice/402001.mp3']) + // } + // } this.judgeUI.draw = true // 处理轨迹plc信息 @@ -406,7 +406,6 @@ export default class Judge { this.xmmcStr = '无'; this.xmmcCode = ''; this.xmdm = ''; - this.judgeUI.isDeductedPopShow = false this.judgeUI.currentXmdm = undefined; break; } @@ -555,7 +554,10 @@ export default class Judge { // kmCode && avPlayer.playAudio([`voice/${kmCode}.mp3`],true) // } // } - setTimeout(()=>{if(param512[7] != 0){this.judgeUI.isDeductedPopShow = true}},200) + setTimeout(()=>{if(param512[7] != 0){ + clearTimeout(this.deductedPopShowTimer) + this.judgeUI.isDeductedPopShow = true + }},200) //项目已考不上传监管信息 if (!isEnd) { judgeTask.addTask(async () => { @@ -590,6 +592,9 @@ export default class Judge { }, {isDelay: true}) } } + this.deductedPopShowTimer = setTimeout(()=>{ + this.judgeUI.isDeductedPopShow = false + },(param512[5] || 0) * 1000) judgeUI.projectsObj[xmdm].isEnd = true; break; } @@ -930,7 +935,7 @@ export default class Judge { } //考试合格自动退出 - if(examSubject == 3 && (param302 == 4)){ + if(examSubject == 3 && (param302 == 4 || param302 == 7) || param302 == 8){ await examJudgeEndExam() this.isExamEnd = true return @@ -1564,7 +1569,7 @@ export default class Judge { const bytes = await this.getMessageHeartbeat(); bytes && globalThis.judgeUdp.send(bytes) - }, 200) + }, 10) globalThis.judgeTimer = judgeTimer; } @@ -1664,6 +1669,7 @@ export default class Judge { private tempData: any private performInfo: any private isEndTip:boolean = false; + private deductedPopShowTimer:number = 0; private ksjs: { // 累计前进距离 qjjl: number,