fix: 优化考生列表

This commit is contained in:
wangzhongjie 2025-06-26 11:18:07 +08:00
parent 019b582940
commit 7c0f24d4cf
6 changed files with 199 additions and 189 deletions

View File

@ -1,6 +1,5 @@
import { examinationStuAbsent, getExaminationItem, getExaminationStudentInfo } from '../api/userInfo';
import router from '@ohos.router';
import TopLogo from './compontents/TopLogo';
import FaceCompare from './compontents/FaceCompare';
import { writeObjectOut } from '../api/judge';
import testNapi from '@ohos.idcard';
@ -14,7 +13,6 @@ import BoardPrePareSetPopup from './compontents/judge/BoardPrePareSetPopup';
import LoadingPopup from './compontents/judge/LoadingPopup';
import VoiceAnnounce from './judgeSDK/utils/voiceAnnouncements';
// import { initJudgeUdp } from '../common/utils/UdpJudge';
import imageBtn from './compontents/imageBtn';
import { CryptoJS } from '@ohos/crypto-js';
@ -47,6 +45,10 @@ import { JudgeEmitterInstance } from '../utils/business/UdpEvent';
import errorMsgDialog from './compontents/errorMsgDialog';
import { JudgeConfig } from '../config';
import { dConsole } from '../utils/LogWorker';
import HeaderComponent from './compontents/Header';
import AvatarComponent from './UserInfo/Avatar';
import CommTextComponent from './UserInfo/CommText';
import LabelBlockComponent from './UserInfo/LabelBlock';
@Entry
@Component
@ -1095,20 +1097,21 @@ struct UserInfoPage {
build() {
Column() {
TopLogo({ outFlag: $outFlag }).margin({ bottom: 10 })
HeaderComponent({
shortLogo: true,
shouBackArea: true
})
Column() {
Row() {
Row() {
ForEach(this.dataList, (item: User) => {
Flex({ justifyContent: FlexAlign.Center, alignItems: ItemAlign.Center }) {
Column() {
CommText({
ratio: this.ratio,
CommTextComponent({
color: item.sfzmhm != this.currentUser.sfzmhm ? '#FFFFFF' : '#000000',
text: item.lsh
})
CommText({
ratio: this.ratio,
CommTextComponent({
color: item.sfzmhm != this.currentUser.sfzmhm ? '#FFFFFF' : '#000000',
text: decodeURIComponent(item.xm)
})
@ -1155,25 +1158,20 @@ struct UserInfoPage {
Row() {
Column() {
if (this.currentUser.kszp) {
Avatar({
ratio: this.ratio,
AvatarComponent({
url: this.currentUser.kszp ? this.currentUser.kszp : ''
})
} else {
Avatar({
ratio: this.ratio,
AvatarComponent({
url: ""
})
}
if (this.currentUser.ksmjzp) {
Avatar({
ratio: this.ratio,
AvatarComponent({
url: this.currentUser.ksmjzp ? this.currentUser.ksmjzp : ''
})
} else {
Avatar({
ratio: this.ratio,
AvatarComponent({
url: ""
})
}
@ -1181,9 +1179,8 @@ struct UserInfoPage {
Column() {
ForEach(this.labelBlocks, (item: LabelBlockType) => {
LabelBlock({
LabelBlockComponent({
label: item.label,
ratio: this.ratio,
value: GetCurrentUserKeyValue(this.currentUser, item.key)
})
})
@ -1243,6 +1240,8 @@ struct UserInfoPage {
}
}
}
}.backgroundColor("#1E1E1E").width("100%").height("100%")
if (this.showFaceCompare) {
FaceCompare({
@ -1328,70 +1327,5 @@ struct UserInfoPage {
}
}
// 头像组件
@Component
struct Avatar {
@State ratio: number = 0
@State url: string = ""
build() {
Row() {
Image(this.url)
.width(93 * this.ratio)
.height(130.5 * this.ratio)
.margin({ bottom: 10 * this.ratio, right: 58 * this.ratio, left: 55 * this.ratio })
.backgroundColor('orange')
.border({ color: '#fff', width: 1, style: BorderStyle.Solid })
.syncLoad(true)
}
}
}
// 横向滚动学员列表里面文字
@Component
struct CommText {
@Prop text: string
@Prop color: string
@Prop ratio: number
build() {
Text(this.text)
.fontSize(19.5 * this.ratio)
.lineHeight(30 * this.ratio)
.fontWeight(500)
.fontColor(this.color)
}
}
// 考生信息的labelBlock组件
@Component
struct LabelBlock {
@State label: string = ''
@State ratio: number = 0
@Prop value: string = ''
@Styles
commLabelStyle(){
.width(280 * this.ratio)
.height(35 * this.ratio)
.backgroundImageSize({ width: '100%', height: '100%' })
.backgroundImage($r('app.media.userbox'))
.margin({ left: 8 * this.ratio })
.align(Alignment.Center)
}
build() {
Row() {
Text(this.label).fontSize(20 * this.ratio).fontColor('#99948A')
Row() {
Text(decodeURIComponent(this.value || '') || '')
.fontColor('#fff')
.textAlign(TextAlign.Center)
.width('100%')
.fontSize(18 * this.ratio)
}
.commLabelStyle()
}.margin({ bottom: 10 * this.ratio })
}
}

View File

@ -0,0 +1,16 @@
@Component
export default struct AvatarComponent {
@State url: string = ""
build() {
Row() {
Image(this.url)
.width(165)
.height(231)
.margin({ bottom: 18, right: 102, left: 97 })
.backgroundColor('orange')
.border({ color: '#fff', width: 1, style: BorderStyle.Solid })
.syncLoad(true)
}
}
}

View File

@ -0,0 +1,13 @@
@Component
export default struct CommTextComponent {
@Prop text: string
@Prop color: string
build() {
Text(this.text)
.fontSize(35)
.lineHeight(52)
.fontWeight(500)
.fontColor(this.color)
}
}

View File

@ -0,0 +1,29 @@
@Component
export default struct LabelBlockComponent {
@State label: string = ''
@Prop value: string = ''
@Styles
commLabelStyle(){
.width(496)
.height(62) // 35 * 1.770833 ≈ 61.979155
.backgroundImageSize({ width: '100%', height: '100%' })
.backgroundImage($r('app.media.userbox'))
.margin({ left: 14.166664 }) // 8 * 1.770833 ≈ 14.166664
.align(Alignment.Center)
}
build() {
Row() {
Text(this.label).fontSize(35).fontColor('#99948A') // 20 * 1.770833 ≈ 35.41666
Row() {
Text(decodeURIComponent(this.value || '') || '')
.fontColor('#fff')
.textAlign(TextAlign.Center)
.width('100%')
.fontSize(32) // 18 * 1.770833 ≈ 31.874994
}
.commLabelStyle()
}.margin({ bottom: 18 }) // 10 * 1.770833 ≈ 17.70833
}
}

View File

@ -0,0 +1,9 @@
// 缺考考生弹窗
@CustomDialog
export default struct MissAnExamDialog {
private controller?: CustomDialogController;
build() {
}
}

View File

@ -0,0 +1,9 @@
// 开始考试弹窗
@CustomDialog
export default struct StartTheExamDialog {
private controller?: CustomDialogController;
build() {
}
}