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

1.文件夹列表显示

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

+ 12 - 0
创维盒子/双子星云手机.xcodeproj/project.pbxproj

@@ -279,6 +279,10 @@
 		6B5BE57B2BFC767100A1B9B3 /* previewFileAndFolderViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5BE5782BFC767100A1B9B3 /* previewFileAndFolderViewController.h */; };
 		6B5BE57C2BFC767100A1B9B3 /* previewFileAndFolderViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5BE5792BFC767100A1B9B3 /* previewFileAndFolderViewController.m */; };
 		6B5BE57D2BFC767100A1B9B3 /* previewFileAndFolderViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5BE5782BFC767100A1B9B3 /* previewFileAndFolderViewController.h */; };
+		6B5BE5802BFC81E300A1B9B3 /* NASFileAndFolderModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5BE57F2BFC81E300A1B9B3 /* NASFileAndFolderModel.m */; };
+		6B5BE5812BFC81E300A1B9B3 /* NASFileAndFolderModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5BE57E2BFC81E300A1B9B3 /* NASFileAndFolderModel.h */; };
+		6B5BE5822BFC81E300A1B9B3 /* NASFileAndFolderModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5BE57F2BFC81E300A1B9B3 /* NASFileAndFolderModel.m */; };
+		6B5BE5832BFC81E300A1B9B3 /* NASFileAndFolderModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5BE57E2BFC81E300A1B9B3 /* NASFileAndFolderModel.h */; };
 		6B5D40152B47F27A000965CF /* couldPhoneCommonModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5D40132B47F27A000965CF /* couldPhoneCommonModel.h */; };
 		6B5D40162B47F27A000965CF /* couldPhoneCommonModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B5D40142B47F27A000965CF /* couldPhoneCommonModel.m */; };
 		6B5D401A2B4A9850000965CF /* couldPhoneFolderListModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B5D40182B4A9850000965CF /* couldPhoneFolderListModel.h */; };
@@ -1187,6 +1191,8 @@
 		6B5B60792B3E71B6009A2AE2 /* filePathCreatTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = filePathCreatTableViewCell.m; sourceTree = "<group>"; };
 		6B5BE5782BFC767100A1B9B3 /* previewFileAndFolderViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = previewFileAndFolderViewController.h; sourceTree = "<group>"; };
 		6B5BE5792BFC767100A1B9B3 /* previewFileAndFolderViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = previewFileAndFolderViewController.m; sourceTree = "<group>"; };
+		6B5BE57E2BFC81E300A1B9B3 /* NASFileAndFolderModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = NASFileAndFolderModel.h; sourceTree = "<group>"; };
+		6B5BE57F2BFC81E300A1B9B3 /* NASFileAndFolderModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = NASFileAndFolderModel.m; sourceTree = "<group>"; };
 		6B5D40132B47F27A000965CF /* couldPhoneCommonModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = couldPhoneCommonModel.h; sourceTree = "<group>"; };
 		6B5D40142B47F27A000965CF /* couldPhoneCommonModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = couldPhoneCommonModel.m; sourceTree = "<group>"; };
 		6B5D40182B4A9850000965CF /* couldPhoneFolderListModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = couldPhoneFolderListModel.h; sourceTree = "<group>"; };
@@ -2199,6 +2205,8 @@
 				6B7EA7972BF5B4A6002D5CC2 /* NASFilePicModel.m */,
 				6B07AC292BF8D38F005C2B0E /* NASFileAudioModel.h */,
 				6B07AC2A2BF8D38F005C2B0E /* NASFileAudioModel.m */,
+				6B5BE57E2BFC81E300A1B9B3 /* NASFileAndFolderModel.h */,
+				6B5BE57F2BFC81E300A1B9B3 /* NASFileAndFolderModel.m */,
 				6B7EA7A82BF72D3B002D5CC2 /* queryShareModel.h */,
 				6B7EA7A92BF72D3B002D5CC2 /* queryShareModel.m */,
 				6B7EA7AE2BF73DEB002D5CC2 /* addShareModel.h */,
@@ -2708,6 +2716,7 @@
 				18C4754F2A8E0DB5006129C0 /* MySetViewController.h in Headers */,
 				18FCE53F2AD136670020F623 /* PlayerViewController+TouchPointXD.h in Headers */,
 				18FCE53E2AD136670020F623 /* PlayerViewController+AdjustBtnFrame.h in Headers */,
+				6B5BE5812BFC81E300A1B9B3 /* NASFileAndFolderModel.h in Headers */,
 				6B7EA7BC2BF759AC002D5CC2 /* shareSecretTableViewCell.h in Headers */,
 				6B05815B2AFC851E00D37290 /* mySetHeadView.h in Headers */,
 				6BF52CAD2AD82EA500A617DB /* PlayerControlButTipView.h in Headers */,
@@ -2860,6 +2869,7 @@
 				6BD506C92B9576A4006E7CB0 /* MySetViewController.h in Headers */,
 				6BD506CA2B9576A4006E7CB0 /* PlayerViewController+TouchPointXD.h in Headers */,
 				6BD506CB2B9576A4006E7CB0 /* PlayerViewController+AdjustBtnFrame.h in Headers */,
+				6B5BE5832BFC81E300A1B9B3 /* NASFileAndFolderModel.h in Headers */,
 				6B7EA7BE2BF759AC002D5CC2 /* shareSecretTableViewCell.h in Headers */,
 				6BD506CC2B9576A4006E7CB0 /* mySetHeadView.h in Headers */,
 				6BD506CD2B9576A4006E7CB0 /* PlayerControlButTipView.h in Headers */,
@@ -3449,6 +3459,7 @@
 				6BD5077C2B9576A4006E7CB0 /* HWFolderListCell.m in Sources */,
 				6BD5077D2B9576A4006E7CB0 /* RSA.m in Sources */,
 				6BD5077E2B9576A4006E7CB0 /* RSATool.m in Sources */,
+				6B5BE5822BFC81E300A1B9B3 /* NASFileAndFolderModel.m in Sources */,
 				6BD5077F2B9576A4006E7CB0 /* iPhone.m in Sources */,
 				6BD507802B9576A4006E7CB0 /* UIRefreshControl+AFNetworking.m in Sources */,
 				6BD507812B9576A4006E7CB0 /* SceneDelegate.m in Sources */,
@@ -3686,6 +3697,7 @@
 				A00221E027EB0EBF00E45F78 /* HWFolderListCell.m in Sources */,
 				A003F6D027D8425C00715CBF /* RSA.m in Sources */,
 				18BA24882AA5C57900BA01EE /* RSATool.m in Sources */,
+				6B5BE5802BFC81E300A1B9B3 /* NASFileAndFolderModel.m in Sources */,
 				1866F99E2A136DC700B31E22 /* iPhone.m in Sources */,
 				183AE64D2A8A2CF000B11CB0 /* UIRefreshControl+AFNetworking.m in Sources */,
 				A003F6E327D8428200715CBF /* SceneDelegate.m in Sources */,

+ 22 - 0
创维盒子/双子星云手机/Assets.xcassets/Set/uploadFile_dir.imageset/Contents.json

@@ -0,0 +1,22 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "scale" : "1x"
+    },
+    {
+      "filename" : "uploadFile_dir@2x.png",
+      "idiom" : "universal",
+      "scale" : "2x"
+    },
+    {
+      "filename" : "uploadFile_dir@3x.png",
+      "idiom" : "universal",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "author" : "xcode",
+    "version" : 1
+  }
+}

BIN
创维盒子/双子星云手机/Assets.xcassets/Set/uploadFile_dir.imageset/uploadFile_dir@2x.png


BIN
创维盒子/双子星云手机/Assets.xcassets/Set/uploadFile_dir.imageset/uploadFile_dir@3x.png


+ 33 - 0
创维盒子/双子星云手机/Class/Set/previewFile/model/NASFileAndFolderModel.h

