完善个人资料页-相册/勋章

This commit is contained in:
eggmanQQQ
2024-06-25 15:08:14 +08:00
parent 8026d3376b
commit 18f9aca9f8
36 changed files with 954 additions and 126 deletions

View File

@@ -530,6 +530,9 @@
54C389672C24464600FD47B1 /* HomeMineRoomModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 54C389662C24464600FD47B1 /* HomeMineRoomModel.m */; };
54F4692F2C280CF100A83655 /* XPMineUserInfoViewControllerV2.m in Sources */ = {isa = PBXBuildFile; fileRef = 54F4692E2C280CF100A83655 /* XPMineUserInfoViewControllerV2.m */; };
54F469352C29711400A83655 /* XPMomentUserDataViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 54F469342C29711400A83655 /* XPMomentUserDataViewController.m */; };
54F469382C29C3B400A83655 /* XPMineAlbumTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 54F469372C29C3B400A83655 /* XPMineAlbumTableViewCell.m */; };
54F4693B2C2A984D00A83655 /* MedalModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 54F4693A2C2A984D00A83655 /* MedalModel.m */; };
54F4693E2C2A9D4E00A83655 /* XPMineMedalsTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 54F4693D2C2A9D4E00A83655 /* XPMineMedalsTableViewCell.m */; };
73FFADDC93E195344047A2EC /* Pods_YuMi.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CACF623970097D653132D69A /* Pods_YuMi.framework */; };
9B0086C627BA392B0032BD2B /* AnchorStageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B0086C527BA392B0032BD2B /* AnchorStageView.m */; };
9B0086CA27BA4F570032BD2B /* AnchorMicroView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B0086C927BA4F570032BD2B /* AnchorMicroView.m */; };
@@ -2588,6 +2591,12 @@
54F4692E2C280CF100A83655 /* XPMineUserInfoViewControllerV2.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineUserInfoViewControllerV2.m; sourceTree = "<group>"; };
54F469332C29711400A83655 /* XPMomentUserDataViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMomentUserDataViewController.h; sourceTree = "<group>"; };
54F469342C29711400A83655 /* XPMomentUserDataViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMomentUserDataViewController.m; sourceTree = "<group>"; };
54F469362C29C3B400A83655 /* XPMineAlbumTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineAlbumTableViewCell.h; sourceTree = "<group>"; };
54F469372C29C3B400A83655 /* XPMineAlbumTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineAlbumTableViewCell.m; sourceTree = "<group>"; };
54F469392C2A984D00A83655 /* MedalModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MedalModel.h; sourceTree = "<group>"; };
54F4693A2C2A984D00A83655 /* MedalModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MedalModel.m; sourceTree = "<group>"; };
54F4693C2C2A9D4E00A83655 /* XPMineMedalsTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineMedalsTableViewCell.h; sourceTree = "<group>"; };
54F4693D2C2A9D4E00A83655 /* XPMineMedalsTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineMedalsTableViewCell.m; sourceTree = "<group>"; };
7DB00EC07F1D0ADFF900B38D /* Pods-YuMi.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YuMi.debug.xcconfig"; path = "Target Support Files/Pods-YuMi/Pods-YuMi.debug.xcconfig"; sourceTree = "<group>"; };
9B0086C427BA392B0032BD2B /* AnchorStageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AnchorStageView.h; sourceTree = "<group>"; };
9B0086C527BA392B0032BD2B /* AnchorStageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AnchorStageView.m; sourceTree = "<group>"; };
@@ -4954,6 +4963,8 @@
E8EEB8F626FC2673007C6EBA /* UserPhoto.m */,
9B2A12DC2783FEDD00CED41B /* UserVipInfoVo.h */,
9B2A12DD2783FEDD00CED41B /* UserVipInfoVo.m */,
54F469392C2A984D00A83655 /* MedalModel.h */,
54F4693A2C2A984D00A83655 /* MedalModel.m */,
);
path = Model;
sourceTree = "<group>";
@@ -10960,6 +10971,10 @@
E8B846C126FD82DC00A777FE /* XPMineUserInfoAlbumCollectionViewCell.m */,
E8D34D4B28080351009C4835 /* XPMineDataClanTableViewCell.h */,
E8D34D4C28080351009C4835 /* XPMineDataClanTableViewCell.m */,
54F469362C29C3B400A83655 /* XPMineAlbumTableViewCell.h */,
54F469372C29C3B400A83655 /* XPMineAlbumTableViewCell.m */,
54F4693C2C2A9D4E00A83655 /* XPMineMedalsTableViewCell.h */,
54F4693D2C2A9D4E00A83655 /* XPMineMedalsTableViewCell.m */,
E8D34D4E28080362009C4835 /* XPMineDataGiftTableViewCell.h */,
E8D34D4F28080362009C4835 /* XPMineDataGiftTableViewCell.m */,
E8D34D5428080393009C4835 /* XPMineDataGiftCollectionViewCell.h */,
@@ -11499,6 +11514,7 @@
238B37A62AC55A2C00BFC9D5 /* TreasureFairySendRecordModel.m in Sources */,
E8AB632F28AE19DE0023B0D2 /* XPMonentMinePresenter.m in Sources */,
E85E7B042A4EB0D200B6D00A /* XPGuildIncomeDetailPresenter.m in Sources */,
54F4693E2C2A9D4E00A83655 /* XPMineMedalsTableViewCell.m in Sources */,
9BD9A17C27A0EE24004186FE /* XPMineVisitorViewController.m in Sources */,
2369F9912A89CE0E00563B48 /* PIUserSexView.m in Sources */,
238B37D92AC55A2C00BFC9D5 /* XPTreasureFairyTrialsRecordView.m in Sources */,
@@ -11537,6 +11553,7 @@
23FE47D82BB3CEAF00F09D23 /* PINobleCenterTitleView.m in Sources */,
9BD9A18427A0F128004186FE /* XPMineVisitorItemModel.m in Sources */,
E852D73E28631C18001465ED /* XPMonentsCommentTableViewCell.m in Sources */,
54F4693B2C2A984D00A83655 /* MedalModel.m in Sources */,
23CEFC4E2AFB8FC100576D89 /* BSNSDictionary.m in Sources */,
23FF426A2AA5DF050055733C /* XPNewHomePartyTagView.m in Sources */,
E85E7BA22A4EC99300B6D00A /* XPMineGiveDiamondSearchModel.m in Sources */,
@@ -11546,6 +11563,7 @@
E87E62682A3F571D002F68C9 /* XPHomeContainerPresenter.m in Sources */,
E8EEB8F326FC2050007C6EBA /* SDWaitingView.m in Sources */,
E85E7B2F2A4EB0D300B6D00A /* XPGoldIncomeSectionView.m in Sources */,
54F469382C29C3B400A83655 /* XPMineAlbumTableViewCell.m in Sources */,
23E9EAA12A84C53900B792F2 /* TTNewAlertView.m in Sources */,
238B37BC2AC55A2C00BFC9D5 /* XPTreasureFairySendView.m in Sources */,
E8DEC9A12764A5D20078CB70 /* XPRoomMoreItemModel.m in Sources */,

