Compare commits
4 Commits
dcbcf9d1ad
...
a0c4c21e90
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a0c4c21e90 | ||
|
|
20b9316f79 | ||
|
|
1edfb1d47b | ||
|
|
33a3e7fd96 |
@ -1,6 +1,6 @@
|
||||
import request from "../utils/Request"
|
||||
import http from "@ohos.net.http"
|
||||
|
||||
import request from '../utils/Request'
|
||||
import http from '@ohos.net.http'
|
||||
import { CarCheckDataType, DeviceParamType, RegistrationDeviceNoRsp } from '../model'
|
||||
|
||||
export async function carConfigurationInfo(params: 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) {
|
||||
return request<object>({
|
||||
export async function registrationDeviceNo(params: DeviceParamType) {
|
||||
return request<RegistrationDeviceNoRsp>({
|
||||
url: '/der2/services/exam/registrationDeviceNo.ws',
|
||||
data: `<?xml version="1.0" encoding="UTF-8" ?>
|
||||
<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>({
|
||||
url: '/der2/services/exam/uploadExamCarCheckResult.ws',
|
||||
data: `<?xml version="1.0" encoding="UTF-8" ?>
|
||||
|
||||
@ -5,7 +5,7 @@ import writeObjectOutNew from './judgeNew';
|
||||
import FileUtil from '../common/utils/File';
|
||||
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 http from "@ohos.net.http"
|
||||
import request from '../utils/Request'
|
||||
import http from '@ohos.net.http'
|
||||
import { UserLoginType } from '../model/ExaminerLogin'
|
||||
|
||||
|
||||
interface ExaminerLoginParams {
|
||||
carId
|
||||
examinationRoomId
|
||||
username
|
||||
password
|
||||
}
|
||||
|
||||
export async function examinerLogin(params: ExaminerLoginParams) {
|
||||
export async function examinerLogin(params: UserLoginType) {
|
||||
return request({
|
||||
url: '/der2/services/exam/examinerLogin.ws',
|
||||
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,9 +1,9 @@
|
||||
import TcpClient from './TcpClient';
|
||||
import { getSyncData } from '../service/initable';
|
||||
import hilog from '@ohos.hilog';
|
||||
import FileUtil from '../../common/utils/File';
|
||||
import { GlobalConfig } from '../../config/index';
|
||||
|
||||
let intervalSendmsg
|
||||
|
||||
export async function getTCP(flag = false) {
|
||||
globalThis.getCloseTcp = true
|
||||
const context = AppStorage.get('context')
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import systemTime from '@ohos.systemDateTime';
|
||||
import { timeSynchronization } from '../../api';
|
||||
import App from '@system.app';
|
||||
|
||||
export function isSevenDaysAgo(date, days = 2) {
|
||||
const today = new Date(); // 当前日期
|
||||
|
||||
@ -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 {
|
||||
key: string;
|
||||
}
|
||||
export interface baseInfo {
|
||||
hasAuth: boolean,
|
||||
version:string,
|
||||
judgeVersion:string,
|
||||
tcpSendNum:number,
|
||||
videoVersion:string,
|
||||
ratio:number,
|
||||
pathDir:string,
|
||||
context:common.UIAbilityContext,
|
||||
isJudgeInitBool:boolean,
|
||||
|
||||
export interface BaseInfoType {
|
||||
hasAuth?: boolean,
|
||||
version?: string,
|
||||
judgeVersion?: string,
|
||||
tcpSendNum?: number,
|
||||
videoVersion?: string,
|
||||
ratio?: number,
|
||||
pathDir?: string,
|
||||
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;
|
||||
}
|
||||
|
||||
@ -11,3 +11,7 @@ export * from "./Register"
|
||||
export * from "./VideoConfig"
|
||||
|
||||
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 { DwMapData, PassData, RealNumData, StackValueData, WarnFlagData, WarnFlagTipData } from '../mock';
|
||||
import { baseInfo } from '../model/Common';
|
||||
import { CarCheckDataType, CarConfigurationParams, CarInfoType } from '../model/CarCheck';
|
||||
import { BusinessError } from '@ohos.base';
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
@ -37,7 +39,7 @@ struct Index {
|
||||
@State devPath: string = "/dev/ttyS3"
|
||||
@State stopFlag: boolean = false
|
||||
@State fromIndex: boolean = false
|
||||
@State carinfo: object = {}
|
||||
@State carInfo: CarInfoType = {}
|
||||
private vocObj: ESObject;
|
||||
|
||||
// private AccountTable = new AccountTable(()=>{},CommonConstants);
|
||||
@ -127,7 +129,8 @@ struct Index {
|
||||
list.map(res => {
|
||||
const arr = res.split(':')
|
||||
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))
|
||||
@ -135,27 +138,25 @@ struct Index {
|
||||
}
|
||||
const baseInfo = AppStorage.get('baseInfo') as baseInfo
|
||||
//模拟真实数据
|
||||
const param = {
|
||||
"body":
|
||||
{
|
||||
const param: CarConfigurationParams = {
|
||||
body: {
|
||||
"carIdString": this.carInfo.carId, //考车ID
|
||||
"deviceNo": baseInfo.deviceNo
|
||||
}
|
||||
}
|
||||
|
||||
carConfigurationInfo(param).then(res => {
|
||||
// @ts-ignore
|
||||
const data = res.body.ES_CHECK_CAR_ITEM[0].ITEMS.split(';');
|
||||
carConfigurationInfo(param).then((res: ESObject) => {
|
||||
const list = res.body.ES_CHECK_CAR_ITEM[0].ITEMS.split(';');
|
||||
this.checkList = []
|
||||
const list = data
|
||||
list.map(res => {
|
||||
const arr = res.split(':')
|
||||
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))
|
||||
}).catch((error) => {
|
||||
}).catch((error: BusinessError) => {
|
||||
console.log('error12error' + error)
|
||||
})
|
||||
}
|
||||
@ -266,6 +267,11 @@ struct Index {
|
||||
flag = true
|
||||
}
|
||||
}
|
||||
// Object.keys(this.warnFlag).map((key) => {
|
||||
// if (this.warnFlag[key] == '0') {
|
||||
// flag = true
|
||||
// }
|
||||
// })
|
||||
this.vocObj.playAudio({
|
||||
type: 1,
|
||||
name: flag ? 'zjwtg.wav' : 'zjtg.wav'
|
||||
@ -274,14 +280,14 @@ struct Index {
|
||||
return
|
||||
}
|
||||
let date = new Date();
|
||||
const data = {
|
||||
const data: CarCheckDataType = {
|
||||
time: dateFormat(date),
|
||||
carId: this.carInfo.carId,
|
||||
examinationRoomId: this.carInfo.examinationRoomId,
|
||||
plateNo: this.carInfo.plateNo,
|
||||
flag: flag ? 'N' : 'Y',
|
||||
condition: flag ? '自检不通过' : '自检通过'
|
||||
}
|
||||
};
|
||||
if (!flag && this.fromIndex || true) {
|
||||
router.pushUrl({
|
||||
url: 'pages/ExaminerLogin',
|
||||
@ -294,7 +300,7 @@ struct Index {
|
||||
}, parseInt(this.checkListCopy[0].time) * 1000)
|
||||
}
|
||||
|
||||
initfackCheck(index) {
|
||||
initfackCheck(index: number) {
|
||||
const that = this
|
||||
setTimeout(() => {
|
||||
console.log('indexindex', index)
|
||||
|
||||
@ -1,6 +1,5 @@
|
||||
import router from '@ohos.router';
|
||||
import TopLogo from './compontents/TopLogo';
|
||||
import { examinerLoginService } from '../common/service/ExaminerService';
|
||||
import Md5 from '../common/utils/md5';
|
||||
import promptAction from '@ohos.promptAction';
|
||||
import errorMsgDialog from './compontents/errorMsgDialog';
|
||||
@ -8,6 +7,8 @@ import errorMsgDialog from './compontents/errorMsgDialog';
|
||||
import imageBtn from './compontents/imageBtn';
|
||||
import { UserLoginType } from '../model/ExaminerLogin';
|
||||
import { BusinessError } from '@ohos.base';
|
||||
import { CarCheckDataType } from '../model/CarCheck';
|
||||
import { examinerLogin } from '../api/login';
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
@ -93,7 +94,7 @@ struct Index {
|
||||
if (this.limit) {
|
||||
return
|
||||
}
|
||||
const carInfo=AppStorage.get('carInfo')
|
||||
const carInfo: CarCheckDataType = AppStorage.get('carInfo')
|
||||
const param: UserLoginType = {
|
||||
carId: carInfo.carId as string,
|
||||
examinationRoomId: carInfo.examinationRoomId as string,
|
||||
@ -105,7 +106,8 @@ struct Index {
|
||||
this.limit = true
|
||||
try {
|
||||
// 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,
|
||||
JSON.stringify(res))
|
||||
this.errorDialog.close()
|
||||
@ -126,7 +128,7 @@ struct Index {
|
||||
}, router.RouterMode.Single);
|
||||
|
||||
console.log('res11', JSON.stringify(res))
|
||||
const examinerLoginInfo=res.examinerLoginRsp.body
|
||||
const examinerLoginInfo: ESObject = res.examinerLoginRsp.body
|
||||
examinerLoginInfo.username = this.inputTextArr[0]
|
||||
AppStorage.setOrCreate('examinerLoginInfo', examinerLoginInfo)
|
||||
}).catch((err: BusinessError) => {
|
||||
|
||||
@ -18,7 +18,9 @@ import UdpEvent from '../common/utils/UdpEvent';
|
||||
import { delPic } from '../service/videoService';
|
||||
import imageBtn from './compontents/imageBtn';
|
||||
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';
|
||||
|
||||
@Entry
|
||||
@ -39,7 +41,7 @@ struct Index {
|
||||
@State loading: boolean = false
|
||||
@State initParamFlag: boolean = false
|
||||
@State fd: number = -1;
|
||||
@State carInfo: object = {};
|
||||
@State carInfo: CarCheckDataType = {};
|
||||
@State num: number = 0;
|
||||
fileHelper = null;
|
||||
errorDialog: CustomDialogController = new CustomDialogController({
|
||||
|
||||
@ -5,7 +5,7 @@ import deviceManager from '@ohos.distributedHardware.deviceManager'
|
||||
import promptAction from '@ohos.promptAction'
|
||||
import FileUtil from '../common/utils/File'
|
||||
import common from '@ohos.app.ability.common'
|
||||
import { DeviceParamType } from '../model'
|
||||
import { DeviceParamType, RegistrationDeviceNoRsp } from '../model'
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
@ -126,7 +126,7 @@ struct Index {
|
||||
fileUtil.addFile(`${folderPath}/deviceNo.txt`, JSON.stringify(param))
|
||||
AppStorage.setOrCreate('deviceNo', this.ip)
|
||||
// upDateTableByArray('DeviceInfoTable', [{ deviceId: this.ip }])
|
||||
registrationDeviceNo(param).then((res: ESObject) => {
|
||||
registrationDeviceNo(param).then((res: RegistrationDeviceNoRsp) => {
|
||||
if (res.registrationDeviceNoRsp.head.resultCode == '0') {
|
||||
promptAction.showToast({
|
||||
message: decodeURIComponent(res.registrationDeviceNoRsp.head.resultMessage),
|
||||
|
||||
@ -1,22 +1,17 @@
|
||||
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'
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
struct Index {
|
||||
@State ratio: number = 1280 / 960
|
||||
@State carNum: string = ''
|
||||
@State version: string = ''
|
||||
@State hasAuth: boolean = false;
|
||||
@State url: string = ''
|
||||
@State baseinfo: baseinfo = {}
|
||||
@State carInfo: object = {}
|
||||
|
||||
@State baseInfo: BaseInfoType = {}
|
||||
@State carInfo: CarCheckDataType = {}
|
||||
@State @Watch('outClick') outFlag: boolean = false;
|
||||
|
||||
// private vocObj = null;
|
||||
|
||||
build() {
|
||||
Column() {
|
||||
TopLogo({ outFlag: $outFlag })
|
||||
@ -60,12 +55,12 @@ struct Index {
|
||||
Column() {
|
||||
Row() {
|
||||
Column() {
|
||||
Text('V ' + this.version)
|
||||
Text('V ' + this.baseInfo.version)
|
||||
.fontColor('#CCAE7A')
|
||||
.fontSize(22 * this.ratio)
|
||||
.width('30%')
|
||||
.margin({ bottom: 10 * this.ratio })
|
||||
Text('授权信息:' + (this.hasAuth ? '已授权' : '未授权'))
|
||||
Text('授权信息:' + (this.baseInfo.hasAuth ? '已授权' : '未授权'))
|
||||
.fontColor('#CCAE7A')
|
||||
.fontSize(22 * this.ratio)
|
||||
.width('30%')
|
||||
@ -94,10 +89,7 @@ struct Index {
|
||||
// this.vocObj = new voiceService(async (status, val, next) => {
|
||||
// });
|
||||
this.carInfo = AppStorage.get('carInfo')
|
||||
this.baseinfo=AppStorage.get('baseinfo') as baseInfo
|
||||
this.carNum = this.carInfo.plateNo;
|
||||
this.version = baseinfo.version;
|
||||
this.hasAuth = baseinfo.hasAuth;
|
||||
this.baseInfo = AppStorage.get('baseinfo') as BaseInfoType
|
||||
}
|
||||
|
||||
outClick() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user