@@ -0,0 +1,33 @@
+//
+//  NASFileAndFolderModel.h
+//  双子星云手机
+//
+//  Created by xd h on 2024/5/21.
+//
+
+#import "SuperModel.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface NASFileAndFolderDataModel : SuperModel
+@property (nonatomic, copy) NSString*path;
+@property (nonatomic, copy) NSString*name;
+@property (nonatomic, assign) long time;//NSString*time;
+@property (nonatomic, assign) long  size;
+@property (nonatomic, copy) NSString*type;
+@property (nonatomic, assign) NSInteger duration;
+
+//自定义
+@property (nonatomic, assign) BOOL isSelectType;
+@end
+
+@protocol NASFileAndFolderDataModel;
+@interface NASFileAndFolderArrModel : SuperModel
+@property (nonatomic, strong) NSArray<NASFileAndFolderDataModel>* list;
+@end
+
+@interface NASFileAndFolderModel : SuperModel
+@property (nonatomic, strong) NASFileAndFolderArrModel* data;
+@end
+
+NS_ASSUME_NONNULL_END

+ 20 - 0
创维盒子/双子星云手机/Class/Set/previewFile/model/NASFileAndFolderModel.m

@@ -0,0 +1,20 @@
+//
+//  NASFileAndFolderModel.m
+//  双子星云手机
+//
+//  Created by xd h on 2024/5/21.
+//
+
+#import "NASFileAndFolderModel.h"
+
+@implementation NASFileAndFolderDataModel
+
+@end
+
+@implementation NASFileAndFolderArrModel
+
+@end
+
+@implementation NASFileAndFolderModel
+
+@end

+ 5 - 5
创维盒子/双子星云手机/Class/Set/previewFile/previewFileAndFolderViewController.m

@@ -20,7 +20,7 @@
 #import "editShareView.h"
 #import "previewToUploadFileView.h"
 #import "netWorkManager.h"
