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

View File

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

View File

@ -1262,22 +1262,22 @@ struct UserInfo {
Column() { Column() {
if (globalThis.singlePlay) { 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 }) .margin({ bottom: 12 * this.ratio })
.onClick(async () => { .onClick(async () => {
await this.prePareExam(5) 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 }) .margin({ bottom: 12 * this.ratio })
.onClick(async () => { .onClick(async () => {
await this.prePareExam(3) 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 }) .margin({ bottom: 12 * this.ratio })
.onClick(async () => { .onClick(async () => {
await this.prePareExam(2) 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 }) .margin({ bottom: 12 * this.ratio })
.onClick(async () => { .onClick(async () => {
await this.prePareExam(1) await this.prePareExam(1)

View File

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

View File

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