Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
Opple-iOS
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张杰
Opple-iOS
Commits
f9d20cbc
Commit
f9d20cbc
authored
Dec 06, 2016
by
曹云霄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改项说明:学习完成考核开发
parent
b511e4c7
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
37 changed files
with
2468 additions
and
963 deletions
+2468
-963
AssessmentHeaderView.h
Class/LearningCenter/OnlineLearning/AssessmentHeaderView.h
+25
-0
AssessmentHeaderView.m
Class/LearningCenter/OnlineLearning/AssessmentHeaderView.m
+24
-0
AssessmentTableViewCell.h
...s/LearningCenter/OnlineLearning/AssessmentTableViewCell.h
+25
-0
AssessmentTableViewCell.m
...s/LearningCenter/OnlineLearning/AssessmentTableViewCell.m
+24
-0
AssessmentViewController.h
.../LearningCenter/OnlineLearning/AssessmentViewController.h
+35
-0
AssessmentViewController.m
.../LearningCenter/OnlineLearning/AssessmentViewController.m
+79
-0
CustomStudyEntity.h
Class/LearningCenter/OnlineLearning/CustomStudyEntity.h
+26
-0
CustomStudyEntity.m
Class/LearningCenter/OnlineLearning/CustomStudyEntity.m
+40
-0
LearningCompleteViewController.h
...ingCenter/OnlineLearning/LearningCompleteViewController.h
+14
-0
LearningCompleteViewController.m
...ingCenter/OnlineLearning/LearningCompleteViewController.m
+5
-0
OnlineLearningDetailViewController.h
...enter/OnlineLearning/OnlineLearningDetailViewController.h
+4
-2
OnlineLearningDetailViewController.m
...enter/OnlineLearning/OnlineLearningDetailViewController.m
+72
-9
OnlineLearningViewController.m
...rningCenter/OnlineLearning/OnlineLearningViewController.m
+1
-1
PPTListItemTableViewCell.h
.../LearningCenter/OnlineLearning/PPTListItemTableViewCell.h
+5
-0
SpecifiedTableViewCell.h
Class/LearningCenter/OnlineLearning/SpecifiedTableViewCell.h
+25
-0
SpecifiedTableViewCell.m
Class/LearningCenter/OnlineLearning/SpecifiedTableViewCell.m
+24
-0
VideoDetailIntroTableViewCell.h
...ningCenter/OnlineLearning/VideoDetailIntroTableViewCell.h
+6
-4
VideoDetailIntroTableViewCell.m
...ningCenter/OnlineLearning/VideoDetailIntroTableViewCell.m
+7
-3
VideoDetailViewController.h
...LearningCenter/OnlineLearning/VideoDetailViewController.h
+10
-0
VideoDetailViewController.m
...LearningCenter/OnlineLearning/VideoDetailViewController.m
+26
-29
VideoHelperViewController.h
...LearningCenter/OnlineLearning/VideoHelperViewController.h
+18
-1
VideoHelperViewController.m
...LearningCenter/OnlineLearning/VideoHelperViewController.m
+36
-14
VideoLecturerTableViewCell.h
...earningCenter/OnlineLearning/VideoLecturerTableViewCell.h
+4
-6
VideoLecturerTableViewCell.m
...earningCenter/OnlineLearning/VideoLecturerTableViewCell.m
+9
-4
VideoListItemTableViewCell.h
...earningCenter/OnlineLearning/VideoListItemTableViewCell.h
+5
-0
VideoListItemTableViewCell.m
...earningCenter/OnlineLearning/VideoListItemTableViewCell.m
+4
-3
VideoListViewController.h
...s/LearningCenter/OnlineLearning/VideoListViewController.h
+15
-2
VideoListViewController.m
...s/LearningCenter/OnlineLearning/VideoListViewController.m
+52
-5
OrderdetailsViewController.m
Class/OrderdetailsViewController.m
+2
-2
project.pbxproj
Lighting.xcodeproj/project.pbxproj
+30
-0
LearningCenter.storyboard
Lighting/LearningCenter.storyboard
+191
-50
CustomWKWebViewController.m
Tools/CustomWKWebViewController.m
+41
-71
PrefixHeader.pch
Tools/PrefixHeader.pch
+1
-0
VICacheConfiguration.m
Tools/VideoCache/Cache/VICacheConfiguration.m
+1
-1
VIResourceLoaderManager.m
Tools/VideoCache/ResourceLoader/VIResourceLoaderManager.m
+2
-2
opple_objc_json_client.h
Tools/opple_objc_json_client.h
+1197
-570
opple_objc_json_client.m
Tools/opple_objc_json_client.m
+383
-184
No files found.
Class/LearningCenter/OnlineLearning/AssessmentHeaderView.h
0 → 100644
View file @
f9d20cbc
//
// AssessmentHeaderView.h
// Lighting
//
// Created by 曹云霄 on 2016/12/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface
AssessmentHeaderView
:
UITableViewCell
/**
问题
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
titleLabel
;
/**
序列号
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
serialNumberLable
;
@end
Class/LearningCenter/OnlineLearning/AssessmentHeaderView.m
0 → 100644
View file @
f9d20cbc
//
// AssessmentHeaderView.m
// Lighting
//
// Created by 曹云霄 on 2016/12/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "AssessmentHeaderView.h"
@implementation
AssessmentHeaderView
-
(
void
)
awakeFromNib
{
[
super
awakeFromNib
];
// Initialization code
}
-
(
void
)
setSelected
:
(
BOOL
)
selected
animated
:
(
BOOL
)
animated
{
[
super
setSelected
:
selected
animated
:
animated
];
// Configure the view for the selected state
}
@end
Class/LearningCenter/OnlineLearning/AssessmentTableViewCell.h
0 → 100644
View file @
f9d20cbc
//
// AssessmentTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 2016/12/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface
AssessmentTableViewCell
:
UITableViewCell
/**
题号
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UIButton
*
titleNumberButton
;
/**
答案
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
answerTitleLabel
;
@end
Class/LearningCenter/OnlineLearning/AssessmentTableViewCell.m
0 → 100644
View file @
f9d20cbc
//
// AssessmentTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 2016/12/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "AssessmentTableViewCell.h"
@implementation
AssessmentTableViewCell
-
(
void
)
awakeFromNib
{
[
super
awakeFromNib
];
// Initialization code
}
-
(
void
)
setSelected
:
(
BOOL
)
selected
animated
:
(
BOOL
)
animated
{
[
super
setSelected
:
selected
animated
:
animated
];
// Configure the view for the selected state
}
@end
Class/LearningCenter/OnlineLearning/AssessmentViewController.h
0 → 100644
View file @
f9d20cbc
//
// AssessmentViewController.h
// Lighting
//
// Created by 曹云霄 on 2016/12/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface
AssessmentViewController
:
BaseViewController
/**
考核tableview
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UITableView
*
AssessmentTableView
;
/**
考核标题
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
AssessmentTitleLabel
;
/**
考核时间
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
AssessmentTimeLabel
;
/**
学习任务ID
*/
@property
(
nonatomic
,
copy
)
NSString
*
taskId
;
@end
Class/LearningCenter/OnlineLearning/AssessmentViewController.m
0 → 100644
View file @
f9d20cbc
//
// AssessmentViewController.m
// Lighting
//
// Created by 曹云霄 on 2016/12/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "AssessmentViewController.h"
#import "AssessmentHeaderView.h"
#import "AssessmentTableViewCell.h"
@interface
AssessmentViewController
()
<
UITableViewDelegate
,
UITableViewDataSource
>
@end
@implementation
AssessmentViewController
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
[
self
uiConfigAction
];
[
self
getExaminationQuestions
];
}
#pragma mark - 设置UI
-
(
void
)
uiConfigAction
{
}
#pragma mark - 获取考题
-
(
void
)
getExaminationQuestions
{
WS
(
weakSelf
);
[
self
CreateMBProgressHUDLoding
];
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:[
NSString
stringWithFormat
:
SERVERREQUESTURL
(
STUDYITEMDETAIL
),
self
.
taskId
]
WithCallClass
:
weakSelf
WithRequestType
:
ONE
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
NSLog
(
@"%@"
,[
returnValue
JSONString
]);
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
TOStudyTaskEntity
*
taskDetails
=
[[
TOStudyTaskEntity
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithFailureBlock
:^
(
NSError
*
error
)
{
}];
}
#pragma mark - <UITableViewDelegate,UITableViewDataSource>
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
AssessmentTableViewCell
*
assessmentCell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"AssessmentTableViewCell"
forIndexPath
:
indexPath
];
return
assessmentCell
;
}
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
return
2
;
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
1
;
}
-
(
UIView
*
)
tableView
:
(
UITableView
*
)
tableView
viewForHeaderInSection
:
(
NSInteger
)
section
{
AssessmentHeaderView
*
headerView
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"AssessmentHeaderView"
];
return
headerView
;
}
@end
Class/LearningCenter/OnlineLearning/CustomStudyEntity.h
0 → 100644
View file @
f9d20cbc
//
// CustomStudyEntity.h
// Lighting
//
// Created by 曹云霄 on 2016/12/5.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "opple_objc_json_client.h"
@interface
CustomStudyEntity
:
TOStudyTaskEntity
/**
学习简介高度
*/
@property
(
nonatomic
,
assign
)
CGFloat
contentHeight
;
/**
导师介绍高度
*/
@property
(
nonatomic
,
assign
)
CGFloat
teacherIntroHeight
;
@end
Class/LearningCenter/OnlineLearning/CustomStudyEntity.m
0 → 100644
View file @
f9d20cbc
//
// CustomStudyEntity.m
// Lighting
//
// Created by 曹云霄 on 2016/12/5.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "CustomStudyEntity.h"
@implementation
CustomStudyEntity
-
(
CGFloat
)
contentHeight
{
if
(
!
_contentHeight
)
{
_contentHeight
=
[
self
calculateStudyIntroductionHeight
:
self
.
contentString
]
+
78
;
}
return
_contentHeight
;
}
-
(
CGFloat
)
teacherIntroHeight
{
if
(
!
_teacherIntroHeight
)
{
_teacherIntroHeight
=
[
self
calculateStudyIntroductionHeight
:
self
.
teacherIntro
]
+
108
;
}
return
_teacherIntroHeight
;
}
#pragma mark - 计算高度
-
(
CGFloat
)
calculateStudyIntroductionHeight
:
(
NSString
*
)
content
{
CGSize
s
=
[
content
boundingRectWithSize
:
CGSizeMake
(
ScreenWidth
*
2
/
3
-
28
*
2
,
CGFLOAT_MAX
)
options
:
NSStringDrawingUsesLineFragmentOrigin
|
NSStringDrawingUsesFontLeading
attributes
:
@{
NSFontAttributeName
:
[
UIFont
systemFontOfSize
:
13
]}
context
:
nil
].
size
;
return
s
.
height
;
}
@end
Class/LearningCenter/OnlineLearning/LearningCompleteViewController.h
View file @
f9d20cbc
...
...
@@ -8,12 +8,26 @@
#import "BaseViewController.h"
@protocol
BeginAssessmentDelegate
<
NSObject
>
-
(
void
)
beginAssessment
:
(
CustomStudyEntity
*
)
studyEntity
;
@end
@interface
LearningCompleteViewController
:
BaseViewController
@property
(
nonatomic
,
weak
)
id
<
BeginAssessmentDelegate
>
delegate
;
/**
获得积分
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
obtainIntegralLabel
;
/**
数据源
*/
@property
(
nonatomic
,
strong
)
CustomStudyEntity
*
studyEntity
;
@end
Class/LearningCenter/OnlineLearning/LearningCompleteViewController.m
View file @
f9d20cbc
...
...
@@ -21,6 +21,11 @@
#pragma mark - 开始考核
-
(
IBAction
)
startEvaluationButtonClickAction
:
(
UIButton
*
)
sender
{
if
([
self
.
delegate
respondsToSelector
:
@selector
(
beginAssessment
:)])
{
[
self
.
delegate
beginAssessment
:
self
.
studyEntity
];
}
}
@end
Class/LearningCenter/OnlineLearning/OnlineLearningDetailViewController.h
View file @
f9d20cbc
...
...
@@ -13,8 +13,10 @@
/**
学习项
ID
学习项
*/
@property
(
nonatomic
,
copy
)
NSString
*
studyTypeID
;
@property
(
nonatomic
,
copy
)
TOStudyTypeEntity
*
studyTypeEntity
;
@end
Class/LearningCenter/OnlineLearning/OnlineLearningDetailViewController.m
View file @
f9d20cbc
...
...
@@ -10,15 +10,18 @@
#import "VideoHelperViewController.h"
#import "VideoListViewController.h"
#import "VideoDetailViewController.h"
#import "CustomWKWebViewController.h"
#import "LearningCompleteViewController.h"
#import "AssessmentViewController.h"
@interface
OnlineLearningDetailViewController
()
@interface
OnlineLearningDetailViewController
()
<
SelectStudyItemDelegate
,
VideoPlayerDelegate
,
BeginAssessmentDelegate
>
/**
学习
项详情
学习
数据
*/
@property
(
nonatomic
,
strong
)
StudyTypeResponse
*
studyResponse
;
@property
(
nonatomic
,
strong
)
StudyTaskResponse
*
studyResult
;
@property
(
nonatomic
,
strong
)
WYPopoverController
*
settingsPopoverController
;
@end
...
...
@@ -58,13 +61,15 @@
{
//播放窗口
VideoHelperViewController
*
videoWindow
=
[[[
self
class
]
getLearningCenterStoryboardClass
]
instantiateViewControllerWithIdentifier
:
@"VideoHelperViewController"
];
videoWindow
.
learningItemUrl
=
@"http://mpvideo-test.b0.upaiyun.com/5813998fb092e5771.mp4"
;
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
];
//播放简介
...
...
@@ -98,19 +103,18 @@
WS
(
weakSelf
);
StudyTaskCondition
*
studyListModel
=
[[
StudyTaskCondition
alloc
]
init
];
studyListModel
.
employeeIdEquals
=
[
Shoppersmanager
manager
].
Shoppers
.
employee
.
fid
;
studyListModel
.
typeEquals
=
self
.
studyType
ID
;
studyListModel
.
typeEquals
=
self
.
studyType
Entity
.
fid
;
DataPage
*
page
=
[[
DataPage
alloc
]
init
];
page
.
page
=
ONE
;
page
.
rows
=
9999
;
studyListModel
.
page
=
page
;
[
self
CreateMBProgressHUDLoding
];
NSLog
(
@"%@"
,[
studyListModel
toDictionary
]);
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
STUDYLIST
)
WithCallClass
:
weakSelf
WithRequestType
:
ZERO
WithParameter
:
studyListModel
WithReturnValueBlock
:^
(
id
returnValue
)
{
NSLog
(
@"%@"
,[
returnValue
JSONString
]);
[
weakSelf
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
weakSelf
.
studyResponse
=
[[
StudyTypeResponse
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
weakSelf
.
studyResult
=
[[
StudyTaskResponse
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
[
weakSelf
transferData
:
weakSelf
.
studyResult
];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
...
...
@@ -122,5 +126,64 @@
}];
}
#pragma mark - 选中学习项
-
(
void
)
seleStudyItemCellIndex
:
(
NSIndexPath
*
)
indexPath
{
VideoDetailViewController
*
studyDetailVc
=
[
self
.
childViewControllers
lastObject
];
studyDetailVc
.
indexPath
=
indexPath
;
VideoHelperViewController
*
videoVc
=
[
self
.
childViewControllers
firstObject
];
RsStudyTask
*
studyEntity
=
self
.
studyResult
.
studyEntity
[
indexPath
.
section
];
CustomStudyEntity
*
studyList
=
studyEntity
.
studyTasks
[
indexPath
.
row
];
if
([
studyList
.
attachment
.
fileUrl
rangeOfString
:
@".mp4"
].
location
!=
NSNotFound
)
{
videoVc
.
learningItem
=
studyList
;
videoVc
.
videoTitleLabel
.
text
=
studyList
.
title
;
}
else
if
([
studyList
.
attachment
.
fileUrl
rangeOfString
:
@".ppt"
].
location
!=
NSNotFound
)
{
[
videoVc
resetPlayer
];
CustomWKWebViewController
*
pdfvc
=
[[
CustomWKWebViewController
alloc
]
init
];
pdfvc
.
urlString
=
studyList
.
attachment
.
fileUrl
;
[
self
presentViewController
:
pdfvc
animated
:
YES
completion
:
nil
];
}
}
#pragma mark - 视频播放完成
-
(
void
)
videoPlayFinish
:
(
CustomStudyEntity
*
)
studyEntity
{
LearningCompleteViewController
*
assessmentVc
=
[[[
self
class
]
getLearningCenterStoryboardClass
]
instantiateViewControllerWithIdentifier
:
@"LearningCompleteViewController"
];
assessmentVc
.
delegate
=
self
;
assessmentVc
.
studyEntity
=
studyEntity
;
assessmentVc
.
preferredContentSize
=
CGSizeMake
(
520
,
450
);
self
.
settingsPopoverController
=
[[
WYPopoverController
alloc
]
initWithContentViewController
:
assessmentVc
];
self
.
settingsPopoverController
.
wantsDefaultContentAppearance
=
NO
;
self
.
settingsPopoverController
.
theme
.
fillBottomColor
=
[
UIColor
clearColor
];
self
.
settingsPopoverController
.
theme
.
fillTopColor
=
[
UIColor
clearColor
];
self
.
settingsPopoverController
.
theme
.
glossShadowColor
=
[
UIColor
clearColor
];
[
self
.
settingsPopoverController
presentPopoverAsDialogAnimated
:
YES
options
:
WYPopoverAnimationOptionFadeWithScale
];
}
#pragma mark - 开始考核
-
(
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
];
}];
}
#pragma mark - 赋值
-
(
void
)
transferData
:
(
StudyTaskResponse
*
)
result
{
VideoListViewController
*
studyListVC
=
self
.
childViewControllers
[
1
];
studyListVC
.
datasArray
=
result
.
studyEntity
;
VideoDetailViewController
*
studyDetailsVC
=
self
.
childViewControllers
[
2
];
studyDetailsVC
.
datasArray
=
result
.
studyEntity
;
studyDetailsVC
.
indexPath
=
[
NSIndexPath
indexPathForRow
:
0
inSection
:
0
];
}
@end
Class/LearningCenter/OnlineLearning/OnlineLearningViewController.m
View file @
f9d20cbc
...
...
@@ -76,7 +76,7 @@
-
(
void
)
collectionView
:
(
UICollectionView
*
)
collectionView
didSelectItemAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
OnlineLearningDetailViewController
*
studyDetail
=
[[[
self
class
]
getLearningCenterStoryboardClass
]
instantiateViewControllerWithIdentifier
:
@"OnlineLearningDetailViewController"
];
studyDetail
.
studyType
ID
=
[
self
.
studyTypeArray
[
indexPath
.
row
]
fid
];
studyDetail
.
studyType
Entity
=
self
.
studyTypeArray
[
indexPath
.
row
];
[
self
.
navigationController
pushViewController
:
studyDetail
animated
:
YES
];
}
...
...
Class/LearningCenter/OnlineLearning/PPTListItemTableViewCell.h
View file @
f9d20cbc
...
...
@@ -31,4 +31,9 @@
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
studyItemLabel
;
/**
学习列表数据源
*/
@property
(
nonatomic
,
strong
)
TOStudyTaskEntity
*
model
;
@end
Class/LearningCenter/OnlineLearning/SpecifiedTableViewCell.h
0 → 100644
View file @
f9d20cbc
//
// SpecifiedTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 2016/12/5.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface
SpecifiedTableViewCell
:
UITableViewCell
/**
针对人员
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
specifiedPersonLabel
;
/**
数据源
*/
@property
(
nonatomic
,
strong
)
CustomStudyEntity
*
studyEntity
;
@end
Class/LearningCenter/OnlineLearning/SpecifiedTableViewCell.m
0 → 100644
View file @
f9d20cbc
//
// SpecifiedTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 2016/12/5.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "SpecifiedTableViewCell.h"
@implementation
SpecifiedTableViewCell
-
(
void
)
awakeFromNib
{
[
super
awakeFromNib
];
// Initialization code
}
-
(
void
)
setStudyEntity
:
(
CustomStudyEntity
*
)
studyEntity
{
_studyEntity
=
studyEntity
;
self
.
specifiedPersonLabel
.
text
=
_studyEntity
.
suitabler
;
}
@end
Class/LearningCenter/OnlineLearning/VideoDetailIntroTableViewCell.h
View file @
f9d20cbc
...
...
@@ -11,15 +11,17 @@
@interface
VideoDetailIntroTableViewCell
:
UITableViewCell
/**
介绍项标题
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
studyIntroTitleLabel
;
/**
简介
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
studyIntroDetailTitleLabel
;
/**
数据源
*/
@property
(
nonatomic
,
strong
)
CustomStudyEntity
*
studyEntity
;
@end
Class/LearningCenter/OnlineLearning/VideoDetailIntroTableViewCell.m
View file @
f9d20cbc
...
...
@@ -15,10 +15,14 @@
// Initialization code
}
-
(
void
)
setSelected
:
(
BOOL
)
selected
animated
:
(
BOOL
)
animated
{
[
super
setSelected
:
selected
animated
:
animated
];
// Configure the view for the selected state
-
(
void
)
setStudyEntity
:
(
CustomStudyEntity
*
)
studyEntity
{
_studyEntity
=
studyEntity
;
if
(
_studyEntity
)
{
self
.
studyIntroDetailTitleLabel
.
text
=
_studyEntity
.
contentString
;
self
.
studyIntroDetailTitleLabel
.
height
=
_studyEntity
.
contentHeight
-
78
;
}
}
@end
Class/LearningCenter/OnlineLearning/VideoDetailViewController.h
View file @
f9d20cbc
...
...
@@ -31,4 +31,14 @@ typedef NS_ENUM(NSInteger,CellType){
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UITableView
*
studyItemDetailsTableView
;
/**
学习列表数据源
*/
@property
(
nonatomic
,
strong
)
NSArray
*
datasArray
;
/**
选择项
*/
@property
(
nonatomic
,
strong
)
NSIndexPath
*
indexPath
;
@end
Class/LearningCenter/OnlineLearning/VideoDetailViewController.m
View file @
f9d20cbc
...
...
@@ -10,14 +10,11 @@
#import "VideoDetailIntroTableViewCell.h"
#import "VideoLecturerTableViewCell.h"
#import "WkWebViewViewController.h"
#import "SpecifiedTableViewCell.h"
@interface
VideoDetailViewController
()
<
UITableViewDataSource
,
UITableViewDelegate
>
/**
简介高度
*/
@property
(
nonatomic
,
assign
)
CGFloat
introductionHeight
;
@end
...
...
@@ -26,28 +23,20 @@
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
[
self
addChildWebViewController
];
[
self
setUpTableView
];
}
#pragma mark -
UITableView
-
(
void
)
set
UpTableView
#pragma mark -
选中学习内容下标
-
(
void
)
set
IndexPath
:
(
NSIndexPath
*
)
indexPath
{
self
.
studyItemDetailsTableView
.
tableFooterView
=
[
UIView
new
];
_indexPath
=
indexPath
;
[
self
.
studyItemDetailsTableView
reloadData
];
}
#pragma mark -
WKWeb
View
-
(
void
)
addChildWebViewController
#pragma mark -
UITable
View
-
(
void
)
setUpTableView
{
WS
(
weakSelf
);
WkWebViewViewController
*
webView
=
[[
WkWebViewViewController
alloc
]
initWithReturnContentSize
:
^
(
CGFloat
contentHeight
)
{
weakSelf
.
introductionHeight
=
contentHeight
;
webView
.
view
.
frame
=
CGRectMake
(
0
,
0
,
ScreenWidth
,
contentHeight
);
[
weakSelf
.
studyItemDetailsTableView
reloadData
];
}];
self
.
introductionHeight
=
100
;
//默认值
webView
.
view
.
frame
=
CGRectMake
(
0
,
0
,
ScreenWidth
,
self
.
introductionHeight
);
[
self
addChildViewController
:
webView
];
self
.
studyItemDetailsTableView
.
tableFooterView
=
[
UIView
new
];
}
#pragma mark - <UITableViewDelegate,UITableViewDataSource>
...
...
@@ -57,19 +46,24 @@
case
StudyItemIntroCell
:
{
VideoDetailIntroTableViewCell
*
itemDetailCell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"VideoDetailIntroTableViewCell"
forIndexPath
:
indexPath
];
[
itemDetailCell
.
contentView
addSubview
:
self
.
childViewControllers
[
0
].
view
];
RsStudyTask
*
studyEntity
=
self
.
datasArray
[
self
.
indexPath
.
section
];
itemDetailCell
.
studyEntity
=
studyEntity
.
studyTasks
[
self
.
indexPath
.
row
];
return
itemDetailCell
;
}
break
;
case
LecturerIntroCell
:
{
VideoLecturerTableViewCell
*
lectureCell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"VideoLecturerTableViewCell"
forIndexPath
:
indexPath
];
RsStudyTask
*
studyEntity
=
self
.
datasArray
[
self
.
indexPath
.
section
];
lectureCell
.
studyEntity
=
studyEntity
.
studyTasks
[
self
.
indexPath
.
row
];
return
lectureCell
;
}
break
;
case
ContraposePersonCell
:
{
VideoDetailIntroTableViewCell
*
scopeCell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"VideoDetailIntroTableViewCell"
forIndexPath
:
indexPath
];
SpecifiedTableViewCell
*
scopeCell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"SpecifiedTableViewCell"
forIndexPath
:
indexPath
];
RsStudyTask
*
studyEntity
=
self
.
datasArray
[
self
.
indexPath
.
section
];
scopeCell
.
studyEntity
=
studyEntity
.
studyTasks
[
self
.
indexPath
.
row
];
return
scopeCell
;
}
break
;
...
...
@@ -87,21 +81,17 @@
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
RsStudyTask
*
studyEntity
=
self
.
datasArray
[
self
.
indexPath
.
section
];
CustomStudyEntity
*
study
=
studyEntity
.
studyTasks
[
self
.
indexPath
.
row
];
switch
(
indexPath
.
row
)
{
case
StudyItemIntroCell
:
{
return
self
.
introductionHeight
;
}
return
study
.
contentHeight
;
break
;
case
LecturerIntroCell
:
{
return
130
;
}
return
study
.
teacherIntroHeight
;
break
;
case
ContraposePersonCell
:
{
return
100
;
}
break
;
default
:
...
...
@@ -110,4 +100,11 @@
return
0
;
}
@end
Class/LearningCenter/OnlineLearning/VideoHelperViewController.h
View file @
f9d20cbc
...
...
@@ -8,7 +8,14 @@
#import "BaseViewController.h"
#import <AVFoundation/AVFoundation.h>
#import "VIMediaCache.h"
@protocol
VideoPlayerDelegate
<
NSObject
>
@optional
-
(
void
)
videoPlayFinish
:
(
CustomStudyEntity
*
)
studyEntity
;
@end
@interface
VideoHelperViewController
:
BaseViewController
...
...
@@ -17,6 +24,11 @@
播放Layer
*/
@property
(
nonatomic
,
strong
)
AVPlayerLayer
*
playerLayer
;
@property
(
nonatomic
,
strong
)
AVPlayer
*
customPlayer
;
@property
(
nonatomic
,
strong
)
AVPlayerItem
*
playerItem
;
@property
(
nonatomic
,
strong
)
id
avplayerServer
;
@property
(
nonatomic
,
strong
)
VIResourceLoaderManager
*
resourceLoaderManager
;
@property
(
nonatomic
,
weak
)
id
<
VideoPlayerDelegate
>
delegate
;
/**
视频导航栏
...
...
@@ -56,12 +68,17 @@
/**
播放路径
*/
@property
(
nonatomic
,
copy
)
NSString
*
learningItemUrl
;
@property
(
nonatomic
,
copy
)
CustomStudyEntity
*
learningItem
;
/**
放大缩小 boolValue(true 全屏)
*/
@property
(
nonatomic
,
copy
)
void
(
^
zoomButtonClickBlock
)(
BOOL
boolValue
);
/**
重置播放器
*/
-
(
void
)
resetPlayer
;
@end
Class/LearningCenter/OnlineLearning/VideoHelperViewController.m
View file @
f9d20cbc
...
...
@@ -7,15 +7,11 @@
//
#import "VideoHelperViewController.h"
#import "VIMediaCache.h"
@interface
VideoHelperViewController
()
<
UIDocumentInteractionControllerDelegate
>
@property
(
nonatomic
,
strong
)
AVPlayer
*
customPlayer
;
@property
(
nonatomic
,
strong
)
AVPlayerItem
*
playerItem
;
@property
(
nonatomic
,
strong
)
id
avplayerServer
;
@property
(
nonatomic
,
strong
)
VIResourceLoaderManager
*
resourceLoaderManager
;
/**
导航栏、工具类是否隐藏
...
...
@@ -30,9 +26,7 @@
{
[
super
viewDidLoad
];
[
self
uiConfigAction
];
[
self
setUpAVPlayer
];
[
self
addAVPlayerKVO
];
[
self
addProgressObserver
];
}
#pragma mark - UI
...
...
@@ -46,7 +40,7 @@
#pragma mark -
-
(
void
)
judgeVideoOrPPT
{
NSURL
*
movieURL
=
[
NSURL
URLWithString
:
self
.
learningItemUrl
];
NSURL
*
movieURL
=
[
NSURL
URLWithString
:
self
.
learningItem
.
attachment
.
file
Url
];
NSDictionary
*
opts
=
[
NSDictionary
dictionaryWithObject
:[
NSNumber
numberWithBool
:
NO
]
forKey
:
AVURLAssetPreferPreciseDurationAndTimingKey
];
AVURLAsset
*
urlAsset
=
[
AVURLAsset
URLAssetWithURL
:
movieURL
options
:
opts
];
// 初始化视频媒体文件
...
...
@@ -56,22 +50,34 @@
NSLog
(
@"%ld"
,
second
);
}
#pragma mark - 播放地址
-
(
void
)
setLearningItem
:
(
CustomStudyEntity
*
)
learningItem
{
_learningItem
=
learningItem
;
[
self
resetPlayer
];
if
(
_learningItem
)
{
[
self
setUpAVPlayer
];
[
self
addAVPlayerKVO
];
[
self
addProgressObserver
];
}
}
#pragma mark - SetUp AVPlayer
-
(
void
)
setUpAVPlayer
{
VIResourceLoaderManager
*
resourceLoaderManager
=
[
VIResourceLoaderManager
new
];
self
.
resourceLoaderManager
=
resourceLoaderManager
;
self
.
playerItem
=
[
resourceLoaderManager
playerItemWithURL
:[
NSURL
URLWithString
:
self
.
learningItemUrl
]];
VICacheConfiguration
*
configuration
=
[
VICacheManager
cacheConfigurationForURL
:[
NSURL
URLWithString
:
self
.
learningItemUrl
]];
self
.
playerItem
=
[
resourceLoaderManager
playerItemWithURL
:[
NSURL
URLWithString
:
self
.
learningItem
.
attachment
.
file
Url
]];
VICacheConfiguration
*
configuration
=
[
VICacheManager
cacheConfigurationForURL
:[
NSURL
URLWithString
:
self
.
learningItem
.
attachment
.
file
Url
]];
if
(
configuration
.
progress
>=
1
.
0
)
{
NSLog
(
@"缓存完成"
);
}
self
.
customPlayer
=
[[
AVPlayer
alloc
]
initWithPlayerItem
:
_playerItem
];
self
.
playerLayer
=
[
AVPlayerLayer
playerLayerWithPlayer
:
_customPlayer
];
[
self
CreateMBProgressHUDLoding
];
self
.
customPlayer
=
[[
AVPlayer
alloc
]
initWithPlayerItem
:
self
.
playerItem
];
self
.
playerLayer
=
[
AVPlayerLayer
playerLayerWithPlayer
:
self
.
customPlayer
];
self
.
playerLayer
.
videoGravity
=
AVLayerVideoGravityResizeAspectFill
;
self
.
playerLayer
.
frame
=
CGRectMake
(
0
,
0
,
ScreenWidth
*
2
/
3
,
ScreenHeight
/
2
);
[
self
.
view
.
layer
insertSublayer
:
self
.
playerLayer
atIndex
:
0
];
[
self
CreateMBProgressHUDLoding
];
//设置静音模式播放声音
AVAudioSession
*
session
=
[
AVAudioSession
sharedInstance
];
[
session
setCategory
:
AVAudioSessionCategoryPlayback
error
:
nil
];
...
...
@@ -95,11 +101,14 @@
NSInteger
status
=
[[
change
objectForKey
:
NSKeyValueChangeNewKey
]
integerValue
];
switch
(
status
)
{
case
AVPlayerStatusFailed
:
self
.
bufferProgressView
.
progress
=
ZERO
;
self
.
playButton
.
selected
=
YES
;
[
self
ErrorMBProgressView
:
@"播放失败"
];
break
;
case
AVPlayerStatusReadyToPlay
:
//正在播放
[
self
RemoveMBProgressHUDLoding
];
self
.
playItemTotalTimeLabel
.
text
=
[
NSString
stringWithFormat
:
@"/ %@"
,[
self
convertTime
:
CMTimeGetSeconds
(
self
.
playerItem
.
duration
)]];
self
.
playButton
.
selected
=
NO
;
break
;
default
:
break
;
...
...
@@ -176,6 +185,9 @@
{
[
self
.
customPlayer
seekToTime
:
kCMTimeZero
];
self
.
playButton
.
selected
=
YES
;
if
([
self
.
delegate
respondsToSelector
:
@selector
(
videoPlayFinish
:)])
{
[
self
.
delegate
videoPlayFinish
:
self
.
learningItem
];
}
}
#pragma mark - 播放、暂停
...
...
@@ -218,6 +230,16 @@
[
self
.
customPlayer
.
currentItem
.
asset
cancelLoading
];
}
#pragma mark - 重置播放器
-
(
void
)
resetPlayer
{
[
self
.
customPlayer
pause
];
[
self
.
customPlayer
seekToTime
:
kCMTimeZero
];
self
.
bufferProgressView
.
progress
=
0
;
self
.
playingTimeLabel
.
text
=
@"00:00"
;
self
.
customPlayer
=
nil
;
}
#pragma mark - 释放KVO
-
(
void
)
dealloc
{
...
...
Class/LearningCenter/OnlineLearning/VideoLecturerTableViewCell.h
View file @
f9d20cbc
...
...
@@ -11,12 +11,6 @@
@interface
VideoLecturerTableViewCell
:
UITableViewCell
/**
讲师介绍标题
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
lecturerTitleLabel
;
/**
讲师头像
*/
...
...
@@ -32,5 +26,9 @@
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
lecurerIntroLabel
;
/**
数据源
*/
@property
(
nonatomic
,
strong
)
CustomStudyEntity
*
studyEntity
;
@end
Class/LearningCenter/OnlineLearning/VideoLecturerTableViewCell.m
View file @
f9d20cbc
...
...
@@ -15,10 +15,15 @@
// Initialization code
}
-
(
void
)
setSelected
:
(
BOOL
)
selected
animated
:
(
BOOL
)
animated
{
[
super
setSelected
:
selected
animated
:
animated
];
// Configure the view for the selected state
-
(
void
)
setStudyEntity
:
(
CustomStudyEntity
*
)
studyEntity
{
_studyEntity
=
studyEntity
;
if
(
_studyEntity
)
{
[
self
.
lecturerImageView
sd_setImageWithURL
:[
NSURL
URLWithString
:
_studyEntity
.
teacherAttachment
.
fileUrl
]
placeholderImage
:
REPLACEIMAGE
];
self
.
lecturerNameLabel
.
text
=
_studyEntity
.
teacher
;
self
.
lecurerIntroLabel
.
text
=
_studyEntity
.
teacherIntro
;
self
.
lecurerIntroLabel
.
height
=
_studyEntity
.
teacherIntroHeight
-
108
;
}
}
@end
Class/LearningCenter/OnlineLearning/VideoListItemTableViewCell.h
View file @
f9d20cbc
...
...
@@ -31,4 +31,9 @@
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
studyItemTimeLabel
;
/**
学习列表数据源
*/
@property
(
nonatomic
,
strong
)
TOStudyTaskEntity
*
model
;
@end
Class/LearningCenter/OnlineLearning/VideoListItemTableViewCell.m
View file @
f9d20cbc
...
...
@@ -15,10 +15,11 @@
// Initialization code
}
-
(
void
)
setSelected
:
(
BOOL
)
selected
animated
:
(
BOOL
)
animated
{
[
super
setSelected
:
selected
animated
:
animated
];
// Configure the view for the selected state
-
(
void
)
setModel
:
(
TOStudyTaskEntity
*
)
model
{
_model
=
model
;
self
.
studyItemTitleLabel
.
text
=
_model
.
title
;
}
@end
Class/LearningCenter/OnlineLearning/VideoListViewController.h
View file @
f9d20cbc
...
...
@@ -8,9 +8,19 @@
#import "BaseViewController.h"
@interface
VideoListViewController
:
BaseViewController
/**
选中
*/
@protocol
SelectStudyItemDelegate
<
NSObject
>
@required
-
(
void
)
seleStudyItemCellIndex
:
(
NSIndexPath
*
)
indexPath
;
@end
@interface
VideoListViewController
:
BaseViewController
@property
(
nonatomic
,
weak
)
id
<
SelectStudyItemDelegate
>
delegate
;
/**
学习列表
...
...
@@ -22,5 +32,8 @@
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
studyItemTitleLabel
;
/**
学习列表数据源
*/
@property
(
nonatomic
,
strong
)
NSArray
*
datasArray
;
@end
Class/LearningCenter/OnlineLearning/VideoListViewController.m
View file @
f9d20cbc
...
...
@@ -9,6 +9,7 @@
#import "VideoListViewController.h"
#import "VideoListItemTableViewCell.h"
#import "VideoListSectionHeaderView.h"
#import "PPTListItemTableViewCell.h"
@interface
VideoListViewController
()
<
UITableViewDelegate
,
UITableViewDataSource
>
...
...
@@ -25,6 +26,13 @@
[
self
setUpTableView
];
}
#pragma mark - 数据源
-
(
void
)
setDatasArray
:
(
NSArray
*
)
datasArray
{
_datasArray
=
datasArray
;
[
self
.
studyListTableView
reloadData
];
}
#pragma mark - UITableView
-
(
void
)
setUpTableView
{
...
...
@@ -36,24 +44,63 @@
#pragma mark - <UITableViewDelegate,UITableViewDataSource>
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
VideoListItemTableViewCell
*
studyItemCell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"VideoListItemTableViewCell"
forIndexPath
:
indexPath
];
return
studyItemCell
;
RsStudyTask
*
studyEntity
=
self
.
datasArray
[
indexPath
.
section
];
CustomStudyEntity
*
studyList
=
studyEntity
.
studyTasks
[
indexPath
.
row
];
if
([
studyList
.
attachment
.
fileUrl
rangeOfString
:
@".ppt"
].
location
!=
NSNotFound
)
{
PPTListItemTableViewCell
*
pptItemCell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"PPTListItemTableViewCell"
forIndexPath
:
indexPath
];
pptItemCell
.
model
=
studyList
;
return
pptItemCell
;
}
else
if
([
studyList
.
attachment
.
fileUrl
rangeOfString
:
@".mp4"
].
location
!=
NSNotFound
){
VideoListItemTableViewCell
*
videoItemCell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"VideoListItemTableViewCell"
forIndexPath
:
indexPath
];
videoItemCell
.
model
=
studyList
;
return
videoItemCell
;
}
return
[
UITableViewCell
new
];
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
10
;
RsStudyTask
*
studyTask
=
self
.
datasArray
[
section
];
return
studyTask
.
studyTasks
.
count
;
}
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
return
self
.
datasArray
.
count
;
}
-
(
UIView
*
)
tableView
:
(
UITableView
*
)
tableView
viewForHeaderInSection
:
(
NSInteger
)
section
{
VideoListSectionHeaderView
*
headerView
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"VideoListSectionHeaderView"
];
headerView
.
studyItemSectionLabel
.
text
=
[
self
.
datasArray
[
section
]
categoryName
];
return
headerView
;
}
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
return
2
;
RsStudyTask
*
studyEntity
=
self
.
datasArray
[
indexPath
.
section
];
CustomStudyEntity
*
studyList
=
studyEntity
.
studyTasks
[
indexPath
.
row
];
for
(
UITableViewCell
*
cell
in
self
.
studyListTableView
.
visibleCells
)
{
if
([
cell
isKindOfClass
:[
PPTListItemTableViewCell
class
]])
{
PPTListItemTableViewCell
*
pptCell
=
(
PPTListItemTableViewCell
*
)
cell
;
pptCell
.
pptButton
.
selected
=
NO
;
}
if
([
cell
isKindOfClass
:[
VideoListItemTableViewCell
class
]])
{
VideoListItemTableViewCell
*
videoCell
=
(
VideoListItemTableViewCell
*
)
cell
;
videoCell
.
playButton
.
selected
=
NO
;
}
}
if
([
studyList
.
attachment
.
fileUrl
rangeOfString
:
@".ppt"
].
location
!=
NSNotFound
)
{
PPTListItemTableViewCell
*
pptItemCell
=
[
tableView
cellForRowAtIndexPath
:
indexPath
];
pptItemCell
.
pptButton
.
selected
=
YES
;
}
else
if
([
studyList
.
attachment
.
fileUrl
rangeOfString
:
@".mp4"
].
location
!=
NSNotFound
){
VideoListItemTableViewCell
*
videoItemCell
=
[
tableView
cellForRowAtIndexPath
:
indexPath
];
videoItemCell
.
playButton
.
selected
=
YES
;
}
if
([
self
.
delegate
respondsToSelector
:
@selector
(
seleStudyItemCellIndex
:)])
{
[
self
.
delegate
seleStudyItemCellIndex
:
indexPath
];
}
}
@end
Class/OrderdetailsViewController.m
View file @
f9d20cbc
...
...
@@ -297,10 +297,10 @@ NSString *const PROMOTIONALSTRING = @"促销信息";
deductionModel
.
priority
=
oldPromotion
.
prority
;
[
weakSelf
.
promotionInformationArray
addObject
:
deductionModel
];
}
else
if
(
!
[
BaseViewController
isBlankString
:[
oldPromotion
.
jd
E
cardDenomation
stringValue
]])
{
}
else
if
(
!
[
BaseViewController
isBlankString
:[
oldPromotion
.
jd
e
cardDenomation
stringValue
]])
{
// 京东E卡
PromotionJDECardModel
*
jdECardModel
=
[[
PromotionJDECardModel
alloc
]
init
];
jdECardModel
.
total
=
[
oldPromotion
.
jd
E
cardDenomation
integerValue
];
jdECardModel
.
total
=
[
oldPromotion
.
jd
e
cardDenomation
integerValue
];
jdECardModel
.
body
=
GUIDE
;
jdECardModel
.
type
=
JDECardAction
;
jdECardModel
.
priority
=
oldPromotion
.
prority
;
...
...
Lighting.xcodeproj/project.pbxproj
View file @
f9d20cbc
This diff is collapsed.
Click to expand it.
Lighting/LearningCenter.storyboard
View file @
f9d20cbc
This diff is collapsed.
Click to expand it.
Tools/CustomWKWebViewController.m
View file @
f9d20cbc
...
...
@@ -14,16 +14,6 @@
@property
(
nonatomic
,
strong
)
WKWebViewConfiguration
*
config
;
@property
(
nonatomic
,
strong
)
UIButton
*
dismissButton
;
/**
PPT倒计时
*/
@property
(
nonatomic
,
strong
)
UILabel
*
countdownLabel
;
/**
PPT定时器
*/
@property
(
nonatomic
,
strong
)
NSTimer
*
timer
;
@end
@implementation
CustomWKWebViewController
...
...
@@ -53,33 +43,11 @@
if
(
!
_webView
)
{
_webView
=
[[
WKWebView
alloc
]
initWithFrame
:
self
.
view
.
bounds
configuration
:
self
.
config
];
_webView
.
navigationDelegate
=
self
;
[
self
.
view
addSubview
:
_webView
];
[
self
.
view
insertSubview
:
_webView
atIndex
:
0
];
}
return
_webView
;
}
-
(
UILabel
*
)
countdownLabel
{
if
(
!
_countdownLabel
)
{
_countdownLabel
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
ScreenWidth
-
150
,
50
,
100
,
30
)];
_countdownLabel
.
backgroundColor
=
kMainBlueColor
;
_countdownLabel
.
textAlignment
=
NSTextAlignmentCenter
;
_countdownLabel
.
layer
.
masksToBounds
=
YES
;
_countdownLabel
.
layer
.
cornerRadius
=
3
;
_countdownLabel
.
textColor
=
[
UIColor
whiteColor
];
[
self
.
view
addSubview
:
_countdownLabel
];
}
return
_countdownLabel
;
}
-
(
NSTimer
*
)
timer
{
if
(
!
_timer
)
{
_timer
=
[
NSTimer
scheduledTimerWithTimeInterval
:
1
target
:
self
selector
:
@selector
(
timerAction
)
userInfo
:
nil
repeats
:
YES
];
}
return
_timer
;
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
...
...
@@ -91,11 +59,7 @@
#pragma mark - 判断加载文件类型
-
(
void
)
determineTheURLFileType
{
if
([
self
.
urlString
rangeOfString
:
@".ppt"
].
location
!=
NSNotFound
)
{
// [self loadPPTfileAction];
}
else
{
[
self
loadURLfileAction
];
}
}
#pragma mark - 加载URL
...
...
@@ -106,42 +70,48 @@
[[
WKWebsiteDataStore
defaultDataStore
]
removeDataOfTypes
:
websiteDataTypes
modifiedSince
:
dateFrom
completionHandler
:^
{
NSLog
(
@"清理缓存成功"
);
}];
[
self
.
webView
loadRequest
:[
NSURLRequest
requestWithURL
:[
NSURL
URLWithString
:
self
.
urlString
]]];
}
#pragma mark - 加载PPT文件
-
(
void
)
loadPPTfileAction
{
[
self
.
webView
loadRequest
:[
NSURLRequest
requestWithURL
:[
NSURL
URLWithString
:
self
.
urlString
]]];
self
.
webView
.
scrollView
.
scrollEnabled
=
NO
;
self
.
webView
.
scrollView
.
pagingEnabled
=
YES
;
self
.
webView
.
scrollView
.
delegate
=
self
;
self
.
countdownLabel
.
text
=
@"10"
;
[[
NSRunLoop
currentRunLoop
]
addTimer
:
self
.
timer
forMode
:
NSDefaultRunLoopMode
];
}
-
(
void
)
scrollViewDidEndDecelerating
:
(
UIScrollView
*
)
scrollView
#pragma mark - 数据
-
(
void
)
setUrlString
:
(
NSString
*
)
urlString
{
NSLog
(
@" end %f"
,
scrollView
.
contentOffset
.
y
);
[[
NSRunLoop
currentRunLoop
]
addTimer
:
self
.
timer
forMode
:
NSDefaultRunLoopMode
];
self
.
countdownLabel
.
text
=
@"10"
;
self
.
webView
.
scrollView
.
scrollEnabled
=
NO
;
}
#pragma mark - 浏览PPT倒计时
-
(
void
)
timerAction
{
NSInteger
number
=
[
self
.
countdownLabel
.
text
integerValue
];
if
(
number
<=
0
)
{
self
.
webView
.
scrollView
.
scrollEnabled
=
YES
;
self
.
countdownLabel
.
text
=
@"请翻页"
;
[
self
.
timer
invalidate
];
self
.
timer
=
nil
;
}
else
{
number
--
;
self
.
countdownLabel
.
text
=
[
NSString
stringWithFormat
:
@"%ld"
,
number
];
}
}
_urlString
=
urlString
;
[
self
.
webView
loadRequest
:[
NSURLRequest
requestWithURL
:[
NSURL
URLWithString
:
_urlString
]]];
}
//#pragma mark - 加载PPT文件
//- (void)loadPPTfileAction
//{
// [self.webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:self.urlString]]];
// self.webView.scrollView.scrollEnabled = NO;
// self.webView.scrollView.pagingEnabled = YES;
// self.webView.scrollView.delegate = self;
// self.countdownLabel.text = @"10";
// [[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSDefaultRunLoopMode];
//}
//
//- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
//{
// NSLog(@" end %f",scrollView.contentOffset.y);
// [[NSRunLoop currentRunLoop] addTimer:self.timer forMode:NSDefaultRunLoopMode];
// self.countdownLabel.text = @"10";
// self.webView.scrollView.scrollEnabled = NO;
//}
//
//#pragma mark - 浏览PPT倒计时
//- (void)timerAction
//{
// NSInteger number = [self.countdownLabel.text integerValue];
// if (number <= 0) {
// self.webView.scrollView.scrollEnabled = YES;
// self.countdownLabel.text = @"请翻页";
// [self.timer invalidate];
// self.timer = nil;
// }else{
// number --;
// self.countdownLabel.text = [NSString stringWithFormat:@"%ld",number];
// }
//}
#pragma mark - 添加删除按钮
-
(
void
)
addDismissButton
...
...
Tools/PrefixHeader.pch
View file @
f9d20cbc
...
...
@@ -40,6 +40,7 @@
#import "WYPopoverController.h"
#import "CustomBorderLabel.h"
#import "PNCircleChart.h"
#import "CustomStudyEntity.h"
// Include any system framework and library headers here that should be included in all compilation units.
...
...
Tools/VideoCache/Cache/VICacheConfiguration.m
View file @
f9d20cbc
...
...
@@ -28,7 +28,7 @@ static NSString *kURLKey = @"kURLKey";
@implementation
VICacheConfiguration
+
(
instancetype
)
configurationWithFilePath
:(
NSString
*
)
filePath
{
filePath
=
[
self
configurationFilePathForFilePath
:
filePath
];
//
filePath = [self configurationFilePathForFilePath:filePath];
VICacheConfiguration
*
configuration
=
[
NSKeyedUnarchiver
unarchiveObjectWithFile
:
filePath
];
if
(
!
configuration
)
{
...
...
Tools/VideoCache/ResourceLoader/VIResourceLoaderManager.m
View file @
f9d20cbc
...
...
@@ -105,8 +105,8 @@ static NSString *kCacheScheme = @"VIMediaCache";
}
-
(
AVPlayerItem
*
)
playerItemWithURL
:(
NSURL
*
)
url
{
NSURL
*
assetURL
=
[
VIResourceLoaderManager
assetURLWithURL
:
url
];
AVURLAsset
*
urlAsset
=
[
AVURLAsset
URLAssetWithURL
:
assetURL
options
:
nil
];
//
NSURL *assetURL = [VIResourceLoaderManager assetURLWithURL:url];
AVURLAsset
*
urlAsset
=
[
AVURLAsset
URLAssetWithURL
:
url
options
:
nil
];
[
urlAsset
.
resourceLoader
setDelegate
:
self
queue
:
dispatch_get_main_queue
()];
AVPlayerItem
*
playerItem
=
[
AVPlayerItem
playerItemWithAsset
:
urlAsset
];
if
([
playerItem
respondsToSelector
:
@selector
(
setCanUseNetworkResourcesForLiveStreamingWhilePaused
:)])
{
...
...
Tools/opple_objc_json_client.h
View file @
f9d20cbc
This diff is collapsed.
Click to expand it.
Tools/opple_objc_json_client.m
View file @
f9d20cbc
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment