逻辑优化

This commit is contained in:
lixiao 2025-05-13 18:06:03 +08:00
parent b446c9442a
commit 7645ab8c14
3 changed files with 218 additions and 189 deletions

View File

@ -134,10 +134,13 @@ struct Index {
}, router.RouterMode.Single)
}
})
}).finally(() => {
this.loading = false
});
}
})
}).finally(() => {
this.loading = false
});
}
async heartMsg() {

View File

@ -884,6 +884,8 @@ struct UserInfo {
const {carId,examinationRoomId} = carInfo;
let examItems = { getExaminationItemRsp: { body: { ykxx: '', jdxx: '' } } };
if (!globalThis.singlePlay) {
try {
//获取已考项目
// @ts-ignore
examItems = await getExaminationItem({
@ -892,6 +894,15 @@ struct UserInfo {
lsh: this.currentUser.lsh || '',
examinationRoomId
});
} catch (e) {
promptAction.showToast({
message: "获取考试信息失败,请重试",
duration: 3000
})
this.isLoadingPopupVisible = false
this.isExamStart = false
return
}
}
this.currentUser.id = '1'
const avPlayer = this.avPlayer;
@ -899,10 +910,9 @@ struct UserInfo {
avPlayer.playAudio([`voice/监管通信中.mp3`], false, async () => {
console.info('surenjun', '播放结束开始考试接口调用')
try {
const {code,keystr,message} = await this.beginExam() || {};
console.info('surenjun', '开始考试接口调用结束')
// console.info('surenjun',code +'')
//@ts-ignore TODO code转换
if (code != 1) {
avPlayer.playAudio([code == -200 ? 'voice/photo_error.mp3' : 'voice/监管审核未通过.mp3']);
@ -959,6 +969,15 @@ struct UserInfo {
this.updateTimeLimit = false
this.stopDeviceById()
this.stepFlag = false
} catch (e) {
promptAction.showToast({
message: "监管审核失败,请重试",
duration: 3000
})
this.isLoadingPopupVisible = false
this.isExamStart = false
return
}
})
}

View File

@ -1320,6 +1320,7 @@ export default class Judge {
const {lsh,idCard,serialNumber,kssycs,totalScore,judgeConfigObj,isAllProjectsEnd,passingScore} = judgeUI
//TODO 断网考试结束补传
// await uploadDisConnectData();
try {
const time = await getCurrentTime();
const photoBase64 = await getPhoto();
const {d1,d2,d3,d4,d5} = ksjs
@ -1466,7 +1467,13 @@ export default class Judge {
}, param302 == 8 ? 3000 : 0)
})
}
} catch (e) {
promptAction.showToast({
message: "考试结束异常,请尝试重新结束",
duration: 3000
})
judgeUI.loadingPopupVisible = false
}
}
// 当前项目转换