Commit 96d801bf authored by 曹云霄's avatar 曹云霄

修改项说明:修复图片异步上传,进度条显示

parent d3512889
......@@ -64,11 +64,11 @@
- (void)setUpChooseView
{
self.dateButton = [ScreeningButton buttonWithType:UIButtonTypeCustom];
self.dateButton.frame = CGRectMake(ScreenWidth-400, (self.chooseBackgroundView.height-30)/2, 150, 30);
self.dateButton.frame = CGRectMake(ScreenWidth-400, 15, 150, 30);
[self.dateButton setTitle:@"时间" forState:UIControlStateNormal];
[self.dateButton addTarget:self action:@selector(dateChooseButtonClick:) forControlEvents:UIControlEventTouchUpInside];
self.typeButton = [ScreeningButton buttonWithType:UIButtonTypeCustom];
self.typeButton.frame = CGRectMake(ScreenWidth-200, (self.chooseBackgroundView.height-30)/2, 150, 30);
self.typeButton.frame = CGRectMake(ScreenWidth-200, 15, 150, 30);
[self.typeButton setTitle:@"类别" forState:UIControlStateNormal];
[self.typeButton addTarget:self action:@selector(typeChooseButtonClick:) forControlEvents:UIControlEventTouchUpInside];
[self.chooseBackgroundView addSubview:self.dateButton];
......
......@@ -17,6 +17,10 @@
*/
@property (nonatomic,strong) NSMutableArray *datasArray;
/**
顶部约束
*/
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *topConstraint;
@end
......@@ -36,7 +40,7 @@
self.integralDetailsTableView.rowHeight = (self.cellType == PrizeTableView)?90:70;
self.integralDetailsTableView.tableFooterView = [UIView new];
if (self.cellType == PrizeTableView) {
self.integralDetailsTableView.frame = CGRectMake(0, 64, ScreenWidth, ScreenHeight-64);
self.topConstraint.constant = 64;
self.integralDetailsTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
self.integralDetailsTableView.backgroundColor = RGB(237, 238, 239, 1);
}
......
......@@ -14,9 +14,9 @@
/**
点击事件
@param isBest true 表示设为最佳 false 表示取消最佳 finish 完成回调 replyId 回复ID
@param isBest true 表示设为最佳 false 表示取消最佳 replyId 回复ID
*/
- (void)tapClickAction:(BOOL)isBest withReplyId:(NSString *)replyId completeBlock:(void(^)())finish;
- (void)tapClickAction:(BOOL)isBest withReplyId:(NSString *)replyId withIndexPath:(NSIndexPath *)indexPath;
@end
......@@ -34,4 +34,9 @@
*/
@property (nonatomic,assign) BOOL isBest;
/**
cell下标
*/
@property (nonatomic,strong) NSIndexPath *indexPath;
@end
......@@ -59,13 +59,9 @@
#pragma mark - 响应
- (void)tapClickAction:(UITapGestureRecognizer *)sender
{
if ([self.delegate respondsToSelector:@selector(tapClickAction:withReplyId:completeBlock:)]) {
if ([self.delegate respondsToSelector:@selector(tapClickAction:withReplyId:withIndexPath:)]) {
UIButton *button = [self viewWithTag:100];
UILabel *label = [self viewWithTag:101];
[self.delegate tapClickAction:button.isSelected withReplyId:self.replyId completeBlock:^{
button.selected = !button.selected;
label.text = button.selected?@"取消最佳":@"设为最佳";
}];
[self.delegate tapClickAction:button.isSelected withReplyId:self.replyId withIndexPath:self.indexPath];
}
}
......
......@@ -42,6 +42,11 @@
*/
@property (weak, nonatomic) IBOutlet UIButton *optionButton;
/**
下标
*/
@property (nonatomic,strong) NSIndexPath *indexPath;
/**
最佳回复View
*/
......
......@@ -13,8 +13,13 @@
- (void)awakeFromNib {
[super awakeFromNib];
self.bestView = [[BestReplyView alloc] initWithFrame:CGRectMake(self.optionButton.x, self.optionButton.y, 0, 30)];
self.bestView = [[BestReplyView alloc] init];
[self.contentView addSubview:self.bestView];
[self.bestView mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.optionButton.mas_left).offset(-5);
make.size.mas_equalTo(CGSizeMake(0, 30));
make.centerY.equalTo(self.optionButton);
}];
}
#pragma mark - 选项按钮
......@@ -38,11 +43,12 @@
{
_replyEntity = replyEntity;
self.bestView.replyId = _replyEntity.fid;
// self.issuerImageView sd_setImageWithURL:[NSURL URLWithString:_replyEntity] placeholderImage:<#(UIImage *)#>
[self.issuerImageView sd_setImageWithURL:[NSURL URLWithString:_replyEntity.replyerPicture] placeholderImage:ReplaceImage];
self.issuerNameLabel.text = [NSString stringWithFormat:@"%@: %@",_replyEntity.replyerPosition,_replyEntity.replyerRealName];
self.issuerDateLabel.text = _replyEntity.replyTime;
self.commentContentLabel.text = _replyEntity.replyContent;
self.bestView.isBest = _replyEntity.best;
self.bestView.indexPath = self.indexPath;
self.baseImageView.hidden = !_replyEntity.best;
}
......
......@@ -47,6 +47,11 @@ typedef NS_ENUM(NSInteger,ItemIndex){
@interface ContentTableViewCell : UITableViewCell<ExtensionDelegate,UITextViewDelegate>
@property (nonatomic,weak) id<ExtensionViewTapDelegate>delgate;
/**
textView 高度
*/
@property (weak, nonatomic) IBOutlet NSLayoutConstraint *heightConstraint;
/**
内容
*/
......
......@@ -65,7 +65,7 @@
#pragma mark - <UITextViewDelegate>
- (void)textViewDidEndEditing:(UITextView *)textView
{
self.contentTextView.height = [self calculateStudyIntroductionHeight:textView.text];
self.heightConstraint.constant = [self calculateStudyIntroductionHeight:textView.text];
if ([self.delgate respondsToSelector:@selector(refreshHeight:)]) {
[self.delgate refreshHeight:self.contentTextView.height];
}
......
......@@ -18,13 +18,13 @@
CGFloat width = 150;
CGFloat interval = 15;
for (int i=0; i<3; i++) {
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(i*width+i*interval, 0, width, self.height)];
UIImageView *imageView = [[UIImageView alloc] initWithFrame:CGRectMake(i*width+i*interval, 0, width, width)];
imageView.userInteractionEnabled = YES;
imageView.tag = i;
[imageView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(TapClickAction:)]];
[self addSubview:imageView];
if (i == 2) {
UILabel *instruction = [[UILabel alloc] initWithFrame:CGRectMake(width-50, self.height-15, 50, 15)];
UILabel *instruction = [[UILabel alloc] initWithFrame:CGRectMake(width-50, width-15, 50, 15)];
instruction.text = @"共4张";
instruction.font = [UIFont systemFontOfSize:10];
instruction.textColor = [UIColor whiteColor];
......@@ -43,8 +43,9 @@
id object = self.subviews[i];
if ([object isKindOfClass:[UIImageView class]]) {
UIImageView *imageView = (UIImageView *)object;
TOAttachmentEntity *entity = _imageArray[i];
[imageView sd_setImageWithURL:[NSURL URLWithString:entity.fileUrl] placeholderImage:ReplaceImage];
TOAttachmentEntity *entity = [_imageArray objectAtIndex_opple:i];
imageView.hidden = !entity;
[imageView sd_setImageWithURL:[NSURL URLWithString:entity.fileUrl] placeholderImage:REPLACEIMAGE];
if (i == 2) {
for (id obj in imageView.subviews) {
if ([obj isKindOfClass:[UILabel class]]) {
......
......@@ -22,7 +22,7 @@
#pragma mark - 计算高度
- (CGFloat)calculateStudyIntroductionHeight:(NSString *)content
{
CGSize s = [content boundingRectWithSize:CGSizeMake(ScreenWidth-28*2, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:13]} context:nil].size;
CGSize s = [content boundingRectWithSize:CGSizeMake(ScreenWidth-20*2, CGFLOAT_MAX) options:NSStringDrawingUsesLineFragmentOrigin | NSStringDrawingUsesFontLeading attributes:@{NSFontAttributeName:[UIFont systemFontOfSize:13]} context:nil].size;
return s.height;
}
......
//
// ForumItemDetailTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 2016/12/12.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
/**
删除帖子
*/
@protocol DeleteDelegate <NSObject>
- (void)deletePostAction;
@end
@interface ForumItemDetailTableViewCell : UITableViewCell
@property (nonatomic,weak) id<DeleteDelegate>delegate;
/**
发贴人头像
*/
@property (weak, nonatomic) IBOutlet UIImageView *issuerImageView;
/**
贴心标题
*/
@property (weak, nonatomic) IBOutlet UILabel *postTitleLabel;
/**
发帖人姓名、时间
*/
@property (weak, nonatomic) IBOutlet UILabel *issuerNameAndDateLabel;
/**
删除帖子
*/
@property (weak, nonatomic) IBOutlet UIButton *delectButton;
/**
帖子内容
*/
@property (weak, nonatomic) IBOutlet UILabel *contentLabel;
/**
详情数据源
*/
@property (nonatomic,strong) CustomTOForumTopicEntity *detailEntity;
@end
//
// ForumItemDetailTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 2016/12/12.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "ForumItemDetailTableViewCell.h"
@implementation ForumItemDetailTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setDetailEntity:(CustomTOForumTopicEntity *)detailEntity
{
_detailEntity = detailEntity;
if (_detailEntity) {
self.postTitleLabel.text = _detailEntity.title;
self.contentLabel.text = _detailEntity.content;
self.issuerNameAndDateLabel.text = [NSString stringWithFormat:@"%@: %@ %@",_detailEntity.posterPosition,_detailEntity.posterRealName,_detailEntity.postTime];
self.contentLabel.height = _detailEntity.contentHeight;
}
}
#pragma mark - 删除帖子
- (IBAction)delectButtonClickAction:(UIButton *)sender {
if ([self.delegate respondsToSelector:@selector(deletePostAction)]) {
[self.delegate deletePostAction];
}
}
@end
......@@ -7,11 +7,10 @@
//
#import "ForumItemDetailViewController.h"
#import "ForumItemDetailTableViewCell.h"
#import "CommentListTableViewCell.h"
#import "PostPhotoManagerViewController.h"
@interface ForumItemDetailViewController ()<UITableViewDelegate,UITableViewDataSource,UITextFieldDelegate,DeleteDelegate,TapClickDelegate>
@interface ForumItemDetailViewController ()<UITableViewDelegate,UITableViewDataSource,UITextFieldDelegate,TapClickDelegate>
@property (nonatomic,strong) ForumReplyResponse *topicReply;
......@@ -129,7 +128,6 @@
self.postTitleLabel.text = self.topicDetail.title;
self.contentLabel.text = self.topicDetail.content;
self.issuerNameAndDateLabel.text = [NSString stringWithFormat:@"%@: %@ %@",self.topicDetail.posterPosition,self.topicDetail.posterRealName,self.topicDetail.postTime];
self.contentLabel.height = self.topicDetail.contentHeight;
//图片
PostPhotoManagerViewController *photoManager = [[[self class] getLearningCenterStoryboardClass] instantiateViewControllerWithIdentifier:@"PostPhotoManagerViewController"];
[self addChildViewController:photoManager];
......@@ -140,8 +138,8 @@
CGFloat attachment = [self calculateImageHeight];
photoManager.imageArray = array;
[self.tableViewHeaderView addSubview:photoManager.view];
self.tableViewHeaderView.height = attachment + self.contentLabel.height + 60 + 20;
photoManager.view.frame = CGRectMake(self.contentLabel.left, self.contentLabel.bottom+10, self.contentLabel.width, attachment);
self.tableViewHeaderView.height = attachment + self.topicDetail.contentHeight + self.contentLabel.top + 20;
photoManager.view.frame = CGRectMake(self.contentLabel.left, self.topicDetail.contentHeight+10+self.contentLabel.top, self.contentLabel.width, attachment);
self.forumDetailTableView.tableHeaderView = self.tableViewHeaderView;
}
......@@ -156,6 +154,7 @@
{
CommentListTableViewCell *commentCell = [tableView dequeueReusableCellWithIdentifier:@"CommentListTableViewCell" forIndexPath:indexPath];
commentCell.bestView.delegate = self;
commentCell.indexPath = indexPath;
commentCell.replyEntity = self.commentsArray[indexPath.row];
return commentCell;
}
......@@ -168,7 +167,14 @@
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
CustomTOForumReplyEntity *replyEntity = self.commentsArray[indexPath.row];
return replyEntity.replyContentHeight + 60 + 20;
//68为上边距 10为下边距
return replyEntity.replyContentHeight + 68 + 10;
}
- (void)tableView:(UITableView *)tableView didEndDisplayingCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
CommentListTableViewCell *commentCell = (CommentListTableViewCell *)cell;
[commentCell.bestView removeFromSuperview];
}
#pragma mark - 计算选中图片显示所需高度
......@@ -195,15 +201,17 @@
- (BOOL)textFieldShouldReturn:(UITextField *)textField
{
if ([[self class] isBlankString:textField.text]) {
[XBLoadingView showHUDViewWithText:@"评论内容不能为空"];return NO;
[XBLoadingView showHUDViewWithText:@"评论内容不能为空"];
}else {
[self replyPostRequest];
}
[self replyPostRequest];
return YES;
}
#pragma mark - 回复帖子
- (void)replyPostRequest
{
[self.view endEditing:YES];
TOForumReplyEntity *reply = [[TOForumReplyEntity alloc] init];
reply.topicId = self.topicDetail.fid;
reply.replyContent = self.commentInputTextFieldView.text;
......@@ -213,10 +221,12 @@
reply.replyTime = [[self class] getTimeby:0];
reply.replyerId = [Shoppersmanager manager].Shoppers.employee.fid;
[XBLoadingView showHUDViewWithDefault];
WS(weakSelf);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(REPLYPOST) WithRequestType:ZERO WithParameter:reply WithReturnValueBlock:^(id returnValue) {
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
weakSelf.commentInputTextFieldView.text = nil;
[XBLoadingView showHUDViewWithSuccessText:@"评论成功" completeBlock:nil];
}else {
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
......@@ -227,9 +237,8 @@
}];
}
#pragma mark - 删除帖子
- (void)deletePostAction
- (IBAction)delecteClickPostAction:(UIButton *)sender
{
[XBLoadingView showHUDViewWithDefault];
WS(weakSelf);
......@@ -253,14 +262,17 @@
#pragma mark - <TapClickDelegate>
#pragma mark -最佳回复
- (void)tapClickAction:(BOOL)isBest withReplyId:(NSString *)replyId completeBlock:(void (^)())finish
- (void)tapClickAction:(BOOL)isBest withReplyId:(NSString *)replyId withIndexPath:(NSIndexPath *)indexPath
{
WS(weakSelf);
[XBLoadingView showHUDViewWithDefault];
NSLog(@"%@",[NSString stringWithFormat:SERVERREQUESTURL(BASEREPLY),self.topicDetail.fid,replyId,isBest]);
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:[NSString stringWithFormat:SERVERREQUESTURL(BASEREPLY),self.topicDetail.fid,replyId,isBest] WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
finish();
CustomTOForumReplyEntity *entity = [weakSelf.commentsArray objectAtIndex_opple:indexPath.row];
entity.best = !isBest;
[weakSelf.forumDetailTableView reloadRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationLeft];
}else {
[XBLoadingView showHUDViewWithText:returnValue[@"message"]];
}
......
......@@ -91,6 +91,7 @@
{
self.classifyTitleLabel.text = self.category.name;
[self.classifyImageView sd_setImageWithURL:[NSURL URLWithString:self.category.attachment.fileUrl] placeholderImage:REPLACEIMAGE];
self.classifyListCountLabel.text = [NSString stringWithFormat:@"%ld",self.category.topicCount];
}
#pragma mark - 获取分类帖子列表
......@@ -148,10 +149,10 @@
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
CustomTOForumTopicEntity *entity = self.datasArray[indexPath.row];
//20 表示控件间隙、60 表示content Y 150 表示图片背景框高度
//10 表示控件间隙、60 表示content Y 150 表示图片背景框高度
CGFloat height = entity.contentHeight + 60 + 20;
if (entity.attachments.count) {
height += 150;
height += 150+10;
}
return height;
}
......
......@@ -28,9 +28,6 @@
if (_topicEntity.attachments.count) {
self.imageBackView.imageArray = _topicEntity.attachments;
}
self.contentLabel.height = _topicEntity.contentHeight;
self.imageBackView.top = self.contentLabel.bottom + 10;
self.imageBackView.height = 140;
self.imageBackView.indexPath = self.indexPath;
}
}
......
......@@ -62,7 +62,7 @@
if ([object isKindOfClass:[UIImage class]]) {
photoCell.photoImageView.image = self.imageArray[indexPath.item];
}else if ([object isKindOfClass:[NSString class]]) {
[photoCell.photoImageView sd_setImageWithURL:[NSURL URLWithString:object] placeholderImage:ReplaceImage];
[photoCell.photoImageView sd_setImageWithURL:[NSURL URLWithString:object] placeholderImage:REPLACEIMAGE];
}
photoCell.photoImageView.tag = indexPath.item;
[photoCell.photoImageView addGestureRecognizer:[[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPressClickAction:)]];
......
......@@ -57,7 +57,7 @@
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
PhotoManagerCollectionViewCell *photoCell = [collectionView dequeueReusableCellWithReuseIdentifier:@"PhotoManagerCollectionViewCell" forIndexPath:indexPath];
[photoCell.photoImageView sd_setImageWithURL:[NSURL URLWithString:self.imageArray[indexPath.item]] placeholderImage:ReplaceImage];
[photoCell.photoImageView sd_setImageWithURL:[NSURL URLWithString:self.imageArray[indexPath.item]] placeholderImage:REPLACEIMAGE];
photoCell.photoImageView.tag = indexPath.item;
return photoCell;
}
......
......@@ -179,7 +179,7 @@
contentCell.delgate = self;
PhotoManagerViewController *photo = [self.childViewControllers firstObject];
[contentCell.contentView addSubview:photo.view];
photo.view.frame = CGRectMake(contentCell.contentTextView.x, contentCell.contentTextView.bottom+30, contentCell.contentTextView.width, [self calculateImageHeight]);
photo.view.frame = CGRectMake(contentCell.contentTextView.x, contentCell.contentTextView.bottom+10, contentCell.contentTextView.width, [self calculateImageHeight]);
photo.imageArray = self.selectedImageArray;
return contentCell;
}
......@@ -354,6 +354,7 @@
#pragma mark - 发表
- (IBAction)publishButtonClickAction:(UIButton *)sender {
[self.view endEditing:YES];
HeadlineTableViewCell *titleCell = [self.publishTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0]];
ContentTableViewCell *contentCell = [self.publishTableView cellForRowAtIndexPath:[NSIndexPath indexPathForRow:1 inSection:0]];
if ([[self class] isBlankString:titleCell.titleTextField.text]) {
......@@ -375,54 +376,43 @@
#pragma mark - 上传图片附件
- (void)uploadAttachments:(void(^)(NSArray *OSSKeys))finish
{
dispatch_group_t group = dispatch_group_create();
NSMutableArray *OSSKeyArray = [NSMutableArray array];
for (int i=0; i<self.selectedImageArray.count; i++) {
[OSSKeyArray addObject:[OSSHelper getOSSObjectKeyWithtype:@"png" index:i]];
}
XBLoadingView *loadView = [XBLoadingView showHUDViewProgressLabel:[NSString stringWithFormat:@"图片上传中:1/%ld",self.selectedImageArray.count]];
static NSInteger number = 0;
for (int i=0;i<self.selectedImageArray.count;i++) {
dispatch_group_enter(group);
UIImage *image = self.selectedImageArray[i];
NSString *ossKey = OSSKeyArray[i];
NSData *data = UIImagePNGRepresentation(image);
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
for (int i=0;i<self.selectedImageArray.count;i++) {
UIImage *image = self.selectedImageArray[i];
NSString *ossKey = OSSKeyArray[i];
NSData *data = UIImagePNGRepresentation(image);
[OSSHelper uploadImageObjectWithKey:ossKey data:data type:OSSHelperOperationTypeSynchronous progress:^(int64_t bytesSent, int64_t totalBytesSent, int64_t totalBytesExpectedToSend) {
CGFloat totalBytesSentFloat = totalBytesSent;
CGFloat totalBytesExpectedToSendFloat = totalBytesExpectedToSend;
CGFloat progress = totalBytesSentFloat / totalBytesExpectedToSendFloat;
NSLog(@"-->进度%f", progress);
dispatch_async(dispatch_get_main_queue(), ^{
loadView.progress = progress;
});
loadView.progress = progress;
} success:^id(OSSTask *task) {
number ++;
dispatch_async(dispatch_get_main_queue(), ^{
loadView.labelText = [NSString stringWithFormat:@"图片上传中:%ld/%ld",number,self.selectedImageArray.count];
});
NSLog(@"%ld",number);
dispatch_group_leave(group);
loadView.labelText = [NSString stringWithFormat:@"图片上传中:%ld/%ld",number,self.selectedImageArray.count];
if (number == self.selectedImageArray.count) {
number = 0;
dispatch_async(dispatch_get_main_queue(), ^{
[loadView hide:YES];
[XBLoadingView showHUDViewWithSuccessText:@"图片上传成功" completeBlock:^{
finish(OSSKeyArray);
}];
});
}
return nil;
} error:^(NSError *error) {
dispatch_group_leave(group);
}];
});
}
dispatch_group_notify(group, dispatch_get_main_queue(), ^{
[loadView hide:YES];
if (number == self.selectedImageArray.count) {
[XBLoadingView showHUDViewWithSuccessText:@"图片上传成功" completeBlock:^{
finish(OSSKeyArray);
[XBLoadingView showHUDViewWithText:error.localizedDescription];
}];
} else {
[XBLoadingView showHUDViewWithText:@"图片上传失败"];
}
number = 0;
});
}
......
......@@ -23,6 +23,27 @@
self.IntegralInformationBackView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
}
#pragma mark -渲染完成
- (void)viewDidAppear:(BOOL)animated
{
[super viewDidAppear:animated];
self.navigationController.fd_fullscreenPopGestureRecognizer.enabled = NO;
if ([self.navigationController respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
self.navigationController.interactivePopGestureRecognizer.enabled = NO;
}
}
#pragma mark -视图即将消失
- (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];
......
......@@ -42,10 +42,8 @@
page.rows = KROWS;
emigrated.page = page;
[XBLoadingView showHUDViewWithDefault];;
NSLog(@"%@",[emigrated toDictionary]);
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(THROUGHLIST) WithRequestType:ZERO WithParameter:emigrated WithReturnValueBlock:^(id returnValue) {
NSLog(@"%@",returnValue);
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
weakSelf.emigratedResponse = [[PassLevelResponse alloc]initWithDictionary:returnValue[@"data"] error:nil];
......@@ -68,10 +66,13 @@
TOPassLevelEntity *entity = self.emigratedResponse.passLevelEntity[i];
ThroughHistoryView *throughView = [ThroughHistoryView initializeView];
throughView.tag = i;
[throughView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(selectApplicableAction:)]];
if ([[self class] isBlankString:entity.passResult]) {
[throughView addGestureRecognizer:[[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(selectApplicableAction:)]];
}
throughView.titleLabel.text = entity.title;
throughView.endDateLabel.text = [[entity.endDate componentsSeparatedByString:@" "] firstObject];
throughView.frame = CGRectMake(i*width+i*interval, 0, width, height);
throughView.stateImageView.image = [self emigratedState:[entity.passResult integerValue]];
[self.throughHistoryBackScrollView addSubview:throughView];
}
self.throughHistoryBackScrollView.contentSize = CGSizeMake(self.emigratedResponse.passLevelEntity.count*width+(self.emigratedResponse.passLevelEntity.count-1)*interval, 0);
......
......@@ -130,10 +130,10 @@
[XBLoadingView showHUDViewWithDefault];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(LOTTERYED) WithRequestType:ZERO WithParameter:self.drawModel WithReturnValueBlock:^(id returnValue) {
[XBLoadingView hideHUDViewWithDefault];
[weakSelf endRefreshingForTableView:weakSelf.drawDetailsTableView];
weakSelf.drawDetailsTableView.emptyDataSetSource = weakSelf;
weakSelf.drawDetailsTableView.emptyDataSetDelegate = weakSelf;
[XBLoadingView hideHUDViewWithDefault];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
if (isRemove) {
[weakSelf.datasArray removeAllObjects];
......
......@@ -81,7 +81,6 @@
headerRefresh.stateLabel.hidden = YES;
headerRefresh.lastUpdatedTimeLabel.hidden = YES;
self.paymentsTableView.mj_header = headerRefresh;
MJRefreshAutoNormalFooter *footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
if (++ weakSelf.model.page.page >= weakSelf.totalPage) {
[weakSelf.paymentsTableView.mj_footer endRefreshingWithNoMoreData];
......
......@@ -155,7 +155,7 @@
[self addChildViewController:cardVc];
cardVc.view.frame = CGRectMake(0, 40, self.cardBackgroundView.mj_w, self.cardBackgroundView.mj_h-50);
[self.cardBackgroundView addSubview:cardVc.view];
/// 我的抽奖
LuckyDrawDetailsViewController *draw = [[[self class] getMainStoryboardClass] instantiateViewControllerWithIdentifier:@"LuckyDrawDetailsViewController"];
[self addChildViewController:draw];
......
......@@ -112,7 +112,8 @@
self.toolview.delegate = self;
self.toolview.inputField.delegate = self;
self.delegate = self;
[self.tabBar addSubview:self.toolview];
[self.view addSubview:self.toolview];
self.tabBar.hidden = YES;
//显示体验中心
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(ShowFollowHeart:) name:OPENFOLLOWHEARTVC object:nil];
}
......
......@@ -150,7 +150,6 @@
298111161DFE6E5000F7EAFF /* NSDate+Formatting.m in Sources */ = {isa = PBXBuildFile; fileRef = 298111151DFE6E5000F7EAFF /* NSDate+Formatting.m */; };
2981111A1DFE9F3F00F7EAFF /* CustomTOForumTopicEntity.m in Sources */ = {isa = PBXBuildFile; fileRef = 298111191DFE9F3F00F7EAFF /* CustomTOForumTopicEntity.m */; };
2981111D1DFEA98D00F7EAFF /* ForumItemDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 2981111C1DFEA98D00F7EAFF /* ForumItemDetailViewController.m */; };
298111201DFEB33D00F7EAFF /* ForumItemDetailTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 2981111F1DFEB33D00F7EAFF /* ForumItemDetailTableViewCell.m */; };
298111261DFEB95A00F7EAFF /* CommentListTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 298111251DFEB95A00F7EAFF /* CommentListTableViewCell.m */; };
29834EB41CDF1EAA001A484F /* screeningSecondView.m in Sources */ = {isa = PBXBuildFile; fileRef = 29834EB31CDF1EAA001A484F /* screeningSecondView.m */; };
29834EB61CDF1EB6001A484F /* screeningSecondView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29834EB51CDF1EB6001A484F /* screeningSecondView.xib */; };
......@@ -575,8 +574,6 @@
298111191DFE9F3F00F7EAFF /* CustomTOForumTopicEntity.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CustomTOForumTopicEntity.m; sourceTree = "<group>"; };
2981111B1DFEA98D00F7EAFF /* ForumItemDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ForumItemDetailViewController.h; sourceTree = "<group>"; };
2981111C1DFEA98D00F7EAFF /* ForumItemDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ForumItemDetailViewController.m; sourceTree = "<group>"; };
2981111E1DFEB33D00F7EAFF /* ForumItemDetailTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ForumItemDetailTableViewCell.h; sourceTree = "<group>"; };
2981111F1DFEB33D00F7EAFF /* ForumItemDetailTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ForumItemDetailTableViewCell.m; sourceTree = "<group>"; };
298111241DFEB95A00F7EAFF /* CommentListTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommentListTableViewCell.h; sourceTree = "<group>"; };
298111251DFEB95A00F7EAFF /* CommentListTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommentListTableViewCell.m; sourceTree = "<group>"; };
29834EB21CDF1EAA001A484F /* screeningSecondView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = screeningSecondView.h; sourceTree = "<group>"; };
......@@ -1813,8 +1810,6 @@
29B78C0E1DFA8B3700C7C6D8 /* ContentTableViewCell.m */,
29B78C161DFA982000C7C6D8 /* PhotoManagerCollectionViewCell.h */,
29B78C171DFA982000C7C6D8 /* PhotoManagerCollectionViewCell.m */,
2981111E1DFEB33D00F7EAFF /* ForumItemDetailTableViewCell.h */,
2981111F1DFEB33D00F7EAFF /* ForumItemDetailTableViewCell.m */,
298111241DFEB95A00F7EAFF /* CommentListTableViewCell.h */,
298111251DFEB95A00F7EAFF /* CommentListTableViewCell.m */,
);
......@@ -2658,7 +2653,6 @@
29F726041CE1E96E0072FE0E /* ScreeningSecondCollectionReusableView.m in Sources */,
2985AEA11CE72F1500704C91 /* NSArray+ ZXPUnicode.m in Sources */,
29C30BE71DDC3B4D00CA3E29 /* OnlineLearningTableViewCell.m in Sources */,
298111201DFEB33D00F7EAFF /* ForumItemDetailTableViewCell.m in Sources */,
296287A81DF7E4300056FDC1 /* AnswerViewController.m in Sources */,
29EC331F1CE02AFA005F0C13 /* PopoverViewController.m in Sources */,
2912DFE21E012FE80095C576 /* PostPhotoManagerViewController.m in Sources */,
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -808,7 +808,7 @@
<autoresizingMask key="autoresizingMask"/>
<subviews>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="折扣金额" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="iOu-WG-fyV">
<frame key="frameInset" minX="10.5" minY="12" height="21" maxX="-1201.5"/>
<frame key="frameInset" minX="9.5" minY="12" height="21" maxX="-1362.5"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.0" green="0.0" blue="0.0" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
......@@ -912,7 +912,7 @@
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<subviews>
<collectionView clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="scaleToFill" dataMode="prototypes" id="qOs-Li-Zuf">
<frame key="frameInset" minY="64"/>
<frame key="frameInset" minY="63" maxX="1" maxY="0.5"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" red="0.94509803921568625" green="0.94509803921568625" blue="0.94509803921568625" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
<collectionViewFlowLayout key="collectionViewLayout" minimumLineSpacing="0.0" minimumInteritemSpacing="0.0" id="Cdi-Mw-Bpg">
......@@ -2359,7 +2359,7 @@
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="CIr-H0-jGO">
<frame key="frameInset" minX="12.28%" minY="62.04%" width="13.87%" height="21.5"/>
<frame key="frameInset" minX="12.28%" minY="61.31%" width="13.87%" height="21.5"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<color key="textColor" red="0.98039215686274506" green="0.32156862745098036" blue="0.050980392156862744" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
......@@ -2371,7 +2371,7 @@
<color key="backgroundColor" red="0.87058823529999996" green="0.87058823529999996" blue="0.87058823529999996" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="GB6-Be-cTJ">
<frame key="frameInset" minX="59.57%" minY="62.04%" width="13.87%" height="21.5"/>
<frame key="frameInset" minX="59.57%" minY="61.31%" width="13.87%" height="21.5"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
......@@ -2403,13 +2403,13 @@
<color key="backgroundColor" red="0.87058823529999996" green="0.87058823529999996" blue="0.87058823529999996" alpha="1" colorSpace="custom" customColorSpace="sRGB"/>
</view>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="ix4-ZS-Oz4">
<frame key="frameInset" minX="43.91%" minY="62.04%" width="13.87%" height="21.5"/>
<frame key="frameInset" minX="43.91%" minY="61.31%" width="13.87%" height="21.5"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
</label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" id="jeQ-n1-pxh">
<frame key="frameInset" minX="27.89%" minY="62.04%" width="13.92%" height="21.5"/>
<frame key="frameInset" minX="27.89%" minY="61.31%" width="13.92%" height="21.5"/>
<autoresizingMask key="autoresizingMask" flexibleMinX="YES" widthSizable="YES" flexibleMaxX="YES" flexibleMinY="YES" flexibleMaxY="YES"/>
<fontDescription key="fontDescription" type="system" pointSize="17"/>
<nil key="highlightedColor"/>
......
......@@ -59,9 +59,9 @@ DEPENDENCIES:
- IQKeyboardManager (~> 4.0.7)
- JSONModel (~> 1.2.0)
- Masonry
- MBProgressHUD (~> 0.9.1)
- MBProgressHUD (~> 0.9.2)
- MJRefresh (~> 3.1.12)
- MMDrawerController
- MMDrawerController (~> 0.6.0)
- MWPhotoBrowser (~> 2.1.2)
- PNChart (~> 0.8.9)
- SDWebImage
......@@ -90,6 +90,6 @@ SPEC CHECKSUMS:
UMengSocial: 48b67179c492a8cf7803fbb0438b8f55432e2fc1
WYPopoverController: a9db25ac2841a686acdc0f3a99bdb21545db32f4
PODFILE CHECKSUM: d37b2751113a2605d8ce8f251877d232eb4e4cbf
PODFILE CHECKSUM: 3a86e5249094d5c7fde794d372fbc6312672daab
COCOAPODS: 1.1.1
......@@ -59,9 +59,9 @@ DEPENDENCIES:
- IQKeyboardManager (~> 4.0.7)
- JSONModel (~> 1.2.0)
- Masonry
- MBProgressHUD (~> 0.9.1)
- MBProgressHUD (~> 0.9.2)
- MJRefresh (~> 3.1.12)
- MMDrawerController
- MMDrawerController (~> 0.6.0)
- MWPhotoBrowser (~> 2.1.2)
- PNChart (~> 0.8.9)
- SDWebImage
......@@ -90,6 +90,6 @@ SPEC CHECKSUMS:
UMengSocial: 48b67179c492a8cf7803fbb0438b8f55432e2fc1
WYPopoverController: a9db25ac2841a686acdc0f3a99bdb21545db32f4
PODFILE CHECKSUM: d37b2751113a2605d8ce8f251877d232eb4e4cbf
PODFILE CHECKSUM: 3a86e5249094d5c7fde794d372fbc6312672daab
COCOAPODS: 1.1.1
......@@ -130,6 +130,14 @@
- (void)promptBoxWithMessage:(NSString *)message cancelBlock:(void(^)())cancel sureBlock:(void(^)())sure;
/**
闯关结果状态
@param passResult 闯关结果
@return 状态图片
*/
- (UIImage *)emigratedState:(NSInteger)passResult;
@end
......@@ -503,6 +503,32 @@
}
/**
闯关结果状态
@param passResult 闯关结果
@return 状态图片
*/
- (UIImage *)emigratedState:(NSInteger)passResult
{
switch (passResult) {
case 0:
return TCImage(@"failure");
break;
case 1:
return TCImage(@"success");
break;
case 2:
return TCImage(@"submited");
break;
default:
break;
}
return nil;
}
- (void)dealloc
{
NSLog(@"释放%@控制器",self);
......
......@@ -19,7 +19,7 @@
hud.animationType = MBProgressHUDAnimationZoom;
hud.mode = MBProgressHUDModeIndeterminate;
hud.color = [UIColor clearColor];
hud.activityIndicatorColor = [UIColor redColor];
hud.activityIndicatorColor = kMainBlueColor;
hud.removeFromSuperViewOnHide = YES;
}
......
......@@ -1775,6 +1775,8 @@ extern NSString * const GRADEMETHOD_MANUL;
*
*/
@property (nonatomic, copy) NSString *attachmentId;
@property (nonatomic, assign) NSInteger topicCount;
/**
* 附件
*
......@@ -5065,6 +5067,8 @@ extern NSString * const GRADEMETHOD_MANUL;
*
*/
@property (nonatomic, copy) NSString *replyTime;
@property (nonatomic,copy) NSString *replyerPicture;
/**
* 方法: 取得回复内容
*
......
......@@ -5,9 +5,9 @@ target 'Lighting' do
pod 'WYPopoverController', '~> 0.3.9'
pod 'FDFullscreenPopGesture'
pod 'MBProgressHUD', '~> 0.9.1'
pod 'MBProgressHUD', '~> 0.9.2'
pod 'IQKeyboardManager', '~> 4.0.7'
pod 'MMDrawerController'
pod 'MMDrawerController', '~> 0.6.0'
pod 'Masonry'
pod 'MJRefresh', '~> 3.1.12'
pod 'SDWebImage'
......
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