From 71b7263fd6ce822976614c95539f8054eae35003 Mon Sep 17 00:00:00 2001 From: eggmanQQQ <3671373519@qq.com> Date: Tue, 25 Jun 2024 19:18:51 +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=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mine_gift_bg.imageset/Contents.json | 0 .../mine_gift_bg.imageset/mine_gift_bg@2x.png | Bin .../mine_gift_bg.imageset/mine_gift_bg@3x.png | Bin .../mine_lucky_gift_bg.imageset/Contents.json | 0 .../mine_lucky_gift_bg@2x.png | Bin .../mine_lucky_gift_bg@3x.png | Bin .../mine_online_mark.imageset/Contents.json | 22 +++++ .../mine_online_mark@2x.png | Bin 0 -> 120 bytes .../mine_online_mark@3x.png | Bin 0 -> 125 bytes .../Cell/MineInfo/XPMineGiftsTableViewCell.h | 3 + .../Cell/MineInfo/XPMineGiftsTableViewCell.m | 57 ++++++++++++- .../MineInfo/XPMineUserDataViewController.h | 8 +- .../MineInfo/XPMineUserDataViewController.m | 58 ++++++++++---- .../MineInfo/XPMineUserInfoViewController.m | 8 +- .../MineInfo/XPMineUserInfoHeaderView.m | 75 +++++++++++++++--- .../YMRoom/View/XPRoomViewController.m | 6 +- 16 files changed, 195 insertions(+), 42 deletions(-) rename YuMi/Assets.xcassets/{ => MineInfo}/mine_gift_bg.imageset/Contents.json (100%) rename YuMi/Assets.xcassets/{ => MineInfo}/mine_gift_bg.imageset/mine_gift_bg@2x.png (100%) rename YuMi/Assets.xcassets/{ => MineInfo}/mine_gift_bg.imageset/mine_gift_bg@3x.png (100%) rename YuMi/Assets.xcassets/{ => MineInfo}/mine_lucky_gift_bg.imageset/Contents.json (100%) rename YuMi/Assets.xcassets/{ => MineInfo}/mine_lucky_gift_bg.imageset/mine_lucky_gift_bg@2x.png (100%) rename YuMi/Assets.xcassets/{ => MineInfo}/mine_lucky_gift_bg.imageset/mine_lucky_gift_bg@3x.png (100%) create mode 100644 YuMi/Assets.xcassets/MineInfo/mine_online_mark.imageset/Contents.json create mode 100644 YuMi/Assets.xcassets/MineInfo/mine_online_mark.imageset/mine_online_mark@2x.png create mode 100644 YuMi/Assets.xcassets/MineInfo/mine_online_mark.imageset/mine_online_mark@3x.png diff --git a/YuMi/Assets.xcassets/mine_gift_bg.imageset/Contents.json b/YuMi/Assets.xcassets/MineInfo/mine_gift_bg.imageset/Contents.json similarity index 100% rename from YuMi/Assets.xcassets/mine_gift_bg.imageset/Contents.json rename to YuMi/Assets.xcassets/MineInfo/mine_gift_bg.imageset/Contents.json diff --git a/YuMi/Assets.xcassets/mine_gift_bg.imageset/mine_gift_bg@2x.png b/YuMi/Assets.xcassets/MineInfo/mine_gift_bg.imageset/mine_gift_bg@2x.png similarity index 100% rename from YuMi/Assets.xcassets/mine_gift_bg.imageset/mine_gift_bg@2x.png rename to YuMi/Assets.xcassets/MineInfo/mine_gift_bg.imageset/mine_gift_bg@2x.png diff --git a/YuMi/Assets.xcassets/mine_gift_bg.imageset/mine_gift_bg@3x.png b/YuMi/Assets.xcassets/MineInfo/mine_gift_bg.imageset/mine_gift_bg@3x.png similarity index 100% rename from YuMi/Assets.xcassets/mine_gift_bg.imageset/mine_gift_bg@3x.png rename to YuMi/Assets.xcassets/MineInfo/mine_gift_bg.imageset/mine_gift_bg@3x.png diff --git a/YuMi/Assets.xcassets/mine_lucky_gift_bg.imageset/Contents.json b/YuMi/Assets.xcassets/MineInfo/mine_lucky_gift_bg.imageset/Contents.json similarity index 100% rename from YuMi/Assets.xcassets/mine_lucky_gift_bg.imageset/Contents.json rename to YuMi/Assets.xcassets/MineInfo/mine_lucky_gift_bg.imageset/Contents.json diff --git a/YuMi/Assets.xcassets/mine_lucky_gift_bg.imageset/mine_lucky_gift_bg@2x.png b/YuMi/Assets.xcassets/MineInfo/mine_lucky_gift_bg.imageset/mine_lucky_gift_bg@2x.png similarity index 100% rename from YuMi/Assets.xcassets/mine_lucky_gift_bg.imageset/mine_lucky_gift_bg@2x.png rename to YuMi/Assets.xcassets/MineInfo/mine_lucky_gift_bg.imageset/mine_lucky_gift_bg@2x.png diff --git a/YuMi/Assets.xcassets/mine_lucky_gift_bg.imageset/mine_lucky_gift_bg@3x.png b/YuMi/Assets.xcassets/MineInfo/mine_lucky_gift_bg.imageset/mine_lucky_gift_bg@3x.png similarity index 100% rename from YuMi/Assets.xcassets/mine_lucky_gift_bg.imageset/mine_lucky_gift_bg@3x.png rename to YuMi/Assets.xcassets/MineInfo/mine_lucky_gift_bg.imageset/mine_lucky_gift_bg@3x.png diff --git a/YuMi/Assets.xcassets/MineInfo/mine_online_mark.imageset/Contents.json b/YuMi/Assets.xcassets/MineInfo/mine_online_mark.imageset/Contents.json new file mode 100644 index 00000000..5667894b --- /dev/null +++ b/YuMi/Assets.xcassets/MineInfo/mine_online_mark.imageset/Contents.json @@ -0,0 +1,22 @@ +{ + "images" : [ + { + "idiom" : "universal", + "scale" : "1x" + }, + { + "filename" : "mine_online_mark@2x.png", + "idiom" : "universal", + "scale" : "2x" + }, + { + "filename" : "mine_online_mark@3x.png", + "idiom" : "universal", + "scale" : "3x" + } + ], + "info" : { + "author" : "xcode", + "version" : 1 + } +} diff --git a/YuMi/Assets.xcassets/MineInfo/mine_online_mark.imageset/mine_online_mark@2x.png b/YuMi/Assets.xcassets/MineInfo/mine_online_mark.imageset/mine_online_mark@2x.png new file mode 100644 index 0000000000000000000000000000000000000000..08ae796f1040eac2a7b439fd95c50da22dc13fee GIT binary patch literal 120 zcmeAS@N?(olHy`uVBq!ia0vp^6(G#W3?!LXEtv?U7>k44ofy`glX(de3-AeX1=7o_ zY;S?&N`m}?862M7NCR@jJY5_^BqWn1SQjUV^fUz;aJezwWn^G)U|{5DV6q0PVDNPH Kb6Mw<&;$VC-Wo&z literal 0 HcmV?d00001 diff --git a/YuMi/Assets.xcassets/MineInfo/mine_online_mark.imageset/mine_online_mark@3x.png b/YuMi/Assets.xcassets/MineInfo/mine_online_mark.imageset/mine_online_mark@3x.png new file mode 100644 index 0000000000000000000000000000000000000000..c5b7347c44c6eebe8754ac19f39a718342e34f9e GIT binary patch literal 125 zcmeAS@N?(olHy`uVBq!ia0vp^TR@nR8A!4-PbmaajKx9jP7LeL$-D$|m;-!5T!HlR zD%)Eixso8iU= 3; + if (index >= 3) { + return; + } + switch (index) { + case 0: + self.numberImageView.image = [UIImage imageNamed:@"gift_list_one"]; + break; + case 1: + self.numberImageView.image = [UIImage imageNamed:@"gift_list_two"]; + break; + case 2: + self.numberImageView.image = [UIImage imageNamed:@"gift_list_three"]; + break; + default: + break; + } + +} - (UIImageView *)backgroundImageView { if (!_backgroundImageView) { @@ -74,6 +109,7 @@ _titleLabel = [UILabel labelInitWithText:@"" font:[UIFont systemFontOfSize:11 weight:UIFontWeightMedium] textColor:UIColorFromRGB(0x515860)]; + _titleLabel.textAlignment = NSTextAlignmentCenter; } return _titleLabel; } @@ -88,6 +124,13 @@ return _countLabel; } +- (UIImageView *)numberImageView { + if (!_numberImageView) { + _numberImageView = [[UIImageView alloc] init]; + } + return _numberImageView; +} + @end @@ -127,6 +170,15 @@ [self.giftsCollectionView reloadData]; } ++ (CGFloat)cellHeight:(BOOL)isExpand source:(NSArray *)dataSource { + if (isExpand) { + NSInteger line = dataSource.count / 4; + return MAX(line * 120 + line * 10, 120); + } else { + return 120; + } +} + #pragma mark - UICollectionViewDataSource - (NSInteger)collectionView:(UICollectionView *)collectionView numberOfItemsInSection:(NSInteger)section { @@ -141,6 +193,8 @@ cell.imageView.imageUrl = giftModel.picUrl; cell.titleLabel.text = giftModel.giftName; cell.countLabel.text = [NSString stringWithFormat:@"x%ld", (long)giftModel.reciveCount]; + cell.index = indexPath.row; + cell.isLuckyGift = self.isLucky; } return cell; } @@ -163,6 +217,7 @@ _giftsCollectionView.backgroundColor = [UIColor clearColor]; _giftsCollectionView.delegate = self; _giftsCollectionView.dataSource = self; + _giftsCollectionView.scrollEnabled = NO; [_giftsCollectionView registerClass:[XPMineGiftCell class] forCellWithReuseIdentifier:@"Gift Cell"]; } diff --git a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.h b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.h index ca66972e..e67ad60b 100644 --- a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.h +++ b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.h @@ -8,7 +8,7 @@ #import "MvpViewController.h" #import #import "MonentsInfoModel.h" -@class MedalModel; +@class MedalModel, UserGiftWallInfoModel; NS_ASSUME_NONNULL_BEGIN @class UserInfoModel, MineSkillCardListInfoModel, XPMineUserDataViewController; @@ -21,9 +21,11 @@ NS_ASSUME_NONNULL_BEGIN @interface XPMineUserDataViewController : MvpViewController @property (nonatomic,copy) NSString *userUid; ///用户信息 -@property (nonatomic,strong) UserInfoModel *userInfo; -@property (nonatomic,strong) NSArray*dynamicInfo; +@property (nonatomic, strong) UserInfoModel *userInfo; +@property (nonatomic, strong) NSArray*dynamicInfo; @property (nonatomic, strong) MedalModel *medalInfo; +@property (nonatomic, strong) NSArray *giftWall; +@property (nonatomic, strong) NSArray *luckyGiftWall; ///代理 @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 8c4f1b5d..51a6a018 100644 --- a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.m +++ b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserDataViewController.m @@ -31,6 +31,7 @@ #import "XPMineClanViewController.h" #import "XPMineGuildViewController.h" #import "XPMonentsDetailViewController.h" +#import "XPMineUserInfoAlbumViewController.h" #import "XPMineDataGiftTableViewCell.h" #import "XPMineAlbumTableViewCell.h" @@ -86,10 +87,12 @@ typedef enum : NSUInteger { }]; _arrowButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_arrowButton setBackgroundColor:[UIColor greenColor]]; + [_arrowButton setBackgroundImage:[UIImage imageNamed:@"skillCard_arrow"] + forState:UIControlStateNormal]; [_arrowButton addTarget:self action:@selector(didTapArrowButton) forControlEvents:UIControlEventTouchUpInside]; + [_arrowButton setEnlargeEdgeWithTop:5 right:10 bottom:10 left:10]; [self addSubview:_arrowButton]; [_arrowButton mas_makeConstraints:^(MASConstraintMaker *make) { make.centerY.mas_equalTo(self); @@ -129,8 +132,8 @@ typedef enum : NSUInteger { ///是否折叠 @property (nonatomic,assign) BOOL isFold; -@property (nonatomic,assign) BOOL isGiftsSectionFold; -@property (nonatomic,assign) BOOL isLuckyGiftsSectionFold; +@property (nonatomic,assign) BOOL isGiftsSectionExpand; +@property (nonatomic,assign) BOOL isLuckyGiftsSectionExpand; @property (nonatomic, copy) void(^scrollCallback)(UIScrollView *scrollView); ///是否展示加入家族房间 @property (nonatomic,assign) BOOL isShowEnterClan; @@ -161,11 +164,9 @@ typedef enum : NSUInteger { - (void)viewDidLoad { [super viewDidLoad]; + self.view.backgroundColor = [UIColor whiteColor]; - self.isGiftsSectionFold = YES; - self.isLuckyGiftsSectionFold = YES; - - [self initHttpRequest]; +// [self initHttpRequest]; [self initSubViews]; [self initSubViewConstraints]; } @@ -183,10 +184,25 @@ typedef enum : NSUInteger { - (void)initSubViewConstraints { [self.tableView mas_makeConstraints:^(MASConstraintMaker *make) { - make.edges.mas_equalTo(self.view); + make.top.mas_equalTo(self.view).offset(14); + make.bottom.mas_equalTo(self.view).offset(-14); + make.left.mas_equalTo(self.view).offset(14); + make.right.mas_equalTo(self.view).offset(-14); }]; } +- (void)didTapGiftsSectionFoldButton { + self.isGiftsSectionExpand = !self.isGiftsSectionExpand; + self.giftsExpandButton.transform = self.isGiftsSectionExpand ? CGAffineTransformMakeRotation(M_PI) : CGAffineTransformIdentity; + [self.tableView reloadData]; +} + +- (void)didTapLuckyGiftsSectionFoldButton { + self.isLuckyGiftsSectionExpand = !self.isLuckyGiftsSectionExpand; + self.luckyGiftsExpandButton.transform = self.isLuckyGiftsSectionExpand ? CGAffineTransformMakeRotation(M_PI) : CGAffineTransformIdentity; + [self.tableView reloadData]; +} + #pragma mark - UITableViewDelegate And UITableViewDataSource - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView { return SectionTypeCount; @@ -221,10 +237,12 @@ typedef enum : NSUInteger { return 70; break; case Gifts: - return self.isGiftsSectionFold ? 150 : 300; + return [XPMineGiftsTableViewCell cellHeight:self.isGiftsSectionExpand + source:self.giftWall]; break; case LuckyGifts: - return self.isLuckyGiftsSectionFold ? 150 : 300; + return [XPMineGiftsTableViewCell cellHeight:self.isLuckyGiftsSectionExpand + source:self.luckyGiftWall]; break; default: return 0; @@ -311,13 +329,15 @@ typedef enum : NSUInteger { break; case Gifts:{ XPMineGiftsTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineGiftsTableViewCell class])]; - cell.giftsDataSource = self.userInfo.userGiftWall; + cell.giftsDataSource = self.giftWall; + cell.isLucky = NO; return cell; } break; case LuckyGifts:{ XPMineGiftsTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineGiftsTableViewCell class])]; - cell.giftsDataSource = self.userInfo.userLuckyBagGiftWall; + cell.giftsDataSource = self.luckyGiftWall; + cell.isLucky = YES; return cell; } break; @@ -326,6 +346,7 @@ typedef enum : NSUInteger { break; } } + - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { if(indexPath.section == 0)return; [tableView deselectRowAtIndexPath:indexPath animated:YES]; @@ -340,6 +361,7 @@ typedef enum : NSUInteger { [self.navigationController pushViewController:detailVC animated:YES]; } } + #pragma mark - XPMonentsTableViewCellDelegate - (void)xPMonentsTableViewCell:(XPMonentsTableViewCell *)view didClickLike:(MonentsInfoModel *)monentsInfo { if(monentsInfo.dynamicId == nil){ @@ -523,7 +545,7 @@ typedef enum : NSUInteger { #pragma mark - Getters And Setters - (void)setUserInfo:(UserInfoModel *)userInfo { _userInfo = userInfo; - + self.albumHeader.num = [NSString stringWithFormat:@"(%ld)", (long)userInfo.privatePhoto.count]; [self.tableView reloadData]; } - (void)setDynamicInfo:(NSArray *)dynamicInfo { @@ -577,6 +599,8 @@ typedef enum : NSUInteger { @kWeakify(self); _albumHeader.didTapMore = ^{ @kStrongify(self); + XPMineUserInfoAlbumViewController * albumVC = [[XPMineUserInfoAlbumViewController alloc] init]; + [self.navigationController pushViewController:albumVC animated:YES]; }; } return _albumHeader; @@ -613,8 +637,8 @@ typedef enum : NSUInteger { - (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 setImage:[UIImage imageNamed:@"gift_bar_count_arrow"] forState:UIControlStateNormal]; + [_giftsExpandButton addTarget:self action:@selector(didTapGiftsSectionFoldButton) forControlEvents:UIControlEventTouchUpInside]; _giftsExpandButton.selected = YES; [_giftsExpandButton setEnlargeEdgeWithTop:5 right:10 bottom:10 left:10]; } @@ -624,8 +648,8 @@ typedef enum : NSUInteger { - (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 setImage:[UIImage imageNamed:@"gift_bar_count_arrow"] forState:UIControlStateNormal]; + [_luckyGiftsExpandButton addTarget:self action:@selector(didTapLuckyGiftsSectionFoldButton) forControlEvents:UIControlEventTouchUpInside]; _luckyGiftsExpandButton.selected = YES; [_luckyGiftsExpandButton setEnlargeEdgeWithTop:5 right:10 bottom:10 left:10]; } diff --git a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m index 187b7168..7d3555cd 100644 --- a/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m +++ b/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m @@ -116,7 +116,7 @@ XPMineCustomNavViewDelegate, XPMineUserInfoProtocol, XPMineUserInfoHeaderViewDel - (void)viewDidLoad { [super viewDidLoad]; - self.view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5]; + self.view.backgroundColor = [UIColor whiteColor]; [self initSubViews]; [self initSubViewConstraints]; } @@ -338,8 +338,8 @@ XPMineCustomNavViewDelegate, XPMineUserInfoProtocol, XPMineUserInfoHeaderViewDel } - (void)ongetDetailInfoSuccess:(UserInfoModel *)userInfo { - self.userDataVC.userInfo.userGiftWall = userInfo.userGiftWall; - self.userDataVC.userInfo.userLuckyBagGiftWall = userInfo.userLuckyBagGiftWall; + self.userDataVC.giftWall = userInfo.userGiftWall; + self.userDataVC.luckyGiftWall = userInfo.userLuckyBagGiftWall; self.userDataVC.dynamicInfo = userInfo.dynamicInfo; self.userDataVC.medalInfo = userInfo.medals; self.userMomentVC.dynamicInfo = userInfo.dynamicInfo; @@ -465,7 +465,7 @@ XPMineCustomNavViewDelegate, XPMineUserInfoProtocol, XPMineUserInfoHeaderViewDel if (!_titleView) { _titleView = [[JXCategoryTitleView alloc] init]; _titleView.delegate = self; - _titleView.backgroundColor = [UIColor clearColor]; + _titleView.backgroundColor = [UIColor whiteColor]; _titleView.titleColor = UIColorRGBAlpha(0x191919, 0.5); _titleView.titleSelectedColor = UIColorFromRGB(0x191919); _titleView.titleFont = [UIFont systemFontOfSize:18 weight:UIFontWeightBold]; diff --git a/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m b/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m index 7c746b5b..0bab9ed6 100644 --- a/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m +++ b/YuMi/Modules/YMMine/View/SubViews/MineInfo/XPMineUserInfoHeaderView.m @@ -12,12 +12,14 @@ #import "SDPhotoBrowser.h" #import #import +#import ///Tool #import "UIImage+ImageEffects.h" #import "UIImage+Utils.h" #import "NetImageView.h" #import "XPSkillCardPlayerManager.h" #import "XPRoomMiniManager.h" +#import "SpriteSheetImageManager.h" ///view #import "XPMineUserInfoHeaderTagView.h" ///Model @@ -110,6 +112,11 @@ return view;\ ///头像 @property (nonatomic,strong) NetImageView * avatarView; +///普通的 +@property (nonatomic,strong) YYAnimatedImageView *headWearImageView; +///头饰播放 +@property (nonatomic, strong) SpriteSheetImageManager *manager; + ///VIP等级icon @property (nonatomic,strong) NetImageView *nobleImageView; @@ -153,7 +160,7 @@ return view;\ [self addSubview:self.pageButton]; [self.pageButton mas_makeConstraints:^(MASConstraintMaker *make) { make.right.mas_equalTo(self); - make.top.mas_equalTo(self).offset(124); + make.top.mas_equalTo(self.onlineButton.mas_bottom).offset(76); make.size.mas_equalTo(CGSizeMake(63, 23)); }]; @@ -171,6 +178,12 @@ return view;\ make.centerY.equalTo(self.userInfoView.mas_top); }]; + [self.userInfoView addSubview:self.headWearImageView]; + [self.headWearImageView mas_makeConstraints:^(MASConstraintMaker *make) { + make.center.mas_equalTo(self.avatarView); + make.width.height.mas_equalTo(kGetScaleWidth(88)); + }]; + [self setupNameArea]; [self setupIDArea]; @@ -529,27 +542,44 @@ return view;\ if (_userInfo) { self.nameLabel.text = _userInfo.nick; self.birthDateLabel.text = @"1987-99-00";//[NSString calculateConstellationWithMonth:userInfo.birth]; - self.locateLabel.text = userInfo.region; //@"苏格拉场"; + self.locateLabel.text = userInfo.region; + NSString *text = [NSString stringWithFormat:@"ID:%ld", (long)_userInfo.erbanNo]; - NSMutableAttributedString *textAtt = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@ ",text] attributes:@{NSForegroundColorAttributeName:UIColorFromRGB(0x6D6B89)}]; - NSTextAttachment * attachment = [[NSTextAttachment alloc] init]; - UIImage *iconImage = [UIImage imageNamed:@"user_card_copy_id1"];; - attachment.bounds = CGRectMake(0, roundf(self.idLabel.font.capHeight - iconImage.size.height)/2.f, iconImage.size.width, iconImage.size.height); - attachment.image = iconImage; - [textAtt insertAttributedString:[NSMutableAttributedString attributedStringWithAttachment:attachment] atIndex:textAtt.length]; - self.idLabel.attributedText = textAtt; - + NSMutableAttributedString *textAtt = [[NSMutableAttributedString alloc]initWithString:[NSString stringWithFormat:@"%@ ",text] attributes:@{NSForegroundColorAttributeName:UIColorFromRGB(0x6D6B89)}]; + NSTextAttachment * attachment = [[NSTextAttachment alloc] init]; + UIImage *iconImage = [UIImage imageNamed:@"user_card_copy_id1"];; + attachment.bounds = CGRectMake(0, roundf(self.idLabel.font.capHeight - iconImage.size.height)/2.f, iconImage.size.width, iconImage.size.height); + attachment.image = iconImage; + [textAtt insertAttributedString:[NSMutableAttributedString attributedStringWithAttachment:attachment] atIndex:textAtt.length]; + self.idLabel.attributedText = textAtt; self.signLabel.text = _userInfo.userDesc.length > 0 ? _userInfo.userDesc : YMLocalizedString(@"XPTreasureFairyFriendCell0"); self.fansNum.text = [@(_userInfo.fansNum) stringValue]; self.followersNum.text = [@(_userInfo.followNum) stringValue];; + [self.sexImageView setTitle:[NSString getAgeWithBirth:_userInfo.birth] forState:UIControlStateNormal]; self.sexImageView.backgroundColor = _userInfo.gender == GenderType_Male ? UIColorFromRGB(0x6BB3FF) :UIColorFromRGB(0xFF80CC); self.sexImageView.titleEdgeInsets = _userInfo.gender != GenderType_Male ? UIEdgeInsetsMake(0, 2, 0, 0):UIEdgeInsetsMake(0, -1, 0, 0); self.sexImageView.selected = _userInfo.gender != GenderType_Male; + self.officalImageView.hidden = userInfo.defUser != UserLevelType_Offical; self.beautifulImageView.hidden = !userInfo.hasPrettyErbanNo; self.newUserImageView.hidden = !userInfo.newUser; + + NSString * headerUrl = userInfo.headwearEffect.length > 0 ? userInfo.headwearEffect : userInfo.headwearPic; + if (headerUrl.length >0) { + self.headWearImageView.hidden = NO; + NSURL *url = [NSURL URLWithString:headerUrl]; + @kWeakify(self); + [self.manager loadSpriteSheetImageWithURL:url completionBlock:^(YYSpriteSheetImage * _Nullable sprit) { + @kStrongify(self); + self.headWearImageView.image = sprit; + } failureBlock:^(NSError * _Nullable error) { + }]; + } else { + self.headWearImageView.hidden = YES; + } + if (userInfo.userLevelVo.experUrl) { [self.experImageView loadImageWithUrl:userInfo.userLevelVo.experUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) { self.experImageView.image = image; @@ -781,13 +811,15 @@ return view;\ - (UIButton *)onlineButton { if (!_onlineButton) { _onlineButton = [UIButton buttonWithType:UIButtonTypeCustom]; - [_onlineButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[UIColorFromRGB(0x41EABA), UIColorFromRGB(0x26cc9c)] - gradientType:GradientTypeTopToBottom - imgSize:CGSizeMake(63, 23)] + [_onlineButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xf2a20f), UIColorFromRGB(0xffd936)] + gradientType:GradientTypeLeftToRight + imgSize:CGSizeMake(64, 24)] forState:UIControlStateNormal]; [_onlineButton addTarget:self action:@selector(onlineButtonAction:) forControlEvents:UIControlEventTouchUpInside]; + [_onlineButton setTitle:YMLocalizedString(@"XPMineSimpleUserInfoHeaderView2") forState:UIControlStateNormal]; + [_onlineButton setImage:[UIImage imageNamed:@"mine_online_mark"] forState:UIControlStateNormal]; [_onlineButton setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10]; } return _onlineButton; @@ -978,6 +1010,23 @@ return view;\ return _avatarView; } +- (YYAnimatedImageView *)headWearImageView { + if (!_headWearImageView) { + _headWearImageView = [[YYAnimatedImageView alloc] init]; + _headWearImageView.backgroundColor = [UIColor clearColor]; + _headWearImageView.contentMode = UIViewContentModeScaleAspectFit; + _headWearImageView.layer.masksToBounds = YES; + _headWearImageView.layer.cornerRadius = 10; + } + return _headWearImageView; +} + +- (SpriteSheetImageManager *)manager { + if (!_manager) { + _manager = [[SpriteSheetImageManager alloc] init]; + } + return _manager; +} -(XPMineUserInfoHeaderTagView *)tagView{ if (!_tagView){ _tagView = [[XPMineUserInfoHeaderTagView alloc]initWithFrame:CGRectZero]; diff --git a/YuMi/Modules/YMRoom/View/XPRoomViewController.m b/YuMi/Modules/YMRoom/View/XPRoomViewController.m index 489cba43..1a8b04ed 100644 --- a/YuMi/Modules/YMRoom/View/XPRoomViewController.m +++ b/YuMi/Modules/YMRoom/View/XPRoomViewController.m @@ -1558,8 +1558,8 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 NSDictionary *data = [content.notifyExt toJSONObject]; int type = [data[@"type"] intValue]; switch (type) { - case 1: - case 3: + case 1: // 房间信息变化 + case 3: // 房间信息 & 麦位信息变化 { NSMutableDictionary *lastRoomInfoDic = [NSMutableDictionary dictionaryWithDictionary:[self.roomInfo model2dictionary]]; [lastRoomInfoDic addEntriesFromDictionary: ((NSString *)data[@"roomInfo"]).toJSONObject]; @@ -1598,8 +1598,6 @@ NSString * const kHadQuitOtherRoomKey = @"kHadQuitOtherRoomKey";//是否退出 [self.functionView removeFromSuperview]; [self.menuContainerView removeFromSuperview]; - - [self.view addSubview:self.backContainerView]; [self.view addSubview:self.stageView]; [self.view addSubview:self.messageContainerView];