Kaynağa Gözat

1.最近文件---进行中

huangxiaodong 11 ay önce
ebeveyn
işleme
66c878e05b

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

@@ -638,6 +638,10 @@
 		6B8661DD2BBA578600B19846 /* HaveNoticeView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B8661DA2BBA578600B19846 /* HaveNoticeView.h */; };
 		6B8661DE2BBA578600B19846 /* HaveNoticeView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B8661DA2BBA578600B19846 /* HaveNoticeView.h */; };
 		6B8661DF2BBA578600B19846 /* HaveNoticeView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B8661DB2BBA578600B19846 /* HaveNoticeView.m */; };
+		6B8A5AE02C3BCC0E00E40B19 /* lastFileModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B8A5ADE2C3BCC0E00E40B19 /* lastFileModel.h */; };
+		6B8A5AE12C3BCC0E00E40B19 /* lastFileModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B8A5ADF2C3BCC0E00E40B19 /* lastFileModel.m */; };
+		6B8A5AE22C3BCC0E00E40B19 /* lastFileModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B8A5ADF2C3BCC0E00E40B19 /* lastFileModel.m */; };
+		6B8A5AE32C3BCC0E00E40B19 /* lastFileModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B8A5ADE2C3BCC0E00E40B19 /* lastFileModel.h */; };
 		6B8FF6B92B04E19600800981 /* uploadFileRecordheadView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B8FF6B72B04E19600800981 /* uploadFileRecordheadView.h */; };
 		6B8FF6BA2B04E19600800981 /* uploadFileRecordheadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B8FF6B82B04E19600800981 /* uploadFileRecordheadView.m */; };
 		6B8FF6C12B05B24D00800981 /* uploadFileRecordCell.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B8FF6BF2B05B24D00800981 /* uploadFileRecordCell.h */; };
@@ -1728,6 +1732,8 @@
 		6B8661D52BBA53B600B19846 /* noticeModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = noticeModel.m; sourceTree = "<group>"; };
 		6B8661DA2BBA578600B19846 /* HaveNoticeView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HaveNoticeView.h; sourceTree = "<group>"; };
 		6B8661DB2BBA578600B19846 /* HaveNoticeView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HaveNoticeView.m; sourceTree = "<group>"; };
+		6B8A5ADE2C3BCC0E00E40B19 /* lastFileModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = lastFileModel.h; sourceTree = "<group>"; };
+		6B8A5ADF2C3BCC0E00E40B19 /* lastFileModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = lastFileModel.m; sourceTree = "<group>"; };
 		6B8FF6B72B04E19600800981 /* uploadFileRecordheadView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = uploadFileRecordheadView.h; sourceTree = "<group>"; };
 		6B8FF6B82B04E19600800981 /* uploadFileRecordheadView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = uploadFileRecordheadView.m; sourceTree = "<group>"; };
 		6B8FF6BF2B05B24D00800981 /* uploadFileRecordCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = uploadFileRecordCell.h; sourceTree = "<group>"; };
@@ -2863,6 +2869,7 @@
 		6B5D86632C227C4A008D25EA /* NAS */ = {
 			isa = PBXGroup;
 			children = (
+				6B8A5ADD2C3BCB2700E40B19 /* recenFile */,
 				6BC741362C23C7BE0049BA8D /* model */,
 				6B5D866A2C22AE0B008D25EA /* view */,
 				6B5D86642C227C71008D25EA /* NASViewController.h */,
@@ -2871,8 +2878,6 @@
 				6B679DE92C252A4E00D0DC03 /* NASMySpaceViewController.m */,
 				6B39586D2C34FA25003FC6C3 /* NasPreviewVideoViewController.h */,
 				6B39586E2C34FA25003FC6C3 /* NasPreviewVideoViewController.m */,
-				6B5D867D2C22EA5B008D25EA /* lastFileManager.h */,
-				6B5D867E2C22EA5B008D25EA /* lastFileManager.m */,
 			);
 			path = NAS;
 			sourceTree = "<group>";
@@ -2985,6 +2990,17 @@
 			path = model;
 			sourceTree = "<group>";
 		};
