Files
peko-ios/YuMi/Modules/YMMine/View/MineInfo/XPMineUserInfoViewController.m

544 lines
21 KiB
Mathematica
Raw Normal View History

2023-07-14 18:50:55 +08:00
//
// MineInfoViewController.m
2023-08-10 16:25:34 +08:00
// xplan-ios
2023-07-14 18:50:55 +08:00
//
2023-08-10 16:25:34 +08:00
// Created by on 2021/9/22.
2023-07-14 18:50:55 +08:00
//
#import "XPMineUserInfoViewController.h"
///Third
#import <NIMSDK/NIMSDK.h>
#import <Masonry/Masonry.h>
#import <SDCycleScrollView/SDCycleScrollView.h>
#import <JXPagingView/JXPagerView.h>
#import <JXPagingView/JXPagerListRefreshView.h>
#import <JXCategoryView/JXCategoryView.h>
2023-08-10 16:25:34 +08:00
#import <AFNetworking.h>
#import <ReactiveObjC/ReactiveObjC.h>
2023-07-14 18:50:55 +08:00
///Tool
#import "AccountInfoStorage.h"
#import "TTPopup.h"
#import "XPSkillCardPlayerManager.h"
#import "UIImage+Utils.h"
2023-07-14 18:50:55 +08:00
///Model
#import "MineSkillCardListInfoModel.h"
#import "UserInfoModel.h"
2023-08-10 16:25:34 +08:00
#import "XPSoundCardModel.h"
#import "XPMineUserInfoTagModel.h"
#import "UploadFile.h"
2023-07-14 18:50:55 +08:00
///View
#import "XPMineUserInfoHeaderView.h"
#import "XPMineUserInfoCustomNavView.h"
2023-08-10 16:25:34 +08:00
#import "XPMineUserInfoIndividualTagView.h"
2023-07-14 18:50:55 +08:00
///P
#import "XPMineUserInfoPresenter.h"
#import "XPMineUserInfoProtocol.h"
#import "RoomHostDelegate.h"
///VC
#import "XPMineUserInfoEditViewController.h"
#import "XPWebViewController.h"
#import "SessionViewController.h"
#import "XPRoomViewController.h"
#import "XPMineUserDataViewController.h"
#import "XPMonentsMineViewController.h"
2023-08-10 16:25:34 +08:00
#import "XPGiftUserDataViewController.h"
2023-08-10 16:25:34 +08:00
#import "XPRoomMiniManager.h"
#import "XPMineUserInfoTagVC.h"
2023-07-14 18:50:55 +08:00
2024-06-25 15:08:14 +08:00
#import "XPMomentUserDataViewController.h"
2023-08-10 16:25:34 +08:00
UIKIT_EXTERN NSString * kUpdateSoundInfo;
@interface XPMineUserInfoViewController ()<
XPMineCustomNavViewDelegate, XPMineUserInfoProtocol, XPMineUserInfoHeaderViewDelegate, JXCategoryViewDelegate,JXPagerViewDelegate, JXPagerMainTableViewGestureDelegate,XPMineUserInfoEditViewControllerDelegate,XPMineUserInfoTagVCDelegate,XPMineUserInfoIndividualTagViewDelegate>
2023-07-14 18:50:55 +08:00
@property (nonatomic, strong) JXCategoryTitleView *titleView;
@property (nonatomic, strong) JXCategoryIndicatorImageView *lineView;
@property (nonatomic, strong) JXPagerView *pagingView;
@property (nonatomic, strong) NSArray<NSString *> *titles;
///
@property (nonatomic,strong) XPMineUserInfoHeaderView *headView;
///
@property (nonatomic,strong) XPMineUserInfoCustomNavView *navView;
///
@property (nonatomic,strong) UserInfoModel *userInfo;
///
@property (nonatomic,strong) UIStackView *bottomStackView;
///
@property (nonatomic,strong) UIButton *chatButton;
///
@property (nonatomic,strong) UIButton *attentionButton;
///
@property (nonatomic,strong) XPMineUserDataViewController *userDataVC;
2023-08-10 16:25:34 +08:00
///
@property (nonatomic,strong) XPGiftUserDataViewController *giftVC;
///
@property (nonatomic,strong) XPMineUserInfoEditViewController * editVC;
2023-08-10 16:25:34 +08:00
///
@property (nonatomic,strong) XPMineUserInfoTagModel *tagModel;
2024-06-25 15:08:14 +08:00
@property (nonatomic, strong) XPMomentUserDataViewController *userMomentVC;
2023-07-14 18:50:55 +08:00
@end
@implementation XPMineUserInfoViewController
- (void)dealloc {
2023-08-10 16:25:34 +08:00
[[NSNotificationCenter defaultCenter]removeObserver:self];
}
2023-07-14 18:50:55 +08:00
- (XPMineUserInfoPresenter *)createPresenter {
2023-08-10 16:25:34 +08:00
return [[XPMineUserInfoPresenter alloc] init];
2023-07-14 18:50:55 +08:00
}
- (BOOL)isHiddenNavBar {
2023-08-10 16:25:34 +08:00
return YES;
2023-07-14 18:50:55 +08:00
}
2023-08-10 16:25:34 +08:00
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
2023-07-14 18:50:55 +08:00
}
2023-08-10 16:25:34 +08:00
-(void)viewDidDisappear:(BOOL)animated{
[super viewDidAppear:animated];
[[XPSkillCardPlayerManager shareInstance] stopMusic];
}
2024-06-21 18:49:16 +08:00
2023-07-14 18:50:55 +08:00
- (void)viewWillAppear:(BOOL)animated {
2023-08-10 16:25:34 +08:00
[super viewWillAppear:animated];
if (self.uid > 0) {
[self initHttpRequest];
}
if([XPSkillCardPlayerManager shareInstance].isInRoom == YES && [XPSkillCardPlayerManager shareInstance].isInRoomFirstRecharge == NO){
[XPSkillCardPlayerManager shareInstance].isInRoomFirstRecharge = YES;
}
2023-07-14 18:50:55 +08:00
}
2023-08-10 16:25:34 +08:00
- (void)viewDidLoad {
[super viewDidLoad];
2024-06-21 18:49:16 +08:00
self.view.backgroundColor = [UIColor colorWithWhite:0 alpha:0.5];
2023-08-10 16:25:34 +08:00
[self initSubViews];
[self initSubViewConstraints];
2023-07-14 18:50:55 +08:00
}
- (void)viewDidLayoutSubviews {
2023-08-10 16:25:34 +08:00
[super viewDidLayoutSubviews];
self.pagingView.frame = self.view.bounds;
2023-07-14 18:50:55 +08:00
}
#pragma mark - Private Method
- (void)initSubViews {
2023-08-10 16:25:34 +08:00
[self.view addSubview:self.pagingView];
[self.view addSubview:self.navView];
if (self.uid != [AccountInfoStorage instance].getUid.integerValue) {
[self.view addSubview:self.bottomStackView];
[self.bottomStackView addArrangedSubview:self.chatButton];
[self.bottomStackView addArrangedSubview:self.attentionButton];
[self.bottomStackView mas_makeConstraints:^(MASConstraintMaker *make) {
2024-04-11 17:05:27 +08:00
make.leading.trailing.mas_equalTo(self.view).inset(15);
2023-08-10 16:25:34 +08:00
make.height.mas_equalTo(45);
make.bottom.mas_equalTo(self.view).offset(-kSafeAreaBottomHeight - 15);
}];
}
2023-07-14 18:50:55 +08:00
}
- (void)initSubViewConstraints {
2023-08-10 16:25:34 +08:00
[self.navView mas_makeConstraints:^(MASConstraintMaker *make) {
2024-04-11 17:05:27 +08:00
make.leading.trailing.top.mas_equalTo(self.view);
2023-08-10 16:25:34 +08:00
make.height.mas_equalTo(kNavigationHeight);
}];
2023-07-14 18:50:55 +08:00
}
- (void)initHttpRequest {
2023-08-10 16:25:34 +08:00
NSString *uid = [NSString stringWithFormat:@"%ld", self.uid];
[self.presenter getUserInfoWithUid:uid];
[self.presenter getUserAttentionState:uid];
2023-08-10 16:25:34 +08:00
// 使
[self.presenter getUserDetailInfoWithUid:uid];
2023-07-14 18:50:55 +08:00
///访
2023-08-10 16:25:34 +08:00
if (![uid isEqualToString:[[AccountInfoStorage instance] getUid]]) {
[self.presenter visitUser:uid];
2023-07-14 18:50:55 +08:00
}
}
#pragma mark -
2023-08-10 16:25:34 +08:00
- (BOOL)isSystemAccount {
return [KeyWithType(KeyType_SecretaryUidKey) isEqualToString:[NSString stringWithFormat:@"%ld", self.uid]] || [KeyWithType(KeyType_SystemNotifiUidKey) isEqualToString:[NSString stringWithFormat:@"%ld", self.uid]] || [KeyWithType(KeyType_GuildUidKey) isEqualToString:[NSString stringWithFormat:@"%ld", self.uid]];
}
2023-07-14 18:50:55 +08:00
2023-08-10 16:25:34 +08:00
- (void)showRightNavHandle {
NSMutableArray<TTActionSheetConfig *> *array = [NSMutableArray array];
NSString *uid = [NSString stringWithFormat:@"%ld",self.uid];
TTActionSheetConfig *report = [TTActionSheetConfig normalTitle:YMLocalizedString(@"XPMineUserInfoViewController0") clickAction:^{
XPWebViewController *vc = [[XPWebViewController alloc]init];
NSString *urlstr = [NSString stringWithFormat:@"%@?reportUid=%@&source=PERSONAL",URLWithType(kReportRoomURL),uid];
vc.url = urlstr;
[self.navigationController pushViewController:vc animated:YES];
}];
2023-08-10 16:25:34 +08:00
TTActionSheetConfig *black = [TTActionSheetConfig normalTitle:YMLocalizedString(@"XPMineUserInfoViewController1") clickAction:^{
[self addOrRemoveBlack:NO uid:uid];
}];
2023-08-10 16:25:34 +08:00
[array addObjectsFromArray:@[report, black]];
2023-08-10 16:25:34 +08:00
BOOL isInBlackList = [[NIMSDK sharedSDK].userManager isUserInBlackList:uid] || [self isSystemAccount];
if (isInBlackList) {
[array removeObject:black];
}
[TTPopup actionSheetWithItems:array];
2023-07-14 18:50:55 +08:00
}
//
- (void)addOrRemoveBlack:(BOOL)isRemove uid:(NSString *)uid {
2023-08-10 16:25:34 +08:00
NSString *title;
NSString *message;
if (isRemove) {
title = YMLocalizedString(@"XPMineUserInfoViewController2");
message = YMLocalizedString(@"XPMineUserInfoViewController3");
}else{
title = YMLocalizedString(@"XPMineUserInfoViewController4");
message = YMLocalizedString(@"XPMineUserInfoViewController5");
}
2023-08-10 16:25:34 +08:00
TTAlertConfig *config = [[TTAlertConfig alloc] init];
config.title = title;
config.message = message;
2023-08-10 16:25:34 +08:00
[TTPopup alertWithConfig:config confirmHandler:^{
if (isRemove) {
[[NIMSDK sharedSDK].userManager removeFromBlackBlackList:uid completion:^(NSError * _Nullable error) {
if (error == nil) {
[self showSuccessToast:YMLocalizedString(@"XPMineUserInfoViewController6")];
}
}];
} else {
[[NIMSDK sharedSDK].userManager addToBlackList:uid completion:^(NSError * _Nullable error) {
if (error == nil) {
[self showSuccessToast:YMLocalizedString(@"XPMineUserInfoViewController7")];
}
}];
}
} cancelHandler:^{
}];
2023-07-14 18:50:55 +08:00
}
#pragma mark - JXCategoryViewDelegate
- (NSUInteger)tableHeaderViewHeightInPagerView:(JXPagerView *)pagerView {
return 500; //358;
2023-07-14 18:50:55 +08:00
}
- (UIView *)tableHeaderViewInPagerView:(JXPagerView *)pagerView {
2023-08-10 16:25:34 +08:00
return self.headView;
2023-07-14 18:50:55 +08:00
}
- (NSUInteger)heightForPinSectionHeaderInPagerView:(JXPagerView *)pagerView {
2023-08-10 16:25:34 +08:00
return 50;
2023-07-14 18:50:55 +08:00
}
- (UIView *)viewForPinSectionHeaderInPagerView:(JXPagerView *)pagerView {
2023-08-10 16:25:34 +08:00
return self.titleView;
2023-07-14 18:50:55 +08:00
}
- (NSInteger)numberOfListsInPagerView:(JXPagerView *)pagerView {
2023-08-10 16:25:34 +08:00
return self.titles.count;
2023-07-14 18:50:55 +08:00
}
- (id<JXPagerViewListViewDelegate>)pagerView:(JXPagerView *)pagerView initListAtIndex:(NSInteger)index {
if(isMSRTL()){
if (index == 1) {
return self.userDataVC;
}
2024-06-25 15:08:14 +08:00
return self.userMomentVC;
// return self.giftVC;
}
2023-08-10 16:25:34 +08:00
if (index == 0) {
return self.userDataVC;
}
2024-06-25 15:08:14 +08:00
return self.userMomentVC;
// return self.giftVC;
2023-07-14 18:50:55 +08:00
}
#pragma mark - JXPagerMainTableViewGestureDelegate
- (BOOL)mainTableViewGestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldRecognizeSimultaneouslyWithGestureRecognizer:(UIGestureRecognizer *)otherGestureRecognizer {
2023-08-10 16:25:34 +08:00
///1000scrollView 1001collectionView
if (otherGestureRecognizer.view.tag == 1005 || otherGestureRecognizer.view.tag == 1009) {
return NO;
}
return [gestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]] && [otherGestureRecognizer isKindOfClass:[UIPanGestureRecognizer class]];
2023-07-14 18:50:55 +08:00
}
#pragma mark - XPMineCustomNavViewDelegate
- (void)xPMineCustomNavView:(XPMineUserInfoCustomNavView *)view didClickEditButton:(UIButton *)sender {
2023-08-10 16:25:34 +08:00
if (sender.isSelected) {///
self.editVC.area = self.userInfo.region;
[self.navigationController pushViewController:self.editVC animated:YES];
} else {
[self showRightNavHandle];
}
2023-07-14 18:50:55 +08:00
}
- (void)xPMineCustomNavView:(XPMineUserInfoCustomNavView *)view didClickBackButton:(UIButton *)sender {
2023-08-10 16:25:34 +08:00
[self.navigationController popViewControllerAnimated:YES];
2023-07-14 18:50:55 +08:00
}
#pragma mark - XPMineUserInfoHeaderViewDelegate
- (void)xPMineUserInfoHeaderView:(XPMineUserInfoHeaderView *)view didClickGoToRoom:(NSString *)roomUid {
2023-08-10 16:25:34 +08:00
if (roomUid.length > 0 ) {
if(roomUid.integerValue == [XPSkillCardPlayerManager shareInstance].roomUid.integerValue && [XPRoomMiniManager shareManager].getRoomInfo == nil){
[self.navigationController popViewControllerAnimated:YES];
return;
}
//退 TODO
[self.navigationController.viewControllers enumerateObjectsUsingBlock:^(__kindof UIViewController * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
if ([obj isKindOfClass:[XPRoomViewController class]]) {
[self.navigationController popToRootViewControllerAnimated:NO];
XPRoomViewController<RoomHostDelegate> * rooomVC = obj;
[rooomVC exitRoom];
*stop = YES;
}
}];
[XPRoomViewController openRoom:roomUid viewController:self];
}
}
2023-08-10 16:25:34 +08:00
#pragma mark - XPMineUserInfoIndividualTagView
- (void)didClickGotoEditVC{
2023-08-10 16:25:34 +08:00
XPMineUserInfoTagVC *tagVC =[XPMineUserInfoTagVC new];
tagVC.tagModel = self.tagModel;
tagVC.delegate = self;
[self.navigationController pushViewController:tagVC animated:YES];
}
#pragma mark- XPMineUserInfoTagVCDelegate
- (void)xPMineUserInfoTagVC:(XPMineUserInfoTagVC *)vc didClickComplete:(NSArray *)meLabels{
self.headView.tagModel = self.tagModel;
2023-07-14 18:50:55 +08:00
}
#pragma mark - XPMineUserInfoProtocol
- (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo {
2023-08-10 16:25:34 +08:00
self.userInfo = userInfo;
self.headView.userInfo = userInfo;
XPMineUserInfoTagModel *tagModel = [XPMineUserInfoTagModel new];
tagModel.meLabels = userInfo.labels;
self.tagModel = tagModel;
self.editVC.tagModel = tagModel;
self.headView.tagModel = tagModel;
self.userDataVC.userInfo = userInfo;
if(isMSRTL()){
[self.titleView selectItemAtIndex:1];
}
2023-07-14 18:50:55 +08:00
}
- (void)ongetDetailInfoSuccess:(UserInfoModel *)userInfo {
2023-08-10 16:25:34 +08:00
self.userDataVC.dynamicInfo = userInfo.dynamicInfo;
2024-06-25 15:08:14 +08:00
self.userDataVC.medalInfo = userInfo.medals;
self.userMomentVC.dynamicInfo = userInfo.dynamicInfo;
2023-08-10 16:25:34 +08:00
self.headView.roomUid = userInfo.roomUid;
self.giftVC.userInfo = userInfo;
2023-07-14 18:50:55 +08:00
}
- (void)getAttentionStateSuccess:(BOOL)status {
2023-08-10 16:25:34 +08:00
self.attentionButton.selected = status;
2023-07-14 18:50:55 +08:00
}
- (void)attentionUserSuccess:(BOOL)status {
2023-08-10 16:25:34 +08:00
self.attentionButton.selected = status;
2023-07-14 18:50:55 +08:00
}
2023-08-10 16:25:34 +08:00
#pragma mark -XPMineUserInfoEditViewController
2023-08-10 16:25:34 +08:00
- (void)xPMineUserInfoEditViewControllerC:(XPMineUserInfoEditViewController *)vc didClickComplete:(NSString *)meLabels{
self.headView.tagModel = self.tagModel;
}
- (void)xPMineUserInfoEditViewControllerC:(XPMineUserInfoEditViewController *)vc didClickCompleteArea:(NSString *)area{
self.userInfo.region = area;
self.userDataVC.userInfo = self.userInfo;
}
2023-07-14 18:50:55 +08:00
#pragma mark - Event Response
- (void)chatButtonAction:(UIButton *)sender {
2023-08-10 16:25:34 +08:00
NSString * sessionId = [NSString stringWithFormat:@"%ld",self.uid];
NIMSession * session = [NIMSession session:sessionId type:NIMSessionTypeP2P];
SessionViewController * sessionVC = [[SessionViewController alloc] initWithSession:session];
[self.navigationController pushViewController:sessionVC animated:YES];
2023-07-14 18:50:55 +08:00
}
- (void)attentionButtonAction:(UIButton *)sender {
2023-08-10 16:25:34 +08:00
NSString *uid = [NSString stringWithFormat:@"%ld", self.uid];
[self.presenter attentionUser:uid state:!sender.selected];
2023-07-14 18:50:55 +08:00
}
#pragma mark - Getters And Setters
- (void)setUid:(NSInteger)uid {
2023-08-10 16:25:34 +08:00
_uid = uid;
if (_uid > 0) {
if (_uid == [AccountInfoStorage instance].getUid.integerValue) {
[self.navView.editButton setImage:[UIImage imageNamed:@"mine_user_info_edit_self"] forState:UIControlStateNormal];
} else {
2023-08-10 16:25:34 +08:00
[self.navView.editButton setImage:[UIImage imageNamed:@"mine_user_info_edit"] forState:UIControlStateNormal];
}
self.navView.editButton.selected = _uid == [AccountInfoStorage instance].getUid.integerValue;
NSString * uidStr = [NSString stringWithFormat:@"%ld", uid];
self.userDataVC.userUid = uidStr;
self.giftVC.userUid = uidStr;
[self.presenter getUserInfoWithUid:uidStr];
self.editVC.uid = uidStr;
}
2023-07-14 18:50:55 +08:00
}
- (XPMineUserInfoHeaderView *)headView {
2023-08-10 16:25:34 +08:00
if (!_headView) {
_headView = [[XPMineUserInfoHeaderView alloc] init];
_headView.delegate = self;
}
return _headView;
2023-07-14 18:50:55 +08:00
}
- (XPMineUserInfoCustomNavView *)navView {
2023-08-10 16:25:34 +08:00
if (!_navView) {
_navView = [[XPMineUserInfoCustomNavView alloc] init];
_navView.delegate = self;
}
return _navView;
2023-07-14 18:50:55 +08:00
}
- (UIStackView *)bottomStackView {
2023-08-10 16:25:34 +08:00
if (!_bottomStackView) {
_bottomStackView = [[UIStackView alloc] init];
_bottomStackView.axis = UILayoutConstraintAxisHorizontal;
_bottomStackView.distribution = UIStackViewDistributionFillEqually;
_bottomStackView.alignment = UIStackViewAlignmentFill;
_bottomStackView.spacing = 25;
}
return _bottomStackView;
2023-07-14 18:50:55 +08:00
}
- (UIButton *)chatButton {
2023-08-10 16:25:34 +08:00
if (!_chatButton) {
_chatButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_chatButton setTitle:YMLocalizedString(@"XPMineUserInfoViewController8") forState:UIControlStateNormal];
[_chatButton setTitleColor:UIColorFromRGB(0x9168FA) forState:UIControlStateNormal];
2023-08-10 16:25:34 +08:00
_chatButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
[_chatButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xCCF8F9),UIColorFromRGB(0xDEE4FF),UIColorFromRGB(0xEEDCFF)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
UIImage *lineImage = [UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor],[DJDKMIMOMColor confirmButtonGradientMiddleColor],[DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake((KScreenWidth - 30 - 25) / 2, 45)];
UIColor *lineColor = [UIColor colorWithPatternImage:lineImage];
_chatButton.layer.borderWidth = 1;
_chatButton.layer.borderColor = lineColor.CGColor;
_chatButton.layer.masksToBounds = YES;
_chatButton.layer.cornerRadius = 45/2;
[_chatButton addTarget:self action:@selector(chatButtonAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _chatButton;
2023-07-14 18:50:55 +08:00
}
- (UIButton *)attentionButton {
2023-08-10 16:25:34 +08:00
if (!_attentionButton) {
_attentionButton = [UIButton buttonWithType:UIButtonTypeCustom];
[_attentionButton setTitle:YMLocalizedString(@"XPMineUserInfoViewController9") forState:UIControlStateNormal];
[_attentionButton setTitle:YMLocalizedString(@"XPMineUserInfoViewController10") forState:UIControlStateSelected];
[_attentionButton setTitleColor:[UIColor whiteColor] forState:UIControlStateNormal];
[_attentionButton setTitleColor:UIColorFromRGB(0xB3B3C3) forState:UIControlStateSelected];
_attentionButton.titleLabel.font = [UIFont systemFontOfSize:16 weight:UIFontWeightMedium];
[_attentionButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[[DJDKMIMOMColor confirmButtonGradientStartColor],[DJDKMIMOMColor confirmButtonGradientMiddleColor],[DJDKMIMOMColor confirmButtonGradientEndColor]] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateNormal];
[_attentionButton setBackgroundImage:[UIImage gradientColorImageFromColors:@[UIColorFromRGB(0xE6E6F0),UIColorFromRGB(0xE6E6F0),UIColorFromRGB(0xE6E6F0)] gradientType:GradientTypeLeftToRight imgSize:CGSizeMake(10, 10)] forState:UIControlStateSelected];
_attentionButton.layer.masksToBounds = YES;
_attentionButton.layer.cornerRadius = 45/2;
[_attentionButton addTarget:self action:@selector(attentionButtonAction:) forControlEvents:UIControlEventTouchUpInside];
}
return _attentionButton;
2023-07-14 18:50:55 +08:00
}
- (JXCategoryTitleView *)titleView {
2023-08-10 16:25:34 +08:00
if (!_titleView) {
_titleView = [[JXCategoryTitleView alloc] init];
_titleView.delegate = self;
_titleView.backgroundColor = [UIColor clearColor];
2024-06-24 19:11:54 +08:00
_titleView.titleColor = UIColorRGBAlpha(0x191919, 0.5);
_titleView.titleSelectedColor = UIColorFromRGB(0x191919);
2024-06-24 14:06:31 +08:00
_titleView.titleFont = [UIFont systemFontOfSize:18 weight:UIFontWeightBold];
_titleView.titleSelectedFont = [UIFont systemFontOfSize:18 weight:UIFontWeightBold];
2023-08-10 16:25:34 +08:00
_titleView.titleLabelAnchorPointStyle = JXCategoryTitleLabelAnchorPointStyleCenter;
_titleView.contentScrollViewClickTransitionAnimationEnabled = NO;
_titleView.defaultSelectedIndex = 0;
_titleView.averageCellSpacingEnabled = NO;
_titleView.contentEdgeInsetLeft = 20;
_titleView.titles = self.titles;
_titleView.cellSpacing = 20;
_titleView.titles = self.titles;
_titleView.listContainer = (id<JXCategoryViewListContainer>)self.pagingView.listContainerView;
JXCategoryIndicatorImageView *lineView = [[JXCategoryIndicatorImageView alloc] init];
lineView.indicatorImageViewSize = CGSizeMake(37, 8);
lineView.verticalMargin = 15;
lineView.indicatorImageView.layer.masksToBounds = YES;
lineView.indicatorImageView.layer.cornerRadius = 3;
lineView.indicatorImageView.image = [UIImage imageNamed:@"mine_dynamic"];
_titleView.indicators = @[lineView];
}
return _titleView;
2023-07-14 18:50:55 +08:00
}
- (JXPagerView *)pagingView {
2023-08-10 16:25:34 +08:00
if (!_pagingView) {
_pagingView = [[JXPagerView alloc] initWithDelegate:self];
_pagingView.backgroundColor = [UIColor clearColor];
_pagingView.listContainerView.backgroundColor = [UIColor clearColor];
_pagingView.mainTableView.backgroundColor = [UIColor clearColor];
_pagingView.listContainerView.listCellBackgroundColor = UIColor.clearColor;
_pagingView.mainTableView.gestureDelegate = self;
}
return _pagingView;
2023-07-14 18:50:55 +08:00
}
- (NSArray<NSString *> *)titles {
2023-08-10 16:25:34 +08:00
if (!_titles) {
2024-06-24 14:06:31 +08:00
_titles = @[YMLocalizedString(@"XPMineUserInfoViewController11"),
@"动态"
// YMLocalizedString(@"XPMineUserInfoViewController13")
];
2023-08-10 16:25:34 +08:00
}
return _titles;
2023-07-14 18:50:55 +08:00
}
- (XPMineUserDataViewController *)userDataVC {
2023-08-10 16:25:34 +08:00
if (!_userDataVC) {
_userDataVC = [[XPMineUserDataViewController alloc] init];
_userDataVC.delegate = self;
}
return _userDataVC;
2023-07-14 18:50:55 +08:00
}
2024-06-25 15:08:14 +08:00
- (XPMomentUserDataViewController *)userMomentVC {
if (!_userMomentVC) {
_userMomentVC = [[XPMomentUserDataViewController alloc] init];
}
return _userMomentVC;
}
2023-08-10 16:25:34 +08:00
-(XPGiftUserDataViewController *)giftVC{
if (!_giftVC){
_giftVC = [XPGiftUserDataViewController new];
}
return _giftVC;
}
- (XPMineUserInfoEditViewController *)editVC{
if (!_editVC){
_editVC = [XPMineUserInfoEditViewController new];
_editVC.delegate = self;
}
return _editVC;
}
2023-07-14 18:50:55 +08:00
@end