2023-07-14 18:50:55 +08:00
|
|
|
//
|
2023-08-10 16:25:34 +08:00
|
|
|
// XPMineUserDataViewController.m
|
|
|
|
// xplan-ios
|
2023-07-14 18:50:55 +08:00
|
|
|
//
|
2023-08-10 16:25:34 +08:00
|
|
|
// Created by 冯硕 on 2022/4/14.
|
2023-07-14 18:50:55 +08:00
|
|
|
//
|
|
|
|
|
|
|
|
#import "XPMineUserDataViewController.h"
|
|
|
|
///Third
|
|
|
|
#import <Masonry/Masonry.h>
|
|
|
|
///Tool
|
|
|
|
#import "AccountInfoStorage.h"
|
2024-07-17 17:49:33 +08:00
|
|
|
#import "XPMomentsLayoutConfig.h"
|
2023-07-14 18:50:55 +08:00
|
|
|
///View
|
|
|
|
#import "XPMineDataGiftTableViewCell.h"
|
2024-07-17 17:49:33 +08:00
|
|
|
#import "XPMomentsTableViewCell.h"
|
|
|
|
#import "XPMomentsEmptyTableViewCell.h"
|
2023-07-14 18:50:55 +08:00
|
|
|
///Model
|
|
|
|
#import "UserInfoModel.h"
|
2023-08-10 16:25:34 +08:00
|
|
|
#import "MineSkillCardListInfoModel.h"
|
2023-07-14 18:50:55 +08:00
|
|
|
///P
|
|
|
|
#import "XPMineUserDataPresenter.h"
|
|
|
|
#import "XPMineUserDataProtocol.h"
|
2024-07-17 17:49:33 +08:00
|
|
|
#import "XPMomentsMineProtocol.h"
|
2023-07-14 18:50:55 +08:00
|
|
|
///View
|
2023-08-10 16:25:34 +08:00
|
|
|
|
2023-07-14 18:50:55 +08:00
|
|
|
#import "XPMineUserInfoGiftWallViewController.h"
|
|
|
|
#import "XPMineGuildViewController.h"
|
2024-07-17 17:49:33 +08:00
|
|
|
#import "XPMomentsDetailViewController.h"
|
2024-06-25 19:18:51 +08:00
|
|
|
#import "XPMineUserInfoAlbumViewController.h"
|
2024-06-25 15:08:14 +08:00
|
|
|
|
|
|
|
#import "XPMineDataGiftTableViewCell.h"
|
|
|
|
#import "XPMineAlbumTableViewCell.h"
|
|
|
|
#import "XPMineMedalsTableViewCell.h"
|
2024-06-25 17:24:32 +08:00
|
|
|
#import "XPMineGiftsTableViewCell.h"
|
2024-09-20 20:16:20 +08:00
|
|
|
#import "XPMineGuildTableViewCell.h"
|
2024-07-11 10:06:33 +08:00
|
|
|
#import "XPMineDataGameMateTableViewCell.h"
|
2024-09-20 20:16:20 +08:00
|
|
|
#import "XPMineMultipleContentTableViewCell.h"
|
2024-07-11 10:06:33 +08:00
|
|
|
|
|
|
|
#import "XPMineGameMateOrderView.h"
|
2024-06-25 15:08:14 +08:00
|
|
|
|
|
|
|
#import "MedalModel.h"
|
2024-07-11 10:06:33 +08:00
|
|
|
#import "XPMineGamePartnerInfoModel.h"
|
2024-06-25 15:08:14 +08:00
|
|
|
|
|
|
|
typedef enum : NSUInteger {
|
2024-07-11 10:06:33 +08:00
|
|
|
GameMate = 0,
|
|
|
|
Album = 1,
|
2024-09-20 20:16:20 +08:00
|
|
|
Guild = 2,
|
|
|
|
Medal = 3,
|
|
|
|
Gifts = 4,
|
|
|
|
LuckyGifts = 5,
|
|
|
|
MultipleContent = 6,
|
|
|
|
SectionTypeCount = 7
|
2024-06-25 15:08:14 +08:00
|
|
|
} MineUserInfoPageSectionType;
|
|
|
|
|
|
|
|
@interface XPMineUserSectionHeader : UIView
|
|
|
|
|
|
|
|
@property (nonatomic, copy) NSString *title;
|
|
|
|
@property (nonatomic, copy) NSString *num;
|
|
|
|
@property (nonatomic, assign) BOOL hasMore;
|
|
|
|
@property (nonatomic, copy) void(^didTapMore)(void);
|
|
|
|
|
|
|
|
@property (nonatomic, strong) UILabel *titleLabel;
|
|
|
|
@property (nonatomic, strong) UILabel *numLabel;
|
|
|
|
@property (nonatomic, strong) UIButton *arrowButton;
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation XPMineUserSectionHeader
|
|
|
|
|
|
|
|
- (instancetype)init
|
|
|
|
{
|
|
|
|
if (self = [super init]) {
|
|
|
|
self.frame = CGRectMake(0, 0, KScreenWidth, 20);
|
|
|
|
|
2024-09-19 18:58:23 +08:00
|
|
|
UIView *greenLine = [[UIView alloc] init];
|
|
|
|
greenLine.layer.backgroundColor = UIColorFromRGB(0x04D5C6).CGColor;
|
|
|
|
greenLine.layer.cornerRadius = 2;
|
|
|
|
|
|
|
|
[self addSubview:greenLine];
|
|
|
|
[greenLine mas_makeConstraints:^(MASConstraintMaker *make) {
|
2024-09-20 20:16:20 +08:00
|
|
|
make.leading.mas_equalTo(self);
|
2024-09-19 18:58:23 +08:00
|
|
|
make.centerY.mas_equalTo(self);
|
|
|
|
make.size.mas_equalTo(CGSizeMake(3, 15));
|
|
|
|
}];
|
|
|
|
|
2024-06-25 15:08:14 +08:00
|
|
|
_titleLabel = [UILabel labelInitWithText:@""
|
2024-09-19 18:58:23 +08:00
|
|
|
font:kFontSemibold(16)
|
|
|
|
textColor:[UIColor whiteColor]];
|
2024-06-25 15:08:14 +08:00
|
|
|
[self addSubview:_titleLabel];
|
|
|
|
[_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
2024-09-19 18:58:23 +08:00
|
|
|
make.centerY.mas_equalTo(self);
|
|
|
|
make.leading.mas_equalTo(greenLine.mas_trailing).offset(7);
|
2024-06-25 15:08:14 +08:00
|
|
|
}];
|
|
|
|
|
|
|
|
_numLabel = [UILabel labelInitWithText:@""
|
2024-09-19 18:58:23 +08:00
|
|
|
font:kFontSemibold(16)
|
|
|
|
textColor:[UIColor whiteColor]];
|
2024-06-25 15:08:14 +08:00
|
|
|
[self addSubview:_numLabel];
|
|
|
|
[_numLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
make.centerY.mas_equalTo(self);
|
2024-07-30 20:16:21 +08:00
|
|
|
make.leading.mas_equalTo(self.titleLabel.mas_trailing).offset(4);
|
2024-06-25 15:08:14 +08:00
|
|
|
}];
|
|
|
|
|
|
|
|
_arrowButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
2024-06-27 21:31:00 +08:00
|
|
|
if (isMSRTL()) {
|
|
|
|
_arrowButton.semanticContentAttribute = UISemanticContentAttributeForceRightToLeft;
|
|
|
|
}
|
|
|
|
if (isMSRTL()) {
|
|
|
|
[_arrowButton setBackgroundImage:[[UIImage imageNamed:@"skillCard_arrow"] ms_SetImageForRTL]
|
|
|
|
forState:UIControlStateNormal];
|
|
|
|
} else {
|
|
|
|
[_arrowButton setBackgroundImage:[UIImage imageNamed:@"skillCard_arrow"]
|
|
|
|
forState:UIControlStateNormal];
|
|
|
|
}
|
2024-06-25 15:08:14 +08:00
|
|
|
[_arrowButton addTarget:self
|
|
|
|
action:@selector(didTapArrowButton)
|
|
|
|
forControlEvents:UIControlEventTouchUpInside];
|
2024-06-25 19:18:51 +08:00
|
|
|
[_arrowButton setEnlargeEdgeWithTop:5 right:10 bottom:10 left:10];
|
2024-06-25 15:08:14 +08:00
|
|
|
[self addSubview:_arrowButton];
|
|
|
|
[_arrowButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
make.centerY.mas_equalTo(self);
|
2024-06-27 21:31:00 +08:00
|
|
|
make.size.mas_equalTo(CGSizeMake(20, 20));
|
2024-07-30 20:16:21 +08:00
|
|
|
make.trailing.mas_equalTo(self).offset(0);
|
2024-06-25 15:08:14 +08:00
|
|
|
}];
|
|
|
|
}
|
|
|
|
return self;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setTitle:(NSString *)title {
|
|
|
|
_titleLabel.text = title;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setNum:(NSString *)num {
|
2024-09-27 11:17:04 +08:00
|
|
|
// _numLabel.text = num;
|
2024-06-25 15:08:14 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setHasMore:(BOOL)hasMore {
|
|
|
|
_arrowButton.hidden = !hasMore;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)didTapArrowButton {
|
|
|
|
if (self.didTapMore) {
|
|
|
|
self.didTapMore();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
2024-07-17 17:49:33 +08:00
|
|
|
@interface XPMineUserDataViewController ()<UITableViewDelegate, UITableViewDataSource, XPMineDataGiftTableViewCellDelegate, XPMomentsTableViewCellDelegate, XPMomentsMineProtocol, XPMomentsDetailViewControllerDelegate>
|
2023-07-14 18:50:55 +08:00
|
|
|
///列表
|
|
|
|
@property (nonatomic,strong) UITableView *tableView;
|
2024-06-24 19:11:54 +08:00
|
|
|
|
2024-06-25 19:18:51 +08:00
|
|
|
@property (nonatomic,assign) BOOL isGiftsSectionExpand;
|
|
|
|
@property (nonatomic,assign) BOOL isLuckyGiftsSectionExpand;
|
2023-07-14 18:50:55 +08:00
|
|
|
@property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView);
|
2024-07-11 10:06:33 +08:00
|
|
|
|
2023-08-10 16:25:34 +08:00
|
|
|
///数据源
|
2024-07-17 17:49:33 +08:00
|
|
|
@property (nonatomic,strong) NSMutableArray<MomentsInfoModel *> *datasource;
|
2024-06-25 15:08:14 +08:00
|
|
|
@property (nonatomic, strong) UIButton *giftsExpandButton;
|
|
|
|
@property (nonatomic, strong) UIButton *luckyGiftsExpandButton;
|
2024-09-20 20:16:20 +08:00
|
|
|
@property (nonatomic,assign) BOOL isDisplayMedalContent;
|
2024-06-25 15:08:14 +08:00
|
|
|
|
2024-07-11 10:06:33 +08:00
|
|
|
@property (nonatomic, strong) XPMineUserSectionHeader *gameMateHeader;
|
2024-06-25 15:08:14 +08:00
|
|
|
@property (nonatomic, strong) XPMineUserSectionHeader *albumHeader;
|
2024-09-20 20:16:20 +08:00
|
|
|
@property (nonatomic, strong) XPMineUserSectionHeader *guildHeader;
|
2024-06-25 15:08:14 +08:00
|
|
|
@property (nonatomic, strong) XPMineUserSectionHeader *medalHeader;
|
|
|
|
@property (nonatomic, strong) XPMineUserSectionHeader *giftsHeader;
|
|
|
|
@property (nonatomic, strong) XPMineUserSectionHeader *luckyGiftsHeader;
|
|
|
|
|
2024-07-11 10:06:33 +08:00
|
|
|
@property (nonatomic, copy) NSArray<XPMineGamePartnerInfoModel *> *gameInfos;
|
|
|
|
|
2023-07-14 18:50:55 +08:00
|
|
|
@end
|
|
|
|
|
|
|
|
@implementation XPMineUserDataViewController
|
|
|
|
|
|
|
|
- (BOOL)isHiddenNavBar {
|
2023-08-10 16:25:34 +08:00
|
|
|
return YES;
|
2023-07-14 18:50:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
- (__kindof id)createPresenter {
|
2023-08-10 16:25:34 +08:00
|
|
|
return [[XPMineUserDataPresenter alloc] init];
|
2023-07-14 18:50:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)viewDidLoad {
|
|
|
|
[super viewDidLoad];
|
2024-09-19 18:58:23 +08:00
|
|
|
self.view.backgroundColor = UIColorFromRGB(0x08151A);
|
2024-09-20 20:16:20 +08:00
|
|
|
self.isDisplayMedalContent = YES;
|
2024-06-25 15:08:14 +08:00
|
|
|
|
2023-08-10 16:25:34 +08:00
|
|
|
[self initSubViews];
|
|
|
|
[self initSubViewConstraints];
|
2023-07-14 18:50:55 +08:00
|
|
|
}
|
2024-07-11 10:06:33 +08:00
|
|
|
|
2023-07-14 18:50:55 +08:00
|
|
|
#pragma mark - Private Method
|
|
|
|
- (void)initSubViews {
|
2023-08-10 16:25:34 +08:00
|
|
|
[self.view addSubview:self.tableView];
|
2023-07-14 18:50:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)initSubViewConstraints {
|
2023-08-10 16:25:34 +08:00
|
|
|
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
2024-06-25 19:18:51 +08:00
|
|
|
make.top.mas_equalTo(self.view).offset(14);
|
|
|
|
make.bottom.mas_equalTo(self.view).offset(-14);
|
2024-07-30 20:16:21 +08:00
|
|
|
make.leading.mas_equalTo(self.view).offset(14);
|
|
|
|
make.trailing.mas_equalTo(self.view).offset(-14);
|
2023-08-10 16:25:34 +08:00
|
|
|
}];
|
2023-07-14 18:50:55 +08:00
|
|
|
}
|
|
|
|
|
2024-06-25 19:18:51 +08:00
|
|
|
- (void)didTapGiftsSectionFoldButton {
|
|
|
|
self.isGiftsSectionExpand = !self.isGiftsSectionExpand;
|
|
|
|
self.giftsExpandButton.transform = self.isGiftsSectionExpand ? CGAffineTransformMakeRotation(M_PI) : CGAffineTransformIdentity;
|
|
|
|
[self.tableView reloadData];
|
|
|
|
}
|
|
|
|
|
|
|
|
- (void)didTapLuckyGiftsSectionFoldButton {
|
|
|
|
self.isLuckyGiftsSectionExpand = !self.isLuckyGiftsSectionExpand;
|
|
|
|
self.luckyGiftsExpandButton.transform = self.isLuckyGiftsSectionExpand ? CGAffineTransformMakeRotation(M_PI) : CGAffineTransformIdentity;
|
|
|
|
[self.tableView reloadData];
|
|
|
|
}
|
|
|
|
|
2024-07-11 10:06:33 +08:00
|
|
|
- (void)submitGameOrder:(XPMineGamePartnerInfoModel *)model round:(NSInteger)round {
|
|
|
|
@kWeakify(self);
|
|
|
|
[self showLoading];
|
|
|
|
[self.presenter submitOrder:^{
|
|
|
|
@kStrongify(self);
|
2024-07-11 18:57:34 +08:00
|
|
|
[self showSuccessToast:YMLocalizedString(@"GameOrderContent_18")];
|
2024-07-11 10:06:33 +08:00
|
|
|
if (self.delegate) {
|
|
|
|
[self.delegate dismissGameOrderView];
|
|
|
|
}
|
|
|
|
} failure:^(NSString * _Nonnull msg) {
|
|
|
|
@kStrongify(self);
|
|
|
|
[self showErrorToast:msg];
|
|
|
|
}
|
|
|
|
gameId:model.gameId
|
|
|
|
gameUid:model.uid
|
|
|
|
inning:round];
|
|
|
|
}
|
|
|
|
|
2024-12-28 15:41:56 +08:00
|
|
|
- (void)reloadView {
|
|
|
|
[self.tableView reloadData];
|
|
|
|
}
|
|
|
|
|
2023-07-14 18:50:55 +08:00
|
|
|
#pragma mark - UITableViewDelegate And UITableViewDataSource
|
|
|
|
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
2024-06-25 15:08:14 +08:00
|
|
|
return SectionTypeCount;
|
2023-07-14 18:50:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
2024-06-25 15:08:14 +08:00
|
|
|
switch (section) {
|
2024-07-11 10:06:33 +08:00
|
|
|
case GameMate:
|
|
|
|
return self.gameInfos.count;
|
|
|
|
break;
|
2024-06-25 15:08:14 +08:00
|
|
|
case Album:
|
|
|
|
return 1;
|
|
|
|
break;
|
2024-09-20 20:16:20 +08:00
|
|
|
case Guild:
|
2024-09-23 20:35:29 +08:00
|
|
|
return self.guildInfo == nil ? 0 : 1;
|
2024-09-20 20:16:20 +08:00
|
|
|
break;
|
2024-06-25 15:08:14 +08:00
|
|
|
case Medal:
|
2024-09-20 20:16:20 +08:00
|
|
|
return 0; //self.medalInfo.medalCount == 0 ? 0 : 1;
|
2024-06-25 15:08:14 +08:00
|
|
|
break;
|
|
|
|
case Gifts:
|
2024-09-20 20:16:20 +08:00
|
|
|
return 0;
|
2024-06-25 15:08:14 +08:00
|
|
|
break;
|
|
|
|
case LuckyGifts:
|
2024-09-20 20:16:20 +08:00
|
|
|
return 0;
|
|
|
|
break;
|
|
|
|
case MultipleContent:
|
2024-06-25 15:08:14 +08:00
|
|
|
return 1;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return 0;
|
|
|
|
break;
|
|
|
|
}
|
2023-07-14 18:50:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
2024-06-25 15:08:14 +08:00
|
|
|
switch (indexPath.section) {
|
2024-07-11 10:06:33 +08:00
|
|
|
case GameMate:
|
|
|
|
return 78.5;
|
|
|
|
break;
|
2024-06-25 15:08:14 +08:00
|
|
|
case Album:
|
2024-09-19 18:58:23 +08:00
|
|
|
// return 90;
|
2024-09-20 20:16:20 +08:00
|
|
|
return self.userInfo.privatePhoto.count == 0 ? 90 : [XPMineAlbumTableViewCell cellHeight:self.userInfo.privatePhoto.count];
|
|
|
|
break;
|
|
|
|
case Guild:
|
|
|
|
return self.guildInfo ? kGetScaleWidth(85 + 14) : 0;
|
2024-06-25 15:08:14 +08:00
|
|
|
break;
|
|
|
|
case Medal:
|
2024-09-20 20:16:20 +08:00
|
|
|
return 0;//140;
|
2024-06-25 15:08:14 +08:00
|
|
|
break;
|
|
|
|
case Gifts:
|
2024-09-20 20:16:20 +08:00
|
|
|
return 0;//[XPMineGiftsTableViewCell cellHeight:self.isGiftsSectionExpand
|
|
|
|
//source:self.giftWall];
|
2024-06-25 15:08:14 +08:00
|
|
|
break;
|
|
|
|
case LuckyGifts:
|
2024-09-20 20:16:20 +08:00
|
|
|
return 0;//[XPMineGiftsTableViewCell cellHeight:self.isLuckyGiftsSectionExpand
|
|
|
|
//source:self.luckyGiftWall];
|
|
|
|
break;
|
|
|
|
case MultipleContent:
|
|
|
|
return self.isDisplayMedalContent ? [XPMineMultipleContentTableViewCell cellHeightFro:self.medalInfo] : [XPMineMultipleContentTableViewCell cellHeightFro:self.giftWall
|
|
|
|
with:self.luckyGiftWall];
|
2024-06-25 15:08:14 +08:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return 0;
|
|
|
|
break;
|
2023-08-10 16:25:34 +08:00
|
|
|
}
|
|
|
|
}
|
2024-09-20 20:16:20 +08:00
|
|
|
|
2023-08-10 16:25:34 +08:00
|
|
|
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
|
2024-06-25 15:08:14 +08:00
|
|
|
switch (section) {
|
2024-07-11 10:06:33 +08:00
|
|
|
case GameMate:
|
|
|
|
return nil;
|
|
|
|
break;
|
2024-06-25 15:08:14 +08:00
|
|
|
case Album:
|
|
|
|
return nil;
|
|
|
|
break;
|
2024-09-20 20:16:20 +08:00
|
|
|
case Guild:
|
|
|
|
return nil;
|
|
|
|
break;
|
2024-06-25 15:08:14 +08:00
|
|
|
case Medal:
|
|
|
|
return nil;
|
|
|
|
break;
|
|
|
|
case Gifts:
|
2024-09-20 20:16:20 +08:00
|
|
|
return nil;//self.giftWall.count > 4 ? self.giftsExpandButton : nil;
|
2024-06-25 15:08:14 +08:00
|
|
|
break;
|
|
|
|
case LuckyGifts:
|
2024-09-20 20:16:20 +08:00
|
|
|
return nil;//self.luckyGiftWall.count > 4 ? self.luckyGiftsExpandButton : nil;
|
|
|
|
break;
|
|
|
|
case MultipleContent:
|
|
|
|
return nil;
|
2024-06-25 15:08:14 +08:00
|
|
|
break;
|
|
|
|
default:
|
2024-09-20 20:16:20 +08:00
|
|
|
return nil;
|
2024-06-25 15:08:14 +08:00
|
|
|
break;
|
|
|
|
}
|
2023-08-10 16:25:34 +08:00
|
|
|
}
|
|
|
|
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
|
2024-06-25 15:08:14 +08:00
|
|
|
switch (section) {
|
2024-07-11 10:06:33 +08:00
|
|
|
case GameMate:
|
|
|
|
return 0;
|
|
|
|
break;
|
2024-06-25 15:08:14 +08:00
|
|
|
case Album:
|
|
|
|
return 0;
|
|
|
|
break;
|
2024-09-20 20:16:20 +08:00
|
|
|
case Guild:
|
|
|
|
return 0;
|
|
|
|
break;
|
2024-06-25 15:08:14 +08:00
|
|
|
case Medal:
|
|
|
|
return 0;
|
|
|
|
break;
|
|
|
|
case Gifts:
|
2024-09-20 20:16:20 +08:00
|
|
|
return 0;//self.giftWall.count > 4 ? 20 : 0;
|
2024-06-25 15:08:14 +08:00
|
|
|
break;
|
|
|
|
case LuckyGifts:
|
2024-09-20 20:16:20 +08:00
|
|
|
return 0;//self.luckyGiftWall.count > 4 ? 20 : 0;
|
|
|
|
break;
|
|
|
|
case MultipleContent:
|
|
|
|
return 0;
|
2024-06-25 15:08:14 +08:00
|
|
|
break;
|
|
|
|
default:
|
|
|
|
return 0;
|
|
|
|
break;
|
|
|
|
}
|
2023-08-10 16:25:34 +08:00
|
|
|
}
|
|
|
|
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
|
2024-07-11 10:06:33 +08:00
|
|
|
switch (section) {
|
|
|
|
case GameMate:
|
2024-07-12 15:53:11 +08:00
|
|
|
return self.gameInfos.count > 0 ? 40 : 0;
|
2024-07-11 10:06:33 +08:00
|
|
|
break;
|
|
|
|
case Album:
|
2024-07-12 15:53:11 +08:00
|
|
|
return 40;
|
2024-07-11 10:06:33 +08:00
|
|
|
break;
|
2024-09-20 20:16:20 +08:00
|
|
|
case Guild:
|
|
|
|
return 40;
|
|
|
|
break;
|
2024-07-11 10:06:33 +08:00
|
|
|
case Medal:
|
2024-09-20 20:16:20 +08:00
|
|
|
return 0;// self.medalInfo.medalCount == 0 ? 0 : 30;
|
2024-07-11 10:06:33 +08:00
|
|
|
break;
|
|
|
|
case Gifts:
|
2024-09-20 20:16:20 +08:00
|
|
|
return 0;//50;
|
2024-07-11 10:06:33 +08:00
|
|
|
break;
|
|
|
|
case LuckyGifts:
|
2024-09-20 20:16:20 +08:00
|
|
|
return 0;//50;
|
|
|
|
break;
|
|
|
|
case MultipleContent:
|
|
|
|
return 0;
|
2024-07-11 10:06:33 +08:00
|
|
|
break;
|
|
|
|
default:
|
2024-07-12 15:53:11 +08:00
|
|
|
return 40;
|
2024-07-11 10:06:33 +08:00
|
|
|
break;
|
2024-06-27 21:31:00 +08:00
|
|
|
}
|
2023-08-10 16:25:34 +08:00
|
|
|
}
|
|
|
|
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
|
2024-06-25 15:08:14 +08:00
|
|
|
switch (section) {
|
2024-07-11 10:06:33 +08:00
|
|
|
case GameMate:
|
|
|
|
return self.gameInfos.count > 0 ? self.gameMateHeader : nil;
|
2024-06-25 15:08:14 +08:00
|
|
|
case Album:
|
|
|
|
return self.albumHeader;
|
|
|
|
break;
|
2024-09-20 20:16:20 +08:00
|
|
|
case Guild:
|
|
|
|
return self.guildHeader;
|
|
|
|
break;
|
2024-06-25 15:08:14 +08:00
|
|
|
case Medal:
|
2024-09-20 20:16:20 +08:00
|
|
|
return nil;//self.medalInfo.medalCount == 0 ? [UIView new] : self.medalHeader;
|
2024-06-25 15:08:14 +08:00
|
|
|
break;
|
|
|
|
case Gifts:
|
2024-09-20 20:16:20 +08:00
|
|
|
return nil;//self.giftsHeader;
|
2024-06-25 15:08:14 +08:00
|
|
|
break;
|
|
|
|
case LuckyGifts:
|
2024-09-20 20:16:20 +08:00
|
|
|
return nil;//self.luckyGiftsHeader;
|
|
|
|
break;
|
|
|
|
case MultipleContent:
|
|
|
|
return nil;
|
2024-06-25 15:08:14 +08:00
|
|
|
break;
|
|
|
|
default:
|
2024-09-20 20:16:20 +08:00
|
|
|
return nil;
|
2024-06-25 15:08:14 +08:00
|
|
|
break;
|
|
|
|
}
|
2023-07-14 18:50:55 +08:00
|
|
|
}
|
|
|
|
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
2024-06-25 15:08:14 +08:00
|
|
|
switch (indexPath.section) {
|
2024-07-11 10:06:33 +08:00
|
|
|
case GameMate: {
|
|
|
|
XPMineDataGameMateTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineDataGameMateTableViewCell class])
|
|
|
|
forIndexPath:indexPath];
|
|
|
|
cell.cellModel = [self.gameInfos xpSafeObjectAtIndex:indexPath.row];
|
2024-07-11 13:37:43 +08:00
|
|
|
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
2024-07-11 10:06:33 +08:00
|
|
|
@kWeakify(self);
|
|
|
|
[cell setDidTapOrder:^(XPMineGamePartnerInfoModel *model) {
|
2024-07-11 13:37:43 +08:00
|
|
|
@kStrongify(self);
|
2024-07-11 10:06:33 +08:00
|
|
|
if (self.delegate) {
|
|
|
|
[self.delegate showGameOrderView:model];
|
|
|
|
}
|
|
|
|
}];
|
|
|
|
return cell;
|
|
|
|
}
|
|
|
|
break;
|
2024-06-25 17:24:32 +08:00
|
|
|
case Album: {
|
|
|
|
XPMineAlbumTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineAlbumTableViewCell class])
|
|
|
|
forIndexPath:indexPath];
|
|
|
|
cell.albumDataSource = self.userInfo.privatePhoto;
|
|
|
|
return cell;
|
2023-08-10 16:25:34 +08:00
|
|
|
}
|
2024-06-25 15:08:14 +08:00
|
|
|
break;
|
2024-09-20 20:16:20 +08:00
|
|
|
case Guild:{
|
|
|
|
XPMineGuildTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineGuildTableViewCell class])
|
|
|
|
forIndexPath:indexPath];
|
|
|
|
cell.info = self.guildInfo;
|
|
|
|
return cell;
|
|
|
|
}
|
|
|
|
break;
|
2024-06-25 17:24:32 +08:00
|
|
|
case Medal: {
|
|
|
|
XPMineMedalsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineMedalsTableViewCell class])
|
|
|
|
forIndexPath:indexPath];
|
|
|
|
cell.medalsDataSource = self.medalInfo.userMedals;
|
|
|
|
return cell;
|
2024-06-25 15:08:14 +08:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
case Gifts:{
|
2024-07-11 10:06:33 +08:00
|
|
|
XPMineGiftsTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineGiftsTableViewCell class]) forIndexPath:indexPath];
|
2024-06-25 19:18:51 +08:00
|
|
|
cell.giftsDataSource = self.giftWall;
|
|
|
|
cell.isLucky = NO;
|
2024-06-25 15:08:14 +08:00
|
|
|
return cell;
|
|
|
|
}
|
|
|
|
break;
|
2024-06-25 17:24:32 +08:00
|
|
|
case LuckyGifts:{
|
2024-07-11 10:06:33 +08:00
|
|
|
XPMineGiftsTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineGiftsTableViewCell class]) forIndexPath:indexPath];
|
2024-06-25 19:18:51 +08:00
|
|
|
cell.giftsDataSource = self.luckyGiftWall;
|
|
|
|
cell.isLucky = YES;
|
2024-09-20 20:16:20 +08:00
|
|
|
return cell;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case MultipleContent: {
|
|
|
|
XPMineMultipleContentTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineMultipleContentTableViewCell class]) forIndexPath:indexPath];;
|
|
|
|
cell.medalModel = self.medalInfo;
|
|
|
|
cell.giftWall = self.giftWall;
|
|
|
|
cell.luckyGiftWall = self.luckyGiftWall;
|
|
|
|
[cell updateCell];
|
|
|
|
|
|
|
|
@kWeakify(self);
|
|
|
|
[cell setDidChangeCatalog:^(BOOL isMedal) {
|
|
|
|
@kStrongify(self);
|
|
|
|
self.isDisplayMedalContent = isMedal;
|
|
|
|
[self.tableView reloadData];
|
|
|
|
}];
|
|
|
|
|
2024-06-25 17:24:32 +08:00
|
|
|
return cell;
|
|
|
|
}
|
2024-06-25 15:08:14 +08:00
|
|
|
break;
|
|
|
|
default:
|
2024-07-17 17:49:33 +08:00
|
|
|
return [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMomentsEmptyTableViewCell class])];
|
2024-06-25 15:08:14 +08:00
|
|
|
break;
|
2023-08-10 16:25:34 +08:00
|
|
|
}
|
|
|
|
}
|
2024-06-25 19:18:51 +08:00
|
|
|
|
2023-08-10 16:25:34 +08:00
|
|
|
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
|
2024-09-27 11:17:04 +08:00
|
|
|
// if(indexPath.section == 0)return;
|
2023-08-10 16:25:34 +08:00
|
|
|
[tableView deselectRowAtIndexPath:indexPath animated:YES];
|
2024-09-27 11:17:04 +08:00
|
|
|
// if (self.datasource.count > 0) {
|
|
|
|
// XPMomentsDetailViewController * detailVC = [[XPMomentsDetailViewController alloc] init];
|
|
|
|
// MomentsInfoModel * monentsInfo = [self.datasource xpSafeObjectAtIndex:indexPath.row];
|
|
|
|
// if(monentsInfo.dynamicId == nil){
|
|
|
|
// return;
|
|
|
|
// }
|
|
|
|
// detailVC.momentsInfo = monentsInfo;
|
|
|
|
// detailVC.delegate = self;
|
|
|
|
// [self.navigationController pushViewController:detailVC animated:YES];
|
|
|
|
// }
|
2023-08-10 16:25:34 +08:00
|
|
|
}
|
2024-06-25 19:18:51 +08:00
|
|
|
|
2024-07-17 17:49:33 +08:00
|
|
|
#pragma mark - XPMomentsTableViewCellDelegate
|
|
|
|
- (void)XPMomentsTableViewCell:(XPMomentsTableViewCell *)view didClickLike:(MomentsInfoModel *)monentsInfo {
|
2023-08-10 16:25:34 +08:00
|
|
|
if(monentsInfo.dynamicId == nil){
|
|
|
|
[self showErrorToast:YMLocalizedString(@"XPMineUserDataViewController2")];
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
[self.presenter likeMonent:monentsInfo.dynamicId status:!monentsInfo.isLike likedUid:monentsInfo.uid worldId:[NSString stringWithFormat:@"%ld", monentsInfo.worldId]];
|
|
|
|
}
|
2024-07-17 17:49:33 +08:00
|
|
|
- (void)XPMomentsTableViewCell:(XPMomentsTableViewCell *)view didClicCommon:(MomentsInfoModel *)monentsInfo{
|
2023-08-10 16:25:34 +08:00
|
|
|
if(monentsInfo.dynamicId == nil){
|
|
|
|
[self showErrorToast:YMLocalizedString(@"XPMineUserDataViewController3")];
|
|
|
|
return;
|
|
|
|
}
|
2024-07-17 17:49:33 +08:00
|
|
|
XPMomentsDetailViewController * detailVC = [[XPMomentsDetailViewController alloc] init];
|
|
|
|
detailVC.momentsInfo = monentsInfo;
|
2023-08-10 16:25:34 +08:00
|
|
|
detailVC.delegate = self;
|
|
|
|
[self.navigationController pushViewController:detailVC animated:YES];
|
|
|
|
}
|
2024-07-17 17:49:33 +08:00
|
|
|
- (void)XPMomentsTableViewCell:(XPMomentsTableViewCell *)view didClicDelete:(MomentsInfoModel *)monentsInfo {
|
2023-08-10 16:25:34 +08:00
|
|
|
[TTPopup alertWithMessage:YMLocalizedString(@"XPMonentsMineViewController0") confirmHandler:^{
|
|
|
|
[self.presenter deleteMonents:monentsInfo.dynamicId worldId:[NSString stringWithFormat:@"%ld", monentsInfo.worldId]];
|
|
|
|
} cancelHandler:^{
|
|
|
|
|
|
|
|
}];
|
|
|
|
}
|
2024-07-17 17:49:33 +08:00
|
|
|
- (void)XPMomentsTableViewCell:(XPMomentsTableViewCell *)view didClicShielding:(nonnull MomentsInfoModel *)monentsInfo{
|
2023-08-10 16:25:34 +08:00
|
|
|
[self showLoading];
|
|
|
|
[self.presenter requesstShieldingWtihType:@"0" objId:monentsInfo.dynamicId];
|
|
|
|
}
|
2024-07-17 17:49:33 +08:00
|
|
|
- (void)XPMomentsTableViewCell:(XPMomentsTableViewCell *)view didClicFold:(MomentsInfoModel *)monentsInfo {
|
|
|
|
__block MomentsInfoModel * monentsInfos;
|
|
|
|
[self.datasource enumerateObjectsUsingBlock:^(MomentsInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
2023-08-10 16:25:34 +08:00
|
|
|
if (obj.dynamicId.integerValue == monentsInfo.dynamicId.integerValue) {
|
|
|
|
monentsInfos = obj;
|
|
|
|
*stop = YES;
|
|
|
|
}
|
|
|
|
}];
|
|
|
|
if (monentsInfos) {
|
|
|
|
NSInteger section = [self.datasource indexOfObject:monentsInfo];
|
2025-04-02 11:04:07 +08:00
|
|
|
[self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:section inSection:1]] withRowAnimation:UITableViewRowAnimationFade];
|
2023-08-10 16:25:34 +08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-07-17 17:49:33 +08:00
|
|
|
#pragma mark - XPMomentsDetailViewControllerDelegate
|
|
|
|
- (void)XPMomentsDetailViewController:(XPMomentsDetailViewController *)view deleteMoments:(NSString *)dynamicId {
|
|
|
|
__block MomentsInfoModel * deleteInfo;
|
|
|
|
[self.datasource enumerateObjectsUsingBlock:^(MomentsInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
2023-08-10 16:25:34 +08:00
|
|
|
if (obj.dynamicId.integerValue == dynamicId.integerValue) {
|
|
|
|
deleteInfo = obj;
|
|
|
|
}
|
|
|
|
}];
|
|
|
|
|
|
|
|
if (deleteInfo) {
|
|
|
|
[self.datasource removeObject:deleteInfo];
|
|
|
|
[self.tableView reloadData];
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-07-17 17:49:33 +08:00
|
|
|
#pragma mark - XPMomentsMineProtocol
|
2023-08-10 16:25:34 +08:00
|
|
|
- (void)requesstShieldingSuccess:(NSString *)monentsInfo{
|
|
|
|
[self hideHUD];
|
2024-07-17 17:49:33 +08:00
|
|
|
[self showSuccessToast:YMLocalizedString(@"XPMomentsMineViewController2")];
|
|
|
|
__block MomentsInfoModel * deleteInfo;
|
|
|
|
[self.datasource enumerateObjectsUsingBlock:^(MomentsInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
2023-08-10 16:25:34 +08:00
|
|
|
if (obj.dynamicId.integerValue == monentsInfo.integerValue) {
|
|
|
|
deleteInfo = obj;
|
|
|
|
}
|
|
|
|
}];
|
|
|
|
|
|
|
|
if (deleteInfo) {
|
|
|
|
[self.datasource removeObject:deleteInfo];
|
|
|
|
[self.tableView reloadData];
|
|
|
|
}
|
|
|
|
}
|
2024-07-17 17:49:33 +08:00
|
|
|
- (void)likeMomentsSuccess:(NSString *)dynamicId status:(BOOL)status {
|
|
|
|
[self.datasource enumerateObjectsUsingBlock:^(MomentsInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
2023-08-10 16:25:34 +08:00
|
|
|
if ([obj.dynamicId isEqualToString:dynamicId]) {
|
|
|
|
NSInteger likeCount = obj.likeCount.integerValue;
|
|
|
|
if (status) {
|
|
|
|
likeCount += 1;
|
|
|
|
obj.isLike += 1;
|
|
|
|
} else {
|
|
|
|
likeCount -= 1;
|
|
|
|
obj.isLike -= 1;
|
|
|
|
}
|
|
|
|
obj.likeCount = @(likeCount).stringValue;
|
|
|
|
*stop = YES;
|
|
|
|
}
|
|
|
|
}];
|
|
|
|
[self.tableView reloadData];
|
|
|
|
}
|
|
|
|
|
2024-07-17 17:49:33 +08:00
|
|
|
- (void)deleteMomentsSuccess:(NSString *)monentsInfo {
|
|
|
|
[self showSuccessToast:YMLocalizedString(@"XPMomentsMineViewController1")];
|
|
|
|
__block MomentsInfoModel * deleteInfo;
|
|
|
|
[self.datasource enumerateObjectsUsingBlock:^(MomentsInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
2023-08-10 16:25:34 +08:00
|
|
|
if (obj.dynamicId.integerValue == monentsInfo.integerValue) {
|
|
|
|
deleteInfo = obj;
|
|
|
|
}
|
|
|
|
}];
|
|
|
|
|
|
|
|
if (deleteInfo) {
|
|
|
|
[self.datasource removeObject:deleteInfo];
|
|
|
|
[self.tableView reloadData];
|
|
|
|
}
|
2023-07-14 18:50:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#pragma mark - XPMineDataGiftTableViewCellDelegate
|
|
|
|
- (void)xPMineDataGiftTableViewCell:(XPMineDataGiftTableViewCell *)view didClickMore:(UIButton *)sender {
|
2023-08-10 16:25:34 +08:00
|
|
|
XPMineUserInfoGiftWallViewController * giftWallVC = [[XPMineUserInfoGiftWallViewController alloc] init];
|
|
|
|
giftWallVC.userUid = self.userUid;
|
|
|
|
[self.navigationController pushViewController:giftWallVC animated:YES];
|
|
|
|
}
|
|
|
|
|
2023-07-14 18:50:55 +08:00
|
|
|
#pragma mark - JXPagingViewListViewDelegate
|
|
|
|
- (UIView *)listView {
|
2023-08-10 16:25:34 +08:00
|
|
|
return self.view;
|
2023-07-14 18:50:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
- (UIScrollView *)listScrollView {
|
2023-08-10 16:25:34 +08:00
|
|
|
return self.tableView;
|
2023-07-14 18:50:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)listViewDidScrollCallback:(void (^)(UIScrollView *))callback {
|
2023-08-10 16:25:34 +08:00
|
|
|
self.scrollCallback = callback;
|
2023-07-14 18:50:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
|
2023-08-10 16:25:34 +08:00
|
|
|
self.scrollCallback(scrollView);
|
2023-07-14 18:50:55 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
#pragma mark - Getters And Setters
|
|
|
|
- (void)setUserInfo:(UserInfoModel *)userInfo {
|
2023-08-10 16:25:34 +08:00
|
|
|
_userInfo = userInfo;
|
2024-06-25 19:18:51 +08:00
|
|
|
self.albumHeader.num = [NSString stringWithFormat:@"(%ld)", (long)userInfo.privatePhoto.count];
|
2023-08-10 16:25:34 +08:00
|
|
|
[self.tableView reloadData];
|
2024-06-27 21:31:00 +08:00
|
|
|
|
|
|
|
if (userInfo.uid != [[AccountInfoStorage instance].getUid integerValue]) {
|
|
|
|
self.albumHeader.hasMore = NO;
|
|
|
|
}
|
2024-07-11 10:06:33 +08:00
|
|
|
|
|
|
|
@kWeakify(self);
|
|
|
|
[self.presenter loadGamePartnerInfoList:^(NSArray<XPMineGamePartnerInfoModel *> * _Nonnull infos) {
|
|
|
|
@kStrongify(self);
|
|
|
|
self.gameInfos = infos;
|
|
|
|
[self.tableView reloadData];
|
|
|
|
} uid:userInfo.uid];
|
2023-08-10 16:25:34 +08:00
|
|
|
}
|
2024-07-17 17:49:33 +08:00
|
|
|
- (void)setDynamicInfo:(NSArray<MomentsInfoModel *> *)dynamicInfo {
|
2023-08-10 16:25:34 +08:00
|
|
|
[self.datasource removeAllObjects];
|
|
|
|
[self.datasource addObjectsFromArray:dynamicInfo];
|
|
|
|
[self.tableView reloadData];
|
2024-06-25 15:08:14 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
- (void)setMedalInfo:(MedalModel *)medalInfo {
|
|
|
|
_medalInfo = medalInfo;
|
|
|
|
self.medalHeader.num = [NSString stringWithFormat:@"(%ld)", (long)medalInfo.medalCount];
|
|
|
|
[self.tableView reloadData];
|
2023-07-14 18:50:55 +08:00
|
|
|
}
|
2024-06-25 15:08:14 +08:00
|
|
|
|
2024-09-20 20:16:20 +08:00
|
|
|
- (void)setGuildInfo:(GuildInfo *)guildInfo {
|
|
|
|
_guildInfo = guildInfo;
|
|
|
|
[self.tableView reloadData];
|
|
|
|
}
|
|
|
|
|
2023-07-14 18:50:55 +08:00
|
|
|
- (UITableView *)tableView {
|
2023-08-10 16:25:34 +08:00
|
|
|
if (!_tableView) {
|
|
|
|
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
|
|
|
|
_tableView.delegate = self;
|
|
|
|
_tableView.dataSource = self;
|
|
|
|
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
2024-09-27 11:17:04 +08:00
|
|
|
_tableView.showsVerticalScrollIndicator = NO;
|
2024-09-19 18:58:23 +08:00
|
|
|
_tableView.backgroundColor = [UIColor clearColor];
|
2023-08-10 16:25:34 +08:00
|
|
|
if (@available(iOS 11.0, *)) {
|
|
|
|
_tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
|
|
|
}
|
2024-07-11 10:06:33 +08:00
|
|
|
[_tableView registerClass:[XPMineDataGameMateTableViewCell class]
|
|
|
|
forCellReuseIdentifier:NSStringFromClass([XPMineDataGameMateTableViewCell class])];
|
2024-06-25 15:08:14 +08:00
|
|
|
[_tableView registerClass:[XPMineAlbumTableViewCell class]
|
|
|
|
forCellReuseIdentifier:NSStringFromClass([XPMineAlbumTableViewCell class])];
|
|
|
|
[_tableView registerClass:[XPMineMedalsTableViewCell class]
|
|
|
|
forCellReuseIdentifier:NSStringFromClass([XPMineMedalsTableViewCell class])];
|
2024-06-25 17:24:32 +08:00
|
|
|
[_tableView registerClass:[XPMineGiftsTableViewCell class]
|
|
|
|
forCellReuseIdentifier:NSStringFromClass([XPMineGiftsTableViewCell class])];
|
2024-07-17 17:49:33 +08:00
|
|
|
[_tableView registerClass:[XPMomentsEmptyTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMomentsEmptyTableViewCell class])];
|
2024-06-25 15:08:14 +08:00
|
|
|
[_tableView registerClass:[XPMineDataGiftTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineDataGiftTableViewCell class])];
|
2024-09-20 20:16:20 +08:00
|
|
|
[_tableView registerClass:[XPMineGuildTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineGuildTableViewCell class])];
|
|
|
|
[_tableView registerClass:[XPMineMultipleContentTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineMultipleContentTableViewCell class])];
|
|
|
|
|
|
|
|
UIView *footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, 0, kSafeAreaBottomHeight)];
|
2024-09-23 18:01:54 +08:00
|
|
|
footer.backgroundColor = [UIColor clearColor];
|
2024-09-20 20:16:20 +08:00
|
|
|
_tableView.tableFooterView = footer;
|
|
|
|
|
2024-06-27 21:31:00 +08:00
|
|
|
if (isMSRTL()) {
|
|
|
|
_tableView.semanticContentAttribute = UISemanticContentAttributeForceRightToLeft;
|
|
|
|
}
|
2023-08-10 16:25:34 +08:00
|
|
|
}
|
|
|
|
return _tableView;
|
|
|
|
}
|
2024-06-25 15:08:14 +08:00
|
|
|
|
2024-07-17 17:49:33 +08:00
|
|
|
- (NSMutableArray<MomentsInfoModel *> *)datasource {
|
2023-08-10 16:25:34 +08:00
|
|
|
if (!_datasource) {
|
|
|
|
_datasource = [NSMutableArray array];
|
|
|
|
}
|
|
|
|
return _datasource;
|
|
|
|
}
|
2024-06-25 15:08:14 +08:00
|
|
|
|
2024-07-11 10:06:33 +08:00
|
|
|
- (XPMineUserSectionHeader *)gameMateHeader {
|
|
|
|
if (!_gameMateHeader) {
|
|
|
|
_gameMateHeader = [[XPMineUserSectionHeader alloc] init];
|
2024-07-11 18:57:34 +08:00
|
|
|
_gameMateHeader.title = YMLocalizedString(@"GameOrderContent_0");
|
2024-07-11 10:06:33 +08:00
|
|
|
_gameMateHeader.hasMore = NO;
|
|
|
|
}
|
|
|
|
return _gameMateHeader;
|
|
|
|
}
|
|
|
|
|
2024-06-25 15:08:14 +08:00
|
|
|
- (XPMineUserSectionHeader *)albumHeader {
|
|
|
|
if (!_albumHeader) {
|
|
|
|
_albumHeader = [[XPMineUserSectionHeader alloc] init];
|
2024-06-27 21:31:00 +08:00
|
|
|
_albumHeader.title = YMLocalizedString(@"QinputPhotoView1");
|
2024-06-25 15:08:14 +08:00
|
|
|
_albumHeader.hasMore = YES;
|
|
|
|
@kWeakify(self);
|
|
|
|
_albumHeader.didTapMore = ^{
|
|
|
|
@kStrongify(self);
|
2024-06-25 19:18:51 +08:00
|
|
|
XPMineUserInfoAlbumViewController * albumVC = [[XPMineUserInfoAlbumViewController alloc] init];
|
|
|
|
[self.navigationController pushViewController:albumVC animated:YES];
|
2024-06-25 15:08:14 +08:00
|
|
|
};
|
|
|
|
}
|
|
|
|
return _albumHeader;
|
|
|
|
}
|
|
|
|
|
2024-09-20 20:16:20 +08:00
|
|
|
- (XPMineUserSectionHeader *)guildHeader {
|
|
|
|
if (!_guildHeader) {
|
|
|
|
_guildHeader = [[XPMineUserSectionHeader alloc] init];
|
2024-09-23 20:35:29 +08:00
|
|
|
_guildHeader.title = YMLocalizedString(@"UserDetail_0");
|
2024-09-20 20:16:20 +08:00
|
|
|
_guildHeader.hasMore = NO;
|
|
|
|
}
|
|
|
|
return _guildHeader;
|
|
|
|
}
|
|
|
|
|
2024-06-25 15:08:14 +08:00
|
|
|
- (XPMineUserSectionHeader *)medalHeader {
|
|
|
|
if (!_medalHeader) {
|
|
|
|
_medalHeader = [[XPMineUserSectionHeader alloc] init];
|
2024-06-27 21:31:00 +08:00
|
|
|
_medalHeader.title = YMLocalizedString(@"XPMineDataGiftTableViewCell2");
|
2024-06-25 15:08:14 +08:00
|
|
|
_medalHeader.num = @"(0)";
|
|
|
|
_medalHeader.hasMore = NO;
|
|
|
|
}
|
|
|
|
return _medalHeader;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (XPMineUserSectionHeader *)giftsHeader {
|
|
|
|
if (!_giftsHeader) {
|
|
|
|
_giftsHeader = [[XPMineUserSectionHeader alloc] init];
|
2024-06-27 21:31:00 +08:00
|
|
|
_giftsHeader.title = YMLocalizedString(@"XPMineDataGiftTableViewCell0");
|
2024-06-25 15:08:14 +08:00
|
|
|
_giftsHeader.hasMore = NO;
|
|
|
|
}
|
|
|
|
return _giftsHeader;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (XPMineUserSectionHeader *)luckyGiftsHeader {
|
|
|
|
if (!_luckyGiftsHeader) {
|
|
|
|
_luckyGiftsHeader = [[XPMineUserSectionHeader alloc] init];
|
2024-06-27 21:31:00 +08:00
|
|
|
_luckyGiftsHeader.title = YMLocalizedString(@"XPMineDataGiftTableViewCell1");
|
2024-06-25 15:08:14 +08:00
|
|
|
_luckyGiftsHeader.hasMore = NO;
|
|
|
|
}
|
|
|
|
return _luckyGiftsHeader;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (UIButton *)giftsExpandButton {
|
|
|
|
if (!_giftsExpandButton) {
|
|
|
|
_giftsExpandButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
2024-06-27 21:31:00 +08:00
|
|
|
[_giftsExpandButton setImage:[UIImage imageNamed:@"common_down_arrow"] forState:UIControlStateNormal];
|
2024-06-25 19:18:51 +08:00
|
|
|
[_giftsExpandButton addTarget:self action:@selector(didTapGiftsSectionFoldButton) forControlEvents:UIControlEventTouchUpInside];
|
2024-06-25 15:08:14 +08:00
|
|
|
_giftsExpandButton.selected = YES;
|
|
|
|
[_giftsExpandButton setEnlargeEdgeWithTop:5 right:10 bottom:10 left:10];
|
|
|
|
}
|
|
|
|
return _giftsExpandButton;
|
|
|
|
}
|
|
|
|
|
|
|
|
- (UIButton *)luckyGiftsExpandButton {
|
|
|
|
if (!_luckyGiftsExpandButton) {
|
|
|
|
_luckyGiftsExpandButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
2024-06-27 21:31:00 +08:00
|
|
|
[_luckyGiftsExpandButton setImage:[UIImage imageNamed:@"common_down_arrow"] forState:UIControlStateNormal];
|
2024-06-25 19:18:51 +08:00
|
|
|
[_luckyGiftsExpandButton addTarget:self action:@selector(didTapLuckyGiftsSectionFoldButton) forControlEvents:UIControlEventTouchUpInside];
|
2024-06-25 15:08:14 +08:00
|
|
|
_luckyGiftsExpandButton.selected = YES;
|
|
|
|
[_luckyGiftsExpandButton setEnlargeEdgeWithTop:5 right:10 bottom:10 left:10];
|
2023-08-10 16:25:34 +08:00
|
|
|
}
|
2024-06-25 15:08:14 +08:00
|
|
|
return _luckyGiftsExpandButton;
|
2023-07-14 18:50:55 +08:00
|
|
|
}
|
|
|
|
@end
|