+		6B8A5ADD2C3BCB2700E40B19 /* recenFile */ = {
+			isa = PBXGroup;
+			children = (
+				6B5D867D2C22EA5B008D25EA /* lastFileManager.h */,
+				6B5D867E2C22EA5B008D25EA /* lastFileManager.m */,
+				6B8A5ADE2C3BCC0E00E40B19 /* lastFileModel.h */,
+				6B8A5ADF2C3BCC0E00E40B19 /* lastFileModel.m */,
+			);
+			path = recenFile;
+			sourceTree = "<group>";
+		};
 		6BA08F452C01D05B00A2242D /* CWUploadManage */ = {
 			isa = PBXGroup;
 			children = (
@@ -3512,6 +3528,7 @@
 				1868201D2AB97BE1005702A6 /* TipsQRCodeViewController.h in Headers */,
 				6B5B60602B3BC8DE009A2AE2 /* fileTransferPopView.h in Headers */,
 				181E85002A8F6B1800292B96 /* LogoSelectView.h in Headers */,
+				6B8A5AE02C3BCC0E00E40B19 /* lastFileModel.h in Headers */,
 				6B5B60762B3E665E009A2AE2 /* filePathCreatPopView.h in Headers */,
 				18BA24872AA5C57900BA01EE /* RSATool.h in Headers */,
 				6B5D40232B4AA7BF000965CF /* downLoadPreviewViewController.h in Headers */,
@@ -3749,6 +3766,7 @@
 				6BD506AA2B9576A4006E7CB0 /* TipsQRCodeViewController.h in Headers */,
 				6BD506AB2B9576A4006E7CB0 /* fileTransferPopView.h in Headers */,
 				6BD506AC2B9576A4006E7CB0 /* LogoSelectView.h in Headers */,
+				6B8A5AE32C3BCC0E00E40B19 /* lastFileModel.h in Headers */,
 				6BD506AD2B9576A4006E7CB0 /* filePathCreatPopView.h in Headers */,
 				6BD506AE2B9576A4006E7CB0 /* RSATool.h in Headers */,
 				6BD506AF2B9576A4006E7CB0 /* downLoadPreviewViewController.h in Headers */,
@@ -4330,6 +4348,7 @@
 				6BD507162B9576A4006E7CB0 /* diskListTableView.m in Sources */,
 				6B8661D92BBA53B600B19846 /* noticeModel.m in Sources */,
 				6B7EA7AD2BF72D3B002D5CC2 /* queryShareModel.m in Sources */,
+				6B8A5AE22C3BCC0E00E40B19 /* lastFileModel.m in Sources */,
 				6B2C1E932C070ADE00FDCF82 /* ZFPlayerLogManager.m in Sources */,
 				6B679E012C255DC900D0DC03 /* MineCommonUsedView.m in Sources */,
 				6BD507172B9576A4006E7CB0 /* fileTransferPopView.m in Sources */,
@@ -4649,6 +4668,7 @@
 				6B45C5052B5F9CEC007E6911 /* diskListTableView.m in Sources */,
 				6B8661D62BBA53B600B19846 /* noticeModel.m in Sources */,
 				6B7EA7AB2BF72D3B002D5CC2 /* queryShareModel.m in Sources */,
+				6B8A5AE12C3BCC0E00E40B19 /* lastFileModel.m in Sources */,
 				6B2C1E922C070ADE00FDCF82 /* ZFPlayerLogManager.m in Sources */,
 				6B679DFF2C255DC900D0DC03 /* MineCommonUsedView.m in Sources */,
 				6B5B60612B3BC8DE009A2AE2 /* fileTransferPopView.m in Sources */,

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

@@ -37,6 +37,7 @@
 #import "NASViewController.h"
 #import "cloudPhoneViewController.h"
 #import "mineViewController.h"
+#import "lastFileManager.h"
 
 @interface SceneDelegate ()<SetUsePWDViewControllerDelegate,GuideViewControllerDelegate>
 @property(nonatomic, strong)   CalculatorViewController *calculatorVC;
@@ -272,6 +273,8 @@
     //下载配置先处理
     [boxDownloadFileManager shareInstance];
     
+    [lastFileManager shareManager].uid = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.sn;
+    
     //获取NAS相关信息
     [self getNASMsgFun];
     
@@ -859,6 +862,8 @@
     }
     
     [YCDownloadManager updateUid:uid];
+    
+    [lastFileManager shareManager].uid = uid;
 }
 
 #pragma mark 上报版本号信息

