Commit 12500c01 authored by freecui's avatar freecui

首页界面

parent 1f30d9b8
...@@ -41,6 +41,11 @@ ...@@ -41,6 +41,11 @@
30ECD6251B00948A0088C57A /* ICRPatrolPlanCellContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 30ECD6231B00948A0088C57A /* ICRPatrolPlanCellContentView.m */; }; 30ECD6251B00948A0088C57A /* ICRPatrolPlanCellContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 30ECD6231B00948A0088C57A /* ICRPatrolPlanCellContentView.m */; };
30F7F5711ADE723100A9B24E /* ICRAttachmentCellContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 30F7F5701ADE723100A9B24E /* ICRAttachmentCellContentView.m */; }; 30F7F5711ADE723100A9B24E /* ICRAttachmentCellContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 30F7F5701ADE723100A9B24E /* ICRAttachmentCellContentView.m */; };
30F7F5721ADE723100A9B24E /* ICRAttachmentCellContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 30F7F5701ADE723100A9B24E /* ICRAttachmentCellContentView.m */; }; 30F7F5721ADE723100A9B24E /* ICRAttachmentCellContentView.m in Sources */ = {isa = PBXBuildFile; fileRef = 30F7F5701ADE723100A9B24E /* ICRAttachmentCellContentView.m */; };
35A1C3451B8EA7A4004AC9F7 /* GXFFunctionsViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 35A1C3441B8EA7A4004AC9F7 /* GXFFunctionsViewController.m */; };
35A1C3481B8EB33B004AC9F7 /* GXFFunction.m in Sources */ = {isa = PBXBuildFile; fileRef = 35A1C3471B8EB33B004AC9F7 /* GXFFunction.m */; };
35A1C34B1B8EB35D004AC9F7 /* GXFDisplayFunction.m in Sources */ = {isa = PBXBuildFile; fileRef = 35A1C34A1B8EB35D004AC9F7 /* GXFDisplayFunction.m */; };
35A1C34E1B8ECBCA004AC9F7 /* GXFNoticeFunctionTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 35A1C34D1B8ECBCA004AC9F7 /* GXFNoticeFunctionTableViewCell.m */; };
35A1C3511B8ED609004AC9F7 /* GXFFunctionCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 35A1C3501B8ED609004AC9F7 /* GXFFunctionCollectionViewCell.m */; };
35C3C0AC1AE956040035AC8A /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 35C3C0AB1AE956040035AC8A /* Security.framework */; }; 35C3C0AC1AE956040035AC8A /* Security.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 35C3C0AB1AE956040035AC8A /* Security.framework */; };
35C3C0AE1AE9560E0035AC8A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 35C3C0AD1AE9560E0035AC8A /* CoreGraphics.framework */; }; 35C3C0AE1AE9560E0035AC8A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 35C3C0AD1AE9560E0035AC8A /* CoreGraphics.framework */; };
35C3C0B01AE9561E0035AC8A /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 35C3C0AF1AE9561E0035AC8A /* SystemConfiguration.framework */; }; 35C3C0B01AE9561E0035AC8A /* SystemConfiguration.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 35C3C0AF1AE9561E0035AC8A /* SystemConfiguration.framework */; };
...@@ -427,6 +432,16 @@ ...@@ -427,6 +432,16 @@
30ECD6231B00948A0088C57A /* ICRPatrolPlanCellContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ICRPatrolPlanCellContentView.m; sourceTree = "<group>"; }; 30ECD6231B00948A0088C57A /* ICRPatrolPlanCellContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ICRPatrolPlanCellContentView.m; sourceTree = "<group>"; };
30F7F56F1ADE723100A9B24E /* ICRAttachmentCellContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ICRAttachmentCellContentView.h; sourceTree = "<group>"; }; 30F7F56F1ADE723100A9B24E /* ICRAttachmentCellContentView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ICRAttachmentCellContentView.h; sourceTree = "<group>"; };
30F7F5701ADE723100A9B24E /* ICRAttachmentCellContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ICRAttachmentCellContentView.m; sourceTree = "<group>"; }; 30F7F5701ADE723100A9B24E /* ICRAttachmentCellContentView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = ICRAttachmentCellContentView.m; sourceTree = "<group>"; };
35A1C3431B8EA7A4004AC9F7 /* GXFFunctionsViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFFunctionsViewController.h; sourceTree = "<group>"; };
35A1C3441B8EA7A4004AC9F7 /* GXFFunctionsViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFFunctionsViewController.m; sourceTree = "<group>"; };
35A1C3461B8EB33B004AC9F7 /* GXFFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFFunction.h; sourceTree = "<group>"; };
35A1C3471B8EB33B004AC9F7 /* GXFFunction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFFunction.m; sourceTree = "<group>"; };
35A1C3491B8EB35D004AC9F7 /* GXFDisplayFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFDisplayFunction.h; sourceTree = "<group>"; };
35A1C34A1B8EB35D004AC9F7 /* GXFDisplayFunction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFDisplayFunction.m; sourceTree = "<group>"; };
35A1C34C1B8ECBCA004AC9F7 /* GXFNoticeFunctionTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFNoticeFunctionTableViewCell.h; sourceTree = "<group>"; };
35A1C34D1B8ECBCA004AC9F7 /* GXFNoticeFunctionTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFNoticeFunctionTableViewCell.m; sourceTree = "<group>"; };
35A1C34F1B8ED609004AC9F7 /* GXFFunctionCollectionViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = GXFFunctionCollectionViewCell.h; sourceTree = "<group>"; };
35A1C3501B8ED609004AC9F7 /* GXFFunctionCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = GXFFunctionCollectionViewCell.m; sourceTree = "<group>"; };
35C3C0AB1AE956040035AC8A /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; }; 35C3C0AB1AE956040035AC8A /* Security.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Security.framework; path = System/Library/Frameworks/Security.framework; sourceTree = SDKROOT; };
35C3C0AD1AE9560E0035AC8A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; }; 35C3C0AD1AE9560E0035AC8A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
35C3C0AF1AE9561E0035AC8A /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; }; 35C3C0AF1AE9561E0035AC8A /* SystemConfiguration.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = SystemConfiguration.framework; path = System/Library/Frameworks/SystemConfiguration.framework; sourceTree = SDKROOT; };
...@@ -1536,8 +1551,18 @@ ...@@ -1536,8 +1551,18 @@
C159185D1AC078020013B391 /* Home */ = { C159185D1AC078020013B391 /* Home */ = {
isa = PBXGroup; isa = PBXGroup;
children = ( children = (
35A1C3491B8EB35D004AC9F7 /* GXFDisplayFunction.h */,
35A1C34A1B8EB35D004AC9F7 /* GXFDisplayFunction.m */,
35A1C3461B8EB33B004AC9F7 /* GXFFunction.h */,
35A1C3471B8EB33B004AC9F7 /* GXFFunction.m */,
35A1C3431B8EA7A4004AC9F7 /* GXFFunctionsViewController.h */,
35A1C3441B8EA7A4004AC9F7 /* GXFFunctionsViewController.m */,
C15918611AC19FB30013B391 /* ICRHomeViewController.h */, C15918611AC19FB30013B391 /* ICRHomeViewController.h */,
C15918621AC19FB30013B391 /* ICRHomeViewController.m */, C15918621AC19FB30013B391 /* ICRHomeViewController.m */,
35A1C34C1B8ECBCA004AC9F7 /* GXFNoticeFunctionTableViewCell.h */,
35A1C34D1B8ECBCA004AC9F7 /* GXFNoticeFunctionTableViewCell.m */,
35A1C34F1B8ED609004AC9F7 /* GXFFunctionCollectionViewCell.h */,
35A1C3501B8ED609004AC9F7 /* GXFFunctionCollectionViewCell.m */,
C10214E11AD9140C0024637E /* Announcement */, C10214E11AD9140C0024637E /* Announcement */,
); );
path = Home; path = Home;
...@@ -2180,6 +2205,7 @@ ...@@ -2180,6 +2205,7 @@
C1E9F5731B2E411900BF1356 /* IBTFileManager.m in Sources */, C1E9F5731B2E411900BF1356 /* IBTFileManager.m in Sources */,
C15295B71B24450A00DF60D1 /* ICRQAViewController.m in Sources */, C15295B71B24450A00DF60D1 /* ICRQAViewController.m in Sources */,
30D7FE5D1AD4F941003D92EE /* ICRAboutViewController.m in Sources */, 30D7FE5D1AD4F941003D92EE /* ICRAboutViewController.m in Sources */,
35A1C3481B8EB33B004AC9F7 /* GXFFunction.m in Sources */,
7281A0B31B8974120052B1AC /* NewPurchaseViewController.m in Sources */, 7281A0B31B8974120052B1AC /* NewPurchaseViewController.m in Sources */,
C10214DF1AD90A3F0024637E /* ICRFunctionItemControl.m in Sources */, C10214DF1AD90A3F0024637E /* ICRFunctionItemControl.m in Sources */,
C15918431AC062460013B391 /* IBTTableViewUserInfo.m in Sources */, C15918431AC062460013B391 /* IBTTableViewUserInfo.m in Sources */,
...@@ -2203,6 +2229,7 @@ ...@@ -2203,6 +2229,7 @@
C11A346B1B2451D500079129 /* NALLabelsMatrix.m in Sources */, C11A346B1B2451D500079129 /* NALLabelsMatrix.m in Sources */,
C17DE85A1AD81D1600581AA6 /* NSMutableArray+SafeInsert.m in Sources */, C17DE85A1AD81D1600581AA6 /* NSMutableArray+SafeInsert.m in Sources */,
35C3C0B91AE9567B0035AC8A /* ICRNavigationViewController.mm in Sources */, 35C3C0B91AE9567B0035AC8A /* ICRNavigationViewController.mm in Sources */,
35A1C3511B8ED609004AC9F7 /* GXFFunctionCollectionViewCell.m in Sources */,
C123A8FB1B2561E1003C0C36 /* JTPopOverWindow.m in Sources */, C123A8FB1B2561E1003C0C36 /* JTPopOverWindow.m in Sources */,
72F56CB21B76EC200077F0C9 /* SurveyUser.m in Sources */, 72F56CB21B76EC200077F0C9 /* SurveyUser.m in Sources */,
FE17F6861B85CA5B0078CE96 /* ShopDetaileViewController.m in Sources */, FE17F6861B85CA5B0078CE96 /* ShopDetaileViewController.m in Sources */,
...@@ -2231,6 +2258,7 @@ ...@@ -2231,6 +2258,7 @@
30D3C1251ADF6451004AC54E /* ICRAnnouncementDetailContentView.m in Sources */, 30D3C1251ADF6451004AC54E /* ICRAnnouncementDetailContentView.m in Sources */,
FEAE16E91B79C9F9009D9E01 /* ResultView.m in Sources */, FEAE16E91B79C9F9009D9E01 /* ResultView.m in Sources */,
FEA2F30C1B84687D00D64735 /* FooterCell.m in Sources */, FEA2F30C1B84687D00D64735 /* FooterCell.m in Sources */,
35A1C34B1B8EB35D004AC9F7 /* GXFDisplayFunction.m in Sources */,
C142D2C01AC3A155000109A7 /* UIView+ViewFrameGeometry.m in Sources */, C142D2C01AC3A155000109A7 /* UIView+ViewFrameGeometry.m in Sources */,
FE17F6851B85CA5B0078CE96 /* SeePurchaseNoticeViewController.m in Sources */, FE17F6851B85CA5B0078CE96 /* SeePurchaseNoticeViewController.m in Sources */,
C1FE50451AE0249A00C18080 /* IBTImagePicker.m in Sources */, C1FE50451AE0249A00C18080 /* IBTImagePicker.m in Sources */,
...@@ -2242,6 +2270,7 @@ ...@@ -2242,6 +2270,7 @@
7217E9F21B72364300FE5C1D /* StartTimeView.m in Sources */, 7217E9F21B72364300FE5C1D /* StartTimeView.m in Sources */,
C1FE50351AE020D400C18080 /* IBTAudioController.m in Sources */, C1FE50351AE020D400C18080 /* IBTAudioController.m in Sources */,
7281A0C21B898A040052B1AC /* PurchaseDetailViewController.m in Sources */, 7281A0C21B898A040052B1AC /* PurchaseDetailViewController.m in Sources */,
35A1C34E1B8ECBCA004AC9F7 /* GXFNoticeFunctionTableViewCell.m in Sources */,
FEA2F3061B8453DE00D64735 /* CostViewController.m in Sources */, FEA2F3061B8453DE00D64735 /* CostViewController.m in Sources */,
C14BE3061ADB84350049F1AA /* IBTTextFieldCell.m in Sources */, C14BE3061ADB84350049F1AA /* IBTTextFieldCell.m in Sources */,
30F7F5711ADE723100A9B24E /* ICRAttachmentCellContentView.m in Sources */, 30F7F5711ADE723100A9B24E /* ICRAttachmentCellContentView.m in Sources */,
...@@ -2254,6 +2283,7 @@ ...@@ -2254,6 +2283,7 @@
C1FE503D1AE0235D00C18080 /* IBTAudioServicesManager.m in Sources */, C1FE503D1AE0235D00C18080 /* IBTAudioServicesManager.m in Sources */,
7217E9F41B72364300FE5C1D /* SurveyListCell.m in Sources */, 7217E9F41B72364300FE5C1D /* SurveyListCell.m in Sources */,
C10214D21AD904F30024637E /* ICRPatrolPlanViewController.m in Sources */, C10214D21AD904F30024637E /* ICRPatrolPlanViewController.m in Sources */,
35A1C3451B8EA7A4004AC9F7 /* GXFFunctionsViewController.m in Sources */,
72C8034F1B7B735300990363 /* TopSheetView.m in Sources */, 72C8034F1B7B735300990363 /* TopSheetView.m in Sources */,
C1E108591ADA53C700620375 /* ICRTaskResultViewController.m in Sources */, C1E108591ADA53C700620375 /* ICRTaskResultViewController.m in Sources */,
FEAE16EF1B79CAE3009D9E01 /* SingleScrollView.m in Sources */, FEAE16EF1B79CAE3009D9E01 /* SingleScrollView.m in Sources */,
......
...@@ -402,6 +402,7 @@ acceptTypeJson:(BOOL)bAcceptJson ...@@ -402,6 +402,7 @@ acceptTypeJson:(BOOL)bAcceptJson
userUtil.orgName = dictResult[ @"enterprise_name" ]; userUtil.orgName = dictResult[ @"enterprise_name" ];
userUtil.orgId = dictResult[ @"enterprise_uuid" ]; userUtil.orgId = dictResult[ @"enterprise_uuid" ];
userUtil.authenticode = dictResult[@"authenticode"]; userUtil.authenticode = dictResult[@"authenticode"];
userUtil.permissions = dictResult[@"permissions"];
[userUtil saveArchive]; [userUtil saveArchive];
if (succ) { if (succ) {
succ( dictResult ); succ( dictResult );
......
//
// GXFDisplayActions.h
// XFFruit
// 显示有已有权限功能的信息
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTObject.h"
@interface GXFDisplayFunction : IBTObject
@property (nonatomic, assign) NSInteger Id; //
@property (nonatomic, copy) NSString *functionName; //
@property (nonatomic, copy) NSString *imgName; //
@property (nonatomic, assign) BOOL isSelected; //选中
+ (instancetype)initClassWithDictionary: (NSDictionary *)dict;
- (instancetype)initWithDictionary: (NSDictionary *)dict;
@end
//
// GXFDisplayActions.m
// XFFruit
// 显示有已有权限功能的信息
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFDisplayFunction.h"
@implementation GXFDisplayFunction
+ (instancetype)initClassWithDictionary:(NSDictionary *)dict {
return [self initClassWithDictionary:dict];
}
- (instancetype)initWithDictionary:(NSDictionary *)dict {
self = [super init];
if (!self) {
return nil;
} else {
[self setValuesForKeysWithDictionary:dict];
}
return self;
}
@end
//
// GXFActions.h
// XFFruit
// 后台返回的json权限文件的内容:选择权限和是否选择
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTObject.h"
@interface GXFFunction : IBTObject
@property (nonatomic, assign) NSInteger Id;
@property (nonatomic, copy) NSString *name; //权限
@property (nonatomic, copy) NSString *captions; //权限的名称
@property (nonatomic, assign) BOOL hasPermission;
@property (nonatomic, assign) BOOL isSelected;
//@property (nonatomic, assign) BOOL isPublic; 是否公共部分功能
@end
//
// GXFActions.m
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFFunction.h"
@implementation GXFFunction
@end
//
// GXFNoticeCollectionViewCell.h
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
#define ICRFUNCTION_IMG_TOP_PADDING (25)
#define ICRFUNCTION_IMG_WIDTH (65)
#define ICRFUNCTION_LABEL_HEIGHT (15)
#define ICRFUNCTION_INNER_GAP (7)
#define RIGHT_LINE_WIDTH (0.5)
@interface GXFFunctionCollectionViewCell : UICollectionViewCell
@property (nonatomic, strong, readonly) UIImageView *functionImage;
@property (nonatomic, strong, readonly) UILabel *functionNameLabel;
@end
//
// GXFNoticeCollectionViewCell.m
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFFunctionCollectionViewCell.h"
@implementation GXFFunctionCollectionViewCell
- (id)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (!self) {
return nil;
}
_functionImage = [[UIImageView alloc]initWithFrame:CGRectMake((CGRectGetWidth(self.frame) - ICRFUNCTION_IMG_WIDTH)/2, ICRFUNCTION_IMG_TOP_PADDING, ICRFUNCTION_IMG_WIDTH, ICRFUNCTION_IMG_WIDTH)];
_functionImage.backgroundColor = [UIColor clearColor];
[self.contentView addSubview:_functionImage];
_functionNameLabel = [[UILabel alloc] init];
CGSize labelSize = CGSizeMake(CGRectGetWidth(self.frame), ICRFUNCTION_LABEL_HEIGHT);
labelSize = [_functionNameLabel sizeThatFits:labelSize];
_functionNameLabel.frame = (CGRect){
.origin.x = (CGRectGetWidth(self.frame) - labelSize.width)/2,
.origin.y = CGRectGetMaxY(_functionImage.frame) + ICRFUNCTION_INNER_GAP,
.size.width = labelSize.width,
.size.height = ICRFUNCTION_LABEL_HEIGHT
};
_functionNameLabel.textColor = [UIColor colorWithRed:0.596f green:0.596f blue:0.596f alpha:1.00f];
_functionNameLabel.textAlignment = NSTextAlignmentCenter;
_functionNameLabel.font = [UIFont systemFontOfSize:13];
[self.contentView addSubview:_functionNameLabel];
self.backgroundColor = [UIColor whiteColor];
return self;
}
@end
//
// GXFFunctionsViewController.h
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "IBTUIViewController.h"
@interface GXFFunctionsViewController : IBTUIViewController
@end
//
// GXFFunctionsViewController.m
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFFunctionsViewController.h"
#import "GXFDisplayFunction.h"
#import "GXFFunction.h"
@interface GXFFunctionsViewController ()<UITableViewDataSource,UITableViewDelegate>
//@property (nonatomic, strong) NSArray *
@property (nonatomic, strong) UITableView *f_tableView;
@property (nonatomic, strong) NSArray *firstSectionArr;
@property (nonatomic, strong) NSArray *secondSectionArr;
@end
@implementation GXFFunctionsViewController
static NSString *cellID = @"cell";
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self initData];
[self setupSubViews];
}
- (void)initData {
NSDictionary *dictOne = @{@"Id":@(1),@"functionName":@"新建行情反馈",@"imgName":@"RefreshBtn",@"isSelected":@(0)};
NSDictionary *dictTwo = @{@"Id":@(2),@"functionName":@"查询行情反馈",@"imgName":@"RefreshBtn",@"isSelected":@(1)};
GXFDisplayFunction *dFuntionOne = [[GXFDisplayFunction alloc]initWithDictionary:dictOne];
GXFDisplayFunction *dFuntionTwo = [[GXFDisplayFunction alloc]initWithDictionary:dictTwo];
self.firstSectionArr = @[dFuntionOne,dFuntionTwo];
self.secondSectionArr = @[dFuntionOne,dFuntionTwo];
//self.firstSection =
}
- (void)setupSubViews {
[self setupRightBarBtn];
[self setupTableView];
}
- (void)setupRightBarBtn {
UIBarButtonItem *rightBarBtn = [[UIBarButtonItem alloc]initWithTitle:@"确定" style:UIBarButtonItemStylePlain target:self action:@selector(selectedFunctions)];
self.navigationItem.rightBarButtonItem = rightBarBtn;
}
- (void)setupTableView {
self.f_tableView = [[UITableView alloc]initWithFrame:self.view.frame style:UITableViewStyleGrouped];
self.f_tableView.dataSource = self;
self.f_tableView.delegate = self;
//[self.f_tableView dequeueReusableCellWithIdentifier ]
[self.view addSubview:_f_tableView];
}
#pragma BarButton Action
- (void)selectedFunctions {
[self PopViewControllerAnimated:YES];
}
#pragma UITablewViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 2;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if (section == 0) {
return _firstSectionArr.count;
} else {
return _secondSectionArr.count;
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
if (!cell) {
cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellID];
}
switch (indexPath.section) {
case 0:
{
[self p_contentToTableViewCell:cell andArray:_firstSectionArr];
}
break;
case 1:
{
[self p_contentToTableViewCell:cell andArray:_secondSectionArr];
}
break;
default:
break;
}
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
- (NSString *)tableView:(UITableView *)tableView titleForDeleteConfirmationButtonForRowAtIndexPath:(NSIndexPath *)indexPath {
NSString *sectionTitle = [NSString string];
switch (indexPath.section) {
case 0:
{
sectionTitle = @"提示选择";
}
break;
case 1:
{
sectionTitle = @"功能选择";
}
break;
}
return sectionTitle;
}
#pragma UITableViewDelegate
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [_f_tableView cellForRowAtIndexPath:indexPath];
if (cell.accessoryType == UITableViewCellAccessoryNone) {
cell.accessoryType = UITableViewCellAccessoryCheckmark;
// if (indexPath.section == 0) {
// _firstSectionArr
// }
} else {
cell.accessoryType = UITableViewCellAccessoryNone;
}
switch (indexPath.section) {
case 0:
{
}
break;
case 1:
{
}
break;
}
}
#pragma 给cell的内容赋值
- (void)p_contentToTableViewCell: (UITableViewCell *)cell andArray: (NSArray *)array {
for (int count = 0; count < array.count; count ++) {
GXFDisplayFunction *dFunction = (GXFDisplayFunction *)array[count];
cell.imageView.image = [UIImage imageNamed:dFunction.imgName];
cell.textLabel.text = dFunction.functionName;
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
/*
#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
//
// GXFNoticeFunctionTableViewCell.h
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GXFNoticeFunctionTableViewCell : UITableViewCell
@property (nonatomic, strong, readonly) UIImageView *functionImg;
@property (nonatomic, strong, readonly) UILabel *noticeLabel;
@property (nonatomic, strong, readonly) UILabel *unReadLabel;
@end
//
// GXFNoticeFunctionTableViewCell.m
// XFFruit
//
// Created by freecui on 15/8/27.
// Copyright (c) 2015年 Xummer. All rights reserved.
//
#import "GXFNoticeFunctionTableViewCell.h"
@implementation GXFNoticeFunctionTableViewCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
_functionImg = [[UIImageView alloc]initWithFrame:CGRectMake(20.f, 10.f, 45.f, 45.f)];
_functionImg.image = [UIImage imageNamed:@""];
[self.contentView addSubview:_functionImg];
_unReadLabel = [[UILabel alloc]initWithFrame:CGRectMake(self.width - 60.f,(self.height - 20.0f)/2.0 , 25.0f, 20.0f)];
_unReadLabel.backgroundColor = [UIColor redColor];
_unReadLabel.textColor = [UIColor whiteColor];
_unReadLabel.font = [UIFont systemFontOfSize:13];
_unReadLabel.layer.cornerRadius =10;
_unReadLabel.layer.masksToBounds = YES;
[self.contentView addSubview:_unReadLabel];
_noticeLabel = [[UILabel alloc] initWithFrame:CGRectMake(_functionImg.right ,_functionImg.x,self.width - _functionImg.right - 40,self.height)];
_noticeLabel.font = [UIFont systemFontOfSize:13.0f];
[_noticeLabel setTextAlignment:NSTextAlignmentRight];
_noticeLabel.textColor = [UIColor blackColor];
[self.contentView addSubview:_noticeLabel];
}
return self;
}
- (void)awakeFromNib {
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment