Files
yinmeng-ios/xplan-ios/Main/Mine/View/SubViews/XPMineHeadView.m

616 lines
23 KiB
Mathematica
Raw Normal View History

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>
#import <YYText/YYText.h>
2021-09-16 19:30:22 +08:00
///Tool
#import "ThemeColor.h"
#import "XPMacro.h"
#import "UIImage+Utils.h"
2021-09-16 19:30:22 +08:00
///View
#import "NetImageView.h"
2021-12-28 02:07:11 +08:00
#import "UIImage+Utils.h"
#import "XPMineFriendNumberView.h"
#import "XPNobleCenterEntranceView.h"
2022-07-22 18:48:23 +08:00
#import "XPMineAccountView.h"
2021-09-16 19:30:22 +08:00
///Model
#import "UserInfoModel.h"
2022-07-22 18:48:23 +08:00
#import "WalletInfoModel.h"
2021-09-16 19:30:22 +08:00
@interface XPMineHeadView ()
///
@property (nonatomic,strong) NetImageView * avatarImageView;
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;
///
@property (nonatomic,strong) UIButton *editButton;
///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;
///
@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;
///
@property (nonatomic, strong) XPNobleCenterEntranceView *nobleEntranceView;
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-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-07-22 18:48:23 +08:00
[self.nameStackView addArrangedSubview:self.nameLabel];
[self.nameStackView addArrangedSubview:self.editButton];
[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-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) {
make.size.mas_equalTo(CGSizeMake(50, 50));
make.left.mas_equalTo(self).offset(20);
make.top.mas_equalTo(self).offset(30 + kSafeAreaTopHeight);
2021-09-16 19:30:22 +08:00
}];
2022-01-19 11:19:33 +08:00
[self.nobleImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.left.mas_equalTo(self.avatarImageView.mas_right).offset(17);
make.top.mas_equalTo(self.avatarImageView).mas_offset(8);
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);
make.left.mas_equalTo(self.nobleImageView.mas_right).mas_offset(5);
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);
2021-09-16 19:30:22 +08:00
make.top.mas_equalTo(self.nameStackView.mas_bottom).offset(6);
}];
[self.levelLabel mas_makeConstraints:^(MASConstraintMaker *make) {
2022-01-19 11:19:33 +08:00
make.left.mas_equalTo(self.nobleImageView);
2021-09-16 19:30:22 +08:00
make.top.mas_equalTo(self.idStackView.mas_bottom).offset(4);
}];
2022-07-22 18:48:23 +08:00
[self.skillCardButton mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerY.mas_equalTo(self.avatarImageView);
make.right.mas_equalTo(15);
make.width.mas_equalTo(87);
make.height.mas_equalTo(28);
}];
[self.attentionStackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.levelLabel.mas_bottom).mas_offset(10);
make.height.mas_equalTo(44);
make.left.mas_equalTo(15);
make.right.mas_equalTo(-15);
}];
CGFloat width = (KScreenWidth - 30) / 4;
CGFloat height = 44;
[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-07-22 18:48:23 +08:00
width = (KScreenWidth - 30 - 17) * 0.5;
height = width * 64 / 164;
[self.accountView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.attentionStackView.mas_bottom).mas_offset(16);
make.size.mas_equalTo(CGSizeMake(width, height));
make.left.mas_equalTo(15);
}];
[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-07-22 18:48:23 +08:00
#pragma mark - Action
- (void)tapAvatarImageView {
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];
}
}
#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 {
NSURL *imgUrl = [NSURL URLWithString:imageUrl];
UIImage *myImage = [UIImage imageWithData:[NSData dataWithContentsOfURL:imgUrl]];
CGFloat scale = myImage.size.width / myImage.size.height;
imageView.bounds = CGRectMake(0, 0, 20 * scale, 20);
}
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
}];
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
}
///
- (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) {
2021-12-17 19:31: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 : @"";
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];
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;
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;
}
- (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;
_avatarImageView.layer.cornerRadius = 25;
}
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];
_nameLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
_nameLabel.textColor = [ThemeColor mainTextColor];
}
return _nameLabel;
}
- (UIButton *)editButton {
if (!_editButton) {
_editButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_editButton setImage:[UIImage imageNamed:@"mine_head_name_edit"] forState:UIControlStateNormal];
[_editButton setImage:[UIImage imageNamed:@"mine_head_name_edit"] forState:UIControlStateSelected];
}
return _editButton;
}
- (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)];
_skillCardButton.backgroundColor = [UIColor whiteColor];
_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;
}
- (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;
}
- (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
@end