From 18f9aca9f81535f827ef546d134c7abf841883b1 Mon Sep 17 00:00:00 2001 From: eggmanQQQ <3671373519@qq.com> Date: Tue, 25 Jun 2024 15:08:14 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=84=E4=B8=AA=E4=BA=BA=E8=B5=84?= =?UTF-8?q?=E6=96=99=E9=A1=B5-=E7=9B=B8=E5=86=8C/=E5=8B=8B=E7=AB=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- YuMi.xcodeproj/project.pbxproj | 18 + .../xcshareddata/xcschemes/YuMi.xcscheme | 2 +- YuMi/CustomUI/UIImageView/UIImageConstant.h | 2 +- YuMi/CustomUI/UIImageView/UIImageConstant.m | 2 +- .../Cell/XPSessionFindNewEmptyTableViewCell.m | 2 +- .../XPSessionSayHelloEmptyTableViewCell.m | 2 +- .../Friend/XPMineFriendEmptyTableViewCell.m | 2 +- .../Cell/MineInfo/XPMineAlbumTableViewCell.h | 18 + .../Cell/MineInfo/XPMineAlbumTableViewCell.m | 125 ++++++ .../Cell/MineInfo/XPMineMedalsTableViewCell.h | 18 + .../Cell/MineInfo/XPMineMedalsTableViewCell.m | 125 ++++++ .../XPMineUserInfoEmptyCollectionViewCell.m | 2 +- .../Visitor/XPMineVisitorEmptyTableViewCell.m | 2 +- .../Cell/XPMineDressEmptyCollectionViewCell.m | 2 +- .../View/Cell/XPMineDressEmptyTableViewCell.m | 2 +- .../Cell/XPGuildEmptyCollectionViewCell.m | 2 +- .../View/Cell/XPMineGuildEmptyTableViewCell.m | 2 +- .../MineInfo/XPMineUserDataViewController.h | 2 + .../MineInfo/XPMineUserDataViewController.m | 392 ++++++++++++++---- .../MineInfo/XPMineUserInfoViewController.m | 19 +- .../View/SubViews/PINoblePrivilegeEmptyCell.m | 2 +- .../View/XPMomentUserDataViewController.h | 3 +- .../View/XPMomentUserDataViewController.m | 206 ++++++++- .../View/Cell/XPMonentsEmptyTableViewCell.m | 2 +- .../Cell/XPArrangeMicEmptyTableViewCell.m | 2 +- .../XPRoomMusicLibraryEmptyTableViewCell.m | 2 +- .../View/Cell/XPCandyTreeEmptyableViewCell.m | 2 +- .../View/Cell/XPRoomPKEmptyTableViewCell.m | 2 +- .../View/Cell/XPSailingEmptyTableViewCell.m | 2 +- .../View/Cell/XPRoomRoleEmptyTableViewCell.m | 2 +- .../View/Cell/XPTreasureFairyNewSummonCell.m | 2 +- .../View/Cell/XPWishGiftEmptyTableViewCell.m | 2 +- YuMi/Structure/MVP/Model/MedalModel.h | 83 ++++ YuMi/Structure/MVP/Model/MedalModel.m | 21 + YuMi/Structure/MVP/Model/UserInfoModel.h | 3 + YuMi/Structure/MVP/Model/UserInfoModel.m | 3 +- 36 files changed, 954 insertions(+), 126 deletions(-) create mode 100644 YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineAlbumTableViewCell.h create mode 100644 YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineAlbumTableViewCell.m create mode 100644 YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineMedalsTableViewCell.h create mode 100644 YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineMedalsTableViewCell.m create mode 100644 YuMi/Structure/MVP/Model/MedalModel.h create mode 100644 YuMi/Structure/MVP/Model/MedalModel.m diff --git a/YuMi.xcodeproj/project.pbxproj b/YuMi.xcodeproj/project.pbxproj index 8856f194..73045829 100644 --- a/YuMi.xcodeproj/project.pbxproj +++ b/YuMi.xcodeproj/project.pbxproj @@ -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 = ""; }; 54F469332C29711400A83655 /* XPMomentUserDataViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMomentUserDataViewController.h; sourceTree = ""; }; 54F469342C29711400A83655 /* XPMomentUserDataViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMomentUserDataViewController.m; sourceTree = ""; }; + 54F469362C29C3B400A83655 /* XPMineAlbumTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineAlbumTableViewCell.h; sourceTree = ""; }; + 54F469372C29C3B400A83655 /* XPMineAlbumTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineAlbumTableViewCell.m; sourceTree = ""; }; + 54F469392C2A984D00A83655 /* MedalModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MedalModel.h; sourceTree = ""; }; + 54F4693A2C2A984D00A83655 /* MedalModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MedalModel.m; sourceTree = ""; }; + 54F4693C2C2A9D4E00A83655 /* XPMineMedalsTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineMedalsTableViewCell.h; sourceTree = ""; }; + 54F4693D2C2A9D4E00A83655 /* XPMineMedalsTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineMedalsTableViewCell.m; sourceTree = ""; }; 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 = ""; }; 9B0086C427BA392B0032BD2B /* AnchorStageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AnchorStageView.h; sourceTree = ""; }; 9B0086C527BA392B0032BD2B /* AnchorStageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AnchorStageView.m; sourceTree = ""; }; @@ -4954,6 +4963,8 @@ E8EEB8F626FC2673007C6EBA /* UserPhoto.m */, 9B2A12DC2783FEDD00CED41B /* UserVipInfoVo.h */, 9B2A12DD2783FEDD00CED41B /* UserVipInfoVo.m */, + 54F469392C2A984D00A83655 /* MedalModel.h */, + 54F4693A2C2A984D00A83655 /* MedalModel.m */, ); path = Model; sourceTree = ""; @@ -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 */, diff --git a/YuMi.xcodeproj/xcshareddata/xcschemes/YuMi.xcscheme b/YuMi.xcodeproj/xcshareddata/xcschemes/YuMi.xcscheme index 1d06cb71..d258e3d3 100644 --- a/YuMi.xcodeproj/xcshareddata/xcschemes/YuMi.xcscheme +++ b/YuMi.xcodeproj/xcshareddata/xcschemes/YuMi.xcscheme @@ -72,7 +72,7 @@ buildConfiguration = "Debug"> diff --git a/YuMi/CustomUI/UIImageView/UIImageConstant.h b/YuMi/CustomUI/UIImageView/UIImageConstant.h index a86d84f3..23653c34 100644 --- a/YuMi/CustomUI/UIImageView/UIImageConstant.h +++ b/YuMi/CustomUI/UIImageView/UIImageConstant.h @@ -39,7 +39,7 @@ typedef NS_ENUM(NSUInteger, ImageType){ ///空白头像缺省图 + (UIImage *)defaultEmptyAvatarPlaceholder; /// 空白图的占位图 -+ (UIImage *)defalutEmptyPlaceholder; ++ (UIImage *)defaultEmptyPlaceholder; /// banner的占位图 + (UIImage *)defaultBannerPlaceholder; diff --git a/YuMi/CustomUI/UIImageView/UIImageConstant.m b/YuMi/CustomUI/UIImageView/UIImageConstant.m index 43a08f3e..7e8762fa 100644 --- a/YuMi/CustomUI/UIImageView/UIImageConstant.m +++ b/YuMi/CustomUI/UIImageView/UIImageConstant.m @@ -36,7 +36,7 @@ NSString * const kImageTypeMonentsPhoto = @"imageMogr2/auto-orient/thumbnail/400 } /// 空白图的占位图 -+ (UIImage *)defalutEmptyPlaceholder { ++ (UIImage *)defaultEmptyPlaceholder { return [UIImage imageNamed:@"common_empty"]; } /// banner的占位图 diff --git a/YuMi/Modules/YMMessage/View/FindNew/View/Cell/XPSessionFindNewEmptyTableViewCell.m b/YuMi/Modules/YMMessage/View/FindNew/View/Cell/XPSessionFindNewEmptyTableViewCell.m index 3f02677a..d1aa4e21 100644 --- a/YuMi/Modules/YMMessage/View/FindNew/View/Cell/XPSessionFindNewEmptyTableViewCell.m +++ b/YuMi/Modules/YMMessage/View/FindNew/View/Cell/XPSessionFindNewEmptyTableViewCell.m @@ -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; } diff --git a/YuMi/Modules/YMMessage/View/SayHello/View/Cell/XPSessionSayHelloEmptyTableViewCell.m b/YuMi/Modules/YMMessage/View/SayHello/View/Cell/XPSessionSayHelloEmptyTableViewCell.m index da089640..e393023a 100644 --- a/YuMi/Modules/YMMessage/View/SayHello/View/Cell/XPSessionSayHelloEmptyTableViewCell.m +++ b/YuMi/Modules/YMMessage/View/SayHello/View/Cell/XPSessionSayHelloEmptyTableViewCell.m @@ -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; } diff --git a/YuMi/Modules/YMMine/View/Cell/Friend/XPMineFriendEmptyTableViewCell.m b/YuMi/Modules/YMMine/View/Cell/Friend/XPMineFriendEmptyTableViewCell.m index a7bd9d00..3fdc8b11 100644 --- a/YuMi/Modules/YMMine/View/Cell/Friend/XPMineFriendEmptyTableViewCell.m +++ b/YuMi/Modules/YMMine/View/Cell/Friend/XPMineFriendEmptyTableViewCell.m @@ -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; } diff --git a/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineAlbumTableViewCell.h b/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineAlbumTableViewCell.h new file mode 100644 index 00000000..dc556d76 --- /dev/null +++ b/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineAlbumTableViewCell.h @@ -0,0 +1,18 @@ +// +// XPMineAlbumTableViewCell.h +// YuMi +// +// Created by P on 2024/6/24. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XPMineAlbumTableViewCell : UITableViewCell + +@property (nonatomic, copy) NSArray *albumDataSource; + +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineAlbumTableViewCell.m b/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineAlbumTableViewCell.m new file mode 100644 index 00000000..ecfa5d6f --- /dev/null +++ b/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineAlbumTableViewCell.m @@ -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() + +@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 diff --git a/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineMedalsTableViewCell.h b/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineMedalsTableViewCell.h new file mode 100644 index 00000000..c03edd54 --- /dev/null +++ b/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineMedalsTableViewCell.h @@ -0,0 +1,18 @@ +// +// XPMineMedalsTableViewCell.h +// YuMi +// +// Created by P on 2024/6/25. +// + +#import + +NS_ASSUME_NONNULL_BEGIN + +@interface XPMineMedalsTableViewCell : UITableViewCell + +@property (nonatomic, copy) NSArray *medalsDataSource; + +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineMedalsTableViewCell.m b/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineMedalsTableViewCell.m new file mode 100644 index 00000000..ad9e3c8a --- /dev/null +++ b/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineMedalsTableViewCell.m @@ -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() + +@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 diff --git a/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineUserInfoEmptyCollectionViewCell.m b/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineUserInfoEmptyCollectionViewCell.m index 829db78b..383359ee 100644 --- a/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineUserInfoEmptyCollectionViewCell.m +++ b/YuMi/Modules/YMMine/View/Cell/MineInfo/XPMineUserInfoEmptyCollectionViewCell.m @@ -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; } diff --git a/YuMi/Modules/YMMine/View/Cell/Visitor/XPMineVisitorEmptyTableViewCell.m b/YuMi/Modules/YMMine/View/Cell/Visitor/XPMineVisitorEmptyTableViewCell.m index 2d0f2b3f..73bc0b8d 100644 --- a/YuMi/Modules/YMMine/View/Cell/Visitor/XPMineVisitorEmptyTableViewCell.m +++ b/YuMi/Modules/YMMine/View/Cell/Visitor/XPMineVisitorEmptyTableViewCell.m @@ -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; } diff --git a/YuMi/Modules/YMMine/View/DressUp/View/Cell/XPMineDressEmptyCollectionViewCell.m b/YuMi/Modules/YMMine/View/DressUp/View/Cell/XPMineDressEmptyCollectionViewCell.m index 757167f1..8878c8e6 100644 --- a/YuMi/Modules/YMMine/View/DressUp/View/Cell/XPMineDressEmptyCollectionViewCell.m +++ b/YuMi/Modules/YMMine/View/DressUp/View/Cell/XPMineDressEmptyCollectionViewCell.m @@ -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; } diff --git a/YuMi/Modules/YMMine/View/DressUp/View/Cell/XPMineDressEmptyTableViewCell.m b/YuMi/Modules/YMMine/View/DressUp/View/Cell/XPMineDressEmptyTableViewCell.m index ff8c793f..782265b5 100644 --- a/YuMi/Modules/YMMine/View/DressUp/View/Cell/XPMineDressEmptyTableViewCell.m +++ b/YuMi/Modules/YMMine/View/DressUp/View/Cell/XPMineDressEmptyTableViewCell.m @@ -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; } diff --git a/YuMi/Modules/YMMine/View/Guild/View/Cell/XPGuildEmptyCollectionViewCell.m b/YuMi/Modules/YMMine/View/Guild/View/Cell/XPGuildEmptyCollectionViewCell.m index 152ffe35..98853d82 100644 --- a/YuMi/Modules/YMMine/View/Guild/View/Cell/XPGuildEmptyCollectionViewCell.m +++ b/YuMi/Modules/YMMine/View/Guild/View/Cell/XPGuildEmptyCollectionViewCell.m @@ -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; } diff --git a/YuMi/Modules/YMMine/View/Guild/View/Cell/XPMineGuildEmptyTableViewCell.m b/YuMi/Modules/YMMine/View/Guild/View/Cell/XPMineGuildEmptyTableViewCell.m index c56f3a87..b826691c 100644 --- a/YuMi/Modules/YMMine/View/Guild/View/Cell/XPMineGuildEmptyTableViewCell.m +++ b/YuMi/Modules/YMMine/View/Guild/View/Cell/XPMineGuildEmptyTableViewCell.m @@ -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; } diff --git a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.h b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.h index 1178f777..ca66972e 100644 --- a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.h +++ b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.h @@ -8,6 +8,7 @@ #import "MvpViewController.h" #import #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*dynamicInfo; +@property (nonatomic, strong) MedalModel *medalInfo; ///代理 @property (nonatomic,weak) id delegate; @end diff --git a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.m b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.m index 169afe45..67d74e8c 100644 --- a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.m +++ b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.m @@ -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 () ///列表 @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 *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{ - return nil; + 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])]; - if (cell == nil) { - cell = [[XPMineDataClanTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineDataClanTableViewCell class])]; + switch (indexPath.section) { + case Album: + { + XPMineAlbumTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineAlbumTableViewCell class]) + forIndexPath:indexPath]; + cell.albumDataSource = self.userInfo.privatePhoto; + return cell; } - cell.isOpne = self.isOpen; - cell.isShowEnterHall = self.isShowEnterClan; - cell.delegate = self; - cell.userInfo = self.userInfo; - cell.clanInfo = self.clanDetailInfo; - 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 = [[XPMineDataGiftTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineDataGiftTableViewCell class])]; + } +// cell.delegate = self; + 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; } - - 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; -// } } - (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 *)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 diff --git a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m index 8827069f..17f1eb72 100644 --- a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m +++ b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m @@ -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]; diff --git a/YuMi/Modules/YMMine/View/Noble/View/SubViews/PINoblePrivilegeEmptyCell.m b/YuMi/Modules/YMMine/View/Noble/View/SubViews/PINoblePrivilegeEmptyCell.m index 3e30643b..2c09bb66 100644 --- a/YuMi/Modules/YMMine/View/Noble/View/SubViews/PINoblePrivilegeEmptyCell.m +++ b/YuMi/Modules/YMMine/View/Noble/View/SubViews/PINoblePrivilegeEmptyCell.m @@ -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; } diff --git a/YuMi/Modules/YMMine/View/XPMomentUserDataViewController.h b/YuMi/Modules/YMMine/View/XPMomentUserDataViewController.h index d80c74aa..07809cce 100644 --- a/YuMi/Modules/YMMine/View/XPMomentUserDataViewController.h +++ b/YuMi/Modules/YMMine/View/XPMomentUserDataViewController.h @@ -12,7 +12,8 @@ NS_ASSUME_NONNULL_BEGIN @interface XPMomentUserDataViewController : MvpViewController -@property (nonatomic,strong) NSMutableArray *datasource; + +@property (nonatomic,strong) NSArray*dynamicInfo; @end diff --git a/YuMi/Modules/YMMine/View/XPMomentUserDataViewController.m b/YuMi/Modules/YMMine/View/XPMomentUserDataViewController.m index 9e366ccb..90929d1a 100644 --- a/YuMi/Modules/YMMine/View/XPMomentUserDataViewController.m +++ b/YuMi/Modules/YMMine/View/XPMomentUserDataViewController.m @@ -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 () +@interface XPMomentUserDataViewController () +@property (nonatomic,strong) NSMutableArray *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 *)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; + 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 diff --git a/YuMi/Modules/YMMonents/View/Cell/XPMonentsEmptyTableViewCell.m b/YuMi/Modules/YMMonents/View/Cell/XPMonentsEmptyTableViewCell.m index 49f5d031..32f61c74 100644 --- a/YuMi/Modules/YMMonents/View/Cell/XPMonentsEmptyTableViewCell.m +++ b/YuMi/Modules/YMMonents/View/Cell/XPMonentsEmptyTableViewCell.m @@ -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; } diff --git a/YuMi/Modules/YMRoom/View/ArrangeMic/View/Cell/XPArrangeMicEmptyTableViewCell.m b/YuMi/Modules/YMRoom/View/ArrangeMic/View/Cell/XPArrangeMicEmptyTableViewCell.m index 7660e554..23d8867f 100644 --- a/YuMi/Modules/YMRoom/View/ArrangeMic/View/Cell/XPArrangeMicEmptyTableViewCell.m +++ b/YuMi/Modules/YMRoom/View/ArrangeMic/View/Cell/XPArrangeMicEmptyTableViewCell.m @@ -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; } diff --git a/YuMi/Modules/YMRoom/View/BackMusic/View/Cell/XPRoomMusicLibraryEmptyTableViewCell.m b/YuMi/Modules/YMRoom/View/BackMusic/View/Cell/XPRoomMusicLibraryEmptyTableViewCell.m index c4b5c4b0..ce599f00 100644 --- a/YuMi/Modules/YMRoom/View/BackMusic/View/Cell/XPRoomMusicLibraryEmptyTableViewCell.m +++ b/YuMi/Modules/YMRoom/View/BackMusic/View/Cell/XPRoomMusicLibraryEmptyTableViewCell.m @@ -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; } diff --git a/YuMi/Modules/YMRoom/View/CandyTree/View/Cell/XPCandyTreeEmptyableViewCell.m b/YuMi/Modules/YMRoom/View/CandyTree/View/Cell/XPCandyTreeEmptyableViewCell.m index 2ceddc72..e0d1b4c7 100644 --- a/YuMi/Modules/YMRoom/View/CandyTree/View/Cell/XPCandyTreeEmptyableViewCell.m +++ b/YuMi/Modules/YMRoom/View/CandyTree/View/Cell/XPCandyTreeEmptyableViewCell.m @@ -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; } diff --git a/YuMi/Modules/YMRoom/View/RoomPK/View/Cell/XPRoomPKEmptyTableViewCell.m b/YuMi/Modules/YMRoom/View/RoomPK/View/Cell/XPRoomPKEmptyTableViewCell.m index 2b8dfb90..8e48e9c4 100644 --- a/YuMi/Modules/YMRoom/View/RoomPK/View/Cell/XPRoomPKEmptyTableViewCell.m +++ b/YuMi/Modules/YMRoom/View/RoomPK/View/Cell/XPRoomPKEmptyTableViewCell.m @@ -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; } diff --git a/YuMi/Modules/YMRoom/View/Sailing/View/Cell/XPSailingEmptyTableViewCell.m b/YuMi/Modules/YMRoom/View/Sailing/View/Cell/XPSailingEmptyTableViewCell.m index 032c0fde..badc8fb9 100644 --- a/YuMi/Modules/YMRoom/View/Sailing/View/Cell/XPSailingEmptyTableViewCell.m +++ b/YuMi/Modules/YMRoom/View/Sailing/View/Cell/XPSailingEmptyTableViewCell.m @@ -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; } diff --git a/YuMi/Modules/YMRoom/View/Setting/View/Cell/XPRoomRoleEmptyTableViewCell.m b/YuMi/Modules/YMRoom/View/Setting/View/Cell/XPRoomRoleEmptyTableViewCell.m index 07d5c446..83339a05 100644 --- a/YuMi/Modules/YMRoom/View/Setting/View/Cell/XPRoomRoleEmptyTableViewCell.m +++ b/YuMi/Modules/YMRoom/View/Setting/View/Cell/XPRoomRoleEmptyTableViewCell.m @@ -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; } diff --git a/YuMi/Modules/YMRoom/View/TreasureFairy/View/Cell/XPTreasureFairyNewSummonCell.m b/YuMi/Modules/YMRoom/View/TreasureFairy/View/Cell/XPTreasureFairyNewSummonCell.m index 3e41a1d4..f3333509 100644 --- a/YuMi/Modules/YMRoom/View/TreasureFairy/View/Cell/XPTreasureFairyNewSummonCell.m +++ b/YuMi/Modules/YMRoom/View/TreasureFairy/View/Cell/XPTreasureFairyNewSummonCell.m @@ -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; diff --git a/YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftEmptyTableViewCell.m b/YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftEmptyTableViewCell.m index 868a14ab..6348dbc5 100644 --- a/YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftEmptyTableViewCell.m +++ b/YuMi/Modules/YMRoom/View/WishGift/View/Cell/XPWishGiftEmptyTableViewCell.m @@ -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; } diff --git a/YuMi/Structure/MVP/Model/MedalModel.h b/YuMi/Structure/MVP/Model/MedalModel.h new file mode 100644 index 00000000..e0b089da --- /dev/null +++ b/YuMi/Structure/MVP/Model/MedalModel.h @@ -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* userMedals; + +@end + +NS_ASSUME_NONNULL_END diff --git a/YuMi/Structure/MVP/Model/MedalModel.m b/YuMi/Structure/MVP/Model/MedalModel.m new file mode 100644 index 00000000..c038f0e6 --- /dev/null +++ b/YuMi/Structure/MVP/Model/MedalModel.m @@ -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 diff --git a/YuMi/Structure/MVP/Model/UserInfoModel.h b/YuMi/Structure/MVP/Model/UserInfoModel.h index e86038a6..d61fc474 100644 --- a/YuMi/Structure/MVP/Model/UserInfoModel.h +++ b/YuMi/Structure/MVP/Model/UserInfoModel.h @@ -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; diff --git a/YuMi/Structure/MVP/Model/UserInfoModel.m b/YuMi/Structure/MVP/Model/UserInfoModel.m index 0d460839..083fea66 100644 --- a/YuMi/Structure/MVP/Model/UserInfoModel.m +++ b/YuMi/Structure/MVP/Model/UserInfoModel.m @@ -15,7 +15,8 @@ @"userGiftWall":UserGiftWallInfoModel.class, @"userLuckyBagGiftWall":UserGiftWallInfoModel.class, @"dynamicInfo":MonentsInfoModel.class, - @"audioCard":XPSoundCardModel.class + @"audioCard":XPSoundCardModel.class, +// @"medals":MedalModel.class }; }