切换学员乱码修改

This commit is contained in:
lvyuankang 2024-08-01 17:04:44 +08:00
parent 65421ce6bc
commit 38a3436b2c

View File

@ -17,17 +17,13 @@ import promptAction from '@ohos.promptAction';
import FilePhoto from './judgeSDK/utils/filePhoto';
import { getSyncData, upDateTableByArray } from '../common/service/initable';
import { CandidateData, EmptyCandidateObject } from '../mock/CandidateData';
import BoardPrePareSetPopup from './compontents/judge/BoardPrePareSetPopup'
import LoadingPopup from './compontents/judge/LoadingPopup';
import BoardPrePareSetPopup from './compontents/judge/BoardPrePareSetPopup';
import VoiceAnnounce from './judgeSDK/utils/voiceAnnouncements';
import { JudgeConfig } from '../config/judge';
import { judgeConfig } from './judgeSDK/utils/judgeConfig';
@Entry
@Component
struct UserInfo {
private filePhoto: FilePhoto
private avPlayer
@State pageIndex: number = 0
@State ratio: number = 1700 / 960
@State index: number = 0
@ -48,7 +44,10 @@ struct UserInfo {
@State isBoardPrePareSetPopupShow: boolean = false
@State isLoadingPopupVisible: boolean = false;
@State loadingText: string = '正在生成考试记录,请稍后...'
@State sczbkf:{xmdm:number,kfdm:string}[] = []
@State sczbkf: {
xmdm: number,
kfdm: string
}[] = []
@State currentUser: User = EmptyCandidateObject
@State dataList: Array<User> = []
@State list: Array<User> = []
@ -73,6 +72,20 @@ struct UserInfo {
@State FaceOpenStatue: string = '0'; //是否开启人脸识别
subscriber;
@State faceCatchImg: string = ''
// 过程照片拍照
getPhoto = async (empty?: boolean) => {
const singlePlay = globalThis.singlePlay
//单机模式返回空照片
if (singlePlay) {
return ''
} else {
const {filePhoto} = this;
const photoBase64 = await filePhoto.getPhoto();
return photoBase64
}
}
private filePhoto: FilePhoto
private avPlayer
private AccountTable = new AccountTable(() => {
}, USER);
private context = getContext(this) as common.UIAbilityContext;
@ -345,6 +358,13 @@ struct UserInfo {
}
this.pageIndex++;
this.dataList = this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4)
this.dataList.forEach(listData => {
for (let i in listData) {
listData[i] = decodeURI(listData[i])
}
listData.kszp = this.photo + listData.kszp
listData.ksmjzp = this.photo + listData.ksmjzp
})
}
prevClick() {
@ -353,6 +373,13 @@ struct UserInfo {
}
this.pageIndex--;
this.dataList = this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4)
this.dataList.forEach(listData => {
for (let i in listData) {
listData[i] = decodeURI(listData[i])
}
listData.kszp = this.photo + listData.kszp
listData.ksmjzp = this.photo + listData.ksmjzp
})
}
//获取下载考生
@ -530,18 +557,6 @@ struct UserInfo {
})
this.stepFlag = false
}
// 过程照片拍照
getPhoto = async (empty?: boolean) => {
const singlePlay = globalThis.singlePlay
//单机模式返回空照片
if (singlePlay) {
return ''
} else {
const {filePhoto} = this;
const photoBase64 = await filePhoto.getPhoto();
return photoBase64
}
}
// 检测车门、熄火信号
async checkSignal(): Promise<boolean> {
@ -554,7 +569,8 @@ struct UserInfo {
const msgArr = msg.split(',')
const mkg = msgArr[14];
const fdjzs = msgArr[25];
globalThis.udpClient.onMessage_1(()=>{});
globalThis.udpClient.onMessage_1(() => {
});
//TODO
console.info('surenjun mkg=>', mkg)
console.info('surenjun fdjzs=>', fdjzs)
@ -578,6 +594,7 @@ struct UserInfo {
})
})
}
// 开始考试
async beginExam() {
const carInfo = globalThis.carInfo;
@ -661,6 +678,8 @@ struct UserInfo {
.backgroundImageSize({ width: '100%', height: '100%' })
.onClick(() => {
this.currentUser = item
})
})
}.width(640 * this.ratio).margin({ left: 30 * this.ratio })