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

修改项说明:

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