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
7ff09212
Commit
7ff09212
authored
May 17, 2016
by
勾芒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
曹云霄
parent
45ca044b
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
286 additions
and
99 deletions
+286
-99
CustomerOrderViewController.h
Lighting/Class/CustomerOrderViewController.h
+12
-2
CustomerOrderViewController.m
Lighting/Class/CustomerOrderViewController.m
+56
-0
OrderdetailsViewController.m
Lighting/Class/OrderdetailsViewController.m
+1
-0
SettlementViewController.h
Lighting/Class/SettlementViewController.h
+4
-1
SettlementViewController.m
Lighting/Class/SettlementViewController.m
+41
-1
GenerateOrdersViewController.m
Lighting/Class/Shoppingcart/GenerateOrdersViewController.m
+58
-36
ShoppingViewController.m
Lighting/Class/Shoppingcart/ShoppingViewController.m
+55
-4
StoryboardwithCYX.storyboard
Lighting/Lighting/StoryboardwithCYX.storyboard
+50
-54
PopoverViewController.m
Lighting/Tools/PopoverViewController.m
+1
-0
opple_objc_json_client.h
Lighting/Tools/opple_objc_json_client.h
+7
-1
opple_objc_json_client.m
Lighting/Tools/opple_objc_json_client.m
+1
-0
No files found.
Lighting/Class/CustomerOrderViewController.h
View file @
7ff09212
...
...
@@ -7,6 +7,8 @@
//
#import "BaseViewController.h"
#import "screeningButton.h"
@interface
CustomerOrderViewController
:
BaseViewController
...
...
@@ -23,9 +25,17 @@
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UITextField
*
searchCustomerOrder
;
/**
* 订单状态排序背景
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UIView
*
orderStateBackView
;
/**
* 订单状态
排序
* 订单状态
按钮
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UIButton
*
orderStat
eButton
;
@property
(
strong
,
nonatomic
)
screeningButton
*
Styl
eButton
;
@end
Lighting/Class/CustomerOrderViewController.m
View file @
7ff09212
...
...
@@ -19,6 +19,7 @@
[
super
viewDidLoad
];
// Do any additional setup after loading the view.
[
self
uiConfigAction
];
[
self
getGuideAllcustomerOrder
];
}
...
...
@@ -28,6 +29,61 @@
self
.
customerOrderTableView
.
dataSource
=
self
;
self
.
customerOrderTableView
.
delegate
=
self
;
self
.
StyleButton
=
[
screeningButton
buttonWithType
:
UIButtonTypeCustom
];
self
.
StyleButton
.
frame
=
CGRectMake
(
ScreenWidth
-
250
,
20
,
150
,
30
);
self
.
StyleButton
.
backgroundColor
=
kTCColor
(
131
,
131
,
131
);
[
self
.
StyleButton
setTitle
:
@"订单状态"
forState
:
UIControlStateNormal
];
[
self
.
StyleButton
addTarget
:
self
action
:
@selector
(
screeningStyleButtonClick
:
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
self
.
StyleButton
setImage
:
TCImage
(
@"down_arr"
)
forState
:
UIControlStateNormal
];
self
.
StyleButton
.
layer
.
masksToBounds
=
YES
;
self
.
StyleButton
.
layer
.
cornerRadius
=
10
;
[
self
.
orderStateBackView
addSubview
:
self
.
StyleButton
];
}
#pragma mark -获取导购下客户订单
-
(
void
)
getGuideAllcustomerOrder
{
OrderBill
*
allOrder
=
[[
OrderBill
alloc
]
init
];
//分页
DataPage
*
page
=
[[
DataPage
alloc
]
init
];
page
=
0
;
//订单
TOOrderEntity
*
order
=
[[
TOOrderEntity
alloc
]
init
];
order
.
guideId
=
[
Shoppersmanager
manager
].
guideid
;
allOrder
.
datapage
=
page
;
allOrder
.
order
=
order
;
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@"
,
ServerAddress
,
@"/order/query"
]
WithRequestType
:
0
WithParameter
:
allOrder
WithReturnValueBlock
:^
(
id
returnValue
)
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
NSLog
(
@"%@"
,
returnValue
);
}
else
{
[
self
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithFailureBlock
:^
(
id
error
)
{
NSLog
(
@"%@"
,
error
);
}];
}
#pragma mark -订单状态筛选
-
(
void
)
screeningStyleButtonClick
:
(
UIButton
*
)
button
{
}
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
...
...
Lighting/Class/OrderdetailsViewController.m
View file @
7ff09212
...
...
@@ -153,6 +153,7 @@
SettlementViewController
*
settlement
=
[[
SettlementViewController
alloc
]
init
];
settlement
.
preferredContentSize
=
CGSizeMake
(
380
,
500
);
settlement
.
goodsArray
=
self
.
orderDetails
.
orderdetailList
;
settlement
.
orderCode
=
_orderCode
;
settlement
.
modalPresentationStyle
=
UIModalPresentationFormSheet
;
UIPopoverPresentationController
*
pop
=
settlement
.
popoverPresentationController
;
pop
.
sourceView
=
settlement
.
view
;
...
...
Lighting/Class/SettlementViewController.h
View file @
7ff09212
...
...
@@ -103,7 +103,10 @@
@property
(
weak
,
nonatomic
)
IBOutlet
UIButton
*
sureButton
;
/**
* 订单编号
*/
@property
(
nonatomic
,
copy
)
NSString
*
orderCode
;
...
...
Lighting/Class/SettlementViewController.m
View file @
7ff09212
...
...
@@ -83,7 +83,7 @@
-
(
IBAction
)
SureButtonClick
:
(
UIButton
*
)
sender
{
[
self
SurePayRequest
];
}
#pragma amrk -支付方式选择
...
...
@@ -96,11 +96,17 @@
#pragma mark -是否开票
-
(
IBAction
)
isinvoiceButtonClick
:
(
UIButton
*
)
sender
{
NSArray
*
arr
=
@[
@"是"
,
@"否"
];
[
self
ShowPopoverViewController
:
CGSizeMake
(
50
,
150
)
Withdatas
:
arr
ShowButton
:
sender
SelectedIndex
:
1
GetTitle
:
YES
];
}
#pragma mark -发票类型
-
(
IBAction
)
invoiceTypeButtonClick
:
(
UIButton
*
)
sender
{
NSArray
*
arr
=
@[
@"个人发票"
,
@"公司发票"
];
[
self
ShowPopoverViewController
:
CGSizeMake
(
100
,
150
)
Withdatas
:
arr
ShowButton
:
sender
SelectedIndex
:
2
GetTitle
:
YES
];
}
...
...
@@ -133,6 +139,7 @@
*/
-
(
void
)
returnCellindexpathwithrow
:
(
NSString
*
)
Type
WithcellTitle
:
(
NSString
*
)
title
Withselected
:
(
NSInteger
)
Selected
{
[
self
dismissViewControllerAnimated
:
YES
completion
:
nil
];
switch
(
Selected
)
{
case
0
:
//支付方式
{
...
...
@@ -155,6 +162,39 @@
}
}
#pragma mark -确认支付请求
-
(
void
)
SurePayRequest
{
NSString
*
string
=
[
NSString
stringWithFormat
:
@"%@%@%@/%@/%@/%@/%@"
,
ServerAddress
,
@"/order/payOrder/"
,
_orderCode
,[
self
ReturnUrlString
:
self
.
payTypeButton
.
currentTitle
],[
self
ReturnUrlString
:
self
.
ISinvoiceButton
.
currentTitle
],[
self
ReturnUrlString
:
self
.
invoiceType
.
currentTitle
],[
self
ReturnUrlString
:
self
.
invoiceHeader
.
text
]];
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:
string
WithRequestType
:
1
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
NSLog
(
@"%@"
,
returnValue
);
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithFailureBlock
:^
(
id
error
)
{
NSLog
(
@"%@"
,
error
);
}];
}
#pragma mark -汉字转码
-
(
NSString
*
)
ReturnUrlString
:
(
NSString
*
)
ChineseString
{
NSString
*
encodedString
=
[
ChineseString
stringByAddingPercentEncodingWithAllowedCharacters
:[
NSCharacterSet
URLQueryAllowedCharacterSet
]];
return
encodedString
;
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
...
...
Lighting/Class/Shoppingcart/GenerateOrdersViewController.m
View file @
7ff09212
...
...
@@ -54,8 +54,10 @@
Customermanager
*
customerModel
=
[
Customermanager
manager
];
[[
_datasArray
firstObject
]
addObject
:
customerModel
];
AddressModel
*
model
=
[[
AddressModel
alloc
]
init
];
model
.
name
=
@"地址占位"
;
//地址占位
[[
_datasArray
objectAtIndex_opple
:
1
]
addObject
:
@"地址占位"
];
[[
_datasArray
objectAtIndex_opple
:
1
]
addObject
:
model
];
//加入商品信息
[
_datasArray
replaceObjectAtIndex
:
2
withObject
:
_settlementGoodsdatas
];
...
...
@@ -355,49 +357,69 @@
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
:
@"未选中地址"
];
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
;
orderGoods
.
goodsCover
=
model
.
goods
.
pictures
;
orderGoods
.
goodsCode
=
model
.
goods
.
code
;
orderGoods
.
goodsSpec
=
model
.
goods
.
spec
;
orderGoods
.
goodsName
=
model
.
goods
.
name
;
orderGoods
.
goodsBrand
=
model
.
goods
.
brandId
;
orderGoods
.
goodsNum
=
model
.
goods
.
number
;
orderGoods
.
goodsPrice
=
model
.
goods
.
costPrice
;
// orderGoods.goodsUnit = model.goods.unit;
// @synthesize goodsId;
// @synthesize goodsCode;
// @synthesize goodsName;
// @synthesize goodsCover;
// @synthesize goodsSpec;
// @synthesize goodsBrand;
// @synthesize goodsNum;
// @synthesize goodsPrice;
// @synthesize goodsTotalPrice;
[
goodidArr
addObject
:
orderGoods
];
}
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
)
{
[
self
RemoveMBProgressHUDLoding
];
}];
return
;
}
else
if
(
i
==
Adressarr
.
count
-
1
)
{
[
self
ErrorMBProgressView
:
@"未选中地址"
];
}
}
}
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
;
[
goodidArr
addObject
:
orderGoods
];
}
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
)
{
[
self
RemoveMBProgressHUDLoding
];
}];
}
...
...
Lighting/Class/Shoppingcart/ShoppingViewController.m
View file @
7ff09212
...
...
@@ -77,8 +77,10 @@
#pragma mark - UI
-
(
void
)
uiConfigAction
{
self
.
view
.
backgroundColor
=
kTCColor
(
238
,
238
,
238
);
self
.
shoppingTableview
.
dataSource
=
self
;
self
.
shoppingTableview
.
delegate
=
self
;
self
.
shoppingTableview
.
backgroundColor
=
[
UIColor
clearColor
];
self
.
shoppingTableview
.
tableFooterView
=
[
UIView
new
];
}
...
...
@@ -166,11 +168,19 @@
}
#pragma mark -
设置为当前客户
回调
#pragma mark -
选中商品
回调
-
(
void
)
setSelectedButton
:
(
NSInteger
)
index
;
{
ShopcarModel
*
model
=
[
self
.
shopResponseArray
objectAtIndex_opple
:
index
];
model
.
isSelected
=
!
model
.
isSelected
;
NSInteger
goodsNumber
=
0
;
for
(
ShopcarModel
*
model
in
self
.
shopResponseArray
)
{
if
(
model
.
isSelected
)
{
goodsNumber
++
;
}
}
[
self
.
settlementButton
setTitle
:[
NSString
stringWithFormat
:
@"去结算(%ld)"
,
goodsNumber
]
forState
:
UIControlStateNormal
];
}
...
...
@@ -230,18 +240,59 @@
#pragma mark -删除选中商品
-
(
IBAction
)
delecteSelectedGoods
:
(
UIButton
*
)
sender
{
//需要删除的cell数组
[
self
CreateMBProgressHUDLoding
];
DeleteCartRequest
*
delecteGoods
=
[[
DeleteCartRequest
alloc
]
init
];
//code数组
NSMutableArray
*
codeArr
=
[
NSMutableArray
array
];
//需要删除的cell数组indexpath
NSMutableArray
*
delecteArray
=
[
NSMutableArray
array
];
//模型数组
NSMutableArray
*
delectemodel
=
[
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
];
[
codeArr
addObject
:
model
.
fid
];
[
delectemodel
addObject
:
model
];
NSIndexPath
*
indexpath
=
[
NSIndexPath
indexPathForRow
:
i
inSection
:
0
];
[
delecteArray
addObject
:
indexpath
];
}
}
[
self
.
shoppingTableview
deleteRowsAtIndexPaths
:
delecteArray
withRowAnimation
:
UITableViewRowAnimationLeft
];
//没有选中任何商品
if
(
codeArr
.
count
==
0
)
{
[
self
RemoveMBProgressHUDLoding
];
return
;
}
delecteGoods
.
cartIds
=
codeArr
;
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@"
,
ServerAddress
,
@"/shopcart/delete"
]
WithRequestType
:
0
WithParameter
:
delecteGoods
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
self
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
//删除商品
for
(
ShopcarModel
*
model
in
delectemodel
)
{
[
self
.
shopResponseArray
removeObject
:
model
];
}
[
self
.
shoppingTableview
deleteRowsAtIndexPaths
:
delecteArray
withRowAnimation
:
UITableViewRowAnimationLeft
];
[
self
SuccessMBProgressView
:
@"删除成功"
];
}
else
{
[
self
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithFailureBlock
:^
(
id
error
)
{
[
self
RemoveMBProgressHUDLoding
];
}];
}
...
...
Lighting/Lighting/StoryboardwithCYX.storyboard
View file @
7ff09212
This diff is collapsed.
Click to expand it.
Lighting/Tools/PopoverViewController.m
View file @
7ff09212
...
...
@@ -29,6 +29,7 @@
self
.
popoverTableView
=
[[
UITableView
alloc
]
initWithFrame
:
CGRectMake
(
0
,
0
,
self
.
contentSize
.
width
,
self
.
contentSize
.
height
)
style
:
UITableViewStylePlain
];
self
.
popoverTableView
.
dataSource
=
self
;
self
.
popoverTableView
.
delegate
=
self
;
self
.
popoverTableView
.
showsVerticalScrollIndicator
=
NO
;
self
.
popoverTableView
.
tableFooterView
=
[
UIView
new
];
[
self
.
view
addSubview
:
self
.
popoverTableView
];
self
.
popoverTableView
.
separatorStyle
=
UITableViewCellSeparatorStyleNone
;
...
...
Lighting/Tools/opple_objc_json_client.h
View file @
7ff09212
...
...
@@ -957,7 +957,7 @@ extern NSString * const SORTDIRECTION_DESC;
*/
@property
(
nonatomic
,
strong
)
TOGoodsEntity
*
goods
;
/**
*
��
法: 取得java.lang.String
*
方
法: 取得java.lang.String
*
*
*/
...
...
@@ -1022,6 +1022,12 @@ extern NSString * const SORTDIRECTION_DESC;
*
*/
@property
(
nonatomic
,
copy
)
NSString
*
resellerId
;
/**
* 方法: 取得java.lang.String
*
*
*/
@property
(
nonatomic
,
strong
)
NSNumber
*
costPrice
;
@end
/* interface TOShopcartEntity */
#endif
...
...
Lighting/Tools/opple_objc_json_client.m
View file @
7ff09212
...
...
@@ -340,6 +340,7 @@
@synthesize
goodsNum
;
@synthesize
consumerId
;
@synthesize
resellerId
;
@synthesize
costPrice
;
+
(
BOOL
)
propertyIsOptional
:(
NSString
*
)
propertyName
{
...
...
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