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
2dd75e10
Commit
2dd75e10
authored
May 25, 2016
by
勾芒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
debug
parent
0d90aa7c
Hide whitespace changes
Inline
Side-by-side
Showing
16 changed files
with
232 additions
and
76 deletions
+232
-76
AllCustomerViewController.m
Lighting/Class/AllCustomerViewController.m
+9
-0
ClientDetailsTableViewCell.m
Lighting/Class/ClientDetailsTableViewCell.m
+2
-1
ClientViewController.h
Lighting/Class/ClientViewController.h
+4
-1
ClientViewController.m
Lighting/Class/ClientViewController.m
+95
-32
ClientdetailsViewController.h
Lighting/Class/ClientdetailsViewController.h
+1
-1
ClientdetailsViewController.m
Lighting/Class/ClientdetailsViewController.m
+12
-14
CommodityListTableViewCell.m
Lighting/Class/CommodityListTableViewCell.m
+2
-1
InformationTableViewCell.m
Lighting/Class/InformationTableViewCell.m
+1
-3
OrderdetailsViewController.m
Lighting/Class/OrderdetailsViewController.m
+24
-0
SettlementViewController.m
Lighting/Class/SettlementViewController.m
+24
-2
SettlementViewController.xib
Lighting/Class/SettlementViewController.xib
+1
-1
GenerateOrdersViewController.m
Lighting/Class/Shoppingcart/GenerateOrdersViewController.m
+20
-0
ShoppingTableViewCell.m
Lighting/Class/Shoppingcart/ShoppingTableViewCell.m
+4
-3
ShoppingViewController.m
Lighting/Class/Shoppingcart/ShoppingViewController.m
+4
-2
StoryboardwithCYX.storyboard
Lighting/Lighting/StoryboardwithCYX.storyboard
+5
-3
BaseViewController.m
Lighting/Tools/BaseViewController.m
+24
-12
No files found.
Lighting/Class/AllCustomerViewController.m
View file @
2dd75e10
...
...
@@ -210,6 +210,15 @@
ClientdetailsViewController
*
clientdetails
=
[
storyboard
instantiateViewControllerWithIdentifier
:
@"clientdetails"
];
clientdetails
.
model
=
[
self
.
CustomerresultArray
objectAtIndex_opple
:
indexPath
.
row
];
clientdetails
.
cellindex
=
indexPath
.
row
;
//设置当前客户
__weak
typeof
(
self
)
weakSelf
=
self
;
[
clientdetails
setCurrentUserBlock
:
^
(
NSInteger
index
,
NSString
*
title
)
{
NSString
*
customerID
=
[[
weakSelf
.
CustomerresultArray
objectAtIndex_opple
:
indexPath
.
row
]
fid
];
NSDictionary
*
dict
=
@{
@"customerid"
:
customerID
,
@"title"
:
title
,
@"model"
:
[
weakSelf
.
CustomerresultArray
objectAtIndex_opple
:
indexPath
.
row
]};
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
@"SETUPCURRENTCUSTOMER"
object
:
dict
];
}];
[
self
.
navigationController
pushViewController
:
clientdetails
animated
:
YES
];
}
...
...
Lighting/Class/ClientDetailsTableViewCell.m
View file @
2dd75e10
...
...
@@ -21,7 +21,8 @@
-
(
void
)
setModel
:
(
ShopcarModel
*
)
model
{
_model
=
model
;
[
self
.
goodsImageview
sd_setImageWithURL
:[
NSURL
URLWithString
:
_model
.
goods
.
pictures
]
placeholderImage
:
REPLACEIMAGE
];
NSArray
*
imagesArray
=
[
_model
.
goods
.
pictures
componentsSeparatedByString
:
@","
];
[
self
.
goodsImageview
sd_setImageWithURL
:[
NSURL
URLWithString
:[
imagesArray
firstObject
]]
placeholderImage
:
REPLACEIMAGE
];
self
.
goodsName
.
text
=
_model
.
goods
.
name
;
self
.
goodsCraneQuotation
.
text
=
[
NSString
stringWithFormat
:
@"¥%.2f"
,[
_model
.
goods
.
tagPrice
floatValue
]];
self
.
goodsSpecifications
.
text
=
_model
.
goods
.
size
;
...
...
Lighting/Class/ClientViewController.h
View file @
2dd75e10
...
...
@@ -81,7 +81,10 @@
/**
* 用户头像
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UIImageView
*
customerHeader
;
...
...
Lighting/Class/ClientViewController.m
View file @
2dd75e10
...
...
@@ -93,6 +93,7 @@
self
.
changePersonInformationButton
.
layer
.
masksToBounds
=
YES
;
self
.
changePersonInformationButton
.
layer
.
cornerRadius
=
kCornerRadius
;
self
.
indexPage
=
1
;
//隐藏更改客户按钮
self
.
changePersonInformationButton
.
hidden
=
YES
;
...
...
@@ -103,6 +104,9 @@
self
.
searchPersonInformationField
.
delegate
=
self
;
//监听键盘落下的通知
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
KeyboadrDismiss
)
name
:
UIKeyboardWillHideNotification
object
:
nil
];
//设置当前客户通知
[[
NSNotificationCenter
defaultCenter
]
addObserver
:
self
selector
:
@selector
(
SetupCurrentCustomer
:
)
name
:
@"SETUPCURRENTCUSTOMER"
object
:
nil
];
//下拉刷新
MjRefreshHeaderCustom
*
headerRefresh
=
[
MjRefreshHeaderCustom
headerWithRefreshingBlock
:
^
{
...
...
@@ -238,16 +242,69 @@
clientdetails
.
model
=
[
self
.
CustomerresultArray
objectAtIndex_opple
:
indexPath
.
row
];
clientdetails
.
cellindex
=
indexPath
.
row
;
//设置当前客户
[
clientdetails
setCurrentUserBlock
:
^
(
NSInteger
index
)
{
InformationTableViewCell
*
cell
=
[
self
.
informationTableview
cellForRowAtIndexPath
:[
NSIndexPath
indexPathForRow
:
index
inSection
:
0
]];
cell
.
setCurrentCustomer
.
selected
=
YES
;
[
self
SetCustomerButtonClick
:
index
];
[
clientdetails
setCurrentUserBlock
:
^
(
NSInteger
index
,
NSString
*
title
)
{
if
([
title
isEqualToString
:
@"设为当前客户"
])
{
InformationTableViewCell
*
cell
=
[
self
.
informationTableview
cellForRowAtIndexPath
:[
NSIndexPath
indexPathForRow
:
index
inSection
:
0
]];
[
self
SetCustomerButtonClick
:
index
];
cell
.
setCurrentCustomer
.
selected
=
YES
;
}
else
if
([
title
isEqualToString
:
@"退出当前客户"
])
{
[
self
ExitCurrentCustomer
];
[
self
.
addpersonInformationButton
setTitle
:
@"添加客户信息"
forState
:
UIControlStateNormal
];
}
}];
[
self
.
navigationController
pushViewController
:
clientdetails
animated
:
YES
];
}
#pragma mark -设置为当前客户回调
#pragma mark -所有客户界面 设置当前客户通知回调
-
(
void
)
SetupCurrentCustomer
:
(
NSNotification
*
)
not
{
NSDictionary
*
dict
=
not
.
object
;
for
(
InformationTableViewCell
*
cell
in
self
.
informationTableview
.
visibleCells
)
{
cell
.
setCurrentCustomer
.
selected
=
NO
;
}
for
(
MyclientEntityModel
*
model
in
self
.
CustomerresultArray
)
{
if
([
model
.
fid
isEqualToString
:
dict
[
@"customerid"
]])
{
model
.
selectedState
=
YES
;
}
else
{
model
.
selectedState
=
NO
;
}
}
if
([
dict
[
@"title"
]
isEqualToString
:
@"设为当前客户"
])
{
MyclientEntityModel
*
model
=
dict
[
@"model"
];
self
.
customerNameField
.
text
=
model
.
name
;
self
.
phoneNumberField
.
text
=
model
.
mobile
;
self
.
customerAddress
.
text
=
model
.
address
;
[
self
.
customerHeader
sd_setImageWithURL
:[
NSURL
URLWithString
:
model
.
picture
]
placeholderImage
:
TCImage
(
@"now"
)];
//保存客户信息
[
Shoppersmanager
manager
].
currentCustomer
=
YES
;
[
Customermanager
manager
].
customerID
=
model
.
fid
;
[
Customermanager
manager
].
customerName
=
model
.
name
;
[
Customermanager
manager
].
customerPhoneNumber
=
model
.
mobile
;
[
Customermanager
manager
].
companyName
=
model
.
address
;
[
Customermanager
manager
].
cutomerAddress
=
model
.
address
;
[
self
.
addpersonInformationButton
setTitle
:
@"退出当前客户"
forState
:
UIControlStateNormal
];
self
.
changePersonInformationButton
.
hidden
=
NO
;
[
self
SetupUserShoppingCarNumberRequest
];
[
self
SetupUserRequest
];
[
self
ChangeCustomerName
];
self
.
customerNameField
.
enabled
=
NO
;
self
.
customerAddress
.
enabled
=
NO
;
self
.
phoneNumberField
.
enabled
=
NO
;
self
.
companyNameField
.
enabled
=
NO
;
}
else
if
([
dict
[
@"title"
]
isEqualToString
:
@"退出当前客户"
])
{
[
self
ExitCurrentCustomer
];
}
}
#pragma mark -设置为当前客户回调2
-
(
void
)
SetCustomerButtonClick
:
(
NSInteger
)
index
;
{
...
...
@@ -265,6 +322,7 @@
self
.
customerNameField
.
text
=
model
.
name
;
self
.
phoneNumberField
.
text
=
model
.
mobile
;
self
.
customerAddress
.
text
=
model
.
address
;
[
self
.
customerHeader
sd_setImageWithURL
:[
NSURL
URLWithString
:
model
.
picture
]
placeholderImage
:
TCImage
(
@"now"
)];
//保存客户信息
[
Shoppersmanager
manager
].
currentCustomer
=
YES
;
[
Customermanager
manager
].
customerID
=
model
.
fid
;
...
...
@@ -327,33 +385,7 @@
if
([
sender
.
currentTitle
isEqualToString
:
@"退出当前客户"
])
{
self
.
customerNameField
.
text
=
nil
;
self
.
customerAddress
.
text
=
nil
;
self
.
phoneNumberField
.
text
=
nil
;
self
.
companyNameField
.
text
=
nil
;
self
.
customerNameField
.
enabled
=
YES
;
self
.
customerAddress
.
enabled
=
YES
;
self
.
phoneNumberField
.
enabled
=
YES
;
self
.
companyNameField
.
enabled
=
YES
;
self
.
changePersonInformationButton
.
hidden
=
YES
;
[
Shoppersmanager
manager
].
currentCustomer
=
NO
;
[
Customermanager
manager
].
customerID
=
nil
;
[
Customermanager
manager
].
customerName
=
nil
;
[
Customermanager
manager
].
customerPhoneNumber
=
nil
;
[
Customermanager
manager
].
companyName
=
nil
;
[
Customermanager
manager
].
cutomerAddress
=
nil
;
[
self
.
changePersonInformationButton
setTitle
:
@"更改客户信息"
forState
:
UIControlStateNormal
];
[
self
ChangeCustomerName
];
[
self
QueryShoppingCarNumber
];
//全部为为选中状态
for
(
InformationTableViewCell
*
cell
in
self
.
informationTableview
.
visibleCells
)
{
cell
.
setCurrentCustomer
.
selected
=
NO
;
}
for
(
MyclientEntityModel
*
model
in
self
.
CustomerresultArray
)
{
model
.
selectedState
=
NO
;
}
[
self
ExitCurrentCustomer
];
[
sender
setTitle
:
@"添加客户信息"
forState
:
UIControlStateNormal
];
return
;
}
...
...
@@ -361,6 +393,37 @@
}
#pragma mark -退出当前客户
-
(
void
)
ExitCurrentCustomer
{
self
.
customerNameField
.
text
=
nil
;
self
.
customerAddress
.
text
=
nil
;
self
.
phoneNumberField
.
text
=
nil
;
self
.
companyNameField
.
text
=
nil
;
self
.
customerNameField
.
enabled
=
YES
;
self
.
customerAddress
.
enabled
=
YES
;
self
.
phoneNumberField
.
enabled
=
YES
;
self
.
companyNameField
.
enabled
=
YES
;
self
.
changePersonInformationButton
.
hidden
=
YES
;
[
Shoppersmanager
manager
].
currentCustomer
=
NO
;
[
Customermanager
manager
].
customerID
=
nil
;
[
Customermanager
manager
].
customerName
=
nil
;
[
Customermanager
manager
].
customerPhoneNumber
=
nil
;
[
Customermanager
manager
].
companyName
=
nil
;
[
Customermanager
manager
].
cutomerAddress
=
nil
;
[
self
.
changePersonInformationButton
setTitle
:
@"更改客户信息"
forState
:
UIControlStateNormal
];
[
self
ChangeCustomerName
];
[
self
QueryShoppingCarNumber
];
//全部为为选中状态
for
(
InformationTableViewCell
*
cell
in
self
.
informationTableview
.
visibleCells
)
{
cell
.
setCurrentCustomer
.
selected
=
NO
;
}
for
(
MyclientEntityModel
*
model
in
self
.
CustomerresultArray
)
{
model
.
selectedState
=
NO
;
}
}
#pragma mark -添加客户信息请求 -新增、或者修改 ischange为真是新增
-
(
void
)
addCustomerInformation
:
(
BOOL
)
isChange
...
...
Lighting/Class/ClientdetailsViewController.h
View file @
2dd75e10
...
...
@@ -68,7 +68,7 @@
/**
* 设置当前客户
*/
@property
(
nonatomic
,
copy
)
void
(
^
CurrentUserBlock
)(
NSInteger
cellindex
);
@property
(
nonatomic
,
copy
)
void
(
^
CurrentUserBlock
)(
NSInteger
cellindex
,
NSString
*
title
);
/**
...
...
Lighting/Class/ClientdetailsViewController.m
View file @
2dd75e10
...
...
@@ -120,6 +120,9 @@
self
.
customerPhoneNumber
.
text
=
self
.
model
.
mobile
;
self
.
companyName
.
text
=
self
.
model
.
name
;
self
.
customerLocation
.
text
=
self
.
model
.
address
;
self
.
setupButton
.
selected
=
self
.
model
.
selectedState
;
[
self
.
setupButton
setTitle
:
self
.
model
.
selectedState
?
@"退出当前客户"
:
@"设为当前客户"
forState
:
UIControlStateNormal
];
}
...
...
@@ -296,6 +299,8 @@
[
self
CreateMBProgressHUDLoding
];
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@"
,
ServerAddress
,
@"/shopcart/query"
]
WithRequestType
:
0
WithParameter
:
shopCar
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
self
endRefreshingForTableView
:
self
.
ClientdetailsTableview
];
[
self
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
(
remove
)
{
[
self
.
shopResponseArray
removeAllObjects
];
...
...
@@ -370,7 +375,6 @@
}
WithFailureBlock
:^
(
id
error
)
{
[
self
RemoveMBProgressHUDLoding
];
}];
}
...
...
@@ -384,10 +388,14 @@
#pragma mark -设为当前的客户
-
(
IBAction
)
SetupcurrentUserButtonClick
:
(
UIButton
*
)
sender
{
if
(
self
.
CurrentUserBlock
)
{
self
.
CurrentUserBlock
(
_cellindex
);
self
.
CurrentUserBlock
(
_cellindex
,
sender
.
currentTitle
);
}
[
sender
setTitle
:
sender
.
selected
?
@"设为当前客户"
:
@"退出当前客户"
forState
:
UIControlStateNormal
];
sender
.
selected
=
!
sender
.
selected
;
}
...
...
@@ -399,12 +407,7 @@
sender
.
selected
=
YES
;
self
.
orderRecordButton
.
selected
=
NO
;
self
.
orderRecordButton
.
backgroundColor
=
kMainBlueColor
;
// if (self.shopResponseArray.count == 0) {
// [self PromptinformationViewWithimage:TCImage(@"ablum-副本") withTitle:@"暂无购物袋信息~" withpoint:CGPointMake(ScreenHeight/2, ScreenWidth/2)];
// }else
// {
// [self RemovePromptinformationView];
// }
[
self
RemovePromptinformationView
];
[
self
.
ClientdetailsTableview
.
mj_header
beginRefreshing
];
}
...
...
@@ -417,12 +420,7 @@
sender
.
selected
=
YES
;
self
.
shoppingBagButton
.
selected
=
NO
;
self
.
shoppingBagButton
.
backgroundColor
=
kMainBlueColor
;
// if (self.orderRecordArray.count == 0) {
// [self PromptinformationViewWithimage:TCImage(@"changjingtubiao") withTitle:@"暂无购单订单~" withpoint:CGPointMake(ScreenHeight/2, ScreenWidth/2)];
// }else
// {
// [self RemovePromptinformationView];
// }
[
self
RemovePromptinformationView
];
[
self
.
ClientdetailsTableview
.
mj_header
beginRefreshing
];
}
...
...
Lighting/Class/CommodityListTableViewCell.m
View file @
2dd75e10
...
...
@@ -19,7 +19,8 @@
-
(
void
)
setModel
:
(
ShopcarModel
*
)
model
{
_model
=
model
;
[
self
.
goodsHeader
sd_setImageWithURL
:[
NSURL
URLWithString
:
_model
.
goods
.
pictures
]
placeholderImage
:
REPLACEIMAGE
];
NSArray
*
images
=
[
_model
.
goods
.
pictures
componentsSeparatedByString
:
@","
];
[
self
.
goodsHeader
sd_setImageWithURL
:[
NSURL
URLWithString
:[
images
firstObject
]]
placeholderImage
:
REPLACEIMAGE
];
self
.
goodsName
.
text
=
_model
.
goods
.
name
;
self
.
specifications
.
text
=
_model
.
goods
.
size
;
self
.
goodsCode
.
text
=
_model
.
goods
.
code
;
...
...
Lighting/Class/InformationTableViewCell.m
View file @
2dd75e10
...
...
@@ -20,6 +20,7 @@
-
(
void
)
setModel
:
(
MyclientEntityModel
*
)
model
{
_model
=
model
;
// NSLog(@"%@",[NSURL URLWithString:_model.picture]);
[
self
.
personHeader
sd_setImageWithURL
:[
NSURL
URLWithString
:
_model
.
picture
]
placeholderImage
:
ReplaceImage
];
self
.
personName
.
text
=
_model
.
name
;
self
.
personPhoneNumber
.
text
=
_model
.
mobile
;
...
...
@@ -31,9 +32,6 @@
#pragma mark -设为当前用户
-
(
IBAction
)
SelectedButtonClick
:
(
UIButton
*
)
sender
{
...
...
Lighting/Class/OrderdetailsViewController.m
View file @
2dd75e10
...
...
@@ -37,7 +37,26 @@
@implementation
OrderdetailsViewController
#pragma mark -渲染完成
-
(
void
)
viewDidAppear
:(
BOOL
)
animated
{
[
super
viewDidAppear
:
animated
];
// 禁用 iOS7 返回手势
if
([
self
.
navigationController
respondsToSelector
:
@selector
(
interactivePopGestureRecognizer
)])
{
self
.
navigationController
.
interactivePopGestureRecognizer
.
enabled
=
NO
;
}
}
#pragma mark -视图即将消失
-
(
void
)
viewWillDisappear
:(
BOOL
)
animated
{
[
super
viewWillDisappear
:
animated
];
// 开启
if
([
self
.
navigationController
respondsToSelector
:
@selector
(
interactivePopGestureRecognizer
)])
{
self
.
navigationController
.
interactivePopGestureRecognizer
.
enabled
=
YES
;
}
}
-
(
void
)
viewDidLoad
{
...
...
@@ -60,6 +79,7 @@
//附加信息cell
[
self
.
orderDetailsTableview
registerNib
:[
UINib
nibWithNibName
:
@"AdditionalTableViewCell"
bundle
:
nil
]
forCellReuseIdentifier
:
@"fifthcell"
];
if
(
self
.
isShowPayButton
)
{
[
self
CreateTableviewFooterView
];
}
}
...
...
@@ -76,6 +96,10 @@
self
.
orderDetails
=
[[
OrderBill
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
[
self
.
orderDetailsTableview
reloadData
];
//默认弹出支付框
if
(
self
.
isShowPayButton
&&
[
self
.
orderDetails
.
order
.
orderState
isEqualToString
:
@"001"
])
{
[
self
PayButtonClick
];
}
}
else
{
...
...
Lighting/Class/SettlementViewController.m
View file @
2dd75e10
...
...
@@ -9,7 +9,7 @@
#import "SettlementViewController.h"
@interface
SettlementViewController
()
<
ReturnTableviewcellIndexpathdelegate
>
@interface
SettlementViewController
()
<
ReturnTableviewcellIndexpathdelegate
,
UITextFieldDelegate
>
/**
* 支付宝二维码
...
...
@@ -62,7 +62,8 @@
self
.
cancelButton
.
layer
.
cornerRadius
=
kCornerRadius
;
self
.
sureButton
.
layer
.
masksToBounds
=
YES
;
self
.
sureButton
.
layer
.
cornerRadius
=
kCornerRadius
;
self
.
myScrollView
.
contentSize
=
CGSizeMake
(
0
,
self
.
view
.
frame
.
size
.
height
+
100
);
self
.
myScrollView
.
contentSize
=
CGSizeMake
(
0
,
self
.
view
.
frame
.
size
.
height
);
self
.
invoiceHeader
.
delegate
=
self
;
}
...
...
@@ -180,6 +181,10 @@
#pragma mark -发票类型
-
(
IBAction
)
invoiceTypeButtonClick
:
(
UIButton
*
)
sender
{
if
([
self
.
ISinvoiceButton
.
currentTitle
isEqualToString
:
@"否"
])
{
[
self
ErrorMBProgressView
:
@"请选择开票"
];
return
;
}
NSArray
*
arr
=
@[
@"个人发票"
,
@"公司发票"
];
[
self
ShowPopoverViewController
:
CGSizeMake
(
100
,
150
)
Withdatas
:
arr
ShowButton
:
sender
SelectedIndex
:
2
GetTitle
:
YES
];
}
...
...
@@ -337,6 +342,23 @@
}
#pragma mark -开始编辑
-
(
BOOL
)
textFieldShouldBeginEditing
:
(
UITextField
*
)
textField
{
if
([
self
.
ISinvoiceButton
.
currentTitle
isEqualToString
:
@"否"
])
{
[
self
ErrorMBProgressView
:
@"请选择开票"
];
return
NO
;
}
return
YES
;
}
#pragma mark -结束编辑
-
(
void
)
textFieldDidEndEditing
:
(
UITextField
*
)
textField
{
self
.
myScrollView
.
contentOffset
=
CGPointMake
(
0
,
0
);
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
...
...
Lighting/Class/SettlementViewController.xib
View file @
2dd75e10
...
...
@@ -103,7 +103,7 @@
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"12"
/>
<inset
key=
"titleEdgeInsets"
minX=
"-50"
minY=
"0.0"
maxX=
"86"
maxY=
"0.0"
/>
<inset
key=
"imageEdgeInsets"
minX=
"120"
minY=
"6"
maxX=
"0.0"
maxY=
"5"
/>
<state
key=
"normal"
title=
"
是
"
image=
"down_arr"
>
<state
key=
"normal"
title=
"
否
"
image=
"down_arr"
>
<color
key=
"titleColor"
white=
"0.66666666666666663"
alpha=
"1"
colorSpace=
"calibratedWhite"
/>
</state>
<connections>
...
...
Lighting/Class/Shoppingcart/GenerateOrdersViewController.m
View file @
2dd75e10
...
...
@@ -67,6 +67,26 @@
}
#pragma mark -渲染完成
-
(
void
)
viewDidAppear
:
(
BOOL
)
animated
{
[
super
viewDidAppear
:
animated
];
// 禁用 iOS7 返回手势
if
([
self
.
navigationController
respondsToSelector
:
@selector
(
interactivePopGestureRecognizer
)])
{
self
.
navigationController
.
interactivePopGestureRecognizer
.
enabled
=
NO
;
}
}
#pragma mark -视图即将消失
-
(
void
)
viewWillDisappear
:
(
BOOL
)
animated
{
[
super
viewWillDisappear
:
animated
];
// 开启
if
([
self
.
navigationController
respondsToSelector
:
@selector
(
interactivePopGestureRecognizer
)])
{
self
.
navigationController
.
interactivePopGestureRecognizer
.
enabled
=
YES
;
}
}
-
(
void
)
viewDidLoad
{
[
super
viewDidLoad
];
...
...
Lighting/Class/Shoppingcart/ShoppingTableViewCell.m
View file @
2dd75e10
...
...
@@ -31,14 +31,15 @@
{
_model
=
model
;
self
.
selectedButton
.
selected
=
_model
.
isSelected
;
[
self
.
goodsImageView
sd_setImageWithURL
:[
NSURL
URLWithString
:
_model
.
goods
.
pictures
]
placeholderImage
:
REPLACEIMAGE
];
NSArray
*
images
=
[
_model
.
goods
.
pictures
componentsSeparatedByString
:
@","
];
[
self
.
goodsImageView
sd_setImageWithURL
:[
NSURL
URLWithString
:[
images
firstObject
]]
placeholderImage
:
REPLACEIMAGE
];
self
.
goodsInformationLabe
.
text
=
_model
.
goods
.
name
;
self
.
specifications
.
text
=
_model
.
goods
.
size
;
self
.
goodsCode
.
text
=
_model
.
goods
.
code
;
self
.
tagsPriceLabe
.
text
=
[
_model
.
goods
.
tagPrice
stringValue
];
self
.
clinchTextfield
.
text
=
[
_model
.
goods
.
costPrice
stringValue
];
self
.
clinchTextfield
.
text
=
[
_model
.
costPrice
stringValue
];
self
.
goodsNumbersLabe
.
text
=
[
NSString
stringWithFormat
:
@"%d"
,
_model
.
goodsNum
];
self
.
productPriceLabe
.
text
=
[
NSString
stringWithFormat
:
@"¥%.2f"
,[
self
.
goodsNumbersLabe
.
text
floatValue
]
*
[
_model
.
goods
.
costPrice
floatValue
]];;
self
.
productPriceLabe
.
text
=
[
NSString
stringWithFormat
:
@"¥%.2f"
,[
self
.
goodsNumbersLabe
.
text
floatValue
]
*
[
_model
.
costPrice
floatValue
]];;
}
#pragma mark -增加或者减少商品
...
...
Lighting/Class/Shoppingcart/ShoppingViewController.m
View file @
2dd75e10
...
...
@@ -137,6 +137,7 @@
model
.
goodsId
=
objc
.
goodsId
;
model
.
goodsNum
=
objc
.
goodsNum
;
model
.
consumerId
=
objc
.
consumerId
;
model
.
costPrice
=
objc
.
costPrice
;
[
self
.
shopResponseArray
addObject
:
model
];
}
[
self
.
shoppingTableview
reloadData
];
...
...
@@ -170,7 +171,7 @@
}];
//提示框回调
[
cell
setPromptStringBlock
:
^
(
NSString
*
string
)
{
[
weakSelf
promptCustomerWithString
:
@"格式不正确"
];
[
weakSelf
promptCustomerWithString
:
string
];
}];
return
cell
;
}
...
...
@@ -318,7 +319,7 @@
CGFloat
allPrice
=
0
;
for
(
ShopcarModel
*
model
in
self
.
shopResponseArray
)
{
if
(
model
.
isSelected
)
{
allPrice
+=
[
model
.
goods
.
costPrice
floatValue
]
*
model
.
goodsNum
;
allPrice
+=
[
model
.
costPrice
floatValue
]
*
model
.
goodsNum
;
}
}
self
.
totalpriceLabe
.
text
=
[
NSString
stringWithFormat
:
@"¥%.2f"
,
allPrice
];
...
...
@@ -423,6 +424,7 @@
NSLog
(
@"%@"
,
error
);
NSLog
(
@"写入服务器失败"
);
}];
[
self
QueryShoppingCarNumber
];
}
...
...
Lighting/Lighting/StoryboardwithCYX.storyboard
View file @
2dd75e10
...
...
@@ -278,6 +278,7 @@
<outlet
property=
"companyNameField"
destination=
"TV1-T3-a8p"
id=
"DiF-es-3b0"
/>
<outlet
property=
"customerAddress"
destination=
"0QQ-Iv-hqR"
id=
"680-hg-muu"
/>
<outlet
property=
"customerAddressBack"
destination=
"hSf-Si-HDP"
id=
"ghx-dx-uv1"
/>
<outlet
property=
"customerHeader"
destination=
"3z6-rk-Y7U"
id=
"bkz-Yd-2ca"
/>
<outlet
property=
"customerNameBack"
destination=
"KTx-r1-Mah"
id=
"s1G-Vo-6lt"
/>
<outlet
property=
"customerNameField"
destination=
"RkM-wZ-Ve3"
id=
"eqI-Bh-eyW"
/>
<outlet
property=
"informationTableview"
destination=
"hkO-uH-vEN"
id=
"DR3-d3-WXe"
/>
...
...
@@ -327,10 +328,11 @@
<color
key=
"textColor"
red=
"0.0"
green=
"0.0"
blue=
"0.0"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<nil
key=
"highlightedColor"
/>
</label>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
buttonType=
"roundedRect"
lineBreakMode=
"middleTruncation"
id=
"qXu-CL-F1I"
>
<button
opaque=
"NO"
contentMode=
"scaleToFill"
contentHorizontalAlignment=
"center"
contentVerticalAlignment=
"center"
lineBreakMode=
"middleTruncation"
id=
"qXu-CL-F1I"
>
<rect
key=
"frame"
x=
"520"
y=
"68"
width=
"162"
height=
"30"
/>
<autoresizingMask
key=
"autoresizingMask"
flexibleMinX=
"YES"
flexibleMaxX=
"YES"
flexibleMaxY=
"YES"
/>
<color
key=
"backgroundColor"
red=
"0.34901960780000002"
green=
"0.67450980390000004"
blue=
"0.86274509799999999"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<fontDescription
key=
"fontDescription"
type=
"system"
pointSize=
"16"
/>
<state
key=
"normal"
title=
"设为当前客户"
>
<color
key=
"titleColor"
white=
"1"
alpha=
"1"
colorSpace=
"calibratedWhite"
/>
</state>
...
...
@@ -1179,7 +1181,7 @@
</collectionViewFlowLayout>
<cells>
<collectionViewCell
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
reuseIdentifier=
"productcell"
id=
"J5m-0M-uqb"
customClass=
"ProductCollectionViewCell"
>
<rect
key=
"frame"
x=
"0.0"
y=
"
64
"
width=
"300"
height=
"300"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"
0.0
"
width=
"300"
height=
"300"
/>
<autoresizingMask
key=
"autoresizingMask"
flexibleMaxX=
"YES"
flexibleMaxY=
"YES"
/>
<view
key=
"contentView"
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"300"
height=
"300"
/>
...
...
@@ -1261,7 +1263,7 @@
<color
key=
"backgroundColor"
red=
"0.93725490199999995"
green=
"0.93725490199999995"
blue=
"0.95686274510000002"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<prototypes>
<tableViewCell
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
selectionStyle=
"default"
indentationWidth=
"10"
reuseIdentifier=
"productDetailscell"
rowHeight=
"170"
id=
"Sye-2R-IQf"
customClass=
"ProductDetailsTableViewCell"
>
<rect
key=
"frame"
x=
"0.0"
y=
"
113
.5"
width=
"768"
height=
"170"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"
49
.5"
width=
"768"
height=
"170"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<tableViewCellContentView
key=
"contentView"
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
tableViewCell=
"Sye-2R-IQf"
id=
"CXs-SR-gHP"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"768"
height=
"169.5"
/>
...
...
Lighting/Tools/BaseViewController.m
View file @
2dd75e10
...
...
@@ -133,19 +133,29 @@
#pragma mark -显示错误的提示框
-
(
void
)
ErrorMBProgressView
:
(
NSString
*
)
errorString
{
MBProgressHUD
*
hud
=
[
MBProgressHUD
showHUDAddedTo
:
self
.
view
.
window
animated
:
YES
];
// Set the custom view mode to show any view.
hud
.
mode
=
MBProgressHUDModeCustomView
;
// Set an image view with a checkmark.
UIImage
*
image
=
[[
UIImage
imageNamed
:
@"Error"
]
imageWithRenderingMode
:
UIImageRenderingModeAlwaysTemplate
];
hud
.
customView
=
[[
UIImageView
alloc
]
initWithImage
:
image
];
// Looks a bit nicer if we make it square.
hud
.
square
=
YES
;
// Optional label text.
hud
.
activityIndicatorColor
=
kMainBlueColor
;
hud
.
labelFont
=
[
UIFont
systemFontOfSize
:
12
];
// MBProgressHUD *hud = [MBProgressHUD showHUDAddedTo:self.view.window animated:YES];
// // Set the custom view mode to show any view.
// hud.mode = MBProgressHUDModeText;
// // Set an image view with a checkmark.
//// UIImage *image = [[UIImage imageNamed:@"Error"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
//// hud.customView = [[UIImageView alloc] initWithImage:image];
// // Looks a bit nicer if we make it square.
//// hud.square = YES;
// // Optional label text.
//// hud.activityIndicatorColor = kMainBlueColor;
// hud.labelFont = [UIFont systemFontOfSize:12];
// hud.labelText = errorString;
// [hud hide:YES afterDelay:1];
MBProgressHUD
*
hud
=
[
MBProgressHUD
showHUDAddedTo
:
self
.
view
animated
:
YES
];
hud
.
labelText
=
errorString
;
[
hud
hide
:
YES
afterDelay
:
1
];
hud
.
margin
=
10
.
f
;
hud
.
color
=
[[
UIColor
blackColor
]
colorWithAlphaComponent
:
0
.
5
];
hud
.
minSize
=
CGSizeMake
(
200
,
50
);
hud
.
animationType
=
MBProgressHUDAnimationZoom
;
hud
.
mode
=
MBProgressHUDModeText
;
hud
.
removeFromSuperViewOnHide
=
YES
;
[
hud
hide
:
YES
afterDelay
:
1
.
0
f
];
}
...
...
@@ -156,6 +166,8 @@
MBProgressHUD
*
hud
=
[
MBProgressHUD
showHUDAddedTo
:
self
.
view
animated
:
YES
];
hud
.
labelText
=
Text
;
hud
.
margin
=
10
.
f
;
hud
.
color
=
[[
UIColor
blackColor
]
colorWithAlphaComponent
:
0
.
5
];
hud
.
minSize
=
CGSizeMake
(
200
,
50
);
hud
.
animationType
=
MBProgressHUDAnimationZoom
;
hud
.
mode
=
MBProgressHUDModeText
;
hud
.
removeFromSuperViewOnHide
=
YES
;
...
...
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