瀏覽代碼

1.上传逻辑优化

huangxiaodong 2 年之前
父節點
當前提交
2f17c1c359

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

@@ -170,6 +170,8 @@
 		6B72724C2B0AF59200C03F87 /* uploadFileRecordTableViewHeadView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B72724A2B0AF59200C03F87 /* uploadFileRecordTableViewHeadView.m */; };
 		6B72724F2B0B58E500C03F87 /* uploadFileRecordEditBottomView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B72724D2B0B58E500C03F87 /* uploadFileRecordEditBottomView.h */; };
 		6B7272502B0B58E500C03F87 /* uploadFileRecordEditBottomView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B72724E2B0B58E500C03F87 /* uploadFileRecordEditBottomView.m */; };
+		6B7272532B0CABC600C03F87 /* cachesFileManager.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B7272512B0CABC600C03F87 /* cachesFileManager.h */; };
+		6B7272542B0CABC600C03F87 /* cachesFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B7272522B0CABC600C03F87 /* cachesFileManager.m */; };
 		6B7B65582AD9227700BE8CB3 /* PlayerViewController+otherDelegate.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B7B65562AD9227700BE8CB3 /* PlayerViewController+otherDelegate.h */; };
 		6B7B65592AD9227700BE8CB3 /* PlayerViewController+otherDelegate.mm in Sources */ = {isa = PBXBuildFile; fileRef = 6B7B65572AD9227700BE8CB3 /* PlayerViewController+otherDelegate.mm */; };
 		6B8FF6B92B04E19600800981 /* uploadFileRecordheadView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B8FF6B72B04E19600800981 /* uploadFileRecordheadView.h */; };
@@ -527,6 +529,8 @@
 		6B72724A2B0AF59200C03F87 /* uploadFileRecordTableViewHeadView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = uploadFileRecordTableViewHeadView.m; sourceTree = "<group>"; };
 		6B72724D2B0B58E500C03F87 /* uploadFileRecordEditBottomView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = uploadFileRecordEditBottomView.h; sourceTree = "<group>"; };
 		6B72724E2B0B58E500C03F87 /* uploadFileRecordEditBottomView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = uploadFileRecordEditBottomView.m; sourceTree = "<group>"; };
+		6B7272512B0CABC600C03F87 /* cachesFileManager.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = cachesFileManager.h; sourceTree = "<group>"; };
+		6B7272522B0CABC600C03F87 /* cachesFileManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = cachesFileManager.m; sourceTree = "<group>"; };
 		6B7B65562AD9227700BE8CB3 /* PlayerViewController+otherDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PlayerViewController+otherDelegate.h"; sourceTree = "<group>"; };
 		6B7B65572AD9227700BE8CB3 /* PlayerViewController+otherDelegate.mm */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.cpp.objcpp; path = "PlayerViewController+otherDelegate.mm"; sourceTree = "<group>"; };
 		6B7B65612ADEAE0300BE8CB3 /* zh-Hant */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = "zh-Hant"; path = "zh-Hant.lproj/LaunchScreen.strings"; sourceTree = "<group>"; };
@@ -1196,6 +1200,8 @@
 			children = (
 				6B0582832B0457C400D37290 /* uploadFileManager.h */,
 				6B0582842B0457C400D37290 /* uploadFileManager.m */,
+				6B7272512B0CABC600C03F87 /* cachesFileManager.h */,
+				6B7272522B0CABC600C03F87 /* cachesFileManager.m */,
 			);
 			path = uploadFileManager;
 			sourceTree = "<group>";
@@ -1690,6 +1696,7 @@
 				6B05819F2AFCF4E800D37290 /* AJPhotoListView.h in Headers */,
 				18963B462AB84398006E7C50 /* GuideView.h in Headers */,
 				18A909982ABC4A3300E6D2BE /* ComontAlretViewController.h in Headers */,
+				6B7272532B0CABC600C03F87 /* cachesFileManager.h in Headers */,
 				186820192AB94877005702A6 /* GuideLastView.h in Headers */,
 				6B0582632AFF4B7D00D37290 /* PhotoPreviewViewController.h in Headers */,
 				6B0581AD2AFCF57300D37290 /* AJPhotoGroupView.h in Headers */,