View File

@@ -72,7 +72,7 @@
buildConfiguration = "Debug">
</AnalyzeAction>
<ArchiveAction
buildConfiguration = "Debug"
buildConfiguration = "Release"
revealArchiveInOrganizer = "YES">
</ArchiveAction>
</Scheme>

View File

@@ -39,7 +39,7 @@ typedef NS_ENUM(NSUInteger, ImageType){
///空白头像缺省图
+ (UIImage *)defaultEmptyAvatarPlaceholder;
/// 空白图的占位图
+ (UIImage *)defalutEmptyPlaceholder;
+ (UIImage *)defaultEmptyPlaceholder;
/// banner的占位图
+ (UIImage *)defaultBannerPlaceholder;

View File

@@ -36,7 +36,7 @@ NSString * const kImageTypeMonentsPhoto = @"imageMogr2/auto-orient/thumbnail/400
}
///
+ (UIImage *)defalutEmptyPlaceholder {
+ (UIImage *)defaultEmptyPlaceholder {
return [UIImage imageNamed:@"common_empty"];
}
/// banner

View File

@@ -52,7 +52,7 @@
if (!_emptyImageView) {
_emptyImageView = [[UIImageView alloc] init];
_emptyImageView.userInteractionEnabled = YES;
_emptyImageView.image = [UIImageConstant defalutEmptyPlaceholder];
_emptyImageView.image = [UIImageConstant defaultEmptyPlaceholder];
_emptyImageView.layer.masksToBounds = YES;
_emptyImageView.contentMode = UIViewContentModeScaleAspectFit;
}

View File

@@ -52,7 +52,7 @@
if (!_emptyImageView) {
_emptyImageView = [[UIImageView alloc] init];
_emptyImageView.userInteractionEnabled = YES;
_emptyImageView.image = [UIImageConstant defalutEmptyPlaceholder];
_emptyImageView.image = [UIImageConstant defaultEmptyPlaceholder];
_emptyImageView.layer.masksToBounds = YES;
_emptyImageView.contentMode = UIViewContentModeScaleAspectFit;
}

View File

@@ -61,7 +61,7 @@
if (!_emptyImageView) {
_emptyImageView = [[UIImageView alloc] init];
_emptyImageView.userInteractionEnabled = YES;
_emptyImageView.image = [UIImageConstant defalutEmptyPlaceholder];
_emptyImageView.image = [UIImageConstant defaultEmptyPlaceholder];
_emptyImageView.layer.masksToBounds = YES;
_emptyImageView.contentMode = UIViewContentModeScaleAspectFit;
}

View File

@@ -0,0 +1,18 @@
//
// XPMineAlbumTableViewCell.h
// YuMi
//
// Created by P on 2024/6/24.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XPMineAlbumTableViewCell : UITableViewCell
@property (nonatomic, copy) NSArray *albumDataSource;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,125 @@
//
// XPMineAlbumTableViewCell.m
// YuMi
//
// Created by P on 2024/6/24.
//
#import "XPMineAlbumTableViewCell.h"
#import "UserPhoto.h"
@interface XPMineAlbumCell : UICollectionViewCell
@property (nonatomic, strong) NetImageView *imageView;
@end
@implementation XPMineAlbumCell
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
NetImageConfig * config = [[NetImageConfig alloc]init];
config.imageType = ImageTypeUserIcon;
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
_imageView = [[NetImageView alloc] initWithConfig:config];
_imageView.layer.masksToBounds = YES;
_imageView.layer.cornerRadius = 12;
[self.contentView addSubview:_imageView];
[_imageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.contentView);
}];
}
return self;
}
@end
@interface XPMineAlbumTableViewCell() <UICollectionViewDelegateFlowLayout, UICollectionViewDataSource>
@property (nonatomic, strong) UICollectionView *albumCollectionView;
@property (nonatomic, strong) UILabel *noDataLabel;
@end
@implementation XPMineAlbumTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.contentView.backgroundColor = [UIColor whiteColor];
[self.contentView addSubview:self.albumCollectionView];
[self.albumCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.contentView).offset(14);
make.edges.mas_equalTo(self.contentView);
}];
[self.contentView addSubview:self.noDataLabel];
[self.noDataLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(self.contentView);
}];
}
return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
}
- (void)setAlbumDataSource:(NSArray *)albumDataSource {
_albumDataSource = albumDataSource;
self.noDataLabel.hidden = albumDataSource.count > 0;
[self.albumCollectionView reloadData];
}
#pragma mark - UICollectionViewDataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.albumDataSource.count;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
XPMineAlbumCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"Album Cell"
forIndexPath:indexPath];
for (UserPhoto *photo in self.albumDataSource) {
cell.imageView.imageUrl = photo.photoUrl;
}
return cell;
}
#pragma mark - UICollectionViewDelegateFlowLayout
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
return CGSizeMake(80, 80);
}
#pragma mark -
- (UICollectionView *)albumCollectionView {
if (!_albumCollectionView) {
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
layout.minimumInteritemSpacing = 10;
layout.minimumLineSpacing = 10;
_albumCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero
collectionViewLayout:layout];
_albumCollectionView.backgroundColor = [UIColor clearColor];
_albumCollectionView.delegate = self;
_albumCollectionView.dataSource = self;
[_albumCollectionView registerClass:[XPMineAlbumCell class]
forCellWithReuseIdentifier:@"Album Cell"];
}
return _albumCollectionView;
}
- (UILabel *)noDataLabel {
if (!_noDataLabel) {
_noDataLabel = [UILabel labelInitWithText:@"暂无照片" font:[UIFont systemFontOfSize:14 weight:UIFontWeightMedium] textColor:UIColorFromRGB(0x191919)];
_noDataLabel.textAlignment = NSTextAlignmentCenter;
_noDataLabel.alpha = 0.5;
_noDataLabel.hidden = YES;
}
return _noDataLabel;
}
@end

View File

