diff --git a/build-profile.json5 b/build-profile.json5 index 66535e1..5d21fa8 100644 --- a/build-profile.json5 +++ b/build-profile.json5 @@ -4,13 +4,13 @@ { "name": "default", "material": { - "certpath": "/Users/wangzhongjie/.ohos/config/openharmony/default_car_next_xIuD6UMCLxZgyeiH-w2XdDck6DewIfdHAvOk_FUbNZo=.cer", - "storePassword": "0000001BF9AB68E8C3E0439D2AA8D641FD06550209928E9CB41AFB9E4D799D516B7D7DB8B1863601225968", + "certpath": "C:/Users/93218/.ohos/config/openharmony/default_harmony_vehicle_terminal_j6U20r4hUBYNJsocRUYxzV96xIPQLMTqn59Ua3h6tI4=.cer", + "storePassword": "0000001A3FBAE9120A580DE1C9D5F8AB398DD7175A8B9FABFBA723C6EB0B2BB78768AAB20CD625EDB6A8", "keyAlias": "debugKey", - "keyPassword": "0000001B4363BBA79693F55689ED8AD636125B8928CFC30F51866D1190ABC6372B58D7025E2650A53AFD2B", - "profile": "/Users/wangzhongjie/.ohos/config/openharmony/default_car_next_xIuD6UMCLxZgyeiH-w2XdDck6DewIfdHAvOk_FUbNZo=.p7b", + "keyPassword": "0000001AC5B516340EAB600B1F9452419BB8A854BB2BBCC2E47FCA97B67D93556BBF50F322FA80CC4A21", + "profile": "C:/Users/93218/.ohos/config/openharmony/default_harmony_vehicle_terminal_j6U20r4hUBYNJsocRUYxzV96xIPQLMTqn59Ua3h6tI4=.p7b", "signAlg": "SHA256withECDSA", - "storeFile": "/Users/wangzhongjie/.ohos/config/openharmony/default_car_next_xIuD6UMCLxZgyeiH-w2XdDck6DewIfdHAvOk_FUbNZo=.p12" + "storeFile": "C:/Users/93218/.ohos/config/openharmony/default_harmony_vehicle_terminal_j6U20r4hUBYNJsocRUYxzV96xIPQLMTqn59Ua3h6tI4=.p12" } } ], diff --git a/entry/src/main/ets/pages/Judge/LargeJudgeBusiness.ets b/entry/src/main/ets/pages/Judge/LargeJudgeBusiness.ets index 2f55c18..1509c62 100644 --- a/entry/src/main/ets/pages/Judge/LargeJudgeBusiness.ets +++ b/entry/src/main/ets/pages/Judge/LargeJudgeBusiness.ets @@ -41,9 +41,13 @@ import { BaseJudge, GetSysSetResult } from './Typing'; import { GetSyncData } from '../../utils/table/Operation'; import promptAction from '@ohos.promptAction'; import { JudgePage } from '../Judge'; +import systemDateTime from '@ohos.systemDateTime'; export class LargeJudge implements BaseJudge { + private mockLight: boolean = false + private mode: number = 1 + private async GetJudgeBeginData(projects: Project[], carType: string, kssycs: string, isDdxk: boolean, ddxkTime: number, projectsCenterObj: Object, ddxkKsxmArr: string[], ddxkKfArr: string[], passingScore: number, wayno: number, name: string, lsh: string, idCard: string, isExam: boolean) { const examinerInfo = AppStorage.get('examinerInfo') const examinerName = examinerInfo?.name || "" @@ -84,7 +88,7 @@ export class LargeJudge implements BaseJudge { ykkkcs: 1, wayno: Number(wayno), czlx: 0, - kskssj: await systemTime.getCurrentTime(), + kskssj: await systemDateTime.getCurrentTime(), passing: Number(passingScore), ksxm, //断点续考 @@ -96,9 +100,9 @@ export class LargeJudge implements BaseJudge { special: [], sczb: (sczb === undefined || sczb == '0') ? 0 : 1, sczbkf: kfdm, - dmndg: false, - mfxx: false, - mfxxn: false + dmndg: this.mockLight, + mfxx: this.mode === 5, + mfxxn: this.mode === 3 || this.mode === 4 } dConsole.info(JudgeTag, '5.获取开始考试数据完成') return beginInfo @@ -167,12 +171,12 @@ export class LargeJudge implements BaseJudge { return initInfo }; - public async JudgeInit(mode: number, carName: string): Promise { + public async JudgeInit(carName: string): Promise { const systemParams = await GetSyncData('MA_SYSTEMPARM') let currentParams: RouteParamsType = router.getParams() as RouteParamsType; + this.mode = currentParams.mode let totalScore: number let wayno: number - let mockLight: boolean let carlist: string let passingScore: number let examMileage: string @@ -182,7 +186,7 @@ export class LargeJudge implements BaseJudge { let singlePlay: boolean = AppStorage.get("singlePlay") let systemparmArr: Array = [] let projects: Array = [] - if (mode === 2) { + if (this.mode === 2) { totalScore = Number(currentParams.score) || totalScore } if (singlePlay) { @@ -191,7 +195,7 @@ export class LargeJudge implements BaseJudge { //真实监管下发的项目 let kStringArr: string[] = (currentParams.kString?.split(',') || []).filter(item => item); // 单机模式下增驾进模拟灯光 - mockLight = kStringArr.includes("41700") || singlePlay && mode === 3 + this.mockLight = kStringArr.includes("41700") || singlePlay && this.mode === 3 let isInExam = kStringArr.length > 0; @@ -216,27 +220,27 @@ export class LargeJudge implements BaseJudge { //根据车型获取应行驶里程数 if (no1 == 3 && no3 == 15 && Number(carNo) == no2) { let mileage = (decodeURI(systemParam.txt1) || '').split('^') - if (mode === 1) { + if (this.mode === 1) { examMileage = mileage[1] - } else if (mode === 2) { + } else if (this.mode === 2) { examMileage = mileage[2] } else { examMileage = mileage[0] } } // 满分学习里程 - if (mode === 5 && no1 == 3 && no2 == Number(carNo) && no3 == 63) { + if (this.mode === 5 && no1 == 3 && no2 == Number(carNo) && no3 == 63) { let data = decodeURI(systemParam.txt1)?.split("^") examMileage = data[1] || examMileage } //获取当前考车的考试项目 - if (mode === 2 && no1 == 3 && no2 == Number(carNo) && no3 == 46) { + if (this.mode === 2 && no1 == 3 && no2 == Number(carNo) && no3 == 46) { // 夜考必考项目读取 allItems = decodeURIComponent(systemParam.txt1).split(',').filter(txt => txt !== '') - } else if (mode !== 2 && no1 == 3 && no2 == Number(carNo) && no3 == 10) { + } else if (this.mode !== 2 && no1 == 3 && no2 == Number(carNo) && no3 == 10) { // 其他模式必考项目获取 allItems = decodeURIComponent(systemParam.txt1).split(',').filter(txt => txt !== '') - } else if (mode == 5 && no1 == 3 && no2 == Number(carNo) && no3 == 63) { + } else if (this.mode == 5 && no1 == 3 && no2 == Number(carNo) && no3 == 63) { // 满分学习项目 let data = decodeURI(systemParam.txt1)?.split("^") allItems = data[0]?.split(",").filter(item => item !== "") || [] @@ -259,19 +263,19 @@ export class LargeJudge implements BaseJudge { if (no1 == 6) { const name = decodeURI(systemParam.txt1) // 白考过滤掉夜间行驶 - if (mode !== 2 && no2 == 13) { + if (this.mode !== 2 && no2 == 13) { return } // 模拟夜间驾驶(灯光) - if (!mockLight && no2 == 41) { + if (!this.mockLight && no2 == 41) { return } - let isRequired = (mode === 5 && allItems.length === 0) || allItems.includes(no2 + '') + let isRequired = (this.mode === 5 && allItems.length === 0) || allItems.includes(no2 + '') let isEnd = false let isUpload = false // 夜考除夜间行驶其他项目不需要重复上传 - if (mode === 2 && no2 != 13) { + if (this.mode === 2 && no2 != 13) { isUpload = true } // 加减档自动完成,为非必须项目 @@ -291,7 +295,7 @@ export class LargeJudge implements BaseJudge { isUpload, } // 夜考时 - if (mode === 2 && no2 != 13) { + if (this.mode === 2 && no2 != 13) { currentProject.ykType = isRequired ? "1" : "3" currentProject.isEnd = !allItems.includes(no2 + '') } @@ -300,7 +304,7 @@ export class LargeJudge implements BaseJudge { projects.push(currentProject); // 真实监管下发考试项目, 夜考模式不进此逻辑 - if (isInExam && mode !== 2 && !(kStringArr.includes(txt2) || kStringArr.includes(no2 + ''))) { + if (isInExam && this.mode !== 2 && !(kStringArr.includes(txt2) || kStringArr.includes(no2 + ''))) { projectsObj[no2*1].type = '3' projectsObj[no2*1].isUpload = true projectsObj[no2*1].isEnd = true @@ -329,7 +333,6 @@ export class LargeJudge implements BaseJudge { return { totalScore, wayno, - mockLight, carlist, passingScore, examMileage, diff --git a/entry/src/main/ets/pages/Judge/SmallJudgeBusiness.ets b/entry/src/main/ets/pages/Judge/SmallJudgeBusiness.ets index 545ddbb..322dadb 100644 --- a/entry/src/main/ets/pages/Judge/SmallJudgeBusiness.ets +++ b/entry/src/main/ets/pages/Judge/SmallJudgeBusiness.ets @@ -42,6 +42,7 @@ import { BaseJudge, GetSysSetResult } from './Typing'; import { GetSyncData } from '../../utils/table/Operation'; import promptAction from '@ohos.promptAction'; import { JudgePage } from '../Judge'; +import systemDateTime from '@ohos.systemDateTime'; export class SmallJudge implements BaseJudge { @@ -85,7 +86,7 @@ export class SmallJudge implements BaseJudge { ykkkcs: 1, wayno: Number(wayno), czlx: 0, - kskssj: await systemTime.getCurrentTime(), + kskssj: await systemDateTime.getCurrentTime(), passing: Number(passingScore), ksxm, //断点续考 @@ -168,12 +169,11 @@ export class SmallJudge implements BaseJudge { return initInfo }; - public async JudgeInit(mode: number, carName: string): Promise { + public async JudgeInit(carName: string): Promise { const systemParams = await GetSyncData('MA_SYSTEMPARM') let currentParams: RouteParamsType = router.getParams() as RouteParamsType; let totalScore: number let wayno: number - let mockLight: boolean let carlist: string let passingScore: number let examMileage: string @@ -184,9 +184,6 @@ export class SmallJudge implements BaseJudge { let systemparmArr: Array = [] let projects: Array = [] let examSubject: string = "" - if (mode === 2) { - totalScore = Number(currentParams.score) || totalScore - } if (singlePlay) { wayno = Number(currentParams.wayno) || 1; } @@ -288,7 +285,6 @@ export class SmallJudge implements BaseJudge { return { totalScore, wayno, - mockLight, carlist, passingScore, examMileage, diff --git a/entry/src/main/ets/pages/Judge/Typing.ets b/entry/src/main/ets/pages/Judge/Typing.ets index af79696..2893b8f 100644 --- a/entry/src/main/ets/pages/Judge/Typing.ets +++ b/entry/src/main/ets/pages/Judge/Typing.ets @@ -6,7 +6,6 @@ import { JudgePage } from "../Judge" export interface GetSysSetResult { totalScore: number wayno: number - mockLight: boolean carlist: string passingScore: number examMileage: string @@ -19,7 +18,7 @@ export interface GetSysSetResult { } export interface BaseJudge { - JudgeInit: (mode: number, carName: string) => Promise + JudgeInit: (carName: string) => Promise JudgeStart: (callBack: Function, judgeUI: JudgePage, that: JudgeBusiness) => void Judging: (strData: string, callBack: Function, judgeUI: JudgePage, that: JudgeBusiness) => void JudgeEnd: (judgeUI: JudgePage, that: JudgeBusiness, isManual?: boolean) => void