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