dev #63
@ -4,7 +4,7 @@ import router from '@ohos.router'
|
||||
import { dateFormat } from '../utils/tools'
|
||||
import FileUtil from '../../common/utils/File'
|
||||
import { takePhoto, deleteAllFileByPiC } from '../../common/service/videoService'
|
||||
import { VideoConfigData } from '../../mock';
|
||||
// import { VideoConfigData } from '../../mock';
|
||||
|
||||
import {
|
||||
delSyncTable,
|
||||
@ -19,27 +19,25 @@ import fs from '@ohos.file.fs';
|
||||
|
||||
let num = 0
|
||||
|
||||
export async function getliushuiNum(context) {
|
||||
console.log('getLiushuihao')
|
||||
const fileUtil = new FileUtil(context)
|
||||
const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/liushui.txt');
|
||||
if (data === '' || data === undefined) {
|
||||
async function getliushuiNum(data) {
|
||||
// let data = AppStorage.get('liushuiNo')
|
||||
if (data) {
|
||||
num = Number(data) + 1
|
||||
let str = num.toString()
|
||||
for (let i = 0; str.length <= 5; i++) {
|
||||
str = '0' + str
|
||||
}
|
||||
globalThis.lshNo = str
|
||||
} else {
|
||||
num = 0
|
||||
let str = num.toString()
|
||||
for (let i = 0; str.length <= 5; i++) {
|
||||
str = '0' + str
|
||||
}
|
||||
globalThis.lshNo = str
|
||||
// return str
|
||||
} else {
|
||||
num = Number(JSON.parse(data).value) + 1
|
||||
let str = num.toString()
|
||||
for (let i = 0; str.length <= 5; i++) {
|
||||
str = '0' + str
|
||||
}
|
||||
globalThis.lshNo = str
|
||||
// return str
|
||||
}
|
||||
console.log('liushuiNo1',globalThis.lshNo)
|
||||
|
||||
}
|
||||
|
||||
export async function deleteAllFIleLog(path) {
|
||||
@ -67,25 +65,6 @@ export async function deleteAllFIleLog(path) {
|
||||
|
||||
}
|
||||
|
||||
export async function delHilog(day) {
|
||||
// const fileUtil = new FileUtil(globalThis.context)
|
||||
// const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/hilogTime.txt');
|
||||
// const folderPath = await fileUtil.initFolder(`/config`);
|
||||
// if (data === '' || data === undefined) {
|
||||
// const date = dateFormat(new Date()).split(' ')[0]
|
||||
// console.log('mm'.date)
|
||||
// fileUtil.addFile(`${folderPath}/hilogTime.txt`, date)
|
||||
// } else {
|
||||
// console.log('kkkkmmm2', data)
|
||||
// console.log('datadata', data, isSevenDaysAgo(data))
|
||||
// if (isSevenDaysAgo(data,day)) {
|
||||
// const date = dateFormat(new Date()).split(' ')[0]
|
||||
// fileUtil.addFile(`${folderPath}/hilogTime.txt`, date)
|
||||
// // deleteAllFileByPiC('pz', 1)
|
||||
// // fileUtil.addFile(`${folderPath}/hilogTime.txt`, JSON.stringify(num))
|
||||
// }
|
||||
// }
|
||||
}
|
||||
|
||||
function isSevenDaysAgo(date, saveDays?) {
|
||||
const today = new Date(); // 当前日期
|
||||
@ -99,54 +78,46 @@ function isSevenDaysAgo(date,saveDays?) {
|
||||
}
|
||||
|
||||
export async function setVideoParam() {
|
||||
return
|
||||
const fileUtil = new FileUtil(context)
|
||||
console.log('configconfig',)
|
||||
try{
|
||||
const data = await this.fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/config3.txt');
|
||||
|
||||
}catch(error){
|
||||
const param: VideoConfig = VideoConfigData
|
||||
const folderPath = await fileUtil.initFolder(`/config`);
|
||||
fileUtil.addFile(`${folderPath}/config3.txt`, JSON.stringify(param))
|
||||
}
|
||||
// return
|
||||
// const fileUtil = new FileUtil(context)
|
||||
// console.log('configconfig',)
|
||||
// try {
|
||||
// const data = await this.fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/config3.txt');
|
||||
//
|
||||
// } catch (error) {
|
||||
// const param: VideoConfig = VideoConfigData
|
||||
// const folderPath = await fileUtil.initFolder(`/config`);
|
||||
// fileUtil.addFile(`${folderPath}/config3.txt`, JSON.stringify(param))
|
||||
// }
|
||||
|
||||
|
||||
}
|
||||
|
||||
let fileFd
|
||||
|
||||
//配置流水号
|
||||
export async function setliushuiNum(context) {
|
||||
const fileUtil = new FileUtil(context)
|
||||
try {
|
||||
const fileData = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/liushui.txt');
|
||||
export async function setliushuiNum() {
|
||||
const data = AppStorage.get('liushuiNo')
|
||||
const liushuiDate = AppStorage.get('liushuiDate')
|
||||
console.log('liushuiNo',data,'liushuiDate',liushuiDate)
|
||||
getliushuiNum(data)
|
||||
if (data&&liushuiDate) {
|
||||
const date = new Date()
|
||||
const time1 = JSON.parse(fileData).date.split(' ')[0]
|
||||
const time1 = liushuiDate.split(' ')[0]
|
||||
const time2 = dateFormat(date).split(' ')[0]
|
||||
if (time1 == time2) {
|
||||
const param = {
|
||||
date: dateFormat(date),
|
||||
value: Number(JSON.parse(fileData).value) + 1
|
||||
if (time1 != time2) {
|
||||
AppStorage.setOrCreate('liushuiDate', dateFormat(date));
|
||||
AppStorage.setOrCreate('liushuiNo', '0');
|
||||
}else{
|
||||
AppStorage.setOrCreate('liushuiNo', Number(data) + 1);
|
||||
}
|
||||
const folderPath = await fileUtil.initFolder(`/config`);
|
||||
fileUtil.addFile(`${folderPath}/liushui.txt`, JSON.stringify(param))
|
||||
return
|
||||
}
|
||||
const param = {
|
||||
date: dateFormat(date),
|
||||
value: 0
|
||||
}
|
||||
const folderPath = await fileUtil.initFolder(`/config`);
|
||||
fileUtil.addFile(`${folderPath}/liushui.txt`, JSON.stringify(param))
|
||||
} catch (err) {
|
||||
} else {
|
||||
const date = new Date()
|
||||
const param = {
|
||||
date: dateFormat(date),
|
||||
value: 0
|
||||
// PersistentStorage.PersistProp('liushuiNo', 0);
|
||||
// PersistentStorage.PersistProp('liushuiDate', dateFormat(date));
|
||||
AppStorage.setOrCreate('liushuiNo', '0');
|
||||
AppStorage.setOrCreate('liushuiDate', dateFormat(date));
|
||||
}
|
||||
const folderPath = await fileUtil.initFolder(`/config`);
|
||||
fileUtil.addFile(`${folderPath}/liushui.txt`, JSON.stringify(param))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
//双中心表
|
||||
|
||||
@ -227,8 +227,8 @@ export async function takePhoto(param, context, dir, flag = 1, callback?) {
|
||||
const time = await getCurrentTime()
|
||||
const date = time.split(' ')[0]
|
||||
await fileHelper.createAlbum(date)
|
||||
rtsp_server.getVideoSnapshot(context, video_uri, fileName, '/jt', true, (err, snapResult) => {
|
||||
console.log('baoyihubaoyihu', video_uri, flag, JSON.stringify(snapResult))
|
||||
rtsp_server.getVideoSnapshot(context, video_uri, fileName, '/jt', true,async (err, snapResult) => {
|
||||
console.log('baoyihubaoyihu', video_uri, flag, JSON.stringify(snapResult.fileSize))
|
||||
console.log('getPhtot', JSON.stringify(snapResult))
|
||||
if(snapResult.result&&snapResult.errorCode==0){
|
||||
resolve({
|
||||
@ -238,8 +238,8 @@ export async function takePhoto(param, context, dir, flag = 1, callback?) {
|
||||
errorCode: snapResult.errorCode
|
||||
})
|
||||
}else{
|
||||
takePhoto(param, context, dir, flag, callback)
|
||||
|
||||
const data=await takePhoto(param, context, dir, flag, callback)
|
||||
resolve(data)
|
||||
// reject()
|
||||
}
|
||||
|
||||
|
||||
@ -6,6 +6,7 @@ import common from '@ohos.app.ability.common'
|
||||
import fs from '@ohos.file.fs'
|
||||
|
||||
const LOGTAG = 'LOGTAG'
|
||||
|
||||
export default class FileUtil {
|
||||
private context: common.UIAbilityContext
|
||||
private wantInfos: Want[]
|
||||
@ -50,12 +51,11 @@ export default class FileUtil{
|
||||
}));
|
||||
return path;
|
||||
}
|
||||
|
||||
/*
|
||||
* @desc 创建并覆盖文件
|
||||
*
|
||||
*/
|
||||
public addFile = async (filePath:string,content:string,type?:string)=>{
|
||||
public addFile = async (filePath: string, content: string, type?: string, fd?) => {
|
||||
const { READ_WRITE,CREATE,APPEND } = fs.OpenMode
|
||||
const isExit = fs.accessSync(filePath);
|
||||
//文件存在先删除
|
||||
@ -63,12 +63,14 @@ export default class FileUtil{
|
||||
fs.unlinkSync(filePath);
|
||||
}
|
||||
try {
|
||||
let file = fs.openSync(filePath, READ_WRITE | CREATE);
|
||||
let file
|
||||
if (!fd) {
|
||||
file = fs.openSync(filePath, READ_WRITE | CREATE);
|
||||
}
|
||||
//追加写入文件
|
||||
fs.writeSync(file.fd, content)
|
||||
fs.closeSync(file)
|
||||
console.error(LOGTAG,'写入文件成功')
|
||||
return true
|
||||
return file.fd
|
||||
|
||||
} catch (e) {
|
||||
console.error(LOGTAG, '写入失败', JSON.stringify(e))
|
||||
@ -87,6 +89,7 @@ export default class FileUtil{
|
||||
fs.closeSync(file)
|
||||
console.error(LOGTAG, '写入文件成功')
|
||||
}
|
||||
|
||||
/*
|
||||
* @desc 创建或者编辑文件
|
||||
*
|
||||
@ -251,6 +254,4 @@ export default class FileUtil{
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@ -12,6 +12,7 @@ export default class GetDistance {
|
||||
public totalDistance: number
|
||||
public totalTime:number
|
||||
public date: string
|
||||
public fd: number
|
||||
|
||||
constructor(context) {
|
||||
const fileUtil = new FileUtil(context)
|
||||
@ -22,7 +23,7 @@ export default class GetDistance {
|
||||
public initFolder= async () => {
|
||||
const {fileUtil} = this
|
||||
const time = await getCurrentTime()
|
||||
const folderPath = await fileUtil.initFolder(`/distance`);
|
||||
const folderPath = await fileUtil.initFolder(`/车辆行驶距离统计`);
|
||||
console.info('surenjun folderPath=>' ,folderPath);
|
||||
const date = time.split(' ')[0].split('-').join('_')
|
||||
const timeStr = time.split(' ')[1]
|
||||
@ -31,8 +32,8 @@ export default class GetDistance {
|
||||
this.totalDistance = 0;
|
||||
this.totalTime = 0;
|
||||
this.date = date;
|
||||
await fileUtil.editFile(
|
||||
`${folderPath}/${date}.txt`,`程序启动时间:${timeStr} 累计行驶距离:${this.totalDistance}m 累计运行时常:${this.totalTime}min`
|
||||
this.fd=await fileUtil.editFile(
|
||||
`${folderPath}/${date}.txt`,`程序启动时间:${timeStr} 累计行驶距离:${this.totalDistance}m 累计运行时常:${this.totalTime}min`,this.fd
|
||||
);
|
||||
return folderPath
|
||||
}
|
||||
|
||||
@ -259,10 +259,11 @@ export default class TcpClient {
|
||||
});
|
||||
}
|
||||
async writeLog(param){
|
||||
const fileUtil = new FileUtil(globalThis.context)
|
||||
fileUtil.editFile(`${this.folderPath}/plcLog.txt`, JSON.stringify(param)+`\n`)
|
||||
// const fileUtil = new FileUtil(globalThis.context)
|
||||
// fileUtil.editFile(`${this.folderPath}/plcLog.txt`, JSON.stringify(param)+`\n`)
|
||||
}
|
||||
async initPath(){
|
||||
return
|
||||
const fileUtil = new FileUtil(globalThis.context)
|
||||
const date=dateFormat(new Date).split(' ')[0]
|
||||
this.folderPath = await fileUtil.initFolder(`/PLC/${date}`);
|
||||
|
||||
@ -349,7 +349,7 @@ export default class UdpClientByCenter {
|
||||
// time:dateFormat(new Date()),
|
||||
// PLC: JSON.stringify(newArr.toString()),
|
||||
// })
|
||||
if(strachArr[83]!='4'||strachArr[92]!='0'){
|
||||
if(strachArr[83]!='4'){
|
||||
console.log('差分状态异常',strachArr[83],strachArr[92])
|
||||
this.writeLog({
|
||||
time:dateFormat(new Date()),
|
||||
@ -369,13 +369,13 @@ export default class UdpClientByCenter {
|
||||
this.testIfUdpConnetced(callback)
|
||||
}
|
||||
async writeLog(param){
|
||||
const fileUtil = new FileUtil(globalThis.context)
|
||||
fileUtil.editFile(`${this.folderPath}/plcLog.txt`, JSON.stringify(param)+`\n`)
|
||||
// const fileUtil = new FileUtil(globalThis.context)
|
||||
// fileUtil.editFile(`${this.folderPath}/plcLog.txt`, JSON.stringify(param)+`\n`)
|
||||
}
|
||||
async initPath(){
|
||||
const fileUtil = new FileUtil(globalThis.context)
|
||||
const date=dateFormat(new Date).split(' ')[0]
|
||||
this.folderPath = await fileUtil.initFolder(`/PLC/${date}`);
|
||||
// const fileUtil = new FileUtil(globalThis.context)
|
||||
// const date=dateFormat(new Date).split(' ')[0]
|
||||
// this.folderPath = await fileUtil.initFolder(`/PLC/${date}`);
|
||||
}
|
||||
//获取当前UDP信号
|
||||
getCurrentMessage = () => {
|
||||
|
||||
@ -30,7 +30,8 @@ export default async function request(req: any) {
|
||||
header: {
|
||||
'Content-Type': xml ? 'text/xml' : 'application/json'
|
||||
},
|
||||
extraData: xml ? data : JSON.stringify(data)
|
||||
extraData: xml ? data : JSON.stringify(data),
|
||||
connectTimeout:120000,
|
||||
}
|
||||
//params转url拼接参数
|
||||
let paramsStr = Reflect.ownKeys(params).reduce((p: string, n: string) => (`${p}${n}=${params[n]}&`), '?') || '';
|
||||
|
||||
@ -4,6 +4,7 @@ import { examinerLoginService } from '../common/service/ExaminerService';
|
||||
import Md5 from '../common/utils/md5';
|
||||
import promptAction from '@ohos.promptAction';
|
||||
import errorMsgDialog from './compontents/errorMsgDialog'
|
||||
import { voiceService } from '../common/service/voiceService';
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
@ -72,7 +73,6 @@ export default struct Index {
|
||||
ForEach(this.imgArr1, (item: Resource, index: number) => {
|
||||
if (index === this.imgArr1.length - 1) {
|
||||
Image(item).width('38%').height('24%').onClick(() => {
|
||||
|
||||
if (this.inputTextArr[0].trim() == '' || this.inputTextArr[1].trim() == '') {
|
||||
promptAction.showToast({
|
||||
message: '请输入用户名和密码',
|
||||
@ -132,10 +132,10 @@ export default struct Index {
|
||||
})
|
||||
} else {
|
||||
Image(item).width('18%').height('24%').onClick(() => {
|
||||
// this.vocObj.playAudio({
|
||||
// type: 1,
|
||||
// name: 'media_button.wav'
|
||||
// })
|
||||
this.vocObj.playAudio({
|
||||
type: 1,
|
||||
name: 'media_button.wav'
|
||||
})
|
||||
this.url = ''
|
||||
if (index < 9) {
|
||||
this.inputTextArr[this.currentInputIndex] += (index + 1).toString()
|
||||
@ -182,6 +182,8 @@ export default struct Index {
|
||||
}
|
||||
|
||||
onPageShow() {
|
||||
this.vocObj = new voiceService(async (status, val, next) => {
|
||||
});
|
||||
}
|
||||
|
||||
outClick() {
|
||||
|
||||
@ -10,7 +10,7 @@ import { getUDP, getUDP2 } from '../common/utils/GlobalUdp';
|
||||
import { initJudgeUdp } from '../common/utils/UdpJudge';
|
||||
import { judgeConfig } from './judgeSDK/utils/judgeConfig';
|
||||
import { getTCP } from '../common/utils/GlobalTcp';
|
||||
import { getliushuiNum, setliushuiNum, takePhotoFn, delHilog, setVideoParam } from '../common/service/indexService';
|
||||
import { setliushuiNum, takePhotoFn, setVideoParam } from '../common/service/indexService';
|
||||
import abilityAccessCtrl, { Permissions } from '@ohos.abilityAccessCtrl';
|
||||
import worker, { MessageEvents } from '@ohos.worker';
|
||||
import promptAction from '@ohos.promptAction'
|
||||
@ -38,6 +38,7 @@ struct Index {
|
||||
@State dialogRatio: number = 0.8
|
||||
@State ratio: number = 1700 / 960
|
||||
@State loading: boolean = true
|
||||
@State initParamFlag: boolean = false
|
||||
@State fd: number = -1;
|
||||
@State num: number = 0;
|
||||
fileHelper = null;
|
||||
@ -77,6 +78,10 @@ struct Index {
|
||||
Row() {
|
||||
Image($r('app.media.btn_setting')).width('16.7%').height('12.2%')
|
||||
.onClick(async () => {
|
||||
// this.vocObj.playAudio({
|
||||
// type: 1,
|
||||
// name: 'button_media.wav'
|
||||
// })
|
||||
if (this.loading) {
|
||||
return
|
||||
}
|
||||
@ -86,6 +91,10 @@ struct Index {
|
||||
})
|
||||
Image($r('app.media.btn_back')).width('14.4%').height('12.2%')
|
||||
.onClick(() => {
|
||||
// this.vocObj.playAudio({
|
||||
// type: 1,
|
||||
// name: 'button_media.wav'
|
||||
// })
|
||||
this.dialogVisiable = true
|
||||
})
|
||||
}
|
||||
@ -102,7 +111,14 @@ struct Index {
|
||||
.height('71%')
|
||||
.margin({ left: 80 * globalThis.ratio })
|
||||
.onClick(async () => {
|
||||
// this.vocObj.playAudio({
|
||||
// type: 1,
|
||||
// name: 'button_media.wav'
|
||||
// })
|
||||
// ||!this.initParamFlag
|
||||
if (this.loading) {
|
||||
// globalThis.title = '正在初始化,请等待5s后重试'
|
||||
// this.errorDialog.open()
|
||||
return
|
||||
}
|
||||
setTimeout(() => {
|
||||
@ -145,6 +161,10 @@ struct Index {
|
||||
if (this.loading) {
|
||||
return
|
||||
}
|
||||
// this.vocObj.playAudio({
|
||||
// type: 1,
|
||||
// name: 'button_media.wav'
|
||||
// })
|
||||
if (judgeConfig.isTrajectoryOpen) {
|
||||
router.pushUrl({
|
||||
url: 'pages/UserInfo',
|
||||
@ -172,6 +192,10 @@ struct Index {
|
||||
if (this.loading) {
|
||||
return
|
||||
}
|
||||
// this.vocObj.playAudio({
|
||||
// type: 1,
|
||||
// name: 'button_media.wav'
|
||||
// })
|
||||
router.pushUrl({
|
||||
url: 'pages/CarCheck'
|
||||
}, router.RouterMode.Single);
|
||||
@ -243,6 +267,10 @@ struct Index {
|
||||
.commStyle()
|
||||
.onClick(() => {
|
||||
this.dialogVisiable = false
|
||||
// this.vocObj.playAudio({
|
||||
// type: 1,
|
||||
// name: 'button_media.wav'
|
||||
// })
|
||||
}).margin({ right: 10 * this.ratio })
|
||||
|
||||
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
|
||||
@ -253,6 +281,10 @@ struct Index {
|
||||
}
|
||||
.commStyle()
|
||||
.onClick(() => {
|
||||
// this.vocObj.playAudio({
|
||||
// type: 1,
|
||||
// name: 'button_media.wav'
|
||||
// })
|
||||
router.back()
|
||||
})
|
||||
}.position({ y: 265 * this.ratio * this.dialogRatio, x: 115 * this.ratio * this.dialogRatio })
|
||||
@ -305,6 +337,7 @@ struct Index {
|
||||
}
|
||||
|
||||
async aboutToAppear() {
|
||||
this.initParamFlag=false
|
||||
this.dialogVisiable = false
|
||||
this.angle = 0
|
||||
this.loading = false
|
||||
@ -341,6 +374,7 @@ struct Index {
|
||||
console.log("baoyihu after postMessage :", JSON.stringify(e.data));
|
||||
// @ts-ignore
|
||||
let workData: WorkData = e.data;
|
||||
this.loading = false
|
||||
if (workData.isComplete) {
|
||||
if(globalThis.singlePlay){
|
||||
router.pushUrl({
|
||||
@ -370,8 +404,6 @@ struct Index {
|
||||
}, router.RouterMode.Single)
|
||||
}
|
||||
})
|
||||
this.loading = false
|
||||
|
||||
});
|
||||
|
||||
}
|
||||
@ -488,14 +520,17 @@ struct Index {
|
||||
this.carNum = globalThis.carInfo.plateNo;
|
||||
this.version = globalThis.version;
|
||||
this.hasAuth = globalThis.hasAuth;
|
||||
setTimeout(()=>{
|
||||
this.initParamFlag=true
|
||||
},3000)
|
||||
initJudgeUdp()
|
||||
takePhotoFn(this.context)
|
||||
clearInterval(this.interval)
|
||||
this.interval = setInterval(() => {
|
||||
console.log('kkkkmmm')
|
||||
this.num++
|
||||
setliushuiNum(this.context)
|
||||
getliushuiNum(this.context)
|
||||
setliushuiNum()
|
||||
// getliushuiNum(this.context)
|
||||
if (this.num >= 3) {
|
||||
this.heartMsg()
|
||||
}
|
||||
|
||||
@ -31,6 +31,7 @@ import { judgeConfig } from './judgeSDK/utils/judgeConfig';
|
||||
import FileUtil from '../common/utils/File';
|
||||
import SignDisplayCom from './compontents/signDisplayCom';
|
||||
import promptAction from '@ohos.promptAction';
|
||||
import { voiceService } from '../common/service/voiceService';
|
||||
|
||||
@Entry
|
||||
@Component
|
||||
@ -40,6 +41,8 @@ struct Index {
|
||||
}
|
||||
|
||||
async aboutToAppear() {
|
||||
this.vocObj = new voiceService(async (status, val, next) => {
|
||||
});
|
||||
globalThis.windowClass.setWindowSystemBarEnable([])
|
||||
const time = await getCurrentTime()
|
||||
|
||||
@ -760,6 +763,10 @@ struct Index {
|
||||
.height(118 * 0.95)
|
||||
.margin({ bottom: 8 })
|
||||
.onClick(() => {
|
||||
this.vocObj.playAudio({
|
||||
type: 1,
|
||||
name: 'button_media.wav'
|
||||
})
|
||||
this.setManualProjectFn(index)
|
||||
})
|
||||
})
|
||||
@ -792,6 +799,10 @@ struct Index {
|
||||
.alignItems(VerticalAlign.Center)
|
||||
.border({ width: 5, color: '#4D4136', radius: 30 })
|
||||
.onClick(() => {
|
||||
this.vocObj.playAudio({
|
||||
type: 1,
|
||||
name: 'button_media.wav'
|
||||
})
|
||||
this.signDisplayComVisible = true
|
||||
})
|
||||
|
||||
@ -827,6 +838,10 @@ struct Index {
|
||||
.backgroundImageSize({ width: '100%', height: '100%' })
|
||||
.margin({ bottom: 10 })
|
||||
.onClick(() => {
|
||||
this.vocObj.playAudio({
|
||||
type: 1,
|
||||
name: 'button_media.wav'
|
||||
})
|
||||
this.isDeductedPopShow = true
|
||||
})
|
||||
}
|
||||
@ -856,6 +871,10 @@ struct Index {
|
||||
.backgroundImage($rawfile('judge/anniu_nor.png'), ImageRepeat.NoRepeat)
|
||||
.backgroundImageSize({ width: '100%', height: '100%' })
|
||||
.onClick(() => {
|
||||
this.vocObj.playAudio({
|
||||
type: 1,
|
||||
name: 'button_media.wav'
|
||||
})
|
||||
if (this.judgeConfigObj['353'] == '0') {
|
||||
this.endPopupVisible = true
|
||||
} else {
|
||||
@ -919,6 +938,10 @@ struct Index {
|
||||
.backgroundImage($rawfile('judge/close.png'), ImageRepeat.NoRepeat)
|
||||
.backgroundImageSize({ width: '33.33%', height: '33.33%' })
|
||||
.onClick(() => {
|
||||
this.vocObj.playAudio({
|
||||
type: 1,
|
||||
name: 'button_media.wav'
|
||||
})
|
||||
this.signDisplayComVisible = false
|
||||
})
|
||||
}.width('100%').height('100%').position({ y: 0 }).backgroundColor('rgba(0,0,0,0.6)')
|
||||
@ -1329,6 +1352,7 @@ struct Index {
|
||||
@State defaultTabIndex: number = 0;
|
||||
private context = getContext(this) as common.UIAbilityContext;
|
||||
public kfArrScroller: Scroller = new Scroller()
|
||||
private vocObj = null;
|
||||
//档位
|
||||
@State dw: string = ''
|
||||
//速度
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
import router from '@ohos.router'
|
||||
import { voiceService } from '../common/service/voiceService'
|
||||
import TopLogo from './compontents/TopLogo'
|
||||
|
||||
@Entry
|
||||
@ -18,18 +19,30 @@ export default struct Index {
|
||||
Column() {
|
||||
Row() {
|
||||
Image($r('app.media.setting_clzc')).width('30.5%').height('74%').onClick(() => {
|
||||
// this.vocObj.playAudio({
|
||||
// type: 1,
|
||||
// name: 'button_media.wav'
|
||||
// })
|
||||
this.url = 'pages/Register'
|
||||
router.pushUrl({
|
||||
url: this.url,
|
||||
}, router.RouterMode.Single);
|
||||
})
|
||||
Image($r('app.media.setting_spjk')).width('30.5%').height('74%').onClick(() => {
|
||||
// this.vocObj.playAudio({
|
||||
// type: 1,
|
||||
// name: 'button_media.wav'
|
||||
// })
|
||||
this.url = 'pages/VideoConfig'
|
||||
router.pushUrl({
|
||||
url: this.url,
|
||||
}, router.RouterMode.Single);
|
||||
})
|
||||
Image($r('app.media.setting_xtts')).width('30.5%').height('74%').onClick(() => {
|
||||
// this.vocObj.playAudio({
|
||||
// type: 1,
|
||||
// name: 'button_media.wav'
|
||||
// })
|
||||
this.url = 'pages/TerminalInfos'
|
||||
router.pushUrl({
|
||||
url: this.url,
|
||||
@ -74,6 +87,8 @@ export default struct Index {
|
||||
}
|
||||
|
||||
aboutToAppear() {
|
||||
this.vocObj = new voiceService(async (status, val, next) => {
|
||||
});
|
||||
this.carNum = globalThis.carInfo.plateNo;
|
||||
this.version = globalThis.version;
|
||||
this.hasAuth = globalThis.hasAuth;
|
||||
|
||||
@ -133,7 +133,6 @@ struct UserInfo {
|
||||
this.updateTimeLimit = false
|
||||
this.ksksLimit = false
|
||||
this.currentUser=EmptyCandidateObject
|
||||
console.log('响应头地址响应头地址')
|
||||
const mediaTest = new FilePhoto(this.context);
|
||||
this.filePhoto = new FilePhoto(this.context);
|
||||
//语音功能on
|
||||
@ -1042,9 +1041,11 @@ struct UserInfo {
|
||||
.height(70 * this.ratio)
|
||||
.margin({ left: 65 * this.ratio, right: 10 * this.ratio })
|
||||
.onClick(() => {
|
||||
// this.avPlayer.playAudio(['button_media.wav'])
|
||||
this.prevClick()
|
||||
})
|
||||
Image($r('app.media.dk_next')).width(90 * this.ratio).height(70 * this.ratio).onClick(() => {
|
||||
this.avPlayer.playAudio(['button_media.wav'])
|
||||
this.nextClick()
|
||||
})
|
||||
}.margin({ top: 40 * this.ratio, bottom: 10 * this.ratio })
|
||||
@ -1095,6 +1096,7 @@ struct UserInfo {
|
||||
Image($r('app.media.gx_btn'))
|
||||
.commStyle()
|
||||
.onClick(() => {
|
||||
// this.avPlayer.playAudio(['button_media.wav'])
|
||||
if (this.isExamStart && !globalThis.singlePlay) {
|
||||
return
|
||||
}
|
||||
@ -1105,6 +1107,7 @@ struct UserInfo {
|
||||
Image($r('app.media.qk_btn'))
|
||||
.commStyle()
|
||||
.onClick(() => {
|
||||
// this.avPlayer.playAudio(['button_media.wav'])
|
||||
// 已开始考试不能缺考 已考过一次学员不能缺考 车上不能缺考
|
||||
if (this.ksksLimit||(this.systemParam.Param352Str=='1'&&this.currentUser.kssycs=='1')||this.systemParam.Param770Str=='1') {
|
||||
return
|
||||
@ -1128,7 +1131,6 @@ struct UserInfo {
|
||||
if(this.systemParam.Param612Str=='1'){
|
||||
return
|
||||
}
|
||||
|
||||
await this.prePareExam()
|
||||
})
|
||||
}
|
||||
@ -1157,6 +1159,7 @@ struct UserInfo {
|
||||
}
|
||||
.commStyle()
|
||||
.onClick(() => {
|
||||
this.avPlayer.playAudio(['button_media.wav'])
|
||||
this.ksksLimit = false
|
||||
this.qkFlag = false
|
||||
})
|
||||
@ -1166,6 +1169,7 @@ struct UserInfo {
|
||||
}
|
||||
.commStyle()
|
||||
.onClick(() => {
|
||||
this.avPlayer.playAudio(['button_media.wav'])
|
||||
this.qkFn()
|
||||
})
|
||||
}.position({ y: 265 * this.ratio, x: 115 * this.ratio })
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
import router from '@ohos.router';
|
||||
import { getCurrentTime } from '../../common/service/timeService';
|
||||
import { voiceService } from '../../common/service/voiceService';
|
||||
|
||||
@Component
|
||||
export default struct TopLogo {
|
||||
@ -7,6 +8,7 @@ export default struct TopLogo {
|
||||
@State timeText: string = '';
|
||||
@Link outFlag: boolean; //返回按钮触发
|
||||
private timer: any = null;
|
||||
private vocObj = null;
|
||||
|
||||
constructor() {
|
||||
super()
|
||||
@ -34,6 +36,10 @@ export default struct TopLogo {
|
||||
|
||||
Image($r('app.media.topB_back')).width('16.7%').height('12.2%')
|
||||
.onClick(() => {
|
||||
this.vocObj.playAudio({
|
||||
type: 1,
|
||||
name: 'button_media.wav'
|
||||
})
|
||||
router.back()
|
||||
this.outFlag = true
|
||||
})
|
||||
@ -47,6 +53,8 @@ export default struct TopLogo {
|
||||
|
||||
async aboutToAppear() {
|
||||
console.log('jiangsong: topLogo aboutToAppear1111')
|
||||
this.vocObj = new voiceService(async (status, val, next) => {
|
||||
});
|
||||
this.timeText = await getCurrentTime();
|
||||
this.timer = setInterval(async () => {
|
||||
this.timeText = await getCurrentTime();
|
||||
|
||||
@ -28,7 +28,7 @@ export default class FileModel{
|
||||
// 存储zip文件并解压
|
||||
public storingFiles = async (str) => {
|
||||
const {fileUtil,folderPath} = this;
|
||||
await fileUtil.editFile(`${folderPath}/model.zip`,str,'overWrite')
|
||||
await fileUtil.editFile(`${folderPath}/model.zip`,str)
|
||||
|
||||
let options = {
|
||||
level: zlib.CompressLevel.COMPRESS_LEVEL_DEFAULT_COMPRESSION,
|
||||
|
||||
@ -15,7 +15,7 @@ export const judgeConfig = {
|
||||
// 本地模型地址
|
||||
modelPath: 'models/model_enc',
|
||||
// 济南科目三
|
||||
trajectoryPath: 'logs/2024_12_20/2024_12_20_15_10_30_9999920215968_355757250887519616_段士婕/judge_exam_data.txt',
|
||||
trajectoryPath: 'logs/2024_12_26/2024_12_26_14_12_51_2412505941910_370125200404041910_赵宇/judge_exam_data.txt',
|
||||
//四合一画面配置
|
||||
fourInOneScreen:{
|
||||
//gps位数
|
||||
|
||||
@ -152,7 +152,7 @@ class AVPlayer {
|
||||
let fileResult = await mediaLib.getFileAssets(fetchOp);
|
||||
let retCount = fileResult.getCount();
|
||||
if (retCount > 0) {
|
||||
ret = fileResult.getFirstObject();
|
||||
ret = await fileResult.getFirstObject();
|
||||
return resolve(ret);
|
||||
}else{
|
||||
return reject(false);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user