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
913b4774
Commit
913b4774
authored
May 15, 2016
by
勾芒
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
caoyunxiao
parent
5eabfae2
Show whitespace changes
Inline
Side-by-side
Showing
18 changed files
with
404 additions
and
47 deletions
+404
-47
AllpriceTableViewCell.h
Lighting/Class/AllpriceTableViewCell.h
+5
-0
AllpriceTableViewCell.m
Lighting/Class/AllpriceTableViewCell.m
+20
-1
ClientViewController.m
Lighting/Class/ClientViewController.m
+2
-0
CommodityListTableViewCell.h
Lighting/Class/CommodityListTableViewCell.h
+3
-0
OrderdetailsViewController.m
Lighting/Class/OrderdetailsViewController.m
+14
-1
AddressModel.h
Lighting/Class/Shoppingcart/AddressModel.h
+21
-0
AddressModel.m
Lighting/Class/Shoppingcart/AddressModel.m
+13
-0
AddressViewController.h
Lighting/Class/Shoppingcart/AddressViewController.h
+24
-4
AddressViewController.m
Lighting/Class/Shoppingcart/AddressViewController.m
+91
-12
AddressViewController.xib
Lighting/Class/Shoppingcart/AddressViewController.xib
+1
-0
GenerateOrdersModifyTableViewCell.h
...ng/Class/Shoppingcart/GenerateOrdersModifyTableViewCell.h
+19
-0
GenerateOrdersModifyTableViewCell.m
...ng/Class/Shoppingcart/GenerateOrdersModifyTableViewCell.m
+20
-0
GenerateOrdersTableViewCell.h
Lighting/Class/Shoppingcart/GenerateOrdersTableViewCell.h
+15
-1
GenerateOrdersTableViewCell.m
Lighting/Class/Shoppingcart/GenerateOrdersTableViewCell.m
+9
-2
GenerateOrdersViewController.m
Lighting/Class/Shoppingcart/GenerateOrdersViewController.m
+121
-21
ShoppingViewController.m
Lighting/Class/Shoppingcart/ShoppingViewController.m
+3
-0
project.pbxproj
Lighting/Lighting.xcodeproj/project.pbxproj
+14
-0
StoryboardwithCYX.storyboard
Lighting/Lighting/StoryboardwithCYX.storyboard
+9
-5
No files found.
Lighting/Class/AllpriceTableViewCell.h
View file @
913b4774
...
...
@@ -23,4 +23,9 @@
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
goodsAllPrice
;
/**
* 商品总个数、总价格,数据源
*/
@property
(
nonatomic
,
strong
)
NSArray
*
goodsAllprice
;
@end
Lighting/Class/AllpriceTableViewCell.m
View file @
913b4774
...
...
@@ -7,7 +7,7 @@
//
#import "AllpriceTableViewCell.h"
#import "ShopcarModel.h"
@implementation
AllpriceTableViewCell
-
(
void
)
awakeFromNib
{
...
...
@@ -15,6 +15,25 @@
// Initialization code
}
#pragma mark -赋值
-
(
void
)
setGoodsAllprice
:
(
NSArray
*
)
goodsAllprice
{
_goodsAllprice
=
goodsAllprice
;
NSUInteger
allNumber
;
NSInteger
allPrice
;
for
(
ShopcarModel
*
model
in
_goodsAllprice
)
{
allNumber
+=
model
.
goodsNum
;
allPrice
+=
[
model
.
goods
.
costPrice
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/ClientViewController.m
View file @
913b4774
...
...
@@ -185,6 +185,8 @@
#pragma mark -设置为当前客户回调
-
(
void
)
SetCustomerButtonClick
:
(
NSInteger
)
index
;
{
...
...
Lighting/Class/CommodityListTableViewCell.h
View file @
913b4774
...
...
@@ -42,4 +42,7 @@
*/
@property
(
nonatomic
,
strong
)
ShopcarModel
*
model
;
@end
Lighting/Class/OrderdetailsViewController.m
View file @
913b4774
...
...
@@ -25,6 +25,7 @@
[
super
viewDidLoad
];
[
self
uiConfigAction
];
[
self
getOrderDetailsData
];
}
...
...
@@ -41,8 +42,20 @@
}
#pragma mark -获取订单详情
-
(
void
)
getOrderDetailsData
{
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@%@"
,
ServerAddress
,
@"/order/get/"
,
_orderCode
]
WithRequestType
:
1
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
NSLog
(
@"%@"
,
returnValue
);
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithFailureBlock
:^
(
id
error
)
{
}];
}
...
...
Lighting/Class/Shoppingcart/AddressModel.h
0 → 100644
View file @
913b4774
//
// AddressModel.h
// Lighting
//
// Created by 曹云霄 on 16/5/15.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "opple_objc_json_client.h"
@interface
AddressModel
:
TOShippingAddrEntity
/**
* 地址选中状态
*/
@property
(
nonatomic
,
assign
)
BOOL
isSelected
;
@end
Lighting/Class/Shoppingcart/AddressModel.m
0 → 100644
View file @
913b4774
//
// AddressModel.m
// Lighting
//
// Created by 曹云霄 on 16/5/15.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "AddressModel.h"
@implementation
AddressModel
@end
Lighting/Class/Shoppingcart/AddressViewController.h
View file @
913b4774
...
...
@@ -7,6 +7,18 @@
//
#import "BaseViewController.h"
#import "AddressModel.h"
@protocol
delecteDelegate
<
NSObject
>
//删除地址
-
(
void
)
delecteCell
:
(
NSString
*
)
addressid
;
//增加地址
-
(
void
)
addAddressCell
:(
AddressModel
*
)
model
;
@end
@interface
AddressViewController
:
BaseViewController
...
...
@@ -87,16 +99,24 @@
/**
* 地址数据源model
*/
@property
(
nonatomic
,
strong
)
AddressModel
*
model
;
/**
* 是否为修改地址
*/
@property
(
nonatomic
,
assign
)
BOOL
isChange
;
/**
* 删除代理
*/
@property
(
nonatomic
,
assign
)
id
<
delecteDelegate
>
delegate
;
...
...
Lighting/Class/Shoppingcart/AddressViewController.m
View file @
913b4774
...
...
@@ -55,8 +55,22 @@
self
.
detailsAddressBackview
.
layer
.
cornerRadius
=
kCornerRadius
;
self
.
citySelected
.
layer
.
masksToBounds
=
YES
;
self
.
citySelected
.
layer
.
cornerRadius
=
kCornerRadius
;
self
.
delectAddressButton
.
layer
.
masksToBounds
=
YES
;
self
.
delectAddressButton
.
layer
.
cornerRadius
=
kCornerRadius
;
self
.
modifyButton
.
layer
.
masksToBounds
=
YES
;
self
.
modifyButton
.
layer
.
cornerRadius
=
kCornerRadius
;
[
self
.
citySelected
addTarget
:
self
action
:
@selector
(
SelectedCityButtonClick
)
forControlEvents
:
UIControlEventTouchUpInside
];
//判断是修改还是新增
if
(
_isChange
)
{
[
self
.
delectAddressButton
setTitle
:
@"删除"
forState
:
UIControlStateNormal
];
[
self
.
modifyButton
setTitle
:
@"保存"
forState
:
UIControlStateNormal
];
}
self
.
recipientPerson
.
text
=
_model
.
name
;
self
.
PhoneNumber
.
text
=
_model
.
miblephone
;
[
self
.
citySelected
setTitle
:
_model
.
city
forState
:
UIControlStateNormal
];
self
.
detailsAddress
.
text
=
_model
.
address
;
}
#pragma mark -取消弹出的圆角
...
...
@@ -118,7 +132,15 @@
#pragma mark 新增按钮点击,或者修改
-
(
IBAction
)
addAddressButtonClick
:
(
UIButton
*
)
sender
{
if
([
sender
.
currentTitle
isEqualToString
:
@"新增"
])
{
[
self
addAddressInformationRequest
];
}
else
if
([
sender
.
currentTitle
isEqualToString
:
@"保存"
])
{
}
}
...
...
@@ -133,9 +155,30 @@
address
.
city
=
[
self
.
citySelected
currentTitle
];
address
.
address
=
self
.
detailsAddress
.
text
;
[
self
CreateMBProgressHUDLoding
];
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@"
,
ServerAddress
,
@"/shippingAddress/save"
]
WithRequestType
:
0
WithParameter
:
address
WithReturnValueBlock
:^
(
id
returnValue
)
{
NSLog
(
@"%@"
,
returnValue
);
[
self
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
AddressModel
*
model
=
[[
AddressModel
alloc
]
init
];
model
.
name
=
self
.
recipientPerson
.
text
;
model
.
miblephone
=
self
.
PhoneNumber
.
text
;
model
.
city
=
self
.
citySelected
.
currentTitle
;
model
.
address
=
self
.
detailsAddress
.
text
;
model
.
consumerId
=
[
Customermanager
manager
].
customerID
;
model
.
fid
=
returnValue
[
@"data"
];
model
.
isSelected
=
NO
;
//增加地址
if
([
self
.
delegate
respondsToSelector
:
@selector
(
addAddressCell
:)])
{
[
self
.
delegate
addAddressCell
:
model
];
}
}
else
{
[
self
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
...
...
@@ -143,6 +186,7 @@
}
WithFailureBlock
:^
(
id
error
)
{
NSLog
(
@"%@"
,
error
);
[
self
RemoveMBProgressHUDLoding
];
}];
...
...
@@ -160,23 +204,58 @@
//@synthesize consumerId;
#pragma mark -修改收货地址
-
(
void
)
ChangeAddressRequest
{
//#pragma mark -修改地址数据源
//- (void)setModel:(AddressModel *)model
//{
// _model = model;
// self.recipientPerson.text = model.name;
// self.PhoneNumber.text = model.miblephone;
// [self.citySelected setTitle:model.city forState:UIControlStateNormal];
// self.detailsAddress.text = model.address;
//
//}
TOShippingAddrEntity
*
change
=
[[
TOShippingAddrEntity
alloc
]
init
];
#pragma mark -取消新增地址,或者删除
-
(
IBAction
)
cancelButtonClick
:
(
UIButton
*
)
sender
{
if
([
sender
.
currentTitle
isEqualToString
:
@"取消"
])
{
[
self
dismissViewControllerAnimated
:
YES
completion
:
nil
];
}
else
if
([
sender
.
currentTitle
isEqualToString
:
@"删除"
])
{
[
self
deleteAddressButtonClick
];
}
}
#pragma mark -删除收货地址
-
(
void
)
deleteAddressButtonClick
{
[
self
CreateMBProgressHUDLoding
];
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@%@"
,
ServerAddress
,
@"/shippingAddress/remove/"
,
_model
.
fid
]
WithRequestType
:
1
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
self
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
#pragma mark -取消新增地址,或者删除
-
(
IBAction
)
cancelButtonClick
:
(
UIButton
*
)
sender
{
[
self
SuccessMBProgressView
:
@"删除成功"
];
if
([
self
.
delegate
respondsToSelector
:
@selector
(
delecteCell
:)])
{
}
[
self
.
delegate
delecteCell
:
_model
.
fid
];
}
}
else
{
[
self
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
}
WithFailureBlock
:^
(
id
error
)
{
[
self
RemoveMBProgressHUDLoding
];
}];
}
/*
...
...
Lighting/Class/Shoppingcart/AddressViewController.xib
View file @
913b4774
...
...
@@ -141,6 +141,7 @@
</subviews>
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"custom"
customColorSpace=
"calibratedWhite"
/>
<freeformSimulatedSizeMetrics
key=
"simulatedDestinationMetrics"
/>
<point
key=
"canvasLocation"
x=
"291.5"
y=
"261"
/>
</view>
</objects>
</document>
Lighting/Class/Shoppingcart/GenerateOrdersModifyTableViewCell.h
View file @
913b4774
...
...
@@ -10,4 +10,23 @@
@interface
GenerateOrdersModifyTableViewCell
:
UITableViewCell
/**
* 新增收货地址
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UIButton
*
addAddressButton
;
/**
* 修改按钮
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UIButton
*
changeButton
;
@end
Lighting/Class/Shoppingcart/GenerateOrdersModifyTableViewCell.m
View file @
913b4774
...
...
@@ -13,8 +13,28 @@
-
(
void
)
awakeFromNib
{
[
super
awakeFromNib
];
// Initialization code
self
.
addAddressButton
.
layer
.
masksToBounds
=
YES
;
self
.
addAddressButton
.
layer
.
cornerRadius
=
kCornerRadius
;
self
.
changeButton
.
layer
.
masksToBounds
=
YES
;
self
.
changeButton
.
layer
.
cornerRadius
=
kCornerRadius
;
}
-
(
void
)
setSelected
:
(
BOOL
)
selected
animated
:
(
BOOL
)
animated
{
[
super
setSelected
:
selected
animated
:
animated
];
...
...
Lighting/Class/Shoppingcart/GenerateOrdersTableViewCell.h
View file @
913b4774
...
...
@@ -7,12 +7,13 @@
//
#import <UIKit/UIKit.h>
#import "AddressModel.h"
@interface
GenerateOrdersTableViewCell
:
UITableViewCell
@property
(
nonatomic
,
strong
)
TOShippingAddrEntity
*
NewModel
;
@property
(
nonatomic
,
strong
)
AddressModel
*
NewModel
;
/**
...
...
@@ -37,4 +38,17 @@
@property
(
weak
,
nonatomic
)
IBOutlet
UIButton
*
isSelectedButton
;
/**
* 当前的cell位置
*/
@property
(
nonatomic
,
assign
)
NSInteger
indexNumber
;
/**
* 反传回控制器.cell位置
*/
@property
(
nonatomic
,
copy
)
void
(
^
blockSeletced
)(
NSInteger
index
);
@end
Lighting/Class/Shoppingcart/GenerateOrdersTableViewCell.m
View file @
913b4774
...
...
@@ -18,10 +18,13 @@
#pragma mark -赋值
-
(
void
)
setNewModel
:
(
TOShippingAddrEntity
*
)
NewModel
-
(
void
)
setNewModel
:
(
AddressModel
*
)
NewModel
{
_NewModel
=
NewModel
;
self
.
isSelectedButton
.
selected
=
NewModel
.
isSelected
;
self
.
consigneeName
.
text
=
_NewModel
.
name
;
self
.
consigneemobile
.
text
=
_NewModel
.
miblephone
;
self
.
consigneeAddress
.
text
=
_NewModel
.
address
;
...
...
@@ -31,7 +34,11 @@
#pragma mark -选中按钮
-
(
IBAction
)
SelectedButtonClick
:
(
UIButton
*
)
sender
{
if
(
self
.
blockSeletced
)
{
self
.
blockSeletced
(
_indexNumber
);
}
sender
.
selected
=
YES
;
}
...
...
Lighting/Class/Shoppingcart/GenerateOrdersViewController.m
View file @
913b4774
...
...
@@ -17,7 +17,8 @@
#import "AppDelegate.h"
#import "OrderdetailsViewController.h"
#import "AddressViewController.h"
@interface
GenerateOrdersViewController
()
<
UITableViewDelegate
,
UITableViewDataSource
>
#import "AddressModel.h"
@interface
GenerateOrdersViewController
()
<
UITableViewDelegate
,
UITableViewDataSource
,
delecteDelegate
>
/**
* 增加或者修改地址
...
...
@@ -84,10 +85,10 @@
#pragma mark -获得地址信息
-
(
void
)
getAddressDatasRequest
{
[
self
CreateMBProgressHUDLoding
];
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:[
NSString
stringWithFormat
:
@"%@%@%@"
,
ServerAddress
,
@"/shippingAddress/listAddress/"
,[
Customermanager
manager
].
customerID
]
WithRequestType
:
1
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
NSLog
(
@"%@"
,
returnValue
)
;
[
self
RemoveMBProgressHUDLoding
]
;
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
RsShippingAddrEntity
*
address
=
[[
RsShippingAddrEntity
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
...
...
@@ -95,10 +96,22 @@
for
(
NSInteger
i
=
address
.
list
.
count
-
1
;
i
>=
0
;
i
--
)
{
TOShippingAddrEntity
*
model
=
[
address
.
list
objectAtIndex_opple
:
i
];
[[
self
.
datasArray
objectAtIndex_opple
:
1
]
insertObject
:
model
atIndex
:
0
];
//自定义model
AddressModel
*
Newmodel
=
[[
AddressModel
alloc
]
init
];
Newmodel
.
fid
=
model
.
fid
;
Newmodel
.
createDate
=
model
.
createDate
;
Newmodel
.
sysOrgCode
=
model
.
sysOrgCode
;
Newmodel
.
name
=
model
.
name
;
Newmodel
.
miblephone
=
model
.
miblephone
;
Newmodel
.
province
=
model
.
province
;
Newmodel
.
city
=
model
.
city
;
Newmodel
.
country
=
model
.
country
;
Newmodel
.
consumerId
=
model
.
consumerId
;
Newmodel
.
address
=
model
.
address
;
[[
self
.
datasArray
objectAtIndex_opple
:
1
]
insertObject
:
Newmodel
atIndex
:
0
];
}
[
self
.
generateOrderTableview
reloadData
];
}
else
...
...
@@ -111,6 +124,7 @@
}
WithFailureBlock
:^
(
id
error
)
{
NSLog
(
@"%@"
,
error
);
[
self
RemoveMBProgressHUDLoding
];
}];
}
...
...
@@ -130,26 +144,35 @@
NSArray
*
Addressarr
=
[
self
.
datasArray
objectAtIndex_opple
:
indexPath
.
section
];
if
(
indexPath
.
row
==
Addressarr
.
count
-
1
)
{
GenerateOrdersModifyTableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"consigneecell"
forIndexPath
:
indexPath
];
GenerateOrdersModifyTableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"Modifycell"
forIndexPath
:
indexPath
];
//增加地址或者修改
[
cell
.
addAddressButton
addTarget
:
self
action
:
@selector
(
AddAddressButtonClick
)
forControlEvents
:
UIControlEventTouchUpInside
];
[
cell
.
changeButton
addTarget
:
self
action
:
@selector
(
ChangeButtonClick
)
forControlEvents
:
UIControlEventTouchUpInside
];
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
cell
.
backgroundColor
=
kTCColor
(
242
,
242
,
242
);
return
cell
;
}
GenerateOrdersTableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"
Modify
cell"
forIndexPath
:
indexPath
];
GenerateOrdersTableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"
consignee
cell"
forIndexPath
:
indexPath
];
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
cell
.
backgroundColor
=
kTCColor
(
242
,
242
,
242
);
TOShippingAddrEntity
*
model
=
[
self
.
datasArray
objectAtIndex_opple
:
indexPath
.
section
][
indexPath
.
row
];
NSLog
(
@"%@"
,
model
);
cell
.
NewModel
=
model
;
cell
.
indexNumber
=
indexPath
.
row
;
//回调
[
cell
setBlockSeletced
:
^
(
NSInteger
index
)
{
[
self
SetCustomerButtonClick
:
index
];
}];
cell
.
NewModel
=
[
self
.
datasArray
objectAtIndex_opple
:
indexPath
.
section
][
indexPath
.
row
];
return
cell
;
}
else
if
(
indexPath
.
section
==
2
)
{
if
(
indexPath
.
row
==
1
)
{
NSArray
*
Addressarr
=
[
self
.
datasArray
objectAtIndex_opple
:
indexPath
.
section
];
if
(
indexPath
.
row
==
Addressarr
.
count
-
1
)
{
AllpriceTableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"sixthcell"
forIndexPath
:
indexPath
];
cell
.
selectionStyle
=
UITableViewCellSelectionStyleNone
;
cell
.
goodsAllprice
=
[
self
.
datasArray
objectAtIndex_opple
:
indexPath
.
section
];
return
cell
;
}
CommodityListTableViewCell
*
cell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"fourthcell"
forIndexPath
:
indexPath
];
...
...
@@ -284,17 +307,20 @@
return
self
.
datasArray
.
count
;
}
-
(
void
)
tableView
:
(
UITableView
*
)
tableView
didSelectRowAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
[
self
CreateModifyShippingView
];
}
#pragma mark -新增或者修改收货地址
-
(
void
)
CreateModifyShippingView
-
(
void
)
CreateModifyShippingView
:
(
AddressModel
*
)
model
{
AddressViewController
*
address
=
[[
AddressViewController
alloc
]
init
];
address
.
delegate
=
self
;
if
(
model
!=
nil
)
{
address
.
model
=
model
;
address
.
isChange
=
YES
;
}
address
.
preferredContentSize
=
CGSizeMake
(
315
,
320
);
address
.
modalPresentationStyle
=
UIModalPresentationFormSheet
;
UIPopoverPresentationController
*
pop
=
address
.
popoverPresentationController
;
...
...
@@ -351,9 +377,6 @@
NSLog
(
@"%@"
,
error
);
[
self
RemoveMBProgressHUDLoding
];
}];
}
...
...
@@ -366,11 +389,88 @@
#pragma mark -设置为当前地址回调
-
(
void
)
SetCustomerButtonClick
:
(
NSInteger
)
index
;
{
for
(
UITableViewCell
*
cell
in
self
.
generateOrderTableview
.
visibleCells
)
{
if
([
cell
isKindOfClass
:[
GenerateOrdersTableViewCell
class
]])
{
GenerateOrdersTableViewCell
*
Newcell
=
(
GenerateOrdersTableViewCell
*
)
cell
;
Newcell
.
isSelectedButton
.
selected
=
NO
;
}
}
for
(
id
objc
in
[
self
.
datasArray
objectAtIndex_opple
:
1
])
{
if
([
objc
isKindOfClass
:[
AddressModel
class
]])
{
AddressModel
*
model
=
(
AddressModel
*
)
objc
;
model
.
isSelected
=
NO
;
}
}
AddressModel
*
model
=
[[
self
.
datasArray
objectAtIndex_opple
:
1
]
objectAtIndex_opple
:
index
];
model
.
isSelected
=
YES
;
}
#pragma mark -修改地址
-
(
void
)
ChangeButtonClick
{
NSArray
*
arr
=
[
self
.
datasArray
objectAtIndex_opple
:
1
];
for
(
int
i
=
0
;
i
<
arr
.
count
;
i
++
)
{
if
([[
arr
objectAtIndex_opple
:
i
]
isKindOfClass
:[
AddressModel
class
]])
{
AddressModel
*
model
=
[
arr
objectAtIndex_opple
:
i
];
//判断是否为选中
if
(
model
.
isSelected
)
{
[
self
CreateModifyShippingView
:[
arr
objectAtIndex_opple
:
i
]];
}
}
}
}
#pragma mark -新增地址
-
(
void
)
AddAddressButtonClick
{
[
self
CreateModifyShippingView
:
nil
];
}
#pragma mark -新增地址回调
-
(
void
)
addAddressCell
:
(
AddressModel
*
)
model
{
[
self
dismissViewControllerAnimated
:
YES
completion
:
nil
];
[[
self
.
datasArray
objectAtIndex_opple
:
1
]
insertObject
:
model
atIndex
:
0
];
NSIndexPath
*
indexpath
=
[
NSIndexPath
indexPathForRow
:
0
inSection
:
1
];
[
self
.
generateOrderTableview
insertRowsAtIndexPaths
:@[
indexpath
]
withRowAnimation
:
UITableViewRowAnimationLeft
];
}
#pragma mark -删除地址
-
(
void
)
delecteCell
:
(
NSString
*
)
addressid
{
NSArray
*
arr
=
[
self
.
datasArray
objectAtIndex_opple
:
1
];
for
(
int
i
=
0
;
i
<
arr
.
count
;
i
++
)
{
if
([[
arr
objectAtIndex_opple
:
i
]
isKindOfClass
:[
AddressModel
class
]])
{
AddressModel
*
model
=
[
arr
objectAtIndex_opple
:
i
];
//判断是否为选中
if
([
model
.
fid
isEqualToString
:
addressid
])
{
[[
self
.
datasArray
objectAtIndex_opple
:
1
]
removeObjectAtIndex
:
i
];
NSIndexPath
*
indexpath
=
[
NSIndexPath
indexPathForRow
:
i
inSection
:
1
];
[
self
.
generateOrderTableview
deleteRowsAtIndexPaths
:@[
indexpath
]
withRowAnimation
:
UITableViewRowAnimationLeft
];
[
self
dismissViewControllerAnimated
:
YES
completion
:
nil
];
}
}
}
}
-
(
void
)
didReceiveMemoryWarning
{
[
super
didReceiveMemoryWarning
];
// Dispose of any resources that can be recreated.
...
...
Lighting/Class/Shoppingcart/ShoppingViewController.m
View file @
913b4774
...
...
@@ -205,6 +205,9 @@
[
self
ErrorMBProgressView
:
@"没有选中任何商品"
];
return
;
}
//占位
ShopcarModel
*
ZhanweiModel
=
[[
ShopcarModel
alloc
]
init
];
[
array
addObject
:
ZhanweiModel
];
GenerateOrdersViewController
*
generateOrder
=
[[
self
getStoryboardWithName
]
instantiateViewControllerWithIdentifier
:
@"generateorders"
];
generateOrder
.
settlementGoodsdatas
=
array
;
[
self
.
navigationController
pushViewController
:
generateOrder
animated
:
YES
];
...
...
Lighting/Lighting.xcodeproj/project.pbxproj
View file @
913b4774
...
...
@@ -27,6 +27,7 @@
2928F83B1CD0A0CE0036D761
/* CustomTabbarController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2928F83A1CD0A0CE0036D761
/* CustomTabbarController.m */
;
};
2928F83D1CD0A9CD0036D761
/* qq.png in Resources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2928F83C1CD0A9CD0036D761
/* qq.png */
;
};
2928F8421CD0ABAC0036D761
/* ShoppingViewController.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2928F8411CD0ABAC0036D761
/* ShoppingViewController.m */
;
};
292A14311CE81D1D00EB4430
/* AddressModel.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
292A14301CE81D1D00EB4430
/* AddressModel.m */
;
};
2933934F1CD3158B000D997B
/* instructionsLabe.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
2933934E1CD3158B000D997B
/* instructionsLabe.m */
;
};
293393551CD3379E000D997B
/* ShoppingTableViewCell.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
293393541CD3379E000D997B
/* ShoppingTableViewCell.m */
;
};
29360C2F1CDDC47E002A5D89
/* ScreeningView.m in Sources */
=
{
isa
=
PBXBuildFile
;
fileRef
=
29360C2E1CDDC47E002A5D89
/* ScreeningView.m */
;
};
...
...
@@ -152,6 +153,8 @@
2928F83C1CD0A9CD0036D761
/* qq.png */
=
{
isa
=
PBXFileReference
;
lastKnownFileType
=
image.png
;
path
=
qq.png
;
sourceTree
=
"<group>"
;
};
2928F8401CD0ABAC0036D761
/* ShoppingViewController.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ShoppingViewController.h
;
sourceTree
=
"<group>"
;
};
2928F8411CD0ABAC0036D761
/* ShoppingViewController.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
ShoppingViewController.m
;
sourceTree
=
"<group>"
;
};
292A142F1CE81D1D00EB4430
/* AddressModel.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
AddressModel.h
;
sourceTree
=
"<group>"
;
};
292A14301CE81D1D00EB4430
/* AddressModel.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
AddressModel.m
;
sourceTree
=
"<group>"
;
};
2933934D1CD3158B000D997B
/* instructionsLabe.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
instructionsLabe.h
;
sourceTree
=
"<group>"
;
};
2933934E1CD3158B000D997B
/* instructionsLabe.m */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.objc
;
path
=
instructionsLabe.m
;
sourceTree
=
"<group>"
;
};
293393531CD3379E000D997B
/* ShoppingTableViewCell.h */
=
{
isa
=
PBXFileReference
;
fileEncoding
=
4
;
lastKnownFileType
=
sourcecode.c.h
;
path
=
ShoppingTableViewCell.h
;
sourceTree
=
"<group>"
;
};
...
...
@@ -519,6 +522,7 @@
2928F83F1CD0AB830036D761
/* Shoppingcart */
=
{
isa
=
PBXGroup
;
children
=
(
292A142E1CE81CF200EB4430
/* addressSelectedModel */
,
2908870D1CE5D900000B7097
/* shopCarmodel */
,
293393521CD3377E000D997B
/* view */
,
293393501CD329EC000D997B
/* controller */
,
...
...
@@ -526,6 +530,15 @@
path
=
Shoppingcart
;
sourceTree
=
"<group>"
;
};
292A142E1CE81CF200EB4430
/* addressSelectedModel */
=
{
isa
=
PBXGroup
;
children
=
(
292A142F1CE81D1D00EB4430
/* AddressModel.h */
,
292A14301CE81D1D00EB4430
/* AddressModel.m */
,
);
name
=
addressSelectedModel
;
sourceTree
=
"<group>"
;
};
293393501CD329EC000D997B
/* controller */
=
{
isa
=
PBXGroup
;
children
=
(
...
...
@@ -1214,6 +1227,7 @@
29EAAE951CDC414C00C4DBA2
/* SeceneLibraryCollectionViewCell.m in Sources */
,
060D397C1CE45CFE0082AECD
/* ImageCropperView.m in Sources */
,
2949BAC21CD3055A0049385A
/* MMExampleDrawerVisualStateManager.m in Sources */
,
292A14311CE81D1D00EB4430
/* AddressModel.m in Sources */
,
29A938221CDADE4700F21E54
/* ProductDetailsTableViewCell.m in Sources */
,
2992493D1CDB3E8900786B1E
/* GenerateOrdersModifyTableViewCell.m in Sources */
,
29BB27741CD9DFAC009A0813
/* SceneLibraryViewController.m in Sources */
,
...
...
Lighting/Lighting/StoryboardwithCYX.storyboard
View file @
913b4774
...
...
@@ -1967,7 +1967,7 @@
<color
key=
"backgroundColor"
white=
"1"
alpha=
"1"
colorSpace=
"calibratedWhite"
/>
<prototypes>
<tableViewCell
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
selectionStyle=
"none"
indentationWidth=
"10"
reuseIdentifier=
"secondcell"
rowHeight=
"140"
id=
"LsY-i0-h5H"
customClass=
"PersonInformationTableViewCell"
>
<rect
key=
"frame"
x=
"0.0"
y=
"
28
"
width=
"768"
height=
"140"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"
92
"
width=
"768"
height=
"140"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<tableViewCellContentView
key=
"contentView"
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
tableViewCell=
"LsY-i0-h5H"
id=
"dPG-p9-V2i"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"768"
height=
"139.5"
/>
...
...
@@ -2064,7 +2064,7 @@
</connections>
</tableViewCell>
<tableViewCell
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
selectionStyle=
"default"
indentationWidth=
"10"
reuseIdentifier=
"consigneecell"
rowHeight=
"56"
id=
"gfQ-UE-mXV"
customClass=
"GenerateOrdersTableViewCell"
>
<rect
key=
"frame"
x=
"0.0"
y=
"
168
"
width=
"768"
height=
"56"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"
232
"
width=
"768"
height=
"56"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<tableViewCellContentView
key=
"contentView"
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
tableViewCell=
"gfQ-UE-mXV"
id=
"za6-HU-VEw"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"768"
height=
"55.5"
/>
...
...
@@ -2135,7 +2135,7 @@
</connections>
</tableViewCell>
<tableViewCell
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
selectionStyle=
"default"
indentationWidth=
"10"
reuseIdentifier=
"Modifycell"
rowHeight=
"56"
id=
"Kk4-Fh-HhL"
customClass=
"GenerateOrdersModifyTableViewCell"
>
<rect
key=
"frame"
x=
"0.0"
y=
"2
24
"
width=
"768"
height=
"56"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"2
88
"
width=
"768"
height=
"56"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<tableViewCellContentView
key=
"contentView"
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
tableViewCell=
"Kk4-Fh-HhL"
id=
"oRX-7p-HkY"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"768"
height=
"55.5"
/>
...
...
@@ -2160,9 +2160,13 @@
</subviews>
</tableViewCellContentView>
<color
key=
"backgroundColor"
red=
"0.94901960784313721"
green=
"0.94901960784313721"
blue=
"0.94901960784313721"
alpha=
"1"
colorSpace=
"calibratedRGB"
/>
<connections>
<outlet
property=
"addAddressButton"
destination=
"QfL-M1-b48"
id=
"3jD-ZC-3Hv"
/>
<outlet
property=
"changeButton"
destination=
"m0f-EW-LM5"
id=
"CVd-sS-vsr"
/>
</connections>
</tableViewCell>
<tableViewCell
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
selectionStyle=
"none"
indentationWidth=
"10"
reuseIdentifier=
"fourthcell"
rowHeight=
"80"
id=
"G7o-xS-1mB"
customClass=
"CommodityListTableViewCell"
>
<rect
key=
"frame"
x=
"0.0"
y=
"
280
"
width=
"768"
height=
"80"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"
344
"
width=
"768"
height=
"80"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<tableViewCellContentView
key=
"contentView"
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
tableViewCell=
"G7o-xS-1mB"
id=
"l3e-TL-GCT"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"768"
height=
"79.5"
/>
...
...
@@ -2223,7 +2227,7 @@
</connections>
</tableViewCell>
<tableViewCell
clipsSubviews=
"YES"
contentMode=
"scaleToFill"
selectionStyle=
"default"
indentationWidth=
"10"
reuseIdentifier=
"sixthcell"
rowHeight=
"50"
id=
"6K9-mc-7RW"
customClass=
"AllpriceTableViewCell"
>
<rect
key=
"frame"
x=
"0.0"
y=
"
360
"
width=
"768"
height=
"50"
/>
<rect
key=
"frame"
x=
"0.0"
y=
"
424
"
width=
"768"
height=
"50"
/>
<autoresizingMask
key=
"autoresizingMask"
/>
<tableViewCellContentView
key=
"contentView"
opaque=
"NO"
clipsSubviews=
"YES"
multipleTouchEnabled=
"YES"
contentMode=
"center"
tableViewCell=
"6K9-mc-7RW"
id=
"Vc7-f6-wGb"
>
<rect
key=
"frame"
x=
"0.0"
y=
"0.0"
width=
"768"
height=
"49.5"
/>
...
...
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