| | |
| | | #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; |
| | |
| | | @property (nonatomic, strong) NSDictionary *customData; |
| | | @property (nonatomic, assign) int logoImageVTop; |
| | | @property (nonatomic, assign) int bgViewTop; |
| | | @property (nonatomic, weak) UIButton *clockBtn; |
| | | @end |
| | | |
| | | @implementation PBLoginViewController |
| | |
| | | }]; |
| | | // [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) { |
| | |
| | | self.passwordTF = passwordTF; |
| | | self.titleL = titleL; |
| | | self.loginBtn = loginBtn; |
| | | self.clockBtn = clockBtn; |
| | | //获取当前时间日期 |
| | | NSDate *date = [NSDate date]; |
| | | NSDateFormatter *format1 = [[NSDateFormatter alloc] init]; |
| | | [format1 setDateFormat:@"yyyy年MM月dd日"]; |
| | | NSString *dateStr = [format1 stringFromDate:date]; |
| | | NSInteger result = [self compareWithDate:dateStr andDate:@"2023年03月12日"]; |
| | | if (result == 1) { |
| | | self.clockBtn.hidden = NO; |
| | | }else { |
| | | self.clockBtn.hidden = YES; |
| | | |
| | | } |
| | | } |
| | | //比较时间大小 |
| | | - (NSInteger)compareWithDate:(NSString*)aDate andDate:(NSString *)bDate{ |
| | | NSDateFormatter *dateformater = [[NSDateFormatter alloc] init]; |
| | | [dateformater setDateFormat:@"yyyy年MM月dd日"]; |
| | | NSDate*dta = [[NSDate alloc]init]; |
| | | NSDate*dtb = [[NSDate alloc]init]; |
| | | dta = [dateformater dateFromString:aDate]; |
| | | dtb = [dateformater dateFromString:bDate]; |
| | | NSComparisonResult result = [dta compare:dtb]; |
| | | if (result == NSOrderedDescending) { |
| | | //指定时间 a 大于 b |
| | | return 1; |
| | | }else if(result == NSOrderedAscending){ |
| | | //指定时间 b 大于 a |
| | | return -1; |
| | | }else{ |
| | | //刚好时间一样. |
| | | return 0; |
| | | } |
| | | } |
| | | - (void)enctyptionAction:(UIButton *)button { |
| | | button.selected = !button.selected; |
| | |
| | | }else { |
| | | 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 { |
| | |
| | | // @"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" : @"", |