Commit 6bbcfab2 authored by Sandy's avatar Sandy

优化,* 学习中的左划事件。(张杰、曹,4.11)

* 我要提问--》我要发帖(张杰、曹,4.11)
* 置顶的贴要有点赞和评论数(张杰、曹 )
* 图片有2层的问题(张杰、曹 )
parent 6d585141
......@@ -32,6 +32,15 @@
*/
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
/**
赞数量
*/
@property (weak, nonatomic) IBOutlet UILabel *praiseNumberLabel;
/**
评论数量
*/
@property (weak, nonatomic) IBOutlet UILabel *commentsNumberLabel;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *topLayoutConstraint;
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *essenceLayoutConstraint;
......
......@@ -25,6 +25,8 @@
self.managerLayoutConstraint.constant = topicModel.backEnd?5:0;
self.contentLabel.text = topicModel.title;
self.contentLabel.textColor = topicModel.isRead?[UIColor grayColor]:[UIColor blackColor];
self.commentsNumberLabel.text = [NSString stringWithFormat:@"%ld",topicModel.replyCount];
self.praiseNumberLabel.text = [NSString stringWithFormat:@"%ld",topicModel.likeCount];
}
@end
......@@ -75,7 +75,7 @@
TOForumCategoryEntity *category = self.result.list[indexPath.row];
category.typeId = self.result.forumType.fid;
itemListVc.category = category;
itemListVc.isPosting = 2;
itemListVc.isPosting = [category.name isEqualToString:@"欧普问问"]?0:1;
[self.navigationController pushViewController:itemListVc animated:YES];
}
......
......@@ -188,7 +188,7 @@
#pragma mark - 设置评论个数
- (void)setUpCommentNumber
{
self.commentNumberLabel.text = [NSString stringWithFormat:@"已有%ld条评论",(unsigned long)self.commentsArray.count];
self.commentNumberLabel.text = [NSString stringWithFormat:@"已有%ld条评论",(unsigned long)self.commentsArray.count - 2];
self.praiseButton.selected = !self.topicDetail.canLike;
WkWebViewViewController *webView = [self.childViewControllers firstObject];
webView.htmlString = self.topicDetail.content;
......
......@@ -150,7 +150,9 @@ static NSString *TAGCELL_IDENTIFIER = @"CommentTagTableViewCell";
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
CustomTOForumTopicEntity *entity = self.datasArray[indexPath.row];
if (entity.backEnd || entity.bestTopic || ![[self class] isBlankString:entity.top]) {
if (entity.backEnd ||
entity.bestTopic ||
![[self class] isBlankString:entity.top]) {
CommentTagTableViewCell *tagCell = [tableView dequeueReusableCellWithIdentifier:TAGCELL_IDENTIFIER forIndexPath:indexPath];
[self configTagCellAction:tagCell withIndexPath:indexPath];
return tagCell;
......
......@@ -91,7 +91,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
ForumItemListViewController *itemListVc = [[[self class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"ForumItemListViewController"];
ForumItemListViewController *itemListVc = [[[self class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"ForumItemListViewController"];
TOForumCategoryEntity *category = self.category.categories[indexPath.row];
category.typeId = self.typeId;
itemListVc.category = category;
......
......@@ -7,6 +7,7 @@
//
#import "BaseViewController.h"
#import "VideoListViewController.h"
@interface OnlineLearningDetailViewController : BaseViewController
......@@ -17,6 +18,10 @@
*/
@property (nonatomic,copy) TOStudyTypeEntity *studyTypeEntity;
/**
学习数据
*/
@property (nonatomic,strong) StudyTaskResponse *studyResult;
@property (strong, nonatomic) NSIndexPath *interIndex;
@end
......@@ -8,7 +8,6 @@
#import "OnlineLearningDetailViewController.h"
#import "VideoHelperViewController.h"
#import "VideoListViewController.h"
#import "VideoDetailViewController.h"
#import "CustomWKWebViewController.h"
#import "LearningCompleteViewController.h"
......@@ -17,10 +16,6 @@
@interface OnlineLearningDetailViewController ()<SelectStudyItemDelegate,VideoPlayerDelegate,BeginAssessmentDelegate,InspectionStateDelegate>
/**
学习数据
*/
@property (nonatomic,strong) StudyTaskResponse *studyResult;
@property (nonatomic,strong) WYPopoverController *settingsPopoverController;
@end
......@@ -32,10 +27,13 @@
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
self.navigationController.fd_fullscreenPopGestureRecognizer.enabled = NO;
// self.navigationController.fd_fullscreenPopGestureRecognizer.enabled = NO;
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
}
//播放进入选中的视频
[self seleStudyItemCellIndex:self.interIndex];
}
#pragma mark -视图即将消失
......@@ -61,7 +59,8 @@
[self addChildViewController];
[self listeningHomeButton];
[self getStudyItemDetailAction];
[self transferData:self.studyResult];
}
#pragma mark - 添加子控制器
......@@ -79,10 +78,12 @@
//播放列表
VideoListViewController *playList = [[[self class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"VideoListViewController"];
playList.studyItemTitle = self.studyTypeEntity.name;
playList.type = VideoViewTypeDetail;
playList.delegate = self;
videoWindow.progressDelegate = playList;
[self addChildViewController:playList];
[self.view addSubview:playList.view];
__weak typeof(videoWindow) weakVideWindow = videoWindow;
//全屏
WS(weakSelf);
......@@ -102,7 +103,7 @@
}
}];
videoWindow.view.frame = CGRectMake(0,NavigationHeight, ScreenWidth*2/3, ScreenHeight/2);
playList.view.frame = CGRectMake(0, 64,ScreenWidth, ScreenHeight-64);
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);
}
......@@ -177,6 +178,7 @@
CustomStudyEntity *studyList = studyEntity.studyTasks[indexPath.row];
videoVc.indexPath = indexPath;
[studyListVC selectedIndexPath:indexPath withIsQualified:[studyList.examResult boolValue]];
// [self.superListVC selectedIndexPath:indexPath withIsQualified:[studyList.examResult boolValue]];
if ([studyList.attachment.fileUrl rangeOfString:@".mp4"].location != NSNotFound) {
//判断是否是第一次播放
if (videoVc.learningItem) {
......@@ -322,6 +324,7 @@
{
VideoListViewController *studyListVC = self.childViewControllers[2];
[studyListVC selectedIndexPath:indexPath withIsQualified:NO];
// [self.superListVC selectedIndexPath:indexPath withIsQualified:NO];
[self seleStudyItemCellIndex:indexPath];
}
......@@ -330,6 +333,7 @@
{
VideoListViewController *studyListVC = self.childViewControllers[2];
[studyListVC selectedIndexPath:indexPath withIsQualified:YES];
// [self.superListVC selectedIndexPath:indexPath withIsQualified:YES];
}
#pragma mark - <VideoPlayerDelegate>
......@@ -348,6 +352,7 @@
}
VideoListViewController *studyListVC = self.childViewControllers[2];
studyListVC.datasArray = [NSMutableArray arrayWithArray:result.studyEntity];
// self.superListVC.datasArray = studyListVC.datasArray;
VideoDetailViewController *studyDetailsVC = self.childViewControllers[1];
studyDetailsVC.datasArray = result.studyEntity;
studyDetailsVC.indexPath = [NSIndexPath indexPathForRow:0 inSection:0];
......
......@@ -8,7 +8,9 @@
#import "OnlineLearningViewController.h"
#import "OnlineLearningTableViewCell.h"
#import "VideoListViewController.h"
#import "OnlineLearningDetailViewController.h"
@interface OnlineLearningViewController ()<UICollectionViewDelegate,UICollectionViewDataSource>
......@@ -74,9 +76,44 @@
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
OnlineLearningDetailViewController *studyDetail = [[[self class] getLearningCenterStoryboardClass]instantiateViewControllerWithIdentifier:@"OnlineLearningDetailViewController"];
studyDetail.studyTypeEntity = self.studyTypeArray[indexPath.row];
[self.navigationController pushViewController:studyDetail animated:YES];
TOStudyTaskEntity *studyType = self.studyTypeArray[indexPath.row];;
VideoListViewController *listView = [[[self class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"VideoListViewController"];
listView.studyType = studyType;
[self.navigationController pushViewController:listView animated:YES];
// WS(weakSelf);
// StudyTaskCondition *studyListModel = [[StudyTaskCondition alloc]init];
// studyListModel.employeeIdEquals = [Shoppersmanager manager].shoppers.employee.fid;
// studyListModel.typeEquals = studyType.fid;
// DataPage *page = [[DataPage alloc] init];
// page.page = ONE;
// page.rows = 9999;
// studyListModel.page = page;
// [XBLoadingView showHUDViewWithDefault];
// [HTTP networkRequestWithURL:SERVERREQUESTURL(STUDYLIST) withRequestType:ZERO withParameter:studyListModel withReturnValueBlock:^(id returnValue) {
//
// [XBLoadingView hideHUDViewWithDefault];
// if (RESULT(returnValue)) {
// StudyTaskResponse *responeseEty = [[StudyTaskResponse alloc]initWithDictionary:RESPONSE(returnValue) error:nil];
// if (responeseEty.studyEntity.count == 0) {
// [XBLoadingView showHUDViewWithText:@"学习内容为空!"];
// return;
// }
//
// VideoListViewController *listView = [[[weakSelf class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"VideoListViewController"];
// [listView view];
//
// listView.datasArray = [NSMutableArray arrayWithArray:responeseEty.studyEntity];
// listView.studyTypeEntity = responeseEty;
// [weakSelf.navigationController pushViewController:listView animated:YES];
// }else {
// [XBLoadingView showHUDViewWithText:MESSAGE(returnValue)];
// }
//
// }withFailureBlock:^(NSError *error) {
// [XBLoadingView showHUDViewWithText:error.localizedDescription];
// }];
}
......
......@@ -9,7 +9,10 @@
#import "BaseViewController.h"
#import "VideoHelperViewController.h"
typedef NS_ENUM(NSInteger, VideoViewType) {
VideoViewTypeList,
VideoViewTypeDetail
};
/**
选中学习项
......@@ -50,6 +53,18 @@
*/
@property (nonatomic,strong) NSMutableArray *datasArray;
/**
学习项
*/
@property (nonatomic,copy) StudyTaskResponse *studyTypeEntity;
/**
页面是纯列表还是在详情旁边
*/
@property (nonatomic, assign) VideoViewType type;
@property (strong, nonatomic) TOStudyTaskEntity *studyType;
/**
刷新选中项
......
......@@ -10,7 +10,7 @@
#import "VideoListItemTableViewCell.h"
#import "VideoListSectionHeaderView.h"
#import "PPTListItemTableViewCell.h"
#import "OnlineLearningDetailViewController.h"
@interface VideoListViewController ()<UITableViewDelegate,UITableViewDataSource>
......@@ -24,6 +24,14 @@
[super viewDidLoad];
[self setUpTableView];
}
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
if (self.type == VideoViewTypeList) {
[self httpRequest];
}
}
#pragma mark - 刷新选中项
......@@ -46,6 +54,36 @@
}
}
- (void)httpRequest {
WS(weakSelf);
StudyTaskCondition *studyListModel = [[StudyTaskCondition alloc]init];
studyListModel.employeeIdEquals = [Shoppersmanager manager].shoppers.employee.fid;
studyListModel.typeEquals = self.studyType.fid;
DataPage *page = [[DataPage alloc] init];
page.page = ONE;
page.rows = 9999;
studyListModel.page = page;
[XBLoadingView showHUDViewWithDefault];
[HTTP networkRequestWithURL:SERVERREQUESTURL(STUDYLIST) withRequestType:ZERO withParameter:studyListModel withReturnValueBlock:^(id returnValue) {
[XBLoadingView hideHUDViewWithDefault];
if (RESULT(returnValue)) {
StudyTaskResponse *responeseEty = [[StudyTaskResponse alloc]initWithDictionary:RESPONSE(returnValue) error:nil];
if (responeseEty.studyEntity.count == 0) {
[XBLoadingView showHUDViewWithText:@"学习内容为空!"];
return;
}
weakSelf.datasArray = [NSMutableArray arrayWithArray:responeseEty.studyEntity];
weakSelf.studyTypeEntity = responeseEty;
}else {
[XBLoadingView showHUDViewWithText:MESSAGE(returnValue)];
}
}withFailureBlock:^(NSError *error) {
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
}
#pragma mark - 数据源
- (void)setDatasArray:(NSMutableArray *)datasArray
......@@ -100,33 +138,41 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
//如果已经选中再次点击无效
UITableViewCell *playCell = [tableView cellForRowAtIndexPath:indexPath];
if ([playCell isKindOfClass:[PPTListItemTableViewCell class]]) {
PPTListItemTableViewCell *pptCell = (PPTListItemTableViewCell *)playCell;
if (pptCell.pptButton.selected) {
return;
}
}else if ([playCell isKindOfClass:[VideoListItemTableViewCell class]]) {
VideoListItemTableViewCell *videoCell = (VideoListItemTableViewCell *)playCell;
if (videoCell.playButton.selected) {
return;
if (self.type == VideoViewTypeDetail) {
//如果已经选中再次点击无效
UITableViewCell *playCell = [tableView cellForRowAtIndexPath:indexPath];
if ([playCell isKindOfClass:[PPTListItemTableViewCell class]]) {
PPTListItemTableViewCell *pptCell = (PPTListItemTableViewCell *)playCell;
if (pptCell.pptButton.selected) {
return;
}
}else if ([playCell isKindOfClass:[VideoListItemTableViewCell class]]) {
VideoListItemTableViewCell *videoCell = (VideoListItemTableViewCell *)playCell;
if (videoCell.playButton.selected) {
return;
}
}
}
//取消所有选中状态
for (UITableViewCell *cell in self.studyListTableView.visibleCells) {
if ([cell isKindOfClass:[PPTListItemTableViewCell class]]) {
PPTListItemTableViewCell *pptCell = (PPTListItemTableViewCell *)cell;
pptCell.pptButton.selected = NO;
//取消所有选中状态
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 ([cell isKindOfClass:[VideoListItemTableViewCell class]]) {
VideoListItemTableViewCell *videoCell = (VideoListItemTableViewCell *)cell;
videoCell.playButton.selected = NO;
if ([self.delegate respondsToSelector:@selector(seleStudyItemCellIndex:)]) {
[self.delegate seleStudyItemCellIndex:indexPath];
}
}else if (self.type == VideoViewTypeList){
OnlineLearningDetailViewController *studyDetail = [[[self class] getLearningCenterStoryboardClass]instantiateViewControllerWithIdentifier:@"OnlineLearningDetailViewController"];
studyDetail.studyResult = self.studyTypeEntity;
studyDetail.interIndex = indexPath;
[self.navigationController pushViewController:studyDetail animated:YES];
}
if ([self.delegate respondsToSelector:@selector(seleStudyItemCellIndex:)]) {
[self.delegate seleStudyItemCellIndex:indexPath];
}
}
#pragma mark - 视频播放百分比
......@@ -137,7 +183,7 @@
CustomStudyEntity *studyList = studyEntity.studyTasks[indexPath.row];
studyList.attachment.playPercent = [NSString stringWithFormat:@"%ld",proportion];
[videoPlayCell.studyProgressView updateChartByCurrent:@(proportion)];
NSLog(@"%ld",proportion);
NSLog(@"----%ld",proportion);
}
#pragma mark -缩小动画
......
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16D32" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="ijs-ag-b7Y">
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="11762" systemVersion="16E195" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none" useAutolayout="YES" colorMatched="YES" initialViewController="ijs-ag-b7Y">
<device id="ipad9_7" orientation="landscape">
<adaptation id="fullscreen"/>
</device>
......@@ -1306,7 +1306,7 @@
<rect key="frame" x="0.0" y="55.5" width="1024" height="182"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="Sye-2R-IQf" id="CXs-SR-gHP">
<rect key="frame" x="0.0" y="0.0" width="1024" height="181"/>
<rect key="frame" x="0.0" y="0.0" width="1024" height="181.5"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="2bG-Ip-ptr" userLabel="View1">
......@@ -7352,7 +7352,7 @@
</viewController>
<placeholder placeholderIdentifier="IBFirstResponder" id="gQg-5p-Qhl" sceneMemberID="firstResponder"/>
</objects>
<point key="canvasLocation" x="-763" y="2541"/>
<point key="canvasLocation" x="288" y="2529"/>
</scene>
<!--促销选择-->
<scene sceneID="PhL-ws-5UB">
......@@ -8000,7 +8000,7 @@
<rect key="frame" x="0.0" y="28" width="1024" height="70"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="A8c-vp-keu" id="bor-pm-4wM">
<rect key="frame" x="0.0" y="0.0" width="1024" height="69"/>
<rect key="frame" x="0.0" y="0.0" width="1024" height="69.5"/>
<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="28E-AO-zbH">
......@@ -8046,7 +8046,7 @@
<rect key="frame" x="0.0" y="98" width="1024" height="70"/>
<autoresizingMask key="autoresizingMask"/>
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" tableViewCell="aJ6-RS-988" id="q46-Um-hjN">
<rect key="frame" x="0.0" y="0.0" width="1024" height="69"/>
<rect key="frame" x="0.0" y="0.0" width="1024" height="69.5"/>
<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="YRX-3g-DLM">
......
......@@ -103,12 +103,12 @@ typedef NS_ENUM(NSInteger,COMMENT_PRAISE) {
/**
* 服务器测试地址
*/
#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg-dev.opple.com/opple-web/app%@",URL]
//#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg-dev.opple.com/opple-web/app%@",URL]
//**
// * 服务器正式地址
// */
//#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]
/*****************************************接口地址*****************************************/
......
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