我的页面改版(账户、赛事调整,新增技能卡入口)

This commit is contained in:
chenguilong
2022-01-19 16:04:46 +08:00
parent 65f730cdd3
commit 7d6fe95f65
61 changed files with 882 additions and 298 deletions

View File

@@ -22,7 +22,7 @@
#import "XPMinePresent.h"
///View
#import "XPMineMenuTableViewCell.h"
#import "XPMineMatchTableViewCell.h"
#import "XPMineHeadItemTableViewCell.h"
#import "XPMineHeadView.h"
///VC
#import "XPMineSettingViewController.h"
@@ -35,14 +35,19 @@
#import "XPMineFansViewController.h"
#import "XPMineAttentionViewController.h"
#import "XPNobleCenterViewController.h"
#import "XPMatchManageViewController.h"
@interface XPMineViewController ()<UITableViewDelegate, UITableViewDataSource, XPMineProtocol, XPMineHeadItemTableViewCellDelegate, XPMineHeadViewDelegate>
///
@property (nonatomic, strong) UIView *bgImageView;
@interface XPMineViewController ()<UITableViewDelegate, UITableViewDataSource, XPMineProtocol, XPMineMatchTableViewCellDelegate, XPMineHeadViewDelegate>
///
@property (nonatomic,strong) UITableView *tableView;
///
@property (nonatomic,strong) NSArray<XPMineItemModel *> *datasource;
///
@property (nonatomic,strong) NSArray<XPMineItemModel *> *matchItemArray;
///item
@property (nonatomic, strong) NSArray<XPMineItemModel *> *cardItemArray;
///
@property (nonatomic,strong) XPMineHeadView *headView;
///
@@ -82,14 +87,18 @@
#pragma mark - Private Method
- (void)initSubViews {
[self.view addSubview:self.bgImageView];
[self.view addSubview:self.tableView];
[self.view addSubview:self.settingButton];
self.tableView.tableHeaderView = self.headView;
[self.presenter getMatchItems];
[self.presenter getNormalItems];
[self.presenter getCardItems];
}
- (void)initSubViewConstraints {
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.right.top.mas_equalTo(0);
}];
[self.settingButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(18, 18));
make.right.mas_equalTo(self.view).offset(-14);
@@ -104,6 +113,11 @@
- (void)pushViewControllerWithType:(XPMineItemType)type {
switch (type) {
case XPMineItemType_Match_Manage: {
XPMatchManageViewController *vc = [[XPMatchManageViewController alloc] init];
[self.navigationController pushViewController:vc animated:YES];
}
break;
case XPMineItemType_Match_Apply_Record:
[self pushMatchVCWithKey:@"quotaRecord"];
break;
@@ -208,7 +222,7 @@
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
return 180;
return 96;
};
return 53;
@@ -216,11 +230,11 @@
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (indexPath.section == 0) {
XPMineMatchTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineMatchTableViewCell class])];
XPMineHeadItemTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineHeadItemTableViewCell class])];
if (cell == nil) {
cell = [[XPMineMatchTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineMatchTableViewCell class])];
cell = [[XPMineHeadItemTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineHeadItemTableViewCell class])];
}
cell.datasource = self.matchItemArray;
cell.datasource = self.cardItemArray;
cell.delegate = self;
return cell;
} else {
@@ -236,7 +250,7 @@
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
if (section == 1) {
return 15;
return 0;
}
return 0;
}
@@ -285,19 +299,21 @@
[self.tableView reloadData];
}
- (void)onGetMatchItemsSuccess:(NSArray<XPMineItemModel *> *)matchItems {
self.matchItemArray = matchItems;
[self.tableView reloadData];
- (void)onGetCardItemsSuccess:(NSArray<XPMineItemModel *> *)cardItems {
self.cardItemArray = cardItems;
[self.tableView reloadData];
}
- (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo {
self.userInfo = userInfo;
self.headView.userInfo = userInfo;
}
#pragma mark - XPMineMatchTableViewCellDelegate
- (void)xPMineMatchTableViewCell:(XPMineMatchTableViewCell *)cell didSelectItem:(XPMineItemModel *)item {
[self pushViewControllerWithType:item.type];
#pragma mark - XPMineHeadItemTableViewCellDelegate
- (void)xPMineHeadItemTableViewCell:(XPMineHeadItemTableViewCell *)cell didSelectItem:(XPMineItemModel *)item {
[self pushViewControllerWithType:item.type];
}
#pragma mark - Getters And Setters
- (UITableView *)tableView {
if (!_tableView) {
@@ -307,7 +323,7 @@
_tableView.showsVerticalScrollIndicator = NO;
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
[_tableView registerClass:[XPMineMenuTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineMenuTableViewCell class])];
[_tableView registerClass:[XPMineMatchTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineMatchTableViewCell class])];
[_tableView registerClass:[XPMineHeadItemTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineHeadItemTableViewCell class])];
_tableView.backgroundColor = [UIColor clearColor];
}
return _tableView;
@@ -316,7 +332,7 @@
- (XPMineHeadView *)headView {
if (!_headView) {
CGFloat nobleH = (KScreenWidth - 30.0)/ 345.0 * 44;
_headView = [[XPMineHeadView alloc] initWithFrame:CGRectMake(0, 0,KScreenWidth , 203 + nobleH + kSafeAreaTopHeight)];
_headView = [[XPMineHeadView alloc] initWithFrame:CGRectMake(0, 0,KScreenWidth , 123 + nobleH + kSafeAreaTopHeight)];
_headView.delegate = self;
}
return _headView;
@@ -333,5 +349,12 @@
return _settingButton;
}
- (UIView *)bgImageView {
if (!_bgImageView) {
_bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"mine_head_bg"]];
_bgImageView.contentMode = UIViewContentModeScaleAspectFill;
}
return _bgImageView;
}
@end