From 68d93b3b5509bdb3c8c5b091afa99c89cea402b2 Mon Sep 17 00:00:00 2001 From: surenjun Date: Wed, 9 Oct 2024 09:15:36 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E8=AF=84=E5=88=A4=E4=BC=98?= =?UTF-8?q?=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/config/global.ts | 25 +++++++++++++++++- .../src/main/ets/entryability/EntryAbility.ts | 26 +++---------------- entry/src/main/ets/pages/Judge.ets | 22 +++++++++------- entry/src/main/ets/pages/judgeSDK/judge.ts | 5 +++- 4 files changed, 44 insertions(+), 34 deletions(-) diff --git a/entry/src/main/ets/config/global.ts b/entry/src/main/ets/config/global.ts index 398a2bd8..7f8f7127 100644 --- a/entry/src/main/ets/config/global.ts +++ b/entry/src/main/ets/config/global.ts @@ -10,5 +10,28 @@ export const GlobalConfig={ comoonfileWriteAddress:'/mnt/hmdfs/100/account/device_view/local/files', picSavePath:'/storage/cloud/100/files/Photo/', videoSavePath:'/storage/cloud/100/files/Videos/', - host:'http://172.37.55.1912:8082' + host:'http://172.37.55.1912:8082', + + version:{ + //杭州 + hz:{ + km2:['2022.03.14.01','2022.03.17.1'], + km3:[], + }, + //黑龙江 + hlg:{ + km2:['2024.03.19.01','2024.01.05.1'], + km3:['2023.09.23.01','2023.09.23.01'], + }, + //济南 + jn:{ + km2:[], + km3:['2023.12.13.01','2023.09.30.1'] + }, + //洛阳 + ly:{ + km2:['2022.06.29.01','2022.12.18.1'], + km3:['2022.08.13.01','2022.12.05.1'], + } + } } diff --git a/entry/src/main/ets/entryability/EntryAbility.ts b/entry/src/main/ets/entryability/EntryAbility.ts index d9f69815..96835384 100644 --- a/entry/src/main/ets/entryability/EntryAbility.ts +++ b/entry/src/main/ets/entryability/EntryAbility.ts @@ -6,6 +6,7 @@ import abilityAccessCtrl, { Permissions } from '@ohos.abilityAccessCtrl'; // import featureAbility from '@ohos.ability.featureAbility' import { makedir } from '../common/service/fileService' import {Array2Byte} from '../common/utils/tools' +import {GlobalConfig} from '../config/global' export default class EntryAbility extends UIAbility { onCreate(want, launchParam) { @@ -28,31 +29,12 @@ export default class EntryAbility extends UIAbility { globalThis.examinerInfo = {} globalThis.deviceNo = ''; globalThis.hasAuth = false - // globalThis.version = '2022.08.13.01'//洛阳 - // globalThis.judgeVersion = '2022.12.05.1' - // globalThis.version = '2022.06.29.01'//洛阳科目二 - // globalThis.judgeVersion = '2022.12.18.1' + globalThis.version = GlobalConfig.version.jn.km3[0]; + globalThis.judgeVersion = GlobalConfig.version.jn.km3[1]; - /***************** 黑龙江科目二 ******************/ - // globalThis.version = '2024.03.19.01' - // globalThis.judgeVersion = '2024.01.05.1' - - /***************** 黑龙江科目三 ******************/ - // globalThis.version = '2023.09.23.01' - // globalThis.judgeVersion = '2023.07.10.1' - - /***************** 杭州科目二 ******************/ - globalThis.version = '2022 03 14 01' - globalThis.judgeVersion = '2022 03 17 1' - - /****************** 济南科目三 *****************/ - // globalThis.version = '2023.12.13.01'//济南科目三 - // globalThis.judgeVersion = '2023.09.30.1' globalThis.videoVersion= '1.0' - // globalThis.videoVersion= '1.0' - // globalThis.version = '2022.03.14.01' //视频遮挡 globalThis.spzd={ spzd1:false, @@ -107,4 +89,4 @@ export default class EntryAbility extends UIAbility { makedir('/testFile'); } -} \ No newline at end of file +} diff --git a/entry/src/main/ets/pages/Judge.ets b/entry/src/main/ets/pages/Judge.ets index e60c814f..fca80179 100644 --- a/entry/src/main/ets/pages/Judge.ets +++ b/entry/src/main/ets/pages/Judge.ets @@ -1018,7 +1018,7 @@ struct Index { isManualProjectIn, getIsExitManualProject, artSubject3ProjectsCodesArr, - currentXmdm, + projectsObj } = this; const projectCode = artSubject3ProjectsCodesArr[index]; if(index === 5) { @@ -1026,13 +1026,16 @@ struct Index { } if (getIsExitManualProject(index)) { // 正在进行的项目 取消项目 - if (isManualProjectIn && projectCode === currentXmdm) { - await this.judge.setJudgeItem(currentXmdm, 2); - Prompt.showToast({ - message: '项目取消', - duration: 2000 - }) - return + if (isManualProjectIn && projectsObj[projectCode].type == '2') { + //判断人工是否能取消项目 && 当前项目有扣分的不能取消 + if(judgeConfigObj['340'] == 1 && projectsObj[projectCode].type != '5'){ + await this.judge.setJudgeItem(projectCode, 2); + Prompt.showToast({ + message: '项目取消', + duration: 2000 + }) + return + } } // 靠边停车时候可以触发 @@ -1073,7 +1076,6 @@ struct Index { carztStr, isManualProjectIn, isProjectIn, - currentXmdm, getProjectIsInRoad } = this; const projectCode = artSubject3ProjectsCodesArr[index]; @@ -1113,7 +1115,7 @@ struct Index { //项目进行中不能人工触发 if (isProjectIn) { if (param340 == 1) { - if (isManualProjectIn && (currentXmdm == projectCode)) { + if (isManualProjectIn && (projectsObj[projectCode].type == '2')) { return true } else { return false diff --git a/entry/src/main/ets/pages/judgeSDK/judge.ts b/entry/src/main/ets/pages/judgeSDK/judge.ts index 7a329bdd..7edfee52 100644 --- a/entry/src/main/ets/pages/judgeSDK/judge.ts +++ b/entry/src/main/ets/pages/judgeSDK/judge.ts @@ -412,6 +412,9 @@ export default class Judge { type: kf.type }) this.judgeUI.totalScore += thisKf.score * 1; + if(kf.xmdm != 20){ + judgeUI.projectsObj[kf.xmdm].type = '5'; + } break; //考车状态 @@ -489,7 +492,6 @@ export default class Judge { //语音播报 this.goVoiceAnnounce(event, xmdm, this.kfArr, xmjs, ksjs,xmxh) - //更新UI if (event == 1 || event == 2 || event == 3 || event == 6) { const copyProjectsObj = this.judgeUI.projectsObj; @@ -574,6 +576,7 @@ export default class Judge { // 扣分 case 3: + console.info('surenjun','扣分开始') //扣分时实时播报语音(0-否+1-是) const currentKf = kf[kfLen -1]; if (judgeConfig.kfVoiceOpen ||(examSubject == 2 && judgeConfigObj['618'] == '1') || (examSubject== 3&& judgeConfigObj['418'] == '1') ) {