Browse Source

1.首页头部视图

time 6 years ago
parent
commit
b33cc76cd3
57 changed files with 995 additions and 18 deletions
  1. 12 0
      UU_Ent/UU_Ent.xcodeproj/project.pbxproj
  2. 1 1
      UU_Ent/UU_Ent/Modules/Base/YRBaseNav.m
  3. 5 3
      UU_Ent/UU_Ent/Modules/Login/Main/Controllers/YRLoginVC.m
  4. 1 1
      UU_Ent/UU_Ent/Modules/Login/Main/Others/YRLoginManager.h
  5. 1 1
      UU_Ent/UU_Ent/Modules/Login/Main/Others/YRLoginManager.m
  6. 187 0
      UU_Ent/UU_Ent/Modules/Message/Main/Controllers/YRMsgVC.m
  7. 200 2
      UU_Ent/UU_Ent/Modules/Message/Main/Views/YRMsgHeader.m
  8. 3 3
      UU_Ent/UU_Ent/Modules/Work/Main/Controllers/YRWorkVC.m
  9. 23 0
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_SIGN IN-select.imageset/Contents.json
  10. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_SIGN IN-select.imageset/UU_MSG_SIGN IN-select@1x.png
  11. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_SIGN IN-select.imageset/UU_MSG_SIGN IN-select@2x.png
  12. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_SIGN IN-select.imageset/UU_MSG_SIGN IN-select@3x.png
  13. 23 0
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_SIGN IN.imageset/Contents.json
  14. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_SIGN IN.imageset/UU_MSG_SIGN IN@1x.png
  15. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_SIGN IN.imageset/UU_MSG_SIGN IN@2x.png
  16. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_SIGN IN.imageset/UU_MSG_SIGN IN@3x.png
  17. 23 0
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_YIYINGUAN.imageset/Contents.json
  18. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_YIYINGUAN.imageset/UU_MSG_YIYINGUAN@1x.png
  19. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_YIYINGUAN.imageset/UU_MSG_YIYINGUAN@2x.png
  20. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_YIYINGUAN.imageset/UU_MSG_YIYINGUAN@3x.png
  21. 23 0
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_YUYINKAI.imageset/Contents.json
  22. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_YUYINKAI.imageset/UU_MSG_YUYINKAI@1x.png
  23. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_YUYINKAI.imageset/UU_MSG_YUYINKAI@2x.png
  24. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_YUYINKAI.imageset/UU_MSG_YUYINKAI@3x.png
  25. 23 0
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_shang.imageset/Contents.json
  26. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_shang.imageset/UU_MSG_shang@1x.png
  27. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_shang.imageset/UU_MSG_shang@2x.png
  28. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_shang.imageset/UU_MSG_shang@3x.png
  29. 23 0
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_xia.imageset/Contents.json
  30. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_xia.imageset/UU_MSG_xia@1x.png
  31. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_xia.imageset/UU_MSG_xia@2x.png
  32. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_xia.imageset/UU_MSG_xia@3x.png
  33. 23 0
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_msgHeaderBackImg.imageset/Contents.json
  34. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_msgHeaderBackImg.imageset/UU_msgHeaderBackImg@1x.png
  35. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_msgHeaderBackImg.imageset/UU_msgHeaderBackImg@2x.png
  36. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_msgHeaderBackImg.imageset/UU_msgHeaderBackImg@3x.png
  37. 23 0
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_msg_快捷打卡.imageset/Contents.json
  38. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_msg_快捷打卡.imageset/UU_msg_快捷打卡@1x.png
  39. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_msg_快捷打卡.imageset/UU_msg_快捷打卡@2x.png
  40. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_msg_快捷打卡.imageset/UU_msg_快捷打卡@3x.png
  41. 23 0
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/导航栏/UU_newMsgNavBar.imageset/Contents.json
  42. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/导航栏/UU_newMsgNavBar.imageset/UU_newMsgNavBar@1x.png
  43. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/导航栏/UU_newMsgNavBar.imageset/UU_newMsgNavBar@2x.png
  44. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/导航栏/UU_newMsgNavBar.imageset/UU_newMsgNavBar@3x.png
  45. 23 0
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/导航栏/UU_newMsgNavBarX.imageset/Contents.json
  46. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/导航栏/UU_newMsgNavBarX.imageset/UU_newMsgNavBarX.png
  47. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/导航栏/UU_newMsgNavBarX.imageset/UU_newMsgNavBarX@2x.png
  48. BIN
      UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/导航栏/UU_newMsgNavBarX.imageset/UU_newMsgNavBarX@3x.png
  49. 2 0
      UU_Ent/UU_Ent/Supporting Files/defines/import.h
  50. 2 2
      UU_Ent/UU_Ent/Supporting Files/defines/macro.h
  51. 82 0
      UU_Ent/UU_Ent/Utils/UIButton/UIButton+Extersion.h
  52. 191 0
      UU_Ent/UU_Ent/Utils/UIButton/UIButton+Extersion.m
  53. 2 2
      UU_Ent/UU_Ent/Utils/UIButton/UIButton+Layout.h
  54. 2 2
      UU_Ent/UU_Ent/Utils/UIButton/UIButton+Layout.m
  55. 19 0
      UU_Ent/UU_Ent/Utils/UIButton/UIButton+block.h
  56. 54 0
      UU_Ent/UU_Ent/Utils/UIButton/UIButton+block.m
  57. 1 1
      UU_Ent/UU_Ent/Utils/UINavigation/YRShowMessageFromNavi.m

+ 12 - 0
UU_Ent/UU_Ent.xcodeproj/project.pbxproj

@@ -27,6 +27,8 @@
 		991C14742282D89C0080B54A /* RSA.m in Sources */ = {isa = PBXBuildFile; fileRef = 991C14702282D89C0080B54A /* RSA.m */; };
 		991C14752282D89C0080B54A /* priva.txt in Resources */ = {isa = PBXBuildFile; fileRef = 991C14722282D89C0080B54A /* priva.txt */; };
 		991C14762282D89C0080B54A /* publi.txt in Resources */ = {isa = PBXBuildFile; fileRef = 991C14732282D89C0080B54A /* publi.txt */; };
+		991C14792282EFFC0080B54A /* UIButton+Extersion.m in Sources */ = {isa = PBXBuildFile; fileRef = 991C14782282EFFC0080B54A /* UIButton+Extersion.m */; };
+		991C147C2282F0520080B54A /* UIButton+block.m in Sources */ = {isa = PBXBuildFile; fileRef = 991C147A2282F0510080B54A /* UIButton+block.m */; };
 		9948171422783494007C7CEA /* msg_route.json in Resources */ = {isa = PBXBuildFile; fileRef = 9948171322783494007C7CEA /* msg_route.json */; };
 		9948171722785013007C7CEA /* YRWorkTabCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9948171622785013007C7CEA /* YRWorkTabCell.m */; };
 		9948171A22785044007C7CEA /* YRWorkCollCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 9948171922785044007C7CEA /* YRWorkCollCell.m */; };
@@ -188,6 +190,10 @@
 		991C14712282D89C0080B54A /* RSA.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = RSA.h; sourceTree = "<group>"; };
 		991C14722282D89C0080B54A /* priva.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = priva.txt; sourceTree = "<group>"; };
 		991C14732282D89C0080B54A /* publi.txt */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = publi.txt; sourceTree = "<group>"; };
+		991C14772282EFFC0080B54A /* UIButton+Extersion.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIButton+Extersion.h"; sourceTree = "<group>"; };
+		991C14782282EFFC0080B54A /* UIButton+Extersion.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIButton+Extersion.m"; sourceTree = "<group>"; };
+		991C147A2282F0510080B54A /* UIButton+block.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = "UIButton+block.m"; sourceTree = "<group>"; };
+		991C147B2282F0510080B54A /* UIButton+block.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIButton+block.h"; sourceTree = "<group>"; };
 		994817112278281F007C7CEA /* macro.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = macro.h; sourceTree = "<group>"; };
 		994817122278290A007C7CEA /* import.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = import.h; sourceTree = "<group>"; };
 		9948171322783494007C7CEA /* msg_route.json */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.json; path = msg_route.json; sourceTree = "<group>"; };
