|
@@ -15,6 +15,7 @@
|
|
|
#import "KSMediaManager.h"
|
|
|
#import "WMPlayer.h"
|
|
|
#import "SongModel.h"
|
|
|
+#import "KSGuideMaskView.h"
|
|
|
|
|
|
@interface RecordExamViewController ()<UITableViewDelegate, UITableViewDataSource,WMPlayerDelegate>
|
|
|
{
|
|
@@ -43,6 +44,8 @@
|
|
|
|
|
|
@property (nonatomic, strong) NSMutableArray *fileUrlArray;
|
|
|
|
|
|
+@property (nonatomic, assign) BOOL hasShowTips;
|
|
|
+
|
|
|
@end
|
|
|
|
|
|
@implementation RecordExamViewController
|
|
@@ -105,7 +108,7 @@
|
|
|
[self.fileUrlArray addObject:remoteUrl];
|
|
|
}
|
|
|
}
|
|
|
-
|
|
|
+ [self checkSubmitButtonEnable];
|
|
|
[self.tableView reloadData];
|
|
|
}
|
|
|
|
|
@@ -132,6 +135,33 @@
|
|
|
}
|
|
|
|
|
|
|
|
|
+- (void)viewDidAppear:(BOOL)animated {
|
|
|
+ [super viewDidAppear:animated];
|
|
|
+
|
|
|
+ if (_hasShowTips == NO) {
|
|
|
+ [self addIntroduceView];
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+- (void)addIntroduceView {
|
|
|
+ _hasShowTips = YES;
|
|
|
+ CGRect rect1 = [self.tableView convertRect:self.tableView.tableHeaderView.frame toView:[UIApplication sharedApplication].keyWindow];
|
|
|
+ rect1.origin.y -= 50;
|
|
|
+ rect1.size.height += 50;
|
|
|
+ UIBezierPath *pathOne = [UIBezierPath bezierPathWithRect:rect1];
|
|
|
+
|
|
|
+ CGRect rect2 = rect1;
|
|
|
+ rect2.size = CGSizeMake(kScreenWidth, 130);
|
|
|
+ rect2.origin.y = CGRectGetMaxY(rect1);
|
|
|
+ UIBezierPath *pathSecond = [UIBezierPath bezierPathWithRect:rect2];
|
|
|
+ NSArray *tipsArray = @[@"请在录播时间内完成视频上传", @"点击上传曲目录播视频"];
|
|
|
+ NSArray *bezierArray = @[pathOne,pathSecond];
|
|
|
+
|
|
|
+ KSGuideMaskView *guideView = [[KSGuideMaskView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, kScreenHeight)];
|
|
|
+ [guideView addTips:tipsArray transparentRect:bezierArray shaperLayerIndex:-1];
|
|
|
+ [guideView showMaskViewInView:nil];
|
|
|
+}
|
|
|
+
|
|
|
#pragma mark ----- table data source
|
|
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
|
|
return self.songArray.count;
|
|
@@ -174,6 +204,7 @@
|
|
|
UserDefaultRemoveObjectForKey(fileKey);
|
|
|
NSString *remoteUrl = [parm stringValueForKey:@"remoteUrl"];
|
|
|
[self.fileUrlArray removeObject:remoteUrl];
|
|
|
+ [self checkSubmitButtonEnable];
|
|
|
[self.tableView reloadData];
|
|
|
}
|
|
|
|
|
@@ -193,6 +224,18 @@
|
|
|
}
|
|
|
|
|
|
|
|
|
+- (void)checkSubmitButtonEnable {
|
|
|
+ if (self.fileUrlArray.count == 0) {
|
|
|
+ self.bottomView.finishButton.userInteractionEnabled = NO;
|
|
|
+ [self.bottomView.finishButton setBackgroundImage:[UIImage imageNamed:@"button_unable"] forState:UIControlStateNormal];
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ self.bottomView.finishButton.userInteractionEnabled = YES;
|
|
|
+ [self.bottomView.finishButton setBackgroundImage:[UIImage imageNamed:@"button_nomal"] forState:UIControlStateNormal];
|
|
|
+ [self.bottomView.finishButton setBackgroundImage:[UIImage imageNamed:@"button_highlight"] forState:UIControlStateHighlighted];
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
|
|
|
#pragma mark --- lazying
|
|
|
- (RecordBodyView *)topView {
|
|
@@ -258,11 +301,6 @@
|
|
|
|
|
|
- (void)submitAction {
|
|
|
// 提交 完成考试
|
|
|
-
|
|
|
- if (self.fileUrlArray.count == 0) {
|
|
|
- [self MBPShow:@"请提交录播视频"];
|
|
|
- return;
|
|
|
- }
|
|
|
[self showhud];
|
|
|
NSString *videoUrl = [self.fileUrlArray componentsJoinedByString:@","];
|
|
|
[KSRequestManager stuEndRecordFinishRequest:KS_POST examRegistrationId:self.examRegistrationId videoUrl:videoUrl success:^(NSDictionary * _Nonnull dic) {
|
|
@@ -320,6 +358,7 @@
|
|
|
[self.tableView reloadData];
|
|
|
|
|
|
[self.fileUrlArray addObject:fileUrl];
|
|
|
+ [self checkSubmitButtonEnable];
|
|
|
}
|
|
|
else {
|
|
|
[self MBPShow:MESSAGEKEY];
|