瀏覽代碼

1.上传文件路径

huangxiaodong 1 年之前
父節點
當前提交
74d38b5ad1

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

@@ -317,6 +317,10 @@
 		6B9354952BF33F2700AA8D31 /* editShareView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B9354922BF33F2700AA8D31 /* editShareView.h */; };
 		6B9354962BF33F2700AA8D31 /* editShareView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B9354922BF33F2700AA8D31 /* editShareView.h */; };
 		6B9354972BF33F2700AA8D31 /* editShareView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B9354932BF33F2700AA8D31 /* editShareView.m */; };
+		6B93549A2BF369D000AA8D31 /* previewToUploadFileView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B9354992BF369D000AA8D31 /* previewToUploadFileView.m */; };
+		6B93549B2BF369D000AA8D31 /* previewToUploadFileView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B9354982BF369D000AA8D31 /* previewToUploadFileView.h */; };
+		6B93549C2BF369D000AA8D31 /* previewToUploadFileView.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B9354982BF369D000AA8D31 /* previewToUploadFileView.h */; };
+		6B93549D2BF369D000AA8D31 /* previewToUploadFileView.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B9354992BF369D000AA8D31 /* previewToUploadFileView.m */; };
 		6B97143F2BCD00CA00CE0096 /* ComontAlretType2ViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 6B97143E2BCD00C900CE0096 /* ComontAlretType2ViewController.m */; };
 		6B9714402BCD00CA00CE0096 /* ComontAlretType2ViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B97143D2BCD00C900CE0096 /* ComontAlretType2ViewController.h */; };
 		6B9714412BCD00CA00CE0096 /* ComontAlretType2ViewController.h in Headers */ = {isa = PBXBuildFile; fileRef = 6B97143D2BCD00C900CE0096 /* ComontAlretType2ViewController.h */; };
@@ -1177,6 +1181,8 @@
 		6B93548D2BF30A8C00AA8D31 /* editTypeBottomView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = editTypeBottomView.m; sourceTree = "<group>"; };
 		6B9354922BF33F2700AA8D31 /* editShareView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = editShareView.h; sourceTree = "<group>"; };
 		6B9354932BF33F2700AA8D31 /* editShareView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = editShareView.m; sourceTree = "<group>"; };
+		6B9354982BF369D000AA8D31 /* previewToUploadFileView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = previewToUploadFileView.h; sourceTree = "<group>"; };
+		6B9354992BF369D000AA8D31 /* previewToUploadFileView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = previewToUploadFileView.m; sourceTree = "<group>"; };
 		6B97143D2BCD00C900CE0096 /* ComontAlretType2ViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = ComontAlretType2ViewController.h; sourceTree = "<group>"; };
 		6B97143E2BCD00C900CE0096 /* ComontAlretType2ViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = ComontAlretType2ViewController.m; sourceTree = "<group>"; };
 		6BA533362B16E65500D1CB5C /* TvStatusModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = TvStatusModel.h; sourceTree = "<group>"; };
@@ -1958,6 +1964,8 @@
 				6B93548D2BF30A8C00AA8D31 /* editTypeBottomView.m */,
 				6B9354922BF33F2700AA8D31 /* editShareView.h */,
 				6B9354932BF33F2700AA8D31 /* editShareView.m */,
+				6B9354982BF369D000AA8D31 /* previewToUploadFileView.h */,
+				6B9354992BF369D000AA8D31 /* previewToUploadFileView.m */,
 			);
 			path = view;
 			sourceTree = "<group>";
@@ -2643,6 +2651,7 @@
 				18FCE5392AD1351B0020F623 /* PlayerViewController.h in Headers */,
 				6BF52CA62AD7D3BE00A617DB /* customLaunchView.h in Headers */,
 				183AE7C72A8CB39100B11CB0 /* SafeForKey.h in Headers */,
+				6B93549B2BF369D000AA8D31 /* previewToUploadFileView.h in Headers */,
 				6B5D40272B4BC402000965CF /* couldPhoneFileListModel.h in Headers */,
 				6B5B606E2B3D7E3B009A2AE2 /* fileTransferPathCheckViewController.h in Headers */,
 				186820252AB9B5BF005702A6 /* SetPWDFirstViewController.h in Headers */,
