调整个人资料页功能和布局

删除不使用的功能代码
This commit is contained in:
eggmanQQQ
2024-06-24 08:10:31 +08:00
parent a646d24d82
commit 9ab187415c
7 changed files with 395 additions and 542 deletions

View File

@@ -528,6 +528,7 @@
54C3895F2C2189DD00FD47B1 /* XPHomeMinePresenter.m in Sources */ = {isa = PBXBuildFile; fileRef = 54C3895E2C2189DD00FD47B1 /* XPHomeMinePresenter.m */; };
54C389622C23BD1600FD47B1 /* HomeRankAvatarModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 54C389612C23BD1600FD47B1 /* HomeRankAvatarModel.m */; };
54C389672C24464600FD47B1 /* HomeMineRoomModel.m in Sources */ = {isa = PBXBuildFile; fileRef = 54C389662C24464600FD47B1 /* HomeMineRoomModel.m */; };
54F4692F2C280CF100A83655 /* XPMineUserInfoViewControllerV2.m in Sources */ = {isa = PBXBuildFile; fileRef = 54F4692E2C280CF100A83655 /* XPMineUserInfoViewControllerV2.m */; };
73FFADDC93E195344047A2EC /* Pods_YuMi.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CACF623970097D653132D69A /* Pods_YuMi.framework */; };
9B0086C627BA392B0032BD2B /* AnchorStageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B0086C527BA392B0032BD2B /* AnchorStageView.m */; };
9B0086CA27BA4F570032BD2B /* AnchorMicroView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B0086C927BA4F570032BD2B /* AnchorMicroView.m */; };
@@ -2582,6 +2583,8 @@
54C389642C24448900FD47B1 /* XPHomeMineProtocol.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPHomeMineProtocol.h; sourceTree = "<group>"; };
54C389652C24464600FD47B1 /* HomeMineRoomModel.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HomeMineRoomModel.h; sourceTree = "<group>"; };
54C389662C24464600FD47B1 /* HomeMineRoomModel.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HomeMineRoomModel.m; sourceTree = "<group>"; };
54F4692D2C280CF100A83655 /* XPMineUserInfoViewControllerV2.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPMineUserInfoViewControllerV2.h; sourceTree = "<group>"; };
54F4692E2C280CF100A83655 /* XPMineUserInfoViewControllerV2.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPMineUserInfoViewControllerV2.m; sourceTree = "<group>"; };
7DB00EC07F1D0ADFF900B38D /* Pods-YuMi.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-YuMi.debug.xcconfig"; path = "Target Support Files/Pods-YuMi/Pods-YuMi.debug.xcconfig"; sourceTree = "<group>"; };
9B0086C427BA392B0032BD2B /* AnchorStageView.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = AnchorStageView.h; sourceTree = "<group>"; };
9B0086C527BA392B0032BD2B /* AnchorStageView.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = AnchorStageView.m; sourceTree = "<group>"; };
@@ -9698,6 +9701,8 @@
isa = PBXGroup;
children = (
E88B5CBF26FB407B00DA9178 /* XPMineUserInfoViewController.h */,
54F4692D2C280CF100A83655 /* XPMineUserInfoViewControllerV2.h */,
54F4692E2C280CF100A83655 /* XPMineUserInfoViewControllerV2.m */,
E88B5CC026FB407B00DA9178 /* XPMineUserInfoViewController.m */,
E8D34D4528080295009C4835 /* XPMineUserDataViewController.h */,
E8D34D4628080295009C4835 /* XPMineUserDataViewController.m */,
@@ -11396,6 +11401,7 @@
2331C1642A5EB71000E1D940 /* NobleInfo.m in Sources */,
23E9EB182A84D0E700B792F2 /* XPMineUserInfoEditMainTagView.m in Sources */,
E824543A26F5880E00BE8163 /* XPLoginVerifBindPhoneProtocol.h in Sources */,
54F4692F2C280CF100A83655 /* XPMineUserInfoViewControllerV2.m in Sources */,
E821077E2987D67100DE7040 /* MessageRiskAlertModel.m in Sources */,
E818DD222A48977F00F163F7 /* XPLoginAreaTableViewCell.m in Sources */,
E81060F72987C8A700B772F0 /* MessageApplicationShareModel.m in Sources */,

View File

@@ -12,7 +12,7 @@
NS_ASSUME_NONNULL_BEGIN
@class UserInfoModel, MineSkillCardListInfoModel, XPMineUserDataViewController;
@protocol XPMineUserDataViewControllerDelegate <NSObject>
@optional
///请求技能卡中有声音的技能
- (void)xPMineUserDataViewController:(XPMineUserDataViewController *)viewController didGetVoiceSuccess:(MineSkillCardListInfoModel *)voiceCard;

View File