@@ -2078,6 +2085,7 @@
 				6BF0F3D12AD391D8000AA133 /* connectDeviceManager.m in Sources */,
 				181E84F62A8F451D00292B96 /* MineViewCell.m in Sources */,
 				18FCE5412AD136670020F623 /* PlayerViewController+AdjustBtnFrame.m in Sources */,
+				6B7272542B0CABC600C03F87 /* cachesFileManager.m in Sources */,
 				184C8ADE2A949DBD00F26650 /* HWVersionModel.m in Sources */,
 				18FCE5352AD12FE00020F623 /* ConnectTestViewController.m in Sources */,
 				183AE64C2A8A2CF000B11CB0 /* UIProgressView+AFNetworking.m in Sources */,

+ 4 - 2
创维盒子/双子星云手机/Class/Set/uploadFile/model/uploadFileDataModel.h

@@ -26,12 +26,14 @@ typedef enum{
 //self.fileName = [assetModel.asset valueForKey:@"filename"];
 @interface uploadFileDataModel : JSONModel
 //目前上传用到的字段有
-@property (nonatomic, copy)  NSString *filename;
-@property (nonatomic, retain) NSData *_Nullable imageData;
+@property (nonatomic, copy)  NSString *filename;//image or video
+@property (nonatomic, copy)  NSString *videoFirstImageName;
+@property (nonatomic, retain) NSData *_Nullable imageData;//image or video
 @property (nonatomic, retain) NSData *_Nullable videoData;
 @property (nonatomic, assign)  uploadStateType curUploadStateType;
 @property (nonatomic, assign)  uploadFileType curUploadFileType;
 @property (nonatomic, assign)  long didUploadBytes;//已经上传的字节数
+@property (nonatomic, assign)  long totalBytes;//总字节数
 @end
 
 NS_ASSUME_NONNULL_END

+ 6 - 1
创维盒子/双子星云手机/Class/Set/uploadFile/model/uploadFileDataModel.m

@@ -8,5 +8,10 @@
 #import "uploadFileDataModel.h"
 
 @implementation uploadFileDataModel
-
+/**
+ 设置不需要存储的属性, 在模型.m文件中实现该函数.
+ */
++(NSArray *)bg_ignoreKeys{
+   return @[@"imageData",@"videoData"];
+}
 @end

+ 22 - 3
创维盒子/双子星云手机/Class/Set/uploadFile/photoView/uploadFileRecordBodyView.m

@@ -93,7 +93,11 @@
                 
                 KWeakSelf
                 headView.didClickButFun = ^{
-                    if(headView == self->_midHeadView)
+                    if(headView == self->_leftHeadView)
+                    {
+                        [weakSelf didClickAllSuspendInLoadingFun];
+                    }
+                    else if(headView == self->_midHeadView)
                     {
                         [weakSelf didClickClearRecordInDoneFun];
                     }
@@ -326,10 +330,12 @@
     if(letfArr){
         NSString *leftStr =  NSLocalizedString(@"File_upload_Record_uploading",nil);
         NSString *rightStr =  NSLocalizedString(@"File_upload_Record_all_suspend",nil);
+        NSString *rightSelectStr =  NSLocalizedString(@"File_upload_Record_all_open",nil);
         NSString *titleStr = [[NSString alloc] initWithFormat:@"%@ (%ld)",leftStr,letfArr.count];
 
         _leftHeadView.titleLabel.text = titleStr;
         [_leftHeadView.rightButton setTitle:rightStr forState:UIControlStateNormal];
+        [_leftHeadView.rightButton setTitle:rightSelectStr forState:UIControlStateSelected];
         
         if(letfArr.count == 0){
             _leftHeadView.hidden = YES;
@@ -373,7 +379,18 @@
 }
 
 #pragma mark 点击上传中的全部暂停
-
+- (void)didClickAllSuspendInLoadingFun
+{
+    _leftHeadView.rightButton.selected = !_leftHeadView.rightButton.selected;
+    
+    if(_leftHeadView.rightButton.selected){
+        [[uploadFileManager shareInstance] suspendUploadFileFun:YES];
+    }
+    else{
+        NSMutableArray *leftArr = _allDataArr[0];
+        [[uploadFileManager shareInstance] reUploadFileFunBy:leftArr];
+    }
+}
 #pragma mark 点击上传成功的清空记录
 - (void)didClickClearRecordInDoneFun
 {
@@ -475,7 +492,9 @@
         [[uploadFileManager shareInstance] suspendUploadFileFun:NO];
     }
     else{
-        [[uploadFileManager shareInstance] reUploadFileFunBy:model];
+        NSMutableArray*arr = [NSMutableArray new];
+        [arr addObject:model];
+        [[uploadFileManager shareInstance] reUploadFileFunBy:arr];
     }
     
 }

+ 25 - 5
创维盒子/双子星云手机/Class/Set/uploadFile/photoView/uploadFileRecordCell.m

@@ -6,6 +6,9 @@
 //
 
 #import "uploadFileRecordCell.h"
+#import "cachesFileManager.h"
+#import <SDWebImage/SDWebImage.h>
+
 @interface uploadFileRecordCell ()
 @property(nonatomic,strong) UIImageView *fileImageView;
 @property(nonatomic,strong) UIButton *upLoadStateButton;
@@ -209,7 +212,24 @@
     _curUploadFileDataModel = curUploadFileDataModel;
     //HLog(@"hhhhhhh  %@ %ld %ld",curUploadFileDataModel.bg_id,curUploadFileDataModel.curUploadStateType,curUploadFileDataModel.didUploadBytes);
     
-    _fileImageView.image = [UIImage imageWithData:curUploadFileDataModel.imageData];
+    if(curUploadFileDataModel.imageData){
+        _fileImageView.image = [UIImage imageWithData:curUploadFileDataModel.imageData];
+    }
+    else{
+        if(curUploadFileDataModel.curUploadFileType == uploadFileTypeImage){
+            NSString*pathStr = [cachesFileManager getFilePathWithName:curUploadFileDataModel.filename type:curUploadFileDataModel.curUploadFileType];
+            _fileImageView.image = [UIImage imageWithContentsOfFile:pathStr];
+        }
+        else{
+            NSString*pathStr = [cachesFileManager getFilePathWithName:curUploadFileDataModel.videoFirstImageName type:uploadFileTypeImage];
+             UIImage *image = [UIImage imageWithContentsOfFile:pathStr];
+            _fileImageView.image = image;
+        }
+    }
+    
+    
+    
+    //_fileImageView.image = [UIImage imageWithData:curUploadFileDataModel.imageData];
     _fileSpeedlabel.hidden = YES;
     
     if(curUploadFileDataModel.curUploadStateType == uploadStateWait){
@@ -235,10 +255,10 @@
     //进度设置
     CGRect frame = CGRectMake(0, 0, SCREEN_W - 15*2 - 34*2, 2);
     
-    NSInteger totalSize = [curUploadFileDataModel.imageData length];
-    if(curUploadFileDataModel.curUploadFileType == uploadFileTypeVideo){
-        totalSize = [curUploadFileDataModel.videoData length];
-    }
+    NSInteger totalSize = curUploadFileDataModel.totalBytes;
+//    if(curUploadFileDataModel.curUploadFileType == uploadFileTypeVideo){
+//        totalSize = [curUploadFileDataModel.videoData length];
+//    }
     
     CGFloat curProgress = curUploadFileDataModel.didUploadBytes/(totalSize*1.0);
     

+ 30 - 0
创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/cachesFileManager.h

@@ -0,0 +1,30 @@
+//
+//  cachesFileManager.h
+//  隐私保护
+//
+//  Created by xd h on 2023/11/21.
+//
+
+#import <Foundation/Foundation.h>
+#import "uploadFileDataModel.h"
+
+#define CachesPatch NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES)[0]
+//图片路径
+#define kSHPath_image [cachesFileManager getCreateFilePath:[NSString stringWithFormat:@"%@/Image",CachesPatch]]
+//视频路径
+#define kSHPath_video [cachesFileManager getCreateFilePath:[NSString stringWithFormat:@"%@/Video",CachesPatch]]
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface cachesFileManager : NSObject
+//获取文件路径(没有的话创建)
++ (NSString *)getCreateFilePath:(NSString *)path;
+
+//获取资源名字并且保存资源
++ (NSString *)getFileNameWithContent:(id)content fileName:(NSString*)fileName type:(uploadFileType)type;
+//获取资源路径
++ (NSString *)getFilePathWithName:(NSString *)name type:(uploadFileType)type;
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 114 - 0
创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/cachesFileManager.m

@@ -0,0 +1,114 @@
+//
+//  cachesFileManager.m
+//  隐私保护
+//
+//  Created by xd h on 2023/11/21.
+//
+
+#import "cachesFileManager.h"
+
+@implementation cachesFileManager
+
+
+#pragma mark - 获取文件夹(没有的话创建)
++ (NSString *)getCreateFilePath:(NSString *)path {
+    
+    if (![[NSFileManager defaultManager] fileExistsAtPath:path]) {
+        
+        [[NSFileManager defaultManager] createDirectoryAtPath:path withIntermediateDirectories:YES attributes:nil error:nil];
+    }
+    return path;
+}
+
+//获取资源名字并且保存资源
++ (NSString *)getFileNameWithContent:(id)content fileName:(NSString*)fileName type:(uploadFileType)type
+{
+    // 解决服务器文件名有 /
+    NSArray *strArr = [fileName componentsSeparatedByString:@"/"];
+    
+    if (strArr.count >= 2) {
+        fileName = strArr.lastObject;
+    }
+    
+    if (!content) {
+        return @"";
+    }
+    
+    NSString *filePath;
+    NSData *data;
+    
+    switch (type) {
+        case uploadFileTypeImage://image
+        {
+            filePath = [NSString stringWithFormat:@"%@/%@",kSHPath_image,fileName];
+            
+            if ([content isKindOfClass:[NSData class]]) {
+                data = content;
+            }
+        }
+            break;
+        
+        case uploadFileTypeVideo://video
+        {
+            if ([content isKindOfClass:[NSData class]]) {
+                data = content;
+            }
+//            else if ([content isKindOfClass:[NSString class]])
+//            {
+//                data = [NSData dataWithContentsOfFile:content];
+//            }
+            filePath = [NSString stringWithFormat:@"%@/%@",kSHPath_video,fileName];
+        }
+            break;
+        
+        default:
+            break;
+    }
+    
+    
+   
+    //创建文件路径
+    [cachesFileManager getCreateFilePath:[filePath stringByDeletingLastPathComponent]];
+    
+    if (data) {
+        BOOL ret =  [data writeToFile:filePath atomically:YES];
+        if (!ret) {
+           HLog(@"\n\n上传文件名写入失败\n\n");
+        }
+    }
+    
+    return filePath.length?filePath.lastPathComponent:@"";
+}
+
+
+//获取资源路径
++ (NSString *)getFilePathWithName:(NSString *)name type:(uploadFileType)type
+{
+    
+    // 解决服务器文件名有 /
+    NSArray *strArr = [name componentsSeparatedByString:@"/"];
+    
+    if (strArr.count >= 2) {
+        name = strArr.lastObject;
+    }
+    
+    switch (type) {
+        case uploadFileTypeImage://image
+        {
+            name = [NSString stringWithFormat:@"%@/%@",kSHPath_image,name];
+        }
+            break;
+    
+        case uploadFileTypeVideo://video
+        {
+            name = [NSString stringWithFormat:@"%@/%@",kSHPath_video,name];
+        }
+            break;
+
+        default:
+            break;
+    }
+    
+    return name;
+}
+@end

+ 4 - 3
创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/uploadFileManager.h

@@ -9,6 +9,7 @@
 #import "uploadFileDataModel.h"
 #import "TZImageManager.h"
 #import "TZAssetModel+imageData.h"
+#import "cachesFileManager.h"
 
 #define upLoadFile_image_tableName @"upLoadFile_image_tableName"
 //#define upLoadFile_Video_tableName @"upLoadFile_Video_tableName"
@@ -29,14 +30,14 @@ NS_ASSUME_NONNULL_BEGIN
 - (NSMutableArray*)handlTZAssetModelToUploadFileDataFunBy:(NSMutableArray*)indexPathsForSelectedItems;
 //暂停上传
 - (void)suspendUploadFileFun:(BOOL)isSuspendAll;
-//某个文件重新上传
-- (void)reUploadFileFunBy:(uploadFileDataModel*)model;
+//文件重新上传
+- (void)reUploadFileFunBy:(NSMutableArray*)Arr;
 
 //文件上传完成
 - (void)uploadFileDoneFun;
 
 //修改文件上传的状态
-- (void)changeUploadFileState:(uploadStateType)curUploadStateType withDidUploadBytes:(long)didUpLoadBytes complete:(custom_complete_B)complete;
+- (void)changeUploadFileState:(uploadStateType)curUploadStateType withDidUploadBytes:(long)didUpLoadBytes withModel:(uploadFileDataModel*)model complete:(custom_complete_B)complete;
 
 //删除本地数据库记录
 - (void)deleteUploadFileRecordBy:(NSMutableArray *)delArr complete:(custom_complete_B)complete;

+ 40 - 12
创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileManager/uploadFileManager.m

@@ -46,12 +46,23 @@ static uploadFileManager * cur_uploadFileShareInstance = nil;
         
         if(model.type == TZAssetModelMediaTypeVideo){
             curModel.curUploadFileType = uploadFileTypeVideo;
+            [cachesFileManager getFileNameWithContent:curModel.videoData fileName:curModel.filename type:uploadFileTypeVideo];
+            
+            curModel.totalBytes = [model.videoData length];
+            
+            NSString *imgName1 = [curModel.filename stringByReplacingOccurrencesOfString:@"." withString:@"_"];
+            curModel.videoFirstImageName = [[NSString alloc] initWithFormat:@"%@.png",imgName1];
+            [cachesFileManager getFileNameWithContent:curModel.imageData fileName:curModel.videoFirstImageName type:uploadFileTypeImage];
         }
         else{
             curModel.curUploadFileType = uploadFileTypeImage;
+            [cachesFileManager getFileNameWithContent:curModel.imageData fileName:curModel.filename type:uploadFileTypeImage];
+            curModel.totalBytes = [model.imageData length];
         }
         
         
+        
+        
         [_fileModelDataArr addObject:curModel];
         
         //保存到数据库
@@ -99,13 +110,18 @@ static uploadFileManager * cur_uploadFileShareInstance = nil;
 }
 
 //修改文件上传的状态
-- (void)changeUploadFileState:(uploadStateType)curUploadStateType withDidUploadBytes:(long)didUpLoadBytes  complete:(custom_complete_B)complete
+- (void)changeUploadFileState:(uploadStateType)curUploadStateType withDidUploadBytes:(long)didUpLoadBytes withModel:(uploadFileDataModel*)model  complete:(custom_complete_B)complete
 {
-    _curUploadFileDataModel.curUploadStateType = curUploadStateType;
-    _curUploadFileDataModel.didUploadBytes = didUpLoadBytes;
+    if(model.bg_id.integerValue == _curUploadFileDataModel.bg_id.integerValue){
+        _curUploadFileDataModel.curUploadStateType = curUploadStateType;
+        _curUploadFileDataModel.didUploadBytes = didUpLoadBytes;
+    }
+    model.curUploadStateType = curUploadStateType;
+    model.didUploadBytes = didUpLoadBytes;
     
-    if(!_isSuspendType){
-        [[NSNotificationCenter defaultCenter] postNotificationName:uploadFileRefreshNotification object:_curUploadFileDataModel];
+    
+    if(!_isSuspendType || curUploadStateType == uploadStateSuspend){
+        [[NSNotificationCenter defaultCenter] postNotificationName:uploadFileRefreshNotification object:model];
     }
     
     if(curUploadStateType == uploadStateUploading){
@@ -127,7 +143,7 @@ static uploadFileManager * cur_uploadFileShareInstance = nil;
 //        where = [NSString stringWithFormat:@"where %@=%@ and %@!=%@ ",bg_sqlKey(@"filename"),bg_sqlValue(_curUploadFileDataModel.filename),bg_sqlKey(@"curUploadStateType"),bg_sqlValue(numberUploadState)];
 //    }
     
-    where = [NSString stringWithFormat:@"where %@=%@ ",bg_sqlKey(@"bg_id"),bg_sqlValue(_curUploadFileDataModel.bg_id)];
+    where = [NSString stringWithFormat:@"where %@=%@ ",bg_sqlKey(@"bg_id"),bg_sqlValue(model.bg_id)];
     //HLog(@"ffff:%@",_curUploadFileDataModel.bg_id);
     
     [uploadFileDataModel bg_findAsync:upLoadFile_image_tableName where:where complete:^(NSArray * _Nullable array) {
@@ -141,7 +157,7 @@ static uploadFileManager * cur_uploadFileShareInstance = nil;
             }
             
             [curModel bg_saveOrUpdateAsync:^(BOOL isSuccess) {
-                HLog(@"%@ 写入 %@", self->_curUploadFileDataModel.filename, isSuccess ? @"成功":@"失败");
+                HLog(@"%@ 写入 %@", model.filename, isSuccess ? @"成功":@"失败");
             }];
             
         }
@@ -159,16 +175,28 @@ static uploadFileManager * cur_uploadFileShareInstance = nil;
 //
 //    }
     
-    _isSuspendType = YES;
+    if(!_fileModelDataArr || !_curUploadFileDataModel){
+        return;
+    }
     
+    _isSuspendType = YES;
     [[NSNotificationCenter defaultCenter] postNotificationName:uploadFileSuspendNotification object:nil];
+    
+    NSEnumerator *curArr = [_fileModelDataArr reverseObjectEnumerator];
+    for (uploadFileDataModel*model in curArr) {
+        HLog(@"111hxd 2 %@ ",_fileModelDataArr)
+
+        [self changeUploadFileState:uploadStateSuspend withDidUploadBytes:model.didUploadBytes withModel:model complete:^(BOOL isSuccess) {
+            
+        }];
+    }
+    
 }
 
 //某个文件重新上传
-- (void)reUploadFileFunBy:(uploadFileDataModel*)model
+- (void)reUploadFileFunBy:(NSMutableArray*)Arr
 {
-    _fileModelDataArr = [NSMutableArray new];
-    [_fileModelDataArr addObject:model];
+    _fileModelDataArr = Arr;
     [self beginUploadFileFun];
 }
 
@@ -180,7 +208,7 @@ static uploadFileManager * cur_uploadFileShareInstance = nil;
         totalSizeByte = [_curUploadFileDataModel.videoData length];
     }
     
-    [self changeUploadFileState:uploadStateDone withDidUploadBytes:totalSizeByte complete:^(BOOL isSuccess) {
+    [self changeUploadFileState:uploadStateDone withDidUploadBytes:totalSizeByte withModel:_curUploadFileDataModel complete:^(BOOL isSuccess) {
         [self->_fileModelDataArr removeObject:self->_curUploadFileDataModel];
          
         if(self->_fileModelDataArr.count > 0){

+ 15 - 0
创维盒子/双子星云手机/Class/Set/uploadFile/uploadFileRecordViewController.m

@@ -171,6 +171,21 @@
         NSMutableArray *otherArr = [NSMutableArray new];
         
             for (uploadFileDataModel * curModel in array) {
+                
+                
+                //图片 和视频 还原
+                if(curModel.curUploadFileType == uploadFileTypeImage){
+                    NSString*pathStr = [cachesFileManager getFilePathWithName:curModel.filename type:uploadFileTypeImage];
+                    curModel.imageData = [NSData dataWithContentsOfFile:pathStr];
+                }
+                else if(curModel.curUploadFileType == uploadFileTypeVideo){
+                    NSString*pathStr = [cachesFileManager getFilePathWithName:curModel.videoFirstImageName type:uploadFileTypeImage];
+                    curModel.imageData = [NSData dataWithContentsOfFile:pathStr];
+                    
+                    NSString*videoPathStr = [cachesFileManager getFilePathWithName:curModel.filename type:uploadFileTypeVideo];
+                    curModel.videoData = [NSData dataWithContentsOfFile:videoPathStr];
+                }
+                
                 if(curModel.curUploadStateType == uploadStateFail){
                     [failArr addObject:curModel];
                 }

+ 4 - 4
创维盒子/双子星云手机/CloudPlayer/PlayerViewController+otherDelegate.mm

@@ -73,7 +73,7 @@
                                 fileLengthNum = data[@"fileLength"];
                             }
                             
-                            [[uploadFileManager shareInstance] changeUploadFileState:uploadStateUploading withDidUploadBytes:[fileLengthNum integerValue] complete:^(BOOL isSuccess) {
+                            [[uploadFileManager shareInstance] changeUploadFileState:uploadStateUploading withDidUploadBytes:[fileLengthNum integerValue] withModel:self.curUploadFileDataMod complete:^(BOOL isSuccess) {
                                 
                             }];
                             
@@ -98,7 +98,7 @@
                             self.cutFileDataArr = [self fileCutPartsBy:self.AllFileData withDidUpLoadSize:[fileLengthNum integerValue]];
                             
                             if(!self.cutFileDataArr){
-                                [[uploadFileManager shareInstance] changeUploadFileState:uploadStateFail withDidUploadBytes:[fileLengthNum integerValue] complete:^(BOOL isSuccess) {
+                                [[uploadFileManager shareInstance] changeUploadFileState:uploadStateFail withDidUploadBytes:[fileLengthNum integerValue] withModel:self.curUploadFileDataMod complete:^(BOOL isSuccess) {
 
                                 }];
                                 
@@ -202,7 +202,7 @@
         //暂停
         self.taskUid = nil;
         NSInteger didUploadSize = (self.indexOfUploadFlie+1) * (self.cutFileEachPieceSzie);
-        [[uploadFileManager shareInstance] changeUploadFileState:uploadStateSuspend withDidUploadBytes:didUploadSize complete:^(BOOL isSuccess) {
+        [[uploadFileManager shareInstance] changeUploadFileState:uploadStateSuspend withDidUploadBytes:didUploadSize  withModel:self.curUploadFileDataMod complete:^(BOOL isSuccess) {
 
         }];
         
@@ -213,7 +213,7 @@
         
         NSInteger didUploadSize = (self.indexOfUploadFlie+1) * (self.cutFileEachPieceSzie);
         
-        [[uploadFileManager shareInstance] changeUploadFileState:uploadStateUploading withDidUploadBytes:didUploadSize complete:^(BOOL isSuccess) {
+        [[uploadFileManager shareInstance] changeUploadFileState:uploadStateUploading withDidUploadBytes:didUploadSize withModel:self.curUploadFileDataMod complete:^(BOOL isSuccess) {
 
         }];
         

+ 1 - 1
创维盒子/双子星云手机/CloudPlayer/View/PlayerView.m

@@ -67,7 +67,7 @@ ShowImageViewDelegate>{
                   inRect:CGRectMake(0, 0, glkshowImageView.drawableWidth, glkshowImageView.drawableHeight)
                 fromRect:[ciImage extent]];
     
-    //[self->glkshowImageView display];
+    [self->glkshowImageView display];
 }
 
 - (void)showIMage

+ 1 - 0
创维盒子/双子星云手机/zh-Hans.lproj/Localizable.strings

@@ -263,6 +263,7 @@
 "File_upload_Record_upload_fail"   = "上传失败";
 "File_upload_Record_did_upload"   = "已上传";
 "File_upload_Record_all_suspend"   = "全部暂停";
+"File_upload_Record_all_open"   = "全部开启";
 "File_upload_Record_clear_Record"   = "清空记录";
 "File_upload_Record_clear_Tip_title"   = "温馨提示";
 "File_upload_Record_clear_Tip_msg"   = "仅删除记录,不会删除文件中心的文件";