Commit 3078e812 authored by 朱璇's avatar 朱璇

bugfix @陈雪 [ios-结束视频弹窗]医生点击结束视频弹窗在结束视频后仍然显示

parent f16b49e9
...@@ -24,6 +24,7 @@ ...@@ -24,6 +24,7 @@
GMTTTUser *_user;//加入进来的医生模型 GMTTTUser *_user;//加入进来的医生模型
GMLinkPromptView *_linePrompView; GMLinkPromptView *_linePrompView;
GMUserFillMessageView *_userMessagLabel; //用户信息 GMUserFillMessageView *_userMessagLabel; //用户信息
UIAlertController *_alert; // 时间太短提示弹窗
} }
- (instancetype)initWithFrame:(CGRect)frame - (instancetype)initWithFrame:(CGRect)frame
...@@ -213,6 +214,12 @@ ...@@ -213,6 +214,12 @@
- (void)exitRoom:(BOOL) status { - (void)exitRoom:(BOOL) status {
[_functionView endTime]; [_functionView endTime];
[_TTManager closeExcitRoom]; [_TTManager closeExcitRoom];
if (_alert) {
[_alert dismissViewControllerAnimated:YES completion:nil];
}
[UIView animateWithDuration:0.4 animations:^{ [UIView animateWithDuration:0.4 animations:^{
self.transform = CGAffineTransformTranslate(self.transform, 0,MAINSCREEN_HEIGHT); self.transform = CGAffineTransformTranslate(self.transform, 0,MAINSCREEN_HEIGHT);
} completion:^(BOOL finished) { } completion:^(BOOL finished) {
...@@ -234,19 +241,15 @@ ...@@ -234,19 +241,15 @@
- (void)closeRoom:(BOOL) status { - (void)closeRoom:(BOOL) status {
if (_TTManager.totalTime < 180) { if (_TTManager.totalTime < 180) {
UIViewController *alertVC = [[UIViewController alloc]init]; _alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"本次视频面诊时间貌似有点短,确定不再聊会儿?" preferredStyle:UIAlertControllerStyleAlert];
[self addSubview:alertVC.view]; [_alert addAction:[UIAlertAction actionWithTitle:@"再聊一会" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:@"本次视频面诊时间貌似有点短,确定不再聊会儿?" preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:@"再聊一会" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
alertVC.view = nil;
}]]; }]];
UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"结束面诊" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"结束面诊" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
alertVC.view = nil;
[GMHudModule showWarning:@"通话结束"]; [GMHudModule showWarning:@"通话结束"];
[self exitRoom:status]; [self exitRoom:status];
}]; }];
[alert addAction:sureAction]; [_alert addAction:sureAction];
[alertVC presentViewController:alert animated:YES completion:NULL]; [[GMBaseTool getCurrentViewController] presentViewController:_alert animated:YES completion:NULL];
} else { } else {
[GMHudModule showWarning:@"通话结束"]; [GMHudModule showWarning:@"通话结束"];
[self exitRoom:status]; [self exitRoom:status];
......
...@@ -26,6 +26,7 @@ ...@@ -26,6 +26,7 @@
GMTTTUser *doctorUser;//加入进来的医生模型 GMTTTUser *doctorUser;//加入进来的医生模型
GMLinkPromptView *_linePrompView; GMLinkPromptView *_linePrompView;
GMTelephoneAudioPlay *_audioPlay; GMTelephoneAudioPlay *_audioPlay;
UIAlertController *_alert; // 时间太短提示弹窗
} }
@property (nonatomic, strong) GMRtcManager *TTManager; @property (nonatomic, strong) GMRtcManager *TTManager;
@property (nonatomic, strong)GMUserTelephoneFunctionView *functionView; @property (nonatomic, strong)GMUserTelephoneFunctionView *functionView;
...@@ -317,21 +318,17 @@ ...@@ -317,21 +318,17 @@
- (void)closeRoom:(BOOL) status { - (void)closeRoom:(BOOL) status {
if (_TTManager.totalTime < 180) { if (_TTManager.totalTime < 180) {
UIViewController *alertVC = [[UIViewController alloc]init];
[self addSubview:alertVC.view];
NSString *title = _TTManager.vidoeTelephoneModel.counsellorInfo.counsellorType == 2 ? @"面诊师":@"医生"; NSString *title = _TTManager.vidoeTelephoneModel.counsellorInfo.counsellorType == 2 ? @"面诊师":@"医生";
NSString *name = [NSString stringWithFormat:@"%@擅长很多项目,可以多咨询呦",title]; NSString *name = [NSString stringWithFormat:@"%@擅长很多项目,可以多咨询呦",title];
UIAlertController *alert = [UIAlertController alertControllerWithTitle:@"提示" message:name preferredStyle:UIAlertControllerStyleAlert]; _alert = [UIAlertController alertControllerWithTitle:@"提示" message:name preferredStyle:UIAlertControllerStyleAlert];
[alert addAction:[UIAlertAction actionWithTitle:@"再聊一会" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) { [_alert addAction:[UIAlertAction actionWithTitle:@"再聊一会" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
alertVC.view = nil;
}]]; }]];
UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"结束面诊" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) { UIAlertAction *sureAction = [UIAlertAction actionWithTitle:@"结束面诊" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
alertVC.view = nil;
[GMHudModule showWarning:@"通话结束"]; [GMHudModule showWarning:@"通话结束"];
[self exitRoom:status]; [self exitRoom:status];
}]; }];
[alert addAction:sureAction]; [_alert addAction:sureAction];
[alertVC presentViewController:alert animated:YES completion:NULL]; [[GMBaseTool getCurrentViewController] presentViewController:_alert animated:YES completion:NULL];
} else { } else {
[GMHudModule showWarning:@"通话结束"]; [GMHudModule showWarning:@"通话结束"];
[self exitRoom:status]; [self exitRoom:status];
...@@ -358,6 +355,11 @@ ...@@ -358,6 +355,11 @@
- (void)exitRoom:(BOOL)status { - (void)exitRoom:(BOOL)status {
[_TTManager closeExcitRoom]; [_TTManager closeExcitRoom];
[_functionView endTime]; [_functionView endTime];
if (_alert) {
[_alert dismissViewControllerAnimated:YES completion:nil];
}
[UIView animateWithDuration:0.4 animations:^{ [UIView animateWithDuration:0.4 animations:^{
self.transform = CGAffineTransformTranslate(self.transform, 0,MAINSCREEN_HEIGHT); self.transform = CGAffineTransformTranslate(self.transform, 0,MAINSCREEN_HEIGHT);
} completion:^(BOOL finished) { } completion:^(BOOL finished) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment