2
This commit is contained in:
@@ -21,6 +21,8 @@
|
|||||||
@property (nonatomic, strong) UIImageView *cardLeft;
|
@property (nonatomic, strong) UIImageView *cardLeft;
|
||||||
@property (nonatomic, strong) UIImageView *cardRight;
|
@property (nonatomic, strong) UIImageView *cardRight;
|
||||||
@property (nonatomic, strong) UIImageView *avatarEditIcon; // 头像右下角的编辑图标
|
@property (nonatomic, strong) UIImageView *avatarEditIcon; // 头像右下角的编辑图标
|
||||||
|
@property (nonatomic, strong) KBUser *userModel;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
@implementation KBMyHeaderView
|
@implementation KBMyHeaderView
|
||||||
@@ -91,6 +93,7 @@
|
|||||||
|
|
||||||
- (void)configureWithUser:(KBUser *)user {
|
- (void)configureWithUser:(KBUser *)user {
|
||||||
// 名称:优先昵称,兜底展示本地化的“Settings”或固定提示
|
// 名称:优先昵称,兜底展示本地化的“Settings”或固定提示
|
||||||
|
self.userModel = user;
|
||||||
NSString *name = user.nickName;
|
NSString *name = user.nickName;
|
||||||
if (name.length == 0) {
|
if (name.length == 0) {
|
||||||
name = KBLocalized(@"Settings");
|
name = KBLocalized(@"Settings");
|
||||||
@@ -224,6 +227,7 @@
|
|||||||
}
|
}
|
||||||
- (void)onAvatarTap {
|
- (void)onAvatarTap {
|
||||||
KBPersonInfoVC *vc = [[KBPersonInfoVC alloc] init];
|
KBPersonInfoVC *vc = [[KBPersonInfoVC alloc] init];
|
||||||
|
vc.userModel = self.userModel;
|
||||||
[KB_CURRENT_NAV pushViewController:vc animated:true];
|
[KB_CURRENT_NAV pushViewController:vc animated:true];
|
||||||
}
|
}
|
||||||
- (void)onLeftCardTap {
|
- (void)onLeftCardTap {
|
||||||
|
|||||||
@@ -6,10 +6,12 @@
|
|||||||
// 个人资料
|
// 个人资料
|
||||||
|
|
||||||
#import <UIKit/UIKit.h>
|
#import <UIKit/UIKit.h>
|
||||||
|
#import "KBUser.h"
|
||||||
|
|
||||||
NS_ASSUME_NONNULL_BEGIN
|
NS_ASSUME_NONNULL_BEGIN
|
||||||
|
|
||||||
@interface KBPersonInfoVC : BaseViewController
|
@interface KBPersonInfoVC : BaseViewController
|
||||||
|
@property (nonatomic, strong) KBUser *userModel;
|
||||||
|
|
||||||
@end
|
@end
|
||||||
|
|
||||||
|
|||||||
@@ -51,9 +51,9 @@
|
|||||||
|
|
||||||
// 构造数据
|
// 构造数据
|
||||||
self.items = @[
|
self.items = @[
|
||||||
@{ @"title": KBLocalized(@"Nickname"), @"value": @"Nickname", @"arrow": @YES, @"copy": @NO },
|
@{ @"title": KBLocalized(@"Nickname"), @"value": @"", @"arrow": @YES, @"copy": @NO },
|
||||||
@{ @"title": KBLocalized(@"Gender"), @"value": @"Choose", @"arrow": @YES, @"copy": @NO },
|
@{ @"title": KBLocalized(@"Gender"), @"value": @"Choose", @"arrow": @YES, @"copy": @NO },
|
||||||
@{ @"title": KBLocalized(@"User ID"), @"value": @"8888888", @"arrow": @NO, @"copy": @YES },
|
@{ @"title": KBLocalized(@"User ID"), @"value": @"", @"arrow": @NO, @"copy": @YES },
|
||||||
];
|
];
|
||||||
|
|
||||||
[self.view addSubview:self.tableView];
|
[self.view addSubview:self.tableView];
|
||||||
@@ -80,6 +80,12 @@
|
|||||||
self.tableView.contentInset = inset;
|
self.tableView.contentInset = inset;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void)setUserModel:(KBUser *)userModel{
|
||||||
|
_userModel = userModel;
|
||||||
|
[self.avatarView kb_setAvatarURL:userModel.avatarUrl placeholder:KBPlaceholderImage];
|
||||||
|
self.modifyLabel.text = userModel.nickName;
|
||||||
|
}
|
||||||
|
|
||||||
#pragma mark - UITableView
|
#pragma mark - UITableView
|
||||||
|
|
||||||
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; }
|
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return 1; }
|
||||||
|
|||||||
@@ -13,7 +13,7 @@
|
|||||||
@implementation KBMyVM
|
@implementation KBMyVM
|
||||||
|
|
||||||
- (void)fetchUserDetailWithCompletion:(KBMyUserDetailCompletion)completion {
|
- (void)fetchUserDetailWithCompletion:(KBMyUserDetailCompletion)completion {
|
||||||
[KBHUD show];
|
// [KBHUD show];
|
||||||
[[KBNetworkManager shared] GET:KB_API_USER_DETAIL
|
[[KBNetworkManager shared] GET:KB_API_USER_DETAIL
|
||||||
parameters:nil
|
parameters:nil
|
||||||
headers:nil
|
headers:nil
|
||||||
|
|||||||
@@ -43,10 +43,11 @@ NSErrorDomain const KBNetworkErrorDomain = @"com.company.keyboard.network";
|
|||||||
_timeout = 10.0;
|
_timeout = 10.0;
|
||||||
// 默认请求头:Accept 任意类型 + 使用项目多语言管理器设置 Accept-Language
|
// 默认请求头:Accept 任意类型 + 使用项目多语言管理器设置 Accept-Language
|
||||||
NSString *lang = [KBLocalizationManager shared].currentLanguageCode ?: KBLanguageCodeEnglish;
|
NSString *lang = [KBLocalizationManager shared].currentLanguageCode ?: KBLanguageCodeEnglish;
|
||||||
|
NSString *token = [KBUserSessionManager shared].accessToken ? [KBUserSessionManager shared].accessToken : @"";
|
||||||
_defaultHeaders = @{
|
_defaultHeaders = @{
|
||||||
@"Accept": @"*/*",
|
@"Accept": @"*/*",
|
||||||
@"Accept-Language": lang,
|
@"Accept-Language": lang,
|
||||||
@"auth-token" : @""
|
@"auth-token" : token
|
||||||
};
|
};
|
||||||
// 设置基础域名,路径可相对该地址拼接
|
// 设置基础域名,路径可相对该地址拼接
|
||||||
_baseURL = [NSURL URLWithString:KB_BASE_URL];
|
_baseURL = [NSURL URLWithString:KB_BASE_URL];
|
||||||
|
|||||||
@@ -37,6 +37,8 @@
|
|||||||
#import "UIView+KBShadow.h"
|
#import "UIView+KBShadow.h"
|
||||||
#import "UIImage+KBColor.h"
|
#import "UIImage+KBColor.h"
|
||||||
#import "UIColor+Extension.h"
|
#import "UIColor+Extension.h"
|
||||||
|
#import "UIImageView+KBWebImage.h"
|
||||||
|
|
||||||
|
|
||||||
#import "UIViewController+Extension.h"
|
#import "UIViewController+Extension.h"
|
||||||
#import "BaseNavigationController.h"
|
#import "BaseNavigationController.h"
|
||||||
|
|||||||
Reference in New Issue
Block a user