浏览代码

1.分享列表接口调试,数据赋值,和详情页面赋值

huangxiaodong 1 年之前
父节点
当前提交
fc5fa1a0df

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

@@ -165,6 +165,10 @@
 		6B0582862B0457C400D37290 /* uploadFileManager.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B0582842B0457C400D37290 /* uploadFileManager.m */; };
 		6B0582892B045E0B00D37290 /* uploadFileDataModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B0582872B045E0B00D37290 /* uploadFileDataModel.h */; };
 		6B05828A2B045E0B00D37290 /* uploadFileDataModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B0582882B045E0B00D37290 /* uploadFileDataModel.m */; };
+		6B07AC252BF85859005C2B0E /* ShareRecordModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B07AC232BF85859005C2B0E /* ShareRecordModel.h */; };
+		6B07AC262BF85859005C2B0E /* ShareRecordModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B07AC242BF85859005C2B0E /* ShareRecordModel.m */; };
+		6B07AC272BF85859005C2B0E /* ShareRecordModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B07AC242BF85859005C2B0E /* ShareRecordModel.m */; };
+		6B07AC282BF85859005C2B0E /* ShareRecordModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B07AC232BF85859005C2B0E /* ShareRecordModel.h */; };
 		6B1CC2C62B677F3E00AD4217 /* extraMediaEventModel.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B1CC2C42B677F3D00AD4217 /* extraMediaEventModel.h */; };
 		6B1CC2C72B677F3E00AD4217 /* extraMediaEventModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B1CC2C52B677F3D00AD4217 /* extraMediaEventModel.m */; };
 		6B1CC2CA2B67A5FC00AD4217 /* USBInsertPopView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B1CC2C82B67A5FC00AD4217 /* USBInsertPopView.h */; };
@@ -1085,6 +1089,8 @@
 		6B0582842B0457C400D37290 /* uploadFileManager.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = uploadFileManager.m; sourceTree = "<group>"; };
 		6B0582872B045E0B00D37290 /* uploadFileDataModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = uploadFileDataModel.h; sourceTree = "<group>"; };
 		6B0582882B045E0B00D37290 /* uploadFileDataModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = uploadFileDataModel.m; sourceTree = "<group>"; };
+		6B07AC232BF85859005C2B0E /* ShareRecordModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ShareRecordModel.h; sourceTree = "<group>"; };
+		6B07AC242BF85859005C2B0E /* ShareRecordModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ShareRecordModel.m; sourceTree = "<group>"; };
 		6B1CC2C42B677F3D00AD4217 /* extraMediaEventModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = extraMediaEventModel.h; sourceTree = "<group>"; };
 		6B1CC2C52B677F3D00AD4217 /* extraMediaEventModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = extraMediaEventModel.m; sourceTree = "<group>"; };
 		6B1CC2C82B67A5FC00AD4217 /* USBInsertPopView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = USBInsertPopView.h; sourceTree = "<group>"; };
@@ -2181,6 +2187,8 @@
 				6B7EA7A92BF72D3B002D5CC2 /* queryShareModel.m */,
 				6B7EA7AE2BF73DEB002D5CC2 /* addShareModel.h */,
 				6B7EA7AF2BF73DEB002D5CC2 /* addShareModel.m */,
+				6B07AC232BF85859005C2B0E /* ShareRecordModel.h */,
+				6B07AC242BF85859005C2B0E /* ShareRecordModel.m */,
 			);
 			path = model;
 			sourceTree = "<group>";
@@ -2647,6 +2655,7 @@
 				6BEA31752BB65606005167AA /* clearCacheAlretViewController.h in Headers */,
 				6B467BB32BC7E4360039A6A6 /* addLogObject.h in Headers */,
 				183AE6D12A8CA98C00B11CB0 /* CloudPhoneAPI.h in Headers */,
+				6B07AC252BF85859005C2B0E /* ShareRecordModel.h in Headers */,
 				1868201D2AB97BE1005702A6 /* TipsQRCodeViewController.h in Headers */,
 				6B5B60602B3BC8DE009A2AE2 /* fileTransferPopView.h in Headers */,
 				181E85002A8F6B1800292B96 /* LogoSelectView.h in Headers */,
@@ -2796,6 +2805,7 @@
 				6BEA31782BB65606005167AA /* clearCacheAlretViewController.h in Headers */,
 				6B467BB52BC7E4360039A6A6 /* addLogObject.h in Headers */,
 				6BD506A92B9576A4006E7CB0 /* CloudPhoneAPI.h in Headers */,
+				6B07AC282BF85859005C2B0E /* ShareRecordModel.h in Headers */,
 				6BD506AA2B9576A4006E7CB0 /* TipsQRCodeViewController.h in Headers */,
 				6BD506AB2B9576A4006E7CB0 /* fileTransferPopView.h in Headers */,
 				6BD506AC2B9576A4006E7CB0 /* LogoSelectView.h in Headers */,
