Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
O
Opple-iOS
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
张杰
Opple-iOS
Commits
5437c3e6
Commit
5437c3e6
authored
Apr 29, 2016
by
曹云霄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
caoyunxiao
parent
63fb02bb
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
26 changed files
with
1469 additions
and
43 deletions
+1469
-43
ClientViewController.h
Lighting/Class/ClientViewController.h
+43
-0
ClientViewController.m
Lighting/Class/ClientViewController.m
+28
-11
CustomerdetailsController.h
Lighting/Class/CustomerdetailsController.h
+13
-0
CustomerdetailsController.m
Lighting/Class/CustomerdetailsController.m
+37
-0
InformationTableViewCell.h
Lighting/Class/InformationTableViewCell.h
+13
-0
InformationTableViewCell.m
Lighting/Class/InformationTableViewCell.m
+24
-0
LoginViewController.m
Lighting/Class/Login/LoginViewController.m
+19
-1
RightViewController.m
Lighting/Class/RightViewController.m
+61
-2
ShoppingTableViewCell.h
Lighting/Class/Shoppingcart/ShoppingTableViewCell.h
+69
-0
ShoppingTableViewCell.m
Lighting/Class/Shoppingcart/ShoppingTableViewCell.m
+47
-0
ShoppingViewController.h
Lighting/Class/Shoppingcart/ShoppingViewController.h
+22
-0
ShoppingViewController.m
Lighting/Class/Shoppingcart/ShoppingViewController.m
+77
-1
CustomTabbarController.m
Lighting/Class/Tabbar/CustomTabbarController.m
+64
-11
Toolview.h
Lighting/Class/Tabbar/Toolview.h
+19
-0
Toolview.m
Lighting/Class/Tabbar/Toolview.m
+48
-3
project.pbxproj
Lighting/Lighting.xcodeproj/project.pbxproj
+149
-3
AppDelegate.h
Lighting/Lighting/AppDelegate.h
+7
-0
StoryboardwithCYX.storyboard
Lighting/Lighting/StoryboardwithCYX.storyboard
+487
-10
CustomButton.h
Lighting/Tools/CustomButton.h
+11
-0
CustomButton.m
Lighting/Tools/CustomButton.m
+24
-1
MMExampleDrawerVisualStateManager.h
Lighting/Tools/MMExampleDrawerVisualStateManager.h
+42
-0
MMExampleDrawerVisualStateManager.m
Lighting/Tools/MMExampleDrawerVisualStateManager.m
+97
-0
PrefixHeader.pch
Lighting/Tools/PrefixHeader.pch
+3
-0
instructionsLabe.h
Lighting/Tools/instructionsLabe.h
+21
-0
instructionsLabe.m
Lighting/Tools/instructionsLabe.m
+44
-0
weibo.png
Lighting/Tools/weibo.png
+0
-0
No files found.
Lighting/Class/ClientViewController.h
View file @
5437c3e6
...
...
@@ -10,4 +10,47 @@
@interface
ClientViewController
:
BaseViewController
/**
* tableview
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UITableView
*
informationTableview
;
/**
* 客户名称
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UITextField
*
customerNameField
;
/**
* 手机号码
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UITextField
*
phoneNumberField
;
/**
* 公司名称
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UITextField
*
companyNameField
;
/**
* 客户地址
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UITextField
*
customerAddress
;
/**
* 添加客户信息
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UIButton
*
addpersonInformationButton
;
/**
* 更改客户信息
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UIButton
*
changePersonInformationButton
;
/**
* 搜索客户信息
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UITextField
*
searchPersonInformationField
;
@end
Lighting/Class/ClientViewController.m
View file @
5437c3e6
...
...
@@ -7,8 +7,8 @@
//
#import "ClientViewController.h"
@interface
ClientViewController
()
#import "InformationTableViewCell.h"
@interface
ClientViewController
()
<
UITableViewDelegate
,
UITableViewDataSource
>
@end
...
...
@@ -18,22 +18,39 @@
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
[
self
uiConfigAction
];
}
#pragma mark -布局
-
(
void
)
uiConfigAction
{
self
.
informationTableview
.
delegate
=
self
;
self
.
informationTableview
.
dataSource
=
self
;
self
.
informationTableview
.
tableFooterView
=
[
UIView
new
];
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
InformationTableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"information"
forIndexPath
:
indexPath
];
// UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
// button.frame = CGRectMake(100, 100, 100, 100);
// button.backgroundColor = [UIColor blackColor];
// [self.view addSubview:button];
// [button addTarget:self action:@selector(Click) forControlEvents:UIControlEventTouchUpInside];
return
cell
;
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
20
;
}
-
(
void
)
Click
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
RightViewController
*
right
=
[[
RightViewController
alloc
]
init
];
[
self
.
navigationController
pushViewController
:
right
animated
:
YES
];
return
100
;
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
...
...
Lighting/Class/CustomerdetailsController.h
0 → 100644
View file @
5437c3e6
//
// CustomerdetailsController.h
// Lighting
//
// Created by 曹云霄 on 16/4/29.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface
CustomerdetailsController
:
BaseViewController
@end
Lighting/Class/CustomerdetailsController.m
0 → 100644
View file @
5437c3e6
//
// CustomerdetailsController.m
// Lighting
//
// Created by 曹云霄 on 16/4/29.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "CustomerdetailsController.h"
@interface
CustomerdetailsController
()
@end
@implementation
CustomerdetailsController
-
(
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
Lighting/Class/InformationTableViewCell.h
0 → 100644
View file @
5437c3e6
//
// InformationTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 16/4/29.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface
InformationTableViewCell
:
UITableViewCell
@end
Lighting/Class/InformationTableViewCell.m
0 → 100644
View file @
5437c3e6
//
// InformationTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 16/4/29.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "InformationTableViewCell.h"
@implementation
InformationTableViewCell
-
(
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
Lighting/Class/Login/LoginViewController.m
View file @
5437c3e6
...
...
@@ -9,6 +9,8 @@
#import "LoginViewController.h"
#import "CustomTabbarController.h"
#import "AppDelegate.h"
#import "MMDrawerVisualState.h"
#import "MMExampleDrawerVisualStateManager.h"
@interface
LoginViewController
()
@property
(
weak
,
nonatomic
)
IBOutlet
UIButton
*
loginButton
;
...
...
@@ -27,16 +29,32 @@
#pragma mark -登陆
-
(
IBAction
)
LoginButtonClick
:
(
UIButton
*
)
sender
{
[
self
MMDrawerController
];
}
#pragma mark -MMDrawerController
-
(
void
)
MMDrawerController
{
CustomTabbarController
*
customtabbar
=
[[
CustomTabbarController
alloc
]
init
];
RightViewController
*
rightVC
=
[[
RightViewController
alloc
]
init
];
self
.
drawerController
=
[[
MMDrawerController
alloc
]
initWithCenterViewController
:
customtabbar
rightDrawerViewController
:
rightVC
];
[
self
.
drawerController
setMaximumRightDrawerWidth
:
RightWidth
];
[
self
.
drawerController
setOpenDrawerGestureModeMask
:
MMOpenDrawerGestureModeAll
];
[
self
.
drawerController
setCloseDrawerGestureModeMask
:
MMCloseDrawerGestureModeAll
];
[
self
.
drawerController
setDrawerVisualStateBlock
:
^
(
MMDrawerController
*
drawerController
,
MMDrawerSide
drawerSide
,
CGFloat
percentVisible
)
{
MMDrawerControllerDrawerVisualStateBlock
block
;
block
=
[[
MMExampleDrawerVisualStateManager
sharedManager
]
drawerVisualStateBlockForDrawerSide
:
drawerSide
];
if
(
block
){
block
(
drawerController
,
drawerSide
,
percentVisible
);
}
}];
[[
MMExampleDrawerVisualStateManager
sharedManager
]
setRightDrawerAnimationType
:
MMDrawerAnimationTypeSwingingDoor
];
SHARED_APPDELEGATE
.
mmdrawer
=
self
.
drawerController
;
SHARED_APPDELEGATE
.
window
.
rootViewController
=
self
.
drawerController
;
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
...
...
Lighting/Class/RightViewController.m
View file @
5437c3e6
...
...
@@ -8,20 +8,79 @@
#import "RightViewController.h"
@interface
RightViewController
()
@interface
RightViewController
()
<
UITableViewDataSource
,
UITableViewDelegate
>
@property
(
nonatomic
,
strong
)
UITableView
*
rightTableview
;
@property
(
nonatomic
,
strong
)
NSArray
*
dataArray
;
@end
@implementation
RightViewController
/**
* 初始化数据源
*
* @return NSArray
*/
-
(
NSArray
*
)
dataArray
{
if
(
_dataArray
==
nil
)
{
_dataArray
=
[
NSArray
arrayWithObjects
:
@"随心配"
,
@"体验中心"
,
@"产品库"
,
@"客户管理"
,
@"关于"
,
nil
];
}
return
_dataArray
;
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
self
.
view
.
backgroundColor
=
[
UIColor
blueColor
];
[
self
uiConfigAction
];
}
#pragma mark -布局
-
(
void
)
uiConfigAction
{
self
.
rightTableview
=
[[
UITableView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
RightWidth
,
ScreenHeight
)
style
:
UITableViewStylePlain
];
self
.
rightTableview
.
delegate
=
self
;
self
.
rightTableview
.
dataSource
=
self
;
[
self
.
view
addSubview
:
self
.
rightTableview
];
self
.
rightTableview
.
tableFooterView
=
[
UIView
new
];
[
self
.
rightTableview
registerClass
:[
UITableViewCell
class
]
forCellReuseIdentifier
:
@"rightcell"
];
[
self
createHeaderview
];
}
#pragma mark -头部视图
-
(
void
)
createHeaderview
{
UIView
*
headerView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
RightWidth
,
200
)];
UIImageView
*
imageView
=
[[
UIImageView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
80
,
80
)];
imageView
.
center
=
CGPointMake
(
RightWidth
/
2
,
100
);
imageView
.
image
=
TCImage
(
@"weibo"
);
[
headerView
addSubview
:
imageView
];
self
.
rightTableview
.
tableHeaderView
=
headerView
;
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
UITableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"rightcell"
forIndexPath
:
indexPath
];
cell
.
textLabel
.
text
=
[
self
.
dataArray
objectAtIndex_opple
:
indexPath
.
row
];
return
cell
;
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
self
.
dataArray
.
count
;
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
...
...
Lighting/Class/Shoppingcart/ShoppingTableViewCell.h
0 → 100644
View file @
5437c3e6
//
// ShoppingTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 16/4/29.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface
ShoppingTableViewCell
:
UITableViewCell
/**
* 选中
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UIButton
*
selectedButton
;
/**
* 商品图片
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UIImageView
*
goodsImageView
;
/**
* 商品信息
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
goodsInformationLabe
;
/**
* 吊牌价格
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
tagsPriceLabe
;
/**
* 成交价格
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UITextField
*
clinchTextfield
;
/**
* 商品数量
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
goodsNumbersLabe
;
/**
* 产品金额
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
productPriceLabe
;
@end
Lighting/Class/Shoppingcart/ShoppingTableViewCell.m
0 → 100644
View file @
5437c3e6
//
// ShoppingTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 16/4/29.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "ShoppingTableViewCell.h"
@implementation
ShoppingTableViewCell
-
(
void
)
awakeFromNib
{
[
super
awakeFromNib
];
// Initialization code
}
#pragma mark -增加或者减少商品
-
(
IBAction
)
reduceAndaddButtonClick
:
(
UIButton
*
)
sender
{
//sender.tag == 100 减少
//sender.tag == 101 增加
}
#pragma mark -商品选中
-
(
IBAction
)
selectedButtonClick
:
(
UIButton
*
)
sender
{
}
-
(
void
)
setSelected
:
(
BOOL
)
selected
animated
:
(
BOOL
)
animated
{
[
super
setSelected
:
selected
animated
:
animated
];
// Configure the view for the selected state
}
@end
Lighting/Class/Shoppingcart/ShoppingViewController.h
View file @
5437c3e6
...
...
@@ -10,4 +10,26 @@
@interface
ShoppingViewController
:
BaseViewController
/**
* 结算按钮
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UIButton
*
settlementButton
;
/**
* 合计金额
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
totalpriceLabe
;
/**
* 合计数量
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
totalNumbersLabe
;
/**
* 全选
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UIButton
*
allSelectedButton
;
@end
Lighting/Class/Shoppingcart/ShoppingViewController.m
View file @
5437c3e6
...
...
@@ -7,20 +7,96 @@
//
#import "ShoppingViewController.h"
#import "ShoppingTableViewCell.h"
#import "AppDelegate.h"
@interface
ShoppingViewController
()
<
UITableViewDelegate
,
UITableViewDataSource
>
@interface
ShoppingViewController
()
@property
(
weak
,
nonatomic
)
IBOutlet
UITableView
*
shoppingTableview
;
@property
(
nonatomic
,
strong
)
NSMutableArray
*
datasArray
;
@end
@implementation
ShoppingViewController
/**
* 数据源
*/
-
(
NSMutableArray
*
)
datasArray
{
if
(
_datasArray
==
nil
)
{
_datasArray
=
[
NSMutableArray
array
];
}
return
_datasArray
;
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
[
self
uiConfigAction
];
}
#pragma mark - UI
-
(
void
)
uiConfigAction
{
self
.
shoppingTableview
.
dataSource
=
self
;
self
.
shoppingTableview
.
delegate
=
self
;
self
.
shoppingTableview
.
tableFooterView
=
[
UIView
new
];
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
ShoppingTableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"Shopping"
forIndexPath
:
indexPath
];
return
cell
;
}
-
(
NSInteger
)
tableView
:
(
UITableView
*
)
tableView
numberOfRowsInSection
:
(
NSInteger
)
section
{
return
20
;
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
return
80
;
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didDeselectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
[
self
.
shoppingTableview
deselectRowAtIndexPath
:
indexPath
animated
:
YES
];
}
#pragma mark -结算
-
(
IBAction
)
settlementButtonClick
:
(
UIButton
*
)
sender
{
}
#pragma mark -全选
-
(
IBAction
)
allSelectedButtonClick
:
(
id
)
sender
{
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
...
...
Lighting/Class/Tabbar/CustomTabbarController.m
View file @
5437c3e6
...
...
@@ -9,33 +9,86 @@
#import "CustomTabbarController.h"
#import "Toolview.h"
#import "ClientViewController.h"
@interface
CustomTabbarController
()
@interface
CustomTabbarController
()
<
TabbarButtonClickdelegate
>
@property
(
nonatomic
,
strong
)
NSArray
*
identifierArray
;
@property
(
nonatomic
,
strong
)
NSArray
*
controllerArray
;
@end
@implementation
CustomTabbarController
/**
* UIStoryboard Identifier数组
*
* @return NSArary
*/
-
(
NSArray
*
)
identifierArray
{
if
(
_identifierArray
==
nil
)
{
_identifierArray
=
[
NSArray
arrayWithObjects
:
@"shopping"
,
@"Client"
,
nil
];
}
return
_identifierArray
;
}
-
(
NSArray
*
)
controllerArray
{
if
(
_controllerArray
==
nil
)
{
_controllerArray
=
[
NSArray
arrayWithObjects
:
@"ShoppingViewController"
,
@"ClientViewController"
,
nil
];
}
return
_controllerArray
;
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
[
self
uiConfigAction
];
[
self
addViewcontroller
];
}
#pragma mark -UI
-
(
void
)
uiConfigAction
{
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
-
(
void
)
addViewcontroller
{
UIStoryboard
*
storyboard
=
[
UIStoryboard
storyboardWithName
:
@"StoryboardwithCYX"
bundle
:
nil
];
ShoppingViewController
*
shoppingVC
=
[
storyboard
instantiateViewControllerWithIdentifier
:[
self
.
identifierArray
firstObject
]];
ClientViewController
*
clientVC
=
[
storyboard
instantiateViewControllerWithIdentifier
:[
self
.
identifierArray
objectAtIndex_opple
:
1
]];
NSArray
*
vcArray
=
[
NSArray
arrayWithObjects
:
clientVC
,
shoppingVC
,
nil
];
self
.
viewControllers
=
vcArray
;
}
ClientViewController
*
client
=
[
storyboard
instantiateViewControllerWithIdentifier
:
@"Client"
];
UINavigationController
*
nav
=
[[
UINavigationController
alloc
]
initWithRootViewController
:
client
];
NSArray
*
arr
=
@[
nav
];
self
.
viewControllers
=
arr
;
#pragma amrk -TabbarButtonClickdelegate代理
-
(
void
)
ButtonClickAction
:
(
NSInteger
)
Buttontag
{
if
(
Buttontag
==
101
)
{
self
.
selectedIndex
=
0
;
}
else
if
(
Buttontag
==
102
){
self
.
selectedIndex
=
1
;
}
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
...
...
Lighting/Class/Tabbar/Toolview.h
View file @
5437c3e6
...
...
@@ -8,6 +8,25 @@
#import <UIKit/UIKit.h>
@protocol
TabbarButtonClickdelegate
<
NSObject
>
@required
/**
* 点击按钮回调
*/
-
(
void
)
ButtonClickAction
:
(
NSInteger
)
Buttontag
;
@end
@interface
Toolview
:
UIView
@property
(
nonatomic
,
assign
)
id
<
TabbarButtonClickdelegate
>
delegate
;
/**
* 下划线
*/
@property
(
nonatomic
,
strong
)
UIView
*
underlineView
;
@end
Lighting/Class/Tabbar/Toolview.m
View file @
5437c3e6
...
...
@@ -37,19 +37,64 @@
#pragma mark -布局
-
(
void
)
uiConfigAction
{
for
(
int
i
=
1
;
i
<
5
;
i
++
)
{
//阴影
self
.
layer
.
shadowColor
=
[
UIColor
blackColor
].
CGColor
;
self
.
layer
.
shadowRadius
=
6
;
self
.
layer
.
shadowOpacity
=
0
.
8
;
//图标
UIImageView
*
iconImage
=
[[
UIImageView
alloc
]
initWithFrame
:
CGRectMake
(
50
,
10
,
100
,
45
)];
iconImage
.
image
=
TCImage
(
@"weibo"
);
[
self
addSubview
:
iconImage
];
//输入框
UITextField
*
inputField
=
[[
UITextField
alloc
]
initWithFrame
:
CGRectMake
(
200
,
(
NavigationHeight
-
35
)
/
2
,
300
,
35
)];
inputField
.
borderStyle
=
UITextBorderStyleNone
;
inputField
.
backgroundColor
=
[
UIColor
grayColor
];
inputField
.
placeholder
=
@"请输入关键字"
;
[
self
addSubview
:
inputField
];
//按钮
NSArray
*
titleArray
=
[
NSArray
arrayWithObjects
:
@"某某用户"
,
@"我的客户"
,
@"购物车"
,
nil
];
for
(
int
i
=
1
;
i
<
4
;
i
++
)
{
CustomButton
*
button
=
[
CustomButton
buttonWithType
:
UIButtonTypeCustom
];
button
.
frame
=
CGRectMake
(
ScreenWidth
-
(
i
*
ButtonWIDTH
+
Buttoninterval
*
(
i
-
1
)),
10
,
ButtonWIDTH
,
ButtonRIGHT
);
[
button
setTitleColor
:[
UIColor
redColor
]
forState
:
UIControlStateNormal
];
[
button
setTitle
:
@"购物车"
forState
:
UIControlStateNormal
];
[
button
setTitle
:[
titleArray
objectAtIndex_opple
:
i
-
1
]
forState
:
UIControlStateNormal
];
button
.
tag
=
100
+
i
-
1
;
[
button
addTarget
:
self
action
:
@selector
(
ButtonClick
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
button
.
instructionsNumber
=
i
;
[
button
setImage
:
TCImage
(
@"qq"
)
forState
:
UIControlStateNormal
];
[
self
addSubview
:
button
];
//创建下划线
if
(
i
==
2
)
{
self
.
underlineView
=
[[
UIView
alloc
]
initWithFrame
:
CGRectMake
(
button
.
frame
.
origin
.
x
+
(
ButtonWIDTH
-
50
)
/
2
,
ButtonRIGHT
+
9
,
50
,
1
)];
_underlineView
.
backgroundColor
=
[
UIColor
redColor
];
[
self
addSubview
:
self
.
underlineView
];
}
}
}
#pragma mark -按钮事件响应
-
(
void
)
ButtonClick
:
(
UIButton
*
)
button
{
//下划线动画
[
UIView
animateWithDuration
:
0
.
2
animations
:
^
{
self
.
underlineView
.
frame
=
CGRectMake
(
button
.
frame
.
origin
.
x
+
(
ButtonWIDTH
-
50
)
/
2
,
ButtonRIGHT
+
9
,
50
,
1
);
}];
//点击代理
if
([
self
.
delegate
respondsToSelector
:
@selector
(
ButtonClickAction
:)])
{
[
self
.
delegate
ButtonClickAction
:
button
.
tag
];
}
}
...
...
Lighting/Lighting.xcodeproj/project.pbxproj
View file @
5437c3e6
This diff is collapsed.
Click to expand it.
Lighting/Lighting/AppDelegate.h
View file @
5437c3e6
...
...
@@ -17,12 +17,19 @@
@property
(
readonly
,
strong
,
nonatomic
)
NSManagedObjectModel
*
managedObjectModel
;
@property
(
readonly
,
strong
,
nonatomic
)
NSPersistentStoreCoordinator
*
persistentStoreCoordinator
;
/**
* 网络状态
*/
@property
(
nonatomic
,
assign
)
BOOL
Networkstatus
;
/**
* 抽屉控制器对象
*/
@property
(
nonatomic
,
strong
)
MMDrawerController
*
mmdrawer
;
-
(
void
)
saveContext
;
-
(
NSURL
*
)
applicationDocumentsDirectory
;
...
...
Lighting/Lighting/StoryboardwithCYX.storyboard
View file @
5437c3e6
This diff is collapsed.
Click to expand it.
Lighting/Tools/CustomButton.h
View file @
5437c3e6
...
...
@@ -10,4 +10,15 @@
@interface
CustomButton
:
UIButton
@property
(
nonatomic
,
strong
)
UILabel
*
instructions
;
/**
* 数量指示
*/
@property
(
nonatomic
,
assign
)
NSInteger
instructionsNumber
;
@end
Lighting/Tools/CustomButton.m
View file @
5437c3e6
...
...
@@ -7,11 +7,13 @@
//
#import "CustomButton.h"
#import "instructionsLabe.h"
#define WIDTH self.frame.size.width
@implementation
CustomButton
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
...
...
@@ -21,6 +23,7 @@
*/
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
{
if
(
self
=
[
super
initWithFrame
:
frame
])
{
...
...
@@ -33,6 +36,26 @@
}
-
(
void
)
setInstructionsNumber
:(
NSInteger
)
instructionsNumber
{
_instructionsNumber
=
instructionsNumber
;
for
(
UIView
*
subview
in
self
.
subviews
)
{
if
([
subview
isKindOfClass
:[
instructionsLabe
class
]])
{
[
subview
removeFromSuperview
];
break
;
}
}
instructionsLabe
*
labe
=
[[
instructionsLabe
alloc
]
initWithFrame
:
CGRectMake
(
WIDTH
-
35
,
0
,
13
,
13
)];
labe
.
instructionsNumber
=
_instructionsNumber
;
[
self
addSubview
:
labe
];
}
-
(
CGRect
)
imageRectForContentRect
:(
CGRect
)
contentRect
{
return
CGRectMake
((
WIDTH
-
30
)
/
2
,
0
,
30
,
30
);
...
...
Lighting/Tools/MMExampleDrawerVisualStateManager.h
0 → 100755
View file @
5437c3e6
// Copyright (c) 2013 Mutual Mobile (http://mutualmobile.com/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import <Foundation/Foundation.h>
#import "MMDrawerVisualState.h"
typedef
NS_ENUM
(
NSInteger
,
MMDrawerAnimationType
){
MMDrawerAnimationTypeNone
,
MMDrawerAnimationTypeSlide
,
MMDrawerAnimationTypeSlideAndScale
,
MMDrawerAnimationTypeSwingingDoor
,
MMDrawerAnimationTypeParallax
,
};
@interface
MMExampleDrawerVisualStateManager
:
NSObject
@property
(
nonatomic
,
assign
)
MMDrawerAnimationType
leftDrawerAnimationType
;
@property
(
nonatomic
,
assign
)
MMDrawerAnimationType
rightDrawerAnimationType
;
+
(
MMExampleDrawerVisualStateManager
*
)
sharedManager
;
-
(
MMDrawerControllerDrawerVisualStateBlock
)
drawerVisualStateBlockForDrawerSide
:(
MMDrawerSide
)
drawerSide
;
@end
Lighting/Tools/MMExampleDrawerVisualStateManager.m
0 → 100755
View file @
5437c3e6
// Copyright (c) 2013 Mutual Mobile (http://mutualmobile.com/)
//
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
#import "MMExampleDrawerVisualStateManager.h"
#import <QuartzCore/QuartzCore.h>
@implementation
MMExampleDrawerVisualStateManager
+
(
MMExampleDrawerVisualStateManager
*
)
sharedManager
{
static
MMExampleDrawerVisualStateManager
*
_sharedManager
=
nil
;
static
dispatch_once_t
onceToken
;
dispatch_once
(
&
onceToken
,
^
{
_sharedManager
=
[[
MMExampleDrawerVisualStateManager
alloc
]
init
];
[
_sharedManager
setLeftDrawerAnimationType
:
MMDrawerAnimationTypeParallax
];
[
_sharedManager
setRightDrawerAnimationType
:
MMDrawerAnimationTypeParallax
];
});
return
_sharedManager
;
}
-
(
MMDrawerControllerDrawerVisualStateBlock
)
drawerVisualStateBlockForDrawerSide
:
(
MMDrawerSide
)
drawerSide
{
MMDrawerAnimationType
animationType
;
if
(
drawerSide
==
MMDrawerSideLeft
){
animationType
=
self
.
leftDrawerAnimationType
;
}
else
{
animationType
=
self
.
rightDrawerAnimationType
;
}
MMDrawerControllerDrawerVisualStateBlock
visualStateBlock
=
nil
;
switch
(
animationType
)
{
case
MMDrawerAnimationTypeSlide
:
visualStateBlock
=
[
MMDrawerVisualState
slideVisualStateBlock
];
break
;
case
MMDrawerAnimationTypeSlideAndScale
:
visualStateBlock
=
[
MMDrawerVisualState
slideAndScaleVisualStateBlock
];
break
;
case
MMDrawerAnimationTypeParallax
:
visualStateBlock
=
[
MMDrawerVisualState
parallaxVisualStateBlockWithParallaxFactor
:
2
.
0
];
break
;
case
MMDrawerAnimationTypeSwingingDoor
:
visualStateBlock
=
[
MMDrawerVisualState
swingingDoorVisualStateBlock
];
break
;
default
:
visualStateBlock
=
^
(
MMDrawerController
*
drawerController
,
MMDrawerSide
drawerSide
,
CGFloat
percentVisible
){
UIViewController
*
sideDrawerViewController
;
CATransform3D
transform
;
CGFloat
maxDrawerWidth
=
0
.
0
;
if
(
drawerSide
==
MMDrawerSideLeft
){
sideDrawerViewController
=
drawerController
.
leftDrawerViewController
;
maxDrawerWidth
=
drawerController
.
maximumLeftDrawerWidth
;
}
else
if
(
drawerSide
==
MMDrawerSideRight
){
sideDrawerViewController
=
drawerController
.
rightDrawerViewController
;
maxDrawerWidth
=
drawerController
.
maximumRightDrawerWidth
;
}
if
(
percentVisible
>
1
.
0
){
transform
=
CATransform3DMakeScale
(
percentVisible
,
1
.
f
,
1
.
f
);
if
(
drawerSide
==
MMDrawerSideLeft
){
transform
=
CATransform3DTranslate
(
transform
,
maxDrawerWidth
*
(
percentVisible
-
1
.
f
)
/
2
,
0
.
f
,
0
.
f
);
}
else
if
(
drawerSide
==
MMDrawerSideRight
){
transform
=
CATransform3DTranslate
(
transform
,
-
maxDrawerWidth
*
(
percentVisible
-
1
.
f
)
/
2
,
0
.
f
,
0
.
f
);
}
}
else
{
transform
=
CATransform3DIdentity
;
}
[
sideDrawerViewController
.
view
.
layer
setTransform
:
transform
];
};
break
;
}
return
visualStateBlock
;
}
@end
Lighting/Tools/PrefixHeader.pch
View file @
5437c3e6
...
...
@@ -15,6 +15,9 @@
#import "IQKeyboardManager.h"
#import "AFNetworking.h"
#import "NetworkRequestClassManager.h"
#import "NSArray+Objectwithindex.h"
#import "ShoppingViewController.h"
#import "ClientViewController.h"
// Include any system framework and library headers here that should be included in all compilation units.
// You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
...
...
Lighting/Tools/instructionsLabe.h
0 → 100644
View file @
5437c3e6
//
// instructionsLabe.h
// Lighting
//
// Created by 曹云霄 on 16/4/29.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface
instructionsLabe
:
UILabel
/**
* 显示指示器的数量
*/
@property
(
nonatomic
,
assign
)
NSInteger
instructionsNumber
;
@end
Lighting/Tools/instructionsLabe.m
0 → 100644
View file @
5437c3e6
//
// instructionsLabe.m
// Lighting
//
// Created by 曹云霄 on 16/4/29.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "instructionsLabe.h"
@implementation
instructionsLabe
/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
// Drawing code
}
*/
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
{
if
(
self
=
[
super
initWithFrame
:
frame
])
{
self
.
layer
.
masksToBounds
=
YES
;
self
.
layer
.
cornerRadius
=
self
.
frame
.
size
.
width
/
2
;
self
.
backgroundColor
=
[
UIColor
redColor
];
self
.
textColor
=
[
UIColor
whiteColor
];
self
.
font
=
[
UIFont
systemFontOfSize
:
8
];
self
.
textAlignment
=
NSTextAlignmentCenter
;
}
return
self
;
}
-
(
void
)
setInstructionsNumber
:(
NSInteger
)
instructionsNumber
{
_instructionsNumber
=
instructionsNumber
;
self
.
text
=
[
NSString
stringWithFormat
:
@"%ld"
,
_instructionsNumber
];
}
@end
Lighting/Tools/weibo.png
0 → 100755
View file @
5437c3e6
2.53 KB
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment