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
986fdbfb
Commit
986fdbfb
authored
May 16, 2016
by
勾芒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
caoyunxiao
parent
157084af
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
42 changed files
with
1465 additions
and
463 deletions
+1465
-463
AdditionalTableViewCell.h
Lighting/Class/AdditionalTableViewCell.h
+13
-0
AdditionalTableViewCell.m
Lighting/Class/AdditionalTableViewCell.m
+4
-4
AdditionalTableViewCell.xib
Lighting/Class/AdditionalTableViewCell.xib
+81
-0
AllpriceTableViewCell.h
Lighting/Class/AllpriceTableViewCell.h
+6
-0
AllpriceTableViewCell.m
Lighting/Class/AllpriceTableViewCell.m
+26
-0
AttachmentInformationTableViewCell.h
Lighting/Class/AttachmentInformationTableViewCell.h
+0
-34
ClientViewController.m
Lighting/Class/ClientViewController.m
+30
-8
CommodityListTableViewCell.h
Lighting/Class/CommodityListTableViewCell.h
+4
-0
CommodityListTableViewCell.m
Lighting/Class/CommodityListTableViewCell.m
+17
-0
GoodsInformationTableViewCell.h
Lighting/Class/GoodsInformationTableViewCell.h
+4
-1
GoodsInformationTableViewCell.m
Lighting/Class/GoodsInformationTableViewCell.m
+17
-0
HotCollectionViewCell.h
Lighting/Class/HotCollectionViewCell.h
+26
-0
HotCollectionViewCell.m
Lighting/Class/HotCollectionViewCell.m
+43
-0
LoginViewController.m
Lighting/Class/Login/LoginViewController.m
+2
-3
OrderInformationTableViewCell.h
Lighting/Class/OrderInformationTableViewCell.h
+4
-1
OrderInformationTableViewCell.m
Lighting/Class/OrderInformationTableViewCell.m
+26
-0
OrderdetailsViewController.h
Lighting/Class/OrderdetailsViewController.h
+16
-1
OrderdetailsViewController.m
Lighting/Class/OrderdetailsViewController.m
+66
-22
PersonInformationTableViewCell.h
Lighting/Class/PersonInformationTableViewCell.h
+4
-0
PersonInformationTableViewCell.m
Lighting/Class/PersonInformationTableViewCell.m
+14
-0
ProductLibraryViewController.m
Lighting/Class/ProductLibraryViewController.m
+45
-106
SearchCollectionViewCell.h
Lighting/Class/SearchCollectionViewCell.h
+24
-0
SearchCollectionViewCell.m
Lighting/Class/SearchCollectionViewCell.m
+13
-0
SearchViewController.h
Lighting/Class/SearchViewController.h
+43
-0
SearchViewController.m
Lighting/Class/SearchViewController.m
+177
-0
SettlementViewController.h
Lighting/Class/SettlementViewController.h
+94
-1
SettlementViewController.m
Lighting/Class/SettlementViewController.m
+131
-2
SettlementViewController.xib
Lighting/Class/SettlementViewController.xib
+56
-20
GenerateOrdersViewController.m
Lighting/Class/Shoppingcart/GenerateOrdersViewController.m
+22
-14
ShoppingTableViewCell.m
Lighting/Class/Shoppingcart/ShoppingTableViewCell.m
+1
-1
ShoppingViewController.m
Lighting/Class/Shoppingcart/ShoppingViewController.m
+44
-21
CustomTabbarController.m
Lighting/Class/Tabbar/CustomTabbarController.m
+44
-25
Toolview.h
Lighting/Class/Tabbar/Toolview.h
+7
-1
Toolview.m
Lighting/Class/Tabbar/Toolview.m
+12
-6
project.pbxproj
Lighting/Lighting.xcodeproj/project.pbxproj
+54
-8
Contents.json
Lighting/Lighting/Images.xcassets/now.imageset/Contents.json
+0
-0
当前.png
Lighting/Lighting/Images.xcassets/now.imageset/当前.png
+0
-0
当前@2x.png
Lighting/Lighting/Images.xcassets/now.imageset/当前@2x.png
+0
-0
StoryboardwithCYX.storyboard
Lighting/Lighting/StoryboardwithCYX.storyboard
+204
-180
BaseViewController.m
Lighting/Tools/BaseViewController.m
+69
-1
PopoverViewController.h
Lighting/Tools/PopoverViewController.h
+7
-0
PopoverViewController.m
Lighting/Tools/PopoverViewController.m
+15
-3
No files found.
Lighting/Class/AdditionalTableViewCell.h
0 → 100644
View file @
986fdbfb
//
// AdditionalTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 16/5/16.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface
AdditionalTableViewCell
:
UITableViewCell
@end
Lighting/Class/A
ttachmentInformation
TableViewCell.m
→
Lighting/Class/A
dditional
TableViewCell.m
View file @
986fdbfb
//
// A
ttachmentInformation
TableViewCell.m
// A
dditional
TableViewCell.m
// Lighting
//
// Created by 曹云霄 on 16/5/
4
.
// Created by 曹云霄 on 16/5/
16
.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "A
ttachmentInformation
TableViewCell.h"
#import "A
dditional
TableViewCell.h"
@implementation
A
ttachmentInformation
TableViewCell
@implementation
A
dditional
TableViewCell
-
(
void
)
awakeFromNib
{
[
super
awakeFromNib
];
...
...
Lighting/Class/AdditionalTableViewCell.xib
0 → 100644
View file @
986fdbfb
<?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"
/>
<tableViewCell
contentMode=
"scaleToFill"
selectionStyle=
"default"
indentationWidth=
"10"
rowHeight=
"259"
id=
"KGk-i7-Jjw"
customClass=
"AdditionalTableViewCell"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"768"
height=
"75"
/>
<autoresizingMask
key=
"autoresizingMask"
flexibleMaxX=
"YES"
flexibleMaxY=
"YES"
/>
<tableViewCellContentView
key=
"contentView"
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
tableViewCell=
"KGk-i7-Jjw"
id=
"H2p-sc-9uM"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"768"
height=
"74.5"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<subviews>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"是否开票:"
textAlignment=
"right"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
id=
"444-pT-XHf"
>
<rect
key=
"frame"
x=
"21"
y=
"13"
width=
"70"
height=
"17"
/>
<autoresizingMask
key=
"autoresizingMask"
flexibleMaxX=
"YES"
flexibleMaxY=
"YES"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"14"
/>
<color
key=
"textColor"
red=
"0.0"
green=
"0.0"
blue=
"0.0"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<nil
key=
"highlightedColor"
/>
</label>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"曹云霄"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
id=
"Gdg-fx-ziI"
>
<rect
key=
"frame"
x=
"95"
y=
"13"
width=
"150"
height=
"17"
/>
<autoresizingMask
key=
"autoresizingMask"
widthSizable=
"YES"
flexibleMaxX=
"YES"
flexibleMaxY=
"YES"
/>
<color
key=
"backgroundColor"
red=
"1"
green=
"0.7124683436"
blue=
"0.054982668810000003"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"14"
/>
<color
key=
"textColor"
white=
"0.66666666666666663"
alpha=
"1"
colorSpace=
"calibratedWhite"
/>
<nil
key=
"highlightedColor"
/>
</label>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"发票抬头:"
textAlignment=
"right"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
id=
"MoA-e8-03W"
>
<rect
key=
"frame"
x=
"21"
y=
"45"
width=
"70"
height=
"17"
/>
<autoresizingMask
key=
"autoresizingMask"
flexibleMaxX=
"YES"
flexibleMaxY=
"YES"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"14"
/>
<color
key=
"textColor"
red=
"0.0"
green=
"0.0"
blue=
"0.0"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<nil
key=
"highlightedColor"
/>
</label>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"曹云霄"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
id=
"IhE-VI-oy0"
>
<rect
key=
"frame"
x=
"95"
y=
"45"
width=
"220"
height=
"17"
/>
<autoresizingMask
key=
"autoresizingMask"
widthSizable=
"YES"
flexibleMaxX=
"YES"
flexibleMaxY=
"YES"
/>
<color
key=
"backgroundColor"
red=
"1"
green=
"0.7124683436"
blue=
"0.054982668810000003"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"14"
/>
<color
key=
"textColor"
white=
"0.66666666666666663"
alpha=
"1"
colorSpace=
"calibratedWhite"
/>
<nil
key=
"highlightedColor"
/>
</label>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"发票类型:"
textAlignment=
"right"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
id=
"Zdn-MM-Xad"
>
<rect
key=
"frame"
x=
"370"
y=
"13"
width=
"70"
height=
"17"
/>
<autoresizingMask
key=
"autoresizingMask"
flexibleMinX=
"YES"
flexibleMaxX=
"YES"
flexibleMaxY=
"YES"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"14"
/>
<color
key=
"textColor"
red=
"0.0"
green=
"0.0"
blue=
"0.0"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<nil
key=
"highlightedColor"
/>
</label>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"曹云霄"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
id=
"7ty-c7-Sgn"
>
<rect
key=
"frame"
x=
"432"
y=
"13"
width=
"170"
height=
"17"
/>
<autoresizingMask
key=
"autoresizingMask"
flexibleMinX=
"YES"
flexibleMaxX=
"YES"
flexibleMaxY=
"YES"
/>
<color
key=
"backgroundColor"
red=
"1"
green=
"0.7124683436"
blue=
"0.054982668810000003"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"14"
/>
<color
key=
"textColor"
white=
"0.66666666666666663"
alpha=
"1"
colorSpace=
"calibratedWhite"
/>
<nil
key=
"highlightedColor"
/>
</label>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"支付方式:"
textAlignment=
"right"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
id=
"S5V-nq-hin"
>
<rect
key=
"frame"
x=
"370"
y=
"43"
width=
"70"
height=
"17"
/>
<autoresizingMask
key=
"autoresizingMask"
flexibleMinX=
"YES"
flexibleMaxX=
"YES"
flexibleMaxY=
"YES"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"14"
/>
<color
key=
"textColor"
red=
"0.0"
green=
"0.0"
blue=
"0.0"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<nil
key=
"highlightedColor"
/>
</label>
<label
opaque=
"NO"
userInteractionEnabled=
"NO"
contentMode=
"left"
horizontalHuggingPriority=
"251"
verticalHuggingPriority=
"251"
text=
"曹云霄"
lineBreakMode=
"tailTruncation"
baselineAdjustment=
"alignBaselines"
adjustsFontSizeToFit=
"NO"
id=
"MPi-P0-LEg"
>
<rect
key=
"frame"
x=
"432"
y=
"43"
width=
"170"
height=
"17"
/>
<autoresizingMask
key=
"autoresizingMask"
flexibleMinX=
"YES"
flexibleMaxX=
"YES"
flexibleMaxY=
"YES"
/>
<color
key=
"backgroundColor"
red=
"1"
green=
"0.7124683436"
blue=
"0.054982668810000003"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"14"
/>
<color
key=
"textColor"
white=
"0.66666666666666663"
alpha=
"1"
colorSpace=
"calibratedWhite"
/>
<nil
key=
"highlightedColor"
/>
</label>
</subviews>
</tableViewCellContentView>
<point
key=
"canvasLocation"
x=
"420"
y=
"242.5"
/>
</tableViewCell>
</objects>
</document>
Lighting/Class/AllpriceTableViewCell.h
View file @
986fdbfb
...
...
@@ -28,4 +28,10 @@
*/
@property
(
nonatomic
,
strong
)
NSArray
*
goodsAllprice
;
/**
* 商品数据源
*/
@property
(
nonatomic
,
strong
)
NSArray
*
goodsArray
;
@end
Lighting/Class/AllpriceTableViewCell.m
View file @
986fdbfb
...
...
@@ -34,6 +34,32 @@
}
#pragma mark -数据源赋值
-
(
void
)
setGoodsArray
:
(
NSArray
*
)
goodsArray
{
_goodsArray
=
goodsArray
;
NSInteger
allNumber
=
0
;
//总数量
NSInteger
allPrice
=
0
;
//总价格
for
(
TOOrderdetailEntity
*
model
in
_goodsArray
)
{
allNumber
+=
[
model
.
goodsPrice
integerValue
];
allPrice
+=
[
model
.
goodsNum
integerValue
];
}
self
.
goodsAllNumber
.
text
=
[
NSString
stringWithFormat
:
@"%ld"
,
allNumber
];
self
.
goodsAllPrice
.
text
=
[
NSString
stringWithFormat
:
@"¥%ld"
,
allPrice
];
}
-
(
void
)
setSelected
:
(
BOOL
)
selected
animated
:
(
BOOL
)
animated
{
[
super
setSelected
:
selected
animated
:
animated
];
...
...
Lighting/Class/AttachmentInformationTableViewCell.h
deleted
100644 → 0
View file @
157084af
//
// 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
Lighting/Class/ClientViewController.m
View file @
986fdbfb
...
...
@@ -219,7 +219,7 @@
#pragma mark -添加客户信息
#pragma mark -添加客户信息
、或者退出当前客户
-
(
IBAction
)
addCustomerInformationORExit
:
(
UIButton
*
)
sender
{
if
([
sender
.
currentTitle
isEqualToString
:
@"退出当前客户"
])
{
...
...
@@ -235,6 +235,7 @@
self
.
changePersonInformationButton
.
hidden
=
YES
;
[
Shoppersmanager
manager
].
currentCustomer
=
NO
;
[
Customermanager
manager
].
customerID
=
nil
;
[
self
.
changePersonInformationButton
setTitle
:
@"更改客户信息"
forState
:
UIControlStateNormal
];
//全部为为选中状态
for
(
InformationTableViewCell
*
cell
in
self
.
informationTableview
.
visibleCells
)
{
...
...
@@ -248,12 +249,12 @@
[
sender
setTitle
:
@"添加客户信息"
forState
:
UIControlStateNormal
];
return
;
}
[
self
addCustomerInformation
];
[
self
addCustomerInformation
:
NO
];
}
#pragma mark -添加客户信息请求
-
(
void
)
addCustomerInformation
#pragma mark -添加客户信息请求
-新增、或者修改
-
(
void
)
addCustomerInformation
:
(
BOOL
)
isChange
{
[
self
.
view
endEditing
:
YES
];
if
(
self
.
customerNameField
.
text
.
length
==
0
)
{
...
...
@@ -280,6 +281,10 @@
customerEntity
.
mobile
=
self
.
phoneNumberField
.
text
;
customerEntity
.
address
=
self
.
customerAddress
.
text
;
customerEntity
.
name
=
self
.
companyNameField
.
text
;
//修改
if
(
isChange
)
{
customerEntity
.
fid
=
[
Customermanager
manager
].
customerID
;
}
[
self
CreateMBProgressHUDLoding
];
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@"
,
ServerAddress
,
@"/consumer/save"
]
WithRequestType
:
0
WithParameter
:
customerEntity
WithReturnValueBlock
:^
(
id
returnValue
)
{
...
...
@@ -287,15 +292,21 @@
[
self
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
//新增保存ID
if
(
!
isChange
)
{
[
Customermanager
manager
].
customerID
=
returnValue
[
@"data"
];
[
self
SuccessMBProgressView
:
@"新增成功"
];
}
else
{
[
self
SuccessMBProgressView
:
@"修改成功"
];
[
self
.
changePersonInformationButton
setTitle
:
@"更改客户信息"
forState
:
UIControlStateNormal
];
}
//保存客户信息
[
Customermanager
manager
].
customerID
=
returnValue
[
@"data"
];
[
Customermanager
manager
].
customerName
=
customerEntity
.
name
;
[
Customermanager
manager
].
customerPhoneNumber
=
customerEntity
.
mobile
;
[
Customermanager
manager
].
companyAddress
=
customerEntity
.
address
;
[
Customermanager
manager
].
cutomerAddress
=
customerEntity
.
address
;
[
Shoppersmanager
manager
].
currentCustomer
=
YES
;
[
self
SuccessMBProgressView
:
returnValue
[
@"新增成功"
]];
[
self
.
addpersonInformationButton
setTitle
:
@"退出当前客户"
forState
:
UIControlStateNormal
];
self
.
changePersonInformationButton
.
hidden
=
NO
;
self
.
customerNameField
.
enabled
=
NO
;
...
...
@@ -324,11 +335,22 @@
-
(
IBAction
)
changeCustomerInformation
:
(
UIButton
*
)
sender
{
if
([
sender
.
currentTitle
isEqualToString
:
@"保存"
])
{
[
self
.
customerNameField
resignFirstResponder
];
[
sender
setTitle
:
@"更改客户信息"
forState
:
UIControlStateNormal
];
[
self
addCustomerInformation
:
YES
];
}
else
{
dispatch_async
(
dispatch_get_main_queue
(),
^
{
[
self
.
customerNameField
becomeFirstResponder
];
});
[
sender
setTitle
:
@"保存"
forState
:
UIControlStateNormal
];
}
self
.
customerNameField
.
enabled
=
YES
;
self
.
customerAddress
.
enabled
=
YES
;
self
.
phoneNumberField
.
enabled
=
YES
;
self
.
companyNameField
.
enabled
=
YES
;
[
self
.
customerNameField
becomeFirstResponder
];
}
...
...
Lighting/Class/CommodityListTableViewCell.h
View file @
986fdbfb
...
...
@@ -43,6 +43,10 @@
@property
(
nonatomic
,
strong
)
ShopcarModel
*
model
;
/**
* 订单详情商品数据源
*/
@property
(
nonatomic
,
strong
)
TOOrderdetailEntity
*
orderDetailslist
;
@end
Lighting/Class/CommodityListTableViewCell.m
View file @
986fdbfb
...
...
@@ -32,6 +32,23 @@
#pragma mark -订单详情页赋值
-
(
void
)
setOrderDetailslist
:
(
TOOrderdetailEntity
*
)
orderDetailslist
{
_orderDetailslist
=
orderDetailslist
;
[
self
.
goodsHeader
sd_setImageWithURL
:[
NSURL
URLWithString
:
_orderDetailslist
.
goodsBrand
]
placeholderImage
:
ReplaceImage
];
self
.
goodsNumber
.
text
=
_orderDetailslist
.
goodsNum
;
self
.
clinchPrice
.
text
=
[
_orderDetailslist
.
goodsPrice
stringValue
];
self
.
totalPrice
.
text
=
[
_orderDetailslist
.
goodsTotalPrice
stringValue
];
self
.
goodsName
.
text
=
_orderDetailslist
.
goodsSpec
;
}
-
(
void
)
setSelected
:
(
BOOL
)
selected
animated
:
(
BOOL
)
animated
{
[
super
setSelected
:
selected
animated
:
animated
];
...
...
Lighting/Class/GoodsInformationTableViewCell.h
View file @
986fdbfb
...
...
@@ -39,7 +39,10 @@
/**
* 收货信息
*/
@property
(
nonatomic
,
strong
)
TOOrderEntity
*
model
;
...
...
Lighting/Class/GoodsInformationTableViewCell.m
View file @
986fdbfb
...
...
@@ -15,6 +15,23 @@
// Initialization code
}
#pragma mark -赋值
-
(
void
)
setModel
:
(
TOOrderEntity
*
)
model
{
_model
=
model
;
self
.
consigneeName
.
text
=
_model
.
receiverName
;
self
.
consigneePhoneNumber
.
text
=
_model
.
receiverMobile
;
self
.
detailsAddress
.
text
=
_model
.
receiverAddress
;
}
-
(
void
)
setSelected
:
(
BOOL
)
selected
animated
:
(
BOOL
)
animated
{
[
super
setSelected
:
selected
animated
:
animated
];
...
...
Lighting/Class/HotCollectionViewCell.h
0 → 100644
View file @
986fdbfb
//
// HotCollectionViewCell.h
// Lighting
//
// Created by 曹云霄 on 16/5/16.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface
HotCollectionViewCell
:
UICollectionViewCell
/**
* 数据源
*/
@property
(
nonatomic
,
strong
)
TOHottagEntity
*
responseDatas
;
/**
* title
*/
@property
(
nonatomic
,
strong
)
UILabel
*
titleLabe
;
@end
Lighting/Class/HotCollectionViewCell.m
0 → 100644
View file @
986fdbfb
//
// HotCollectionViewCell.m
// Lighting
//
// Created by 曹云霄 on 16/5/16.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "HotCollectionViewCell.h"
@implementation
HotCollectionViewCell
-
(
instancetype
)
initWithFrame
:(
CGRect
)
frame
{
if
(
self
=
[
super
initWithFrame
:
frame
])
{
[
self
uiConfigAction
];
}
return
self
;
}
#pragma mark -UI
-
(
void
)
uiConfigAction
{
self
.
titleLabe
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
self
.
frame
.
size
.
width
,
self
.
frame
.
size
.
height
)];
self
.
titleLabe
.
textAlignment
=
NSTextAlignmentCenter
;
self
.
titleLabe
.
font
=
[
UIFont
systemFontOfSize
:
14
];
[
self
.
contentView
addSubview
:
self
.
titleLabe
];
}
#pragma mark -赋值
-
(
void
)
setResponseDatas
:
(
TOHottagEntity
*
)
responseDatas
{
_responseDatas
=
responseDatas
;
self
.
titleLabe
.
text
=
_responseDatas
.
name
;
}
@end
Lighting/Class/Login/LoginViewController.m
View file @
986fdbfb
...
...
@@ -79,7 +79,8 @@
#pragma mark -登陆
-
(
IBAction
)
LoginButtonClick
:
(
UIButton
*
)
sender
{
// [self SetTheRootViewController];
// return;
if
(
self
.
userName
.
text
.
length
==
0
)
{
...
...
@@ -130,8 +131,6 @@
[
Shoppersmanager
manager
].
passWordString
=
self
.
passWord
.
text
;
[
self
SetTheRootViewController
];
NSLog
(
@"成功"
);
}
else
{
[
self
ErrorMBProgressView
:
returnValue
[
@"message"
]];
...
...
Lighting/Class/OrderInformationTableViewCell.h
View file @
986fdbfb
...
...
@@ -30,6 +30,9 @@
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
operatorName
;
/**
* 订单数据
*/
@property
(
nonatomic
,
strong
)
OrderBill
*
model
;
@end
Lighting/Class/OrderInformationTableViewCell.m
View file @
986fdbfb
...
...
@@ -15,6 +15,32 @@
// Initialization code
}
#pragma mark -订单赋值
-
(
void
)
setModel
:
(
OrderBill
*
)
model
{
_model
=
model
;
self
.
orderNumber
.
text
=
_model
.
order
.
orderNumber
;
self
.
orderTime
.
text
=
[
self
dateAsString
:
_model
.
order
.
orderTime
];
self
.
orderStatus
.
text
=
_model
.
order
.
orderState
;
self
.
operatorName
.
text
=
_model
.
employee
.
userName
;
}
#pragma mark -时间转换NSDate转NSString
-
(
NSString
*
)
dateAsString
:
(
NSDate
*
)
date
{
NSDateFormatter
*
formatter
=
[[
NSDateFormatter
alloc
]
init
];
[
formatter
setDateFormat
:
@"yyyy-MM-dd"
];
NSString
*
timeString
=
[
formatter
stringFromDate
:
date
];
return
timeString
;
}
-
(
void
)
setSelected
:
(
BOOL
)
selected
animated
:
(
BOOL
)
animated
{
[
super
setSelected
:
selected
animated
:
animated
];
...
...
Lighting/Class/OrderdetailsViewController.h
View file @
986fdbfb
...
...
@@ -18,7 +18,22 @@
/**
* 订单
详情
* 订单
ID
*/
@property
(
nonatomic
,
copy
)
NSString
*
orderCode
;
/**
* 是否显示附件信息
*/
@property
(
nonatomic
,
assign
)
BOOL
isShowattachment
;
/**
* 区头显示title
*/
@property
(
nonatomic
,
strong
)
NSArray
*
sectionTitle
;
@end
Lighting/Class/OrderdetailsViewController.m
View file @
986fdbfb
...
...
@@ -12,15 +12,27 @@
#import "GoodsInformationTableViewCell.h"
#import "CommodityListTableViewCell.h"
#import "AllpriceTableViewCell.h"
#import "AttachmentInformationTableViewCell.h"
#import "SettlementViewController.h"
#import "AdditionalTableViewCell.h"
@interface
OrderdetailsViewController
()
<
UITableViewDelegate
,
UITableViewDataSource
>
/**
* 订单详情数据
*/
@property
(
nonatomic
,
strong
)
OrderBill
*
orderDetails
;
@end
@implementation
OrderdetailsViewController
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
...
...
@@ -35,21 +47,22 @@
{
self
.
orderDetailsTableview
.
dataSource
=
self
;
self
.
orderDetailsTableview
.
delegate
=
self
;
// self.orderDetailsTableview.tableFooterView = [UIView new];
[
self
CreateTableviewHeaderView
];
[
self
CreateTableviewFooterView
];
}
#pragma mark -获取订单详情
-
(
void
)
getOrderDetailsData
{
[
self
CreateMBProgressHUDLoding
];
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@%@"
,
ServerAddress
,
@"/order/findOrder/"
,
_orderCode
]
WithRequestType
:
1
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
NSLog
(
@"%@"
,
returnValue
)
;
[
self
RemoveMBProgressHUDLoding
]
;
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
OrderBill
*
orderDetails
=
[[
OrderBill
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
NSLog
(
@"%@"
,
orderDetails
)
;
self
.
orderDetails
=
[[
OrderBill
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
[
self
.
orderDetailsTableview
reloadData
]
;
}
else
{
...
...
@@ -61,6 +74,7 @@
}
WithFailureBlock
:^
(
id
error
)
{
[
self
RemoveMBProgressHUDLoding
];
}];
}
...
...
@@ -102,6 +116,11 @@
lineView
.
backgroundColor
=
kTCColor
(
193
,
193
,
193
);
[
headerView
addSubview
:
lineView
];
//附加信息cell
[
self
.
orderDetailsTableview
registerNib
:[
UINib
nibWithNibName
:
@"AdditionalTableViewCell"
bundle
:
nil
]
forCellReuseIdentifier
:
@"fifthcell"
];
self
.
orderDetailsTableview
.
tableHeaderView
=
headerView
;
}
...
...
@@ -130,8 +149,10 @@
#pragma mark -调出支付框
-
(
void
)
PayButtonClick
{
SettlementViewController
*
settlement
=
[[
SettlementViewController
alloc
]
init
];
settlement
.
preferredContentSize
=
CGSizeMake
(
380
,
500
);
settlement
.
goodsArray
=
self
.
orderDetails
.
orderdetailList
;
settlement
.
modalPresentationStyle
=
UIModalPresentationFormSheet
;
UIPopoverPresentationController
*
pop
=
settlement
.
popoverPresentationController
;
pop
.
sourceView
=
settlement
.
view
;
...
...
@@ -161,7 +182,7 @@
break
;
case
3
:
{
return
3
;
return
self
.
orderDetails
.
orderdetailList
.
count
+
1
;
}
break
;
case
4
:
...
...
@@ -183,44 +204,52 @@
case
0
:
//订单信息
{
OrderInformationTableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"firstcell"
forIndexPath
:
indexPath
];
cell
.
model
=
self
.
orderDetails
;
return
cell
;
}
break
;
case
1
:
//客户信息
{
PersonInformationTableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"secondcell"
forIndexPath
:
indexPath
];
cell
.
model
=
self
.
orderDetails
.
consumer
;
return
cell
;
}
break
;
case
2
:
//收货信息
{
GoodsInformationTableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"thirdcell"
forIndexPath
:
indexPath
];
cell
.
model
=
self
.
orderDetails
.
order
;
return
cell
;
}
break
;
case
3
:
//商品清单
{
if
(
indexPath
.
row
==
2
)
{
if
(
indexPath
.
row
==
self
.
orderDetails
.
orderdetailList
.
count
)
{
//商品总计
AllpriceTableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"sixthcell"
forIndexPath
:
indexPath
];
cell
.
goodsArray
=
self
.
orderDetails
.
orderdetailList
;
return
cell
;
}
else
{
//单个商品
CommodityListTableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"fourthcell"
forIndexPath
:
indexPath
];
cell
.
orderDetailslist
=
[
self
.
orderDetails
.
orderdetailList
objectAtIndex_opple
:
indexPath
.
row
];
return
cell
;
}
}
break
;
case
4
:
//附件信息
{
AttachmentInformationTableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"fifthcell"
forIndexPath
:
indexPath
];
return
cell
;
//是否显示
if
(
_isShowattachment
)
{
AdditionalTableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"fifthcell"
forIndexPath
:
indexPath
];
return
cell
;
}
}
break
;
default
:
break
;
}
...
...
@@ -237,18 +266,18 @@
break
;
case
1
:
{
return
1
60
;
return
1
35
;
}
break
;
case
2
:
{
return
11
0
;
return
9
0
;
}
break
;
case
3
:
{
//商品总计
if
(
indexPath
.
row
==
2
)
{
if
(
indexPath
.
row
==
self
.
orderDetails
.
orderdetailList
.
count
)
{
return
50
;
}
...
...
@@ -261,6 +290,11 @@
break
;
case
4
:
{
//是否显示附件信息
if
(
!
_isShowattachment
)
{
return
0
;
}
return
75
;
}
break
;
...
...
@@ -276,12 +310,9 @@
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
=
@" 订单详情"
;
UILabel
*
Titlelabe
=
[[
UILabel
alloc
]
initWithFrame
:
CGRectMake
(
30
,
0
,
100
,
44
)];
Titlelabe
.
text
=
[
self
.
sectionTitle
objectAtIndex_opple
:
section
];
Titlelabe
.
font
=
[
UIFont
systemFontOfSize
:
13
];
[
view
addSubview
:
Titlelabe
];
return
view
;
...
...
@@ -298,7 +329,7 @@
-
(
NSInteger
)
numberOfSectionsInTableView
:
(
UITableView
*
)
tableView
{
return
5
;
return
self
.
sectionTitle
.
count
;
}
...
...
@@ -309,7 +340,19 @@
#pragma mark -打印订单
-
(
void
)
AirprintButtonClick
:
(
UIButton
*
)
button
{
[
self
callAirprintWithdata
:
nil
];
// [self callAirprintWithdata:nil];
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@%@"
,
ServerAddress
,
@"/order/UrlOfprintPDF/"
,
_orderCode
]
WithRequestType
:
0
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
NSLog
(
@"%@"
,
returnValue
);
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithFailureBlock
:^
(
id
error
)
{
NSLog
(
@"%@"
,
error
);
}];
}
...
...
@@ -329,15 +372,16 @@
/*
#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
];
...
...
Lighting/Class/PersonInformationTableViewCell.h
View file @
986fdbfb
...
...
@@ -52,6 +52,10 @@
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
customerQQNumber
;
/**
* 订单数据
*/
@property
(
nonatomic
,
strong
)
TOConsumerEntity
*
model
;
...
...
Lighting/Class/PersonInformationTableViewCell.m
View file @
986fdbfb
...
...
@@ -15,6 +15,20 @@
// Initialization code
}
#pragma mark -赋值
-
(
void
)
setModel
:
(
TOConsumerEntity
*
)
model
{
_model
=
model
;
self
.
customerName
.
text
=
_model
.
name
;
[
self
.
customerHeader
sd_setImageWithURL
:[
NSURL
URLWithString
:
_model
.
picture
]
placeholderImage
:
ReplaceImage
];
self
.
customerNumbers
.
text
=
_model
.
mobile
;
}
-
(
void
)
setSelected
:
(
BOOL
)
selected
animated
:
(
BOOL
)
animated
{
[
super
setSelected
:
selected
animated
:
animated
];
...
...
Lighting/Class/ProductLibraryViewController.m
View file @
986fdbfb
...
...
@@ -69,13 +69,13 @@
}
//
- (void)viewWillAppear:(BOOL)animated
//
{
// if (self.productCollectionView
!= nil) {
//
//
[self getGoodsListDatas];
//
}
//
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
if
(
_screeningDatas
!=
nil
)
{
[
self
getGoodsListDatas
];
}
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
...
...
@@ -116,7 +116,6 @@
-
(
void
)
getScreeningdatas
{
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@"
,
ServerAddress
,
@"/goods/getGoodsFilter"
]
WithRequestType
:
1
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
...
...
@@ -127,9 +126,7 @@
[
self
.
screeningDatas
addObject
:
goodsStyle
.
space
];
[
self
.
screeningDatas
addObject
:
goodsStyle
.
material
];
[
self
.
screeningDatas
addObject
:
goodsStyle
.
price
];
// NSLog(@"%@",self.screeningDatas);
}
}
else
{
[
self
ErrorMBProgressView
:
returnValue
[
@"message"
]];
...
...
@@ -144,101 +141,6 @@
}];
}
/*
{
code = 0;
data = {
categories = (
{
children = (
{
children = (
);
id = 0b44439e54997ce201549986e02c0003;
name = "\U5927\U706f";
},
{
children = (
);
id = 0b44439e54997ce201549987c8550004;
name = "\U5eca\U706f";
}
);
id = 0b44439e54997ce20154998630210002;
name = "\U73b0\U4ee3\U706f";
},
{
children = (
{
children = (
);
id = 0b44439e54997ce20154998a59450006;
name = "\U53a8\U623f\U706f";
}
);
id = 0b44439e54997ce201549989c8b10005;
name = "\U7167\U660e\U706f";
}
);
material = (
{
typecode = 001;
typename = "\U91d1";
},
{
typecode = 002;
typename = "\U94f6";
},
{
typecode = 003;
typename = "\U6728\U8d28";
}
);
price = (
{
typecode = 001;
typename = "500\U4ee5\U4e0b";
},
{
typecode = 002;
typename = "500\U52301000";
},
{
typecode = 003;
typename = "1000\U52302000";
}
);
space = (
{
typecode = 001;
typename = "15\U5e73\U7c73";
},
{
typecode = 002;
typename = "20\U5e73\U7c73";
},
{
typecode = 003;
typename = "35\U5e73\U7c73";
}
);
styles = (
{
typecode = 001;
typename = "\U4e2d\U56fd\U98ce";
},
{
typecode = 002;
typename = "\U82f1\U56fd\U98ce";
}
);
};
message = "\U64cd\U4f5c\U6210\U529f";
}
*/
#pragma mark -获取商品列表数据
-
(
void
)
getGoodsListdatas
:
(
GoodsCondition
*
)
conditon
returnResponse
:
(
void
(
^
)(
GoodsResponse
*
))
finish
...
...
@@ -283,9 +185,36 @@
self
.
productCollectionView
.
alwaysBounceVertical
=
YES
;
[
self
CreatescreeningButton
];
//搜索关键字
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
searchInputString
:
)
name
:
@"SEARCHINPUTSTRING"
object
:
nil
];
}
#pragma mark -搜索关键字
-
(
void
)
searchInputString
:
(
NSNotification
*
)
not
{
//默认数据
GoodsCondition
*
conditon
=
[[
GoodsCondition
alloc
]
init
];
//分页数据
DataPage
*
Newpage
=
[[
DataPage
alloc
]
init
];
Newpage
.
page
=
0
;
conditon
.
page
=
Newpage
;
conditon
.
nameLike
=
not
.
object
;
__weak
typeof
(
self
)
weakSelf
=
self
;
[
self
getGoodsListdatas
:
conditon
returnResponse
:
^
(
GoodsResponse
*
response
)
{
if
(
response
.
goodsEntity
.
count
==
0
)
{
[
self
ErrorMBProgressView
:
@"暂无数据"
];
return
;
}
weakSelf
.
datasArray
=
response
;
[
weakSelf
.
productCollectionView
reloadData
];
}];
}
#pragma mark -筛选按钮
-
(
void
)
CreatescreeningButton
...
...
@@ -559,6 +488,16 @@
}
#pragma mark -释放
-
(
void
)
dealloc
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
...
...
Lighting/Class/SearchCollectionViewCell.h
0 → 100644
View file @
986fdbfb
//
// SearchCollectionViewCell.h
// Lighting
//
// Created by 曹云霄 on 16/5/16.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface
SearchCollectionViewCell
:
UICollectionViewCell
/**
* 显示历史记录,或者热门搜索
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
searchLabe
;
@end
Lighting/Class/SearchCollectionViewCell.m
0 → 100644
View file @
986fdbfb
//
// SearchCollectionViewCell.m
// Lighting
//
// Created by 曹云霄 on 16/5/16.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "SearchCollectionViewCell.h"
@implementation
SearchCollectionViewCell
@end
Lighting/Class/SearchViewController.h
0 → 100644
View file @
986fdbfb
//
// SearchViewController.h
// Lighting
//
// Created by 曹云霄 on 16/5/16.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface
SearchViewController
:
BaseViewController
/**
* 历史记录collectionView
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UICollectionView
*
historyCollectionView
;
/**
* 历史记录layout
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UICollectionViewFlowLayout
*
historyLayout
;
/**
* 热门搜索collectionView
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UICollectionView
*
hotCollectionView
;
/**
* 热门搜索layout
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UICollectionViewFlowLayout
*
hotCollectionviewLayout
;
@end
Lighting/Class/SearchViewController.m
0 → 100644
View file @
986fdbfb
//
// SearchViewController.m
// Lighting
//
// Created by 曹云霄 on 16/5/16.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "SearchViewController.h"
#import "SearchCollectionViewCell.h"
#import "HotCollectionViewCell.h"
@interface
SearchViewController
()
<
UICollectionViewDelegate
,
UICollectionViewDataSource
>
/**
* 数据源
*/
@property
(
nonatomic
,
strong
)
HotTagResponse
*
response
;
/**
* 本地搜索历史
*/
@property
(
nonatomic
,
strong
)
NSMutableArray
*
localSearchArray
;
@end
@implementation
SearchViewController
/**
* 本地搜索历史初始化
*/
-
(
NSMutableArray
*
)
localSearchArray
{
if
(
_localSearchArray
==
nil
)
{
_localSearchArray
=
[
NSMutableArray
array
];
}
return
_localSearchArray
;
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
[
self
uiConfigAction
];
[
self
getHotSearchdatas
];
}
#pragma mark -布局
-
(
void
)
uiConfigAction
{
self
.
hotCollectionviewLayout
.
itemSize
=
CGSizeMake
(
120
,
44
);
self
.
hotCollectionviewLayout
.
minimumLineSpacing
=
10
;
self
.
hotCollectionviewLayout
.
minimumInteritemSpacing
=
10
;
self
.
hotCollectionviewLayout
.
sectionInset
=
UIEdgeInsetsMake
(
10
,
10
,
10
,
10
);
self
.
historyLayout
.
itemSize
=
CGSizeMake
(
120
,
44
);
self
.
historyLayout
.
minimumLineSpacing
=
10
;
self
.
historyLayout
.
minimumInteritemSpacing
=
10
;
self
.
historyLayout
.
sectionInset
=
UIEdgeInsetsMake
(
10
,
10
,
10
,
10
);
self
.
historyCollectionView
.
delegate
=
self
;
self
.
historyCollectionView
.
dataSource
=
self
;
self
.
hotCollectionView
.
dataSource
=
self
;
self
.
hotCollectionView
.
delegate
=
self
;
self
.
hotCollectionView
.
backgroundColor
=
[
UIColor
redColor
];
self
.
historyCollectionView
.
backgroundColor
=
[
UIColor
greenColor
];
}
#pragma mark -获取本地存储搜索历史
-
(
void
)
getlocalsaveDatas
{
NSString
*
homeDictionary
=
[
NSSearchPathForDirectoriesInDomains
(
NSDocumentDirectory
,
NSUserDomainMask
,
YES
)
objectAtIndex
:
0
];
NSString
*
homepath
=
[
homeDictionary
stringByAppendingPathComponent
:
@"LOCALSAVE"
];
//添加储存的文件名
self
.
localSearchArray
=
[
NSKeyedUnarchiver
unarchiveObjectWithFile
:
homepath
];
}
#pragma mark -归档搜索历史
-
(
void
)
SaveSearchDatas
{
NSString
*
homeDictionary
=
[
NSSearchPathForDirectoriesInDomains
(
NSDocumentDirectory
,
NSUserDomainMask
,
YES
)
objectAtIndex
:
0
];
NSString
*
homepath
=
[
homeDictionary
stringByAppendingPathComponent
:
@"LOCALSAVE"
];
//添加储存的文件名
BOOL
flag
=
[
NSKeyedArchiver
archiveRootObject
:
self
.
localSearchArray
toFile
:
homepath
];
//归档一个字符串
}
#pragma mark -获取热门搜索数据
-
(
void
)
getHotSearchdatas
{
[
self
CreateMBProgressHUDLoding
];
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@"
,
ServerAddress
,
@"/hottag/getHotTag"
]
WithRequestType
:
1
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
self
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
self
.
response
=
[[
HotTagResponse
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
[
self
.
hotCollectionView
reloadData
];
}
else
{
[
self
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithFailureBlock
:^
(
id
error
)
{
[
self
RemoveMBProgressHUDLoding
];
}];
}
-
(
UICollectionViewCell
*
)
collectionView
:
(
UICollectionView
*
)
collectionView
cellForItemAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
if
([
collectionView
isEqual
:
self
.
historyCollectionView
])
{
SearchCollectionViewCell
*
cell
=
[
collectionView
dequeueReusableCellWithReuseIdentifier
:
@"firstcell"
forIndexPath
:
indexPath
];
return
cell
;
}
if
([
collectionView
isEqual
:
self
.
hotCollectionView
])
{
HotCollectionViewCell
*
cell
=
[
collectionView
dequeueReusableCellWithReuseIdentifier
:
@"secondcell"
forIndexPath
:
indexPath
];
cell
.
responseDatas
=
[
self
.
response
.
list
objectAtIndex_opple
:
indexPath
.
item
];
return
cell
;
}
return
nil
;
}
-
(
NSInteger
)
collectionView
:
(
UICollectionView
*
)
collectionView
numberOfItemsInSection
:
(
NSInteger
)
section
{
if
([
collectionView
isEqual
:
self
.
hotCollectionView
])
{
return
self
.
response
.
list
.
count
;
}
return
20
;
}
#pragma mark -释放
-
(
void
)
dealloc
{
[[
NSNotificationCenter
defaultCenter
]
removeObserver
:
self
];
}
-
(
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/SettlementViewController.h
View file @
986fdbfb
...
...
@@ -14,8 +14,101 @@
/**
*
*
商品信息
*/
@property
(
nonatomic
,
strong
)
NSArray
*
goodsArray
;
/**
* 商品总数量
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UITextField
*
goodsAllNumber
;
/**
* 商品总数量背景View
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UIView
*
goodsAllNumberBackvie
;
/**
* 商品总金额
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UITextField
*
goodsAllPrice
;
/**
* 商品总金额背景View
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UIView
*
goodsAllpriceBackView
;
/**
* 支付方式
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UIButton
*
payTypeButton
;
/**
* 微信支付
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UIButton
*
WeixiPayButton
;
/**
* 支付宝支付
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UIButton
*
payTreasureButton
;
/**
* 显示支付二维码
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UIImageView
*
showPayQrCodeImageView
;
/**
* 是否开票
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UIButton
*
ISinvoiceButton
;
/**
* 发票类型
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UIButton
*
invoiceType
;
/**
* 发票抬头
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UITextField
*
invoiceHeader
;
/**
* 发票抬头背景
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UIView
*
invoiceBackView
;
/**
* 取消
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UIButton
*
cancelButton
;
/**
* 确认
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UIButton
*
sureButton
;
@end
Lighting/Class/SettlementViewController.m
View file @
986fdbfb
...
...
@@ -8,7 +8,7 @@
#import "SettlementViewController.h"
@interface
SettlementViewController
()
@interface
SettlementViewController
()
<
ReturnTableviewcellIndexpathdelegate
>
@end
...
...
@@ -16,16 +16,145 @@
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
// Do any additional setup after loading the view from its nib.
[
self
uiConfigAction
];
}
#pragma mark -布局
-
(
void
)
uiConfigAction
{
self
.
goodsAllNumberBackvie
.
layer
.
masksToBounds
=
YES
;
self
.
goodsAllNumberBackvie
.
layer
.
cornerRadius
=
kCornerRadius
;
self
.
goodsAllpriceBackView
.
layer
.
masksToBounds
=
YES
;
self
.
goodsAllpriceBackView
.
layer
.
cornerRadius
=
kCornerRadius
;
self
.
payTypeButton
.
layer
.
masksToBounds
=
YES
;
self
.
payTypeButton
.
layer
.
cornerRadius
=
kCornerRadius
;
self
.
WeixiPayButton
.
layer
.
masksToBounds
=
YES
;
self
.
WeixiPayButton
.
layer
.
cornerRadius
=
kCornerRadius
;
self
.
payTreasureButton
.
layer
.
masksToBounds
=
YES
;
self
.
payTreasureButton
.
layer
.
cornerRadius
=
kCornerRadius
;
self
.
ISinvoiceButton
.
layer
.
masksToBounds
=
YES
;
self
.
ISinvoiceButton
.
layer
.
cornerRadius
=
kCornerRadius
;
self
.
invoiceType
.
layer
.
masksToBounds
=
YES
;
self
.
invoiceType
.
layer
.
cornerRadius
=
kCornerRadius
;
self
.
invoiceBackView
.
layer
.
masksToBounds
=
YES
;
self
.
invoiceBackView
.
layer
.
cornerRadius
=
kCornerRadius
;
}
#pragma mark -支付总金额,商品总数量
-
(
void
)
setGoodsArray
:
(
NSArray
*
)
goodsArray
{
_goodsArray
=
goodsArray
;
NSInteger
goodsAllNumber
=
0
;
//总数量
NSInteger
goodAllprice
=
0
;
//总价格
for
(
TOOrderdetailEntity
*
model
in
_goodsArray
)
{
goodsAllNumber
+=
[
model
.
goodsNum
integerValue
];
goodAllprice
+=
[
model
.
goodsPrice
integerValue
];
}
self
.
goodsAllNumber
.
text
=
[
NSString
stringWithFormat
:
@"%ld"
,
goodsAllNumber
];
self
.
goodsAllPrice
.
text
=
[
NSString
stringWithFormat
:
@"%ld元"
,
goodAllprice
];
}
-
(
void
)
viewWillAppear
:
(
BOOL
)
animated
{
self
.
view
.
superview
.
layer
.
cornerRadius
=
0
;
}
#pragma mark -取消支付
-
(
IBAction
)
CancelButtonClick
:
(
UIButton
*
)
sender
{
[
self
dismissViewControllerAnimated
:
YES
completion
:
nil
];
}
#pragma mark -确认支付
-
(
IBAction
)
SureButtonClick
:
(
UIButton
*
)
sender
{
}
#pragma amrk -支付方式选择
-
(
IBAction
)
payTypeButtonClick
:
(
UIButton
*
)
sender
{
NSArray
*
arr
=
@[
@"现金"
,
@"支票"
,
@"转账"
];
[
self
ShowPopoverViewController
:
CGSizeMake
(
100
,
200
)
Withdatas
:
arr
ShowButton
:
sender
SelectedIndex
:
0
GetTitle
:
YES
];
}
#pragma mark -是否开票
-
(
IBAction
)
isinvoiceButtonClick
:
(
UIButton
*
)
sender
{
}
#pragma mark -发票类型
-
(
IBAction
)
invoiceTypeButtonClick
:
(
UIButton
*
)
sender
{
}
#pragma mark -弹出popover视图控制器
-
(
void
)
ShowPopoverViewController
:
(
CGSize
)
size
Withdatas
:
(
NSArray
*
)
datasArray
ShowButton
:
(
UIButton
*
)
button
SelectedIndex
:
(
NSInteger
)
index
GetTitle
:
(
BOOL
)
istitle
{
PopoverViewController
*
popover
=
[[
PopoverViewController
alloc
]
init
];
popover
.
datasArray
=
datasArray
;
popover
.
delegate
=
self
;
popover
.
Selectedindex
=
index
;
popover
.
isString
=
YES
;
popover
.
contentSize
=
size
;
popover
.
preferredContentSize
=
size
;
popover
.
modalPresentationStyle
=
UIModalPresentationPopover
;
UIPopoverPresentationController
*
pop
=
popover
.
popoverPresentationController
;
pop
.
permittedArrowDirections
=
UIPopoverArrowDirectionUp
;
pop
.
sourceView
=
popover
.
view
;
pop
.
barButtonItem
=
[[
UIBarButtonItem
alloc
]
initWithCustomView
:
button
];
[
self
presentViewController
:
popover
animated
:
YES
completion
:
nil
];
}
/**
* 选中筛选条件对象typecode
*
* @param index NSString
*/
-
(
void
)
returnCellindexpathwithrow
:
(
NSString
*
)
Type
WithcellTitle
:
(
NSString
*
)
title
Withselected
:
(
NSInteger
)
Selected
{
switch
(
Selected
)
{
case
0
:
//支付方式
{
[
self
.
payTypeButton
setTitle
:
title
forState
:
UIControlStateNormal
];
}
break
;
case
1
:
//是否开票
{
[
self
.
ISinvoiceButton
setTitle
:
title
forState
:
UIControlStateNormal
];
}
break
;
case
2
:
//发票类型
{
[
self
.
invoiceType
setTitle
:
title
forState
:
UIControlStateNormal
];
}
break
;
default
:
break
;
}
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
...
...
Lighting/Class/SettlementViewController.xib
View file @
986fdbfb
This diff is collapsed.
Click to expand it.
Lighting/Class/Shoppingcart/GenerateOrdersViewController.m
View file @
986fdbfb
...
...
@@ -346,19 +346,33 @@
//收货地址
TOOrderEntity
*
orderReceiver
=
[[
TOOrderEntity
alloc
]
init
];
orderReceiver
.
receiverName
=
@"caoyunxiao"
;
orderReceiver
.
receiverMobile
=
@"15121161964"
;
orderReceiver
.
receiverAddress
=
@"dasdsssssssssss"
;
NSArray
*
Adressarr
=
[
self
.
datasArray
objectAtIndex_opple
:
1
];
for
(
int
i
=
0
;
i
<
Adressarr
.
count
;
i
++
)
{
if
([[
Adressarr
objectAtIndex_opple
:
i
]
isKindOfClass
:[
AddressModel
class
]])
{
AddressModel
*
model
=
[
Adressarr
objectAtIndex_opple
:
i
];
if
(
model
.
isSelected
)
{
orderReceiver
.
receiverName
=
model
.
name
;
orderReceiver
.
receiverMobile
=
model
.
miblephone
;
orderReceiver
.
receiverAddress
=
model
.
address
;
break
;
}
if
(
i
==
Adressarr
.
count
-
1
)
{
[
self
ErrorMBProgressView
:
@"未选中地址"
];
return
;
}
}
}
order
.
order
=
orderReceiver
;
orderReceiver
.
guideId
=
[[
Shoppersmanager
manager
]
Shoppers
].
employee
.
fid
;
orderReceiver
.
consumerId
=
[[
Customermanager
manager
]
customerID
];
//商品ID
NSArray
*
goodArray
=
[
self
.
datasArray
lastObject
];
NSMutableArray
*
goodidArr
=
[
NSMutableArray
array
];
for
(
int
i
=
0
;
i
<
goodArray
.
count
-
1
;
i
++
)
{
ShopcarModel
*
model
=
[
goodArray
objectAtIndex_opple
:
i
];
TOOrderdetailEntity
*
orderGoods
=
[[
TOOrderdetailEntity
alloc
]
init
];
orderGoods
.
goodsId
=
model
.
fid
;
...
...
@@ -367,25 +381,20 @@
order
.
orderdetailList
=
goodidArr
;
[
self
CreateMBProgressHUDLoding
];
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@"
,
ServerAddress
,
@"/order/save"
]
WithRequestType
:
0
WithParameter
:
order
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
self
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
OrderdetailsViewController
*
orderDetails
=
[[
self
getStoryboardWithName
]
instantiateViewControllerWithIdentifier
:
@"orderdetails"
];
orderDetails
.
orderCode
=
returnValue
[
@"data"
];
orderDetails
.
sectionTitle
=
@[
@"订单信息"
,
@"客户信息"
,
@"收货信息"
,
@"商品清单"
];
orderDetails
.
isShowattachment
=
NO
;
[
self
.
navigationController
pushViewController
:
orderDetails
animated
:
YES
];
}
else
{
[
self
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithFailureBlock
:^
(
id
error
)
{
NSLog
(
@"%@"
,
error
);
[
self
RemoveMBProgressHUDLoding
];
}];
}
...
...
@@ -399,7 +408,6 @@
}
#pragma mark -设置为当前地址回调
-
(
void
)
SetCustomerButtonClick
:
(
NSInteger
)
index
;
{
...
...
Lighting/Class/Shoppingcart/ShoppingTableViewCell.m
View file @
986fdbfb
...
...
@@ -85,7 +85,7 @@
self
.
returnCellblock
(
_cellindex
);
}
sender
.
selected
=
YES
;
sender
.
selected
=
!
sender
.
selected
;
}
...
...
Lighting/Class/Shoppingcart/ShoppingViewController.m
View file @
986fdbfb
...
...
@@ -64,6 +64,8 @@
-
(
void
)
viewWillDisappear
:
(
BOOL
)
animated
{
[
super
viewWillDisappear
:
animated
];
[
self
.
shopResponseArray
removeAllObjects
];
[
self
getShoppingCardata
];
// 开启
if
([
self
.
navigationController
respondsToSelector
:
@selector
(
interactivePopGestureRecognizer
)])
{
...
...
@@ -115,19 +117,15 @@
model
.
goodsId
=
objc
.
goodsId
;
model
.
goodsNum
=
objc
.
goodsNum
;
model
.
consumerId
=
objc
.
consumerId
;
[
self
.
shopResponseArray
addObject
:
model
];
}
[
self
.
shoppingTableview
reloadData
];
}
else
{
[
self
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithFailureBlock
:^
(
id
error
)
{
[
self
RemoveMBProgressHUDLoding
];
...
...
@@ -136,7 +134,6 @@
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
ShoppingTableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"Shopping"
forIndexPath
:
indexPath
];
...
...
@@ -147,7 +144,6 @@
[
cell
setReturnCellblock
:
^
(
NSInteger
index
)
{
[
self
setSelectedButton
:
index
];
}];
return
cell
;
}
...
...
@@ -170,33 +166,20 @@
}
#pragma mark -设置为当前客户回调
-
(
void
)
setSelectedButton
:
(
NSInteger
)
index
;
{
for
(
ShoppingTableViewCell
*
cell
in
self
.
shoppingTableview
.
visibleCells
)
{
cell
.
selectedButton
.
selected
=
NO
;
}
for
(
ShopcarModel
*
model
in
self
.
shopResponseArray
)
{
model
.
isSelected
=
NO
;
}
ShopcarModel
*
model
=
[
self
.
shopResponseArray
objectAtIndex_opple
:
index
];
model
.
isSelected
=
YES
;
model
.
isSelected
=
!
model
.
isSelected
;
}
#pragma mark -结算
-
(
IBAction
)
settlementButtonClick
:
(
UIButton
*
)
sender
{
NSMutableArray
*
array
=
[
NSMutableArray
array
];
for
(
ShopcarModel
*
model
in
self
.
shopResponseArray
)
{
if
(
model
.
isSelected
)
{
[
array
addObject
:
model
];
}
}
...
...
@@ -214,12 +197,52 @@
}
#pragma mark -全选
-
(
IBAction
)
allSelectedButtonClick
:
(
id
)
sender
{
-
(
IBAction
)
allSelectedButtonClick
:
(
UIButton
*
)
sender
{
sender
.
selected
=
!
sender
.
selected
;
if
(
sender
.
selected
)
{
//全部选中
for
(
ShoppingTableViewCell
*
cell
in
self
.
shoppingTableview
.
visibleCells
)
{
cell
.
selectedButton
.
selected
=
YES
;
}
for
(
ShopcarModel
*
model
in
self
.
shopResponseArray
)
{
model
.
isSelected
=
YES
;
}
}
else
{
//取消全部选中
for
(
ShoppingTableViewCell
*
cell
in
self
.
shoppingTableview
.
visibleCells
)
{
cell
.
selectedButton
.
selected
=
NO
;
}
for
(
ShopcarModel
*
model
in
self
.
shopResponseArray
)
{
model
.
isSelected
=
NO
;
}
}
}
#pragma mark -删除选中商品
-
(
IBAction
)
delecteSelectedGoods
:
(
UIButton
*
)
sender
{
//需要删除的cell数组
NSMutableArray
*
delecteArray
=
[
NSMutableArray
array
];
for
(
int
i
=
0
;
i
<
self
.
shopResponseArray
.
count
;
i
++
)
{
ShopcarModel
*
model
=
[
self
.
shopResponseArray
objectAtIndex_opple
:
i
];
if
(
model
.
isSelected
)
{
[
self
.
shopResponseArray
removeObject
:
model
];
NSIndexPath
*
indexpath
=
[
NSIndexPath
indexPathForRow
:
i
inSection
:
0
];
[
delecteArray
addObject
:
indexpath
];
}
}
[
self
.
shoppingTableview
deleteRowsAtIndexPaths
:
delecteArray
withRowAnimation
:
UITableViewRowAnimationLeft
];
}
...
...
Lighting/Class/Tabbar/CustomTabbarController.m
View file @
986fdbfb
...
...
@@ -19,11 +19,13 @@
#import "CustomerOrderViewController.h"
#import "UserViewController.h"
#import "ChangePasswordViewController.h"
#import "SearchViewController.h"
@interface
CustomTabbarController
()
<
TabbarButtonClickdelegate
,
ChangpasswordDelegate
,
CancelButtondelegate
>
@interface
CustomTabbarController
()
<
TabbarButtonClickdelegate
,
ChangpasswordDelegate
,
CancelButtondelegate
,
UITextFieldDelegate
>
@property
(
nonatomic
,
strong
)
NSArray
*
identifierArray
;
@property
(
nonatomic
,
strong
)
NSArray
*
controllerArray
;
/**
* 保存按钮引用
...
...
@@ -43,21 +45,13 @@
{
if
(
_identifierArray
==
nil
)
{
_identifierArray
=
[
NSArray
arrayWithObjects
:
@"shopping"
,
@"Client"
,
@"followheart"
,
@"scenelibrary"
,
@"productlibrary"
,
@"customermanager"
,
@"allcustomer"
,
@"customerorder"
,
@"about"
,
nil
];
_identifierArray
=
[
NSArray
arrayWithObjects
:
@"s
earchvc"
,
@"s
hopping"
,
@"Client"
,
@"followheart"
,
@"scenelibrary"
,
@"productlibrary"
,
@"customermanager"
,
@"allcustomer"
,
@"customerorder"
,
@"about"
,
nil
];
}
return
_identifierArray
;
return
_identifierArray
;
}
-
(
NSArray
*
)
controllerArray
{
if
(
_controllerArray
==
nil
)
{
_controllerArray
=
[
NSArray
arrayWithObjects
:
@"ShoppingViewController"
,
@"ClientViewController"
,
nil
];
}
return
_controllerArray
;
}
-
(
void
)
viewDidLoad
{
...
...
@@ -75,6 +69,7 @@
self
.
tabBar
.
frame
=
CGRectMake
(
Zero
,
Zero
,
ScreenWidth
,
NavigationHeight
);
Toolview
*
toolview
=
[[
Toolview
alloc
]
initWithFrame
:
CGRectMake
(
Zero
,
Zero
,
ScreenWidth
,
NavigationHeight
)];
toolview
.
delegate
=
self
;
toolview
.
inputField
.
delegate
=
self
;
[
self
.
tabBar
addSubview
:
toolview
];
SHARED_APPDELEGATE
.
tabbar
=
self
.
tabBar
;
}
...
...
@@ -85,17 +80,19 @@
{
UIStoryboard
*
storyboard
=
[
UIStoryboard
storyboardWithName
:
@"StoryboardwithCYX"
bundle
:
nil
];
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
]];
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
]];
SearchViewController
*
searchVC
=
[
storyboard
instantiateViewControllerWithIdentifier
:[
self
.
identifierArray
objectAtIndex_opple
:
0
]];
ShoppingViewController
*
shoppingVC
=
[
storyboard
instantiateViewControllerWithIdentifier
:[
self
.
identifierArray
objectAtIndex_opple
:
1
]];
ClientViewController
*
clientVC
=
[
storyboard
instantiateViewControllerWithIdentifier
:[
self
.
identifierArray
objectAtIndex_opple
:
2
]];
FollowHeartViewController
*
followVC
=
[
storyboard
instantiateViewControllerWithIdentifier
:[
self
.
identifierArray
objectAtIndex_opple
:
3
]];
SceneLibraryViewController
*
sceneVC
=
[
storyboard
instantiateViewControllerWithIdentifier
:[
self
.
identifierArray
objectAtIndex_opple
:
4
]];
ProductLibraryViewController
*
productVC
=
[
storyboard
instantiateViewControllerWithIdentifier
:[
self
.
identifierArray
objectAtIndex_opple
:
5
]];
CustomerManagementViewController
*
customerVC
=
[
storyboard
instantiateViewControllerWithIdentifier
:[
self
.
identifierArray
objectAtIndex_opple
:
6
]];
AllCustomerViewController
*
allcustomerVC
=
[
storyboard
instantiateViewControllerWithIdentifier
:[
self
.
identifierArray
objectAtIndex_opple
:
7
]];
CustomerOrderViewController
*
customerOrderVC
=
[
storyboard
instantiateViewControllerWithIdentifier
:[
self
.
identifierArray
objectAtIndex_opple
:
8
]];
AboutViewController
*
aboutVC
=
[
storyboard
instantiateViewControllerWithIdentifier
:[
self
.
identifierArray
objectAtIndex_opple
:
9
]];
UINavigationController
*
searchNav
=
[[
UINavigationController
alloc
]
initWithRootViewController
:
searchVC
];
UINavigationController
*
shoppingNav
=
[[
UINavigationController
alloc
]
initWithRootViewController
:
shoppingVC
];
UINavigationController
*
clientNav
=
[[
UINavigationController
alloc
]
initWithRootViewController
:
clientVC
];
UINavigationController
*
followNav
=
[[
UINavigationController
alloc
]
initWithRootViewController
:
followVC
];
...
...
@@ -106,7 +103,7 @@
UINavigationController
*
cutomerorderNav
=
[[
UINavigationController
alloc
]
initWithRootViewController
:
customerOrderVC
];
UINavigationController
*
aboutNav
=
[[
UINavigationController
alloc
]
initWithRootViewController
:
aboutVC
];
NSArray
*
vcArray
=
[
NSArray
arrayWithObjects
:
aboutNav
,
cutomerorderNav
,
allcustomerNav
,
customerNav
,
productNav
,
sceneNav
,
followNav
,
clientNav
,
shoppingNav
,
nil
];
NSArray
*
vcArray
=
[
NSArray
arrayWithObjects
:
aboutNav
,
cutomerorderNav
,
allcustomerNav
,
customerNav
,
productNav
,
sceneNav
,
followNav
,
clientNav
,
shoppingNav
,
searchNav
,
nil
];
self
.
viewControllers
=
vcArray
;
self
.
selectedIndex
=
7
;
}
...
...
@@ -218,12 +215,34 @@
-
(
void
)
QrcodeButtonClick
{
NSLog
(
@"二维码扫描"
);
}
#pragma mark -搜索框代理方法
-
(
BOOL
)
textFieldShouldBeginEditing
:
(
UITextField
*
)
textField
{
self
.
selectedIndex
=
9
;
return
YES
;
}
#pragma mark -Search按钮
-
(
BOOL
)
textFieldShouldReturn
:
(
UITextField
*
)
textField
{
//搜索
if
(
textField
.
text
!=
nil
)
{
[
textField
resignFirstResponder
];
self
.
selectedIndex
=
4
;
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
@"SEARCHINPUTSTRING"
object
:
textField
.
text
];
}
return
YES
;
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
...
...
Lighting/Class/Tabbar/Toolview.h
View file @
986fdbfb
...
...
@@ -8,7 +8,7 @@
#import <UIKit/UIKit.h>
@protocol
TabbarButtonClickdelegate
<
NSObject
>
@protocol
TabbarButtonClickdelegate
<
NSObject
,
UITextFieldDelegate
>
@required
...
...
@@ -34,4 +34,10 @@
*/
@property
(
nonatomic
,
strong
)
UIView
*
underlineView
;
/**
* 搜索框
*/
@property
(
nonatomic
,
strong
)
UITextField
*
inputField
;
@end
Lighting/Class/Tabbar/Toolview.m
View file @
986fdbfb
...
...
@@ -67,12 +67,12 @@
//输入框
UITextField
*
inputField
=
[[
UITextField
alloc
]
initWithFrame
:
CGRectMake
(
45
,
0
,
170
,
35
)];
inputField
.
borderStyle
=
UITextBorderStyleNone
;
inputField
.
placeholder
=
@"请输入关键字"
;
inputField
.
font
=
[
UIFont
systemFontOfSize
:
12
];
[
backView
addSubview
:
inputField
]
;
self
.
inputField
=
[[
UITextField
alloc
]
initWithFrame
:
CGRectMake
(
45
,
0
,
170
,
35
)];
self
.
inputField
.
borderStyle
=
UITextBorderStyleNone
;
self
.
inputField
.
placeholder
=
@"请输入关键字"
;
self
.
inputField
.
font
=
[
UIFont
systemFontOfSize
:
12
];
self
.
inputField
.
returnKeyType
=
UIReturnKeySearch
;
[
backView
addSubview
:
self
.
inputField
];
//扫描二维码
UIButton
*
button
=
[
UIButton
buttonWithType
:
UIButtonTypeCustom
];
...
...
@@ -148,4 +148,10 @@
@end
Lighting/Lighting.xcodeproj/project.pbxproj
View file @
986fdbfb
This diff is collapsed.
Click to expand it.
Lighting/Lighting/Images.xcassets/
当前
.imageset/Contents.json
→
Lighting/Lighting/Images.xcassets/
now
.imageset/Contents.json
View file @
986fdbfb
File moved
Lighting/Lighting/Images.xcassets/
当前
.imageset/当前.png
→
Lighting/Lighting/Images.xcassets/
now
.imageset/当前.png
View file @
986fdbfb
File moved
Lighting/Lighting/Images.xcassets/
当前
.imageset/当前@2x.png
→
Lighting/Lighting/Images.xcassets/
now
.imageset/当前@2x.png
View file @
986fdbfb
File moved
Lighting/Lighting/StoryboardwithCYX.storyboard
View file @
986fdbfb
This diff is collapsed.
Click to expand it.
Lighting/Tools/BaseViewController.m
View file @
986fdbfb
...
...
@@ -11,6 +11,7 @@
@interface
BaseViewController
()
<
UIPrintInteractionControllerDelegate
>
@property
(
nonatomic
,
strong
)
MBProgressHUD
*
TCHud
;
@property
(
nonatomic
,
strong
)
UIWebView
*
webView
;
@end
...
...
@@ -31,10 +32,22 @@
return
_TCHud
;
}
-
(
UIWebView
*
)
webView
{
if
(
_webView
==
nil
)
{
_webView
=
[[
UIWebView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
ScreenWidth
,
ScreenHeight
)];
}
return
_webView
;
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
self
.
automaticallyAdjustsScrollViewInsets
=
NO
;
self
.
automaticallyAdjustsScrollViewInsets
=
NO
;
self
.
view
.
backgroundColor
=
[
UIColor
whiteColor
];
}
-
(
void
)
didReceiveMemoryWarning
{
...
...
@@ -181,4 +194,59 @@
}
#pragma mark 调用airPrint无线打印机
-
(
void
)
callAirprintWithURL
:
(
NSURL
*
)
datasurl
{
// NSData *mypdfdata = [NSData dataWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"The Swift Programming Language 中文版 - v1.2" ofType:@"pdf"]];
UIPrintInteractionController
*
pic
=
[
UIPrintInteractionController
sharedPrintController
];
pic
.
delegate
=
self
;
[
self
.
webView
loadRequest
:[
NSURLRequest
requestWithURL
:
datasurl
]];
//网页
pic
.
printFormatter
=
[
self
.
webView
viewPrintFormatter
];
//布局打印视图绘制的内容。
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
Lighting/Tools/PopoverViewController.h
View file @
986fdbfb
...
...
@@ -15,6 +15,8 @@
@protocol
ReturnTableviewcellIndexpathdelegate
<
NSObject
>
@optional
/**
* 选中筛选条件对象typecode
*
...
...
@@ -63,5 +65,10 @@
@property
(
nonatomic
,
assign
)
NSInteger
Selectedindex
;
/**
* 是否传入数据源,结构为内嵌字符串
*/
@property
(
nonatomic
,
assign
)
BOOL
isString
;
@end
Lighting/Tools/PopoverViewController.m
View file @
986fdbfb
...
...
@@ -54,7 +54,12 @@
cell
.
imageView
.
image
=
TCImage
([
self
.
datasArray
objectAtIndex_opple
:
indexPath
.
row
]);
return
cell
;
}
cell
.
textLabel
.
text
=
[[
self
.
datasArray
objectAtIndex_opple
:
indexPath
.
row
]
typename
];
if
(
self
.
isString
)
{
cell
.
textLabel
.
text
=
[
self
.
datasArray
objectAtIndex_opple
:
indexPath
.
row
];
}
else
{
cell
.
textLabel
.
text
=
[[
self
.
datasArray
objectAtIndex_opple
:
indexPath
.
row
]
typename
];
}
cell
.
textLabel
.
textAlignment
=
NSTextAlignmentCenter
;
cell
.
textLabel
.
font
=
[
UIFont
systemFontOfSize
:
12
];
return
cell
;
...
...
@@ -75,7 +80,6 @@
if
([
self
.
delegate
respondsToSelector
:
@selector
(
returnWithIndexSelected
:)])
{
[
self
.
delegate
returnWithIndexSelected
:
indexPath
.
row
];
}
}
else
...
...
@@ -83,7 +87,15 @@
if
([
self
.
delegate
respondsToSelector
:
@selector
(
returnCellindexpathwithrow
:
WithcellTitle
:
Withselected
:
)])
{
[
self
.
delegate
returnCellindexpathwithrow
:[[
self
.
datasArray
objectAtIndex_opple
:
indexPath
.
row
]
typecode
]
WithcellTitle
:[[
self
.
datasArray
objectAtIndex_opple
:
indexPath
.
row
]
typename
]
Withselected
:
_Selectedindex
];
//判断是为纯字符串选中
if
(
self
.
isString
)
{
[
self
.
delegate
returnCellindexpathwithrow
:[
self
.
datasArray
objectAtIndex_opple
:
indexPath
.
row
]
WithcellTitle
:[
self
.
datasArray
objectAtIndex_opple
:
indexPath
.
row
]
Withselected
:
_Selectedindex
];
}
else
{
[
self
.
delegate
returnCellindexpathwithrow
:[[
self
.
datasArray
objectAtIndex_opple
:
indexPath
.
row
]
typecode
]
WithcellTitle
:[[
self
.
datasArray
objectAtIndex_opple
:
indexPath
.
row
]
typename
]
Withselected
:
_Selectedindex
];
}
}
}
}
...
...
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