Commit 871db568 authored by 曹云霄's avatar 曹云霄

修改项说明:积分明细,兑奖记录开发

parent 16c67bd6
...@@ -7,15 +7,10 @@ ...@@ -7,15 +7,10 @@
// //
#import "GuideIntegralViewController.h" #import "GuideIntegralViewController.h"
#import "PaymentsViewController.h" #import "IntegralDetailsViewController.h"
@interface GuideIntegralViewController () @interface GuideIntegralViewController ()
/**
积分
*/
@property (nonatomic,strong) RsScoreDetails *integralDatas;
@end @end
@implementation GuideIntegralViewController @implementation GuideIntegralViewController
...@@ -23,31 +18,9 @@ ...@@ -23,31 +18,9 @@
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
[self getIntegralDataAction];
[self addChildViewController]; [self addChildViewController];
} }
#pragma mark - 获取积分数据
- (void)getIntegralDataAction
{
WS(weakSelf);
NSString *url = [NSString stringWithFormat:SERVERREQUESTURL(INTEGRALQUERY),[Shoppersmanager manager].Shoppers.employee.fid];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:url WithCallClass:weakSelf WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) {
weakSelf.integralDatas = [[RsScoreDetails alloc]initWithDictionary:returnValue[@"data"] error:nil];
[weakSelf integralAssignment:weakSelf.integralDatas];
}else {
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
} WithFailureBlock:^(NSError *error) {
}];
}
#pragma mark - 积分赋值 #pragma mark - 积分赋值
- (void)integralAssignment:(RsScoreDetails *)scoreModel - (void)integralAssignment:(RsScoreDetails *)scoreModel
{ {
...@@ -60,17 +33,22 @@ ...@@ -60,17 +33,22 @@
#pragma mark - 添加积分明细、导购头像 #pragma mark - 添加积分明细、导购头像
- (void)addChildViewController - (void)addChildViewController
{ {
PaymentsViewController *payments = [[[self class] getMainStoryboardClass] instantiateViewControllerWithIdentifier:@"PaymentsViewController"]; IntegralDetailsViewController *integralDetails = [[[self class] getGuideIntegralStoryboardClass] instantiateViewControllerWithIdentifier:@"IntegralDetailsViewController"];
[self addChildViewController:payments]; [self addChildViewController:integralDetails];
payments.view.frame = CGRectMake(0, 50, self.integralDetailsView.mj_w, self.integralDetailsView.mj_h-50); integralDetails.view.frame = CGRectMake(0, 50, self.integralDetailsView.mj_w, self.integralDetailsView.mj_h-50);
[self.integralDetailsView addSubview:payments.view]; [self.integralDetailsView addSubview:integralDetails.view];
NSString *headerurl = [Shoppersmanager manager].Shoppers.employee.picture; NSString *headerurl = [Shoppersmanager manager].Shoppers.employee.picture;
[self.guideHeaderView sd_setImageWithURL:[NSURL URLWithString:headerurl] placeholderImage:ReplaceImage]; [self.guideHeaderView sd_setImageWithURL:[NSURL URLWithString:headerurl] placeholderImage:ReplaceImage];
WS(weakSelf);
[integralDetails setReturnIntegralDetailsBlock:^(RsScoreDetails *model) {
[weakSelf integralAssignment:model];
}];
} }
#pragma mark - 礼品兑换 #pragma mark - 礼品兑换
- (IBAction)exchangeButtonClick:(UIButton *)sender { - (IBAction)exchangeButtonClick:(UIButton *)sender {
} }
......
...@@ -8,6 +8,20 @@ ...@@ -8,6 +8,20 @@
#import "BaseViewController.h" #import "BaseViewController.h"
/**
tableview类型
- intrgralTableView: 积分明细
- prizeTableView: 兑奖记录
*/
typedef NS_ENUM(NSInteger,tableViewType){
intrgralTableView = 1,
prizeTableView
};
@interface IntegralDetailsViewController : BaseViewController @interface IntegralDetailsViewController : BaseViewController
...@@ -16,4 +30,14 @@ ...@@ -16,4 +30,14 @@
*/ */
@property (weak, nonatomic) IBOutlet UITableView *integralDetailsTableView; @property (weak, nonatomic) IBOutlet UITableView *integralDetailsTableView;
/**
type:1表示积分详情,2表示兑奖记录
*/
@property (nonatomic,assign) tableViewType cellType;
/**
返回积分详情数据
*/
@property (nonatomic,copy) void(^returnIntegralDetailsBlock)(RsScoreDetails *integralModel);
@end @end
...@@ -7,31 +7,155 @@ ...@@ -7,31 +7,155 @@
// //
#import "IntegralDetailsViewController.h" #import "IntegralDetailsViewController.h"
#import "IntegralDetailsTableViewCell.h"
#import "prizeDetailsTableViewCell.h"
@interface IntegralDetailsViewController () @interface IntegralDetailsViewController ()<UITableViewDelegate,UITableViewDataSource>
/**
数据源
*/
@property (nonatomic,strong) NSMutableArray *datasArray;
@end @end
@implementation IntegralDetailsViewController @implementation IntegralDetailsViewController
- (void)viewDidAppear:(BOOL)animated
{
[self.integralDetailsTableView.mj_header beginRefreshing];
}
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
// Do any additional setup after loading the view.
[self uiConfigAction];
[self setUpRefreshAction];
} }
- (void)didReceiveMemoryWarning { #pragma mark - UI
[super didReceiveMemoryWarning]; - (void)uiConfigAction
// Dispose of any resources that can be recreated. {
self.integralDetailsTableView.rowHeight = 70;
}
#pragma mark - 设置刷新
- (void)setUpRefreshAction
{
WS(weakSelf);
MjRefreshHeaderCustom *headerRefresh = [MjRefreshHeaderCustom headerWithRefreshingBlock:^{
[weakSelf.integralDetailsTableView.mj_footer resetNoMoreData];
switch (weakSelf.cellType) {
case intrgralTableView:
{
[weakSelf queryIntegralDetails:YES];
}
break;
case prizeTableView:
{
[weakSelf queryPrizeDetails:YES];
}
break;
default:
break;
}
}];
headerRefresh.stateLabel.hidden = YES;
headerRefresh.lastUpdatedTimeLabel.hidden = YES;
self.integralDetailsTableView.mj_header = headerRefresh;
MJRefreshAutoNormalFooter *footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
switch (weakSelf.cellType) {
case intrgralTableView:
{
[weakSelf queryIntegralDetails:NO];
}
break;
case prizeTableView:
{
// if (++ weakSelf.drawModel.page.page > weakSelf.totalPage) {
// [weakSelf.integralDetailsTableView.mj_footer endRefreshingWithNoMoreData];
// }else
// {
// [weakSelf queryPrizeDetails:NO];
// }
}
break;
default:
break;
}
}];
footer.automaticallyHidden = YES;
self.integralDetailsTableView.mj_footer = footer;
} }
#pragma mark - 查询积分明细
- (void)queryIntegralDetails:(BOOL)isRemove
{
WS(weakSelf);
[self CreateMBProgressHUDLoding];
NSString *url = [NSString stringWithFormat:SERVERREQUESTURL(INTEGRALQUERY),[Shoppersmanager manager].Shoppers.employee.fid];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:url WithCallClass:weakSelf WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf endRefreshingForTableView:weakSelf.integralDetailsTableView];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
RsScoreDetails *integralDatas = [[RsScoreDetails alloc]initWithDictionary:returnValue[@"data"] error:nil];
[weakSelf.datasArray addObjectsFromArray:integralDatas.recoreds];
if (weakSelf.returnIntegralDetailsBlock) {
weakSelf.returnIntegralDetailsBlock(integralDatas);
}
}else {
[weakSelf ErrorMBProgressView:returnValue[@"message"]];
}
[weakSelf.integralDetailsTableView reloadData];
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf endRefreshingForTableView:weakSelf.integralDetailsTableView];
[weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf endRefreshingForTableView:weakSelf.integralDetailsTableView];
[weakSelf ErrorMBProgressView:error.localizedDescription];
}];
}
#pragma mark - 查询兑奖明细
- (void)queryPrizeDetails:(BOOL)isRemove
{
}
#pragma mark - <UITableViewDataSource,UITableViewDelegate>
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
IntegralDetailsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"IntegralDetailsTableViewCell" forIndexPath:indexPath];
return cell;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return self.datasArray.count;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation #pragma mark - lazy
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender { - (NSMutableArray *)datasArray
// Get the new view controller using [segue destinationViewController]. {
// Pass the selected object to the new view controller. if (!_datasArray) {
_datasArray = [NSMutableArray array];
}
return _datasArray;
} }
*/
@end @end
...@@ -162,7 +162,6 @@ ...@@ -162,7 +162,6 @@
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(SCENESCREENING) WithCallClass:weakSelf WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) { [[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(SCENESCREENING) WithCallClass:weakSelf WithRequestType:ONE WithParameter:nil WithReturnValueBlock:^(id returnValue) {
if ([returnValue[@"code"] isEqualToNumber:@0]) { if ([returnValue[@"code"] isEqualToNumber:@0]) {
weakSelf.filter = [[SceneFilter alloc]initWithDictionary:returnValue[@"data"] error:nil]; weakSelf.filter = [[SceneFilter alloc]initWithDictionary:returnValue[@"data"] error:nil];
} }
else else
...@@ -172,7 +171,7 @@ ...@@ -172,7 +171,7 @@
} WithErrorCodeBlock:^(id errorCodeValue) { } WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding]; [weakSelf RemoveMBProgressHUDLoding];
[weakSelf ErrorMBProgressView:@"无网络"]; [weakSelf ErrorMBProgressView:NETWORK];
} WithFailureBlock:^(id error) { } WithFailureBlock:^(id error) {
}]; }];
......
//
// prizeDetailsTableViewCell.h
// Lighting
//
// Created by 曹云霄 on 2016/11/22.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface prizeDetailsTableViewCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UILabel *prizeTimeLabel;
@property (weak, nonatomic) IBOutlet UILabel *prizeOrderNumberLabel;
@property (weak, nonatomic) IBOutlet UIButton *prizeStateButton;
@end
//
// prizeDetailsTableViewCell.m
// Lighting
//
// Created by 曹云霄 on 2016/11/22.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "prizeDetailsTableViewCell.h"
@implementation prizeDetailsTableViewCell
- (void)awakeFromNib {
[super awakeFromNib];
// Initialization code
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
// Configure the view for the selected state
}
- (IBAction)prizeStateButtonClickAction:(UIButton *)sender {
}
@end
...@@ -187,6 +187,7 @@ ...@@ -187,6 +187,7 @@
29E384C81CE9A8BF00888199 /* SearchCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E384C71CE9A8BF00888199 /* SearchCollectionViewCell.m */; }; 29E384C81CE9A8BF00888199 /* SearchCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E384C71CE9A8BF00888199 /* SearchCollectionViewCell.m */; };
29E384CB1CE9B0BB00888199 /* HotCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E384CA1CE9B0BB00888199 /* HotCollectionViewCell.m */; }; 29E384CB1CE9B0BB00888199 /* HotCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E384CA1CE9B0BB00888199 /* HotCollectionViewCell.m */; };
29E384D11CE9C65700888199 /* SearchViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E384D01CE9C65700888199 /* SearchViewController.m */; }; 29E384D11CE9C65700888199 /* SearchViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E384D01CE9C65700888199 /* SearchViewController.m */; };
29E9443D1DE3E0D0007CD26C /* prizeDetailsTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29E9443C1DE3E0D0007CD26C /* prizeDetailsTableViewCell.m */; };
29EAAE8E1CDC3E8E00C4DBA2 /* BillingInfoView.m in Sources */ = {isa = PBXBuildFile; fileRef = 29EAAE8D1CDC3E8E00C4DBA2 /* BillingInfoView.m */; }; 29EAAE8E1CDC3E8E00C4DBA2 /* BillingInfoView.m in Sources */ = {isa = PBXBuildFile; fileRef = 29EAAE8D1CDC3E8E00C4DBA2 /* BillingInfoView.m */; };
29EAAE901CDC3E9700C4DBA2 /* BillingInfoView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29EAAE8F1CDC3E9700C4DBA2 /* BillingInfoView.xib */; }; 29EAAE901CDC3E9700C4DBA2 /* BillingInfoView.xib in Resources */ = {isa = PBXBuildFile; fileRef = 29EAAE8F1CDC3E9700C4DBA2 /* BillingInfoView.xib */; };
29EAAE951CDC414C00C4DBA2 /* SeceneLibraryCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29EAAE941CDC414C00C4DBA2 /* SeceneLibraryCollectionViewCell.m */; }; 29EAAE951CDC414C00C4DBA2 /* SeceneLibraryCollectionViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 29EAAE941CDC414C00C4DBA2 /* SeceneLibraryCollectionViewCell.m */; };
...@@ -546,6 +547,8 @@ ...@@ -546,6 +547,8 @@
29E384CA1CE9B0BB00888199 /* HotCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HotCollectionViewCell.m; sourceTree = "<group>"; }; 29E384CA1CE9B0BB00888199 /* HotCollectionViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = HotCollectionViewCell.m; sourceTree = "<group>"; };
29E384CF1CE9C65700888199 /* SearchViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SearchViewController.h; sourceTree = "<group>"; }; 29E384CF1CE9C65700888199 /* SearchViewController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SearchViewController.h; sourceTree = "<group>"; };
29E384D01CE9C65700888199 /* SearchViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SearchViewController.m; sourceTree = "<group>"; }; 29E384D01CE9C65700888199 /* SearchViewController.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = SearchViewController.m; sourceTree = "<group>"; };
29E9443B1DE3E0D0007CD26C /* prizeDetailsTableViewCell.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = prizeDetailsTableViewCell.h; sourceTree = "<group>"; };
29E9443C1DE3E0D0007CD26C /* prizeDetailsTableViewCell.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = prizeDetailsTableViewCell.m; sourceTree = "<group>"; };
29EAAE8C1CDC3E8E00C4DBA2 /* BillingInfoView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BillingInfoView.h; sourceTree = "<group>"; }; 29EAAE8C1CDC3E8E00C4DBA2 /* BillingInfoView.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = BillingInfoView.h; sourceTree = "<group>"; };
29EAAE8D1CDC3E8E00C4DBA2 /* BillingInfoView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BillingInfoView.m; sourceTree = "<group>"; }; 29EAAE8D1CDC3E8E00C4DBA2 /* BillingInfoView.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = BillingInfoView.m; sourceTree = "<group>"; };
29EAAE8F1CDC3E9700C4DBA2 /* BillingInfoView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = BillingInfoView.xib; sourceTree = "<group>"; }; 29EAAE8F1CDC3E9700C4DBA2 /* BillingInfoView.xib */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = file.xib; path = BillingInfoView.xib; sourceTree = "<group>"; };
...@@ -931,6 +934,8 @@ ...@@ -931,6 +934,8 @@
children = ( children = (
292AD2021DE30A5F003EC56E /* IntegralDetailsTableViewCell.h */, 292AD2021DE30A5F003EC56E /* IntegralDetailsTableViewCell.h */,
292AD2031DE30A5F003EC56E /* IntegralDetailsTableViewCell.m */, 292AD2031DE30A5F003EC56E /* IntegralDetailsTableViewCell.m */,
29E9443B1DE3E0D0007CD26C /* prizeDetailsTableViewCell.h */,
29E9443C1DE3E0D0007CD26C /* prizeDetailsTableViewCell.m */,
); );
name = Cells; name = Cells;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -2078,6 +2083,7 @@ ...@@ -2078,6 +2083,7 @@
29498C5D1D053B2C004FA79B /* ShoppingBagViewController.m in Sources */, 29498C5D1D053B2C004FA79B /* ShoppingBagViewController.m in Sources */,
291D6A5C1CFFDCCA007891AE /* SceneListModel.m in Sources */, 291D6A5C1CFFDCCA007891AE /* SceneListModel.m in Sources */,
299876331CD997DF00C90D0A /* OrderInformationTableViewCell.m in Sources */, 299876331CD997DF00C90D0A /* OrderInformationTableViewCell.m in Sources */,
29E9443D1DE3E0D0007CD26C /* prizeDetailsTableViewCell.m in Sources */,
29CB35421CFF0FB60061A5F3 /* ScreeningCollectionViewCell.m in Sources */, 29CB35421CFF0FB60061A5F3 /* ScreeningCollectionViewCell.m in Sources */,
2994C0151CFBE793005A80AF /* PayViewController.m in Sources */, 2994C0151CFBE793005A80AF /* PayViewController.m in Sources */,
2925D03D1CFEE5D7008879BC /* ScreeningTableViewCell.m in Sources */, 2925D03D1CFEE5D7008879BC /* ScreeningTableViewCell.m in Sources */,
......
This diff is collapsed.
{
"images" : [
{
"idiom" : "universal",
"filename" : "right.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "right@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "right@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
...@@ -41,7 +41,7 @@ ...@@ -41,7 +41,7 @@
/** /**
* 传入数据源 * 传入数据源
*/ */
@property (nonatomic,strong) NSArray *datasArray; @property (nonatomic,strong) NSMutableArray *datasArray;
/** /**
* 代理 * 代理
......
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