Commit 36252819 by pierce

fixed bugs

parent a514747d
...@@ -171,6 +171,10 @@ ...@@ -171,6 +171,10 @@
result = [result stringByReplacingOccurrencesOfString:@"FIREFLY" withString:@"FUSI"]; result = [result stringByReplacingOccurrencesOfString:@"FIREFLY" withString:@"FUSI"];
} }
if ([result containsString:@"Footseen"]) {
result = [result stringByReplacingOccurrencesOfString:@"Footseen" withString:@"fusi"];
}
return result; return result;
} }
......
...@@ -16,6 +16,7 @@ ...@@ -16,6 +16,7 @@
#import "FUSReportViewController.h" #import "FUSReportViewController.h"
// View // View
#import "FUSLiveOutlineLabel.h" #import "FUSLiveOutlineLabel.h"
#import "FUSControllerPushHelper.h"
#define INFO_VIEW_HEIGHT 338 #define INFO_VIEW_HEIGHT 338
#define BUTTOM_VIEW_HEIGHT 64 #define BUTTOM_VIEW_HEIGHT 64
...@@ -38,6 +39,8 @@ if (@available(iOS 11.0, *)) {height = 80 + UIView.fus_SafeBottom;}\ ...@@ -38,6 +39,8 @@ if (@available(iOS 11.0, *)) {height = 80 + UIView.fus_SafeBottom;}\
@property (nonatomic, strong) UIButton *faceBtn; @property (nonatomic, strong) UIButton *faceBtn;
// 富豪等级view // 富豪等级view
@property (nonatomic, strong) UIImageView *richImageView; @property (nonatomic, strong) UIImageView *richImageView;
/// vip 点击事件
@property (nonatomic, strong) UIButton *vipBtn;
// 举报按钮 // 举报按钮
@property (nonatomic, strong) UIButton *reportBtn; @property (nonatomic, strong) UIButton *reportBtn;
// 昵称 // 昵称
...@@ -466,6 +469,10 @@ if (@available(iOS 11.0, *)) {height = 80 + UIView.fus_SafeBottom;}\ ...@@ -466,6 +469,10 @@ if (@available(iOS 11.0, *)) {height = 80 + UIView.fus_SafeBottom;}\
_richImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 28, 14)]; _richImageView = [[UIImageView alloc] initWithFrame:CGRectMake(0, 0, 28, 14)];
_richImageView.contentMode = UIViewContentModeScaleAspectFit; _richImageView.contentMode = UIViewContentModeScaleAspectFit;
[self.bgView addSubview:_richImageView]; [self.bgView addSubview:_richImageView];
self.vipBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[self.vipBtn addTarget:self action:@selector(fus_jumpToVipPage) forControlEvents:UIControlEventTouchUpInside];
[self.bgView addSubview:self.vipBtn];
} }
- (void)fus_initSexAndAgeBgView { - (void)fus_initSexAndAgeBgView {
...@@ -682,7 +689,7 @@ if (@available(iOS 11.0, *)) {height = 80 + UIView.fus_SafeBottom;}\ ...@@ -682,7 +689,7 @@ if (@available(iOS 11.0, *)) {height = 80 + UIView.fus_SafeBottom;}\
self.levLabel.centerY = self.nickNameLabel.centerY; self.levLabel.centerY = self.nickNameLabel.centerY;
self.richImageView.centerY = self.levLabel.centerY; self.richImageView.centerY = self.levLabel.centerY;
self.vipBtn.frame = self.richImageView.frame;
/// *********** /// ***********
/// id行 :id + 性别 /// id行 :id + 性别
...@@ -702,7 +709,7 @@ if (@available(iOS 11.0, *)) {height = 80 + UIView.fus_SafeBottom;}\ ...@@ -702,7 +709,7 @@ if (@available(iOS 11.0, *)) {height = 80 + UIView.fus_SafeBottom;}\
[_sexAndAgeBgBtn setBackgroundImage:nil forState:UIControlStateNormal]; [_sexAndAgeBgBtn setBackgroundImage:nil forState:UIControlStateNormal];
[_sexAndAgeBgBtn setImage:nil forState:UIControlStateNormal]; [_sexAndAgeBgBtn setImage:nil forState:UIControlStateNormal];
[_sexAndAgeBgBtn setTitle:nil forState:UIControlStateNormal]; [_sexAndAgeBgBtn setTitle:nil forState:UIControlStateNormal];
if ([NSString isNull:model.constellation]) { if (model.age.integerValue <= 0) {
if (model.sex.integerValue == 0) { if (model.sex.integerValue == 0) {
[_sexAndAgeBgBtn setImage:[[UIImage imageNamed:@"fireFly_my_zone_sex_famale_no_age"] fusrtl_imageFlippedForRightToLeftLayoutDirection] forState:UIControlStateNormal]; [_sexAndAgeBgBtn setImage:[[UIImage imageNamed:@"fireFly_my_zone_sex_famale_no_age"] fusrtl_imageFlippedForRightToLeftLayoutDirection] forState:UIControlStateNormal];
}else if (model.sex.integerValue == 1) { }else if (model.sex.integerValue == 1) {
...@@ -710,6 +717,7 @@ if (@available(iOS 11.0, *)) {height = 80 + UIView.fus_SafeBottom;}\ ...@@ -710,6 +717,7 @@ if (@available(iOS 11.0, *)) {height = 80 + UIView.fus_SafeBottom;}\
}else if (model.sex.integerValue == -1) { }else if (model.sex.integerValue == -1) {
[_sexAndAgeBgBtn setImage:[[UIImage imageNamed:@"fireFly_my_zone_sex_secret_no_age"] fusrtl_imageFlippedForRightToLeftLayoutDirection] forState:UIControlStateNormal]; [_sexAndAgeBgBtn setImage:[[UIImage imageNamed:@"fireFly_my_zone_sex_secret_no_age"] fusrtl_imageFlippedForRightToLeftLayoutDirection] forState:UIControlStateNormal];
} }
self.sexAndAgeBgBtn.width = 14;
}else { }else {
if (model.sex.integerValue == 0) { if (model.sex.integerValue == 0) {
NSString *str = [FUSRTL RTLImageName:@"video_chat_userinfo_sex_female_bg"]; NSString *str = [FUSRTL RTLImageName:@"video_chat_userinfo_sex_female_bg"];
...@@ -723,6 +731,7 @@ if (@available(iOS 11.0, *)) {height = 80 + UIView.fus_SafeBottom;}\ ...@@ -723,6 +731,7 @@ if (@available(iOS 11.0, *)) {height = 80 + UIView.fus_SafeBottom;}\
[_sexAndAgeBgBtn setTitleEdgeInsets:UIEdgeInsetsMake(0, 10, 0, 0)]; [_sexAndAgeBgBtn setTitleEdgeInsets:UIEdgeInsetsMake(0, 10, 0, 0)];
} }
[_sexAndAgeBgBtn setTitle:model.age forState:UIControlStateNormal]; [_sexAndAgeBgBtn setTitle:model.age forState:UIControlStateNormal];
self.sexAndAgeBgBtn.width = 30;
} }
idLineWidth += nickLineItemSpace + _sexAndAgeBgBtn.width; idLineWidth += nickLineItemSpace + _sexAndAgeBgBtn.width;
...@@ -1055,6 +1064,10 @@ if (@available(iOS 11.0, *)) {height = 80 + UIView.fus_SafeBottom;}\ ...@@ -1055,6 +1064,10 @@ if (@available(iOS 11.0, *)) {height = 80 + UIView.fus_SafeBottom;}\
#pragma mark 按钮点击事件 #pragma mark 按钮点击事件
- (void)fus_jumpToVipPage {
[[UIViewController fus_topViewController].navigationController fus_pushToBuyVIPControllerWithAnimate:YES];
}
- (void)fus_onClickChatWithUser { - (void)fus_onClickChatWithUser {
[self fus_dismissUserInfoViewWithAnimate:YES]; [self fus_dismissUserInfoViewWithAnimate:YES];
if (self.didClickUserInfoViewBtnBlock) { if (self.didClickUserInfoViewBtnBlock) {
......
...@@ -397,9 +397,9 @@ ...@@ -397,9 +397,9 @@
if (level <= 0) { if (level <= 0) {
continue; continue;
} else if (level > 0 && level <= 30) { } else if (level > 0 && level <= 30) {
content = [content stringByReplacingCharactersInRange:result.range withString:@"<img src=https://big.bgp.ourpow.com/comm/userlevel/fusi/vip.png />"]; content = [content stringByReplacingCharactersInRange:result.range withString:@" <img src=https://big.bgp.ourpow.com/comm/userlevel/fusi/vip.png /> "];
} else { } else {
content = [content stringByReplacingCharactersInRange:result.range withString:@"<img src=https://big.bgp.ourpow.com/comm/userlevel/fusi/svip.png />"]; content = [content stringByReplacingCharactersInRange:result.range withString:@" <img src=https://big.bgp.ourpow.com/comm/userlevel/fusi/svip.png /> "];
} }
} }
} }
......
...@@ -764,12 +764,8 @@ ...@@ -764,12 +764,8 @@
} }
} }
CGFloat imageH = LEVEL_IMAGE_HEIGHT; CGFloat imageH = 14;
CGFloat imageW = LEVEL_IMAGE_WIDTH; CGFloat imageW = 0;
if (model.isHide.boolValue || model.danmu.boolValue) {
imageH = LEVEL_IMAGE_HEIGHT*0.8;
imageW = LEVEL_IMAGE_WIDTH*0.8;
}
dispatch_async(dispatch_get_global_queue(0, 0), ^{ dispatch_async(dispatch_get_global_queue(0, 0), ^{
...@@ -864,8 +860,9 @@ ...@@ -864,8 +860,9 @@
levBtn.width = 20; levBtn.width = 20;
} }
NSAttributedString *levAttr = [NSAttributedString attachmentStringWithContent:levBtn contentMode:UIViewContentModeScaleAspectFit attachmentSize:levBtn.size alignToFont:[UIFont fus_themeFont:self.fontSize] alignment:YYTextVerticalAlignmentCenter]; NSAttributedString *levAttr = [NSAttributedString attachmentStringWithContent:levBtn contentMode:UIViewContentModeScaleAspectFit attachmentSize:levBtn.size alignToFont:[UIFont fus_themeFont:self.fontSize] alignment:YYTextVerticalAlignmentCenter];
[attr insertString:@" " atIndex:0];
[attr insertAttributedString:levAttr atIndex:0]; [attr insertAttributedString:levAttr atIndex:0];
[attr appendString:@" "];
} }
// 容错 // 容错
...@@ -887,7 +884,9 @@ ...@@ -887,7 +884,9 @@
CGFloat imageW = levelImageHeight / levelImage.size.height * levelImage.size.width; CGFloat imageW = levelImageHeight / levelImage.size.height * levelImage.size.width;
NSAttributedString *levelAttr = [NSAttributedString attachmentStringWithContent:levelImage contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(imageW,imageH) alignToFont:FUS_LIVE_FONT(fontSize) alignment:YYTextVerticalAlignmentCenter]; NSAttributedString *levelAttr = [NSAttributedString attachmentStringWithContent:levelImage contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(imageW,imageH) alignToFont:FUS_LIVE_FONT(fontSize) alignment:YYTextVerticalAlignmentCenter];
// 让VIP图标图标往下偏移 // 让VIP图标图标往下偏移
[attr appendString:@" "];
[attr appendAttributedString:levelAttr]; [attr appendAttributedString:levelAttr];
[attr appendString:@" "];
} }
// 有等级 进行添加 // 有等级 进行添加
// FUSLevelDataModel *levelModel = [self.levelDict objectForKey:model.level]; // FUSLevelDataModel *levelModel = [self.levelDict objectForKey:model.level];
...@@ -980,7 +979,7 @@ ...@@ -980,7 +979,7 @@
// 3.2.0 添加首冲标识 // 3.2.0 添加首冲标识
if ([model.privilege[@"firstChargePower"] integerValue] == 1) { if ([model.privilege[@"firstChargePower"] integerValue] == 1) {
UIImageView *firstChargeImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"live_first_love_img"]]; UIImageView *firstChargeImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"live_first_love_img"]];
firstChargeImageView.frame = CGRectMake(0, 0, 35, 13); firstChargeImageView.frame = CGRectMake(0, 0, 35, 14);
firstChargeImageView.contentMode = UIViewContentModeScaleAspectFit; firstChargeImageView.contentMode = UIViewContentModeScaleAspectFit;
NSAttributedString *firstChargeAttr = [NSAttributedString attachmentStringWithContent:firstChargeImageView contentMode:UIViewContentModeScaleAspectFit attachmentSize:firstChargeImageView.size alignToFont:[UIFont fus_themeFont:fontSize] alignment:YYTextVerticalAlignmentCenter]; NSAttributedString *firstChargeAttr = [NSAttributedString attachmentStringWithContent:firstChargeImageView contentMode:UIViewContentModeScaleAspectFit attachmentSize:firstChargeImageView.size alignToFont:[UIFont fus_themeFont:fontSize] alignment:YYTextVerticalAlignmentCenter];
...@@ -1337,7 +1336,7 @@ ...@@ -1337,7 +1336,7 @@
dispatch_async(dispatch_get_global_queue(0, 0), ^{ dispatch_async(dispatch_get_global_queue(0, 0), ^{
__weak typeof(self) weakSelf = self; __weak typeof(self) weakSelf = self;
CGSize imageSize = CGSizeMake(45, 20); CGSize imageSize = CGSizeMake(45, 14);
NSMutableAttributedString *bulletAttr = [self createContentAttributedStringWithModel:message imageSize:imageSize fontSize:14]; NSMutableAttributedString *bulletAttr = [self createContentAttributedStringWithModel:message imageSize:imageSize fontSize:14];
dispatch_async(dispatch_get_main_queue(), ^{ dispatch_async(dispatch_get_main_queue(), ^{
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
#import "FUSContributeCellTableViewCell.h" #import "FUSContributeCellTableViewCell.h"
#import "FUSControllerPushHelper.h"
@interface FUSContributeCellTableViewCell () @interface FUSContributeCellTableViewCell ()
...@@ -24,6 +25,9 @@ ...@@ -24,6 +25,9 @@
/// vip /// vip
@property (nonatomic, strong) UIImageView *vipImageView; @property (nonatomic, strong) UIImageView *vipImageView;
/// vip 点击事件
@property (nonatomic, strong) UIButton *vipBtn;
/// 在线等级 /// 在线等级
@property (nonatomic, strong) UILabel *onlineLabel; @property (nonatomic, strong) UILabel *onlineLabel;
...@@ -53,6 +57,7 @@ ...@@ -53,6 +57,7 @@
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) { if (self) {
self.backgroundColor = [UIColor fus_appBGColor];
self.selectedBackgroundView = [[UIView alloc] init]; self.selectedBackgroundView = [[UIView alloc] init];
self.selectedBackgroundView.backgroundColor = [UIColor clearColor]; self.selectedBackgroundView.backgroundColor = [UIColor clearColor];
[self fus_initViews]; [self fus_initViews];
...@@ -89,6 +94,10 @@ ...@@ -89,6 +94,10 @@
self.vipImageView.contentMode = UIViewContentModeScaleToFill; self.vipImageView.contentMode = UIViewContentModeScaleToFill;
[self.contentView addSubview:self.vipImageView]; [self.contentView addSubview:self.vipImageView];
self.vipBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[self.vipBtn addTarget:self action:@selector(fus_jumpToVipPage) forControlEvents:UIControlEventTouchUpInside];
[self.contentView addSubview:self.vipBtn];
self.firstLoveImageView = [[UIImageView alloc] init]; self.firstLoveImageView = [[UIImageView alloc] init];
self.firstLoveImageView.contentMode = UIViewContentModeScaleToFill; self.firstLoveImageView.contentMode = UIViewContentModeScaleToFill;
self.firstLoveImageView.image = [UIImage imageNamed:@"live_first_love_img"]; self.firstLoveImageView.image = [UIImage imageNamed:@"live_first_love_img"];
...@@ -108,7 +117,7 @@ ...@@ -108,7 +117,7 @@
self.genderAndAgeBtn.titleLabel.font = [UIFont fus_themeFont:9]; self.genderAndAgeBtn.titleLabel.font = [UIFont fus_themeFont:9];
self.genderAndAgeBtn.layer.borderColor = [UIColor colorWithHex:@"#D6D6D7"].CGColor; self.genderAndAgeBtn.layer.borderColor = [UIColor colorWithHex:@"#D6D6D7"].CGColor;
self.genderAndAgeBtn.layer.borderWidth = 0.5; self.genderAndAgeBtn.layer.borderWidth = 0.5;
self.genderAndAgeBtn.layer.cornerRadius = 9; self.genderAndAgeBtn.layer.cornerRadius = 7;
self.genderAndAgeBtn.layer.masksToBounds = YES; self.genderAndAgeBtn.layer.masksToBounds = YES;
[self.contentView addSubview:self.genderAndAgeBtn]; [self.contentView addSubview:self.genderAndAgeBtn];
...@@ -161,6 +170,10 @@ ...@@ -161,6 +170,10 @@
make.left.equalTo(self.onlineLabel.mas_right).offset(4); make.left.equalTo(self.onlineLabel.mas_right).offset(4);
}]; }];
[self.vipBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.vipImageView);
}];
[self.firstLoveImageView mas_makeConstraints:^(MASConstraintMaker *make) { [self.firstLoveImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(32); make.width.mas_equalTo(32);
make.height.mas_equalTo(11); make.height.mas_equalTo(11);
...@@ -320,4 +333,8 @@ ...@@ -320,4 +333,8 @@
} }
} }
- (void)fus_jumpToVipPage {
[[UIViewController fus_topViewController].navigationController fus_pushToBuyVIPControllerWithAnimate:YES];
}
@end @end
...@@ -28,6 +28,7 @@ ...@@ -28,6 +28,7 @@
self.tableView = [[UITableView alloc] initWithFrame:self.bounds style:UITableViewStylePlain]; self.tableView = [[UITableView alloc] initWithFrame:self.bounds style:UITableViewStylePlain];
self.tableView.delegate = self; self.tableView.delegate = self;
self.tableView.dataSource = self; self.tableView.dataSource = self;
self.tableView.backgroundColor = [UIColor fus_appBGColor];
self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 74, 0); self.tableView.contentInset = UIEdgeInsetsMake(0, 0, 74, 0);
[self.tableView registerClass:[FUSContributeCellTableViewCell class] forCellReuseIdentifier:[FUSContributeCellTableViewCell cellIdentifer]]; [self.tableView registerClass:[FUSContributeCellTableViewCell class] forCellReuseIdentifier:[FUSContributeCellTableViewCell cellIdentifer]];
self.tableView.rowHeight = 60; self.tableView.rowHeight = 60;
......
...@@ -46,6 +46,7 @@ ...@@ -46,6 +46,7 @@
self.tableView = [[UITableView alloc] initWithFrame:self.bounds style:UITableViewStylePlain]; self.tableView = [[UITableView alloc] initWithFrame:self.bounds style:UITableViewStylePlain];
self.tableView.delegate = self; self.tableView.delegate = self;
self.tableView.dataSource = self; self.tableView.dataSource = self;
self.tableView.backgroundColor = [UIColor fus_appBGColor];
self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone; self.tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
[self.tableView registerClass:[FUSAudienceTableViewCell class] forCellReuseIdentifier:[FUSAudienceTableViewCell cellIdentifer]]; [self.tableView registerClass:[FUSAudienceTableViewCell class] forCellReuseIdentifier:[FUSAudienceTableViewCell cellIdentifer]];
self.tableView.rowHeight = 60; self.tableView.rowHeight = 60;
......
...@@ -6,6 +6,7 @@ ...@@ -6,6 +6,7 @@
// //
#import "FUSAudienceTableViewCell.h" #import "FUSAudienceTableViewCell.h"
#import "FUSControllerPushHelper.h"
#import <Masonry/Masonry.h> #import <Masonry/Masonry.h>
@interface FUSAudienceTableViewCell () @interface FUSAudienceTableViewCell ()
...@@ -19,6 +20,9 @@ ...@@ -19,6 +20,9 @@
/// vip /// vip
@property (nonatomic, strong) UIImageView *vipImageView; @property (nonatomic, strong) UIImageView *vipImageView;
/// vip 点击事件
@property (nonatomic, strong) UIButton *vipBtn;
/// 在线等级 /// 在线等级
@property (nonatomic, strong) UILabel *onlineLabel; @property (nonatomic, strong) UILabel *onlineLabel;
...@@ -43,6 +47,7 @@ ...@@ -43,6 +47,7 @@
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]; self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self) { if (self) {
self.backgroundColor = [UIColor fus_appBGColor];
self.selectedBackgroundView = [[UIView alloc] init]; self.selectedBackgroundView = [[UIView alloc] init];
self.selectedBackgroundView.backgroundColor = [UIColor clearColor]; self.selectedBackgroundView.backgroundColor = [UIColor clearColor];
[self fus_initViews]; [self fus_initViews];
...@@ -69,6 +74,10 @@ ...@@ -69,6 +74,10 @@
self.vipImageView.contentMode = UIViewContentModeScaleToFill; self.vipImageView.contentMode = UIViewContentModeScaleToFill;
[self.contentView addSubview:self.vipImageView]; [self.contentView addSubview:self.vipImageView];
self.vipBtn = [UIButton buttonWithType:UIButtonTypeCustom];
[self.vipBtn addTarget:self action:@selector(fus_jumpToVipPage) forControlEvents:UIControlEventTouchUpInside];
[self.contentView addSubview:self.vipBtn];
self.firstLoveImageView = [[UIImageView alloc] init]; self.firstLoveImageView = [[UIImageView alloc] init];
self.firstLoveImageView.contentMode = UIViewContentModeScaleToFill; self.firstLoveImageView.contentMode = UIViewContentModeScaleToFill;
self.firstLoveImageView.image = [UIImage imageNamed:@"live_first_love_img"]; self.firstLoveImageView.image = [UIImage imageNamed:@"live_first_love_img"];
...@@ -88,7 +97,7 @@ ...@@ -88,7 +97,7 @@
self.genderAndAgeBtn.titleLabel.font = [UIFont fus_themeFont:9]; self.genderAndAgeBtn.titleLabel.font = [UIFont fus_themeFont:9];
self.genderAndAgeBtn.layer.borderColor = [UIColor colorWithHex:@"#D6D6D7"].CGColor; self.genderAndAgeBtn.layer.borderColor = [UIColor colorWithHex:@"#D6D6D7"].CGColor;
self.genderAndAgeBtn.layer.borderWidth = 0.5; self.genderAndAgeBtn.layer.borderWidth = 0.5;
self.genderAndAgeBtn.layer.cornerRadius = 9; self.genderAndAgeBtn.layer.cornerRadius = 7;
self.genderAndAgeBtn.layer.masksToBounds = YES; self.genderAndAgeBtn.layer.masksToBounds = YES;
[self.contentView addSubview:self.genderAndAgeBtn]; [self.contentView addSubview:self.genderAndAgeBtn];
} }
...@@ -121,6 +130,10 @@ ...@@ -121,6 +130,10 @@
make.left.equalTo(self.onlineLabel.mas_right).offset(4); make.left.equalTo(self.onlineLabel.mas_right).offset(4);
}]; }];
[self.vipBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.mas_equalTo(self.vipImageView);
}];
[self.firstLoveImageView mas_makeConstraints:^(MASConstraintMaker *make) { [self.firstLoveImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.mas_equalTo(32); make.width.mas_equalTo(32);
make.height.mas_equalTo(11); make.height.mas_equalTo(11);
...@@ -260,4 +273,8 @@ ...@@ -260,4 +273,8 @@
} }
} }
- (void)fus_jumpToVipPage {
[[UIViewController fus_topViewController].navigationController fus_pushToBuyVIPControllerWithAnimate:YES];
}
@end @end
...@@ -168,7 +168,7 @@ ...@@ -168,7 +168,7 @@
CGFloat height = _portraitView.height * 1.6; CGFloat height = _portraitView.height * 1.6;
// 装 collectionView 的 BGView // 装 collectionView 的 BGView
_userCollectionBGView = [[UIView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(_portraitView.frame) + 2, CGRectGetMaxY(_portraitView.frame) - height, self.width - CGRectGetMaxX(_portraitView.frame) - 8, height+10)]; _userCollectionBGView = [[UIView alloc]initWithFrame:CGRectMake(CGRectGetMaxX(_portraitView.frame) + 2, CGRectGetMaxY(_portraitView.frame) - height, self.width - CGRectGetMaxX(_portraitView.frame) - 8, height)];
_userCollectionBGView.backgroundColor = [UIColor clearColor]; _userCollectionBGView.backgroundColor = [UIColor clearColor];
_userCollectionBGView.clipsToBounds = YES; _userCollectionBGView.clipsToBounds = YES;
[self addSubview:_userCollectionBGView]; [self addSubview:_userCollectionBGView];
......
...@@ -56,13 +56,18 @@ typedef enum : NSUInteger { ...@@ -56,13 +56,18 @@ typedef enum : NSUInteger {
[super setFrame:frame]; [super setFrame:frame];
_userCollectionView.frame = self.bounds; _userCollectionView.frame = self.bounds;
CGFloat width = floor((self.width) / 6.0); CGFloat width = self.height * 0.6;
if (self.userItemSize.width != width) { if (self.userItemSize.width != width) {
_userItemSize = CGSizeMake(floor(width), self.height); _userItemSize = CGSizeMake(floor(width), self.height);
_flowLayout.itemSize = _userItemSize; _flowLayout.itemSize = _userItemSize;
[_userCollectionView reloadData]; [_userCollectionView reloadData];
} }
_userCollectionView.width = width * 5; // 要显示整数个
CGFloat collectionViewWidth = width * 5;
if (collectionViewWidth > self.width - width) {
collectionViewWidth = width * 4;
}
self.userCollectionView.width = collectionViewWidth;
CGFloat userCountBtnWidth = self.userItemSize.width - 4; CGFloat userCountBtnWidth = self.userItemSize.width - 4;
self.userCountBtn.size = CGSizeMake(userCountBtnWidth, userCountBtnWidth); self.userCountBtn.size = CGSizeMake(userCountBtnWidth, userCountBtnWidth);
...@@ -118,7 +123,7 @@ typedef enum : NSUInteger { ...@@ -118,7 +123,7 @@ typedef enum : NSUInteger {
_flowLayout = [[UICollectionViewFlowLayout alloc]init]; _flowLayout = [[UICollectionViewFlowLayout alloc]init];
if (CGSizeEqualToSize(_userItemSize, CGSizeZero)) { if (CGSizeEqualToSize(_userItemSize, CGSizeZero)) {
CGFloat width = (self.width) / 6.0; CGFloat width = self.height * 0.6;
_userItemSize = CGSizeMake(floor(width), self.height); _userItemSize = CGSizeMake(floor(width), self.height);
} }
_flowLayout.itemSize = _userItemSize; _flowLayout.itemSize = _userItemSize;
...@@ -127,8 +132,15 @@ typedef enum : NSUInteger { ...@@ -127,8 +132,15 @@ typedef enum : NSUInteger {
_flowLayout.minimumInteritemSpacing = 0; _flowLayout.minimumInteritemSpacing = 0;
_flowLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal; _flowLayout.scrollDirection = UICollectionViewScrollDirectionHorizontal;
// 要显示整数个
CGFloat collectionViewWidth = _userItemSize.width * 5;
if (collectionViewWidth > self.width - _userItemSize.width) {
collectionViewWidth = _userItemSize.width * 4;
}
CGRect frame = self.bounds; CGRect frame = self.bounds;
frame.size.width = _userItemSize.width * 5; frame.size.width = collectionViewWidth;
_userCollectionView = [[UICollectionView alloc]initWithFrame:frame collectionViewLayout:_flowLayout]; _userCollectionView = [[UICollectionView alloc]initWithFrame:frame collectionViewLayout:_flowLayout];
_userCollectionView.showsHorizontalScrollIndicator = NO; _userCollectionView.showsHorizontalScrollIndicator = NO;
_userCollectionView.scrollEnabled = NO; _userCollectionView.scrollEnabled = NO;
......
...@@ -56,6 +56,7 @@ ...@@ -56,6 +56,7 @@
layout.itemSize = CGSizeMake(UIView.fus_screenW / 4.0, 98); layout.itemSize = CGSizeMake(UIView.fus_screenW / 4.0, 98);
self.collectionView = [[UICollectionView alloc] initWithFrame:self.contentView.bounds collectionViewLayout:layout]; self.collectionView = [[UICollectionView alloc] initWithFrame:self.contentView.bounds collectionViewLayout:layout];
self.collectionView.backgroundColor = [UIColor fus_appBGColor];
self.collectionView.delegate = self; self.collectionView.delegate = self;
self.collectionView.dataSource = self; self.collectionView.dataSource = self;
[self.collectionView registerClass:[FUSLiveGameCollectionViewCell class] forCellWithReuseIdentifier:[FUSLiveGameCollectionViewCell cellIdentifer]]; [self.collectionView registerClass:[FUSLiveGameCollectionViewCell class] forCellWithReuseIdentifier:[FUSLiveGameCollectionViewCell cellIdentifer]];
......
...@@ -45,8 +45,8 @@ ...@@ -45,8 +45,8 @@
<color key="textColor" red="0.13333333333333333" green="0.13333333333333333" blue="0.13333333333333333" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.13333333333333333" green="0.13333333333333333" blue="0.13333333333333333" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
</label> </label>
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Hot Ranking" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CPj-W5-p8C"> <label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Popularity Ranking" textAlignment="natural" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="CPj-W5-p8C">
<rect key="frame" x="78" y="17" width="64.5" height="15.5"/> <rect key="frame" x="78" y="17" width="98.5" height="15.5"/>
<fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="11"/> <fontDescription key="fontDescription" name="PingFangSC-Medium" family="PingFang SC" pointSize="11"/>
<color key="textColor" red="0.52156862745098043" green="0.52156862745098043" blue="0.52156862745098043" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.52156862745098043" green="0.52156862745098043" blue="0.52156862745098043" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
...@@ -129,7 +129,7 @@ ...@@ -129,7 +129,7 @@
</userDefinedRuntimeAttributes> </userDefinedRuntimeAttributes>
</view> </view>
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="live_popular_hot" translatesAutoresizingMaskIntoConstraints="NO" id="Noo-0c-BBA"> <imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="live_popular_hot" translatesAutoresizingMaskIntoConstraints="NO" id="Noo-0c-BBA">
<rect key="frame" x="98.5" y="40" width="128" height="128"/> <rect key="frame" x="98.5" y="40" width="12.5" height="12.5"/>
<color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/> <color key="tintColor" white="1" alpha="1" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
<constraints> <constraints>
<constraint firstAttribute="width" secondItem="Noo-0c-BBA" secondAttribute="height" multiplier="1:1" id="Y6U-hc-qYS"/> <constraint firstAttribute="width" secondItem="Noo-0c-BBA" secondAttribute="height" multiplier="1:1" id="Y6U-hc-qYS"/>
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
</connections> </connections>
</button> </button>
<label opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BgM-jW-rQL" customClass="FUSLabel"> <label opaque="NO" clipsSubviews="YES" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="0" textAlignment="center" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="BgM-jW-rQL" customClass="FUSLabel">
<rect key="frame" x="231.5" y="39" width="7.5" height="17"/> <rect key="frame" x="116" y="39" width="7.5" height="17"/>
<fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="12"/> <fontDescription key="fontDescription" name="PingFangSC-Regular" family="PingFang SC" pointSize="12"/>
<color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/> <color key="textColor" red="0.40000000000000002" green="0.40000000000000002" blue="0.40000000000000002" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/> <nil key="highlightedColor"/>
...@@ -229,6 +229,6 @@ ...@@ -229,6 +229,6 @@
</objects> </objects>
<resources> <resources>
<image name="common_help_icon" width="17.5" height="17.5"/> <image name="common_help_icon" width="17.5" height="17.5"/>
<image name="live_popular_hot" width="128" height="128"/> <image name="live_popular_hot" width="12.5" height="12.5"/>
</resources> </resources>
</document> </document>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment