防抖
This commit is contained in:
		
							parent
							
								
									6d86dad782
								
							
						
					
					
						commit
						46cc3a311f
					
				| @ -14,6 +14,7 @@ export default struct Index { | ||||
|   @State inputTextArr: string[] = ['', '']; | ||||
|   @State imgArr1: Resource[] = [$r('app.media.1_nor'), $r('app.media.2_nor'), $r('app.media.3_nor'), $r('app.media.4_nor'), $r('app.media.5_nor'), $r('app.media.6_nor'), $r('app.media.7_nor'), $r('app.media.8_nor'), $r('app.media.9_nor'), $r('app.media.0_nor'), $r('app.media.x_nor'), $r('app.media.clear_nor'), $r('app.media.delete_nor'), $r('app.media.confirm_nor')] | ||||
|   @State currentInputIndex: number = 0 | ||||
|   @State limit: boolean = false | ||||
|   @State @Watch('outClick') outFlag: boolean = false; | ||||
|   private vocObj = null; | ||||
|   private title = '' | ||||
| @ -79,7 +80,9 @@ export default struct Index { | ||||
|                     }); | ||||
|                     return | ||||
|                   } | ||||
| 
 | ||||
|                   if(this.limit){ | ||||
|                     return | ||||
|                   } | ||||
|                   const param = { | ||||
|                     carId: globalThis.carInfo.carId, | ||||
|                     examinationRoomId: globalThis.carInfo.examinationRoomId, | ||||
| @ -88,10 +91,13 @@ export default struct Index { | ||||
|                   } | ||||
|                   this.type='2' | ||||
|                   this.errorDialog.open() | ||||
|                   this.limit=true | ||||
|                   console.log('carInfo', JSON.stringify(globalThis.carInfo)) | ||||
|                   examinerLoginService(param).then(res => { | ||||
|                     console.log('res?.examinerLoginRsp?.head?.resultCode',res?.examinerLoginRsp?.head?.resultCode,JSON.stringify(res)) | ||||
|                     this.errorDialog.close() | ||||
| 
 | ||||
|                     this.limit=false | ||||
|                     if(res?.examinerLoginRsp?.head?.resultCode=='1'){ | ||||
|                       // this.type='1' | ||||
|                       // this.title=decodeURIComponent(res.examinerLoginRsp.head.resultMessage) | ||||
|  | ||||
| @ -462,13 +462,13 @@ struct UserInfo { | ||||
|     await upDateTableByArray('USER', []) | ||||
|     this.type='2' | ||||
|     this.errorDialog.open() | ||||
|     this.updateTimeLimit = true | ||||
|     const param = `<getExaminationStudentInfoReq><head><checkCode>${Md5.Instance.get_md5(globalThis.carInfo.carId + globalThis.carInfo.examinationRoomId + globalThis.username)}</checkCode></head><body><carId>${globalThis.carInfo.carId}</carId><examinationRoomId>${globalThis.carInfo.examinationRoomId}</examinationRoomId><examinerName>${globalThis.username}</examinerName></body></getExaminationStudentInfoReq>` | ||||
|     getExaminationStudentInfo(param).then(async (res) => { | ||||
|       this.errorDialog.close() | ||||
|       setTimeout(() => { | ||||
|         this.updateTimeLimit = true | ||||
|       }, 30000) | ||||
|       this.updateTimeLimit = false | ||||
|         this.updateTimeLimit = false | ||||
|       }, 3000) | ||||
|       if (!res||res?.getExaminationStudentInfoRsp?.head?.resultCode=='1') { | ||||
|         return | ||||
|       } | ||||
| @ -517,6 +517,7 @@ struct UserInfo { | ||||
|         } | ||||
|       }) | ||||
|     }).catch((error) => { | ||||
|       this.updateTimeLimit = false | ||||
|       console.log('error12error' + error) | ||||
|     }) | ||||
|   } | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user