@@ -20,7 +20,7 @@
#import "TTPopup.h"
#import "XPSkillCardPlayerManager.h"
#import "UIImage+Utils.h"
#import "CountDownHelper.h"
///Model
#import "MineSkillCardListInfoModel.h"
#import "UserInfoModel.h"
@@ -30,7 +30,6 @@
///View
#import "XPMineUserInfoHeaderView.h"
#import "XPMineUserInfoCustomNavView.h"
#import "XPMineUserInfoVoiceCardView.h"
#import "XPMineUserInfoIndividualTagView.h"
///P
#import "XPMineUserInfoPresenter.h"
@@ -44,13 +43,14 @@
#import "XPMineUserDataViewController.h"
#import "XPMonentsMineViewController.h"
#import "XPGiftUserDataViewController.h"
#import "XPMineUserInfoRecordedSoundVC.h"
#import "XPRoomMiniManager.h"
#import "XPMineUserInfoTagVC.h"
UIKIT_EXTERN NSString * kUpdateSoundInfo;
@interface XPMineUserInfoViewController ()<CountDownHelperDelegate,XPMineCustomNavViewDelegate, XPMineUserInfoProtocol, XPMineUserInfoHeaderViewDelegate, JXCategoryViewDelegate,JXPagerViewDelegate, XPMineUserDataViewControllerDelegate, JXPagerMainTableViewGestureDelegate,XPMineUserInfoEditViewControllerDelegate,XPMineUserInfoTagVCDelegate,XPMineUserInfoIndividualTagViewDelegate>
@interface XPMineUserInfoViewController ()<
XPMineCustomNavViewDelegate, XPMineUserInfoProtocol, XPMineUserInfoHeaderViewDelegate, JXCategoryViewDelegate,JXPagerViewDelegate, JXPagerMainTableViewGestureDelegate,XPMineUserInfoEditViewControllerDelegate,XPMineUserInfoTagVCDelegate,XPMineUserInfoIndividualTagViewDelegate>
@property (nonatomic, strong) JXCategoryTitleView *titleView;
@property (nonatomic, strong) JXCategoryIndicatorImageView *lineView;
@property (nonatomic, strong) JXPagerView *pagingView;
@@ -69,25 +69,20 @@ UIKIT_EXTERN NSString * kUpdateSoundInfo;
@property (nonatomic,strong) UIButton *attentionButton;
///
@property (nonatomic,strong) XPMineUserDataViewController *userDataVC;
///
//@property (nonatomic,strong) XPMonentsMineViewController *monentsVC;
///
@property (nonatomic,strong) XPGiftUserDataViewController *giftVC;
///
@property (nonatomic,strong) XPMineUserInfoEditViewController * editVC ;
///
@property (nonatomic,strong) XPMineUserInfoVoiceCardView *voiceView;
///
@property (nonatomic,strong) CountDownHelper *countDownHelper;
@property (nonatomic,strong) XPMineUserInfoEditViewController * editVC;
///
@property (nonatomic,strong) XPMineUserInfoTagModel *tagModel;
@end
@implementation XPMineUserInfoViewController
- (void)dealloc{
- (void)dealloc {
[[NSNotificationCenter defaultCenter]removeObserver:self];
}
- (XPMineUserInfoPresenter *)createPresenter {
return [[XPMineUserInfoPresenter alloc] init];
}
@@ -98,15 +93,11 @@ UIKIT_EXTERN NSString * kUpdateSoundInfo;
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
self.countDownHelper.delegate = self;
}
-(void)viewDidDisappear:(BOOL)animated{
[super viewDidAppear:animated];
[self.countDownHelper stopCountDown];
self.countDownHelper .delegate = nil;
[[XPSkillCardPlayerManager shareInstance] stopMusic];
[self.headView setPlaySoundStatus:NO];
}
- (void)viewWillAppear:(BOOL)animated {
@@ -124,26 +115,7 @@ UIKIT_EXTERN NSString * kUpdateSoundInfo;
self.view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
[self initSubViews];
[self initSubViewConstraints];
[[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(updateSoundInfo:) name:kUpdateSoundInfo object:nil];
}
-(void)updateSoundInfo:(NSNotification *)not{
if(not.object != nil){
self.headView.soundModel = not.object;
NSString *fileName = [[ self.headView.soundModel.audioUrl componentsSeparatedByString:@"/"] lastObject];
NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) xpSafeObjectAtIndex:0] stringByAppendingPathComponent:@"kMineSoundCard"];
NSString *fullPath = [filePath stringByAppendingPathComponent:fileName];
if (![[NSFileManager defaultManager] fileExistsAtPath:fullPath]) {
NSFileManager *fileMgr = [[NSFileManager alloc] init];
[fileMgr createDirectoryAtPath:filePath withIntermediateDirectories:YES attributes:nil error:nil];
[UploadFile downloadAudioWithFileName:fileName musicUrl:self.headView.soundModel.audioUrl mainFileName:@"kMineSoundCard" completion:^(BOOL isSuccess, NSString *editAudioPath) {
}];
}
}else{
self.headView.soundModel = nil;
}
}
- (void)viewDidLayoutSubviews {
[super viewDidLayoutSubviews];
@@ -154,7 +126,6 @@ UIKIT_EXTERN NSString * kUpdateSoundInfo;
- (void)initSubViews {
[self.view addSubview:self.pagingView];
[self.view addSubview:self.navView];
[self.view addSubview:self.voiceView];
if (self.uid != [AccountInfoStorage instance].getUid.integerValue) {
[self.view addSubview:self.bottomStackView];
[self.bottomStackView addArrangedSubview:self.chatButton];
@@ -166,7 +137,6 @@ UIKIT_EXTERN NSString * kUpdateSoundInfo;
make.bottom.mas_equalTo(self.view).offset(-kSafeAreaBottomHeight - 15);
}];
}
}
- (void)initSubViewConstraints {
@@ -174,20 +144,13 @@ UIKIT_EXTERN NSString * kUpdateSoundInfo;
make.leading.trailing.top.mas_equalTo(self.view);
make.height.mas_equalTo(kNavigationHeight);
}];
[self.voiceView mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.mas_equalTo(self.view);
make.top.mas_equalTo(self.view.mas_safeAreaLayoutGuideTop).offset(176);
make.size.mas_equalTo(CGSizeMake(65, 25));
}];
}
- (void)initHttpRequest {
NSString *uid = [NSString stringWithFormat:@"%ld", self.uid];
[self.presenter getUserInfoWithUid:uid];
[self.presenter getUserAttentionState:uid];
// 使
[self.presenter getUserDetailInfoWithUid:uid];
@@ -263,7 +226,7 @@ UIKIT_EXTERN NSString * kUpdateSoundInfo;
#pragma mark - JXCategoryViewDelegate
- (NSUInteger)tableHeaderViewHeightInPagerView:(JXPagerView *)pagerView {
return 358;
return 500; //358;
}
- (UIView *)tableHeaderViewInPagerView:(JXPagerView *)pagerView {
@@ -294,8 +257,6 @@ UIKIT_EXTERN NSString * kUpdateSoundInfo;
return self.userDataVC;
}
return self.giftVC;
}
#pragma mark - JXPagerMainTableViewGestureDelegate
@@ -322,81 +283,6 @@ UIKIT_EXTERN NSString * kUpdateSoundInfo;
}
#pragma mark - XPMineUserInfoHeaderViewDelegate
- (void)xPMineUserInfoHeaderView:(XPMineUserInfoHeaderView *)view didClickGotoEditVC:(nonnull NSMutableArray *)itemList{
XPMineUserInfoTagVC *tagVC =[XPMineUserInfoTagVC new];
tagVC.tagModel = self.tagModel;
tagVC.delegate = self;
[self.navigationController pushViewController:tagVC animated:YES];
}
- (void)xPMineUserInfoHeaderView:(XPMineUserInfoHeaderView *)view didClickGotoEditView:(NSMutableArray *)itemList{
XPMineUserInfoIndividualTagView *tagView = [[XPMineUserInfoIndividualTagView alloc]initWithFrame:CGRectMake(0, 0, KScreenWidth, KScreenHeight)];
tagView.uid = @(self.uid).stringValue;
tagView.itemList = itemList;
tagView.delegate = self;
[TTPopup popupView:tagView style:TTPopupStyleAlert];
}
-(void)didClickGoToPlaySound{
XPMineUserInfoRecordedSoundVC *soundVC = [[XPMineUserInfoRecordedSoundVC alloc]init];
soundVC.soundModel = self.headView.soundModel;
[self.navigationController pushViewController:soundVC animated:YES];
}
- (void)xPMineUserInfoHeaderView:(XPMineUserInfoHeaderView *)view didClickPlaySound:(BOOL)isPlay{
if(isPlay == YES){
NSString *fileName = [[self.headView.soundModel.audioUrl componentsSeparatedByString:@"/"] lastObject];
NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) xpSafeObjectAtIndex:0] stringByAppendingPathComponent:@"kMineSoundCard"];
NSString *fullPath = [filePath stringByAppendingPathComponent:fileName];
if ([[NSFileManager defaultManager] fileExistsAtPath:fullPath]) {
[self playAudioWithUrl:fullPath isDelay:[XPSkillCardPlayerManager shareInstance].isMineInMic];
}else{
if (![[NSFileManager defaultManager] fileExistsAtPath:filePath]) {
NSFileManager *fileMgr = [[NSFileManager alloc] init];
[fileMgr createDirectoryAtPath:filePath withIntermediateDirectories:YES attributes:nil error:nil];
}
[UploadFile downloadAudioWithFileName:fileName musicUrl:self.headView.soundModel.audioUrl mainFileName:@"kMineSoundCard" completion:^(BOOL isSuccess, NSString *editAudioPath) {
if(isSuccess){
[self playAudioWithUrl:editAudioPath isDelay:[XPSkillCardPlayerManager shareInstance].isMineInMic];
}else{
[self.headView setPlaySoundStatus:NO];
[[XPSkillCardPlayerManager shareInstance] stopMusic];
}
}];
}
}else{
[self.countDownHelper stopCountDown];
[self.headView setPlaySoundStatus:NO];
[[XPSkillCardPlayerManager shareInstance] stopMusic];
}
}
///
/// - Parameters:
/// - url:
/// - isDelay: 0.50.5
-(void)playAudioWithUrl:(NSString*)url isDelay:(BOOL)isDelay{
if(isDelay == YES){
[[XPSkillCardPlayerManager shareInstance] playerNewVoiceWithPath:url completionBlock:^{
[[XPSkillCardPlayerManager shareInstance] stopMusic];
}];
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.5 * NSEC_PER_SEC));
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
NSInteger getCurrentTime = ceil(self.headView.soundModel.second);
[self.countDownHelper openCountdownWithTime:(int)getCurrentTime];
});
return;
}
NSInteger getCurrentTime = ceil(self.headView.soundModel.second);
[self.countDownHelper openCountdownWithTime:(int)getCurrentTime];
[[XPSkillCardPlayerManager shareInstance] playerVoiceWithPath:url completionBlock:^{
[[XPSkillCardPlayerManager shareInstance] stopMusic];
}];
}
- (void)xPMineUserInfoHeaderView:(XPMineUserInfoHeaderView *)view didClickGoToRoom:(NSString *)roomUid {
if (roomUid.length > 0 ) {
if(roomUid.integerValue == [XPSkillCardPlayerManager shareInstance].roomUid.integerValue && [XPRoomMiniManager shareManager].getRoomInfo == nil){
@@ -415,20 +301,7 @@ UIKIT_EXTERN NSString * kUpdateSoundInfo;
[XPRoomViewController openRoom:roomUid viewController:self];
}
}
#pragma mark - CountDownHelperDelegate
///
- (void)onCountdownFinish{
[self.headView setPlaySoundTime:0];
dispatch_time_t popTime = dispatch_time(DISPATCH_TIME_NOW, (int64_t)(0.3 * NSEC_PER_SEC));
dispatch_after(popTime, dispatch_get_main_queue(), ^(void){
[self.headView setPlaySoundStatus:NO];
});
}
///
- (void)onCountdownOpen:(int)time{
[self.headView setPlaySoundTime:(int)time + 1];
}
#pragma mark - XPMineUserInfoIndividualTagView
- (void)didClickGotoEditVC{
@@ -443,48 +316,22 @@ UIKIT_EXTERN NSString * kUpdateSoundInfo;
- (void)xPMineUserInfoTagVC:(XPMineUserInfoTagVC *)vc didClickComplete:(NSArray *)meLabels{
self.headView.tagModel = self.tagModel;
}
#pragma mark - XPMineUserDataViewControllerDelegate
- (void)xPMineUserDataViewController:(XPMineUserDataViewController *)viewController didGetVoiceSuccess:(MineSkillCardListInfoModel *)voiceCard {
if (voiceCard && [voiceCard.cardId isEqualToString:@"8"]) {
self.voiceView.hidden = NO;
self.voiceView.voiceInfo = voiceCard;
} else {
self.voiceView.hidden = YES;
}
}
#pragma mark - XPMineUserInfoProtocol
- (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo {
self.userInfo = userInfo;
self.headView.userInfo = userInfo;
self.headView.soundModel = self.userInfo.audioCard;
self.editVC.soundModel = self.headView.soundModel;
XPMineUserInfoTagModel *tagModel = [XPMineUserInfoTagModel new];
tagModel.meLabels = userInfo.labels;
self.tagModel = tagModel;
self.editVC.tagModel = tagModel;
self.headView.tagModel = tagModel;
self.userDataVC.userInfo = userInfo;
NSString *fileName = [[self.headView.soundModel.audioUrl componentsSeparatedByString:@"/"] lastObject];
NSString *filePath = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) xpSafeObjectAtIndex:0] stringByAppendingPathComponent:@"kMineSoundCard"];
NSString *fullPath = [filePath stringByAppendingPathComponent:fileName];
if (![[NSFileManager defaultManager] fileExistsAtPath:fullPath]) {
NSFileManager *fileMgr = [[NSFileManager alloc] init];
[fileMgr createDirectoryAtPath:filePath withIntermediateDirectories:YES attributes:nil error:nil];
[UploadFile downloadAudioWithFileName:fileName musicUrl:self.headView.soundModel.audioUrl mainFileName:@"kMineSoundCard" completion:^(BOOL isSuccess, NSString *editAudioPath) {
}];
}
if(isMSRTL()){
[self.titleView selectItemAtIndex:1];
}
}
- (void)ongetDetailInfoSuccess:(UserInfoModel *)userInfo {
self.userDataVC.dynamicInfo = userInfo.dynamicInfo;
self.headView.roomUid = userInfo.roomUid;
@@ -660,14 +507,6 @@ UIKIT_EXTERN NSString * kUpdateSoundInfo;
}
return _userDataVC;
}
- (XPMineUserInfoVoiceCardView *)voiceView {
if (!_voiceView) {
_voiceView = [[XPMineUserInfoVoiceCardView alloc] init];
_voiceView.hidden = YES;
}
return _voiceView;
}
-(XPGiftUserDataViewController *)giftVC{
if (!_giftVC){
@@ -682,10 +521,5 @@ UIKIT_EXTERN NSString * kUpdateSoundInfo;
}
return _editVC;
}
- (CountDownHelper *)countDownHelper{
if (!_countDownHelper){
_countDownHelper = [[CountDownHelper alloc]init];
}
return _countDownHelper;
}
@end

