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

增加导购提现功能

parent 4b771a05
......@@ -10,4 +10,9 @@
@interface PaymentsDetailsTableViewController : UITableViewController
/**
* 数据源
*/
@property (nonatomic,strong) TOCommissionHistEntity *model;
@end
......@@ -10,6 +10,31 @@
@interface PaymentsDetailsTableViewController ()
/**
* 金额
*/
@property (weak, nonatomic) IBOutlet UILabel *amountLabel;
/**
* 金额类型
*/
@property (weak, nonatomic) IBOutlet UILabel *amountTypeLabel;
/**
* 时间
*/
@property (weak, nonatomic) IBOutlet UILabel *createTimeLabel;
/**
* 流水号
*/
@property (weak, nonatomic) IBOutlet UILabel *serialNumberLabel;
/**
* 余额
*/
@property (weak, nonatomic) IBOutlet UILabel *currentAmountLabel;
@end
@implementation PaymentsDetailsTableViewController
......@@ -17,82 +42,25 @@
- (void)viewDidLoad {
[super viewDidLoad];
// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;
// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
[self uiConfigAction];
[self fillDataAction];
}
//
//- (void)didReceiveMemoryWarning {
// [super didReceiveMemoryWarning];
// // Dispose of any resources that can be recreated.
//}
//
//#pragma mark - Table view data source
//
//- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
//#warning Incomplete implementation, return the number of sections
// return 0;
//}
//
//- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
//#warning Incomplete implementation, return the number of rows
// return 0;
//}
/*
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath];
// Configure the cell...
return cell;
#pragma mark - UI
- (void)uiConfigAction
{
self.tableView.tableFooterView = [UIView new];
}
*/
/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the specified item to be editable.
return YES;
#pragma mark - 填充数据
- (void)fillDataAction
{
NSString *string = ([self.model.amount floatValue] > 0)?[NSString stringWithFormat:@"+%.2f",[self.model.amount floatValue]]:[NSString stringWithFormat:@"%.2f",[self.model.amount floatValue]];
self.amountLabel.text = string;
self.createTimeLabel.text = self.model.createDate;
self.serialNumberLabel.text = self.model.orderNumber;
}
*/
/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath {
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:@[indexPath] withRowAnimation:UITableViewRowAnimationFade];
} else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
*/
/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath {
}
*/
/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath {
// Return NO if you do not want the item to be re-orderable.
return YES;
}
*/
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end
......@@ -10,4 +10,22 @@
@interface PaymentsTableViewCell : UITableViewCell
/**
* 返佣、提现
*/
@property (weak, nonatomic) IBOutlet UILabel *moneyTypeLabel;
/**
* 时间
*/
@property (weak, nonatomic) IBOutlet UILabel *createTimeLabel;
/**
* 金额
*/
@property (weak, nonatomic) IBOutlet UILabel *amountLabel;
@end
......@@ -14,33 +14,127 @@
@interface PaymentsViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *paymentsTableView;
/**
* 上传参数
*/
@property (nonatomic,strong) RsCommissionRequest *model;
/**
* 数据源
*/
@property (nonatomic,strong) NSMutableArray *resultArray;
/**
* 总页数
*/
@property (nonatomic,assign) NSInteger totalPage;
@end
@implementation PaymentsViewController
#pragma mark - lazy
- (RsCommissionRequest *)model
{
if (!_model) {
_model = [[RsCommissionRequest alloc]init];
DataPage *page = [[DataPage alloc]init];
page.page = Zero;
page.rows = KROWS;
_model.page = page;
_model.emploreeId = [Shoppersmanager manager].Shoppers.employee.fid;
}
return _model;
}
- (NSMutableArray *)resultArray
{
if (!_resultArray) {
_resultArray = [NSMutableArray array];
}
return _resultArray;
}
- (void)viewDidLoad {
[super viewDidLoad];
[self uiConfigAction];
self.paymentsTableView.tableFooterView = [UIView new];
[self setupRefreshing];
}
#pragma mark - UI
- (void)uiConfigAction
#pragma mark - 设置刷新
- (void)setupRefreshing
{
WS(weakSelf);
MjRefreshHeaderCustom *headerRefresh = [MjRefreshHeaderCustom headerWithRefreshingBlock:^{
weakSelf.model.page.page = 0;
[weakSelf.paymentsTableView.mj_footer resetNoMoreData];
[weakSelf getDatasAction:YES];
}];
headerRefresh.stateLabel.hidden = YES;
headerRefresh.lastUpdatedTimeLabel.hidden = YES;
self.paymentsTableView.mj_header = headerRefresh;
[self.paymentsTableView.mj_header beginRefreshing];
self.paymentsTableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
if (++ weakSelf.model.page.page >= weakSelf.totalPage) {
[weakSelf.paymentsTableView.mj_footer endRefreshingWithNoMoreData];
}else
{
[weakSelf getDatasAction:NO];
}
}];
}
#pragma mark - 获取收支明细
- (void)getDatasAction:(BOOL)isRemoveAll
{
WS(weakSelf);
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(PAYMENTS) WithRequestType:0 WithParameter:self.model WithReturnValueBlock:^(id returnValue) {
[weakSelf endRefreshingForTableView:weakSelf.paymentsTableView];
[weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
if (isRemoveAll) {
[weakSelf.resultArray removeAllObjects];
}
RsCommissionResponse *result = [[RsCommissionResponse alloc]initWithDictionary:returnValue[@"data"] error:nil];
weakSelf.totalPage = result.totalpages;
for (TOCommissionHistEntity *entity in result.list) {
[weakSelf.resultArray addObject:entity];
}
[weakSelf.paymentsTableView reloadData];
}else
{
[weakSelf SHOWPrompttext:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf endRefreshingForTableView:weakSelf.paymentsTableView];
[weakSelf SHOWPrompttext:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.paymentsTableView];
[weakSelf SHOWPrompttext:error.localizedDescription];
}];
}
#pragma mark - <UITableViewDataSource,UITableViewDelegate>
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
PaymentsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"PaymentsTableViewCell" forIndexPath:indexPath];
TOCommissionHistEntity *entity = self.resultArray[indexPath.row];
cell.createTimeLabel.text = entity.createDate;
cell.moneyTypeLabel.text = [self separatePaymentsAndWithfrawal:entity.state];
NSString *string = ([entity.amount floatValue] > 0)?[NSString stringWithFormat:@"+%.2f",[entity.amount floatValue]]:[NSString stringWithFormat:@"%.2f",[entity.amount floatValue]];
cell.amountLabel.text = string;
return cell;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 10;
return self.resultArray.count;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
......@@ -52,10 +146,21 @@
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
PaymentsDetailsTableViewController *paymentsDetailsVC = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"PaymentsDetailsTableViewController"];
paymentsDetailsVC.model = self.resultArray[indexPath.row];
[self.navigationController pushViewController:paymentsDetailsVC animated:YES];
}
#pragma mark - 区分提现还是返佣
- (NSString *)separatePaymentsAndWithfrawal:(NSString *)state
{
if ([state isEqualToString:@"0"]) {
return @"返佣";
}
if ([state isEqualToString:@"1"]) {
return @"提现";
}
return nil;
}
......
//
// RebateDetailsViewController.h
// Lighting
//
// Created by 曹云霄 on 16/8/28.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "BaseViewController.h"
@interface RebateDetailsViewController : BaseViewController
/**
* 最大提现金额
*/
@property (nonatomic,copy) NSString *rebateAmount;
/**
* 查看此次申请详情
*/
@property (nonatomic,copy) void(^showApplyDetails)(TOApplyBillEntity *model);
@end
//
// RebateDetailsViewController.m
// Lighting
//
// Created by 曹云霄 on 16/8/28.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "RebateDetailsViewController.h"
#import "RebateSuccessTableViewController.h"
@interface RebateDetailsViewController ()
/**
* 输入提现金额
*/
@property (weak, nonatomic) IBOutlet UITextField *inputRebateTextField;
/**
* 本次申请的UUID
*/
@property (nonatomic,copy) NSString *applyUUID;
@end
@implementation RebateDetailsViewController
- (void)viewDidLoad {
[super viewDidLoad];
}
- (IBAction)rebateButtonClickAction:(UIButton *)sender {
WS(weakSelf);
if (![self.inputRebateTextField.text length]) {
[self SHOWPrompttext:@"请输入提现金额"];return;
}
if ([self.inputRebateTextField.text floatValue] > [self.rebateAmount floatValue]) {
[self SHOWPrompttext:@"当前账户余额不足"];return;
}
UIAlertController *alertVC = [UIAlertController alertControllerWithTitle:nil message:[NSString stringWithFormat:@"请确认提现金额:%@元",self.inputRebateTextField.text] preferredStyle:UIAlertControllerStyleAlert];
[alertVC addAction:[UIAlertAction actionWithTitle:@"确认" style:UIAlertActionStyleDefault handler:^(UIAlertAction * _Nonnull action) {
[weakSelf CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(WITHDRAWAL) WithRequestType:0 WithParameter:@{@"amount":self.inputRebateTextField.text} WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
weakSelf.applyUUID = returnValue[@"data"];
[weakSelf rebateApplySuccess];
}else
{
[weakSelf SHOWPrompttext:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:error.localizedDescription];
}];
}]];
[alertVC addAction:[UIAlertAction actionWithTitle:@"取消" style:UIAlertActionStyleCancel handler:^(UIAlertAction * _Nonnull action) {
}]];
[self presentViewController:alertVC animated:YES completion:nil];
}
#pragma mark - 提现申请成功
- (void)rebateApplySuccess
{
WS(weakSelf);
RebateSuccessTableViewController *success = [self.getStoryboardWithName instantiateViewControllerWithIdentifier:@"RebateSuccessTableViewController"];
[success setClickEvent:^(NSIndexPath *indexPath) {
if (indexPath.row == 1) {
[weakSelf.navigationController popViewControllerAnimated:YES];
}else if (indexPath.row == 0)
{
[weakSelf queryDetails];
}
}];
success.preferredContentSize = CGSizeMake(315, 320);
success.modalPresentationStyle = UIModalPresentationFormSheet;
UIPopoverPresentationController *pop = success.popoverPresentationController;
pop.permittedArrowDirections = UIPopoverArrowDirectionAny;
pop.sourceView = success.view;
[self presentViewController:success animated:YES completion:nil];
}
#pragma mark - 查询详情
- (void)queryDetails
{
[self CreateMBProgressHUDLoding];
WS(weakSelf);
NSString *urlString = [NSString stringWithFormat:@"%@/%@",WITHDRAWALPROGRESSDETAILS,self.applyUUID];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(urlString) WithRequestType:0 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
TOApplyBillEntity *result = [[TOApplyBillEntity alloc]initWithDictionary:returnValue[@"data"] error:nil];
[weakSelf.navigationController popViewControllerAnimated:NO];
if (weakSelf.showApplyDetails) {
weakSelf.showApplyDetails(result);
}
}else
{
[weakSelf SHOWPrompttext:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:error.localizedDescription];
}];
}
@end
//
// RebateSuccessTableViewController.h
// Lighting
//
// Created by 曹云霄 on 16/8/28.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface RebateSuccessTableViewController : UITableViewController
/**
* 点击事件
*/
@property (nonatomic,copy) void(^ClickEvent)(NSIndexPath *indexPath);
@end
//
// RebateSuccessTableViewController.m
// Lighting
//
// Created by 曹云霄 on 16/8/28.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "RebateSuccessTableViewController.h"
@interface RebateSuccessTableViewController ()
///
@property (weak, nonatomic) IBOutlet UITableViewRowAction *showRebateDetailsCell;
@property (weak, nonatomic) IBOutlet UITableViewRowAction *backAccountCell;
@end
@implementation RebateSuccessTableViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.tableView.tableFooterView = [UIView new];
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
[self dismissViewControllerAnimated:YES completion:nil];
if (self.ClickEvent) {
self.ClickEvent(indexPath);
}
}
@end
......@@ -9,6 +9,9 @@
#import "RebateViewController.h"
#import "PaymentsViewController.h"
#import "WithdrawalViewController.h"
#import "RebateDetailsViewController.h"
#import "WithdrawalTableViewController.h"
@interface RebateViewController ()
......@@ -62,6 +65,11 @@
*/
@property (weak, nonatomic) IBOutlet UIButton *withdrawalProgressButton;
/**
* 账户数据
*/
@property (nonatomic,strong) EarningsRequest *model;
@end
......@@ -72,6 +80,7 @@
[self setupChildViewController];
[self uiConfigAction];
[self getRebateDatasFromUser];
}
#pragma mark - UI
......@@ -130,5 +139,64 @@
}
#pragma mark - 查询返利信息
- (void)getRebateDatasFromUser
{
WS(weakSelf);
[self CreateMBProgressHUDLoding];
NSString *URL = [NSString stringWithFormat:@"%@/%@",REBATE,[Shoppersmanager manager].Shoppers.employee.fid];
[[NetworkRequestClassManager Manager] NetworkWithDictionaryRequestWithURL:SERVERREQUESTURL(URL) WithRequestType:0 WithParameter:nil WithReturnValueBlock:^(id returnValue) {
[weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
weakSelf.model = [[EarningsRequest alloc]initWithDictionary:returnValue[@"data"] error:nil];
weakSelf.currentAmountLabel.text = [returnValue[@"data"][@"accountTotal"] stringValue];
// weakSelf.yesterdayAmountLabel.text = [returnValue[@"data"][@"yesterdayEarnings"] stringValue];
weakSelf.historyAmountLabel.text = [returnValue[@"data"][@"historyEarning"] stringValue];
}else
{
[weakSelf SHOWPrompttext:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:error.localizedDescription];
}];
}
#pragma mark - 提现
- (IBAction)withdrawalButtonClickAction:(UIButton *)sender {
WS(weakSelf);
RebateDetailsViewController *rebateDetails = [self.getStoryboardWithName instantiateViewControllerWithIdentifier:@"RebateDetailsViewController"];
rebateDetails.rebateAmount = [self.model.accountTotal stringValue];
[rebateDetails setShowApplyDetails:^(TOApplyBillEntity *entity) {
WithdrawalTableViewController *detailVC = [weakSelf.getStoryboardWithName instantiateViewControllerWithIdentifier:@"WithdrawalTableViewController"];
[weakSelf.navigationController pushViewController:detailVC animated:YES];
}];
[self.navigationController pushViewController:rebateDetails animated:YES];
}
@end
......@@ -33,8 +33,6 @@
*/
@property (weak, nonatomic) IBOutlet UIView *BackView;
/**
* 结算的商品数据源
*/
......
......@@ -10,4 +10,20 @@
@interface WithdrawalTableViewCell : UITableViewCell
/**
* 进度
*/
@property (weak, nonatomic) IBOutlet UILabel *progressLabel;
/**
* 时间
*/
@property (weak, nonatomic) IBOutlet UILabel *createTimeLabel;
/**
* 金额
*/
@property (weak, nonatomic) IBOutlet UILabel *amountLabel;
@end
//
// WithdrawalTableViewController.h
// Lighting
//
// Created by 曹云霄 on 16/8/28.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import <UIKit/UIKit.h>
@interface WithdrawalTableViewController : UITableViewController
/**
* 数据源
*/
@property (nonatomic,strong) TOApplyBillEntity *model;
/**
* 进度条图片
*/
@property (weak, nonatomic) IBOutlet UIImageView *progressImageView;
/**
* 提交申请时间
*/
@property (weak, nonatomic) IBOutlet UILabel *submitApplyTimeLabel;
/**
* 到账成功
*/
@property (weak, nonatomic) IBOutlet UILabel *applyCompleteLabel;
/**
* 到账时间
*/
@property (weak, nonatomic) IBOutlet UILabel *appleCompleteTimeLabel;
/**
* 金额
*/
@property (weak, nonatomic) IBOutlet UILabel *amountLabel;
/**
* 订单时间
*/
@property (weak, nonatomic) IBOutlet UILabel *orderTimeLabel;
/**
* 流水号
*/
@property (weak, nonatomic) IBOutlet UILabel *orderBillNumberLabel;
@end
//
// WithdrawalTableViewController.m
// Lighting
//
// Created by 曹云霄 on 16/8/28.
// Copyright © 2016年 上海勾芒科技有限公司. All rights reserved.
//
#import "WithdrawalTableViewController.h"
@interface WithdrawalTableViewController ()
@end
@implementation WithdrawalTableViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self uiConfigAction];
[self fillDataAction];
}
#pragma mark - UI
- (void)uiConfigAction
{
self.tableView.tableFooterView = [UIView new];
}
#pragma mark - 填充数据
- (void)fillDataAction
{
BOOL boolValue = [self.model.billStates isEqualToString:@"到账成功"];
self.progressImageView.image = boolValue?TCImage(@"finish"):TCImage(@"progress");
self.appleCompleteTimeLabel.hidden = !boolValue;
self.appleCompleteTimeLabel.textColor = [self setupLabelColor:self.model.billStates];
self.appleCompleteTimeLabel.text = self.model.updateDate;
self.submitApplyTimeLabel.text = self.model.createDate;
self.orderTimeLabel.text = self.model.createDate;
self.orderBillNumberLabel.text = self.model.billNumber;
self.amountLabel.text = [self.model.applyMoney stringValue];
}
#pragma mark - 设置字体颜色
- (UIColor *)setupLabelColor:(NSString *)text
{
if ([text isEqualToString:@"到账成功"]) {
return RGB(89, 172, 220, 1);
}
if ([text isEqualToString:@"申请已提交"]) {
return RGB(128, 189, 51, 1);
}
return nil;
}
@end
......@@ -8,38 +8,132 @@
#import "WithdrawalViewController.h"
#import "WithdrawalTableViewCell.h"
#import "WithdrawalTableViewController.h"
@interface WithdrawalViewController ()
@property (weak, nonatomic) IBOutlet UITableView *withdrawalTableView;
/**
* 上传参数
*/
@property (nonatomic,strong) RsApplyBillRequest *model;
/**
* 数据源
*/
@property (nonatomic,strong) NSMutableArray *resultArray;
/**
* 总页数
*/
@property (nonatomic,assign) NSInteger totalPage;
@end
@implementation WithdrawalViewController
#pragma mark - lazy
- (RsApplyBillRequest *)model
{
if (!_model) {
_model = [[RsApplyBillRequest alloc]init];
DataPage *page = [[DataPage alloc]init];
page.page = Zero;
page.rows = KROWS;
_model.page = page;
_model.employeeId = [Shoppersmanager manager].Shoppers.employee.fid;
}
return _model;
}
- (NSMutableArray *)resultArray
{
if (!_resultArray) {
_resultArray = [NSMutableArray array];
}
return _resultArray;
}
- (void)viewDidLoad {
[super viewDidLoad];
[self uiConfigAction];
[self setupRefreshing];
}
#pragma mark - UI
- (void)uiConfigAction
#pragma mark - 设置刷新
- (void)setupRefreshing
{
WS(weakSelf);
MjRefreshHeaderCustom *headerRefresh = [MjRefreshHeaderCustom headerWithRefreshingBlock:^{
weakSelf.model.page.page = 0;
[weakSelf.withdrawalTableView.mj_footer resetNoMoreData];
[weakSelf getDatasAction:YES];
}];
headerRefresh.stateLabel.hidden = YES;
headerRefresh.lastUpdatedTimeLabel.hidden = YES;
self.withdrawalTableView.mj_header = headerRefresh;
[self.withdrawalTableView.mj_header beginRefreshing];
self.withdrawalTableView.mj_footer = [MJRefreshAutoNormalFooter footerWithRefreshingBlock:^{
if (++ weakSelf.model.page.page >= weakSelf.totalPage) {
[weakSelf.withdrawalTableView.mj_footer endRefreshingWithNoMoreData];
}else
{
[weakSelf getDatasAction:NO];
}
}];
}
#pragma mark - 获取收支明细
- (void)getDatasAction:(BOOL)isRemoveAll
{
WS(weakSelf);
[self CreateMBProgressHUDLoding];
[[NetworkRequestClassManager Manager] NetworkRequestWithURL:SERVERREQUESTURL(WITHDRAWALPROGRESS) WithRequestType:0 WithParameter:self.model WithReturnValueBlock:^(id returnValue) {
[weakSelf endRefreshingForTableView:weakSelf.withdrawalTableView];
[weakSelf RemoveMBProgressHUDLoding];
if ([returnValue[@"code"] isEqualToNumber:@0]) {
if (isRemoveAll) {
[weakSelf.resultArray removeAllObjects];
}
RsApplyBillResponse *result = [[RsApplyBillResponse alloc]initWithDictionary:returnValue[@"data"] error:nil];
weakSelf.totalPage = result.totalpages;
for (TOApplyBillEntity *entity in result.list) {
[weakSelf.resultArray addObject:entity];
}
[weakSelf.withdrawalTableView reloadData];
}else
{
[weakSelf SHOWPrompttext:returnValue[@"message"]];
}
} WithErrorCodeBlock:^(id errorCodeValue) {
[weakSelf endRefreshingForTableView:weakSelf.withdrawalTableView];
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:NETWORK];
} WithFailureBlock:^(NSError *error) {
[weakSelf endRefreshingForTableView:weakSelf.withdrawalTableView];
[weakSelf RemoveMBProgressHUDLoding];
[weakSelf SHOWPrompttext:error.localizedDescription];
}];
}
#pragma mark - <UITableViewDataSource,UITableViewDelegate>
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
WithdrawalTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"WithdrawalTableViewCell" forIndexPath:indexPath];
TOApplyBillEntity *entity = self.resultArray[indexPath.row];
cell.amountLabel.text = [entity.applyMoney stringValue];
cell.createTimeLabel.text = entity.createDate;
cell.progressLabel.textColor = [self setupLabelColor:entity.billStates];
cell.progressLabel.text = entity.billStates;
return cell;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return 10;
return self.resultArray.count;
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
......@@ -50,8 +144,29 @@
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[tableView deselectRowAtIndexPath:indexPath animated:YES];
WithdrawalTableViewController *paymentsDetailsVC = [[self getStoryboardWithName] instantiateViewControllerWithIdentifier:@"WithdrawalTableViewController"];
paymentsDetailsVC.model = self.resultArray[indexPath.row];
[self.navigationController pushViewController:paymentsDetailsVC animated:YES];
}
#pragma mark - 设置字体颜色
- (UIColor *)setupLabelColor:(NSString *)text
{
if ([text isEqualToString:@"到账成功"]) {
return RGB(89, 172, 220, 1);
}
if ([text isEqualToString:@"申请已提交"]) {
return RGB(128, 189, 51, 1);
}
return nil;
}
@end
This diff is collapsed.
{
"images" : [
{
"idiom" : "universal",
"filename" : "finish.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "finish@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "finish@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "green.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "green@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "green@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
{
"images" : [
{
"idiom" : "universal",
"filename" : "progress.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "progress@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "progress@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
......@@ -7,17 +7,13 @@
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>com.gomore.opple</string>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>欧立方</string>
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
<string>1.0.5</string>
<key>CFBundleSignature</key>
<string>????</string>
<key>CFBundleURLTypes</key>
<array>
<dict>
......@@ -72,6 +68,8 @@
<string>LaunchScreen</string>
<key>UIMainStoryboardFile</key>
<string>Main</string>
<key>UIMainStoryboardFile~ipad</key>
<string>Main</string>
<key>UIRequiredDeviceCapabilities</key>
<array>
<string>armv7</string>
......
......@@ -192,6 +192,30 @@
*/
#define VERSION @"/employee/getUpgrade?"
/**
* 查询返利信息
*/
#define REBATE @"/applybill/getTotal"
/**
* 提现
*/
#define WITHDRAWAL @"/applybill/save"
/**
* 收支明细
*/
#define PAYMENTS @"/applybill/queryCommission"
/**
* 提现进度
*/
#define WITHDRAWALPROGRESS @"/applybill/queryApplyBill"
/**
* 提现进度详情
*/
#define WITHDRAWALPROGRESSDETAILS @"/applybill/getDetailState"
......
......@@ -19,18 +19,18 @@
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"animation%ld", i]];
[idleImages addObject:image];
}
[self setImages:idleImages forState:MJRefreshStateIdle];
[self setImages:idleImages forState:1];
// 设置即将刷新状态的动画图片(一松开就会刷新的状态
// 设置即将刷新状态的动画图片(一松开就会刷新的状态
NSMutableArray *refreshingImages = [NSMutableArray array];
for (NSUInteger i = 1; i<=5; i++) {
UIImage *image = [UIImage imageNamed:[NSString stringWithFormat:@"animation%ld", i]];
[refreshingImages addObject:image];
}
[self setImages:refreshingImages forState:MJRefreshStatePulling];
[self setImages:refreshingImages forState:2];
// 设置正在刷新状态的动画图片
[self setImages:refreshingImages forState:MJRefreshStateRefreshing];
[self setImages:refreshingImages forState:3];
}
@end
......@@ -34,7 +34,6 @@
#import "HeaderforURL.h"
#import "UINavigationController+FDFullscreenPopGesture.h"
#import "UIView+cornerRadius.h"
// Include any system framework and library headers here that should be included in all compilation units.
// You will also need to set the Prefix Header build setting of one or more of your targets to reference this file.
......@@ -113,12 +112,12 @@
/**
* 服务器开发地址
*/
//#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://139.196.195.30:8090/opple-web/app%@",URL]
#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://139.196.195.30:8090/opple-web/app%@",URL]
/**
* 服务器测试地址
*/
#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg-dev.opple.com/opple-web/app%@",URL]
//#define SERVERREQUESTURL(URL) [NSString stringWithFormat:@"http://dg-dev.opple.com/opple-web/app%@",URL]
///**
// * 服务器正式地址
......@@ -197,7 +196,10 @@
*/
#define UPLOADVERSION @"uploadVersion"
/**
* 网络断开
*/
#define NETWORK @"网络已断开"
......
This diff is collapsed.
This diff is collapsed.
platform:ios,'9.0'
pod 'FDFullscreenPopGesture', '~> 1.1'
pod 'MBProgressHUD', '~> 0.9.2'
pod 'SVProgressHUD', '~> 2.0.3'
......
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