Kaynağa Gözat

1.分享页面UI大概完成

huangxiaodong 1 yıl önce
ebeveyn
işleme
827d4915e7
14 değiştirilmiş dosya ile 302 ekleme ve 3 silme
  1. 22 0
      创维盒子/双子星云手机/Assets.xcassets/common/common_did_check_24.imageset/Contents.json
  2. BIN
      创维盒子/双子星云手机/Assets.xcassets/common/common_did_check_24.imageset/common_did_check_24@2x.png
  3. BIN
      创维盒子/双子星云手机/Assets.xcassets/common/common_did_check_24.imageset/common_did_check_24@3x.png
  4. 22 0
      创维盒子/双子星云手机/Assets.xcassets/common/common_no_data_pic.imageset/Contents.json
  5. BIN
      创维盒子/双子星云手机/Assets.xcassets/common/common_no_data_pic.imageset/common_no_data_pic@2x.png
  6. BIN
      创维盒子/双子星云手机/Assets.xcassets/common/common_no_data_pic.imageset/common_no_data_pic@3x.png
  7. 22 0
      创维盒子/双子星云手机/Assets.xcassets/common/common_un_check_24.imageset/Contents.json
  8. BIN
      创维盒子/双子星云手机/Assets.xcassets/common/common_un_check_24.imageset/common_un_check_24@2x.png
  9. BIN
      创维盒子/双子星云手机/Assets.xcassets/common/common_un_check_24.imageset/common_un_check_24@3x.png
  10. 195 1
      创维盒子/双子星云手机/Class/Set/previewFile/shareRecordViewController.m
  11. 1 1
      创维盒子/双子星云手机/Class/Set/previewFile/view/shareRecordTableViewCell.h
  12. 34 0
      创维盒子/双子星云手机/Class/Set/previewFile/view/shareRecordTableViewCell.m
  13. 1 1
      创维盒子/双子星云手机/Class/Set/view/mySetHeadView.m
  14. 5 0
      创维盒子/双子星云手机/zh-Hans.lproj/Localizable.strings

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

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

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


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


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

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

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


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


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

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

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


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


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

@@ -10,10 +10,18 @@
 
 @interface shareRecordViewController ()<UITableViewDelegate,UITableViewDataSource,DZNEmptyDataSetSource, DZNEmptyDataSetDelegate>
 {
+    BOOL isEditType;
 }
 
 @property (nonatomic, strong) UITableView *tableView;
+@property (nonatomic, strong) UIButton *ruleBottomButton;
 
+@property (nonatomic, strong) UIButton *delRuleButton;
+@property (nonatomic, strong) UIButton *cancelShareButton;
+
+@property (nonatomic, strong) UIButton *rightEditButton;
+@property (nonatomic, strong) UIButton *leftCancleButton;
+@property (nonatomic, strong) UIButton *rightSelectAllButton;
 @end
 
 @implementation shareRecordViewController
@@ -34,6 +42,8 @@
 
 - (void)drawAnyView{
         
+    [self initNavHeadUIFun];
+    
     [self.view addSubview:self.tableView];
     [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
         make.left.mas_equalTo(0);
@@ -41,6 +51,130 @@
         make.bottom.mas_equalTo(-(60 + safeArea));
         make.top.equalTo(self.navBarBGView.mas_bottom).offset(10.f);
     }];
