From 2f9db78e1ba41efeaeb934e7acb93f63676713ac Mon Sep 17 00:00:00 2001 From: Surenjun Date: Tue, 2 Jul 2024 10:26:42 +0800 Subject: [PATCH] =?UTF-8?q?feat=EF=BC=9A=E5=90=88=E5=B9=B6master?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- entry/src/main/ets/common/utils/UdpJudge.ts | 2 +- entry/src/main/ets/pages/Index.ets | 9 ++++----- entry/src/main/ets/pages/Judge.ets | 12 ++++++------ entry/src/main/ets/pages/TerminalInfos.ets | 1 + .../main/ets/pages/compontents/SignDisplayCom.ets | 2 +- entry/src/main/ets/pages/judgeSDK/judge.ts | 5 ++--- .../src/main/ets/pages/judgeSDK/utils/judge-task.ts | 5 +++-- .../ets/pages/judgeSDK/utils/voice-announcements.ts | 4 ++-- 8 files changed, 20 insertions(+), 20 deletions(-) diff --git a/entry/src/main/ets/common/utils/UdpJudge.ts b/entry/src/main/ets/common/utils/UdpJudge.ts index a0b6fccf..6de5966d 100644 --- a/entry/src/main/ets/common/utils/UdpJudge.ts +++ b/entry/src/main/ets/common/utils/UdpJudge.ts @@ -1,7 +1,7 @@ import systemTime from '@ohos.systemDateTime'; import { Array2Byte, fillZero, string2Bytes, stringToASC } from '../../common/utils/tools'; import { testKmItems } from '../../pages/judgeSDK/dataTest/index'; -import { setJudgeUdp, setTopLineUdp } from './GlobleUdp'; +import { setJudgeUdp, setTopLineUdp } from './GlobalUdp'; import { convertGpsCoord2 } from '../utils/tools'; diff --git a/entry/src/main/ets/pages/Index.ets b/entry/src/main/ets/pages/Index.ets index b912452f..548ad25f 100644 --- a/entry/src/main/ets/pages/Index.ets +++ b/entry/src/main/ets/pages/Index.ets @@ -1,4 +1,3 @@ -// @ts-nocheck import { VideoConfig } from './interfaces' import common from '@ohos.app.ability.common'; import router from '@ohos.router' @@ -10,14 +9,15 @@ import { getEsCarModel, } from '../common/service/initable' import FileUtil from '../common/utils/File' -import { getUDP, getUDP2 } from '../common/utils/GlobleUdp' +import { getUDP, getUDP2 } from '../common/utils/GlobalUdp' import {initJudgeUdp} from '../common/utils/UdpJudge' -import { getTCP } from '../common/utils/GlobleTcp' +import { getTCP } from '../common/utils/GlobalTcp' import TcpClient from '../common/utils/TcpClient'; import testNapi from '@ohos.hiserialsdk' import {setliushuiNum,getliushuiNum,getSingleCenterTable,getDoubleCeneterTable,takePhotoFn} from '../common/service/indexService' import abilityAccessCtrl, { Permissions } from '@ohos.abilityAccessCtrl'; import worker, { MessageEvents } from '@ohos.worker'; +import Prompt from '@system.prompt'; @Entry @Component @@ -110,7 +110,7 @@ struct Index { }, 1000) this.angle = 0 if(!globalThis.timeInfo){ - promptAction.showToast({ + Prompt.showToast({ message: `网络连接失败`, duration: 3000 }); @@ -338,7 +338,6 @@ struct Index { // await this.getModel() // const arr = [0x55, 0xaa, 0x01, 0x00, 0x02, 0x01, 0x03, 0x00] // globalThis.udpClientByTopLine.sendMsg(Array2Byte(arr).buffer) - console.info(testNapi) } async getModel() { const context = this.context; diff --git a/entry/src/main/ets/pages/Judge.ets b/entry/src/main/ets/pages/Judge.ets index aebfb054..7d59c45e 100644 --- a/entry/src/main/ets/pages/Judge.ets +++ b/entry/src/main/ets/pages/Judge.ets @@ -1,5 +1,5 @@ import router from '@ohos.router' -import prompt from '@ohos.prompt' +import Prompt from '@system.prompt'; import common from '@ohos.app.ability.common'; import EndPoPup from './compontents/judge/end-popup' import LoadingPopup from './compontents/judge/loading-popup' @@ -212,7 +212,7 @@ struct Index { const projects = this.projects; if(!projects.length){ - prompt.showToast({ + Prompt.showToast({ message: '读取数据库信息失败,请重新考试!', duration: 8000 }); @@ -263,7 +263,7 @@ struct Index { }) const projects = this.projects; if (!projects.length) { - prompt.showToast({ + Prompt.showToast({ message: '读取数据库信息失败,请重新考试!', duration: 8000 }); @@ -585,7 +585,7 @@ struct Index { this.amplifiedImgIndex = index;this.isAmplifyPopShow = true } else{ if(index === 5){ - prompt.showToast({ + Prompt.showToast({ message: `${xmmcStr}未结束,不允许靠边停车`, duration: 8000 }); @@ -647,7 +647,7 @@ struct Index { if(this.judgeConfigObj['342'] == 0){ this.isDeductedPopShow = true }else{ - prompt.showToast({ + Prompt.showToast({ message: '平台配置不允许人工评判!', duration: 4000 }); @@ -672,7 +672,7 @@ struct Index { if(this.judgeConfigObj['353'] == '0' ){ this.endPopupVisible = true }else{ - prompt.showToast({ + Prompt.showToast({ message: '车上不允许手动结束考试!', duration: 4000 }); diff --git a/entry/src/main/ets/pages/TerminalInfos.ets b/entry/src/main/ets/pages/TerminalInfos.ets index 2c27b2f3..43b553eb 100644 --- a/entry/src/main/ets/pages/TerminalInfos.ets +++ b/entry/src/main/ets/pages/TerminalInfos.ets @@ -88,6 +88,7 @@ struct Index { gateway: this.inputTextList1[5],//value.gateway网关 netMask: this.inputTextList1[4],//value.netMask网络掩码 dnsServers: this.inputTextList1[6], + // @ts-ignore domain: "" }, (error) => { if (error) { diff --git a/entry/src/main/ets/pages/compontents/SignDisplayCom.ets b/entry/src/main/ets/pages/compontents/SignDisplayCom.ets index 4fe9d258..19affe5f 100644 --- a/entry/src/main/ets/pages/compontents/SignDisplayCom.ets +++ b/entry/src/main/ets/pages/compontents/SignDisplayCom.ets @@ -80,7 +80,7 @@ export default struct SignDisplayCom { @State gpsActive: number = 1 @Prop active: number = 0 @State msgStr: string = '' - @State interval: any='' + @State interval: number=0 @State @Watch('outClick') outFlag: boolean = false; private timer = null diff --git a/entry/src/main/ets/pages/judgeSDK/judge.ts b/entry/src/main/ets/pages/judgeSDK/judge.ts index 1e88a6b2..94997e4c 100644 --- a/entry/src/main/ets/pages/judgeSDK/judge.ts +++ b/entry/src/main/ets/pages/judgeSDK/judge.ts @@ -33,8 +33,7 @@ import { examJudgeMapSetParam } from './api/index' import UsbService from '../../common/service/usbService' -import prompt from '@ohos.prompt'; - +import Prompt from '@system.prompt'; const judgeTag = 'SURENJUN_JUDGE' export default class Judge{ @@ -362,7 +361,7 @@ export default class Judge{ const {judgeConfigObj,totalScore} = judgeUI if(judgeConfigObj['344'] == 1){ - prompt.showToast({ + Prompt.showToast({ message: '考试未结束,不允许手动退出!', duration: 4000 }); diff --git a/entry/src/main/ets/pages/judgeSDK/utils/judge-task.ts b/entry/src/main/ets/pages/judgeSDK/utils/judge-task.ts index b516a04a..7925f759 100644 --- a/entry/src/main/ets/pages/judgeSDK/utils/judge-task.ts +++ b/entry/src/main/ets/pages/judgeSDK/utils/judge-task.ts @@ -1,4 +1,5 @@ -import prompt from '@ohos.prompt' +import Prompt from '@system.prompt' + const TAG = 'SURENJUN_JUDGE' export default class JudgeTask{ @@ -18,7 +19,7 @@ export default class JudgeTask{ await currentTask(); }catch (e){ // console.info(TAG,'过程数据接口解析错误') - prompt.showToast({ + Prompt.showToast({ message: '过程数据接口解析错误', duration: 3000 }); diff --git a/entry/src/main/ets/pages/judgeSDK/utils/voice-announcements.ts b/entry/src/main/ets/pages/judgeSDK/utils/voice-announcements.ts index 020bcd7b..16a14643 100644 --- a/entry/src/main/ets/pages/judgeSDK/utils/voice-announcements.ts +++ b/entry/src/main/ets/pages/judgeSDK/utils/voice-announcements.ts @@ -1,5 +1,5 @@ import media from '@ohos.multimedia.media'; -import prompt from '@ohos.prompt'; +import Prompt from '@system.prompt'; const TAG = 'VoiceAnnounce' @@ -84,7 +84,7 @@ class AVPlayer { url = await globalThis.context.resourceManager.getRawFd(name); this.avPlayer.fdSrc = url; } catch (e) { - prompt.showToast({ + Prompt.showToast({ message: `${name}语音文件不存在`, duration: 4000 });