@@ -0,0 +1,18 @@
//
// XPMineMedalsTableViewCell.h
// YuMi
//
// Created by P on 2024/6/25.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface XPMineMedalsTableViewCell : UITableViewCell
@property (nonatomic, copy) NSArray *medalsDataSource;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,125 @@
//
// XPMineMedalsTableViewCell.m
// YuMi
//
// Created by P on 2024/6/25.
//
#import "XPMineMedalsTableViewCell.h"
#import "MedalModel.h"
@interface XPMineMedalCell : UICollectionViewCell
@property (nonatomic, strong) NetImageView *imageView;
@end
@implementation XPMineMedalCell
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
NetImageConfig * config = [[NetImageConfig alloc]init];
config.imageType = ImageTypeUserIcon;
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
_imageView = [[NetImageView alloc] initWithConfig:config];
_imageView.layer.masksToBounds = YES;
_imageView.layer.cornerRadius = 12;
[self.contentView addSubview:_imageView];
[_imageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.contentView);
}];
}
return self;
}
@end
@interface XPMineMedalsTableViewCell() <UICollectionViewDelegateFlowLayout, UICollectionViewDataSource>
@property (nonatomic, strong) UICollectionView *medalsCollectionView;
@property (nonatomic, strong) UILabel *noDataLabel;
@end
@implementation XPMineMedalsTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.contentView.backgroundColor = [UIColor whiteColor];
[self.contentView addSubview:self.medalsCollectionView];
[self.medalsCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.contentView).offset(14);
make.edges.mas_equalTo(self.contentView);
}];
[self.contentView addSubview:self.noDataLabel];
[self.noDataLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(self.contentView);
}];
}
return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
}
- (void)setMedalsDataSource:(NSArray *)medalsDataSource {
_medalsDataSource = medalsDataSource;
self.noDataLabel.hidden = medalsDataSource.count > 0;
[self.medalsCollectionView reloadData];
}
#pragma mark - UICollectionViewDataSource
- (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section {
return self.medalsDataSource.count;
}
- (UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
XPMineMedalCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:@"Medal Cell"
forIndexPath:indexPath];
for (UserMedalModel *userMedal in self.medalsDataSource) {
cell.imageView.imageUrl = userMedal.picUrl;
}
return cell;
}
#pragma mark - UICollectionViewDelegateFlowLayout
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
return CGSizeMake(80, 80);
}
#pragma mark -
- (UICollectionView *)medalsCollectionView {
if (!_medalsCollectionView) {
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
layout.minimumInteritemSpacing = 10;
layout.minimumLineSpacing = 10;
_medalsCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero
collectionViewLayout:layout];
_medalsCollectionView.backgroundColor = [UIColor clearColor];
_medalsCollectionView.delegate = self;
_medalsCollectionView.dataSource = self;
[_medalsCollectionView registerClass:[XPMineMedalCell class]
forCellWithReuseIdentifier:@"Medal Cell"];
}
return _medalsCollectionView;
}
- (UILabel *)noDataLabel {
if (!_noDataLabel) {
_noDataLabel = [UILabel labelInitWithText:@"暂无勋章" font:[UIFont systemFontOfSize:14 weight:UIFontWeightMedium] textColor:UIColorFromRGB(0x191919)];
_noDataLabel.textAlignment = NSTextAlignmentCenter;
_noDataLabel.alpha = 0.5;
_noDataLabel.hidden = YES;
}
return _noDataLabel;
}
@end

View File

@@ -62,7 +62,7 @@
if (!_emptyImageView) {
_emptyImageView = [[UIImageView alloc] init];
_emptyImageView.userInteractionEnabled = YES;
_emptyImageView.image = [UIImageConstant defalutEmptyPlaceholder];
_emptyImageView.image = [UIImageConstant defaultEmptyPlaceholder];
_emptyImageView.layer.masksToBounds = YES;
_emptyImageView.contentMode = UIViewContentModeScaleAspectFit;
}

View File

@@ -60,7 +60,7 @@
if (!_emptyImageView) {
_emptyImageView = [[UIImageView alloc] init];
_emptyImageView.userInteractionEnabled = YES;
_emptyImageView.image = [UIImageConstant defalutEmptyPlaceholder];
_emptyImageView.image = [UIImageConstant defaultEmptyPlaceholder];
_emptyImageView.layer.masksToBounds = YES;
_emptyImageView.contentMode = UIViewContentModeScaleAspectFit;
}

View File

@@ -57,7 +57,7 @@
if (!_emptyImageView) {
_emptyImageView = [[UIImageView alloc] init];
_emptyImageView.userInteractionEnabled = YES;
_emptyImageView.image = [UIImageConstant defalutEmptyPlaceholder];
_emptyImageView.image = [UIImageConstant defaultEmptyPlaceholder];
_emptyImageView.layer.masksToBounds = YES;
_emptyImageView.contentMode = UIViewContentModeScaleAspectFit;
}

View File

@@ -58,7 +58,7 @@
if (!_emptyImageView) {
_emptyImageView = [[UIImageView alloc] init];
_emptyImageView.userInteractionEnabled = YES;
_emptyImageView.image = [UIImageConstant defalutEmptyPlaceholder];
_emptyImageView.image = [UIImageConstant defaultEmptyPlaceholder];
_emptyImageView.layer.masksToBounds = YES;
_emptyImageView.contentMode = UIViewContentModeScaleAspectFit;
}

View File

@@ -58,7 +58,7 @@
if (!_emptyImageView) {
_emptyImageView = [[UIImageView alloc] init];
_emptyImageView.userInteractionEnabled = YES;
_emptyImageView.image = [UIImageConstant defalutEmptyPlaceholder];
_emptyImageView.image = [UIImageConstant defaultEmptyPlaceholder];
_emptyImageView.layer.masksToBounds = YES;
_emptyImageView.contentMode = UIViewContentModeScaleAspectFit;
}

View File

@@ -58,7 +58,7 @@
if (!_emptyImageView) {
_emptyImageView = [[UIImageView alloc] init];
_emptyImageView.userInteractionEnabled = YES;
_emptyImageView.image = [UIImageConstant defalutEmptyPlaceholder];
_emptyImageView.image = [UIImageConstant defaultEmptyPlaceholder];
_emptyImageView.layer.masksToBounds = YES;
_emptyImageView.contentMode = UIViewContentModeScaleAspectFit;
}

View File

@@ -8,6 +8,7 @@
#import "MvpViewController.h"
#import <JXPagingView/JXPagerView.h>
#import "MonentsInfoModel.h"
@class MedalModel;
NS_ASSUME_NONNULL_BEGIN
@class UserInfoModel, MineSkillCardListInfoModel, XPMineUserDataViewController;
@@ -22,6 +23,7 @@ NS_ASSUME_NONNULL_BEGIN
///用户信息
@property (nonatomic,strong) UserInfoModel *userInfo;
@property (nonatomic,strong) NSArray<MonentsInfoModel *>*dynamicInfo;
@property (nonatomic, strong) MedalModel *medalInfo;
///代理
@property (nonatomic,weak) id<XPMineUserDataViewControllerDelegate> delegate;
@end