@@ -371,6 +377,10 @@
 		27029BCD227709A700D53A94 /* UIButton */ = {
 			isa = PBXGroup;
 			children = (
+				991C147B2282F0510080B54A /* UIButton+block.h */,
+				991C147A2282F0510080B54A /* UIButton+block.m */,
+				991C14772282EFFC0080B54A /* UIButton+Extersion.h */,
+				991C14782282EFFC0080B54A /* UIButton+Extersion.m */,
 				27029BCF227709CC00D53A94 /* UIButton+Layout.h */,
 				27029BCE227709CC00D53A94 /* UIButton+Layout.m */,
 				27029BD12277E16300D53A94 /* YRButton.h */,
@@ -1477,6 +1487,7 @@
 				99C6FE99227690F800C7070A /* YRBaseNav.m in Sources */,
 				99C6FE96227690BE00C7070A /* YRBaseVC.m in Sources */,
 				2710E65522801B7E0002A4B0 /* YRRegisterVC.m in Sources */,
+				991C147C2282F0520080B54A /* UIButton+block.m in Sources */,
 				99C6FF172276D13500C7070A /* YRUserInfo.m in Sources */,
 				270E6C972282B72D008B12B9 /* YRSettingVC.m in Sources */,
 				99B4252F22815E2900DAE304 /* YRAlertView.m in Sources */,
@@ -1498,6 +1509,7 @@
 				999F651E227E6A6000329012 /* NSString+regular.m in Sources */,
 				99F4A7432277D332009AA6ED /* YRCountDownView.m in Sources */,
 				2710E65D22801E330002A4B0 /* LeftViewTF.m in Sources */,
+				991C14792282EFFC0080B54A /* UIButton+Extersion.m in Sources */,
 				99C6FEBA2276950C00C7070A /* YRMainVC.m in Sources */,
 				9948171A22785044007C7CEA /* YRWorkCollCell.m in Sources */,
 				27029BC72276A23400D53A94 /* YRLoginVC.m in Sources */,

+ 1 - 1
UU_Ent/UU_Ent/Modules/Base/YRBaseNav.m

@@ -24,7 +24,7 @@
 
 -(void)setNavigationBar{
     
-    self.navigationBar.tintColor = [UIColor orangeColor];
+    self.navigationBar.tintColor = [UIColor whiteColor];
     
 }
 

+ 5 - 3
UU_Ent/UU_Ent/Modules/Login/Main/Controllers/YRLoginVC.m

@@ -289,7 +289,9 @@
     [_phoneTF setValue:HexColor(@"#FFFFFF") forKeyPath:@"_placeholderLabel.textColor"];
     [firstView addSubview:_phoneTF];
     [_phoneTF addTarget:self action:@selector(passConTextChange:) forControlEvents:UIControlEventEditingChanged];
-    _phoneTF.text = u_account;
+    _phoneTF.text = [NSString encodeSeciWithStr:FORMAT(@"%@",[[NSUserDefaults standardUserDefaults] objectForKey:@"userAccount"])];
+    
+    
     
     _passwordTF = [[UITextField alloc] initWithFrame:CGRectMake(CGRectGetMaxX(password.frame)+14, 0, self_width-90, 50)];
     _passwordTF.delegate = self;
@@ -309,7 +311,7 @@
     [_passwordTF setValue:HexColor(@"#FFFFFF") forKeyPath:@"_placeholderLabel.textColor"];
     [secondView addSubview:_passwordTF];
     [_passwordTF addTarget:self action:@selector(pwdTextChanged:) forControlEvents:UIControlEventAllEditingEvents|UIControlEventValueChanged];
-    _passwordTF.text = u_password;
+    _passwordTF.text = [NSString encodeSeciWithStr:FORMAT(@"%@",[[NSUserDefaults standardUserDefaults] objectForKey:@"userPassword"])];
     
     self.loginBtn = [[YRButton alloc]initWithTitle:@"登录" titleColor:nil titleFont:18 buttonNormalColor:nil buttonSelectColor:nil buttonDiabledColor:nil];
     self.loginBtn.frame = CGRectMake(20, CGRectGetMaxY(secondView.frame)+25, self_width-40, 40);
@@ -318,7 +320,7 @@
     
     YRButton *registerBtn = [[YRButton alloc]initWithTitle:@"新用户注册" titleColor:HexColor(@"#AADAFB") titleFont:12 buttonNormalColor:[UIColor clearColor] buttonSelectColor:[UIColor clearColor] buttonDiabledColor:[UIColor clearColor]];
     [registerBtn setContentHorizontalAlignment:UIControlContentHorizontalAlignmentRight];
-    registerBtn.frame = CGRectMake(kWidth-120, CGRectGetMaxY(self.loginBtn.frame)+10, 100, 20);
+    registerBtn.frame = CGRectMake(SCREEN_WIDTH-120, CGRectGetMaxY(self.loginBtn.frame)+10, 100, 20);
     [self.scrollView addSubview:registerBtn];
     [registerBtn addTarget:self action:@selector(registerAction) forControlEvents:UIControlEventTouchUpInside];
     

+ 1 - 1
UU_Ent/UU_Ent/Modules/Login/Main/Others/YRLoginManager.h

@@ -8,7 +8,7 @@
 
 #import <Foundation/Foundation.h>
 #import <UU_Ent/Account.pbrpc.h>
-
+#import "NSString+secri.h"
 NS_ASSUME_NONNULL_BEGIN
 
 @interface YRLoginManager : NSObject

+ 1 - 1
UU_Ent/UU_Ent/Modules/Login/Main/Others/YRLoginManager.m

@@ -8,7 +8,7 @@
 
 #import "YRLoginManager.h"
 #import "YRUserInfo.h"
-#import "NSString+secri.h"
+
 @implementation YRLoginManager
 
 +(void)autoLoginsuccess:(void(^)(void))success failure:(void(^)(NSString *errorStr))failure{

+ 187 - 0
UU_Ent/UU_Ent/Modules/Message/Main/Controllers/YRMsgVC.m

@@ -13,12 +13,29 @@
 #import "YRMsgMainCell.h"
 #import "YRWebVC.h"
 #import "YRTabBar.h"
+#import "YRMsgHeader.h"
 @interface YRMsgVC ()<UITableViewDelegate,UITableViewDataSource>
 
 @property(strong,nonatomic)YRTableView *tableView;
 
 @property(strong,nonatomic)NSMutableArray *dataArr;
 
+
+/**
+ 头部视图
+ */
+@property(strong,nonatomic)YRMsgHeader *headerView;
+
+/**
+ 右边按钮
+ */
+@property(strong,nonatomic)UIButton *rigBtn;
+
+/**
+ 头部视图是否展开
+ */
+@property(assign,nonatomic)BOOL isSpread;
+
 @end
 
 @implementation YRMsgVC
@@ -35,11 +52,16 @@
     
     [self loadData];
     
+    [self setNavigationBarBackgroundImageWithAppear:YES];
+    
 }
 
 -(void)setUpUI{
     
     self.title = @"消息";
+    
+    [self setNavigationBar];
+    
     [self.view addSubview:self.tableView];
     [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
        
@@ -48,6 +70,116 @@
     }];
     
     
+    [self setUpHeaderView];
+}
+
+-(void)setUpHeaderView{
+    
+    self.headerView = [[YRMsgHeader alloc]initWithFrame:CGRectMake(0, -121, self_width, 121)];
+    
+    self.tableView.estimatedRowHeight = 0;
+    
+    [self.tableView insertSubview:self.headerView atIndex:1];
+    
+    self.headerView.hidden = YES;
+    
+}
+
+-(void)setNavigationBarBackgroundImageWithAppear:(BOOL)appear{
+    
+    if (appear) {
+        
+        [self.navigationController.navigationBar setBackgroundImage:nil forBarMetrics:UIBarMetricsDefault];
+        
+        if(statusXLately){
+            
+            [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"UU_newMsgNavBarX"]  forBarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault];
+            
+        }else{
+            
+            [self.navigationController.navigationBar setBackgroundImage:[UIImage imageNamed:@"UU_newMsgNavBar"]  forBarPosition:UIBarPositionAny barMetrics:UIBarMetricsDefault];
+            
+        }
+        
+        [self.navigationController.navigationBar setShadowImage:[UIImage new]];
+        
+    }
+    
+    
+}
+
+-(void)setNavigationBar{
+    
+    [self.navigationController.navigationBar setTitleTextAttributes:@{NSForegroundColorAttributeName : [UIColor whiteColor],NSFontAttributeName:[UIFont boldSystemFontOfSize:17.0]}];
+    
+    UIButton *btn = [UIButton buttonWithType:UIButtonTypeSystem];
+    btn.frame = CGRectMake(0, 5, 22, 22);
+    CGFloat imageY = 0;
+    if ([[[UIDevice currentDevice] systemVersion] floatValue] >= 11.0) {
+        imageY = 5;
+    }
+    [btn setImage:[UIImage imageNamed:@"UU_msg_快捷打卡"] forState:UIControlStateNormal];
+    self.rigBtn = btn;
+    btn.tintColor = [UIColor whiteColor];
+    [btn addTarget:self action:@selector(spreadOutHeaderOrNot:) forControlEvents:UIControlEventTouchUpInside];
+    
+    UIBarButtonItem *barButton = [[UIBarButtonItem alloc]initWithCustomView:btn];
+   
+    barButton.tintColor = [UIColor whiteColor];
+    
+    self.navigationItem.rightBarButtonItems = @[barButton];
+    
+}
+
+/**
+ 是否展开头部视图
+ */
+-(void)spreadOutHeaderOrNot:(UIButton *)button{
+    
+    button.userInteractionEnabled  = NO;
+    
+    if (!self.isSpread) {//缩起状态
+        
+        self.headerView.hidden = NO;
+        
+        [UIView animateWithDuration:1 animations:^{
+            
+            [self.tableView setContentOffset:CGPointMake(0, -121)];
+            
+        } completion:^(BOOL finished) {
+            
+            self.tableView.contentInset = UIEdgeInsetsMake(121, 0, 0,0);
+            
+            self.isSpread = !self.isSpread;
+            
+            button.userInteractionEnabled = YES;
+            
+        }];
+        
+        
+    }else{//展开状态
+        
+        [UIView animateWithDuration:1 animations:^{
+            
+            [self.tableView setContentOffset:CGPointMake(0, 0)];
+            
+        } completion:^(BOOL finished) {
+            
+            
+            self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 0,0);
+            
+            self.headerView.hidden = YES;
+            
+            self.isSpread = !self.isSpread;
+            
+            button.userInteractionEnabled = YES;
+            
+            
+        }];
+        
+    }
+    
+    
     
 }
 
@@ -267,6 +399,61 @@
     
 }
 
+#pragma mark - 滑动
+-(void)scrollViewDidScroll:(UIScrollView *)scrollView{
+    //正在操作中不允许点击
+    if(!self.rigBtn.userInteractionEnabled){
+        
+        return;
+        
+    }
+    //展开状态
+    if (self.isSpread) {
+        
+        if(scrollView.contentOffset.y < -121){
+            
+            
+            [scrollView setContentOffset:CGPointMake(0, -121)];
+            
+            return;
+            
+        }
+        
+        
+        //当滑动距离上面小于70时
+        if (scrollView.contentOffset.y > -70)
+        {
+            
+            self.rigBtn.userInteractionEnabled = NO;
+    
+            scrollView.userInteractionEnabled = NO;
+            
+            self.isSpread = NO;
+            
+            [UIView animateWithDuration:0.6 animations:^{
+                
+                self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 0, 0);
+                
+            } completion:^(BOOL finished) {
+                
+                [self.tableView setContentOffset:CGPointMake(0, 0)];
+                
+                scrollView.userInteractionEnabled = YES;
+                self.headerView.hidden = YES;
+                self.rigBtn.userInteractionEnabled = YES;
+                
+                
+                
+            }];
+            
+            
+            
+        }
+        
+    }
+    
+}
+
 #pragma mark - 计数
 
 -(void)calculteRemindCount{

+ 200 - 2
UU_Ent/UU_Ent/Modules/Message/Main/Views/YRMsgHeader.m

@@ -8,23 +8,221 @@
 
 #import "YRMsgHeader.h"
 
+@interface YRMsgHeader()
+
+/**
+ 上班图片
+ */
+@property (strong,nonatomic)UIImageView *goWorkImg;
+
+/**
+ 下班图片
+ */
+@property (strong,nonatomic)UIImageView *outWorkImg;
+/**
+ 上班
+ */
+@property (strong,nonatomic)UILabel *startlabel;
+
+/**
+ 下班
+ */
+@property (strong,nonatomic)UILabel *endlabel;
+
+/**
+ 打卡按钮
+ */
+@property (strong,nonatomic)UIButton *signInBtn;
+
+/**
+ 语音
+ */
+@property (strong , nonatomic)UIButton *voiceBtn;
+
+@end
+
 @implementation YRMsgHeader
 
-- (instancetype)init
+- (instancetype)initWithFrame:(CGRect)frame
 {
-    self = [super init];
+    self = [super initWithFrame:frame];
+    
     if (self) {
         
         [self setUpUI];
         
     }
+    
     return self;
 }
 
 -(void)setUpUI{
     
+    //背景图
+    UIImageView *mge = [[UIImageView alloc] init];
+    [self addSubview:mge];
+    mge.image = [UIImage imageNamed:@"UU_msgHeaderBackImg"];
+    [mge mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.edges.equalTo(self);
+    }];
+    
+    [self addSubview:self.signInBtn];
+    
+    [self.signInBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.centerX.equalTo(self);
+        make.centerY.equalTo(self).offset(-10);
+        make.width.height.mas_equalTo(70);
+    }];
+    
+    [self addSubview:self.goWorkImg];
+    
+    [self.goWorkImg mas_makeConstraints:^(MASConstraintMaker *make) {
+        
+        make.left.equalTo(self).offset(40);
+        make.centerY.equalTo(self.signInBtn);
+        make.width.height.mas_equalTo(15);
+        
+    }];
+    
+    [self addSubview:self.startlabel];
+    
+    [self.startlabel mas_makeConstraints:^(MASConstraintMaker *make) {
+        
+        make.left.equalTo(self.goWorkImg.mas_right).offset(5);
+        make.right.equalTo(self.signInBtn.mas_left);
+        make.centerY.equalTo(self.signInBtn);
+        make.height.greaterThanOrEqualTo(@15);
+    }];
+    
+    [self addSubview:self.outWorkImg];
+    
+    [self.outWorkImg mas_makeConstraints:^(MASConstraintMaker *make) {
+        
+        make.left.equalTo(self.signInBtn.mas_right).offset(20);
+        make.centerY.equalTo(self.signInBtn);
+        make.width.height.mas_equalTo(15);
+        
+    }];
+    
+    [self addSubview:self.endlabel];
+    
+    [self.endlabel mas_makeConstraints:^(MASConstraintMaker *make) {
+        
+        make.left.equalTo(self.outWorkImg.mas_right).offset(5);
+        make.centerY.equalTo(self.signInBtn);
+        make.right.equalTo(self);
+        make.height.greaterThanOrEqualTo(@15);
+        
+    }];
     
+    [self addSubview:self.voiceBtn];
+    [self.voiceBtn mas_makeConstraints:^(MASConstraintMaker *make) {
+        make.right.bottom.equalTo(self).offset(-20);
+        make.width.height.mas_equalTo(20);
+    }];
+    
+}
+
+
+#pragma mark - lazy
+
+-(UIButton *)signInBtn{
+    
+    if (!_signInBtn) {
+        
+        @weakify(self)
+        _signInBtn = [UIButton blockSetWithImgName:@"UU_MSG_SIGN IN-select" selImgName:@"UU_MSG_SIGN IN" block:^(UIButton *button) {
+           @strongify(self)
+            
+            button.transform = CGAffineTransformIdentity;
+            [UIView animateKeyframesWithDuration:1 delay:0 options:0 animations: ^{
+                [UIView addKeyframeWithRelativeStartTime:0 relativeDuration:1 / 3.0 animations: ^{
+                    
+                    button.transform = CGAffineTransformMakeScale(1.5, 1.5);
+                }];
+                [UIView addKeyframeWithRelativeStartTime:1/3.0 relativeDuration:1/3.0 animations: ^{
+                    
+                    button.transform = CGAffineTransformMakeScale(0.8, 0.8);
+                }];
+                [UIView addKeyframeWithRelativeStartTime:2/3.0 relativeDuration:1/3.0 animations: ^{
+                    
+                    button.transform = CGAffineTransformMakeScale(1.0, 1.0);
+                }];
+            } completion:nil];
+            
+        }];
+        
+    }
+    return _signInBtn;
+    
+}
+
+-(UIImageView *)goWorkImg{
+    
+    if (!_goWorkImg) {
+        
+        _goWorkImg  = [[UIImageView alloc]init];
+        _goWorkImg.image = [UIImage imageNamed:@"UU_MSG_shang"];
+        
+    }
+    
+    return _goWorkImg;
+}
+
+-(UIImageView *)outWorkImg{
+    
+    if (!_outWorkImg) {
+        
+        _outWorkImg  = [[UIImageView alloc]init];
+        _outWorkImg.image = [UIImage imageNamed:@"UU_MSG_xia"];
+        
+    }
+    
+    return _outWorkImg;
+}
+
+-(UILabel *)startlabel{
+    
+    if (!_startlabel) {
+        
+        _startlabel = [[UILabel alloc] init];
+        _startlabel.text = @"8:00";
+        _startlabel.font = FONT_SIZE(14);
+        _startlabel.textColor = [UIColor whiteColor];
+        
+    }
+    
+    return _startlabel;
+}
+
+-(UILabel *)endlabel{
+    
+    if (!_endlabel) {
+        
+        _endlabel = [[UILabel alloc] init];
+        _endlabel.text = @"18:00";
+        _endlabel.font = FONT_SIZE(14);
+        _endlabel.textColor = [UIColor whiteColor];
+        
+    }
+    
+    return _endlabel;
+}
+
+-(UIButton *)voiceBtn{
+    
+    if (!_voiceBtn) {
+        
+        @weakify(self)
+        _voiceBtn  = [UIButton blockSetWithImgName:@"UU_MSG_YUYINKAI" selImgName:@"UU_MSG_YIYINGUAN" block:^(UIButton *button) {
+           @strongify(self)
+            button.selected = !button.selected;
+            
+        }];
+        
+    }
     
+    return _voiceBtn;
 }
 
 @end

