青少年模式隐藏部分功能
This commit is contained in:
16
xplan-ios/Main/Mine/View/SubViews/XPMineHeadTeenagerView.h
Normal file
16
xplan-ios/Main/Mine/View/SubViews/XPMineHeadTeenagerView.h
Normal file
@@ -0,0 +1,16 @@
|
||||
//
|
||||
// XPMineHeadTeenagerView.h
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/9/27.
|
||||
//
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
NS_ASSUME_NONNULL_BEGIN
|
||||
|
||||
@interface XPMineHeadTeenagerView : UIView
|
||||
|
||||
@end
|
||||
|
||||
NS_ASSUME_NONNULL_END
|
122
xplan-ios/Main/Mine/View/SubViews/XPMineHeadTeenagerView.m
Normal file
122
xplan-ios/Main/Mine/View/SubViews/XPMineHeadTeenagerView.m
Normal file
@@ -0,0 +1,122 @@
|
||||
//
|
||||
// XPMineHeadTeenagerView.m
|
||||
// xplan-ios
|
||||
//
|
||||
// Created by GreenLand on 2022/9/27.
|
||||
//
|
||||
|
||||
#import "XPMineHeadTeenagerView.h"
|
||||
///Third
|
||||
#import <Masonry/Masonry.h>
|
||||
#import <YYText/YYText.h>
|
||||
///Tool
|
||||
#import "ThemeColor.h"
|
||||
#import "XPMacro.h"
|
||||
#import "UIImage+Utils.h"
|
||||
///View
|
||||
#import "NetImageView.h"
|
||||
#import "UIImage+Utils.h"
|
||||
#import "XPMineFriendNumberView.h"
|
||||
#import "XPNobleCenterEntranceView.h"
|
||||
#import "XPMineAccountView.h"
|
||||
///Model
|
||||
#import "UserInfoModel.h"
|
||||
#import "WalletInfoModel.h"
|
||||
#import "NobleCenterModel.h"
|
||||
|
||||
@interface XPMineHeadTeenagerView ()
|
||||
|
||||
///icon
|
||||
@property (nonatomic,strong) UIImageView *avatarImageView;
|
||||
///名字
|
||||
@property (nonatomic,strong) UILabel *nameLabel;
|
||||
///id
|
||||
@property (nonatomic,strong) UILabel *descLabel;
|
||||
///性别
|
||||
@property (nonatomic,strong) UIImageView *arrowImageView;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation XPMineHeadTeenagerView
|
||||
|
||||
- (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 whiteColor];
|
||||
[self addSubview:self.avatarImageView];
|
||||
[self addSubview:self.nameLabel];
|
||||
[self addSubview:self.descLabel];
|
||||
[self addSubview:self.arrowImageView];
|
||||
}
|
||||
|
||||
- (void)initSubViewConstraints {
|
||||
[self.avatarImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.size.mas_equalTo(CGSizeMake(32, 32));
|
||||
make.left.mas_equalTo(self).offset(12);
|
||||
make.centerY.mas_equalTo(self);
|
||||
}];
|
||||
|
||||
[self.nameLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.left.mas_equalTo(self.avatarImageView.mas_right);
|
||||
make.centerY.mas_equalTo(self);
|
||||
}];
|
||||
[self.descLabel mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self);
|
||||
make.right.mas_equalTo(self.arrowImageView.mas_left);
|
||||
}];
|
||||
[self.arrowImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.centerY.mas_equalTo(self);
|
||||
make.right.mas_equalTo(-8);
|
||||
make.width.mas_equalTo(21);
|
||||
make.height.mas_equalTo(21);
|
||||
}];
|
||||
}
|
||||
|
||||
#pragma mark - getter
|
||||
- (UIImageView *)avatarImageView {
|
||||
if (!_avatarImageView) {
|
||||
_avatarImageView = [[UIImageView alloc] init];
|
||||
_avatarImageView.image = [UIImage imageNamed:@"mine_normal_teenager_open"];
|
||||
}
|
||||
return _avatarImageView;
|
||||
}
|
||||
|
||||
- (UIImageView *)arrowImageView {
|
||||
if (!_arrowImageView) {
|
||||
_arrowImageView = [[UIImageView alloc] init];
|
||||
_arrowImageView.image = [UIImage imageNamed:@"skillCard_arrow"];
|
||||
}
|
||||
return _arrowImageView;
|
||||
}
|
||||
|
||||
- (UILabel *)nameLabel {
|
||||
if (!_nameLabel) {
|
||||
_nameLabel = [[UILabel alloc] init];
|
||||
_nameLabel.font = [UIFont systemFontOfSize:12];
|
||||
_nameLabel.textColor = [ThemeColor mainTextColor];
|
||||
_nameLabel.text = @"青少年模式中,暂无内容";
|
||||
}
|
||||
return _nameLabel;
|
||||
}
|
||||
|
||||
- (UILabel *)descLabel {
|
||||
if (!_descLabel) {
|
||||
_descLabel = [[UILabel alloc] init];
|
||||
_descLabel.font = [UIFont systemFontOfSize:12];
|
||||
_descLabel.textColor = [ThemeColor textThirdColor];
|
||||
_descLabel.text = @"已开启";
|
||||
}
|
||||
return _descLabel;
|
||||
}
|
||||
|
||||
@end
|
@@ -26,6 +26,8 @@ NS_ASSUME_NONNULL_BEGIN
|
||||
- (void)xpMineHeadViewClickAcount;
|
||||
///点击了贵族中心
|
||||
- (void)xPMineHeadViewCliekNobleCenter;
|
||||
///点击了青少年模式
|
||||
- (void)xPmineHeadViewClickTeenager;
|
||||
|
||||
@end
|
||||
@interface XPMineHeadView : UIView
|
||||
|
@@ -19,6 +19,7 @@
|
||||
#import "XPMineFriendNumberView.h"
|
||||
#import "XPNobleCenterEntranceView.h"
|
||||
#import "XPMineAccountView.h"
|
||||
#import "XPMineHeadTeenagerView.h"
|
||||
///Model
|
||||
#import "UserInfoModel.h"
|
||||
#import "WalletInfoModel.h"
|
||||
@@ -58,6 +59,8 @@
|
||||
///贵族中心
|
||||
@property (nonatomic, strong) XPNobleCenterEntranceView *nobleEntranceView;
|
||||
|
||||
@property (nonatomic, strong) XPMineHeadTeenagerView *teenagerView;
|
||||
|
||||
@end
|
||||
|
||||
@implementation XPMineHeadView
|
||||
@@ -170,6 +173,9 @@
|
||||
|
||||
#pragma mark - Action
|
||||
- (void)tapAvatarImageView {
|
||||
if (self.userInfo.parentMode) {
|
||||
return;
|
||||
}
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPMineHeadView:didClickAvatar:)]) {
|
||||
[self.delegate xPMineHeadView:self didClickAvatar:self.userInfo];
|
||||
}
|
||||
@@ -218,6 +224,13 @@
|
||||
}
|
||||
}
|
||||
|
||||
///青少年模式
|
||||
- (void)tapTeenagerView {
|
||||
if (self.delegate && [self.delegate respondsToSelector:@selector(xPmineHeadViewClickTeenager)]) {
|
||||
[self.delegate xPmineHeadViewClickTeenager];
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - NSMutableAttributedString
|
||||
-(NSInteger) getMonth:(long )time
|
||||
{
|
||||
@@ -431,6 +444,27 @@
|
||||
self.visitorView.number = [NSString stringWithFormat:@"%ld", _userInfo.visitNum];
|
||||
self.footprintView.number = [NSString stringWithFormat:@"%ld", _userInfo.inRoomNum];
|
||||
self.nobleEntranceView.vipInfo = userInfo.userVipInfoVO;
|
||||
if (userInfo.parentMode) {//青少年模式
|
||||
if (!self.teenagerView.superview) {
|
||||
[self addSubview:self.teenagerView];
|
||||
[self.teenagerView mas_makeConstraints:^(MASConstraintMaker *make) {
|
||||
make.top.mas_equalTo(self.levelLabel.mas_bottom).mas_offset(16);
|
||||
make.height.mas_equalTo(44);
|
||||
make.left.right.mas_equalTo(self).inset(16);
|
||||
}];
|
||||
}
|
||||
self.attentionStackView.hidden = YES;
|
||||
self.accountView.hidden = YES;
|
||||
self.nobleEntranceView.hidden = YES;
|
||||
self.skillCardButton.hidden = YES;
|
||||
} else {
|
||||
[self.teenagerView removeFromSuperview];
|
||||
self.teenagerView = nil;
|
||||
self.attentionStackView.hidden = NO;
|
||||
self.accountView.hidden = NO;
|
||||
self.nobleEntranceView.hidden = NO;
|
||||
self.skillCardButton.hidden = NO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -607,4 +641,15 @@
|
||||
return _nobleEntranceView;
|
||||
}
|
||||
|
||||
- (XPMineHeadTeenagerView *)teenagerView {
|
||||
if (!_teenagerView) {
|
||||
_teenagerView = [[XPMineHeadTeenagerView alloc] init];
|
||||
_teenagerView.layer.cornerRadius = 8;
|
||||
_teenagerView.layer.masksToBounds = YES;
|
||||
UITapGestureRecognizer * tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(tapTeenagerView)];
|
||||
[_teenagerView addGestureRecognizer:tap];
|
||||
}
|
||||
return _teenagerView;
|
||||
}
|
||||
|
||||
@end
|
||||
|
Reference in New Issue
Block a user