浏览代码

Merge branch 'master' of ssh://10.10.100.21/source/UUEnt

time 6 年之前
父节点
当前提交
089289a3d8

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

@@ -11,6 +11,7 @@
 		27029BCC2277063F00D53A94 /* UIColor+HexColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 27029BCB2277063F00D53A94 /* UIColor+HexColor.m */; };
 		27029BCC2277063F00D53A94 /* UIColor+HexColor.m in Sources */ = {isa = PBXBuildFile; fileRef = 27029BCB2277063F00D53A94 /* UIColor+HexColor.m */; };
 		27029BD0227709CC00D53A94 /* UIButton+Layout.m in Sources */ = {isa = PBXBuildFile; fileRef = 27029BCE227709CC00D53A94 /* UIButton+Layout.m */; };
 		27029BD0227709CC00D53A94 /* UIButton+Layout.m in Sources */ = {isa = PBXBuildFile; fileRef = 27029BCE227709CC00D53A94 /* UIButton+Layout.m */; };
 		27029BD32277E16300D53A94 /* YRButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 27029BD22277E16300D53A94 /* YRButton.m */; };
 		27029BD32277E16300D53A94 /* YRButton.m in Sources */ = {isa = PBXBuildFile; fileRef = 27029BD22277E16300D53A94 /* YRButton.m */; };
+		270E6C972282B72D008B12B9 /* YRSettingVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 270E6C962282B72D008B12B9 /* YRSettingVC.m */; };
 		2710E65522801B7E0002A4B0 /* YRRegisterVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 2710E65422801B7E0002A4B0 /* YRRegisterVC.m */; };
 		2710E65522801B7E0002A4B0 /* YRRegisterVC.m in Sources */ = {isa = PBXBuildFile; fileRef = 2710E65422801B7E0002A4B0 /* YRRegisterVC.m */; };
 		2710E65822801B930002A4B0 /* YRPwdLevelView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2710E65722801B930002A4B0 /* YRPwdLevelView.m */; };
 		2710E65822801B930002A4B0 /* YRPwdLevelView.m in Sources */ = {isa = PBXBuildFile; fileRef = 2710E65722801B930002A4B0 /* YRPwdLevelView.m */; };
 		2710E65D22801E330002A4B0 /* LeftViewTF.m in Sources */ = {isa = PBXBuildFile; fileRef = 2710E65C22801E330002A4B0 /* LeftViewTF.m */; };
 		2710E65D22801E330002A4B0 /* LeftViewTF.m in Sources */ = {isa = PBXBuildFile; fileRef = 2710E65C22801E330002A4B0 /* LeftViewTF.m */; };
