Commit b3ed99d7 authored by 曹云霄's avatar 曹云霄

正常进度

parent 9e8538c5
//
// AddaddressViewController.h
// Lighting
//
// Created by 曹云霄 on 16/5/5.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface AddaddressViewController : BaseViewController
@end
//
// AddaddressViewController.m
// Lighting
//
// Created by 曹云霄 on 16/5/5.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "AddaddressViewController.h"
@interface AddaddressViewController ()
@end
@implementation AddaddressViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
- (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
//
// AllCustomerViewController.h
// Lighting
//
// Created by 曹云霄 on 16/5/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface AllCustomerViewController : BaseViewController
/**
* 搜索栏背景
*/
@property (weak, nonatomic) IBOutlet UIView *searchBackview;
/**
* 搜索栏
*/
@property (weak, nonatomic) IBOutlet UITextField *searchTextfield;
/**
* 日期筛选起始时间
*/
@property (weak, nonatomic) IBOutlet UIButton *begindateButton;
/**
* 日期筛选结束时间
*/
@property (weak, nonatomic) IBOutlet UIButton *enddateButton;
/**
* 所有客户tableview
*/
@property (weak, nonatomic) IBOutlet UITableView *allCustomerTableview;
@end
//
// AllCustomerViewController.m
// Lighting
//
// Created by 曹云霄 on 16/5/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "AllCustomerViewController.h"
#import "AllCutomerTableViewCell.h"
@interface AllCustomerViewController ()<UITableViewDelegate,UITableViewDataSource>
@end
@implementation AllCustomerViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self uiConfigAction];
}
#pragma mark -UI
- (void)uiConfigAction
{
self.allCustomerTableview.dataSource = self;
self.allCustomerTableview.delegate = self;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
AllCutomerTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"allcustomercell" forIndexPath:indexPath];
cell.contentBackView.layer.masksToBounds = YES;
cell.contentBackView.layer.cornerRadius = kCornerRadius;
cell.backgroundColor = [UIColor clearColor];
return cell;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 10;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 116;
}
- (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
//
// AllCutomerTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 16/5/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface AllCutomerTableViewCell : UITableViewCell
/**
* content背景View
*/
@property (weak, nonatomic) IBOutlet UIView *contentBackView;
/**
* 客户头像
*/
@property (weak, nonatomic) IBOutlet UIImageView *customerHeader;
/**
* 客户名称
*/
@property (weak, nonatomic) IBOutlet UILabel *customerName;
/**
* 联系电话
*/
@property (weak, nonatomic) IBOutlet UILabel *customerPhoneName;
/**
* 最近到访时间
*/
@property (weak, nonatomic) IBOutlet UILabel *cutomerTime;
/**
* 服务导购
*/
@property (weak, nonatomic) IBOutlet UILabel *serviceName;
/**
* 客户地址
*/
@property (weak, nonatomic) IBOutlet UILabel *customerAddress;
@end
//
// AllCutomerTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 16/5/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "AllCutomerTableViewCell.h"
@implementation AllCutomerTableViewCell
- (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
//
// BillingInfoView.h
// Lighting
//
// Created by 曹云霄 on 16/5/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface BillingInfoView : UIView
@end
//
// BillingInfoView.m
// Lighting
//
// Created by 曹云霄 on 16/5/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BillingInfoView.h"
@implementation BillingInfoView
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
@end
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="3.0" toolsVersion="10116" systemVersion="15E65" targetRuntime="iOS.CocoaTouch.iPad" propertyAccessControl="none">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="10085"/>
</dependencies>
<objects>
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
<view contentMode="scaleToFill" id="iN0-l3-epB" customClass="BillingInfoView">
<rect key="frame" x="0.0" y="0.0" width="768" height="1024"/>
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/>
<color key="backgroundColor" white="1" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<point key="canvasLocation" x="340" y="308"/>
</view>
</objects>
</document>
//
// CustomerOrderTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 16/5/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface CustomerOrderTableViewCell : UITableViewCell
/**
* 日期
*/
@property (weak, nonatomic) IBOutlet UILabel *orderDate;
/**
* 订单编号
*/
@property (weak, nonatomic) IBOutlet UILabel *orderSerialNumber;
/**
* 操作员
*/
@property (weak, nonatomic) IBOutlet UILabel *shoppersName;
/**
* 客户头像
*/
@property (weak, nonatomic) IBOutlet UIImageView *customerHeader;
/**
* 订单状态
*/
@property (weak, nonatomic) IBOutlet UILabel *orderStatus;
/**
* 客户名称
*/
@property (weak, nonatomic) IBOutlet UILabel *customerName;
/**
* 款式数量
*/
@property (weak, nonatomic) IBOutlet UILabel *styleNumber;
/**
* 收货人
*/
@property (weak, nonatomic) IBOutlet UILabel *consigneeName;
/**
* 收货人电话
*/
@property (weak, nonatomic) IBOutlet UILabel *consigneePhoneNumber;
/**
* 商品品牌
*/
@property (weak, nonatomic) IBOutlet UILabel *goodsBrandName;
/**
* 联系电话
*/
@property (weak, nonatomic) IBOutlet UILabel *phoneNumber;
/**
* 购买数量
*/
@property (weak, nonatomic) IBOutlet UILabel *buyNumber;
/**
* 客户地址
*/
@property (weak, nonatomic) IBOutlet UILabel *consigneeAddress;
/**
* 订单总计
*/
@property (weak, nonatomic) IBOutlet UILabel *orderTotalPrice;
/**
* cell背景
*/
@property (weak, nonatomic) IBOutlet UIView *cellBackView;
@end
//
// CustomerOrderTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 16/5/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "CustomerOrderTableViewCell.h"
@implementation CustomerOrderTableViewCell
- (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
//
// CustomerOrderViewController.h
// Lighting
//
// Created by 曹云霄 on 16/5/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface CustomerOrderViewController : BaseViewController
/**
* customerOrderTableView
*/
@property (weak, nonatomic) IBOutlet UITableView *customerOrderTableView;
/**
* 搜索客户订单
*/
@property (weak, nonatomic) IBOutlet UITextField *searchCustomerOrder;
/**
* 订单状态排序
*/
@property (weak, nonatomic) IBOutlet UIButton *orderStateButton;
@end
//
// CustomerOrderViewController.m
// Lighting
//
// Created by 曹云霄 on 16/5/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "CustomerOrderViewController.h"
#import "CustomerOrderTableViewCell.h"
@interface CustomerOrderViewController ()<UITableViewDataSource,UITableViewDelegate>
@end
@implementation CustomerOrderViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
[self uiConfigAction];
}
#pragma mark -UI
- (void)uiConfigAction
{
self.customerOrderTableView.dataSource = self;
self.customerOrderTableView.delegate = self;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
CustomerOrderTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"customerordercell" forIndexPath:indexPath];
cell.backgroundColor = [UIColor clearColor];
cell.cellBackView.layer.masksToBounds = YES;
cell.cellBackView.layer.cornerRadius = kCornerRadius;
return cell;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 10;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 260;
}
- (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
......@@ -56,38 +56,31 @@
#pragma mark -RightVCselectedDelegate 方法
- (void)SelectedControllerWithIndex:(NSInteger)index
- (void)SelectedControllerWithIndex:(NSString *)Name
{
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;
if ([Name isEqualToString:@"体验中心"]) {
selectedIndex = 6;
}else if ([Name isEqualToString:@"场景库"])
{
selectedIndex = 5;
}else if ([Name isEqualToString:@"产品库"])
{
selectedIndex = 4;
}else if ([Name isEqualToString:@"客户管理"])
{
selectedIndex = 3;
}else if ([Name isEqualToString:@"所有客户"])
{
selectedIndex = 2;
}else if ([Name isEqualToString:@"客户订单"])
{
selectedIndex = 1;
}else if ([Name isEqualToString:@"关于"])
{
selectedIndex = 0;
}
self.customtabbar.selectedIndex = selectedIndex;
......
......@@ -50,6 +50,7 @@
[previewButton setTitle:@"预览" forState:UIControlStateNormal];
previewButton.titleLabel.font = [UIFont systemFontOfSize:12];
[previewButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[previewButton addTarget:self action:@selector(PreviewButtonClick:) forControlEvents:UIControlEventTouchUpInside];
previewButton.backgroundColor = kMainBlueColor;
previewButton.layer.masksToBounds = YES;
previewButton.layer.cornerRadius = kCornerRadius;
......@@ -61,6 +62,7 @@
[printButton setTitle:@"打印" forState:UIControlStateNormal];
[printButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
printButton.titleLabel.font = [UIFont systemFontOfSize:12];
[printButton addTarget:self action:@selector(AirprintButtonClick:) forControlEvents:UIControlEventTouchUpInside];
printButton.layer.masksToBounds = YES;
printButton.layer.cornerRadius = kCornerRadius;
printButton.backgroundColor = kMainBlueColor;
......@@ -190,7 +192,7 @@
break;
case 1:
{
return 140;
return 160;
}
break;
case 2:
......@@ -254,6 +256,34 @@
return 5;
}
#pragma mark -打印订单
- (void)AirprintButtonClick:(UIButton *)button
{
[self callAirprintWithdata:nil];
}
#pragma mark -预览订单
- (void)PreviewButtonClick:(UIButton *)button
{
}
/*
#pragma mark - Navigation
......
......@@ -30,39 +30,62 @@
{
self.productDetilsTableview.dataSource = self;
self.productDetilsTableview.delegate = self;
[self CreateHeaderView];
}
#pragma mark -头部视图
- (void)CreateHeaderView
{
self.headerView = [[[NSBundle mainBundle] loadNibNamed:@"ProductDetailsHeaderView" owner:self options:nil] lastObject];
self.productDetilsTableview.tableHeaderView = self.headerView;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
ProductDetailsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"productDetailscell" forIndexPath:indexPath];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
return cell;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 2;
return 1;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
return 170;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 2;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
return 50;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView *headerView = [[UIView alloc]initWithFrame:CGRectMake(0, 2, ScreenWidth, 46)];
headerView.backgroundColor = [UIColor grayColor];
UILabel *titleLabe = [[UILabel alloc]initWithFrame:CGRectMake(50, 15, 200, 20)];
titleLabe.textColor = [UIColor redColor];
titleLabe.font = [UIFont systemFontOfSize:12];
titleLabe.text = section?@"商品参数":@"图文详情";
[headerView addSubview:titleLabe];
return headerView;
}
......
......@@ -19,7 +19,7 @@
*/
@required
- (void)SelectedControllerWithIndex:(NSInteger)index;
- (void)SelectedControllerWithIndex:(NSString *)Name;
@end
......
......@@ -17,7 +17,10 @@
@interface RightViewController ()<UITableViewDataSource,UITableViewDelegate>
@property (nonatomic,strong) UITableView *rightTableview;
@property (nonatomic,strong) NSArray *dataArray;
@property (nonatomic,strong) NSMutableArray *dataArray;
@property (nonatomic,assign) BOOL isOpen;
@end
......@@ -32,7 +35,7 @@
{
if (_dataArray == nil) {
_dataArray = [NSArray arrayWithObjects:@"体验中心",@"场景库",@"产品库",@"客户管理",@"关于", nil];
_dataArray = [NSMutableArray arrayWithObjects:@"体验中心",@"场景库",@"产品库",@"客户管理",@"关于", nil];
}
return _dataArray;
}
......@@ -71,7 +74,10 @@
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"rightcell" forIndexPath:indexPath];
cell.textLabel.text = [self.dataArray objectAtIndex_opple:indexPath.row];
if (self.isOpen && ([cell.textLabel.text isEqualToString:@"所有客户"] || [cell.textLabel.text isEqualToString:@"客户订单"])) {
cell.backgroundColor = kMainBlueColor;
}
return cell;
}
......@@ -82,17 +88,51 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
//收起右侧控制器
[SHARED_APPDELEGATE.mmdrawer toggleDrawerSide:MMDrawerSideRight animated:YES completion:nil];
if ([self.delegate respondsToSelector:@selector(SelectedControllerWithIndex:)]) {
[self.delegate SelectedControllerWithIndex:indexPath.row];
[tableView deselectRowAtIndexPath:indexPath animated:YES];
UITableViewCell *cell = [tableView cellForRowAtIndexPath:indexPath];
if ([cell.textLabel.text isEqualToString:@"客户管理"] ) {
if (!self.isOpen) {
self.isOpen = YES;
[self.dataArray insertObject:@"所有客户" atIndex:self.dataArray.count-1];
[self.dataArray insertObject:@"客户订单" atIndex:self.dataArray.count-1];
[self.rightTableview insertRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:4 inSection:0],[NSIndexPath indexPathForRow:5 inSection:0]] withRowAnimation:UITableViewRowAnimationMiddle];
}
else
{
[self recoveryCell];
}
}else
{
//收起右侧控制器
[SHARED_APPDELEGATE.mmdrawer toggleDrawerSide:MMDrawerSideRight animated:YES completion:^(BOOL finished) {
[self recoveryCell];
}];
if ([self.delegate respondsToSelector:@selector(SelectedControllerWithIndex:)]) {
[self.delegate SelectedControllerWithIndex:[self.dataArray objectAtIndex_opple:indexPath.row]];
}
}
}
#pragma mark -复原cell
- (void)recoveryCell
{
if ([self.dataArray containsObject:@"所有客户"] && [self.dataArray containsObject:@"客户订单"]) {
self.isOpen = NO;
[self.dataArray removeObject:@"所有客户"];
[self.dataArray removeObject:@"客户订单"];
[self.rightTableview deleteRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:4 inSection:0],[NSIndexPath indexPathForRow:5 inSection:0]] withRowAnimation:UITableViewRowAnimationMiddle];
}
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
......
......@@ -10,4 +10,40 @@
@interface SceneLibraryViewController : BaseViewController
/**
* SeceneLibraryCollectionView
*/
@property (weak, nonatomic) IBOutlet UICollectionView *seceneLibararyCollectionView;
/**
* SeceneLibraryLayout
*/
@property (weak, nonatomic) IBOutlet UICollectionViewFlowLayout *seceneLibraryCollectionLayout;
/**
* 显示风格(为一横排多少张,4、6、9)
*/
@property (weak, nonatomic) IBOutlet UIButton *accordingStyle;
/**
* 数据风格
*/
@property (weak, nonatomic) IBOutlet UIButton *dataStyleButton;
/**
* 房型风格
*/
@property (weak, nonatomic) IBOutlet UIButton *houseStyleButton;
/**
* 背景View
*/
@property (weak, nonatomic) IBOutlet UIView *backView;
@end
......@@ -7,8 +7,9 @@
//
#import "SceneLibraryViewController.h"
#import "SeceneLibraryCollectionViewCell.h"
@interface SceneLibraryViewController ()
@interface SceneLibraryViewController ()<UICollectionViewDelegate,UICollectionViewDataSource>
@end
......@@ -17,9 +18,48 @@
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
self.view.backgroundColor = [UIColor grayColor];
[self uiConfigAction];
}
#pragma mark -UI
- (void)uiConfigAction
{
self.seceneLibraryCollectionLayout.itemSize = CGSizeMake((ScreenWidth-6)/3, (ScreenWidth-6)/3-50);
self.seceneLibraryCollectionLayout.minimumLineSpacing = 2;
self.seceneLibraryCollectionLayout.minimumInteritemSpacing = 2;
self.seceneLibraryCollectionLayout.sectionInset = UIEdgeInsetsMake(5, 0, 5, 0);
self.seceneLibararyCollectionView.dataSource = self;
self.seceneLibararyCollectionView.delegate = self;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath
{
SeceneLibraryCollectionViewCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"secenelibrary" forIndexPath:indexPath];
return cell;
}
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section
{
return 20;
}
#pragma mark -切换显示风格
- (IBAction)SwitchdisplayStyleClick:(UIButton *)sender {
self.seceneLibraryCollectionLayout.itemSize = CGSizeMake((ScreenWidth-10)/6, (ScreenWidth-10)/6-50);
[self.seceneLibararyCollectionView reloadData];
}
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
......
//
// SeceneLibraryCollectionViewCell.h
// Lighting
//
// Created by 曹云霄 on 16/5/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface SeceneLibraryCollectionViewCell : UICollectionViewCell
@end
//
// SeceneLibraryCollectionViewCell.m
// Lighting
//
// Created by 曹云霄 on 16/5/6.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "SeceneLibraryCollectionViewCell.h"
@implementation SeceneLibraryCollectionViewCell
@end
//
// GenerateOrdersModifyTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 16/5/5.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GenerateOrdersModifyTableViewCell : UITableViewCell
@end
//
// GenerateOrdersModifyTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 16/5/5.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "GenerateOrdersModifyTableViewCell.h"
@implementation GenerateOrdersModifyTableViewCell
- (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
//
// GenerateOrdersTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 16/5/5.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface GenerateOrdersTableViewCell : UITableViewCell
@end
//
// GenerateOrdersTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 16/5/5.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "GenerateOrdersTableViewCell.h"
@implementation GenerateOrdersTableViewCell
- (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
//
// GenerateOrdersViewController.h
// Lighting
//
// Created by 曹云霄 on 16/5/5.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface GenerateOrdersViewController : BaseViewController
/**
* 生成订单tableview
*/
@property (weak, nonatomic) IBOutlet UITableView *generateOrderTableview;
/**
* 返回购物车
*/
@property (weak, nonatomic) IBOutlet UIButton *backShoppingbagsButton;
/**
* 生成订单
*/
@property (weak, nonatomic) IBOutlet UIButton *createOrderButton;
/**
* 生成订单和返回购物车按钮背景
*/
@property (weak, nonatomic) IBOutlet UIView *BackView;
@end
//
// GenerateOrdersViewController.m
// Lighting
//
// Created by 曹云霄 on 16/5/5.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "GenerateOrdersViewController.h"
#import "GenerateOrdersTableViewCell.h"
#import "GenerateOrdersModifyTableViewCell.h"
#import "PersonInformationTableViewCell.h"
#import "CommodityListTableViewCell.h"
#import "AllpriceTableViewCell.h"
#import "AddaddressViewController.h"
#import "ModifyShippingAddressView.h"
#import "AppDelegate.h"
#import "OrderdetailsViewController.h"
@interface GenerateOrdersViewController ()<UITableViewDelegate,UITableViewDataSource>
/**
* 增加或者修改地址
*/
@property (nonatomic,strong) ModifyShippingAddressView *addressView;
@property (nonatomic,strong) UIView *Tabbarview;
@end
@implementation GenerateOrdersViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self uiConfigAction];
}
#pragma mark -UI
- (void)uiConfigAction
{
self.generateOrderTableview.dataSource = self;
self.generateOrderTableview.delegate = self;
self.generateOrderTableview.tableFooterView = [UIView new];
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
if (indexPath.section == 0 && indexPath.row == 0) {
PersonInformationTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"secondcell" forIndexPath:indexPath];
return cell;
}
else if (indexPath.section == 1)
{
if (indexPath.row == 1) {
GenerateOrdersModifyTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"Modifycell" forIndexPath:indexPath];
return cell;
}
GenerateOrdersTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"consigneecell" forIndexPath:indexPath];
return cell;
}
else if (indexPath.section == 2)
{
if (indexPath.row == 1) {
AllpriceTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"sixthcell" forIndexPath:indexPath];
return cell;
}
CommodityListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"fourthcell" forIndexPath:indexPath];
return cell;
}
return nil;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
switch (section) {
case 0:
{
return 1;
}
break;
case 1:
{
return 2;
}
break;
case 2:
{
return 2;
}
break;
default:
break;
}
return 0;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
switch (indexPath.section) {
case 0:
{
return 160;
}
break;
case 1:
{
return 56;
}
break;
case 2:
{
if (indexPath.row == 1) {
return 50;
}
return 80;
}
break;
default:
break;
}
return 0;
}
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section
{
switch (section) {
case 0:
{
return 0;
}
break;
case 1:
{
return 10;
}
break;
case 2:
{
return 44;
}
break;
default:
break;
}
return 0;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section
{
UIView *view = [[UIView alloc]initWithFrame:CGRectMake(0, 0, ScreenWidth, 44)];
view.backgroundColor = [UIColor redColor];
return view;
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 3;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[self CreateModifyShippingView];
}
#pragma mark -新增或者修改收货地址
- (void)CreateModifyShippingView
{
//修改收货地址弹出框
self.addressView = [[[NSBundle mainBundle] loadNibNamed:@"ModifyShippingAddressView" owner:self options:nil]firstObject];
self.addressView.frame = CGRectMake(0, ScreenHeight+NavigationHeight, ScreenWidth, ScreenHeight);
self.addressView.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
[self.addressView.turnoffButton addTarget:self action:@selector(TurnofffButtonClick) forControlEvents:UIControlEventTouchUpInside];
[self.addressView.citySelected addTarget:self action:@selector(SelectedCityButtonClick) forControlEvents:UIControlEventTouchUpInside];
[self.view addSubview:self.addressView];
//tabbar遮罩
self.Tabbarview = [[UIView alloc]initWithFrame:CGRectMake(0, ScreenHeight, ScreenWidth, NavigationHeight)];
self.Tabbarview.backgroundColor = [[UIColor blackColor] colorWithAlphaComponent:0.5];
[SHARED_APPDELEGATE.tabbar addSubview:self.Tabbarview];
[UIView animateWithDuration:0.2 animations:^{
self.Tabbarview.frame = CGRectMake(0, 0, ScreenWidth, NavigationHeight);
self.addressView.frame = CGRectMake(0, 0, ScreenWidth, ScreenHeight);
}];
}
#pragma mark -关闭按钮
- (void)TurnofffButtonClick
{
[UIView animateWithDuration:0.2 animations:^{
self.addressView.frame = CGRectMake(0, ScreenHeight+NavigationHeight, ScreenWidth, ScreenHeight);
self.Tabbarview.frame = CGRectMake(0, ScreenHeight, ScreenWidth, NavigationHeight);
}];
}
#pragma mark -生成订单
- (IBAction)CreateOrderButtonClick:(UIButton *)sender {
OrderdetailsViewController *orderDetails = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"orderdetails"];
[self.navigationController pushViewController:orderDetails animated:YES];
}
#pragma mark -返回购物车
- (IBAction)BackShoppingBagsButtonClick:(UIButton *)sender {
[self.navigationController popViewControllerAnimated:YES];
}
#pragma mark -城市选择器
- (void)SelectedCityButtonClick
{
ModifyShippingAddressView *view = [[[NSBundle mainBundle] loadNibNamed:@"ModifyShippingAddressView"
owner:self options:nil]lastObject];
view.frame = CGRectMake(0, self.addressView.popupView.frame.size.height, self.addressView.popupView.frame.size.width, 160);
[self.addressView.popupView addSubview:view];
view.tag = 100;
[view.selectedCityButton addTarget:self action:@selector(CompleteButton) forControlEvents:UIControlEventTouchUpInside];
[UIView animateWithDuration:0.2 animations:^{
view.frame = CGRectMake(0, self.addressView.popupView.frame.size.height-160, self.addressView.popupView.frame.size.width, 160);
}];
}
#pragma mark -完成按钮点击
- (void)CompleteButton
{
ModifyShippingAddressView *view = [self.view viewWithTag:100];
[UIView animateWithDuration:0.2 animations:^{
view.frame = CGRectMake(0, ScreenHeight, self.addressView.popupView.frame.size.width, 160);
}completion:^(BOOL finished) {
[view removeFromSuperview];
}];
}
- (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
//
// ModifyShippingAddressView.h
// Lighting
//
// Created by 曹云霄 on 16/5/5.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface ModifyShippingAddressView : UIView<UIPickerViewDelegate,UIPickerViewDataSource>
/**
* 关闭按钮
*/
@property (weak, nonatomic) IBOutlet UIButton *turnoffButton;
/**
* title
*/
@property (weak, nonatomic) IBOutlet UILabel *changAddressLabe;
/**
* 收件人
*/
@property (weak, nonatomic) IBOutlet UITextField *recipientPerson;
/**
* 手机号
*/
@property (weak, nonatomic) IBOutlet UITextField *PhoneNumber;
/**
* 邮箱
*/
@property (weak, nonatomic) IBOutlet UITextField *personEmail;
/**
* 地址选择(城市选择器)
*/
@property (weak, nonatomic) IBOutlet UIButton *citySelected;
/**
* 详细地址
*/
@property (weak, nonatomic) IBOutlet UITextField *detailsAddress;
/**
* 删除按钮(取消按钮)
*/
@property (weak, nonatomic) IBOutlet UIButton *delectAddressButton;
/**
* 修改按钮(新增按钮)
*/
@property (weak, nonatomic) IBOutlet UIButton *modifyButton;
/**
* 弹出框View
*/
@property (weak, nonatomic) IBOutlet UIView *popupView;
/**
* 城市选择器完成
*/
@property (weak, nonatomic) IBOutlet UIButton *selectedCityButton;
/**
* UIPickerView
*/
@property (weak, nonatomic) IBOutlet UIPickerView *cityPickerView;
@end
//
// ModifyShippingAddressView.m
// Lighting
//
// Created by 曹云霄 on 16/5/5.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "ModifyShippingAddressView.h"
@implementation ModifyShippingAddressView
{
NSMutableArray *provinces; //城市大数组
NSArray *cities; //城市小数组
NSString *provincesString; //省份
NSString *cityString; //城市
NSString *cityIDstring; //城市ID
NSString *_cityCode; //城市编码
}
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
- (void)awakeFromNib
{
[self uiConfigAction];
}
#pragma mark -UI
- (void)uiConfigAction
{
self.cityPickerView.delegate = self;
self.cityPickerView.dataSource = self;
NSString *path = [[NSBundle mainBundle] pathForResource:@"city" ofType:@"json"];
NSString *string = [NSString stringWithContentsOfFile:path encoding:NSUTF8StringEncoding error:nil];
NSData *data = [string dataUsingEncoding:NSUTF8StringEncoding];
provinces = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
cities = [[provinces objectAtIndex:0] objectForKey:@"list"];
}
#pragma mark -城市选择器代理方法
- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)pickerView
{
return 2;
}
- (NSInteger)pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:(NSInteger)componen
{
switch (componen) {
case 0:
{
return [provinces count];
}
break;
case 1:
{
return [cities count];
}
break;
default:
break;
}
return 0;
}
- (NSString *)pickerView:(UIPickerView *)pickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component
{
switch (component)
{
case 0:
return [[provinces objectAtIndex:row] objectForKey:@"name"];
break;
case 1:
return [[cities objectAtIndex:row] objectForKey:@"name"];
break;
default:
return nil;
break;
}
}
- (void)pickerView:(UIPickerView *)pickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component
{
switch (component)
{
case 0:
cities = [[provinces objectAtIndex:row] objectForKey:@"list"];
[self.cityPickerView selectRow:0 inComponent:1 animated:NO];
[self.cityPickerView reloadComponent:1];
provincesString = [[provinces objectAtIndex:row] objectForKey:@"name"];
cityString = [[cities objectAtIndex:0] objectForKey:@"name"];
_cityCode = [[cities objectAtIndex:0] objectForKey:@"code"];//城市编码
break;
case 1:
cityString = [[cities objectAtIndex:row] objectForKey:@"name"];
cityIDstring = [[cities objectAtIndex:row] objectForKey:@"code"];
_cityCode = [NSString stringWithFormat:@"%@",[[cities objectAtIndex:row] objectForKey:@"code"]];//城市编码
break;
default:
break;
}
[self.citySelected setTitle:cityString forState:UIControlStateNormal];
}
- (UIView *)pickerView:(UIPickerView *)pickerView viewForRow:(NSInteger)row forComponent:(NSInteger)component reusingView:(UIView *)view{
UILabel* pickerLabel = (UILabel*)view;
if (!pickerLabel){
pickerLabel = [[UILabel alloc] init];
pickerLabel.adjustsFontSizeToFitWidth = YES;
pickerLabel.textColor = kMainBlueColor;
pickerLabel.textAlignment = NSTextAlignmentCenter;
[pickerLabel setBackgroundColor:[UIColor clearColor]];
[pickerLabel setFont:[UIFont boldSystemFontOfSize:15]];
}
// Fill the label text here
pickerLabel.text=[self pickerView:pickerView titleForRow:row forComponent:component];
return pickerLabel;
}
@end
This diff is collapsed.
......@@ -9,6 +9,9 @@
#import "ShoppingViewController.h"
#import "ShoppingTableViewCell.h"
#import "AppDelegate.h"
#import "GenerateOrdersViewController.h"
@interface ShoppingViewController ()<UITableViewDelegate,UITableViewDataSource>
......@@ -79,11 +82,14 @@
#pragma mark -结算
- (IBAction)settlementButtonClick:(UIButton *)sender {
GenerateOrdersViewController *generateOrder = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"generateorders"];
[self.navigationController pushViewController:generateOrder animated:YES];
}
#pragma mark -全选
- (IBAction)allSelectedButtonClick:(id)sender {
}
......@@ -92,11 +98,6 @@
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
......
......@@ -15,6 +15,8 @@
#import "ProductLibraryViewController.h"
#import "CustomerManagementViewController.h"
#import "AboutViewController.h"
#import "AllCustomerViewController.h"
#import "CustomerOrderViewController.h"
@interface CustomTabbarController ()<TabbarButtonClickdelegate>
......@@ -35,7 +37,7 @@
{
if (_identifierArray == nil) {
_identifierArray = [NSArray arrayWithObjects:@"shopping",@"Client",@"followheart",@"scenelibrary",@"productlibrary",@"customermanager",@"about", nil];
_identifierArray = [NSArray arrayWithObjects:@"shopping",@"Client",@"followheart",@"scenelibrary",@"productlibrary",@"customermanager",@"allcustomer",@"customerorder",@"about", nil];
}
return _identifierArray
;
......@@ -66,11 +68,9 @@
{
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];
SHARED_APPDELEGATE.tabbar = self.tabBar;
}
......@@ -86,7 +86,9 @@
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]];
AllCustomerViewController *allcustomerVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:6]];
CustomerOrderViewController *customerOrderVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:7]];
AboutViewController *aboutVC = [storyboard instantiateViewControllerWithIdentifier:[self.identifierArray objectAtIndex_opple:8]];
UINavigationController *shoppingNav = [[UINavigationController alloc]initWithRootViewController:shoppingVC];
......@@ -95,11 +97,13 @@
UINavigationController *sceneNav = [[UINavigationController alloc]initWithRootViewController:sceneVC];
UINavigationController *productNav = [[UINavigationController alloc]initWithRootViewController:productVC];
UINavigationController *customerNav = [[UINavigationController alloc]initWithRootViewController:customerVC];
UINavigationController *allcustomerNav = [[UINavigationController alloc]initWithRootViewController:allcustomerVC];
UINavigationController *cutomerorderNav = [[UINavigationController alloc]initWithRootViewController:customerOrderVC];
UINavigationController *aboutNav = [[UINavigationController alloc]initWithRootViewController:aboutVC];
NSArray *vcArray = [NSArray arrayWithObjects:aboutNav,customerNav,productNav,sceneNav,followNav,clientNav,shoppingNav, nil];
NSArray *vcArray = [NSArray arrayWithObjects:aboutNav,cutomerorderNav,allcustomerNav,customerNav,productNav,sceneNav,followNav,clientNav,shoppingNav, nil];
self.viewControllers = vcArray;
self.selectedIndex = 5;
self.selectedIndex = 7;
}
......@@ -137,14 +141,14 @@
//我的客户
case 102:
self.selectedIndex = 5;
self.selectedIndex = 7;
break;
//购物车
case 103:
self.selectedIndex = 6;
self.selectedIndex = 8;
break;
......
This diff is collapsed.
......@@ -30,6 +30,12 @@
*/
@property (nonatomic,strong) MMDrawerController *mmdrawer;
/**
* tabbar控制器
*/
@property (nonatomic,strong) UITabBar *tabbar;
- (void)saveContext;
- (NSURL *)applicationDocumentsDirectory;
......
......@@ -3,7 +3,7 @@
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<string>China(zh_CN)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -33,5 +33,30 @@
*/
- (void)SHOWPrompttext:(NSString *)Text ComcpleteBlock:(void(^)())completed;
/**
* 获得我的storyboard对象
*/
- (UIStoryboard *)getStoryboardWithName;
/**
* 调用打印机
*/
- (void)callAirprintWithdata:(NSData *)PDFdata;
@end
......@@ -8,7 +8,7 @@
#import "BaseViewController.h"
@interface BaseViewController ()
@interface BaseViewController ()<UIPrintInteractionControllerDelegate>
@property (nonatomic,strong) MBProgressHUD*TCHud;
......@@ -95,5 +95,44 @@
}
}
#pragma mark -获得我的storyboard对象
- (UIStoryboard *)getStoryboardWithName
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"StoryboardwithCYX" bundle:nil];
return storyboard;
}
#pragma mark 调用airPrint无线打印机
- (void)callAirprintWithdata:(NSData *)PDFdata
{
NSData *mypdfdata = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"The Swift Programming Language 中文版 - v1.2" ofType:@"pdf"]];
UIPrintInteractionController *pic = [UIPrintInteractionController sharedPrintController];
if (pic && [UIPrintInteractionController canPrintData: mypdfdata] ) {
pic.delegate = self;
UIPrintInfo *printInfo = [UIPrintInfo printInfo];
printInfo.outputType = UIPrintInfoOutputGeneral;
printInfo.jobName = @"订单明细";
printInfo.duplex = UIPrintInfoDuplexLongEdge;
pic.printInfo = printInfo;
pic.showsPageRange = YES;
pic.printingItem = mypdfdata;
void (^completionHandler)(UIPrintInteractionController *, BOOL, NSError *) =
^(UIPrintInteractionController *pic, BOOL completed, NSError *error) {
if (!completed && error)
NSLog(@"FAILED! due to error in domain %@ with error code %ld",
error.domain, error.code);
};
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
[pic presentAnimated:YES completionHandler:completionHandler];
} else {
[pic presentAnimated:YES completionHandler:completionHandler];
}
}
}
@end
This diff is collapsed.
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