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

修改项说明:优化代码

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