@@ -3461,6 +3471,7 @@
 				6B9354A92BF3848D00AA8D31 /* shareRecordViewController.m in Sources */,
 				6B7EA7A72BF607FB002D5CC2 /* imageDetailsScrollViewController.m in Sources */,
 				6BD507A52B9576A4006E7CB0 /* RCCommandHelp.m in Sources */,
+				6B07AC272BF85859005C2B0E /* ShareRecordModel.m in Sources */,
 				6BD507A62B9576A4006E7CB0 /* HWBookmarkModel.m in Sources */,
 				6BD507A72B9576A4006E7CB0 /* NSCache+BGCache.m in Sources */,
 				6BD507A82B9576A4006E7CB0 /* uploadFileRecordBgScorllView.m in Sources */,
@@ -3695,6 +3706,7 @@
 				6B9354A62BF3848D00AA8D31 /* shareRecordViewController.m in Sources */,
 				6B7EA7A52BF607FB002D5CC2 /* imageDetailsScrollViewController.m in Sources */,
 				183AE6B02A8C9EAB00B11CB0 /* RCCommandHelp.m in Sources */,
+				6B07AC262BF85859005C2B0E /* ShareRecordModel.m in Sources */,
 				A00221E727EB25B000E45F78 /* HWBookmarkModel.m in Sources */,
 				A08A94FC27E9A4E400C544BB /* NSCache+BGCache.m in Sources */,
 				6B72725C2B0E22D000C03F87 /* uploadFileRecordBgScorllView.m in Sources */,

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

@@ -140,6 +140,7 @@
     if(_index >=0 &&  _index < _totalDataArr.count){
         NASFilePicDataArrModel *dataModel = _totalDataArr[_index];
         NSArray *pathArr = @[dataModel.path];
+        //NSArray *pathArr = @[dataModel.path,dataModel.path];
         [paraDict setValue:pathArr forKey:@"path"];
     }
     

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

@@ -0,0 +1,46 @@
+//
+//  ShareRecordModel.h
+//  双子星云手机
+//
+//  Created by xd h on 2024/5/18.
+//
+
+#import "SuperModel.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface ShareFileDataModel : SuperModel
+@property (nonatomic, copy) NSString*fileName;
+@property (nonatomic, copy) NSString*fileSize;
+@property (nonatomic, copy) NSString*fileTime;
+@property (nonatomic, copy) NSString*fileUrl;
+@property (nonatomic, copy) NSString*headUrl;
+//@property (nonatomic, assign) long  size;
+//id
+@end
+
+@protocol ShareFileDataModel;
+@interface ShareRecordListModel : SuperModel
+@property (nonatomic, assign) NSInteger expirationDay;//有效期
+@property (nonatomic, copy) NSString* extractionCode;//提取码
+@property (nonatomic, copy) NSString* token;//
+@property (nonatomic, copy) NSString* sn;//
+@property (nonatomic, copy) NSString* addShareId;//
+@property (nonatomic, assign) NSInteger fileType;
+@property (nonatomic, assign) NSInteger platformType;
+@property (nonatomic, assign) NSInteger expirationStatus;//过期状态 0=有效 1=失效
+@property (nonatomic, copy) NSString* expirationTime;//
+@property (nonatomic, copy) NSString* createTime;
+          
+@property (nonatomic, strong) NSArray<ShareFileDataModel>* fileListVOS;
+
+//自定义
+@property (nonatomic, assign) BOOL isSelectType;
+@end
+
+@protocol ShareRecordListModel;
+@interface ShareRecordModel : SuperModel
+@property (nonatomic, strong) NSArray<ShareRecordListModel>* data;;
+@end
+
+NS_ASSUME_NONNULL_END

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

@@ -0,0 +1,22 @@
+//
+//  ShareRecordModel.m
+//  双子星云手机
+//
+//  Created by xd h on 2024/5/18.
+//
+
+#import "ShareRecordModel.h"
+
+@implementation ShareFileDataModel
+
+@end
+
+@implementation ShareRecordListModel
++ (JSONKeyMapper *)keyMapper {
+    return [[JSONKeyMapper alloc] initWithDictionary:@{@"id":@"addShareId"}];
+}
+@end
+
+@implementation ShareRecordModel
+
+@end

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

@@ -9,9 +9,7 @@
 
 @implementation addShareDataModel
 + (JSONKeyMapper *)keyMapper {
-    
     return [[JSONKeyMapper alloc] initWithDictionary:@{@"id":@"addShareId"}];
-    
 }
 @end
 

+ 2 - 2
创维盒子/双子星云手机/Class/Set/previewFile/shareRecordDetailsHWViewController.h

@@ -6,11 +6,11 @@
 //
 
 #import "BaseViewController.h"
-
+#import "ShareRecordModel.h"
 NS_ASSUME_NONNULL_BEGIN
 
 @interface shareRecordDetailsHWViewController : BaseViewController
-
+@property(nonatomic,strong) ShareRecordListModel *dataModel;
 @end
 
 NS_ASSUME_NONNULL_END

+ 142 - 18
创维盒子/双子星云手机/Class/Set/previewFile/shareRecordDetailsHWViewController.m

@@ -8,10 +8,13 @@
 #import "shareRecordDetailsHWViewController.h"
 
 @interface shareRecordDetailsHWViewController ()
+@property (nonatomic,strong)UIView *whiteBgView;
 @property (nonatomic,strong)UILabel *shareTitleLabel;
 @property (nonatomic,strong)UILabel *shareBeginDateLabel;
 @property (nonatomic,strong)UIImageView *shareQRCodeImageView;
 @property (nonatomic,strong)UIButton*checkShareLinkButton;
+@property (nonatomic,strong)UIView *extractCodeBgView;
+@property (nonatomic,strong)UILabel *extractCodeTip2Lab;
 @property (nonatomic,strong)UILabel *shareEndDateLabel;
 
 @property (nonatomic,strong)UIButton*cancelShareLinkButton;
@@ -37,14 +40,14 @@
 - (void)drawAnyView{
     
     //
-    UIView *whiteBgView = [[UIView alloc] init];
-    whiteBgView.backgroundColor = [UIColor whiteColor];
-    [self.view addSubview:whiteBgView];
+    _whiteBgView = [[UIView alloc] init];
+    _whiteBgView.backgroundColor = [UIColor whiteColor];
+    [self.view addSubview:_whiteBgView];
     
-    whiteBgView.layer.cornerRadius = 8;
-    whiteBgView.layer.masksToBounds = YES;
+    _whiteBgView.layer.cornerRadius = 8;
+    _whiteBgView.layer.masksToBounds = YES;
     
-    [whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+    [_whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(15);
         make.right.mas_equalTo(-15);
         make.top.equalTo(self.navBarBGView.mas_bottom).offset(40.f);
@@ -68,11 +71,11 @@
     }];
     
     _shareTitleLabel = [[UILabel alloc] init];
-    _shareTitleLabel.text = @"banner.png等多个文件";
+    //_shareTitleLabel.text = @"banner.png等多个文件";
     _shareTitleLabel.textAlignment = NSTextAlignmentCenter;
     _shareTitleLabel.textColor = HW0A132BColor;
     _shareTitleLabel.font = [UIFont systemFontOfSize:14.0];
-    [whiteBgView addSubview:_shareTitleLabel];
+    [_whiteBgView addSubview:_shareTitleLabel];
     
     [_shareTitleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(folderImageView.mas_bottom).offset(5.f);
@@ -82,11 +85,11 @@
     }];
     
     _shareBeginDateLabel = [[UILabel alloc] init];
-    _shareBeginDateLabel.text = @"2024/04/25 19:45";
+    //_shareBeginDateLabel.text = @"2024/04/25 19:45";
     _shareBeginDateLabel.textAlignment = NSTextAlignmentCenter;
     _shareBeginDateLabel.textColor = HW666666Color;
     _shareBeginDateLabel.font = [UIFont systemFontOfSize:12.0];
-    [whiteBgView addSubview:_shareBeginDateLabel];
+    [_whiteBgView addSubview:_shareBeginDateLabel];
     
     [_shareBeginDateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(_shareTitleLabel.mas_bottom).offset(25.f);
@@ -97,7 +100,7 @@
     
     UIImageView *QRCodeEdgingImageView = [[UIImageView alloc] init];
     QRCodeEdgingImageView.image = [UIImage imageNamed:@"share_QRCode_edging"];
-    [whiteBgView addSubview:QRCodeEdgingImageView];
+    [_whiteBgView addSubview:QRCodeEdgingImageView];
 
     [QRCodeEdgingImageView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.equalTo(_shareBeginDateLabel.mas_bottom).offset(10.f);
@@ -107,7 +110,7 @@
     }];
     
     _shareQRCodeImageView = [[UIImageView alloc] init];
-    _shareQRCodeImageView.backgroundColor = [UIColor greenColor];
+    //_shareQRCodeImageView.backgroundColor = [UIColor lightGrayColor];
     [QRCodeEdgingImageView addSubview:_shareQRCodeImageView];
     [_shareQRCodeImageView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.top.mas_equalTo(20);
@@ -116,7 +119,7 @@
         make.right.mas_equalTo(-20);
     }];
     
-    _shareQRCodeImageView.image = [self generateQRCodeWithInputMessage:@"http://baidu.com" Width:168 Height:168];
+    //_shareQRCodeImageView.image = [self generateQRCodeWithInputMessage:@"http://baidu.com" Width:168 Height:168];
     
     _checkShareLinkButton = [[UIButton alloc] init];
     [_checkShareLinkButton setTitle:NSLocalizedString(@"check_share_link_title",nil) forState:UIControlStateNormal];
