Browse Source

1.tabbar针对SN显示不一样的内容

huangxiaodong 2 months ago
parent
commit
1cad939a16

+ 22 - 12
创维盒子/code/AppDelegate/SceneDelegate.m

@@ -64,7 +64,7 @@
 #import "imageVersionUpdateFailView.h"
 #import "LoginType1ViewController.h"
 #import "privacyModeTipViewController.h"
-
+#import "previewFileAndFolderViewController.h"
 
 @interface SceneDelegate ()<SetUsePWDViewControllerDelegate,GuideViewControllerDelegate,UITabBarControllerDelegate>
 {
@@ -534,25 +534,35 @@
     cloudPhoneViewController *cloudVC = [[cloudPhoneViewController alloc] init];
     BaseNavigationController *cloudPhoneNav = [[BaseNavigationController alloc] initWithRootViewController:cloudVC];
 
+    previewFileAndFolderViewController *fileVC = [[previewFileAndFolderViewController alloc] init];
+    BaseNavigationController *fileNav = [[BaseNavigationController alloc] initWithRootViewController:fileVC];
+
     mineViewController *mineVC = [[mineViewController alloc] init];
     BaseNavigationController *mineNav = [[BaseNavigationController alloc] initWithRootViewController:mineVC];
     
-
-    //NSArray *viewControllers = @[NasNav, cloudPhoneNav,mineNav]; // 添加更多视图控制器
-    NSArray *viewControllers = @[NasNav,mineNav]; // 添加更多视图控制器
-    tabBarController.viewControllers = viewControllers;
     
-
     NSString*phoneTitle = NSLocalizedString(@"tabbar_cloud_phone",nil);
     NSString*myTitle = NSLocalizedString(@"tabbar_my_title",nil);
+    NSString*fileTitle = NSLocalizedString(@"my_set_no_file",nil);
     
-//    NSArray *titleArr = @[@"NAS",phoneTitle,myTitle];
-//    NSArray *imageNArr = @[@"tabbar_nas_N", @"tabbar_phone_N",@"tabbar_my_N"];
-//    NSArray *imageHArr = @[@"tabbar_nas_H", @"tabbar_phone_H",@"tabbar_my_H"];
+    //NSArray *viewControllers = @[NasNav, cloudPhoneNav,mineNav]; // 添加更多视图控制器
+    NSArray *viewControllers = @[NasNav,fileNav,mineNav]; // 添加更多视图控制器
     
-    NSArray *titleArr = @[@"NAS",myTitle];
-    NSArray *imageNArr = @[@"tabbar_nas_N",@"tabbar_my_N"];
-    NSArray *imageHArr = @[@"tabbar_nas_H",@"tabbar_my_H"];
+    NSArray *titleArr = @[@"NAS",fileTitle,myTitle];
+    NSArray *imageNArr = @[@"tabbar_nas_N", @"tabbar_file_N",@"tabbar_my_N"];
+    NSArray *imageHArr = @[@"tabbar_nas_H", @"tabbar_file_H",@"tabbar_my_H"];
+    
+    if(ksharedAppDelegate.DeviceThirdIdMod
+       && ![ksharedAppDelegate.DeviceThirdIdMod.data.changeSn isEqualToString:@"0333933700223110016962"]){
+        titleArr = @[@"NAS",phoneTitle,myTitle];
+        imageNArr = @[@"tabbar_nas_N", @"my_device_NO",@"tabbar_my_N"];
+        imageHArr = @[@"tabbar_nas_H", @"my_device_ok",@"tabbar_my_H"];
+        
+        viewControllers = @[NasNav,cloudPhoneNav,mineNav];
+    }
+   
+    
+    tabBarController.viewControllers = viewControllers;
     
     for (int i=0; i<viewControllers.count; i++) {
         UITabBarItem * tabBarItem = [UITabBarItem new];

+ 37 - 2
创维盒子/code/Class/Set/previewFile/previewFileAndFolderViewController.m

@@ -37,6 +37,8 @@
     BOOL hadDownloadTaskType;
     
     BOOL canShareType;
+    
+    BOOL isFirstPageType;//是否为第一页
 }
 @property (nonatomic, strong) UITableView *tableView;
 
@@ -61,12 +63,26 @@
     [super viewDidLoad];
     // Do any additional setup after loading the view.
     
+    NSArray *vcArr = self.navigationController.viewControllers;
+    
+    if(vcArr.count == 1){
+        isFirstPageType = YES;
+    }
+    else{
+        isFirstPageType = NO;
+    }
+    
     [self.toolBar setHidden:YES];
     [self.navigationBar setHidden:YES];
     [self.navBarBGView setHidden:NO];
     self.navBarBGView.backgroundColor = [UIColor whiteColor];
     [self.view setBackgroundColor:[UIColor whiteColor]];
     
+    
+    if(isFirstPageType){
+        self.backBtn.hidden = YES;
+    }
+    
     [self drawAnyView];
     
     _didSelectListArr = [NSMutableArray new];
@@ -127,12 +143,21 @@
         }
     };
     
+    CGFloat tableViewAdjust = 0.0;
+    CGFloat bigAddbuttonAdjust = 0.0;
+    
+    if(isFirstPageType){
+        tableViewAdjust = TABBARHEIGHT;
+        bigAddbuttonAdjust = TABBARHEIGHT;
+    }
+    
+    
     [self.view addSubview:self.tableView];
     [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(0);
         make.right.mas_equalTo(0);
         //make.bottom.mas_equalTo(-(safeArea));
-        make.bottom.mas_equalTo(0);
+        make.bottom.mas_equalTo(-tableViewAdjust);
         make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
     }];
     
@@ -145,9 +170,15 @@
         make.right.mas_equalTo(-15);
         make.width.mas_equalTo(52);
         make.height.mas_equalTo(52);
-        make.bottom.mas_equalTo(-30 - AdaptTabHeight);
+        make.bottom.mas_equalTo(-30 - AdaptTabHeight - bigAddbuttonAdjust);
     }];
     
+    [self customDefaultDiskPathFun];
+}
+
+//设置默认磁盘
+- (void)customDefaultDiskPathFun
+{
     NSMutableArray *arr = [NSMutableArray new];
     NSArray *diskList = ksharedAppDelegate.cloudPhoneExtraFileListMod.data;
     if(diskList && [diskList isKindOfClass:[NSArray class]]){
@@ -189,6 +220,7 @@
     }
     _diskListArr = arr;
     [self setTitleAfterGetdiskFun];
+    
 }
 
 - (void)initNavHeadUIFun
@@ -812,6 +844,9 @@
     [self checkFileTransferTask];
     
     if(!_curNASFileAudioMod){
+        
+        [self customDefaultDiskPathFun];
+        
         [self getFileListFun:NO];
         [self queryShareSwitchFunFun];
     }

File diff suppressed because it is too large
+ 0 - 1203
创维盒子/code/Class/Set/previewFile/previewFileAndFolderViewController~.m