Commit 7c37e110 authored by admin's avatar admin

排序 筛选接口完成

parent c0e7f861
No preview for this file type
{
"images" : [
{
"orientation" : "portrait",
"idiom" : "ipad",
"minimum-system-version" : "7.0",
"extent" : "full-screen",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"minimum-system-version" : "7.0",
"extent" : "full-screen",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"minimum-system-version" : "7.0",
"extent" : "full-screen",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"minimum-system-version" : "7.0",
"subtype" : "retina4",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"minimum-system-version" : "7.0",
"extent" : "full-screen",
"scale" : "1x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "filter_after@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "filter_after@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
redstar/Assets.xcassets/Inspect/filter_after.imageset/filter_after@2x.png

1.5 KB

redstar/Assets.xcassets/Inspect/filter_after.imageset/filter_after@3x.png

1.74 KB

{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "iconfont-duigou@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "iconfont-duigou@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "sort_icon_after@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "sort_icon_after@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "736h",
"filename" : "launch_bg_6plus-2.png",
"minimum-system-version" : "8.0",
"orientation" : "portrait",
"scale" : "3x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "736h",
"filename" : "launch_bg_6plus-3.png",
"minimum-system-version" : "8.0",
"orientation" : "landscape",
"scale" : "3x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "667h",
"filename" : "launch_bg_6-1.png",
"minimum-system-version" : "8.0",
"orientation" : "portrait",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"filename" : "launch_bg_4.png",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"extent" : "full-screen",
"idiom" : "iphone",
"subtype" : "retina4",
"filename" : "launch_bg_6plus-1.png",
"minimum-system-version" : "7.0",
"orientation" : "portrait",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"minimum-system-version" : "7.0",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"extent" : "full-screen",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"filename" : "launch_bg_6.png",
"extent" : "full-screen",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "iphone",
"filename" : "launch_bg_6plus.png",
"extent" : "full-screen",
"subtype" : "retina4",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "to-status-bar",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "to-status-bar",
"scale" : "1x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"scale" : "1x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "to-status-bar",
"scale" : "2x"
},
{
"orientation" : "portrait",
"idiom" : "ipad",
"extent" : "full-screen",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "to-status-bar",
"scale" : "2x"
},
{
"orientation" : "landscape",
"idiom" : "ipad",
"extent" : "full-screen",
"scale" : "2x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -31,4 +31,7 @@
// http://.../redstar-server/rest/question/submit?time={time}&operId={operId}&operName={operName}
#define kAddQuestionURL @""
// 提交评论
#define kAddCommentURL @"redstar-server/rest/comment"
#endif /* Url_h */
......@@ -20,5 +20,6 @@
@property (nonatomic, strong) UIButton *sureBtn;
@property (nonatomic, strong) StarBar *starBar;
@property (nonatomic, strong) UITextView *contentTextView;
@end
......@@ -13,7 +13,6 @@
@interface CommentView ()
@property (nonatomic, strong) UILabel *placeholderLabel2;
@property (nonatomic, strong) UIImageView *backImageView2;
@property (nonatomic, strong) UITextView *contentTextView;
@end
......
......@@ -13,6 +13,7 @@
#import "QuestionDetailFooterView.h"
#import "CommentView.h"
#import "HttpClient.h"
#define kQuestionDetailCell @"QuestionDetailCell" // 问题详情
#define kQuestionCommentCell @"QuestionCommentCell" // 评论
......@@ -95,6 +96,8 @@
_commentView = [[CommentView alloc] init];
_commentView.backgroundColor = [UIColor whiteColor];
}
_commentView.starBar.starNumber = 0;
_commentView.contentTextView.text = @"";
[_commentView.quitBtn addTarget:self action:@selector(closeBackGroundView) forControlEvents:UIControlEventTouchUpInside];
[_commentView.sureBtn addTarget:self action:@selector(submitComment:) forControlEvents:UIControlEventTouchUpInside];
[self.view insertSubview:_backGroundView aboveSubview:_tableView];
......@@ -116,6 +119,20 @@
- (void)submitComment:(UIButton *)sender
{
NSNumber *count = [NSNumber numberWithInteger:_commentView.starBar.starNumber];
NSString *url = [NSString stringWithFormat:@"%@%@", kRedStarURL, kAddCommentURL];
NSLog(@"url = %@", url);
HttpClient *httpClient = [[HttpClient alloc] initWithUrl:url];
NSDictionary *parameters = @{@"entityType":@"question",
@"entityUuid":_question.uuid,
@"star":count,
@"comment":_commentView.contentTextView.text};
NSLog(@"parameters = %@", parameters);
[httpClient submitCommentWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"respo = %@, error = %@", response , error);
}];
[self closeBackGroundView];
}
......
......@@ -48,8 +48,16 @@
self.alreadyLabel.text = [NSString stringWithFormat:@"%d", taskList.reportCount];
self.allLabel.text = [NSString stringWithFormat:@"/%d", taskList.questionCount];
self.multiplier = (CGFloat)taskList.reportCount / taskList.questionCount;
self.allView.backgroundColor = kProgressViewAllBackColor;
if (taskList.reportCount == 0) {
self.multiplier = 0;
} else {
self.multiplier = (CGFloat)taskList.reportCount / taskList.questionCount;
}
UIImage *image = [UIImage imageNamed:@"progress-bar"];
image = [image resizableImageWithCapInsets:UIEdgeInsetsZero resizingMode:UIImageResizingModeTile];
self.alreadyView.image = image;
......@@ -280,6 +288,7 @@
_alreadyView.layer.cornerRadius = 3;
_alreadyView.layer.masksToBounds = YES;
_alreadyView.translatesAutoresizingMaskIntoConstraints = NO;
_alreadyView.tag = 9760001;
[self.allView addSubview:_alreadyView];
NSLayoutConstraint *overDateTop = [NSLayoutConstraint constraintWithItem:_alreadyView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.allView attribute:NSLayoutAttributeTop multiplier:1.0 constant:1];
......
......@@ -34,5 +34,7 @@ typedef void (^completionBlock) (id response, NSError *error);
// 获取口碑巡检明细
- (void)getPraiseDetailWithParameters:(id)parameters completion:(completionBlock)completion;
// 提交评论
- (void)submitCommentWithParameters:(id)parameters completion:(completionBlock)completion;
@end
......@@ -90,9 +90,6 @@
// password
NSString *passwordMD5 = [CommonFunc md5:password];
// 参数
// NSDictionary *dataDict = [[NSUserDefaults standardUserDefaults] objectForKey:@"loginData"];
// NSString *authenticode = dataDict[@"authenticode"];
NSDictionary *parameters = @{@"authenticode":@"211534962",
@"password":passwordMD5
};
......@@ -148,4 +145,13 @@
}];
}
- (void)submitCommentWithParameters:(id)parameters completion:(completionBlock)completion
{
[self getParameters:parameters completion:^(id response, NSError *error) {
if (completion) {
completion (response, error);
}
}];
}
@end
......@@ -51,7 +51,6 @@
- (void)showIndex:(NSInteger) index
{
NSLog(@"self.buttons = %@", self.buttons);
[self touchDownForButton:[self.buttons objectAtIndex:index]];
[self touchUpForButton:[self.buttons objectAtIndex:index]];
}
......
......@@ -11,7 +11,7 @@
@protocol ScreenTableDelegate <NSObject>
- (void)click;
- (void)tableViewDidSelectRow:(NSInteger)row;
@end
......
......@@ -42,7 +42,7 @@
- (void)setup
{
self.testArray = [NSArray arrayWithObjects:@"全部",@"未提交",@"已提交",@"调研中",@"已过期", @"未完成", nil];
self.testArray = [NSArray arrayWithObjects:@"全部", @"未处理",@"进行中",@"已上报",@"已评分", @"已发布", @"已过期",nil];
self.groupTabBar = [[GroupTabBar alloc] initWithFrame:CGRectMake(0, 0, 100, 180)];
_groupTabBar.delegate = self;
[self addSubview:_groupTabBar];
......@@ -119,7 +119,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (_delegate) {
[_delegate click];
[_delegate tableViewDidSelectRow:indexPath.row];
}
}
......@@ -166,15 +166,16 @@
_resetBtn = [[UIButton alloc] init];
_resetBtn.backgroundColor = [UIColor grayColor];
_resetBtn.translatesAutoresizingMaskIntoConstraints = NO;
_resetBtn.layer.cornerRadius = 4.0;
[self.backView addSubview:_resetBtn];
NSLayoutConstraint *lineViewTop = [NSLayoutConstraint constraintWithItem:_resetBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.backView attribute:NSLayoutAttributeTop multiplier:1.0 constant:5];
NSLayoutConstraint *lineViewTop = [NSLayoutConstraint constraintWithItem:_resetBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.backView attribute:NSLayoutAttributeTop multiplier:1.0 constant:7.5];
[self.backView addConstraint:lineViewTop];
NSLayoutConstraint *lineViewRight = [NSLayoutConstraint constraintWithItem:_resetBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.backView attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:-20];
[self.backView addConstraint:lineViewRight];
NSLayoutConstraint *lineViewBottom = [NSLayoutConstraint constraintWithItem:_resetBtn attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.backView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-5];
NSLayoutConstraint *lineViewBottom = [NSLayoutConstraint constraintWithItem:_resetBtn attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.backView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-7.5];
[self.backView addConstraint:lineViewBottom];
NSLayoutConstraint *lineViewLeft = [NSLayoutConstraint constraintWithItem:_resetBtn attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.backView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
......@@ -189,15 +190,16 @@
_submitBtn = [[UIButton alloc] init];
_submitBtn.backgroundColor = kNavigationBarColor;
_submitBtn.translatesAutoresizingMaskIntoConstraints = NO;
_submitBtn.layer.cornerRadius = 4.0;
[self.backView addSubview:_submitBtn];
NSLayoutConstraint *lineViewTop = [NSLayoutConstraint constraintWithItem:_submitBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.backView attribute:NSLayoutAttributeTop multiplier:1.0 constant:5];
NSLayoutConstraint *lineViewTop = [NSLayoutConstraint constraintWithItem:_submitBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.backView attribute:NSLayoutAttributeTop multiplier:1.0 constant:7.5];
[self.backView addConstraint:lineViewTop];
NSLayoutConstraint *lineViewRight = [NSLayoutConstraint constraintWithItem:_submitBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.backView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.backView addConstraint:lineViewRight];
NSLayoutConstraint *lineViewBottom = [NSLayoutConstraint constraintWithItem:_submitBtn attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.backView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-5];
NSLayoutConstraint *lineViewBottom = [NSLayoutConstraint constraintWithItem:_submitBtn attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.backView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:-7.5];
[self.backView addConstraint:lineViewBottom];
NSLayoutConstraint *lineViewLeft = [NSLayoutConstraint constraintWithItem:_submitBtn attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.backView attribute:NSLayoutAttributeCenterX multiplier:1.0 constant:20];
......
......@@ -7,6 +7,14 @@
//
#import <UIKit/UIKit.h>
#define kTAxisBtnTag 500232
@protocol TaxisViewDelegate <NSObject>
- (void)timeChange:(UIButton *)sender;
@end
@interface TaxisView : UIView
......@@ -14,4 +22,6 @@
@property (nonatomic, strong) UIButton *sequenceBtn; // 顺序
@property (nonatomic, strong) UIButton *changeoverBtn; // 逆序
@property (nonatomic, strong) id <TaxisViewDelegate> delegate;
@end
......@@ -32,7 +32,6 @@
{
[self.defaultBtn setTitle:@"默认排序" forState:UIControlStateNormal];
[self.sequenceBtn setTitle:@"时间顺序排序" forState:UIControlStateNormal];
[self.changeoverBtn setTitle:@"时间逆序排序" forState:UIControlStateNormal];
}
......@@ -49,6 +48,9 @@
[_defaultBtn setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal];
_defaultBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft ;
_defaultBtn.titleLabel.font = [UIFont systemFontOfSize:14.0];
[_defaultBtn addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
_defaultBtn.tag = kTAxisBtnTag + 1;
[self addSubview:_defaultBtn];
// 顶端
......@@ -81,7 +83,14 @@
[_sequenceBtn setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal];
_sequenceBtn.titleLabel.font = [UIFont systemFontOfSize:14.0];
_sequenceBtn.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft ;
_sequenceBtn.imageEdgeInsets = UIEdgeInsetsMake(0, kScreenWidth - 30, 0, 0);
_sequenceBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 20, 0, 0);
_sequenceBtn.imageView.contentMode = UIViewContentModeRight;
_sequenceBtn.titleLabel.contentMode = UIViewContentModeLeft;
[_sequenceBtn addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
_sequenceBtn.tag = kTAxisBtnTag + 2;
[self addSubview:_sequenceBtn];
// 顶端
......@@ -114,6 +123,12 @@
_changeoverBtn.translatesAutoresizingMaskIntoConstraints = NO;
[_changeoverBtn setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal];
_changeoverBtn.titleLabel.font = [UIFont systemFontOfSize:14.0];
_changeoverBtn.imageEdgeInsets = UIEdgeInsetsMake(0, kScreenWidth - 30, 0, 0);
_changeoverBtn.titleEdgeInsets = UIEdgeInsetsMake(0, 20, 0, 0);
[_changeoverBtn addTarget:self action:@selector(click:) forControlEvents:UIControlEventTouchUpInside];
_changeoverBtn.tag = kTAxisBtnTag + 3;
[self addSubview:_changeoverBtn];
// 顶端
......@@ -135,4 +150,11 @@
return _changeoverBtn;
}
- (void)click:(UIButton *)sender
{
if (_delegate) {
[_delegate timeChange:sender];
}
}
@end
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