@@ -151,6 +152,8 @@
 		27029BCF227709CC00D53A94 /* UIButton+Layout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIButton+Layout.h"; sourceTree = "<group>"; };
 		27029BCF227709CC00D53A94 /* UIButton+Layout.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = "UIButton+Layout.h"; sourceTree = "<group>"; };
 		27029BD12277E16300D53A94 /* YRButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YRButton.h; sourceTree = "<group>"; };
 		27029BD12277E16300D53A94 /* YRButton.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YRButton.h; sourceTree = "<group>"; };
 		27029BD22277E16300D53A94 /* YRButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YRButton.m; sourceTree = "<group>"; };
 		27029BD22277E16300D53A94 /* YRButton.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YRButton.m; sourceTree = "<group>"; };
+		270E6C952282B72D008B12B9 /* YRSettingVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YRSettingVC.h; sourceTree = "<group>"; };
+		270E6C962282B72D008B12B9 /* YRSettingVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YRSettingVC.m; sourceTree = "<group>"; };
 		2710E65322801B7E0002A4B0 /* YRRegisterVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YRRegisterVC.h; sourceTree = "<group>"; };
 		2710E65322801B7E0002A4B0 /* YRRegisterVC.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = YRRegisterVC.h; sourceTree = "<group>"; };
 		2710E65422801B7E0002A4B0 /* YRRegisterVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YRRegisterVC.m; sourceTree = "<group>"; };
 		2710E65422801B7E0002A4B0 /* YRRegisterVC.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = YRRegisterVC.m; sourceTree = "<group>"; };
 		2710E65622801B930002A4B0 /* YRPwdLevelView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = YRPwdLevelView.h; path = UU_Ent/Modules/Login/Main/Views/YRPwdLevelView.h; sourceTree = SOURCE_ROOT; };
 		2710E65622801B930002A4B0 /* YRPwdLevelView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = YRPwdLevelView.h; path = UU_Ent/Modules/Login/Main/Views/YRPwdLevelView.h; sourceTree = SOURCE_ROOT; };
@@ -362,6 +365,47 @@
 			path = UIButton;
 			path = UIButton;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
 		};
 		};
+		270E6C902282B6A5008B12B9 /* Child */ = {
+			isa = PBXGroup;
+			children = (
+				270E6C912282B6F5008B12B9 /* Controllers */,
+				270E6C922282B6FE008B12B9 /* Models */,
+				270E6C942282B70C008B12B9 /* Views */,
+				270E6C932282B705008B12B9 /* Others */,
+			);
+			path = Child;
+			sourceTree = "<group>";
+		};
+		270E6C912282B6F5008B12B9 /* Controllers */ = {
+			isa = PBXGroup;
+			children = (
+				270E6C952282B72D008B12B9 /* YRSettingVC.h */,
+				270E6C962282B72D008B12B9 /* YRSettingVC.m */,
+			);
+			path = Controllers;
+			sourceTree = "<group>";
+		};
+		270E6C922282B6FE008B12B9 /* Models */ = {
+			isa = PBXGroup;
+			children = (
+			);
+			path = Models;
+			sourceTree = "<group>";
+		};
+		270E6C932282B705008B12B9 /* Others */ = {
+			isa = PBXGroup;
+			children = (
+			);
+			path = Others;
+			sourceTree = "<group>";
+		};
+		270E6C942282B70C008B12B9 /* Views */ = {
+			isa = PBXGroup;
+			children = (
+			);
+			path = Views;
+			sourceTree = "<group>";
+		};
 		2710E65922801D760002A4B0 /* UITextField */ = {
 		2710E65922801D760002A4B0 /* UITextField */ = {
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
@@ -585,6 +629,7 @@
 			isa = PBXGroup;
 			isa = PBXGroup;
 			children = (
 			children = (
 				99C6FE9B2276933F00C7070A /* Main */,
 				99C6FE9B2276933F00C7070A /* Main */,
+				270E6C902282B6A5008B12B9 /* Child */,
 			);
 			);
 			path = Mine;
 			path = Mine;
 			sourceTree = "<group>";
 			sourceTree = "<group>";
@@ -1375,6 +1420,7 @@
 				99C6FE96227690BE00C7070A /* YRBaseVC.m in Sources */,
 				99C6FE96227690BE00C7070A /* YRBaseVC.m in Sources */,
 				2710E65522801B7E0002A4B0 /* YRRegisterVC.m in Sources */,
 				2710E65522801B7E0002A4B0 /* YRRegisterVC.m in Sources */,
 				99C6FF172276D13500C7070A /* YRUserInfo.m in Sources */,
 				99C6FF172276D13500C7070A /* YRUserInfo.m in Sources */,
+				270E6C972282B72D008B12B9 /* YRSettingVC.m in Sources */,
 				99B4252F22815E2900DAE304 /* YRAlertView.m in Sources */,
 				99B4252F22815E2900DAE304 /* YRAlertView.m in Sources */,
 				999F6510227E658E00329012 /* UIView+frame.m in Sources */,
 				999F6510227E658E00329012 /* UIView+frame.m in Sources */,
 				99C6FEC32276959B00C7070A /* YRWorkVC.m in Sources */,
 				99C6FEC32276959B00C7070A /* YRWorkVC.m in Sources */,

+ 12 - 1
UU_Ent/UU_Ent/Modules/Login/Main/Controllers/YRLoginVC.m

@@ -9,7 +9,8 @@
 #import "YRLoginVC.h"
 #import "YRLoginVC.h"
 #import "YRUserInfo.h"
 #import "YRUserInfo.h"
 #import "YRRegisterVC.h"
 #import "YRRegisterVC.h"
-
+#import "YRLoginManager.h"
+#import "YRMainVC.h"
 
 
 @interface YRLoginVC ()<UITextFieldDelegate,UIPopoverListViewDelegate,UIPopoverListViewDataSource>
 @interface YRLoginVC ()<UITextFieldDelegate,UIPopoverListViewDelegate,UIPopoverListViewDataSource>
 @property (nonatomic,strong) UIScrollView *scrollView;
 @property (nonatomic,strong) UIScrollView *scrollView;
@@ -47,6 +48,11 @@
                 
                 
                 self.completed(YES);
                 self.completed(YES);
                 
                 
+            }else{
+                
+                YRMainVC *vc = [YRMainVC new];
+                
+                [UIApplication sharedApplication].keyWindow.rootViewController = vc;
             }
             }
         }
         }
         
         
@@ -68,6 +74,11 @@
             
             
             self.completed(YES);
             self.completed(YES);
             
             
