弹窗异常关闭

This commit is contained in:
lixiao 2025-05-09 15:33:44 +08:00
parent 2a9b4a4f4d
commit bd41dc0ad2
3 changed files with 215 additions and 265 deletions

View File

@ -54,59 +54,6 @@ struct Index {
}), }),
customStyle: true, customStyle: true,
alignment: DialogAlignment.Center, alignment: DialogAlignment.Center,
}) })
@ -507,7 +454,6 @@ struct Index {
} }
}) })
}); });
} }
aboutToDisappear() { aboutToDisappear() {
@ -518,10 +464,6 @@ struct Index {
if (this.loading) { if (this.loading) {
return return
} }
// let mode=globalThis.timeInfo?.mode?globalThis.timeInfo?.mode:1
// console.log('mode',mode)
const param = { const param = {
carId: globalThis.carInfo?.carId, carId: globalThis.carInfo?.carId,
examinationRoomId: globalThis.carInfo?.examinationRoomId, examinationRoomId: globalThis.carInfo?.examinationRoomId,
@ -536,30 +478,18 @@ struct Index {
singlePlay: globalThis.singlePlay singlePlay: globalThis.singlePlay
} }
this.loading = true this.loading = true
console.log("sql 1111")
getSingleCenterTable(param).then((ret) => { getSingleCenterTable(param).then((ret) => {
console.log('teststetfinsh1', ret) console.log('getSingleCenterTable finish', ret)
// DB.queryListBySql('select * from MA_SYSSET', [{
// name: "v_no",
// type: ColumnType.STRING,
// columnName: "v_no"
// }]).then((res) => {
// console.log('sql success', JSON.stringify(res))
// }).catch((err) => {
// console.log('sql error1', err)
// })
if (ret) { if (ret) {
getSyncData('MA_SYSSET').then(data => { getSyncData('MA_SYSSET').then((data: any[]) => {
console.log('datadata', JSON.stringify(data)) console.log('MA_SYSSET data', JSON.stringify(data))
// @ts-ignore
data.forEach(sys => { data.forEach(sys => {
//判断是否能点开始考试 //判断是否能点开始考试
if (sys.v_no === '854') { if (sys.v_no === '854') {
globalThis.param854Str = sys.v_value globalThis.param854Str = sys.v_value
} }
if (sys.v_no === '824' && decodeURIComponent(sys.v_value) == '0') { if (sys.v_no === '824' && decodeURIComponent(sys.v_value) == '0') {
// this.Param612Str= decodeURIComponent(sys.v_value)
router.pushUrl({ router.pushUrl({
url: 'pages/CarCheck', url: 'pages/CarCheck',
params: { params: {
@ -572,9 +502,12 @@ struct Index {
}, router.RouterMode.Single) }, router.RouterMode.Single)
} }
}) })
}).finally(() => {
this.loading = false
}); });
} }
}).finally(() => {
this.loading = false
}) })
} }
@ -623,9 +556,7 @@ struct Index {
globalThis.singlePlay = false globalThis.singlePlay = false
} }
this.isSingle = globalThis.singlePlay this.isSingle = globalThis.singlePlay
// this.loading = false
this.num = 0 this.num = 0
// const TcpClient: TcpClient =new TcpClient(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort)
globalThis.lsh = '1111111111111' globalThis.lsh = '1111111111111'
} }
@ -666,7 +597,6 @@ struct Index {
console.error(`Failed to request permissions from user. Code is ${err.code}, message is ${err.message}`); console.error(`Failed to request permissions from user. Code is ${err.code}, message is ${err.message}`);
}) })
}) })
} }
async initParams() { async initParams() {

View File

@ -109,7 +109,6 @@ struct UserInfo {
if (this.ksksLimit) { if (this.ksksLimit) {
return return
} }
console.log('routerParamrouterParam')
try { try {
await this.checkSignal() await this.checkSignal()
this.faceCompareSucess = 0 this.faceCompareSucess = 0
@ -140,7 +139,6 @@ struct UserInfo {
// 同一学员连续第二次考试时不再验证身份 // 同一学员连续第二次考试时不再验证身份
if (this.currentUser.kssycs == '1' && this.systemParam.Param830Str == '1') { if (this.currentUser.kssycs == '1' && this.systemParam.Param830Str == '1') {
this.sfbdinterfaceFn() this.sfbdinterfaceFn()
} else { } else {
this.ksksLimit = false this.ksksLimit = false
this.showFaceCompare = true this.showFaceCompare = true
@ -891,6 +889,7 @@ struct UserInfo {
const {carId,examinationRoomId} = carInfo; const {carId,examinationRoomId} = carInfo;
let examItems = { getExaminationItemRsp: { body: { ykxx: '' } } }; let examItems = { getExaminationItemRsp: { body: { ykxx: '' } } };
if (!globalThis.singlePlay) { if (!globalThis.singlePlay) {
try {
//获取已考项目 //获取已考项目
// @ts-ignore // @ts-ignore
examItems = await getExaminationItem({ examItems = await getExaminationItem({
@ -899,6 +898,15 @@ struct UserInfo {
lsh: this.currentUser.lsh || '', lsh: this.currentUser.lsh || '',
examinationRoomId examinationRoomId
}) })
} catch (e) {
promptAction.showToast({
message: "获取考试信息失败,请重试",
duration: 3000
})
this.isLoadingPopupVisible = false
this.isExamStart = false
return
}
} }
this.currentUser.id = '1' this.currentUser.id = '1'
const avPlayer = this.avPlayer; const avPlayer = this.avPlayer;
@ -906,11 +914,9 @@ struct UserInfo {
avPlayer.playAudio([`voice/监管通信中.mp3`], false, async () => { avPlayer.playAudio([`voice/监管通信中.mp3`], false, async () => {
console.info('surenjun', '播放结束开始考试接口调用') console.info('surenjun', '播放结束开始考试接口调用')
try {
const {code,keystr,message} = await this.beginExam() || {}; const {code,keystr,message} = await this.beginExam() || {};
console.info('surenjun', '开始考试接口调用结束') console.info('surenjun', '开始考试接口调用结束')
// console.info('surenjun',code +'')
//@ts-ignore TODO code转换
if (code != 1) { if (code != 1) {
avPlayer.playAudio([code == -200 ? 'voice/photo_error.mp3' : 'voice/监管审核未通过.mp3']); avPlayer.playAudio([code == -200 ? 'voice/photo_error.mp3' : 'voice/监管审核未通过.mp3']);
this.isLoadingPopupVisible = false this.isLoadingPopupVisible = false
@ -938,6 +944,15 @@ struct UserInfo {
this.updateTimeLimit = false this.updateTimeLimit = false
this.stopDeviceById() this.stopDeviceById()
this.stepFlag = false this.stepFlag = false
} catch (e) {
promptAction.showToast({
message: "监管审核失败,请重试",
duration: 3000
})
this.isLoadingPopupVisible = false
this.isExamStart = false
return
}
}) })
} }
@ -1097,9 +1112,7 @@ struct UserInfo {
}).catch(err => { }).catch(err => {
console.log("USER insert fail", JSON.stringify(err)) console.log("USER insert fail", JSON.stringify(err))
}) })
// await upDateTableByArray('USER', [this.currentUser])
console.log("User", JSON.stringify(this.currentUser)) console.log("User", JSON.stringify(this.currentUser))
// await sqlInsertCommonFn("USER", [this.currentUser])
globalThis.statue = 4 globalThis.statue = 4
this.isBoardPrePareSetPopupShow = true; this.isBoardPrePareSetPopupShow = true;
this.isFirstBoardPrePareSetPopupBtnShow = true; this.isFirstBoardPrePareSetPopupBtnShow = true;
@ -1284,9 +1297,9 @@ struct UserInfo {
return return
} }
//835参数值和预约考试次数对比 //835参数值和预约考试次数对比
if(Number(this.systemParam.Param835)<=Number(this.currentUser.yycs)&&!globalThis.singlePlay){ if (Number(this.systemParam.Param835) <= Number(this.currentUser.yycs) && !globalThis.singlePlay) {
this.type='4' this.type = '4'
this.title='当前考生预约考试次数为'+this.currentUser.yycs this.title = '当前考生预约考试次数为' + this.currentUser.yycs
this.errorDialog.open() this.errorDialog.open()
return return
} }
@ -1446,5 +1459,5 @@ type systemParam = {
'Param830Str': string, //同一学员连续第二次考试时不再验证身份 'Param830Str': string, //同一学员连续第二次考试时不再验证身份
'Param364': string, //考前上车准备 'Param364': string, //考前上车准备
'Param398': string, //考前上车准备 'Param398': string, //考前上车准备
'Param835' :string 'Param835': string
} }

View File

@ -54,6 +54,7 @@ import {
examJudgeVersion examJudgeVersion
} from './api/index'; } from './api/index';
import { getSyncData, upDateTableByArray } from '../../common/service/initable'; import { getSyncData, upDateTableByArray } from '../../common/service/initable';
import promptAction from '@ohos.promptAction';
const judgeTag = 'SURENJUN_JUDGE' const judgeTag = 'SURENJUN_JUDGE'
@ -382,10 +383,10 @@ export default class Judge {
//成绩不合格 //成绩不合格
if (totalScore < passingGrade) { if (totalScore < passingGrade) {
//科目三不合格报靠边停车 //科目三不合格报靠边停车
if (examSubject == 3 ) { if (examSubject == 3) {
if( param302 == 1){ if (param302 == 1) {
avPlayer.playAudio([`voice/考试结束.mp3`]); avPlayer.playAudio([`voice/考试结束.mp3`]);
}else if(param302 == 0){ } else if (param302 == 0) {
return return
} }
} }
@ -1226,7 +1227,7 @@ export default class Judge {
}) })
} else { } else {
//收到综合评判语音时,显示综合评判弹窗 //收到综合评判语音时,显示综合评判弹窗
if(code[0] == 'zhpp'){ if (code[0] == 'zhpp') {
clearTimeout(this.deductedPopShowTimer) clearTimeout(this.deductedPopShowTimer)
this.judgeUI.isDeductedPopShow = true this.judgeUI.isDeductedPopShow = true
this.judgeUI.defaultTabIndex = 1 this.judgeUI.defaultTabIndex = 1
@ -1298,17 +1299,15 @@ export default class Judge {
judgeUI, judgeUI,
ksjs, ksjs,
getPhoto, getPhoto,
uploadProgressData,
uploadDisConnectData,
avPlayer, avPlayer,
kfArr, kfArr,
judgeTask,
filePath, filePath,
closeAllFiles closeAllFiles
} = this; } = this;
const { lsh, idCard, serialNumber, kssycs, totalScore, judgeConfigObj, isAllProjectsEnd, passingScore } = judgeUI const { lsh, idCard, serialNumber, kssycs, totalScore, judgeConfigObj, isAllProjectsEnd, passingScore } = judgeUI
//TODO 断网考试结束补传 //TODO 断网考试结束补传
// await uploadDisConnectData(); // await uploadDisConnectData();
try {
const time = await getCurrentTime(); const time = await getCurrentTime();
const photoBase64 = await getPhoto(); const photoBase64 = await getPhoto();
const { d1, d2, d3, d4, d5 } = ksjs const { d1, d2, d3, d4, d5 } = ksjs
@ -1458,6 +1457,14 @@ export default class Judge {
}) })
} }
} catch (e) {
promptAction.showToast({
message: "考试结束异常,请尝试重新结束",
duration: 3000
})
judgeUI.loadingPopupVisible = false
}
} }
// 当前项目转换 // 当前项目转换