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
b70036b6
Commit
b70036b6
authored
Nov 23, 2016
by
曹云霄
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改项说明:
parent
a03062f0
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
140 additions
and
29 deletions
+140
-29
PrizeExchangeBillTableViewCell.h
Class/PrizeExchangeBillTableViewCell.h
+16
-0
PrizeExchangeBillTableViewCell.m
Class/PrizeExchangeBillTableViewCell.m
+5
-4
PrizeExchangeConsigneeTableViewCell.h
Class/PrizeExchangeConsigneeTableViewCell.h
+17
-0
PrizeExchangeDetailsViewController.h
Class/PrizeExchangeDetailsViewController.h
+5
-0
PrizeExchangeDetailsViewController.m
Class/PrizeExchangeDetailsViewController.m
+21
-5
PrizeListCollectionViewCell.m
Class/PrizeListCollectionViewCell.m
+6
-2
PrizeListModel.h
Class/PrizeListModel.h
+9
-0
PrizeMainViewController.m
Class/PrizeMainViewController.m
+50
-18
BaseViewController.h
Tools/BaseViewController.h
+4
-0
BaseViewController.m
Tools/BaseViewController.m
+7
-0
No files found.
Class/PrizeExchangeBillTableViewCell.h
View file @
b70036b6
...
...
@@ -10,10 +10,26 @@
@interface
PrizeExchangeBillTableViewCell
:
UITableViewCell
/**
兑换单单号
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
exchangeBillNumberLabel
;
/**
兑换日期
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
exchangeTimeLabel
;
/**
兑换状态
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
exchangeStateLabel
;
/**
兑换单信息
*/
@property
(
nonatomic
,
strong
)
TOPrizeBillEntity
*
billEntity
;
@end
Class/PrizeExchangeBillTableViewCell.m
View file @
b70036b6
...
...
@@ -15,10 +15,11 @@
// Initialization code
}
-
(
void
)
setSelected
:
(
BOOL
)
selected
animated
:
(
BOOL
)
animated
{
[
super
setSelected
:
selected
animated
:
animated
];
// Configure the view for the selected state
-
(
void
)
setBillEntity
:
(
TOPrizeBillEntity
*
)
billEntity
{
_billEntity
=
billEntity
;
self
.
exchangeBillNumberLabel
.
text
=
_billEntity
.
billnumber
;
self
.
exchangeTimeLabel
.
text
=
_billEntity
.
createDate
;
}
@end
Class/PrizeExchangeConsigneeTableViewCell.h
View file @
b70036b6
...
...
@@ -11,10 +11,27 @@
@interface
PrizeExchangeConsigneeTableViewCell
:
UITableViewCell
/**
收货人
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
consigneeLabel
;
/**
地址
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
addressLabel
;
/**
手机号
*/
@property
(
weak
,
nonatomic
)
IBOutlet
UILabel
*
phoneNumberLabel
;
/**
收货人信息
*/
@property
(
nonatomic
,
strong
)
TOPrizeBillEntity
*
consigneeEntity
;
@end
Class/PrizeExchangeDetailsViewController.h
View file @
b70036b6
...
...
@@ -25,4 +25,9 @@ typedef NS_ENUM(NSInteger,CellType){
@interface
PrizeExchangeDetailsViewController
:
BaseViewController
@property
(
weak
,
nonatomic
)
IBOutlet
UITableView
*
prizeExchangeDetailsTableView
;
/**
兑奖单单号
*/
@property
(
nonatomic
,
copy
)
NSString
*
prizeBillNumber
;
@end
Class/PrizeExchangeDetailsViewController.m
View file @
b70036b6
...
...
@@ -15,6 +15,12 @@
@interface
PrizeExchangeDetailsViewController
()
<
UITableViewDelegate
,
UITableViewDataSource
>
/**
兑奖单详情
*/
@property
(
nonatomic
,
strong
)
RsPrizeBill
*
prizeBillResult
;
@end
@implementation
PrizeExchangeDetailsViewController
...
...
@@ -36,14 +42,22 @@
-
(
void
)
getPrizeDetailsDataAction
{
WS
(
weakSelf
);
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:
SERVERREQUESTURL
(
PRIZEBILLDETAILS
)
WithCallClass
:
weakSelf
WithRequestType
:
ONE
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
NSSLog
(
@"%@"
,
returnValue
);
[
self
CreateMBProgressHUDLoding
];
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:[
NSString
stringWithFormat
:
SERVERREQUESTURL
(
PRIZEBILLDETAILS
),
@"demo11611221750244"
]
WithCallClass
:
weakSelf
WithRequestType
:
ONE
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
weakSelf
.
prizeBillResult
=
[[
RsPrizeBill
alloc
]
initWithDictionary
:
returnValue
[
@"data"
]
error
:
nil
];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
[
weakSelf
.
prizeExchangeDetailsTableView
reloadData
];
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
NETWORK
];
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
}];
}
...
...
@@ -54,12 +68,14 @@
case
ExchangeBillInformation
:
{
PrizeExchangeBillTableViewCell
*
billCell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"PrizeExchangeBillTableViewCell"
forIndexPath
:
indexPath
];
billCell
.
billEntity
=
self
.
prizeBillResult
.
bill
;
return
billCell
;
}
break
;
case
ReceivingInformation
:
{
PrizeExchangeConsigneeTableViewCell
*
consigneeCell
=
[
tableView
dequeueReusableCellWithIdentifier
:
@"PrizeExchangeConsigneeTableViewCell"
forIndexPath
:
indexPath
];
consigneeCell
.
consigneeEntity
=
self
.
prizeBillResult
.
bill
;
return
consigneeCell
;
}
break
;
...
...
Class/PrizeListCollectionViewCell.m
View file @
b70036b6
...
...
@@ -16,12 +16,16 @@
[
self
.
prizeImageView
sd_setImageWithURL
:[
NSURL
URLWithString
:
_prizeModel
.
picture
]
placeholderImage
:
REPLACEIMAGE
];
self
.
prizeDescribeLabel
.
text
=
_prizeModel
.
name
;
self
.
isSelectButton
.
selected
=
_prizeModel
.
isSelect
;
self
.
backgroundColor
=
_prizeModel
.
isAllowSelect
?[
UIColor
whiteColor
]:[
UIColor
lightGrayColor
];
}
#pragma mark - 选中
-
(
IBAction
)
isSelectButton
:(
UIButton
*
)
sender
{
sender
.
selected
=
!
sender
.
selected
;
_prizeModel
.
isSelect
=
sender
.
selected
;
if
(
_prizeModel
.
isAllowSelect
)
{
sender
.
selected
=
!
sender
.
selected
;
_prizeModel
.
isSelect
=
sender
.
selected
;
}
}
@end
Class/PrizeListModel.h
View file @
b70036b6
...
...
@@ -12,6 +12,15 @@
-
(
instancetype
)
initWithSuper
:(
TOPrizeEntity
*
)
model
;
/**
是否选中
*/
@property
(
nonatomic
,
assign
)
BOOL
isSelect
;
/**
是否允许选中
*/
@property
(
nonatomic
,
assign
)
BOOL
isAllowSelect
;
@end
Class/PrizeMainViewController.m
View file @
b70036b6
...
...
@@ -24,6 +24,11 @@
*/
@property
(
nonatomic
,
strong
)
NSMutableArray
*
prizeDatasArray
;
/**
可以申请的列表
*/
@property
(
nonatomic
,
strong
)
NSMutableArray
*
availableArray
;
/**
总页数
*/
...
...
@@ -36,7 +41,6 @@
[
super
viewDidLoad
];
[
self
setUpCollectionView
];
[
self
queryExchangeQualification
];
[
self
setUpRefreshAction
];
}
...
...
@@ -74,14 +78,16 @@
self
.
prizeListCollectionView
.
mj_footer
=
footer
;
}
#pragma mark - 获取奖品列表
#pragma mark - 获取奖品列表
、可申请礼品列表
-
(
void
)
getPrizeListDatasAction
:
(
BOOL
)
isRemove
{
WS
(
weakSelf
);
[
self
CreateMBProgressHUDLoding
];
dispatch_group_t
group
=
dispatch_group_create
();
dispatch_group_enter
(
group
);
//任务一 请求奖品列表
[[
NetworkRequestClassManager
Manager
]
NetworkRequestWithURL
:
SERVERREQUESTURL
(
PRIZELIST
)
WithCallClass
:
weakSelf
WithRequestType
:
ZERO
WithParameter
:
self
.
queryPrizeModel
WithReturnValueBlock
:^
(
id
returnValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
dispatch_group_leave
(
group
);
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
prizeListCollectionView
];
weakSelf
.
prizeListCollectionView
.
emptyDataSetSource
=
weakSelf
;
weakSelf
.
prizeListCollectionView
.
emptyDataSetDelegate
=
weakSelf
;
...
...
@@ -98,35 +104,50 @@
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
[
weakSelf
.
prizeListCollectionView
reloadData
];
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
prizeListCollectionView
];
dispatch_group_leave
(
group
);
[
weakSelf
ErrorMBProgressView
:
NETWORK
];
}
WithFailureBlock
:^
(
NSError
*
error
)
{
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
prizeListCollectionView
];
dispatch_group_leave
(
group
);
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
}];
}
#pragma mark - 查询兑奖资格
-
(
void
)
queryExchangeQualification
{
WS
(
weakSelf
);
//任务二 查询可申请礼品
dispatch_group_enter
(
group
);
[[
NetworkRequestClassManager
Manager
]
NetworkWithDictionaryRequestWithURL
:[
NSString
stringWithFormat
:
SERVERREQUESTURL
(
EXCHANGEQUALIFICATION
),[
Shoppersmanager
manager
].
Shoppers
.
employee
.
fid
]
WithCallClass
:
weakSelf
WithRequestType
:
ONE
WithParameter
:
nil
WithReturnValueBlock
:^
(
id
returnValue
)
{
NSLog
(
@"%@"
,
returnValue
);
dispatch_group_leave
(
group
);
if
([
returnValue
[
@"code"
]
isEqualToNumber
:
@0
])
{
if
(
isRemove
)
{
[
weakSelf
.
availableArray
removeAllObjects
];
}
[
weakSelf
.
availableArray
addObjectsFromArray
:
returnValue
[
@"data"
]];
}
else
{
[
weakSelf
ErrorMBProgressView
:
returnValue
[
@"message"
]];
}
}
WithErrorCodeBlock
:^
(
id
errorCodeValue
)
{
dispatch_group_leave
(
group
);
[
weakSelf
ErrorMBProgressView
:
NETWORK
];
}
WithFailureBlock
:^
(
NSError
*
error
)
{
dispatch_group_leave
(
group
);
[
weakSelf
ErrorMBProgressView
:
error
.
localizedDescription
];
}];
// 所有请求完成后
dispatch_group_notify
(
group
,
dispatch_get_main_queue
(),
^
{
for
(
PrizeListModel
*
model
in
weakSelf
.
prizeDatasArray
)
{
if
([
weakSelf
.
availableArray
containsObject
:
model
.
fid
])
{
model
.
isAllowSelect
=
YES
;
}
}
[
weakSelf
RemoveMBProgressHUDLoding
];
[
weakSelf
endRefreshingForTableView
:
weakSelf
.
prizeListCollectionView
];
[
weakSelf
.
prizeListCollectionView
reloadData
];
});
}
#pragma mark - <UICollectionViewDelegate,UICollectionViewDataSource>
-
(
NSInteger
)
collectionView
:
(
UICollectionView
*
)
collectionView
numberOfItemsInSection
:
(
NSInteger
)
section
{
...
...
@@ -143,9 +164,12 @@
-
(
void
)
collectionView
:
(
UICollectionView
*
)
collectionView
didSelectItemAtIndexPath
:
(
NSIndexPath
*
)
indexPath
{
PrizeListCollectionViewCell
*
cell
=
(
PrizeListCollectionViewCell
*
)[
collectionView
cellForItemAtIndexPath
:
indexPath
];
cell
.
isSelectButton
.
selected
=
!
cell
.
isSelectButton
.
selected
;
PrizeListModel
*
model
=
self
.
prizeDatasArray
[
indexPath
.
item
];
model
.
isSelect
=
cell
.
isSelectButton
.
selected
;
if
(
model
.
isAllowSelect
)
{
cell
.
isSelectButton
.
selected
=
!
cell
.
isSelectButton
.
selected
;
model
.
isSelect
=
cell
.
isSelectButton
.
selected
;
}
}
#pragma mark - 申请兑奖
...
...
@@ -216,4 +240,12 @@
return
_queryPrizeModel
;
}
-
(
NSMutableArray
*
)
availableArray
{
if
(
!
_availableArray
)
{
_availableArray
=
[
NSMutableArray
array
];
}
return
_availableArray
;
}
@end
Tools/BaseViewController.h
View file @
b70036b6
...
...
@@ -108,6 +108,10 @@
*/
+
(
id
)
ReturnOrderStateTitleWithStateCode
:(
NSInteger
)
ordercode
withPoint
:(
CGPoint
)
point
WithCode
:(
NSInteger
)
code
;
/**
查询兑奖单state对应文字
*/
+
(
id
)
returnPrizeBillStateTitleColor
:(
NSString
*
)
stateCode
;
/**
* 查询购物车数量
...
...
Tools/BaseViewController.m
View file @
b70036b6
...
...
@@ -423,6 +423,13 @@
return
nil
;
}
#pragma mark - <##>查询兑奖单state对应文字
//+ (id)returnPrizeBillStateTitleColor:(NSString *)stateCode
//{
//
//}
#pragma mark -查询购物车数量
-
(
void
)
QueryShoppingCarNumber
{
...
...
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