@@ -133,15 +136,58 @@
         make.height.mas_equalTo(30);
     }];
     
+    //提取码
+    _extractCodeBgView = [[UIView alloc] init];
+    _extractCodeBgView.backgroundColor = [UIColor hwColor:@"#F9F9F9"];
+    [_whiteBgView addSubview:_extractCodeBgView];
+    _extractCodeBgView.layer.cornerRadius = 8;
+    _extractCodeBgView.layer.masksToBounds = YES;
+    
+    [_extractCodeBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(50);
+        make.right.mas_equalTo(-50);
+        make.top.equalTo(_checkShareLinkButton.mas_bottom).offset(15);
+        make.height.mas_equalTo(40);
+    }];
+    
+    UILabel *extractCodeTipLab = [[UILabel alloc] init];
+    extractCodeTipLab.font = [UIFont systemFontOfSize:14.f];
+    [extractCodeTipLab setTextColor:HW0A132BColor];
+    extractCodeTipLab.text =  NSLocalizedString(@"share_Extract_code_tip",nil);
+    [_extractCodeBgView addSubview:extractCodeTipLab];
+    
+    [extractCodeTipLab mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(15);
+        make.right.mas_equalTo(_extractCodeBgView.mas_centerX);
+        make.top.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+    }];
+    
+    _extractCodeTip2Lab = [[UILabel alloc] init];
+    _extractCodeTip2Lab.font = [UIFont systemFontOfSize:14.f];
+    //[_extractCodeTip2Lab setTextAlignment:(NSTextAlignmentRight)];
+    [_extractCodeTip2Lab setTextAlignment:(NSTextAlignmentCenter)];
+    [_extractCodeTip2Lab setTextColor:[UIColor hwColor:@"#01B7EA" alpha:1.0]];
+    [_extractCodeBgView addSubview:_extractCodeTip2Lab];
+    //extractCodeTip2Lab.text = _addShareMod.data.extractionCode;
+    
+    [_extractCodeTip2Lab mas_makeConstraints:^(MASConstraintMaker *make) {
+        //make.left.mas_equalTo(extractCodeTipLab.mas_right);
+        make.left.mas_equalTo(20);
+        make.right.mas_equalTo(-20);
+        make.top.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+    }];
+    
     _shareEndDateLabel = [[UILabel alloc] init];
-    _shareEndDateLabel.text = @"2024/04/25 19:45";
+    //_shareEndDateLabel.text = @"2024/04/25 19:45";
     _shareEndDateLabel.textAlignment = NSTextAlignmentCenter;
     _shareEndDateLabel.textColor = HW0A132BColor;
     _shareEndDateLabel.font = [UIFont systemFontOfSize:14.0];
-    [whiteBgView addSubview:_shareEndDateLabel];
+    [_whiteBgView addSubview:_shareEndDateLabel];
     
     [_shareEndDateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
-        make.top.equalTo(_checkShareLinkButton.mas_bottom).offset(25.f);
+        make.top.equalTo(_extractCodeBgView.mas_bottom).offset(15.f);
         make.left.mas_equalTo(15);
         make.right.mas_equalTo(-15);
         make.height.mas_equalTo(15);
@@ -163,7 +209,7 @@
     [_cancelShareLinkButton mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(15);
         make.width.mas_equalTo(130);
-        make.top.equalTo(whiteBgView.mas_bottom).offset(25);
+        make.top.equalTo(_whiteBgView.mas_bottom).offset(25);
         make.height.mas_equalTo(48);
     }];
     
@@ -193,7 +239,7 @@
     [_shareLinkCopyButton mas_makeConstraints:^(MASConstraintMaker *make) {
         make.right.mas_equalTo(-15);
         make.width.mas_equalTo(w_btn);
-        make.top.equalTo(whiteBgView.mas_bottom).offset(25);
+        make.top.equalTo(_whiteBgView.mas_bottom).offset(25);
         make.height.mas_equalTo(48);
     }];
     
@@ -222,4 +268,82 @@
     
 }
 