+    
+    _ruleBottomButton = [[UIButton alloc] init];
+    [_ruleBottomButton setTitle:NSLocalizedString(@"share_rule_but_title",nil) forState:UIControlStateNormal];
+    [_ruleBottomButton setTitleColor:HW0A132BColor forState:UIControlStateNormal];
+    _ruleBottomButton.titleLabel.font = [UIFont boldSystemFontOfSize:14.0];
+    [_ruleBottomButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
+    _ruleBottomButton.tag = 1;
+    [self.view addSubview:_ruleBottomButton];
+    _ruleBottomButton.layer.cornerRadius = 8;
+    _ruleBottomButton.layer.masksToBounds = YES;
+    _ruleBottomButton.backgroundColor = [UIColor whiteColor];
+    
+    [_ruleBottomButton mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(15);
+        make.right.mas_equalTo(-15);
+        make.bottom.mas_equalTo(-(safeArea));
+        make.height.mas_equalTo(48);
+    }];
+    
+    
+    _delRuleButton = [[UIButton alloc] init];
+    [_delRuleButton setTitle:NSLocalizedString(@"share_del_record",nil) forState:UIControlStateNormal];
+    [_delRuleButton setTitleColor:HW0A132BColor forState:UIControlStateNormal];
+    _delRuleButton.titleLabel.font = [UIFont boldSystemFontOfSize:14.0];
+    [_delRuleButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
+    _delRuleButton.tag = 10;
+    [self.view addSubview:_delRuleButton];
+    _delRuleButton.layer.cornerRadius = 8;
+    _delRuleButton.layer.masksToBounds = YES;
+    _delRuleButton.backgroundColor = [UIColor hwColor:@"#E3E8F1"];
+    _delRuleButton.hidden = YES;
+    
+    [_delRuleButton mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.left.mas_equalTo(15);
+        make.right.equalTo(self.view.mas_centerX).offset(-10);
+        make.bottom.mas_equalTo(-(safeArea));
+        make.height.mas_equalTo(48);
+    }];
+    
+    
+    _cancelShareButton = [[UIButton alloc] init];
+    CGFloat w_btn = SCREEN_W/2.0 -15 -10;
+    
+    // gradient
+    CAGradientLayer *gl = [CAGradientLayer layer];
+    gl.frame = CGRectMake(0,0,w_btn,48.f);
+    gl.startPoint = CGPointMake(0, 0.5);
+    gl.endPoint = CGPointMake(1, 0.5);
+    gl.colors = @[(__bridge id)HW0CDEFDColor.CGColor, (__bridge id)HW058DFBColor.CGColor];
+    gl.locations = @[@(0), @(1.0f)];
+    
+    [_cancelShareButton.layer addSublayer:gl];
+    [_cancelShareButton setTitleColor:[UIColor whiteColor] forState:(UIControlStateNormal)];
+    [_cancelShareButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:(UIControlEventTouchUpInside)];
+    [_cancelShareButton setTitle:NSLocalizedString(@"cancel_share_title",nil) forState:(UIControlStateNormal)];
+    [_cancelShareButton.titleLabel setFont:[UIFont systemFontOfSize:14.f]];
+    [_cancelShareButton.layer setCornerRadius:8.f];
+    _cancelShareButton.clipsToBounds = YES;
+    _cancelShareButton.tag = 11;
+    
+    [self.view addSubview:_cancelShareButton];
+    _cancelShareButton.hidden = YES;
+
+    [_cancelShareButton mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.right.mas_equalTo(-15);
+        make.left.equalTo(self.view.mas_centerX).offset(10);
+        make.bottom.mas_equalTo(-(safeArea));
+        make.height.mas_equalTo(48);
+    }];
+    
+    
+   
+}
+
+- (void)initNavHeadUIFun
+{
+    _rightEditButton = [[UIButton alloc] init];
+    [_rightEditButton setTitle:NSLocalizedString(@"edit_common",nil) forState:UIControlStateNormal];
+    _rightEditButton.tag = 2;
+    [_rightEditButton setTitleColor:[UIColor hwColor:@"#01B7EA" alpha:1.0] forState:UIControlStateNormal];
+    _rightEditButton.titleLabel.font = [UIFont systemFontOfSize:16.0];
+    _rightEditButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentRight;
+    [_rightEditButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
+    [self.navBarBGView addSubview:_rightEditButton];
+    
+    [_rightEditButton mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.width.mas_equalTo(80);
+        make.height.mas_equalTo(40);
+        make.right.mas_equalTo(-15);
+        make.centerY.mas_equalTo(self.titleLabel.mas_centerY);
+    }];
+    
+    
+    _leftCancleButton = [[UIButton alloc] init];
+    [_leftCancleButton setTitleColor:[UIColor hwColor:@"#01B7EA" alpha:1.0] forState:UIControlStateNormal];
+    _leftCancleButton.titleLabel.font = [UIFont systemFontOfSize:18.0];
+    _leftCancleButton.contentHorizontalAlignment = UIControlContentHorizontalAlignmentLeft;
+    [_leftCancleButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
+    _leftCancleButton.tag = 3;
+    [_leftCancleButton setTitle:NSLocalizedString(@"other_cancel",nil) forState:UIControlStateNormal];
+    [self.navBarBGView addSubview:_leftCancleButton];
+    _leftCancleButton.hidden = YES;
+    
+    [_leftCancleButton mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.width.mas_equalTo(80);
+        make.left.mas_equalTo(15);
+        make.height.mas_equalTo(30);
+        make.centerY.mas_equalTo(self.titleLabel.mas_centerY);
+    }];
+    
+    _rightSelectAllButton = [[UIButton alloc] init];
+    [_rightSelectAllButton setImage:[UIImage imageNamed:@"edit_select_all_h"] forState:UIControlStateSelected];
+    [_rightSelectAllButton setImage:[UIImage imageNamed:@"edit_select_all_n"] forState:UIControlStateNormal];
+    [_rightSelectAllButton addTarget:self action:@selector(didClickButtonFun:) forControlEvents:UIControlEventTouchUpInside];
+    _rightSelectAllButton.tag = 4;
+    [self.navBarBGView addSubview:_rightSelectAllButton];
+    _rightSelectAllButton.hidden = YES;
+    
+    [_rightSelectAllButton mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.width.mas_equalTo(80);
+        make.right.mas_equalTo(0);
+        make.height.mas_equalTo(30);
+        make.centerY.mas_equalTo(self.titleLabel.mas_centerY);
+    }];
 }
 
 #pragma mark - 懒加载
