Commit cd5f8851 authored by Sandy's avatar Sandy

核销订单等功能完成

parent 4f34f0e9
......@@ -8,6 +8,7 @@
/* Begin PBXBuildFile section */
19413CC62AA7F91BAA93A7AC /* libPods-car_base-Car.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F5E1689EFB8A98572A90A6D3 /* libPods-car_base-Car.a */; };
3ACF93FF5CBBDE59C28DC356 /* libPods-car_base-Car-Customer Release.a in Frameworks */ = {isa = PBXBuildFile; fileRef = C54D3C7AD614F01AAF598ED8 /* libPods-car_base-Car-Customer Release.a */; };
53DE6594F962D3D35D9FB355 /* libPods-car_base-Car Release.a in Frameworks */ = {isa = PBXBuildFile; fileRef = E3A60FCFD401BA3D051DAF70 /* libPods-car_base-Car Release.a */; };
8F2095511E15171600FBED74 /* UMengHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F2095501E15171600FBED74 /* UMengHelper.m */; };
8F2095521E15171600FBED74 /* UMengHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F2095501E15171600FBED74 /* UMengHelper.m */; };
......@@ -118,6 +119,7 @@
8FFE3E0C1E14AC6700BEB6A6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8F97C2C71E0CC4BE00D8A57D /* Assets.xcassets */; };
8FFE3E0D1E14AC6700BEB6A6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8F97C2C41E0CC4BE00D8A57D /* Main.storyboard */; };
8FFE3E0E1E14AC6700BEB6A6 /* CodeScan.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 8FC2BDC21E1285F700A879C1 /* CodeScan.bundle */; };
F16EFE19711BD2F266C2D5A4 /* libPods-car_base-Car-Customer.a in Frameworks */ = {isa = PBXBuildFile; fileRef = 9B728771192ABAD4E95A586F /* libPods-car_base-Car-Customer.a */; };
/* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */
......@@ -263,8 +265,14 @@
8FFE3D991E13A8AA00BEB6A6 /* car_objc_json_client.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = car_objc_json_client.h; sourceTree = "<group>"; };
8FFE3E141E14AC6700BEB6A6 /* Car-Customer Release.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Car-Customer Release.app"; sourceTree = BUILT_PRODUCTS_DIR; };
8FFE3E151E14AC6700BEB6A6 /* Car Release.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; name = "Car Release.plist"; path = "/Users/Javen/Documents/MyProject/Car-iOS/Car Release.plist"; sourceTree = "<absolute>"; };
9B728771192ABAD4E95A586F /* libPods-car_base-Car-Customer.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-car_base-Car-Customer.a"; sourceTree = BUILT_PRODUCTS_DIR; };
A5E2324AC29CF797BD9B1963 /* Pods-car_base-Car-Customer Release.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-car_base-Car-Customer Release.release.xcconfig"; path = "Pods/Target Support Files/Pods-car_base-Car-Customer Release/Pods-car_base-Car-Customer Release.release.xcconfig"; sourceTree = "<group>"; };
C54D3C7AD614F01AAF598ED8 /* libPods-car_base-Car-Customer Release.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-car_base-Car-Customer Release.a"; sourceTree = BUILT_PRODUCTS_DIR; };
D18C257D0E5B93CEB8753920 /* Pods-car_base-Car-Customer.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-car_base-Car-Customer.debug.xcconfig"; path = "Pods/Target Support Files/Pods-car_base-Car-Customer/Pods-car_base-Car-Customer.debug.xcconfig"; sourceTree = "<group>"; };
D4BC599BDCE4593FFA63789C /* Pods-car_base-Car-Customer Release.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-car_base-Car-Customer Release.debug.xcconfig"; path = "Pods/Target Support Files/Pods-car_base-Car-Customer Release/Pods-car_base-Car-Customer Release.debug.xcconfig"; sourceTree = "<group>"; };
D84929CB776A620566CE3CB6 /* Pods-car_base-Car Release.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-car_base-Car Release.release.xcconfig"; path = "Pods/Target Support Files/Pods-car_base-Car Release/Pods-car_base-Car Release.release.xcconfig"; sourceTree = "<group>"; };
E3A60FCFD401BA3D051DAF70 /* libPods-car_base-Car Release.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-car_base-Car Release.a"; sourceTree = BUILT_PRODUCTS_DIR; };
F405B1E31F164E40648DEDA9 /* Pods-car_base-Car-Customer.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-car_base-Car-Customer.release.xcconfig"; path = "Pods/Target Support Files/Pods-car_base-Car-Customer/Pods-car_base-Car-Customer.release.xcconfig"; sourceTree = "<group>"; };
F5E1689EFB8A98572A90A6D3 /* libPods-car_base-Car.a */ = {isa = PBXFileReference; explicitFileType = archive.ar; includeInIndex = 0; path = "libPods-car_base-Car.a"; sourceTree = BUILT_PRODUCTS_DIR; };
/* End PBXFileReference section */
......@@ -274,6 +282,7 @@
buildActionMask = 2147483647;
files = (
19413CC62AA7F91BAA93A7AC /* libPods-car_base-Car.a in Frameworks */,
F16EFE19711BD2F266C2D5A4 /* libPods-car_base-Car-Customer.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -296,6 +305,7 @@
buildActionMask = 2147483647;
files = (
53DE6594F962D3D35D9FB355 /* libPods-car_base-Car Release.a in Frameworks */,
3ACF93FF5CBBDE59C28DC356 /* libPods-car_base-Car-Customer Release.a in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
......@@ -315,6 +325,8 @@
8F21E8FF1E0D05BE0066533F /* libSDWebImage.a */,
F5E1689EFB8A98572A90A6D3 /* libPods-car_base-Car.a */,
E3A60FCFD401BA3D051DAF70 /* libPods-car_base-Car Release.a */,
9B728771192ABAD4E95A586F /* libPods-car_base-Car-Customer.a */,
C54D3C7AD614F01AAF598ED8 /* libPods-car_base-Car-Customer Release.a */,
);
name = Frameworks;
sourceTree = "<group>";
......@@ -326,6 +338,10 @@
1C42A5C44B20710C8551415C /* Pods-car_base-Car.release.xcconfig */,
59F0FD637A5CE430F164395B /* Pods-car_base-Car Release.debug.xcconfig */,
D84929CB776A620566CE3CB6 /* Pods-car_base-Car Release.release.xcconfig */,
D18C257D0E5B93CEB8753920 /* Pods-car_base-Car-Customer.debug.xcconfig */,
F405B1E31F164E40648DEDA9 /* Pods-car_base-Car-Customer.release.xcconfig */,
D4BC599BDCE4593FFA63789C /* Pods-car_base-Car-Customer Release.debug.xcconfig */,
A5E2324AC29CF797BD9B1963 /* Pods-car_base-Car-Customer Release.release.xcconfig */,
);
name = Pods;
sourceTree = "<group>";
......@@ -866,7 +882,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-car_base-Car/Pods-car_base-Car-resources.sh\"\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-car_base-Car-Customer/Pods-car_base-Car-Customer-resources.sh\"\n";
showEnvVarsInLog = 0;
};
802307BB0542BA9258708321 /* [CP] Embed Pods Frameworks */ = {
......@@ -881,7 +897,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-car_base-Car/Pods-car_base-Car-frameworks.sh\"\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-car_base-Car-Customer/Pods-car_base-Car-Customer-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
CAC7AF49CE02CC356ECE68F0 /* [CP] Embed Pods Frameworks */ = {
......@@ -896,7 +912,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-car_base-Car Release/Pods-car_base-Car Release-frameworks.sh\"\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-car_base-Car-Customer Release/Pods-car_base-Car-Customer Release-frameworks.sh\"\n";
showEnvVarsInLog = 0;
};
FCA34B475FB586740CBE6248 /* [CP] Copy Pods Resources */ = {
......@@ -911,7 +927,7 @@
);
runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh;
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-car_base-Car Release/Pods-car_base-Car Release-resources.sh\"\n";
shellScript = "\"${SRCROOT}/Pods/Target Support Files/Pods-car_base-Car-Customer Release/Pods-car_base-Car-Customer Release-resources.sh\"\n";
showEnvVarsInLog = 0;
};
/* End PBXShellScriptBuildPhase section */
......@@ -1173,7 +1189,7 @@
};
8F97C2E61E0CC4BE00D8A57D /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 34B91CD599A3C8265AB0C96C /* Pods-car_base-Car.debug.xcconfig */;
baseConfigurationReference = D18C257D0E5B93CEB8753920 /* Pods-car_base-Car-Customer.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Car/Car.entitlements;
......@@ -1197,7 +1213,7 @@
};
8F97C2E71E0CC4BE00D8A57D /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 1C42A5C44B20710C8551415C /* Pods-car_base-Car.release.xcconfig */;
baseConfigurationReference = F405B1E31F164E40648DEDA9 /* Pods-car_base-Car-Customer.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Car/Car.entitlements;
......@@ -1285,7 +1301,7 @@
};
8FFE3E121E14AC6700BEB6A6 /* Debug */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = 59F0FD637A5CE430F164395B /* Pods-car_base-Car Release.debug.xcconfig */;
baseConfigurationReference = D4BC599BDCE4593FFA63789C /* Pods-car_base-Car-Customer Release.debug.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Car/Car.entitlements;
......@@ -1308,7 +1324,7 @@
};
8FFE3E131E14AC6700BEB6A6 /* Release */ = {
isa = XCBuildConfiguration;
baseConfigurationReference = D84929CB776A620566CE3CB6 /* Pods-car_base-Car Release.release.xcconfig */;
baseConfigurationReference = A5E2324AC29CF797BD9B1963 /* Pods-car_base-Car-Customer Release.release.xcconfig */;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Car/Car.entitlements;
......
{
"images" : [
{
"idiom" : "universal",
"filename" : "status_checked.png",
"scale" : "1x"
},
{
"idiom" : "universal",
"filename" : "status_checked@2x.png",
"scale" : "2x"
},
{
"idiom" : "universal",
"filename" : "status_checked@3x.png",
"scale" : "3x"
}
],
"info" : {
"version" : 1,
"author" : "xcode"
}
}
\ No newline at end of file
This diff is collapsed.
......@@ -7,6 +7,6 @@
//
#import <UIKit/UIKit.h>
@interface CardModel : OtherTicketEntity
@interface CardModel : ProductOrderEntity
@end
......@@ -11,11 +11,11 @@
#import "CardView.h"
#import "CardModel.h"
@interface CardViewController ()
@property(weak, nonatomic) IBOutlet UITextField *textFieldCardNumber;
@property(weak, nonatomic) IBOutlet CardView *cardView;
@property(weak, nonatomic) IBOutlet UIImageView *imgNoCardBg;
@property(weak, nonatomic) IBOutlet UILabel *labelFindCard;
@property(weak, nonatomic) IBOutlet UIButton *btnConfirm;
@property (weak, nonatomic) IBOutlet UITextField *textFieldCardNumber;
@property (weak, nonatomic) IBOutlet CardView *cardView;
@property (weak, nonatomic) IBOutlet UIImageView *imgNoCardBg;
@property (weak, nonatomic) IBOutlet UILabel *labelFindCard;
@property (weak, nonatomic) IBOutlet UIButton *btnConfirm;
@property (strong, nonatomic) CardModel *card;
@end
......@@ -49,10 +49,7 @@
- (void)configUIWithCard {
[self findCard];
self.cardView.model = self.card;
if ([self.card.state isEqualToString:@"used"]) {
self.btnConfirm.enabled = NO;
}
self.btnConfirm.enabled = ![self.card.state isEqualToString:@"checked"];
}
- (void)configUI {
......@@ -99,32 +96,37 @@
*/
- (IBAction)actionOffset:(id)sender {
WS(weakSelf);
[self alertTitle:@"确认销券?" msg:nil okAction:^(UIAlertAction * _Nullable action) {
[self alertTitle:@"确认销券?"
msg:nil
okAction:^(UIAlertAction *_Nullable action) {
[weakSelf httpCheckCard];
} cancelAction:nil];
}
cancelAction:nil];
}
/**
销券
*/
- (void)httpCheckCard {
CheckTicketRequest *param = [[CheckTicketRequest alloc] init];
// [MBProgressHUD j_loading];
// param.checkDate = [[NSDate date] httpParameterString];
// param.checkManId = kUser.fid;
// param.checkManName = kUser.realName;
// param.ticketNumber = self.card.ticketNumber;
// WS(weakSelf);
// [kHttp POST:kCheckTicketUrl parameters:[param toDictionary] complete:^(id _Nullable response, NSError * _Nullable error) {
// [MBProgressHUD j_hideLoadingView];
// if (kRsSuccess(response)) {
// [MBProgressHUD j_textOnly:@"销券成功!"];
// weakSelf.card.state = @"used";
// [weakSelf configUIWithCard];
// }else{
// kShowRsMsg(response);
// }
// }];
CheckProductOrderRequest *param = [CheckProductOrderRequest new];
[MBProgressHUD j_loading];
param.checkDate = [[NSDate date] httpParameterString];
param.checkManId = kUser.fid;
param.checkManName = kUser.realName;
param.checkKey = self.card.checkKey;
WS(weakSelf);
[kHttp POST:kCheckTicketUrl parameters:[param toDictionary] complete:^(id _Nullable response, NSError * _Nullable error) {
[MBProgressHUD j_hideLoadingView];
if (kRsSuccess(response)) {
[MBProgressHUD j_textOnly:@"核销成功!"];
weakSelf.card.state = @"checked";
[weakSelf configUIWithCard];
}else{
kShowRsMsg(response);
}
}];
}
- (void)didReceiveMemoryWarning {
......
......@@ -9,12 +9,41 @@
#import <UIKit/UIKit.h>
#import "CardModel.h"
@interface CardView : UIView
@property (weak, nonatomic) IBOutlet UIImageView *imgBg;
/**
左侧的图片
*/
@property (weak, nonatomic) IBOutlet UIImageView *imgLogo;
/**
标题
*/
@property (weak, nonatomic) IBOutlet UILabel *labelTitle;
@property (weak, nonatomic) IBOutlet UILabel *labelPrice;
@property (weak, nonatomic) IBOutlet UILabel *labelCondition;
/**
副标题
*/
@property (weak, nonatomic) IBOutlet UILabel *labelSubtitle;
/**
单号
*/
@property (weak, nonatomic) IBOutlet UILabel *labelBillNumber;
/**
有效日期
*/
@property (weak, nonatomic) IBOutlet UILabel *labelDuring;
/**
状态
*/
@property (weak, nonatomic) IBOutlet UIImageView *imgState;
@property (weak, nonatomic) IBOutlet UILabel *labelDuration;
@property (weak, nonatomic) IBOutlet UILabel *labelCardNumber;
/**
金额
*/
@property (weak, nonatomic) IBOutlet UILabel *labelMoney;
@property (strong, nonatomic) CardModel *model;
@end
......@@ -8,6 +8,7 @@
#import "CardView.h"
#import "CalculateHelper.h"
#import "UIImageView+WebCache.h"
@implementation CardView
/*
......@@ -19,25 +20,12 @@
*/
- (void)setModel:(CardModel *)model {
_model = model;
self.labelTitle.text = model.name;
self.labelPrice.text = [model.total stringValue];
self.labelDuration.text = [NSString stringWithFormat:@"%@~%@",[model.startDate substringToIndex:11],[model.endDate substringToIndex:11]];
self.labelCondition.text = model.remak;
self.labelCardNumber.text = kStrPrefix(model.ticketNumber, @"券号:");
if ([model.state isEqualToString:@"used"]) {
[self used];
}else{
[self unUse];
}
}
- (void)unUse {
self.imgBg.image = [UIImage imageNamed:@"orange_card_bg"];
self.imgState.hidden = YES;
}
[self.imgLogo sd_setImageWithURL:[NSURL URLWithString:model.productImageUrl]];
self.labelTitle.text = model.productName;
self.labelBillNumber.text = model.billNumber;
self.labelMoney.text = [model.realPayTotal stringValue];
self.imgState.hidden = ![model.state isEqualToString:@"checked"];
- (void)used {
self.imgBg.image = [UIImage imageNamed:@"gray_card_bg"];
self.imgState.hidden = NO;
}
@end
......@@ -9,21 +9,47 @@
#import <UIKit/UIKit.h>
@interface OrderListTableViewCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UILabel *labelTime;
@property (weak, nonatomic) IBOutlet UILabel *labelStation;
@property (weak, nonatomic) IBOutlet UILabel *labelOil;
/**
左侧的图片
*/
@property (weak, nonatomic) IBOutlet UIImageView *imgLogo;
/**
标题
*/
@property (weak, nonatomic) IBOutlet UILabel *labelTitle;
/**
副标题
*/
@property (weak, nonatomic) IBOutlet UILabel *labelSubtitle;
/**
单号
*/
@property (weak, nonatomic) IBOutlet UILabel *labelBillNumber;
@property (weak, nonatomic) IBOutlet UILabel *labelPrice;
@property (weak, nonatomic) IBOutlet UIButton *btnIsChecked;
/**
有效日期
*/
@property (weak, nonatomic) IBOutlet UILabel *labelDuring;
/**
状态
*/
@property (weak, nonatomic) IBOutlet UIImageView *imgState;
/**
cell刷新
金额
*/
@property (weak, nonatomic) IBOutlet UILabel *labelMoney;
@param array 数据
@param indexPath 位置
@param isShow 是否显示checkbox
@param isAll 是否全选
/**
使用条件
*/
- (void)configCellArray:(NSMutableArray *)array indexPath:(NSIndexPath *)indexPath isShow:(BOOL)isShow isAll:(BOOL)isAll;
@property (weak, nonatomic) IBOutlet UILabel *labelCondition;
- (void)configCellWithModel:(ProductOrderEntity *)model;
@end
......@@ -8,8 +8,7 @@
#import "OrderListTableViewCell.h"
#import "OrderListModel.h"
#import "UIImageView+WebCache.h"
@interface OrderListTableViewCell ()
@property (strong, nonatomic) OrderListModel *model;
@end
......@@ -17,33 +16,16 @@
- (void)awakeFromNib {
[super awakeFromNib];
[self.btnIsChecked setBackgroundImage:[UIImage imageNamed:@"radious_select_gray"] forState:UIControlStateDisabled | UIControlStateSelected];
// Initialization code
}
- (void)configCellArray:(NSMutableArray *)array indexPath:(NSIndexPath *)indexPath isShow:(BOOL)isShow isAll:(BOOL)isAll{
OrderListModel *model = array[indexPath.row];
self.model = model;
self.labelTime.text = model.payTime;
self.labelStation.text = [NSString stringWithFormat:@"%@ - %@", model.stationName, model.stationUserName];
self.labelOil.text = [NSString stringWithFormat:@"%@ - %@", model.gasItemName, model.oilGunName];
- (void)configCellWithModel:(ProductOrderEntity *)model; {
[self.imgLogo sd_setImageWithURL:[NSURL URLWithString:model.productImageUrl]];
self.labelTitle.text = model.productName;
self.labelBillNumber.text = model.billNumber;
self.labelPrice.text = [CalculateHelper getMoneyStringFrom:model.realPayTotal];
self.labelMoney.text = [model.realPayTotal stringValue];
self.imgState.hidden = ![model.state isEqualToString:@"checked"];
self.btnIsChecked.selected = model.isSelected;
if ([model.checkState isEqualToString:@"checked"]) {
self.btnIsChecked.enabled = NO;
} else {
self.btnIsChecked.enabled = YES;
}
self.btnIsChecked.hidden = !isShow;
}
- (IBAction)actionCheck:(UIButton *)sender {
sender.selected = !sender.isSelected;
self.model.isSelected = sender.isSelected;
[[NSNotificationCenter defaultCenter] postNotificationName:kNotiSelectBill object:self.model];
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
......
......@@ -25,7 +25,8 @@
[super viewDidLoad];
[self httpRequest];
self.view.backgroundColor = [UIColor whiteColor];
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(actionNoti:) name:kNotiSelectBill object:nil];
// self.tableView.rowHeight = UITableViewAutomaticDimension;
// self.tableView.estimatedRowHeight = 140;
}
- (void)viewWillAppear:(BOOL)animated {
......@@ -45,7 +46,10 @@
[MBProgressHUD j_hideLoadingView];
if (kRsSuccess(response)) {
weakSelf.total = [[TradeStatisticsResult alloc] initWithDictionary:response[@"data"][@"total"] error:nil];
for (NSDictionary *dict in response[@"data"][@"records"]) {
ProductOrderEntity *order = [[ProductOrderEntity alloc] initWithDictionary:dict error:nil];
[weakSelf.arrData addObject:order];
};
[weakSelf listTableViewReloadData];
......@@ -61,16 +65,14 @@
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 166;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.arrData.count;
return 128;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
OrderListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"OrderListTableViewCell" forIndexPath:indexPath];
ProductOrderEntity *entity = self.arrData[indexPath.row];
[cell configCellWithModel:entity];
// [cell configCellArray:self.arrData indexPath:indexPath isShow:self.btnCheck.isSelected isAll:self.btnSelectAll.selected];
return cell;
}
......@@ -84,9 +86,9 @@
- (void)listDidSelect:(id)model {
OrderDetailViewController *detailVC = [OrderDetailViewController viewControllerWithStoryBoardType:STORYBOARD_TYPE_MAIN];
detailVC.model = model;
[self.navigationController pushViewController:detailVC animated:YES];
// OrderDetailViewController *detailVC = [OrderDetailViewController viewControllerWithStoryBoardType:STORYBOARD_TYPE_MAIN];
// detailVC.model = model;
// [self.navigationController pushViewController:detailVC animated:YES];
}
#pragma mark - actions
......@@ -138,7 +140,7 @@
order.field = @"payTime";
order.direction = @"desc";
_param.orders = (NSArray<QueryOrder> *) @[ order ];
_param.merchantId = kUser.fid;
// _param.merchantId = kUser.fid;
// _param.state = @"paid, invalid";
_param.beginDate = [[[NSDate date] yearMonthDayString] stringByAppendingString:@" 00:00:00"];
_param.endDate = [[[NSDate date] yearMonthDayString] stringByAppendingString:@" 23:59:59"];
......
......@@ -33,8 +33,9 @@ static NSString *const kAccountGetUrl = @"account/get";
//查询加油员账户流水列表
static NSString *const kAccountQueryUrl = @"account/query";
static NSString *const kRePrintUrl = @"printer/printRefuelBill";
static NSString *const kGetTicketUrl = @"ticket/get?ticketNumber=";
static NSString *const kCheckTicketUrl = @"ticket/check";
//根据兑换码获取订单
static NSString *const kGetTicketUrl = @"productorder/getByCheckKey?checkKey=";
static NSString *const kCheckTicketUrl = @"productorder/check";
static NSString *const kWatchLogin = @"stationUser/token/send";
//查询用户申请提现记录
......
......@@ -433,7 +433,7 @@ extern NSString * const QUERYORDERDIRECTION_DESC;
*
*
*/
@property (nonatomic, strong) NSDecimalNumber *balance;
@property (nonatomic, strong) NSNumber *balance;
/**
* 方法: 取得日订单数量
*
......@@ -445,7 +445,7 @@ extern NSString * const QUERYORDERDIRECTION_DESC;
*
*
*/
@property (nonatomic, strong) NSDecimalNumber *drawBalance;
@property (nonatomic, strong) NSNumber *drawBalance;
@end /* interface StationUserAcctEntity */
......@@ -617,13 +617,13 @@ extern NSString * const QUERYORDERDIRECTION_DESC;
*
*
*/
@property (nonatomic, strong) NSDecimalNumber *workpoint;
@property (nonatomic, strong) NSNumber *workpoint;
/**
* 提现金额
*
*
*/
@property (nonatomic, strong) NSDecimalNumber *cash;
@property (nonatomic, strong) NSNumber *cash;
/**
* 状态
*
......@@ -905,7 +905,7 @@ extern NSString * const QUERYORDERDIRECTION_DESC;
*
*
*/
@property (nonatomic, strong) NSDecimalNumber *price;
@property (nonatomic, strong) NSNumber *price;
/**
* 描述
*
......@@ -1181,13 +1181,13 @@ extern NSString * const QUERYORDERDIRECTION_DESC;
*
*
*/
@property (nonatomic, strong) NSDecimalNumber *total;
@property (nonatomic, strong) NSNumber *total;
/**
* 实际抵扣金额
*
*
*/
@property (nonatomic, strong) NSDecimalNumber *realPayTotal;
@property (nonatomic, strong) NSNumber *realPayTotal;
/**
* 状态
*
......@@ -1342,19 +1342,19 @@ extern NSString * const QUERYORDERDIRECTION_DESC;
*
*
*/
@property (nonatomic, strong) NSDecimalNumber *total;
@property (nonatomic, strong) NSNumber *total;
/**
* 实际支付金额
*
*
*/
@property (nonatomic, strong) NSDecimalNumber *realPayTotal;
@property (nonatomic, strong) NSNumber *realPayTotal;
/**
* 优惠金额
*
*
*/
@property (nonatomic, strong) NSDecimalNumber *discountAmount;
@property (nonatomic, strong) NSNumber *discountAmount;
/**
* 支付时间
*
......@@ -1620,13 +1620,13 @@ extern NSString * const QUERYORDERDIRECTION_DESC;
*
*
*/
@property (nonatomic, strong) NSDecimalNumber *total;
@property (nonatomic, strong) NSNumber *total;
/**
* 方法: 取得实付金额
*
*
*/
@property (nonatomic, strong) NSDecimalNumber *realPayTotal;
@property (nonatomic, strong) NSNumber *realPayTotal;
/**
* 方法: 取得支付时间
*
......@@ -1644,7 +1644,7 @@ extern NSString * const QUERYORDERDIRECTION_DESC;
*
*
*/
@property (nonatomic, strong) NSDecimalNumber *deduct;
@property (nonatomic, strong) NSNumber *deduct;
/**
* 方法: 取得是否开票
*
......@@ -1808,19 +1808,19 @@ extern NSString * const QUERYORDERDIRECTION_DESC;
*
*
*/
@property (nonatomic, strong) NSDecimalNumber *oldBalance;
@property (nonatomic, strong) NSNumber *oldBalance;
/**
* 方法: 取得发生额
*
*
*/
@property (nonatomic, strong) NSDecimalNumber *occur;
@property (nonatomic, strong) NSNumber *occur;
/**
* 方法: 取得变化后余额
*
*
*/
@property (nonatomic, strong) NSDecimalNumber *fnewBalance;
@property (nonatomic, strong) NSNumber *fnewBalance;
/**
* 方法: 取得业务单号
*
......@@ -2241,10 +2241,10 @@ extern NSString * const QUERYORDERDIRECTION_DESC;
@interface ProductOrderQueryResult : RsQueryResult
/**
* 查询结果集合
* @see OrderEntity
* @see ProductOrderEntity
*
*/
@property (nonatomic, strong) NSArray<OrderEntity> *records;
@property (nonatomic, strong) NSArray<ProductOrderEntity> *records;
@end /* interface ProductOrderQueryResult */
......
......@@ -15,8 +15,7 @@
#pragma mark - life cycle
- (void)viewDidLoad
{
- (void)viewDidLoad {
[super viewDidLoad];
self.pageSize = 15;
......@@ -31,25 +30,21 @@
// Do any additional setup after loading the view.
}
- (void)viewDidAppear:(BOOL)animated
{
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
}
- (void)viewWillAppear:(BOOL)animated
{
- (void)viewWillAppear:(BOOL)animated {
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:NO animated:YES];
}
- (void)viewWillDisappear:(BOOL)animated
{
- (void)viewWillDisappear:(BOOL)animated {
[super viewWillDisappear:animated];
[self.navigationController setNavigationBarHidden:NO animated:YES];
}
- (void)didReceiveMemoryWarning
{
- (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
......@@ -57,8 +52,7 @@
/**
* 启用分页加载(最好在ViewDidLoad里面调用)
*/
- (void)paggingMode
{
- (void)paggingMode {
WS(weakSelf);
self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
weakSelf.page = 0;
......@@ -74,37 +68,31 @@
weakSelf.page++;
[weakSelf httpRequest];
}];
self.tableView.mj_footer.hidden = YES;
self.tableView.mj_footer.automaticallyHidden = YES;
}
- (void)refresh
{
- (void)refresh {
[self.tableView.mj_header beginRefreshing];
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.arrData.count;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
[self listDidSelect:self.arrData[indexPath.row]];
}
#pragma mark - empty state
- (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView
{
- (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView {
return [UIImage imageNamed:@"list_no_data"];
}
- (void)emptyDataSet:(UIScrollView *)scrollView didTapView:(UIView *)view
{
- (void)emptyDataSet:(UIScrollView *)scrollView didTapView:(UIView *)view {
[self.tableView.mj_header beginRefreshing];
}
- (CAAnimation *)imageAnimationForEmptyDataSet:(UIScrollView *)scrollView
{
- (CAAnimation *)imageAnimationForEmptyDataSet:(UIScrollView *)scrollView {
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform"];
animation.fromValue = [NSValue valueWithCATransform3D:CATransform3DIdentity];
animation.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeRotation(M_PI_2, 0.0, 0.0, 1.0)];
......@@ -115,40 +103,39 @@
return animation;
}
- (UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView
{
- (UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView {
return [UIColor whiteColor];
}
- (IBAction)actionAdd:(UIButton *)sender
{
- (IBAction)actionAdd:(UIButton *)sender {
}
- (void)listTableViewReloadData
{
- (void)listTableViewReloadData {
[MBProgressHUD j_hideLoadingView];
[self.tableView reloadData];
if (self.page == 0) {
[self.tableView j_endRefresh];
self.tableView.mj_footer.hidden = self.arrData.count == 0;
[self.tableView.mj_footer resetNoMoreData];
} else {
if (self.arrData.count < self.pageSize * self.page) {
[self.tableView.mj_footer endRefreshingWithNoMoreData];
} else {
[self.tableView j_endRefresh];
}
if (self.page == 0) {
[self.tableView.mj_footer resetNoMoreData];
}
[self.tableView reloadData];
}
- (void)listTableViewReloadDataWithNewRecord:(NSArray *)newRecord
{
- (void)listTableViewReloadDataWithNewRecord:(NSArray *)newRecord {
[self listTableViewReloadData];
CLog(@"newrecord count = %lu", newRecord.count);
if ([newRecord count] < self.pageSize) {
[self.tableView.mj_footer endRefreshingWithNoMoreData];
}
}
- (NSMutableArray *)arrData
{
- (NSMutableArray *)arrData {
if (!_arrData) {
_arrData = [NSMutableArray array];
}
......
......@@ -11,10 +11,10 @@
@implementation UITableView (Addtions)
- (void)j_endRefresh {
// if ([self.mj_header isRefreshing]) {
if ([self.mj_header isRefreshing]) {
[self.mj_header endRefreshing];
// }else if ([self.mj_footer isRefreshing]) {
}else if ([self.mj_footer isRefreshing]) {
[self.mj_footer endRefreshing];
// }
}
}
@end
......@@ -4,7 +4,7 @@ abstract_target 'car_base' do
pod 'AFNetworking', '~> 3.1.0'
pod 'SDWebImage', '~> 3.7.5'
pod 'MBProgressHUD', '~> 1.0.0'
pod 'MJRefresh', '~> 3.1.2'
pod 'MJRefresh'
pod 'IQKeyboardManager', '~> 4.0.6'
pod 'JSONModel', '~> 1.2.0'
pod 'DZNEmptyDataSet', '~> 1.8.1'
......@@ -14,9 +14,9 @@ abstract_target 'car_base' do
pod 'ZXingObjC', '~> 3.0'
pod 'UMengUShare/Social/WeChat'
target 'Car' do
target 'Car-Customer' do
end
target 'Car Release' do
target 'Car-Customer Release' do
end
end
......@@ -42,7 +42,7 @@ DEPENDENCIES:
- JPush (~> 2.2.0.1)
- JSONModel (~> 1.2.0)
- MBProgressHUD (~> 1.0.0)
- MJRefresh (~> 3.1.2)
- MJRefresh
- SDWebImage (~> 3.7.5)
- UMengAnalytics-NO-IDFA
- UMengUShare/Social/WeChat
......@@ -62,6 +62,6 @@ SPEC CHECKSUMS:
UMengUShare: fc0a98b8d5297632e82874318fd72a10d17da228
ZXingObjC: bf15b3814f7a105b6d99f47da2333c93a063650a
PODFILE CHECKSUM: e9648119590790f6e637a439070d1eeaeac8afa5
PODFILE CHECKSUM: 267d7a77c2851d02af19b01794259d6389bb108e
COCOAPODS: 1.2.0
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