2021-09-16 19:30:22 +08:00
|
|
|
|
//
|
|
|
|
|
// XPMineHeadView.m
|
|
|
|
|
// xplan-ios
|
|
|
|
|
//
|
|
|
|
|
// Created by 冯硕 on 2021/9/16.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#import "XPMineHeadView.h"
|
|
|
|
|
///Third
|
|
|
|
|
#import <Masonry/Masonry.h>
|
2021-12-21 18:10:33 +08:00
|
|
|
|
#import <YYText/YYText.h>
|
2021-09-16 19:30:22 +08:00
|
|
|
|
///Tool
|
|
|
|
|
#import "ThemeColor.h"
|
|
|
|
|
#import "XPMacro.h"
|
2021-12-21 18:10:33 +08:00
|
|
|
|
#import "UIImage+Utils.h"
|
2022-11-15 11:15:05 +08:00
|
|
|
|
#import <YYImage/YYAnimatedImageView.h>
|
|
|
|
|
#import "SpriteSheetImageManager.h"
|
2022-12-14 16:28:15 +08:00
|
|
|
|
#import "StatisticsServiceHelper.h"
|
2021-09-16 19:30:22 +08:00
|
|
|
|
///View
|
2021-11-03 18:11:27 +08:00
|
|
|
|
#import "NetImageView.h"
|
2021-12-28 02:07:11 +08:00
|
|
|
|
#import "UIImage+Utils.h"
|
2021-12-21 18:10:33 +08:00
|
|
|
|
#import "XPMineFriendNumberView.h"
|
2022-01-06 17:50:59 +08:00
|
|
|
|
#import "XPNobleCenterEntranceView.h"
|
2022-07-22 18:48:23 +08:00
|
|
|
|
#import "XPMineAccountView.h"
|
2022-09-27 15:07:31 +08:00
|
|
|
|
#import "XPMineHeadTeenagerView.h"
|
2021-09-16 19:30:22 +08:00
|
|
|
|
///Model
|
|
|
|
|
#import "UserInfoModel.h"
|
2022-07-22 18:48:23 +08:00
|
|
|
|
#import "WalletInfoModel.h"
|
2022-07-27 15:11:11 +08:00
|
|
|
|
#import "NobleCenterModel.h"
|
2022-12-14 16:28:15 +08:00
|
|
|
|
#import "AnchorLevelModel.h"
|
2021-09-16 19:30:22 +08:00
|
|
|
|
|
|
|
|
|
@interface XPMineHeadView ()
|
|
|
|
|
///头像
|
2021-11-03 18:11:27 +08:00
|
|
|
|
@property (nonatomic,strong) NetImageView * avatarImageView;
|
2022-11-15 11:15:05 +08:00
|
|
|
|
///普通的
|
|
|
|
|
@property (nonatomic,strong) YYAnimatedImageView *headWearImageView;
|
|
|
|
|
///头饰播放
|
|
|
|
|
@property (nonatomic, strong) SpriteSheetImageManager *manager;
|
2021-09-16 19:30:22 +08:00
|
|
|
|
///name的容器
|
|
|
|
|
@property (nonatomic,strong) UIStackView *nameStackView;
|
2022-07-22 18:48:23 +08:00
|
|
|
|
///贵族等级icon
|
2022-01-19 11:19:33 +08:00
|
|
|
|
@property (nonatomic,strong) NetImageView *nobleImageView;
|
2021-09-16 19:30:22 +08:00
|
|
|
|
///名字
|
|
|
|
|
@property (nonatomic,strong) UILabel *nameLabel;
|
|
|
|
|
///id 的容器
|
|
|
|
|
@property (nonatomic,strong) UIStackView *idStackView;
|
|
|
|
|
///id
|
|
|
|
|
@property (nonatomic,strong) UILabel *idLabel;
|
|
|
|
|
///性别
|
|
|
|
|
@property (nonatomic,strong) UIImageView *sexImageView;
|
|
|
|
|
///显示等级
|
|
|
|
|
@property (nonatomic,strong) YYLabel *levelLabel;
|
2022-07-22 18:48:23 +08:00
|
|
|
|
///关注、粉丝的容器
|
|
|
|
|
@property (nonatomic,strong) UIStackView *attentionStackView;
|
2021-12-21 18:10:33 +08:00
|
|
|
|
///关注
|
|
|
|
|
@property (nonatomic,strong) XPMineFriendNumberView *attentionView;
|
|
|
|
|
///粉丝
|
|
|
|
|
@property (nonatomic,strong) XPMineFriendNumberView *fansView;
|
2022-07-22 18:48:23 +08:00
|
|
|
|
///访客记录
|
|
|
|
|
@property (nonatomic,strong) XPMineFriendNumberView *visitorView;
|
|
|
|
|
///足迹
|
|
|
|
|
@property (nonatomic,strong) XPMineFriendNumberView *footprintView;
|
|
|
|
|
///技能卡
|
|
|
|
|
@property (nonatomic, strong) UIButton *skillCardButton;
|
|
|
|
|
///账户中心
|
|
|
|
|
@property (nonatomic, strong) XPMineAccountView *accountView;
|
2022-01-06 17:50:59 +08:00
|
|
|
|
///贵族中心
|
|
|
|
|
@property (nonatomic, strong) XPNobleCenterEntranceView *nobleEntranceView;
|
|
|
|
|
|
2022-09-27 15:07:31 +08:00
|
|
|
|
@property (nonatomic, strong) XPMineHeadTeenagerView *teenagerView;
|
|
|
|
|
|
2022-12-13 21:09:48 +08:00
|
|
|
|
///主播评级
|
|
|
|
|
@property (nonatomic,strong) UIButton *anchorLevel;
|
|
|
|
|
|
2021-09-16 19:30:22 +08:00
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
@implementation XPMineHeadView
|
|
|
|
|
|
|
|
|
|
- (instancetype)initWithFrame:(CGRect)frame
|
|
|
|
|
{
|
|
|
|
|
self = [super initWithFrame:frame];
|
|
|
|
|
if (self) {
|
|
|
|
|
[self initSubViews];
|
|
|
|
|
[self initSubViewConstraints];
|
|
|
|
|
}
|
|
|
|
|
return self;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma mark - Private Method
|
|
|
|
|
- (void)initSubViews {
|
|
|
|
|
self.backgroundColor = [UIColor clearColor];
|
|
|
|
|
[self addSubview:self.avatarImageView];
|
2022-11-15 11:15:05 +08:00
|
|
|
|
[self addSubview:self.headWearImageView];
|
2022-07-22 18:48:23 +08:00
|
|
|
|
[self addSubview:self.nobleImageView];
|
2021-09-16 19:30:22 +08:00
|
|
|
|
[self addSubview:self.nameStackView];
|
|
|
|
|
[self addSubview:self.idStackView];
|
2022-12-13 21:09:48 +08:00
|
|
|
|
[self addSubview:self.anchorLevel];
|
2022-07-22 18:48:23 +08:00
|
|
|
|
[self.nameStackView addArrangedSubview:self.nameLabel];
|
|
|
|
|
[self.idStackView addArrangedSubview:self.idLabel];
|
|
|
|
|
[self.idStackView addArrangedSubview:self.sexImageView];
|
2021-09-16 19:30:22 +08:00
|
|
|
|
[self addSubview:self.levelLabel];
|
2022-07-22 18:48:23 +08:00
|
|
|
|
[self addSubview:self.skillCardButton];
|
|
|
|
|
|
|
|
|
|
[self addSubview:self.attentionStackView];
|
|
|
|
|
[self.attentionStackView addArrangedSubview:self.attentionView];
|
|
|
|
|
[self.attentionStackView addArrangedSubview:self.fansView];
|
|
|
|
|
[self.attentionStackView addArrangedSubview:self.visitorView];
|
|
|
|
|
[self.attentionStackView addArrangedSubview:self.footprintView];
|
2022-01-06 17:50:59 +08:00
|
|
|
|
|
2022-07-22 18:48:23 +08:00
|
|
|
|
[self addSubview:self.accountView];
|
|
|
|
|
[self addSubview:self.nobleEntranceView];
|
2021-09-16 19:30:22 +08:00
|
|
|
|
|
|
|
|
|
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAvatarImageView)];
|
|
|
|
|
[self.avatarImageView addGestureRecognizer:tap];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)initSubViewConstraints {
|
|
|
|
|
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
2022-08-05 13:04:10 +08:00
|
|
|
|
make.size.mas_equalTo(CGSizeMake(68, 68));
|
2021-09-16 19:30:22 +08:00
|
|
|
|
make.left.mas_equalTo(self).offset(20);
|
2022-08-05 13:04:10 +08:00
|
|
|
|
make.top.mas_equalTo(self).offset(30 + kStatusBarHeight);
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}];
|
2022-11-15 11:15:05 +08:00
|
|
|
|
[self.headWearImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.centerX.centerY.mas_equalTo(self.avatarImageView);
|
|
|
|
|
make.width.mas_equalTo(self.avatarImageView.mas_width).multipliedBy(1.31);
|
|
|
|
|
make.height.mas_equalTo(self.headWearImageView.mas_width);
|
|
|
|
|
}];
|
2022-01-19 11:19:33 +08:00
|
|
|
|
[self.nobleImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
2022-12-24 17:53:56 +08:00
|
|
|
|
make.left.mas_equalTo(self.headWearImageView.mas_right).offset(9);
|
2022-08-05 13:04:10 +08:00
|
|
|
|
make.top.mas_equalTo(self.avatarImageView).mas_offset(14);
|
2022-01-19 11:19:33 +08:00
|
|
|
|
make.width.height.mas_equalTo(20);
|
|
|
|
|
}];
|
2021-09-16 19:30:22 +08:00
|
|
|
|
[self.nameStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
2022-01-19 11:19:33 +08:00
|
|
|
|
make.centerY.mas_equalTo(self.nobleImageView);
|
2022-12-24 17:53:56 +08:00
|
|
|
|
make.left.mas_equalTo(self.nobleImageView.mas_right).mas_offset(10);
|
2022-08-05 13:04:10 +08:00
|
|
|
|
make.height.mas_equalTo(16);
|
|
|
|
|
make.right.mas_equalTo(self.skillCardButton.mas_left).mas_offset(-2);
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
[self.idStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
2022-01-19 11:19:33 +08:00
|
|
|
|
make.left.mas_equalTo(self.nobleImageView);
|
2022-08-05 13:04:10 +08:00
|
|
|
|
make.top.mas_equalTo(self.nameStackView.mas_bottom).offset(10);
|
|
|
|
|
make.height.mas_equalTo(16);
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
[self.levelLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
2022-01-19 11:19:33 +08:00
|
|
|
|
make.left.mas_equalTo(self.nobleImageView);
|
2022-08-05 13:04:10 +08:00
|
|
|
|
make.top.mas_equalTo(self.idStackView.mas_bottom).offset(8);
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}];
|
2022-07-22 18:48:23 +08:00
|
|
|
|
[self.skillCardButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
2022-12-13 21:09:48 +08:00
|
|
|
|
make.bottom.mas_equalTo(self.avatarImageView).mas_offset(-1);
|
2022-08-05 13:04:10 +08:00
|
|
|
|
make.right.mas_equalTo(14);
|
2022-07-22 18:48:23 +08:00
|
|
|
|
make.width.mas_equalTo(87);
|
|
|
|
|
make.height.mas_equalTo(28);
|
|
|
|
|
}];
|
|
|
|
|
[self.attentionStackView mas_makeConstraints:^(MASConstraintMaker *make) {
|
2022-08-05 13:04:10 +08:00
|
|
|
|
make.top.mas_equalTo(self.levelLabel.mas_bottom).mas_offset(16);
|
|
|
|
|
make.height.mas_equalTo(45);
|
2022-07-22 18:48:23 +08:00
|
|
|
|
make.left.mas_equalTo(15);
|
|
|
|
|
make.right.mas_equalTo(-15);
|
|
|
|
|
}];
|
|
|
|
|
CGFloat width = (KScreenWidth - 30) / 4;
|
2022-08-05 13:04:10 +08:00
|
|
|
|
CGFloat height = 45;
|
2022-07-22 18:48:23 +08:00
|
|
|
|
[self.attentionView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.size.mas_equalTo(CGSizeMake(width, height));
|
|
|
|
|
}];
|
|
|
|
|
[self.fansView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.size.mas_equalTo(CGSizeMake(width, height));
|
|
|
|
|
}];
|
|
|
|
|
[self.visitorView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.size.mas_equalTo(CGSizeMake(width, height));
|
|
|
|
|
}];
|
|
|
|
|
[self.footprintView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.size.mas_equalTo(CGSizeMake(width, height));
|
|
|
|
|
}];
|
2022-01-06 17:50:59 +08:00
|
|
|
|
|
2022-08-05 13:04:10 +08:00
|
|
|
|
width = (KScreenWidth - 30 - 16) * 0.5;
|
2022-07-22 18:48:23 +08:00
|
|
|
|
height = width * 64 / 164;
|
|
|
|
|
[self.accountView mas_makeConstraints:^(MASConstraintMaker *make) {
|
2022-08-05 13:04:10 +08:00
|
|
|
|
make.bottom.mas_equalTo(self);
|
2022-07-22 18:48:23 +08:00
|
|
|
|
make.size.mas_equalTo(CGSizeMake(width, height));
|
|
|
|
|
make.left.mas_equalTo(15);
|
|
|
|
|
}];
|
2022-01-06 17:50:59 +08:00
|
|
|
|
[self.nobleEntranceView mas_makeConstraints:^(MASConstraintMaker *make) {
|
2022-07-22 18:48:23 +08:00
|
|
|
|
make.top.mas_equalTo(self.accountView);
|
|
|
|
|
make.size.mas_equalTo(CGSizeMake(width, height));
|
|
|
|
|
make.right.mas_equalTo(-15);
|
2022-01-06 17:50:59 +08:00
|
|
|
|
}];
|
2022-12-13 21:09:48 +08:00
|
|
|
|
|
|
|
|
|
[self.anchorLevel mas_makeConstraints:^(MASConstraintMaker *make) {
|
2022-12-14 16:28:15 +08:00
|
|
|
|
make.width.mas_equalTo(91);
|
|
|
|
|
make.height.mas_equalTo(28);
|
2022-12-13 21:09:48 +08:00
|
|
|
|
make.right.mas_equalTo(self);
|
|
|
|
|
make.bottom.mas_equalTo(self.skillCardButton.mas_top).offset(-14);
|
|
|
|
|
}];
|
2021-12-21 18:10:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
2022-07-22 18:48:23 +08:00
|
|
|
|
#pragma mark - Action
|
|
|
|
|
- (void)tapAvatarImageView {
|
2022-09-27 15:07:31 +08:00
|
|
|
|
if (self.userInfo.parentMode) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2022-07-22 18:48:23 +08:00
|
|
|
|
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMineHeadView:didClickAvatar:)]) {
|
|
|
|
|
[self.delegate xPMineHeadView:self didClickAvatar:self.userInfo];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
///技能卡
|
|
|
|
|
- (void)tapSkillCardRecognizer {
|
|
|
|
|
if (self.delegate && [self.delegate respondsToSelector:@selector(xpMineHeadViewClickSkillCard)]) {
|
|
|
|
|
[self.delegate xpMineHeadViewClickSkillCard];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///粉丝
|
|
|
|
|
- (void)tapFansRecognizer {
|
|
|
|
|
if (self.delegate && [self.delegate respondsToSelector:@selector(xpMineHeadViewClickFans)]) {
|
|
|
|
|
[self.delegate xpMineHeadViewClickFans];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
///关注
|
|
|
|
|
- (void)tapAttentionRecognizer {
|
|
|
|
|
if (self.delegate && [self.delegate respondsToSelector:@selector(xpMineHeadViewClickAttention)]) {
|
|
|
|
|
[self.delegate xpMineHeadViewClickAttention];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
///访客
|
|
|
|
|
- (void)tapVisitorRecognizer {
|
|
|
|
|
if (self.delegate && [self.delegate respondsToSelector:@selector(xpMineHeadViewClickVisitor)]) {
|
|
|
|
|
[self.delegate xpMineHeadViewClickVisitor];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
///足迹
|
|
|
|
|
- (void)tapFootprintRecognizer {
|
|
|
|
|
if (self.delegate && [self.delegate respondsToSelector:@selector(xpMineHeadViewClickFootprint)]) {
|
|
|
|
|
[self.delegate xpMineHeadViewClickFootprint];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
///账号中心
|
|
|
|
|
- (void)tapAccountrecognizer {
|
|
|
|
|
if (self.delegate && [self.delegate respondsToSelector:@selector(xpMineHeadViewClickAcount)]) {
|
|
|
|
|
[self.delegate xpMineHeadViewClickAcount];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
///贵族中心
|
|
|
|
|
- (void)tapNobleCenterrecognizer {
|
|
|
|
|
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMineHeadViewCliekNobleCenter)]) {
|
|
|
|
|
[self.delegate xPMineHeadViewCliekNobleCenter];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-09-27 15:07:31 +08:00
|
|
|
|
///青少年模式
|
|
|
|
|
- (void)tapTeenagerView {
|
|
|
|
|
if (self.delegate && [self.delegate respondsToSelector:@selector(xPmineHeadViewClickTeenager)]) {
|
|
|
|
|
[self.delegate xPmineHeadViewClickTeenager];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-13 21:09:48 +08:00
|
|
|
|
- (void)anchorLevelAction:(UIButton *)sender {
|
|
|
|
|
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMineHeadView:didClickAnchorLevel:)]) {
|
|
|
|
|
[self.delegate xPMineHeadView:self didClickAnchorLevel:self.anchorLevelInfo];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-12-21 18:10:33 +08:00
|
|
|
|
#pragma mark - NSMutableAttributedString
|
|
|
|
|
-(NSInteger) getMonth:(long )time
|
|
|
|
|
{
|
|
|
|
|
NSDate *date = [NSDate dateWithTimeIntervalSince1970:time/1000];
|
|
|
|
|
NSCalendar* calendar = [NSCalendar currentCalendar];
|
|
|
|
|
NSDateComponents* components = [calendar components:NSCalendarUnitMonth fromDate:date];
|
|
|
|
|
NSInteger month = components.month;
|
|
|
|
|
return month;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSInteger) getDay:(long) time
|
|
|
|
|
{
|
|
|
|
|
NSDate *date = [NSDate dateWithTimeIntervalSince1970:time/1000];
|
|
|
|
|
NSCalendar* calendar = [NSCalendar currentCalendar];
|
|
|
|
|
NSDateComponents* components = [calendar components:NSCalendarUnitDay fromDate:date];
|
|
|
|
|
NSInteger day = components.day;
|
|
|
|
|
return day;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (NSString *)calculateConstellationWithMonth:(long)time
|
|
|
|
|
{
|
|
|
|
|
NSString *astroString = @"魔羯水瓶双鱼白羊金牛双子巨蟹狮子处女天秤天蝎射手魔羯";
|
|
|
|
|
NSString *astroFormat = @"102123444543";
|
|
|
|
|
NSString *result;
|
|
|
|
|
|
|
|
|
|
NSInteger month = [self getMonth:time];
|
|
|
|
|
NSInteger day = [self getDay:time];
|
|
|
|
|
|
|
|
|
|
if (month<1 || month>12 || day<1 || day>31){
|
|
|
|
|
return @"错误日期格式!";
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(month==2 && day>29)
|
|
|
|
|
{
|
|
|
|
|
return @"错误日期格式!!";
|
|
|
|
|
}else if(month==4 || month==6 || month==9 || month==11) {
|
|
|
|
|
if (day>30) {
|
|
|
|
|
return @"错误日期格式!!!";
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
result=[NSString stringWithFormat:@"%@",[astroString substringWithRange:NSMakeRange(month*2-(day < [[astroFormat substringWithRange:NSMakeRange((month-1), 1)] intValue] - (-19))*2,2)]];
|
|
|
|
|
|
|
|
|
|
return [NSString stringWithFormat:@"%@座",result];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// 生成一个图片的富文本
|
|
|
|
|
/// @param imageUrl 网络图片的地址
|
|
|
|
|
- (NSMutableAttributedString *)createUrlImageAttribute:(NSString *)imageUrl {
|
|
|
|
|
NetImageConfig *config = [[NetImageConfig alloc]init];
|
|
|
|
|
///先这样吧
|
|
|
|
|
config.autoLoad = YES;
|
|
|
|
|
NetImageView *imageView = [[NetImageView alloc]initWithUrl:imageUrl config:config];
|
|
|
|
|
UIImage* image = imageView.image;
|
|
|
|
|
if (image) {
|
|
|
|
|
CGFloat scale = image.size.width / image.size.height;
|
|
|
|
|
imageView.bounds = CGRectMake(0, 0, 20 * scale, 20);
|
|
|
|
|
} else {
|
2022-12-30 18:13:11 +08:00
|
|
|
|
dispatch_async(dispatch_get_global_queue(0, 0), ^{
|
|
|
|
|
NSURL *imgUrl = [NSURL URLWithString:imageUrl];
|
|
|
|
|
UIImage *myImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:imgUrl]];
|
|
|
|
|
dispatch_async(dispatch_get_main_queue(), ^{
|
|
|
|
|
if (myImage) {
|
|
|
|
|
CGFloat scale = myImage.size.width / myImage.size.height;
|
|
|
|
|
imageView.bounds = CGRectMake(0, 0, 20 * scale, 20);
|
|
|
|
|
} else {
|
|
|
|
|
imageView.bounds = CGRectMake(0, 0, 20, 20);
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
});
|
2021-12-21 18:10:33 +08:00
|
|
|
|
}
|
|
|
|
|
imageView.layer.masksToBounds = YES;
|
|
|
|
|
imageView.contentMode = UIViewContentModeScaleAspectFit;
|
|
|
|
|
NSMutableAttributedString * attrString = [NSMutableAttributedString yy_attachmentStringWithContent:imageView contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(imageView.bounds.size.width, imageView.bounds.size.height) alignToFont:[UIFont systemFontOfSize:15.0] alignment:YYTextVerticalAlignmentCenter];
|
|
|
|
|
return attrString;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// 占位的富文本
|
|
|
|
|
/// @param width 需要的间隙
|
|
|
|
|
- (NSMutableAttributedString *)createSapceAttribute:(CGFloat)width {
|
|
|
|
|
UIView *spaceView = [[UIView alloc]init];
|
|
|
|
|
spaceView.backgroundColor = [UIColor clearColor];
|
|
|
|
|
spaceView.bounds = CGRectMake(0, 0, width, 10);
|
|
|
|
|
NSMutableAttributedString * attribute = [NSMutableAttributedString yy_attachmentStringWithContent:spaceView contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(spaceView.frame.size.width, spaceView.frame.size.height) alignToFont:[UIFont systemFontOfSize:15.0] alignment:YYTextVerticalAlignmentCenter];
|
|
|
|
|
return attribute;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//dateLabel
|
|
|
|
|
- (NSMutableAttributedString *)makeDateLabel:(long)birth{
|
|
|
|
|
NSString *dateStr = [NSString stringWithFormat:@" %@ ",[self calculateConstellationWithMonth:birth]];
|
|
|
|
|
UIButton *dataButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
|
|
[dataButton setTitle:dateStr forState:UIControlStateNormal];
|
|
|
|
|
dataButton.titleLabel.font = [UIFont boldSystemFontOfSize:10];
|
|
|
|
|
[dataButton setTitleColor:UIColorFromRGB(0xFFFFFF) forState:UIControlStateNormal];
|
|
|
|
|
dataButton.frame = CGRectMake(0, 0, 45, 17);
|
|
|
|
|
dataButton.layer.masksToBounds = YES;
|
|
|
|
|
dataButton.layer.cornerRadius = 17/2;
|
|
|
|
|
[dataButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[ThemeColor confirmButtonGradientStartColor], [ThemeColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
|
|
|
|
|
NSMutableAttributedString * dateLabelString = [NSMutableAttributedString yy_attachmentStringWithContent:dataButton contentMode:UIViewContentModeScaleAspectFit attachmentSize:CGSizeMake(dataButton.frame.size.width, dataButton.frame.size.height) alignToFont:[UIFont systemFontOfSize:11] alignment:YYTextVerticalAlignmentCenter];
|
|
|
|
|
return dateLabelString;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///铭牌
|
|
|
|
|
- (NSMutableAttributedString *)createNameplateAttibute:(NSString *)tagName image:(NSString *)imageName textFont:(UIFont *)textFont {
|
|
|
|
|
NetImageConfig *config = [[NetImageConfig alloc]init];
|
|
|
|
|
///先这样吧
|
|
|
|
|
config.autoLoad = YES;
|
|
|
|
|
NetImageView *imageView = [[NetImageView alloc]initWithUrl:imageName config:config];
|
|
|
|
|
UIImage* image = imageView.image;
|
|
|
|
|
if (image) {
|
|
|
|
|
CGFloat scale = image.size.width / image.size.height;
|
|
|
|
|
imageView.bounds = CGRectMake(0, 0, 20 * scale, 20);
|
|
|
|
|
} else {
|
|
|
|
|
NSURL *imgUrl = [NSURL URLWithString:imageName];
|
|
|
|
|
UIImage *myImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:imgUrl]];
|
|
|
|
|
CGFloat scale = myImage.size.width / myImage.size.height;
|
|
|
|
|
if (scale == 0) {
|
|
|
|
|
imageView.bounds = CGRectMake(0, 0, 60, 20);
|
|
|
|
|
}else {
|
|
|
|
|
imageView.bounds = CGRectMake(0, 0, 20* scale, 20);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
imageView.contentMode = UIViewContentModeScaleAspectFit;
|
|
|
|
|
// 铭牌文字
|
|
|
|
|
UILabel *label = [[UILabel alloc] init];
|
|
|
|
|
label.textAlignment = NSTextAlignmentCenter;
|
|
|
|
|
label.font = [UIFont boldSystemFontOfSize:12];
|
|
|
|
|
label.adjustsFontSizeToFitWidth = YES;
|
|
|
|
|
label.textColor = UIColor.whiteColor;
|
|
|
|
|
label.text = tagName;
|
|
|
|
|
[imageView addSubview:label];
|
|
|
|
|
[label mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.left.mas_equalTo(27);
|
|
|
|
|
make.right.mas_equalTo(-8);
|
|
|
|
|
make.centerY.mas_equalTo(0);
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}];
|
2021-12-21 18:10:33 +08:00
|
|
|
|
NSMutableAttributedString *string = [NSMutableAttributedString yy_attachmentStringWithContent:imageView contentMode:UIViewContentModeScaleAspectFit attachmentSize:imageView.bounds.size alignToFont:[UIFont boldSystemFontOfSize:12] alignment:YYTextVerticalAlignmentCenter];
|
|
|
|
|
return string;
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
2021-12-21 18:10:33 +08:00
|
|
|
|
///当装扮铭牌时,我的页面中不需要显示铭牌标识
|
|
|
|
|
- (NSMutableAttributedString *)creatNameplateLevleAttribute:(UserInfoModel *)userInfo {
|
|
|
|
|
NSMutableAttributedString *attributedString = [[NSMutableAttributedString alloc] init];
|
|
|
|
|
|
|
|
|
|
if (!userInfo) {
|
|
|
|
|
return attributedString;
|
|
|
|
|
}
|
|
|
|
|
//主播认证
|
|
|
|
|
if (userInfo.nameplateWord.length > 0 && userInfo.nameplatePic.length>0) {
|
|
|
|
|
[self createNameplateAttibute:userInfo.nameplateWord image:userInfo.nameplatePic textFont:[UIFont systemFontOfSize:9]];
|
|
|
|
|
[attributedString appendAttributedString:[self createSapceAttribute:2]];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// userRank 用户级别
|
|
|
|
|
if (userInfo.userLevelVo.experUrl) {
|
|
|
|
|
[attributedString appendAttributedString:[self createUrlImageAttribute:userInfo.userLevelVo.experUrl]];
|
|
|
|
|
[attributedString appendAttributedString:[self createSapceAttribute:2]];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//charmRank 魅力等级
|
|
|
|
|
if (userInfo.userLevelVo.charmUrl) {
|
|
|
|
|
[attributedString appendAttributedString:[self createUrlImageAttribute:userInfo.userLevelVo.charmUrl]];
|
|
|
|
|
[attributedString appendAttributedString:[self createSapceAttribute:2]];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// constellation 星座
|
|
|
|
|
if (userInfo.birth) {
|
|
|
|
|
[attributedString appendAttributedString:[self makeDateLabel:userInfo.birth]];
|
|
|
|
|
}
|
|
|
|
|
return attributedString;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
2021-09-16 19:30:22 +08:00
|
|
|
|
#pragma mark - Getters And Setters
|
|
|
|
|
- (void)setUserInfo:(UserInfoModel *)userInfo {
|
|
|
|
|
_userInfo = userInfo;
|
|
|
|
|
if (_userInfo) {
|
2022-11-15 11:15:05 +08:00
|
|
|
|
NSString * headurl = userInfo.headwearEffect.length > 0 ? userInfo.headwearEffect : userInfo.headwearPic;
|
|
|
|
|
if (headurl.length >0) {
|
|
|
|
|
self.headWearImageView.hidden = NO;
|
|
|
|
|
NSURL *url = [NSURL URLWithString:headurl];
|
|
|
|
|
@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;
|
|
|
|
|
}
|
2022-09-22 14:08:26 +08:00
|
|
|
|
self.idLabel.text = [NSString stringWithFormat:@"魔力号:%ld", (long)_userInfo.erbanNo];
|
2021-09-16 19:30:22 +08:00
|
|
|
|
self.nameLabel.text = _userInfo.nick.length > 0 ? _userInfo.nick : @"";
|
2021-11-03 18:11:27 +08:00
|
|
|
|
self.avatarImageView.imageUrl = userInfo.avatar;
|
2021-12-28 02:07:11 +08:00
|
|
|
|
if (userInfo.isReview) {
|
|
|
|
|
[self.avatarImageView loadImageWithUrl:userInfo.reviewingAvatar completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) {
|
|
|
|
|
UIImage * waterImage = [UIImage imageNamed:@"mine_avatar_reviewing"];
|
|
|
|
|
float ratio = waterImage.size.height / waterImage.size.width;
|
|
|
|
|
float rectY = image.size.height * (1 - ratio);
|
|
|
|
|
self.avatarImageView.image = [UIImage waterImageWithImage:image waterImage:waterImage waterImageRect:CGRectMake(0, rectY, image.size.width, image.size.height * ratio)];
|
|
|
|
|
}];
|
|
|
|
|
} else {
|
|
|
|
|
self.avatarImageView.imageUrl = userInfo.avatar;
|
2022-01-19 11:19:33 +08:00
|
|
|
|
}
|
|
|
|
|
self.nobleImageView.imageUrl = userInfo.userVipInfoVO.vipIcon;
|
|
|
|
|
UIImage *nobleImage = self.nobleImageView.image;
|
|
|
|
|
if (nobleImage) {
|
|
|
|
|
CGFloat scale = nobleImage.size.width / nobleImage.size.height;
|
|
|
|
|
[self.nobleImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.size.mas_equalTo(CGSizeMake(20* scale, 20));
|
|
|
|
|
}];
|
|
|
|
|
[self.nameStackView mas_updateConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.left.mas_equalTo(self.nobleImageView.mas_right).mas_offset(5);
|
|
|
|
|
}];
|
|
|
|
|
} else {
|
|
|
|
|
[self.nobleImageView mas_updateConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.size.mas_equalTo(CGSizeMake(0, 20));
|
|
|
|
|
}];
|
|
|
|
|
[self.nameStackView mas_updateConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.left.mas_equalTo(self.nobleImageView.mas_right);
|
|
|
|
|
}];
|
2021-12-28 02:07:11 +08:00
|
|
|
|
}
|
2021-09-16 19:30:22 +08:00
|
|
|
|
NSString * sexName;
|
|
|
|
|
if (userInfo.gender == GenderType_Male) {
|
2021-09-17 19:41:09 +08:00
|
|
|
|
sexName = @"common_male";
|
2021-09-16 19:30:22 +08:00
|
|
|
|
} else {
|
2021-09-17 19:41:09 +08:00
|
|
|
|
sexName = @"common_female";
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}
|
|
|
|
|
self.sexImageView.image = [UIImage imageNamed:sexName];
|
2021-12-21 18:10:33 +08:00
|
|
|
|
self.levelLabel.attributedText = [self creatNameplateLevleAttribute:_userInfo];
|
|
|
|
|
self.fansView.number = [NSString stringWithFormat:@"%ld",_userInfo.fansNum];
|
|
|
|
|
self.attentionView.number = [NSString stringWithFormat:@"%ld",_userInfo.followNum];
|
2022-07-22 18:48:23 +08:00
|
|
|
|
self.visitorView.number = [NSString stringWithFormat:@"%ld", _userInfo.visitNum];
|
|
|
|
|
self.footprintView.number = [NSString stringWithFormat:@"%ld", _userInfo.inRoomNum];
|
2022-07-25 17:59:46 +08:00
|
|
|
|
self.nobleEntranceView.vipInfo = userInfo.userVipInfoVO;
|
2022-09-27 15:07:31 +08:00
|
|
|
|
if (userInfo.parentMode) {//青少年模式
|
|
|
|
|
if (!self.teenagerView.superview) {
|
|
|
|
|
[self addSubview:self.teenagerView];
|
|
|
|
|
[self.teenagerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.top.mas_equalTo(self.levelLabel.mas_bottom).mas_offset(16);
|
|
|
|
|
make.height.mas_equalTo(44);
|
|
|
|
|
make.left.right.mas_equalTo(self).inset(16);
|
|
|
|
|
}];
|
|
|
|
|
}
|
|
|
|
|
self.attentionStackView.hidden = YES;
|
|
|
|
|
self.accountView.hidden = YES;
|
|
|
|
|
self.nobleEntranceView.hidden = YES;
|
|
|
|
|
self.skillCardButton.hidden = YES;
|
|
|
|
|
} else {
|
|
|
|
|
[self.teenagerView removeFromSuperview];
|
|
|
|
|
self.teenagerView = nil;
|
|
|
|
|
self.attentionStackView.hidden = NO;
|
|
|
|
|
self.accountView.hidden = NO;
|
|
|
|
|
self.nobleEntranceView.hidden = NO;
|
|
|
|
|
self.skillCardButton.hidden = NO;
|
|
|
|
|
}
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
2022-07-22 18:48:23 +08:00
|
|
|
|
|
|
|
|
|
- (void)setWalletInfo:(WalletInfoModel *)walletInfo {
|
|
|
|
|
self.accountView.diamonds = walletInfo.diamonds;
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-27 11:49:51 +08:00
|
|
|
|
- (void)setVisitorUnReadCount:(NSInteger)visitorUnReadCount {
|
|
|
|
|
self.visitorView.visitorNum = visitorUnReadCount;
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-27 15:11:11 +08:00
|
|
|
|
- (void)setNobleInfo:(NobleCenterModel *)nobleInfo {
|
|
|
|
|
self.nobleEntranceView.nobleInfo = nobleInfo;
|
|
|
|
|
}
|
|
|
|
|
|
2022-12-13 21:09:48 +08:00
|
|
|
|
- (void)setAnchorLevelInfo:(AnchorLevelModel *)anchorLevelInfo {
|
|
|
|
|
_anchorLevelInfo = anchorLevelInfo;
|
|
|
|
|
if (_anchorLevelInfo) {
|
2022-12-14 16:28:15 +08:00
|
|
|
|
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventRoom_grade_profit_pop_show];
|
2022-12-13 21:09:48 +08:00
|
|
|
|
self.anchorLevel.hidden = NO;
|
2022-12-14 16:28:15 +08:00
|
|
|
|
if ([_anchorLevelInfo.grade isEqualToString:@"S"]) {
|
|
|
|
|
[self.anchorLevel setBackgroundImage:[UIImage imageNamed:@"mine_anchor_level_enter_s"] forState:UIControlStateNormal];
|
|
|
|
|
} else if([_anchorLevelInfo.grade isEqualToString:@"B"]) {
|
|
|
|
|
[self.anchorLevel setBackgroundImage:[UIImage imageNamed:@"mine_anchor_level_enter_b"] forState:UIControlStateNormal];
|
|
|
|
|
} else if([_anchorLevelInfo.grade isEqualToString:@"C"]) {
|
|
|
|
|
[self.anchorLevel setBackgroundImage:[UIImage imageNamed:@"mine_anchor_level_enter_c"] forState:UIControlStateNormal];
|
|
|
|
|
}else if([_anchorLevelInfo.grade isEqualToString:@"D"]) {
|
|
|
|
|
[self.anchorLevel setBackgroundImage:[UIImage imageNamed:@"mine_anchor_level_enter_d"] forState:UIControlStateNormal];
|
|
|
|
|
} else {
|
|
|
|
|
[self.anchorLevel setBackgroundImage:[UIImage imageNamed:@"mine_anchor_level_enter_a"] forState:UIControlStateNormal];
|
|
|
|
|
}
|
2022-12-13 21:09:48 +08:00
|
|
|
|
} else {
|
|
|
|
|
self.anchorLevel.hidden = YES;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2021-11-03 18:11:27 +08:00
|
|
|
|
- (NetImageView *)avatarImageView {
|
2021-09-16 19:30:22 +08:00
|
|
|
|
if (!_avatarImageView) {
|
2021-11-25 17:35:31 +08:00
|
|
|
|
NetImageConfig * config = [[NetImageConfig alloc]init];
|
|
|
|
|
config.imageType = ImageTypeUserIcon;
|
|
|
|
|
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
|
|
|
|
|
_avatarImageView = [[NetImageView alloc] initWithConfig:config];
|
2021-09-16 19:30:22 +08:00
|
|
|
|
_avatarImageView.userInteractionEnabled = YES;
|
|
|
|
|
_avatarImageView.layer.masksToBounds = YES;
|
2022-08-05 13:04:10 +08:00
|
|
|
|
_avatarImageView.layer.cornerRadius = 34;
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}
|
|
|
|
|
return _avatarImageView;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UIStackView *)nameStackView {
|
|
|
|
|
if (!_nameStackView) {
|
|
|
|
|
_nameStackView = [[UIStackView alloc] init];
|
|
|
|
|
_nameStackView.axis = UILayoutConstraintAxisHorizontal;
|
|
|
|
|
_nameStackView.distribution = UIStackViewDistributionFill;
|
|
|
|
|
_nameStackView.alignment = UIStackViewAlignmentCenter;
|
|
|
|
|
_nameStackView.spacing = 5;
|
|
|
|
|
}
|
|
|
|
|
return _nameStackView;
|
|
|
|
|
}
|
2022-07-22 18:48:23 +08:00
|
|
|
|
|
2022-01-19 11:19:33 +08:00
|
|
|
|
- (NetImageView *)nobleImageView {
|
|
|
|
|
if (!_nobleImageView) {
|
|
|
|
|
_nobleImageView = [[NetImageView alloc] init];
|
|
|
|
|
}
|
|
|
|
|
return _nobleImageView;
|
|
|
|
|
}
|
2021-09-16 19:30:22 +08:00
|
|
|
|
|
|
|
|
|
- (UILabel *)nameLabel {
|
|
|
|
|
if (!_nameLabel) {
|
|
|
|
|
_nameLabel = [[UILabel alloc] init];
|
2022-08-05 13:04:10 +08:00
|
|
|
|
_nameLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:16];
|
|
|
|
|
_nameLabel.textColor = UIColorFromRGB(0x000000);
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}
|
|
|
|
|
return _nameLabel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UIStackView *)idStackView {
|
|
|
|
|
if (!_idStackView) {
|
|
|
|
|
_idStackView = [[UIStackView alloc] init];
|
|
|
|
|
_idStackView.axis = UILayoutConstraintAxisHorizontal;
|
|
|
|
|
_idStackView.distribution = UIStackViewDistributionFill;
|
|
|
|
|
_idStackView.alignment = UIStackViewAlignmentCenter;
|
|
|
|
|
_idStackView.spacing = 5;
|
|
|
|
|
}
|
|
|
|
|
return _idStackView;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UILabel *)idLabel {
|
|
|
|
|
if (!_idLabel) {
|
|
|
|
|
_idLabel = [[UILabel alloc] init];
|
|
|
|
|
_idLabel.font = [UIFont systemFontOfSize:13];
|
|
|
|
|
_idLabel.textColor = [ThemeColor secondTextColor];
|
|
|
|
|
}
|
|
|
|
|
return _idLabel;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UIImageView *)sexImageView {
|
|
|
|
|
if (!_sexImageView) {
|
|
|
|
|
_sexImageView = [[UIImageView alloc] init];
|
|
|
|
|
_sexImageView.userInteractionEnabled = YES;
|
|
|
|
|
}
|
|
|
|
|
return _sexImageView;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (YYLabel *)levelLabel {
|
|
|
|
|
if (!_levelLabel) {
|
|
|
|
|
_levelLabel = [[YYLabel alloc] init];
|
|
|
|
|
_levelLabel.preferredMaxLayoutWidth = KScreenWidth - 88;
|
|
|
|
|
}
|
|
|
|
|
return _levelLabel;
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-22 18:48:23 +08:00
|
|
|
|
- (UIButton *)skillCardButton {
|
|
|
|
|
if (!_skillCardButton) {
|
|
|
|
|
_skillCardButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
|
|
[_skillCardButton setImage:[UIImage imageNamed:@"mine_normal_skill_card"] forState:UIControlStateNormal];
|
|
|
|
|
[_skillCardButton setTitle:@"技能卡" forState:UIControlStateNormal];
|
|
|
|
|
_skillCardButton.titleLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
|
|
|
|
|
[_skillCardButton setTitleColor:UIColorFromRGB(0x000000) forState:UIControlStateNormal];
|
|
|
|
|
[_skillCardButton setImageEdgeInsets:UIEdgeInsetsMake(0, -10, 0, 0)];
|
2022-08-05 00:33:58 +08:00
|
|
|
|
_skillCardButton.backgroundColor = UIColorRGBAlpha(0xFFFFFF, 0.7);
|
2022-07-22 18:48:23 +08:00
|
|
|
|
_skillCardButton.layer.cornerRadius = 14;
|
|
|
|
|
_skillCardButton.layer.masksToBounds = YES;
|
|
|
|
|
[_skillCardButton addTarget:self action:@selector(tapSkillCardRecognizer) forControlEvents:UIControlEventTouchUpInside];
|
|
|
|
|
}
|
|
|
|
|
return _skillCardButton;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UIStackView *)attentionStackView {
|
|
|
|
|
if (!_attentionStackView) {
|
|
|
|
|
_attentionStackView = [[UIStackView alloc] init];
|
|
|
|
|
_attentionStackView.axis = UILayoutConstraintAxisHorizontal;
|
|
|
|
|
_attentionStackView.distribution = UIStackViewDistributionFill;
|
|
|
|
|
_attentionStackView.alignment = UIStackViewAlignmentFill;
|
|
|
|
|
}
|
|
|
|
|
return _attentionStackView;
|
2021-12-21 18:10:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (XPMineFriendNumberView *)attentionView {
|
|
|
|
|
if (!_attentionView) {
|
|
|
|
|
_attentionView = [[XPMineFriendNumberView alloc] init];
|
|
|
|
|
_attentionView.title = @"关注";
|
|
|
|
|
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAttentionRecognizer)];
|
|
|
|
|
[_attentionView addGestureRecognizer:tap];
|
|
|
|
|
}
|
|
|
|
|
return _attentionView;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (XPMineFriendNumberView *)fansView {
|
|
|
|
|
if (!_fansView) {
|
|
|
|
|
_fansView = [[XPMineFriendNumberView alloc] init];
|
|
|
|
|
_fansView.title = @"粉丝";
|
|
|
|
|
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapFansRecognizer)];
|
|
|
|
|
[_fansView addGestureRecognizer:tap];
|
|
|
|
|
}
|
|
|
|
|
return _fansView;
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-22 18:48:23 +08:00
|
|
|
|
- (XPMineFriendNumberView *)visitorView {
|
|
|
|
|
if (!_visitorView) {
|
|
|
|
|
_visitorView = [[XPMineFriendNumberView alloc] init];
|
|
|
|
|
_visitorView.title = @"访客";
|
2022-07-27 11:49:51 +08:00
|
|
|
|
_visitorView.isVisitor = YES;
|
2022-07-22 18:48:23 +08:00
|
|
|
|
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapVisitorRecognizer)];
|
|
|
|
|
[_visitorView addGestureRecognizer:tap];
|
|
|
|
|
}
|
|
|
|
|
return _visitorView;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (XPMineFriendNumberView *)footprintView {
|
|
|
|
|
if (!_footprintView) {
|
|
|
|
|
_footprintView = [[XPMineFriendNumberView alloc] init];
|
|
|
|
|
_footprintView.title = @"足迹";
|
|
|
|
|
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapFootprintRecognizer)];
|
|
|
|
|
[_footprintView addGestureRecognizer:tap];
|
|
|
|
|
}
|
|
|
|
|
return _footprintView;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (XPMineAccountView *)accountView {
|
|
|
|
|
if (!_accountView) {
|
|
|
|
|
_accountView = [[XPMineAccountView alloc] init];
|
|
|
|
|
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapAccountrecognizer)];
|
|
|
|
|
[_accountView addGestureRecognizer:tap];
|
|
|
|
|
}
|
|
|
|
|
return _accountView;
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-06 17:50:59 +08:00
|
|
|
|
- (XPNobleCenterEntranceView *)nobleEntranceView {
|
|
|
|
|
if (!_nobleEntranceView) {
|
|
|
|
|
_nobleEntranceView = [[XPNobleCenterEntranceView alloc] init];
|
|
|
|
|
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapNobleCenterrecognizer)];
|
|
|
|
|
[_nobleEntranceView addGestureRecognizer:tap];
|
|
|
|
|
}
|
|
|
|
|
return _nobleEntranceView;
|
|
|
|
|
}
|
2021-09-16 19:30:22 +08:00
|
|
|
|
|
2022-09-27 15:07:31 +08:00
|
|
|
|
- (XPMineHeadTeenagerView *)teenagerView {
|
|
|
|
|
if (!_teenagerView) {
|
|
|
|
|
_teenagerView = [[XPMineHeadTeenagerView alloc] init];
|
|
|
|
|
_teenagerView.layer.cornerRadius = 8;
|
|
|
|
|
_teenagerView.layer.masksToBounds = YES;
|
|
|
|
|
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapTeenagerView)];
|
|
|
|
|
[_teenagerView addGestureRecognizer:tap];
|
|
|
|
|
}
|
|
|
|
|
return _teenagerView;
|
|
|
|
|
}
|
|
|
|
|
|
2022-11-15 11:15:05 +08:00
|
|
|
|
- (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;
|
|
|
|
|
}
|
2022-12-13 21:09:48 +08:00
|
|
|
|
|
|
|
|
|
- (UIButton *)anchorLevel {
|
|
|
|
|
if (!_anchorLevel) {
|
|
|
|
|
_anchorLevel = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
|
|
[_anchorLevel setImage:[UIImage imageNamed:@"mine_anchor_level_enter"] forState:UIControlStateNormal];
|
|
|
|
|
[_anchorLevel setImage:[UIImage imageNamed:@"mine_anchor_level_enter"] forState:UIControlStateSelected];
|
2022-12-14 16:28:15 +08:00
|
|
|
|
[_anchorLevel setTitle:@"主播评级" forState:UIControlStateNormal];
|
|
|
|
|
_anchorLevel.titleLabel.font = [UIFont systemFontOfSize:12];
|
|
|
|
|
[_anchorLevel setTitleColor:[ThemeColor mainTextColor] forState:UIControlStateNormal];
|
|
|
|
|
[_anchorLevel setTitleEdgeInsets:UIEdgeInsetsMake(0, 25, 0, 0)];
|
2022-12-13 21:09:48 +08:00
|
|
|
|
[_anchorLevel addTarget:self action:@selector(anchorLevelAction:) forControlEvents:UIControlEventTouchUpInside];
|
|
|
|
|
}
|
|
|
|
|
return _anchorLevel;
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-16 19:30:22 +08:00
|
|
|
|
@end
|