+ 3 - 3
UU_Ent/UU_Ent/Modules/Work/Main/Controllers/YRWorkVC.m

@@ -37,14 +37,14 @@
     
     self.navigationController.navigationBar.hidden = YES;
    
-    UIImageView *topView = [[UIImageView alloc]initWithFrame:CGRectMake(0,0, kWidth, 94)];
+    UIImageView *topView = [[UIImageView alloc]initWithFrame:CGRectMake(0,0, SCREEN_WIDTH, 94)];
     topView.image = [UIImage imageNamed:@"UU_newNavbg3"];
     topView.backgroundColor = RGB(48, 92, 131, 1);
     topView.userInteractionEnabled = YES;
     
     self.topView = topView;
     
-    UILabel *titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 14, kWidth , 64+10)];
+    UILabel *titleLabel = [[UILabel alloc]initWithFrame:CGRectMake(10, 14, SCREEN_WIDTH , 64+10)];
     
     self.titleLabel = titleLabel;
     
@@ -89,7 +89,7 @@
      self.view.backgroundColor = RGB(219, 227, 232, 1);
     
     [self.view addSubview:self.tableView];
-    self.tableView.frame = CGRectMake(10, 74, self.view.frame.size.width-20, kHeight - 108);
+    self.tableView.frame = CGRectMake(10, 74, self.view.frame.size.width-20, SCREEN_WIDTH - 108);
     
     UIView *footerView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, self.view.width, 70)];
     

+ 23 - 0
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_SIGN IN-select.imageset/Contents.json

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

BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_SIGN IN-select.imageset/UU_MSG_SIGN IN-select@1x.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_SIGN IN-select.imageset/UU_MSG_SIGN IN-select@2x.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_SIGN IN-select.imageset/UU_MSG_SIGN IN-select@3x.png


+ 23 - 0
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_SIGN IN.imageset/Contents.json

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

BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_SIGN IN.imageset/UU_MSG_SIGN IN@1x.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_SIGN IN.imageset/UU_MSG_SIGN IN@2x.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_SIGN IN.imageset/UU_MSG_SIGN IN@3x.png


+ 23 - 0
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_YIYINGUAN.imageset/Contents.json

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

BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_YIYINGUAN.imageset/UU_MSG_YIYINGUAN@1x.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_YIYINGUAN.imageset/UU_MSG_YIYINGUAN@2x.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_YIYINGUAN.imageset/UU_MSG_YIYINGUAN@3x.png


+ 23 - 0
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_YUYINKAI.imageset/Contents.json

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

BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_YUYINKAI.imageset/UU_MSG_YUYINKAI@1x.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_YUYINKAI.imageset/UU_MSG_YUYINKAI@2x.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_YUYINKAI.imageset/UU_MSG_YUYINKAI@3x.png


+ 23 - 0
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_shang.imageset/Contents.json

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

BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_shang.imageset/UU_MSG_shang@1x.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_shang.imageset/UU_MSG_shang@2x.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_shang.imageset/UU_MSG_shang@3x.png


+ 23 - 0
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_xia.imageset/Contents.json

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

BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_xia.imageset/UU_MSG_xia@1x.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_xia.imageset/UU_MSG_xia@2x.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_MSG_xia.imageset/UU_MSG_xia@3x.png


+ 23 - 0
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_msgHeaderBackImg.imageset/Contents.json

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

BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_msgHeaderBackImg.imageset/UU_msgHeaderBackImg@1x.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_msgHeaderBackImg.imageset/UU_msgHeaderBackImg@2x.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_msgHeaderBackImg.imageset/UU_msgHeaderBackImg@3x.png


+ 23 - 0
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_msg_快捷打卡.imageset/Contents.json

@@ -0,0 +1,23 @@
+{
+  "images" : [
+    {
+      "idiom" : "universal",
+      "filename" : "UU_msg_快捷打卡@1x.png",
+      "scale" : "1x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "UU_msg_快捷打卡@2x.png",
+      "scale" : "2x"
+    },
+    {
+      "idiom" : "universal",
+      "filename" : "UU_msg_快捷打卡@3x.png",
+      "scale" : "3x"
+    }
+  ],
+  "info" : {
+    "version" : 1,
+    "author" : "xcode"
+  }
+}

BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_msg_快捷打卡.imageset/UU_msg_快捷打卡@1x.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_msg_快捷打卡.imageset/UU_msg_快捷打卡@2x.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/Msg/首页/UU_msg_快捷打卡.imageset/UU_msg_快捷打卡@3x.png


+ 23 - 0
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/导航栏/UU_newMsgNavBar.imageset/Contents.json

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

BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/导航栏/UU_newMsgNavBar.imageset/UU_newMsgNavBar@1x.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/导航栏/UU_newMsgNavBar.imageset/UU_newMsgNavBar@2x.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/导航栏/UU_newMsgNavBar.imageset/UU_newMsgNavBar@3x.png


+ 23 - 0
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/导航栏/UU_newMsgNavBarX.imageset/Contents.json

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

BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/导航栏/UU_newMsgNavBarX.imageset/UU_newMsgNavBarX.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/导航栏/UU_newMsgNavBarX.imageset/UU_newMsgNavBarX@2x.png


BIN
UU_Ent/UU_Ent/Supporting Files/Assets.xcassets/Resources/导航栏/UU_newMsgNavBarX.imageset/UU_newMsgNavBarX@3x.png


+ 2 - 0
UU_Ent/UU_Ent/Supporting Files/defines/import.h

@@ -30,6 +30,8 @@
 #import "YRBaseNav.h"
 #import "UIPopoverListView.h"
 #import "YRAlertView.h"
+#import "UIButton+block.h"
+#import "UIButton+Extersion.h"
 
 //第三方导入
 #import <GRPCClient/GRPCCall+Tests.h>

+ 2 - 2
UU_Ent/UU_Ent/Supporting Files/defines/macro.h

@@ -28,8 +28,8 @@
 #define self_width self.view.frame.size.width
 #define self_height self.view.frame.size.height
 //屏幕的宽高度
-#define kWidth [UIScreen mainScreen].bounds.size.width
-#define kHeight [UIScreen mainScreen].bounds.size.height
+#define SCREEN_WIDTH [UIScreen mainScreen].bounds.size.width
+#define SCREEN_HEIGHT [UIScreen mainScreen].bounds.size.height
 //颜色
 #define HexColor(h) [UIColor colorWithHexString:(h)]
 #define RGB(r, g, b, A) [UIColor colorWithRed:((r) / 255.0) green:((g) / 255.0) blue:((b) / 255.0) alpha:(A)]

+ 82 - 0
UU_Ent/UU_Ent/Utils/UIButton/UIButton+Extersion.h

@@ -0,0 +1,82 @@
+//
+//  UIButton+Extersion.h
+//  shiku_im
+//
+//  Created by huangyp-pc on 2018/01/23.
+//
+
+#import <UIKit/UIKit.h>
+
+@interface UIButton (Extersion)
+
+/**
+ 确定按钮
+
+ */
++(UIButton *)sureButtonWithTitle:(NSString *)title;
+
+/// 图片接文字 -- 富文本
+///
+/// @param string    文字
+/// @param imageName 图片名
+- (instancetype)initWithAttributeString:(NSString *)string
+                           andImageName:(NSString *)imageName;
+
+
+/// 图片接文字+换行文字 -- 富文本
+///
+/// @param string      图片后的文字
+/// @param levelString 换行后的文字
+/// @param imageName   图片名字
+- (instancetype)initWithLevelAttributeString:(NSString *)string
+                                 levelString:(NSString *)levelString
+                                   imageName:(NSString *)imageName;
+
+/// 商品收藏类:数字+文字 -- 富文本
+///
+/// @param string     数字
+/// @param nameString 文字描述
+/// @param textColor  文字颜色
+- (instancetype)initWithAttributeString:(NSString *)string
+                          andNameString:(NSString *)nameString
+                           andTextColor:(UIColor *)textColor;
+
+/// 图片换行文字
+///
+/// @param imageName 图片名
+/// @param string    文字
+/// @param textColor 文字颜色
+- (instancetype)initWithImageName:(NSString *)imageName andString:(NSString *)string textColor:(UIColor *)textColor;
+
+
+/// 图片换行文字(图片原始大小)
+///
+/// @param imageName 图片名
+/// @param string    文字
+/// @param textColor 文字颜色
+- (instancetype)initWithOriginalImage:(NSString *)imageName andString:(NSString *)string textColor:(UIColor *)textColor;
+
+/// 按钮的初始化方法
+///
+/// @param text  按钮文字
+/// @param size  文字大小
+/// @param color 文字颜色
+/// @param state 按钮状态
+- (instancetype)initWithText:(NSString *)text
+                    fontSize:(CGFloat)size
+                   textColor:(UIColor *)color
+                    forState:(UIControlState)state;
+
+
+/// 图片换行文字(对象方法)
+///
+/// @param imageName 图片名
+/// @param string    文字
+/// @param textColor 文字颜色
+- (void)setImageName:(NSString *)imageName
+           andString:(NSString *)string
+           textColor:(UIColor *)textColor;
+
++ (UIButton *)ggButtonWithText:(NSString *)title fontSize:(CGFloat)size normalColor:(UIColor *)normalColor selectedColor:(UIColor *)selectedColor;
+
+@end

+ 191 - 0
UU_Ent/UU_Ent/Utils/UIButton/UIButton+Extersion.m

