| | |
| | | NSString * refuseStr; |
| | | NSString * answerStr; |
| | | NSString * unlockSuccessfullyStr; |
| | | NSString * callingStr; |
| | | // int openDoorTimeout; |
| | | //全局变量 |
| | | SystemSoundID sound; |
| | |
| | | [self initTopBarView]; |
| | | [self initCentetView]; |
| | | [self initData]; |
| | | [self setAnswerBtnEnable:NO]; |
| | | // [self setAnswerBtnEnable:NO]; |
| | | [self initESVideo]; |
| | | //开始反呼 |
| | | [self StartReverseCall]; |
| | | [self ShowCalltimeBtn:callingStr]; |
| | | // Do any additional setup after loading the view. |
| | | } |
| | | |
| | |
| | | refuseStr = @"拒绝"; |
| | | answerStr = @"接听"; |
| | | unlockSuccessfullyStr = @"开锁成功"; |
| | | callingStr = @"来电中..."; |
| | | }else{ |
| | | tipStr = @"Prompt"; |
| | | okStr = @"OK"; |
| | |
| | | refuseStr = @"Refuse"; |
| | | answerStr = @"Answer"; |
| | | unlockSuccessfullyStr = @"Unlock successfully"; |
| | | callingStr = @"Incoming call"; |
| | | |
| | | } |
| | | } |
| | | |
| | |
| | | |
| | | -(void)backAction{ |
| | | [self.navigationController popViewControllerAnimated:true]; |
| | | // [self dismissViewControllerAnimated:YES completion:NULL]; |
| | | |
| | | // [self dismissViewControllerAnimated:YES completion:NULL]; |
| | | |
| | | } |
| | | |
| | | - (UIButton *)moreButton{ |
| | |
| | | |
| | | - (void)initCentetView { |
| | | [self.view addSubview:self.centerView]; |
| | | [self.centerView addSubview:self.collectButton]; |
| | | // [self.centerView addSubview:self.collectButton]; |
| | | [self.centerView addSubview:self.homeView]; |
| | | [self.centerView addSubview:self.unlockView]; |
| | | [self.unlockView addSubview:self.screenshotImgBtn]; |
| | |
| | | return _calltimeBtn; |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | -(void)ShowTime:(int)nowTime { |
| | | if(_calltimeBtn.hidden) _calltimeBtn.hidden = NO; |
| | | NSString *timeStr = [self timeFormatted:nowTime]; |
| | | [self setCalltimeButtonText:timeStr]; |
| | | [self setCalltimeButtonText:timeStr isTime:YES]; |
| | | } |
| | | |
| | | -(void)ShowCalltimeBtn:(NSString*) mesStr { |
| | | if(_calltimeBtn.hidden) _calltimeBtn.hidden = NO; |
| | | |
| | | [self setCalltimeButtonText:mesStr isTime:NO]; |
| | | |
| | | |
| | | } |
| | | |
| | | /* |
| | | 根据文字调整按钮宽 |
| | | */ |
| | | -(void)setCalltimeButtonText:(NSString*) mesStr { |
| | | -(void)setCalltimeButtonText:(NSString*) mesStr isTime:(BOOL)isTime |
| | | { |
| | | [_calltimeBtn setTitle:mesStr forState:UIControlStateNormal]; |
| | | _calltimeBtn.frame = CGRectMake(0, 0, 100, 30); |
| | | if(isTime){ |
| | | _calltimeBtn.frame = CGRectMake(0, 0, 80, 30); |
| | | }else{ |
| | | _calltimeBtn.frame = CGRectMake(0, 0, 115, 30); |
| | | } |
| | | _calltimeBtn.center = CGPointMake(APP_SCREEN_WIDTH/2, 397); |
| | | } |
| | | |
| | |
| | | [alertController addAction:[UIAlertAction actionWithTitle:okStr style:UIAlertActionStyleCancel handler:nil]]; |
| | | [self presentViewController:alertController animated:YES completion:nil]; |
| | | |
| | | // UIAlertView *alertView1 = [[UIAlertView alloc] initWithTitle:tipStr message:mes delegate:self cancelButtonTitle:okStr otherButtonTitles:nil, nil]; |
| | | // [alertView1 show]; |
| | | // UIAlertView *alertView1 = [[UIAlertView alloc] initWithTitle:tipStr message:mes delegate:self cancelButtonTitle:okStr otherButtonTitles:nil, nil]; |
| | | // [alertView1 show]; |
| | | |
| | | } |
| | | |