-#import "NASFileAudioModel.h"
+#import "NASFileAndFolderModel.h"
 
 @interface previewFileAndFolderViewController ()<UITableViewDelegate,UITableViewDataSource,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
 {
@@ -46,7 +46,7 @@
 @property(nonatomic,strong) UIButton*uploadFileButton;
 
 @property (nonatomic, strong)  NSMutableArray*didSelectListArr;//选中的数据
-@property (nonatomic, strong)NASFileAudioModel * curNASFileAudioMod;
+@property (nonatomic, strong)NASFileAndFolderModel * curNASFileAudioMod;
 @end
 
 @implementation previewFileAndFolderViewController
@@ -344,8 +344,8 @@
     }
     
     if(row < _curNASFileAudioMod.data.list.count){
-        NASFileAudioDataModel* dataModel = _curNASFileAudioMod.data.list[row];
-        cell.curNASFileAudioDataModel = dataModel;
+        NASFileAndFolderDataModel* dataModel = _curNASFileAudioMod.data.list[row];
+        cell.curNASFileAndFolderDataModel = dataModel;
         
         KWeakSelf
         cell.didClickSwitch = ^(BOOL SwitchOn) {
@@ -783,7 +783,7 @@
     KWeakSelf
     [[netWorkManager shareInstance] cloudPhoneGETCallBackCode:@"getFileListByFolder" Parameters:paraDict success:^(id  _Nonnull responseObject) {
         [weakSelf removeNewIndicatorHaveStr];
-        weakSelf.curNASFileAudioMod = [[NASFileAudioModel alloc] initWithDictionary:responseObject error:nil];
+        weakSelf.curNASFileAudioMod = [[NASFileAndFolderModel alloc] initWithDictionary:responseObject error:nil];
         
         if(weakSelf.curNASFileAudioMod && weakSelf.curNASFileAudioMod.status == 0){
             [weakSelf.tableView reloadData];

+ 4 - 0
创维盒子/双子星云手机/Class/Set/uploadFile/downLoadFile/view/downLoadPreViewCell.h

@@ -8,6 +8,7 @@
 #import <UIKit/UIKit.h>
 #import "couldPhoneFileListModel.h"
 #import "NASFileAudioModel.h"
+#import "NASFileAndFolderModel.h"
 NS_ASSUME_NONNULL_BEGIN
 
 @interface downLoadPreViewCell : UITableViewCell
@@ -24,6 +25,9 @@ NS_ASSUME_NONNULL_BEGIN
 
 @property(nonatomic,strong) couldPhoneFileModel*curFileModel;
 @property(nonatomic,strong) NASFileAudioDataModel*curNASFileAudioDataModel;
+
+@property(nonatomic,strong) NASFileAndFolderDataModel*curNASFileAndFolderDataModel;
+
 @end
 
 NS_ASSUME_NONNULL_END

+ 67 - 0
创维盒子/双子星云手机/Class/Set/uploadFile/downLoadFile/view/downLoadPreViewCell.m

@@ -253,4 +253,71 @@
     
     titleLabel.attributedText = noteStr;
 }
+
+- (void)setCurNASFileAndFolderDataModel:(NASFileAndFolderDataModel *)curNASFileAndFolderDataModel
+{
+    _curNASFileAndFolderDataModel = curNASFileAndFolderDataModel;
+    
+    checkButton.hidden = NO;
+    
+    mImageView.image = [UIImage imageNamed:@"uploadFile_image"];
+    if([curNASFileAndFolderDataModel.type isEqualToString:@"video"])
+    {
+        mImageView.image = [UIImage imageNamed:@"uploadFile_Video"];
+    }
+    else if([curNASFileAndFolderDataModel.type isEqualToString:@"audio"])
+    {
+        mImageView.image = [UIImage imageNamed:@"uploadFile_audio"];
+    }
+    else if([curNASFileAndFolderDataModel.type isEqualToString:@"dir"])
+    {
+        checkButton.hidden = YES;
+        mImageView.image = [UIImage imageNamed:@"uploadFile_dir"];
+    }
+        
+    checkButton.selected = curNASFileAndFolderDataModel.isSelectType;
+
+    
+    //时间戳转换为日期
+    NSString *timeStr = [[NSString alloc] initWithFormat:@"%ld",curNASFileAndFolderDataModel.time];
+    NSString *dateStr = [iTools getDateStringWithTimeStr:timeStr];
+    
+    
+    NSString * totalSizeStr = nil;
+    NSInteger totalSize_k = curNASFileAndFolderDataModel.size / 1024;
+    if(totalSize_k == 0){
+        totalSize_k = 1;
+    }
+    
+    if(totalSize_k < 1024){
+        totalSizeStr = [[NSString alloc] initWithFormat:@"%ldKB",totalSize_k];
+    }
+    else if( totalSize_k >= 1024 && totalSize_k < 1024*1024){
+        totalSizeStr = [[NSString alloc] initWithFormat:@"%.1fMB",totalSize_k/1024.0];
+        
+    }
+    else{
+        totalSizeStr = [[NSString alloc] initWithFormat:@"%.2fG",totalSize_k/1024.0/1024.0];
+    }
+    
+    NSString * leftStr = curNASFileAndFolderDataModel.name;
+    NSString * rightStr = [[NSString alloc] initWithFormat:@"\n%@      %@",dateStr,totalSizeStr];
+    
+    
+    NSString *totalStr = [[NSString alloc] initWithFormat:@"%@%@",leftStr,rightStr];
+    
+    NSMutableAttributedString *noteStr = [[NSMutableAttributedString alloc] initWithString:totalStr];
+    
+    NSRange redRange = NSMakeRange([totalStr rangeOfString:rightStr].location, [totalStr rangeOfString:rightStr].length);
+    [noteStr addAttribute:NSForegroundColorAttributeName value:[UIColor hwColor:@"#666666" alpha:1.0] range:redRange];
+    [noteStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12.0] range:redRange];
+    // 设置行间距
+    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+    [paragraphStyle setLineSpacing:5];        //设置行间距
+    
+    [noteStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [totalStr  length])];
+    
+    
+    titleLabel.attributedText = noteStr;
+}
 @end