updataTable
This commit is contained in:
parent
7b27578efd
commit
d66793359b
@ -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;
|
||||
@ -492,11 +505,7 @@ struct UserInfo {
|
||||
return
|
||||
}
|
||||
// }
|
||||
this.AccountTable.query('0', (result) => {
|
||||
if (result.length == 0) {
|
||||
this.isExamStart = true
|
||||
this.AccountTable.insertData(this.currentUser, (id) => {
|
||||
this.AccountTable.query('0', (result) => {
|
||||
await upDateTableByArray('USER', [this.currentUser])
|
||||
globalThis.statue = 4
|
||||
this.stepFlag = false
|
||||
router.pushUrl({
|
||||
@ -508,39 +517,7 @@ struct UserInfo {
|
||||
}
|
||||
}, router.RouterMode.Single);
|
||||
this.stopDeviceById()
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.AccountTable.updateData(this.currentUser, (id) => {
|
||||
this.AccountTable.query('0', (result) => {
|
||||
this.stepFlag = false
|
||||
router.pushUrl({
|
||||
url:'pages/Judge',
|
||||
params: {
|
||||
examItems: examItems?.getExaminationItemRsp?.body?.ykxx ,
|
||||
sczb:Number(this.isBoardPrePareSetPopupOpen),
|
||||
kfdm:this.sczbkf
|
||||
}
|
||||
}, router.RouterMode.Single);
|
||||
globalThis.statue = 4
|
||||
this.stopDeviceById()
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
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
|
||||
}
|
||||
}
|
||||
|
||||
// 检测车门、熄火信号
|
||||
@ -554,7 +531,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 +556,7 @@ struct UserInfo {
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
// 开始考试
|
||||
async beginExam() {
|
||||
const carInfo = globalThis.carInfo;
|
||||
@ -772,10 +751,7 @@ struct UserInfo {
|
||||
if (globalThis.singlePlay) {
|
||||
const {examSubject} = globalThis.carInfo;
|
||||
console.info('surenjun => sczbkf', JSON.stringify(this.sczbkf))
|
||||
this.AccountTable.query('0', (result) => {
|
||||
if (result.length == 0) {
|
||||
this.AccountTable.insertData(this.currentUser, (id) => {
|
||||
this.AccountTable.query('0', (result) => {
|
||||
await upDateTableByArray('USER', [this.currentUser])
|
||||
router.pushUrl({
|
||||
url: examSubject == 3 ? 'pages/Roads' : 'pages/Judge',
|
||||
params: {
|
||||
@ -784,23 +760,6 @@ struct UserInfo {
|
||||
}
|
||||
}, router.RouterMode.Single);
|
||||
this.stopDeviceById()
|
||||
})
|
||||
})
|
||||
} else {
|
||||
this.AccountTable.updateData(this.currentUser, (id) => {
|
||||
this.AccountTable.query('0', (result) => {
|
||||
router.pushUrl({
|
||||
url: examSubject == 3?'pages/Roads':'pages/Judge',
|
||||
params:{
|
||||
sczb:Number(this.isBoardPrePareSetPopupOpen),
|
||||
kfdm:this.sczbkf
|
||||
}
|
||||
}, router.RouterMode.Single);
|
||||
this.stopDeviceById()
|
||||
})
|
||||
})
|
||||
}
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.FaceOpenStatue != '0') {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user