@@ -2779,6 +2788,7 @@
 				6BD5070B2B9576A4006E7CB0 /* PlayerViewController.h in Headers */,
 				6BD5070C2B9576A4006E7CB0 /* customLaunchView.h in Headers */,
 				6BD5070D2B9576A4006E7CB0 /* SafeForKey.h in Headers */,
+				6B93549C2BF369D000AA8D31 /* previewToUploadFileView.h in Headers */,
 				6BD5070E2B9576A4006E7CB0 /* couldPhoneFileListModel.h in Headers */,
 				6BD5070F2B9576A4006E7CB0 /* fileTransferPathCheckViewController.h in Headers */,
 				6BD507102B9576A4006E7CB0 /* SetPWDFirstViewController.h in Headers */,
@@ -3191,6 +3201,7 @@
 				6BD507312B9576A4006E7CB0 /* BaseViewController.m in Sources */,
 				6BD507322B9576A4006E7CB0 /* PlayerViewController+upLoadFile.m in Sources */,
 				6BD507332B9576A4006E7CB0 /* Calculator.m in Sources */,
+				6B93549D2BF369D000AA8D31 /* previewToUploadFileView.m in Sources */,
 				6BD507342B9576A4006E7CB0 /* HWWebViewController.m in Sources */,
 				6B8661DF2BBA578600B19846 /* HaveNoticeView.m in Sources */,
 				6BD507352B9576A4006E7CB0 /* HWBookmarkListCell.m in Sources */,
@@ -3412,6 +3423,7 @@
 				A003F6A627D841C800715CBF /* BaseViewController.m in Sources */,
 				6B1FBD332B455DBD00926382 /* PlayerViewController+upLoadFile.m in Sources */,
 				18E557212A3C5D75005CC84B /* Calculator.m in Sources */,
+				6B93549A2BF369D000AA8D31 /* previewToUploadFileView.m in Sources */,
 				A003F6ED27D84D9C00715CBF /* HWWebViewController.m in Sources */,
 				6B8661DC2BBA578600B19846 /* HaveNoticeView.m in Sources */,
 				A031DD6D27EC1FCD00909527 /* HWBookmarkListCell.m in Sources */,

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

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

二進制
创维盒子/双子星云手机/Assets.xcassets/Set/fileSet/add_file_icon.imageset/add_file_icon@2x.png


二進制
创维盒子/双子星云手机/Assets.xcassets/Set/fileSet/add_file_icon.imageset/add_file_icon@3x.png


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

@@ -19,6 +19,7 @@
 #import "editTypeHeadView.h"
 #import "editTypeBottomView.h"
 #import "editShareView.h"
+#import "previewToUploadFileView.h"
 
 @interface previewImageOrVideoViewController ()<UICollectionViewDelegate,UICollectionViewDataSource,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
 {
@@ -41,6 +42,7 @@
 @property(nonatomic,assign) BOOL isEditType;
 @property(nonatomic,strong) editTypeHeadView*curEditTypeHeadView;
 @property(nonatomic,strong) editTypeBottomView*curEditTypeBottomView;
+@property(nonatomic,strong) UIButton*uploadFileButton;
 
 @property(nonatomic,strong) couldPhoneFileListModel *curCouldPhoneFileListMod;
 @property (nonatomic, strong)  NSMutableArray*didSelectListArr;//选中的数据
@@ -128,6 +130,17 @@
         make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
     }];
     
+    //大+号
+    _uploadFileButton = [[UIButton alloc] init];
+    [_uploadFileButton setBackgroundImage:[UIImage imageNamed:@"add_file_icon"] forState:UIControlStateNormal];
+    [_uploadFileButton addTarget:self action:@selector(userDidClickUploadViewFun) forControlEvents:UIControlEventTouchUpInside];
+    [self.view addSubview:_uploadFileButton];
+    [_uploadFileButton mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.right.mas_equalTo(-15);
+        make.width.mas_equalTo(52);
+        make.height.mas_equalTo(52);
+        make.bottom.mas_equalTo(-30 - AdaptTabHeight);
+    }];
     
     NSMutableArray *arr = [NSMutableArray new];
     NSArray *diskList = ksharedAppDelegate.cloudPhoneExtraFileListMod.data;
