Commit a00a176e authored by freecui's avatar freecui

把首页的第二部分有collectionView换成functionbaseView

parent 12500c01
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
#import "ICRFunctionBaseView.h" #import "ICRFunctionBaseView.h"
#import "ICRFunctionEntity.h" #import "ICRFunctionEntity.h"
#import "ICRFunctionBaseView.h"
#import "NewSurveyViewController.h" #import "NewSurveyViewController.h"
#import "SurveyViewController.h" #import "SurveyViewController.h"
...@@ -42,13 +42,17 @@ ...@@ -42,13 +42,17 @@
#define ICRFUNCTION_INNER_GAP (5) #define ICRFUNCTION_INNER_GAP (5)
#define RIGHT_LINE_WIDTH (0.5) #define RIGHT_LINE_WIDTH (0.5)
@interface ICRHomeViewController () @interface ICRHomeViewController ()
<UITableViewDataSource,UITableViewDelegate,UICollectionViewDataSource,UICollectionViewDelegate>//,UICollectionViewDelegateFlowLayout> <UITableViewDataSource,UITableViewDelegate,UICollectionViewDataSource,UICollectionViewDelegate,ICRFunctionBaseViewDelegate>//,UICollectionViewDelegateFlowLayout>
@property (nonatomic, strong) UITableView *f_tableView; @property (nonatomic, strong) UITableView *f_tableView;
@property (nonatomic, strong) NSArray *firstSectionArr; @property (nonatomic, strong) NSArray *firstSectionArr;
@property (nonatomic, strong) NSArray *secondSectionArr; @property (nonatomic, strong) NSArray *secondSectionArr;
@property (nonatomic, strong) ICRFunctionBaseView *f_functionBaseView;
@property (nonatomic, strong) UICollectionView *f_collectionView; @property (nonatomic, strong) UICollectionView *f_collectionView;
@end @end
@implementation ICRHomeViewController @implementation ICRHomeViewController
...@@ -68,6 +72,7 @@ static NSString *collectionCellID = @"collectionCell"; ...@@ -68,6 +72,7 @@ static NSString *collectionCellID = @"collectionCell";
[self setupRightBarBtn]; [self setupRightBarBtn];
[self setupTableView]; [self setupTableView];
[self setupColletionView]; [self setupColletionView];
[self setupFunctionBaseView];
} }
- (void)initData { - (void)initData {
NSDictionary *dictOne = @{@"Id":@(1),@"functionName":@"新建行情反馈",@"imgName":@"RefreshBtn",@"isSelected":@(0)}; NSDictionary *dictOne = @{@"Id":@(1),@"functionName":@"新建行情反馈",@"imgName":@"RefreshBtn",@"isSelected":@(0)};
...@@ -105,10 +110,74 @@ static NSString *collectionCellID = @"collectionCell"; ...@@ -105,10 +110,74 @@ static NSString *collectionCellID = @"collectionCell";
self.f_collectionView.dataSource = self; self.f_collectionView.dataSource = self;
self.f_collectionView.delegate = self; self.f_collectionView.delegate = self;
} }
- (void)setupFunctionBaseView {
NSMutableArray *funtionEntitlesArr = [NSMutableArray array];
NSArray *functionImageNames = @[ @"AnnouncementIcon",@"create_surver",@"watch_surver",@"create_surver_result",@"create_needs",@"watch_needs",@"create_purchase",@"watch_purchase",@"review_purchase",@"create_transport",@"watch_transort",@"create_process"];
NSArray *functionNames = @[ [IBTCommon localizableString:@"Announcement"],
[IBTCommon localizableString:@"AddSurvey"],
[IBTCommon localizableString:@"Survey"],
[IBTCommon localizableString:@"Survey1"],
[IBTCommon localizableString:@"Survey2"],
[IBTCommon localizableString:@"Survey3"],
[IBTCommon localizableString:@"Survey4"],
[IBTCommon localizableString:@"Survey5"],
[IBTCommon localizableString:@"Survey6"],
[IBTCommon localizableString:@"Survey7"],
[IBTCommon localizableString:@"Survey8"],[IBTCommon localizableString:@"Survey9"],
];
NSArray *functionTags = @[ @(kFunctionNotice),
//公告
@(kFunctionNewSurvey),
//新建行情调研
@(kFunctionSeeSurvey),
//查看行情调研
@(kFunctionFeeBackSurvey),
//填写行情反馈
@(kFunctionNewPurchaseNotice),
//新建采购通知
@(kFunctionSeePurchaseNotice),
//查看采购通知
@(kFunctionNewPurchase),
//新建采购单
@(kFunctionSeePurchase),
//查看采购单
@(kFunctionExaminePurchas),
//审核采购单
@(kFunctionNewShipment),
//新建发运单
@(kFunctionSeeShipment),
//查看发运单
@(kFunctionNewProcessing)];
//新建加工单
int i = 0;
for (NSString *functionName in functionNames) {
ICRFunctionEntity *functionEntity = [[ICRFunctionEntity alloc]init];
functionEntity.functionName = functionName;
functionEntity.iconName = functionImageNames[i];
// functionEntity.functionItemTag = []
[funtionEntitlesArr addObject:functionEntity];
i++;
}
self.f_functionBaseView = [ICRFunctionBaseView initWithFunctionData:funtionEntitlesArr];
_f_functionBaseView.frame = (CGRect){
.origin.x = 0,
.origin.y =0,
.size.width = CGRectGetWidth(self.view.frame),
.size.height = CGRectGetHeight(self.view.frame),};
_f_functionBaseView.backgroundColor = [UIColor clearColor];
_f_functionBaseView.m_delegate = self;
}
#pragma BarButton Action #pragma BarButton Action
- (void)defineFunctions { - (void)defineFunctions {
GXFFunctionsViewController *functionsVc = [[GXFFunctionsViewController alloc]init]; GXFFunctionsViewController *functionsVc = [[GXFFunctionsViewController alloc]init];
[self PushViewController:functionsVc animated:YES]; [self PushViewController:functionsVc animated:YES];
} }
...@@ -138,11 +207,13 @@ static NSString *collectionCellID = @"collectionCell"; ...@@ -138,11 +207,13 @@ static NSString *collectionCellID = @"collectionCell";
if (indexPath.section == 0) { if (indexPath.section == 0) {
cell = [[GXFNoticeFunctionTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID]; cell = [[GXFNoticeFunctionTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator; cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
cell.textLabel.text = @"查看行情反馈-进行中";
} else { } else {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"secondCell"]; cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"secondCell"];
//self.f_collectionView.size = //self.f_collectionView.size =
[cell.contentView addSubview:_f_collectionView]; // [cell.contentView addSubview:_f_collectionView];
[cell.contentView addSubview:_f_functionBaseView];
NSLog(@"%@",NSStringFromCGRect(cell.frame)); NSLog(@"%@",NSStringFromCGRect(cell.frame));
} }
} }
......
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