Compare commits

...

2 Commits

Author SHA1 Message Date
48540ef01b accounttable优化 2024-08-01 17:47:01 +08:00
d66793359b updataTable 2024-08-01 17:36:42 +08:00

View File

@ -17,13 +17,17 @@ import promptAction from '@ohos.promptAction';
import FilePhoto from './judgeSDK/utils/filePhoto'; import FilePhoto from './judgeSDK/utils/filePhoto';
import { getSyncData, upDateTableByArray } from '../common/service/initable'; import { getSyncData, upDateTableByArray } from '../common/service/initable';
import { CandidateData, EmptyCandidateObject } from '../mock/CandidateData'; 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 VoiceAnnounce from './judgeSDK/utils/voiceAnnouncements';
import { JudgeConfig } from '../config/judge';
import { judgeConfig } from './judgeSDK/utils/judgeConfig'; import { judgeConfig } from './judgeSDK/utils/judgeConfig';
@Entry @Entry
@Component @Component
struct UserInfo { struct UserInfo {
private filePhoto: FilePhoto
private avPlayer
@State pageIndex: number = 0 @State pageIndex: number = 0
@State ratio: number = 1700 / 960 @State ratio: number = 1700 / 960
@State index: number = 0 @State index: number = 0
@ -42,12 +46,9 @@ struct UserInfo {
@State isBoardPrePareSetPopupOpen: boolean = false @State isBoardPrePareSetPopupOpen: boolean = false
@State isFirstBoardPrePareSetPopupBtnShow: boolean = false @State isFirstBoardPrePareSetPopupBtnShow: boolean = false
@State isBoardPrePareSetPopupShow: boolean = false @State isBoardPrePareSetPopupShow: boolean = false
@State isLoadingPopupVisible: boolean = false; @State isLoadingPopupVisible:boolean = false;
@State loadingText: string = '正在生成考试记录,请稍后...' @State loadingText:string = '正在生成考试记录,请稍后...'
@State sczbkf: { @State sczbkf:{xmdm:number,kfdm:string}[] = []
xmdm: number,
kfdm: string
}[] = []
@State currentUser: User = EmptyCandidateObject @State currentUser: User = EmptyCandidateObject
@State dataList: Array<User> = [] @State dataList: Array<User> = []
@State list: Array<User> = [] @State list: Array<User> = []
@ -60,7 +61,7 @@ struct UserInfo {
@State idCard: string = ''; @State idCard: string = '';
@State grantDept: string = ''; @State grantDept: string = '';
//是否已经开始考试 //是否已经开始考试
@State isExamStart: boolean = false; @State isExamStart:boolean = false;
@State effectDate: string = ''; @State effectDate: string = '';
@State interval: any = null; @State interval: any = null;
@State studentRefreshStatue: string = '0'; @State studentRefreshStatue: string = '0';
@ -519,42 +520,18 @@ struct UserInfo {
return return
} }
// } // }
this.AccountTable.query('0', (result) => { await upDateTableByArray('USER', [this.currentUser])
if (result.length == 0) { globalThis.statue = 4
this.isExamStart = true this.stepFlag = false
this.AccountTable.insertData(this.currentUser, (id) => { router.pushUrl({
this.AccountTable.query('0', (result) => { url: 'pages/Judge',
globalThis.statue = 4 params: {
this.stepFlag = false examItems: examItems?.getExaminationItemRsp?.body?.ykxx,
router.pushUrl({ sczb: Number(this.isBoardPrePareSetPopupOpen),
url: 'pages/Judge', kfdm: this.sczbkf
params: {
examItems: examItems?.getExaminationItemRsp?.body?.ykxx,
sczb: Number(this.isBoardPrePareSetPopupOpen),
kfdm: this.sczbkf
}
}, 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()
})
})
} }
}) }, router.RouterMode.Single);
this.stopDeviceById()
this.stepFlag = false this.stepFlag = false
} }
@ -678,8 +655,6 @@ struct UserInfo {
.backgroundImageSize({ width: '100%', height: '100%' }) .backgroundImageSize({ width: '100%', height: '100%' })
.onClick(() => { .onClick(() => {
this.currentUser = item this.currentUser = item
}) })
}) })
}.width(640 * this.ratio).margin({ left: 30 * this.ratio }) }.width(640 * this.ratio).margin({ left: 30 * this.ratio })
@ -791,35 +766,15 @@ struct UserInfo {
if (globalThis.singlePlay) { if (globalThis.singlePlay) {
const {examSubject} = globalThis.carInfo; const {examSubject} = globalThis.carInfo;
console.info('surenjun => sczbkf', JSON.stringify(this.sczbkf)) console.info('surenjun => sczbkf', JSON.stringify(this.sczbkf))
this.AccountTable.query('0', (result) => { await upDateTableByArray('USER', [this.currentUser])
if (result.length == 0) { router.pushUrl({
this.AccountTable.insertData(this.currentUser, (id) => { url: examSubject == 3 ? 'pages/Roads' : 'pages/Judge',
this.AccountTable.query('0', (result) => { params: {
router.pushUrl({ sczb: Number(this.isBoardPrePareSetPopupOpen),
url: examSubject == 3 ? 'pages/Roads' : 'pages/Judge', kfdm: this.sczbkf
params: {
sczb: Number(this.isBoardPrePareSetPopupOpen),
kfdm: this.sczbkf
}
}, 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()
})
})
} }
}) }, router.RouterMode.Single);
this.stopDeviceById()
return return
} }
if (this.FaceOpenStatue != '0') { if (this.FaceOpenStatue != '0') {