@@ -459,6 +472,7 @@
     
     _curEditTypeHeadView.hidden = NO;
     _curEditTypeBottomView.hidden = NO;
+    _uploadFileButton.hidden = YES;
     
     [self.dataCollectionView mas_remakeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(0);
@@ -476,6 +490,7 @@
     
     _curEditTypeHeadView.hidden = YES;
     _curEditTypeBottomView.hidden = YES;
+    _uploadFileButton.hidden = NO;
     
     [self.dataCollectionView mas_remakeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(0);
@@ -562,6 +577,20 @@
     }];
 }
 
+#pragma mark 用户点击上传文件
+- (void)userDidClickUploadViewFun
+{
+    previewToUploadFileView *previewToUploadFileV = [[previewToUploadFileView alloc] init];
+    [self.view addSubview:previewToUploadFileV];
+    
+    [previewToUploadFileV mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+        make.top.mas_equalTo(0);
+    }];
+}
+
 #pragma mark 设置标题
 - (void)setTitleLabelText:(NSString*)title
 {

+ 16 - 0
创维盒子/双子星云手机/Class/Set/previewFile/view/previewToUploadFileView.h

@@ -0,0 +1,16 @@
+//
+//  previewToUploadFileView.h
+//  双子星云手机
+//
+//  Created by xd h on 2024/5/14.
+//
+
+#import <UIKit/UIKit.h>
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface previewToUploadFileView : UIView
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 168 - 0
创维盒子/双子星云手机/Class/Set/previewFile/view/previewToUploadFileView.m

@@ -0,0 +1,168 @@
+//
+//  previewToUploadFileView.m
+//  双子星云手机
+//
+//  Created by xd h on 2024/5/14.
+//
+
+#import "previewToUploadFileView.h"
+
+@interface previewToUploadFileView ()
+
+@end
+
+@implementation previewToUploadFileView
+
+- (id)initWithFrame:(CGRect)frame{
+    self = [super initWithFrame:frame];
+    self.backgroundColor = [UIColor hwColor:@"#000000" alpha:0.6];
+    [self drawAnyView];
+    return self;
+}
+
+- (void)drawAnyView{
+    
+    UIView *whiteBgView = [[UIView alloc] init];
+    whiteBgView.backgroundColor = [UIColor whiteColor];
+    [self addSubview:whiteBgView];
+    whiteBgView.layer.cornerRadius = 32;
+    whiteBgView.layer.masksToBounds = YES;
+    
+    [whiteBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+        make.height.mas_equalTo(180+ AdaptTabHeight);
+    }];
+    
+ 
+    UILabel *titleLabel = [[UILabel alloc] init];
+    titleLabel.font = [UIFont systemFontOfSize:18.0];
+    titleLabel.textColor = [UIColor hwColor:@"#0A132B" alpha:1.0];
+    [whiteBgView addSubview:titleLabel];
+    
+    NSString *leftText = NSLocalizedString(@"uploadFile_title_left",nil);
+    NSString *rightText = NSLocalizedString(@"uploadFile_title_right",nil);
+    NSString *totalStr = [[NSString alloc] initWithFormat:@"%@  %@",leftText,rightText];
+    
+    NSMutableAttributedString *attrStr = [[NSMutableAttributedString alloc] initWithString:totalStr];
+    NSRange redRange = NSMakeRange([totalStr rangeOfString:rightText].location, [totalStr rangeOfString:rightText].length);
+    UIColor *noteColor =[UIColor hwColor:@"#959799" alpha:1.0];
+    [attrStr addAttribute:NSForegroundColorAttributeName value:noteColor range:redRange];
+    [attrStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:12.0] range:redRange];
+    titleLabel.attributedText = attrStr;
+    
+    [titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(25);
+        make.right.mas_equalTo(0);
+        make.top.mas_equalTo(20);
+        make.height.mas_equalTo(40);
+    }];
+    
+   
+    
+    NSArray *titleArr = @[NSLocalizedString(@"my_set_no_image_upload",nil),
+                          NSLocalizedString(@"my_set_no_video_upload",nil)];
+  
+    NSArray *imageStrArr = @[@"uploadFile_image",
+                             @"uploadFile_Video"
+                             ];
+    
+    CGFloat curButFullWidth = SCREEN_W/4.0;
+    
+    for (int i = 0; i< titleArr.count; i++) {
+
+        UIButton*curButton = [[UIButton alloc] init];
+        [curButton addTarget:self action:@selector(didClickButFun:) forControlEvents:UIControlEventTouchUpInside];
+        curButton.tag = 10+i;
+        [whiteBgView addSubview:curButton];
+
+        [curButton mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.width.mas_equalTo(curButFullWidth);
+            make.left.mas_equalTo(i*curButFullWidth);
+            make.height.mas_equalTo(80);
+            make.top.equalTo(titleLabel.mas_bottom).offset(20);
+        }];
+        
+        UIView *imageBgView = [[UIView alloc] init];
+        imageBgView.backgroundColor = [UIColor hwColor:@"#F5F7FA"];
+        imageBgView.layer.cornerRadius = 8;
+        imageBgView.layer.masksToBounds = YES;
+        [curButton addSubview:imageBgView];
+        
+        [imageBgView mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.width.mas_equalTo(64);
+            make.height.mas_equalTo(52);
+            make.centerX.equalTo(curButton.mas_centerX);
+            make.top.mas_equalTo(0);
+        }];
+        
+        UIImageView *leftImageV = [[UIImageView alloc] init];
+        leftImageV.image = [UIImage imageNamed:imageStrArr[i]];
+        [imageBgView addSubview:leftImageV];
+
+        [leftImageV mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.width.mas_equalTo(25);
+            make.height.mas_equalTo(25);
+            make.centerX.equalTo(imageBgView.mas_centerX);
+            make.centerY.equalTo(imageBgView.mas_centerY).offset(0);
+        }];
+
+        UILabel *leftLabel = [[UILabel alloc] init];
+        leftLabel.textColor = [UIColor hwColor:@"#0A132B"];
+        leftLabel.textAlignment = NSTextAlignmentCenter;
+        leftLabel.font = [UIFont systemFontOfSize:12.0];
+        leftLabel.text = titleArr[i];
+        [curButton addSubview:leftLabel];
+
+        [leftLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+            make.width.mas_equalTo(curButFullWidth);
+            make.height.mas_equalTo(25);
+            make.centerX.equalTo(curButton.mas_centerX);
+            make.top.equalTo(imageBgView.mas_bottom).offset(10);
+        }];
+    }
+    
+    
+    UIButton*cancelButton = [[UIButton alloc] init];
+    //[cancelButton setTitle:NSLocalizedString(@"other_cancel",nil) forState:UIControlStateNormal];
+    //[cancelButton setTitleColor:[UIColor hwColor:@"#0A132B"] forState:UIControlStateNormal];
+    [cancelButton addTarget:self action:@selector(didClickButFun:) forControlEvents:UIControlEventTouchUpInside];
+    //cancelButton.titleLabel.font = [UIFont boldSystemFontOfSize:14];
+    cancelButton.tag = 100;
+    [self addSubview:cancelButton];
+    
+    [cancelButton mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.equalTo(whiteBgView.mas_top).offset(0);
+        make.top.mas_equalTo(40);
+    }];
+//    
+//    UIView *lineView = [[UIView alloc] init];
+//    lineView.backgroundColor = [UIColor hwColor:@"#EAEAEA"];
+//    [whiteBgView addSubview:lineView];
+//    
+//    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
+//        make.left.mas_equalTo(25);
+//        make.right.mas_equalTo(-25);
+//        make.bottom.equalTo(cancelButton.mas_top).offset(-5);
+//        make.height.mas_equalTo(1);
+//    }];
+}
+
+- (void)didClickButFun:(UIButton*)but
+{
+    NSInteger tag = but.tag;
+    
+    if(tag == 100){
+        [self removeFromSuperview];
+    }
+    
+//    if(_didClickButtonFun){
+//        _didClickButtonFun(tag);
+//    }
+}
+
+@end
+

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

@@ -467,3 +467,5 @@
 "share_by_QQ"   = "QQ";
 "share_by_timeLine"   = "朋友圈";
 "share_by_secret"   = "私密分享";
+"uploadFile_title_left"   = "上传文件";
+"uploadFile_title_right"   = "本地文件将保存到【云机/外挂磁盘】";