+ 38 - 4
创维盒子/双子星云手机/Class/Set/previewFile/audioPlayerViewController.m

@@ -10,6 +10,7 @@
 #import "DFPlayerUIManager.h"
 
 #import "NASFileAudioModel.h"
+#import "lastFileManager.h"
 
 @interface audioPlayerViewController ()<DFPlayerDelegate,DFPlayerDataSource>
 
@@ -18,6 +19,7 @@
 @property (nonatomic, strong) UIImageView*bgImageView;
 @property (nonatomic, strong)UIButton * playPauseBtn;
 @property (nonatomic, strong) NSMutableArray<DFPlayerModel *> *dataArray;
+@property (nonatomic, assign) NSInteger lastAudioIndex;//-1未记录
 @end
 
 @implementation audioPlayerViewController
@@ -25,7 +27,7 @@
 - (void)viewDidLoad {
     [super viewDidLoad];
     // Do any additional setup after loading the view.
-    _isOlnyOneType = YES;
+    _isOlnyOneType = NO;
     
     [self.toolBar setHidden:YES];
     [self.navigationBar setHidden:YES];
@@ -34,6 +36,7 @@
     [self.view setBackgroundColor:[UIColor whiteColor]];
     
     [self drawAnyView];
+    _lastAudioIndex = -1;
 }
 
 - (void)drawAnyView{
@@ -276,7 +279,18 @@
 
 //播放进度代理
 - (void)df_player:(DFPlayer *)player progress:(CGFloat)progress currentTime:(CGFloat)currentTime{
-    //HLog(@"音频播放进度代理");
+    HLog(@"音频播放进度:%@",player.currentAudioModel);
+    
+    if(_lastAudioIndex != player.currentAudioModel.audioId){
+        _lastAudioIndex = player.currentAudioModel.audioId;
+        _index = _lastAudioIndex;
+        [self setTitleFunByIndex];
+        [self audioPlayerByIndex:_lastAudioIndex];
+    }
+    
+    if(progress >= 1.0){
+        _lastAudioIndex = -1;
+    }
 }
 
 //状态信息代理
@@ -293,8 +307,7 @@
     }else if(statusCode == DFPlayerStatusTimeOut){
         //[self showAlert:@"请求超时"];
     }else if(statusCode == DFPlayerStatusCacheSucc){
-//        [self tableViewReloadData];
-//        return;
+
         [[DFPlayer sharedPlayer] df_playWithAudioId:player.currentAudioModel.audioId];
     }else{
         HLog(@"状态码:%lu",(unsigned long)statusCode);
@@ -311,6 +324,8 @@
     [self setTitleFunByIndex];
     [[DFPlayer sharedPlayer] df_reloadData];//需在传入数据源后调用
     
+    [DFPlayer sharedPlayer].playMode = DFPlayerModeOrderCycle;
+    
     KWeakSelf
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
         [weakSelf playAudioFun];
@@ -364,4 +379,23 @@
     }
     
 }
+
+#pragma mark 音频可以播放
+- (void)audioPlayerByIndex:(NSInteger)index{
+    if(index >=0 &&  index < _audioOutSidedataArray.count){
+        NASFileAudioDataModel *dataModel = _audioOutSidedataArray[index];
+        
+        lastFileModel *lastFileMod = [lastFileModel new];
+        lastFileMod.path = dataModel.path;
+        lastFileMod.name = dataModel.name;
+        lastFileMod.time = dataModel.time;
+        lastFileMod.size = dataModel.size;
+        lastFileMod.duration = dataModel.duration;
+        lastFileMod.type = @"jpg";
+        lastFileMod.lastPreTime = [iTools getNowTimeStamp];
+        
+        [[lastFileManager shareManager] saveFileInfoWith:lastFileMod with:dataModel.path];
+   
+    }
+}
 @end

+ 1 - 0
创维盒子/双子星云手机/Class/Set/previewFile/imageDetailsScrollViewController.h

@@ -6,6 +6,7 @@
 //
 
 #import "BaseViewController.h"
+#import "lastFileManager.h"
 
 NS_ASSUME_NONNULL_BEGIN
 

+ 21 - 1
创维盒子/双子星云手机/Class/Set/previewFile/imageDetailsScrollViewController.m

