Commit b70036b6 authored by 曹云霄's avatar 曹云霄

修改项说明:

parent a03062f0
......@@ -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
......@@ -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
......@@ -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
......@@ -25,4 +25,9 @@ typedef NS_ENUM(NSInteger,CellType){
@interface PrizeExchangeDetailsViewController : BaseViewController
@property (weak, nonatomic) IBOutlet UITableView *prizeExchangeDetailsTableView;
/**
兑奖单单号
*/
@property (nonatomic,copy) NSString *prizeBillNumber;
@end
......@@ -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;
......
......@@ -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
......@@ -12,6 +12,15 @@
- (instancetype)initWithSuper:(TOPrizeEntity *)model;
/**
是否选中
*/
@property (nonatomic,assign) BOOL isSelect;
/**
是否允许选中
*/
@property (nonatomic,assign) BOOL isAllowSelect;
@end
......@@ -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
......@@ -108,6 +108,10 @@
*/
+ (id)ReturnOrderStateTitleWithStateCode:(NSInteger)ordercode withPoint:(CGPoint)point WithCode:(NSInteger)code;
/**
查询兑奖单state对应文字
*/
+ (id)returnPrizeBillStateTitleColor:(NSString *)stateCode;
/**
* 查询购物车数量
......
......@@ -423,6 +423,13 @@
return nil;
}
#pragma mark - <##>查询兑奖单state对应文字
//+ (id)returnPrizeBillStateTitleColor:(NSString *)stateCode
//{
//
//}
#pragma mark -查询购物车数量
- (void)QueryShoppingCarNumber
{
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment