Merge remote-tracking branch 'origin/dev' into dev

# Conflicts:
#	entry/src/main/ets/common/utils/File.ts
This commit is contained in:
surenjun 2024-12-24 17:28:55 +08:00
commit 0fa4bb81cc
13 changed files with 178 additions and 88 deletions

View File

@ -287,7 +287,10 @@ export async function takePhotoFn(context) {
console.log('拍照失败')
return
}
console.log('takePhototakePhoto',JSON.stringify(data))
const zdyz=globalThis.param854Str?Number(globalThis.param854Str):Number(param.zdyz)
console.log('takePhototakePhoto',JSON.stringify(zdyz),)
if (Number(data.fileSize) <= (zdyz * 1000)) {
map[key1] = true
promptAction.showToast({

View File

@ -33,7 +33,7 @@ const FILE_ASSET_FETCH_COLUMNS = [photoAccessHelper.PhotoKeys.URI,
// const rtsp_server = record.createServer();
export async function startRecordVideo(param, td, context, dir, path?,index?) {
export async function startRecordVideo(param, td, context, dir, path?, index?) {
return new Promise(async (reslove, reject) => {
// const fileUtil = new FileUtil(globalThis.context)
// const date=dateFormat(new Date).split(' ')[0]
@ -47,7 +47,7 @@ export async function startRecordVideo(param, td, context, dir, path?,index?) {
if (!path) {
fileName = `movie_record${num}.mp4`
} else {
fileName = `${path}_${index||num}.mp4`
fileName = `${path}_${index || num}.mp4`
}
// @ts-ignore
@ -99,20 +99,20 @@ export async function saveStartRecordVideo(path) {
}
for (let i = 1; i <= 4; i++) {
if (param['videoRecord'+i]) {
console.log('pathpath0',path)
console.log('pathpath0', path)
record_handle[i] = await getfilehandleCode(i, param, date, path,i)
record_handle[i] = await getfilehandleCode(i, param, date, path, i)
}
}
reslove(record_handle)
})
}
async function getfilehandleCode(td, param, dir, path,index) {
async function getfilehandleCode(td, param, dir, path, index) {
return new Promise(async (reslove, reject) => {
console.log('pathpath1',path)
console.log('pathpath1', path)
const record_handle = await startRecordVideo(param, td, globalThis.context, dir, path,index)
const record_handle = await startRecordVideo(param, td, globalThis.context, dir, path, index)
// this.rocordHandleObj['rocord_handle'+td] = record_handle
reslove(record_handle)
})
@ -120,7 +120,7 @@ async function getfilehandleCode(td, param, dir, path,index) {
}
export async function getUserAlbumItemByDisplayName(displayName: string,day?,type?): Promise<photoAccessHelper.Album> {
export async function getUserAlbumItemByDisplayName(displayName: string, day?, type?): Promise<photoAccessHelper.Album> {
let fetchResult = null
let album: photoAccessHelper.Album = null
try {
@ -137,10 +137,10 @@ export async function getUserAlbumItemByDisplayName(displayName: string,day?,typ
console.log('get getUserAlbumItemByDisplayName, count: ' + JSON.stringify(fetchResult));
if (fetchResult.getCount() > 0) {
const albums = await fetchResult.getLastObject();
console.log('get getUserAlbumItemByDisplayName album111',albums.albumName)
console.log('get getUserAlbumItemByDisplayName album111', albums.albumName)
if(isSevenDaysAgo(albums.albumName,day)){
deleteAllFileByPiC(albums.albumName,type)
if (isSevenDaysAgo(albums.albumName, day)) {
deleteAllFileByPiC(albums.albumName, type)
}
console.log('get getUserAlbumItemByDisplayName album',)
}
@ -178,8 +178,33 @@ interface takePhotoParam {
*/
const fileHelper = new FileHelper();
export async function takePhoto(param, context, dir, flag = 1, callback?) {
export async function delPic(day,type) {
let phAccessHelper = photoAccessHelper.getPhotoAccessHelper(globalThis.context);
console.info('albumGetAssetsDemoCallback');
let predicates: dataSharePredicates.DataSharePredicates = new dataSharePredicates.DataSharePredicates();
let albumFetchOptions: photoAccessHelper.FetchOptions = {
fetchColumns: [],
predicates: predicates
};
let fetchOption: photoAccessHelper.FetchOptions = {
fetchColumns: [],
predicates: predicates
};
let albumList: photoAccessHelper.FetchResult<photoAccessHelper.Album> = await phAccessHelper.getAlbums(photoAccessHelper.AlbumType.USER, photoAccessHelper.AlbumSubtype.USER_GENERIC, albumFetchOptions);
let albums = await albumList.getAllObjects();
for(let i=0;i<=albums.length;i++){
let albumName=albums[i].albumName
console.log('albumNamealbumName',albumName)
if (isSevenDaysAgo(albumName, day)&&albumName!='jt'&&albumName!='pz') {
deleteAllFileByPiC(albums.albumName, type)
}
}
return
}
export async function takePhoto(param, context, dir, flag = 1, callback?) {
var video_uri = `rtsp://${param.userName}:${param.pwd}@${param.ip}:${param.port}/h264/ch${param.pztd}/main/av_stream`;
// var video_uri = `rtsp://admin:openharmony1@192.168.1.66:554/Streaming/Channels/3`;
@ -195,26 +220,31 @@ export async function takePhoto(param, context, dir, flag = 1, callback?) {
console.log("baohaowen_detectLoop round end size1:" + snapResult.fileSize);
callback({ fileSize: snapResult.fileSize, errorCode: snapResult.errorCode })
});
}
else {
console.log('baoyihubaoyihu1', video_uri, flag)
return new Promise<takePhotoParam>(async (resolve, reject) => {
const time = await getCurrentTime()
const date = time.split(' ')[0]
rtsp_server.getVideoSnapshot(context, video_uri, fileName, date, true, (err, snapResult) => {
await fileHelper.createAlbum(date)
rtsp_server.getVideoSnapshot(context, video_uri, fileName, '/jt', true, (err, snapResult) => {
console.log('baoyihubaoyihu', video_uri, flag, JSON.stringify(snapResult))
console.log('getPhtot', JSON.stringify(snapResult))
resolve({
base64: snapResult.dataString,
name: snapResult.fileName,
fileSize: snapResult.fileSize,
errorCode: snapResult.errorCode
})
if(snapResult.result&&snapResult.errorCode==0){
resolve({
base64: snapResult.dataString,
name: snapResult.fileName,
fileSize: snapResult.fileSize,
errorCode: snapResult.errorCode
})
}else{
takePhoto(param, context, dir, flag, callback)
// reject()
}
});
})
console.log('getmyLog02')
}
console.log('getmyLog03')

View File

@ -74,6 +74,19 @@ export default class FileUtil{
console.error(LOGTAG,'写入失败',JSON.stringify(e))
}
}
public openFileSync=async(filePath)=>{
const { READ_WRITE,CREATE,APPEND }= fs.OpenMode
let file = fs.openSync(filePath, READ_WRITE | APPEND |CREATE);
return file
}
public editFileWidthOutOpen(file,content){
const newStr = content + '\n'
fs.writeSync(file.fd,newStr)
fs.closeSync(file)
console.error(LOGTAG,'写入文件成功')
}
/*
* @desc
*

View File

@ -61,6 +61,7 @@ export default class GetDistance {
setInterval(()=>{
const { carId } = globalThis.carInfo;
const {date,timeStr,totalDistance}= this;
return
//"carid":"1001","startTime":"2024-08-24 08:09:01","time":"111233", "mileage":"1222"
uploadHarmonyLiCheng({
carid:carId,

View File

@ -3,7 +3,7 @@ import { getSyncData } from '../service/initable';
import hilog from '@ohos.hilog';
import FileUtil from '../../common/utils/File'
import { GlobalConfig } from '../../config/index'
export async function getTCP() {
export async function getTCP(flag=false) {
const fileUtil = new FileUtil(globalThis.context)
const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/ipConfig.txt');
if (data === '' || data === undefined) {
@ -12,14 +12,16 @@ export async function getTCP() {
}
}else{
const result=JSON.parse(data)
if (globalThis.TcpClient && globalThis.TcpClient.closeTcp) {
if (globalThis.TcpClient && globalThis.TcpClient.closeTcp&&!flag) {
globalThis.TcpClient.closeTcp(async () => {
// const tcpClient: TcpClient =new TcpClient(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort)
// globalThis.TcpClient = tcpClient
setTimeout(async () => {
await globalThis.TcpClient.rebindTcp(result.tcplocalIp, result.tcplocalIpPort, result.tcpOppositeIp, result.tcpOppositePort)
const tcpClient: TcpClient = new TcpClient(result.tcplocalIp, result.tcplocalIpPort, result.tcpOppositeIp, result.tcpOppositePort)
globalThis.TcpClient = tcpClient
await globalThis.TcpClient.bindTcp()
// await globalThis.TcpClient.rebindTcp(result.tcplocalIp, result.tcplocalIpPort, result.tcpOppositeIp, result.tcpOppositePort)
await globalThis.TcpClient.connectTcp()
await globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
globalThis.TcpClient.onError((val) => {
setTimeout(() => {
getTCP()
@ -27,7 +29,6 @@ export async function getTCP() {
})
await globalThis.TcpClient.onMessage((val) => {
setTimeout(() => {
globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
if (val) {
// const msg=val.substring(5,val.length-1)
console.log('socketTag[PLC.UdpClient] status:', globalThis.udpClient.getStatus())
@ -46,6 +47,12 @@ export async function getTCP() {
await globalThis.TcpClient.bindTcp()
await globalThis.TcpClient.connectTcp()
await globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
clearInterval(globalThis.intervalSendmsg)
globalThis.intervalSendmsg=setInterval(()=>{
if(!globalThis.getCloseTcp){
globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
}
},1000/3)
globalThis.TcpClient.onError((val) => {
setTimeout(() => {
getTCP()
@ -54,7 +61,6 @@ export async function getTCP() {
await globalThis.TcpClient.onMessage((val) => {
hilog.info(0x0000, 'testTag', "valvalval2" + JSON.stringify(val));
setTimeout(() => {
globalThis.TcpClient.sendMsg(globalThis.carInfo.carNo) //1002
if (val && globalThis.udpClient?.sendMsg) {
globalThis.udpClient?.sendMsg(val)
}

View File

@ -33,6 +33,8 @@ export default class TcpClient {
// time:dateFormat(new Date()),
// PLC:`${TAG} tcpOnerror ${JSON.stringify(err)}`,
// })
globalThis.getCloseTcp = true
this.writeLog({
time:dateFormat(new Date()),
message: `${TAG} tcponerror localIp${JSON.stringify(err)}`,
@ -62,7 +64,10 @@ export default class TcpClient {
time:dateFormat(new Date()),
message: `${TAG} tcprebind tcpreBinderror${JSON.stringify(err)}`,
})
globalThis.getCloseTcp = true
setTimeout(async () => {
getTCP()
}, 2000)
// globalThis.getCloseTcp = true
hilog.info(0x0000, 'testTag', "tcpreBinderror:" + JSON.stringify(err));
resolve(true)
}
@ -71,7 +76,7 @@ export default class TcpClient {
message: `${TAG} tcprebind success`,
})
console.log('testTag,rebindtestTag tcp bind success');
globalThis.getCloseTcp = false
// globalThis.getCloseTcp = false
resolve(false)
})
@ -104,13 +109,14 @@ export default class TcpClient {
time:dateFormat(new Date()),
message: `${TAG} tcpbind error ${JSON.stringify(err)}`,
})
setTimeout(async () => {
getTCP()
}, 2000)
console.log('testTag tcp bind faile');
globalThis.getCloseTcp = true
hilog.info(0x0000, 'testTag', "tcpBinderror:" + JSON.stringify(err));
resolve(true)
return
}
globalThis.getCloseTcp = false
console.log('testTag tcp bind success');
// this.writeLog({
// time:dateFormat(new Date()),
@ -152,13 +158,12 @@ export default class TcpClient {
time:dateFormat(new Date()),
message: `${TAG} TCPconnect error ${JSON.stringify(err)}`,
})
// this.writeLog({
// time:dateFormat(new Date()),
// PLC:`${TAG} tcp connect rebind success`,
// })
if(this.num>3){
return
}
setTimeout(() => {
this.writeLog({
time:dateFormat(new Date()),
@ -166,12 +171,11 @@ export default class TcpClient {
})
getTCP()
resolve(false)
}, 2000)
}, 9000)
return;
}
});
console.log('socketTag','success')
globalThis.getCloseTcp = false
resolve(true)
}).catch(err => {
@ -180,15 +184,12 @@ export default class TcpClient {
time:dateFormat(new Date()),
message: `${TAG} TCPconnect error2 ${JSON.stringify(err)}`,
})
globalThis.getCloseTcp = true
this.num++
if(this.num>3){
return
}
// globalThis.getCloseTcp = true
setTimeout(() => {
getTCP()
resolve(false)
}, 2000)
}, 9000)
// this.writeLog({
// time:dateFormat(new Date()),
// PLC:`${TAG} tcp connect error`,
@ -206,10 +207,11 @@ export default class TcpClient {
promise.then(() => {
reslove(true)
}).catch(err => {
this.writeLog({
time:dateFormat(new Date()),
message: `${TAG} TCPsend error ${JSON.stringify(err)}`,
})
console.log(`${TAG} TCPsend error ${JSON.stringify(err)}`)
// this.writeLog({
// time:dateFormat(new Date()),
// message: `${TAG} TCPsend error ${JSON.stringify(err)}`,
// })
reslove(false)
});
})
@ -223,10 +225,7 @@ export default class TcpClient {
// })
console.log(TAG, 'Tcponmessage', value)
globalThis.tcpUdpError = false
this.writeLog({
time:dateFormat(new Date()),
message: `${TAG} Tcponmessage ,${value}`,
})
// console.log('messageLengt',,value.message.length))
console.log('testTagtcpmsg')
// console.log("on message, message:" + value.message+ ", remoteInfo:" )
@ -244,7 +243,7 @@ export default class TcpClient {
//程序断开
if (globalThis.tcpUdpError) {
console.log(TAG,'tcp信号丢失')
getTCP()
// getTCP()
prompt.showToast({
message: 'tcp信号丢失',
duration: 2000
@ -276,7 +275,6 @@ export default class TcpClient {
}
closeTcp(callback) {
return new Promise((reslove, reject) => {
console.log(TAG, 'tcpClose')
let promise = this.tcp.close();
@ -290,6 +288,9 @@ export default class TcpClient {
callback()
reslove(true)
}).catch(err => {
setTimeout(async () => {
getTCP(true)
}, 9000)
this.writeLog({
time:dateFormat(new Date()),
message: `${TAG} tcpclose error ${JSON.stringify(err)}`,

View File

@ -30,8 +30,10 @@ export default class EntryAbility extends UIAbility {
globalThis.deviceNo = '';
globalThis.hasAuth = false
globalThis.version = GlobalConfig.version.sz.km2[0];
globalThis.judgeVersion = GlobalConfig.version.sz.km2[1];
// globalThis.judgeVersion ='2024.08.24.1'
// globalThis.version ='2023.12.13.01';
globalThis.version = GlobalConfig.version.jn.km3[0];
globalThis.judgeVersion = GlobalConfig.version.jn.km3[1];
globalThis.videoVersion= '1.0'

View File

@ -313,8 +313,26 @@ export default struct Index {
this.getCheckList()
return
}
console.log('this.index',index,)
that.passArray[index]=true
that.warnFlag[index]='2'
if(index==2){
let flag=false
console.log('globalThis.spzd[key]',globalThis.spzd)
for(let key in globalThis.spzd){
console.log('globalThis.spzd[key]',globalThis.spzd[key])
if(globalThis.spzd[key]){
that.warnFlag[index]='1'
flag=true
}
}
if(!flag){
that.warnFlag[index]='2'
}
}else{
that.warnFlag[index]='2'
}
that.passArray=JSON.parse(JSON.stringify(that.passArray))
that.warnFlag=JSON.parse(JSON.stringify(that.warnFlag))
index++

View File

@ -23,8 +23,7 @@ import VoiceAnnounce from './judgeSDK/utils/voiceAnnouncements';
import { judgeConfig } from './judgeSDK/utils/judgeConfig';
import { initJudgeUdp } from '../common/utils/UdpJudge';
import errorMsgDialog from './compontents/errorMsgDialog'
import { delHilog } from '../common/service/indexService';
import { deleteAllFileByPiC, getUserAlbumItemByDisplayName } from '../common/service/videoService';
import { delPic } from '../common/service/videoService';
import { getCurrentHourTime } from '../common/utils/tools';
@Entry
@Component
@ -32,7 +31,8 @@ struct UserInfo {
@State pageIndex: number = 0
@State ratio: number = 1700 / 960
@State index: number = 0
@State stepFlag: boolean = false;
@State stepFlag:
boolean = false;
@State errorMsg: string = ''
@State ksxtbh: string = ''
@State pic: string = ''
@ -180,8 +180,7 @@ struct UserInfo {
if (this.dataList.length) {
setTimeout(()=>{
this.currentUser = this.dataList[0]
this.currentUser.ksy2= globalThis.ksyxm
this.currentUser.ksy2= globalThis.kgxm
globalThis.lsh=this.currentUser.lsh
},200)
} else {
@ -253,7 +252,7 @@ struct UserInfo {
if (res.sfzmhm == id) {
flag = true
this.currentUser = res
this.currentUser.ksy2= globalThis.ksyxm
this.currentUser.ksy2= globalThis.kgxm
this.lsh = this.currentUser.lsh
globalThis.lsh = this.currentUser.lsh
@ -284,7 +283,7 @@ struct UserInfo {
await upDateTableByArray('USER', [])
setTimeout(()=>{
this.currentUser = this.list[0]
this.currentUser.ksy2= globalThis.ksyxm
this.currentUser.ksy2= globalThis.kgxm
globalThis.lsh = this.currentUser.lsh
},200)
@ -370,7 +369,7 @@ struct UserInfo {
this.pageIndex = 0
this.dataList = this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4)
this.currentUser = this.dataList[0]
this.currentUser.ksy2= globalThis.ksyxm
this.currentUser.ksy2= globalThis.kgxm
this.lsh = this.currentUser.lsh
globalThis.ksyh = this.currentUser.ksy1sfzmhm
@ -487,9 +486,10 @@ struct UserInfo {
if(!Number(this.systemParam.Param305Str)){
that.systemParam.Param305Str='2'
}
console.log('Param305Str',that.systemParam.Param305Str)
// delHilog(this.Param305Str)
getUserAlbumItemByDisplayName('', that.systemParam.Param305Str,1)
getUserAlbumItemByDisplayName('',that.systemParam.Param305Str,2)
delPic(that.systemParam.Param305Str,1)
delPic(that.systemParam.Param305Str,2)
}
})
@ -602,9 +602,11 @@ struct UserInfo {
listData[i] = decodeURI(listData[i])
}
if(this.systemParam.Param828Str=='1'||this.systemParam.Param828Str=='2'){
listData.ksy2=listData.ksy1;
// listData.ksy2=listData.ksy1;
listData.ksy2=globalThis.kgxm
}else{
listData.ksy2=listData.ksy2;
// listData.ksy2=listData.ksy2;
listData.ksy2=globalThis.kgxm
}
listData.kszp = this.photo + listData.kszp
listData.ksmjzp = this.photo + listData.ksmjzp
@ -616,7 +618,7 @@ struct UserInfo {
if (this.dataList.length) {
setTimeout(()=>{
this.currentUser = this.dataList[0]
this.currentUser.ksy2= globalThis.ksyxm
this.currentUser.ksy2= globalThis.kgxm
globalThis.lsh=this.currentUser.lsh
},200)
// this.currentUser = this.dataList[0]
@ -876,6 +878,11 @@ struct UserInfo {
const date = new Date()
globalThis.startHourTime = await getCurrentHourTime()
const photoBase64 = await this.getPhoto();
if(photoBase64==''){
this.ksksLimit=false
this.isLoadingPopupVisible=false
return
}
const drvexam = {
lsh: this.currentUser.lsh || '',
kskm: examSubject,
@ -896,7 +903,7 @@ struct UserInfo {
//接口标识
jkid: '17C51',
}
console.info('surenjun', JSON.stringify(param))
console.info('surenjunjianguan', JSON.stringify(param))
const temp = await writeObjectOut(param);
globalThis.lsh = this.currentUser.lsh
globalThis.ksyh = this.currentUser.ksy1sfzmhm
@ -1022,7 +1029,7 @@ struct UserInfo {
globalThis.lsh = item.lsh;
setTimeout(()=>{
this.currentUser = item
this.currentUser.ksy2= globalThis.ksyxm
this.currentUser.ksy2= globalThis.kgxm
},200)

View File

@ -4,7 +4,8 @@ import FileLog from '../judgeSDK/utils/fileLog';
import RealTime from '../compontents/judge/RealTime';
import { GPSData, SignalData } from '../../mock';
import { SignalDataType } from '../../model';
import FileUtil from '../../common/utils/File'
import { GlobalConfig } from '../../config/index'
@Component
export default struct SignDisplayCom {
@State showBack: boolean = false
@ -13,6 +14,7 @@ export default struct SignDisplayCom {
@State signArr: Array<any> = []
@State sjxhColum: Array<SignalDataType> = SignalData
@State GPSColum: Array<SignalDataType> = GPSData
@State udplocalIp: string = ''
@State ratio: number = 850 / 960
@State gpsActive: number = 1
@Prop active: number = 0
@ -166,7 +168,7 @@ export default struct SignDisplayCom {
}.justifyContent(FlexAlign.Start).padding({ left: 10 * this.ratio }).margin({ top: 8 * this.ratio })
Row() {
Text("本机IP" + this.signArr[53] || '0')
Text("本机IP" + '192.168.7.170')
.fontColor('#FFF5E5')
.fontSize(14 * this.ratio)
.width('25%')
@ -219,7 +221,7 @@ export default struct SignDisplayCom {
Text('时分秒:' + this.signArr[94]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio)
Text('经度:' + this.signArr[95]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio)
Text('纬度:' + this.signArr[96]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio)
Text('速度:' + this.signArr[97]).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio)
Text('速度:' +((Number((this.signArr[97]||0))*1.852).toFixed(2)).toString()).fontColor('#FFB433').fontSize(14 * this.ratio).height(18 * this.ratio)
}
.backgroundColor('#1A1A1A')
.width(170 * this.ratio)
@ -319,7 +321,10 @@ export default struct SignDisplayCom {
clearInterval(this.interval)
}
aboutToAppear() {
async aboutToAppear() {
// const fileUtil = new FileUtil(globalThis.context)
// const data = await fileUtil.readFile(GlobalConfig.comoonfileWriteAddress + '/config/ipConfig.txt')
// this.udplocalIp=JSON.parse(data)?.udplocalIp||'192.168.7.170'
this.ratio = this.ratio * (this.scaleNum || 1);
const that = this
const {showBack,getSignal} = this
@ -369,7 +374,6 @@ export default struct SignDisplayCom {
}
getSignal = (msg) => {
console.log('msgmsgmsg', msg)
const that = this;
that.msg = msg
const strachArr = msg.split(',')
@ -411,6 +415,12 @@ export default struct SignDisplayCom {
this.GPSColum[t].value = this.signArr[i]
t++
}
this.GPSColum[14].value = ((Number((this.signArr[97]||0))*1.852).toFixed(2)).toString()
const str0=this.signArr[93].substr(0,2)
const str1=this.signArr[93].substr(2,2)
const str2=this.signArr[93].substr(4.2)
this.signArr[93]=str2+str1+str0
// this.signArr[53]=192.168.7.170'
this.sjxhColum = JSON.parse(JSON.stringify((this.sjxhColum)))
that.signArr = JSON.parse(JSON.stringify((this.signArr)))
that.GPSColum = JSON.parse(JSON.stringify((this.GPSColum)))

View File

@ -12,7 +12,7 @@ export default struct DeductedPopup {
super()
}
@State fontSize:number = 24
@State fontSize:number = 30
@State unselected:SEL = {fontColor:'#000000', bgColor:'#CCC4B8'}
@State selected:SEL = {fontColor:'#FFAD33', bgColor:'#26231E'}
@ -90,7 +90,7 @@ export default struct DeductedPopup {
Row(){
Text(text).fontColor(index === this.currentIndex ? this.selected.fontColor : this.unselected.fontColor).fontSize(this.fontSize).fontWeight(500)
}
.width(120).height(60)
.width(140).height(60)
.backgroundColor(index === this.currentIndex ? this.selected.bgColor: this.unselected.bgColor ).justifyContent(FlexAlign.Center).justifyContent(FlexAlign.Center)
.borderRadius({topLeft:20,topRight:20}).margin({right:10})
.onClick(()=>{
@ -113,7 +113,7 @@ export default struct DeductedPopup {
Row(){
Image($rawfile(`judge/km3/zuo_nor.png`)).height(15).margin({left:20,top:0})
Text('上一页'){}.fontColor('#FFF').fontSize(this.fontSize)
}.width(140).height(60).justifyContent(FlexAlign.Start).alignItems(VerticalAlign.Center).backgroundImage($rawfile(`judge/km3/button_nor.png`)).backgroundImageSize({width:'100%',height:'100%'}).margin({right:15})
}.width(150).height(60).justifyContent(FlexAlign.Start).alignItems(VerticalAlign.Center).backgroundImage($rawfile(`judge/km3/button_nor.png`)).backgroundImageSize({width:'100%',height:'100%'}).margin({right:30})
.onClick(()=>{this.goPage(0)})
}
@ -123,7 +123,7 @@ export default struct DeductedPopup {
Row(){
Text('下一页'){}.fontColor('#FFF').fontSize(this.fontSize).padding({left:30})
Image($rawfile(`judge/km3/you_nor.png`)).height(15).margin({right:6,top:0})
}.width(140).height(60).justifyContent(FlexAlign.Start).alignItems(VerticalAlign.Center).backgroundImage($rawfile(`judge/km3/button_nor.png`)).backgroundImageSize({width:'100%',height:'100%'}).margin({right:15})
}.width(150).height(60).justifyContent(FlexAlign.Start).alignItems(VerticalAlign.Center).backgroundImage($rawfile(`judge/km3/button_nor.png`)).backgroundImageSize({width:'100%',height:'100%'}).margin({right:30})
.onClick(()=>{this.goPage(1)})
}
@ -138,12 +138,14 @@ export default struct DeductedPopup {
Column(){
ForEach(this.getCurrentMarkRuleList(),(item,index) => {
Row(){
Text(`${item.markshow} (${item.markcatalog})`).fontColor('#FFF').fontSize(this.fontSize).fontWeight(500)
Row(){
Text(item.markreal + '').fontColor('#FFF').fontSize(this.fontSize).fontWeight(500)
Text(`${item.markshow} (${item.markcatalog})`).fontColor('#FFF').fontSize(this.fontSize).fontWeight(600)
}.width(1000)
Row(){
Text(item.markreal + '').fontColor('#FFF').fontSize(this.fontSize).fontWeight(600)
}
}
.width('100%').height(70).justifyContent(FlexAlign.SpaceBetween).alignItems(VerticalAlign.Center)
.width('100%').justifyContent(FlexAlign.SpaceBetween).alignItems(VerticalAlign.Center).constraintSize({minHeight:70})
.padding({left:20,right:20})
.backgroundColor(this.getSelectedLine(index))
.onClick(()=>{this.selectedLine = index})

View File

@ -44,7 +44,7 @@ export default class FilePhoto{
return res.base64
} catch (e) {
promptAction.showToast({
message: '拍照异常' + JSON.stringify(e),
message: '拍照异常,请重新' + JSON.stringify(e),
duration: 2000
});
return ''

View File

@ -1,4 +1,3 @@
//考试回放开关
export const judgeConfig = {
//本地目录开关
@ -16,14 +15,12 @@ export const judgeConfig = {
// 本地模型地址
modelPath: 'models/model_enc',
// 济南科目三
trajectoryPath: 'logs/2024_12_05/2024_12_05_14_35_24_0000000000000_342323199501470011_测试学员1/judge_exam_data.txt',
trajectoryPath: 'logs/2024_12_20/2024_12_20_15_10_30_9999920215968_355757250887519616_段士婕/judge_exam_data.txt',
//四合一画面配置
fourInOneScreen:{
//gps位数
gpsDigit:6
},
//后置机类型 0=>三代机 1=>一体机 2=>二代机
rearEndUnitsType:0,
// 杭州科目二
// trajectoryPath: 'logs/2024_07_19/0000000000001_342323199501470011_测试学员1_2024_07_19_06_49_12/judge_exam_data.txt',
//TODO 济南临时特殊配置