feat: 补充个人资料页公会信息

This commit is contained in:
eggmanQQQ
2024-09-19 18:58:23 +08:00
parent 61e316044d
commit 513cabbedc
14 changed files with 272 additions and 27 deletions

View File

@@ -519,6 +519,8 @@
54ACDCC22C5B31BD0099472C /* XPBeautIDView.m in Sources */ = {isa = PBXBuildFile; fileRef = 54ACDCC12C5B31BD0099472C /* XPBeautIDView.m */; };
54AE7E142C9AD9AB006D2BE2 /* CPCard.m in Sources */ = {isa = PBXBuildFile; fileRef = 54AE7E132C9AD9A6006D2BE2 /* CPCard.m */; };
54AE7E172C9AE589006D2BE2 /* CPListViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 54AE7E162C9AE589006D2BE2 /* CPListViewController.m */; };
54B9C6E72C9C2CA1003F1CC5 /* XPMineGuildTableViewCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 54B9C6E62C9C2CA1003F1CC5 /* XPMineGuildTableViewCell.m */; };
54B9C6EA2C9C2DDC003F1CC5 /* GuildInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = 54B9C6E92C9C2DDC003F1CC5 /* GuildInfo.m */; };
54C3895C2C215F5100FD47B1 /* XPHomeMineViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 54C3895B2C215F5100FD47B1 /* XPHomeMineViewController.m */; };
54C3895F2C2189DD00FD47B1 /* XPHomeMinePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 54C3895E2C2189DD00FD47B1 /* XPHomeMinePresenter.m */; };
54C389622C23BD1600FD47B1 /* HomeRankAvatarModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 54C389612C23BD1600FD47B1 /* HomeRankAvatarModel.m */; };
@@ -2580,6 +2582,10 @@
54AE7E132C9AD9A6006D2BE2 /* CPCard.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPCard.m; sourceTree = "<group>"; };
54AE7E152C9AE589006D2BE2 /* CPListViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = CPListViewController.h; sourceTree = "<group>"; };
54AE7E162C9AE589006D2BE2 /* CPListViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = CPListViewController.m; sourceTree = "<group>"; };
54B9C6E52C9C2CA1003F1CC5 /* XPMineGuildTableViewCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineGuildTableViewCell.h; sourceTree = "<group>"; };
54B9C6E62C9C2CA1003F1CC5 /* XPMineGuildTableViewCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineGuildTableViewCell.m; sourceTree = "<group>"; };
54B9C6E82C9C2DDC003F1CC5 /* GuildInfo.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GuildInfo.h; sourceTree = "<group>"; };
54B9C6E92C9C2DDC003F1CC5 /* GuildInfo.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GuildInfo.m; sourceTree = "<group>"; };
54C3895A2C215F5100FD47B1 /* XPHomeMineViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeMineViewController.h; sourceTree = "<group>"; };
54C3895B2C215F5100FD47B1 /* XPHomeMineViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPHomeMineViewController.m; sourceTree = "<group>"; };
54C3895D2C2189DD00FD47B1 /* XPHomeMinePresenter.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeMinePresenter.h; sourceTree = "<group>"; };
@@ -4999,6 +5005,8 @@
54F4693A2C2A984D00A83655 /* MedalModel.m */,
54FFD3782C9BCB1900DE61E5 /* RelationUserVO.h */,
54FFD3792C9BCB1900DE61E5 /* RelationUserVO.m */,
54B9C6E82C9C2DDC003F1CC5 /* GuildInfo.h */,
54B9C6E92C9C2DDC003F1CC5 /* GuildInfo.m */,
);
path = Model;
sourceTree = "<group>";
@@ -11026,6 +11034,8 @@
E8D34D4C28080351009C4835 /* XPMineDataClanTableViewCell.m */,
54F469362C29C3B400A83655 /* XPMineAlbumTableViewCell.h */,
54F469372C29C3B400A83655 /* XPMineAlbumTableViewCell.m */,
54B9C6E52C9C2CA1003F1CC5 /* XPMineGuildTableViewCell.h */,
54B9C6E62C9C2CA1003F1CC5 /* XPMineGuildTableViewCell.m */,
54F4693C2C2A9D4E00A83655 /* XPMineMedalsTableViewCell.h */,
54F4693D2C2A9D4E00A83655 /* XPMineMedalsTableViewCell.m */,
54F4693F2C2AB56900A83655 /* XPMineGiftsTableViewCell.h */,
@@ -11448,6 +11458,7 @@
E8E0DAE0285C20E500566A2F /* MessageContentFindNewGreetView.m in Sources */,
E8A3540128FEAC5E0014A784 /* XPWishGiftTableViewCell.m in Sources */,
237700E32BC7D7C000D661F1 /* NSMutableAttributedString+MSRTL.m in Sources */,
54B9C6EA2C9C2DDC003F1CC5 /* GuildInfo.m in Sources */,
234D821E2AEC57CF0022EFEB /* YYTextAsyncLayer+PITextAsyncLayer.m in Sources */,
23B2AEC12A64E9C200543D17 /* LoginForgetEditView.m in Sources */,
E8EEB90326FC31DC007C6EBA /* XPMineUserInfoProtocol.h in Sources */,
@@ -12635,6 +12646,7 @@
234E50AF2BF7352C005CB6D5 /* NSTextAttachment+MSImage.m in Sources */,
E896EF9C2771AE6B00AD2CC1 /* XPMineFansViewController.m in Sources */,
238B37A72AC55A2C00BFC9D5 /* TreasureFairyRewardModel.m in Sources */,
54B9C6E72C9C2CA1003F1CC5 /* XPMineGuildTableViewCell.m in Sources */,
E84B0E462727EF9D008818C6 /* XPRoomMessageParser.m in Sources */,
23E9E9A12A80C7E000B792F2 /* XPMineGuildPersonalBillRecordModel.m in Sources */,
E838D9A0275E1BF60079E0B5 /* XPRoomAnimationView.m in Sources */,

