1
This commit is contained in:
@@ -13,12 +13,14 @@
|
||||
#import "KBTestVC.h"
|
||||
#import "KBNoticeVC.h"
|
||||
#import "KBFeedBackVC.h"
|
||||
#import "KBMyVM.h"
|
||||
|
||||
@interface MyVC () <UITableViewDelegate, UITableViewDataSource>
|
||||
@property (nonatomic, strong) BaseTableView *tableView; // 列表
|
||||
@property (nonatomic, strong) KBMyHeaderView *header; // 顶部视图
|
||||
@property (nonatomic, strong) NSArray<NSArray<NSDictionary *> *> *data; // 分组数据
|
||||
@property (nonatomic, strong) UIImageView *bgImageView; // 全屏背景图
|
||||
@property (nonatomic, strong) KBMyVM *viewModel; // 我的页面 VM
|
||||
@end
|
||||
|
||||
@implementation MyVC
|
||||
@@ -59,6 +61,20 @@
|
||||
self.tableView.tableHeaderView = self.header;
|
||||
}
|
||||
|
||||
- (void)viewWillAppear:(BOOL)animated {
|
||||
[super viewWillAppear:animated];
|
||||
// 每次进入“我的”页面时请求用户详情
|
||||
if (!self.viewModel) {
|
||||
self.viewModel = [[KBMyVM alloc] init];
|
||||
}
|
||||
__weak typeof(self) weakSelf = self;
|
||||
[self.viewModel fetchUserDetailWithCompletion:^(KBUser * _Nullable user, NSError * _Nullable error) {
|
||||
if (user) {
|
||||
[weakSelf.header configureWithUser:user];
|
||||
}
|
||||
}];
|
||||
}
|
||||
|
||||
// 系统导航栏的显隐由 BaseViewController 统一处理(始终隐藏),此处无需再设置。
|
||||
|
||||
#pragma mark - UITableView
|
||||
|
||||
Reference in New Issue
Block a user