@@ -105,7 +105,6 @@
     //_curScrollView.placeholderImage = [UIImage imageNamed:@"uploadFile_image"];
     [self.view addSubview:_curScrollView];
     _curScrollView.backgroundColor = [UIColor blackColor];
-    //_curScrollView.hidden = YES;
     
     [_curScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(0);
@@ -119,12 +118,14 @@
     dispatch_after(dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.01 * NSEC_PER_SEC)), dispatch_get_main_queue(), ^{
         [self->_curScrollView makeScrollViewScrollToIndex:self->_index];
         [weakSelf setTitleLabelTextFunBy:self->_index];
+        [weakSelf cycleScrollViewDidScrollToIndex:self->_index];
         self->_curScrollView.hidden = NO;
     });
     
     _curScrollView.itemDidScrollOperationBlock = ^(NSInteger currentIndex) {
         weakSelf.index = currentIndex;
         [weakSelf setTitleLabelTextFunBy:currentIndex];
+        [weakSelf cycleScrollViewDidScrollToIndex:currentIndex];
     };
 }
 
@@ -225,4 +226,23 @@
     _canShareType = canShareType;
     [_curEditTypeBottomView setCanShaewFunBy:canShareType];
 }
+
+#pragma mark 图片滑动
+- (void)cycleScrollViewDidScrollToIndex:(NSInteger)index{
+    if(index >=0 &&  index < _totalDataArr.count){
+        NASFilePicDataArrModel *dataModel = _totalDataArr[index];
+        
+        lastFileModel *lastFileMod = [lastFileModel new];
+        lastFileMod.path = dataModel.path;
+        lastFileMod.name = dataModel.name;
+        lastFileMod.time = dataModel.time;
+        lastFileMod.size = dataModel.size;
+        lastFileMod.duration = dataModel.duration;
+        lastFileMod.type = @"jpg";
+        lastFileMod.lastPreTime = [iTools getNowTimeStamp];
+        
+        [[lastFileManager shareManager] saveFileInfoWith:lastFileMod with:dataModel.path];
+   
+    }
+}
 @end

+ 0 - 16
创维盒子/双子星云手机/NAS/lastFileManager.h

@@ -1,16 +0,0 @@
-//
-//  lastFileManager.h
-//  双子星云手机
-//
-//  Created by xd h on 2024/6/19.
-//
-
-#import <Foundation/Foundation.h>
-
-NS_ASSUME_NONNULL_BEGIN
-
-@interface lastFileManager : NSObject
-
-@end
-
-NS_ASSUME_NONNULL_END

+ 0 - 12
创维盒子/双子星云手机/NAS/lastFileManager.m

@@ -1,12 +0,0 @@
-//
-//  lastFileManager.m
-//  双子星云手机
-//
-//  Created by xd h on 2024/6/19.
-//
-
-#import "lastFileManager.h"
-
-@implementation lastFileManager
-
-@end

+ 31 - 0
创维盒子/双子星云手机/NAS/recenFile/lastFileManager.h

@@ -0,0 +1,31 @@
+//
+//  lastFileManager.h
+//  双子星云手机
+//
+//  Created by xd h on 2024/6/19.
+//
+
+#import <Foundation/Foundation.h>
+#import "lastFileModel.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+#define KLastFileDirector  @"lastFile"
+
+@interface lastFileManager : NSObject
+@property(nonatomic,strong) NSString *uid;//用户id 用来创建文件夹路径 防止不要用户的缓存关联
+@property(nonatomic,assign) NSInteger saveDays;//默认90天
+@property (nonatomic, strong) NSMutableDictionary * _Nullable lastFileList;
+@property (nonatomic, strong) NSMutableArray * _Nullable lastFileListArr;
+
+
+/** 实例化对象(单例) */
++ (instancetype)shareManager;
+
+/**  增加配置信息 */
+- (BOOL)saveFileInfoWith:(lastFileModel *)lastFileMod with:(NSString*)fullPath;
+/**  删除配置信息 */
+- (BOOL)deleteFileInfoWithUrl:(NSString *)fullPath;
+@end
+
+NS_ASSUME_NONNULL_END

+ 211 - 0
创维盒子/双子星云手机/NAS/recenFile/lastFileManager.m