Binary file not shown.

After

Width:  |  Height:  |  Size: 100 KiB

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "2@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

View File

@@ -0,0 +1,21 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "矩形 3164@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 996 B

View File

@@ -13,6 +13,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, copy) NSArray *albumDataSource;
+ (CGFloat)cellHeight:(NSInteger)numOfPhotos;
@end
NS_ASSUME_NONNULL_END

View File

@@ -21,11 +21,11 @@
self = [super initWithFrame:frame];
if (self) {
NetImageConfig *config = [[NetImageConfig alloc]init];
config.imageType = ImageTypeUserInfoAlbum;
config.imageType = ImageTypeUserLibaryDetail;
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
_imageView = [[NetImageView alloc] initWithConfig:config];
_imageView.layer.masksToBounds = YES;
_imageView.layer.cornerRadius = 12;
_imageView.layer.cornerRadius = 8;
_imageView.contentMode = UIViewContentModeScaleAspectFill;
[self.contentView addSubview:_imageView];
@@ -48,12 +48,16 @@
@implementation XPMineAlbumTableViewCell
+ (CGFloat)cellHeight:(NSInteger)numOfPhotos {
NSInteger lines = MIN(3, ceil(numOfPhotos / 3.0));
return lines * (kGetScaleWidth(110) + 7);
}
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.contentView.backgroundColor = [UIColor whiteColor];
self.contentView.backgroundColor = [UIColor clearColor];
[self.contentView addSubview:self.albumCollectionView];
[self.albumCollectionView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(self.contentView).offset(8);
make.edges.mas_equalTo(self.contentView);
}];
@@ -103,9 +107,8 @@ didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
}
#pragma mark - UICollectionViewDelegateFlowLayout
- (CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath {
return CGSizeMake(81, 81);
return CGSizeMake(kGetScaleWidth(110), kGetScaleWidth(110));
}
#pragma mark - SDPhotoBrowserDelegate
@@ -125,14 +128,15 @@ didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
- (UICollectionView *)albumCollectionView {
if (!_albumCollectionView) {
UICollectionViewFlowLayout *layout = [[UICollectionViewFlowLayout alloc] init];
layout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
layout.minimumInteritemSpacing = 4.5;
layout.minimumLineSpacing = 4.5;
layout.scrollDirection = UICollectionViewScrollDirectionVertical;
layout.minimumInteritemSpacing = 8;
layout.minimumLineSpacing = 8;
_albumCollectionView = [[UICollectionView alloc] initWithFrame:CGRectZero
collectionViewLayout:layout];
_albumCollectionView.backgroundColor = [UIColor clearColor];
_albumCollectionView.delegate = self;
_albumCollectionView.dataSource = self;
_albumCollectionView.scrollEnabled = NO;
[_albumCollectionView registerClass:[XPMineAlbumCell class]
forCellWithReuseIdentifier:@"Album Cell"];
}
@@ -141,7 +145,9 @@ didSelectItemAtIndexPath:(NSIndexPath *)indexPath {
- (UILabel *)noDataLabel {
if (!_noDataLabel) {
_noDataLabel = [UILabel labelInitWithText:YMLocalizedString(@"XPMineUserInfoGiftWallViewController3") font:[UIFont systemFontOfSize:14 weight:UIFontWeightMedium] textColor:UIColorFromRGB(0x191919)];
_noDataLabel = [UILabel labelInitWithText:YMLocalizedString(@"XPMineUserInfoGiftWallViewController3")
font:kFontRegular(14)
textColor:[UIColor colorWithWhite:1 alpha:0.6]];
_noDataLabel.textAlignment = NSTextAlignmentCenter;
_noDataLabel.alpha = 0.5;
_noDataLabel.hidden = YES;

View File

@@ -0,0 +1,18 @@
//
// XPMineGuildTableViewCell.h
// YuMi
//
// Created by P on 2024/9/19.
//
#import <UIKit/UIKit.h>
@class GuildInfo;
NS_ASSUME_NONNULL_BEGIN
@interface XPMineGuildTableViewCell : UITableViewCell
@property (nonatomic, strong) GuildInfo *info;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,116 @@
//
// XPMineGuildTableViewCell.m
// YuMi
//
// Created by P on 2024/9/19.
//
#import "XPMineGuildTableViewCell.h"
#import "GuildInfo.h"
@interface XPMineGuildTableViewCell ()
@property (nonatomic, strong) NetImageView *avatarImageView;
@property (nonatomic, strong) UILabel *nameLabel;
@property (nonatomic, strong) UILabel *guildIDLabel;
@property (nonatomic, strong) UILabel *agentIDLabel;
@end
@implementation XPMineGuildTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
self.selectionStyle = UITableViewCellSelectionStyleNone;
}
return self;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
[super setSelected:selected animated:animated];
}
- (void)setupUI {
UIImageView *backgroundImageView = [[UIImageView alloc] initWithImage:kImage(@"user_guild_bg")];
[self.contentView addSubview:backgroundImageView];
[backgroundImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.contentView);
}];
[self.contentView addSubview:self.avatarImageView];
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.contentView);
make.leading.mas_equalTo(self.contentView).offset(12);
make.width.height.mas_equalTo(kGetScaleWidth(62));
}];
UIStackView *stack = [[UIStackView alloc] init];
stack.axis = UILayoutConstraintAxisVertical;
stack.spacing = 3;
stack.alignment = UIStackViewAlignmentLeading;
[self.contentView addSubview:stack];
[stack mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(self.avatarImageView.mas_trailing).offset(12);
make.top.bottom.mas_equalTo(self.avatarImageView);
make.trailing.mas_equalTo(self.contentView).offset(-12);
}];
[stack addArrangedSubview:self.nameLabel];
[stack addArrangedSubview:self.guildIDLabel];
[stack addArrangedSubview:self.agentIDLabel];
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(20);
}];
[self.guildIDLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(18);
}];
[self.agentIDLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(18);
}];
}
- (void)setInfo:(GuildInfo *)info {
_info = info;
self.avatarImageView.imageUrl = info.avatar;
self.guildIDLabel.text = [NSString stringWithFormat:@"Guild ID: $ld", (long)info.guildId];
self.agentIDLabel.text = [NSString stringWithFormat:@"Agent ID: $ld", (long)info.erbanNo];
}
#pragma mark -
- (NetImageView *)avatarImageView {
if (!_avatarImageView) {
_avatarImageView = [[NetImageView alloc] init];
_avatarImageView.layer.cornerRadius = 8;
_avatarImageView.layer.borderColor = UIColorFromRGB(0xFFEEAC).CGColor;
_avatarImageView.layer.borderWidth = 1;
_avatarImageView.layer.maskedCorners = YES;
}
return _avatarImageView;
}
- (UILabel *)nameLabel {
if (!_nameLabel) {
_nameLabel = [UILabel labelInitWithText:@"" font:kFontMedium(14) textColor:[UIColor whiteColor]];
}
return _nameLabel;
}
- (UILabel *)guildIDLabel {
if (!_guildIDLabel) {
_guildIDLabel = [UILabel labelInitWithText:@"" font:kFontMedium(13) textColor:[UIColor colorWithWhite:1 alpha:0.6]];
}
return _guildIDLabel;
}
- (UILabel *)agentIDLabel {
if (!_agentIDLabel) {
_agentIDLabel = [UILabel labelInitWithText:@"" font:kFontMedium(13) textColor:[UIColor colorWithWhite:1 alpha:0.6]];
}
return _agentIDLabel;
}
@end

