Ver código fonte

1.相片选择页面UI

huangxiaodong 2 anos atrás
pai
commit
4567dd1d41

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

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

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


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


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

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

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


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


+ 92 - 1
创维盒子/双子星云手机/Class/Set/uploadFile/photoView/uploadFileBottomView.m

@@ -8,7 +8,9 @@
 #import "uploadFileBottomView.h"
 
 @interface uploadFileBottomView ()
-
+@property(nonatomic,strong)UILabel *selectNumLabel;
+@property(nonatomic,strong)UILabel *uploadFileRoutelabel;
+@property(nonatomic,strong)UIButton *uploadButon;
 @end
 
 @implementation uploadFileBottomView
@@ -24,6 +26,95 @@
 - (void)drawAnyView{
     [self setBackgroundColor:[UIColor whiteColor]];
     
+    _selectNumLabel = [[UILabel alloc] init];
+    _selectNumLabel.font = [UIFont boldSystemFontOfSize:16.0];
+    [self addSubview:_selectNumLabel];
+    
+    [_selectNumLabel mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(15);
+        make.top.mas_equalTo(10);
+        make.right.mas_equalTo(-110);
+        make.height.mas_equalTo(20);
+    }];
+    
+    NSString *curStr1 = [NSString stringWithFormat:@"%@",@"已选0项"];
+    NSString *curStr2 = [NSString stringWithFormat:@"%@",@"(0kb,可用120.00GB)"];
+    NSString *totalStr = [[NSString alloc] initWithFormat:@"%@ %@",curStr1,curStr2];
+    
+    NSMutableAttributedString *noteStr = [[NSMutableAttributedString alloc] initWithString:totalStr];
+    
+    NSRange redRange = NSMakeRange([totalStr rangeOfString:curStr2].location, [totalStr rangeOfString:curStr2].length);
+    [noteStr addAttribute:NSForegroundColorAttributeName value:[UIColor hwColor:@"#959799" alpha:1.0] range:redRange];
+    [noteStr addAttribute:NSFontAttributeName value:[UIFont systemFontOfSize:14.0] range:redRange];
+    // 设置行间距
+    NSMutableParagraphStyle *paragraphStyle = [[NSMutableParagraphStyle alloc] init];
+    [paragraphStyle setLineSpacing:5];        //设置行间距
+    
+    [noteStr addAttribute:NSParagraphStyleAttributeName value:paragraphStyle range:NSMakeRange(0, [totalStr  length])];
+
+    _selectNumLabel.attributedText = noteStr;
+
+    
+    _uploadFileRoutelabel = [[UILabel alloc] init];
+    _uploadFileRoutelabel.font = [UIFont systemFontOfSize:14.0];
+    _uploadFileRoutelabel.textColor = [UIColor hwColor:@"#959799" alpha:1.0];
+    _uploadFileRoutelabel.text = @"上传路径:xxxxxxxxxxxxxxx";
+    [self addSubview:_uploadFileRoutelabel];
+    
+    [_uploadFileRoutelabel mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(15);
+        make.top.mas_equalTo(_selectNumLabel.mas_bottom).offset(10);
+        make.right.mas_equalTo(-110);
+        make.height.mas_equalTo(20);
+    }];
+    
+    //图片上传
+    NSString* curImgUploadStr = [[NSString alloc] initWithFormat:@"%@ %@",@"  ",NSLocalizedString(@"my_set_no_File_upload",nil)];
+    
+    
+    // gradient
+    CAGradientLayer *gl_But = [CAGradientLayer layer];
+    gl_But.frame = CGRectMake(0,0,88.f,40.f);
+    gl_But.startPoint = CGPointMake(0, 0.5);
+    gl_But.endPoint = CGPointMake(1, 0.5);
+    gl_But.colors = @[(__bridge id)HW0CDEFDColor.CGColor, (__bridge id)HW058DFBColor.CGColor];
+    gl_But.locations = @[@(0), @(1.0f)];
+    gl_But.cornerRadius = 8;
+    
+    
+    UIButton *imageUploadBut = [[UIButton alloc] init];
+    
+    
+    [imageUploadBut setImage:[UIImage imageNamed:@"upload_file_white_100"] forState:UIControlStateNormal];
+    [imageUploadBut setTitle:curImgUploadStr forState:UIControlStateNormal];
+   
+    [imageUploadBut setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
+    imageUploadBut.titleLabel.font = [UIFont boldSystemFontOfSize:13.0];
+    imageUploadBut.tag = 2;
+    [imageUploadBut addTarget:self action:@selector(didClickButFun:) forControlEvents:UIControlEventTouchUpInside];
+    [self addSubview:imageUploadBut];
+    [imageUploadBut.layer insertSublayer:gl_But atIndex:0];
+    [imageUploadBut bringSubviewToFront:imageUploadBut.imageView];
+    
+    self.uploadButon = imageUploadBut;
+    
+    //imageUploadBut.backgroundColor = [UIColor redColor];
+    
+    [imageUploadBut mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.right.mas_equalTo(-15);
+        make.top.mas_equalTo(10);
+        make.width.mas_equalTo(88);
+        make.height.mas_equalTo(40);
+    }];
+    
+    imageUploadBut.enabled = NO;
+    //imageUploadBut.alpha = 0.5;
+}
+
+#pragma mark 按钮点击
+- (void)didClickButFun:(UIButton*)but
+{
+    
 }
 
 @end

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

@@ -11,6 +11,7 @@
 #import "AJPhotoListView.h"
 #import "AJPhotoGroupView.h"
 #import "AJPhotoListCell.h"
+#import "uploadFileBottomView.h"
 
 @interface uploadImageOrVideoViewController ()<AJPhotoGroupViewProtocol,UICollectionViewDataSource,UICollectionViewDelegate,UICollectionViewDelegateFlowLayout>
 
@@ -22,6 +23,7 @@
 @property (strong, nonatomic) AJPhotoListView *photoListView;
 @property (strong, nonatomic) NSMutableArray *assets;
 @property (strong, nonatomic) NSIndexPath *lastAccessed;
+@property (strong, nonatomic) uploadFileBottomView *uploadFileBottomV;
 
 //最多选择项
 @property (nonatomic, assign) NSInteger maximumNumberOfSelection;
@@ -68,6 +70,7 @@
     
     //列表view
     [self setupPhotoListView];
+    [self setupUploadFileBottomView];
     //相册分组
     [self setupGroupView];
 }
@@ -164,12 +167,29 @@
     [collectionView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(0);
         make.right.mas_equalTo(0);
-        make.bottom.mas_equalTo(0);
+        make.bottom.mas_equalTo(-(60 + safeArea));
         make.top.equalTo(self.navBarBGView.mas_bottom).offset(0.f);
     }];
 }
 
 /**
+ *  照片列表
+ */
+- (void)setupUploadFileBottomView
+{
+    uploadFileBottomView *bottomView = [[uploadFileBottomView alloc] init];
+    [self.view insertSubview:bottomView atIndex:0];
+    self.uploadFileBottomV = bottomView;
+    
+    [bottomView mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(0);
+        make.right.mas_equalTo(0);
+        make.bottom.mas_equalTo(0);
+        make.height.mas_equalTo(60 + safeArea);
+    }];
+}
+
+/**
  *  相册
  */
 - (void)setupGroupView {

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

@@ -256,3 +256,4 @@
 "my_set_no_File_upload_record"   = "上传记录";
 "my_set_no_image_upload"   = "上传图片";
 "my_set_no_video_upload"   = "上传视频";
+"my_set_no_File_upload"   = "上传";