@@ -0,0 +1,211 @@
+//
+//  lastFileManager.m
+//  双子星云手机
+//
+//  Created by xd h on 2024/6/19.
+//
+
+#import "lastFileManager.h"
+#import <MJExtension.h>
+
+@implementation lastFileManager
+
++ (instancetype)shareManager {
+    static lastFileManager *_instance;
+    static dispatch_once_t onceToken;
+    dispatch_once(&onceToken, ^{
+        _instance = [[self alloc] init];
+    });
+    return _instance;
+}
+
+- (instancetype)init {
+
+    if (self = [super init]) {
+        _saveDays = 90;
+    }
+    return self;
+}
+
+- (NSString*)uid{
+    if(!_uid || _uid.length == 0){
+        return @"userName";
+    }
+    
+    return _uid;
+}
+
+- (NSString *)getFullDirector {
+
+    NSString *account = self.uid;
+    if (account.length != 0)
+    {
+         NSString *fileFolder = [HWDataManager documentPathForAccount:account fileFolder:KLastFileDirector];
+        // 创建文件储存路径
+        if (![[NSFileManager defaultManager] fileExistsAtPath:fileFolder]) {
+            [[NSFileManager defaultManager] createDirectoryAtPath:fileFolder withIntermediateDirectories:YES attributes:nil error:nil];
+        }
+         return fileFolder;
+     }else {
+         HLog(@"创建文件失败!");
+         return @"";
+     }
+}
+
+#pragma mark- last file plist Path
+- (NSString *)getLastFilePlistPath {
+    NSString *fileFolder = [self getFullDirector];
+    return [fileFolder stringByAppendingPathComponent:@"lastFile.plist"];;
+}
+
+#pragma mark- last file  plist
+- (NSMutableDictionary *)getLastFileList {
+    
+    if (!_lastFileList) { // 内存没有
+        _lastFileList = [[NSDictionary dictionaryWithContentsOfFile:[self getLastFilePlistPath]] mutableCopy]; // 本地加载
+        if (!_lastFileList) { // 本地没有,分配内存
+            _lastFileList = [NSMutableDictionary dictionary];
+        }
+    }
+    return _lastFileList;
+}
+
+
+- (NSMutableArray*)getLastFileListArr{
+    if (!_lastFileListArr) { // 内存没有
+        NSMutableArray *dataArr = [NSMutableArray new];
+        if (self.lastFileList) {
+
+            for (NSString *key in self.lastFileList) {
+                NSDictionary *dict = self.lastFileList[key];
+                
+                lastFileModel *model = [lastFileModel mj_objectWithKeyValues:dict];
+                if(model){
+                    NSTimeInterval preTime = model.lastPreTime;
+                    if (![self areTimes:preTime MoreThanDays:self.saveDays]) {
+                        [dataArr addObject:model];
+                    }
+                    else{
+                        [self.lastFileList removeObjectForKey:key];
+                    }
+                }
+            }
+        }
+        
+        if(dataArr.count > 0){//排序
+            NSArray *sortArr = [dataArr sortedArrayUsingComparator:^NSComparisonResult(lastFileModel* obj1, lastFileModel* obj2) {
+                       NSTimeInterval time1 = obj1.lastPreTime;
+                        NSTimeInterval time2 = obj2.lastPreTime;
+                       if (time1 < time2) {
+                           return NSOrderedAscending;
+                       }
+                       if (time1 > time2) {
+                           return NSOrderedDescending;
+                       }
+                       return NSOrderedSame;
+                   }];
+            
+            _lastFileListArr = [NSMutableArray arrayWithArray:sortArr];
+        }
+        else{
+            _lastFileListArr = [NSMutableArray new];
+        }
+        
+    }
+    return _lastFileListArr;
+}
+
+/**  增加配置信息 */
+- (BOOL)saveFileInfoWith:(lastFileModel *)lastFileMod with:(NSString*)fullPath {
+    
+    if(!lastFileMod || !fullPath){
+        return NO;
+    }
+    
+    BOOL flag = NO;
+    @synchronized (self) {
+        NSString *key = fullPath;
+        //1.本地持久化
+        NSMutableDictionary *dictM =  [self getLastFileList];
+        //时间戳要刷新
+        //lastFileMod.lastPreTime = [iTools getNowTimeStamp];
+        
+        NSDictionary *dict = [lastFileMod lastFileInfoFun];
+        if(dict){
+            [dictM setObject:dict forKey:key];
+        }
+        NSString * PlistPath = [self getLastFilePlistPath];
+        flag = [dictM writeToFile:PlistPath atomically:YES];
+        
+        //2.写到内存
+        BOOL isNewObj = YES;
+        for (lastFileModel*preModel in self.lastFileListArr) {
+            if([preModel.path isEqualToString:lastFileMod.path]){
+                isNewObj = NO;
+                preModel.lastPreTime = lastFileMod.lastPreTime;
+                break;
+            }
+        }
+        
+        if(isNewObj){
+            [self.lastFileListArr insertObject:lastFileMod atIndex:0];
+        }
+    }
+    
+    return flag;
+    
+}
+
+/**  删除配置信息 */
+- (BOOL)deleteFileInfoWithUrl:(NSString *)fullPath {
+    if(!fullPath){
+        return NO;
+    }
+    
+    BOOL flag = NO;
+    @synchronized (self) {
+        //1.本地持久化删除
+        NSMutableDictionary *dictM =  [self getLastFileList];
+        [dictM removeObjectForKey:fullPath];
+        flag = [dictM writeToFile:[self getLastFilePlistPath] atomically:YES];
+        
+        //内存删除
+        for (lastFileModel*preModel in self.lastFileListArr) {
+            if([preModel.path isEqualToString:fullPath]){
+                [self.lastFileListArr removeObject:preModel];
+                break;
+            }
+        }
+        
+    }
+    return flag;
+}
+
+/**  时间戳距离现在是否超过多少天 */
+- (BOOL)areTimes:(NSTimeInterval)timestamp1 MoreThanDays:(NSInteger)days {
+    // 将时间戳转换为NSDate对象
+    NSDate *date1 = [NSDate dateWithTimeIntervalSince1970:timestamp1];
+    NSDate *date2 = [NSDate date];
+      
+    // 创建一个日历对象
+    NSCalendar *calendar = [NSCalendar currentCalendar];
+      
+    // 计算两个日期之间的组件差异
+    NSDateComponents *components = [calendar components:NSCalendarUnitDay
+                                              fromDate:date1
+                                                toDate:date2
+                                               options:0];
+      
+    // 获取天数差
+    NSInteger daysBetween = [components day];
+      
+//    // 如果日期是逆序的,我们需要取绝对值或调整计算逻辑
+//    if (date1.compare(date2) == NSOrderedDescending) {
+//        daysBetween = -daysBetween;
+//    }
+      
+    // 检查天数差是否大于90
+    return labs(daysBetween) > days;
+}
+
+@end

