Forráskód Böngészése

1.最近文件开关

huangxiaodong 1 éve%!(EXTRA string=óta)
szülő
commit
d4a33fbbc8

+ 3 - 0
创维盒子/双子星云手机/AppDelegate/Config/Const.h

@@ -151,6 +151,9 @@ UIKIT_EXTERN NSString *const Consn_player_Nav_hide;
 /*推流页是否全屏 YES:全屏  其他显示*/
 UIKIT_EXTERN NSString *const Consn_player_full_screen_show;
 
+/*是否显示最近文件 YES:显示  其他显示*/
+UIKIT_EXTERN NSString *const Const_last_file_show;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 3 - 0
创维盒子/双子星云手机/AppDelegate/Config/Const.m

@@ -146,4 +146,7 @@ NSString *const Const_did_show_version_and_click_wait = @"show_version_and_click
 NSString *const Consn_player_Nav_hide = @"player_Nav_hide";
 /*推流页是否全屏 YES:全屏  其他显示*/
 NSString *const Consn_player_full_screen_show = @"player_full_screen_show";
+
+/*是否显示最近文件 YES:显示  其他显示*/
+NSString *const Const_last_file_show = @"last_file_show";
 @end

+ 4 - 0
创维盒子/双子星云手机/AppDelegate/SceneDelegate.m

@@ -134,6 +134,10 @@
     /*先判断本地有无设备 无设备时需要先扫码添加设备*/
     NSDictionary *deviceDict = [HWDataManager getObjectWithKey:Const_Have_Add_Device];
     if (!deviceDict || ![[deviceDict allKeys] containsObject:Const_Have_Add_Device_SN]){
+        
+        //默认显示最近文件
+        [HWDataManager setBoolWithKey:Const_last_file_show value:YES];
+        
         /*扫码界面*/
         TipsQRCodeViewController *qrCodeVC = [[TipsQRCodeViewController alloc] init];
         BaseNavigationController *qrCodeVCNav = [[BaseNavigationController alloc] initWithRootViewController:qrCodeVC];

+ 33 - 11
创维盒子/双子星云手机/NAS/NASViewController.m

@@ -172,6 +172,9 @@
         make.height.mas_equalTo(54);
     }];
     
+    BOOL isShowLastFileType = [HWDataManager getBoolWithKey:Const_last_file_show];
+    self.NASLastFileV.eyeButton.selected = !isShowLastFileType;
+    
     //tableFooterView
     NSString *text =  NSLocalizedString(@"NAS_bottom_tip",nil);
     UILabel *label = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, SCREEN_W, 50)];
@@ -387,7 +390,9 @@
 #pragma mark 点击最近文件模块
 - (void)didClickLastFileFunBy:(NSInteger)tag
 {
-    
+    if(tag == 2){
+        [self getLastFileDataFun];
+    }
 }
 
 #pragma mark 用户点击上传文件
@@ -475,7 +480,33 @@
     _lastFileDataArr = [lastFileManager shareManager].lastFileListArr;
     //HLog(@"%@",_lastFileDataArr);
     
-    if(_lastFileDataArr.count > 0){
+    BOOL isShowLastFileType = [HWDataManager getBoolWithKey:Const_last_file_show];
+    if(!isShowLastFileType){
+        _tableHeadView.frame = CGRectMake(0, 0, SCREEN_W, 165+ 15 +120 +54 + 15);
+        
+        [self.NASLastFileV mas_remakeConstraints:^(MASConstraintMaker *make) {
+            make.top.equalTo(_NASCommonUsedV.mas_bottom).offset(15);
+            make.left.mas_equalTo(0);
+            make.right.mas_equalTo(0);
+            make.height.mas_equalTo(54);
+        }];
+        
+        self.NASLastFileV.notDataImageV.hidden = YES;
+        self.NASLastFileV.notDataLabel.hidden = YES;
+        
+        //全圆角
+        UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W-32 , 54)
+                                                       byRoundingCorners:UIRectCornerAllCorners
+                                                             cornerRadii:CGSizeMake(12, 12)];
+        CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
+        maskLayer.frame = self.NASLastFileV.bounds;
+        maskLayer.path = maskPath.CGPath;
+        self.NASLastFileV.whiteBgView.layer.mask = maskLayer;
+        
+        _lastFileDataArr = [NSMutableArray new];
+        
+    }
+    else if(_lastFileDataArr.count > 0){
         _tableHeadView.frame = CGRectMake(0, 0, SCREEN_W, 165+ 15 +120 +54 + 15);
         
         [self.NASLastFileV mas_remakeConstraints:^(MASConstraintMaker *make) {
@@ -488,15 +519,6 @@
         self.NASLastFileV.notDataImageV.hidden = YES;
         self.NASLastFileV.notDataLabel.hidden = YES;
         
-//        /*上圆角*/
-//        UIBezierPath *maskPath = [UIBezierPath bezierPathWithRoundedRect:CGRectMake(0, 0, SCREEN_W- 32 , 54)
-//                                                       byRoundingCorners:UIRectCornerAllCorners
-//                                                             cornerRadii:CGSizeMake(12, 12)];
-//        CAShapeLayer *maskLayer = [[CAShapeLayer alloc] init];
-//        //maskLayer.frame = self.NASLastFileV.bounds;
-//        maskLayer.frame = CGRectMake(0, 0, SCREEN_W -32, 54);
-//        maskLayer.path = maskPath.CGPath;
-//        self.NASLastFileV.layer.mask = maskLayer;
     }
     else{
         _tableHeadView.frame = CGRectMake(0, 0, SCREEN_W, 165+ 15 +120 +254 + 15);

+ 1 - 0
创维盒子/双子星云手机/NAS/view/NASLastFileView.h

@@ -11,6 +11,7 @@ NS_ASSUME_NONNULL_BEGIN
 
 @interface NASLastFileView : UIView
 @property(nonatomic,strong)UIView *whiteBgView;
+@property(nonatomic,strong)UIButton *eyeButton;
 
 @property(nonatomic,strong)UIImageView* notDataImageV;
 @property(nonatomic,strong)UILabel *notDataLabel;

+ 10 - 1
创维盒子/双子星云手机/NAS/view/NASLastFileView.m

@@ -9,7 +9,7 @@
 
 @interface NASLastFileView ()
 @property(nonatomic,strong) UILabel*titleLabel;
-@property(nonatomic,strong)UIButton *eyeButton;
+
 @end
 
 @implementation NASLastFileView
@@ -137,6 +137,15 @@
     NSInteger tag = but.tag;
     HLog(@"%ld",tag);
     
+    if(tag == 2){
+        [HWDataManager setBoolWithKey:Const_last_file_show value:but.selected];
+        
+        //HLog(@"Const_last_file_show xxx:%d",but.selected)
+        but.selected = !but.selected;
+        //HLog(@"Const_last_file_show ddd:%d",but.selected)
+        
+    }
+    
     if(_didClickButtonFun){
         _didClickButtonFun(tag);
     }