user
This commit is contained in:
		
							parent
							
								
									a12d8c79e9
								
							
						
					
					
						commit
						e828c532de
					
				| @ -57,8 +57,8 @@ export default class EntryAbility extends UIAbility { | ||||
| 
 | ||||
|         const windowClass  = await windowStage.getMainWindow(); | ||||
|         globalThis.windowClass = windowClass | ||||
|         await windowClass.setWindowLayoutFullScreen(true) | ||||
|         // await windowClass.setWindowSystemBarEnable([]) //全屏
 | ||||
|         // await windowClass.setWindowLayoutFullScreen(true)
 | ||||
|         await windowClass.setWindowSystemBarEnable([]) //全屏
 | ||||
|         // await windowClass.setWindowSystemBarEnable(['navigation'])
 | ||||
| 
 | ||||
|         windowStage.loadContent('pages/Index', (err, data) => { | ||||
|  | ||||
| @ -134,9 +134,11 @@ struct UserInfo { | ||||
|     alignment: DialogAlignment.Center, | ||||
|   }, | ||||
|   ) | ||||
| 
 | ||||
|   aboutToAppear() { | ||||
|     this.avPlayer = new VoiceAnnounce(); | ||||
|   } | ||||
| 
 | ||||
|   async onPageShow() { | ||||
|     this.isExamStart = false | ||||
|     this.startExam = false | ||||
| @ -186,15 +188,31 @@ struct UserInfo { | ||||
|           }) | ||||
|           this.pageIndex = 0 | ||||
|           this.dataList = this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4) | ||||
|           if (this.dataList.length) { | ||||
|             setTimeout(()=>{ | ||||
|               this.currentUser = this.dataList[0] | ||||
|               this.currentUser.ksy2= globalThis.kgxm | ||||
|               globalThis.lsh=this.currentUser.lsh | ||||
|             },200) | ||||
|           } else { | ||||
|             this.currentUser = EmptyCandidateObject | ||||
|           const data = await getSyncData('USER') | ||||
|           const user = data[0] | ||||
|           if (user && Number(user.kssycs)) { | ||||
|             let flag = false | ||||
|             this.list.forEach(res => { | ||||
|               if (res.sfzmhm == user.sfzmhm) { | ||||
|                 flag = true | ||||
|                 res.kssycs = user.kssycs | ||||
|                 this.getCurrentStudent(res.sfzmhm) | ||||
|               } | ||||
|             }) | ||||
|             if (!flag) { | ||||
|               this.currentUser = (this.list.length ? this.list[0] : EmptyCandidateObject) | ||||
|             } | ||||
|           } | ||||
|           // if (this.dataList.length) { | ||||
|           // | ||||
|           //   setTimeout(()=>{ | ||||
|           //     this.currentUser = this.dataList[0] | ||||
|           //     this.currentUser.ksy2= globalThis.kgxm | ||||
|           //     globalThis.lsh=this.currentUser.lsh | ||||
|           //   },200) | ||||
|           // } else { | ||||
|           //   this.currentUser = EmptyCandidateObject | ||||
|           // } | ||||
|         } | ||||
|         this.list.forEach((res, index) => { | ||||
|           res.id = index.toString() | ||||
| @ -638,26 +656,50 @@ struct UserInfo { | ||||
|         dataList = this.list.length > 4 ? this.list.slice(this.pageIndex * 4, this.pageIndex * 4 + 4) : this.list; | ||||
| 
 | ||||
|         this.dataList = dataList | ||||
|         const flag=dataList.filter((res)=>{ | ||||
|            return res.sfzmhm==this.currentUser.sfzmhm | ||||
|         }).length?true:false | ||||
|         if(!this.currentUser.sfzmhm||this.currentUser.kssycs=='0'||!flag){ | ||||
|         const user = this.dataList.filter(res => { | ||||
|           res.kssycs = '1' | ||||
|         }) | ||||
|         if (this.dataList.length) { | ||||
|           if (user.length) { | ||||
|             setTimeout(() => { | ||||
|               this.currentUser = user[0] | ||||
|               this.currentUser.ksy2 = globalThis.kgxm | ||||
|               globalThis.lsh = this.currentUser.lsh | ||||
|               globalThis.ksyh = this.currentUser.ksy1sfzmhm | ||||
|             }, 200) | ||||
|           } else { | ||||
|             setTimeout(() => { | ||||
|               this.currentUser = this.dataList[0] | ||||
|               this.currentUser.ksy2 = globalThis.kgxm | ||||
|               globalThis.ksyh = this.currentUser.ksy1sfzmhm | ||||
|               globalThis.lsh = this.currentUser.lsh | ||||
|             }, 200) | ||||
|             console.log('this.currentUser1',JSON.stringify(this.currentUser)) | ||||
|           } | ||||
|         } else { | ||||
|           this.currentUser = EmptyCandidateObject | ||||
|         } | ||||
|         } | ||||
| 
 | ||||
| 
 | ||||
|         this.lsh = this.currentUser.lsh | ||||
|         globalThis.lsh = this.lsh | ||||
|         globalThis.ksyh = this.currentUser.ksy1sfzmhm | ||||
|         // const flag=dataList.filter((res)=>{ | ||||
|         //    return res.sfzmhm==this.currentUser.sfzmhm | ||||
|         // }).length?true:false | ||||
|         // if(!this.currentUser.sfzmhm||this.currentUser.kssycs=='0'||!flag){ | ||||
|         //   if (this.dataList.length) { | ||||
|         //     setTimeout(()=>{ | ||||
|         //       this.currentUser = this.dataList[0] | ||||
|         //       this.currentUser.ksy2= globalThis.kgxm | ||||
|         //       globalThis.lsh=this.currentUser.lsh | ||||
|         //     },200) | ||||
|         //     console.log('this.currentUser1',JSON.stringify(this.currentUser)) | ||||
|         //   } else { | ||||
|         //     this.currentUser = EmptyCandidateObject | ||||
|         //   } | ||||
|         // } | ||||
| 
 | ||||
| 
 | ||||
|         // this.lsh = this.currentUser.lsh | ||||
|         // globalThis.lsh = this.lsh | ||||
|         // globalThis.ksyh = this.currentUser.ksy1sfzmhm | ||||
| 
 | ||||
|         //364	绕车一周评判时机(1-开始考试后判 2-开始考试前判) | ||||
|         if (this.systemParam.Param364 == '2') { | ||||
| @ -968,7 +1010,6 @@ struct UserInfo { | ||||
| 
 | ||||
|     } | ||||
|   } | ||||
| 
 | ||||
|   //开始考试准备 | ||||
|   prePareExam = async () => { | ||||
|     if (this.ksksLimit) { | ||||
| @ -1137,11 +1178,13 @@ struct UserInfo { | ||||
|         Column() { | ||||
|           // Image($r('app.media.yydj_btn')) | ||||
|           //   .commStyle() | ||||
|           imageBtn({btnWidth:220 * this.ratio,btnHeight:69 * this.ratio,imgSrc:$r('app.media.yydj_btn')}).margin({ bottom: 12 * this.ratio }) | ||||
|           imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.yydj_btn') }) | ||||
|             .margin({ bottom: 12 * this.ratio }) | ||||
| 
 | ||||
|           // Image($r('app.media.gx_btn')) | ||||
|           //   .commStyle() | ||||
|           imageBtn({btnWidth:220 * this.ratio,btnHeight:69 * this.ratio,imgSrc:$r('app.media.gx_btn')}).margin({ bottom: 12 * this.ratio }) | ||||
|           imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.gx_btn') }) | ||||
|             .margin({ bottom: 12 * this.ratio }) | ||||
|             .onClick(() => { | ||||
|               // this.avPlayer.playAudio(['button_media.wav']) | ||||
|               if (this.isExamStart && !globalThis.singlePlay) { | ||||
| @ -1153,7 +1196,8 @@ struct UserInfo { | ||||
|             }) | ||||
|           // Image($r('app.media.qk_btn')) | ||||
|           //   .commStyle() | ||||
|           imageBtn({btnWidth:220 * this.ratio,btnHeight:69 * this.ratio,imgSrc:$r('app.media.qk_btn')}).margin({ bottom: 12 * this.ratio }) | ||||
|           imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.qk_btn') }) | ||||
|             .margin({ bottom: 12 * this.ratio }) | ||||
|             .onClick(() => { | ||||
|               // this.avPlayer.playAudio(['button_media.wav']) | ||||
|               //  已开始考试不能缺考   已考过一次学员不能缺考                                                 车上不能缺考 | ||||
| @ -1167,7 +1211,8 @@ struct UserInfo { | ||||
|           if (this.isBoardPrePareSetPopupOpen && (this.isSecondBoardPrePareSetPopupOpen && this.currentUser.kssycs == '2') && !this.isFirstBoardPrePareSetPopupBtnShow) { | ||||
|             //上车准备 | ||||
|             // Image($r('app.media.sczb_btn')).commStyle() | ||||
|             imageBtn({btnWidth:220 * this.ratio,btnHeight:69 * this.ratio,imgSrc:$r('app.media.sczb_btn')}).margin({ bottom: 12 * this.ratio }) | ||||
|             imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.sczb_btn') }) | ||||
|               .margin({ bottom: 12 * this.ratio }) | ||||
|               .onClick(async () => { | ||||
|                 if (this.systemParam.Param612Str == '1') { | ||||
|                   return | ||||
| @ -1177,7 +1222,8 @@ struct UserInfo { | ||||
|           } else { | ||||
|             // Image($r('app.media.ksks_btn')) | ||||
|             //   .commStyle() | ||||
|             imageBtn({btnWidth:220 * this.ratio,btnHeight:69 * this.ratio,imgSrc:$r('app.media.ksks_btn')}).margin({ bottom: 12 * this.ratio }) | ||||
|             imageBtn({ btnWidth: 220 * this.ratio, btnHeight: 69 * this.ratio, imgSrc: $r('app.media.ksks_btn') }) | ||||
|               .margin({ bottom: 12 * this.ratio }) | ||||
|               .onClick(async () => { | ||||
|                 if (this.systemParam.Param612Str == '1') { | ||||
|                   return | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user