Commit 61bfff8b authored by 曹云霄's avatar 曹云霄

修改项说明:优化代码

parent 205cbfab
...@@ -61,20 +61,17 @@ ...@@ -61,20 +61,17 @@
{ {
//播放窗口 //播放窗口
VideoHelperViewController *videoWindow = [[[self class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"VideoHelperViewController"]; VideoHelperViewController *videoWindow = [[[self class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"VideoHelperViewController"];
videoWindow.view.frame = CGRectMake(0, NavigationHeight, ScreenWidth*2/3, ScreenHeight/2);
videoWindow.delegate = self; videoWindow.delegate = self;
[self addChildViewController:videoWindow]; [self addChildViewController:videoWindow];
[self.view addSubview:videoWindow.view]; [self.view addSubview:videoWindow.view];
//播放列表 //播放列表
VideoListViewController *playList = [[[self class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"VideoListViewController"]; VideoListViewController *playList = [[[self class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"VideoListViewController"];
playList.view.frame = CGRectMake(ScreenWidth*2/3 + 5, NavigationHeight, ScreenWidth/3-5, ScreenHeight-64);
playList.studyItemTitleLabel.text = self.studyTypeEntity.name; playList.studyItemTitleLabel.text = self.studyTypeEntity.name;
playList.delegate = self; playList.delegate = self;
[self addChildViewController:playList]; [self addChildViewController:playList];
[self.view addSubview:playList.view]; [self.view addSubview:playList.view];
//播放简介 //播放简介
VideoDetailViewController *playDetail = [[[self class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"VideoDetailViewController"]; VideoDetailViewController *playDetail = [[[self class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"VideoDetailViewController"];
playDetail.view.frame = CGRectMake(0, ScreenHeight/2+NavigationHeight, ScreenWidth*2/3, ScreenHeight/2-NavigationHeight);
[self addChildViewController:playDetail]; [self addChildViewController:playDetail];
[self.view addSubview:playDetail.view]; [self.view addSubview:playDetail.view];
__block VideoHelperViewController *weakVideWindow = videoWindow; __block VideoHelperViewController *weakVideWindow = videoWindow;
...@@ -82,7 +79,7 @@ ...@@ -82,7 +79,7 @@
WS(weakSelf); WS(weakSelf);
[videoWindow setZoomButtonClickBlock:^(BOOL boolValue) { [videoWindow setZoomButtonClickBlock:^(BOOL boolValue) {
if (boolValue) { if (boolValue) {
[weakSelf.view.window addSubview:weakVideWindow.view]; [SHARED_APPDELEGATE.window addSubview:weakVideWindow.view];
[UIView animateWithDuration:0.2 animations:^{ [UIView animateWithDuration:0.2 animations:^{
weakVideWindow.view.frame = [UIScreen mainScreen].bounds; weakVideWindow.view.frame = [UIScreen mainScreen].bounds;
weakVideWindow.playerLayer.frame = [UIScreen mainScreen].bounds; weakVideWindow.playerLayer.frame = [UIScreen mainScreen].bounds;
...@@ -95,8 +92,12 @@ ...@@ -95,8 +92,12 @@
}completion:nil]; }completion:nil];
} }
}]; }];
videoWindow.view.frame = CGRectMake(0,NavigationHeight, ScreenWidth*2/3, ScreenHeight/2);
playList.view.frame = CGRectMake(ScreenWidth*2/3 + 5, NavigationHeight,ScreenWidth/3-5, ScreenHeight-64);
playDetail.view.frame = CGRectMake(0, ScreenHeight/2+NavigationHeight, ScreenWidth*2/3, ScreenHeight/2-NavigationHeight);
} }
#pragma mark - 获取学习项详情 #pragma mark - 获取学习项详情
- (void)getStudyItemDetailAction - (void)getStudyItemDetailAction
{ {
...@@ -165,11 +166,20 @@ ...@@ -165,11 +166,20 @@
- (void)beginAssessment:(CustomStudyEntity *)studyEntity - (void)beginAssessment:(CustomStudyEntity *)studyEntity
{ {
WS(weakSelf); WS(weakSelf);
VideoHelperViewController *videoWindow = self.childViewControllers[0];
if (videoWindow.view.height == ScreenHeight) {
[self.view insertSubview:videoWindow.view atIndex:0];
[UIView animateWithDuration:0.2 animations:^{
videoWindow.view.frame = CGRectMake(0, NavigationHeight, ScreenWidth*2/3, ScreenHeight/2);
videoWindow.playerLayer.frame = CGRectMake(0, 0, ScreenWidth*2/3, ScreenHeight/2);
}completion:^(BOOL finished) {
[self.settingsPopoverController dismissPopoverAnimated:YES completion:^{ [self.settingsPopoverController dismissPopoverAnimated:YES completion:^{
AssessmentViewController *assessmentVc = [[[self class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"AssessmentViewController"]; AssessmentViewController *assessmentVc = [[[self class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"AssessmentViewController"];
assessmentVc.taskId = studyEntity.fid; assessmentVc.taskId = studyEntity.fid;
[weakSelf.navigationController pushViewController:assessmentVc animated:YES]; [weakSelf.navigationController pushViewController:assessmentVc animated:YES];
}]; }];
}];
}
} }
#pragma mark - 赋值 #pragma mark - 赋值
......
...@@ -204,7 +204,14 @@ ...@@ -204,7 +204,14 @@
#pragma mark - 退出播放 #pragma mark - 退出播放
- (IBAction)exitPlayControllerButtonClick:(UIButton *)sender { - (IBAction)exitPlayControllerButtonClick:(UIButton *)sender {
[self.customPlayer pause]; [self.customPlayer pause];
self.playButton.selected = NO;
if (self.playerLayer.frame.size.height == ScreenHeight) {
if (self.zoomButtonClickBlock) {
self.zoomButtonClickBlock(NO);
}
}else {
[self.navigationController popViewControllerAnimated:YES]; [self.navigationController popViewControllerAnimated:YES];
}
} }
#pragma mark - 后退5秒 #pragma mark - 后退5秒
......
...@@ -1063,11 +1063,6 @@ NSString *const PROMOTIONALSTRING = @"促销信息"; ...@@ -1063,11 +1063,6 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
return self.PDFpath; return self.PDFpath;
} }
- (BOOL)prefersStatusBarHidden
{
return YES;
}
#pragma mark - 分享订单 #pragma mark - 分享订单
- (void)ShareButtonClick:(UIButton *)sender - (void)ShareButtonClick:(UIButton *)sender
{ {
......
This diff is collapsed.
...@@ -48,7 +48,6 @@ ...@@ -48,7 +48,6 @@
- (WKWebView *)webView - (WKWebView *)webView
{ {
if (_webView == nil) { if (_webView == nil) {
_webView = [[WKWebView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight)]; _webView = [[WKWebView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, ScreenHeight)];
} }
return _webView; return _webView;
...@@ -59,11 +58,20 @@ ...@@ -59,11 +58,20 @@
[super viewDidLoad]; [super viewDidLoad];
self.automaticallyAdjustsScrollViewInsets = NO; self.automaticallyAdjustsScrollViewInsets = NO;
self.navigationController.navigationBar.translucent = NO; self.navigationController.navigationBarHidden = YES;
if ([self respondsToSelector:@selector(setNeedsStatusBarAppearanceUpdate)])
{
[self prefersStatusBarHidden];
}
//检测登陆超时通知 //检测登陆超时通知
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(logintimeoutNotification:) name:LOGINTIMEOUT object:nil]; [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(logintimeoutNotification:) name:LOGINTIMEOUT object:nil];
} }
#pragma mark - 隐藏状态栏
- (BOOL)prefersStatusBarHidden
{
return YES;
}
#pragma mark -登陆超时回调 #pragma mark -登陆超时回调
- (void)logintimeoutNotification:(NSNotification *)not - (void)logintimeoutNotification:(NSNotification *)not
......
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