Commit 7a5beac0 authored by 管鹏飞's avatar 管鹏飞

no message

parent 2bf26c46
......@@ -212,6 +212,7 @@
72F9D48B1BA8582100795A00 /* NoticeBoltView.m in Sources */ = {isa = PBXBuildFile; fileRef = 72F9D48A1BA8582100795A00 /* NoticeBoltView.m */; };
871F9F047CDDAC523E4358DC /* libPods.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 86D33EC280C440156ED1B976 /* libPods.a */; };
ABFA26061C87D38800274481 /* JavenImages.m in Sources */ = {isa = PBXBuildFile; fileRef = ABFA26051C87D38800274481 /* JavenImages.m */; };
ABFA260C1C8832DF00274481 /* MarketSurveyViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = ABFA260B1C8832DF00274481 /* MarketSurveyViewController.m */; };
C10214CD1AD8FE200024637E /* ICRStoreDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C10214CC1AD8FE200024637E /* ICRStoreDetailViewController.m */; };
C10214CE1AD8FE200024637E /* ICRStoreDetailViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C10214CC1AD8FE200024637E /* ICRStoreDetailViewController.m */; };
C10214D21AD904F30024637E /* ICRPatrolPlanViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = C10214D11AD904F30024637E /* ICRPatrolPlanViewController.m */; };
......@@ -874,6 +875,8 @@
86D33EC280C440156ED1B976 /* libPods.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = libPods.a; sourceTree = BUILT_PRODUCTS_DIR; };
ABFA26041C87D38800274481 /* JavenImages.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JavenImages.h; sourceTree = "<group>"; };
ABFA26051C87D38800274481 /* JavenImages.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = JavenImages.m; sourceTree = "<group>"; };
ABFA260A1C8832DF00274481 /* MarketSurveyViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = MarketSurveyViewController.h; sourceTree = "<group>"; };
ABFA260B1C8832DF00274481 /* MarketSurveyViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = MarketSurveyViewController.m; sourceTree = "<group>"; };
C10214CB1AD8FE200024637E /* ICRStoreDetailViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ICRStoreDetailViewController.h; sourceTree = "<group>"; };
C10214CC1AD8FE200024637E /* ICRStoreDetailViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ICRStoreDetailViewController.m; sourceTree = "<group>"; };
C10214D01AD904F30024637E /* ICRPatrolPlanViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ICRPatrolPlanViewController.h; sourceTree = "<group>"; };
......@@ -1442,6 +1445,8 @@
359788641C868EB8009205AA /* XFPhoto.m */,
ABFA26041C87D38800274481 /* JavenImages.h */,
ABFA26051C87D38800274481 /* JavenImages.m */,
ABFA260A1C8832DF00274481 /* MarketSurveyViewController.h */,
ABFA260B1C8832DF00274481 /* MarketSurveyViewController.m */,
);
path = FeedBack;
sourceTree = "<group>";
......@@ -3072,6 +3077,7 @@
C15918491AC062460013B391 /* IBTObject.m in Sources */,
35CF339B1B96E41F001211EF /* GXFVendorViewController.m in Sources */,
72B3C0CA1B9D3C7300025D81 /* TransportPurductCell.m in Sources */,
ABFA260C1C8832DF00274481 /* MarketSurveyViewController.m in Sources */,
C142D2B01AC3A155000109A7 /* UIColor+Helper.m in Sources */,
72A813FA1BCD3205003631F3 /* ReceiveViewController.m in Sources */,
C142D2AC1AC3A155000109A7 /* NSNull+OVNatural.m in Sources */,
......
//
// MarketSurveyViewController.h
// XFFruit
//
// Created by Jonathan on 16/3/3.
// Copyright © 2016年 Xummer. All rights reserved.
//
#import "ICRBaseViewController.h"
@interface MarketSurveyViewController : ICRBaseViewController
@end
//
// MarketSurveyViewController.m
// XFFruit
//
// Created by Jonathan on 16/3/3.
// Copyright © 2016年 Xummer. All rights reserved.
//
#import "MarketSurveyViewController.h"
#import "SurveyListCell.h"
#import "Survey.h"
#import "SortMaskView.h"
#import "BoltMaskView.h"
#import "SurveyDetailViewController.h"
#import "NewSurveyViewController.h"
#import "QueryOrder.h"
#import "MJRefresh.h"
#import "WriteFeedbackViewController.h"
#define TopMargin 44
#define TableHeight 120
#define LeftMargin 20
#define BtnWidth 60
#define BtnHeight 24
#define BtnSize 16
typedef enum : NSUInteger {
SortTag = 3000,
BoltTag
} BtnTag;
@interface MarketSurveyViewController ()<UITableViewDataSource,UITableViewDelegate,BoltMaskViewDelegate,SortMaskViewDelegate,UIGestureRecognizerDelegate>
{
UIView *_maskView;
UIButton *currentBtn;
SortMaskView *_sortView;
BoltMaskView *_boltView;
UIBarButtonItem *_sureBtn;
UIButton *_sortBtn;
UIButton *_boltBtn;
BOOL _isRefresh;
BOOL _isLoadMore;
NSInteger _currentPage;
}
@property (nonatomic,strong)NSMutableArray *dataArr;
@property (nonatomic,strong)UITableView *tableView;
@property (nonatomic,strong)NSString *billNumberLike;
@property (nonatomic,strong)NSString *state;//未提交=initial已提交=submitted调研中=insurvey已完成=finished
@property (nonatomic,strong)NSString *titleLike;
@property (nonatomic,strong)NSString *orderDirection;//asc(升序),desc(降序)
@end
@implementation MarketSurveyViewController
- (void)viewDidLoad {
[super viewDidLoad];
//self.title = @"行情调研";
self.view.backgroundColor = XXFBgColor;
[self createBackBtn];
[self initData];
[self createTableView];
[self getData];
//刷新
[self createRefresh];
}
- (void)initData{
self.dataArr = [NSMutableArray array];
}
- (void)createRefresh{
self.tableView.header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
if (_isRefresh) {
return ;
}
_isRefresh = YES;
_currentPage = 0;
[self getData];
}];
self.tableView.header.lastUpdatedTimeKey = SurveyUpdateDate;
self.tableView.footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
if (_isLoadMore) {
return ;
}
_isLoadMore = YES;
_currentPage ++;
[self getData];
} ];
}
#pragma mark - 结束刷新
- (void)endRefreshing{
_isLoadMore = NO;
_isRefresh = NO;
[self.tableView.header endRefreshing];
[self.tableView.footer endRefreshing];
}
- (void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
if ([ICRUserUtil sharedInstance].needFresh && self.tableView != nil) {
[self.tableView.header beginRefreshing];
}
}
- (void)getData{
[ICRUserUtil sharedInstance].needFresh = NO;
__weak typeof(self)weakSelf = self;
void(^succ)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
__strong __typeof(weakSelf)strongSelf = weakSelf;
[strongSelf fetchtSurveyList:data];
};
void(^fail)(id) = ^(id data) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
ICRUserUtil *userUtil = [ICRUserUtil sharedInstance];
NSMutableArray *orderArr =[NSMutableArray array];
if (self.orderDirection.length > 0 && ![self.orderDirection isEqualToString:@"none"]) {
QueryOrder *order = [QueryOrder new];
order.field = @"lastModified";
order.direction = self.orderDirection;
[orderArr addObject:[order dictForCommit]];
}
id billObject = [NSNull null];
if (self.billNumberLike.length > 0) {
billObject = self.billNumberLike;
if (self.orderDirection.length > 0 && ![self.orderDirection isEqualToString:@"none"]) {
QueryOrder *order = [QueryOrder new];
order.field = @"billNumber";
order.direction = self.orderDirection;
[orderArr addObject:[order dictForCommit]];
}
}
id stateObject = [NSNull null];
if (self.state.length > 0 && ![self.state isEqualToString:@"none"]) {
stateObject = self.state;
if (self.orderDirection.length > 0 && ![self.orderDirection isEqualToString:@"none"]) {
QueryOrder *order = [QueryOrder new];
order.field = @"state";
order.direction = self.orderDirection;
[orderArr addObject:[order dictForCommit]];
}
}
id titleObject = [NSNull null];
if (self.titleLike.length > 0) {
titleObject = self.titleLike;
if (self.orderDirection.length > 0 && ![self.orderDirection isEqualToString:@"none"]) {
QueryOrder *order = [QueryOrder new];
order.field = @"title";
order.direction = self.orderDirection;
[orderArr addObject:[order dictForCommit]];
}
}
if (orderArr.count == 0) {
QueryOrder *order = [QueryOrder new];
order.field = @"billNumber";
order.direction = @"desc";
[orderArr addObject:[order dictForCommit]];
}
NSDictionary *dict = @{
@"billNumberLike":billObject,
@"state":stateObject,
@"titleLike":titleObject,
@"queryOrders":orderArr,
@"userUuid":userUtil.userId,
@"pageNumber":@(_currentPage),
@"pageSize":@(20)};
[[ICRHTTPController sharedController] querySurveyWithBillData:dict success:succ failure:fail];
}
#pragma mark -成功
- (void)fetchtSurveyList:(id)data{
if (data) {
NSInteger success = [data[@"success"] integerValue];
NSString *message = data[@"message"] ;
if (success == 1) {
if (_currentPage == 0) {
if (self.dataArr.count > 0) {
[self.dataArr removeAllObjects];
}
}
NSArray *recodesArr = data[ @"data" ][ @"records" ];
for (NSDictionary *surveyDict in recodesArr) {
Survey *survey = [[Survey alloc]init];
[survey setValuesForKeysWithDictionary:surveyDict];
if ([survey.state isEqualToString:@"insurvey"]) {
[self.dataArr addObject:survey];
}
}
NSDictionary *pageDict = data[ @"data" ][ @"paging" ];
NSInteger pageCount = [pageDict[@"pageCount"] integerValue];
[self.tableView reloadData];
[self endRefreshing];
if (pageCount <= _currentPage) {
[self.tableView.footer noticeNoMoreData];
}
if (_currentPage == 0 && self.dataArr.count > 0) {
[self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:YES];
}
}else{
[IBTLoadingView showTips:message];
}
}else{
[IBTLoadingView showTips:@" 无记录 "];
}
}
- (void)createTableView
{
_sureBtn = [[UIBarButtonItem alloc]initWithTitle:@"确定" style:UIBarButtonItemStylePlain target:self action:@selector(sureClick)];
self.navigationItem.rightBarButtonItem = _sureBtn;
_sortBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(LeftMargin, 10, BtnWidth, BtnHeight) target:self sel:@selector(sortClick:) tag:SortTag image:@"black_arrow_down_with_text" title:nil titleColor:GXF_DETAIL_COLOR isCorner:NO corner:0 bgColor:nil];
_sortBtn.titleLabel.font = FontSize(BtnSize);
[self.view addSubview:_sortBtn];
_boltBtn = [IBTCustomButtom creatButtonWithFrame:CGRectMake(ScreenSize.width-BtnWidth - LeftMargin,10,BtnWidth, BtnHeight) target:self sel:@selector(sortClick:) tag:BoltTag image:@"black_filter_with_text" title:nil titleColor:GXF_DETAIL_COLOR isCorner:NO corner:0 bgColor:nil];
_boltBtn.titleLabel.font = FontSize(BtnSize);
[self.view addSubview:_boltBtn];
self.tableView = [[UITableView alloc]initWithFrame:(CGRectMake(0, TopMargin,ScreenSize.width, ScreenSize.height - 64 - TopMargin)) style:(UITableViewStylePlain)];
self.tableView.delegate = self;
self.tableView.dataSource = self;
[self.view addSubview:self.tableView];
_maskView = [[UIView alloc]initWithFrame:CGRectMake(0, TopMargin, ScreenSize.width, ScreenSize.height - 64- TopMargin)];
_maskView.backgroundColor = RGBA(0, 0, 0, 0.5);
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(hiddenMaskView)];
[_maskView addGestureRecognizer:tap];
tap.delegate = self;
_maskView.hidden = YES;
[self.view addSubview:_maskView];
}
#pragma mark - 手势代理方法
- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch
{
// 输出点击的view的类名
NSLog(@"%@", NSStringFromClass([touch.view class]));
// 若为UITableViewCellContentView(即点击了tableViewCell),则不截获Touch事件
if ([NSStringFromClass([touch.view class]) isEqualToString:@"UITableViewCellContentView"]) {
return NO;
}
return YES;
}
//检测排序的颜色
- (void)checkSortBtnColor{
if (self.orderDirection.length > 0) {
[_sortBtn setImage:[UIImage imageNamed:@"select_arrow_up_text"] forState:UIControlStateNormal];
}else{
[_sortBtn setImage:[UIImage imageNamed:@"black_arrow_down_with_text"] forState:UIControlStateNormal];
}
}
- (void)checkBoltBtnColor{
if (self.state.length > 0 || self.billNumberLike.length > 0 || self.titleLike.length > 0) {
[_boltBtn setImage:[UIImage imageNamed:@"selected-filter_with_text"] forState:UIControlStateNormal];
}else{
[_boltBtn setImage:[UIImage imageNamed:@"black_filter_with_text"] forState:UIControlStateNormal];
}
}
#pragma mark - 确定
- (void)sureClick{
[_boltView.titleFiled resignFirstResponder];
[_boltView.billFiled resignFirstResponder];
_currentPage = 0;
//请求
[self getData];
//还原数据
if (_sortView) {
[self hiddenSortMaskView:YES];
}
if (_boltView) {
[self hiddenBoltMaskView:YES];
}
}
#pragma mark -按钮事件
- (void)sortClick:(UIButton *)btn{
_maskView.backgroundColor = RGBA(0, 0, 0, 0.5);
_maskView.hidden = NO;
if (btn.tag == SortTag) {
if(_boltView){
[self hiddenBoltMaskView:NO];
}
if (currentBtn == btn) {
[btn setImage:[UIImage imageNamed:@"black_arrow_down_with_text"] forState:UIControlStateNormal];
[self hiddenSortMaskView:YES];
currentBtn = nil;
}else{
[btn setImage:[UIImage imageNamed:@"select_arrow_up_text"] forState:UIControlStateNormal];
if (_sortView == nil) {
_sortView = [[SortMaskView alloc]initWithFrame:CGRectMake(0, -105, ScreenSize.width, 150) withOrderDirection:self.orderDirection];
_sortView.dataArr = [[NSMutableArray alloc]initWithObjects:@"按时间顺序",@"按时间逆序",@"默认排序",nil];
_sortView.delegate = self;
[_maskView addSubview:_sortView];
[UIView animateWithDuration:0.25 animations:^{
CGRect sortFrame = _sortView.frame;
sortFrame.origin.y = 0;
_sortView.frame = sortFrame;
}];
}
currentBtn = btn;
}
}else if(btn.tag == BoltTag){
if (_sortView) {
[self hiddenSortMaskView:NO];
}
if (currentBtn == btn) {
[btn setImage:[UIImage imageNamed:@"black_filter_with_text"] forState:UIControlStateNormal];
[self hiddenBoltMaskView:YES];
currentBtn = nil;
}else{
[btn setImage:[UIImage imageNamed:@"selected-filter_with_text"] forState:UIControlStateNormal];
if (_boltView == nil) {
_boltView = [[BoltMaskView alloc]initWithFrame:CGRectMake(0, -105, ScreenSize.width, 274) state:self.state title:self.titleLike bill:self.billNumberLike];
_boltView.backgroundColor = XXFBgColor;
_boltView.delegate = self;
_boltView.dataArr = [[NSMutableArray alloc]initWithObjects:@"不限",@"未提交",@"已提交" ,@"调研中",nil];
[_maskView addSubview:_boltView];
[UIView animateWithDuration:0.25 animations:^{
CGRect sortFrame = _boltView.frame;
sortFrame.origin.y = 0;
_boltView.frame = sortFrame;
}];
currentBtn = btn;
}
}
}
}
- (void)hiddenSortMaskView:(BOOL)isHide{
currentBtn = nil;
[self checkSortBtnColor];
if (isHide == NO) {
[_sortView removeFromSuperview];
_sortView = nil;
}else{
[UIView animateWithDuration:0.25 animations:^{
CGRect sortFrame = _sortView.frame;
sortFrame.origin.y = -105;
_sortView.frame = sortFrame;
_maskView.backgroundColor = RGBA(0, 0, 0, 0);
}completion:^(BOOL finished) {
[_sortView removeFromSuperview];
_sortView = nil;
_maskView.hidden = YES;
}];
}
}
- (void)hiddenBoltMaskView:(BOOL)isHide{
currentBtn = nil;
[self checkBoltBtnColor];
if (isHide == NO) {
[_boltView removeFromSuperview];
_boltView = nil;
}else{
[UIView animateWithDuration:0.25 animations:^{
CGRect sortFrame = _boltView.frame;
sortFrame.origin.y = -105;
_boltView.frame = sortFrame;
_maskView.backgroundColor = RGBA(0, 0, 0, 0);
}completion:^(BOOL finished) {
[_boltView removeFromSuperview];
_boltView = nil;
_maskView.hidden = YES;
}];
}
}
#pragma mark - sortDelegate
- (void)getSortValueSelectRow:(NSString *)state{
if (state.length > 0) {
self.orderDirection = state;
CLog(@"%@",state);
}
}
#pragma mark - boltDelegate
- (void)getBoltValueSelectRow:(NSString *)state{
self.state = state;
CLog(@"%@",state);
}
- (void)getTitleLike:(NSString *)titleLike{
self.titleLike = titleLike;
CLog(@"%@",titleLike);
}
- (void)getBillNumber:(NSString *)billNumber{
self.billNumberLike = billNumber;
CLog(@"%@",billNumber);
}
- (void)clearBoltInformation{
//清空所有条件
if (self.billNumberLike.length > 0) {
self.billNumberLike = @"";
}
if (self.titleLike.length > 0) {
self.titleLike = @"";
}
if (self.state.length > 0) {
self.state = @"";
}
}
#pragma mark - 隐藏maskView
- (void)hiddenMaskView{
if (_sortView) {
[self hiddenSortMaskView:YES];
}
if (_boltView) {
[self hiddenBoltMaskView:YES];
}
}
#pragma mark - 协议方法
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.dataArr.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
static NSString *cellID = @"SurveyID";
SurveyListCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (cell == nil) {
cell = [[SurveyListCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
if (self.dataArr.count > 0) {
Survey *survey = self.dataArr[indexPath.row];
[cell setSurvey:survey];
}
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
Survey *survey = nil;
if (self.dataArr.count > 0) {
survey = self.dataArr[indexPath.row];
}
WriteFeedbackViewController *feedBackVC = [[WriteFeedbackViewController alloc] init];
feedBackVC.aSurvey = survey;
[self PushViewController:feedBackVC animated:YES];
}
- (void)createBackBtn{
UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
[btn setImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal];
btn.frame = CGRectMake(0, 0, 12, 20);
[btn addTarget:self action:@selector(backRV) forControlEvents:UIControlEventTouchUpInside];
UIBarButtonItem *back = [[UIBarButtonItem alloc]initWithCustomView:btn];
self.navigationItem.leftBarButtonItem = back;
}
- (void)backRV{
[self PopToRootViewControllerAnimated:YES];
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath{
return TableHeight;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
......@@ -15,6 +15,7 @@
@property (nonatomic,strong)Survey *survey;
@property (nonatomic,strong)NSString *surveyUuid;
@property (nonatomic, strong) NSArray *imgsFile;
@property (nonatomic, strong) Survey *aSurvey;
- (instancetype)initWithImgName:(NSString *)imgName;
@end
......@@ -352,11 +352,15 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
}
}
#pragma mark btn action
- (void)photosDisplay {
HGPhWViewController *ghphVC = [[HGPhWViewController alloc]init];
[self PushViewController:ghphVC animated:YES];
}
#pragma mark - ZYQAssetPickerController Delegate
-(void)assetPickerController:(ZYQAssetPickerController *)picker didFinishPickingAssets:(NSArray *)assets{
......@@ -374,8 +378,6 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
[[JavenImages shareInstance] insertImages:self.imgesMuArr];
// [[HGPhWViewController shareInstance] addPhotosWithArrayImgs:_imgesMuArr];
[self pushToHGphVC];
......@@ -392,6 +394,7 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
.size.width = BOTTOM_BTN_WIDTH,
.size.height = BTN_HEIGHT
};
[btnBack addTarget:self
action:@selector(commitFeedback)
forControlEvents:UIControlEventTouchUpInside];
......@@ -412,39 +415,46 @@ typedef NS_ENUM(NSUInteger, feedbackCellInfo){
#pragma mark - 接口调用:3.1 新增行情反馈
- (void)saveSurveyResult{
void(^succ)(id) = ^(id data) {
[IBTLoadingView showProgressLabel:@"正在加载..."];
NSDictionary *paramDict = @{@"result":[self getSurveyResult],@"attachments":[self getAttachmentArray]};
[[ICRHTTPController sharedController] surveySaveResultWithDict:paramDict surveyUuid:_surveyUuid success:^(id succ) {
[IBTLoadingView hideHUDWithText:nil];
if (data) {
NSInteger success = [data[@"success"] integerValue];
NSString *message = data[@"message"] ;
if (succ) {
NSInteger success = [succ[@"success"] integerValue];
NSString *message = succ[@"message"] ;
if (success == 1) {
// [self backSurvey];
// [self backSurvey];
}else{
[IBTLoadingView showTips:message];
}
}else{
[IBTLoadingView showTips:@"返回异常"];
}
};
void(^fail)(id) = ^(id data) {
} failure:^(id fail) {
[IBTLoadingView hideHUDWithText:nil];
[IBTLoadingView showTips:data];
};
[IBTLoadingView showProgressLabel:@"正在加载..."];
NSDictionary *paramDict = @{@"result":[self getSurveyResult],@"attachments":[self getAttachmentArray]};
[[ICRHTTPController sharedController]surveySaveResultWithDict:paramDict surveyUuid:_surveyUuid success:succ failure:fail];
[IBTLoadingView showTips:fail];
}];
}
- (NSArray *)getAttachmentArray {
NSMutableArray *attachArr = [NSMutableArray array];
NSMutableArray *resultMuArr = [NSMutableArray array];
NSMutableArray *arrImgsData = [[XFDB sharedInstance]fetchAllPhotosDataFromLocal];
if (arrImgsData.count == 0) {
//NSMutableArray *arrImgsData = [[XFDB sharedInstance]fetchAllPhotosDataFromLocal];
if ([JavenImages shareInstance].imageArr.count == 0) {
// return attachArr;
} else {
for (int count = 0; count < arrImgsData.count; count ++) {
NSData *data = arrImgsData[count];
for (int count = 0; count < [JavenImages shareInstance].imageArr.count; count ++) {
UIImage *image = [JavenImages shareInstance].imageArr[count];
NSData *data = UIImageJPEGRepresentation(image, 1);
NSString *fileName = [[NSString alloc]initWithData:data encoding:NSUTF8StringEncoding];
NSMutableDictionary *phontoMuDict = [NSMutableDictionary dictionaryWithObjects:@[@"",data ] forKeys:@[@"fileName",@"content"]];
[attachArr addObject:phontoMuDict];
......
......@@ -35,6 +35,7 @@
#import "GXFListProcessViewController.h"
#import "GXFFunctionDB.h"
#import "WriteFeedbackViewController.h"
#import "MarketSurveyViewController.h"
#define ICRFUNCTION_IMG_TOP_PADDING (25)
#define ICRFUNCTION_IMG_WIDTH (65)
#define ICRFUNCTION_LABEL_HEIGHT (15)
......@@ -233,7 +234,7 @@ static NSString *collectionCellID = @"collectionCell";
[self PushViewController:svc animated:YES];
}
break;
case kFunctionSeeSurvey://查看行情
case kFunctionSeeSurvey://查看行情调研
{
SurveyViewController *svc = [[SurveyViewController alloc] init];
svc.title = [IBTCommon localizableString:@"Survey"];
......@@ -244,10 +245,12 @@ static NSString *collectionCellID = @"collectionCell";
case kFunctionFeedBackSurvey: //填写行情反馈3
{
WriteFeedbackViewController *svc = [[WriteFeedbackViewController alloc] init];
// svc.title = [IBTCommon localizableString:@"Survey"];
// svc.navigationItem.hidesBackButton = YES;
[self PushViewController:svc animated:YES];
MarketSurveyViewController *marketSurveyVC = [[MarketSurveyViewController alloc] init];
marketSurveyVC.title = @"调研中";
//WriteFeedbackViewController *svc = [[WriteFeedbackViewController alloc] init];
[self PushViewController:marketSurveyVC animated:YES];
}
break;
case kFunctionNewPurchaseNotice://新建采购通知单
......
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