+- (void)viewWillAppear:(BOOL)animated
+{
+    [super viewWillAppear:animated];
+    [self handleDataFun];
+}
+
+//- (void)setDataModel:(ShareRecordListModel *)dataModel
+- (void)handleDataFun
+{
+    //_dataModel = dataModel;
+    
+    if(!_dataModel.expirationStatus){
+       _cancelShareLinkButton.hidden = NO;
+       _shareLinkCopyButton.hidden = NO;
+    }
+    else{
+        _cancelShareLinkButton.hidden = YES;
+        _shareLinkCopyButton.hidden = YES;
+    }
+    
+    //失效时间
+    NSString *tipStr = NSLocalizedString(@"copy_share_link_Invalid_tip3",nil);
+    _shareEndDateLabel.text = [[NSString alloc] initWithFormat:@"%@: %@",tipStr,_dataModel.expirationTime];
+    
+    ShareFileDataModel *fileModel = _dataModel.fileListVOS.firstObject;
+    NSString *titleStr = [[NSString alloc] initWithFormat:@"%@%@%ld%@",fileModel.fileName,NSLocalizedString(@"share_file_more_tip",nil), _dataModel.fileListVOS.count,NSLocalizedString(@"share_file_Numbers_tip",nil)];
+    
+    if(_dataModel.fileListVOS.count == 1){
+        titleStr = fileModel.fileName;
+    }
+    
+    _shareTitleLabel.text = titleStr;
+    _shareBeginDateLabel.text = _dataModel.createTime;
+    
+    NSString *serUrl = @"http://192.168.12.253:8080/#/pages/fileSharing/index?token=";
+    NSString *shareUrl = [[NSString alloc] initWithFormat:@"%@%@",serUrl,_dataModel.token];
+    _shareQRCodeImageView.image = [self generateQRCodeWithInputMessage:shareUrl Width:168 Height:168];
+    
+    _extractCodeTip2Lab.text = _dataModel.extractionCode;
+    
+    if(_dataModel.platformType == 4){
+        
+        [_whiteBgView mas_remakeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(15);
+            make.right.mas_equalTo(-15);
+            make.top.equalTo(self.navBarBGView.mas_bottom).offset(40.f);
+            make.height.mas_equalTo(508);
+        }];
+        
+        _extractCodeBgView.hidden = NO;
+        
+        [_shareEndDateLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
+            make.top.equalTo(_extractCodeBgView.mas_bottom).offset(15.f);
+            make.left.mas_equalTo(15);
+            make.right.mas_equalTo(-15);
+            make.height.mas_equalTo(15);
+        }];
+    }
+    else{
+        
+        [_whiteBgView mas_remakeConstraints:^(MASConstraintMaker *make) {
+            make.left.mas_equalTo(15);
+            make.right.mas_equalTo(-15);
+            make.top.equalTo(self.navBarBGView.mas_bottom).offset(40.f);
+            make.height.mas_equalTo(448);
+        }];
+        
+        _extractCodeBgView.hidden = YES;
+        
+        [_shareEndDateLabel mas_remakeConstraints:^(MASConstraintMaker *make) {
+            make.top.equalTo(_checkShareLinkButton.mas_bottom).offset(15.f);
+            make.left.mas_equalTo(15);
+            make.right.mas_equalTo(-15);
+            make.height.mas_equalTo(15);
+        }];
+    }
+}
+
 @end

+ 58 - 14
创维盒子/双子星云手机/Class/Set/previewFile/shareRecordViewController.m

@@ -8,7 +8,7 @@
 #import "shareRecordViewController.h"
 #import "shareRecordTableViewCell.h"
 #import "shareRecordDetailsHWViewController.h"
