// // YOUPAIBBProfileHeaderView.m // VQU // // Created by Elaine on 2021/10/19. // Copyright © 2021 MS. All rights reserved. // #import "YOUPAIBBProfileHeaderView.h" //#import "YOUPAILCEditUserMsgVC.h" #import "YOUPAILCFollowVC.h" #import "YOUPAILCFansVC.h" #import "YOUPAILCSeenVC.h" #import "YOUPAILCVisitVC.h" #import "YOUPAILZProfitVC.h" #import "YOUPAIZYVideoLikesVC.h" #import "YOUPAIXRWalletVC.h" #import "LZAlertWindow.h" #import "UIViewController+TFPresent.h" #import "YOUPAILZLevelView.h" #import "YOUPAILZAvatarView.h" #import "YOUPAIBBSettingVC.h" #import "YOUPAILZUserShowVC.h" #import "MSYMineinfoEditVC.h" @interface BBProfileBadgeButton : UIButton @property (nonatomic, assign) NSInteger youpaipbadgeValue; @property (nonatomic, assign) NSInteger youpaipcount; @property (nonatomic, strong) NSString *youpaiptitleStr; @property (nonatomic, weak) UILabel *youpaipcountL; @property (nonatomic, weak) UILabel *youpaiptitleL; @property (nonatomic, weak) UILabel *youpaipbadgeL; @property (nonatomic, weak) UIView *youpaipbadgeBgV; @end @implementation BBProfileBadgeButton - (instancetype)init{ if (self = [super init]) { [self youpaifinitUI]; } return self; } - (void)youpaifinitUI{ UILabel *youpaipcountL = [[UILabel alloc] init]; youpaipcountL.font = LCFont(16.0f); youpaipcountL.textColor = LZ273145Color; [self addSubview:youpaipcountL]; self.youpaipcountL = youpaipcountL; [youpaipcountL mas_makeConstraints:^(MASConstraintMaker *make) { make.centerX.equalTo(self); make.top.offset(0.0f); }]; UILabel *youpaiptitleL = [[UILabel alloc] init]; youpaiptitleL.font = LCFont(12.0f); youpaiptitleL.textColor = LZA3AABEColor; youpaiptitleL.textAlignment = NSTextAlignmentCenter; [self addSubview:youpaiptitleL]; self.youpaiptitleL = youpaiptitleL; [youpaiptitleL mas_makeConstraints:^(MASConstraintMaker *make) { make.bottom.left.right.offset(0.0f); }]; UIView *youpaipbadgeBgV = [[UIView alloc] init]; youpaipbadgeBgV.backgroundColor = HexColorFromRGB(0xF4003F); youpaipbadgeBgV.layer.cornerRadius = 7.0f; youpaipbadgeBgV.clipsToBounds = YES; youpaipbadgeBgV.hidden = YES; [self addSubview:youpaipbadgeBgV]; self.youpaipbadgeBgV = youpaipbadgeBgV; [youpaipbadgeBgV mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(youpaipcountL.mas_right).offset(-5.0f); make.bottom.equalTo(youpaipcountL.mas_top).offset(5.0f); make.height.offset(14.0f); make.width.greaterThanOrEqualTo(14.0f); }]; UILabel *youpaipbadgeL = [[UILabel alloc] init]; youpaipbadgeL.font = LCFont(10.0f); youpaipbadgeL.textColor = [UIColor whiteColor]; youpaipbadgeL.textAlignment = NSTextAlignmentCenter; [youpaipbadgeBgV addSubview:youpaipbadgeL]; self.youpaipbadgeL = youpaipbadgeL; [youpaipbadgeL mas_makeConstraints:^(MASConstraintMaker *make) { make.left.offset(2.0f); make.right.offset(-2.0f); make.top.bottom.offset(0.0f); }]; } -(void)setYoupaipbadgeValue:(NSInteger)youpaipbadgeValue { _youpaipbadgeValue = youpaipbadgeValue; self.youpaipbadgeBgV.hidden = youpaipbadgeValue <= 0; self.youpaipbadgeL.text = [NSString stringWithFormat:@"%ld",youpaipbadgeValue]; if (youpaipbadgeValue > 99) { self.youpaipbadgeL.text = @"99+"; } } - (void)setYoupaiptitleStr:(NSString *)youpaiptitleStr{ _youpaiptitleStr = youpaiptitleStr; self.youpaiptitleL.text = youpaiptitleStr; } -(void)setYoupaipcount:(NSInteger)youpaipcount { _youpaipcount= youpaipcount; self.youpaipcountL.text = [NSString stringWithFormat:@"%@",@(youpaipcount)]; } @end @interface YOUPAIBBProfileHeaderView() @property (nonatomic, weak) YOUPAILZAvatarView *youpaipavatarImgV; // 头像 @property (nonatomic,weak) UIImageView *youpaipanchorTagImgV; @property (nonatomic, weak) UILabel *youpaipnicknameL; // 昵称 @property (nonatomic, weak) UIButton *youpaipidBtn; // id @property (nonatomic, weak) BBProfileBadgeButton *youpaipfollowBtn; // 关注 @property (nonatomic, weak) BBProfileBadgeButton *youpaipfansBtn; // 粉丝 @property (nonatomic, weak) BBProfileBadgeButton *youpaipvisitBtn; // 访客 @property (nonatomic, weak) BBProfileBadgeButton *youpaipliveBtn; // 获赞 @property (nonatomic, weak) UILabel *youpaipbalanceL; // 余额 @property (nonatomic, weak) UILabel *youpaipprofitL; // 收益 @property (nonatomic, strong) YOUPAILCUserModel *youpaipuserModel; @property (nonatomic, strong) YOUPAILZLiveCardModel *youpaipcardModel; @property (nonatomic, weak) UIImageView *youpaipvipV; @property (nonatomic, weak) UIImageView *youpaipbadgeImgV; @property (nonatomic, weak) YOUPAILZLevelView *youpaiplevelView; @end @implementation YOUPAIBBProfileHeaderView - (instancetype)initWithFrame:(CGRect)frame{ if (self = [super initWithFrame:frame]) { [self youpaifinitUI]; } return self; } - (void)youpaifinitUI{ UIButton *editBtn = [UIButton buttonWithType:UIButtonTypeCustom]; editBtn.frame = CGRectMake(0.0f, 0.0f, 64.0f, 20.0f); [editBtn setImage:[UIImage imageNamed:@"vqu_images_mine_arrow"] forState:UIControlStateNormal]; [editBtn setImage:[UIImage imageNamed:@"vqu_images_mine_arrow"] forState:UIControlStateHighlighted]; [editBtn setTitle:@"编辑资料" forState:UIControlStateNormal]; [editBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal]; editBtn.titleLabel.font = LCFont(12.0f); [editBtn addTarget:self action:@selector(youpaifeditBtnClick) forControlEvents:UIControlEventTouchUpInside]; CGFloat btnImageWidth = editBtn.imageView.bounds.size.width; CGFloat btnLabelWidth = editBtn.titleLabel.bounds.size.width; [editBtn setTitleEdgeInsets:UIEdgeInsetsMake(0, -btnImageWidth, 0, btnImageWidth)]; [editBtn setImageEdgeInsets:UIEdgeInsetsMake(0, btnLabelWidth, 0, -btnLabelWidth)]; [self addSubview:editBtn]; [editBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.right.offset(-20.0f); make.top.offset(34.0f + StatusBarHeight); make.height.offset(20.0f); make.width.offset(64.0f); }]; //设置 // UIButton *setMineBtn = [UIButton buttonWithType:UIButtonTypeCustom]; // [self addSubview:setMineBtn]; // [setMineBtn mas_makeConstraints:^(MASConstraintMaker *make) { // make.right.offset(-23.0f); // make.top.offset(15.0f + StatusBarHeight); // make.size.mas_equalTo(CGSizeMake(30, 18)); // }]; // [setMineBtn setImage:[UIImage imageNamed:@"vqu_images_setMine"] forState:UIControlStateNormal]; // [setMineBtn addTarget:self action:@selector(youpaifsetMineBtnClick) forControlEvents:UIControlEventTouchUpInside]; UIButton *userBtn = [UIButton buttonWithType:UIButtonTypeCustom]; [userBtn addTarget:self action:@selector(youpaifuserBtnClick) forControlEvents:UIControlEventTouchUpInside]; [self addSubview:userBtn]; [userBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.left.offset(20.0f); make.centerY.equalTo(editBtn).offset(-10.0f); make.height.offset(49.0f); make.right.equalTo(editBtn.mas_left).offset(-10.0f); }]; YOUPAILZAvatarView *youpaipavatarImgV = [YOUPAILZAvatarView youpaifavatarViewWithFrame:CGRectMake(0.0f, 0.0f, 49.0f, 49.0f) avatarURL:nil personalityBoxURL:nil]; youpaipavatarImgV.userInteractionEnabled = NO; [userBtn addSubview:youpaipavatarImgV]; self.youpaipavatarImgV = youpaipavatarImgV; [youpaipavatarImgV mas_makeConstraints:^(MASConstraintMaker *make) { make.left.top.bottom.offset(0.0f); make.width.offset(49.0f); }]; UIImageView *youpaipanchorTagImgV = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"vqu_images_anchor_vlog"]]; youpaipanchorTagImgV.hidden = YES; [userBtn addSubview:youpaipanchorTagImgV]; self.youpaipanchorTagImgV = youpaipanchorTagImgV; [youpaipanchorTagImgV mas_makeConstraints:^(MASConstraintMaker *make) { make.right.equalTo(self.youpaipavatarImgV.youpaipavatarImgV.mas_right).offset(0.0f); make.bottom.equalTo(self.youpaipavatarImgV.youpaipavatarImgV.mas_bottom).offset(0.0f); make.size.mas_offset(CGSizeMake(10.0f, 10.0f)); }]; UILabel *youpaipnicknameL = [[UILabel alloc] init]; youpaipnicknameL.font = LCFont(19.0f); youpaipnicknameL.textColor = [UIColor blackColor]; youpaipnicknameL.text = [LCSaveModel getUserModel].youpaipuserinfo.youpaipnickname; [userBtn addSubview:youpaipnicknameL]; self.youpaipnicknameL = youpaipnicknameL; [youpaipnicknameL mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(youpaipavatarImgV.mas_right).offset(10.0f); make.top.offset(0.0f); make.height.offset(24.5f); }]; UIImageView *youpaipvipV = [[UIImageView alloc] init]; [self addSubview:youpaipvipV]; self.youpaipvipV = youpaipvipV; youpaipvipV.hidden = YES; [youpaipvipV mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(youpaipnicknameL.mas_right).offset(3.0f); make.centerY.equalTo(youpaipnicknameL); }]; UIImageView *youpaipbadgeImgV = [[UIImageView alloc] init]; [self addSubview:youpaipbadgeImgV]; self.youpaipbadgeImgV = youpaipbadgeImgV; youpaipbadgeImgV.hidden = YES; [youpaipbadgeImgV mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(youpaipnicknameL.mas_right).offset(3.0f); make.centerY.equalTo(youpaipnicknameL); }]; YOUPAILZLevelView *youpaiplevelView = [[YOUPAILZLevelView alloc] init]; [self addSubview:youpaiplevelView]; self.youpaiplevelView = youpaiplevelView; youpaiplevelView.hidden = YES; [youpaiplevelView mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(youpaipnicknameL.mas_right).offset(3.0f); make.centerY.equalTo(youpaipnicknameL); }]; // UITapGestureRecognizer *tapGest = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(youpaiftouchUserLevel)]; // [youpaiplevelView addGestureRecognizer:tapGest]; UIButton *youpaipidBtn = [UIButton buttonWithType:UIButtonTypeCustom]; youpaipidBtn.titleLabel.font = LCFont12; [youpaipidBtn setTitleColor:LZA3AABEColor forState:UIControlStateNormal]; [youpaipidBtn setTitle:[NSString stringWithFormat:@"ID:%@",[LCSaveModel getUserModel].youpaipuserinfo.youpaipusercode] forState:UIControlStateNormal]; [youpaipidBtn addTarget:self action:@selector(youpaifcopyBtnClick) forControlEvents:UIControlEventTouchUpInside]; [userBtn addSubview:youpaipidBtn]; self.youpaipidBtn = youpaipidBtn; [youpaipidBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(youpaipavatarImgV.mas_right).offset(10.0f); make.bottom.offset(0.0f); make.top.equalTo(youpaipnicknameL.mas_bottom); }]; UIButton *copyIDBtn = [UIButton buttonWithType:UIButtonTypeCustom]; [copyIDBtn setImage:[UIImage imageNamed:@"vqu_images_ic_profile_copy_code1"] forState:UIControlStateNormal]; [copyIDBtn addTarget:self action:@selector(youpaifcopyBtnClick) forControlEvents:UIControlEventTouchUpInside]; [userBtn addSubview:copyIDBtn]; [copyIDBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(youpaipidBtn.mas_right).offset(3.0f); make.centerY.equalTo(youpaipidBtn.mas_centerY); make.size.mas_offset(CGSizeMake(12.0f, 12.0f)); }]; UIView *countBtnBgV = [[UIView alloc] init]; [self addSubview:countBtnBgV]; [countBtnBgV mas_makeConstraints:^(MASConstraintMaker *make) { make.left.offset(12.0f); make.right.offset(-12.0f); make.top.equalTo(userBtn.mas_bottom).offset(21.0f); make.height.offset(35.0f); }]; NSArray *btnContents = @[ @{@"title":@"关注",@"count":@"0"}, @{@"title":@"粉丝",@"count":@"0"}, @{@"title":[LCSaveModel getUserModel].youpaipuserinfo.youpaipis_anchor != 0 ? @"获赞" : @"足迹",@"count":@"0"}, @{@"title":@"访客",@"count":@"0"}, ]; NSArray *sels = @[ @"youpaiffollowBtnClick", @"youpaiffansBtnClick", [LCSaveModel getUserModel].youpaipuserinfo.youpaipis_anchor != 0 ? @"youpaifliveBtnClick" : @"youpaifvisitClick", @"youpaifvisitBtnClick", ]; NSMutableArray *btns = [NSMutableArray array]; for (NSInteger i = 0; i < btnContents.count; i ++) { NSDictionary *youpaipdict = btnContents[i]; BBProfileBadgeButton *badgeBtn = [[BBProfileBadgeButton alloc] init]; badgeBtn.youpaipcount = [youpaipdict[@"count"] integerValue]; badgeBtn.youpaiptitleStr = youpaipdict[@"title"]; [countBtnBgV addSubview:badgeBtn]; [badgeBtn addTarget:self action:NSSelectorFromString(sels[i]) forControlEvents:UIControlEventTouchUpInside]; [btns addObject:badgeBtn]; if (i == 0) { self.youpaipfollowBtn = badgeBtn; }else if (i == 1){ self.youpaipfansBtn = badgeBtn; }else if (i == 2){ self.youpaipliveBtn = badgeBtn; }else{ self.youpaipvisitBtn = badgeBtn; } } [btns mas_distributeViewsAlongAxis:MASAxisTypeHorizontal withFixedSpacing:0 leadSpacing:0 tailSpacing:0]; [btns mas_makeConstraints:^(MASConstraintMaker *make) { make.top.bottom.offset(0.0f); }]; for (NSInteger i = 1; i < btns.count; i ++) { BBProfileBadgeButton *badgeBtn = btns[i]; UIView *line = [[UIView alloc] init]; line.backgroundColor = [[UIColor whiteColor] colorWithAlphaComponent:0.22f]; [countBtnBgV addSubview:line]; [line mas_makeConstraints:^(MASConstraintMaker *make) { make.right.equalTo(badgeBtn.mas_left); make.centerY.equalTo(badgeBtn); make.size.mas_offset(CGSizeMake(1.0f, 10.0f)); }]; } UIView *walletBgV = [[UIView alloc] init]; walletBgV.backgroundColor = HexColorFromRGB(0xffffff); walletBgV.layer.cornerRadius = 5.0f; walletBgV.clipsToBounds = YES; [self addSubview:walletBgV]; [walletBgV mas_makeConstraints:^(MASConstraintMaker *make) { make.left.offset(20.0f); make.right.bottom.offset(-20.0f); make.height.offset(86.0f); }]; UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(youpaifbalanceBtnClick)]; [walletBgV addGestureRecognizer:tap]; UIImageView *imgV = [[UIImageView alloc] init]; imgV.image =[UIImage imageNamed:@"vqu_images_ic_profile_balance"]; [walletBgV addSubview:imgV]; [imgV mas_makeConstraints:^(MASConstraintMaker *make) { make.left.offset(ScaleSize(30.0f)); make.centerY.equalTo(walletBgV); make.size.mas_offset(CGSizeMake(50.0f, 64.0f)); }]; UILabel *numberL = [[UILabel alloc] init]; numberL.text = [NSString stringWithFormat:@"%@",@"0"]; numberL.font = LCBoldFont(16.0f); [walletBgV addSubview:numberL]; [numberL mas_makeConstraints:^(MASConstraintMaker *make) { make.left.equalTo(imgV.mas_right).offset(10.0f); make.top.offset(0.0f); make.right.offset(-80.0f); make.bottom.offset(0.0f); }]; self.youpaipbalanceL = numberL; UIButton *detailsBtn = [UIButton buttonWithType:UIButtonTypeCustom]; detailsBtn.userInteractionEnabled = NO; detailsBtn.frame = CGRectMake(0.0f, 0.0f, 40.0f, 16.0f); [detailsBtn setImage:[UIImage imageNamed:@"vqu_images_mine_arrow"] forState:UIControlStateNormal]; [detailsBtn setImage:[UIImage imageNamed:@"vqu_images_mine_arrow"] forState:UIControlStateHighlighted]; [detailsBtn setTitle:@"充值" forState:UIControlStateNormal]; [detailsBtn setTitleColor:HexColorFromRGB(0x9F9DA5) forState:UIControlStateNormal]; detailsBtn.titleLabel.font = LCFont(12.0f); CGFloat bImageWidth = detailsBtn.imageView.bounds.size.width; CGFloat bLabelWidth = detailsBtn.titleLabel.bounds.size.width; [detailsBtn setTitleEdgeInsets:UIEdgeInsetsMake(0, -bImageWidth, 0, bImageWidth)]; [detailsBtn setImageEdgeInsets:UIEdgeInsetsMake(0, bLabelWidth, 0, -bLabelWidth)]; [walletBgV addSubview:detailsBtn]; [detailsBtn mas_makeConstraints:^(MASConstraintMaker *make) { make.right.offset(-20.0f); make.centerY.equalTo(walletBgV); make.height.offset(16.0f); make.width.offset(40.0f); }]; } - (void)youpaiftouchUserLevel{ LZAlertAction *action = [LZAlertAction actionWithTitle:@"好的" handler:^(LZAlertAction *action) { }]; action.bgColor = [UIColor colorWithPatternImage:[LCTools ColorImage:CGSizeMake(KScreenWidth - 128.0f, 48.0f) FromColors:@[HexColorFromRGB(0xFF0084),HexColorFromRGB(0xFF3A00)] ByGradientType:GradientLeftToRight]]; LZAlertWindow *alert = [LZAlertWindow alertWithTitle:@"" content:@"在视频中或直播中送礼即可提升等级" action:@[action]]; alert.contentFont = LCFont16; alert.contentHorizontalSpace = 32.0f; [[LCTools getCurrentVC] TFPresentVC:alert completion:^{}]; } /// 更新用户信息 - (void)youpaifreloadUserInfoWithModel:(YOUPAILCUserModel *)youpaipuserModel{ self.youpaipuserModel = youpaipuserModel; self.youpaipavatarImgV.youpaipavatarURL = [LCTools getImageUrlWithAddress:youpaipuserModel.youpaipuserinfo.youpaipavatar]; self.youpaipavatarImgV.youpaippersonalityBoxURL = [LCTools getImageUrlWithAddress:youpaipuserModel.youpaipuserinfo.youpaipavatar_frame]; // [self.youpaipavatarImgV sd_setImageWithURL:[LCTools getImageUrlWithAddress:youpaipuserModel.userinfo.avatar]]; self.youpaipnicknameL.text = youpaipuserModel.youpaipuserinfo.youpaipnickname; [self.youpaipidBtn setTitle:[NSString stringWithFormat:@"ID:%@",youpaipuserModel.youpaipuserinfo.youpaipusercode] forState:UIControlStateNormal]; //self.youpaipanchorTagImgV.hidden = youpaipuserModel.userinfo.is_live != 1; [self youpaifreloadTags]; } /// 更新数量信息 - (void)youpaifreloadCountWithModel:(YOUPAILCUserCountModel *)model{ self.youpaipfollowBtn.youpaipcount = model.youpaipfollow_count; self.youpaipfansBtn.youpaipcount = model.youpaipfans_count; self.youpaipfansBtn.youpaipbadgeValue = model.youpaipnew_fans_count; self.youpaipvisitBtn.youpaipcount = model.youpaipvisitor_count; self.youpaipvisitBtn.youpaipbadgeValue = model.youpaipnew_visitor_count; if ([LCSaveModel getUserModel].youpaipuserinfo.youpaipis_anchor != 0) { self.youpaipliveBtn.youpaipbadgeValue = model.youpaipnew_videoTrendsLike_count; self.youpaipliveBtn.youpaipcount = model.youpaipvideoTrendsLike_count; }else{ self.youpaipliveBtn.youpaipbadgeValue = 0; self.youpaipliveBtn.youpaipcount = model.youpaipviewer_count; } } /// 更新用户等级 - (void)youpaifreloadUserLevelModel:(YOUPAILZLiveCardModel *)model{ self.youpaipcardModel = model; [self youpaifreloadTags]; } // // - (void)youpaifreloadTags{ self.youpaipvipV.hidden = YES; self.youpaipbadgeImgV.hidden = YES; self.youpaiplevelView.hidden = YES; UIView *frontV; if (self.youpaipuserModel.youpaipuserinfo.youpaipvip_icon.length != 0) { self.youpaipvipV.hidden = NO; [self.youpaipvipV sd_setImageWithURL:[LCTools getImageUrlWithAddress:self.youpaipuserModel.youpaipuserinfo.youpaipvip_icon]]; [self.youpaipvipV mas_remakeConstraints:^(MASConstraintMaker *make) { if (frontV == nil) { make.left.equalTo(self.youpaipnicknameL.mas_right).offset(3.0f); }else{ make.left.equalTo(frontV.mas_right).offset(3.0f); } make.centerY.equalTo(self.youpaipnicknameL); make.size.mas_offset(CGSizeMake(30.0f, 19.0f)); }]; frontV = self.youpaipvipV; } if (self.youpaipuserModel.youpaipuserinfo.youpaipbadge_info.youpaipfile.length != 0) { self.youpaipbadgeImgV.hidden = NO; [self.youpaipbadgeImgV sd_setImageWithURL:[LCTools getImageUrlWithAddress:self.youpaipuserModel.youpaipuserinfo.youpaipbadge_info.youpaipfile]]; [self.youpaipbadgeImgV mas_remakeConstraints:^(MASConstraintMaker *make) { if (frontV == nil) { make.left.equalTo(self.youpaipnicknameL.mas_right).offset(3.0f); }else{ make.left.equalTo(frontV.mas_right).offset(3.0f); } make.centerY.equalTo(self.youpaipnicknameL); make.size.mas_offset(CGSizeMake(self.youpaipuserModel.youpaipuserinfo.youpaipbadge_info.youpaipwidth, 17.0f)); }]; frontV = self.youpaipbadgeImgV; } self.youpaiplevelView.hidden = NO; [self.youpaiplevelView youpaifreloadWithIcon:self.youpaipcardModel.youpaipgrade.youpaipimg1 iconWidth:self.youpaipcardModel.youpaipgrade.youpaipicon_width bgImg:self.youpaipcardModel.youpaipgrade.youpaipimg2 bgImgWidth:self.youpaipcardModel.youpaipgrade.youpaipicon1_width levelName:self.youpaipcardModel.youpaipgrade.youpaipgrade_name level:self.youpaipcardModel.youpaipgrade.youpaipgrade]; [self.youpaiplevelView mas_remakeConstraints:^(MASConstraintMaker *make) { if (frontV == nil) { make.left.equalTo(self.youpaipnicknameL.mas_right).offset(3.0f); }else{ make.left.equalTo(frontV.mas_right).offset(3.0f); } make.centerY.equalTo(self.youpaipnicknameL); make.size.mas_offset(self.youpaiplevelView.mj_size); }]; } /// 更新账户资产信息 /// balance 余额 /// profit 收益 - (void)youpaifreloadAccountWithBalance:(NSInteger)balance profit:(NSString *)profit{ self.youpaipbalanceL.text = [NSString stringWithFormat:@"%@",@(balance)]; self.youpaipprofitL.text = [NSString stringWithFormat:@"%@",profit]; } // 设置点击事件 -(void)youpaifsetMineBtnClick{ YOUPAIBBSettingVC* setting = [[YOUPAIBBSettingVC alloc]init]; setting.youpaipinfoModel = self.youpaipinfoModel; [[LCTools getCurrentVC].navigationController pushViewController:setting animated:YES]; } // 编辑点击事件 - (void)youpaifeditBtnClick{ MSYMineinfoEditVC * editvc = [MSYMineinfoEditVC new]; [[LCTools getCurrentVC].navigationController pushViewController:editvc animated:true]; // YOUPAILCEditUserMsgVC* editMsg = [[YOUPAILCEditUserMsgVC alloc]init]; // [[LCTools getCurrentVC].navigationController pushViewController:editMsg animated:YES]; } // 用户信息点击事件 - (void)youpaifuserBtnClick{ YOUPAILZUserShowVC *showVC = [[YOUPAILZUserShowVC alloc]init]; showVC.youpaipuserId = [LCSaveModel getUserModel].youpaipuserinfo.youpaipuser_id; [[LCTools getCurrentVC].navigationController pushViewController:showVC animated:YES]; } // 复制ID点击事件 - (void)youpaifcopyBtnClick{ UIPasteboard *pasteboard = [UIPasteboard generalPasteboard]; pasteboard.string = self.youpaipuserModel.youpaipuserinfo.youpaipusercode; [ZCHUDHelper showTitle:@"复制成功"]; } // 关注点击事件 - (void)youpaiffollowBtnClick{ YOUPAILCFollowVC* follow = [[YOUPAILCFollowVC alloc]init]; [[LCTools getCurrentVC].navigationController pushViewController:follow animated:YES]; } // 粉丝点击事件 - (void)youpaiffansBtnClick{ YOUPAILCFansVC* fan = [[YOUPAILCFansVC alloc]init]; [[LCTools getCurrentVC].navigationController pushViewController:fan animated:YES]; } // 访客点击事件 - (void)youpaifvisitBtnClick{ YOUPAILCSeenVC* seen = [[YOUPAILCSeenVC alloc]init]; [[LCTools getCurrentVC].navigationController pushViewController:seen animated:YES]; } // 获赞点击事件 - (void)youpaifliveBtnClick{ YOUPAIZYVideoLikesVC* fan = [[YOUPAIZYVideoLikesVC alloc]init]; [[LCTools getCurrentVC].navigationController pushViewController:fan animated:YES]; } // 足迹点击事件 - (void)youpaifvisitClick{ YOUPAILCVisitVC* visitVC = [[YOUPAILCVisitVC alloc]init]; [[LCTools getCurrentVC].navigationController pushViewController:visitVC animated:YES]; } // 账户余额 - (void)youpaifbalanceBtnClick{ YOUPAIXRWalletVC *wallet = [[YOUPAIXRWalletVC alloc]init]; [[LCTools getCurrentVC].navigationController pushViewController:wallet animated:YES]; } // 我的收益 - (void)youpaifprofitBtnClick{ YOUPAILZProfitVC *rechargeVC = [[YOUPAILZProfitVC alloc]init]; [[LCTools getCurrentVC].navigationController pushViewController:rechargeVC animated:YES]; } @end