View File

@@ -0,0 +1,16 @@
//
// XPMineUserInfoViewControllerV2.h
// YuMi
//
// Created by P on 2024/6/23.
//
#import "MvpViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface XPMineUserInfoViewControllerV2 : MvpViewController
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,43 @@
//
// XPMineUserInfoViewControllerV2.m
// YuMi
//
// Created by P on 2024/6/23.
//
#import "XPMineUserInfoViewControllerV2.h"
#import "XPMineUserInfoPresenter.h"
@interface XPMineUserInfoViewControllerV2 ()
@end
@implementation XPMineUserInfoViewControllerV2
- (void)viewDidLoad {
[super viewDidLoad];
}
- (void)viewDidAppear:(BOOL)animated {
[super viewDidAppear:animated];
}
- (XPMineUserInfoPresenter *)createPresenter {
return [[XPMineUserInfoPresenter alloc] init];
}
- (BOOL)isHiddenNavBar {
return YES;
}
/*
#pragma mark - Navigation
// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
// Get the new view controller using [segue destinationViewController].
// Pass the selected object to the new view controller.
}
*/
@end

View File

@@ -13,7 +13,9 @@ NS_ASSUME_NONNULL_BEGIN
@protocol XPMineUserInfoHeaderViewDelegate <NSObject>
///去房间
- (void)xPMineUserInfoHeaderView:(XPMineUserInfoHeaderView *)view didClickGoToRoom:(NSString *)roomUid;
//播放声音,播放或关闭
@optional
///播放声音,播放或关闭
- (void)xPMineUserInfoHeaderView:(XPMineUserInfoHeaderView *)view didClickPlaySound:(BOOL)isPlay;
///去录音VC
- (void)didClickGoToPlaySound;
@@ -27,7 +29,7 @@ NS_ASSUME_NONNULL_BEGIN
///用户信息
@property (nonatomic,strong) UserInfoModel *userInfo;
///声音卡基本信息
@property (nonatomic,strong) XPSoundCardModel *__nullable soundModel;
//@property (nonatomic,strong) XPSoundCardModel *__nullable soundModel;
///标签
@property (nonatomic,strong) XPMineUserInfoTagModel *tagModel;
///轮播图
@@ -36,10 +38,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,weak) id<XPMineUserInfoHeaderViewDelegate> delegate;
///当前查看用户是否在直播
@property (nonatomic,copy) NSString *roomUid;
///声音卡时svga是否播放动画
-(void)setPlaySoundStatus:(BOOL)isPlay;
///声音卡倒计时
-(void)setPlaySoundTime:(NSInteger)time;
@end

