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