Commit d8cf8511 authored by n22's avatar n22

行情反馈查询

parent a1c4abb0
...@@ -342,6 +342,10 @@ ...@@ -342,6 +342,10 @@
C1FE50531AE024FA00C18080 /* UIAlertView+Blocks.m in Sources */ = {isa = PBXBuildFile; fileRef = C1FE504D1AE024FA00C18080 /* UIAlertView+Blocks.m */; }; C1FE50531AE024FA00C18080 /* UIAlertView+Blocks.m in Sources */ = {isa = PBXBuildFile; fileRef = C1FE504D1AE024FA00C18080 /* UIAlertView+Blocks.m */; };
C1FE50561AE3587F00C18080 /* ICRAttachmentUnit.m in Sources */ = {isa = PBXBuildFile; fileRef = C1FE50551AE3587F00C18080 /* ICRAttachmentUnit.m */; }; C1FE50561AE3587F00C18080 /* ICRAttachmentUnit.m in Sources */ = {isa = PBXBuildFile; fileRef = C1FE50551AE3587F00C18080 /* ICRAttachmentUnit.m */; };
C1FE50571AE3587F00C18080 /* ICRAttachmentUnit.m in Sources */ = {isa = PBXBuildFile; fileRef = C1FE50551AE3587F00C18080 /* ICRAttachmentUnit.m */; }; C1FE50571AE3587F00C18080 /* ICRAttachmentUnit.m in Sources */ = {isa = PBXBuildFile; fileRef = C1FE50551AE3587F00C18080 /* ICRAttachmentUnit.m */; };
FE2FCC7F1B74511000BBC6FB /* ChooseProductViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FE2FCC7E1B74511000BBC6FB /* ChooseProductViewController.m */; };
FE2FCC821B745E1A00BBC6FB /* SurveyDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FE2FCC811B745E1A00BBC6FB /* SurveyDetailViewController.m */; };
FE2FCC881B7492C500BBC6FB /* ResultDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FE2FCC871B7492C500BBC6FB /* ResultDetailViewController.m */; };
FE2FCC8B1B74A9EE00BBC6FB /* SurveyResultCell.m in Sources */ = {isa = PBXBuildFile; fileRef = FE2FCC8A1B74A9EE00BBC6FB /* SurveyResultCell.m */; };
FE4F17251B72FAAB00924DED /* ChosePersonViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FE4F17241B72FAAB00924DED /* ChosePersonViewController.m */; }; FE4F17251B72FAAB00924DED /* ChosePersonViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = FE4F17241B72FAAB00924DED /* ChosePersonViewController.m */; };
/* End PBXBuildFile section */ /* End PBXBuildFile section */
...@@ -720,6 +724,14 @@ ...@@ -720,6 +724,14 @@
C1FE504D1AE024FA00C18080 /* UIAlertView+Blocks.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIAlertView+Blocks.m"; sourceTree = "<group>"; }; C1FE504D1AE024FA00C18080 /* UIAlertView+Blocks.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIAlertView+Blocks.m"; sourceTree = "<group>"; };
C1FE50541AE3587F00C18080 /* ICRAttachmentUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ICRAttachmentUnit.h; sourceTree = "<group>"; }; C1FE50541AE3587F00C18080 /* ICRAttachmentUnit.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ICRAttachmentUnit.h; sourceTree = "<group>"; };
C1FE50551AE3587F00C18080 /* ICRAttachmentUnit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ICRAttachmentUnit.m; sourceTree = "<group>"; }; C1FE50551AE3587F00C18080 /* ICRAttachmentUnit.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ICRAttachmentUnit.m; sourceTree = "<group>"; };
FE2FCC7D1B74511000BBC6FB /* ChooseProductViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChooseProductViewController.h; sourceTree = "<group>"; };
FE2FCC7E1B74511000BBC6FB /* ChooseProductViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChooseProductViewController.m; sourceTree = "<group>"; };
FE2FCC801B745E1A00BBC6FB /* SurveyDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SurveyDetailViewController.h; sourceTree = "<group>"; };
FE2FCC811B745E1A00BBC6FB /* SurveyDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SurveyDetailViewController.m; sourceTree = "<group>"; };
FE2FCC861B7492C500BBC6FB /* ResultDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ResultDetailViewController.h; sourceTree = "<group>"; };
FE2FCC871B7492C500BBC6FB /* ResultDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ResultDetailViewController.m; sourceTree = "<group>"; };
FE2FCC891B74A9EE00BBC6FB /* SurveyResultCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SurveyResultCell.h; sourceTree = "<group>"; };
FE2FCC8A1B74A9EE00BBC6FB /* SurveyResultCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SurveyResultCell.m; sourceTree = "<group>"; };
FE4F17231B72FAAB00924DED /* ChosePersonViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChosePersonViewController.h; sourceTree = "<group>"; }; FE4F17231B72FAAB00924DED /* ChosePersonViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ChosePersonViewController.h; sourceTree = "<group>"; };
FE4F17241B72FAAB00924DED /* ChosePersonViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChosePersonViewController.m; sourceTree = "<group>"; }; FE4F17241B72FAAB00924DED /* ChosePersonViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ChosePersonViewController.m; sourceTree = "<group>"; };
/* End PBXFileReference section */ /* End PBXFileReference section */
...@@ -780,6 +792,12 @@ ...@@ -780,6 +792,12 @@
7217E9C71B72364300FE5C1D /* SurveyViewController.m */, 7217E9C71B72364300FE5C1D /* SurveyViewController.m */,
FE4F17231B72FAAB00924DED /* ChosePersonViewController.h */, FE4F17231B72FAAB00924DED /* ChosePersonViewController.h */,
FE4F17241B72FAAB00924DED /* ChosePersonViewController.m */, FE4F17241B72FAAB00924DED /* ChosePersonViewController.m */,
FE2FCC7D1B74511000BBC6FB /* ChooseProductViewController.h */,
FE2FCC7E1B74511000BBC6FB /* ChooseProductViewController.m */,
FE2FCC801B745E1A00BBC6FB /* SurveyDetailViewController.h */,
FE2FCC811B745E1A00BBC6FB /* SurveyDetailViewController.m */,
FE2FCC861B7492C500BBC6FB /* ResultDetailViewController.h */,
FE2FCC871B7492C500BBC6FB /* ResultDetailViewController.m */,
); );
path = controllers; path = controllers;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -818,6 +836,8 @@ ...@@ -818,6 +836,8 @@
7217E9E11B72364300FE5C1D /* SurveyCell.m */, 7217E9E11B72364300FE5C1D /* SurveyCell.m */,
7217E9E21B72364300FE5C1D /* SurveyListCell.h */, 7217E9E21B72364300FE5C1D /* SurveyListCell.h */,
7217E9E31B72364300FE5C1D /* SurveyListCell.m */, 7217E9E31B72364300FE5C1D /* SurveyListCell.m */,
FE2FCC891B74A9EE00BBC6FB /* SurveyResultCell.h */,
FE2FCC8A1B74A9EE00BBC6FB /* SurveyResultCell.m */,
); );
path = Views; path = Views;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -1833,6 +1853,8 @@ ...@@ -1833,6 +1853,8 @@
FE4F17251B72FAAB00924DED /* ChosePersonViewController.m in Sources */, FE4F17251B72FAAB00924DED /* ChosePersonViewController.m in Sources */,
30D7495F1ACE8F4400C63BA1 /* ICRConfigurationViewController.m in Sources */, 30D7495F1ACE8F4400C63BA1 /* ICRConfigurationViewController.m in Sources */,
C15918631AC19FB30013B391 /* ICRHomeViewController.m in Sources */, C15918631AC19FB30013B391 /* ICRHomeViewController.m in Sources */,
FE2FCC821B745E1A00BBC6FB /* SurveyDetailViewController.m in Sources */,
FE2FCC8B1B74A9EE00BBC6FB /* SurveyResultCell.m in Sources */,
C182E40E1AD4CE0B009BB9DB /* IBTModel.m in Sources */, C182E40E1AD4CE0B009BB9DB /* IBTModel.m in Sources */,
C1FE50411AE0240300C18080 /* IBTAVAudioPlayWrapper.m in Sources */, C1FE50411AE0240300C18080 /* IBTAVAudioPlayWrapper.m in Sources */,
7217E9EC1B72364300FE5C1D /* HPTextViewInternal.m in Sources */, 7217E9EC1B72364300FE5C1D /* HPTextViewInternal.m in Sources */,
...@@ -1977,6 +1999,8 @@ ...@@ -1977,6 +1999,8 @@
C14BE30E1ADB86DB0049F1AA /* NSData+EncodeAdditions.m in Sources */, C14BE30E1ADB86DB0049F1AA /* NSData+EncodeAdditions.m in Sources */,
C1E093041AC8E8E0003B7126 /* ICRCheckBox.m in Sources */, C1E093041AC8E8E0003B7126 /* ICRCheckBox.m in Sources */,
C1864A561B0B0D9D00D11C4E /* ICRPostTask.m in Sources */, C1864A561B0B0D9D00D11C4E /* ICRPostTask.m in Sources */,
FE2FCC7F1B74511000BBC6FB /* ChooseProductViewController.m in Sources */,
FE2FCC881B7492C500BBC6FB /* ResultDetailViewController.m in Sources */,
C159183D1AC062460013B391 /* IBTTableViewCellInfo.m in Sources */, C159183D1AC062460013B391 /* IBTTableViewCellInfo.m in Sources */,
C1FE504E1AE024FA00C18080 /* RIButtonItem.m in Sources */, C1FE504E1AE024FA00C18080 /* RIButtonItem.m in Sources */,
C18AEA9A1AD2749200A1DB7B /* ICRStoreListViewController.m in Sources */, C18AEA9A1AD2749200A1DB7B /* ICRStoreListViewController.m in Sources */,
......
...@@ -29,6 +29,7 @@ ...@@ -29,6 +29,7 @@
#define HTTP_REST_API_BASE_URL @"http://218.244.151.129:8281/XFFruit-server/rest" #define HTTP_REST_API_BASE_URL @"http://218.244.151.129:8281/XFFruit-server/rest"
// Import Headers // Import Headers
#import "ICRUtilsMacro.h" #import "ICRUtilsMacro.h"
#import "ICRVendorMacro.h" #import "ICRVendorMacro.h"
......
...@@ -18,6 +18,8 @@ ...@@ -18,6 +18,8 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
self.view.backgroundColor = HexColor(@"f8f8f8");
} }
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
......
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
{ {
UIView *_leftView; UIView *_leftView;
UIButton *_currentBtn; UIButton *_currentBtn;
MaskCell *_currentCell; NSIndexPath *_currentIndexPath;
} }
@end @end
...@@ -84,15 +84,24 @@ ...@@ -84,15 +84,24 @@
[cell setTitleStr:self.dataArr[indexPath.row]]; [cell setTitleStr:self.dataArr[indexPath.row]];
} }
if (_currentIndexPath) {
if (indexPath.row == _currentIndexPath.row) {
cell.Commitbtn.hidden = NO;
}else{
cell.Commitbtn.hidden = YES;
}
}
return cell; return cell;
} }
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
//获取选中的cell //获取选中的cell
_currentCell.Commitbtn.hidden = YES; MaskCell *currentCell = (MaskCell *)[tableView cellForRowAtIndexPath:_currentIndexPath];
currentCell.Commitbtn.hidden = YES;
MaskCell *cell = (MaskCell *)[tableView cellForRowAtIndexPath:indexPath]; MaskCell *cell = (MaskCell *)[tableView cellForRowAtIndexPath:indexPath];
cell.Commitbtn.hidden = NO; cell.Commitbtn.hidden = NO;
_currentCell = cell; _currentIndexPath = indexPath;
[self.delegate getBoltValueSelectRow:@"tt"]; [self.delegate getBoltValueSelectRow:@"tt"];
} }
......
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
@interface SortMaskView () @interface SortMaskView ()
{ {
MaskCell *_currentCell; NSIndexPath *_currentIndexPath;
} }
@end @end
...@@ -48,14 +48,23 @@ ...@@ -48,14 +48,23 @@
[cell setTitleStr:self.dataArr[indexPath.row]]; [cell setTitleStr:self.dataArr[indexPath.row]];
cell.Commitbtn.hidden = YES; cell.Commitbtn.hidden = YES;
} }
if (_currentIndexPath) {
if (indexPath.row == _currentIndexPath.row) {
cell.Commitbtn.hidden = NO;
}else{
cell.Commitbtn.hidden = YES;
}
}
return cell; return cell;
} }
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{ - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
//获取选中的cell //获取选中的cell
_currentCell.Commitbtn.hidden = YES; MaskCell *currentCell = (MaskCell *)[tableView cellForRowAtIndexPath:_currentIndexPath];
currentCell.Commitbtn.hidden = YES;
MaskCell *cell = (MaskCell *)[tableView cellForRowAtIndexPath:indexPath]; MaskCell *cell = (MaskCell *)[tableView cellForRowAtIndexPath:indexPath];
cell.Commitbtn.hidden = NO; cell.Commitbtn.hidden = NO;
_currentCell = cell; _currentIndexPath = indexPath;
[self.delegate getSortValueSelectRow:@"s"]; [self.delegate getSortValueSelectRow:@"s"];
} }
......
//
// SurveyResultCell.h
// XFFruit
//
// Created by 陈俊俊 on 15/8/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
#import "SurveyResult.h"
@interface SurveyResultCell : UITableViewCell
@property (nonatomic,strong)UIButton *imageBtn;
@property (nonatomic,strong)UILabel *userNameLabel;
@property (nonatomic,strong)UILabel *placeLabel;
@property (nonatomic,strong)UILabel *priceLabel;
@property (nonatomic,strong)UILabel *capacityLabel;
@property (nonatomic,strong)UILabel *qualityLabel;
@property (nonatomic,strong)UILabel *lineLabel;
@property (nonatomic,strong)SurveyResult *surveyResult;
@end
//
// SurveyResultCell.m
// XFFruit
//
// Created by 陈俊俊 on 15/8/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "SurveyResultCell.h"
#define TopMargin 10
#define TitleHeight 20
#define LeftWidth 100
#define TableHeight 150
#define TitleSize 16
#define ContentSize 14
#define TitleColor @"444444"
#define ContentColor @"aaaaaa"
@implementation SurveyResultCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) {
[self bulidLayout];
}
return self;
}
- (void)bulidLayout
{
self.imageBtn = [UIButton buttonWithType:UIButtonTypeCustom];
self.imageBtn.frame = CGRectMake(TopMargin *2 , TopMargin, LeftWidth, TableHeight - TopMargin*2);
self.userNameLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMaxX(self.imageBtn.frame) + TopMargin, TopMargin, ScreenSize.width - TopMargin*2 - LeftWidth, TitleHeight))];
self.userNameLabel.textColor = HexColor(TitleColor);
self.userNameLabel.font = FontSize(TitleSize);
self.placeLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.userNameLabel.frame), CGRectGetMaxY(self.userNameLabel.frame), CGRectGetWidth(self.userNameLabel.frame), TitleHeight))];
self.placeLabel.textColor = HexColor(ContentColor);
self.placeLabel.font = FontSize(ContentSize);
self.priceLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.userNameLabel.frame), CGRectGetMaxY(self.placeLabel.frame), CGRectGetWidth(self.userNameLabel.frame), TitleHeight))];
self.priceLabel.textColor = HexColor(ContentColor);
self.priceLabel.font = FontSize(ContentSize);
self.capacityLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.userNameLabel.frame), CGRectGetMaxY(self.priceLabel.frame), CGRectGetWidth(self.userNameLabel.frame), TitleHeight))];
self.capacityLabel.textColor = HexColor(ContentColor);
self.capacityLabel.font = FontSize(ContentSize);
self.qualityLabel = [[UILabel alloc]initWithFrame:(CGRectMake(CGRectGetMinX(self.userNameLabel.frame), CGRectGetMaxY(self.capacityLabel.frame), CGRectGetWidth(self.userNameLabel.frame), TitleHeight))];
self.qualityLabel.textColor = HexColor(ContentColor);
self.qualityLabel.font = FontSize(ContentSize);
self.lineLabel = [[UILabel alloc]initWithFrame:(CGRectMake(TopMargin,TableHeight-1, ScreenSize.width - TopMargin * 2, 1))];;
self.lineLabel.backgroundColor = HexColor(@"e5e5e5");
[self.contentView addSubview:self.imageBtn];
[self.contentView addSubview:self.userNameLabel];
[self.contentView addSubview:self.placeLabel];
[self.contentView addSubview:self.priceLabel];
[self.contentView addSubview:self.capacityLabel];
[self.contentView addSubview:self.qualityLabel];
[self.contentView addSubview:self.lineLabel];
}
- (void)setSurveyResult:(SurveyResult *)surveyResult{
[self.imageBtn setBackgroundImage:[UIImage imageNamed:@"SystemImage"] forState:UIControlStateNormal];
self.userNameLabel.text = surveyResult.personname;
self.placeLabel.text = surveyResult.place;
self.priceLabel.text = surveyResult.price;
self.capacityLabel.text = surveyResult.capacity;
self.qualityLabel.text = surveyResult.quality;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// ChooseProductViewController.h
// XFFruit
//
// Created by n22 on 15/8/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
typedef void(^ChoseProduct)(NSString *name);
@interface ChooseProductViewController : ICRBaseViewController
@property (nonatomic,assign) BOOL isMoreChose;//是否是多选
@property (nonatomic,copy)ChoseProduct choseProduct;
@end
//
// ChooseProductViewController.m
// XFFruit
//
// Created by n22 on 15/8/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ChooseProductViewController.h"
#import "MaskCell.h"
#define TopMargin 50
#define TableHeight 50
@interface ChooseProductViewController ()<UITableViewDataSource,UITableViewDelegate,UITextFieldDelegate>
{
UITableView *_tableView;
UITextField *_selectTextFiled;
NSMutableArray *_dataArr;
NSMutableArray *_indexArr;
NSIndexPath *_currentIndexPath;
}@end
@implementation ChooseProductViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self initData];
[self bulidLayout];
}
- (void)initData{
_dataArr = [NSMutableArray array];
_indexArr = [NSMutableArray array];
[_dataArr addObject:@"商品1"];
[_dataArr addObject:@"商品2"];
[_dataArr addObject:@"商品3"];
[_dataArr addObject:@"商品4"];
[_dataArr addObject:@"商品5"];
[_dataArr addObject:@"商品6"];
[_dataArr addObject:@"商品7"];
[_dataArr addObject:@"商品8"];
[_dataArr addObject:@"商品9"];
[_dataArr addObject:@"商品10"];
[_dataArr addObject:@"商品11"];
[_dataArr addObject:@"商品12"];
[_dataArr addObject:@"商品13"];
[_dataArr addObject:@"商品14"];
[_dataArr addObject:@"商品15"];
}
- (void)bulidLayout
{
self.view.backgroundColor = HexColor(@"f8f8f8");
_selectTextFiled = [[UITextField alloc] initWithFrame:CGRectMake(20,5,ScreenSize.width - 40,TopMargin -10)];
_selectTextFiled.textAlignment = NSTextAlignmentLeft;
_selectTextFiled.background = [UIImage imageNamed:@"textFiled"];
_selectTextFiled.delegate = self;
_selectTextFiled.font = FontSize(15);
[self.view addSubview:_selectTextFiled];
UIImageView *leftView = [[UIImageView alloc]initWithFrame:CGRectMake(0, 0, 35, 40)];
leftView.image = [UIImage imageNamed:@"search"];
_selectTextFiled.leftView = leftView;
_selectTextFiled.leftViewMode = UITextFieldViewModeAlways;
UIButton *rightView = [UIButton buttonWithType:UIButtonTypeCustom];
[rightView setImage:[UIImage imageNamed:@"delete"] forState:UIControlStateNormal];
rightView.frame = CGRectMake(0, 0, 35, 40);
[rightView addTarget:self action:@selector(deletePerson) forControlEvents:UIControlEventTouchUpInside];
_selectTextFiled.rightView = rightView;
_selectTextFiled.rightViewMode = UITextFieldViewModeAlways;
_tableView = [[UITableView alloc]initWithFrame:(CGRectMake(0, TopMargin,ScreenSize.width, ScreenSize.height - 64 - TopMargin)) style:(UITableViewStylePlain)];
_tableView.backgroundColor = [UIColor whiteColor];
_tableView.delegate = self;
_tableView.dataSource = self;
[self.view addSubview:_tableView];
UIBarButtonItem *rightItem = [[UIBarButtonItem alloc]initWithTitle:@"确定" style:UIBarButtonItemStylePlain target:self action:@selector(sureClick)];
self.navigationItem.rightBarButtonItem = rightItem;
}
- (void)sureClick{
self.choseProduct(_selectTextFiled.text);
[self PopViewControllerAnimated:YES];
}
- (void)deletePerson {
_selectTextFiled.text = @"";
[_indexArr removeAllObjects];
[_tableView reloadData];
}
#pragma mark - 协议方法
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return _dataArr.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"MaskCell";
MaskCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (cell == nil) {
cell = [[MaskCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID totalWidth:ScreenSize.width totalHeight:TableHeight];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
cell.Commitbtn.hidden = YES;
}
if (self.isMoreChose) {
if ([self isHaveIndexPath:indexPath]) {
cell.Commitbtn.hidden = NO;
}else{
cell.Commitbtn.hidden = YES;
}
}else{
if (_currentIndexPath) {
if (indexPath.row == _currentIndexPath.row) {
cell.Commitbtn.hidden = NO;
}else{
cell.Commitbtn.hidden = YES;
}
}
}
[cell setTitleStr:_dataArr[indexPath.row]];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if (self.isMoreChose == YES) {
MaskCell *cell = (MaskCell *)[tableView cellForRowAtIndexPath:indexPath];
cell.Commitbtn.hidden = NO;
if (![self isHaveIndexPath:indexPath]) {
[_indexArr addObject:indexPath];
}
NSString *personStr = @"";
for (NSIndexPath *index in _indexArr) {
personStr = [personStr stringByAppendingFormat:@"%@、",_dataArr[index.row]];
}
_selectTextFiled.text = personStr;
}else{
MaskCell *currentCell = (MaskCell *)[tableView cellForRowAtIndexPath:_currentIndexPath];
currentCell.Commitbtn.hidden = YES;
MaskCell *cell = (MaskCell *)[tableView cellForRowAtIndexPath:indexPath];
cell.Commitbtn.hidden = NO;
_currentIndexPath = indexPath;
NSString *name = _dataArr[indexPath.row];
_selectTextFiled.text = name;
}
}
- (BOOL)isHaveIndexPath:(NSIndexPath *)indexPath{
for (NSIndexPath *path in _indexArr) {
if (path.row == indexPath.row) {
return YES;
}
}
return NO;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return TableHeight;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
@end
...@@ -13,6 +13,7 @@ ...@@ -13,6 +13,7 @@
#import "HPGrowingTextView.h" #import "HPGrowingTextView.h"
#import "StartTimeView.h" #import "StartTimeView.h"
#import "ChosePersonViewController.h" #import "ChosePersonViewController.h"
#import "ChooseProductViewController.h"
#import "Survey.h" #import "Survey.h"
#define LeftMargin 15 #define LeftMargin 15
...@@ -42,6 +43,15 @@ typedef enum : NSUInteger { ...@@ -42,6 +43,15 @@ typedef enum : NSUInteger {
UIDatePicker *_timePicker; UIDatePicker *_timePicker;
BOOL _isClickStart; BOOL _isClickStart;
StartTimeView *_startTimeView; StartTimeView *_startTimeView;
//内容
NSString *_title;
NSString *_productUuid;
NSString *_productName;
NSString *_beginDate;
NSString *_endDate;
NSString *_remark;
//user对象
} }
@end @end
...@@ -101,14 +111,10 @@ typedef enum : NSUInteger { ...@@ -101,14 +111,10 @@ typedef enum : NSUInteger {
void(^succ)(id) = ^(id data) { void(^succ)(id) = ^(id data) {
NSLog(@"%@",data); NSLog(@"%@",data);
}; };
void(^fail)(id) = ^(id data) { void(^fail)(id) = ^(id data) {
[IBTLoadingView showTips:data]; [IBTLoadingView showTips:data];
}; };
NSDictionary *dict = @{@"authenticode":@"sssffff",@"userUuid":@"1123",@"action":@"save",@"survey":[survey dictForCommit]}; NSDictionary *dict = @{@"authenticode":@"sssffff",@"userUuid":@"1123",@"action":@"save",@"survey":[survey dictForCommit]};
[[ICRHTTPController sharedController] saveSurveyWithAuthenticode:dict success:succ failure:fail]; [[ICRHTTPController sharedController] saveSurveyWithAuthenticode:dict success:succ failure:fail];
} }
break; break;
...@@ -220,6 +226,14 @@ typedef enum : NSUInteger { ...@@ -220,6 +226,14 @@ typedef enum : NSUInteger {
}; };
cvc.isMoreChose = YES; cvc.isMoreChose = YES;
[self PushViewController:cvc animated:YES]; [self PushViewController:cvc animated:YES];
}else if(indexPath.row == 1){
ChooseProductViewController *cvc = [ChooseProductViewController new];
cvc.choseProduct = ^(NSString *name){
_productLabel.text = name;
_productLabel.textColor = HexColor(@"444444");
};
cvc.isMoreChose = NO;
[self PushViewController:cvc animated:YES];
} }
} }
......
//
// ResultDetailViewController.h
// XFFruit
//
// Created by n22 on 15/8/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
@interface ResultDetailViewController : ICRBaseViewController
@end
//
// ResultDetailViewController.m
// XFFruit
//
// Created by n22 on 15/8/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ResultDetailViewController.h"
#import "SurveyResult.h"
#import "SurveyResultCell.h"
#define TableHeight 150
@interface ResultDetailViewController ()<UITableViewDataSource,UITableViewDelegate>
{
UITableView *_tableView;
NSMutableArray *_dataArr;
}
@end
@implementation ResultDetailViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self initData];
[self createTableView];
}
- (void)initData{
_dataArr = [NSMutableArray array];
for (NSInteger i = 0; i < 4; i++) {
SurveyResult *survey = [[SurveyResult alloc]init];
survey.personname = @"南汇8424西瓜调研情况";
survey.place = @"150605000001";
survey.price = @"南汇842[100213]";
survey.capacity = @"22222222222";
survey.quality = @"费卡接口";
[_dataArr addObject:survey];
}
}
- (void)createTableView{
_tableView = [[UITableView alloc]initWithFrame:(CGRectMake(0, 0,ScreenSize.width, ScreenSize.height - 64)) style:(UITableViewStylePlain)];
_tableView.backgroundColor = [UIColor whiteColor];
_tableView.delegate = self;
_tableView.dataSource = self;
[self.view addSubview:_tableView];
}
#pragma mark - 协议方法
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return _dataArr.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"SurveyResultCell";
SurveyResultCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (cell == nil) {
cell = [[SurveyResultCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
if (_dataArr.count > 0) {
SurveyResult *survey = _dataArr[indexPath.row];
cell.surveyResult = survey;
}
return cell;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return TableHeight;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
//
// SurveyDetailViewController.h
// XFFruit
//
// Created by 陈俊俊 on 15/8/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
#import "Survey.h"
@interface SurveyDetailViewController : ICRBaseViewController
@property (nonatomic,strong)Survey *survey;
@end
//
// SurveyDetailViewController.m
// XFFruit
//
// Created by 陈俊俊 on 15/8/7.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "SurveyDetailViewController.h"
#import "ResultDetailViewController.h"
#define BottomHeight 50
#define LeftMargin 20
#define LeftWidth 100
#define LeftHeight 30
typedef enum : NSUInteger {
DetailTag = 6000,
EndTag,
} BtnTag;
@interface SurveyDetailViewController ()
{
UIScrollView *_scrollView;
UIView *_surveyView;
UIView *_bottomView;
}
@property (nonatomic,strong)UILabel *noteLabel;
@end
@implementation SurveyDetailViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self bulifLayout];
}
#pragma mark - 视图初始化
- (void)bulifLayout{
self.view.backgroundColor = HexColor(@"f8f8f8");
_scrollView = [[UIScrollView alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, ScreenSize.height - 64 - BottomHeight)];
_scrollView.showsHorizontalScrollIndicator = NO;
_scrollView.showsVerticalScrollIndicator = NO;
[self.view addSubview:_scrollView];
UIButton *endBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(LeftMargin, ScreenSize.height - 64 - BottomHeight +5, ScreenSize.width - LeftMargin*2, 40) target:self sel:@selector(btnClick:) tag:EndTag image:nil title:@"结束" titleColor:[UIColor whiteColor] isCorner:YES corner:8 bgColor:HexColor(@"f69100")];
[self.view addSubview:endBtn];
_surveyView= [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenSize.width, LeftHeight*9+LeftMargin/2)];
_surveyView.backgroundColor = [UIColor whiteColor];
[_scrollView addSubview:_surveyView];
UILabel *tagLabel = [[UILabel alloc]initWithFrame:CGRectMake(LeftMargin/2, 10, LeftWidth*2, LeftHeight)];
tagLabel.text = @"【调研内容】";
tagLabel.font = FontSize(17);
tagLabel.textColor = [UIColor blueColor];
[_surveyView addSubview:tagLabel];
NSArray *leftArr = @[@"单号:",@"状态:",@"标题:",@"商品:",@"开始日期:",@"截止日期:",@"调研人员:",@"备注:"];
NSMutableArray *contentArr = [[NSMutableArray alloc]init];
[contentArr addObject:self.survey.billnumber];
[contentArr addObject:self.survey.state];
[contentArr addObject:self.survey.title];
[contentArr addObject:self.survey.productname];
[contentArr addObject:[IBTCommon stringFromDate:self.survey.begindate]];
[contentArr addObject:[IBTCommon stringFromDate:self.survey.enddate]];
[contentArr addObject:self.survey.productcode];
[contentArr addObject:self.survey.note];
for (NSInteger i = 0 ; i < leftArr.count; i++) {
UILabel *leftLabel = [[UILabel alloc]initWithFrame:CGRectMake(LeftMargin, CGRectGetMaxY(tagLabel.frame) + LeftHeight *i, LeftWidth, LeftHeight)];
leftLabel.text = leftArr[i];
leftLabel.font = FontSize(17);
[_surveyView addSubview:leftLabel];
UILabel *rightLabel = [[UILabel alloc]initWithFrame:CGRectMake(CGRectGetMaxX(leftLabel.frame), CGRectGetMaxY(tagLabel.frame) + LeftHeight *i, _surveyView.frame.size.width - LeftMargin - LeftWidth, LeftHeight)];
rightLabel.text = contentArr[i];
rightLabel.font = FontSize(17);
if (i == leftArr.count - 1) {
rightLabel.numberOfLines = 0;
self.noteLabel = rightLabel;
}
[_surveyView addSubview:rightLabel];
}
_bottomView= [[UIView alloc]initWithFrame:CGRectMake(0, CGRectGetMaxY(_surveyView.frame), ScreenSize.width, 200)];
_bottomView.backgroundColor = [UIColor whiteColor];
[_scrollView addSubview:_bottomView];
UILabel *resultLabel = [[UILabel alloc]initWithFrame:CGRectMake(LeftMargin/2, 10, LeftWidth*2, LeftHeight)];
resultLabel.text = @"【行情反馈】";
resultLabel.font = FontSize(17);
resultLabel.textColor = [UIColor blueColor];
[_bottomView addSubview:resultLabel];
UIButton *btn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(CGRectGetWidth(_bottomView.frame) - 100, 10, 100, LeftHeight) target:self sel:@selector(btnClick:) tag:DetailTag image:nil title:@">>查看详情" titleColor:[UIColor blueColor] isCorner:NO corner:0 bgColor:nil];
[_bottomView addSubview:btn];
[self setNoteHeight];
}
- (void)btnClick:(UIButton *)btn{
if (btn.tag == DetailTag) {
ResultDetailViewController *rvc = [ResultDetailViewController new];
[self PushViewController:rvc animated:YES];
}else if (btn.tag == EndTag){
}
}
- (void)setNoteHeight
{
CGFloat height = [self.noteLabel calculateHeight];
CGRect noteFrame = self.noteLabel.frame;
noteFrame.size.height = height;
self.noteLabel.frame = noteFrame;
CGFloat totalHeight = height + LeftHeight*9;
CGRect surveyFrame = _surveyView.frame;
surveyFrame.size.height = totalHeight;
_surveyView.frame = surveyFrame;
CGRect bottomFrame = _bottomView.frame;
bottomFrame.origin.y = CGRectGetMaxY(_surveyView.frame);
_bottomView.frame = bottomFrame;
_scrollView.contentSize = CGSizeMake(ScreenSize.width, totalHeight + CGRectGetHeight(_bottomView.frame));
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
@end
...@@ -11,6 +11,7 @@ ...@@ -11,6 +11,7 @@
#import "Survey.h" #import "Survey.h"
#import "SortMaskView.h" #import "SortMaskView.h"
#import "BoltMaskView.h" #import "BoltMaskView.h"
#import "SurveyDetailViewController.h"
#define TopMargin 44 #define TopMargin 44
...@@ -44,7 +45,6 @@ typedef enum : NSUInteger { ...@@ -44,7 +45,6 @@ typedef enum : NSUInteger {
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
self.title = @"行情调研"; self.title = @"行情调研";
self.view.backgroundColor = HexColor(@"f8f8f8");
[self initData]; [self initData];
[self createTableView]; [self createTableView];
} }
...@@ -56,6 +56,8 @@ typedef enum : NSUInteger { ...@@ -56,6 +56,8 @@ typedef enum : NSUInteger {
survey.title = @"南汇8424西瓜调研情况"; survey.title = @"南汇8424西瓜调研情况";
survey.billnumber = @"150605000001"; survey.billnumber = @"150605000001";
survey.productname = @"南汇842[100213]"; survey.productname = @"南汇842[100213]";
survey.productcode = @"22222222222";
survey.note = @"费卡接口浪格可放大文化大fdsaf缴费卡接口浪费缴费卡上就付款放假快乐撒即可书法家开发商";
survey.begindate = [IBTCommon convertToDateFrom:@"2015.05.25"]; survey.begindate = [IBTCommon convertToDateFrom:@"2015.05.25"];
survey.enddate = [IBTCommon convertToDateFrom:@"2015.08.06"]; survey.enddate = [IBTCommon convertToDateFrom:@"2015.08.06"];
[_dataArr addObject:survey]; [_dataArr addObject:survey];
...@@ -228,10 +230,24 @@ typedef enum : NSUInteger { ...@@ -228,10 +230,24 @@ typedef enum : NSUInteger {
} }
return cell; return cell;
} }
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
SurveyDetailViewController *svc = [SurveyDetailViewController new];
if (_dataArr.count > 0) {
svc.survey = _dataArr[indexPath.row];
}
[self PushViewController:svc animated:YES];
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{ - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return TableHeight; return TableHeight;
} }
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
} }
......
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