Compare commits

...

2 Commits

Author SHA1 Message Date
7c57ba3e93 单机模式优化 2025-05-14 14:03:33 +08:00
c6bffaaf6f 单机模式优化 2025-05-14 12:09:31 +08:00
10 changed files with 28 additions and 28 deletions

View File

@ -1,42 +1,42 @@
import systemTime from '@ohos.systemTime';
import systemDateTime from '@ohos.systemDateTime';
import { timeSynchronization } from '../../api/index'
import { dateFormat,dateVersionFormat } from '../utils/tools';
import { dateFormat, dateVersionFormat } from '../utils/tools';
//同步时时间
export async function timeSynchronize() {
let date = new Date();
console.info('jiangsong1:timeSynchronization begin ' );
console.info('jiangsong1:timeSynchronization begin ');
let params = { time: dateFormat(date), deviceNo: globalThis.deviceNo,version:globalThis.version,judgeVersion:globalThis.judgeVersion}
let res:any = await timeSynchronization(params)
let params = {
time: dateFormat(date),
deviceNo: globalThis.deviceNo,
version: globalThis.version,
judgeVersion: globalThis.judgeVersion
}
let res: any = await timeSynchronization(params)
res = res.timeSynchronizationRsp;
globalThis.timeInfo=res.body
console.log('timeInfo',JSON.stringify(res.body))
globalThis.timeInfo = res.body
console.log('timeInfo', JSON.stringify(res.body))
return res;
}
export async function setCurrentTime():Promise<void> {
export async function setCurrentTime(): Promise<void> {
let res = await timeSynchronize();
let currentTime = res.head.time;
let times = new Date(currentTime).getTime();
console.log('jiangsong:times==' + times);
try {
await systemTime.setTime(times)
// systemTime.setTime(times).then(() => {
// console.info(`Succeeded in setting time.`);
// }).catch((error) => {
// console.info(`Failed to set time. message: ${error.message}, code: ${error.code}`);
// });
} catch(e) {
} catch (e) {
console.info(`Failed to set time. message: ${e.message}, code: ${e.code}`);
}
}
//获取当前时间并转化
export async function getCurrentTime():Promise<string> {
export async function getCurrentTime(): Promise<string> {
const date = await systemTime.getDate();
const year = date.getFullYear();
let month = date.getMonth() + 1;
@ -58,7 +58,7 @@ export async function getCurrentTime():Promise<string> {
}
//时间戳转日期
export function formatTime(time:number):string {
export function formatTime(time: number): string {
//@ts-ignore
const h = parseInt(time / 3600)
//@ts-ignore

View File

@ -230,23 +230,19 @@ struct Index {
}
async initParams() {
// deleteAllFIleLog(GlobalConfig.comoonfileWriteAddress + '/PLC/')
//设置plc udp 同步requesthost
await getUDP(this.context, false)
// 判断是否需要开启gps2导航仪A2需要
getSyncData('ES_CARINFO').then(result => {
console.log("CARINFO", JSON.stringify(result))
const carInfo = result[0] || {};
if (carInfo.kscx == 'A2') {
console.log("GPS2 udp")
// A2牵引车2号导航仪
getUDPGps2(this.context, false)
}
})
this.loading = false
await getDeviceInfo(this.context)
await getCarInfo()
await getUDP2(this.context, false)
getTCP()
@ -366,6 +362,10 @@ struct Index {
const carInfo = result[0] || {};
if ((globalThis.isA1 && carInfo.kscx != "A1") || (globalThis.isA3 && carInfo.kscx != "A3")) {
console.log("lixiao 重新拉表")
setTimeout(() => {
this.angle = 360
}, 1000)
this.angle = 0
this.networkExam(true)
return
}

View File

@ -1262,22 +1262,22 @@ struct UserInfo {
Column() {
if (globalThis.singlePlay) {
imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.满分学习_nor') })
imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r("app.media.learn_nor") })
.margin({ bottom: 12 * this.ratio })
.onClick(async () => {
await this.prePareExam(5)
})
imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.增驾_nor') })
imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r("app.media.zeng_nor") })
.margin({ bottom: 12 * this.ratio })
.onClick(async () => {
await this.prePareExam(3)
})
imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.夜考_nor') })
imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r("app.media.night_nor") })
.margin({ bottom: 12 * this.ratio })
.onClick(async () => {
await this.prePareExam(2)
})
imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.白考_nor') })
imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r("app.media.light_nor") })
.margin({ bottom: 12 * this.ratio })
.onClick(async () => {
await this.prePareExam(1)

View File

@ -48,8 +48,8 @@ struct Index {
Column() {
Row() {
imageBtn({ btnWidth: '28%', btnHeight: '71%', imgSrc: $r('app.media.A1-xz') })
.margin({ right: 80 * globalThis.ratio }).onClick(async () => {
imageBtn({ btnWidth: '28%', btnHeight: '71%', imgSrc: $r("app.media.A1_xz") })
.margin({ left: 80 * globalThis.ratio }).onClick(async () => {
globalThis.isA1 = true
router.pushUrl({
url: 'pages/Index'

View File

@ -3,7 +3,7 @@ export const judgeConfig = {
// 外壳版本号
version: "2025.05.14.01",
// 是否A1A3共用一车
isUseSameCar: true,
isUseSameCar: false,
//本地目录开关
isTrajectoryOpen: false,
//是否开启拍照

View File

Before

Width:  |  Height:  |  Size: 726 KiB

After

Width:  |  Height:  |  Size: 726 KiB

View File

Before

Width:  |  Height:  |  Size: 52 KiB

After

Width:  |  Height:  |  Size: 52 KiB

View File

Before

Width:  |  Height:  |  Size: 43 KiB

After

Width:  |  Height:  |  Size: 43 KiB

View File

Before

Width:  |  Height:  |  Size: 46 KiB

After

Width:  |  Height:  |  Size: 46 KiB

View File

Before

Width:  |  Height:  |  Size: 45 KiB

After

Width:  |  Height:  |  Size: 45 KiB