弹窗异常关闭

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,
alignment: DialogAlignment.Center,
})
@ -507,7 +454,6 @@ struct Index {
}
})
});
}
aboutToDisappear() {
@ -518,10 +464,6 @@ struct Index {
if (this.loading) {
return
}
// let mode=globalThis.timeInfo?.mode?globalThis.timeInfo?.mode:1
// console.log('mode',mode)
const param = {
carId: globalThis.carInfo?.carId,
examinationRoomId: globalThis.carInfo?.examinationRoomId,
@ -536,30 +478,18 @@ struct Index {
singlePlay: globalThis.singlePlay
}
this.loading = true
console.log("sql 1111")
getSingleCenterTable(param).then((ret) => {
console.log('teststetfinsh1', 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)
// })
console.log('getSingleCenterTable finish', ret)
if (ret) {
getSyncData('MA_SYSSET').then(data => {
console.log('datadata', JSON.stringify(data))
// @ts-ignore
getSyncData('MA_SYSSET').then((data: any[]) => {
console.log('MA_SYSSET data', JSON.stringify(data))
data.forEach(sys => {
//判断是否能点开始考试
if (sys.v_no === '854') {
globalThis.param854Str = sys.v_value
}
if (sys.v_no === '824' && decodeURIComponent(sys.v_value) == '0') {
// this.Param612Str= decodeURIComponent(sys.v_value)
router.pushUrl({
url: 'pages/CarCheck',
params: {
@ -572,9 +502,12 @@ struct Index {
}, router.RouterMode.Single)
}
})
}).finally(() => {
this.loading = false
});
}
}).finally(() => {
this.loading = false
})
}
@ -623,9 +556,7 @@ struct Index {
globalThis.singlePlay = false
}
this.isSingle = globalThis.singlePlay
// this.loading = false
this.num = 0
// const TcpClient: TcpClient =new TcpClient(result[0].tcplocalIp, result[0].tcplocalIpPort,result[0].tcpOppositeIp,result[0].tcpOppositePort)
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}`);
})
})
}
async initParams() {

View File

@ -109,7 +109,6 @@ struct UserInfo {
if (this.ksksLimit) {
return
}
console.log('routerParamrouterParam')
try {
await this.checkSignal()
this.faceCompareSucess = 0
@ -140,7 +139,6 @@ struct UserInfo {
// 同一学员连续第二次考试时不再验证身份
if (this.currentUser.kssycs == '1' && this.systemParam.Param830Str == '1') {
this.sfbdinterfaceFn()
} else {
this.ksksLimit = false
this.showFaceCompare = true
@ -891,6 +889,7 @@ struct UserInfo {
const {carId,examinationRoomId} = carInfo;
let examItems = { getExaminationItemRsp: { body: { ykxx: '' } } };
if (!globalThis.singlePlay) {
try {
//获取已考项目
// @ts-ignore
examItems = await getExaminationItem({
@ -899,6 +898,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;
@ -906,11 +914,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']);
this.isLoadingPopupVisible = false
@ -938,6 +944,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
}
})
}
@ -1097,9 +1112,7 @@ struct UserInfo {
}).catch(err => {
console.log("USER insert fail", JSON.stringify(err))
})
// await upDateTableByArray('USER', [this.currentUser])
console.log("User", JSON.stringify(this.currentUser))
// await sqlInsertCommonFn("USER", [this.currentUser])
globalThis.statue = 4
this.isBoardPrePareSetPopupShow = true;
this.isFirstBoardPrePareSetPopupBtnShow = true;

View File

@ -54,6 +54,7 @@ import {
examJudgeVersion
} from './api/index';
import { getSyncData, upDateTableByArray } from '../../common/service/initable';
import promptAction from '@ohos.promptAction';
const judgeTag = 'SURENJUN_JUDGE'
@ -1298,17 +1299,15 @@ export default class Judge {
judgeUI,
ksjs,
getPhoto,
uploadProgressData,
uploadDisConnectData,
avPlayer,
kfArr,
judgeTask,
filePath,
closeAllFiles
} = this;
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
@ -1458,6 +1457,14 @@ export default class Judge {
})
}
} catch (e) {
promptAction.showToast({
message: "考试结束异常,请尝试重新结束",
duration: 3000
})
judgeUI.loadingPopupVisible = false
}
}
// 当前项目转换