|
|
@@ -48,6 +48,8 @@
|
|
|
|
|
|
- (void)viewWillAppear:(BOOL)animated{
|
|
|
[self setNavigationBarHidden:YES animated:YES];
|
|
|
+ NSLog(@"viewWillAppear------------");
|
|
|
+ [self getUserinfo];
|
|
|
}
|
|
|
|
|
|
-(void)initsubView{
|
|
|
@@ -57,14 +59,8 @@
|
|
|
_tableView.backgroundColor = [UIColor clearColor];
|
|
|
_tableView.delegate =self;
|
|
|
_tableView.dataSource = self;
|
|
|
- NSDictionary *userinfo = [UDManager.shareInstance getDDManager:dkuserinfo];
|
|
|
- _nameLb.text = userinfo[@"name"];
|
|
|
- _qianmLb.alpha = 0;
|
|
|
- NSURL *av = [NSURL URLWithString:userinfo[@"avatar"]];
|
|
|
- _avatar.layer.cornerRadius = 41.0;
|
|
|
- _avatar.layer.borderWidth = 1.0;
|
|
|
- _avatar.layer.borderColor = [UIColor whiteColor].CGColor;
|
|
|
- [_avatar sd_setImageWithURL:av placeholderImage:[UIImage imageNamed:@"Avatar"]];
|
|
|
+ [self showUserData];
|
|
|
+
|
|
|
}
|
|
|
|
|
|
|
|
|
@@ -140,7 +136,7 @@
|
|
|
|
|
|
NSInteger section =indexPath.section;
|
|
|
NSString *cellT =@"cellT";
|
|
|
- if(section==_cellDatas.count-1){
|
|
|
+ if(section>=_cellDatas.count-2){
|
|
|
cellT =@"tuichu";
|
|
|
}
|
|
|
|
|
|
@@ -288,6 +284,63 @@
|
|
|
}];
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+#pragma mark private
|
|
|
+
|
|
|
+-(void)getUserinfo{
|
|
|
+ NSString *token = [UDManager.shareInstance getSDManager:gkeytoken];
|
|
|
+ if([token isKindOfClass:[NSString class]]&&token.length>10){
|
|
|
+ [UserNetApi getUserinfo:^(int code, NSDictionary * res) {
|
|
|
+ NSLog(@"%d", code);
|
|
|
+ NSNumber *gcode=res[@"code"];
|
|
|
+ NSDictionary *data=res[@"data"];
|
|
|
+ NSLog(@"%@", res);
|
|
|
+ if([gcode intValue]!=200){
|
|
|
+ NSLog(@"%@",res[@"msg"]);
|
|
|
+// [MBProgressHUD showWithText:@"登录异常,请重新登录"];
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ NSDictionary *ps = @{@"avatar": data[@"avatar"]?:@"",
|
|
|
+ @"deptId": data[@"deptId"]?:@"",
|
|
|
+ //@"domainId":data[@"domainId"],
|
|
|
+ @"email":data[@"email"]?:@"",
|
|
|
+ @"id":data[@"id"]?:@"",
|
|
|
+ @"mobile":data[@"mobile"]?:@"",
|
|
|
+ @"name":data[@"name"]?:@"",
|
|
|
+ //@"platformType":data[@"platformType"]?:@"",
|
|
|
+ //@"registrationId":data[@"registrationId"]?:@"",
|
|
|
+ @"sex":data[@"sex"]?:@"",
|
|
|
+ //@"tgbotAdmin":data[@"tgbotAdmin"],
|
|
|
+ //@"tgbotName":data[@"tgbotName"],
|
|
|
+ //@"tgbotTk":data[@"tgbotTk"]?:@"",
|
|
|
+ @"username":data[@"username"]?:@"",
|
|
|
+ //@"uuid":data[@"uuid"],
|
|
|
+ //@"voipTk":data[@"voipTk"]?:@""
|
|
|
+ };
|
|
|
+ if([gcode intValue]==200){
|
|
|
+ NSLog(@"ps:%@",ps);
|
|
|
+ [UDManager.shareInstance setSDManager:ps[@"id"] key:dkuserId];
|
|
|
+ [UDManager.shareInstance setDDManager:ps key:dkuserinfo];
|
|
|
+ [self showUserData];
|
|
|
+ }
|
|
|
+
|
|
|
+ } fail:^(NSError * _Nonnull error) {
|
|
|
+ NSLog(@"%@", error);
|
|
|
+ }];
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+-(void)showUserData{
|
|
|
+ NSDictionary *userinfo = [UDManager.shareInstance getDDManager:dkuserinfo];
|
|
|
+ _nameLb.text = userinfo[@"name"];
|
|
|
+ _qianmLb.alpha = 0;
|
|
|
+ NSURL *av = [NSURL URLWithString:userinfo[@"avatar"]];
|
|
|
+ _avatar.layer.cornerRadius = 41.0;
|
|
|
+ _avatar.layer.borderWidth = 1.0;
|
|
|
+ _avatar.layer.borderColor = [UIColor whiteColor].CGColor;
|
|
|
+ [_avatar sd_setImageWithURL:av placeholderImage:[UIImage imageNamed:@"Avatar"]];
|
|
|
+}
|
|
|
+
|
|
|
#pragma mark statusBar
|
|
|
- (UIStatusBarStyle)preferredStatusBarStyle{
|
|
|
return UIStatusBarStyleLightContent;
|