+        }else{
+            
+            YRMainVC *vc = [YRMainVC new];
+            
+            [UIApplication sharedApplication].keyWindow.rootViewController = vc;
         }
         }
         
         
     } failure:^(SwitchCompanyResponse * _Nullable response, NSError * _Nullable error) {
     } failure:^(SwitchCompanyResponse * _Nullable response, NSError * _Nullable error) {

+ 5 - 0
UU_Ent/UU_Ent/Modules/Login/Main/Others/YRLoginManager.h

@@ -28,6 +28,11 @@ NS_ASSUME_NONNULL_BEGIN
  */
  */
 +(void)companyLoginWithCompanyInfo:(NSDictionary *)company success:(void(^)(SwitchCompanyResponse * _Nullable response))success failure:(void(^)(SwitchCompanyResponse * _Nullable response, NSError * _Nullable error))failure;
 +(void)companyLoginWithCompanyInfo:(NSDictionary *)company success:(void(^)(SwitchCompanyResponse * _Nullable response))success failure:(void(^)(SwitchCompanyResponse * _Nullable response, NSError * _Nullable error))failure;
 
 
+/**
+ 退出登录
+ */
++(void)userLogout:(void(^)(AccountSignoutResponse * _Nullable response))success failure:(void(^)(AccountSignoutResponse * _Nullable response, NSError * _Nullable error))failure;
+
 @end
 @end
 
 
 NS_ASSUME_NONNULL_END
 NS_ASSUME_NONNULL_END

+ 40 - 0
UU_Ent/UU_Ent/Modules/Login/Main/Others/YRLoginManager.m

@@ -198,6 +198,46 @@
     
     
     [call start];
     [call start];
     
     
+}
+
+/**
+ 退出登录
+ */
++(void)userLogout:(void(^)(AccountSignoutResponse * _Nullable response))success failure:(void(^)(AccountSignoutResponse * _Nullable response, NSError * _Nullable error))failure{
+    
+    [GRPCCall useInsecureConnectionsForHost:kHostAddress];
+    
+    AccountService *client = [[AccountService alloc]initWithHost:kHostAddress];
+    
+    AccountSignoutRequest *request = [AccountSignoutRequest message];
+    
+    GRPCProtoCall *call = [client RPCTosignoutWithRequest:request handler:^(AccountSignoutResponse * _Nullable response, NSError * _Nullable error) {
+        
+        if (response.responseHeader.success) {
+            
+            if (success) {
+                
+                success(response);
+                
+            }
+            
+        }else{
+            
+            if (failure) {
+                
+                failure(response,error);
+                
+            }
+            
+            
+        }
+        
+        
+    }];
+    
+    call.requestHeaders[@"authentication"] = [YRUserInfo shareManager].token;
+    
+    [call start];
     
     
 }
 }
 
 

+ 17 - 0
UU_Ent/UU_Ent/Modules/Mine/Child/Controllers/YRSettingVC.h

@@ -0,0 +1,17 @@
+//
+//  YRSettingVC.h
+//  UU_Ent
+//
+//  Created by huangyp-pc on 2019/5/8.
+//  Copyright © 2019 UAS. All rights reserved.
+//
+
+#import "YRBaseVC.h"
+
+NS_ASSUME_NONNULL_BEGIN
+
+@interface YRSettingVC : YRBaseVC
+
+@end
+
+NS_ASSUME_NONNULL_END

+ 179 - 0
UU_Ent/UU_Ent/Modules/Mine/Child/Controllers/YRSettingVC.m

