From abac8765bf6a1f400c2377b9999ce7495ba34a3f Mon Sep 17 00:00:00 2001 From: zjf <zhangjf@probim.com.cn> Date: Fri, 10 Mar 2023 18:05:41 +0800 Subject: [PATCH] 人员、车辆 进出场 --- IphoneBIMe/IphoneBIMe/Classes/Login/ViewControllers/PBLoginViewController.m | 47 ++++++++++++++++++++++++++++++++++++++--------- 1 files changed, 38 insertions(+), 9 deletions(-) diff --git a/IphoneBIMe/IphoneBIMe/Classes/Login/ViewControllers/PBLoginViewController.m b/IphoneBIMe/IphoneBIMe/Classes/Login/ViewControllers/PBLoginViewController.m index c890ab9..d691e99 100644 --- a/IphoneBIMe/IphoneBIMe/Classes/Login/ViewControllers/PBLoginViewController.m +++ b/IphoneBIMe/IphoneBIMe/Classes/Login/ViewControllers/PBLoginViewController.m @@ -13,6 +13,8 @@ #import <JPUSHService.h> #import "PGGCryptoDES.h" #import "PBEnterpriseCodeController.h" +#import "PBSitePerViewController.h" +#import "PBProjectModel.h" #define bim365Code @"300012" @interface PBLoginViewController ()<UITextFieldDelegate> @property (nonatomic, weak) UILabel *codeL; @@ -228,6 +230,14 @@ }]; // [loginBtn circleViewWithRadius:6]; + UIButton *clockBtn = [UIButton z_textButton:@"打卡" boldFontSize:16 normalColor:PBColor(40, 58, 79)]; + [clockBtn addTarget:self action:@selector(clockAction) forControlEvents:UIControlEventTouchUpInside]; + [self.view addSubview:clockBtn]; + [clockBtn mas_makeConstraints:^(MASConstraintMaker *make) { + make.top.equalTo(loginBtn.mas_bottom).offset(20); + make.right.equalTo(loginBtn); + }]; + UILabel *agreeL = [UILabel z_labelWithText:@"登录代表同意" Color:DescColor isBold:YES Font:12]; [self.view addSubview:agreeL]; [agreeL mas_makeConstraints:^(MASConstraintMaker *make) { @@ -257,6 +267,16 @@ self.passwordTF.secureTextEntry = YES; } } +- (void)clockAction { + PBSitePerViewController *moduleVC = [[PBSitePerViewController alloc] init]; + moduleVC.isFromLogin = YES; + PBProjectModel *projectModel = [[PBProjectModel alloc] init]; + projectModel.organizeid = @"726970e7-005a-42d7-8ab4-0703d9d02957"; + moduleVC.projectModel = projectModel; + UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:moduleVC]; + nav.modalPresentationStyle = UIModalPresentationFullScreen; + [self presentViewController:nav animated:YES completion:nil]; +} #pragma mark -查看协议 - (void)agreementAction { PBAgreementViewController *agreementVC = [[PBAgreementViewController alloc] init]; @@ -267,15 +287,24 @@ #pragma mark - 编辑企业码 - (void)codeBtnAction { PBEnterpriseCodeController *codeVC = [[PBEnterpriseCodeController alloc] init]; - codeVC.SetCodeBlock = ^(NSDictionary * _Nonnull obj) { + codeVC.SetCodeBlock = ^(NSString * _Nonnull code, NSDictionary * _Nonnull obj) { self.customData = obj; NSMutableArray *arrM = [[NSMutableArray alloc] init]; NSArray *arr = [NSString getApiArrData]; + BOOL isHave = false; for (NSDictionary *dict in arr) { - [dict setValue:@"0" forKey:@"Check"]; - [arrM addObject:dict]; + NSString *haveCode = [dict valueForKey:@"Code"]; + if ([code isEqualToString:haveCode]) { + [arrM addObject:obj]; + isHave = true; + } else { + [dict setValue:@"0" forKey:@"Check"]; + [arrM addObject:dict]; + } } - [arrM addObject:self.customData]; + if (!isHave) { + [arrM addObject:self.customData]; + } [self saveApiArr:arrM.copy]; [self storedLocallyApiWithData:self.customData]; [self setApi]; @@ -485,13 +514,13 @@ // @"Check" : @"1" // }; _bim365Data = @{ - @"ModelApi" : @"http://39.129.29.216:6081", + @"ModelApi" : @"https://bime.shinewing.com:6081", @"Panorama": @"errurl", - @"NewApi" : @"http://39.129.29.216:6082", + @"NewApi" : @"https://bime.shinewing.com:6082", @"AppApi" : @"errurl", - @"Web" : @"http://39.129.29.216:6080", - @"NewWeb" : @"http://39.129.29.216:6080", - @"LogoUrl" : @"http://39.129.29.216:6080/Content/function/Login/images/Simple_logo.png", + @"Web" : @"https://bime.shinewing.com:6080", + @"NewWeb" : @"https://bime.shinewing.com:6080", + @"LogoUrl" : @"https://bime.shinewing.com:6080/Content/function/Login/images/Simple_logo.png", @"CompanyName" : @"管理平台", @"Code" : bim365Code, @"StarName" : @"", -- Gitblit v1.9.3