Commit 4cdb86ad authored by admin's avatar admin

添加了httpcilent

parent e190d8e9
...@@ -13,9 +13,12 @@ ...@@ -13,9 +13,12 @@
840826211BE5D2400022B795 /* OnLineFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 840826201BE5D2400022B795 /* OnLineFooterView.m */; }; 840826211BE5D2400022B795 /* OnLineFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 840826201BE5D2400022B795 /* OnLineFooterView.m */; };
840ABECC1BE1C29F006E49C5 /* RankDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 840ABECB1BE1C29F006E49C5 /* RankDetailViewController.m */; }; 840ABECC1BE1C29F006E49C5 /* RankDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 840ABECB1BE1C29F006E49C5 /* RankDetailViewController.m */; };
840ABECF1BE20A53006E49C5 /* RankShopDetialCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 840ABECE1BE20A53006E49C5 /* RankShopDetialCell.m */; }; 840ABECF1BE20A53006E49C5 /* RankShopDetialCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 840ABECE1BE20A53006E49C5 /* RankShopDetialCell.m */; };
8419EAD01BEDAC0A002635ED /* TaxisViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 8419EACF1BEDAC0A002635ED /* TaxisViewController.m */; };
8419EAD41BEDC98F002635ED /* HttpClient.m in Sources */ = {isa = PBXBuildFile; fileRef = 8419EAD31BEDC98F002635ED /* HttpClient.m */; };
841BBCDE1BE49E18007A21BF /* RankWorkDetailCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 841BBCDD1BE49E18007A21BF /* RankWorkDetailCell.m */; }; 841BBCDE1BE49E18007A21BF /* RankWorkDetailCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 841BBCDD1BE49E18007A21BF /* RankWorkDetailCell.m */; };
841D24F81BEB473C0005CC9F /* CheckPicViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 841D24F71BEB473C0005CC9F /* CheckPicViewController.m */; }; 841D24F81BEB473C0005CC9F /* CheckPicViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 841D24F71BEB473C0005CC9F /* CheckPicViewController.m */; };
841D24FB1BEB75CA0005CC9F /* QuestionDetailFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 841D24FA1BEB75CA0005CC9F /* QuestionDetailFooterView.m */; }; 841D24FB1BEB75CA0005CC9F /* QuestionDetailFooterView.m in Sources */ = {isa = PBXBuildFile; fileRef = 841D24FA1BEB75CA0005CC9F /* QuestionDetailFooterView.m */; };
842547FC1BF03977006C79C5 /* QuestionModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 842547FB1BF03977006C79C5 /* QuestionModel.m */; };
8442BA5C1BDB8FDB005E5657 /* MineTableHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8442BA5B1BDB8FDB005E5657 /* MineTableHeaderView.m */; }; 8442BA5C1BDB8FDB005E5657 /* MineTableHeaderView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8442BA5B1BDB8FDB005E5657 /* MineTableHeaderView.m */; };
8474A01C1BE368D700315F30 /* HomeCellItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 8474A01B1BE368D700315F30 /* HomeCellItem.m */; }; 8474A01C1BE368D700315F30 /* HomeCellItem.m in Sources */ = {isa = PBXBuildFile; fileRef = 8474A01B1BE368D700315F30 /* HomeCellItem.m */; };
8474C5831BE751A2007DCF19 /* CommonFunc.m in Sources */ = {isa = PBXBuildFile; fileRef = 8474C5821BE751A2007DCF19 /* CommonFunc.m */; }; 8474C5831BE751A2007DCF19 /* CommonFunc.m in Sources */ = {isa = PBXBuildFile; fileRef = 8474C5821BE751A2007DCF19 /* CommonFunc.m */; };
...@@ -99,12 +102,18 @@ ...@@ -99,12 +102,18 @@
840ABECB1BE1C29F006E49C5 /* RankDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankDetailViewController.m; sourceTree = "<group>"; }; 840ABECB1BE1C29F006E49C5 /* RankDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankDetailViewController.m; sourceTree = "<group>"; };
840ABECD1BE20A53006E49C5 /* RankShopDetialCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RankShopDetialCell.h; sourceTree = "<group>"; }; 840ABECD1BE20A53006E49C5 /* RankShopDetialCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RankShopDetialCell.h; sourceTree = "<group>"; };
840ABECE1BE20A53006E49C5 /* RankShopDetialCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankShopDetialCell.m; sourceTree = "<group>"; }; 840ABECE1BE20A53006E49C5 /* RankShopDetialCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankShopDetialCell.m; sourceTree = "<group>"; };
8419EACE1BEDAC0A002635ED /* TaxisViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TaxisViewController.h; sourceTree = "<group>"; };
8419EACF1BEDAC0A002635ED /* TaxisViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TaxisViewController.m; sourceTree = "<group>"; };
8419EAD21BEDC98F002635ED /* HttpClient.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HttpClient.h; sourceTree = "<group>"; };
8419EAD31BEDC98F002635ED /* HttpClient.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HttpClient.m; sourceTree = "<group>"; };
841BBCDC1BE49E18007A21BF /* RankWorkDetailCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RankWorkDetailCell.h; sourceTree = "<group>"; }; 841BBCDC1BE49E18007A21BF /* RankWorkDetailCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RankWorkDetailCell.h; sourceTree = "<group>"; };
841BBCDD1BE49E18007A21BF /* RankWorkDetailCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankWorkDetailCell.m; sourceTree = "<group>"; }; 841BBCDD1BE49E18007A21BF /* RankWorkDetailCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = RankWorkDetailCell.m; sourceTree = "<group>"; };
841D24F61BEB473C0005CC9F /* CheckPicViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CheckPicViewController.h; sourceTree = "<group>"; }; 841D24F61BEB473C0005CC9F /* CheckPicViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CheckPicViewController.h; sourceTree = "<group>"; };
841D24F71BEB473C0005CC9F /* CheckPicViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CheckPicViewController.m; sourceTree = "<group>"; }; 841D24F71BEB473C0005CC9F /* CheckPicViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CheckPicViewController.m; sourceTree = "<group>"; };
841D24F91BEB75CA0005CC9F /* QuestionDetailFooterView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QuestionDetailFooterView.h; sourceTree = "<group>"; }; 841D24F91BEB75CA0005CC9F /* QuestionDetailFooterView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QuestionDetailFooterView.h; sourceTree = "<group>"; };
841D24FA1BEB75CA0005CC9F /* QuestionDetailFooterView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QuestionDetailFooterView.m; sourceTree = "<group>"; }; 841D24FA1BEB75CA0005CC9F /* QuestionDetailFooterView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QuestionDetailFooterView.m; sourceTree = "<group>"; };
842547FA1BF03977006C79C5 /* QuestionModel.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = QuestionModel.h; sourceTree = "<group>"; };
842547FB1BF03977006C79C5 /* QuestionModel.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = QuestionModel.m; sourceTree = "<group>"; };
8442BA5A1BDB8FDB005E5657 /* MineTableHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MineTableHeaderView.h; sourceTree = "<group>"; }; 8442BA5A1BDB8FDB005E5657 /* MineTableHeaderView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MineTableHeaderView.h; sourceTree = "<group>"; };
8442BA5B1BDB8FDB005E5657 /* MineTableHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MineTableHeaderView.m; sourceTree = "<group>"; }; 8442BA5B1BDB8FDB005E5657 /* MineTableHeaderView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MineTableHeaderView.m; sourceTree = "<group>"; };
8474A01A1BE368D700315F30 /* HomeCellItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeCellItem.h; sourceTree = "<group>"; }; 8474A01A1BE368D700315F30 /* HomeCellItem.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = HomeCellItem.h; sourceTree = "<group>"; };
...@@ -255,6 +264,72 @@ ...@@ -255,6 +264,72 @@
path = Cell; path = Cell;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
8419EABB1BEDA8F9002635ED /* Menu */ = {
isa = PBXGroup;
children = (
8419EAC81BEDABF0002635ED /* Screen */,
8419EACB1BEDABF0002635ED /* Taxis */,
);
path = Menu;
sourceTree = "<group>";
};
8419EAC81BEDABF0002635ED /* Screen */ = {
isa = PBXGroup;
children = (
8419EAC91BEDABF0002635ED /* View */,
8419EACA1BEDABF0002635ED /* ViewController */,
);
path = Screen;
sourceTree = "<group>";
};
8419EAC91BEDABF0002635ED /* View */ = {
isa = PBXGroup;
children = (
);
path = View;
sourceTree = "<group>";
};
8419EACA1BEDABF0002635ED /* ViewController */ = {
isa = PBXGroup;
children = (
);
path = ViewController;
sourceTree = "<group>";
};
8419EACB1BEDABF0002635ED /* Taxis */ = {
isa = PBXGroup;
children = (
8419EACC1BEDABF0002635ED /* View */,
8419EACD1BEDABF0002635ED /* ViewController */,
);
path = Taxis;
sourceTree = "<group>";
};
8419EACC1BEDABF0002635ED /* View */ = {
isa = PBXGroup;
children = (
);
path = View;
sourceTree = "<group>";
};
8419EACD1BEDABF0002635ED /* ViewController */ = {
isa = PBXGroup;
children = (
8419EACE1BEDAC0A002635ED /* TaxisViewController.h */,
8419EACF1BEDAC0A002635ED /* TaxisViewController.m */,
);
path = ViewController;
sourceTree = "<group>";
};
8419EAD11BEDC976002635ED /* HttpClient */ = {
isa = PBXGroup;
children = (
8419EAD21BEDC98F002635ED /* HttpClient.h */,
8419EAD31BEDC98F002635ED /* HttpClient.m */,
);
path = HttpClient;
sourceTree = "<group>";
};
841D24F51BEB473B0005CC9F /* Check */ = { 841D24F51BEB473B0005CC9F /* Check */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -264,6 +339,15 @@ ...@@ -264,6 +339,15 @@
path = Check; path = Check;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
842547F91BF03962006C79C5 /* Model */ = {
isa = PBXGroup;
children = (
842547FA1BF03977006C79C5 /* QuestionModel.h */,
842547FB1BF03977006C79C5 /* QuestionModel.m */,
);
path = Model;
sourceTree = "<group>";
};
8426A4A01BDF0CD600E5FDF5 /* Function */ = { 8426A4A01BDF0CD600E5FDF5 /* Function */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -437,6 +521,7 @@ ...@@ -437,6 +521,7 @@
8474C5891BE78A85007DCF19 /* QuestionList */ = { 8474C5891BE78A85007DCF19 /* QuestionList */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
842547F91BF03962006C79C5 /* Model */,
8474C58A1BE78A85007DCF19 /* Cell */, 8474C58A1BE78A85007DCF19 /* Cell */,
8474C58D1BE78A85007DCF19 /* View */, 8474C58D1BE78A85007DCF19 /* View */,
8474C58E1BE78A85007DCF19 /* ViewController */, 8474C58E1BE78A85007DCF19 /* ViewController */,
...@@ -717,6 +802,8 @@ ...@@ -717,6 +802,8 @@
84970E261BD8DEFE00C1728A /* Tools */ = { 84970E261BD8DEFE00C1728A /* Tools */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
8419EAD11BEDC976002635ED /* HttpClient */,
8419EABB1BEDA8F9002635ED /* Menu */,
84F57C991BECA72C00DDEEB1 /* StarBar */, 84F57C991BECA72C00DDEEB1 /* StarBar */,
8474C5801BE751A2007DCF19 /* CommonFunc */, 8474C5801BE751A2007DCF19 /* CommonFunc */,
84F166981BE715D20061D350 /* ZanButton */, 84F166981BE715D20061D350 /* ZanButton */,
...@@ -1271,7 +1358,10 @@ ...@@ -1271,7 +1358,10 @@
8442BA5C1BDB8FDB005E5657 /* MineTableHeaderView.m in Sources */, 8442BA5C1BDB8FDB005E5657 /* MineTableHeaderView.m in Sources */,
8474C5991BE78BBC007DCF19 /* QuestionDetailCell.m in Sources */, 8474C5991BE78BBC007DCF19 /* QuestionDetailCell.m in Sources */,
8474C5911BE78A85007DCF19 /* QuestionListTableCell.m in Sources */, 8474C5911BE78A85007DCF19 /* QuestionListTableCell.m in Sources */,
8419EAD01BEDAC0A002635ED /* TaxisViewController.m in Sources */,
84F1669B1BE715E40061D350 /* ZanButton.m in Sources */, 84F1669B1BE715E40061D350 /* ZanButton.m in Sources */,
8419EAD41BEDC98F002635ED /* HttpClient.m in Sources */,
842547FC1BF03977006C79C5 /* QuestionModel.m in Sources */,
84E420441BE84A2300689976 /* QuestionCommentCell.m in Sources */, 84E420441BE84A2300689976 /* QuestionCommentCell.m in Sources */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
......
...@@ -18,4 +18,7 @@ ...@@ -18,4 +18,7 @@
// QuestionList // QuestionList
#define kQuestionListURL @"redstar-server/rest/question/query" #define kQuestionListURL @"redstar-server/rest/question/query"
// InspectList
#define kInspectListURL @"redstar-server/rest/praise/query"
#endif /* Url_h */ #endif /* Url_h */
...@@ -7,11 +7,15 @@ ...@@ -7,11 +7,15 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "QuestionModel.h"
@interface QuestionCommentCell : UITableViewCell @interface QuestionCommentCell : UITableViewCell
@property (nonatomic, strong) UILabel *suggestLabel; // 评论 @property (nonatomic, strong) UILabel *suggestLabel; // 评论
@property (nonatomic, strong) UILabel *peopleLabel; // 评论人 @property (nonatomic, strong) UILabel *peopleLabel; // 评论人
@property (nonatomic, strong) UILabel *positionLabel; // 职位 @property (nonatomic, strong) UILabel *positionLabel; // 职位
@property (nonatomic, strong) UILabel *dateLabel; // 职位 @property (nonatomic, strong) UILabel *dateLabel; // 时间
@property (nonatomic, strong) QuestionModel *question;
@end @end
...@@ -7,6 +7,7 @@ ...@@ -7,6 +7,7 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "QuestionModel.h"
@interface QuestionDescribeCell : UITableViewCell @interface QuestionDescribeCell : UITableViewCell
@property (nonatomic, strong) UILabel *titleLabel; // 标题 @property (nonatomic, strong) UILabel *titleLabel; // 标题
...@@ -21,4 +22,6 @@ ...@@ -21,4 +22,6 @@
@property (nonatomic, strong) UILabel *peopleLabel; // 解决人 @property (nonatomic, strong) UILabel *peopleLabel; // 解决人
@property (nonatomic, strong) UILabel *dateLabel; // 时间 @property (nonatomic, strong) UILabel *dateLabel; // 时间
@property (nonatomic, strong) QuestionModel *question;
@end @end
...@@ -24,16 +24,6 @@ ...@@ -24,16 +24,6 @@
self.titleLabel.textColor = kDetailCellDescribeTextColor; self.titleLabel.textColor = kDetailCellDescribeTextColor;
_titleLabel.text = @"问题与建议描述"; _titleLabel.text = @"问题与建议描述";
self.describeLabel.textColor = kdetailCellTitleColor;
_describeLabel.text = @"系统跟单维护在订单当天发出回访短信,此时商品可能尚未送达到用户,引起消费者的疑问和不解,进而引起客户的不满和投诉,建议集团把短信回访延后1-2天,也避免由此引起的客户抱怨。";
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:_describeLabel.text];
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.alignment = NSTextAlignmentLeft;
paragraphStyle.lineSpacing = 6; //行自定义行高度
[attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [_describeLabel.text length])];
_describeLabel.attributedText = attributedString;
[self.describeLabel sizeToFit];
self.pictureLabel.textColor = kDetailCellDescribeTextColor; self.pictureLabel.textColor = kDetailCellDescribeTextColor;
_pictureLabel.text = @"照片"; _pictureLabel.text = @"照片";
...@@ -41,7 +31,33 @@ ...@@ -41,7 +31,33 @@
self.feedbackLabel.textColor = kDetailCellDescribeTextColor; self.feedbackLabel.textColor = kDetailCellDescribeTextColor;
self.feedbackBackView.backgroundColor = kQuestionFeedBackColor; self.feedbackBackView.backgroundColor = kQuestionFeedBackColor;
}
- (void)setQuestion:(QuestionModel *)question
{
_question = question;
// 问题与描述
NSString *describeStr = [NSString stringWithFormat:@"%@", question.content];
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:describeStr];
NSMutableParagraphStyle *paragraphStyle1 = [[NSMutableParagraphStyle alloc] init];
paragraphStyle1.alignment = NSTextAlignmentLeft;
paragraphStyle1.lineSpacing = 6; //行自定义行高度
[attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle1 range:NSMakeRange(0, [describeStr length])];
self.describeLabel.attributedText = attributedString;
// 反馈
NSString *answerStr = [NSString stringWithFormat:@"%@", question.feedback];
NSMutableAttributedString *answerAttrStr = [[NSMutableAttributedString alloc] initWithString:answerStr];
NSMutableParagraphStyle *paragraphStyle2 = [[NSMutableParagraphStyle alloc] init];
paragraphStyle2.alignment = NSTextAlignmentLeft;
paragraphStyle2.lineSpacing = 6; //行自定义行高度
[answerAttrStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle2 range:NSMakeRange(0, answerStr.length)];
self.answerLabel.attributedText = answerAttrStr;
// 解决人
self.peopleLabel.text = [NSString stringWithFormat:@"问题解决负责人:%@", question.responsiblePersonName];
self.dateLabel.text = [NSString stringWithFormat:@"反馈时间:%@", question.lastModify_time];
} }
#pragma mark - lazy loading #pragma mark - lazy loading
...@@ -76,9 +92,11 @@ ...@@ -76,9 +92,11 @@
{ {
if (!_describeLabel) { if (!_describeLabel) {
_describeLabel = [[UILabel alloc] init]; _describeLabel = [[UILabel alloc] init];
_describeLabel.textColor = kdetailCellTitleColor;
_describeLabel.font = [UIFont systemFontOfSize:15.0]; _describeLabel.font = [UIFont systemFontOfSize:15.0];
_describeLabel.translatesAutoresizingMaskIntoConstraints = NO; _describeLabel.translatesAutoresizingMaskIntoConstraints = NO;
_describeLabel.numberOfLines = 0; _describeLabel.numberOfLines = 0;
[_describeLabel sizeToFit];
[self.contentView addSubview:_describeLabel]; [self.contentView addSubview:_describeLabel];
// 顶端 // 顶端
...@@ -220,6 +238,7 @@ ...@@ -220,6 +238,7 @@
{ {
if (!_answerLabel) { if (!_answerLabel) {
_answerLabel = [[UILabel alloc] init]; _answerLabel = [[UILabel alloc] init];
[_answerLabel sizeToFit];
_answerLabel.font = [UIFont systemFontOfSize:15.0]; _answerLabel.font = [UIFont systemFontOfSize:15.0];
_answerLabel.translatesAutoresizingMaskIntoConstraints = NO; _answerLabel.translatesAutoresizingMaskIntoConstraints = NO;
_answerLabel.textColor = kQuestionFeedBackTitleColor; _answerLabel.textColor = kQuestionFeedBackTitleColor;
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "ZanButton.h" #import "ZanButton.h"
#import "QuestionModel.h"
@interface QuestionDetailCell : UITableViewCell @interface QuestionDetailCell : UITableViewCell
@property (nonatomic, strong) UILabel *stateLabel; // 状态 @property (nonatomic, strong) UILabel *stateLabel; // 状态
...@@ -16,4 +17,6 @@ ...@@ -16,4 +17,6 @@
@property (nonatomic, strong) UILabel *shopLabel; // 商场 @property (nonatomic, strong) UILabel *shopLabel; // 商场
@property (nonatomic, strong) UILabel *peopleLabel; // 提报人 @property (nonatomic, strong) UILabel *peopleLabel; // 提报人
@property (nonatomic, strong) UILabel *dateLabel; // 提报时间 @property (nonatomic, strong) UILabel *dateLabel; // 提报时间
@property (nonatomic, strong) QuestionModel *question;
@end @end
...@@ -21,33 +21,59 @@ ...@@ -21,33 +21,59 @@
#pragma mark - Private Methods #pragma mark - Private Methods
- (void)setup - (void)setup
{ {
NSString *stateText = [NSString stringWithFormat:@"状态:已解决"];
NSMutableAttributedString *stateAttr = [[NSMutableAttributedString alloc] initWithString:stateText];
[stateAttr addAttributes:@{NSForegroundColorAttributeName:kDetailCellDescribeTextColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(0,3)];
[stateAttr addAttributes:@{NSForegroundColorAttributeName:kNavigationBarColor,NSFontAttributeName:[UIFont boldSystemFontOfSize:15.0f]} range:NSMakeRange(3,stateText.length - 3)];
[self.stateLabel setAttributedText:stateAttr];
[self.thumbBtn setTitle:@"300" forState:UIControlStateNormal];
NSString *sortText = [NSString stringWithFormat:@"分类:送货跟单-送货跟单"];
}
- (void)setQuestion:(QuestionModel *)question
{
_question = question;
// 状态
if ([question.state isEqualToString:@"resolved"]) {
NSString *stateText = [NSString stringWithFormat:@"状态:已解决"];
NSMutableAttributedString *stateAttr = [[NSMutableAttributedString alloc] initWithString:stateText];
[stateAttr addAttributes:@{NSForegroundColorAttributeName:kDetailCellDescribeTextColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(0,3)];
[stateAttr addAttributes:@{NSForegroundColorAttributeName:kNavigationBarColor,NSFontAttributeName:[UIFont boldSystemFontOfSize:15.0f]} range:NSMakeRange(3,stateText.length - 3)];
[self.stateLabel setAttributedText:stateAttr];
} else {
NSString *stateText = [NSString stringWithFormat:@"状态:已创建"];
NSMutableAttributedString *stateAttr = [[NSMutableAttributedString alloc] initWithString:stateText];
[stateAttr addAttributes:@{NSForegroundColorAttributeName:kDetailCellDescribeTextColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(0,3)];
[stateAttr addAttributes:@{NSForegroundColorAttributeName:kdetailCellTitleColor,NSFontAttributeName:[UIFont boldSystemFontOfSize:15.0f]} range:NSMakeRange(3,stateText.length - 3)];
[self.stateLabel setAttributedText:stateAttr];
}
// 点赞数
[self.thumbBtn setTitle:@"300" forState:UIControlStateNormal];
// 分类
NSString *sortText = [NSString stringWithFormat:@"分类:%@", question.categoryName];
NSMutableAttributedString *sortAttr = [[NSMutableAttributedString alloc] initWithString:sortText]; NSMutableAttributedString *sortAttr = [[NSMutableAttributedString alloc] initWithString:sortText];
[sortAttr addAttributes:@{NSForegroundColorAttributeName:kDetailCellDescribeTextColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(0,3)]; [sortAttr addAttributes:@{NSForegroundColorAttributeName:kDetailCellDescribeTextColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(0,3)];
[sortAttr addAttributes:@{NSForegroundColorAttributeName:kdetailCellTitleColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(3,sortText.length - 3)]; [sortAttr addAttributes:@{NSForegroundColorAttributeName:kdetailCellTitleColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(3,sortText.length - 3)];
[self.sortLabel setAttributedText:sortAttr]; [self.sortLabel setAttributedText:sortAttr];
NSString *shopText = [NSString stringWithFormat:@"商场:京沪西南-上海区域-上海金桥"]; // 商场
NSString *shopText = [NSString stringWithFormat:@"商场:%@", question.projectPath];
NSMutableAttributedString *shopAttr = [[NSMutableAttributedString alloc] initWithString:shopText]; NSMutableAttributedString *shopAttr = [[NSMutableAttributedString alloc] initWithString:shopText];
[shopAttr addAttributes:@{NSForegroundColorAttributeName:kDetailCellDescribeTextColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(0,3)]; [shopAttr addAttributes:@{NSForegroundColorAttributeName:kDetailCellDescribeTextColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(0,3)];
[shopAttr addAttributes:@{NSForegroundColorAttributeName:kdetailCellTitleColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(3,shopText.length - 3)]; [shopAttr addAttributes:@{NSForegroundColorAttributeName:kdetailCellTitleColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(3,shopText.length - 3)];
[self.shopLabel setAttributedText:shopAttr]; [self.shopLabel setAttributedText:shopAttr];
NSString *peopleText = [NSString stringWithFormat:@"问题提报人:张三"]; // 问题提报人
NSDictionary *submitPersonDict = question.submitPerson;
NSString *peopleText = [NSString stringWithFormat:@"问题提报人:%@", submitPersonDict[@"name"]];
NSMutableAttributedString *peopleAttr = [[NSMutableAttributedString alloc] initWithString:peopleText]; NSMutableAttributedString *peopleAttr = [[NSMutableAttributedString alloc] initWithString:peopleText];
[peopleAttr addAttributes:@{NSForegroundColorAttributeName:kDetailCellDescribeTextColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(0,6)]; [peopleAttr addAttributes:@{NSForegroundColorAttributeName:kDetailCellDescribeTextColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(0,6)];
[peopleAttr addAttributes:@{NSForegroundColorAttributeName:kdetailCellTitleColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(6,peopleText.length - 6)]; [peopleAttr addAttributes:@{NSForegroundColorAttributeName:kdetailCellTitleColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(6,peopleText.length - 6)];
[self.peopleLabel setAttributedText:peopleAttr]; [self.peopleLabel setAttributedText:peopleAttr];
NSString *dateText = [NSString stringWithFormat:@"提报时间:2015-10-29 23:15:30"]; // 提报时间
NSString *dateText = [NSString stringWithFormat:@"提报时间:%@", question.submitTime];
NSMutableAttributedString *dateAttr = [[NSMutableAttributedString alloc] initWithString:dateText]; NSMutableAttributedString *dateAttr = [[NSMutableAttributedString alloc] initWithString:dateText];
[dateAttr addAttributes:@{NSForegroundColorAttributeName:kDetailCellDescribeTextColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(0,5)]; [dateAttr addAttributes:@{NSForegroundColorAttributeName:kDetailCellDescribeTextColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(0,5)];
[dateAttr addAttributes:@{NSForegroundColorAttributeName:kdetailCellTitleColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(5,dateText.length - 5)]; [dateAttr addAttributes:@{NSForegroundColorAttributeName:kdetailCellTitleColor,NSFontAttributeName:[UIFont systemFontOfSize:15.0f]} range:NSMakeRange(5,dateText.length - 5)];
......
...@@ -7,7 +7,10 @@ ...@@ -7,7 +7,10 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "QuestionModel.h"
@interface QuestionDetailViewController : UIViewController @interface QuestionDetailViewController : UIViewController
@property (nonatomic,strong) QuestionModel *question;
@end @end
...@@ -140,6 +140,7 @@ ...@@ -140,6 +140,7 @@
if (!cell) { if (!cell) {
cell = [[QuestionDetailCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kQuestionDetailCell]; cell = [[QuestionDetailCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kQuestionDetailCell];
} }
cell.question = self.question;
return cell; return cell;
} else if (indexPath.section == 1) { } else if (indexPath.section == 1) {
...@@ -147,19 +148,7 @@ ...@@ -147,19 +148,7 @@
if (!cell) { if (!cell) {
cell = [[QuestionDescribeCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kQuestionDescribeCell]; cell = [[QuestionDescribeCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kQuestionDescribeCell];
} }
cell.answerLabel.text = @"新的SOP对营业员跟单的要求,已经修改为送货完成后的2天内,不再是要求当天。"; cell.question = self.question;
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] initWithString:cell.answerLabel.text];
NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
paragraphStyle.alignment = NSTextAlignmentLeft;
paragraphStyle.lineSpacing = 6; //行自定义行高度
[attributedString addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [cell.answerLabel.text length])];
cell.answerLabel.attributedText = attributedString;
[cell.answerLabel sizeToFit];
cell.peopleLabel.text = @"问题解决负责人:杨发布";
cell.dateLabel.text = @"反馈时间:2015-09-11 10:23:15";
return cell; return cell;
} else { } else {
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "ZanButton.h" #import "ZanButton.h"
#import "QuestionModel.h"
@interface QuestionListTableCell : UITableViewCell @interface QuestionListTableCell : UITableViewCell
@property (nonatomic, strong) UILabel *titleLabel; // 标题 @property (nonatomic, strong) UILabel *titleLabel; // 标题
...@@ -18,4 +19,6 @@ ...@@ -18,4 +19,6 @@
@property (nonatomic, strong) ZanButton *thumbBtn; // 点赞 @property (nonatomic, strong) ZanButton *thumbBtn; // 点赞
@property (nonatomic, strong) QuestionModel *question; // 点赞
@end @end
...@@ -23,12 +23,23 @@ ...@@ -23,12 +23,23 @@
{ {
self.titleLabel.textColor = kQuestionCellTitleColor; self.titleLabel.textColor = kQuestionCellTitleColor;
self.hotLabel.font = [UIFont boldSystemFontOfSize:12.0]; self.hotLabel.font = [UIFont boldSystemFontOfSize:12.0];
self.detailsLabel.font = [UIFont systemFontOfSize:15.0];
self.stateLabel.font = [UIFont systemFontOfSize:14.0];
self.dateLabel.font = [UIFont systemFontOfSize:14.0];
self.thumbBtn.titleLabel.font = [UIFont systemFontOfSize:15.0]; self.thumbBtn.titleLabel.font = [UIFont systemFontOfSize:15.0];
} }
- (void)setQuestion:(QuestionModel *)question
{
_question = question;
// 标题
self.titleLabel.text = [NSString stringWithFormat:@"%@",question.content];
// 反馈(副标题)
self.detailsLabel.text = [NSString stringWithFormat:@"%@", question.feedback];
// 服务类型
self.stateLabel.text = [NSString stringWithFormat:@"%@", question.categoryName];
// 提报时间
self.dateLabel.text = [NSString stringWithFormat:@"提报时间:%@", question.submitTime];
}
#pragma mark - lazy laoding #pragma mark - lazy laoding
- (UILabel *)titleLabel - (UILabel *)titleLabel
{ {
...@@ -93,6 +104,7 @@ ...@@ -93,6 +104,7 @@
{ {
if (!_detailsLabel) { if (!_detailsLabel) {
_detailsLabel = [[UILabel alloc] init]; _detailsLabel = [[UILabel alloc] init];
_detailsLabel.font = [UIFont systemFontOfSize:15.0];
_detailsLabel.translatesAutoresizingMaskIntoConstraints = NO; _detailsLabel.translatesAutoresizingMaskIntoConstraints = NO;
_detailsLabel.textColor = kQuestionCellTitleColor; _detailsLabel.textColor = kQuestionCellTitleColor;
[self.contentView addSubview:_detailsLabel]; [self.contentView addSubview:_detailsLabel];
...@@ -122,6 +134,8 @@ ...@@ -122,6 +134,8 @@
_stateLabel = [[UILabel alloc] init]; _stateLabel = [[UILabel alloc] init];
_stateLabel.translatesAutoresizingMaskIntoConstraints = NO; _stateLabel.translatesAutoresizingMaskIntoConstraints = NO;
_stateLabel.textColor = kQuestionStateColor; _stateLabel.textColor = kQuestionStateColor;
_stateLabel.font = [UIFont systemFontOfSize:14.0];
[self.contentView addSubview:_stateLabel]; [self.contentView addSubview:_stateLabel];
// 顶端 // 顶端
...@@ -149,6 +163,7 @@ ...@@ -149,6 +163,7 @@
_dateLabel = [[UILabel alloc] init]; _dateLabel = [[UILabel alloc] init];
_dateLabel.translatesAutoresizingMaskIntoConstraints = NO; _dateLabel.translatesAutoresizingMaskIntoConstraints = NO;
_dateLabel.textColor = kQuestionStateColor; _dateLabel.textColor = kQuestionStateColor;
_dateLabel.font = [UIFont systemFontOfSize:14.0];
[self.contentView addSubview:_dateLabel]; [self.contentView addSubview:_dateLabel];
// 顶端 // 顶端
......
//
// QuestionModel.h
// redstar
//
// Created by admin on 15/11/9.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <Foundation/Foundation.h>
@interface QuestionModel : NSObject
@property (nonatomic, strong) NSString *uuid;//唯一标识
@property (nonatomic, strong) NSString *categoryName;//问题分类名称
@property (nonatomic, strong) NSString *categoryUuid;//问题分类Uuid
@property (nonatomic, strong) NSString *content; //问题内容
@property (nonatomic, strong) NSString *create_id; //
@property (nonatomic, strong) NSString *create_operName; //
@property (nonatomic, strong) NSString *create_time;//
@property (nonatomic, strong) NSString *enterprise;//
@property (nonatomic, strong) NSString *feedback;//问题反馈
@property (nonatomic, strong) NSString *groupName;//专业组名称
@property (nonatomic, strong) NSString *groupUuid;//专业组Uuid
@property (nonatomic, strong) NSString *lastModify_id;//
@property (nonatomic, strong) NSString *lastModify_operName;//
@property (nonatomic, strong) NSString *lastModify_time;//
@property (nonatomic, strong) NSArray *pictureIds;//pictureIds
@property (nonatomic, strong) NSString *projectName;//商场名称
@property (nonatomic, strong) NSString *projectPath;//组织路径
@property (nonatomic, strong) NSString *projectUuid;//商场Uuid
@property (nonatomic, strong) NSDictionary *resolvePerson;//问题解决人Uuid
@property (nonatomic, strong) NSString *responsiblePersonName;//责任人姓名
@property (nonatomic, strong) NSString *responsiblePersonUuid;//责任人Uuid
@property (nonatomic, strong) NSString *state;//问题状态
@property (nonatomic, strong) NSDictionary *submitPerson;//
@property (nonatomic, strong) NSString *submitTime;//
@property (nonatomic, strong) NSString *type;//问题处理分类
@property (nonatomic, strong) NSString *version;//
@end
//
// QuestionModel.m
// redstar
//
// Created by admin on 15/11/9.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "QuestionModel.h"
@implementation QuestionModel
@end
...@@ -10,15 +10,16 @@ ...@@ -10,15 +10,16 @@
#import "QuestionListTableCell.h" #import "QuestionListTableCell.h"
#import "MenuButton.h" #import "MenuButton.h"
#import "QuestionDetailViewController.h" #import "QuestionDetailViewController.h"
#import "AddQuestionViewController.h" #import "AddQuestionViewController.h"
#import "HttpClient.h"
#import <AFNetworking.h> #import "QuestionModel.h"
#define kQuestionListCell @"questionListTableViewCell" #define kQuestionListCell @"questionListTableViewCell"
@interface QuestionViewController () <UITableViewDelegate, UITableViewDataSource> @interface QuestionViewController () <UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) NSMutableArray *allQuestionArray;
@end @end
@implementation QuestionViewController @implementation QuestionViewController
...@@ -27,7 +28,12 @@ ...@@ -27,7 +28,12 @@
{ {
[super viewDidLoad]; [super viewDidLoad];
[self.tableView registerClass:[QuestionListTableCell class] forCellReuseIdentifier:kQuestionListCell]; if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
self.edgesForExtendedLayout = UIRectEdgeNone;
self.extendedLayoutIncludesOpaqueBars = NO;
self.modalPresentationCapturesStatusBarAppearance = NO;
self.navigationController.navigationBar.translucent = NO;
}
[self setupNav]; [self setupNav];
...@@ -42,14 +48,12 @@ ...@@ -42,14 +48,12 @@
#pragma mark - Private Methods #pragma mark - Private Methods
- (void)requestQuestionList - (void)requestQuestionList
{ {
AFHTTPSessionManager *session = [AFHTTPSessionManager manager]; // 初始化数组
session.requestSerializer = [AFJSONRequestSerializer serializer]; self.allQuestionArray = [NSMutableArray array];
[session.requestSerializer setValue:@"application/json;charset=utf-8" forHTTPHeaderField:@"Content-Type"]; // 请求地址
[session.requestSerializer setValue:@"5a74170150b940ae0150b940f7db0082" forHTTPHeaderField:@"enterprise"];
NSString *urlStr = [NSString stringWithFormat:@"%@%@", kRedStarURL, kQuestionListURL]; NSString *urlStr = [NSString stringWithFormat:@"%@%@", kRedStarURL, kQuestionListURL];
NSLog(@"urlStr = %@", urlStr);
// 请求参数
NSDictionary *parameters = @{@"user":@"5a74170150b940ae0150b940f8450083", NSDictionary *parameters = @{@"user":@"5a74170150b940ae0150b940f8450083",
@"scope":@"all", @"scope":@"all",
@"category":@"", @"category":@"",
...@@ -57,12 +61,22 @@ ...@@ -57,12 +61,22 @@
@"state":@"resolved" @"state":@"resolved"
}; };
[session GET:urlStr parameters:parameters success:^(NSURLSessionDataTask *task, id responseObject) { // 发起请求
NSLog(@"response = %@", responseObject); HttpClient *httpClient = [[HttpClient alloc] initWithUrl:urlStr];
} failure:^(NSURLSessionDataTask *task, NSError *error) { //
NSLog(@"error = %@", error); __block QuestionViewController *weakSelf = self;
// 请求问题列表
[httpClient getQuestionListWithParameters:parameters completion:^(id response, NSError *error) {
NSDictionary *dataDict = (NSDictionary *)response[@"data"];
NSDictionary *recordsDict = (NSDictionary *)dataDict[@"records"];
NSLog(@"recods = %@", recordsDict);
for (NSDictionary *questionDict in recordsDict) {
QuestionModel *question = [[QuestionModel alloc] init];
[question setValuesForKeysWithDictionary:questionDict];
[weakSelf.allQuestionArray addObject:question];
}
[weakSelf.tableView registerClass:[QuestionListTableCell class] forCellReuseIdentifier:kQuestionListCell];
}]; }];
} }
- (void)setupNav - (void)setupNav
...@@ -88,11 +102,15 @@ ...@@ -88,11 +102,15 @@
[self.navigationController pushViewController:addQuestionVC animated:YES]; [self.navigationController pushViewController:addQuestionVC animated:YES];
} }
#pragma mark - UItableView Delegate/DataSource - (void)taxiBtnCilck:(UIButton *)sender
{
}
#pragma mark - UItableView Delegate/DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{ {
return 5; return _allQuestionArray.count;
} }
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
...@@ -101,10 +119,8 @@ ...@@ -101,10 +119,8 @@
if (!cell) { if (!cell) {
cell = [[QuestionListTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kQuestionListCell]; cell = [[QuestionListTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kQuestionListCell];
} }
cell.titleLabel.text = @"系统跟单维护回访短信早于物流跟单送货"; cell.question = _allQuestionArray[indexPath.row];
cell.detailsLabel.text = @"新的SOP营业员跟单送货完成后的两天内未能及时返回,回访短信已经发送"; // cell.stateLabel.text = @"服务 - 15分钟退单";
cell.stateLabel.text = @"服务 - 15分钟退单";
cell.dateLabel.text = @"提报时间:2015-09-10 08:10:18";
return cell; return cell;
} }
...@@ -113,6 +129,7 @@ ...@@ -113,6 +129,7 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{ {
QuestionDetailViewController *questionDetailVC = [[QuestionDetailViewController alloc] init]; QuestionDetailViewController *questionDetailVC = [[QuestionDetailViewController alloc] init];
questionDetailVC.question = (QuestionModel *)_allQuestionArray[indexPath.row];
[self.navigationController pushViewController:questionDetailVC animated:YES]; [self.navigationController pushViewController:questionDetailVC animated:YES];
} }
...@@ -164,6 +181,7 @@ ...@@ -164,6 +181,7 @@
[taxiButton setImage:[UIImage imageNamed:@"sort_icon"] forState:UIControlStateNormal]; [taxiButton setImage:[UIImage imageNamed:@"sort_icon"] forState:UIControlStateNormal];
taxiButton.titleLabel.font = [UIFont systemFontOfSize:14.0]; taxiButton.titleLabel.font = [UIFont systemFontOfSize:14.0];
[taxiButton setTitle:@"排序" forState:UIControlStateNormal]; [taxiButton setTitle:@"排序" forState:UIControlStateNormal];
[taxiButton addTarget:self action:@selector(taxiBtnCilck:) forControlEvents:UIControlEventTouchUpInside];
[sectionView addSubview:taxiButton]; [sectionView addSubview:taxiButton];
MenuButton *screenButton = [[MenuButton alloc] init]; MenuButton *screenButton = [[MenuButton alloc] init];
......
...@@ -11,6 +11,8 @@ ...@@ -11,6 +11,8 @@
#import "MenuButton.h" #import "MenuButton.h"
#import "InspectTaskViewController.h" #import "InspectTaskViewController.h"
#import "HttpClient.h"
#define kInspectListCell @"InspectListCellTableViewCell" #define kInspectListCell @"InspectListCellTableViewCell"
@interface InspectListViewController ()<UITableViewDelegate, UITableViewDataSource> @interface InspectListViewController ()<UITableViewDelegate, UITableViewDataSource>
...@@ -45,6 +47,8 @@ ...@@ -45,6 +47,8 @@
self.test4Array = [NSArray arrayWithObjects:@"2",@"3",@"1",@"2",@"1", nil]; self.test4Array = [NSArray arrayWithObjects:@"2",@"3",@"1",@"2",@"1", nil];
self.test5Array = [NSArray arrayWithObjects:@(5),@(12),@(0),@(8),@(20), nil]; self.test5Array = [NSArray arrayWithObjects:@(5),@(12),@(0),@(8),@(20), nil];
self.test6Array = [NSArray arrayWithObjects:@(16),@(25),@(20),@(100),@(20), nil]; self.test6Array = [NSArray arrayWithObjects:@(16),@(25),@(20),@(100),@(20), nil];
[self requestInspectList];
} }
...@@ -60,6 +64,29 @@ ...@@ -60,6 +64,29 @@
// Dispose of any resources that can be recreated. // Dispose of any resources that can be recreated.
} }
#pragma mark - Private
- (void)taxiBtnCilck:(UIButton *)sender
{
}
- (void)requestInspectList
{
// NSString *url = [NSString stringWithFormat:@"%@%@", kRedStarURL, kInspectListURL];
// HttpClient *httpCilent = [[HttpClient alloc] initWithUrl:url];
// NSDictionary *parameters = @{@"userUuid":@"",
// @"state":@"",
// @"beginDateFrom":,
// @"endDateTo":@"",
// @"nameLike":@"",
// @"queryOrders":@"",
// @"pageNumber":@"",
// @"pageSize":@""};
// [httpCilent getInspectListWithParameters:parameters completion:^(id response, NSError *error) {
//
// }];
}
#pragma mark - UITableView Delegate/DataSource #pragma mark - UITableView Delegate/DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{ {
...@@ -154,6 +181,7 @@ ...@@ -154,6 +181,7 @@
[taxiButton setImage:[UIImage imageNamed:@"sort_icon"] forState:UIControlStateNormal]; [taxiButton setImage:[UIImage imageNamed:@"sort_icon"] forState:UIControlStateNormal];
taxiButton.titleLabel.font = [UIFont systemFontOfSize:14.0]; taxiButton.titleLabel.font = [UIFont systemFontOfSize:14.0];
[taxiButton setTitle:@"排序" forState:UIControlStateNormal]; [taxiButton setTitle:@"排序" forState:UIControlStateNormal];
[taxiButton addTarget:self action:@selector(taxiBtnCilck:) forControlEvents:UIControlEventTouchUpInside];
[sectionView addSubview:taxiButton]; [sectionView addSubview:taxiButton];
MenuButton *screenButton = [[MenuButton alloc] init]; MenuButton *screenButton = [[MenuButton alloc] init];
......
...@@ -84,13 +84,13 @@ ...@@ -84,13 +84,13 @@
// 口碑列表 或口碑排名 // 口碑列表 或口碑排名
- (void)wordOfMouthClick:(UIButton *)sender - (void)wordOfMouthClick:(UIButton *)sender
{ {
// InspectListViewController *inspectListVC = [[InspectListViewController alloc] init]; InspectListViewController *inspectListVC = [[InspectListViewController alloc] init];
// self.hidesBottomBarWhenPushed = YES;
// [self.navigationController pushViewController:inspectListVC animated:YES];
RankingListViewController *rankListVC = [[RankingListViewController alloc] init];
self.hidesBottomBarWhenPushed = YES; self.hidesBottomBarWhenPushed = YES;
[self.navigationController pushViewController:rankListVC animated:YES]; [self.navigationController pushViewController:inspectListVC animated:YES];
// RankingListViewController *rankListVC = [[RankingListViewController alloc] init];
// self.hidesBottomBarWhenPushed = YES;
// [self.navigationController pushViewController:rankListVC animated:YES];
} }
// 问题与知识 // 问题与知识
......
...@@ -73,30 +73,33 @@ ...@@ -73,30 +73,33 @@
*/ */
- (void)loginButtonClick:(UIButton *)sender - (void)loginButtonClick:(UIButton *)sender
{ {
AFHTTPSessionManager *session = [AFHTTPSessionManager manager]; self.rootTBC = [[RootTabBarController alloc] init];
session.requestSerializer = [AFJSONRequestSerializer serializer]; [self presentViewController:_rootTBC animated:YES completion:nil];
[session.requestSerializer setValue:@"application/json;charset=utf-8" forHTTPHeaderField:@"Content-Type"];
NSString *urlStr = [NSString stringWithFormat:@"%@%@%@", kRedStarURL, kLoginURL, self.loginView.usernameTextFiled.text]; // AFHTTPSessionManager *session = [AFHTTPSessionManager manager];
NSString *password = self.loginView.passwordTextFiled.text; // session.requestSerializer = [AFJSONRequestSerializer serializer];
NSString *passwordMD5 = [CommonFunc md5:password]; // [session.requestSerializer setValue:@"application/json;charset=utf-8" forHTTPHeaderField:@"Content-Type"];
NSDictionary *parameters = @{@"authenticode":@"211534962",@"password":passwordMD5}; // NSString *urlStr = [NSString stringWithFormat:@"%@%@%@", kRedStarURL, kLoginURL, self.loginView.usernameTextFiled.text];
[session POST:urlStr parameters:parameters success:^(NSURLSessionDataTask *task, id responseObject) { // NSString *password = self.loginView.passwordTextFiled.text;
if ([responseObject[@"message"] isEqualToString:@"ok"]) { // NSString *passwordMD5 = [CommonFunc md5:password];
// NSDictionary *parameters = @{@"authenticode":@"211534962",@"password":passwordMD5};
NSLog(@"response = %@", responseObject); // [session POST:urlStr parameters:parameters success:^(NSURLSessionDataTask *task, id responseObject) {
// if ([responseObject[@"message"] isEqualToString:@"ok"]) {
NSUserDefaults *userDefault = [NSUserDefaults standardUserDefaults]; //
[userDefault setObject:self.loginView.usernameTextFiled.text forKey:@"username"]; // NSLog(@"response = %@", responseObject);
[userDefault setObject:self.loginView.passwordTextFiled.text forKey:@"password"]; //
self.rootTBC = [[RootTabBarController alloc] init]; // NSUserDefaults *userDefault = [NSUserDefaults standardUserDefaults];
[self presentViewController:_rootTBC animated:YES completion:nil]; // [userDefault setObject:self.loginView.usernameTextFiled.text forKey:@"username"];
} else { // [userDefault setObject:self.loginView.passwordTextFiled.text forKey:@"password"];
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:[NSString stringWithFormat:@"%@", responseObject[@"message"]] delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil]; // self.rootTBC = [[RootTabBarController alloc] init];
[alertView show]; // [self presentViewController:_rootTBC animated:YES completion:nil];
} // } else {
} failure:^(NSURLSessionDataTask *task, NSError *error) { // UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"提示" message:[NSString stringWithFormat:@"%@", responseObject[@"message"]] delegate:nil cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
NSLog(@"error = %@", error); // [alertView show];
}]; // }
// } failure:^(NSURLSessionDataTask *task, NSError *error) {
// NSLog(@"error = %@", error);
// }];
} }
......
//
// HttpClient.h
// redstar
//
// Created by admin on 15/11/7.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <Foundation/Foundation.h>
#import <AFNetworking.h>
typedef void (^completionBlock) (id response, NSError *error);
@interface HttpClient : NSObject
// 初始化
- (id)initWithUrl:(NSString *)url;
// 获取问题列表
- (void)getQuestionListWithParameters:(id)parameters completion:(completionBlock)completion;
// 获取巡检列表
- (void)getInspectListWithParameters:(id)parameters completion:(completionBlock)completion;
@end
//
// HttpClient.m
// redstar
//
// Created by admin on 15/11/7.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "HttpClient.h"
@interface HttpClient ()
{
AFHTTPSessionManager *_manager;
NSString *_url;
}
@end
@implementation HttpClient
- (id)initWithUrl:(NSString *)url
{
self = [super init];
if (self) {
_url = url;
_manager = [AFHTTPSessionManager manager];
_manager.requestSerializer = [AFJSONRequestSerializer serializer];
_manager.responseSerializer = [AFJSONResponseSerializer serializer];
// 设置请求头
[_manager.requestSerializer setValue:@"application/json;charset=utf-8" forHTTPHeaderField:@"Content-Type"];
[_manager.requestSerializer setValue:@"5a74170150b940ae0150b940f7db0082" forHTTPHeaderField:@"enterprise"];
}
return self;
}
- (void)postParameters:(id)parameters completion:(completionBlock)completion
{
NSString *url = _url;
[_manager POST:url parameters:parameters success:^(NSURLSessionDataTask *task, id responseObject) {
if (completion) {
NSError *error = nil;
completion(responseObject, error);
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
if (completion) {
completion(nil,error);
}
}];
}
- (void)getParameters:(id)parameters completion:(completionBlock)completion
{
NSString *url = _url;
[_manager GET:url parameters:parameters success:^(NSURLSessionDataTask *task, id responseObject) {
if (completion) {
NSError *error = nil;
completion(responseObject, error);
}
} failure:^(NSURLSessionDataTask *task, NSError *error) {
if (completion) {
completion(nil,error);
}
}];
}
// 获取问题列表
- (void)getQuestionListWithParameters:(id)parameters completion:(completionBlock)completion
{
[self getParameters:parameters completion:^(id response, NSError *error) {
if (completion) {
completion (response, error);
}
}];
}
// 获取巡检列表
- (void)getInspectListWithParameters:(id)parameters completion:(completionBlock)completion
{
[self postParameters:parameters completion:^(id response, NSError *error) {
if (completion) {
completion (response, error);
}
}];
}
@end
//
// TaxisViewController.h
// redstar
//
// Created by admin on 15/11/7.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface TaxisViewController : UIViewController
@property (nonatomic, strong) UITableView *taxisTableView;
@end
//
// TaxisViewController.m
// redstar
//
// Created by admin on 15/11/7.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "TaxisViewController.h"
@interface TaxisViewController ()
@end
@implementation TaxisViewController
- (void)viewDidLoad
{
[super viewDidLoad];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
#pragma mark - Lazy loading
- (UITableView *)taxisTableView
{
if (_taxisTableView) {
_taxisTableView = [[UITableView alloc] init];
}
return _taxisTableView;
}
@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