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
853747a5
Commit
853747a5
authored
May 20, 2016
by
勾芒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
曹云霄
parent
62b1e46a
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
94 additions
and
38 deletions
+94
-38
ClientViewController.m
Lighting/Class/ClientViewController.m
+1
-11
OrderdetailsViewController.m
Lighting/Class/OrderdetailsViewController.m
+7
-5
GenerateOrdersViewController.h
Lighting/Class/Shoppingcart/GenerateOrdersViewController.h
+7
-0
GenerateOrdersViewController.m
Lighting/Class/Shoppingcart/GenerateOrdersViewController.m
+11
-4
ShoppingViewController.m
Lighting/Class/Shoppingcart/ShoppingViewController.m
+42
-1
StoryboardwithCYX.storyboard
Lighting/Lighting/StoryboardwithCYX.storyboard
+2
-13
BaseViewController.h
Lighting/Tools/BaseViewController.h
+4
-1
BaseViewController.m
Lighting/Tools/BaseViewController.m
+20
-3
No files found.
Lighting/Class/ClientViewController.m
View file @
853747a5
...
...
@@ -265,17 +265,7 @@
#pragma mark -设置为当前客户、查询购物车数量
-
(
void
)
SetupUserShoppingCarNumberRequest
{
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@%@"
,
ServerAddress
,
@"/shopcart/get/"
,[
Customermanager
manager
].
customerID
]
WithRequestType
:
1
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
REFRESHSHOPPINGCAR
object
:
returnValue
[
@"data"
]];
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithFailureBlock
:^
(
id
error
)
{
}];
[
self
QueryShoppingCarNumber
];
}
...
...
Lighting/Class/OrderdetailsViewController.m
View file @
853747a5
...
...
@@ -55,6 +55,9 @@
self
.
orderDetailsTableview
.
dataSource
=
self
;
self
.
orderDetailsTableview
.
delegate
=
self
;
// [self CreateTableviewHeaderView];
//附加信息cell
[
self
.
orderDetailsTableview
registerNib
:[
UINib
nibWithNibName
:
@"AdditionalTableViewCell"
bundle
:
nil
]
forCellReuseIdentifier
:
@"fifthcell"
];
[
self
CreateTableviewFooterView
];
}
...
...
@@ -123,11 +126,6 @@
lineView
.
backgroundColor
=
kTCColor
(
193
,
193
,
193
);
[
headerView
addSubview
:
lineView
];
//附加信息cell
[
self
.
orderDetailsTableview
registerNib
:[
UINib
nibWithNibName
:
@"AdditionalTableViewCell"
bundle
:
nil
]
forCellReuseIdentifier
:
@"fifthcell"
];
self
.
orderDetailsTableview
.
tableHeaderView
=
headerView
;
}
...
...
@@ -273,6 +271,10 @@
return
nil
;
}
-
(
CGFloat
)
tableView
:
(
UITableView
*
)
tableView
heightForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
switch
(
indexPath
.
section
)
{
...
...
Lighting/Class/Shoppingcart/GenerateOrdersViewController.h
View file @
853747a5
...
...
@@ -41,6 +41,13 @@
@property
(
nonatomic
,
strong
)
NSArray
*
settlementGoodsdatas
;
/**
* 清空已生成订单的商品 ,goodsCode表示选中商品购物车ID
*/
@property
(
nonatomic
,
copy
)
void
(
^
DelecteSelectedGoods
)(
NSArray
*
goodsCode
);
@end
Lighting/Class/Shoppingcart/GenerateOrdersViewController.m
View file @
853747a5
...
...
@@ -126,7 +126,7 @@
NSIndexPath
*
indexpath
=
[
NSIndexPath
indexPathForRow
:
i
inSection
:
1
];
[
addCellArray
addObject
:
indexpath
];
}
[
self
.
generateOrderTableview
insertRowsAtIndexPaths
:
addCellArray
withRowAnimation
:
UITableViewRowAnimation
Left
];
[
self
.
generateOrderTableview
insertRowsAtIndexPaths
:
addCellArray
withRowAnimation
:
UITableViewRowAnimation
Bottom
];
}
else
{
...
...
@@ -329,15 +329,12 @@
-
(
IBAction
)
CreateOrderButtonClick
:
(
UIButton
*
)
sender
{
OrderBill
*
order
=
[[
OrderBill
alloc
]
init
];
//分页
DataPage
*
page
=
[[
DataPage
alloc
]
init
];
page
.
page
=
0
;
order
.
datapage
=
page
;
//收货地址
TOOrderEntity
*
orderReceiver
=
[[
TOOrderEntity
alloc
]
init
];
NSArray
*
Adressarr
=
[
self
.
datasArray
objectAtIndex_opple
:
1
];
...
...
@@ -385,11 +382,21 @@
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@"
,
ServerAddress
,
@"/order/save"
]
WithRequestType
:
0
WithParameter
:
order
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
self
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
//商品购物车id
NSMutableArray
*
codeArrray
=
[
NSMutableArray
array
];
for
(
ShopcarModel
*
model
in
_settlementGoodsdatas
)
{
[
codeArrray
addObject
:
model
.
fid
?
model
.
fid
:
@" "
];
}
//调用删除购物车
if
(
self
.
DelecteSelectedGoods
)
{
self
.
DelecteSelectedGoods
(
codeArrray
);
}
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"
]];
...
...
Lighting/Class/Shoppingcart/ShoppingViewController.m
View file @
853747a5
...
...
@@ -153,6 +153,7 @@
-
(
UITableViewCell
*
)
tableView
:
(
UITableView
*
)
tableView
cellForRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
ShoppingTableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"Shopping"
forIndexPath
:
indexPath
];
...
...
@@ -228,6 +229,44 @@
[
array
addObject
:
ZhanweiModel
];
GenerateOrdersViewController
*
generateOrder
=
[[
self
getStoryboardWithName
]
instantiateViewControllerWithIdentifier
:
@"generateorders"
];
generateOrder
.
settlementGoodsdatas
=
array
;
//清除已经生成订单的商品
[
generateOrder
setDelecteSelectedGoods
:
^
(
NSArray
*
goodsCode
)
{
DeleteCartRequest
*
delecteGoods
=
[[
DeleteCartRequest
alloc
]
init
];
delecteGoods
.
cartIds
=
goodsCode
;
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@"
,
ServerAddress
,
@"/shopcart/delete"
]
WithRequestType
:
0
WithParameter
:
delecteGoods
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
self
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
[
self
QueryShoppingCarNumber
];
//商品cell
NSMutableArray
*
cellArray
=
[
NSMutableArray
array
];
//删除商品
for
(
int
i
=
0
;
i
<
self
.
shopResponseArray
.
count
;
i
++
)
{
ShopcarModel
*
model
=
[
self
.
shopResponseArray
objectAtIndex_opple
:
i
];
if
([
goodsCode
containsObject
:
model
.
fid
])
{
[
self
.
shopResponseArray
removeObject
:
model
];
NSIndexPath
*
indexpath
=
[
NSIndexPath
indexPathForRow
:
i
inSection
:
0
];
[
cellArray
addObject
:
indexpath
];
}
}
//删除cell
[
self
.
shoppingTableview
deleteRowsAtIndexPaths
:
cellArray
withRowAnimation
:
UITableViewRowAnimationTop
];
}
else
{
[
self
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithFailureBlock
:^
(
id
error
)
{
[
self
RemoveMBProgressHUDLoding
];
}];
}];
[
self
.
navigationController
pushViewController
:
generateOrder
animated
:
YES
];
}
...
...
@@ -311,6 +350,7 @@
[
self
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
[
self
QueryShoppingCarNumber
];
//删除商品
for
(
ShopcarModel
*
model
in
delectemodel
)
{
[
self
.
shopResponseArray
removeObject
:
model
];
...
...
@@ -335,6 +375,7 @@
}
#pragma mark -改变商品数量
-
(
void
)
ChangeGoodsNumber
:
(
int
)
goodsNumber
WithcostPrice
:
(
NSInteger
)
costprice
Withcellindex
:
(
NSInteger
)
cellindex
{
...
...
Lighting/Lighting/StoryboardwithCYX.storyboard
View file @
853747a5
This diff is collapsed.
Click to expand it.
Lighting/Tools/BaseViewController.h
View file @
853747a5
...
...
@@ -90,6 +90,9 @@
+
(
id
)
ReturnOrderStateTitleWithStateCode
:(
NSInteger
)
ordercode
withPoint
:(
CGPoint
)
point
WithCode
:(
NSInteger
)
code
;
/**
* 查询购物车数量
*/
-
(
void
)
QueryShoppingCarNumber
;
@end
Lighting/Tools/BaseViewController.m
View file @
853747a5
...
...
@@ -286,17 +286,17 @@
{
const
NSArray
*
imageArray
=
[
NSArray
arrayWithObjects
:
@"已撤销"
,
@"已完成"
,
@"已退货"
,
nil
];
switch
(
ordercode
)
{
case
00
4
:
//退货
case
4
:
//退货
{
return
TCImage
([
imageArray
objectAtIndex_opple
:
2
]);
}
break
;
case
00
5
:
//作废
case
5
:
//作废
{
return
TCImage
([
imageArray
objectAtIndex_opple
:
0
]);
}
break
;
case
00
6
:
//完成
case
6
:
//完成
{
return
TCImage
([
imageArray
objectAtIndex_opple
:
1
]);
}
...
...
@@ -374,6 +374,23 @@
return
nil
;
}
#pragma mark -查询购物车数量
-
(
void
)
QueryShoppingCarNumber
{
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@%@"
,
ServerAddress
,
@"/shopcart/get/"
,[
Customermanager
manager
].
customerID
]
WithRequestType
:
1
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
NSLog
(
@"更新购物车数量成功"
);
[[
NSNotificationCenter
defaultCenter
]
postNotificationName
:
REFRESHSHOPPINGCAR
object
:
returnValue
[
@"data"
]];
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithFailureBlock
:^
(
id
error
)
{
NSLog
(
@"更新购物车数量失败"
);
}];
}
...
...
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