feat_surenjun #46
| @ -23,11 +23,13 @@ import VoiceAnnounce from './judgeSDK/utils/voiceAnnouncements'; | |||||||
| import { JudgeConfig } from '../config/judge'; | 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 filePhoto: FilePhoto | ||||||
|   private avPlayer |   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 | ||||||
| @ -47,7 +49,7 @@ struct UserInfo { | |||||||
|   @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:{xmdm:number,kfdm:string}[] = [] |   @State sczbkf:{xmdm:number,kfdm:string}[] = [] | ||||||
|   @State currentUser: User = EmptyCandidateObject |   @State currentUser: User = EmptyCandidateObject | ||||||
|   @State dataList: Array<User> = [] |   @State dataList: Array<User> = [] | ||||||
| @ -85,10 +87,7 @@ struct UserInfo { | |||||||
|       return photoBase64 |       return photoBase64 | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|   private filePhoto: FilePhoto |   private AccountTable = new AccountTable(() => {}, USER); | ||||||
|   private avPlayer |  | ||||||
|   private AccountTable = new AccountTable(() => { |  | ||||||
|   }, USER); |  | ||||||
|   private context = getContext(this) as common.UIAbilityContext; |   private context = getContext(this) as common.UIAbilityContext; | ||||||
|   private labelBlocks = [ |   private labelBlocks = [ | ||||||
|     { label: '考生姓名', key: 'xm' }, |     { label: '考生姓名', key: 'xm' }, | ||||||
| @ -513,16 +512,21 @@ struct UserInfo { | |||||||
|       }); |       }); | ||||||
|     } |     } | ||||||
|     this.currentUser.id = '1' |     this.currentUser.id = '1' | ||||||
|     //是否已经开始考试 |     const avPlayer = this.avPlayer; | ||||||
|     // if(!this.isExamStart){ |     this.isLoadingPopupVisible = true | ||||||
|  |     avPlayer.playAudio([`voice/监管通信中.mp3`],false,async ()=>{ | ||||||
|       const code = await this.beginExam(); |       const code = await this.beginExam(); | ||||||
|       if (code != 1) { |       if (code != 1) { | ||||||
|  |         promptAction.showToast({ | ||||||
|  |           message:'开始考试接口调用失败!', | ||||||
|  |           duration:4000 | ||||||
|  |         }) | ||||||
|         return |         return | ||||||
|       } |       } | ||||||
|     // } |  | ||||||
|       await upDateTableByArray('USER', [this.currentUser]) |       await upDateTableByArray('USER', [this.currentUser]) | ||||||
|       globalThis.statue = 4 |       globalThis.statue = 4 | ||||||
|       this.stepFlag = false |       this.stepFlag = false | ||||||
|  |       this.isLoadingPopupVisible = false | ||||||
|       router.pushUrl({ |       router.pushUrl({ | ||||||
|         url: 'pages/Judge', |         url: 'pages/Judge', | ||||||
|         params: { |         params: { | ||||||
| @ -533,42 +537,39 @@ struct UserInfo { | |||||||
|       }, router.RouterMode.Single); |       }, router.RouterMode.Single); | ||||||
|       this.stopDeviceById() |       this.stopDeviceById() | ||||||
|       this.stepFlag = false |       this.stepFlag = false | ||||||
|  |     }) | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
|   // 检测车门、熄火信号 |   // 检测车门、熄火信号 | ||||||
|   async checkSignal(): Promise<boolean> { |   async checkSignal(): Promise<boolean> { | ||||||
|     const {isCheckFireOpen} = judgeConfig |     const {isCheckFireOpen} = judgeConfig | ||||||
|     return new Promise((resolve, reject) => { |     return new Promise((resolve,reject)=>{ | ||||||
|       if (isCheckFireOpen) { |       if(isCheckFireOpen){ | ||||||
|         resolve(true) |         resolve(true) | ||||||
|  |         // return | ||||||
|       } |       } | ||||||
|       globalThis.udpClient.onMessage_1(async (msg) => { |       console.info('socketTag[PLC.UdpClient]', '注册udp回调') | ||||||
|         const msgArr = msg.split(',') |       let plcValue =  globalThis.udpClient.getCurrentMessage(); | ||||||
|  |       console.info('surenjun',plcValue) | ||||||
|  |       const msgArr = plcValue.split(',') || '' | ||||||
|       const mkg = msgArr[14]; |       const mkg = msgArr[14]; | ||||||
|       const fdjzs = msgArr[25]; |       const fdjzs = msgArr[25]; | ||||||
|         globalThis.udpClient.onMessage_1(() => { |       if(mkg == 1){ | ||||||
|         }); |  | ||||||
|         //TODO |  | ||||||
|         console.info('surenjun mkg=>', mkg) |  | ||||||
|         console.info('surenjun fdjzs=>', fdjzs) |  | ||||||
|         if (mkg == 1) { |  | ||||||
|         this.avPlayer.playAudio(['voice/关门.mp3']) |         this.avPlayer.playAudio(['voice/关门.mp3']) | ||||||
|         promptAction.showToast({ |         promptAction.showToast({ | ||||||
|             message: '请关闭车门', |           message:'请关闭车门', | ||||||
|             duration: 4000 |           duration:4000 | ||||||
|         }) |         }) | ||||||
|         reject(false) |         reject(false) | ||||||
|       } |       } | ||||||
|         if (fdjzs * 1 > 0) { |       if(fdjzs*1 > 0){ | ||||||
|         this.avPlayer.playAudio(['voice/熄火.mp3']) |         this.avPlayer.playAudio(['voice/熄火.mp3']) | ||||||
|         promptAction.showToast({ |         promptAction.showToast({ | ||||||
|             message: '请熄火', |           message:'请熄火', | ||||||
|             duration: 4000 |           duration:4000 | ||||||
|         }) |         }) | ||||||
|         reject(false) |         reject(false) | ||||||
|       } |       } | ||||||
|         resolve(true) |  | ||||||
|       }) |  | ||||||
|     }) |     }) | ||||||
|   } |   } | ||||||
| 
 | 
 | ||||||
| @ -838,16 +839,7 @@ struct UserInfo { | |||||||
|         BoardPrePareSetPopup({ |         BoardPrePareSetPopup({ | ||||||
|           closePopup: (bool) => { |           closePopup: (bool) => { | ||||||
|             this.isBoardPrePareSetPopupShow = false; |             this.isBoardPrePareSetPopupShow = false; | ||||||
|             // if(!globalThis.singlePlay){ |  | ||||||
|             //   this.isFirstBoardPrePareSetPopupBtnShow = !bool; |  | ||||||
|             // } |  | ||||||
|           }, |           }, | ||||||
|           // endLoading:()=>{ |  | ||||||
|           //   this.isLoadingPopupVisible = false; |  | ||||||
|           //   this.faceCompareSucess = 0 |  | ||||||
|           //   this.numCount = 0 |  | ||||||
|           //   this.getExaminationStudentInfoFn() |  | ||||||
|           // }, |  | ||||||
|           confirmMark: (kfdm) => { |           confirmMark: (kfdm) => { | ||||||
|             this.sczbkf = kfdm |             this.sczbkf = kfdm | ||||||
|           } |           } | ||||||
| @ -855,12 +847,11 @@ struct UserInfo { | |||||||
|       } |       } | ||||||
| 
 | 
 | ||||||
|       // loading |       // loading | ||||||
|       // if(this.isLoadingPopupVisible){ |       if(this.isLoadingPopupVisible){ | ||||||
|       //   LoadingPopup({ |         LoadingPopup({ | ||||||
|       //     title: this.loadingText, |           title: this.loadingText, | ||||||
|       //   }) |         }) | ||||||
|       // } |       } | ||||||
| 
 |  | ||||||
|     } |     } | ||||||
|     .height('100%') |     .height('100%') | ||||||
|     .width('100%') |     .width('100%') | ||||||
|  | |||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user