表更新 #47
@ -17,19 +17,15 @@ 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 BoardPrePareSetPopup from './compontents/judge/BoardPrePareSetPopup';
|
||||
import LoadingPopup from './compontents/judge/LoadingPopup';
|
||||
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,9 +44,12 @@ struct UserInfo {
|
||||
@State isBoardPrePareSetPopupOpen: boolean = false
|
||||
@State isFirstBoardPrePareSetPopupBtnShow: boolean = false
|
||||
@State isBoardPrePareSetPopupShow: boolean = false
|
||||
@State isLoadingPopupVisible:boolean = false;
|
||||
@State loadingText:string = '正在认证监管信息,请稍后...'
|
||||
@State sczbkf:{xmdm:number,kfdm:string}[] = []
|
||||
@State isLoadingPopupVisible: boolean = false;
|
||||
@State loadingText: string = '正在认证监管信息,请稍后...'
|
||||
@State sczbkf: {
|
||||
xmdm: number,
|
||||
kfdm: string
|
||||
}[] = []
|
||||
@State currentUser: User = EmptyCandidateObject
|
||||
@State dataList: Array<User> = []
|
||||
@State list: Array<User> = []
|
||||
@ -63,7 +62,7 @@ struct UserInfo {
|
||||
@State idCard: string = '';
|
||||
@State grantDept: string = '';
|
||||
//是否已经开始考试
|
||||
@State isExamStart:boolean = false;
|
||||
@State isExamStart: boolean = false;
|
||||
@State effectDate: string = '';
|
||||
@State interval: any = null;
|
||||
@State studentRefreshStatue: string = '0';
|
||||
@ -87,7 +86,10 @@ struct UserInfo {
|
||||
return photoBase64
|
||||
}
|
||||
}
|
||||
private AccountTable = new AccountTable(() => {}, USER);
|
||||
private filePhoto: FilePhoto
|
||||
private avPlayer
|
||||
private AccountTable = new AccountTable(() => {
|
||||
}, USER);
|
||||
private context = getContext(this) as common.UIAbilityContext;
|
||||
private labelBlocks = [
|
||||
{ label: '考生姓名', key: 'xm' },
|
||||
@ -514,12 +516,12 @@ struct UserInfo {
|
||||
this.currentUser.id = '1'
|
||||
const avPlayer = this.avPlayer;
|
||||
this.isLoadingPopupVisible = true
|
||||
avPlayer.playAudio([`voice/监管通信中.mp3`],false,async ()=>{
|
||||
avPlayer.playAudio([`voice/监管通信中.mp3`], false, async () => {
|
||||
const code = await this.beginExam();
|
||||
if (code != 1) {
|
||||
promptAction.showToast({
|
||||
message:'开始考试接口调用失败!',
|
||||
duration:4000
|
||||
message: '开始考试接口调用失败!',
|
||||
duration: 4000
|
||||
})
|
||||
return
|
||||
}
|
||||
@ -543,30 +545,30 @@ struct UserInfo {
|
||||
// 检测车门、熄火信号
|
||||
async checkSignal(): Promise<boolean> {
|
||||
const {isCheckFireOpen} = judgeConfig
|
||||
return new Promise((resolve,reject)=>{
|
||||
if(isCheckFireOpen){
|
||||
return new Promise((resolve, reject) => {
|
||||
if (isCheckFireOpen) {
|
||||
resolve(true)
|
||||
// return
|
||||
}
|
||||
console.info('socketTag[PLC.UdpClient]', '注册udp回调')
|
||||
let plcValue = globalThis.udpClient.getCurrentMessage();
|
||||
console.info('surenjun',plcValue)
|
||||
console.info('surenjun', plcValue)
|
||||
const msgArr = plcValue.split(',') || ''
|
||||
const mkg = msgArr[14];
|
||||
const fdjzs = msgArr[25];
|
||||
if(mkg == 1){
|
||||
if (mkg == 1) {
|
||||
this.avPlayer.playAudio(['voice/关门.mp3'])
|
||||
promptAction.showToast({
|
||||
message:'请关闭车门',
|
||||
duration:4000
|
||||
message: '请关闭车门',
|
||||
duration: 4000
|
||||
})
|
||||
reject(false)
|
||||
}
|
||||
if(fdjzs*1 > 0){
|
||||
if (fdjzs * 1 > 0) {
|
||||
this.avPlayer.playAudio(['voice/熄火.mp3'])
|
||||
promptAction.showToast({
|
||||
message:'请熄火',
|
||||
duration:4000
|
||||
message: '请熄火',
|
||||
duration: 4000
|
||||
})
|
||||
reject(false)
|
||||
}
|
||||
@ -847,7 +849,7 @@ struct UserInfo {
|
||||
}
|
||||
|
||||
// loading
|
||||
if(this.isLoadingPopupVisible){
|
||||
if (this.isLoadingPopupVisible) {
|
||||
LoadingPopup({
|
||||
title: this.loadingText,
|
||||
})
|
||||
@ -887,7 +889,7 @@ struct CommText {
|
||||
|
||||
build() {
|
||||
Text(this.text)
|
||||
.fontSize(16 * this.ratio)
|
||||
.fontSize(19.5 * this.ratio)
|
||||
.lineHeight(30 * this.ratio)
|
||||
.fontWeight(500)
|
||||
.fontColor(this.color)
|
||||
@ -913,9 +915,13 @@ struct LabelBlock {
|
||||
|
||||
build() {
|
||||
Row() {
|
||||
Text(this.label).fontSize(16 * this.ratio).fontColor('#99948A')
|
||||
Text(this.label).fontSize(18 * this.ratio).fontColor('#99948A')
|
||||
Row() {
|
||||
Text(decodeURIComponent(this.value)).fontColor('#fff').textAlign(TextAlign.Center).width('100%')
|
||||
Text(decodeURIComponent(this.value))
|
||||
.fontColor('#fff')
|
||||
.textAlign(TextAlign.Center)
|
||||
.width('100%')
|
||||
.fontSize(20 * this.ratio)
|
||||
}
|
||||
.commLabelStyle()
|
||||
}.margin({ bottom: 10 * this.ratio })
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user