@@ -95,6 +229,8 @@
         
     }
     
+    cell.isEditType = isEditType;
+    
 //    if(row < _curCouldPhoneFileListMod.data.list.count){
 //        couldPhoneFileModel* fileModel = _curCouldPhoneFileListMod.data.list[row];
 //        cell.curFileModel = fileModel;
@@ -113,6 +249,8 @@
     return 70;
 }
 
+
+
 #pragma mark 空数据
 - (UIImage *)imageForEmptyDataSet:(UIScrollView *)scrollView {
     
@@ -122,7 +260,7 @@
 }
 
 - (NSAttributedString *)titleForEmptyDataSet:(UIScrollView *)scrollView {
-    NSString *text = NSLocalizedString(@"File_download_file_no_data",nil);
+    NSString *text = NSLocalizedString(@"common_no_data_pic",nil);
     
     NSDictionary *attributes = @{NSFontAttributeName: [UIFont systemFontOfSize:16.0f],
                                  NSForegroundColorAttributeName: HW999999Color};
@@ -135,5 +273,61 @@
     return -150;
 }
 
+- (void)didClickButtonFun:(UIButton*)but
+{
+    NSInteger tag = but.tag;
+    
+    if(tag == 1){
+        [[iToast makeText:@"分享规则"] show];
+    }
+    else if(tag == 2){
+        [self setEditTypeFun];
+    }
+    else if(tag == 3){
+        [self cancelEditTypeFun];
+    }
+    else if(tag == 4){
+        but.selected = !but.selected;
+    }
+    
+}
+
+#pragma mark 进入编辑
+- (void)setEditTypeFun
+{
+    isEditType = YES;
+    _rightEditButton.hidden = YES;
+    _ruleBottomButton.hidden = YES;
+    self.backBtn.hidden = YES;
+    
+    _leftCancleButton.hidden = NO;
+    _rightSelectAllButton.hidden = NO;
+    
+    _delRuleButton.hidden = NO;
+    _delRuleButton.userInteractionEnabled = NO;
+//    [_delRuleButton setTitleColor:[UIColor hwColor:@"#0A132B" alpha:0.5] forState:UIControlStateNormal];
+//    _delRuleButton.backgroundColor = [UIColor hwColor:@"#E3E8F1" alpha:0.5];
+    _delRuleButton.alpha = 0.5;
+    
+    _cancelShareButton.hidden = NO;
+    _cancelShareButton.userInteractionEnabled = NO;
+    _cancelShareButton.alpha = 0.5;
+    
+    [self.tableView reloadData];
+}
 
