Commit f29fa7ad authored by admin's avatar admin

修复部分bug

parent f362f21d
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
842547FC1BF03977006C79C5 /* QuestionModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 842547FB1BF03977006C79C5 /* QuestionModel.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 */; };
8462C6EC1BF5F3BE00344DDD /* MenuButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 8462C6EB1BF5F3BE00344DDD /* MenuButton.m */; }; 8462C6EC1BF5F3BE00344DDD /* MenuButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 8462C6EB1BF5F3BE00344DDD /* MenuButton.m */; };
84720BC11C0377D300314099 /* CommentWithStarView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84720BC01C0377D300314099 /* CommentWithStarView.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 */; };
8474C5911BE78A85007DCF19 /* QuestionListTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8474C58C1BE78A85007DCF19 /* QuestionListTableCell.m */; }; 8474C5911BE78A85007DCF19 /* QuestionListTableCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 8474C58C1BE78A85007DCF19 /* QuestionListTableCell.m */; };
...@@ -46,6 +47,7 @@ ...@@ -46,6 +47,7 @@
84970E281BD8DEFE00C1728A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 84970E231BD8DEFE00C1728A /* AppDelegate.m */; }; 84970E281BD8DEFE00C1728A /* AppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 84970E231BD8DEFE00C1728A /* AppDelegate.m */; };
84970E361BD8E09D00C1728A /* LoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84970E351BD8E09D00C1728A /* LoginViewController.m */; }; 84970E361BD8E09D00C1728A /* LoginViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 84970E351BD8E09D00C1728A /* LoginViewController.m */; };
84970E391BD8E0B300C1728A /* LoginView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84970E381BD8E0B300C1728A /* LoginView.m */; }; 84970E391BD8E0B300C1728A /* LoginView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84970E381BD8E0B300C1728A /* LoginView.m */; };
8497B62B1C043671007ECBE6 /* InspectTableView.m in Sources */ = {isa = PBXBuildFile; fileRef = 8497B62A1C043671007ECBE6 /* InspectTableView.m */; };
84AD4F201BF425AC00BFB37C /* InspectDetailView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AD4F1F1BF425AC00BFB37C /* InspectDetailView.m */; }; 84AD4F201BF425AC00BFB37C /* InspectDetailView.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AD4F1F1BF425AC00BFB37C /* InspectDetailView.m */; };
84AD4F221BF42F8E00BFB37C /* classfiy.plist in Resources */ = {isa = PBXBuildFile; fileRef = 84AD4F211BF42F8E00BFB37C /* classfiy.plist */; }; 84AD4F221BF42F8E00BFB37C /* classfiy.plist in Resources */ = {isa = PBXBuildFile; fileRef = 84AD4F211BF42F8E00BFB37C /* classfiy.plist */; };
84AD4F261BF4356A00BFB37C /* TaskModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AD4F251BF4356A00BFB37C /* TaskModel.m */; }; 84AD4F261BF4356A00BFB37C /* TaskModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 84AD4F251BF4356A00BFB37C /* TaskModel.m */; };
...@@ -133,6 +135,8 @@ ...@@ -133,6 +135,8 @@
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>"; };
8462C6EA1BF5F3BE00344DDD /* MenuButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MenuButton.h; sourceTree = "<group>"; }; 8462C6EA1BF5F3BE00344DDD /* MenuButton.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MenuButton.h; sourceTree = "<group>"; };
8462C6EB1BF5F3BE00344DDD /* MenuButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MenuButton.m; sourceTree = "<group>"; }; 8462C6EB1BF5F3BE00344DDD /* MenuButton.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MenuButton.m; sourceTree = "<group>"; };
84720BBF1C0377D300314099 /* CommentWithStarView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommentWithStarView.h; sourceTree = "<group>"; };
84720BC01C0377D300314099 /* CommentWithStarView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = CommentWithStarView.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>"; };
8474A01B1BE368D700315F30 /* HomeCellItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeCellItem.m; sourceTree = "<group>"; }; 8474A01B1BE368D700315F30 /* HomeCellItem.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HomeCellItem.m; sourceTree = "<group>"; };
8474C5811BE751A2007DCF19 /* CommonFunc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonFunc.h; sourceTree = "<group>"; }; 8474C5811BE751A2007DCF19 /* CommonFunc.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CommonFunc.h; sourceTree = "<group>"; };
...@@ -192,6 +196,8 @@ ...@@ -192,6 +196,8 @@
84970E371BD8E0B300C1728A /* LoginView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginView.h; sourceTree = "<group>"; }; 84970E371BD8E0B300C1728A /* LoginView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = LoginView.h; sourceTree = "<group>"; };
84970E381BD8E0B300C1728A /* LoginView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginView.m; sourceTree = "<group>"; }; 84970E381BD8E0B300C1728A /* LoginView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = LoginView.m; sourceTree = "<group>"; };
84970E3F1BD9127A00C1728A /* Constant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Constant.h; sourceTree = "<group>"; }; 84970E3F1BD9127A00C1728A /* Constant.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = Constant.h; sourceTree = "<group>"; };
8497B6291C043671007ECBE6 /* InspectTableView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectTableView.h; sourceTree = "<group>"; };
8497B62A1C043671007ECBE6 /* InspectTableView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InspectTableView.m; sourceTree = "<group>"; };
84AD4F1E1BF425AC00BFB37C /* InspectDetailView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectDetailView.h; sourceTree = "<group>"; }; 84AD4F1E1BF425AC00BFB37C /* InspectDetailView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = InspectDetailView.h; sourceTree = "<group>"; };
84AD4F1F1BF425AC00BFB37C /* InspectDetailView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InspectDetailView.m; sourceTree = "<group>"; }; 84AD4F1F1BF425AC00BFB37C /* InspectDetailView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = InspectDetailView.m; sourceTree = "<group>"; };
84AD4F211BF42F8E00BFB37C /* classfiy.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = classfiy.plist; sourceTree = "<group>"; }; 84AD4F211BF42F8E00BFB37C /* classfiy.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = classfiy.plist; sourceTree = "<group>"; };
...@@ -622,6 +628,7 @@ ...@@ -622,6 +628,7 @@
8486999C1BDF810900859DFE /* InspectList */ = { 8486999C1BDF810900859DFE /* InspectList */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
8497B6281C043656007ECBE6 /* View */,
84E363CC1BFAC3600061547E /* Model */, 84E363CC1BFAC3600061547E /* Model */,
8486999D1BDF810900859DFE /* Cell */, 8486999D1BDF810900859DFE /* Cell */,
848699A21BDF810900859DFE /* ViewController */, 848699A21BDF810900859DFE /* ViewController */,
...@@ -980,6 +987,15 @@ ...@@ -980,6 +987,15 @@
path = Macro; path = Macro;
sourceTree = "<group>"; sourceTree = "<group>";
}; };
8497B6281C043656007ECBE6 /* View */ = {
isa = PBXGroup;
children = (
8497B6291C043671007ECBE6 /* InspectTableView.h */,
8497B62A1C043671007ECBE6 /* InspectTableView.m */,
);
path = View;
sourceTree = "<group>";
};
84AD4F1D1BF4257C00BFB37C /* View */ = { 84AD4F1D1BF4257C00BFB37C /* View */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
...@@ -1200,6 +1216,8 @@ ...@@ -1200,6 +1216,8 @@
children = ( children = (
84F57C441BEC388A00DDEEB1 /* CommentView.h */, 84F57C441BEC388A00DDEEB1 /* CommentView.h */,
84F57C451BEC388A00DDEEB1 /* CommentView.m */, 84F57C451BEC388A00DDEEB1 /* CommentView.m */,
84720BBF1C0377D300314099 /* CommentWithStarView.h */,
84720BC01C0377D300314099 /* CommentWithStarView.m */,
); );
path = View; path = View;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1515,6 +1533,7 @@ ...@@ -1515,6 +1533,7 @@
files = ( files = (
8490C4C61BF9CE85006B6569 /* HomeTitleTableCell.m in Sources */, 8490C4C61BF9CE85006B6569 /* HomeTitleTableCell.m in Sources */,
840ABECC1BE1C29F006E49C5 /* RankDetailViewController.m in Sources */, 840ABECC1BE1C29F006E49C5 /* RankDetailViewController.m in Sources */,
8497B62B1C043671007ECBE6 /* InspectTableView.m in Sources */,
84AD4F261BF4356A00BFB37C /* TaskModel.m in Sources */, 84AD4F261BF4356A00BFB37C /* TaskModel.m in Sources */,
841D24FB1BEB75CA0005CC9F /* QuestionDetailFooterView.m in Sources */, 841D24FB1BEB75CA0005CC9F /* QuestionDetailFooterView.m in Sources */,
84CF0FA21BE9EDA900C855CE /* TakePhotoView.m in Sources */, 84CF0FA21BE9EDA900C855CE /* TakePhotoView.m in Sources */,
...@@ -1522,6 +1541,7 @@ ...@@ -1522,6 +1541,7 @@
84D80EB61BF714BE00A10EA4 /* GroupTabBar.m in Sources */, 84D80EB61BF714BE00A10EA4 /* GroupTabBar.m in Sources */,
8487D7721BF19A9C00E63E90 /* SearchToolBar.m in Sources */, 8487D7721BF19A9C00E63E90 /* SearchToolBar.m in Sources */,
84970E361BD8E09D00C1728A /* LoginViewController.m in Sources */, 84970E361BD8E09D00C1728A /* LoginViewController.m in Sources */,
84720BC11C0377D300314099 /* CommentWithStarView.m in Sources */,
84FD8A0A1BDA01D1006E442A /* MineViewController.m in Sources */, 84FD8A0A1BDA01D1006E442A /* MineViewController.m in Sources */,
848699B21BDF810900859DFE /* InspectListViewController.m in Sources */, 848699B21BDF810900859DFE /* InspectListViewController.m in Sources */,
84846E971BE069BC0010550A /* DateButton.m in Sources */, 84846E971BE069BC0010550A /* DateButton.m in Sources */,
......
{
"images" : [
{
"idiom" : "universal",
"filename" : "img_05.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "img_01.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "img_02.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "img_03.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "img_04.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
[homeNav.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,nil]]; [homeNav.navigationBar setTitleTextAttributes:[NSDictionary dictionaryWithObjectsAndKeys:[UIColor whiteColor],NSForegroundColorAttributeName,nil]];
AnnounceViewController *announce = (AnnounceViewController *)[self setUpOneChildViewController:[[AnnounceViewController alloc] init] title:@"公告" imageName:@"notice_unchecked" selImageName:@"notice_checked"]; AnnounceViewController *announce = (AnnounceViewController *)[self setUpOneChildViewController:[[AnnounceViewController alloc] init] title:@"功能" imageName:@"function_uncheck" selImageName:@"function_check"];
// 添加nav // 添加nav
UINavigationController *announceNav = [[UINavigationController alloc] initWithRootViewController:announce]; UINavigationController *announceNav = [[UINavigationController alloc] initWithRootViewController:announce];
[announceNav.navigationBar setBarTintColor:kNavigationBarColor]; [announceNav.navigationBar setBarTintColor:kNavigationBarColor];
......
...@@ -9,8 +9,8 @@ ...@@ -9,8 +9,8 @@
#ifndef Constant_h #ifndef Constant_h
#define Constant_h #define Constant_h
#define kNavigationBarColor [UIColor colorWithRed:0 / 255.0 green:111 / 255.0 blue:188 / 255.0 alpha:1.0] #define kNavigationBarColor [UIColor colorWithRed:47 / 255.0 green:170 / 255.0 blue: 229 / 255.0 alpha:1.0]
#define kNavigationBarCGColor [[UIColor colorWithRed:0 / 255.0 green:111 / 255.0 blue:188 / 255.0 alpha:1.0] CGColor] #define kNavigationBarCGColor [[UIColor colorWithRed:47 / 255.0 green:170 / 255.0 blue: 229 / 255.0 alpha:1.0] CGColor]
#define kRemindTextColor [UIColor colorWithRed:133 / 255.0 green:133/255.0 blue:133/255.0 alpha:1.0] #define kRemindTextColor [UIColor colorWithRed:133 / 255.0 green:133/255.0 blue:133/255.0 alpha:1.0]
#define kMineBackGroundColor [UIColor colorWithRed:243 / 255.0 green:243 / 255.0 blue:243 / 255.0 alpha:1.0] #define kMineBackGroundColor [UIColor colorWithRed:243 / 255.0 green:243 / 255.0 blue:243 / 255.0 alpha:1.0]
...@@ -28,7 +28,7 @@ ...@@ -28,7 +28,7 @@
// #dddddd // #dddddd
#define kPasswordBorderColor [[UIColor colorWithRed:221 / 255.0 green:221 / 255.0 blue:221 / 255.0 alpha:1.0] CGColor] #define kPasswordBorderColor [[UIColor colorWithRed:221 / 255.0 green:221 / 255.0 blue:221 / 255.0 alpha:1.0] CGColor]
// #006fbc // #006fbc
#define kLoginButtonBackGroundColor [UIColor colorWithRed:0 / 255.0 green:111 / 255.0 blue:188 / 255.0 alpha:1.0] #define kLoginButtonBackGroundColor [UIColor colorWithRed:47 / 255.0 green:170 / 255.0 blue: 229 / 255.0 alpha:1.0]
// #dddddd // #dddddd
#define kSeparateLineColor [UIColor colorWithRed:221 / 255.0 green:221 / 255.0 blue:221 / 255.0 alpha:1.0] #define kSeparateLineColor [UIColor colorWithRed:221 / 255.0 green:221 / 255.0 blue:221 / 255.0 alpha:1.0]
#define kSeparateLineCGColor [[UIColor colorWithRed:221 / 255.0 green:221 / 255.0 blue:221 / 255.0 alpha:1.0] CGColor] #define kSeparateLineCGColor [[UIColor colorWithRed:221 / 255.0 green:221 / 255.0 blue:221 / 255.0 alpha:1.0] CGColor]
...@@ -54,10 +54,10 @@ ...@@ -54,10 +54,10 @@
// #999999 // #999999
#define kRankHeadTitleTextColor [UIColor colorWithRed:153 / 255.0 green:153 / 255.0 blue:153 / 255.0 alpha:1.0] #define kRankHeadTitleTextColor [UIColor colorWithRed:153 / 255.0 green:153 / 255.0 blue:153 / 255.0 alpha:1.0]
// #006fbc // #006fbc
#define kDateButtonTextColor [UIColor colorWithRed:0 / 255.0 green:111 / 255.0 blue:188 / 255.0 alpha:1.0] #define kDateButtonTextColor [UIColor colorWithRed:47 / 255.0 green:170 / 255.0 blue: 229 / 255.0 alpha:1.0]
#define kShopCountTextColor [UIColor colorWithRed:255 / 255.0 green:0 / 255.0 blue:0 / 255.0 alpha:1.0] #define kShopCountTextColor [UIColor colorWithRed:255 / 255.0 green:0 / 255.0 blue:0 / 255.0 alpha:1.0]
// #006fbc // #006fbc
#define kScoreTextColor [UIColor colorWithRed:0 / 255.0 green:111 / 255.0 blue:188 / 255.0 alpha:1.0] #define kScoreTextColor [UIColor colorWithRed:47 / 255.0 green:170 / 255.0 blue: 229 / 255.0 alpha:1.0]
// #444444 // #444444
#define kShopNameTextColor [UIColor colorWithRed:68 / 255.0 green:68 / 255.0 blue:68 / 255.0 alpha:1.0] #define kShopNameTextColor [UIColor colorWithRed:68 / 255.0 green:68 / 255.0 blue:68 / 255.0 alpha:1.0]
// #fe6903 // #fe6903
...@@ -124,7 +124,7 @@ ...@@ -124,7 +124,7 @@
// #444444 // #444444
#define kLightBlack [UIColor colorWithRed:68 / 255.0 green:68 / 255.0 blue:68 / 255.0 alpha:1.0] #define kLightBlack [UIColor colorWithRed:68 / 255.0 green:68 / 255.0 blue:68 / 255.0 alpha:1.0]
#define kCommentViewHeight 335 #define kCommentViewHeight 300
#define kTaxisViewHeight 150 #define kTaxisViewHeight 150
#define kScreenViewHeight 240 #define kScreenViewHeight 240
......
...@@ -7,19 +7,16 @@ ...@@ -7,19 +7,16 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "StarBar.h"
@interface CommentView : UIView <UITextViewDelegate> @interface CommentView : UIView <UITextViewDelegate>
@property (nonatomic, strong) UILabel *titleLabel; @property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIButton *quitBtn; @property (nonatomic, strong) UIButton *quitBtn;
@property (nonatomic, strong) UILabel *starLabel;
@property (nonatomic, strong) UILabel *commentLabel; @property (nonatomic, strong) UILabel *commentLabel;
@property (nonatomic, strong) UIButton *sureBtn; @property (nonatomic, strong) UIButton *sureBtn;
@property (nonatomic, strong) StarBar *starBar;
@property (nonatomic, strong) UITextView *contentTextView; @property (nonatomic, strong) UITextView *contentTextView;
@end @end
...@@ -41,7 +41,6 @@ ...@@ -41,7 +41,6 @@
- (void)setup - (void)setup
{ {
self.titleLabel.text = @"评分、评论"; self.titleLabel.text = @"评分、评论";
self.starLabel.text = @"星级打分";
self.commentLabel.text = @"评论内容"; self.commentLabel.text = @"评论内容";
UIImage *image = [UIImage imageNamed:@"textbox"]; UIImage *image = [UIImage imageNamed:@"textbox"];
...@@ -54,7 +53,6 @@ ...@@ -54,7 +53,6 @@
[self.sureBtn setTitle:@"确定" forState:UIControlStateNormal]; [self.sureBtn setTitle:@"确定" forState:UIControlStateNormal];
self.starBar.starNumber = 0;
} }
...@@ -112,56 +110,28 @@ ...@@ -112,56 +110,28 @@
if (!_quitBtn) { if (!_quitBtn) {
_quitBtn = [[UIButton alloc] init]; _quitBtn = [[UIButton alloc] init];
_quitBtn.translatesAutoresizingMaskIntoConstraints = NO; _quitBtn.translatesAutoresizingMaskIntoConstraints = NO;
_quitBtn.backgroundColor = kSectionBackGroundColor; [_quitBtn setImage:[UIImage imageNamed:@"close"] forState:UIControlStateNormal];
[self.titleLabel addSubview:_quitBtn]; [self addSubview:_quitBtn];
[self insertSubview:_quitBtn aboveSubview:_titleLabel];
// 顶端 // 顶端
NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_quitBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.titleLabel attribute:NSLayoutAttributeTop multiplier:1.0 constant:0]; NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_quitBtn attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[self.titleLabel addConstraint:titleTop]; [self addConstraint:titleTop];
// 左边 // 左边
NSLayoutConstraint *titleWidth = [NSLayoutConstraint constraintWithItem:_quitBtn attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:45]; NSLayoutConstraint *titleWidth = [NSLayoutConstraint constraintWithItem:_quitBtn attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:45];
[self.titleLabel addConstraint:titleWidth]; [self addConstraint:titleWidth];
// 右边 // 右边
NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_quitBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.titleLabel attribute:NSLayoutAttributeRight multiplier:1.0 constant:0]; NSLayoutConstraint *titleRight = [NSLayoutConstraint constraintWithItem:_quitBtn attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[self.titleLabel addConstraint:titleRight]; [self addConstraint:titleRight];
// 右边 // 右边
NSLayoutConstraint *titleHeight = [NSLayoutConstraint constraintWithItem:_quitBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:45]; NSLayoutConstraint *titleHeight = [NSLayoutConstraint constraintWithItem:_quitBtn attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:45];
[self.titleLabel addConstraint:titleHeight];
}
return _quitBtn;
}
- (UILabel *)starLabel
{
if (!_starLabel) {
_starLabel = [[UILabel alloc] init];
_starLabel.font = [UIFont systemFontOfSize:16.0];
_starLabel.textColor = kLightBlack;
_starLabel.translatesAutoresizingMaskIntoConstraints = NO;
[self addSubview:_starLabel];
// 顶端
NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_starLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.titleLabel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:10];
[self addConstraint:titleTop];
// 左边
NSLayoutConstraint *titleLeft = [NSLayoutConstraint constraintWithItem:_starLabel attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self addConstraint:titleLeft];
// 右边
NSLayoutConstraint *titleWidth = [NSLayoutConstraint constraintWithItem:_starLabel attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:65];
[self addConstraint:titleWidth];
// 右边
NSLayoutConstraint *titleHeight = [NSLayoutConstraint constraintWithItem:_starLabel attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:30];
[self addConstraint:titleHeight]; [self addConstraint:titleHeight];
} }
return _starLabel; return _quitBtn;
} }
- (UILabel *)commentLabel - (UILabel *)commentLabel
...@@ -174,7 +144,7 @@ ...@@ -174,7 +144,7 @@
[self addSubview:_commentLabel]; [self addSubview:_commentLabel];
// 顶端 // 顶端
NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_commentLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.starLabel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:2]; NSLayoutConstraint *titleTop = [NSLayoutConstraint constraintWithItem:_commentLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.titleLabel attribute:NSLayoutAttributeBottom multiplier:1.0 constant:5];
[self addConstraint:titleTop]; [self addConstraint:titleTop];
// 左边 // 左边
...@@ -299,14 +269,8 @@ ...@@ -299,14 +269,8 @@
return _sureBtn; return _sureBtn;
} }
- (StarBar *)starBar - (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
{ [self endEditing:YES];
if (!_starBar) {
_starBar = [[StarBar alloc] initWithFrame:CGRectMake(kScreenWidth - kStarBarWidth, 55, kStarBarWidth, 30)];
[self addSubview:_starBar];
}
return _starBar;
} }
@end @end
//
// CommentWithStarView.h
// redstar
//
// Created by admin on 15/11/24.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "StarBar.h"
@interface CommentWithStarView : UIView <UITextViewDelegate>
@property (nonatomic, strong) UILabel *titleLabel;
@property (nonatomic, strong) UIButton *quitBtn;
@property (nonatomic, strong) UILabel *starLabel;
@property (nonatomic, strong) UILabel *commentLabel;
@property (nonatomic, strong) UIButton *sureBtn;
@property (nonatomic, strong) StarBar *starBar;
@property (nonatomic, strong) UITextView *contentTextView;
@property (nonatomic, strong) UILabel *placeholderLabel2;
@property (nonatomic, strong) UIImageView *backImageView2;
@end
This diff is collapsed.
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
{ {
self.titleLabel.textColor = kOnLineCellTitleColor; self.titleLabel.textColor = kOnLineCellTitleColor;
self.selectLabel.textColor = kOnLineCellDetailColor; self.selectLabel.textColor = kOnLineCellDetailColor;
} }
#pragma mark - lazy loading #pragma mark - lazy loading
...@@ -38,7 +39,6 @@ ...@@ -38,7 +39,6 @@
_titleLabel = [[UILabel alloc] init]; _titleLabel = [[UILabel alloc] init];
_titleLabel.translatesAutoresizingMaskIntoConstraints = NO; _titleLabel.translatesAutoresizingMaskIntoConstraints = NO;
_titleLabel.font = [UIFont systemFontOfSize:16.0]; _titleLabel.font = [UIFont systemFontOfSize:16.0];
[self.contentView addSubview:_titleLabel]; [self.contentView addSubview:_titleLabel];
// 顶端 // 顶端
...@@ -67,7 +67,6 @@ ...@@ -67,7 +67,6 @@
if (!_selectLabel) { if (!_selectLabel) {
_selectLabel = [[UILabel alloc] init]; _selectLabel = [[UILabel alloc] init];
_selectLabel.textAlignment = NSTextAlignmentRight; _selectLabel.textAlignment = NSTextAlignmentRight;
_selectLabel.text = @"请选择";
_selectLabel.translatesAutoresizingMaskIntoConstraints = NO; _selectLabel.translatesAutoresizingMaskIntoConstraints = NO;
_selectLabel.font = [UIFont systemFontOfSize:15.0]; _selectLabel.font = [UIFont systemFontOfSize:15.0];
[self.contentView addSubview:_selectLabel]; [self.contentView addSubview:_selectLabel];
......
...@@ -10,7 +10,9 @@ ...@@ -10,7 +10,9 @@
#import "TakePhotoView.h" #import "TakePhotoView.h"
@interface AddQuestionFooterView : UIView @interface AddQuestionFooterView : UIView
@property (nonatomic, strong) UITextView *titleTextView; @property (nonatomic, strong) UITextView *titleTextView;
@property (nonatomic, strong) UITextView *contentTextView;
@property (nonatomic, strong) TakePhotoView *takePhotoView; @property (nonatomic, strong) TakePhotoView *takePhotoView;
......
...@@ -17,9 +17,13 @@ ...@@ -17,9 +17,13 @@
#import "RedStarTools.h" #import "RedStarTools.h"
#import <MBProgressHUD.h> #import <MBProgressHUD.h>
#define kAddQuestionCell @"addQuestionTableViewCell" #define CATEGORYLIST @"服务", @"环境企划", @"环境物业", nil
#define QUESTIONLIST @"15分钟退单", @"便民服务", @"基础管理",@"轻松购系统",@"全员服务",@"人员信息",@"营运物流及服务硬件", nil
@interface AddQuestionViewController () <UITableViewDelegate, UITableViewDataSource, TakePhotoViewDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate>
#define kAddQuestionCell @"UITableViewCellIdentifier"
@interface AddQuestionViewController () <UITableViewDelegate, UITableViewDataSource, TakePhotoViewDelegate, UINavigationControllerDelegate, UIImagePickerControllerDelegate, UIActionSheetDelegate>
@property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) AddQuestionFooterView *footerView; @property (nonatomic, strong) AddQuestionFooterView *footerView;
...@@ -27,6 +31,12 @@ ...@@ -27,6 +31,12 @@
@property (nonatomic, strong) NSArray *titleArray; @property (nonatomic, strong) NSArray *titleArray;
@property (nonatomic, strong) NSString *imageMD5; @property (nonatomic, strong) NSString *imageMD5;
@property (nonatomic, strong) UIActionSheet *categoryActionSheet;
@property (nonatomic, strong) UIActionSheet *questionActionSheet;
@property (nonatomic ,strong) UILabel *selectLabel;
@property (nonatomic ,strong) UILabel *selectLabel1;
@end @end
@implementation AddQuestionViewController @implementation AddQuestionViewController
...@@ -74,13 +84,25 @@ ...@@ -74,13 +84,25 @@
- (void)upLoadQuestionPic:(UIButton *)sender - (void)upLoadQuestionPic:(UIButton *)sender
{ {
if ([_selectLabel.text isEqualToString:@"请选择"]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"警告" message:@"请选择对应专业组" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
return;
}
if ([_selectLabel1.text isEqualToString:@"请选择"]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"警告" message:@"请选择问题分类" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
return;
}
NSLog(@"_selectLabel.text = %@, _selectLabel2.text = %@ ,self.footerView.contentTextView.text ===%@, elf.footerView.titleTextView.text = %@", _selectLabel.text,_selectLabel1.text,self.footerView.contentTextView.text, self.footerView.titleTextView.text);
[[RedStarTools sharedInstance] loadLocalData]; [[RedStarTools sharedInstance] loadLocalData];
NSMutableArray *localData = [RedStarTools sharedInstance].localDatas; NSMutableArray *localData = [RedStarTools sharedInstance].localDatas;
NSDictionary *parameters; NSDictionary *parameters;
if (localData.count == 0) { if (localData.count == 0) {
parameters = @{@"category":@"环境物业", parameters = @{@"category":_selectLabel.text,
@"group":@"基础环境", @"group":_selectLabel1.text,
@"title":@"测试数据", @"title":self.footerView.contentTextView.text,
@"content":self.footerView.titleTextView.text @"content":self.footerView.titleTextView.text
}; };
} else { } else {
...@@ -147,7 +169,7 @@ ...@@ -147,7 +169,7 @@
- (void)addTableView - (void)addTableView
{ {
[self.tableView registerClass:[OnLineTableViewCell class] forCellReuseIdentifier:kAddQuestionCell]; [self.tableView registerClass:[UITableViewCell class] forCellReuseIdentifier:kAddQuestionCell];
self.tableView.tableFooterView = self.footerView; self.tableView.tableFooterView = self.footerView;
} }
...@@ -253,12 +275,60 @@ ...@@ -253,12 +275,60 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{ {
OnLineTableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:kAddQuestionCell]; UITableViewCell *cell=[tableView dequeueReusableCellWithIdentifier:kAddQuestionCell];
if (!cell) { if (!cell) {
cell = [[OnLineTableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kAddQuestionCell]; cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kAddQuestionCell];
} }
cell.titleLabel.text = [NSString stringWithFormat:@"%@", _titleArray[indexPath.row]]; cell.textLabel.text = [NSString stringWithFormat:@"%@", _titleArray[indexPath.row]];
cell.textLabel.font = [UIFont systemFontOfSize:16.0];
cell.textLabel.textColor = kOnLineCellTitleColor;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
if (indexPath.row == 0) {
self.selectLabel = [[UILabel alloc] init];
_selectLabel.text = @"请选择";
_selectLabel.translatesAutoresizingMaskIntoConstraints = NO;
_selectLabel.textColor = kOnLineCellDetailColor;
_selectLabel.textAlignment = NSTextAlignmentRight;
_selectLabel.translatesAutoresizingMaskIntoConstraints = NO;
_selectLabel.font = [UIFont systemFontOfSize:15.0];
[cell.contentView addSubview:_selectLabel];
// 顶端
NSLayoutConstraint *selectTop = [NSLayoutConstraint constraintWithItem:_selectLabel attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:cell.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[cell.contentView addConstraint:selectTop];
// 左边
NSLayoutConstraint *selectRight = [NSLayoutConstraint constraintWithItem:_selectLabel attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:cell.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[cell.contentView addConstraint:selectRight];
// 高度
NSLayoutConstraint *selectBottom = [NSLayoutConstraint constraintWithItem:_selectLabel attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:cell.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[cell.contentView addConstraint:selectBottom];
} else {
self.selectLabel1 = [[UILabel alloc] init];
_selectLabel1.text = @"请选择";
_selectLabel1.translatesAutoresizingMaskIntoConstraints = NO;
_selectLabel1.textColor = kOnLineCellDetailColor;
_selectLabel1.textAlignment = NSTextAlignmentRight;
_selectLabel1.translatesAutoresizingMaskIntoConstraints = NO;
_selectLabel1.font = [UIFont systemFontOfSize:15.0];
[cell.contentView addSubview:_selectLabel1];
// 顶端
NSLayoutConstraint *selectTop = [NSLayoutConstraint constraintWithItem:_selectLabel1 attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:cell.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
[cell.contentView addConstraint:selectTop];
// 左边
NSLayoutConstraint *selectRight = [NSLayoutConstraint constraintWithItem:_selectLabel1 attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:cell.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:0];
[cell.contentView addConstraint:selectRight];
// 高度
NSLayoutConstraint *selectBottom = [NSLayoutConstraint constraintWithItem:_selectLabel1 attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:cell.contentView attribute:NSLayoutAttributeBottom multiplier:1.0 constant:0];
[cell.contentView addConstraint:selectBottom];
}
return cell; return cell;
...@@ -270,6 +340,36 @@ ...@@ -270,6 +340,36 @@
return 50; return 50;
} }
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.row == 0) {
self.categoryActionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:nil otherButtonTitles:CATEGORYLIST];
_categoryActionSheet.delegate = self;
[_categoryActionSheet showInView:self.view];
} else {
self.questionActionSheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:nil otherButtonTitles:QUESTIONLIST];
_questionActionSheet.delegate = self;
[_questionActionSheet showInView:self.view];
}
}
#pragma mark - UIActionSheetDelegate
- (void)actionSheet:(UIActionSheet *)actionSheet didDismissWithButtonIndex:(NSInteger)buttonIndex
{
if (actionSheet == _categoryActionSheet) {
if (buttonIndex < [NSArray arrayWithObjects:CATEGORYLIST].count) {
_selectLabel.text = [[NSArray arrayWithObjects:CATEGORYLIST] objectAtIndex:buttonIndex];
}
} else {
if (buttonIndex < [NSArray arrayWithObjects:QUESTIONLIST].count) {
_selectLabel1.text = [[NSArray arrayWithObjects:QUESTIONLIST] objectAtIndex:buttonIndex];
}
}
}
#pragma mark - lazy loading #pragma mark - lazy loading
- (UITableView *)tableView - (UITableView *)tableView
...@@ -310,6 +410,10 @@ ...@@ -310,6 +410,10 @@
return _footerView; return _footerView;
} }
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
[self.tableView endEditing:YES];
}
/* /*
#pragma mark - Navigation #pragma mark - Navigation
......
...@@ -47,9 +47,15 @@ ...@@ -47,9 +47,15 @@
[self.stateLabel setAttributedText:stateAttr]; [self.stateLabel setAttributedText:stateAttr];
} }
if (questionDetail.myLike) {
self.thumbBtn.selected = YES;
} else {
self.thumbBtn.selected = NO;
}
// 点赞数 // 点赞数
[self.thumbBtn setTitle:[NSString stringWithFormat:@"%d",questionDetail.likeCount] forState:UIControlStateNormal]; [self.thumbBtn setTitle:[NSString stringWithFormat:@"%d",questionDetail.likeCount] forState:UIControlStateNormal];
// 分类 // 分类
NSString *sortText = [NSString stringWithFormat:@"分类:%@", questionDetail.category]; NSString *sortText = [NSString stringWithFormat:@"分类:%@", questionDetail.category];
NSMutableAttributedString *sortAttr = [[NSMutableAttributedString alloc] initWithString:sortText]; NSMutableAttributedString *sortAttr = [[NSMutableAttributedString alloc] initWithString:sortText];
...@@ -112,6 +118,7 @@ ...@@ -112,6 +118,7 @@
if (!_thumbBtn) { if (!_thumbBtn) {
_thumbBtn = [[ZanButton alloc] init]; _thumbBtn = [[ZanButton alloc] init];
[_thumbBtn setImage:[UIImage imageNamed:@"commend"] forState:UIControlStateNormal]; [_thumbBtn setImage:[UIImage imageNamed:@"commend"] forState:UIControlStateNormal];
[_thumbBtn setImage:[UIImage imageNamed:@"commend_after"] forState:UIControlStateSelected];
_thumbBtn.translatesAutoresizingMaskIntoConstraints = NO; _thumbBtn.translatesAutoresizingMaskIntoConstraints = NO;
_thumbBtn.titleLabel.font = [UIFont systemFontOfSize:15.0]; _thumbBtn.titleLabel.font = [UIFont systemFontOfSize:15.0];
[_thumbBtn setTitleColor:kNavigationBarColor forState:UIControlStateNormal]; [_thumbBtn setTitleColor:kNavigationBarColor forState:UIControlStateNormal];
......
...@@ -40,5 +40,7 @@ ...@@ -40,5 +40,7 @@
@property (nonatomic, copy) NSString *uuid; @property (nonatomic, copy) NSString *uuid;
@property (nonatomic, copy) NSString *version; @property (nonatomic, copy) NSString *version;
@property (nonatomic, strong) NSString *store_code;
@property (nonatomic, strong) NSString *store_uuid;
@property (nonatomic, strong) NSString *store_name;
@end @end
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#define kQuestionDetailCell @"QuestionDetailCell" // 问题详情 #define kQuestionDetailCell @"QuestionDetailCell" // 问题详情
#define kQuestionCommentCell @"QuestionCommentCell" // 评论 #define kQuestionCommentCell @"QuestionCommentCell" // 评论
#define kQuestionDescribeCell @"QuestionDescribeCell" // 问题描述 #define kQuestionDescribeCell @"QuestionDescribeCell" // 问题描述
@interface QuestionDetailViewController ()<UITableViewDelegate, UITableViewDataSource, UIAlertViewDelegate> @interface QuestionDetailViewController ()<UITableViewDelegate, UITableViewDataSource, UIAlertViewDelegate, UITextViewDelegate>
@property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) QuestionDetailFooterView *footerView; @property (nonatomic, strong) QuestionDetailFooterView *footerView;
...@@ -30,6 +30,8 @@ ...@@ -30,6 +30,8 @@
@property (nonatomic, strong) CommentView *commentView; @property (nonatomic, strong) CommentView *commentView;
@property (nonatomic, strong) QuestionDetailModel *questionDetailModel; @property (nonatomic, strong) QuestionDetailModel *questionDetailModel;
@property (nonatomic, strong) NSMutableArray *allCommentArray; @property (nonatomic, strong) NSMutableArray *allCommentArray;
@end @end
@implementation QuestionDetailViewController @implementation QuestionDetailViewController
...@@ -135,8 +137,8 @@ ...@@ -135,8 +137,8 @@
_commentView = [[CommentView alloc] init]; _commentView = [[CommentView alloc] init];
_commentView.backgroundColor = [UIColor whiteColor]; _commentView.backgroundColor = [UIColor whiteColor];
} }
_commentView.starBar.starNumber = 0;
_commentView.contentTextView.text = @""; _commentView.contentTextView.text = @"";
_commentView.contentTextView.delegate = self;
[_commentView.quitBtn addTarget:self action:@selector(closeBackGroundView) forControlEvents:UIControlEventTouchUpInside]; [_commentView.quitBtn addTarget:self action:@selector(closeBackGroundView) forControlEvents:UIControlEventTouchUpInside];
[_commentView.sureBtn addTarget:self action:@selector(submitComment:) forControlEvents:UIControlEventTouchUpInside]; [_commentView.sureBtn addTarget:self action:@selector(submitComment:) forControlEvents:UIControlEventTouchUpInside];
[self.view insertSubview:_backGroundView aboveSubview:_tableView]; [self.view insertSubview:_backGroundView aboveSubview:_tableView];
...@@ -159,7 +161,6 @@ ...@@ -159,7 +161,6 @@
// 提交评论 // 提交评论
- (void)submitComment:(UIButton *)sender - (void)submitComment:(UIButton *)sender
{ {
NSNumber *count = [NSNumber numberWithInteger:_commentView.starBar.starNumber];
NSDate *date = [NSDate date]; NSDate *date = [NSDate date];
NSTimeZone *zone = [NSTimeZone systemTimeZone]; NSTimeZone *zone = [NSTimeZone systemTimeZone];
...@@ -180,7 +181,6 @@ ...@@ -180,7 +181,6 @@
HttpClient *httpClient = [[HttpClient alloc] initWithUrl:url]; HttpClient *httpClient = [[HttpClient alloc] initWithUrl:url];
NSDictionary *parameters = @{@"entityType":@"question", NSDictionary *parameters = @{@"entityType":@"question",
@"entityUuid":_questionUuid, @"entityUuid":_questionUuid,
@"star":count,
@"comment":_commentView.contentTextView.text}; @"comment":_commentView.contentTextView.text};
NSLog(@"parameters = %@", parameters); NSLog(@"parameters = %@", parameters);
[MBProgressHUD showHUDAddedTo:self.view animated:YES]; [MBProgressHUD showHUDAddedTo:self.view animated:YES];
...@@ -366,6 +366,7 @@ ...@@ -366,6 +366,7 @@
titleBtn.translatesAutoresizingMaskIntoConstraints = NO; titleBtn.translatesAutoresizingMaskIntoConstraints = NO;
[titleBtn setTitle:@"添加评论" forState:UIControlStateNormal]; [titleBtn setTitle:@"添加评论" forState:UIControlStateNormal];
[titleBtn setTitleColor:kNavigationBarColor forState:UIControlStateNormal]; [titleBtn setTitleColor:kNavigationBarColor forState:UIControlStateNormal];
[titleBtn addTarget:self action:@selector(addComment:) forControlEvents:UIControlEventTouchUpInside];
titleBtn.titleLabel.font = [UIFont systemFontOfSize:14.0]; titleBtn.titleLabel.font = [UIFont systemFontOfSize:14.0];
titleBtn.layer.borderColor = kNavigationBarCGColor; titleBtn.layer.borderColor = kNavigationBarCGColor;
titleBtn.layer.borderWidth = 1.0; titleBtn.layer.borderWidth = 1.0;
...@@ -467,4 +468,8 @@ ...@@ -467,4 +468,8 @@
} }
@end @end
...@@ -44,4 +44,13 @@ ...@@ -44,4 +44,13 @@
@property (nonatomic, strong) NSString *title;//问题处理分类 @property (nonatomic, strong) NSString *title;//问题处理分类
@property (nonatomic, strong) NSString *uuid;// @property (nonatomic, strong) NSString *uuid;//
@property (nonatomic, strong) NSString *version;// @property (nonatomic, strong) NSString *version;//
@property (nonatomic, strong) NSString *principal_uuid;
@property (nonatomic, strong) NSString *principal_name;
@property (nonatomic, strong) NSString *principal_code;
@property (nonatomic, strong) NSString *store_code;
@property (nonatomic, strong) NSString *store_uuid;
@property (nonatomic, strong) NSString *store_name;
@end @end
...@@ -169,59 +169,6 @@ ...@@ -169,59 +169,6 @@
[self.navigationController dismissViewControllerAnimated:YES completion:nil]; [self.navigationController dismissViewControllerAnimated:YES completion:nil];
} }
- (void)addZan:(ZanButton *)sender
{
sender.selected = !sender.selected;
NSInteger row = sender.tag - kThumbTag;
QuestionModel *question = _allQuestionArray[row];
NSDate *date = [NSDate date];
NSTimeZone *zone = [NSTimeZone systemTimeZone];
NSInteger interval = [zone secondsFromGMTForDate:date];
NSDate *localeDate = [date dateByAddingTimeInterval:interval];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"YYYY-MM-dd+hh:mm:ss"];
NSString *dateString = [dateFormatter stringFromDate:localeDate];
NSString *operId = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_code"];
NSString *operName = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_name"];
if (sender.selected) {
// 点赞
NSString *url = [NSString stringWithFormat:@"%@%@%@?time=%@&operId=%@&operName=%@", kRedStarURL, kAddLikeURL, question.uuid, dateString, operId, operName];
url = [url stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
HttpClient *httpClient = [[HttpClient alloc] initWithUrl:url];
[httpClient likeCountWithParameters:nil completion:^(id response, NSError *error) {
if (response[@"success"]) {
int likeCount = [sender.titleLabel.text intValue];
[sender setTitle:[NSString stringWithFormat:@"%d", likeCount + 1] forState:UIControlStateNormal];
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"警告" message:@"点赞失败!" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alert show];
}
}];
} else {
// 取消点赞
NSString *url = [NSString stringWithFormat:@"%@%@%@?time=%@&operId=%@&operName=%@", kRedStarURL, kCancelLikeURL, question.uuid, dateString, operId, operName];
url = [url stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
HttpClient *httpClient = [[HttpClient alloc] initWithUrl:url];
[httpClient likeCountWithParameters:nil completion:^(id response, NSError *error) {
NSLog(@"取消点赞response = %@", response);
if (response[@"success"]) {
int likeCount = [sender.titleLabel.text intValue];
[sender setTitle:[NSString stringWithFormat:@"%d", likeCount - 1] forState:UIControlStateNormal];
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"警告" message:@"取消点赞失败!" delegate:self cancelButtonTitle:@"确定" otherButtonTitles:nil, nil];
[alert show];
}
}];
}
}
- (void)addQuestionClick:(UIButton *)sender - (void)addQuestionClick:(UIButton *)sender
{ {
AddQuestionViewController *addQuestionVC = [[AddQuestionViewController alloc] init]; AddQuestionViewController *addQuestionVC = [[AddQuestionViewController alloc] init];
...@@ -414,10 +361,7 @@ ...@@ -414,10 +361,7 @@
cell = [[QuestionListTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kQuestionListCell]; cell = [[QuestionListTableCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kQuestionListCell];
} }
cell.question = _allQuestionArray[indexPath.row]; cell.question = _allQuestionArray[indexPath.row];
[cell.thumbBtn addTarget:self action:@selector(addZan:) forControlEvents:UIControlEventTouchUpInside];
cell.thumbBtn.tag = kThumbTag + indexPath.row;
return cell; return cell;
} }
// cell点击事件 // cell点击事件
......
...@@ -32,7 +32,7 @@ ...@@ -32,7 +32,7 @@
if (self) { if (self) {
UIImage *image = [UIImage imageNamed:kAddImage]; UIImage *image = [UIImage imageNamed:kAddImage];
UIButton *btn = [self createButtonWithImage:image]; UIButton *btn = [self createButtonWithImage:image];
btn.backgroundColor = [UIColor lightGrayColor]; btn.backgroundColor = [UIColor whiteColor];
[btn addTarget:self action:@selector(addNewButton:) forControlEvents:UIControlEventTouchUpInside]; [btn addTarget:self action:@selector(addNewButton:) forControlEvents:UIControlEventTouchUpInside];
[btn setTitleColor:kLightGray forState:UIControlStateNormal]; [btn setTitleColor:kLightGray forState:UIControlStateNormal];
...@@ -47,7 +47,11 @@ ...@@ -47,7 +47,11 @@
{ {
UIButton *addBtn = [UIButton buttonWithType:UIButtonTypeCustom]; UIButton *addBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[addBtn setImage:image forState:UIControlStateNormal]; [addBtn setImage:image forState:UIControlStateNormal];
addBtn.imageEdgeInsets = UIEdgeInsetsMake(2, 2, 2, 2);
addBtn.tag = self.subviews.count; addBtn.tag = self.subviews.count;
addBtn.backgroundColor = [UIColor whiteColor];
addBtn.layer.borderWidth = 0.5;
addBtn.layer.borderColor = kSeparateLineCGColor;
// 添加长按手势,用作删除. 加号按钮不添加 // 添加长按手势,用作删除. 加号按钮不添加
if(addBtn.tag != 0) { if(addBtn.tag != 0) {
UILongPressGestureRecognizer *gester = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress:)]; UILongPressGestureRecognizer *gester = [[UILongPressGestureRecognizer alloc] initWithTarget:self action:@selector(longPress:)];
......
...@@ -7,7 +7,9 @@ ...@@ -7,7 +7,9 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "TaskModel.h"
@interface InspectSettleViewController : UIViewController @interface InspectSettleViewController : UIViewController
@property (nonatomic, assign) int questionCount;
@property (nonatomic, strong) TaskModel *taskModel;
@end @end
...@@ -26,9 +26,10 @@ ...@@ -26,9 +26,10 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 40, 30)]; UILabel *customLab = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 30)];
[customLab setTextColor:[UIColor whiteColor]]; [customLab setTextColor:[UIColor whiteColor]];
[customLab setText:@"已上报"]; customLab.textAlignment = NSTextAlignmentCenter;
[customLab setText:[NSString stringWithFormat:@"检查点--%@(%@/%d)", self.taskModel.category, self.taskModel.lineNo, self.questionCount]];
customLab.font = [UIFont boldSystemFontOfSize:19]; customLab.font = [UIFont boldSystemFontOfSize:19];
self.navigationItem.titleView = customLab; self.navigationItem.titleView = customLab;
...@@ -148,13 +149,31 @@ ...@@ -148,13 +149,31 @@
if (!cell) { if (!cell) {
cell = [[InspectSettleCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kInspectSettleCell]; cell = [[InspectSettleCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kInspectSettleCell];
} }
cell.titleLabel.text = @"3:广场吊旗"; cell.titleLabel.text = [NSString stringWithFormat:@"%@", _taskModel.title];
cell.titleDetailLabel.text = @"要求图片3张"; cell.titleDetailLabel.text = [NSString stringWithFormat:@"要求图片%d张", _taskModel.attachmentNumber];
cell.introLabel.text = @"参考说明"; cell.introLabel.text = @"参考说明";
cell.introDetailLabel.text = @"字体以简体中文为主;内容贴近活动主题;悬挂牢固,以不影响顾客浏览体验为佳"; cell.introDetailLabel.text = [self filterHTML:[NSString stringWithFormat:@"%@", _taskModel.reference]];
return cell; return cell;
} }
- (NSString *)filterHTML:(NSString *)html
{
NSScanner * scanner = [NSScanner scannerWithString:html];
NSString * text = nil;
while([scanner isAtEnd]==NO)
{
//找到标签的起始位置
[scanner scanUpToString:@"<" intoString:nil];
//找到标签的结束位置
[scanner scanUpToString:@">" intoString:&text];
//替换字符
html = [html stringByReplacingOccurrencesOfString:[NSString stringWithFormat:@"%@>",text] withString:@""];
}
// NSString * regEx = @"<([^>]*)>";
// html = [html stringByReplacingOccurrencesOfString:regEx withString:@""];
return html;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{ {
...@@ -210,4 +229,8 @@ ...@@ -210,4 +229,8 @@
return _footerView; return _footerView;
} }
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
[self.view endEditing:YES];
}
@end @end
//
// InspectTableView.h
// redstar
//
// Created by admin on 15/11/24.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import <UIKit/UIKit.h>
@protocol InspectTableViewDelegate <NSObject>
- (void)inspectTableViewDidSelectWithRow:(NSInteger)row;
@end
@interface InspectTableView : UITableView
@property (nonatomic, weak) id <InspectTableViewDelegate> inspectDelegate;
@end
//
// InspectTableView.m
// redstar
//
// Created by admin on 15/11/24.
// Copyright © 2015年 ZWF. All rights reserved.
//
#import "InspectTableView.h"
#define kInspectViewCell @"screenInspectTableCell"
@interface InspectTableView () <UITableViewDelegate, UITableViewDataSource>
@property (nonatomic, strong) NSArray *testArray;
@end
@implementation InspectTableView
- (instancetype)initWithFrame:(CGRect)frame
{
self = [super initWithFrame:frame];
if (self) {
self.testArray = [NSArray arrayWithObjects:@"全部", @"未处理",@"进行中",@"已上报",@"已评分", @"已发布", @"已过期",nil];
[self setup];
}
return self;
}
- (void)setup {
self.delegate = self;
self.dataSource = self;
[self registerClass:[UITableViewCell class] forCellReuseIdentifier:kInspectViewCell];
}
#pragma mark - UITabelViewDelgate / DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return _testArray.count;
}
// cell显示的内容
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:kInspectViewCell];
if (!cell) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:kInspectViewCell];
}
cell.textLabel.text = _testArray[indexPath.row];
cell.textLabel.font = [UIFont systemFontOfSize:14.0];
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"iconfont-duigou2"]];
imageView.translatesAutoresizingMaskIntoConstraints = NO;
[cell.contentView addSubview:imageView];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:imageView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:cell.contentView attribute:NSLayoutAttributeTop multiplier:1.0 constant:15];
[cell.contentView addConstraint:tableTop];
NSLayoutConstraint *tableRight = [NSLayoutConstraint constraintWithItem:imageView attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:cell.contentView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-5];
[cell.contentView addConstraint:tableRight];
NSLayoutConstraint *tableWidth = [NSLayoutConstraint constraintWithItem:imageView attribute:NSLayoutAttributeWidth relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:19];
[cell.contentView addConstraint:tableWidth];
NSLayoutConstraint *tableHeight = [NSLayoutConstraint constraintWithItem:imageView attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:14];
[cell.contentView addConstraint:tableHeight];
return cell;
}
// cell的点击事件
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if (_inspectDelegate) {
[_inspectDelegate inspectTableViewDidSelectWithRow:indexPath.row];
}
}
@end
...@@ -12,7 +12,6 @@ ...@@ -12,7 +12,6 @@
#import "InspectTaskViewController.h" #import "InspectTaskViewController.h"
#import "HttpClient.h" #import "HttpClient.h"
#import "MenuView.h" #import "MenuView.h"
#import "MenuButton.h" #import "MenuButton.h"
#import "TaxisView.h" #import "TaxisView.h"
...@@ -26,7 +25,7 @@ ...@@ -26,7 +25,7 @@
#define kInspectListCell @"InspectListCellTableViewCell" #define kInspectListCell @"InspectListCellTableViewCell"
@interface InspectListViewController ()<UITableViewDelegate, UITableViewDataSource, ScreenTableDelegate , TaxisViewDelegate> @interface InspectListViewController ()<UITableViewDelegate, UITableViewDataSource, ScreenTableDelegate , TaxisViewDelegate, InspectTableViewDelegate>
@property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) MenuView *menuView; @property (nonatomic, strong) MenuView *menuView;
...@@ -41,6 +40,9 @@ ...@@ -41,6 +40,9 @@
@property (nonatomic, strong) NSMutableArray *taskListDataArray; @property (nonatomic, strong) NSMutableArray *taskListDataArray;
@property (nonatomic, assign) NSInteger selectRow; @property (nonatomic, assign) NSInteger selectRow;
@property (nonatomic, assign) NSInteger timeSelectNum;
@property (nonatomic, strong) NoDataView *noDataView; @property (nonatomic, strong) NoDataView *noDataView;
@end @end
...@@ -80,7 +82,6 @@ ...@@ -80,7 +82,6 @@
[self requestInspectList]; [self requestInspectList];
} }
- (void)viewWillAppear:(BOOL)animated - (void)viewWillAppear:(BOOL)animated
...@@ -121,9 +122,9 @@ ...@@ -121,9 +122,9 @@
NSString *url = [NSString stringWithFormat:@"%@%@", kRedStarURL, kInspectListURL]; NSString *url = [NSString stringWithFormat:@"%@%@", kRedStarURL, kInspectListURL];
HttpClient *httpCilent = [[HttpClient alloc] initWithUrl:url]; HttpClient *httpCilent = [[HttpClient alloc] initWithUrl:url];
NSDictionary *parameters = @{@"userUuid":@"", NSDictionary *parameters = @{@"userUuid":@"",
@"beginDateFrom":@"", // @"beginDateFrom":@"",
@"endDateTo":@"", // @"endDateTo":@"",
@"nameLike":@"", // @"nameLike":@"",
@"queryOrders":@[@{@"field":@"lastModifyInfo"}], @"queryOrders":@[@{@"field":@"lastModifyInfo"}],
@"pageNumber":@(0), @"pageNumber":@(0),
@"pageSize":@(10) @"pageSize":@(10)
...@@ -167,7 +168,6 @@ ...@@ -167,7 +168,6 @@
} else { } else {
[self showGreenView]; [self showGreenView];
} }
// [sender setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];
sender.selected = YES; sender.selected = YES;
} else { } else {
...@@ -176,7 +176,6 @@ ...@@ -176,7 +176,6 @@
} else { } else {
[self closeGreenView]; [self closeGreenView];
} }
// [sender setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal];
sender.selected = NO; sender.selected = NO;
} }
...@@ -185,8 +184,6 @@ ...@@ -185,8 +184,6 @@
_selctedButton.selected = NO; _selctedButton.selected = NO;
_selctedButton.isDrop = NO; _selctedButton.isDrop = NO;
// 进行选中状态为NO 的操作 // 进行选中状态为NO 的操作
// 1.将发生“选中”->“未选中”状态变化的按钮文字由Orange->White
// [_selctedButton setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal];
// 2.判断当前是否有bgView 有->移除, 没有->跳过 // 2.判断当前是否有bgView 有->移除, 没有->跳过
if (_bgView) { if (_bgView) {
// _bgView存在 // _bgView存在
...@@ -208,8 +205,6 @@ ...@@ -208,8 +205,6 @@
// 将当前选中的按钮设置 选中状态为YES; // 将当前选中的按钮设置 选中状态为YES;
sender.selected = YES; sender.selected = YES;
// 对选中按钮 进行相关操作 // 对选中按钮 进行相关操作
// 1.将选中按钮的文字设置为Orange
// [sender setTitleColor:[UIColor orangeColor] forState:UIControlStateNormal];
_selctedButton = (MenuButton *)sender; _selctedButton = (MenuButton *)sender;
if (sender.tag == 4001) { if (sender.tag == 4001) {
...@@ -252,7 +247,7 @@ ...@@ -252,7 +247,7 @@
- (void)closeRedView - (void)closeRedView
{ {
_selctedButton.isDrop = NO; _selctedButton.isDrop = NO;
[_selctedButton setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal]; _selctedButton.selected = NO;
CGRect fromFrame = CGRectMake(0, -kTaxisViewHeight, kScreenWidth, kTaxisViewHeight); CGRect fromFrame = CGRectMake(0, -kTaxisViewHeight, kScreenWidth, kTaxisViewHeight);
[UIView animateWithDuration:0.3 animations:^{ [UIView animateWithDuration:0.3 animations:^{
_bgView.alpha = .0f; _bgView.alpha = .0f;
...@@ -274,11 +269,13 @@ ...@@ -274,11 +269,13 @@
if (!_screenView) { if (!_screenView) {
_screenView = [[ScreenView alloc] init]; _screenView = [[ScreenView alloc] init];
_screenView.delegate = self; _screenView.delegate = self;
_screenView.inspectTableView.inspectDelegate = self;
_screenView.backgroundColor = [UIColor whiteColor]; _screenView.backgroundColor = [UIColor whiteColor];
} }
[_screenView.resetBtn addTarget:self action:@selector(resetClick:) forControlEvents:UIControlEventTouchUpInside]; [_screenView.resetBtn addTarget:self action:@selector(resetClick:) forControlEvents:UIControlEventTouchUpInside];
[_screenView.submitBtn addTarget:self action:@selector(submitClick:) forControlEvents:UIControlEventTouchUpInside]; [_screenView.submitBtn addTarget:self action:@selector(submitClick:) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:_bgView]; [self.view addSubview:_bgView];
[self.view insertSubview:_screenView aboveSubview:_bgView]; [self.view insertSubview:_screenView aboveSubview:_bgView];
...@@ -299,6 +296,7 @@ ...@@ -299,6 +296,7 @@
- (void)closeGreenView - (void)closeGreenView
{ {
_selctedButton.isDrop = NO; _selctedButton.isDrop = NO;
_selctedButton.selected = NO;
[_selctedButton setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal]; [_selctedButton setTitleColor:kInspectSectionButtonTextColor forState:UIControlStateNormal];
CGRect fromFrame = CGRectMake(0, -kScreenViewHeight, kScreenWidth, kScreenViewHeight); CGRect fromFrame = CGRectMake(0, -kScreenViewHeight, kScreenWidth, kScreenViewHeight);
[UIView animateWithDuration:0.3 animations:^{ [UIView animateWithDuration:0.3 animations:^{
...@@ -316,7 +314,12 @@ ...@@ -316,7 +314,12 @@
NSInteger selectedIndex = 0; NSInteger selectedIndex = 0;
NSIndexPath *selectedIndexPath = [NSIndexPath indexPathForRow:selectedIndex inSection:0]; NSIndexPath *selectedIndexPath = [NSIndexPath indexPathForRow:selectedIndex inSection:0];
[_screenView.tableView selectRowAtIndexPath:selectedIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone]; [_screenView.tableView selectRowAtIndexPath:selectedIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
_screenView.textView.text = @""; _screenView.textView.text = @"";
NSInteger timeIndex = 0;
NSIndexPath *timeIndexPath = [NSIndexPath indexPathForRow:timeIndex inSection:0];
[_screenView.tableView selectRowAtIndexPath:timeIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
_selectRow = 0; _selectRow = 0;
} }
// 提交按钮 // 提交按钮
...@@ -330,26 +333,32 @@ ...@@ -330,26 +333,32 @@
if (_selectRow == 0) { if (_selectRow == 0) {
} else if (_selectRow == 1) { } else if (_selectRow == 1) {
_screenView.textView.text = @"";
[parameters setObject:@"initial" forKey:@"state"]; [parameters setObject:@"initial" forKey:@"state"];
NSArray *array = @[@{@"field":@"state"}]; NSArray *array = @[@{@"field":@"state"}];
[parameters setObject:array forKey:@"queryOrders"]; [parameters setObject:array forKey:@"queryOrders"];
} else if (_selectRow == 2) { } else if (_selectRow == 2) {
_screenView.textView.text = @"";
[parameters setObject:@"processing" forKey:@"state"]; [parameters setObject:@"processing" forKey:@"state"];
NSArray *array = @[@{@"field":@"state"}]; NSArray *array = @[@{@"field":@"state"}];
[parameters setObject:array forKey:@"queryOrders"]; [parameters setObject:array forKey:@"queryOrders"];
} else if (_selectRow == 3) { } else if (_selectRow == 3) {
_screenView.textView.text = @"";
[parameters setObject:@"reported" forKey:@"state"]; [parameters setObject:@"reported" forKey:@"state"];
NSArray *array = @[@{@"field":@"state"}]; NSArray *array = @[@{@"field":@"state"}];
[parameters setObject:array forKey:@"queryOrders"]; [parameters setObject:array forKey:@"queryOrders"];
} else if (_selectRow == 4) { } else if (_selectRow == 4) {
_screenView.textView.text = @"";
[parameters setObject:@"finished" forKey:@"state"]; [parameters setObject:@"finished" forKey:@"state"];
NSArray *array = @[@{@"field":@"state"}]; NSArray *array = @[@{@"field":@"state"}];
[parameters setObject:array forKey:@"queryOrders"]; [parameters setObject:array forKey:@"queryOrders"];
} else if (_selectRow == 5) { } else if (_selectRow == 5) {
_screenView.textView.text = @"";
[parameters setObject:@"published" forKey:@"state"]; [parameters setObject:@"published" forKey:@"state"];
NSArray *array = @[@{@"field":@"state"}]; NSArray *array = @[@{@"field":@"state"}];
[parameters setObject:array forKey:@"queryOrders"]; [parameters setObject:array forKey:@"queryOrders"];
} else if (_selectRow == 6){ } else if (_selectRow == 6){
_screenView.textView.text = @"";
[parameters setObject:@"expired" forKey:@"state"]; [parameters setObject:@"expired" forKey:@"state"];
NSArray *array = @[@{@"field":@"state"}]; NSArray *array = @[@{@"field":@"state"}];
[parameters setObject:array forKey:@"queryOrders"]; [parameters setObject:array forKey:@"queryOrders"];
...@@ -410,10 +419,16 @@ ...@@ -410,10 +419,16 @@
} }
#pragma mark - InspectTableViewDelegate
- (void)inspectTableViewDidSelectWithRow:(NSInteger)row
{
_selectRow = row;
}
#pragma mark - ScreenDelegate #pragma mark - ScreenDelegate
- (void)tableViewDidSelectRow:(NSInteger)row - (void)tableViewDidSelectRow:(NSInteger)row
{ {
_selectRow = row; NSLog(@"row == %ld", (long)row);
} }
#pragma mark - TaxisDelegate #pragma mark - TaxisDelegate
- (void)timeChange:(UIButton *)sender - (void)timeChange:(UIButton *)sender
...@@ -437,9 +452,6 @@ ...@@ -437,9 +452,6 @@
} }
NSDictionary *parameters = @{@"userUuid":@"", NSDictionary *parameters = @{@"userUuid":@"",
@"beginDateFrom":@"",
@"endDateTo":@"",
@"nameLike":@"",
@"queryOrders":queryOrders, @"queryOrders":queryOrders,
@"pageNumber":@(0), @"pageNumber":@(0),
@"pageSize":@(10) @"pageSize":@(10)
......
...@@ -34,7 +34,7 @@ ...@@ -34,7 +34,7 @@
self.stateLabel.text = [NSString stringWithFormat:@"未上报"]; self.stateLabel.text = [NSString stringWithFormat:@"未上报"];
} else if (task.state == 1) { } else if (task.state == 1) {
self.stateLabel.textColor = [UIColor orangeColor]; self.stateLabel.textColor = kNavigationBarColor;
self.stateLabel.text = [NSString stringWithFormat:@"已上报"]; self.stateLabel.text = [NSString stringWithFormat:@"已上报"];
} else { } else {
self.stateLabel.textColor = [UIColor orangeColor]; self.stateLabel.textColor = [UIColor orangeColor];
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
@property (nonatomic, copy) NSString *answerAttachmentId; @property (nonatomic, copy) NSString *answerAttachmentId;
@property (nonatomic, strong) NSArray *answerAttachments; @property (nonatomic, strong) NSArray *answerAttachments;
@property (nonatomic, copy) NSString *attachmentId; @property (nonatomic, copy) NSString *attachmentId;
@property (nonatomic, copy) NSString *attachmentNumber; @property (nonatomic, assign) int attachmentNumber;
@property (nonatomic, copy) NSString *category; @property (nonatomic, copy) NSString *category;
@property (nonatomic, copy) NSString *lineNo; @property (nonatomic, copy) NSString *lineNo;
@property (nonatomic, copy) NSString *readonly; @property (nonatomic, copy) NSString *readonly;
......
...@@ -102,6 +102,30 @@ ...@@ -102,6 +102,30 @@
self.detailView.startDateLabel.text = [NSString stringWithFormat:@"%@", taskDetail.beginDate]; self.detailView.startDateLabel.text = [NSString stringWithFormat:@"%@", taskDetail.beginDate];
self.detailView.overDateLabel.text = [NSString stringWithFormat:@"%@", taskDetail.endDate]; self.detailView.overDateLabel.text = [NSString stringWithFormat:@"%@", taskDetail.endDate];
self.detailView.multiplier = (CGFloat)taskDetail.reportCount / taskDetail.questionCount; self.detailView.multiplier = (CGFloat)taskDetail.reportCount / taskDetail.questionCount;
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"yyyy-MM-dd"];
// 当前时间
NSDate *date = [NSDate date];
NSTimeZone *zone = [NSTimeZone systemTimeZone];
NSInteger interval = [zone secondsFromGMTForDate: date];
NSDate *localeDate = [date dateByAddingTimeInterval: interval];
NSString *strDate = [dateFormatter stringFromDate:localeDate];
NSDate *today = [dateFormatter dateFromString:strDate];
NSLog(@"today = %@", today);
// endTime
NSDate *endTime = [dateFormatter dateFromString:[NSString stringWithFormat:@"%@", taskDetail.endDate]];
NSLog(@"endTime = %@", endTime);
NSCalendar *cal = [NSCalendar currentCalendar];
unsigned int unitFlags = NSYearCalendarUnit | NSMonthCalendarUnit | NSDayCalendarUnit;
NSDateComponents *d = [cal components:unitFlags fromDate:today toDate:endTime options:0];
if (d.day > 0) {
self.detailView.dayLabel.text = [NSString stringWithFormat:@"%ld", (long)d.day];
} else {
self.detailView.dayLabel.text = @"0";
}
if ([taskDetail.state isEqualToString:@"initial"]) { if ([taskDetail.state isEqualToString:@"initial"]) {
self.detailView.progressLabel.text = [NSString stringWithFormat:@"未处理 %.0f%%", (CGFloat)taskDetail.reportCount / taskDetail.questionCount * 100]; self.detailView.progressLabel.text = [NSString stringWithFormat:@"未处理 %.0f%%", (CGFloat)taskDetail.reportCount / taskDetail.questionCount * 100];
self.detailView.progressLabel.textColor = kProgressUnSettledColor; self.detailView.progressLabel.textColor = kProgressUnSettledColor;
...@@ -143,6 +167,8 @@ ...@@ -143,6 +167,8 @@
} }
- (InspectDetailView *)detailView - (InspectDetailView *)detailView
{ {
if (!_detailView) { if (!_detailView) {
......
...@@ -66,7 +66,7 @@ ...@@ -66,7 +66,7 @@
- (void)setTaskGroup:(TaskGroup *)taskGroup - (void)setTaskGroup:(TaskGroup *)taskGroup
{ {
_taskGroup = taskGroup; _taskGroup = taskGroup;
NSString *nameStr = [NSString stringWithFormat:@"模块 -- %@(10/%lu)", taskGroup.category, (unsigned long)taskGroup.answers.count]; NSString *nameStr = [NSString stringWithFormat:@"模块 -- %@(%d/%d)", taskGroup.category, taskGroup.reportCount, taskGroup.questionCount];
NSMutableAttributedString *nameAttr = [[NSMutableAttributedString alloc] initWithString:nameStr]; NSMutableAttributedString *nameAttr = [[NSMutableAttributedString alloc] initWithString:nameStr];
[nameAttr addAttributes:@{NSForegroundColorAttributeName:kLightBlack,NSFontAttributeName:[UIFont systemFontOfSize:17.0f]} range:NSMakeRange(0,nameStr.length)]; [nameAttr addAttributes:@{NSForegroundColorAttributeName:kLightBlack,NSFontAttributeName:[UIFont systemFontOfSize:17.0f]} range:NSMakeRange(0,nameStr.length)];
[_bgButton setAttributedTitle:nameAttr forState:UIControlStateNormal]; [_bgButton setAttributedTitle:nameAttr forState:UIControlStateNormal];
......
...@@ -148,7 +148,7 @@ ...@@ -148,7 +148,7 @@
TaskModel *task = taskGroup.answers[indexPath.row]; TaskModel *task = taskGroup.answers[indexPath.row];
cell.task = task; cell.task = task;
cell.titleLabel.text = [NSString stringWithFormat:@"%d、%@", (int)(indexPath.row + 1) ,task.title]; cell.titleLabel.text = [NSString stringWithFormat:@"%@、%@", task.lineNo ,task.title];
cell.selectionStyle = UITableViewCellSelectionStyleNone; cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
...@@ -157,8 +157,19 @@ ...@@ -157,8 +157,19 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{ {
InspectSettleViewController *inspectVC = [[InspectSettleViewController alloc] init]; TaskGroup *taskGroup = _taskData[indexPath.section];
[self.navigationController pushViewController:inspectVC animated:YES]; TaskModel *task = taskGroup.answers[indexPath.row];
if (task.readonly) {
InspectSettleViewController *inspectVC = [[InspectSettleViewController alloc] init];
inspectVC.questionCount = taskGroup.questionCount;
inspectVC.taskModel = task;
[self.navigationController pushViewController:inspectVC animated:YES];
} else {
}
} }
// cell的高度 // cell的高度
...@@ -221,9 +232,6 @@ ...@@ -221,9 +232,6 @@
{ {
if (!_detailHeaderView) { if (!_detailHeaderView) {
_detailHeaderView = [[InspectDetailHeaderView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 285)]; _detailHeaderView = [[InspectDetailHeaderView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 285)];
_detailHeaderView.detailView.dayLabel.text = @"3";
} }
return _detailHeaderView; return _detailHeaderView;
} }
......
...@@ -18,6 +18,7 @@ ...@@ -18,6 +18,7 @@
#import "TaskModel.h" #import "TaskModel.h"
#import "TaskDetailModel.h" #import "TaskDetailModel.h"
#import "CheckPicViewController.h" #import "CheckPicViewController.h"
#import "CommentView.h"
#import <UIButton+WebCache.h> #import <UIButton+WebCache.h>
...@@ -29,8 +30,12 @@ ...@@ -29,8 +30,12 @@
@property (nonatomic, strong) RankDetailHeaderView *rankDetailHeaderView; @property (nonatomic, strong) RankDetailHeaderView *rankDetailHeaderView;
@property (nonatomic, strong) NSMutableArray *taskData; @property (nonatomic, strong) NSMutableArray *taskData;
@property (nonatomic, strong) UIView *footerView;
@property (nonatomic, strong) NSMutableDictionary *selectedIndexes; // 存放二次展开的cell @property (nonatomic, strong) NSMutableDictionary *selectedIndexes; // 存放二次展开的cell
@property (nonatomic, strong) UIButton *commentButton;
@property (nonatomic, strong) UIView *backGroundView;
@property (nonatomic, strong) CommentView *commentView;
@end @end
...@@ -47,7 +52,7 @@ ...@@ -47,7 +52,7 @@
{ {
[super viewDidLoad]; [super viewDidLoad];
self.view.backgroundColor = [UIColor lightGrayColor]; self.view.backgroundColor = [UIColor whiteColor];
if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) { if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 7.0) {
self.edgesForExtendedLayout = UIRectEdgeNone; self.edgesForExtendedLayout = UIRectEdgeNone;
...@@ -74,6 +79,8 @@ ...@@ -74,6 +79,8 @@
self.selectedIndexes = [[NSMutableDictionary alloc] init]; self.selectedIndexes = [[NSMutableDictionary alloc] init];
// 请求口碑排名详情 // 请求口碑排名详情
[self requestRankingDetail]; [self requestRankingDetail];
[self.commentButton setTitle:@"添加评论" forState:UIControlStateNormal];
} }
...@@ -113,8 +120,93 @@ ...@@ -113,8 +120,93 @@
}]; }];
} }
- (void)addComment:(UIButton *)sender
{
if (!_backGroundView) {
_backGroundView = [[UIView alloc] initWithFrame:self.view.bounds];
UITapGestureRecognizer *tapGR = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(closeBackGroundView)];
[_backGroundView addGestureRecognizer:tapGR];
}
if (!_commentView) {
_commentView = [[CommentView alloc] init];
_commentView.backgroundColor = [UIColor whiteColor];
}
_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];
[self.view insertSubview:_commentView aboveSubview:_backGroundView];
_backGroundView.alpha = 0;
_backGroundView.backgroundColor = [UIColor blackColor];
CGRect toFrame = CGRectMake(0, self.view.frame.size.height - kCommentViewHeight, kScreenWidth, kCommentViewHeight);
CGRect fromFrame = CGRectMake(0, kScreenHeight, kScreenWidth, kCommentViewHeight);
_commentView.frame = fromFrame;
[UIView animateWithDuration:0.3 animations:^{
_backGroundView.alpha = 0.6;
_commentView.frame = toFrame;
}];
}
// 提交评论
- (void)submitComment:(UIButton *)sender
{
NSDate *date = [NSDate date];
NSTimeZone *zone = [NSTimeZone systemTimeZone];
NSInteger interval = [zone secondsFromGMTForDate:date];
NSDate *localeDate = [date dateByAddingTimeInterval:interval];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"YYYY-MM-dd+hh:mm:ss"];
NSString *dateString = [dateFormatter stringFromDate:localeDate];
NSString *operId = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_code"];
NSString *operName = [[NSUserDefaults standardUserDefaults] objectForKey:@"user_name"];
NSString *url = [NSString stringWithFormat:@"%@%@?time=%@&operId=%@&operName=%@", kRedStarURL, kAddCommentURL , dateString , operId, operName];
url = [url stringByAddingPercentEscapesUsingEncoding: NSUTF8StringEncoding];
NSLog(@"url = %@", url);
HttpClient *httpClient = [[HttpClient alloc] initWithUrl:url];
NSDictionary *parameters = @{@"entityType":@"question",
@"entityUuid":self.uuid,
@"comment":_commentView.contentTextView.text};
NSLog(@"parameters = %@", parameters);
[MBProgressHUD showHUDAddedTo:self.view animated:YES];
[httpClient submitCommentWithParameters:parameters completion:^(id response, NSError *error) {
NSLog(@"respo = %@, error = %@", response , error);
if ([response[@"message"] isEqualToString:@"ok"]) {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示" message:@"添加评论成功" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
alert.delegate = self;
[alert show];
[MBProgressHUD hideHUDForView:self.view animated:YES];
} else {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"警告" message:@"添加评论失败" delegate:self cancelButtonTitle:nil otherButtonTitles:@"确定", nil];
[alert show];
[MBProgressHUD hideHUDForView:self.view animated:YES];
}
}];
[self closeBackGroundView];
}
- (void)closeBackGroundView
{
CGRect fromFrame = CGRectMake(0, kScreenHeight, kScreenWidth, kCommentViewHeight);
[UIView animateWithDuration:0.3 animations:^{
_backGroundView.alpha = .0f;
_commentView.frame = fromFrame;
} completion:^(BOOL finished) {
[_backGroundView removeFromSuperview];
[_commentView removeFromSuperview];
}];
}
// 返回上一页面 // 返回上一页面
- (void)doBack:(UIBarButtonItem *)sender - (void)doBack:(UIBarButtonItem *)sender
{ {
...@@ -327,6 +419,7 @@ ...@@ -327,6 +419,7 @@
_tableView.dataSource = self; _tableView.dataSource = self;
_tableView.showsVerticalScrollIndicator = NO; _tableView.showsVerticalScrollIndicator = NO;
_tableView.showsHorizontalScrollIndicator = NO; _tableView.showsHorizontalScrollIndicator = NO;
_tableView.tableFooterView = self.footerView;
[self.view addSubview:_tableView]; [self.view addSubview:_tableView];
NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0]; NSLayoutConstraint *tableTop = [NSLayoutConstraint constraintWithItem:_tableView attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeTop multiplier:1.0 constant:0];
...@@ -365,6 +458,46 @@ ...@@ -365,6 +458,46 @@
return _rankDetailHeaderView; return _rankDetailHeaderView;
} }
- (UIView *)footerView
{
if (!_footerView) {
_footerView = [[UIView alloc] initWithFrame:CGRectMake(0, 0, kScreenWidth, 60)];
}
return _footerView;
}
- (UIButton *)commentButton
{
if (!_commentButton) {
_commentButton = [[UIButton alloc] init];
// 设置圆角
_commentButton.layer.cornerRadius = 5;
_commentButton.translatesAutoresizingMaskIntoConstraints = NO;
_commentButton.backgroundColor = kLoginButtonBackGroundColor;
[_commentButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[_commentButton addTarget:self action:@selector(addComment:) forControlEvents:UIControlEventTouchUpInside];
_commentButton.titleLabel.font = [UIFont systemFontOfSize:20.0];
[self.footerView addSubview:_commentButton];
// 顶端
NSLayoutConstraint *loginTop = [NSLayoutConstraint constraintWithItem:_commentButton attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.footerView attribute:NSLayoutAttributeTop multiplier:1.0 constant:20];
[self.footerView addConstraint:loginTop];
// 左边
NSLayoutConstraint *loginLeft = [NSLayoutConstraint constraintWithItem:_commentButton attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.footerView attribute:NSLayoutAttributeLeft multiplier:1.0 constant:20];
[self.footerView addConstraint:loginLeft];
// 右边
NSLayoutConstraint *loginRight = [NSLayoutConstraint constraintWithItem:_commentButton attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.footerView attribute:NSLayoutAttributeRight multiplier:1.0 constant:-20];
[self.footerView addConstraint:loginRight];
// 高度
NSLayoutConstraint *loginHeight = [NSLayoutConstraint constraintWithItem:_commentButton attribute:NSLayoutAttributeHeight relatedBy:NSLayoutRelationEqual toItem:nil attribute:NSLayoutAttributeNotAnAttribute multiplier:1.0 constant:40];
[self.footerView addConstraint:loginHeight];
}
return _commentButton;
}
/* /*
#pragma mark - Navigation #pragma mark - Navigation
......
...@@ -242,6 +242,10 @@ ...@@ -242,6 +242,10 @@
return _dropTableView; return _dropTableView;
} }
- (void)touchesEnded:(NSSet *)touches withEvent:(UIEvent *)event {
[self.view endEditing:YES];
}
......
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "GroupTabBar.h" #import "GroupTabBar.h"
#import "InspectTableView.h"
@protocol ScreenTableDelegate <NSObject> @protocol ScreenTableDelegate <NSObject>
...@@ -21,7 +22,7 @@ ...@@ -21,7 +22,7 @@
@property (nonatomic, strong) UITableView *tableView; @property (nonatomic, strong) UITableView *tableView;
@property (nonatomic, strong) UITextView *textView; @property (nonatomic, strong) UITextView *textView;
@property (nonatomic, strong) UIView *cyanView; @property (nonatomic, strong) InspectTableView *inspectTableView;
@property (nonatomic, strong) UIButton *resetBtn; // 重置 @property (nonatomic, strong) UIButton *resetBtn; // 重置
@property (nonatomic, strong) UIButton *submitBtn; // 提交 @property (nonatomic, strong) UIButton *submitBtn; // 提交
......
...@@ -42,19 +42,18 @@ ...@@ -42,19 +42,18 @@
- (void)setup - (void)setup
{ {
self.testArray = [NSArray arrayWithObjects:@"全部", @"未处理",@"进行中",@"已上报",@"已评分", @"已发布", @"已过期",nil]; self.testArray = [NSArray arrayWithObjects:@"一周", @"一个月",@"三个月",@"一年",@"历史更多",nil];
self.groupTabBar = [[GroupTabBar alloc] initWithFrame:CGRectMake(0, 0, 100, 180)]; self.groupTabBar = [[GroupTabBar alloc] initWithFrame:CGRectMake(0, 0, 100, 180)];
_groupTabBar.delegate = self; _groupTabBar.delegate = self;
[self addSubview:_groupTabBar]; [self addSubview:_groupTabBar];
self.tableView = [[UITableView alloc] init]; self.inspectTableView = [[InspectTableView alloc] init];
_tableView.delegate = self; NSInteger inspectIndex = 0;
_tableView.dataSource = self; NSIndexPath *inspectIndexPath = [NSIndexPath indexPathForRow:inspectIndex inSection:0];
NSInteger selectedIndex = 0; [_inspectTableView selectRowAtIndexPath:inspectIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
NSIndexPath *selectedIndexPath = [NSIndexPath indexPathForRow:selectedIndex inSection:0]; GroupItems *cyanItem = [[GroupItems alloc] initWithTitle:@"状态等于" view:_inspectTableView];
[_tableView selectRowAtIndexPath:selectedIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
GroupItems *tableItem = [[GroupItems alloc] initWithTitle:@"状态等于" view:_tableView];
self.textView = [[UITextView alloc] init]; self.textView = [[UITextView alloc] init];
_textView.delegate = self; _textView.delegate = self;
...@@ -66,16 +65,21 @@ ...@@ -66,16 +65,21 @@
GroupItems *textItem = [[GroupItems alloc] initWithTitle:@"标题类似于" view:_textView]; GroupItems *textItem = [[GroupItems alloc] initWithTitle:@"标题类似于" view:_textView];
self.cyanView = [[UIView alloc] init];
GroupItems *cyanItem = [[GroupItems alloc] initWithTitle:@"单号等于" view:_cyanView];
[self insertSubview:_tableView belowSubview:_groupTabBar];
self.tableView = [[UITableView alloc] init];
_tableView.delegate = self;
_tableView.dataSource = self;
NSInteger selectedIndex = 0;
NSIndexPath *selectedIndexPath = [NSIndexPath indexPathForRow:selectedIndex inSection:0];
[_tableView selectRowAtIndexPath:selectedIndexPath animated:NO scrollPosition:UITableViewScrollPositionNone];
GroupItems *tableItem = [[GroupItems alloc] initWithTitle:@"时间范围" view:_tableView];
[self insertSubview:_inspectTableView belowSubview:_groupTabBar];
[self insertSubview:_textView belowSubview:_groupTabBar]; [self insertSubview:_textView belowSubview:_groupTabBar];
[self insertSubview:_cyanView belowSubview:_groupTabBar]; [self insertSubview:_tableView belowSubview:_groupTabBar];
_groupTabBar.items = @[tableItem, textItem, cyanItem]; _groupTabBar.items = @[cyanItem, textItem, tableItem];
[_groupTabBar showIndex:0]; [_groupTabBar showIndex:0];
self.backView.backgroundColor = [UIColor whiteColor]; self.backView.backgroundColor = [UIColor whiteColor];
...@@ -84,22 +88,6 @@ ...@@ -84,22 +88,6 @@
} }
#pragma mark - UITextView Delegate
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
if (![text isEqualToString:@""]) {
_placeholderLabel1.hidden = YES;
}
if ([text isEqualToString:@""] && range.location == 0 && range.length == 1) {
_placeholderLabel1.hidden = NO;
}
return YES;
}
#pragma mark - UITabelViewDelgate / DataSource #pragma mark - UITabelViewDelgate / DataSource
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{ {
...@@ -118,7 +106,7 @@ ...@@ -118,7 +106,7 @@
cell.textLabel.font = [UIFont systemFontOfSize:14.0]; cell.textLabel.font = [UIFont systemFontOfSize:14.0];
UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"iconfont-duigou2"]]; UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"iconfont-duigou2"]];
imageView.frame = CGRectMake(kScreenWidth - self.groupTabBar.frame.size.width - 30, 15, 19, 14); imageView.frame = CGRectMake(kScreenWidth - self.groupTabBar.frame.size.width-30 , 15, 19, 14);
[cell.contentView addSubview:imageView]; [cell.contentView addSubview:imageView];
return cell; return cell;
...@@ -133,6 +121,22 @@ ...@@ -133,6 +121,22 @@
} }
} }
#pragma mark - UITextView Delegate
- (BOOL)textView:(UITextView *)textView shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text {
if (![text isEqualToString:@""]) {
_placeholderLabel1.hidden = YES;
}
if ([text isEqualToString:@""] && range.location == 0 && range.length == 1) {
_placeholderLabel1.hidden = NO;
}
return YES;
}
- (void)switchView:(UIView *)view - (void)switchView:(UIView *)view
{ {
......
...@@ -2,6 +2,11 @@ ...@@ -2,6 +2,11 @@
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0"> <plist version="1.0">
<dict> <dict>
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
<string>zh_CN</string>
</array>
<key>CFBundleDevelopmentRegion</key> <key>CFBundleDevelopmentRegion</key>
<string>en</string> <string>en</string>
<key>CFBundleExecutable</key> <key>CFBundleExecutable</key>
......
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