Commit cd5f8851 authored by Sandy's avatar Sandy

核销订单等功能完成

parent 4f34f0e9
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
/* Begin PBXBuildFile section */ /* Begin PBXBuildFile section */
19413CC62AA7F91BAA93A7AC /* libPods-car_base-Car.a in Frameworks */ = {isa = PBXBuildFile; fileRef = F5E1689EFB8A98572A90A6D3 /* libPods-car_base-Car.a */; }; 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 */; }; 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 */; }; 8F2095511E15171600FBED74 /* UMengHelper.m in Sources */ = {isa = PBXBuildFile; fileRef = 8F2095501E15171600FBED74 /* UMengHelper.m */; };
8F2095521E15171600FBED74 /* 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 @@ ...@@ -118,6 +119,7 @@
8FFE3E0C1E14AC6700BEB6A6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8F97C2C71E0CC4BE00D8A57D /* Assets.xcassets */; }; 8FFE3E0C1E14AC6700BEB6A6 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 8F97C2C71E0CC4BE00D8A57D /* Assets.xcassets */; };
8FFE3E0D1E14AC6700BEB6A6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8F97C2C41E0CC4BE00D8A57D /* Main.storyboard */; }; 8FFE3E0D1E14AC6700BEB6A6 /* Main.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 8F97C2C41E0CC4BE00D8A57D /* Main.storyboard */; };
8FFE3E0E1E14AC6700BEB6A6 /* CodeScan.bundle in Resources */ = {isa = PBXBuildFile; fileRef = 8FC2BDC21E1285F700A879C1 /* CodeScan.bundle */; }; 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 */ /* End PBXBuildFile section */
/* Begin PBXContainerItemProxy section */ /* Begin PBXContainerItemProxy section */
...@@ -263,8 +265,14 @@ ...@@ -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>"; }; 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; }; 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>"; }; 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>"; }; 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; }; 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; }; 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 */ /* End PBXFileReference section */
...@@ -274,6 +282,7 @@ ...@@ -274,6 +282,7 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
19413CC62AA7F91BAA93A7AC /* libPods-car_base-Car.a in Frameworks */, 19413CC62AA7F91BAA93A7AC /* libPods-car_base-Car.a in Frameworks */,
F16EFE19711BD2F266C2D5A4 /* libPods-car_base-Car-Customer.a in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -296,6 +305,7 @@ ...@@ -296,6 +305,7 @@
buildActionMask = 2147483647; buildActionMask = 2147483647;
files = ( files = (
53DE6594F962D3D35D9FB355 /* libPods-car_base-Car Release.a in Frameworks */, 53DE6594F962D3D35D9FB355 /* libPods-car_base-Car Release.a in Frameworks */,
3ACF93FF5CBBDE59C28DC356 /* libPods-car_base-Car-Customer Release.a in Frameworks */,
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
}; };
...@@ -315,6 +325,8 @@ ...@@ -315,6 +325,8 @@
8F21E8FF1E0D05BE0066533F /* libSDWebImage.a */, 8F21E8FF1E0D05BE0066533F /* libSDWebImage.a */,
F5E1689EFB8A98572A90A6D3 /* libPods-car_base-Car.a */, F5E1689EFB8A98572A90A6D3 /* libPods-car_base-Car.a */,
E3A60FCFD401BA3D051DAF70 /* libPods-car_base-Car Release.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; name = Frameworks;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -326,6 +338,10 @@ ...@@ -326,6 +338,10 @@
1C42A5C44B20710C8551415C /* Pods-car_base-Car.release.xcconfig */, 1C42A5C44B20710C8551415C /* Pods-car_base-Car.release.xcconfig */,
59F0FD637A5CE430F164395B /* Pods-car_base-Car Release.debug.xcconfig */, 59F0FD637A5CE430F164395B /* Pods-car_base-Car Release.debug.xcconfig */,
D84929CB776A620566CE3CB6 /* Pods-car_base-Car Release.release.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; name = Pods;
sourceTree = "<group>"; sourceTree = "<group>";
...@@ -866,7 +882,7 @@ ...@@ -866,7 +882,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; 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; showEnvVarsInLog = 0;
}; };
802307BB0542BA9258708321 /* [CP] Embed Pods Frameworks */ = { 802307BB0542BA9258708321 /* [CP] Embed Pods Frameworks */ = {
...@@ -881,7 +897,7 @@ ...@@ -881,7 +897,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; 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; showEnvVarsInLog = 0;
}; };
CAC7AF49CE02CC356ECE68F0 /* [CP] Embed Pods Frameworks */ = { CAC7AF49CE02CC356ECE68F0 /* [CP] Embed Pods Frameworks */ = {
...@@ -896,7 +912,7 @@ ...@@ -896,7 +912,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; 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; showEnvVarsInLog = 0;
}; };
FCA34B475FB586740CBE6248 /* [CP] Copy Pods Resources */ = { FCA34B475FB586740CBE6248 /* [CP] Copy Pods Resources */ = {
...@@ -911,7 +927,7 @@ ...@@ -911,7 +927,7 @@
); );
runOnlyForDeploymentPostprocessing = 0; runOnlyForDeploymentPostprocessing = 0;
shellPath = /bin/sh; 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; showEnvVarsInLog = 0;
}; };
/* End PBXShellScriptBuildPhase section */ /* End PBXShellScriptBuildPhase section */
...@@ -1173,7 +1189,7 @@ ...@@ -1173,7 +1189,7 @@
}; };
8F97C2E61E0CC4BE00D8A57D /* Debug */ = { 8F97C2E61E0CC4BE00D8A57D /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 34B91CD599A3C8265AB0C96C /* Pods-car_base-Car.debug.xcconfig */; baseConfigurationReference = D18C257D0E5B93CEB8753920 /* Pods-car_base-Car-Customer.debug.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Car/Car.entitlements; CODE_SIGN_ENTITLEMENTS = Car/Car.entitlements;
...@@ -1197,7 +1213,7 @@ ...@@ -1197,7 +1213,7 @@
}; };
8F97C2E71E0CC4BE00D8A57D /* Release */ = { 8F97C2E71E0CC4BE00D8A57D /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 1C42A5C44B20710C8551415C /* Pods-car_base-Car.release.xcconfig */; baseConfigurationReference = F405B1E31F164E40648DEDA9 /* Pods-car_base-Car-Customer.release.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Car/Car.entitlements; CODE_SIGN_ENTITLEMENTS = Car/Car.entitlements;
...@@ -1285,7 +1301,7 @@ ...@@ -1285,7 +1301,7 @@
}; };
8FFE3E121E14AC6700BEB6A6 /* Debug */ = { 8FFE3E121E14AC6700BEB6A6 /* Debug */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = 59F0FD637A5CE430F164395B /* Pods-car_base-Car Release.debug.xcconfig */; baseConfigurationReference = D4BC599BDCE4593FFA63789C /* Pods-car_base-Car-Customer Release.debug.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Car/Car.entitlements; CODE_SIGN_ENTITLEMENTS = Car/Car.entitlements;
...@@ -1308,7 +1324,7 @@ ...@@ -1308,7 +1324,7 @@
}; };
8FFE3E131E14AC6700BEB6A6 /* Release */ = { 8FFE3E131E14AC6700BEB6A6 /* Release */ = {
isa = XCBuildConfiguration; isa = XCBuildConfiguration;
baseConfigurationReference = D84929CB776A620566CE3CB6 /* Pods-car_base-Car Release.release.xcconfig */; baseConfigurationReference = A5E2324AC29CF797BD9B1963 /* Pods-car_base-Car-Customer Release.release.xcconfig */;
buildSettings = { buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon; ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CODE_SIGN_ENTITLEMENTS = Car/Car.entitlements; 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 @@ ...@@ -7,6 +7,6 @@
// //
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
@interface CardModel : OtherTicketEntity @interface CardModel : ProductOrderEntity
@end @end
...@@ -11,11 +11,11 @@ ...@@ -11,11 +11,11 @@
#import "CardView.h" #import "CardView.h"
#import "CardModel.h" #import "CardModel.h"
@interface CardViewController () @interface CardViewController ()
@property(weak, nonatomic) IBOutlet UITextField *textFieldCardNumber; @property (weak, nonatomic) IBOutlet UITextField *textFieldCardNumber;
@property(weak, nonatomic) IBOutlet CardView *cardView; @property (weak, nonatomic) IBOutlet CardView *cardView;
@property(weak, nonatomic) IBOutlet UIImageView *imgNoCardBg; @property (weak, nonatomic) IBOutlet UIImageView *imgNoCardBg;
@property(weak, nonatomic) IBOutlet UILabel *labelFindCard; @property (weak, nonatomic) IBOutlet UILabel *labelFindCard;
@property(weak, nonatomic) IBOutlet UIButton *btnConfirm; @property (weak, nonatomic) IBOutlet UIButton *btnConfirm;
@property (strong, nonatomic) CardModel *card; @property (strong, nonatomic) CardModel *card;
@end @end
...@@ -23,112 +23,114 @@ ...@@ -23,112 +23,114 @@
@implementation CardViewController @implementation CardViewController
- (void)viewDidLoad { - (void)viewDidLoad {
[super viewDidLoad]; [super viewDidLoad];
[self configUI]; [self configUI];
[self noCard]; [self noCard];
if (self.cardNumber) { if (self.cardNumber) {
self.textFieldCardNumber.text = self.cardNumber; self.textFieldCardNumber.text = self.cardNumber;
[self httpCardWithNumber:self.cardNumber]; [self httpCardWithNumber:self.cardNumber];
} }
} }
- (void)noCard { - (void)noCard {
self.cardView.hidden = YES; self.cardView.hidden = YES;
self.labelFindCard.hidden = YES; self.labelFindCard.hidden = YES;
self.imgNoCardBg.hidden = NO; self.imgNoCardBg.hidden = NO;
self.btnConfirm.hidden = YES; self.btnConfirm.hidden = YES;
} }
- (void)findCard { - (void)findCard {
self.cardView.hidden = NO; self.cardView.hidden = NO;
self.labelFindCard.hidden = NO; self.labelFindCard.hidden = NO;
self.imgNoCardBg.hidden = YES; self.imgNoCardBg.hidden = YES;
self.btnConfirm.hidden = NO; self.btnConfirm.hidden = NO;
} }
- (void)configUIWithCard { - (void)configUIWithCard {
[self findCard]; [self findCard];
self.cardView.model = self.card; self.cardView.model = self.card;
if ([self.card.state isEqualToString:@"used"]) { self.btnConfirm.enabled = ![self.card.state isEqualToString:@"checked"];
self.btnConfirm.enabled = NO;
}
} }
- (void)configUI { - (void)configUI {
self.title = @"核销订单"; self.title = @"核销订单";
UIBarButtonItem *rightBtn = UIBarButtonItem *rightBtn =
[[UIBarButtonItem alloc] initWithTitle:@"确认查询" [[UIBarButtonItem alloc] initWithTitle:@"确认查询"
style:UIBarButtonItemStyleDone style:UIBarButtonItemStyleDone
target:self target:self
action:@selector(actionCard)]; action:@selector(actionCard)];
self.navigationItem.rightBarButtonItem = rightBtn; self.navigationItem.rightBarButtonItem = rightBtn;
} }
- (void)httpCardWithNumber:(NSString *)number { - (void)httpCardWithNumber:(NSString *)number {
NSString *url = kStrPrefix(number, kGetTicketUrl); NSString *url = kStrPrefix(number, kGetTicketUrl);
[MBProgressHUD j_loading:@"查询中…"]; [MBProgressHUD j_loading:@"查询中…"];
WS(weakSelf); WS(weakSelf);
[kHttp GET:url [kHttp GET:url
parameters:nil parameters:nil
complete:^(id _Nullable response, NSError *_Nullable error) { complete:^(id _Nullable response, NSError *_Nullable error) {
[MBProgressHUD j_hideLoadingView]; [MBProgressHUD j_hideLoadingView];
if (kRsSuccess(response)) { if (kRsSuccess(response)) {
weakSelf.card = [[CardModel alloc] initWithDictionary:response[@"data"] error:nil]; weakSelf.card = [[CardModel alloc] initWithDictionary:response[@"data"] error:nil];
[weakSelf configUIWithCard]; [weakSelf configUIWithCard];
} else { } else {
kShowRsMsg(response); kShowRsMsg(response);
} }
}]; }];
} }
- (void)actionCard { - (void)actionCard {
HIDE_KEYBOARD; HIDE_KEYBOARD;
kCanNotBeNil(self.textFieldCardNumber.text, @"卡券号不能为空!"); kCanNotBeNil(self.textFieldCardNumber.text, @"卡券号不能为空!");
[self httpCardWithNumber:self.textFieldCardNumber.text]; [self httpCardWithNumber:self.textFieldCardNumber.text];
} }
/* /*
扫描二维码 扫描二维码
*/ */
- (IBAction)actionScan:(id)sender { - (IBAction)actionScan:(id)sender {
[self.navigationController popViewControllerAnimated:YES]; [self.navigationController popViewControllerAnimated:YES];
} }
/** /**
确认销券 确认销券
*/ */
- (IBAction)actionOffset:(id)sender { - (IBAction)actionOffset:(id)sender {
WS(weakSelf); WS(weakSelf);
[self alertTitle:@"确认销券?" msg:nil okAction:^(UIAlertAction * _Nullable action) { [self alertTitle:@"确认销券?"
[weakSelf httpCheckCard]; msg:nil
} cancelAction:nil]; okAction:^(UIAlertAction *_Nullable action) {
[weakSelf httpCheckCard];
}
cancelAction:nil];
} }
/** /**
销券 销券
*/ */
- (void)httpCheckCard { - (void)httpCheckCard {
CheckTicketRequest *param = [[CheckTicketRequest alloc] init]; CheckProductOrderRequest *param = [CheckProductOrderRequest new];
// [MBProgressHUD j_loading];
// param.checkDate = [[NSDate date] httpParameterString];
// param.checkManId = kUser.fid; [MBProgressHUD j_loading];
// param.checkManName = kUser.realName; param.checkDate = [[NSDate date] httpParameterString];
// param.ticketNumber = self.card.ticketNumber; param.checkManId = kUser.fid;
// WS(weakSelf); param.checkManName = kUser.realName;
// [kHttp POST:kCheckTicketUrl parameters:[param toDictionary] complete:^(id _Nullable response, NSError * _Nullable error) { param.checkKey = self.card.checkKey;
// [MBProgressHUD j_hideLoadingView]; WS(weakSelf);
// if (kRsSuccess(response)) { [kHttp POST:kCheckTicketUrl parameters:[param toDictionary] complete:^(id _Nullable response, NSError * _Nullable error) {
// [MBProgressHUD j_textOnly:@"销券成功!"]; [MBProgressHUD j_hideLoadingView];
// weakSelf.card.state = @"used"; if (kRsSuccess(response)) {
// [weakSelf configUIWithCard]; [MBProgressHUD j_textOnly:@"核销成功!"];
// }else{ weakSelf.card.state = @"checked";
// kShowRsMsg(response); [weakSelf configUIWithCard];
// } }else{
// }]; kShowRsMsg(response);
}
}];
} }
- (void)didReceiveMemoryWarning { - (void)didReceiveMemoryWarning {
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated. // Dispose of any resources that can be recreated.
} }
@end @end
...@@ -9,12 +9,41 @@ ...@@ -9,12 +9,41 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
#import "CardModel.h" #import "CardModel.h"
@interface CardView : UIView @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 *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 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; @property (strong, nonatomic) CardModel *model;
@end @end
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
#import "CardView.h" #import "CardView.h"
#import "CalculateHelper.h" #import "CalculateHelper.h"
#import "UIImageView+WebCache.h"
@implementation CardView @implementation CardView
/* /*
...@@ -19,25 +20,12 @@ ...@@ -19,25 +20,12 @@
*/ */
- (void)setModel:(CardModel *)model { - (void)setModel:(CardModel *)model {
_model = model; _model = model;
self.labelTitle.text = model.name; [self.imgLogo sd_setImageWithURL:[NSURL URLWithString:model.productImageUrl]];
self.labelPrice.text = [model.total stringValue]; self.labelTitle.text = model.productName;
self.labelDuration.text = [NSString stringWithFormat:@"%@~%@",[model.startDate substringToIndex:11],[model.endDate substringToIndex:11]]; self.labelBillNumber.text = model.billNumber;
self.labelCondition.text = model.remak; self.labelMoney.text = [model.realPayTotal stringValue];
self.labelCardNumber.text = kStrPrefix(model.ticketNumber, @"券号:"); self.imgState.hidden = ![model.state isEqualToString:@"checked"];
if ([model.state isEqualToString:@"used"]) {
[self used];
}else{
[self unUse];
}
}
- (void)unUse {
self.imgBg.image = [UIImage imageNamed:@"orange_card_bg"];
self.imgState.hidden = YES;
}
- (void)used {
self.imgBg.image = [UIImage imageNamed:@"gray_card_bg"];
self.imgState.hidden = NO;
} }
@end @end
...@@ -9,21 +9,47 @@ ...@@ -9,21 +9,47 @@
#import <UIKit/UIKit.h> #import <UIKit/UIKit.h>
@interface OrderListTableViewCell : UITableViewCell @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 *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 @end
...@@ -8,8 +8,7 @@ ...@@ -8,8 +8,7 @@
#import "OrderListTableViewCell.h" #import "OrderListTableViewCell.h"
#import "OrderListModel.h" #import "OrderListModel.h"
#import "UIImageView+WebCache.h"
@interface OrderListTableViewCell () @interface OrderListTableViewCell ()
@property (strong, nonatomic) OrderListModel *model; @property (strong, nonatomic) OrderListModel *model;
@end @end
...@@ -17,33 +16,16 @@ ...@@ -17,33 +16,16 @@
- (void)awakeFromNib { - (void)awakeFromNib {
[super 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{ - (void)configCellWithModel:(ProductOrderEntity *)model; {
OrderListModel *model = array[indexPath.row]; [self.imgLogo sd_setImageWithURL:[NSURL URLWithString:model.productImageUrl]];
self.model = model; self.labelTitle.text = model.productName;
self.labelTime.text = model.payTime;
self.labelStation.text = [NSString stringWithFormat:@"%@ - %@", model.stationName, model.stationUserName];
self.labelOil.text = [NSString stringWithFormat:@"%@ - %@", model.gasItemName, model.oilGunName];
self.labelBillNumber.text = model.billNumber; 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 { - (void)setSelected:(BOOL)selected animated:(BOOL)animated {
......
...@@ -25,7 +25,8 @@ ...@@ -25,7 +25,8 @@
[super viewDidLoad]; [super viewDidLoad];
[self httpRequest]; [self httpRequest];
self.view.backgroundColor = [UIColor whiteColor]; 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 { - (void)viewWillAppear:(BOOL)animated {
...@@ -45,7 +46,10 @@ ...@@ -45,7 +46,10 @@
[MBProgressHUD j_hideLoadingView]; [MBProgressHUD j_hideLoadingView];
if (kRsSuccess(response)) { 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]; [weakSelf listTableViewReloadData];
...@@ -61,16 +65,14 @@ ...@@ -61,16 +65,14 @@
} }
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { - (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
return 166; return 128;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
return self.arrData.count;
} }
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
OrderListTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"OrderListTableViewCell" forIndexPath: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]; // [cell configCellArray:self.arrData indexPath:indexPath isShow:self.btnCheck.isSelected isAll:self.btnSelectAll.selected];
return cell; return cell;
} }
...@@ -84,9 +86,9 @@ ...@@ -84,9 +86,9 @@
- (void)listDidSelect:(id)model { - (void)listDidSelect:(id)model {
OrderDetailViewController *detailVC = [OrderDetailViewController viewControllerWithStoryBoardType:STORYBOARD_TYPE_MAIN]; // OrderDetailViewController *detailVC = [OrderDetailViewController viewControllerWithStoryBoardType:STORYBOARD_TYPE_MAIN];
detailVC.model = model; // detailVC.model = model;
[self.navigationController pushViewController:detailVC animated:YES]; // [self.navigationController pushViewController:detailVC animated:YES];
} }
#pragma mark - actions #pragma mark - actions
...@@ -138,7 +140,7 @@ ...@@ -138,7 +140,7 @@
order.field = @"payTime"; order.field = @"payTime";
order.direction = @"desc"; order.direction = @"desc";
_param.orders = (NSArray<QueryOrder> *) @[ order ]; _param.orders = (NSArray<QueryOrder> *) @[ order ];
_param.merchantId = kUser.fid; // _param.merchantId = kUser.fid;
// _param.state = @"paid, invalid"; // _param.state = @"paid, invalid";
_param.beginDate = [[[NSDate date] yearMonthDayString] stringByAppendingString:@" 00:00:00"]; _param.beginDate = [[[NSDate date] yearMonthDayString] stringByAppendingString:@" 00:00:00"];
_param.endDate = [[[NSDate date] yearMonthDayString] stringByAppendingString:@" 23:59:59"]; _param.endDate = [[[NSDate date] yearMonthDayString] stringByAppendingString:@" 23:59:59"];
......
...@@ -33,8 +33,9 @@ static NSString *const kAccountGetUrl = @"account/get"; ...@@ -33,8 +33,9 @@ static NSString *const kAccountGetUrl = @"account/get";
//查询加油员账户流水列表 //查询加油员账户流水列表
static NSString *const kAccountQueryUrl = @"account/query"; static NSString *const kAccountQueryUrl = @"account/query";
static NSString *const kRePrintUrl = @"printer/printRefuelBill"; 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"; static NSString *const kWatchLogin = @"stationUser/token/send";
//查询用户申请提现记录 //查询用户申请提现记录
......
...@@ -433,7 +433,7 @@ extern NSString * const QUERYORDERDIRECTION_DESC; ...@@ -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; ...@@ -445,7 +445,7 @@ extern NSString * const QUERYORDERDIRECTION_DESC;
* *
* *
*/ */
@property (nonatomic, strong) NSDecimalNumber *drawBalance; @property (nonatomic, strong) NSNumber *drawBalance;
@end /* interface StationUserAcctEntity */ @end /* interface StationUserAcctEntity */
...@@ -617,13 +617,13 @@ extern NSString * const QUERYORDERDIRECTION_DESC; ...@@ -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; ...@@ -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; ...@@ -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; ...@@ -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; ...@@ -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; ...@@ -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; ...@@ -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; ...@@ -2241,10 +2241,10 @@ extern NSString * const QUERYORDERDIRECTION_DESC;
@interface ProductOrderQueryResult : RsQueryResult @interface ProductOrderQueryResult : RsQueryResult
/** /**
* 查询结果集合 * 查询结果集合
* @see OrderEntity * @see ProductOrderEntity
* *
*/ */
@property (nonatomic, strong) NSArray<OrderEntity> *records; @property (nonatomic, strong) NSArray<ProductOrderEntity> *records;
@end /* interface ProductOrderQueryResult */ @end /* interface ProductOrderQueryResult */
......
...@@ -15,8 +15,7 @@ ...@@ -15,8 +15,7 @@
#pragma mark - life cycle #pragma mark - life cycle
- (void)viewDidLoad - (void)viewDidLoad {
{
[super viewDidLoad]; [super viewDidLoad];
self.pageSize = 15; self.pageSize = 15;
...@@ -31,25 +30,21 @@ ...@@ -31,25 +30,21 @@
// Do any additional setup after loading the view. // Do any additional setup after loading the view.
} }
- (void)viewDidAppear:(BOOL)animated - (void)viewDidAppear:(BOOL)animated {
{
[super viewDidAppear:animated]; [super viewDidAppear:animated];
} }
- (void)viewWillAppear:(BOOL)animated - (void)viewWillAppear:(BOOL)animated {
{
[super viewWillAppear:animated]; [super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:NO animated:YES]; [self.navigationController setNavigationBarHidden:NO animated:YES];
} }
- (void)viewWillDisappear:(BOOL)animated - (void)viewWillDisappear:(BOOL)animated {
{
[super viewWillDisappear:animated]; [super viewWillDisappear:animated];
[self.navigationController setNavigationBarHidden:NO animated:YES]; [self.navigationController setNavigationBarHidden:NO animated:YES];
} }
- (void)didReceiveMemoryWarning - (void)didReceiveMemoryWarning {
{
[super didReceiveMemoryWarning]; [super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated. // Dispose of any resources that can be recreated.
} }
...@@ -57,8 +52,7 @@ ...@@ -57,8 +52,7 @@
/** /**
* 启用分页加载(最好在ViewDidLoad里面调用) * 启用分页加载(最好在ViewDidLoad里面调用)
*/ */
- (void)paggingMode - (void)paggingMode {
{
WS(weakSelf); WS(weakSelf);
self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{ self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
weakSelf.page = 0; weakSelf.page = 0;
...@@ -74,37 +68,31 @@ ...@@ -74,37 +68,31 @@
weakSelf.page++; weakSelf.page++;
[weakSelf httpRequest]; [weakSelf httpRequest];
}]; }];
self.tableView.mj_footer.hidden = YES; self.tableView.mj_footer.automaticallyHidden = YES;
} }
- (void)refresh - (void)refresh {
{
[self.tableView.mj_header beginRefreshing]; [self.tableView.mj_header beginRefreshing];
} }
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
{
return self.arrData.count; return self.arrData.count;
} }
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
{
[tableView deselectRowAtIndexPath:indexPath animated:YES]; [tableView deselectRowAtIndexPath:indexPath animated:YES];
[self listDidSelect:self.arrData[indexPath.row]]; [self listDidSelect:self.arrData[indexPath.row]];
} }
#pragma mark - empty state #pragma mark - empty state
- (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView - (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView {
{
return [UIImage imageNamed:@"list_no_data"]; 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]; [self.tableView.mj_header beginRefreshing];
} }
- (CAAnimation *)imageAnimationForEmptyDataSet:(UIScrollView *)scrollView - (CAAnimation *)imageAnimationForEmptyDataSet:(UIScrollView *)scrollView {
{
CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform"]; CABasicAnimation *animation = [CABasicAnimation animationWithKeyPath:@"transform"];
animation.fromValue = [NSValue valueWithCATransform3D:CATransform3DIdentity]; animation.fromValue = [NSValue valueWithCATransform3D:CATransform3DIdentity];
animation.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeRotation(M_PI_2, 0.0, 0.0, 1.0)]; animation.toValue = [NSValue valueWithCATransform3D:CATransform3DMakeRotation(M_PI_2, 0.0, 0.0, 1.0)];
...@@ -115,40 +103,39 @@ ...@@ -115,40 +103,39 @@
return animation; return animation;
} }
- (UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView - (UIColor *)backgroundColorForEmptyDataSet:(UIScrollView *)scrollView {
{
return [UIColor whiteColor]; return [UIColor whiteColor];
} }
- (IBAction)actionAdd:(UIButton *)sender - (IBAction)actionAdd:(UIButton *)sender {
{
} }
- (void)listTableViewReloadData - (void)listTableViewReloadData {
{
[MBProgressHUD j_hideLoadingView]; [MBProgressHUD j_hideLoadingView];
[self.tableView reloadData];
[self.tableView j_endRefresh];
self.tableView.mj_footer.hidden = self.arrData.count == 0;
if (self.arrData.count < self.pageSize * self.page) {
[self.tableView.mj_footer endRefreshingWithNoMoreData];
}
if (self.page == 0) { if (self.page == 0) {
[self.tableView j_endRefresh];
[self.tableView.mj_footer resetNoMoreData]; [self.tableView.mj_footer resetNoMoreData];
} else {
if (self.arrData.count < self.pageSize * self.page) {
[self.tableView.mj_footer endRefreshingWithNoMoreData];
} else {
[self.tableView j_endRefresh];
}
} }
[self.tableView reloadData];
} }
- (void)listTableViewReloadDataWithNewRecord:(NSArray *)newRecord - (void)listTableViewReloadDataWithNewRecord:(NSArray *)newRecord {
{
[self listTableViewReloadData]; [self listTableViewReloadData];
CLog(@"newrecord count = %lu", newRecord.count); CLog(@"newrecord count = %lu", newRecord.count);
if ([newRecord count] < self.pageSize) { if ([newRecord count] < self.pageSize) {
[self.tableView.mj_footer endRefreshingWithNoMoreData]; [self.tableView.mj_footer endRefreshingWithNoMoreData];
} }
} }
- (NSMutableArray *)arrData - (NSMutableArray *)arrData {
{
if (!_arrData) { if (!_arrData) {
_arrData = [NSMutableArray array]; _arrData = [NSMutableArray array];
} }
......
...@@ -11,10 +11,10 @@ ...@@ -11,10 +11,10 @@
@implementation UITableView (Addtions) @implementation UITableView (Addtions)
- (void)j_endRefresh { - (void)j_endRefresh {
// if ([self.mj_header isRefreshing]) { if ([self.mj_header isRefreshing]) {
[self.mj_header endRefreshing]; [self.mj_header endRefreshing];
// }else if ([self.mj_footer isRefreshing]) { }else if ([self.mj_footer isRefreshing]) {
[self.mj_footer endRefreshing]; [self.mj_footer endRefreshing];
// } }
} }
@end @end
...@@ -4,7 +4,7 @@ abstract_target 'car_base' do ...@@ -4,7 +4,7 @@ abstract_target 'car_base' do
pod 'AFNetworking', '~> 3.1.0' pod 'AFNetworking', '~> 3.1.0'
pod 'SDWebImage', '~> 3.7.5' pod 'SDWebImage', '~> 3.7.5'
pod 'MBProgressHUD', '~> 1.0.0' pod 'MBProgressHUD', '~> 1.0.0'
pod 'MJRefresh', '~> 3.1.2' pod 'MJRefresh'
pod 'IQKeyboardManager', '~> 4.0.6' pod 'IQKeyboardManager', '~> 4.0.6'
pod 'JSONModel', '~> 1.2.0' pod 'JSONModel', '~> 1.2.0'
pod 'DZNEmptyDataSet', '~> 1.8.1' pod 'DZNEmptyDataSet', '~> 1.8.1'
...@@ -14,9 +14,9 @@ abstract_target 'car_base' do ...@@ -14,9 +14,9 @@ abstract_target 'car_base' do
pod 'ZXingObjC', '~> 3.0' pod 'ZXingObjC', '~> 3.0'
pod 'UMengUShare/Social/WeChat' pod 'UMengUShare/Social/WeChat'
target 'Car' do target 'Car-Customer' do
end end
target 'Car Release' do target 'Car-Customer Release' do
end end
end end
...@@ -42,7 +42,7 @@ DEPENDENCIES: ...@@ -42,7 +42,7 @@ DEPENDENCIES:
- JPush (~> 2.2.0.1) - JPush (~> 2.2.0.1)
- JSONModel (~> 1.2.0) - JSONModel (~> 1.2.0)
- MBProgressHUD (~> 1.0.0) - MBProgressHUD (~> 1.0.0)
- MJRefresh (~> 3.1.2) - MJRefresh
- SDWebImage (~> 3.7.5) - SDWebImage (~> 3.7.5)
- UMengAnalytics-NO-IDFA - UMengAnalytics-NO-IDFA
- UMengUShare/Social/WeChat - UMengUShare/Social/WeChat
...@@ -62,6 +62,6 @@ SPEC CHECKSUMS: ...@@ -62,6 +62,6 @@ SPEC CHECKSUMS:
UMengUShare: fc0a98b8d5297632e82874318fd72a10d17da228 UMengUShare: fc0a98b8d5297632e82874318fd72a10d17da228
ZXingObjC: bf15b3814f7a105b6d99f47da2333c93a063650a ZXingObjC: bf15b3814f7a105b6d99f47da2333c93a063650a
PODFILE CHECKSUM: e9648119590790f6e637a439070d1eeaeac8afa5 PODFILE CHECKSUM: 267d7a77c2851d02af19b01794259d6389bb108e
COCOAPODS: 1.2.0 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