@@ -0,0 +1,191 @@
+//
+//  UIButton+Extersion.m
+//  shiku_im
+//
+//  Created by huangyp-pc on 2018/01/23.
+//
+
+#import "UIButton+Extersion.h"
+
+@implementation UIButton (Extersion)
+
++(UIButton *)sureButtonWithTitle:(NSString *)title{
+    
+    UIButton *button = [UIButton new];
+    
+    [button setTitle:title forState:UIControlStateNormal];
+    [button setTitle:title forState:UIControlStateHighlighted];
+    [button setTitleColor:HexColor(@"#FFFFFF") forState:UIControlStateNormal];
+    [button setTitleColor:HexColor(@"#FFFFFF") forState:UIControlStateHighlighted];
+    button.titleLabel.font = FONT_SIZE(18);
+    
+    [button setBackgroundImage:[UIImage imageWithColor:HexColor(@"#8EB2CD")] forState:UIControlStateDisabled];
+    [button setBackgroundImage:[UIImage imageWithColor:HexColor(@"#2D84C0")] forState:UIControlStateHighlighted];
+    [button setBackgroundImage:[UIImage imageWithColor:HexColor(@"#33A2EE")] forState:UIControlStateNormal];
+    
+    button.layer.cornerRadius = 5;
+    button.layer.masksToBounds = YES;
+    
+    return button;
+    
+}
+
+- (instancetype)initWithText:(NSString *)text fontSize:(CGFloat)size textColor:(UIColor *)color forState:(UIControlState)state
+{
+    self = [super init];
+    if (self) {
+        [self setTitle:text forState:state];
+        [self setTitleColor:color forState:state];
+        self.titleLabel.font = FONT_SIZE(size);
+    }
+    return self;
+}
+
+- (instancetype)initWithAttributeString:(NSString *)string andImageName:(NSString *)imageName
+{
+    self = [super init];
+    if (self) {
+        NSMutableAttributedString *attributeString = [[NSMutableAttributedString alloc] init];
+        NSTextAttachment *attach = [[NSTextAttachment alloc] init];
+        attach.image = [UIImage imageNamed:imageName];
+        attach.bounds = CGRectMake(0, -7, 25, 25);
+        NSAttributedString *attributeStr = [NSAttributedString attributedStringWithAttachment:attach];
+        [attributeString appendAttributedString:attributeStr];
+        NSAttributedString *titleString = [[NSAttributedString alloc] initWithString:string attributes:@{NSFontAttributeName:FONT_SIZE(14),NSForegroundColorAttributeName:[UIColor whiteColor]}];
+        [attributeString appendAttributedString:titleString];
+        [self setAttributedTitle:attributeString forState:UIControlStateNormal];
+    }
+    return self;
+}
+
+- (instancetype)initWithLevelAttributeString:(NSString *)string levelString:(NSString *)levelString imageName:(NSString *)imageName
+{
+    self = [super init];
+    if (self) {
+        self.titleLabel.numberOfLines = 3;
+        self.titleLabel.textAlignment = NSTextAlignmentCenter;
+        NSMutableAttributedString *attributeString = [[NSMutableAttributedString alloc] init];
+        NSTextAttachment *attach = [[NSTextAttachment alloc] init];
+        attach.image = [UIImage imageNamed:imageName];
+        attach.bounds = CGRectMake(0, -8, 25, 25);
+        NSAttributedString *attributeStr = [NSAttributedString attributedStringWithAttachment:attach];
+        [attributeString appendAttributedString:attributeStr];
+        
+        NSAttributedString *titleString = [[NSAttributedString alloc] initWithString:string attributes:@{NSFontAttributeName:FONT_SIZE(15),NSForegroundColorAttributeName:RGB(235, 129, 16, 1.0)}];
+        [attributeString appendAttributedString:titleString];
+        
+        NSAttributedString *spaceString = [[NSAttributedString alloc] initWithString:@" \n" attributes:@{NSFontAttributeName:FONT_SIZE(8)}];
+        [attributeString appendAttributedString:spaceString];
+        
+        NSAttributedString *string = [[NSAttributedString alloc] initWithString:levelString attributes:@{NSFontAttributeName:FONT_SIZE(15),NSForegroundColorAttributeName:RGB(235, 129, 16, 1.0)}];
+        [attributeString appendAttributedString:string];
+        
+        [self setAttributedTitle:attributeString forState:UIControlStateNormal];
+    }
+    return self;
+}
+
+- (instancetype)initWithAttributeString:(NSString *)string andNameString:(NSString *)nameString andTextColor:(UIColor *)textColor
+{
+    self = [super init];
+    if (self) {
+        if (string && nameString) { // 只有当参数都有值的时候才创建富文本
+            self.titleLabel.numberOfLines = 2;
+            self.titleLabel.textAlignment = NSTextAlignmentCenter;
+            NSMutableAttributedString *attributeString = [[NSMutableAttributedString alloc] init];
+            
+            NSAttributedString *titleString = [[NSAttributedString alloc] initWithString:string attributes:@{NSFontAttributeName:FONT_SIZE(18),NSForegroundColorAttributeName:textColor}];
+            [attributeString appendAttributedString:titleString];
+            
+            NSAttributedString *spaceString = [[NSAttributedString alloc] initWithString:@"\n" attributes:@{NSFontAttributeName:FONT_SIZE(16)}];
+            [attributeString appendAttributedString:spaceString];
+            
+            NSAttributedString *string = [[NSAttributedString alloc] initWithString:nameString attributes:@{NSFontAttributeName:FONT_SIZE(15),NSForegroundColorAttributeName:textColor}];
+            [attributeString appendAttributedString:string];
+            
+            [self setAttributedTitle:attributeString forState:UIControlStateNormal];
+        }
+    }
+    return self;
+}
+
+- (instancetype)initWithImageName:(NSString *)imageName andString:(NSString *)string textColor:(UIColor *)textColor
+{
+    self = [super init];
+    if (self) {
+        self.titleLabel.numberOfLines = 3;
+        self.titleLabel.textAlignment = NSTextAlignmentCenter;
+        NSMutableAttributedString *attributeString = [[NSMutableAttributedString alloc] init];
+        NSTextAttachment *attach = [[NSTextAttachment alloc] init];
+        attach.image = [UIImage imageNamed:imageName];
+        attach.bounds = CGRectMake(0, 0, 27, 27);
+        NSAttributedString *attributeStr = [NSAttributedString attributedStringWithAttachment:attach];
+        [attributeString appendAttributedString:attributeStr];
+        
+        NSAttributedString *spaceString = [[NSAttributedString alloc] initWithString:@"\n \n" attributes:@{NSFontAttributeName:FONT_SIZE(6)}];
+        [attributeString appendAttributedString:spaceString];
+        
+        NSAttributedString *titleString = [[NSAttributedString alloc] initWithString:string attributes:@{NSFontAttributeName:FONT_SIZE(13),NSForegroundColorAttributeName:textColor}];
+        [attributeString appendAttributedString:titleString];
+        [self setAttributedTitle:attributeString forState:UIControlStateNormal];
+    }
+    return self;
+}
+
+- (instancetype)initWithOriginalImage:(NSString *)imageName andString:(NSString *)string textColor:(UIColor *)textColor
+{
+    self = [super init];
+    if (self) {
+        self.titleLabel.numberOfLines = 2;
+        self.titleLabel.textAlignment = NSTextAlignmentCenter;
+        NSMutableAttributedString *attributeString = [[NSMutableAttributedString alloc] init];
+        NSTextAttachment *attach = [[NSTextAttachment alloc] init];
+        attach.image = [UIImage imageNamed:imageName];
+        attach.image = [UIImage imageNamed:imageName];
+        attach.bounds = CGRectMake(0, 0, 27, 27);
+        NSAttributedString *attributeStr = [NSAttributedString attributedStringWithAttachment:attach];
+        [attributeString appendAttributedString:attributeStr];
+        
+        NSAttributedString *spaceString = [[NSAttributedString alloc] initWithString:@"\n" attributes:@{NSFontAttributeName:FONT_SIZE(16)}];
+        [attributeString appendAttributedString:spaceString];
+        
+        NSAttributedString *titleString = [[NSAttributedString alloc] initWithString:string attributes:@{NSFontAttributeName:FONT_SIZE(15),NSForegroundColorAttributeName:textColor}];
+        [attributeString appendAttributedString:titleString];
+        [self setAttributedTitle:attributeString forState:UIControlStateNormal];
+    }
+    return self;
+}
+
+
+- (void)setImageName:(NSString *)imageName andString:(NSString *)string textColor:(UIColor *)textColor
+{
+    self.titleLabel.numberOfLines = 2;
+    self.titleLabel.textAlignment = NSTextAlignmentCenter;
+    NSMutableAttributedString *attributeString = [[NSMutableAttributedString alloc] init];
+    NSTextAttachment *attach = [[NSTextAttachment alloc] init];
+    attach.image = [UIImage imageNamed:imageName];
+    attach.bounds = CGRectMake(0, 0, 27, 27);
+    NSAttributedString *attributeStr = [NSAttributedString attributedStringWithAttachment:attach];
+    [attributeString appendAttributedString:attributeStr];
+    
+    NSAttributedString *spaceString = [[NSAttributedString alloc] initWithString:@"\n" attributes:@{NSFontAttributeName:FONT_SIZE(16)}];
+    [attributeString appendAttributedString:spaceString];
+    
+    NSAttributedString *titleString = [[NSAttributedString alloc] initWithString:string attributes:@{NSFontAttributeName:FONT_SIZE(13),NSForegroundColorAttributeName:textColor}];
+    [attributeString appendAttributedString:titleString];
+    [self setAttributedTitle:attributeString forState:UIControlStateNormal];
+}
+
++ (instancetype )ggButtonWithText:(NSString *)title fontSize:(CGFloat)size normalColor:(UIColor *)normalColor selectedColor:(UIColor *)selectedColor
+{
+    UIButton *button = [UIButton buttonWithType:UIButtonTypeCustom];
+    [button setTitle:title forState:UIControlStateNormal];
+    button.titleLabel.font = FONT_SIZE(size);
+    
+    [button setTitleColor:normalColor forState:UIControlStateNormal];
+    [button setTitleColor:selectedColor forState:UIControlStateSelected];
+ 
+    return button;
+}
+
+@end

