完善个人资料页功能
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 21 KiB |
Before Width: | Height: | Size: 54 KiB After Width: | Height: | Size: 54 KiB |
Before Width: | Height: | Size: 24 KiB After Width: | Height: | Size: 24 KiB |
Before Width: | Height: | Size: 58 KiB After Width: | Height: | Size: 58 KiB |
22
YuMi/Assets.xcassets/MineInfo/mine_online_mark.imageset/Contents.json
vendored
Normal file
@@ -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
|
||||
}
|
||||
}
|
BIN
YuMi/Assets.xcassets/MineInfo/mine_online_mark.imageset/mine_online_mark@2x.png
vendored
Normal file
After Width: | Height: | Size: 120 B |
BIN
YuMi/Assets.xcassets/MineInfo/mine_online_mark.imageset/mine_online_mark@3x.png
vendored
Normal file
After Width: | Height: | Size: 125 B |
@@ -12,6 +12,9 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
@interface XPMineGiftsTableViewCell : UITableViewCell
|
||||
|
||||
@property (nonatomic, copy) NSArray *giftsDataSource;
|
||||
@property (nonatomic, assign) BOOL isLucky;
|
||||
|
||||
+ (CGFloat)cellHeight:(BOOL)isExpand source:(NSArray *)dataSource;
|
||||
|
||||
@end
|
||||
|
||||
|
@@ -14,6 +14,9 @@
|
||||
@property (nonatomic, strong) NetImageView *imageView;
|
||||
@property (nonatomic, strong) UILabel *titleLabel;
|
||||
@property (nonatomic, strong) UILabel *countLabel;
|
||||
@property (nonatomic, strong) UIImageView *numberImageView;
|
||||
@property (nonatomic, assign) NSInteger index;
|
||||
@property (nonatomic, assign) BOOL isLuckyGift;
|
||||
|
||||
@end
|
||||
|
||||
@@ -36,7 +39,7 @@
|
||||
|
||||
[self.contentView addSubview:self.titleLabel];
|
||||
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerX.mas_equalTo(self.contentView);
|
||||
make.left.right.mas_equalTo(self.contentView);
|
||||
make.top.mas_equalTo(self.imageView.mas_bottom).offset(10);
|
||||
}];
|
||||
|
||||
@@ -45,10 +48,42 @@
|
||||
make.centerX.mas_equalTo(self.contentView);
|
||||
make.top.mas_equalTo(self.titleLabel.mas_bottom).offset(6);
|
||||
}];
|
||||
|
||||
[self.contentView addSubview:self.numberImageView];
|
||||
[self.numberImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.top.mas_equalTo(8);
|
||||
make.width.height.mas_equalTo(20);
|
||||
}];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)setIsLuckyGift:(BOOL)isLuckyGift {
|
||||
_isLuckyGift = isLuckyGift;
|
||||
self.backgroundImageView.image = isLuckyGift ? [UIImage imageNamed:@"mine_lucky_gift_bg"] : [UIImage imageNamed:@"mine_gift_bg"];
|
||||
}
|
||||
|
||||
- (void)setIndex:(NSInteger)index {
|
||||
_index = index;
|
||||
self.numberImageView.hidden = index >= 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"];
|
||||
}
|
||||
|
@@ -8,7 +8,7 @@
|
||||
#import "MvpViewController.h"
|
||||
#import <JXPagingView/JXPagerView.h>
|
||||
#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<JXPagerViewListViewDelegate>
|
||||
@property (nonatomic,copy) NSString *userUid;
|
||||
///用户信息
|
||||
@property (nonatomic,strong) UserInfoModel *userInfo;
|
||||
@property (nonatomic,strong) NSArray<MonentsInfoModel *>*dynamicInfo;
|
||||
@property (nonatomic, strong) UserInfoModel *userInfo;
|
||||
@property (nonatomic, strong) NSArray<MonentsInfoModel *>*dynamicInfo;
|
||||
@property (nonatomic, strong) MedalModel *medalInfo;
|
||||
@property (nonatomic, strong) NSArray<UserGiftWallInfoModel *> *giftWall;
|
||||
@property (nonatomic, strong) NSArray<UserGiftWallInfoModel *> *luckyGiftWall;
|
||||
///代理
|
||||
@property (nonatomic,weak) id<XPMineUserDataViewControllerDelegate> delegate;
|
||||
@end
|
||||
|
@@ -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<MonentsInfoModel *> *)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];
|
||||
}
|
||||
|
@@ -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];
|
||||
|
@@ -12,12 +12,14 @@
|
||||
#import "SDPhotoBrowser.h"
|
||||
#import <ReactiveObjC/ReactiveObjC.h>
|
||||
#import <SVGA.h>
|
||||
#import <YYImage/YYAnimatedImageView.h>
|
||||
///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];
|
||||
|
@@ -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];
|
||||
|