View File

@@ -69,17 +69,29 @@ typedef enum : NSUInteger {
if (self = [super init]) {
self.frame = CGRectMake(0, 0, KScreenWidth, 20);
UIView *greenLine = [[UIView alloc] init];
greenLine.layer.backgroundColor = UIColorFromRGB(0x04D5C6).CGColor;
greenLine.layer.cornerRadius = 2;
[self addSubview:greenLine];
[greenLine mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(kGetScaleWidth(15));
make.centerY.mas_equalTo(self);
make.size.mas_equalTo(CGSizeMake(3, 15));
}];
_titleLabel = [UILabel labelInitWithText:@""
font:[UIFont systemFontOfSize:16 weight:UIFontWeightBold]
textColor:UIColorFromRGB(0x191919)];
font:kFontSemibold(16)
textColor:[UIColor whiteColor]];
[self addSubview:_titleLabel];
[_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.centerY.mas_equalTo(self);
make.centerY.mas_equalTo(self);
make.leading.mas_equalTo(greenLine.mas_trailing).offset(7);
}];
_numLabel = [UILabel labelInitWithText:@""
font:[UIFont systemFontOfSize:16 weight:UIFontWeightBold]
textColor:UIColorFromRGB(0x666666)];
font:kFontSemibold(16)
textColor:[UIColor whiteColor]];
[self addSubview:_numLabel];
[_numLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self);
@@ -172,7 +184,7 @@ typedef enum : NSUInteger {
- (void)viewDidLoad {
[super viewDidLoad];
self.view.backgroundColor = [UIColor whiteColor];
self.view.backgroundColor = UIColorFromRGB(0x08151A);
[self initSubViews];
[self initSubViewConstraints];
@@ -256,7 +268,8 @@ typedef enum : NSUInteger {
return 78.5;
break;
case Album:
return 90;
// return 90;
return [XPMineAlbumTableViewCell cellHeight:self.userInfo.privatePhoto.count];
break;
case Medal:
return 140;
@@ -595,7 +608,7 @@ typedef enum : NSUInteger {
_tableView.delegate = self;
_tableView.dataSource = self;
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
_tableView.backgroundColor = [UIColor whiteColor];
_tableView.backgroundColor = [UIColor clearColor];
if (@available(iOS 11.0, *)) {
_tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
}

View File

@@ -472,11 +472,11 @@ XPMineCustomNavViewDelegate, XPMineUserInfoProtocol, XPMineUserInfoHeaderViewDel
if (!_titleView) {
_titleView = [[JXCategoryTitleView alloc] init];
_titleView.delegate = self;
_titleView.backgroundColor = [UIColor whiteColor];
_titleView.titleColor = UIColorRGBAlpha(0x191919, 0.5);
_titleView.titleSelectedColor = UIColorFromRGB(0x191919);
_titleView.titleFont = [UIFont systemFontOfSize:18 weight:UIFontWeightBold];
_titleView.titleSelectedFont = [UIFont systemFontOfSize:20 weight:UIFontWeightBold];
_titleView.backgroundColor = UIColorFromRGB(0x08151A);
_titleView.titleColor = [UIColor colorWithWhite:1 alpha:0.6];
_titleView.titleSelectedColor = [UIColor whiteColor];
_titleView.titleFont = kFontMedium(16);
_titleView.titleSelectedFont = kFontMedium(18);
_titleView.titleLabelAnchorPointStyle = JXCategoryTitleLabelAnchorPointStyleCenter;
_titleView.contentScrollViewClickTransitionAnimationEnabled = NO;
_titleView.defaultSelectedIndex = isMSRTL() ? 1 : 0;
@@ -488,11 +488,9 @@ XPMineCustomNavViewDelegate, XPMineUserInfoProtocol, XPMineUserInfoHeaderViewDel
JXCategoryIndicatorImageView *lineView = [[JXCategoryIndicatorImageView alloc] init];
lineView.verticalMargin = 8;
lineView.indicatorImageView.layer.masksToBounds = YES;
lineView.indicatorImageView.layer.cornerRadius = 1.5;
lineView.indicatorImageView.image = [UIImage imageWithColor:UIColorFromRGB(0x26cc9c)];
lineView.indicatorImageView.image = kImage(@"user_page_Indicator");
lineView.indicatorImageView.contentMode = UIViewContentModeScaleAspectFill;
lineView.indicatorImageViewSize = CGSizeMake(18, 3);
lineView.indicatorImageViewSize = CGSizeMake(21, 6);
_titleView.indicators = @[lineView];
}
return _titleView;

View File

@@ -0,0 +1,22 @@
//
// GuildInfo.h
// YuMi
//
// Created by P on 2024/9/19.
//
#import "PIBaseModel.h"
NS_ASSUME_NONNULL_BEGIN
@interface GuildInfo : PIBaseModel
@property (nonatomic, copy) NSString *avatar;
@property (nonatomic, copy) NSString *guildName;
@property (nonatomic, assign) NSInteger erbanNo;
@property (nonatomic, assign) NSInteger guildId;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,12 @@
//
// GuildInfo.m
// YuMi
//
// Created by P on 2024/9/19.
//
#import "GuildInfo.h"
@implementation GuildInfo
@end

View File

@@ -16,6 +16,8 @@
#import "XPSoundCardModel.h"
#import "MedalModel.h"
#import "RelationUserVO.h"
#import "GuildInfo.h"
NS_ASSUME_NONNULL_BEGIN
@@ -160,6 +162,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, strong) RelationUserVO *relationUserVO;
@property (nonatomic, strong) GuildInfo *guildInfo;
- (BOOL)isUserValid;
- (NSString *)userIDString;