View File

@@ -22,6 +22,21 @@
#import "XPMineUserInfoHeaderTagView.h"
///Model
#import "UserInfoModel.h"
#define StackSpring(axis) \
^{\
UIView *view = UIView.new; \
[view mas_makeConstraints:^(MASConstraintMaker *make) {\
if (axis == UILayoutConstraintAxisHorizontal) {\
make.width.mas_equalTo(1000).priorityLow();\
} else {\
make.height.mas_equalTo(1000).priorityLow();\
}\
}];\
return view;\
}()
@interface XPMineUserInfoHeaderView ()<SDCycleScrollViewDelegate, SDPhotoBrowserDelegate,XPMineUserInfoHeaderTagViewDelegate>
///
@property (nonatomic,strong) SDCycleScrollView *pi_cycleScrollView;
@@ -37,10 +52,8 @@
///
@property (nonatomic,strong) UIView * userInfoView;
///
@property (nonatomic,strong) UIImageView *userShadowImageView;
@property (nonatomic,strong) UIStackView *nickStackView;
///
@property (nonatomic,strong) UILabel *nameLabel;
@@ -58,11 +71,10 @@
///
@property (nonatomic,strong) UIStackView *idStackView;
///
@property (nonatomic,strong) UIImageView *beautifulImageViw;
@property (nonatomic,strong) UIImageView *beautifulImageView;
///id
@property (nonatomic,strong) UILabel *idLabel;
///
@property (nonatomic,strong) UIView * spaceView;
///
@property (nonatomic,strong) UILabel *fansNumLabel;
///
@@ -99,21 +111,18 @@
@property (nonatomic,strong) UserPhoto *avatarPhoto;
///
@property (nonatomic,strong) NetImageView * avatarView;
///
@property (nonatomic,strong) UIImageView *soundView;
///
@property (nonatomic,strong) UIButton *palySoundBtn;
///
@property (nonatomic,strong) SVGAImageView *soundSVGAView;
///
@property (nonatomic,strong) UILabel *soundTimeView;
///
@property (nonatomic,strong) UILabel *soundPromptView;
///
@property (nonatomic,strong) UIButton *toSoundBtn;
///VIPicon
@property (nonatomic,strong) NetImageView *nobleImageView;
@property (nonatomic, strong) UIStackView *locateDateStackView;
@property (nonatomic, strong) UILabel *locateLabel;
@property (nonatomic, strong) UILabel *birthDateLabel;
@property (nonatomic, strong) UIImageView *relationshipView;
@property (nonatomic, strong) UILabel *fansNum;
@property (nonatomic, strong) UILabel *followersNum;
@end
@implementation XPMineUserInfoHeaderView
@@ -121,70 +130,230 @@
- (instancetype)initWithFrame:(CGRect)frame {
self = [super initWithFrame:frame];
if (self) {
[self initSubViews];
[self initSubViewConstraints];
// [self initSubViews];
// [self initSubViewConstraints];
[self setupUI];
}
return self;
}
#pragma mark - Private Method
- (void)initSubViews {
- (void)setupUI {
[self addSubview:self.pi_cycleScrollView];
[self.pi_cycleScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.top.mas_equalTo(self);
make.height.mas_equalTo(kGetScaleWidth(256));
}];
[self addSubview:self.reviewIcon];
[self addSubview:self.userInfoView];
[self addSubview:self.pageButton];
[self addSubview:self.avatarView];
[self addSubview:self.soundView];
[self.avatarView addSubview:self.onlineView];
[self.onlineView addSubview:self.onlineIconView];
[self.onlineView addSubview:self.onlineTitleView];
[self.onlineView addSubview:self.onlineButton];
[self.userInfoView addSubview:self.userShadowImageView];
[self.userShadowImageView addSubview:self.singStackView];
// [self.userInfoView addSubview:self.lineView];
[self.userShadowImageView addSubview:self.nickStackView];
[self.userShadowImageView addSubview:self.idStackView];
[self.userShadowImageView addSubview:self.tagStackView];
[self.soundView addSubview:self.palySoundBtn];
[self.soundView addSubview:self.soundSVGAView];
[self.soundView addSubview:self.soundTimeView];
[self.soundView addSubview:self.soundPromptView];
[self.soundView addSubview:self.toSoundBtn];
[self.userInfoView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.mas_equalTo(self);
make.top.mas_equalTo(self).offset(kGetScaleWidth(224));
make.bottom.mas_equalTo(self);
}];
[self.userInfoView addSubview:self.avatarView];
[self.avatarView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(kGetScaleWidth(72));
make.centerX.mas_equalTo(0);
make.centerY.equalTo(self.userInfoView.mas_top);
}];
[self setupNameArea];
[self setupIDArea];
[self setupLocateArea];
[self setupTagsArea];
[self setupCustomDesc];
[self setupRelationshipArea];
}
- (void)setupNameArea {
[self.userInfoView addSubview:self.nickStackView];
[self.nickStackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.mas_equalTo(self.userInfoView);
make.top.mas_equalTo(self.avatarView.mas_bottom).offset(18);
}];
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(25);
}];
[self.nobleImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(20);
}];
[self.sexImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(28, 14));
}];
// [self.nickStackView addArrangedSubview:StackSpring(UILayoutConstraintAxisHorizontal)];
[self.nickStackView addArrangedSubview:self.nobleImageView];
[self.nickStackView addArrangedSubview:self.nameLabel];
[self.nickStackView addArrangedSubview:self.sexImageView];
[self.idStackView addArrangedSubview:self.beautifulImageViw];
[self.idStackView addArrangedSubview:self.idLabel];
[self.idStackView addArrangedSubview:self.spaceView];
[self.idStackView addArrangedSubview:self.fansNumLabel];
// [self.nickStackView addArrangedSubview:StackSpring(UILayoutConstraintAxisHorizontal)];
}
- (void)setupIDArea {
[self.userInfoView addSubview:self.idStackView];
[self.idStackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.mas_equalTo(self.userInfoView);
make.top.mas_equalTo(self.nickStackView.mas_bottom).offset(4);
}];
[self.beautifulImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(12, 15));
}];
[self.idLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(14);
}];
[self.idStackView addArrangedSubview:[UIView new]];
[self.idStackView addArrangedSubview:self.beautifulImageView];
[self.idStackView addArrangedSubview:self.idLabel];
[self.idStackView addArrangedSubview:[UIView new]];
}
- (void)setupLocateArea {
[self.userInfoView addSubview:self.locateDateStackView];
[self.locateDateStackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.mas_equalTo(self.userInfoView);
make.top.mas_equalTo(self.idStackView.mas_bottom).offset(4);
}];
[self.locateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(16);
}];
[self.birthDateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(16);
}];
UILabel *line = [UILabel labelInitWithText:@"|"
font:self.locateLabel.font
textColor:self.locateLabel.textColor];
[self.locateDateStackView addArrangedSubview:StackSpring(UILayoutConstraintAxisHorizontal)];
[self.locateDateStackView addArrangedSubview:self.locateLabel];
[self.locateDateStackView addArrangedSubview:line];
[self.locateDateStackView addArrangedSubview:self.birthDateLabel];
[self.locateDateStackView addArrangedSubview:StackSpring(UILayoutConstraintAxisHorizontal)];
}
- (void)setupTagsArea {
[self.userInfoView addSubview:self.tagStackView];
[self.tagStackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.locateDateStackView.mas_bottom).offset(4);
make.leading.trailing.mas_equalTo(self.userInfoView);
}];
[self.newUserImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(20);
}];
[self.officalImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(20);
}];
[self.experImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(20);
make.width.mas_equalTo(34);
}];
[self.charmImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(20);
make.width.mas_equalTo(34);
}];
[self.rechargeImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(18);
make.width.mas_equalTo(54);
}];
[self.namePlateView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(30);
make.width.mas_equalTo(80);
}];
///
[self.tagStackView addArrangedSubview:[self stackSpaceView]];
[self.tagStackView addArrangedSubview:self.newUserImageView];
[self.tagStackView addArrangedSubview:self.officalImageView];
[self.tagStackView addArrangedSubview:self.experImageView];
[self.tagStackView addArrangedSubview:self.charmImageView];
[self.tagStackView addArrangedSubview:self.namePlateView];
[self.tagStackView addArrangedSubview:self.rechargeImageView];
[self.tagStackView addArrangedSubview:[self stackSpaceView]];
///
[self.namePlateView addSubview:self.nameplateImageView];
[self.namePlateView addSubview:self.nameplateLabel];
[self.nameplateImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(30);
make.top.mas_equalTo(0);
make.width.mas_equalTo(80);
}];
[self.nameplateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.bottom.mas_equalTo(self.nameplateImageView);
make.trailing.mas_equalTo(self.namePlateView).offset(-2);
}];
}
- (void)setupCustomDesc {
[self.userInfoView addSubview:self.signLabel];
[self.signLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.userInfoView);
make.top.mas_equalTo(self.tagStackView.mas_bottom).offset(4);
make.width.mas_equalTo(KScreenWidth - 70);
}];
}
- (void)setupRelationshipArea {
[self.userInfoView addSubview:self.relationshipView];
[self.relationshipView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.signLabel.mas_bottom);
make.left.mas_equalTo(self.userInfoView).offset(14);
make.right.mas_equalTo(self.userInfoView).offset(-14);
make.height.mas_equalTo(55);
}];
UIView *line = [[UIView alloc] init];
line.backgroundColor = [UIColor colorWithWhite:1 alpha:0.6];
[self.relationshipView addSubview:line];
[line mas_makeConstraints:^(MASConstraintMaker *make) {
make.center.mas_equalTo(self.relationshipView);
make.size.mas_equalTo(CGSizeMake(1.5, 20));
}];
UILabel *followerTitle = [UILabel labelInitWithText:@"关注"
font:[UIFont systemFontOfSize:13 weight:UIFontWeightBold]
textColor:[UIColor colorWithWhite:1 alpha:0.8]];
UILabel *fansTitle = [UILabel labelInitWithText:@"粉丝"
font:[UIFont systemFontOfSize:13 weight:UIFontWeightBold]
textColor:[UIColor colorWithWhite:1 alpha:0.8]];
[self.relationshipView addSubview:followerTitle];
[followerTitle mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.relationshipView).offset(10);
make.right.mas_equalTo(line.mas_left).offset(-60);
}];
[self.relationshipView addSubview:fansTitle];
[fansTitle mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.relationshipView).offset(10);
make.left.mas_equalTo(line.mas_right).offset(60);
}];
}
- (void)initSubViews {
[self addSubview:self.reviewIcon];
[self addSubview:self.pageButton];
[self.avatarView addSubview:self.onlineView];
[self.onlineView addSubview:self.onlineIconView];
[self.onlineView addSubview:self.onlineTitleView];
[self.onlineView addSubview:self.onlineButton];
// [self.userInfoView addSubview:self.lineView];
// [self.userShadowImageView addSubview:self.nickStackView];
// [self.userShadowImageView addSubview:self.idStackView];
// [self.userShadowImageView addSubview:self.tagStackView];
[self.idStackView addArrangedSubview:self.fansNumLabel];
[self.singStackView addArrangedSubview:self.tagView];
[self.singStackView addArrangedSubview:self.signBackView];
[self.signBackView addSubview:self.signLabel];
@@ -200,49 +369,16 @@
} failureBlock:^(NSError * _Nonnull error) {
}];
SVGAParser *soundParser = [SVGAParser new];
[soundParser parseWithNamed:@"pi_new_mine_info_sound_play" inBundle:[NSBundle mainBundle] completionBlock:^(SVGAVideoEntity * _Nonnull videoItem) {
@kStrongify(self);
self.soundSVGAView.loops = 0;
self.soundSVGAView.clearsAfterStop = NO;
self.soundSVGAView.videoItem = videoItem;
} failureBlock:^(NSError * _Nonnull error) {
}];
}
- (void)initSubViewConstraints {
[self.pi_cycleScrollView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.top.mas_equalTo(self);
make.height.mas_equalTo(245);
}];
[self.reviewIcon mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.trailing.mas_equalTo(self);
make.width.mas_equalTo(85);
make.height.mas_equalTo(50);
}];
[self.userInfoView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.trailing.mas_equalTo(self);
make.bottom.mas_equalTo(self);
make.height.mas_greaterThanOrEqualTo(133);
}];
[self.userShadowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(0);
make.trailing.mas_equalTo(0);
make.top.height.mas_equalTo(self.userInfoView);
}];
[self.avatarView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(88);
make.leading.mas_equalTo(30);
make.top.equalTo(self.userInfoView.mas_top).mas_offset(-28);
}];
[self.onlineView mas_makeConstraints:^(MASConstraintMaker *make) {
make.bottom.equalTo(self.avatarView);
make.width.mas_equalTo(84);
@@ -272,87 +408,13 @@
make.bottom.mas_equalTo(self.userInfoView.mas_top).offset(-8);
}];
[self.nickStackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(self.userShadowImageView).offset(115);
make.top.mas_equalTo(self.userShadowImageView).offset(11);
make.trailing.lessThanOrEqualTo(@(-15));
}];
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(25);
}];
[self.nobleImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(20);
}];
[self.sexImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(28, 14));
}];
[self.idStackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(self.nickStackView);
make.top.mas_equalTo(self.nickStackView.mas_bottom).offset(4);
make.trailing.mas_equalTo(-15);
}];
[self.beautifulImageViw mas_makeConstraints:^(MASConstraintMaker *make) {
make.size.mas_equalTo(CGSizeMake(15, 15));
}];
[self.spaceView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.greaterThanOrEqualTo(@10);
make.height.mas_equalTo(15);
}];
[self.tagStackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(self.userShadowImageView).offset(15);
make.top.mas_equalTo(self.userInfoView).offset(68);
make.trailing.lessThanOrEqualTo(@70);
}];
[self.experImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(20);
make.width.mas_equalTo(34);
}];
[self.charmImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(20);
make.width.mas_equalTo(34);
}];
[self.rechargeImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(18);
make.width.mas_equalTo(54);
}];
[self.newUserImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(20);
}];
[self.officalImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(20);
}];
[self.namePlateView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(20);
make.width.mas_equalTo(self.nameplateImageView.mas_width);
}];
[self.nameplateImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.height.mas_equalTo(30);
make.top.mas_equalTo(-5);
make.width.mas_equalTo(80);
}];
[self.nameplateLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.bottom.mas_equalTo(self.nameplateImageView);
make.trailing.mas_equalTo(self.namePlateView).offset(-2);
}];
[self.singStackView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(15);
make.top.mas_equalTo(103);
@@ -372,42 +434,7 @@
[self.signLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.signBackView);
}];
[self.soundView mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.mas_equalTo(-15);
make.width.mas_equalTo(98);
make.height.mas_equalTo(28);
make.bottom.equalTo(self.userInfoView.mas_top).mas_offset(-5);
}];
[self.palySoundBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(18);
make.top.mas_equalTo(5);
make.leading.mas_equalTo(4);
}];
[self.soundSVGAView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(27);
make.width.mas_equalTo(35);
make.height.mas_equalTo(19);
make.centerY.equalTo(self.soundView);
}];
[self.soundTimeView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.mas_equalTo(67);
make.centerY.equalTo(self.soundView);
}];
[self.soundPromptView mas_makeConstraints:^(MASConstraintMaker *make) {
make.trailing.mas_equalTo(-8);
make.centerY.equalTo(self.soundView);
}];
[self.toSoundBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.edges.equalTo(self.soundView);
}];
[self.userShadowImageView.superview layoutIfNeeded];
// [self.userShadowImageView.superview layoutIfNeeded];
}
@@ -449,25 +476,13 @@
pasteboard. string = [NSString stringWithFormat:@"%ld", (long)_userInfo.erbanNo];
}
-(void)toSoundAction{
if(self.soundTimeView.hidden == NO){
[self playSoundAction];
return;
}
if(self.delegate && [self.delegate respondsToSelector:@selector(didClickGoToPlaySound)]){
[self.delegate didClickGoToPlaySound];
}
}
-(void)setPlaySoundStatus:(BOOL)isPlay{
self.palySoundBtn.selected = isPlay;
if(self.palySoundBtn.selected == YES){
[self.soundSVGAView startAnimation];
}else{
[self.soundSVGAView stopAnimation];
self.soundTimeView.text = [NSString stringWithFormat:@"%ld\"",_soundModel.second];
}
}
-(void)setPlaySoundTime:(NSInteger)time{
self.soundTimeView.text = [NSString stringWithFormat:@"%ld\"",time];
}
#pragma mark - XPMineUserInfoHeaderTagView
- (void)didClickGotoIvidualView{
@@ -498,55 +513,15 @@
}
}
-(void)playSoundAction{
self.palySoundBtn.selected = !self.palySoundBtn.selected;
if(self.palySoundBtn.selected == YES){
[self.soundSVGAView startAnimation];
}else{
[self.soundSVGAView stopAnimation];
}
if(self.delegate && [self.delegate respondsToSelector:@selector(xPMineUserInfoHeaderView:didClickPlaySound:)]){
[self.delegate xPMineUserInfoHeaderView:self didClickPlaySound:self.palySoundBtn.selected];
}
}
#pragma mark - Getters And Setters
-(void)setSoundModel:(XPSoundCardModel *)soundModel{
_soundModel = soundModel;
if(_soundModel != nil){
if(_soundModel.status == 2){
_soundView.hidden = YES;
_soundTimeView.hidden = NO;
_soundSVGAView.hidden = NO;
_soundPromptView.hidden = YES;
_soundTimeView.text = [NSString stringWithFormat:@"%ld\"",_soundModel.second];
return;
}
if(_soundModel.uid.integerValue == [[AccountInfoStorage instance] getUid].integerValue){
_soundView.hidden = YES;
_soundPromptView.hidden = YES;
_soundTimeView.hidden = YES;
_soundSVGAView.hidden = YES;
}
return;
}
if(_soundModel.uid.integerValue == [[AccountInfoStorage instance] getUid].integerValue){
_soundView.hidden = YES;
_soundPromptView.hidden = YES;
_soundTimeView.hidden = YES;
_soundSVGAView.hidden = YES;
return;
}
_soundView.hidden = YES;
_soundTimeView.text = [NSString stringWithFormat:@"%d\"",0];
}
- (void)setUserInfo:(UserInfoModel *)userInfo {
_userInfo = userInfo;
if (_userInfo) {
self.nameLabel.text = _userInfo.nick;
self.birthDateLabel.text = @"1987-99-00";//[NSString calculateConstellationWithMonth:userInfo.birth];
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];
@@ -564,7 +539,7 @@
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.beautifulImageViw.hidden = !userInfo.hasPrettyErbanNo;
self.beautifulImageView.hidden = !userInfo.hasPrettyErbanNo;
self.newUserImageView.hidden = !userInfo.newUser;
if (userInfo.userLevelVo.experUrl) {
[self.experImageView loadImageWithUrl:userInfo.userLevelVo.experUrl completion:^(UIImage * _Nonnull image, NSURL * _Nonnull url) {
@@ -639,7 +614,7 @@
}
}
}
self.nobleImageView.hidden = userInfo.userVipInfoVO.vipIcon.length == 0;
// self.nobleImageView.hidden = userInfo.userVipInfoVO.vipIcon.length == 0;
[self.nobleImageView loadImageWithUrl:userInfo.userVipInfoVO.vipIcon completion:^(UIImage * _Nullable image, NSURL * _Nonnull url) {
self.nobleImageView.image = image;
CGFloat height = image.size.height > 0 ? image.size.height : 1;
@@ -690,28 +665,18 @@
_userInfoView = [[UIView alloc] init];
_userInfoView.backgroundColor = [UIColor clearColor];
_userInfoView.backgroundColor = [UIColor yellowColor];
_userInfoView.layer.masksToBounds = YES;
_userInfoView.layer.masksToBounds = NO;
_userInfoView.layer.cornerRadius = 8;
}
return _userInfoView;
}
- (UIImageView *)userShadowImageView {
if (!_userShadowImageView) {
_userShadowImageView = [[UIImageView alloc] init];
_userShadowImageView.userInteractionEnabled = YES;
_userShadowImageView.backgroundColor = [UIColor yellowColor];
_userShadowImageView.layer.cornerRadius = 13;
_userShadowImageView.layer.masksToBounds = YES;
}
return _userShadowImageView;
}
- (UIStackView *)nickStackView {
if (!_nickStackView) {
_nickStackView = [[UIStackView alloc] init];
_nickStackView.backgroundColor = [UIColor systemBlueColor];
_nickStackView.axis = UILayoutConstraintAxisHorizontal;
_nickStackView.distribution = UIStackViewDistributionFill;
_nickStackView.distribution = UIStackViewDistributionEqualCentering;
_nickStackView.alignment = UIStackViewAlignmentCenter;
_nickStackView.spacing = 5;
}
@@ -721,10 +686,8 @@
- (UILabel *)nameLabel {
if (!_nameLabel) {
_nameLabel = [[UILabel alloc] init];
_nameLabel.font = [UIFont fontWithName:@"PingFang-SC-Medium" size:18];
_nameLabel.textColor = UIColorFromRGB(0x1F1A4E);
_nameLabel.font = [UIFont systemFontOfSize:18 weight:UIFontWeightBold];
_nameLabel.textColor = UIColorFromRGB(0x1A1A1A);
}
return _nameLabel;
}
@@ -746,21 +709,22 @@
- (UIStackView *)idStackView {
if (!_idStackView) {
_idStackView = [[UIStackView alloc] init];
_idStackView.backgroundColor = [UIColor greenColor];
_idStackView.axis = UILayoutConstraintAxisHorizontal;
_idStackView.distribution = UIStackViewDistributionFill;
_idStackView.distribution = UIStackViewDistributionEqualCentering;
_idStackView.alignment = UIStackViewAlignmentCenter;
_idStackView.spacing = 5;
}
return _idStackView;
}
- (UIImageView *)beautifulImageViw {
if (!_beautifulImageViw) {
_beautifulImageViw = [[UIImageView alloc] init];
_beautifulImageViw.userInteractionEnabled = YES;
_beautifulImageViw.image = [UIImage getLanguageImage:@"common_icon_beautiful"];
- (UIImageView *)beautifulImageView {
if (!_beautifulImageView) {
_beautifulImageView = [[UIImageView alloc] init];
_beautifulImageView.userInteractionEnabled = YES;
_beautifulImageView.image = [UIImage getLanguageImage:@"common_icon_beautiful"];
}
return _beautifulImageViw;
return _beautifulImageView;
}
- (UILabel *)fansNumLabel {
@@ -772,19 +736,11 @@
return _fansNumLabel;
}
- (UIView *)spaceView {
if (!_spaceView) {
_spaceView = [[UIView alloc] init];
_spaceView.backgroundColor = [UIColor clearColor];
}
return _spaceView;
}
- (UILabel *)idLabel {
if (!_idLabel) {
_idLabel = [[UILabel alloc] init];
_idLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightRegular];
_idLabel.textColor = UIColorFromRGB(0x6D6B89);
_idLabel.font = [UIFont systemFontOfSize:11 weight:UIFontWeightMedium];
_idLabel.textColor = UIColorFromRGB(0x191919);
_idLabel.userInteractionEnabled = YES;
UITapGestureRecognizer *longPress = [[UITapGestureRecognizer alloc]initWithTarget:self action:@selector(copyNameAction)];
[_idLabel addGestureRecognizer:longPress];
@@ -831,14 +787,16 @@
- (SDCycleScrollView *)pi_cycleScrollView {
if (!_pi_cycleScrollView) {
_pi_cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectZero delegate:self placeholderImage:[UIImageConstant defaultBannerPlaceholder]];
_pi_cycleScrollView = [SDCycleScrollView cycleScrollViewWithFrame:CGRectZero
delegate:self
placeholderImage:[UIImageConstant defaultBannerPlaceholder]];
_pi_cycleScrollView.backgroundColor = [UIColor clearColor];
_pi_cycleScrollView.bannerImageViewContentMode = UIViewContentModeScaleAspectFill;
_pi_cycleScrollView.pageControlStyle = SDCycleScrollViewPageContolStyleNone;
_pi_cycleScrollView.autoScroll = NO;
// SDCycleScrollViewRTLLTR
_pi_cycleScrollView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
for (UIView *subView in _pi_cycleScrollView.subviews) {
for (UIView *subView in _pi_cycleScrollView.subviews) {
subView.semanticContentAttribute = UISemanticContentAttributeForceLeftToRight;
}
}
@@ -872,7 +830,7 @@
if (!_tagStackView) {
_tagStackView = [[UIStackView alloc] init];
_tagStackView.axis = UILayoutConstraintAxisHorizontal;
_tagStackView.distribution = UIStackViewDistributionFill;
_tagStackView.distribution = UIStackViewDistributionEqualCentering;
_tagStackView.alignment = UIStackViewAlignmentCenter;
_tagStackView.spacing = 2;
}
@@ -975,10 +933,10 @@
- (UILabel *)signLabel {
if (!_signLabel) {
_signLabel = [[UILabel alloc] init];
_signLabel.font = [UIFont systemFontOfSize:13 weight:UIFontWeightRegular];;
_signLabel.textColor = UIColorFromRGB(0xB3B3C3);
_signLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
_signLabel.textColor = UIColorFromRGB(0x1a1a1a);
_signLabel.numberOfLines = 2;
_signLabel.textAlignment = NSTextAlignmentCenter;
}
return _signLabel;
}
@@ -1003,7 +961,7 @@
config.placeHolder = [UIImageConstant defaultAvatarPlaceholder];
config.imageType = ImageTypeUserIcon;
_avatarView = [[NetImageView alloc]initWithConfig:config];
_avatarView.layer.cornerRadius = 44;
_avatarView.layer.cornerRadius = kGetScaleWidth(36);
_avatarView.layer.masksToBounds = YES;
_avatarView.layer.borderWidth = 1;
_avatarView.userInteractionEnabled = YES;
@@ -1014,58 +972,6 @@
return _avatarView;
}
- (UIImageView *)soundView{
if (!_soundView){
_soundView = [UIImageView new];
UIImage *image = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor],[DJDKMIMOMColor confirmButtonGradientMiddleColor],[DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(98, 28)];
_soundView.image = image;
_soundView.layer.cornerRadius = 14;
_soundView.userInteractionEnabled = YES;
_soundView.layer.masksToBounds = YES;
_soundView.hidden = YES;
}
return _soundView;
}
- (UIButton *)palySoundBtn{
if (!_palySoundBtn){
_palySoundBtn = [UIButton new];
[_palySoundBtn setBackgroundImage:kImage(@"mine_info_close") forState:UIControlStateNormal];
[_palySoundBtn setBackgroundImage:kImage(@"mine_info_paly") forState:UIControlStateSelected];
[_palySoundBtn setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10];
[_palySoundBtn addTarget:self action:@selector(playSoundAction) forControlEvents:UIControlEventTouchUpInside];
}
return _palySoundBtn;
}
- (SVGAImageView *)soundSVGAView {
if (_soundSVGAView == nil) {
_soundSVGAView = [[SVGAImageView alloc]init];
_soundSVGAView.contentMode = UIViewContentModeScaleToFill;
_soundSVGAView.userInteractionEnabled = NO;
_soundSVGAView.backgroundColor = [UIColor clearColor];
}
return _soundSVGAView;
}
- (UILabel *)soundTimeView{
if (!_soundTimeView){
_soundTimeView = [UILabel labelInitWithText:@"0\"" font:[UIFont systemFontOfSize:14 weight:UIFontWeightMedium] textColor:[UIColor whiteColor]];
}
return _soundTimeView;
}
- (UILabel *)soundPromptView{
if (!_soundPromptView){
_soundPromptView = [UILabel labelInitWithText:YMLocalizedString(@"XPMineUserInfoHeaderView4") font:[UIFont systemFontOfSize:12 weight:UIFontWeightMedium] textColor:[UIColor whiteColor]];
_soundPromptView.hidden = YES;
_soundPromptView.userInteractionEnabled = YES;
}
return _soundPromptView;
}
-(UIButton *)toSoundBtn{
if (!_toSoundBtn){
_toSoundBtn = [UIButton new];
[_toSoundBtn addTarget:self action:@selector(toSoundAction) forControlEvents:UIControlEventTouchUpInside];
}
return _toSoundBtn;
}
-(XPMineUserInfoHeaderTagView *)tagView{
if (!_tagView){
_tagView = [[XPMineUserInfoHeaderTagView alloc]initWithFrame:CGRectZero];
@@ -1076,6 +982,7 @@
- (UIStackView *)singStackView {
if (!_singStackView) {
_singStackView = [[UIStackView alloc] init];
_singStackView.backgroundColor = [UIColor systemRedColor];
_singStackView.axis = UILayoutConstraintAxisVertical;
_singStackView.distribution = UIStackViewDistributionFill;
_singStackView.alignment = UIStackViewAlignmentCenter;
@@ -1094,8 +1001,56 @@
- (NetImageView *)nobleImageView {
if (!_nobleImageView) {
_nobleImageView = [[NetImageView alloc] init];
_nobleImageView.hidden = YES;
_nobleImageView.backgroundColor = [UIColor purpleColor];
// _nobleImageView.hidden = YES;
}
return _nobleImageView;
}
- (UIStackView *)locateDateStackView {
if (!_locateDateStackView) {
_locateDateStackView = [[UIStackView alloc] init];
_locateDateStackView.backgroundColor = [UIColor systemRedColor];
_locateDateStackView.axis = UILayoutConstraintAxisHorizontal;
_locateDateStackView.distribution = UIStackViewDistributionFill;
_locateDateStackView.alignment = UIStackViewAlignmentCenter;
_locateDateStackView.spacing = 6;
}
return _locateDateStackView;
}
- (UILabel *)locateLabel {
if (!_locateLabel) {
_locateLabel = [[UILabel alloc] init];
_locateLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
_locateLabel.textColor = UIColorFromRGB(0x1a1a1a);
}
return _locateLabel;
}
- (UILabel *)birthDateLabel {
if (!_birthDateLabel) {
_birthDateLabel = [[UILabel alloc] init];
_birthDateLabel.font = [UIFont systemFontOfSize:12 weight:UIFontWeightMedium];
_birthDateLabel.textColor = UIColorFromRGB(0x1a1a1a);
}
return _birthDateLabel;
}
- (UIImageView *)relationshipView {
if (!_relationshipView) {
_relationshipView = [[UIImageView alloc] init];
_relationshipView.image = [UIImage gradientColorImageFromColors:@[UIColorFromRGB(0x41EABA), UIColorFromRGB(0x26cc9c)]
gradientType:GradientTypeTopToBottom
imgSize:CGSizeMake(360, 55)];
_relationshipView.userInteractionEnabled = YES;
}
return _relationshipView;
}
- (UIView *)stackSpaceView {
return [UIView new];
}
@end