Commit 18d0e156 authored by 曹云霄's avatar 曹云霄

no message

parent 73525f75
......@@ -38,9 +38,9 @@
}
self.imageBackView.indexPath = indexPath;
if (topicEntity.backEnd) {
self.headerImageView.image = TCImage(@"Icon-83.5");
self.headerImageView.image = TCImage(@"manager");
}else {
[self.headerImageView sd_setImageWithURL:[NSURL URLWithString:topicEntity.posterPicture] placeholderImage:ReplaceImage];
[self.headerImageView sd_setImageWithURL:[NSURL URLWithString:topicEntity.posterPicture] placeholderImage:TCImage(@"user")];
}
}
......
......@@ -16,6 +16,11 @@
*/
@property (weak, nonatomic) IBOutlet UIImageView *forumImageView;
/**
icon
*/
@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
/**
讨论项标题
*/
......
......@@ -19,7 +19,8 @@
{
_categoryEntity = categoryEntity;
if (_categoryEntity) {
[self.forumImageView sd_setImageWithURL:[NSURL URLWithString:_categoryEntity.attachment.fileUrl] placeholderImage:ReplaceImage];
[self.forumImageView sd_setImageWithURL:[NSURL URLWithString:_categoryEntity.attachmentBg.fileUrl] placeholderImage:ReplaceImage];
[self.iconImageView sd_setImageWithURL:[NSURL URLWithString:_categoryEntity.attachment.fileUrl] placeholderImage:ReplaceImage];
self.forumTitleLabel.text = _categoryEntity.name;
self.forumDetailTitleLabel.text = _categoryEntity.fdescription;
}
......
......@@ -73,7 +73,14 @@
}
self.timeLineResponse = response;
[self.calibrationCollectionView reloadData];
[self.calibrationCollectionView setContentOffset:CGPointMake(self.calibrationCollectionView.contentSize.height - self.calibrationCollectionView.frame.size.height, 0) animated:YES];
[self.calibrationCollectionView scrollToItemAtIndexPath:[NSIndexPath indexPathForItem:self.timeLineResponse.list.count-1 inSection:0] atScrollPosition:UICollectionViewScrollPositionNone animated:NO];
//等待0.3s秒(刷新主界面)
dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
NSInteger yearNumber = self.timeLineResponse.list.count-1;
[self checkAnimationTriangleView:yearNumber returnMonthBlock:^(NSInteger monthNumber) {
[self refreshForumTypeList:yearNumber monthNumber:monthNumber];
}];
});
}
#pragma mark -判断时间轴是否有效
......@@ -84,17 +91,23 @@
if ([entity.year integerValue] == [year integerValue]) {
if ([entity.month integerValue] > [month integerValue]) {
return NotChoose;
}else if ([entity.month integerValue] == [month integerValue]) {
return Selected;
}else {
return Default;
}
}else if ([entity.year integerValue] > [year integerValue]) {
if ([entity.month integerValue] == [month integerValue]) {
return Selected;
}
return Default;
}else if ([entity.year integerValue] < [year integerValue]) {
if ([entity.month integerValue] == [month integerValue]) {
return Selected;
}
return Default;
}
if ([month isEqualToString:entity.month]) {
return Selected;
}else {
return Default;
}
return NotChoose;
}
#pragma mark -UI
......@@ -128,39 +141,89 @@
self.yearNumber = index;
TimeLineType *entity = self.timeLineResponse.list[self.yearNumber];
self.triangleView.yearString = entity.year;
[self refreshForumTypeList];
[self checkAnimationTriangleView:index returnMonthBlock:nil];
[self refreshForumTypeList:index monthNumber:self.monthNumber];
}
#pragma mark -监听子控制器点击
#pragma mark -监听子控制器点击通知
- (void)animationTriangleView:(NSNotification *)object
{
CalibrationDetailCollectionCell *cell = object.object;
self.monthNumber = cell.indexPath.item;
for (TimeLineType *timeLineType in self.timeLineResponse.list) {
BOOL isSelected = NO;
for (int i=0; i<timeLineType.list.count; i++) {
CustomTOForumtypeEntity *entity = timeLineType.list[i];
if (i == cell.indexPath.item) {
if (entity.type) {
entity.type = Selected;
isSelected = YES;
}
}else {
if (entity.type == Selected) {
entity.type = Default;
}
}
//本次循环结束判断是否有选中时间轴
if (i == timeLineType.list.count - 1) {
if (!isSelected) {
[self checkTimeLineSelected:timeLineType];
}
}
}
}
[self.calibrationCollectionView reloadData];
[self mobileTriangleView:cell];
[self refreshForumTypeList];
[self refreshForumTypeList:self.yearNumber monthNumber:self.monthNumber];
}
#pragma mark -时间轴选中后通知
- (void)checkAnimationTriangleView:(NSInteger)yearNumber returnMonthBlock:(void(^)(NSInteger month))monthNumber
{
TimeLineType *timeLineType = self.timeLineResponse.list[yearNumber];
NSInteger selected = 0;
for (int i=0; i<timeLineType.list.count; i++) {
CustomTOForumtypeEntity *entity = timeLineType.list[i];
if (entity.type == Selected) {
if (monthNumber) {
monthNumber(selected);
}
selected = i;break;
}
}
CalibrationCollectionViewCell *calibrationCell = (CalibrationCollectionViewCell *)[self.calibrationCollectionView cellForItemAtIndexPath:[NSIndexPath indexPathForItem:yearNumber inSection:0]];
CalibrationDetailCollectionCell *calibrationDetailCell = (CalibrationDetailCollectionCell *)[calibrationCell.detailsVc.calibrationDetailCollectionView cellForItemAtIndexPath:[NSIndexPath indexPathForItem:selected inSection:0]];
[self mobileTriangleView:calibrationDetailCell];
}
#pragma mark -校验是否选中
- (void)checkTimeLineSelected:(TimeLineType *)timeLineType
{
NSInteger number = timeLineType.list.count-1;
for (NSInteger i=number; i>=0; i--) {
CustomTOForumtypeEntity *entity = timeLineType.list[i];
if (entity.type) {
entity.type = Selected;break;
}
}
}
#pragma mark -刷新帖子分类列表
- (void)refreshForumTypeList
- (void)refreshForumTypeList:(NSInteger)yearNumber monthNumber:(NSInteger)monthNumber
{
TimeLineType *timeLineType = self.timeLineResponse.list[self.yearNumber];
CustomTOForumtypeEntity *entity = timeLineType.list[self.monthNumber];
[Notification postNotificationName:REFRESH_FROUMLIST object:entity.fid];
TimeLineType *timeLineType = self.timeLineResponse.list[yearNumber];
CustomTOForumtypeEntity *entity = timeLineType.list[monthNumber];
NSString *fidString = entity.fid;
//判断滑动结束后指向的时间轴是否有效.
if (entity.type != Selected) {
for (int i=0; i<timeLineType.list.count; i++) {
CustomTOForumtypeEntity *newEntity = timeLineType.list[i];
if (newEntity.type == Selected) {
fidString = newEntity.fid;break;
}
}
}
[Notification postNotificationName:REFRESH_FROUMLIST object:fidString];
}
#pragma mark -移动指示三角
......@@ -178,7 +241,7 @@
- (TriangleIndicatorView *)triangleView
{
if (!_triangleView) {
_triangleView = [[TriangleIndicatorView alloc] initializeView:CGRectMake(20, 45, 25, 15) contentLabel:[[NSDate date] yearString]];
_triangleView = [[TriangleIndicatorView alloc] initializeView:CGRectMake(-100, 45, 25, 15) contentLabel:[[NSDate date] yearString]];
}
return _triangleView;
}
......
......@@ -8,6 +8,7 @@
#import "DiscussModuleViewController.h"
#import "DiscussModuleCollectionViewCell.h"
#import "ForumItemListViewController.h"
@interface DiscussModuleViewController ()<UICollectionViewDelegate,UICollectionViewDataSource>
......@@ -62,11 +63,22 @@
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
DiscussModuleCollectionViewCell *moduleCell = [collectionView dequeueReusableCellWithReuseIdentifier:@"DiscussModuleCollectionViewCell" forIndexPath:indexPath];
TOForumtypeEntity *entity = self.result.list[indexPath.item];
[moduleCell.DiscussModuleImageView sd_setImageWithURL:[NSURL URLWithString:entity.attachment.fileUrl] placeholderImage:REPLACEIMAGE];
TOForumCategoryEntity *entity = self.result.list[indexPath.item];
[moduleCell refreshCell:entity];
return moduleCell;
}
- (void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath
{
ForumItemListViewController *itemListVc = [[[self class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"ForumItemListViewController"];
TOForumCategoryEntity *category = self.result.list[indexPath.row];
category.typeId = self.result.forumType.fid;
itemListVc.category = category;
[self.navigationController pushViewController:itemListVc animated:YES];
}
@end
......@@ -142,9 +142,9 @@
NSString *headerurl = [Shoppersmanager manager].Shoppers.employee.picture;
[self.issuerImageView sd_setImageWithURL:[NSURL URLWithString:headerurl] placeholderImage:ReplaceImage];
if (self.topicDetail.backEnd) {
self.issuerImageView.image = TCImage(@"Icon-83.5");
self.issuerImageView.image = TCImage(@"manager");
}else {
[self.issuerImageView sd_setImageWithURL:[NSURL URLWithString:self.topicDetail.posterPicture] placeholderImage:ReplaceImage];
[self.issuerImageView sd_setImageWithURL:[NSURL URLWithString:self.topicDetail.posterPicture] placeholderImage:TCImage(@"user")];
}
//图片
PostPhotoManagerViewController *photoManager = [[[self class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"PostPhotoManagerViewController"];
......
......@@ -21,6 +21,11 @@
*/
@property (weak, nonatomic) IBOutlet UIImageView *classifyImageView;
/**
分类图标
*/
@property (weak, nonatomic) IBOutlet UIImageView *classIconImageView;
/**
分类标题
*/
......
......@@ -97,7 +97,8 @@ static NSString *TAGCELL_IDENTIFIER = @"CommentTagTableViewCell";
{
self.classificationListTableView.backgroundColor = RGB(237, 238, 239, 1);
self.classifyTitleLabel.text = self.category.name;
[self.classifyImageView sd_setImageWithURL:[NSURL URLWithString:self.category.attachment.fileUrl] placeholderImage:REPLACEIMAGE];
[self.classifyImageView sd_setImageWithURL:[NSURL URLWithString:self.category.attachmentBg.fileUrl] placeholderImage:REPLACEIMAGE];
[self.classIconImageView sd_setImageWithURL:[NSURL URLWithString:self.category.attachment.fileUrl] placeholderImage:REPLACEIMAGE];
}
#pragma mark - 获取分类帖子列表
......
......@@ -11,7 +11,7 @@
#import "ForumItemListViewController.h"
@interface ForumViewController ()<UITableViewDelegate,UITableViewDataSource>
@interface ForumViewController ()<UITableViewDelegate,UITableViewDataSource,DZNEmptyDataSetSource,DZNEmptyDataSetDelegate>
@property (nonatomic,strong) ForumCategoryResponse *category;
......@@ -51,7 +51,6 @@
headerRefresh.stateLabel.hidden = YES;
headerRefresh.lastUpdatedTimeLabel.hidden = YES;
self.forumTableView.mj_header =headerRefresh;
[self.forumTableView.mj_header beginRefreshing];
}
#pragma mark - 获取论坛项Type
......@@ -63,6 +62,8 @@
[XBLoadingView hideHUDViewWithDefault];
[weakSelf endRefreshingForTableView:weakSelf.forumTableView];
weakSelf.forumTableView.emptyDataSetDelegate = weakSelf;
weakSelf.forumTableView.emptyDataSetSource = weakSelf;
if (RESULT(returnValue)) {
weakSelf.category = [[ForumCategoryResponse alloc] initWithDictionary:RESPONSE(returnValue) error:nil];
[weakSelf.forumTableView reloadData];
......@@ -97,4 +98,26 @@
}
#pragma mark -友好界面
- (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView
{
return kNoDataImage;
}
- (BOOL)emptyDataSetShouldAllowScroll:(UIScrollView *)scrollView
{
return YES;
}
- (CGFloat)verticalOffsetForEmptyDataSet:(UIScrollView *)scrollView {
return 64.0;
}
@end
......@@ -55,7 +55,7 @@
- (void)timeLineNotChoose
{
self.userInteractionEnabled = NO;
self.monthLabel.textColor = [UIColor grayColor];
self.monthLabel.textColor = [UIColor lightGrayColor];
}
......
......@@ -10,5 +10,24 @@
@interface DiscussModuleCollectionViewCell : UICollectionViewCell
@property (weak, nonatomic) IBOutlet UIImageView *DiscussModuleImageView;
/**
背景图片
*/
@property (weak, nonatomic) IBOutlet UIImageView *discussModuleImageView;
/**
图片
*/
@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
/**
标题
*/
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
- (void)refreshCell:(TOForumCategoryEntity *)entity;
@end
......@@ -10,4 +10,12 @@
@implementation DiscussModuleCollectionViewCell
- (void)refreshCell:(TOForumCategoryEntity *)entity
{
[self.discussModuleImageView sd_setImageWithURL:[NSURL URLWithString:entity.attachmentBg.fileUrl] placeholderImage:REPLACEIMAGE];
[self.iconImageView sd_setImageWithURL:[NSURL URLWithString:entity.attachment.fileUrl] placeholderImage:REPLACEIMAGE];
self.titleLabel.text = entity.name;
}
@end
......@@ -31,11 +31,10 @@
#pragma mark - UICollectionView
- (void)setUpCollectionView
{
self.onlineLearningFlowLayout.itemSize = CGSizeMake((ScreenWidth-100)/4.0, ((ScreenWidth-100)/4.0-50));
self.onlineLearningFlowLayout.itemSize = CGSizeMake((ScreenWidth-60)/3.0, ((ScreenWidth-60)/3.0)*0.9);
self.onlineLearningFlowLayout.sectionInset = UIEdgeInsetsMake(20, 20, 20, 20);
self.onlineLearningFlowLayout.minimumLineSpacing = 20;
self.onlineLearningFlowLayout.minimumInteritemSpacing = 20;
self.onlineLearningFlowLayout.minimumLineSpacing = 10;
self.onlineLearningFlowLayout.minimumInteritemSpacing = 10;
}
#pragma mark - 学习模块数据
......
......@@ -16,11 +16,21 @@
*/
@property (weak, nonatomic) IBOutlet UIImageView *studyItemImageView;
/**
图标
*/
@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
/**
类型title
*/
@property (weak, nonatomic) IBOutlet UILabel *studyItemTitleLabel;
/**
title背景
*/
@property (weak, nonatomic) IBOutlet UIView *titleBackgroundView;
/**
学习类型
*/
......
......@@ -12,14 +12,16 @@
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
self.titleBackgroundView.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.15];
}
- (void)setStudeType:(TOStudyTypeEntity *)studeType
{
_studeType = studeType;
[self.studyItemImageView sd_setImageWithURL:[NSURL URLWithString:_studeType.attachment.thumbnailUrl] placeholderImage:REPLACEIMAGE];
[self.studyItemImageView sd_setImageWithURL:[NSURL URLWithString:_studeType.attachmentBg.fileUrl] placeholderImage:REPLACEIMAGE];
[self.iconImageView sd_setImageWithURL:[NSURL URLWithString:_studeType.attachment.fileUrl] placeholderImage:REPLACEIMAGE];
self.studyItemTitleLabel.text = _studeType.name;
}
......
......@@ -35,9 +35,23 @@
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
self.navigationController.fd_fullscreenPopGestureRecognizer.enabled = NO;
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
}
[self.meesageTableView.mj_header beginRefreshing];
}
- (void)viewWillDisappear:(BOOL)animated
{
[super viewWillDisappear:animated];
self.navigationController.fd_fullscreenPopGestureRecognizer.enabled = YES;
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = YES;
}
}
- (void)viewDidLoad {
[super viewDidLoad];
......
This diff is collapsed.
{
"images" : [
{
"idiom" : "universal",
"filename" : "6.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "manager.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "manager@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "manager@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "user.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "user@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "user@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "矩形-1-拷贝-9.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -844,4 +844,3 @@ extern NSString *const REFRESH_FROUMLIST;
......@@ -790,10 +790,16 @@ extern NSString * const GRADEMETHOD_MANUL;
@interface ForumTypeResponse : JSONModel
/**
* (no documentation provided)
* @see TOForumtypeEntity
* @see TOForumCategoryEntity
*
*/
@property (nonatomic, strong) NSArray<TOForumCategoryEntity> *list;
/**
* (no documentation provided)
*
*
*/
@property (nonatomic, strong) NSArray<TOForumtypeEntity> *list;
@property (nonatomic, strong) TOForumtypeEntity *forumType;
@end /* interface ForumTypeResponse */
......@@ -1841,6 +1847,7 @@ extern NSString * const GRADEMETHOD_MANUL;
*
*/
@property (nonatomic, copy) NSString *thumbnailUrl;
/**
* 实体类型
*
......@@ -2012,6 +2019,8 @@ extern NSString * const GRADEMETHOD_MANUL;
*
*/
@property (nonatomic, strong) TOAttachmentEntity *attachment;
@property (nonatomic, strong) TOAttachmentEntity *attachmentBg;
@end /* interface TOForumCategoryEntity */
......@@ -3725,6 +3734,8 @@ extern NSString * const GRADEMETHOD_MANUL;
*
*/
@property (nonatomic, strong) TOAttachmentEntity *attachment;
@property (nonatomic, strong) TOAttachmentEntity *attachmentBg;
@end /* interface TOStudyTypeEntity */
......
......@@ -689,6 +689,8 @@
}
- (void)dealloc
{
NSLog(@"释放%@控制器",self);
......
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