Commit b5bec041 authored by Sandy's avatar Sandy

1.学习完成增加是否学习完成接口。2.列表页增加答题按钮

parent 6bbcfab2
......@@ -21,6 +21,7 @@
三次重考机会
*/
@property (nonatomic,assign) NSInteger retakeCount;
@property (strong, nonatomic) TOStudyResultEntity *studyResult;
@end
......@@ -52,6 +53,7 @@
self.retakeCount = 3;
[self getExaminationQuestions];
[self httpGetAnswerId];
}
#pragma mark - 获取考题
......@@ -156,9 +158,9 @@
#pragma mark - 提交考核结果
- (void)submitAnswer
{
TOStudyResultEntity *studyResult = [[TOStudyResultEntity alloc]init];
studyResult.taskId = self.taskId;
studyResult.employeeId = [Shoppersmanager manager].shoppers.employee.fid;
TOStudyResultEntity *studyResult = self.studyResult;
// studyResult.taskId = self.taskId;
// studyResult.employeeId = [Shoppersmanager manager].shoppers.employee.fid;
studyResult.submitTime = [[NSDate date] httpParameterString];
NSArray *answerArray = self.taskDetails.topics;
NSMutableArray *submitAnswerArray = [NSMutableArray array];
......@@ -244,6 +246,17 @@
}];
}
- (void)httpGetAnswerId {
WS(weakSelf);
NSString *url = [NSString stringWithFormat:@"/study/startExam/%@/%@", self.taskId, [Shoppersmanager manager].shoppers.employee.fid];
[HTTP networkRequestWithURL:SERVERREQUESTURL(url) withRequestType:(GET) withParameter:nil withReturnValueBlock:^(id returnValue) {
NSLog(@"%@", returnValue);
weakSelf.studyResult = [[TOStudyResultEntity alloc] initWithDictionary:RESPONSE(returnValue) error:nil];
} withFailureBlock:^(NSError *error) {
}];
}
#pragma mark - 判断得分是否及格
- (void)determineIsQualified:(NSInteger)allScore
......
......@@ -13,10 +13,10 @@
#import "LearningCompleteViewController.h"
#import "AssessmentViewController.h"
@interface OnlineLearningDetailViewController ()<SelectStudyItemDelegate,VideoPlayerDelegate,BeginAssessmentDelegate,InspectionStateDelegate>
@property (nonatomic,strong) WYPopoverController *settingsPopoverController;
@property (nonatomic, assign) BOOL isNotFirstIn;
@end
......@@ -31,9 +31,11 @@
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
}
//播放进入选中的视频
[self seleStudyItemCellIndex:self.interIndex];
if (!self.isNotFirstIn) {
//播放进入选中的视频
self.isNotFirstIn = YES;
[self seleStudyItemCellIndex:self.interIndex];
}
}
#pragma mark -视图即将消失
......@@ -195,6 +197,7 @@
pptVc.type = Study;
pptVc.indexPath = indexPath;
videoVc.learningItem = nil;
pptVc.studyId = studyList.fid;
[pptVc setScrollViewEndBottomBlock:^(NSIndexPath *indexPath){
[weakSelf dismissViewControllerAnimated:YES completion:^{
[weakSelf videoPlayFinish:studyList withIndexPath:indexPath];
......@@ -226,10 +229,21 @@
}];
}
#pragma mark - 学习完成,告诉服务器学习完成
- (void)httpStudyCompleteTaskId:(NSString *)taskId {
NSString *url = [NSString stringWithFormat:@"/study/finishStudy/%@/%@", taskId, [Shoppersmanager manager].shoppers.employee.fid];
[HTTP networkRequestWithURL:SERVERREQUESTURL(url) withRequestType:(GET) withParameter:nil withReturnValueBlock:^(id returnValue) {
NSLog(@"%@", returnValue);
} withFailureBlock:^(NSError *error) {
}];
}
#pragma mark - 视频播放完成
- (void)videoPlayFinish:(CustomStudyEntity *)studyEntity withIndexPath:(NSIndexPath *)indexPath
{
[self httpStudyCompleteTaskId:studyEntity.fid];
WS(weakSelf);
[self studyFinishGetIntegral:^(NSString *integral) {
LearningCompleteViewController *assessmentVc = [[[weakSelf class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"LearningCompleteViewController"];
......@@ -299,6 +313,7 @@
videoWindow.playerLayer.frame = CGRectMake(0, 0, ScreenWidth*2/3, ScreenHeight/2);
}completion:^(BOOL finished) {
[weakSelf assessment:studyEntity.fid withIndexPath:indexPath];
}];
}else {
[weakSelf assessment:studyEntity.fid withIndexPath:indexPath];
......
......@@ -169,7 +169,7 @@
}else if (self.type == VideoViewTypeList){
OnlineLearningDetailViewController *studyDetail = [[[self class] getLearningCenterStoryboardClass]instantiateViewControllerWithIdentifier:@"OnlineLearningDetailViewController"];
studyDetail.studyResult = self.studyTypeEntity;
studyDetail.interIndex = indexPath;
studyDetail.interIndex = indexPath;
[self.navigationController pushViewController:studyDetail animated:YES];
}
......
......@@ -36,4 +36,9 @@
*/
@property (nonatomic,strong) CustomStudyEntity *model;
/**
开始答题按钮
*/
@property (weak, nonatomic) IBOutlet UIButton *btnStartAnswer;
@end
......@@ -7,7 +7,7 @@
//
#import "PPTListItemTableViewCell.h"
#import "AssessmentViewController.h"
@implementation PPTListItemTableViewCell
- (void)awakeFromNib {
......@@ -20,11 +20,26 @@
{
_model = model;
self.studyItemTitleLabel.text = _model.title;
//考核状态
if ([BaseViewController isBlankString:_model.examResult] || [_model.examResult isEqualToString:@"0"]) {
self.examResultImageView.hidden = YES;
if (model.studyComplete == nil || !model.hasStudyTopic) {
self.btnStartAnswer.hidden = YES;
}else{
self.btnStartAnswer.hidden = NO;
}
}else {
self.examResultImageView.hidden = NO;
self.btnStartAnswer.hidden = YES;
}
}
- (IBAction)actionStartAnswer:(id)sender {
AssessmentViewController *assessmentVc = [[AssessmentViewController getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"AssessmentViewController"];
assessmentVc.taskId = _model.fid;
// assessmentVc.indexPath = indexPath;
// assessmentVc.delegate = weakSelf;
[self.viewController.navigationController pushViewController:assessmentVc animated:YES];
}
@end
......@@ -47,5 +47,9 @@
*/
@property (weak, nonatomic) IBOutlet UIImageView *examResultImageView;
/**
开始答题按钮
*/
@property (weak, nonatomic) IBOutlet UIButton *btnStartAnswer;
@end
......@@ -7,7 +7,7 @@
//
#import "VideoListItemTableViewCell.h"
#import "AssessmentViewController.h"
@implementation VideoListItemTableViewCell
- (void)awakeFromNib {
......@@ -32,9 +32,23 @@
//考核状态
if ([BaseViewController isBlankString:_model.examResult] || [_model.examResult isEqualToString:@"0"]) {
self.examResultImageView.hidden = YES;
if (model.studyComplete == nil || !model.hasStudyTopic) {
self.btnStartAnswer.hidden = YES;
}else{
self.btnStartAnswer.hidden = NO;
}
}else {
self.examResultImageView.hidden = NO;
self.btnStartAnswer.hidden = YES;
}
}
- (IBAction)actionStartAnswer:(id)sender {
AssessmentViewController *assessmentVc = [[AssessmentViewController getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"AssessmentViewController"];
assessmentVc.taskId = _model.fid;
// assessmentVc.indexPath = indexPath;
// assessmentVc.delegate = weakSelf;
[self.viewController.navigationController pushViewController:assessmentVc animated:YES];
}
@end
......@@ -359,7 +359,7 @@
<rect key="frame" x="0.0" y="28" width="1024" height="90"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="ctQ-16-eCQ" id="DuY-Eq-G4z">
<rect key="frame" x="0.0" y="0.0" width="830" height="89.5"/>
<rect key="frame" x="0.0" y="0.0" width="830" height="89"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="00登录-谭" translatesAutoresizingMaskIntoConstraints="NO" id="jVJ-Bu-xw9">
......@@ -1065,7 +1065,7 @@
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="AssessmentHeaderView" id="UfB-K3-NdF" customClass="AssessmentHeaderView">
<rect key="frame" x="0.0" y="55.5" width="460" height="44"/>
<rect key="frame" x="0.0" y="56" width="460" height="44"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="UfB-K3-NdF" id="WGo-Wa-YTq">
<rect key="frame" x="0.0" y="0.0" width="460" height="44"/>
......@@ -1091,7 +1091,7 @@
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="AssessmentTableViewCell" rowHeight="52" id="gIe-bF-XsX" customClass="AssessmentTableViewCell">
<rect key="frame" x="0.0" y="99.5" width="460" height="52"/>
<rect key="frame" x="0.0" y="100" width="460" height="52"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="gIe-bF-XsX" id="Va8-wn-DBM">
<rect key="frame" x="0.0" y="0.0" width="460" height="52"/>
......@@ -1137,7 +1137,7 @@
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="AssessmentShortAnswerTableViewCell" rowHeight="112" id="smV-qr-KgP" customClass="AssessmentShortAnswerTableViewCell">
<rect key="frame" x="0.0" y="151.5" width="460" height="112"/>
<rect key="frame" x="0.0" y="152" width="460" height="112"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="smV-qr-KgP" id="A2f-ek-60T">
<rect key="frame" x="0.0" y="0.0" width="460" height="112"/>
......@@ -1373,7 +1373,7 @@
</collectionViewFlowLayout>
<cells>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="CalibrationDetailCollectionCell" id="dGo-4o-u9g" customClass="CalibrationDetailCollectionCell">
<rect key="frame" x="0.0" y="9.5" width="93" height="41"/>
<rect key="frame" x="0.0" y="10" width="93" height="41"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="93" height="41"/>
......@@ -1453,7 +1453,7 @@
</collectionViewFlowLayout>
<cells>
<collectionViewCell opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" reuseIdentifier="CalibrationCollectionViewCell" id="v20-Kz-8OX" customClass="CalibrationCollectionViewCell">
<rect key="frame" x="0.0" y="4.5" width="50" height="50"/>
<rect key="frame" x="0.0" y="5" width="50" height="50"/>
<autoresizingMask key="autoresizingMask" flexibleMaxX="YES" flexibleMaxY="YES"/>
<view key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center">
<rect key="frame" x="0.0" y="0.0" width="50" height="50"/>
......@@ -2157,7 +2157,7 @@
<rect key="frame" x="0.0" y="28" width="1024" height="100"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Qnm-0r-wEL" id="VAA-bT-OlF">
<rect key="frame" x="0.0" y="0.0" width="1024" height="99.5"/>
<rect key="frame" x="0.0" y="0.0" width="1024" height="99"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="课时简介" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="agZ-rF-DnB">
......@@ -2189,7 +2189,7 @@
<rect key="frame" x="0.0" y="128" width="1024" height="130"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="WzB-nZ-wsW" id="Zzv-Yi-ZxT">
<rect key="frame" x="0.0" y="0.0" width="1024" height="129.5"/>
<rect key="frame" x="0.0" y="0.0" width="1024" height="129"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="授课讲师" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="kxK-dX-OAf">
......@@ -2246,7 +2246,7 @@
<rect key="frame" x="0.0" y="258" width="1024" height="100"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="oia-jO-L9n" id="AMF-ag-ZWN">
<rect key="frame" x="0.0" y="0.0" width="1024" height="99.5"/>
<rect key="frame" x="0.0" y="0.0" width="1024" height="99"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="针对人员" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="NfI-IM-h1i">
......@@ -2517,6 +2517,17 @@
<constraint firstAttribute="height" constant="1" id="wjU-cG-Cbi"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="kEq-ur-qoX">
<rect key="frame" x="330" y="10" width="70" height="30"/>
<constraints>
<constraint firstAttribute="width" constant="70" id="AyV-pl-VGJ"/>
<constraint firstAttribute="height" constant="30" id="oBJ-gK-mHg"/>
</constraints>
<state key="normal" title="开始答题"/>
<connections>
<action selector="actionStartAnswer:" destination="YXo-b3-NKo" eventType="touchUpInside" id="Bgd-Lu-ItT"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="Ast-eO-9V0" firstAttribute="centerY" secondItem="FNL-Q4-kdY" secondAttribute="centerY" id="4D8-Yl-tb5"/>
......@@ -2526,6 +2537,7 @@
<constraint firstItem="BVg-HN-E2s" firstAttribute="leading" secondItem="cny-PA-JpH" secondAttribute="trailing" constant="10" id="FeY-kV-5zF"/>
<constraint firstAttribute="trailing" secondItem="fYk-7O-XdO" secondAttribute="trailing" id="Hs3-xl-h3f"/>
<constraint firstItem="FNL-Q4-kdY" firstAttribute="leading" secondItem="Zsh-Nm-SGv" secondAttribute="leading" constant="12" id="IKT-GZ-UfU"/>
<constraint firstItem="BVg-HN-E2s" firstAttribute="leading" secondItem="kEq-ur-qoX" secondAttribute="trailing" constant="9" id="Izj-z7-6cb"/>
<constraint firstItem="0QA-OC-BkN" firstAttribute="centerY" secondItem="FNL-Q4-kdY" secondAttribute="centerY" id="KVJ-bY-0gc"/>
<constraint firstItem="cny-PA-JpH" firstAttribute="centerY" secondItem="BVg-HN-E2s" secondAttribute="centerY" id="Odt-ir-59j"/>
<constraint firstItem="0QA-OC-BkN" firstAttribute="leading" secondItem="FNL-Q4-kdY" secondAttribute="trailing" constant="20" id="Qc4-J9-Joq"/>
......@@ -2533,9 +2545,11 @@
<constraint firstAttribute="trailing" secondItem="Ast-eO-9V0" secondAttribute="trailing" constant="15" id="Xih-52-5hy"/>
<constraint firstItem="Ast-eO-9V0" firstAttribute="leading" secondItem="BVg-HN-E2s" secondAttribute="trailing" constant="10" id="i3G-EM-h4h"/>
<constraint firstItem="BVg-HN-E2s" firstAttribute="leading" secondItem="0QA-OC-BkN" secondAttribute="trailing" constant="20" id="igE-qL-tRe"/>
<constraint firstItem="kEq-ur-qoX" firstAttribute="centerY" secondItem="0QA-OC-BkN" secondAttribute="centerY" id="mXX-oH-lQ1"/>
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="btnStartAnswer" destination="kEq-ur-qoX" id="Mfo-QQ-ha3"/>
<outlet property="examResultImageView" destination="cny-PA-JpH" id="R7t-ol-rAq"/>
<outlet property="playButton" destination="FNL-Q4-kdY" id="Abd-Au-JQk"/>
<outlet property="seekbarView" destination="BVg-HN-E2s" id="Ngx-Ju-zff"/>
......@@ -2585,8 +2599,21 @@
<constraint firstAttribute="height" constant="1" id="sBH-lC-hCS"/>
</constraints>
</view>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" buttonType="roundedRect" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="cSM-mJ-Ih8">
<rect key="frame" x="337" y="10" width="70" height="30"/>
<constraints>
<constraint firstAttribute="height" constant="30" id="AhY-XM-AIa"/>
<constraint firstAttribute="width" constant="70" id="dZU-Xt-mQu"/>
</constraints>
<state key="normal" title="开始答题"/>
<connections>
<action selector="actionStartAnswer:" destination="OSF-93-RuO" eventType="touchUpInside" id="GlH-hr-1xT"/>
</connections>
</button>
</subviews>
<constraints>
<constraint firstItem="cSM-mJ-Ih8" firstAttribute="centerY" secondItem="IQr-pV-6ZO" secondAttribute="centerY" id="1Dw-hQ-AZN"/>
<constraint firstItem="t1Q-41-RAj" firstAttribute="leading" secondItem="cSM-mJ-Ih8" secondAttribute="trailing" constant="50" id="9bb-a8-pJP"/>
<constraint firstItem="Gwb-yp-kzF" firstAttribute="centerY" secondItem="t1Q-41-RAj" secondAttribute="centerY" id="Lvf-ms-adf"/>
<constraint firstItem="t1Q-41-RAj" firstAttribute="leading" secondItem="6O1-Dg-ELo" secondAttribute="trailing" constant="20" id="P2g-cX-AOe"/>
<constraint firstAttribute="bottom" secondItem="SCg-SR-kAg" secondAttribute="bottom" id="PQy-Zh-wy0"/>
......@@ -2602,6 +2629,7 @@
</constraints>
</tableViewCellContentView>
<connections>
<outlet property="btnStartAnswer" destination="cSM-mJ-Ih8" id="phi-7Q-oZT"/>
<outlet property="examResultImageView" destination="Gwb-yp-kzF" id="Ftr-TR-W7i"/>
<outlet property="pptButton" destination="j7R-oP-wMP" id="m7u-ia-zmb"/>
<outlet property="studyItemLabel" destination="t1Q-41-RAj" id="jCw-CL-C3l"/>
......@@ -2667,7 +2695,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="9lH-c2-zzY" userLabel="First Responder" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="3137" y="-1598"/>
<point key="canvasLocation" x="3177" y="-1611"/>
</scene>
<!--Assessment View Controller-->
<scene sceneID="2bA-hi-BSu">
......@@ -2719,7 +2747,7 @@
<color key="backgroundColor" white="1" alpha="1" colorSpace="calibratedWhite"/>
<prototypes>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="default" indentationWidth="10" reuseIdentifier="AssessmentHeaderView" rowHeight="60" id="2M5-To-MLj" customClass="AssessmentHeaderView">
<rect key="frame" x="0.0" y="55.5" width="1024" height="60"/>
<rect key="frame" x="0.0" y="56" width="1024" height="60"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="2M5-To-MLj" id="ypf-GL-4CP">
<rect key="frame" x="0.0" y="0.0" width="1024" height="60"/>
......@@ -2745,7 +2773,7 @@
</connections>
</tableViewCell>
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" selectionStyle="none" indentationWidth="10" reuseIdentifier="AssessmentTableViewCell" rowHeight="50" id="BjI-a1-CRm" customClass="AssessmentTableViewCell">
<rect key="frame" x="0.0" y="115.5" width="1024" height="50"/>
<rect key="frame" x="0.0" y="116" width="1024" height="50"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="BjI-a1-CRm" id="bq8-ly-DcD">
<rect key="frame" x="0.0" y="0.0" width="1024" height="50"/>
......
......@@ -96,7 +96,7 @@ typedef NS_ENUM(NSInteger,COMMENT_PRAISE) {
/**
* 服务器开发地址
*/
//#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://gomoredev:8082/opple-web/app%@",URL]
#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://gomoredev:8082/opple-web/app%@",URL]
//外网http://debenson.picp.io/opple-web/
......@@ -108,7 +108,7 @@ typedef NS_ENUM(NSInteger,COMMENT_PRAISE) {
//**
// * 服务器正式地址
// */
#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg.opple.com/opple-web/app%@",URL]
//#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg.opple.com/opple-web/app%@",URL]
/*****************************************接口地址*****************************************/
......
......@@ -24,5 +24,10 @@
@param number 圆角系数
*/
- (void)setMyCorner:(CGFloat)number;
/**
* 获取view父视图的控制器
*
* @return 控制器
*/
- (UIViewController *)viewController;
@end
......@@ -73,5 +73,15 @@
self.layer.rasterizationScale = [UIScreen mainScreen].scale;
}
- (UIViewController *)viewController
{
for (UIView *next = [self superview]; next; next = next.superview) {
UIResponder *nextResponder = [next nextResponder];
if ([nextResponder isKindOfClass:[UIViewController class]]) {
return (UIViewController *)nextResponder;
}
}
return nil;
}
@end
......@@ -4098,6 +4098,12 @@ extern NSString * const GRADEMETHOD_MANUL;
*
*/
@property (nonatomic, copy) NSString *examResult;
/**
* 是否学习完成
*
*
*/
@property (nonatomic, copy) NSString *studyComplete;
/**
* 学习内容
*
......@@ -4170,6 +4176,12 @@ extern NSString * const GRADEMETHOD_MANUL;
*
*/
@property (nonatomic, copy) NSString *studyCategory;
/**
* 分类id
*
*
*/
@property (nonatomic, assign) BOOL hasStudyTopic;
/**
* 分类标题
*
......
......@@ -1443,6 +1443,7 @@ NSString * const SORTDIRECTION_DESC = @"desc";
@synthesize title;
@synthesize typeName;
@synthesize examResult;
@synthesize studyComplete;
@synthesize content;
@synthesize teacher;
@synthesize teacherIntro;
......@@ -1455,6 +1456,7 @@ NSString * const SORTDIRECTION_DESC = @"desc";
@synthesize topics;
@synthesize stateName;
@synthesize studyCategory;
@synthesize hasStudyTopic;
@synthesize categoryName;
+(BOOL)propertyIsOptional:(NSString*)propertyName
......
......@@ -54,6 +54,7 @@ typedef NS_ENUM(NSInteger,CALL_TYPE) {
学习项下标
*/
@property (nonatomic,strong) NSIndexPath *indexPath;
@property (strong, nonatomic) NSString *studyId;
@end
......@@ -189,11 +189,13 @@
#pragma mark - <UIScrollViewDelegate>
- (void)scrollViewDidEndDecelerating:(UIScrollView *)scrollView
{
CGFloat height = scrollView.frame.size.height;
CGFloat contentYoffset = scrollView.contentOffset.y;
CGFloat distanceFromBottom = scrollView.contentSize.height - contentYoffset;
WS(weakSelf);
if (distanceFromBottom <= height && self.type == Study) {
[self httpStudyCompleteTaskId:self.studyId];
ShowDefaultAlertView(self, nil, @"学习完成,是否开始考核?", UIAlertControllerStyleAlert, ^{
if (weakSelf.scrollViewEndBottomBlock) {
weakSelf.scrollViewEndBottomBlock(weakSelf.indexPath);
......@@ -202,7 +204,15 @@
}
}
#pragma mark - 学习完成,告诉服务器学习完成
- (void)httpStudyCompleteTaskId:(NSString *)taskId {
NSString *url = [NSString stringWithFormat:@"/study/finishStudy/%@/%@", taskId, [Shoppersmanager manager].shoppers.employee.fid];
[HTTP networkRequestWithURL:SERVERREQUESTURL(url) withRequestType:(GET) withParameter:nil withReturnValueBlock:^(id returnValue) {
NSLog(@"%@", returnValue);
} withFailureBlock:^(NSError *error) {
}];
}
......
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