-
+#import "ShareRecordModel.h"
 @interface shareRecordViewController ()<UITableViewDelegate,UITableViewDataSource,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
 {
     BOOL isEditType;
@@ -23,6 +23,8 @@
 @property (nonatomic, strong) UIButton *rightEditButton;
 @property (nonatomic, strong) UIButton *leftCancleButton;
 @property (nonatomic, strong) UIButton *rightSelectAllButton;
+
+@property (nonatomic, strong) ShareRecordModel * ShareRecordMod;
 @end
 
 @implementation shareRecordViewController
@@ -35,10 +37,12 @@
     [self.navigationBar setHidden:YES];
     [self.navBarBGView setHidden:NO];
     self.navBarBGView.backgroundColor = [UIColor whiteColor];
-    [self.view setBackgroundColor:[UIColor hwColor:@"#F5F7FA"]];
+    //[self.view setBackgroundColor:[UIColor hwColor:@"#F5F7FA"]];
+    [self.view setBackgroundColor:[UIColor whiteColor]];
     self.titleLabel.text = NSLocalizedString(@"my_set_no_share",nil);
     
     [self drawAnyView];
+    [self getShareFileListFun];
 }
 
 - (void)drawAnyView{
@@ -55,7 +59,7 @@
     
     _ruleBottomButton = [[UIButton alloc] init];
     [_ruleBottomButton setTitle:NSLocalizedString(@"share_rule_but_title",nil) forState:UIControlStateNormal];
-    [_ruleBottomButton setTitleColor:HW0A132BColor forState:UIControlStateNormal];
+    [_ruleBottomButton setTitleColor:[UIColor hwColor:@"#01B7EA"] forState:UIControlStateNormal];
     _ruleBottomButton.titleLabel.font = [UIFont boldSystemFontOfSize:14.0];
     [_ruleBottomButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
     _ruleBottomButton.tag = 1;
@@ -63,6 +67,8 @@
     _ruleBottomButton.layer.cornerRadius = 8;
     _ruleBottomButton.layer.masksToBounds = YES;
     _ruleBottomButton.backgroundColor = [UIColor whiteColor];
+    _ruleBottomButton.layer.borderWidth = 1;
+    _ruleBottomButton.layer.borderColor = [UIColor hwColor:@"#01B7EA"].CGColor;
     
     [_ruleBottomButton mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(15);
@@ -211,7 +217,10 @@
 }
 
 - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
-    return 2;
+    if (_ShareRecordMod && _ShareRecordMod.data.count>0) {
+        return _ShareRecordMod.data.count;
+    }
+    return 0;
 }
 
 - (shareRecordTableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{
@@ -226,23 +235,21 @@
         [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
         [cell setBackgroundColor:[UIColor clearColor]];
         [cell setAccessoryType:(UITableViewCellAccessoryNone)];
-        
-        
     }
     
     cell.isEditType = isEditType;
     
-//    if(row < _curCouldPhoneFileListMod.data.list.count){
-//        couldPhoneFileModel* fileModel = _curCouldPhoneFileListMod.data.list[row];
-//        cell.curFileModel = fileModel;
-//        
-//        KWeakSelf
+    if(row < _ShareRecordMod.data.count){
+        ShareRecordListModel* model = _ShareRecordMod.data[row];
+        cell.dataModel = model;
+        
+        KWeakSelf
 //        cell.didClickSwitch = ^(BOOL SwitchOn) {
 //            if([weakSelf userCheckFileModel:fileModel withShowTip:YES]){
 //                [weakSelf userCheckFilePreviewByRow:row];
 //            }
 //        };
-//    }
+    }
     return cell;
 }
 
@@ -258,19 +265,24 @@
     
     shareRecordDetailsHWViewController *vc = [shareRecordDetailsHWViewController new];
     [self.navigationController pushViewController:vc animated:YES];
+    
+    if(row < _ShareRecordMod.data.count){
+        ShareRecordListModel* model = _ShareRecordMod.data[row];
+        vc.dataModel = model;
+    }
 }
 
 
 #pragma mark 空数据
 - (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView {
     
-    NSString *imageName = @"uploadFile_noData";
+    NSString *imageName = @"common_no_data_pic";
     
     return [UIImage imageNamed:imageName];
 }
 
 - (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView {
-    NSString *text = NSLocalizedString(@"common_no_data_pic",nil);
+    NSString *text = NSLocalizedString(@"common_no_data_tip",nil);
     
     NSDictionary *attributes = @{NSFontAttributeName: [UIFont systemFontOfSize:16.0f],
                                  NSForegroundColorAttributeName: HW999999Color};
@@ -340,4 +352,36 @@
     _cancelShareButton.hidden = YES;
     [self.tableView reloadData];
 }
+
+
+
+#pragma mark 分享记录列表
+- (void)getShareFileListFun
+{
+    NSMutableDictionary*paraDict = [NSMutableDictionary new];
+    
+    NSString *SNStr = [connectDeviceManager shareInstance].DeviceThirdIdMod.data.changeSn;
+    if(SNStr){
+        [paraDict setValue:SNStr forKey:@"sn"];
+    }
+    else{
+        return;;
+    }
+    
+    [self showNewIndicatorWithCanBack:YES canTouch:NO];
+    
+    KWeakSelf
+    [[netWorkManager shareInstance] CommonPostCallBackCode:queryShareRecordFun Parameters:paraDict success:^(id  _Nonnull responseObject) {
+        [weakSelf removeNewIndicator];
+        weakSelf.ShareRecordMod = [[ShareRecordModel alloc] initWithDictionary:responseObject error:nil];
+        if(weakSelf.ShareRecordMod && weakSelf.ShareRecordMod.status == 0){
+            [weakSelf.tableView reloadData];
+        }
+        else{
+            
+        }
+    } failure:^(NSError * _Nonnull error) {
+        [weakSelf removeNewIndicator];
+    }];
+}
 @end

+ 15 - 16
创维盒子/双子星云手机/Class/Set/previewFile/view/imageCollectionViewCell.m

@@ -63,35 +63,34 @@
 - (void)setCurFileModel:(NASFilePicDataArrModel *)curFileModel
 {
     _curFileModel = curFileModel;
-    
+   
+    NSString *filePath = _curFileModel.path;
+    NSString *urlStr = ksharedAppDelegate.NASFileService;
+    NSString *fileUrl = [[NSString alloc] initWithFormat:@"%@getThumbnail?path=%@",urlStr,filePath];
     
     UIImage *defaultImage = [UIImage imageNamed:@"uploadFile_image"];
     if([self.fileType isEqualToString:@"video"])
     {
         defaultImage = [UIImage imageNamed:@"uploadFile_Video"];
-        _imageView.image = defaultImage;
     }
     else{
-        NSString *filePath = _curFileModel.path;
-        NSString *urlStr = ksharedAppDelegate.NASFileService;
-        NSString *fileUrl = [[NSString alloc] initWithFormat:@"%@getThumbnail?path=%@",urlStr,filePath];
-        
         //iOS格式的图片 代理拿不到缩略图
         if([filePath rangeOfString:@".HEIC"].location != NSNotFound
            ||[filePath rangeOfString:@".heic"].location != NSNotFound){
             fileUrl = [[NSString alloc] initWithFormat:@"%@getFile?path=%@",urlStr,filePath];
         }
-  
-        [_imageView sd_setImageWithURL:[NSURL URLWithString:fileUrl] placeholderImage:defaultImage completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
-//            if(image){
-//                HLog(@"11图片1:%@",imageURL.absoluteString);
-//            }
-//            else{
-//                HLog(@"11图片0:%@",imageURL.absoluteString);
-//            }
-            
-        }];
     }
+
+    [_imageView sd_setImageWithURL:[NSURL URLWithString:fileUrl] placeholderImage:defaultImage completed:^(UIImage * _Nullable image, NSError * _Nullable error, SDImageCacheType cacheType, NSURL * _Nullable imageURL) {
+        if(image){
+            HLog(@"11图片1:%@",imageURL.absoluteString);
+        }
+        else{
+            HLog(@"11图片0:%@",imageURL.absoluteString);
+        }
+        
+    }];
+    
     
     if(!_isEditType){
         self.selectButton.hidden = YES;

+ 2 - 1
创维盒子/双子星云手机/Class/Set/previewFile/view/shareRecordTableViewCell.h

@@ -6,11 +6,12 @@
 //
 
 #import <UIKit/UIKit.h>
-
+#import "ShareRecordModel.h"
 NS_ASSUME_NONNULL_BEGIN
 
 @interface shareRecordTableViewCell : UITableViewCell
 @property(nonatomic,assign) BOOL isEditType;
+@property(nonatomic,strong) ShareRecordListModel *dataModel;
 @end
 
 NS_ASSUME_NONNULL_END

+ 50 - 3
创维盒子/双子星云手机/Class/Set/previewFile/view/shareRecordTableViewCell.m

@@ -93,7 +93,7 @@
         //make.top.mas_equalTo(15.f);
     }];
     
-    _stateLabel.text = @"已失效";
+    
     
     /**标题*/
     _titleLabel = [[UILabel alloc] init];
@@ -108,7 +108,7 @@
         make.top.mas_equalTo(15.f);
     }];
     