+ 28 - 0
创维盒子/双子星云手机/NAS/recenFile/lastFileModel.h

@@ -0,0 +1,28 @@
+//
+//  lastFileModel.h
+//  双子星云手机
+//
+//  Created by xd h on 2024/7/8.
+//
+
+#import "SuperModel.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface lastFileModel : SuperModel
+@property (nonatomic, copy) NSString*path;
+@property (nonatomic, copy) NSString*name;
+@property (nonatomic, copy) NSString*time;
+@property (nonatomic, assign) long  size;
+@property (nonatomic, copy) NSString*type;// jpg video audio
+@property (nonatomic, assign) NSInteger duration;
+//自定义
+@property (nonatomic, assign) BOOL isSelectType;
+
+@property (nonatomic, assign) NSTimeInterval lastPreTime;//最后预览时间
+
+
+- (NSDictionary *)lastFileInfoFun;
+@end
+
+NS_ASSUME_NONNULL_END

+ 26 - 0
创维盒子/双子星云手机/NAS/recenFile/lastFileModel.m

@@ -0,0 +1,26 @@
+//
+//  lastFileModel.m
+//  双子星云手机
+//
+//  Created by xd h on 2024/7/8.
+//
+
+#import "lastFileModel.h"
+
+@implementation lastFileModel
+
+#pragma mark - get lastFile info
+//
+- (NSDictionary *)lastFileInfoFun{
+    return  @{
+               @"path" : self.path,
+               @"name" : self.name,
+               @"time" : self.time,
+               @"type" : self.type,
+               @"size" : @(self.size),
+              @"duration" : @(self.duration),
+               //@"isSelectType" : @(self.isSelectType),
+              @"lastPreTime" : @(self.lastPreTime),
+            };
+}
+@end