Commit 7be88176 authored by 曹云霄's avatar 曹云霄

创建了所有的模块控制器并加入tabbar控制器统一管理,完成订单详情页布局、客户详情页布局

parent d5e8b4b0
//
// CustomerdetailsController.h
// AboutViewController.h
// Lighting
//
// Created by 曹云霄 on 16/4/29.
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface CustomerdetailsController : BaseViewController
@interface AboutViewController : BaseViewController
@end
//
// CustomerdetailsController.m
// AboutViewController.m
// Lighting
//
// Created by 曹云霄 on 16/4/29.
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "CustomerdetailsController.h"
#import "AboutViewController.h"
@interface CustomerdetailsController ()
@interface AboutViewController ()
@end
@implementation CustomerdetailsController
@implementation AboutViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = [UIColor purpleColor];
}
- (void)didReceiveMemoryWarning {
......
//
// AllpriceTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AllpriceTableViewCell : UITableViewCell
/**
* 商品总数量
*/
@property (weak, nonatomic) IBOutlet UILabel *goodsAllNumber;
/**
* 商品总价格
*/
@property (weak, nonatomic) IBOutlet UILabel *goodsAllPrice;
@end
//
// AllpriceTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "AllpriceTableViewCell.h"
@implementation AllpriceTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// AttachmentInformationTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AttachmentInformationTableViewCell : UITableViewCell
/**
* 是否开票
*/
@property (weak, nonatomic) IBOutlet UILabel *whetherInvoice;
/**
* 发票抬头
*/
@property (weak, nonatomic) IBOutlet UILabel *InvoiceHeader;
/**
* 发票类型
*/
@property (weak, nonatomic) IBOutlet UILabel *invoicetype;
@end
//
// AttachmentInformationTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "AttachmentInformationTableViewCell.h"
@implementation AttachmentInformationTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
......@@ -8,6 +8,9 @@
#import "ClientdetailsViewController.h"
#import "ClientDetailsTableViewCell.h"
#import "OrderTableViewCell.h"
#import "OrderdetailsViewController.h"
@interface ClientdetailsViewController ()<UITableViewDelegate,UITableViewDataSource>
/**
......@@ -47,14 +50,23 @@
self.shoppingBagButton.selected = YES;
self.shoppingBagButton.backgroundColor = [UIColor whiteColor];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
ClientDetailsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ClientDetails" forIndexPath:indexPath];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
if (self.shoppingBagButton.selected) {
ClientDetailsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ClientDetails" forIndexPath:indexPath];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}else if (self.orderRecordButton.selected)
{
OrderTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"ordercell" forIndexPath:indexPath];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
return nil;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
......@@ -64,9 +76,24 @@
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 100;
if (self.shoppingBagButton.selected) {
return 100;
}
else if (self.orderRecordButton.selected)
{
return 200;
}
return 0;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"StoryboardwithCYX" bundle:nil];
OrderdetailsViewController *orderdetails = [storyboard instantiateViewControllerWithIdentifier:@"orderdetails"];
[self.navigationController pushViewController:orderdetails animated:YES];
}
......@@ -90,7 +117,8 @@
sender.backgroundColor = [UIColor whiteColor];
sender.selected = YES;
self.orderRecordButton.selected = NO;
self.orderRecordButton.backgroundColor = kMainColor;
self.orderRecordButton.backgroundColor = kMainBlueColor;
[self.ClientdetailsTableview reloadData];
}
#pragma mark -订单记录
......@@ -100,7 +128,8 @@
sender.backgroundColor = [UIColor whiteColor];
sender.selected = YES;
self.shoppingBagButton.selected = NO;
self.shoppingBagButton.backgroundColor = kMainColor;
self.shoppingBagButton.backgroundColor = kMainBlueColor;
[self.ClientdetailsTableview reloadData];
}
......
//
// CommodityListTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CommodityListTableViewCell : UITableViewCell
/**
* 商品图片
*/
@property (weak, nonatomic) IBOutlet UIImageView *goodsHeader;
/**
* 商品名字
*/
@property (weak, nonatomic) IBOutlet UILabel *goodsName;
/**
* 商品数量
*/
@property (weak, nonatomic) IBOutlet UILabel *goodsNumber;
/**
* 成交价格
*/
@property (weak, nonatomic) IBOutlet UILabel *clinchPrice;
/**
* 小计
*/
@property (weak, nonatomic) IBOutlet UILabel *totalPrice;
@end
//
// CommodityListTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "CommodityListTableViewCell.h"
@implementation CommodityListTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// CustomerManagementViewController.h
// Lighting
//
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface CustomerManagementViewController : BaseViewController
@end
//
// CustomerManagementViewController.m
// Lighting
//
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "CustomerManagementViewController.h"
@interface CustomerManagementViewController ()
@end
@implementation CustomerManagementViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = [UIColor greenColor];
}
- (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
//
// FollowHeartViewController.h
// Lighting
//
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface FollowHeartViewController : BaseViewController
@end
//
// FollowHeartViewController.m
// Lighting
//
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "FollowHeartViewController.h"
@interface FollowHeartViewController ()
@end
@implementation FollowHeartViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = [UIColor redColor];
}
- (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
//
// GoodsInformationTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GoodsInformationTableViewCell : UITableViewCell
/**
* 收货人
*/
@property (weak, nonatomic) IBOutlet UILabel *consigneeName;
/**
* 电子邮箱
*/
@property (weak, nonatomic) IBOutlet UILabel *emailName;
/**
* 详细地址
*/
@property (weak, nonatomic) IBOutlet UILabel *detailsAddress;
/**
* 手机号码
*/
@property (weak, nonatomic) IBOutlet UILabel *consigneePhoneNumber;
/**
* 物流公司
*/
@property (weak, nonatomic) IBOutlet UILabel *logisticsCompany;
@end
//
// GoodsInformationTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "GoodsInformationTableViewCell.h"
@implementation GoodsInformationTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
......@@ -9,14 +9,30 @@
#import "LoginViewController.h"
#import "CustomTabbarController.h"
#import "AppDelegate.h"
@interface LoginViewController ()
@interface LoginViewController ()<RightVCselectedDelegate>
@property (weak, nonatomic) IBOutlet UIButton *loginButton;
@property (nonatomic,strong) MMDrawerController *drawerController;
@property (nonatomic,strong) CustomTabbarController *customtabbar;
@end
@implementation LoginViewController
- (CustomTabbarController *)customtabbar
{
if (_customtabbar == nil) {
_customtabbar = [[CustomTabbarController alloc]init];
}
return _customtabbar;
}
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
......@@ -27,9 +43,9 @@
#pragma mark -登陆
- (IBAction)LoginButtonClick:(UIButton *)sender {
CustomTabbarController *customtabbar = [[CustomTabbarController alloc]init];
RightViewController *rightVC = [[RightViewController alloc]init];
self.drawerController = [[MMDrawerController alloc]initWithCenterViewController:customtabbar rightDrawerViewController:rightVC];
rightVC.delegate = self;
self.drawerController = [[MMDrawerController alloc]initWithCenterViewController:self.customtabbar rightDrawerViewController:rightVC];
[self.drawerController setMaximumRightDrawerWidth:RightWidth];
[self.drawerController setOpenDrawerGestureModeMask:MMOpenDrawerGestureModeAll];
[self.drawerController setCloseDrawerGestureModeMask:MMCloseDrawerGestureModeAll];
......@@ -39,6 +55,46 @@
}
#pragma mark -RightVCselectedDelegate 方法
- (void)SelectedControllerWithIndex:(NSInteger)index
{
NSInteger selectedIndex;
switch (index) {
case 0:
{
selectedIndex = 4;
}
break;
case 1:
{
selectedIndex = 3;
}
break;
case 2:
{
selectedIndex = 2;
}
break;
case 3:
{
selectedIndex = 1;
}
break;
case 4:
{
selectedIndex = 0;
}
break;
default:
break;
}
self.customtabbar.selectedIndex = selectedIndex;
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
......
//
// OrderInformationTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface OrderInformationTableViewCell : UITableViewCell
/**
* 订单编号
*/
@property (weak, nonatomic) IBOutlet UILabel *orderNumber;
/**
* 下单日期
*/
@property (weak, nonatomic) IBOutlet UILabel *orderTime;
/**
* 订单状态
*/
@property (weak, nonatomic) IBOutlet UILabel *orderStatus;
/**
* 操作员
*/
@property (weak, nonatomic) IBOutlet UILabel *operatorName;
@end
//
// OrderInformationTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "OrderInformationTableViewCell.h"
@implementation OrderInformationTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// OrderTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface OrderTableViewCell : UITableViewCell
@end
//
// OrderTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "OrderTableViewCell.h"
@implementation OrderTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// OrderdetailsViewController.h
// Lighting
//
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface OrderdetailsViewController : BaseViewController
/**
* 订单详情tableview
*/
@property (weak, nonatomic) IBOutlet UITableView *orderDetailsTableview;
@end
//
// OrderdetailsViewController.m
// Lighting
//
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "OrderdetailsViewController.h"
#import "OrderInformationTableViewCell.h"
#import "PersonInformationTableViewCell.h"
#import "GoodsInformationTableViewCell.h"
#import "CommodityListTableViewCell.h"
#import "AllpriceTableViewCell.h"
#import "AttachmentInformationTableViewCell.h"
@interface OrderdetailsViewController ()<UITableViewDelegate,UITableViewDataSource>
@end
@implementation OrderdetailsViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self uiConfigAction];
}
#pragma mark - UI
- (void)uiConfigAction
{
self.orderDetailsTableview.dataSource = self;
self.orderDetailsTableview.delegate = self;
// self.orderDetailsTableview.tableFooterView = [UIView new];
[self CreateTableviewHeaderView];
[self CreateTableviewFooterView];
}
#pragma mark -TableviewHeader------根据不同的订单状态判断是否显示
- (void)CreateTableviewHeaderView
{
UIView *headerView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, 60)];
//预览
UIButton *previewButton = [UIButton buttonWithType:UIButtonTypeSystem];
previewButton.frame = CGRectMake(50, 15, 150, 30);
[previewButton setTitle:@"预览" forState:UIControlStateNormal];
previewButton.titleLabel.font = [UIFont systemFontOfSize:12];
[previewButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
previewButton.backgroundColor = kMainBlueColor;
previewButton.layer.masksToBounds = YES;
previewButton.layer.cornerRadius = kCornerRadius;
[headerView addSubview:previewButton];
//打印
UIButton *printButton = [UIButton buttonWithType:UIButtonTypeSystem];
printButton.frame = CGRectMake(ScreenWidth-50-150, 15, 150, 30);
[printButton setTitle:@"打印" forState:UIControlStateNormal];
[printButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
printButton.titleLabel.font = [UIFont systemFontOfSize:12];
printButton.layer.masksToBounds = YES;
printButton.layer.cornerRadius = kCornerRadius;
printButton.backgroundColor = kMainBlueColor;
[headerView addSubview:printButton];
//横线
UIView *lineView = [[UIView alloc]initWithFrame:CGRectMake(0, 59, ScreenWidth, 1)];
lineView.backgroundColor = kTCColor(193, 193, 193);
[headerView addSubview:lineView];
self.orderDetailsTableview.tableHeaderView = headerView;
}
#pragma mark -TableviewFooterView------根据不同的订单状态判断支付按钮是否显示
- (void)CreateTableviewFooterView
{
UIView *footerView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, 100)];
//支付
UIButton *payButton = [UIButton buttonWithType:UIButtonTypeSystem];
payButton.frame = CGRectMake((ScreenWidth-150)/2, 30, 150, 40);
[payButton setTitle:@"支付" forState:UIControlStateNormal];
payButton.titleLabel.font = [UIFont systemFontOfSize:12];
[payButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
payButton.backgroundColor = kMainBlueColor;
payButton.layer.masksToBounds = YES;
payButton.layer.cornerRadius = kCornerRadius;
[footerView addSubview:payButton];
self.orderDetailsTableview.tableFooterView = footerView;
}
#pragma mark - Table view data source
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
switch (section) {
case 0:
{
return 1;
}
break;
case 1:
{
return 1;
}
break;
case 2:
{
return 1;
}
break;
case 3:
{
return 3;
}
break;
case 4:
{
return 1;
}
break;
default:
break;
}
return 0;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
switch (indexPath.section) {
case 0://订单信息
{
OrderInformationTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"firstcell" forIndexPath:indexPath];
return cell;
}
break;
case 1://客户信息
{
PersonInformationTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"secondcell" forIndexPath:indexPath];
return cell;
}
break;
case 2://收货信息
{
GoodsInformationTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"thirdcell" forIndexPath:indexPath];
return cell;
}
break;
case 3://商品清单
{
if (indexPath.row == 2) {
//商品总计
AllpriceTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"sixthcell" forIndexPath:indexPath];
return cell;
}else
{
//单个商品
CommodityListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"fourthcell" forIndexPath:indexPath];
return cell;
}
}
break;
case 4://附件信息
{
AttachmentInformationTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"fifthcell" forIndexPath:indexPath];
return cell;
}
break;
default:
break;
}
return nil;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
switch (indexPath.section) {
case 0:
{
return 84;
}
break;
case 1:
{
return 140;
}
break;
case 2:
{
return 110;
}
break;
case 3:
{
//商品总计
if (indexPath.row == 2) {
return 50;
}
else
{
//单个商品
return 80;
}
}
break;
case 4:
{
return 75;
}
break;
default:
break;
}
return 100;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, 44)];
view.backgroundColor = kMainGrayColor;
//区头文字
UILabel *Titlelabe = [[UILabel alloc]initWithFrame:CGRectMake(0, 10, ScreenWidth, 34)];
Titlelabe.backgroundColor = [UIColor whiteColor];
Titlelabe.text = @" 订单详情";
Titlelabe.font = [UIFont systemFontOfSize:13];
[view addSubview:Titlelabe];
return view;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 44;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 5;
}
/*
#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.
}
*/
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
//
// PersonInformationTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface PersonInformationTableViewCell : UITableViewCell
/**
* 客户头像
*/
@property (weak, nonatomic) IBOutlet UIImageView *customerHeader;
/**
* 客户姓名
*/
@property (weak, nonatomic) IBOutlet UILabel *customerName;
/**
* 公司名称
*/
@property (weak, nonatomic) IBOutlet UILabel *companyName;
/**
* 电子邮箱
*/
@property (weak, nonatomic) IBOutlet UILabel *emailName;
/**
* 公司地址
*/
@property (weak, nonatomic) IBOutlet UILabel *companyLocation;
/**
* 手机号码
*/
@property (weak, nonatomic) IBOutlet UILabel *customerPhoneNumber;
/**
* 电话号码
*/
@property (weak, nonatomic) IBOutlet UILabel *customerNumbers;
/**
* QQ
*/
@property (weak, nonatomic) IBOutlet UILabel *customerQQNumber;
@end
//
// PersonInformationTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "PersonInformationTableViewCell.h"
@implementation PersonInformationTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
@end
//
// ProductLibraryViewController.h
// Lighting
//
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface ProductLibraryViewController : BaseViewController
@end
//
// ProductLibraryViewController.m
// Lighting
//
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "ProductLibraryViewController.h"
@interface ProductLibraryViewController ()
@end
@implementation ProductLibraryViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = [UIColor blueColor];
}
- (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
......@@ -8,6 +8,26 @@
#import "BaseViewController.h"
/**
* 右侧控制器选中代理
*/
@protocol RightVCselectedDelegate <NSObject>
/**
* 选中控制器返回当前下标
*
*/
@required
- (void)SelectedControllerWithIndex:(NSInteger)index;
@end
@interface RightViewController : BaseViewController
@property (nonatomic,strong) id<RightVCselectedDelegate>delegate;
@end
......@@ -8,6 +8,12 @@
#import "RightViewController.h"
#import "AppDelegate.h"
@interface RightViewController ()<UITableViewDataSource,UITableViewDelegate>
@property (nonatomic,strong) UITableView *rightTableview;
......@@ -26,7 +32,7 @@
{
if (_dataArray == nil) {
_dataArray = [NSArray arrayWithObjects:@"随心配",@"场景库",@"产品库",@"体验中心",@"客户管理",@"关于", nil];
_dataArray = [NSArray arrayWithObjects:@"体验中心",@"场景库",@"产品库",@"客户管理",@"关于", nil];
}
return _dataArray;
}
......@@ -78,31 +84,10 @@
{
//收起右侧控制器
[SHARED_APPDELEGATE.mmdrawer toggleDrawerSide:MMDrawerSideRight animated:YES completion:nil];
switch (indexPath.row) {
case 0: //随心配
break;
case 1: //场景库
break;
case 2: //产品库
break;
case 3: //体验中心
break;
case 4: //客户管理
break;
case 5://关于
break;
default:
break;
if ([self.delegate respondsToSelector:@selector(SelectedControllerWithIndex:)]) {
[self.delegate SelectedControllerWithIndex:indexPath.row];
}
}
......
//
// SceneLibraryViewController.h
// Lighting
//
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface SceneLibraryViewController : BaseViewController
@end
//
// SceneLibraryViewController.m
// Lighting
//
// Created by 曹云霄 on 16/5/4.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "SceneLibraryViewController.h"
@interface SceneLibraryViewController ()
@end
@implementation SceneLibraryViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = [UIColor grayColor];
}
- (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
......@@ -10,6 +10,12 @@
#import "CustomTabbarController.h"
#import "Toolview.h"
#import "AppDelegate.h"
#import "FollowHeartViewController.h"
#import "SceneLibraryViewController.h"
#import "ProductLibraryViewController.h"
#import "CustomerManagementViewController.h"
#import "AboutViewController.h"
@interface CustomTabbarController ()<TabbarButtonClickdelegate>
......@@ -29,7 +35,7 @@
{
if (_identifierArray == nil) {
_identifierArray = [NSArray arrayWithObjects:@"shopping",@"Client", nil];
_identifierArray = [NSArray arrayWithObjects:@"shopping",@"Client",@"followheart",@"scenelibrary",@"productlibrary",@"customermanager",@"about", nil];
}
return _identifierArray
;
......@@ -60,21 +66,53 @@
{
self.tabBar.frame = CGRectMake(Zero, Zero, ScreenWidth, NavigationHeight);
Toolview *toolview = [[Toolview alloc]initWithFrame:CGRectMake(Zero, Zero, ScreenWidth, NavigationHeight)];
toolview.delegate = self;
[self.tabBar addSubview:toolview];
}
#pragma mark -添加controller
#pragma mark -添加controller到viewControllers
- (void)addViewcontroller
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"StoryboardwithCYX" bundle:nil];
ShoppingViewController *shoppingVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray firstObject]];
ShoppingViewController *shoppingVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:0]];
ClientViewController *clientVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:1]];
FollowHeartViewController *followVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:2]];
SceneLibraryViewController *sceneVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:3]];
ProductLibraryViewController *productVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:4]];
CustomerManagementViewController *customerVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:5]];
AboutViewController *aboutVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:6]];
UINavigationController *shoppingNav = [[UINavigationController alloc]initWithRootViewController:shoppingVC];
UINavigationController *clientNav = [[UINavigationController alloc]initWithRootViewController:clientVC];
NSArray *vcArray = [NSArray arrayWithObjects:clientNav,shoppingNav, nil];
UINavigationController *followNav = [[UINavigationController alloc]initWithRootViewController:followVC];
UINavigationController *sceneNav = [[UINavigationController alloc]initWithRootViewController:sceneVC];
UINavigationController *productNav = [[UINavigationController alloc]initWithRootViewController:productVC];
UINavigationController *customerNav = [[UINavigationController alloc]initWithRootViewController:customerVC];
UINavigationController *aboutNav = [[UINavigationController alloc]initWithRootViewController:aboutVC];
NSArray *vcArray = [NSArray arrayWithObjects:aboutNav,customerNav,productNav,sceneNav,followNav,clientNav,shoppingNav, nil];
self.viewControllers = vcArray;
self.selectedIndex = 5;
}
#pragma mark -移除系统自带的UITabBarButton
- (void)viewWillLayoutSubviews {
[super viewWillLayoutSubviews];
for (UIView *view in self.tabBar.subviews) {
if ([view isKindOfClass:NSClassFromString(@"UITabBarButton")]) {
[view removeFromSuperview];
}
}
}
......@@ -99,14 +137,14 @@
//我的客户
case 102:
self.selectedIndex = 0;
self.selectedIndex = 5;
break;
//购物车
case 103:
self.selectedIndex = 1;
self.selectedIndex = 6;
break;
......@@ -116,6 +154,9 @@
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
......
This diff is collapsed.
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -34,6 +34,7 @@
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.automaticallyAdjustsScrollViewInsets = NO;
}
- (void)didReceiveMemoryWarning {
......
......@@ -94,7 +94,9 @@
/**
* 主题蓝色
*/
#define kMainColor [UIColor colorWithRed:89/255.0 green:172/255.0 blue:220/255.0 alpha:1.0]
#define kMainBlueColor [UIColor colorWithRed:89/255.0 green:172/255.0 blue:220/255.0 alpha:1.0]
/**
* 默认圆角系数
......@@ -102,7 +104,10 @@
#define kCornerRadius 3
/**
* 主题灰色
*/
#define kMainGrayColor [UIColor colorWithRed:241/255.0 green:241/255.0 blue:241/255.0 alpha:1.0]
......
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