View File

@@ -31,6 +31,95 @@
#import "XPMineClanViewController.h"
#import "XPMineGuildViewController.h"
#import "XPMonentsDetailViewController.h"
#import "XPMineDataGiftTableViewCell.h"
#import "XPMineAlbumTableViewCell.h"
#import "XPMineMedalsTableViewCell.h"
#import "MedalModel.h"
typedef enum : NSUInteger {
Album = 0,
Medal = 1,
Gifts = 2,
LuckyGifts = 3,
SectionTypeCount = 4
} 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);
_titleLabel = [UILabel labelInitWithText:@""
font:[UIFont systemFontOfSize:16 weight:UIFontWeightBold]
textColor:UIColorFromRGB(0x191919)];
[self addSubview:_titleLabel];
[_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self);
make.left.mas_equalTo(self).offset(16);
}];
_numLabel = [UILabel labelInitWithText:@""
font:[UIFont systemFontOfSize:16 weight:UIFontWeightBold]
textColor:UIColorFromRGB(0x666666)];
[self addSubview:_numLabel];
[_numLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self);
make.left.mas_equalTo(self.titleLabel.mas_right).offset(4);
}];
_arrowButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_arrowButton setBackgroundColor:[UIColor greenColor]];
[_arrowButton addTarget:self
action:@selector(didTapArrowButton)
forControlEvents:UIControlEventTouchUpInside];
[self addSubview:_arrowButton];
[_arrowButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self);
make.right.mas_equalTo(self).offset(-16);
make.size.mas_equalTo(CGSizeMake(10, 10));
}];
}
return self;
}
- (void)setTitle:(NSString *)title {
_titleLabel.text = title;
}
- (void)setNum:(NSString *)num {
_numLabel.text = num;
}
- (void)setHasMore:(BOOL)hasMore {
_arrowButton.hidden = !hasMore;
}
- (void)didTapArrowButton {
if (self.didTapMore) {
self.didTapMore();
}
}
@end
@interface XPMineUserDataViewController ()<XPMineUserDataProtocol, UITableViewDelegate, UITableViewDataSource, XPMineDataClanTableViewCellDelegate, XPMineDataGiftTableViewCellDelegate, XPMonentsTableViewCellDelegate, XPMonentsMineProtocol, XPMonentsDetailViewControllerDelegate>
///
@property (nonatomic,strong) UITableView *tableView;
@@ -39,15 +128,24 @@
///
@property (nonatomic,assign) BOOL isFold;
@property (nonatomic,assign) BOOL isGiftsSectionFold;
@property (nonatomic,assign) BOOL isLuckyGiftsSectionFold;
@property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView);
///
@property (nonatomic,assign) BOOL isShowEnterClan;
///
@property (nonatomic,strong) NSMutableArray<MonentsInfoModel *> *datasource;
@property (nonatomic,strong) UIView *headView;
///
//@property (nonatomic,strong) UIView *headView;
@property (nonatomic, strong) UIButton *giftsExpandButton;
@property (nonatomic, strong) UIButton *luckyGiftsExpandButton;
///
@property (nonatomic,assign) BOOL isOpen;
@property (nonatomic, strong) XPMineUserSectionHeader *albumHeader;
@property (nonatomic, strong) XPMineUserSectionHeader *medalHeader;
@property (nonatomic, strong) XPMineUserSectionHeader *giftsHeader;
@property (nonatomic, strong) XPMineUserSectionHeader *luckyGiftsHeader;
@end
@implementation XPMineUserDataViewController
@@ -62,6 +160,10 @@
- (void)viewDidLoad {
[super viewDidLoad];
self.isGiftsSectionFold = YES;
self.isLuckyGiftsSectionFold = YES;
[self initHttpRequest];
[self initSubViews];
[self initSubViewConstraints];
@@ -86,99 +188,146 @@
#pragma mark - UITableViewDelegate And UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 2;
return SectionTypeCount;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if(section == 0)return 1;
return self.datasource.count > 0 ? self.datasource.count : 1;;
// if(section == 0) {
// return 1;
// }else if (section == 1) {
// return (self.clanDetailInfo.clan.elderUid.length > 0 || self.clanDetailInfo.hall.ownerUid.length > 0) ? 1 : 0;
// } else {
// return 1;
// }
switch (section) {
case Album:
return 1;
break;
case Medal:
return 1;
break;
case Gifts:
return 1;
break;
case LuckyGifts:
return 1;
break;
default:
return 0;
break;
}
}
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
if(indexPath.section == 0){
if(self.isOpen == YES){
if (self.clanDetailInfo.clan.elderUid.length > 0) {
return kGetScaleWidth(150);
}
return kGetScaleWidth(130);
}
return kGetScaleWidth(106);
}
if (self.datasource.count > 0) {
MonentsInfoModel * monentInfo= [self.datasource xpSafeObjectAtIndex:indexPath.row];
[XPMonentsLayoutConfig getNewlayoutMonentsModelWithDynamic:monentInfo];
if(monentInfo.content.length == 0){
return monentInfo.rowHeight + 20;
}
return monentInfo.rowHeight;
switch (indexPath.section) {
case Album:
return 90;
break;
case Medal:
return 70;
break;
case Gifts:
return self.isGiftsSectionFold ? 100 : 300;
break;
case LuckyGifts:
return self.isLuckyGiftsSectionFold ? 100 : 300;
break;
default:
return 0;
break;
}
return KScreenHeight - kNavigationHeight - 49 - kSafeAreaBottomHeight;
}
- (UIView *)tableView:(UITableView *)tableView viewForFooterInSection:(NSInteger)section{
switch (section) {
case Album:
return nil;
break;
case Medal:
return nil;
break;
case Gifts:
return self.giftsExpandButton;
break;
case LuckyGifts:
return self.luckyGiftsExpandButton;
break;
default:
return 0;
break;
}
}
- (CGFloat)tableView:(UITableView *)tableView heightForFooterInSection:(NSInteger)section{
return 0.01;
switch (section) {
case Album:
return 0;
break;
case Medal:
return 0;
break;
case Gifts:
return 20;
break;
case LuckyGifts:
return 20;
break;
default:
return 0;
break;
}
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
if(section == 0)return 0.01;
return self.datasource.count > 0 ? 30 : 0.01;
return 30;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
if(section == 0)return nil;
return self.datasource.count > 0 ? self.headView : nil;
switch (section) {
case Album:
return self.albumHeader;
break;
case Medal:
return self.medalHeader;
break;
case Gifts:
return self.giftsHeader;
break;
case LuckyGifts:
return self.luckyGiftsHeader;
break;
default:
return [UIView new];
break;
}
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if(indexPath.section == 0){
XPMineDataClanTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineDataClanTableViewCell class])];
switch (indexPath.section) {
case Album:
{
XPMineAlbumTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineAlbumTableViewCell class])
forIndexPath:indexPath];
cell.albumDataSource = self.userInfo.privatePhoto;
return cell;
}
break;
case Medal:
{
XPMineMedalsTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineMedalsTableViewCell class])
forIndexPath:indexPath];
cell.medalsDataSource = self.medalInfo.userMedals;
return cell;
}
break;
case Gifts:{
XPMineDataGiftTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineDataGiftTableViewCell class])];
if (cell == nil) {
cell = [[XPMineDataClanTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineDataClanTableViewCell class])];
cell = [[XPMineDataGiftTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineDataGiftTableViewCell class])];
}
cell.isOpne = self.isOpen;
cell.isShowEnterHall = self.isShowEnterClan;
cell.delegate = self;
cell.userInfo = self.userInfo;
cell.clanInfo = self.clanDetailInfo;
return cell;
}
if (self.datasource.count > 0) {
XPMonentsTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"XPMonentsDynamicTableViewCell" forIndexPath:indexPath];
MonentsInfoModel * monentsInfo = [self.datasource xpSafeObjectAtIndex:indexPath.row];
cell.delegate = self;
cell.mineMonentsInfo = monentsInfo;
cell.isFillet = indexPath.row == self.datasource.count - 1;
return cell;
}
XPMonentsEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMonentsEmptyTableViewCell class])];
return cell;
// if (indexPath.section == 0) {
// XPMineDataSkillCardTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineDataSkillCardTableViewCell class])];
// if (cell == nil) {
// cell = [[XPMineDataSkillCardTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineDataSkillCardTableViewCell class])];
// }
// cell.delegate = self;
// cell.datasourece = self.skillArray;
// return cell;
// } else if(indexPath.section == 1) {
//
// } else {
// XPMineDataGiftTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineDataGiftTableViewCell class])];
// if (cell == nil) {
// cell = [[XPMineDataGiftTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineDataGiftTableViewCell class])];
// }
// cell.delegate = self;
// cell.userGiftWall = self.userInfo.userGiftWall;
// cell.userLuckyBagGiftWall = self.userInfo.userLuckyBagGiftWall;
// return cell;
// }
cell.userGiftWall = self.userInfo.userGiftWall;
cell.userLuckyBagGiftWall = self.userInfo.userLuckyBagGiftWall;
return cell;
}
break;
case LuckyGifts:
return [UITableViewCell new];
break;
default:
return [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMonentsEmptyTableViewCell class])];
break;
}
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if(indexPath.section == 0)return;
@@ -384,44 +533,105 @@
[self.datasource removeAllObjects];
[self.datasource addObjectsFromArray:dynamicInfo];
[self.tableView reloadData];
self.medalHeader.num = [NSString stringWithFormat:@"(%ld)", (long)self.userInfo.medals.medalCount];
}
- (void)setMedalInfo:(MedalModel *)medalInfo {
_medalInfo = medalInfo;
self.medalHeader.num = [NSString stringWithFormat:@"(%ld)", (long)medalInfo.medalCount];
[self.tableView reloadData];
}
- (UITableView *)tableView {
if (!_tableView) {
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStyleGrouped];
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_tableView.backgroundColor = [UIColor clearColor];
_tableView.backgroundColor = [UIColor whiteColor];
if (@available(iOS 11.0, *)) {
_tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}
[_tableView registerClass:[XPMineAlbumTableViewCell class]
forCellReuseIdentifier:NSStringFromClass([XPMineAlbumTableViewCell class])];
[_tableView registerClass:[XPMineMedalsTableViewCell class]
forCellReuseIdentifier:NSStringFromClass([XPMineMedalsTableViewCell class])];
[_tableView registerClass:[XPMonentsEmptyTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMonentsEmptyTableViewCell class])];
[_tableView registerClass:[XPMonentsTableViewCell class] forCellReuseIdentifier:@"XPMonentsDynamicTableViewCell"];
[_tableView registerClass:[XPMineDataClanTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineDataClanTableViewCell class])];
[_tableView registerClass:[XPMineDataGiftTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineDataGiftTableViewCell class])];
}
return _tableView;
}
- (NSMutableArray<MonentsInfoModel *> *)datasource {
if (!_datasource) {
_datasource = [NSMutableArray array];
}
return _datasource;
}
-(UIView *)headView{
if (!_headView){
_headView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, 30)];
_headView.backgroundColor = [UIColor clearColor];
UIView *bgView = [[UIView alloc]initWithFrame:CGRectMake(15, 0, KScreenWidth-30, 30)];
[_headView addSubview:bgView];
bgView.backgroundColor = [UIColor whiteColor];
[bgView setCornerWithLeftTopCorner:8 rightTopCorner:8 bottomLeftCorner:0 bottomRightCorner:0 size:CGSizeMake(KScreenWidth-30, 30)];
UILabel *titleView = [UILabel labelInitWithText:YMLocalizedString(@"XPMineUserDataViewController1") font:kFontMedium(15) textColor:[DJDKMIMOMColor inputTextColor]];
[bgView addSubview:titleView];
[titleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(12);
make.leading.mas_equalTo(12);
}];
- (XPMineUserSectionHeader *)albumHeader {
if (!_albumHeader) {
_albumHeader = [[XPMineUserSectionHeader alloc] init];
_albumHeader.title = @"相册";
_albumHeader.hasMore = YES;
@kWeakify(self);
_albumHeader.didTapMore = ^{
@kStrongify(self);
};
}
return _headView;
return _albumHeader;
}
- (XPMineUserSectionHeader *)medalHeader {
if (!_medalHeader) {
_medalHeader = [[XPMineUserSectionHeader alloc] init];
_medalHeader.title = @"勋章";
_medalHeader.num = @"(0)";
_medalHeader.hasMore = NO;
}
return _medalHeader;
}
- (XPMineUserSectionHeader *)giftsHeader {
if (!_giftsHeader) {
_giftsHeader = [[XPMineUserSectionHeader alloc] init];
_giftsHeader.title = @"普通礼物";
_giftsHeader.hasMore = NO;
}
return _giftsHeader;
}
- (XPMineUserSectionHeader *)luckyGiftsHeader {
if (!_luckyGiftsHeader) {
_luckyGiftsHeader = [[XPMineUserSectionHeader alloc] init];
_luckyGiftsHeader.title = @"幸运礼物";
_luckyGiftsHeader.hasMore = NO;
}
return _luckyGiftsHeader;
}
- (UIButton *)giftsExpandButton {
if (!_giftsExpandButton) {
_giftsExpandButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_giftsExpandButton setImage:[UIImage imageNamed:@"room_across_pk_panel_fold"] forState:UIControlStateNormal];
// [_giftsExpandButton addTarget:self action:@selector(foldButtonAction:) forControlEvents:UIControlEventTouchUpInside];
_giftsExpandButton.selected = YES;
[_giftsExpandButton setEnlargeEdgeWithTop:5 right:10 bottom:10 left:10];
}
return _giftsExpandButton;
}
- (UIButton *)luckyGiftsExpandButton {
if (!_luckyGiftsExpandButton) {
_luckyGiftsExpandButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_luckyGiftsExpandButton setImage:[UIImage imageNamed:@"room_across_pk_panel_fold"] forState:UIControlStateNormal];
// [_giftsExpandButton addTarget:self action:@selector(foldButtonAction:) forControlEvents:UIControlEventTouchUpInside];
_luckyGiftsExpandButton.selected = YES;
[_luckyGiftsExpandButton setEnlargeEdgeWithTop:5 right:10 bottom:10 left:10];
}
return _luckyGiftsExpandButton;
}
@end