@@ -0,0 +1,179 @@
+//
+//  YRSettingVC.m
+//  UU_Ent
+//
+//  Created by huangyp-pc on 2019/5/8.
+//  Copyright © 2019 UAS. All rights reserved.
+//
+
+#import "YRSettingVC.h"
+#import "YRLoginManager.h"
+#import "YRLoginVC.h"
+
+static NSString *cellID = @"cellID";
+
+@interface YRSettingVC ()<UITableViewDataSource,UITableViewDelegate>
+
+@property (nonatomic,strong) YRTableView *tableView;
+
+@property (nonatomic,strong) NSArray *titleArr;
+
+@end
+
+@implementation YRSettingVC
+
+- (void)viewDidLoad {
+    [super viewDidLoad];
+    // Do any additional setup after loading the view.
+}
+
+#pragma mark --- 退出登录
+-(void)LoggingOutAction
+{
+    [MBProgressHUD showHUDAddedTo:self.view animated:YES];
+    
+    [YRLoginManager userLogout:^(AccountSignoutResponse * _Nullable response) {
+        
+        YRLoginVC *vc = [YRLoginVC new];
+        
+        [UIView animateWithDuration:0.5 animations:^{
+            
+            [UIApplication sharedApplication].keyWindow.rootViewController = vc;
+            
+        }];
+        
+    } failure:^(AccountSignoutResponse * _Nullable response, NSError * _Nullable error) {
+        
+        [YRShowMessageFromNavi showDropViewWithMessage:response.responseHeader.message ToNavi:self.navigationController withColor:nil];
+        
+    }];
+}
+
+#pragma mark --- TableView Delegat / DataSource
+- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
+{
+    return _titleArr.count;
+}
+
+- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
+{
+    NSArray *sub = _titleArr[section];
+    return sub.count;
+}
+
+- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellID];
+    
+    if (!cell) {
+        
+        cell = [[UITableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:cellID];
+        cell.textLabel.textColor = HexColor(@"#333333");
+        
+        
+//        if ([FORMAT(@"%@",_titleArr[indexPath.section][indexPath.row]) isEqualToString:Localized(@"UU_me_set_openPush")]) {
+//
+//            UISwitch *switchButton = [[UISwitch alloc] initWithFrame:CGRectMake(SCREEN_WIDTH-60, 5, 30, 10)];
+//            BOOL isNoPush = [[NSUserDefaults standardUserDefaults] boolForKey:@"isMeNoPushCao"];
+//            if (!isNoPush) {
+//                [switchButton setOn:YES];
+//            }else{
+//                [switchButton setOn:NO];
+//            }
+//
+//            [switchButton addTarget:self action:@selector(switchAction:) forControlEvents:UIControlEventValueChanged];
+//
+//            [cell.contentView addSubview:switchButton];
+//        }else{
+//            cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
+//            cell.selectionStyle = UITableViewCellSelectionStyleDefault;
+//        }
+        
+    }
+    cell.accessoryType = UITableViewCellAccessoryDisclosureIndicator;
+    cell.selectionStyle = UITableViewCellSelectionStyleDefault;
+    cell.textLabel.font = FONT_SIZE(15);
+    cell.textLabel.text = _titleArr[indexPath.section][indexPath.row];
+    
+    return cell;
+}
+
+- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
+    
+    return 16;
+    
+}
+
+- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
+    
+    if (section == self.titleArr.count-1) {
+        return 29+45;
+    }else
+        return CGFLOAT_MIN;
+    
+}
+
+- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
+    
+    return [UIView new];
+    
+}
+
+- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
+    
+    if (section == self.titleArr.count-1) {
+        UIView *footerView = [[UIView alloc] init];
+        footerView.userInteractionEnabled = YES;
+        footerView.backgroundColor = [UIColor clearColor];
+        
+        YRButton *btn = [[YRButton alloc]initWithTitle:@"退出登录" titleColor:HexColor(@"#FF0000") titleFont:15 buttonNormalColor:[UIColor whiteColor] buttonSelectColor:RGB(208, 208, 208, 1) buttonDiabledColor:nil];
+        
+        btn.frame = CGRectMake(0, 29, self_width, 45);
+        
+        [footerView addSubview:btn];
+        
+        [btn addTarget:self action:@selector(LoggingOutAction) forControlEvents:UIControlEventTouchUpInside];
+        
+        return footerView;
+    }
+    else
+        return [UIView new];
+    
+}
+
+-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
+{
+    return 40 ;
+}
+
+#pragma mark --- 创建UI
+-(void)setUpUI
+{
+    [self.view addSubview:self.tableView];
+    
+    [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
+        
+        make.top.left.bottom.right.equalTo(self.view);
+        
+    }];
+    
+    self.titleArr = @[@[@"启动推送"],@[@"打卡设置",@"外勤设置",@"预约时间段设置"],@[@"清除缓存",@"用户反馈",@"关于UU互联"],@[@"语言设置",@"字体大小设置"]];
+}
+
+#pragma mark --- lazy
+-(YRTableView *)tableView{
+    
+    if (!_tableView) {
+        
+        _tableView = [[YRTableView alloc]initWithFrame:self.view.frame style:UITableViewStyleGrouped];
+        _tableView.delegate = self;
+        _tableView.dataSource = self;
+        _tableView.showsVerticalScrollIndicator = NO;
+        _tableView.showsHorizontalScrollIndicator = NO;
+        _tableView.tableFooterView = [UIView new];
+    }
+    
+    return _tableView;
+}
+
+@end

+ 2 - 2
UU_Ent/UU_Ent/Modules/Mine/Main/Others/mine_route.json

@@ -3,9 +3,9 @@
     "data":[
     "data":[
         {"title":"设置",
         {"title":"设置",
             "id":"1",
             "id":"1",
-            "desVc": "YRBaseVC",
+            "desVc": "YRSettingVC",
             "id_p":"1",
             "id_p":"1",
-            "desc":"设置",
+            "desc":"YRSettingVC",
         },
         },
         
         
     ]
     ]