This commit is contained in:
2025-12-03 20:31:33 +08:00
parent 9651ae7ad7
commit 819d74cc8d
6 changed files with 19 additions and 4 deletions

View File

@@ -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 {

View File

@@ -6,10 +6,12 @@
// 个人资料
#import <UIKit/UIKit.h>
#import "KBUser.h"
NS_ASSUME_NONNULL_BEGIN
@interface KBPersonInfoVC : BaseViewController
@property (nonatomic, strong) KBUser *userModel;
@end

View File

@@ -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; }

View File

@@ -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

View File

@@ -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];

View File

@@ -37,6 +37,8 @@
#import "UIView+KBShadow.h"
#import "UIImage+KBColor.h"
#import "UIColor+Extension.h"
#import "UIImageView+KBWebImage.h"
#import "UIViewController+Extension.h"
#import "BaseNavigationController.h"