View File

@@ -47,6 +47,8 @@
#import "XPRoomMiniManager.h"
#import "XPMineUserInfoTagVC.h"
#import "XPMomentUserDataViewController.h"
UIKIT_EXTERN NSString * kUpdateSoundInfo;
@interface XPMineUserInfoViewController ()<
@@ -76,6 +78,8 @@ XPMineCustomNavViewDelegate, XPMineUserInfoProtocol, XPMineUserInfoHeaderViewDel
///
@property (nonatomic,strong) XPMineUserInfoTagModel *tagModel;
@property (nonatomic, strong) XPMomentUserDataViewController *userMomentVC;
@end
@implementation XPMineUserInfoViewController
@@ -251,12 +255,14 @@ XPMineCustomNavViewDelegate, XPMineUserInfoProtocol, XPMineUserInfoHeaderViewDel
if (index == 1) {
return self.userDataVC;
}
return self.giftVC;
return self.userMomentVC;
// return self.giftVC;
}
if (index == 0) {
return self.userDataVC;
}
return self.giftVC;
return self.userMomentVC;
// return self.giftVC;
}
#pragma mark - JXPagerMainTableViewGestureDelegate
@@ -334,6 +340,8 @@ XPMineCustomNavViewDelegate, XPMineUserInfoProtocol, XPMineUserInfoHeaderViewDel
- (void)ongetDetailInfoSuccess:(UserInfoModel *)userInfo {
self.userDataVC.dynamicInfo = userInfo.dynamicInfo;
self.userDataVC.medalInfo = userInfo.medals;
self.userMomentVC.dynamicInfo = userInfo.dynamicInfo;
self.headView.roomUid = userInfo.roomUid;
self.giftVC.userInfo = userInfo;
}
@@ -511,6 +519,13 @@ XPMineCustomNavViewDelegate, XPMineUserInfoProtocol, XPMineUserInfoHeaderViewDel
return _userDataVC;
}
- (XPMomentUserDataViewController *)userMomentVC {
if (!_userMomentVC) {
_userMomentVC = [[XPMomentUserDataViewController alloc] init];
}
return _userMomentVC;
}
-(XPGiftUserDataViewController *)giftVC{
if (!_giftVC){
_giftVC = [XPGiftUserDataViewController new];

View File

@@ -42,7 +42,7 @@
if (!_emptyImageView) {
_emptyImageView = [[UIImageView alloc] init];
_emptyImageView.userInteractionEnabled = YES;
_emptyImageView.image = [UIImageConstant defalutEmptyPlaceholder];
_emptyImageView.image = [UIImageConstant defaultEmptyPlaceholder];
_emptyImageView.layer.masksToBounds = YES;
_emptyImageView.contentMode = UIViewContentModeScaleAspectFit;
}

View File

@@ -12,7 +12,8 @@
NS_ASSUME_NONNULL_BEGIN
@interface XPMomentUserDataViewController : MvpViewController<JXPagerViewListViewDelegate>
@property (nonatomic,strong) NSMutableArray<MonentsInfoModel *> *datasource;
@property (nonatomic,strong) NSArray<MonentsInfoModel *>*dynamicInfo;
@end

View File

@@ -7,15 +7,22 @@
#import "XPMomentUserDataViewController.h"
#import "XPMonentsDetailViewController.h"
#import "XPMineUserDataPresenter.h"
#import "XPMonentsMineProtocol.h"
#import "XPMonentsLayoutConfig.h"
#import "XPMonentsEmptyTableViewCell.h"
#import "XPMonentsTableViewCell.h"
#import "MonentsInfoModel.h"
@interface XPMomentUserDataViewController () <UITableViewDelegate, UITableViewDataSource>
@interface XPMomentUserDataViewController () <UITableViewDelegate, UITableViewDataSource, XPMonentsTableViewCellDelegate, XPMonentsMineProtocol, XPMonentsDetailViewControllerDelegate>
@property (nonatomic,strong) NSMutableArray<MonentsInfoModel *> *datasource;
@property (nonatomic,strong) UITableView *tableView;
@property (nonatomic,strong) UIView *headView;
@property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView);
@end
@implementation XPMomentUserDataViewController
@@ -23,15 +30,48 @@
- (void)viewDidLoad {
[super viewDidLoad];
[self.view addSubview:self.tableView];
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.view);
}];
}
- (__kindof id)createPresenter {
return [[XPMineUserDataPresenter alloc] init];
}
- (void)setDynamicInfo:(NSArray<MonentsInfoModel *> *)dynamicInfo {
[self.datasource removeAllObjects];
// [self.datasource addObjectsFromArray:dynamicInfo];
[self.tableView reloadData];
}
- (BOOL)isHiddenNavBar {
return YES;
}
#pragma mark - JXPagingViewListViewDelegate
- (UIView *)listView {
return self.view;
}
- (UIScrollView *)listScrollView {
return self.tableView;
}
- (void)listViewDidScrollCallback:(void (^)(UIScrollView *))callback {
self.scrollCallback = callback;
}
- (void)scrollViewDidScroll:(UIScrollView *)scrollView {
self.scrollCallback(scrollView);
}
#pragma mark - UITableViewDelegate And UITableViewDataSource
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
return 2;
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
if(section == 0)return 1;
return self.datasource.count > 0 ? self.datasource.count : 1;;
}
@@ -53,14 +93,146 @@
return 0.01;
}
-(CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section{
if(section == 0)return 0.01;
return self.datasource.count > 0 ? 30 : 0.01;
return 0.01;
// return self.datasource.count > 0 ? 30 : 0.01;
}
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section{
if(section == 0)return nil;
return nil; //self.datasource.count > 0 ? self.headView : nil;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
if (self.datasource.count > 0) {
XPMonentsTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:@"XPMonentsDynamicTableViewCell" forIndexPath:indexPath];
MonentsInfoModel * monentsInfo = [self.datasource xpSafeObjectAtIndex:indexPath.row];
cell.delegate = self;
cell.mineMonentsInfo = monentsInfo;
cell.isFillet = indexPath.row == self.datasource.count - 1;
return cell;
}
XPMonentsEmptyTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMonentsEmptyTableViewCell class])];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
if(indexPath.section == 0)return;
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (self.datasource.count > 0) {
XPMonentsDetailViewController * detailVC = [[XPMonentsDetailViewController alloc] init];
MonentsInfoModel * monentsInfo = [self.datasource xpSafeObjectAtIndex:indexPath.row];
if(monentsInfo.dynamicId == nil){
return;
}
detailVC.monentsInfo = monentsInfo;
detailVC.delegate = self;
[self.navigationController pushViewController:detailVC animated:YES];
}
}
#pragma mark - XPMonentsTableViewCellDelegate
- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClickLike:(MonentsInfoModel *)monentsInfo {
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]];
}
- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClicCommon:(MonentsInfoModel *)monentsInfo{
if(monentsInfo.dynamicId == nil){
[self showErrorToast:YMLocalizedString(@"XPMineUserDataViewController3")];
return;
}
XPMonentsDetailViewController * detailVC = [[XPMonentsDetailViewController alloc] init];
detailVC.monentsInfo = monentsInfo;
detailVC.delegate = self;
[self.navigationController pushViewController:detailVC animated:YES];
}
- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClicDelete:(MonentsInfoModel *)monentsInfo {
[TTPopup alertWithMessage:YMLocalizedString(@"XPMonentsMineViewController0") confirmHandler:^{
[self.presenter deleteMonents:monentsInfo.dynamicId worldId:[NSString stringWithFormat:@"%ld", monentsInfo.worldId]];
} cancelHandler:^{
}];
}
- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClicShielding:(nonnull MonentsInfoModel *)monentsInfo{
[self showLoading];
[self.presenter requesstShieldingWtihType:@"0" objId:monentsInfo.dynamicId];
}
- (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClicFold:(MonentsInfoModel *)monentsInfo {
__block MonentsInfoModel * monentsInfos;
[self.datasource enumerateObjectsUsingBlock:^(MonentsInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
if (obj.dynamicId.integerValue == monentsInfo.dynamicId.integerValue) {
monentsInfos = obj;
*stop = YES;
}
}];
if (monentsInfos) {
NSInteger section = [self.datasource indexOfObject:monentsInfo];
[self.tableView reloadRowsAtIndexPaths:@[[NSIndexPath indexPathForRow:section inSection:1]] withRowAnimation:UITableViewRowAnimationNone];
}
}
#pragma mark - XPMonentsDetailViewControllerDelegate
- (void)xPMonentsDetailViewController:(XPMonentsDetailViewController *)view deleteMonents:(NSString *)dynamicId {
__block MonentsInfoModel * deleteInfo;
[self.datasource enumerateObjectsUsingBlock:^(MonentsInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
if (obj.dynamicId.integerValue == dynamicId.integerValue) {
deleteInfo = obj;
}
}];
if (deleteInfo) {
[self.datasource removeObject:deleteInfo];
[self.tableView reloadData];
}
}
#pragma mark - XPMonentsMineProtocol
- (void)requesstShieldingSuccess:(NSString *)monentsInfo{
[self hideHUD];
[self showSuccessToast:YMLocalizedString(@"XPMonentsMineViewController2")];
__block MonentsInfoModel * deleteInfo;
[self.datasource enumerateObjectsUsingBlock:^(MonentsInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
if (obj.dynamicId.integerValue == monentsInfo.integerValue) {
deleteInfo = obj;
}
}];
if (deleteInfo) {
[self.datasource removeObject:deleteInfo];
[self.tableView reloadData];
}
}
- (void)likeMonentsSuccess:(NSString *)dynamicId status:(BOOL)status {
[self.datasource enumerateObjectsUsingBlock:^(MonentsInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
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];
}
- (void)deleteMonentsSuccess:(NSString *)monentsInfo {
[self showSuccessToast:YMLocalizedString(@"XPMonentsMineViewController1")];
__block MonentsInfoModel * deleteInfo;
[self.datasource enumerateObjectsUsingBlock:^(MonentsInfoModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
if (obj.dynamicId.integerValue == monentsInfo.integerValue) {
deleteInfo = obj;
}
}];
if (deleteInfo) {
[self.datasource removeObject:deleteInfo];
[self.tableView reloadData];
}
}
#pragma mark -
- (UITableView *)tableView {
@@ -86,5 +258,21 @@
return _datasource;
}
-(UIView *)headView{
if (!_headView){
_headView = [[UIView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, 30)];
_headView.backgroundColor = [UIColor clearColor];
UIView *bgView = [[UIView alloc]initWithFrame:CGRectMake(15, 0, KScreenWidth-30, 30)];
[_headView addSubview:bgView];
bgView.backgroundColor = [UIColor whiteColor];
[bgView setCornerWithLeftTopCorner:8 rightTopCorner:8 bottomLeftCorner:0 bottomRightCorner:0 size:CGSizeMake(KScreenWidth-30, 30)];
UILabel *titleView = [UILabel labelInitWithText:YMLocalizedString(@"XPMineUserDataViewController1") font:kFontMedium(15) textColor:[DJDKMIMOMColor inputTextColor]];
[bgView addSubview:titleView];
[titleView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(12);
make.leading.mas_equalTo(12);
}];
}
return _headView;
}
@end

View File

@@ -51,7 +51,7 @@
if (!_emptyImageView) {
_emptyImageView = [[UIImageView alloc] init];
_emptyImageView.userInteractionEnabled = YES;
_emptyImageView.image = [UIImageConstant defalutEmptyPlaceholder];
_emptyImageView.image = [UIImageConstant defaultEmptyPlaceholder];
_emptyImageView.layer.masksToBounds = YES;
_emptyImageView.contentMode = UIViewContentModeScaleAspectFit;
}

View File

@@ -59,7 +59,7 @@
if (!_emptyImageView) {
_emptyImageView = [[UIImageView alloc] init];
_emptyImageView.userInteractionEnabled = YES;
_emptyImageView.image = [UIImageConstant defalutEmptyPlaceholder];
_emptyImageView.image = [UIImageConstant defaultEmptyPlaceholder];
_emptyImageView.layer.masksToBounds = YES;
_emptyImageView.contentMode = UIViewContentModeScaleAspectFit;
}

View File

@@ -67,7 +67,7 @@
if (!_emptyImageView) {
_emptyImageView = [[UIImageView alloc] init];
_emptyImageView.userInteractionEnabled = YES;
_emptyImageView.image = [UIImageConstant defalutEmptyPlaceholder];
_emptyImageView.image = [UIImageConstant defaultEmptyPlaceholder];
_emptyImageView.layer.masksToBounds = YES;
_emptyImageView.contentMode = UIViewContentModeScaleAspectFit;
}

View File

@@ -50,7 +50,7 @@
if (!_emptyImageView) {
_emptyImageView = [[UIImageView alloc] init];
_emptyImageView.userInteractionEnabled = YES;
_emptyImageView.image = [UIImageConstant defalutEmptyPlaceholder];
_emptyImageView.image = [UIImageConstant defaultEmptyPlaceholder];
_emptyImageView.layer.masksToBounds = YES;
_emptyImageView.contentMode = UIViewContentModeScaleAspectFit;
}

View File

@@ -52,7 +52,7 @@
if (!_emptyImageView) {
_emptyImageView = [[UIImageView alloc] init];
_emptyImageView.userInteractionEnabled = YES;
_emptyImageView.image = [UIImageConstant defalutEmptyPlaceholder];
_emptyImageView.image = [UIImageConstant defaultEmptyPlaceholder];
_emptyImageView.layer.masksToBounds = YES;
_emptyImageView.contentMode = UIViewContentModeScaleAspectFit;
}

View File

@@ -52,7 +52,7 @@
if (!_emptyImageView) {
_emptyImageView = [[UIImageView alloc] init];
_emptyImageView.userInteractionEnabled = YES;
_emptyImageView.image = [UIImageConstant defalutEmptyPlaceholder];
_emptyImageView.image = [UIImageConstant defaultEmptyPlaceholder];
_emptyImageView.layer.masksToBounds = YES;
_emptyImageView.contentMode = UIViewContentModeScaleAspectFit;
}

View File

@@ -50,7 +50,7 @@
if (!_emptyImageView) {
_emptyImageView = [[UIImageView alloc] init];
_emptyImageView.userInteractionEnabled = YES;
_emptyImageView.image = [UIImageConstant defalutEmptyPlaceholder];
_emptyImageView.image = [UIImageConstant defaultEmptyPlaceholder];
_emptyImageView.layer.masksToBounds = YES;
_emptyImageView.contentMode = UIViewContentModeScaleAspectFit;
}

View File

@@ -299,7 +299,7 @@
- (NetImageView *)iconView{
if(!_iconView){
NetImageConfig *config = [[NetImageConfig alloc]init];
config.placeHolder = [UIImageConstant defalutEmptyPlaceholder];
config.placeHolder = [UIImageConstant defaultEmptyPlaceholder];
_iconView = [[NetImageView alloc]initWithConfig:config];
}
return _iconView;

View File

@@ -52,7 +52,7 @@
if (!_emptyImageView) {
_emptyImageView = [[UIImageView alloc] init];
_emptyImageView.userInteractionEnabled = YES;
_emptyImageView.image = [UIImageConstant defalutEmptyPlaceholder];
_emptyImageView.image = [UIImageConstant defaultEmptyPlaceholder];
_emptyImageView.layer.masksToBounds = YES;
_emptyImageView.contentMode = UIViewContentModeScaleAspectFit;
}

View File

@@ -0,0 +1,83 @@
//
// MedalModel.h
// YuMi
//
// Created by P on 2024/6/25.
//
#import "PIBaseModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface UserMedalModel : PIBaseModel
/**
* 用户UID
*/
@property (nonatomic, assign) NSInteger uid;
/**
* 勋章ID
*/
@property (nonatomic, assign) NSInteger medalId;
/**
* 勋章名称
*/
@property (nonatomic, copy) NSString *medalName;
/**
* 图片链接
*/
@property (nonatomic, copy) NSString *picUrl;
/**
* 排序
*/
@property (nonatomic, assign) NSInteger seqNo;
/**
* 勋章类型
*/
@property (nonatomic, assign) NSInteger medalType;
/**
* 是否点亮
*/
@property (nonatomic, assign) BOOL isLightUp;
/**
* 领取时间
*/
@property (nonatomic, assign) double receiveTime;
/**
* 勋章描述
*/
@property (nonatomic, copy) NSString *medalDesc;
/**
* 勋章横幅
*/
@property (nonatomic, copy) NSString *banner;
/**
* 勋章数量
*/
@property (nonatomic, assign) NSInteger amount;
/**
* 勋章小图标
*/
@property (nonatomic, copy) NSString *smallIcon;
/**
* 业务类型
*/
@property (nonatomic, assign) NSInteger busType;
@end
@interface MedalModel : PIBaseModel
@property (nonatomic, assign) NSInteger medalCount;
@property (nonatomic, strong) NSArray<UserMedalModel *>* userMedals;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,21 @@
//
// MedalModel.m
// YuMi
//
// Created by P on 2024/6/25.
//
#import "MedalModel.h"
@implementation MedalModel
+ (NSDictionary *)objectClassInArray {
return @{
@"userMedals":UserMedalModel.class
};
}
@end
@implementation UserMedalModel
@end

View File

@@ -14,6 +14,7 @@
#import "UserGiftWallInfoModel.h"
#import "MonentsInfoModel.h"
#import "XPSoundCardModel.h"
#import "MedalModel.h"
NS_ASSUME_NONNULL_BEGIN
@@ -151,6 +152,8 @@ NS_ASSUME_NONNULL_BEGIN
///pk时不能禁麦
@property(nonatomic,assign) BOOL isNoProhibitMic;
@property (nonatomic, strong) MedalModel *medals;
- (BOOL)isUserValid;
- (NSString *)userIDString;

View File

@@ -15,7 +15,8 @@
@"userGiftWall":UserGiftWallInfoModel.class,
@"userLuckyBagGiftWall":UserGiftWallInfoModel.class,
@"dynamicInfo":MonentsInfoModel.class,
@"audioCard":XPSoundCardModel.class
@"audioCard":XPSoundCardModel.class,
// @"medals":MedalModel.class
};
}