+ 2 - 2
UU_Ent/UU_Ent/Utils/UIButton/UIButton+Layout.h

@@ -2,8 +2,8 @@
 //  UIButton+Layout.h
 //  YBL365
 //
-//  Created by 乔同新 on 12/20/16.
-//  Copyright © 2016 乔同新. All rights reserved.
+//  Created by  on 12/20/16.
+//  Copyright © . All rights reserved.
 //
 
 #import <UIKit/UIKit.h>

+ 2 - 2
UU_Ent/UU_Ent/Utils/UIButton/UIButton+Layout.m

@@ -2,8 +2,8 @@
 //  UIButton+Layout.m
 //  YBL365
 //
-//  Created by 乔同新 on 12/20/16.
-//  Copyright © 2016 乔同新. All rights reserved.
+//  Created by  on 12/20/16.
+//  Copyright © . All rights reserved.
 //
 
 #import "UIButton+Layout.h"

+ 19 - 0
UU_Ent/UU_Ent/Utils/UIButton/UIButton+block.h

@@ -0,0 +1,19 @@
+//
+//  UIButton+block.h
+//  shiku_im
+//
+//  Created by ime on 2017/8/31.
+//
+//
+
+#import <UIKit/UIKit.h>
+
+@interface UIButton (block)
+
++(UIButton *)blockSetWithTitle:(NSString *)title textColor:(UIColor *)textColor backgroundColor:(UIColor *)backColor fontSize:(CGFloat)size radius:(CGFloat)radius block:(void (^)(id x))block;
+
++(UIButton *)blockSetWithImgName:(NSString *)imgName selImgName:(NSString *)selImgName block:(void (^)(id x))block;
+
+
+
+@end

+ 54 - 0
UU_Ent/UU_Ent/Utils/UIButton/UIButton+block.m

@@ -0,0 +1,54 @@
+//
+//  UIButton+block.m
+//  shiku_im
+//
+//  Created by ime on 2017/8/31.
+//
+//
+
+#import "UIButton+block.h"
+
+@implementation UIButton (block)
+
++(UIButton *)blockSetWithTitle:(NSString *)title textColor:(UIColor *)textColor backgroundColor:(UIColor *)backColor fontSize:(CGFloat)size radius:(CGFloat)radius block:(void (^)(id))block{
+    UIButton *button = [UIButton new];
+    if (title) {
+        [button setTitle:title forState:UIControlStateNormal];
+    }
+    if (textColor) {
+        [button setTitleColor:textColor forState:UIControlStateNormal];
+    }
+    if (backColor) {
+        button.backgroundColor = backColor;
+    }if (size) {
+        button.titleLabel.font = FONT_SIZE(size);
+       
+    }if (radius) {
+        button.layer.cornerRadius = radius;
+        button.layer.masksToBounds = YES;
+    }
+    if (block) {
+        [[button rac_signalForControlEvents:UIControlEventTouchUpInside]subscribeNext:block];
+    }
+    
+    return button;
+}
+
+
++(UIButton *)blockSetWithImgName:(NSString *)imgName selImgName:(NSString *)selImgName block:(void (^)(id))block{
+    UIButton *button = [UIButton new];
+    if (imgName) {
+        [button setImage:[UIImage imageNamed:imgName] forState:UIControlStateNormal];
+    }
+    if (selImgName) {
+        [button setImage:[UIImage imageNamed:selImgName] forState:UIControlStateSelected];
+    }
+    if (block) {
+        [[button rac_signalForControlEvents:UIControlEventTouchUpInside] subscribeNext:block];
+    }
+    
+    return button;
+
+}
+
+@end

+ 1 - 1
UU_Ent/UU_Ent/Utils/UINavigation/YRShowMessageFromNavi.m

@@ -101,7 +101,7 @@ static UILabel *label = nil;
 
 + (CGFloat)getHeighth:(NSString *)str{
     
-    return [str boundingRectWithSize:CGSizeMake(kWidth,CGFLOAT_MAX) options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName: FONT_SIZE(12)} context:NULL].size.height;
+    return [str boundingRectWithSize:CGSizeMake(SCREEN_WIDTH,CGFLOAT_MAX) options:NSStringDrawingUsesFontLeading | NSStringDrawingUsesLineFragmentOrigin attributes:@{NSFontAttributeName: FONT_SIZE(12)} context:NULL].size.height;
     
 }