Compare commits
4 Commits
dcbcf9d1ad
...
a0c4c21e90
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0c4c21e90 | ||
|
|
20b9316f79 | ||
|
|
1edfb1d47b | ||
|
|
33a3e7fd96 |
@ -1,6 +1,6 @@
|
|||||||
import request from "../utils/Request"
|
import request from '../utils/Request'
|
||||||
import http from "@ohos.net.http"
|
import http from '@ohos.net.http'
|
||||||
|
import { CarCheckDataType, DeviceParamType, RegistrationDeviceNoRsp } from '../model'
|
||||||
|
|
||||||
export async function carConfigurationInfo(params: object) {
|
export async function carConfigurationInfo(params: object) {
|
||||||
return request<object>({
|
return request<object>({
|
||||||
@ -11,15 +11,10 @@ export async function carConfigurationInfo(params: object) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
interface registrationDeviceNoParams {
|
|
||||||
time: string
|
|
||||||
deviceName: string
|
|
||||||
type: string
|
|
||||||
}
|
|
||||||
|
|
||||||
//设备注册
|
//设备注册
|
||||||
export async function registrationDeviceNo(params: registrationDeviceNoParams) {
|
export async function registrationDeviceNo(params: DeviceParamType) {
|
||||||
return request<object>({
|
return request<RegistrationDeviceNoRsp>({
|
||||||
url: '/der2/services/exam/registrationDeviceNo.ws',
|
url: '/der2/services/exam/registrationDeviceNo.ws',
|
||||||
data: `<?xml version="1.0" encoding="UTF-8" ?>
|
data: `<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
<registrationDeviceNoReq>
|
<registrationDeviceNoReq>
|
||||||
@ -31,17 +26,9 @@ export async function registrationDeviceNo(params: registrationDeviceNoParams) {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
interface uploadExamCarCheckResultParams {
|
|
||||||
time: string
|
|
||||||
carId: string
|
|
||||||
examinationRoomId: string
|
|
||||||
plateNo: string
|
|
||||||
flag: string
|
|
||||||
condition: string
|
|
||||||
}
|
|
||||||
|
|
||||||
//自检结果上传
|
//自检结果上传
|
||||||
export async function uploadExamCarCheckResult(params: uploadExamCarCheckResultParams) {
|
export async function uploadExamCarCheckResult(params: CarCheckDataType) {
|
||||||
return request<object>({
|
return request<object>({
|
||||||
url: '/der2/services/exam/uploadExamCarCheckResult.ws',
|
url: '/der2/services/exam/uploadExamCarCheckResult.ws',
|
||||||
data: `<?xml version="1.0" encoding="UTF-8" ?>
|
data: `<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import writeObjectOutNew from './judgeNew';
|
|||||||
import FileUtil from '../common/utils/File';
|
import FileUtil from '../common/utils/File';
|
||||||
import http from '@ohos.net.http';
|
import http from '@ohos.net.http';
|
||||||
|
|
||||||
let baseHost = AppStorage.get('host');
|
let baseHost: string = AppStorage.get('host');
|
||||||
|
|
||||||
|
|
||||||
// 下载模型
|
// 下载模型
|
||||||
|
|||||||
@ -1,15 +1,9 @@
|
|||||||
import request from "../utils/Request"
|
import request from '../utils/Request'
|
||||||
import http from "@ohos.net.http"
|
import http from '@ohos.net.http'
|
||||||
|
import { UserLoginType } from '../model/ExaminerLogin'
|
||||||
|
|
||||||
|
|
||||||
interface ExaminerLoginParams {
|
export async function examinerLogin(params: UserLoginType) {
|
||||||
carId
|
|
||||||
examinationRoomId
|
|
||||||
username
|
|
||||||
password
|
|
||||||
}
|
|
||||||
|
|
||||||
export async function examinerLogin(params: ExaminerLoginParams) {
|
|
||||||
return request({
|
return request({
|
||||||
url: '/der2/services/exam/examinerLogin.ws',
|
url: '/der2/services/exam/examinerLogin.ws',
|
||||||
data: `<?xml version="1.0" encoding="UTF-8" ?>
|
data: `<?xml version="1.0" encoding="UTF-8" ?>
|
||||||
|
|||||||
17
entry/src/main/ets/common/service/ExaminerService.ets
Normal file
17
entry/src/main/ets/common/service/ExaminerService.ets
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
//考官登录信息
|
||||||
|
// export async function examinerLoginService(params) {
|
||||||
|
// let res: any = await examinerLogin(params)
|
||||||
|
// AppStorage.setOrCreate('examinerInfo', res?.examinerLoginRsp?.body)
|
||||||
|
// console.log('jiangsong1: examinerLoginService' + JSON.stringify(res))
|
||||||
|
// //{"examinerLoginRsp":{"head":{"resultCode":"0","resultMessage":"%E8%80%83%E8%AF%95%E5%91%98%E7%99%BB%E5%BD%95-%E6%88%90%E5%8A%9F","time":"2023-06-01 10:06:39"},"body":{"code":"006","name":"%E8%80%836","statusRgpp":"1"}}}
|
||||||
|
// return res
|
||||||
|
// }
|
||||||
|
|
||||||
|
//获取考车信息
|
||||||
|
// export async function initParseCarInfo(params) {
|
||||||
|
// let res: any = await initCarInfoCache(params)
|
||||||
|
// console.log('jiangsong1: examinerLoginService' + JSON.stringify(res))
|
||||||
|
// //{"examinerLoginRsp":{"head":{"resultCode":"0","resultMessage":"%E8%80%83%E8%AF%95%E5%91%98%E7%99%BB%E5%BD%95-%E6%88%90%E5%8A%9F","time":"2023-06-01 10:06:39"},"body":{"code":"006","name":"%E8%80%836","statusRgpp":"1"}}}
|
||||||
|
// return res
|
||||||
|
// }
|
||||||
@ -1,19 +0,0 @@
|
|||||||
import { examinerLogin } from '../../api/login'
|
|
||||||
import { initCarInfoCache } from '../../api/index'
|
|
||||||
|
|
||||||
//考官登录信息
|
|
||||||
export async function examinerLoginService(params) {
|
|
||||||
let res: any = await examinerLogin(params)
|
|
||||||
AppStorage.setOrCreate('examinerInfo', res?.examinerLoginRsp?.body)
|
|
||||||
console.log('jiangsong1: examinerLoginService' + JSON.stringify(res))
|
|
||||||
//{"examinerLoginRsp":{"head":{"resultCode":"0","resultMessage":"%E8%80%83%E8%AF%95%E5%91%98%E7%99%BB%E5%BD%95-%E6%88%90%E5%8A%9F","time":"2023-06-01 10:06:39"},"body":{"code":"006","name":"%E8%80%836","statusRgpp":"1"}}}
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
|
|
||||||
//获取考车信息
|
|
||||||
export async function initParseCarInfo(params) {
|
|
||||||
let res: any = await initCarInfoCache(params)
|
|
||||||
console.log('jiangsong1: examinerLoginService' + JSON.stringify(res))
|
|
||||||
//{"examinerLoginRsp":{"head":{"resultCode":"0","resultMessage":"%E8%80%83%E8%AF%95%E5%91%98%E7%99%BB%E5%BD%95-%E6%88%90%E5%8A%9F","time":"2023-06-01 10:06:39"},"body":{"code":"006","name":"%E8%80%836","statusRgpp":"1"}}}
|
|
||||||
return res
|
|
||||||
}
|
|
||||||
@ -1,12 +1,12 @@
|
|||||||
import TcpClient from './TcpClient';
|
import TcpClient from './TcpClient';
|
||||||
import { getSyncData } from '../service/initable';
|
|
||||||
import hilog from '@ohos.hilog';
|
|
||||||
import FileUtil from '../../common/utils/File';
|
import FileUtil from '../../common/utils/File';
|
||||||
import { GlobalConfig } from '../../config/index';
|
import { GlobalConfig } from '../../config/index';
|
||||||
|
|
||||||
let intervalSendmsg
|
let intervalSendmsg
|
||||||
|
|
||||||
export async function getTCP(flag = false) {
|
export async function getTCP(flag = false) {
|
||||||
globalThis.getCloseTcp = true
|
globalThis.getCloseTcp = true
|
||||||
const context= AppStorage.get('context')
|
const context = AppStorage.get('context')
|
||||||
const fileUtil = new FileUtil(context)
|
const fileUtil = new FileUtil(context)
|
||||||
const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/ipConfig.txt');
|
const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/ipConfig.txt');
|
||||||
if (data === '' || data === undefined) {
|
if (data === '' || data === undefined) {
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
import systemTime from '@ohos.systemDateTime';
|
import systemTime from '@ohos.systemDateTime';
|
||||||
import { timeSynchronization } from '../../api';
|
import { timeSynchronization } from '../../api';
|
||||||
import App from '@system.app';
|
|
||||||
|
|
||||||
export function isSevenDaysAgo(date, days = 2) {
|
export function isSevenDaysAgo(date, days = 2) {
|
||||||
const today = new Date(); // 当前日期
|
const today = new Date(); // 当前日期
|
||||||
@ -90,7 +89,7 @@ export async function timeSynchronize() {
|
|||||||
}
|
}
|
||||||
let res: any = await timeSynchronization(params)
|
let res: any = await timeSynchronization(params)
|
||||||
res = res.timeSynchronizationRsp;
|
res = res.timeSynchronizationRsp;
|
||||||
AppStorage.setOrCreate('timeInfo',res.body)
|
AppStorage.setOrCreate('timeInfo', res.body)
|
||||||
|
|
||||||
|
|
||||||
return res;
|
return res;
|
||||||
|
|||||||
@ -0,0 +1,27 @@
|
|||||||
|
export interface CarCheckDataType {
|
||||||
|
time?: string;
|
||||||
|
carId?: string;
|
||||||
|
examinationRoomId?: string;
|
||||||
|
plateNo?: string;
|
||||||
|
flag?: 'N' | 'Y';
|
||||||
|
condition?: string;
|
||||||
|
carNo?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CarConfigurationParamsType {
|
||||||
|
time: string;
|
||||||
|
deviceName: string;
|
||||||
|
type: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CarInfoType {
|
||||||
|
carId?: string;
|
||||||
|
examinationRoomId?: string;
|
||||||
|
plateNo?: string;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
@ -75,14 +75,16 @@ export interface VideoConfig {
|
|||||||
export interface CommonType {
|
export interface CommonType {
|
||||||
key: string;
|
key: string;
|
||||||
}
|
}
|
||||||
export interface baseInfo {
|
|
||||||
hasAuth: boolean,
|
export interface BaseInfoType {
|
||||||
version:string,
|
hasAuth?: boolean,
|
||||||
judgeVersion:string,
|
version?: string,
|
||||||
tcpSendNum:number,
|
judgeVersion?: string,
|
||||||
videoVersion:string,
|
tcpSendNum?: number,
|
||||||
ratio:number,
|
videoVersion?: string,
|
||||||
pathDir:string,
|
ratio?: number,
|
||||||
context:common.UIAbilityContext,
|
pathDir?: string,
|
||||||
isJudgeInitBool:boolean,
|
context?: common.UIAbilityContext,
|
||||||
|
isJudgeInitBool?: boolean,
|
||||||
|
deviceNo?: string
|
||||||
}
|
}
|
||||||
14
entry/src/main/ets/model/api.ets
Normal file
14
entry/src/main/ets/model/api.ets
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
export interface RegistrationDeviceNoRsp {
|
||||||
|
registrationDeviceNoRsp: RegistrationDeviceNoRspDetails;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface RegistrationDeviceNoRspDetails {
|
||||||
|
head: Head;
|
||||||
|
}
|
||||||
|
|
||||||
|
interface Head {
|
||||||
|
resultCode: string;
|
||||||
|
time: string;
|
||||||
|
resultMessage: string;
|
||||||
|
}
|
||||||
|
|
||||||
@ -10,4 +10,8 @@ export * from "./Register"
|
|||||||
|
|
||||||
export * from "./VideoConfig"
|
export * from "./VideoConfig"
|
||||||
|
|
||||||
export * from "./UserInfo"
|
export * from "./UserInfo"
|
||||||
|
|
||||||
|
export * from "./CarCheck"
|
||||||
|
|
||||||
|
export * from "./api"
|
||||||
|
|||||||
@ -6,6 +6,8 @@ import testNapi from '@ohos.hiserialsdk';
|
|||||||
import { dateFormat } from '../common/utils/tools';
|
import { dateFormat } from '../common/utils/tools';
|
||||||
import { DwMapData, PassData, RealNumData, StackValueData, WarnFlagData, WarnFlagTipData } from '../mock';
|
import { DwMapData, PassData, RealNumData, StackValueData, WarnFlagData, WarnFlagTipData } from '../mock';
|
||||||
import { baseInfo } from '../model/Common';
|
import { baseInfo } from '../model/Common';
|
||||||
|
import { CarCheckDataType, CarConfigurationParams, CarInfoType } from '../model/CarCheck';
|
||||||
|
import { BusinessError } from '@ohos.base';
|
||||||
|
|
||||||
@Entry
|
@Entry
|
||||||
@Component
|
@Component
|
||||||
@ -37,13 +39,13 @@ struct Index {
|
|||||||
@State devPath: string = "/dev/ttyS3"
|
@State devPath: string = "/dev/ttyS3"
|
||||||
@State stopFlag: boolean = false
|
@State stopFlag: boolean = false
|
||||||
@State fromIndex: boolean = false
|
@State fromIndex: boolean = false
|
||||||
@State carinfo: object = {}
|
@State carInfo: CarInfoType = {}
|
||||||
private vocObj: ESObject;
|
private vocObj: ESObject;
|
||||||
|
|
||||||
// private AccountTable = new AccountTable(()=>{},CommonConstants);
|
// private AccountTable = new AccountTable(()=>{},CommonConstants);
|
||||||
aboutToAppear() {
|
aboutToAppear() {
|
||||||
const that = this
|
const that = this
|
||||||
this.carInfo=AppStorage.get('carInfo')
|
this.carInfo = AppStorage.get('carInfo')
|
||||||
this.vocObj = new voiceService(async (status: string, val: string) => {
|
this.vocObj = new voiceService(async (status: string, val: string) => {
|
||||||
if (!that.breakFlag) {
|
if (!that.breakFlag) {
|
||||||
return
|
return
|
||||||
@ -127,35 +129,34 @@ struct Index {
|
|||||||
list.map(res => {
|
list.map(res => {
|
||||||
const arr = res.split(':')
|
const arr = res.split(':')
|
||||||
this.checkList.push({
|
this.checkList.push({
|
||||||
'key': parseInt(arr[0]) + 2, 'time': arr[1]
|
key: parseInt(arr[0]) + 2,
|
||||||
|
time: arr[1]
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.checkListCopy = JSON.parse(JSON.stringify(this.checkList))
|
this.checkListCopy = JSON.parse(JSON.stringify(this.checkList))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const baseInfo=AppStorage.get('baseInfo') as baseInfo
|
const baseInfo = AppStorage.get('baseInfo') as baseInfo
|
||||||
//模拟真实数据
|
//模拟真实数据
|
||||||
const param = {
|
const param: CarConfigurationParams = {
|
||||||
"body":
|
body: {
|
||||||
{
|
|
||||||
"carIdString": this.carInfo.carId, //考车ID
|
"carIdString": this.carInfo.carId, //考车ID
|
||||||
"deviceNo": baseInfo.deviceNo
|
"deviceNo": baseInfo.deviceNo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
carConfigurationInfo(param).then(res => {
|
carConfigurationInfo(param).then((res: ESObject) => {
|
||||||
// @ts-ignore
|
const list = res.body.ES_CHECK_CAR_ITEM[0].ITEMS.split(';');
|
||||||
const data = res.body.ES_CHECK_CAR_ITEM[0].ITEMS.split(';');
|
|
||||||
this.checkList = []
|
this.checkList = []
|
||||||
const list = data
|
|
||||||
list.map(res => {
|
list.map(res => {
|
||||||
const arr = res.split(':')
|
const arr = res.split(':')
|
||||||
this.checkList.push({
|
this.checkList.push({
|
||||||
'key': parseInt(arr[0]) + 2, 'time': arr[1]
|
key: parseInt(arr[0]) + 2,
|
||||||
|
time: arr[1]
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
this.checkListCopy = JSON.parse(JSON.stringify(this.checkList))
|
this.checkListCopy = JSON.parse(JSON.stringify(this.checkList))
|
||||||
}).catch((error) => {
|
}).catch((error: BusinessError) => {
|
||||||
console.log('error12error' + error)
|
console.log('error12error' + error)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -266,6 +267,11 @@ struct Index {
|
|||||||
flag = true
|
flag = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// Object.keys(this.warnFlag).map((key) => {
|
||||||
|
// if (this.warnFlag[key] == '0') {
|
||||||
|
// flag = true
|
||||||
|
// }
|
||||||
|
// })
|
||||||
this.vocObj.playAudio({
|
this.vocObj.playAudio({
|
||||||
type: 1,
|
type: 1,
|
||||||
name: flag ? 'zjwtg.wav' : 'zjtg.wav'
|
name: flag ? 'zjwtg.wav' : 'zjtg.wav'
|
||||||
@ -274,14 +280,14 @@ struct Index {
|
|||||||
return
|
return
|
||||||
}
|
}
|
||||||
let date = new Date();
|
let date = new Date();
|
||||||
const data = {
|
const data: CarCheckDataType = {
|
||||||
time: dateFormat(date),
|
time: dateFormat(date),
|
||||||
carId: this.carInfo.carId,
|
carId: this.carInfo.carId,
|
||||||
examinationRoomId: this.carInfo.examinationRoomId,
|
examinationRoomId: this.carInfo.examinationRoomId,
|
||||||
plateNo: this.carInfo.plateNo,
|
plateNo: this.carInfo.plateNo,
|
||||||
flag: flag ? 'N' : 'Y',
|
flag: flag ? 'N' : 'Y',
|
||||||
condition: flag ? '自检不通过' : '自检通过'
|
condition: flag ? '自检不通过' : '自检通过'
|
||||||
}
|
};
|
||||||
if (!flag && this.fromIndex || true) {
|
if (!flag && this.fromIndex || true) {
|
||||||
router.pushUrl({
|
router.pushUrl({
|
||||||
url: 'pages/ExaminerLogin',
|
url: 'pages/ExaminerLogin',
|
||||||
@ -294,7 +300,7 @@ struct Index {
|
|||||||
}, parseInt(this.checkListCopy[0].time) * 1000)
|
}, parseInt(this.checkListCopy[0].time) * 1000)
|
||||||
}
|
}
|
||||||
|
|
||||||
initfackCheck(index) {
|
initfackCheck(index: number) {
|
||||||
const that = this
|
const that = this
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
console.log('indexindex', index)
|
console.log('indexindex', index)
|
||||||
@ -307,7 +313,7 @@ struct Index {
|
|||||||
that.passArray[index] = true
|
that.passArray[index] = true
|
||||||
if (index == 2) {
|
if (index == 2) {
|
||||||
let flag = false
|
let flag = false
|
||||||
const spzd=AppStorage.get('spzd')
|
const spzd = AppStorage.get('spzd')
|
||||||
for (let key in pzd) {
|
for (let key in pzd) {
|
||||||
if (spzd[key]) {
|
if (spzd[key]) {
|
||||||
that.warnFlag[index] = '1'
|
that.warnFlag[index] = '1'
|
||||||
|
|||||||
@ -1,6 +1,5 @@
|
|||||||
import router from '@ohos.router';
|
import router from '@ohos.router';
|
||||||
import TopLogo from './compontents/TopLogo';
|
import TopLogo from './compontents/TopLogo';
|
||||||
import { examinerLoginService } from '../common/service/ExaminerService';
|
|
||||||
import Md5 from '../common/utils/md5';
|
import Md5 from '../common/utils/md5';
|
||||||
import promptAction from '@ohos.promptAction';
|
import promptAction from '@ohos.promptAction';
|
||||||
import errorMsgDialog from './compontents/errorMsgDialog';
|
import errorMsgDialog from './compontents/errorMsgDialog';
|
||||||
@ -8,6 +7,8 @@ import errorMsgDialog from './compontents/errorMsgDialog';
|
|||||||
import imageBtn from './compontents/imageBtn';
|
import imageBtn from './compontents/imageBtn';
|
||||||
import { UserLoginType } from '../model/ExaminerLogin';
|
import { UserLoginType } from '../model/ExaminerLogin';
|
||||||
import { BusinessError } from '@ohos.base';
|
import { BusinessError } from '@ohos.base';
|
||||||
|
import { CarCheckDataType } from '../model/CarCheck';
|
||||||
|
import { examinerLogin } from '../api/login';
|
||||||
|
|
||||||
@Entry
|
@Entry
|
||||||
@Component
|
@Component
|
||||||
@ -93,7 +94,7 @@ struct Index {
|
|||||||
if (this.limit) {
|
if (this.limit) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
const carInfo=AppStorage.get('carInfo')
|
const carInfo: CarCheckDataType = AppStorage.get('carInfo')
|
||||||
const param: UserLoginType = {
|
const param: UserLoginType = {
|
||||||
carId: carInfo.carId as string,
|
carId: carInfo.carId as string,
|
||||||
examinationRoomId: carInfo.examinationRoomId as string,
|
examinationRoomId: carInfo.examinationRoomId as string,
|
||||||
@ -105,7 +106,8 @@ struct Index {
|
|||||||
this.limit = true
|
this.limit = true
|
||||||
try {
|
try {
|
||||||
// TODO
|
// TODO
|
||||||
examinerLoginService(param).then((res: ESObject) => {
|
examinerLogin(param).then((res: ESObject) => {
|
||||||
|
AppStorage.setOrCreate('examinerInfo', res?.examinerLoginRsp?.body)
|
||||||
console.log('res?.examinerLoginRsp?.head?.resultCode', res?.examinerLoginRsp?.head?.resultCode,
|
console.log('res?.examinerLoginRsp?.head?.resultCode', res?.examinerLoginRsp?.head?.resultCode,
|
||||||
JSON.stringify(res))
|
JSON.stringify(res))
|
||||||
this.errorDialog.close()
|
this.errorDialog.close()
|
||||||
@ -126,9 +128,9 @@ struct Index {
|
|||||||
}, router.RouterMode.Single);
|
}, router.RouterMode.Single);
|
||||||
|
|
||||||
console.log('res11', JSON.stringify(res))
|
console.log('res11', JSON.stringify(res))
|
||||||
const examinerLoginInfo=res.examinerLoginRsp.body
|
const examinerLoginInfo: ESObject = res.examinerLoginRsp.body
|
||||||
examinerLoginInfo.username= this.inputTextArr[0]
|
examinerLoginInfo.username = this.inputTextArr[0]
|
||||||
AppStorage.setOrCreate('examinerLoginInfo',examinerLoginInfo)
|
AppStorage.setOrCreate('examinerLoginInfo', examinerLoginInfo)
|
||||||
}).catch((err: BusinessError) => {
|
}).catch((err: BusinessError) => {
|
||||||
console.log('jiangsong12', JSON.stringify(err))
|
console.log('jiangsong12', JSON.stringify(err))
|
||||||
this.errorDialog.close()
|
this.errorDialog.close()
|
||||||
|
|||||||
@ -18,7 +18,9 @@ import UdpEvent from '../common/utils/UdpEvent';
|
|||||||
import { delPic } from '../service/videoService';
|
import { delPic } from '../service/videoService';
|
||||||
import imageBtn from './compontents/imageBtn';
|
import imageBtn from './compontents/imageBtn';
|
||||||
import VoiceAnnounce from './judgeSDK/utils/voiceAnnouncements';
|
import VoiceAnnounce from './judgeSDK/utils/voiceAnnouncements';
|
||||||
import {baseInfo} from '../model/Common'
|
import { baseInfo } from '../model/Common';
|
||||||
|
import { CarCheckDataType } from '../model/CarCheck';
|
||||||
|
|
||||||
// import VoiceAnnounce from './judgeSDK/utils/voiceAnnouncements';
|
// import VoiceAnnounce from './judgeSDK/utils/voiceAnnouncements';
|
||||||
|
|
||||||
@Entry
|
@Entry
|
||||||
@ -39,12 +41,12 @@ struct Index {
|
|||||||
@State loading: boolean = false
|
@State loading: boolean = false
|
||||||
@State initParamFlag: boolean = false
|
@State initParamFlag: boolean = false
|
||||||
@State fd: number = -1;
|
@State fd: number = -1;
|
||||||
@State carInfo: object = {};
|
@State carInfo: CarCheckDataType = {};
|
||||||
@State num: number = 0;
|
@State num: number = 0;
|
||||||
fileHelper = null;
|
fileHelper = null;
|
||||||
errorDialog: CustomDialogController = new CustomDialogController({
|
errorDialog: CustomDialogController = new CustomDialogController({
|
||||||
builder: errorMsgDialog({
|
builder: errorMsgDialog({
|
||||||
title:AppStorage.get('title'),
|
title: AppStorage.get('title'),
|
||||||
type: AppStorage.get('type'),
|
type: AppStorage.get('type'),
|
||||||
cancel: () => {
|
cancel: () => {
|
||||||
},
|
},
|
||||||
@ -126,8 +128,8 @@ struct Index {
|
|||||||
}, 1000)
|
}, 1000)
|
||||||
this.angle = 0
|
this.angle = 0
|
||||||
if (!this.timeInfo) {
|
if (!this.timeInfo) {
|
||||||
AppStorage.setOrCreate('type',1)
|
AppStorage.setOrCreate('type', 1)
|
||||||
AppStorage.setOrCreate('title','时间同步接口连接失败')
|
AppStorage.setOrCreate('title', '时间同步接口连接失败')
|
||||||
this.errorDialog.open()
|
this.errorDialog.open()
|
||||||
promptAction.showToast({
|
promptAction.showToast({
|
||||||
message: `时间同步接口连接失败`,
|
message: `时间同步接口连接失败`,
|
||||||
@ -141,8 +143,8 @@ struct Index {
|
|||||||
message: `车辆信息接口获取失败`,
|
message: `车辆信息接口获取失败`,
|
||||||
duration: 3000
|
duration: 3000
|
||||||
});
|
});
|
||||||
AppStorage.setOrCreate('type',1)
|
AppStorage.setOrCreate('type', 1)
|
||||||
AppStorage.setOrCreate('title','车辆信息接口获取失败')
|
AppStorage.setOrCreate('title', '车辆信息接口获取失败')
|
||||||
this.errorDialog.open()
|
this.errorDialog.open()
|
||||||
this.loading = false
|
this.loading = false
|
||||||
return
|
return
|
||||||
@ -209,7 +211,7 @@ struct Index {
|
|||||||
.fontSize(18 * this.ratio)
|
.fontSize(18 * this.ratio)
|
||||||
.width('30%')
|
.width('30%')
|
||||||
.margin({ bottom: 10 })
|
.margin({ bottom: 10 })
|
||||||
Text('V评判:' + this.baseInfo.judgeVersion)
|
Text('V评判:' + this.baseInfo.judgeVersion)
|
||||||
.fontColor('#CCAE7A')
|
.fontColor('#CCAE7A')
|
||||||
.fontSize(18 * this.ratio)
|
.fontSize(18 * this.ratio)
|
||||||
.width('30%')
|
.width('30%')
|
||||||
@ -227,7 +229,7 @@ struct Index {
|
|||||||
.onAction(() => {
|
.onAction(() => {
|
||||||
// takePhotoFn(this.context)
|
// takePhotoFn(this.context)
|
||||||
this.singlePlay = !this.singlePlay
|
this.singlePlay = !this.singlePlay
|
||||||
AppStorage.setOrCreate('singlePlay',this.singlePlay)
|
AppStorage.setOrCreate('singlePlay', this.singlePlay)
|
||||||
|
|
||||||
})
|
})
|
||||||
)
|
)
|
||||||
@ -363,7 +365,7 @@ struct Index {
|
|||||||
this.dialogVisiable = false
|
this.dialogVisiable = false
|
||||||
this.angle = 0
|
this.angle = 0
|
||||||
this.loading = false
|
this.loading = false
|
||||||
AppStorage.set('lsh','1111111111111')
|
AppStorage.set('lsh', '1111111111111')
|
||||||
globalThis.errorDialog = this.errorDialog
|
globalThis.errorDialog = this.errorDialog
|
||||||
globalThis.udpEvent = new UdpEvent();
|
globalThis.udpEvent = new UdpEvent();
|
||||||
getSyncData('MA_SYSSET').then(async data => {
|
getSyncData('MA_SYSSET').then(async data => {
|
||||||
@ -430,7 +432,7 @@ struct Index {
|
|||||||
data.forEach(sys => {
|
data.forEach(sys => {
|
||||||
//判断是否能点开始考试
|
//判断是否能点开始考试
|
||||||
if (sys.v_no === '854') {
|
if (sys.v_no === '854') {
|
||||||
AppStorage.setOrCreate('param854Str',sys.v_value)
|
AppStorage.setOrCreate('param854Str', sys.v_value)
|
||||||
}
|
}
|
||||||
if (sys.v_no === '824' && decodeURIComponent(sys.v_value) == '0') {
|
if (sys.v_no === '824' && decodeURIComponent(sys.v_value) == '0') {
|
||||||
// this.Param612Str= decodeURIComponent(sys.v_value)
|
// this.Param612Str= decodeURIComponent(sys.v_value)
|
||||||
@ -494,9 +496,9 @@ struct Index {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async heartMsg() {
|
async heartMsg() {
|
||||||
const signNum=AppStorage.get('signNum') as Number
|
const signNum = AppStorage.get('signNum') as Number
|
||||||
const statue=AppStorage.get('statue') as Number
|
const statue = AppStorage.get('statue') as Number
|
||||||
const lsh=AppStorage.get('lsh') as String
|
const lsh = AppStorage.get('lsh') as String
|
||||||
const arr = [signNum || 0, statue || 1]
|
const arr = [signNum || 0, statue || 1]
|
||||||
let tmpList = [];
|
let tmpList = [];
|
||||||
tmpList.push(string2Bytes(arr[0], 1 * 8)[0])
|
tmpList.push(string2Bytes(arr[0], 1 * 8)[0])
|
||||||
@ -520,8 +522,8 @@ struct Index {
|
|||||||
|
|
||||||
async onPageShow() {
|
async onPageShow() {
|
||||||
console.log('ttttt', 1111)
|
console.log('ttttt', 1111)
|
||||||
this.singlePlay=AppStorage.get('singlePlay')
|
this.singlePlay = AppStorage.get('singlePlay')
|
||||||
this.baseInfo=AppStorage.get('baseInfo') as baseInfo
|
this.baseInfo = AppStorage.get('baseInfo') as baseInfo
|
||||||
await this.userAuth();
|
await this.userAuth();
|
||||||
if (this.singlePlay == undefined || this.singlePlay == null) {
|
if (this.singlePlay == undefined || this.singlePlay == null) {
|
||||||
// setVideoParam()
|
// setVideoParam()
|
||||||
@ -541,12 +543,12 @@ struct Index {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.singlePlay = false
|
this.singlePlay = false
|
||||||
AppStorage.setOrCreate('singlePlay',false)
|
AppStorage.setOrCreate('singlePlay', false)
|
||||||
}
|
}
|
||||||
// this.loading = false
|
// this.loading = false
|
||||||
this.num = 0
|
this.num = 0
|
||||||
// const TcpClient: TcpClient =new TcpClient(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort)
|
// const TcpClient: TcpClient =new TcpClient(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort)
|
||||||
AppStorage.setOrCreate('lsh','1111111111111')
|
AppStorage.setOrCreate('lsh', '1111111111111')
|
||||||
}
|
}
|
||||||
|
|
||||||
async createAlbum() {
|
async createAlbum() {
|
||||||
@ -601,20 +603,20 @@ struct Index {
|
|||||||
await getCarInfo()
|
await getCarInfo()
|
||||||
await getUDP2(this.context, false)
|
await getUDP2(this.context, false)
|
||||||
getTCP()
|
getTCP()
|
||||||
this.carInfo=AppStorage.get('carInfo')
|
this.carInfo = AppStorage.get('carInfo')
|
||||||
this.deviceId = this.carInfo.carNo
|
this.deviceId = this.carInfo.carNo
|
||||||
await setCurrentTime();
|
await setCurrentTime();
|
||||||
this.timeInfo=AppStorage.get('timeInfo')
|
this.timeInfo = AppStorage.get('timeInfo')
|
||||||
const distanceClass=AppStorage.get('distanceClass') as boolean
|
const distanceClass = AppStorage.get('distanceClass') as boolean
|
||||||
if (!distanceClass) {
|
if (!distanceClass) {
|
||||||
const distanceClass = new GetDistance(this.context)
|
const distanceClass = new GetDistance(this.context)
|
||||||
await distanceClass.initFolder()
|
await distanceClass.initFolder()
|
||||||
AppStorage.setOrCreate('distanceClass',distanceClass)
|
AppStorage.setOrCreate('distanceClass', distanceClass)
|
||||||
console.info('surenjun', 'distanceClass=>初始化完成')
|
console.info('surenjun', 'distanceClass=>初始化完成')
|
||||||
}
|
}
|
||||||
this.carNum = this.carInfo.plateNo;
|
this.carNum = this.carInfo.plateNo;
|
||||||
this.version = this.baseInfo.version;
|
this.version = this.baseInfo.version;
|
||||||
this.hasAuth = this.baseInfo.hasAuth;
|
this.hasAuth = this.baseInfo.hasAuth;
|
||||||
setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.initParamFlag = true
|
this.initParamFlag = true
|
||||||
}, 3000)
|
}, 3000)
|
||||||
|
|||||||
@ -5,7 +5,7 @@ import deviceManager from '@ohos.distributedHardware.deviceManager'
|
|||||||
import promptAction from '@ohos.promptAction'
|
import promptAction from '@ohos.promptAction'
|
||||||
import FileUtil from '../common/utils/File'
|
import FileUtil from '../common/utils/File'
|
||||||
import common from '@ohos.app.ability.common'
|
import common from '@ohos.app.ability.common'
|
||||||
import { DeviceParamType } from '../model'
|
import { DeviceParamType, RegistrationDeviceNoRsp } from '../model'
|
||||||
|
|
||||||
@Entry
|
@Entry
|
||||||
@Component
|
@Component
|
||||||
@ -31,7 +31,7 @@ struct Index {
|
|||||||
this.deviceName = value.getLocalDeviceInfoSync().deviceName
|
this.deviceName = value.getLocalDeviceInfoSync().deviceName
|
||||||
this.deviceNo = value.getLocalDeviceInfoSync().deviceId.substring(0, 10).toUpperCase()
|
this.deviceNo = value.getLocalDeviceInfoSync().deviceId.substring(0, 10).toUpperCase()
|
||||||
this.ip = 'MAC-' + this.deviceNo
|
this.ip = 'MAC-' + this.deviceNo
|
||||||
AppStorage.setOrCreate('deviceNo','MAC-' + this.deviceNo)
|
AppStorage.setOrCreate('deviceNo', 'MAC-' + this.deviceNo)
|
||||||
});
|
});
|
||||||
|
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
@ -126,7 +126,7 @@ struct Index {
|
|||||||
fileUtil.addFile(`${folderPath}/deviceNo.txt`, JSON.stringify(param))
|
fileUtil.addFile(`${folderPath}/deviceNo.txt`, JSON.stringify(param))
|
||||||
AppStorage.setOrCreate('deviceNo', this.ip)
|
AppStorage.setOrCreate('deviceNo', this.ip)
|
||||||
// upDateTableByArray('DeviceInfoTable', [{ deviceId: this.ip }])
|
// upDateTableByArray('DeviceInfoTable', [{ deviceId: this.ip }])
|
||||||
registrationDeviceNo(param).then((res: ESObject) => {
|
registrationDeviceNo(param).then((res: RegistrationDeviceNoRsp) => {
|
||||||
if (res.registrationDeviceNoRsp.head.resultCode == '0') {
|
if (res.registrationDeviceNoRsp.head.resultCode == '0') {
|
||||||
promptAction.showToast({
|
promptAction.showToast({
|
||||||
message: decodeURIComponent(res.registrationDeviceNoRsp.head.resultMessage),
|
message: decodeURIComponent(res.registrationDeviceNoRsp.head.resultMessage),
|
||||||
|
|||||||
@ -1,22 +1,17 @@
|
|||||||
import router from '@ohos.router'
|
import router from '@ohos.router'
|
||||||
import { baseInfo } from '../model/Common'
|
import { CarCheckDataType } from '../model/CarCheck'
|
||||||
|
import { BaseInfoType } from '../model/Common'
|
||||||
import TopLogo from './compontents/TopLogo'
|
import TopLogo from './compontents/TopLogo'
|
||||||
|
|
||||||
@Entry
|
@Entry
|
||||||
@Component
|
@Component
|
||||||
struct Index {
|
struct Index {
|
||||||
@State ratio: number = 1280 / 960
|
@State ratio: number = 1280 / 960
|
||||||
@State carNum: string = ''
|
|
||||||
@State version: string = ''
|
|
||||||
@State hasAuth: boolean = false;
|
|
||||||
@State url: string = ''
|
@State url: string = ''
|
||||||
@State baseinfo: baseinfo = {}
|
@State baseInfo: BaseInfoType = {}
|
||||||
@State carInfo: object = {}
|
@State carInfo: CarCheckDataType = {}
|
||||||
|
|
||||||
@State @Watch('outClick') outFlag: boolean = false;
|
@State @Watch('outClick') outFlag: boolean = false;
|
||||||
|
|
||||||
// private vocObj = null;
|
|
||||||
|
|
||||||
build() {
|
build() {
|
||||||
Column() {
|
Column() {
|
||||||
TopLogo({ outFlag: $outFlag })
|
TopLogo({ outFlag: $outFlag })
|
||||||
@ -60,12 +55,12 @@ struct Index {
|
|||||||
Column() {
|
Column() {
|
||||||
Row() {
|
Row() {
|
||||||
Column() {
|
Column() {
|
||||||
Text('V ' + this.version)
|
Text('V ' + this.baseInfo.version)
|
||||||
.fontColor('#CCAE7A')
|
.fontColor('#CCAE7A')
|
||||||
.fontSize(22 * this.ratio)
|
.fontSize(22 * this.ratio)
|
||||||
.width('30%')
|
.width('30%')
|
||||||
.margin({ bottom: 10 * this.ratio })
|
.margin({ bottom: 10 * this.ratio })
|
||||||
Text('授权信息:' + (this.hasAuth ? '已授权' : '未授权'))
|
Text('授权信息:' + (this.baseInfo.hasAuth ? '已授权' : '未授权'))
|
||||||
.fontColor('#CCAE7A')
|
.fontColor('#CCAE7A')
|
||||||
.fontSize(22 * this.ratio)
|
.fontSize(22 * this.ratio)
|
||||||
.width('30%')
|
.width('30%')
|
||||||
@ -93,11 +88,8 @@ struct Index {
|
|||||||
aboutToAppear() {
|
aboutToAppear() {
|
||||||
// this.vocObj = new voiceService(async (status, val, next) => {
|
// this.vocObj = new voiceService(async (status, val, next) => {
|
||||||
// });
|
// });
|
||||||
this.carInfo=AppStorage.get('carInfo')
|
this.carInfo = AppStorage.get('carInfo')
|
||||||
this.baseinfo=AppStorage.get('baseinfo') as baseInfo
|
this.baseInfo = AppStorage.get('baseinfo') as BaseInfoType
|
||||||
this.carNum = this.carInfo.plateNo;
|
|
||||||
this.version = baseinfo.version;
|
|
||||||
this.hasAuth = baseinfo.hasAuth;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
outClick() {
|
outClick() {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user