| | |
| | | if([UserDefault stringForKey:@"isLogin"] != nil && [[UserDefault stringForKey:@"isLogin"] intValue] == 1 ) |
| | | { |
| | | // 跳转主界面 |
| | | //[GetAppDelegate getUserInfo]; |
| | | [GetAppDelegate getUserInfo]; |
| | | } |
| | | |
| | | } |
| | |
| | | [self.view addSubview:loginBk]; |
| | | |
| | | // 初始化 pagecontrol |
| | | CGFloat logoHeight = 77; |
| | | CGFloat logoWidth = 152; |
| | | CGFloat logoHeight = 134; |
| | | CGFloat logoWidth = 113; |
| | | CGFloat tipsLabelHeight = NavBarHeight7+75+30; |
| | | CGFloat textFieldW = 292; |
| | | CGFloat textFieldH = 56; |
| | | |
| | | if( IsiPhone4 || IsiPhone5) |
| | | { |
| | | logoWidth = 120; |
| | | logoHeight = 70; |
| | | logoWidth = 80; |
| | | logoHeight = 90; |
| | | tipsLabelHeight = NavBarHeight7+70+10; |
| | | textFieldH = 50; |
| | | } |
| | | |
| | | |
| | | UIImageView * logoPic = [[UIImageView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH-logoWidth)/2, NavBarHeight7+22, logoWidth, logoHeight)]; |
| | | UIImageView * logoPic = [[UIImageView alloc] initWithFrame:CGRectMake((SCREEN_WIDTH-logoWidth)/2, NavBarHeight7, logoWidth, logoHeight)]; |
| | | logoPic.image = [UIImage imageNamed:@"login_logo"]; |
| | | [self.view addSubview:logoPic]; |
| | | |
| | |
| | | registBtn.frame = CGRectMake((SCREEN_WIDTH-120)/2, SCREEN_HEIGHT/2+225, 120, 40); |
| | | [registBtn setTitle:@"新用户注册" forState:UIControlStateNormal]; |
| | | registBtn.titleLabel.font = [UIFont systemFontOfSize: 16.0]; |
| | | [registBtn setTitleColor:RgbColor(241, 0, 39) forState:UIControlStateNormal]; |
| | | [registBtn setTitleColor:kUIColorFromRGB(0x269af4) forState:UIControlStateNormal]; |
| | | [registBtn addTarget:self action:@selector(registAction) forControlEvents:UIControlEventTouchUpInside]; |
| | | [self.view addSubview:registBtn]; |
| | | |
| | |
| | | // YES代表需要蒙版效果 |
| | | HUD.dimBackground = YES; |
| | | |
| | | NSString *path = [[NSString alloc] initWithFormat:LOGIN]; |
| | | NSString *path = [[NSString alloc] initWithFormat:USER_LOGIN]; |
| | | |
| | | CommonReqModel * model = [[CommonReqModel alloc] init]; |
| | | [model setUsername:userPhoneTextField.text]; |
| | | [model setPhone:userPhoneTextField.text]; |
| | | [model setPassword:userPwdTextFeild.text]; |
| | | |
| | | MPWeakSelf(self); |
| | | [NetworkSingleton networkingPostMethod:model.toDic urlName:path success:^(id responseBody) |
| | | [NetworkSingleton networkingGetMethod:model.toDic urlName:path success:^(id responseBody) |
| | | { |
| | | HUD.hidden = YES; |
| | | MPStrongSelf(self); |
| | |
| | | // 存储用户信息 |
| | | [UserDefault setObject:@"1" forKey:@"isLogin"]; |
| | | [UserDefault setObject:userModel._id forKey:@"user_id"]; |
| | | [UserDefault setObject:userModel.username forKey:@"username"]; |
| | | [UserDefault setObject:userModel.phone forKey:@"phone"]; |
| | | [UserDefault setObject:userModel.password forKey:@"password"]; |
| | | [UserDefault setObject:userModel.nickname forKey:@"nickname"]; |
| | | if(userModel.opt == 2) |
| | | { |
| | | [UserDefault setObject:userModel.hotel_id forKey:@"hotel_id"]; |
| | | } |
| | | [UserDefault setObject:[NSString stringWithFormat:@"%d",userModel.opt] forKey:@"opt"];//opt=1表示运维人员,opt=2表示酒店前台 |
| | | [UserDefault setObject:userModel.video forKey:@"video"]; |
| | | [UserDefault setObject:userModel.refresh_frequency forKey:@"refresh_frequency"]; |
| | | [UserDefault setObject:userModel.is_open_upload forKey:@"is_open_upload"]; |
| | | [UserDefault synchronize];//使用synchronize强制立即将数据写入磁盘,防止在写完NSUserDefaults后程序退出导致的数据丢失 |
| | | |
| | | // 跳转主界面 |