-    _titleLabel.text = @"banner.png等多个文件";
+    
     
     _lockImageView = [[UIImageView alloc] init];
     [_lockImageView setImage:[UIImage imageNamed:@"share_lock_icon"]];
@@ -133,7 +133,7 @@
         make.height.mas_equalTo(16);
     }];
     
-    _titleLabel2.text = @"2024/04/25 19:45";
+    
     
 }
 
@@ -149,6 +149,53 @@
     }
 }
 
+- (void)setDataModel:(ShareRecordListModel *)dataModel
+{
+    _dataModel = dataModel;
+    
+    if(_dataModel.expirationStatus){
+        _stateLabel.text = NSLocalizedString(@"copy_share_link_Invalid_tip",nil);
+        [_stateLabel setTextColor:HW666666Color]; //#01B7EA
+    }
+    else{
+        //计算失效时间
+        NSString *expDateStr = [iTools getTimeStringToExpirationDate:_dataModel.expirationTime];
+        NSString *tipStr = NSLocalizedString(@"copy_share_link_Invalid_tip2",nil);
+        _stateLabel.text = [[NSString alloc] initWithFormat:@"%@%@",expDateStr,tipStr];
+        [_stateLabel setTextColor:[UIColor hwColor:@"#01B7EA"]];
+    }
+    
+    ShareFileDataModel *fileModel = _dataModel.fileListVOS.firstObject;
+    NSString *titleStr = [[NSString alloc] initWithFormat:@"%@%@%ld%@",fileModel.fileName,NSLocalizedString(@"share_file_more_tip",nil), _dataModel.fileListVOS.count,NSLocalizedString(@"share_file_Numbers_tip",nil)];
+    
+    if(_dataModel.fileListVOS.count == 1){
+        titleStr = fileModel.fileName;
+    }
+    
+    _titleLabel.text = titleStr;
+    _titleLabel2.text = _dataModel.createTime;
+    
+    if(_dataModel.platformType == 4){
+        _lockImageView.hidden = NO;
+        /**副标题*/
+        [_titleLabel2 mas_remakeConstraints:^(MASConstraintMaker *make) {
+            make.right.equalTo(_titleLabel.mas_right);
+            make.left.equalTo(_lockImageView.mas_right);
+            make.centerY.equalTo(_lockImageView.mas_centerY);
+            make.height.mas_equalTo(16);
+        }];
+    }
+    else{
+        _lockImageView.hidden = YES;
+        [_titleLabel2 mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.right.equalTo(_titleLabel.mas_right);
+            make.left.equalTo(_lockImageView.mas_left);
+            make.centerY.equalTo(_lockImageView.mas_centerY);
+            make.height.mas_equalTo(16);
+        }];
+    }
+}
+
 - (void)didClickButFun:(UIButton*)but
 {
     but.selected = !but.selected;

+ 2 - 1
创维盒子/双子星云手机/Helpers/iTools.h

@@ -44,7 +44,8 @@ NS_ASSUME_NONNULL_BEGIN
 + (NSString *)getTimeStringFromTimeInterval:(NSInteger)timeInterval;
 /** 秒转播放时间HH:mm:ss */
 + (NSString *)getPlayTimeStringFromTimeInterval:(NSTimeInterval)timeInterval;
-
+/** 把字符串转时间戳Date  YYYYMMddhhmmssSSS 2024-05-24 20:44:57 返回 x天 多少时 多少分*/
++ (NSString *)getTimeStringToExpirationDate:(NSString *)timeStr;
 
 #pragma mark 通讯录备份
 //ypp add 通讯录文件名格式YmdHis+随机数字(1000~9999) 2020 07 07 15 08 25 1000

+ 45 - 0
创维盒子/双子星云手机/Helpers/iTools.m

@@ -135,6 +135,51 @@ static const char encodingTable[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopq
     return format_time;
 }
 
+/** 把字符串转时间戳Date  YYYYMMddhhmmssSSS 2024-05-24 20:44:57 返回 x天 多少时 多少分*/
++ (NSString *)getTimeStringToExpirationDate:(NSString *)timeStr
+{
+    NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
+    //需要设置为和字符串相同的格式
+    [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];;
+    NSDate *localDate = [dateFormatter dateFromString:timeStr];
+    
+    NSTimeInterval ExpSecond =   [localDate timeIntervalSince1970];
+    NSTimeInterval curSecond =   [[NSDate date] timeIntervalSince1970];
+    NSTimeInterval curSecond2 =   ExpSecond - curSecond;
+    
+    NSInteger validSecond = (NSInteger)curSecond2;
+    NSInteger daySecond = 60*60*24;
+    NSInteger hourSecond = 60*60;
+    NSInteger minSecond = 60;
+    if(validSecond >= daySecond){
+        NSInteger day = validSecond/daySecond;
+        if(validSecond % daySecond >0){
+            day += 1;
+        }
+        
+        return [[NSString alloc] initWithFormat:@"%ld%@",day,NSLocalizedString(@"share_expiration_date_unit_day_tip",nil)];
+    }
+    else if(validSecond >= hourSecond){
+        NSInteger day = validSecond/daySecond;
+        if(validSecond % daySecond >0){
+            day += 1;
+        }
+        
+        return [[NSString alloc] initWithFormat:@"%ld%@",day,NSLocalizedString(@"share_expiration_date_unit_hour_tip",nil)];
+    }
+    else if(validSecond >= minSecond){
+        NSInteger day = validSecond/daySecond;
+        if(validSecond % daySecond >0){
+            day += 1;
+        }
+        
+        return [[NSString alloc] initWithFormat:@"%ld%@",day,NSLocalizedString(@"share_expiration_date_unit_min_tip",nil)];
+    }
+ 
+    return [[NSString alloc] initWithFormat:@"1%@",NSLocalizedString(@"share_expiration_date_unit_min_tip",nil)];
+}
+
+
 //ypp add 通讯录文件名格式YmdHis+随机数字(1000~9999) 2020 07 07 15 08 25 1000
 + (NSString *)getContactsNameStr {
     NSString* date;

+ 6 - 0
创维盒子/双子星云手机/netWork/newWorkInterface.h

@@ -89,4 +89,10 @@
  返回数据模型 */
 #define updateShareInfoFun  @"/box/share/info/update"
 
+/*13 分享记录列表接口  POST请求
+输入参数
+ 
+ 返回数据模型 */
+#define queryShareRecordFun  @"/box/share/info/queryByCondition"
+
 #endif /* newWorkInterface_h */

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

@@ -489,3 +489,9 @@
 "share_secret_titile_3"   = "密码:";
 "share_secret_titile_4"   = "点击链接即可打开查看好友分享的文件";
 "copy_share_link_suc_tip"   = "复制连接成功";
+"copy_share_link_Invalid_tip"   = "已失效";
+"copy_share_link_Invalid_tip2"   = "失效";
+"copy_share_link_Invalid_tip3"   = "失效日期";
+"share_expiration_date_unit_day_tip"   = "天后";
+"share_expiration_date_unit_hour_tip"   = "小时后";
+"share_expiration_date_unit_min_tip"   = "分钟后";