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,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,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(); // 当前日期
|
||||
@ -90,7 +89,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;
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -10,4 +10,8 @@ export * from "./Register"
|
||||
|
||||
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 { 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,13 +39,13 @@ 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);
|
||||
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
|
||||
@ -127,35 +129,34 @@ 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 = {
|
||||
"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)
|
||||
@ -307,7 +313,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,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,9 +128,9 @@ struct Index {
|
||||
}, router.RouterMode.Single);
|
||||
|
||||
console.log('res11', JSON.stringify(res))
|
||||
const examinerLoginInfo=res.examinerLoginRsp.body
|
||||
examinerLoginInfo.username= this.inputTextArr[0]
|
||||
AppStorage.setOrCreate('examinerLoginInfo',examinerLoginInfo)
|
||||
const examinerLoginInfo: ESObject = 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,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,12 +41,12 @@ 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({
|
||||
builder: errorMsgDialog({
|
||||
title:AppStorage.get('title'),
|
||||
title: AppStorage.get('title'),
|
||||
type: AppStorage.get('type'),
|
||||
cancel: () => {
|
||||
},
|
||||
@ -126,8 +128,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: `时间同步接口连接失败`,
|
||||
@ -141,8 +143,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
|
||||
@ -209,7 +211,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%')
|
||||
@ -227,7 +229,7 @@ struct Index {
|
||||
.onAction(() => {
|
||||
// takePhotoFn(this.context)
|
||||
this.singlePlay = !this.singlePlay
|
||||
AppStorage.setOrCreate('singlePlay',this.singlePlay)
|
||||
AppStorage.setOrCreate('singlePlay', this.singlePlay)
|
||||
|
||||
})
|
||||
)
|
||||
@ -363,7 +365,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 => {
|
||||
@ -430,7 +432,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)
|
||||
@ -494,9 +496,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])
|
||||
@ -520,8 +522,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()
|
||||
@ -541,12 +543,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() {
|
||||
@ -601,20 +603,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 } from '../model'
|
||||
import { DeviceParamType, RegistrationDeviceNoRsp } 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: 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%')
|
||||
@ -93,11 +88,8 @@ struct Index {
|
||||
aboutToAppear() {
|
||||
// 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.carInfo = AppStorage.get('carInfo')
|
||||
this.baseInfo = AppStorage.get('baseinfo') as BaseInfoType
|
||||
}
|
||||
|
||||
outClick() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user