瀏覽代碼

Apex Land 1.11
修复无订单时首页控制按钮不能点

Ray Zhang 7 年之前
父節點
當前提交
c76ad67e7d

+ 3 - 0
Redant Drivers/Apex And Drivers/Home/RAHomeViewController.h

@@ -8,6 +8,7 @@
 
 #import "RABaseViewController.h"
 #import "RAHomeOrderModel.h"
+#import "RAEmptyView.h"
 
 @protocol RAHomeSectionModelDelegate <NSObject>
 
@@ -46,6 +47,8 @@
 @property (nonatomic,assign) BOOL reloadFlag;///<视图显示时Reload
 @property (weak, nonatomic) IBOutlet UILabel *label_cache;
 
+@property (strong,nonatomic) RAEmptyView * Reloadview;
+
 @property (nonatomic,strong, readonly) RAHomeHeaderView *headerView;
 
 #pragma mark - Getter

+ 73 - 8
Redant Drivers/Apex And Drivers/Home/RAHomeViewController.m

@@ -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;
             }
         });
         

+ 2 - 2
Redant Drivers/Apex And Drivers/Info.plist

@@ -17,9 +17,9 @@
 	<key>CFBundlePackageType</key>
 	<string>APPL</string>
 	<key>CFBundleShortVersionString</key>
-	<string>1.10</string>
+	<string>1.11</string>
 	<key>CFBundleVersion</key>
-	<string>40255</string>
+	<string>40259</string>
 	<key>LSApplicationQueriesSchemes</key>
 	<array>
 		<string>comgooglemaps</string>

+ 5 - 3
common/UIScrollVIew+Empty/UIScrollView+Empty.h

@@ -7,15 +7,17 @@
 //
 
 #import <UIKit/UIKit.h>
-
+#import "RAEmptyDataView.h"
 @interface UIScrollView (Empty)
 
 @property (nonatomic,strong) UIView *emptyView;
-
+//@property  (assign) bool emptyDataViewManualsize;
 - (void)showEmpty;
 
 - (void)hideEmpty;
 
-- (void)setEmptyContentViewBackgroupColor:(UIColor *)color;
 
+//- (void)setEmptyDataViewManualsize:(bool)bManualsize;
+- (void)setEmptyContentViewBackgroupColor:(UIColor *)color;
+- (RAEmptyDataView *)emptyContentView;
 @end

+ 5 - 2
common/UIScrollVIew+Empty/UIScrollView+Empty.m

@@ -7,7 +7,7 @@
 //
 
 #import "UIScrollView+Empty.h"
-#import "RAEmptyDataView.h"
+
 #import <objc/runtime.h>
 
 static const char *emptyKey = "emptyKey";
@@ -15,7 +15,10 @@ static const char *emptyKey = "emptyKey";
 static const float duration = 0.25;
 
 @implementation UIScrollView (Empty)
-
+//- (void)setEmptyDataViewManualsize:(bool)bManualsize
+//{
+//    _emptyDataViewManualsize=bManualsize;
+//}
 - (void)setEmptyContentView:(RAEmptyDataView *)contentView {
     if (contentView) {
         UIView *view = objc_getAssociatedObject(self, emptyKey);