+#pragma mark 取消编辑
+- (void)cancelEditTypeFun
+{
+    isEditType = NO;
+    _rightEditButton.hidden = NO;
+    _ruleBottomButton.hidden = NO;
+    self.backBtn.hidden = NO;
+    
+    _leftCancleButton.hidden = YES;
+    _rightSelectAllButton.hidden = YES;
+    _delRuleButton.hidden = YES;
+    _cancelShareButton.hidden = YES;
+    [self.tableView reloadData];
+}
 @end

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

@@ -10,7 +10,7 @@
 NS_ASSUME_NONNULL_BEGIN
 
 @interface shareRecordTableViewCell : UITableViewCell
-
+@property(nonatomic,assign) BOOL isEditType;
 @end
 
 NS_ASSUME_NONNULL_END

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

@@ -13,6 +13,7 @@
 @property(nonatomic,strong)UILabel *titleLabel;
 @property(nonatomic,strong)UILabel *titleLabel2;
 @property(nonatomic,strong)UIImageView *rightImage;
+@property (nonatomic, strong) UIButton *selectButton;
 @property(nonatomic,strong)UIImageView *lockImageView;
 @property(nonatomic,strong)UILabel *stateLabel;
 @end
@@ -64,6 +65,22 @@
         make.centerY.equalTo(self.mas_centerY);
     }];
     
+    UIButton *but = [[UIButton alloc] init];
+    [but setImage:[UIImage imageNamed:@"common_un_check_24"] forState:UIControlStateNormal];
+    [but setImage:[UIImage imageNamed:@"common_did_check_24"] forState:UIControlStateSelected];
+    [self.contentView addSubview:but];
+    [but addTarget:self action:@selector(didClickButFun:) forControlEvents:UIControlEventTouchUpInside];
+    but.hidden = YES;
+
+    [but mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.width.mas_equalTo(28);
+        make.right.mas_equalTo(-15.f);
+        make.height.mas_equalTo(28);
+        make.centerY.equalTo(self.mas_centerY);
+    }];
+    
+    self.selectButton = but;
+    
     _stateLabel = [[UILabel alloc] init];
     [self.contentView addSubview:_stateLabel];
     _stateLabel.textAlignment = NSTextAlignmentRight;
@@ -120,4 +137,21 @@
     
 }
 
+- (void)setIsEditType:(BOOL)isEditType
+{
+    if(isEditType){
+        _rightImage.hidden = YES;
+        _selectButton.hidden = NO;
+    }
+    else{
+        _rightImage.hidden = NO;
+        _selectButton.hidden = YES;
+    }
+}
+
+- (void)didClickButFun:(UIButton*)but
+{
+    but.selected = !but.selected;
+}
+
 @end

+ 1 - 1
创维盒子/双子星云手机/Class/Set/view/mySetHeadView.m

@@ -61,7 +61,7 @@
                           NSLocalizedString(@"my_set_no_video_upload",nil),
                           NSLocalizedString(@"my_set_no_music",nil),
                           NSLocalizedString(@"my_set_no_file",nil),
-                          NSLocalizedString(@"my_set_no_share",nil),
+                          NSLocalizedString(@"common_edit_share",nil),
                           NSLocalizedString(@"my_set_no_File_backups",nil),
                           NSLocalizedString(@"more_set",nil)];
     

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

@@ -469,3 +469,8 @@
 "share_by_secret"   = "私密分享";
 "uploadFile_title_left"   = "上传文件";
 "uploadFile_title_right"   = "本地文件将保存到【云机/外挂磁盘】";
+"share_rule_but_title"   = "了解更多分享规则";
+"edit_common"      = "编辑";
+"share_del_record"   = "删除记录";
+"cancel_share_title"   = "取消分享";
+"common_no_data_tip"   = "暂无数据";