|
|
@@ -12,7 +12,7 @@
|
|
|
#import "ApexDriverUploadListVC.h"
|
|
|
#import "RAHomeMoreViewController.h"
|
|
|
#import <UserNotifications/UserNotifications.h>
|
|
|
-#import "UIScrollView+Empty.h"
|
|
|
+//#import "UIScrollView+Empty.h"
|
|
|
#import "RAEmptyView.h"
|
|
|
#import "RAHomeHeaderView.h"
|
|
|
#import "RAMessageViewController.h"
|
|
|
@@ -165,18 +165,80 @@
|
|
|
[self.homeOrderTableView addSubview:refresh];
|
|
|
self.refreshControl = refresh;
|
|
|
|
|
|
+// self.homeOrderTableView.emptyDataViewManualsize = true;
|
|
|
// empty
|
|
|
- __weak typeof(self) weakSelf = self;
|
|
|
- self.homeOrderTableView.emptyView = [RAEmptyView emptyViewWithTapBlk:^(id sender) {
|
|
|
- [weakSelf loadData];
|
|
|
- }];
|
|
|
+// self.homeOrderTableView setempty
|
|
|
+// __weak typeof(self) weakSelf = self;
|
|
|
+// self.homeOrderTableView.emptyView = [RAEmptyView emptyViewWithTapBlk:^(id sender) {
|
|
|
+// [weakSelf loadData];
|
|
|
+// }];
|
|
|
|
|
|
// Header
|
|
|
self.headerView = [RAHomeHeaderView homeHeader];
|
|
|
self.headerView.delegate = self;
|
|
|
self.homeOrderTableView.tableHeaderView = self.headerView;
|
|
|
+
|
|
|
+
|
|
|
+// self.emptyReloadview =[[UIView alloc] initWithFrame:CGRectMake(200, 200, 300, 300)];
|
|
|
+//// self.emptyReloadview.autoresizingMask = UIViewAutoresizingFlexibleWidth|UIViewAutoresizingFlexibleHeight;
|
|
|
+//// [self.homeOrderTableView addSubview:self.emptyContentview];
|
|
|
+// [self.homeOrderTableView insertSubview:self.emptyReloadview atIndex:0];
|
|
|
+//
|
|
|
+// self.emptyReloadview.backgroundColor = [UIColor redColor];
|
|
|
+// self.emptyReloadview.hidden = NO;
|
|
|
+// [self.homeOrderTableView bringSubviewToFront:self.emptyReloadview];
|
|
|
+
|
|
|
+ __weak typeof(self) weakSelf = self;
|
|
|
+ RAEmptyView* ev = [RAEmptyView emptyViewWithTapBlk:^(id sender) {
|
|
|
+ [weakSelf loadData];
|
|
|
+
|
|
|
+
|
|
|
+ }];
|
|
|
+ self.Reloadview = ev;
|
|
|
+ [self.homeOrderTableView addSubview:ev];
|
|
|
+// CGRect tvrect = self.homeOrderTableView.frame;
|
|
|
+// CGRect hvrect = self.homeOrderTableView.tableHeaderView.frame;
|
|
|
+ ev.hidden = YES;
|
|
|
+// ev.translatesAutoresizingMaskIntoConstraints = false;
|
|
|
+// NSLayoutConstraint *centerYConstraint =
|
|
|
+// [NSLayoutConstraint constraintWithItem:ev
|
|
|
+// attribute:NSLayoutAttributeCenterY
|
|
|
+// relatedBy:NSLayoutRelationEqual
|
|
|
+// toItem:self.homeOrderTableView
|
|
|
+// attribute:NSLayoutAttributeCenterY
|
|
|
+// multiplier:1.0
|
|
|
+// constant:0.0];
|
|
|
+// [self.homeOrderTableView addConstraint:centerYConstraint];
|
|
|
+//
|
|
|
+
|
|
|
+ ev.center = self.homeOrderTableView.center;
|
|
|
}
|
|
|
+- (void)updateViewConstraints
|
|
|
+{
|
|
|
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ [super updateViewConstraints];
|
|
|
+
|
|
|
+//
|
|
|
+// //约束条件
|
|
|
+// //redview在垂直方向上距离边界为50
|
|
|
+// UIView* dv= self.emptyReloadview;
|
|
|
+// dv.translatesAutoresizingMaskIntoConstraints=NO;
|
|
|
+// NSLayoutConstraint *constraint1 = [NSLayoutConstraint constraintWithItem:dv attribute:NSLayoutAttributeTop relatedBy:NSLayoutRelationEqual toItem:self.homeOrderTableView attribute:NSLayoutAttributeTop multiplier:1 constant:0];
|
|
|
+// NSLayoutConstraint *constraint2 = [NSLayoutConstraint constraintWithItem:dv attribute:NSLayoutAttributeBottom relatedBy:NSLayoutRelationEqual toItem:self.homeOrderTableView attribute:NSLayoutAttributeBottom multiplier:1 constant:0];
|
|
|
+//
|
|
|
+// NSLayoutConstraint *constraint3 = [NSLayoutConstraint constraintWithItem:dv attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.homeOrderTableView attribute:NSLayoutAttributeLeft multiplier:1 constant:0];
|
|
|
+//
|
|
|
+// NSLayoutConstraint *constraint4 = [NSLayoutConstraint constraintWithItem:dv attribute:NSLayoutAttributeRight relatedBy:NSLayoutRelationEqual toItem:self.homeOrderTableView attribute:NSLayoutAttributeRight multiplier:1 constant:0];
|
|
|
+//
|
|
|
+// [self.homeOrderTableView addConstraint:constraint1];
|
|
|
+// [self.homeOrderTableView addConstraint:constraint2];
|
|
|
+// [self.homeOrderTableView addConstraint:constraint3];
|
|
|
+// [self.homeOrderTableView addConstraint:constraint4];
|
|
|
+
|
|
|
+}
|
|
|
- (void)configureNavigationBar {
|
|
|
|
|
|
UIImage *logo = [[UIImage imageNamed:@"apex_logo"] imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
|
|
|
@@ -407,7 +469,8 @@
|
|
|
}
|
|
|
self.loading = YES;
|
|
|
|
|
|
- [self.homeOrderTableView hideEmpty];
|
|
|
+// [self.homeOrderTableView hideEmpty];
|
|
|
+ self.Reloadview.hidden = true;
|
|
|
|
|
|
// show progress
|
|
|
RAProgressHUD *hud = [RAProgressHUD showHUDOnView:self.view];
|
|
|
@@ -496,9 +559,11 @@
|
|
|
weakSelf.loading = NO;
|
|
|
|
|
|
if (weakSelf.orderSectionCount == 0) {
|
|
|
- [weakSelf.homeOrderTableView showEmpty];
|
|
|
+// [weakSelf.homeOrderTableView showEmpty];
|
|
|
+ self.Reloadview.hidden = false;
|
|
|
} else {
|
|
|
- [weakSelf.homeOrderTableView hideEmpty];
|
|
|
+// [weakSelf.homeOrderTableView hideEmpty];
|
|
|
+ self.Reloadview.hidden = true;
|
|
|
}
|
|
|
});
|
|
|
|