2021-09-16 19:30:22 +08:00
|
|
|
|
//
|
|
|
|
|
// XPMineViewController.m
|
|
|
|
|
// xplan-ios
|
|
|
|
|
//
|
|
|
|
|
// Created by 冯硕 on 2021/9/16.
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
#import "XPMineViewController.h"
|
|
|
|
|
///Third
|
|
|
|
|
#import <Masonry/Masonry.h>
|
2021-09-17 19:41:09 +08:00
|
|
|
|
#import <flutter_boost/FlutterBoost.h>
|
2021-09-16 19:30:22 +08:00
|
|
|
|
///Tool
|
2022-01-21 19:47:46 +08:00
|
|
|
|
#import "TTPopup.h"
|
2021-09-16 19:30:22 +08:00
|
|
|
|
#import "XPMacro.h"
|
2021-09-17 19:41:09 +08:00
|
|
|
|
#import "XPHtmlUrl.h"
|
|
|
|
|
#import "UIButton+EnlargeTouchArea.h"
|
2022-01-11 11:28:04 +08:00
|
|
|
|
#import "StatisticsServiceHelper.h"
|
2022-01-26 15:51:19 +08:00
|
|
|
|
#import "XPConstant.h"
|
2022-01-21 19:47:46 +08:00
|
|
|
|
#import "Api+Room.h"
|
2022-07-26 19:09:14 +08:00
|
|
|
|
#import "Api+RoomSetting.h"
|
|
|
|
|
#import "AccountInfoStorage.h"
|
2022-07-29 17:09:01 +08:00
|
|
|
|
#import "ClientConfig.h"
|
2022-12-29 19:03:03 +08:00
|
|
|
|
#import "NSMutableDictionary+Saft.h"
|
2021-09-16 19:30:22 +08:00
|
|
|
|
///Model
|
|
|
|
|
#import "XPMineItemModel.h"
|
2021-09-23 18:38:33 +08:00
|
|
|
|
#import "UserInfoModel.h"
|
2022-01-26 15:51:19 +08:00
|
|
|
|
#import "XPMineVisitorUnReadModel.h"
|
2022-04-14 00:35:31 +08:00
|
|
|
|
#import "ClanDetailInfoModel.h"
|
2022-07-22 18:48:23 +08:00
|
|
|
|
#import "HomeBannerInfoModel.h"
|
|
|
|
|
#import "XPMineFuntionItemModel.h"
|
|
|
|
|
#import "LittleGameInfoModel.h"
|
|
|
|
|
#import "WalletInfoModel.h"
|
2022-07-26 19:09:14 +08:00
|
|
|
|
#import "HomeLittleGameRoomModel.h"
|
2022-07-27 15:11:11 +08:00
|
|
|
|
#import "NobleCenterModel.h"
|
2021-09-16 19:30:22 +08:00
|
|
|
|
///P
|
|
|
|
|
#import "XPMineProtocol.h"
|
|
|
|
|
#import "XPMinePresent.h"
|
|
|
|
|
///View
|
2022-01-19 16:04:46 +08:00
|
|
|
|
#import "XPMineHeadItemTableViewCell.h"
|
2021-09-16 19:30:22 +08:00
|
|
|
|
#import "XPMineHeadView.h"
|
2022-01-21 19:47:46 +08:00
|
|
|
|
#import "XPLittleGameRoomOpenView.h"
|
2022-07-22 18:48:23 +08:00
|
|
|
|
#import "XPMineGameTableViewCell.h"
|
|
|
|
|
#import "XPHomeBannerTableViewCell.h"
|
2022-07-28 15:24:42 +08:00
|
|
|
|
#import "XPMineNewUserRechargeView.h"
|
2021-09-17 19:41:09 +08:00
|
|
|
|
///VC
|
|
|
|
|
#import "XPMineSettingViewController.h"
|
2021-09-22 18:30:15 +08:00
|
|
|
|
#import "XPMineTeenagerViewController.h"
|
2021-09-23 18:38:33 +08:00
|
|
|
|
#import "XPMineUserInfoViewController.h"
|
2021-09-24 19:17:19 +08:00
|
|
|
|
#import "XPMineRechargeViewController.h"
|
2021-09-17 19:41:09 +08:00
|
|
|
|
#import "XPWebViewController.h"
|
2021-10-14 21:10:04 +08:00
|
|
|
|
#import "XPRoomViewController.h"
|
2021-12-16 19:02:31 +08:00
|
|
|
|
#import "XPMineDressUpViewController.h"
|
2022-07-29 15:26:33 +08:00
|
|
|
|
#import "XPDressUpShopViewController.h"
|
2021-12-21 18:10:33 +08:00
|
|
|
|
#import "XPMineFansViewController.h"
|
|
|
|
|
#import "XPMineAttentionViewController.h"
|
2021-12-28 17:32:27 +08:00
|
|
|
|
#import "XPNobleCenterViewController.h"
|
2022-01-19 16:04:46 +08:00
|
|
|
|
#import "XPMatchManageViewController.h"
|
2022-01-19 18:58:30 +08:00
|
|
|
|
#import "XPSkillCardViewController.h"
|
2022-01-26 11:51:06 +08:00
|
|
|
|
#import "XPMineVisitorViewController.h"
|
2022-04-08 16:16:38 +08:00
|
|
|
|
#import "XPMineFansTeamViewController.h"
|
2022-04-06 21:52:38 +08:00
|
|
|
|
#import "XPMineClanViewController.h"
|
2022-04-14 00:35:31 +08:00
|
|
|
|
#import "XPMineGuildViewController.h"
|
2022-07-26 11:08:01 +08:00
|
|
|
|
#import "XPMineFootPrintViewController.h"
|
2022-07-27 15:51:09 +08:00
|
|
|
|
#import "XPMineCollectRoomListViewController.h"
|
2022-07-29 18:56:08 +08:00
|
|
|
|
#import "XPNewUserRechargeViewController.h"
|
2022-01-19 16:04:46 +08:00
|
|
|
|
|
2022-07-22 18:48:23 +08:00
|
|
|
|
@interface XPMineViewController ()<UITableViewDelegate, UITableViewDataSource, XPMineProtocol, XPMineHeadItemTableViewCellDelegate, XPMineHeadViewDelegate, XPMineGameTableViewCellDelegate, XPHomeBannerTableViewCellDelegate>
|
2022-01-19 16:04:46 +08:00
|
|
|
|
///顶部背景
|
|
|
|
|
@property (nonatomic, strong) UIView *bgImageView;
|
2021-09-22 18:30:15 +08:00
|
|
|
|
|
2021-09-16 19:30:22 +08:00
|
|
|
|
@property (nonatomic,strong) UITableView *tableView;
|
2022-07-22 18:48:23 +08:00
|
|
|
|
///个人功能
|
|
|
|
|
@property (nonatomic, strong) NSMutableArray<XPMineFuntionItemModel *> *functionArray;
|
|
|
|
|
///游戏列表
|
|
|
|
|
@property (nonatomic, strong) NSMutableArray<LittleGameInfoModel *> *littleGameArray;
|
|
|
|
|
///banner列表
|
|
|
|
|
@property (nonatomic, strong) NSMutableArray<HomeBannerInfoModel *> *bannerArray;
|
2021-09-16 19:30:22 +08:00
|
|
|
|
///头部
|
|
|
|
|
@property (nonatomic,strong) XPMineHeadView *headView;
|
|
|
|
|
///设置
|
|
|
|
|
@property (nonatomic,strong) UIButton *settingButton;
|
2022-04-14 00:35:31 +08:00
|
|
|
|
///用户信息
|
2021-09-18 20:05:02 +08:00
|
|
|
|
@property (nonatomic,strong) UserInfoModel *userInfo;
|
2022-04-14 00:35:31 +08:00
|
|
|
|
///家族信息
|
|
|
|
|
@property (nonatomic,strong) ClanDetailInfoModel *clanInfo;
|
|
|
|
|
///我的公会
|
|
|
|
|
@property (nonatomic,strong) XPMineItemModel *guildItemModel;
|
2022-07-28 15:24:42 +08:00
|
|
|
|
///新用户充值优惠入口
|
|
|
|
|
@property (nonatomic, strong) XPMineNewUserRechargeView *userRechargeView;
|
|
|
|
|
|
2021-09-16 19:30:22 +08:00
|
|
|
|
@end
|
|
|
|
|
|
|
|
|
|
@implementation XPMineViewController
|
|
|
|
|
|
2022-01-26 15:51:19 +08:00
|
|
|
|
|
|
|
|
|
- (void)dealloc {
|
|
|
|
|
[[NSNotificationCenter defaultCenter] removeObserver:self];
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-16 19:30:22 +08:00
|
|
|
|
- (BOOL)isHiddenNavBar {
|
|
|
|
|
return YES;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (XPMinePresent *)createPresenter {
|
|
|
|
|
return [[XPMinePresent alloc] init];;
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-26 15:51:19 +08:00
|
|
|
|
- (instancetype)init {
|
|
|
|
|
if (self = [super init]) {
|
|
|
|
|
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(onVisitorUnReadCountUpdate:) name:kVisitorUnReadCountNotificationKey object:nil];
|
|
|
|
|
}
|
|
|
|
|
return self;
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-16 19:30:22 +08:00
|
|
|
|
- (void)viewDidLoad {
|
2021-09-22 18:30:15 +08:00
|
|
|
|
[super viewDidLoad];
|
2021-09-16 19:30:22 +08:00
|
|
|
|
[self initSubViews];
|
|
|
|
|
[self initSubViewConstraints];
|
2022-08-05 13:04:10 +08:00
|
|
|
|
self.tableView.contentInsetAdjustmentBehavior = UIScrollViewContentInsetAdjustmentNever;
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)viewWillAppear:(BOOL)animated {
|
|
|
|
|
[super viewWillAppear:animated];
|
2022-08-08 13:15:04 +08:00
|
|
|
|
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_recharge_card_show];
|
|
|
|
|
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_noble_card_show];
|
2022-07-22 18:48:23 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)viewDidAppear:(BOOL)animated {
|
|
|
|
|
[super viewDidAppear:animated];
|
2022-08-02 17:06:46 +08:00
|
|
|
|
[self.presenter getUserInfo];
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma mark - Response
|
|
|
|
|
- (void)settingButtonAction:(UIButton *)sender {
|
2021-09-17 19:41:09 +08:00
|
|
|
|
XPMineSettingViewController * settingVC = [[XPMineSettingViewController alloc] init];
|
2021-09-18 20:05:02 +08:00
|
|
|
|
settingVC.userInfo = self.userInfo;
|
2021-09-17 19:41:09 +08:00
|
|
|
|
[self.navigationController pushViewController:settingVC animated:YES];
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma mark - Private Method
|
|
|
|
|
- (void)initSubViews {
|
2022-01-19 16:04:46 +08:00
|
|
|
|
[self.view addSubview:self.bgImageView];
|
2021-09-16 19:30:22 +08:00
|
|
|
|
[self.view addSubview:self.tableView];
|
|
|
|
|
[self.view addSubview:self.settingButton];
|
|
|
|
|
self.tableView.tableHeaderView = self.headView;
|
2022-01-19 16:29:07 +08:00
|
|
|
|
if (@available(iOS 15.0, *)) {//移除iOS15列表头默认增加的22高度
|
|
|
|
|
self.tableView.sectionHeaderTopPadding = 0;
|
|
|
|
|
}
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)initSubViewConstraints {
|
2022-01-19 16:04:46 +08:00
|
|
|
|
[self.bgImageView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.left.right.top.mas_equalTo(0);
|
|
|
|
|
}];
|
2021-09-16 19:30:22 +08:00
|
|
|
|
[self.settingButton mas_makeConstraints:^(MASConstraintMaker *make) {
|
2022-08-05 00:33:58 +08:00
|
|
|
|
make.size.mas_equalTo(CGSizeMake(21, 21));
|
2021-09-16 19:30:22 +08:00
|
|
|
|
make.right.mas_equalTo(self.view).offset(-14);
|
|
|
|
|
make.top.mas_equalTo(self.view).offset(kSafeAreaTopHeight + 29);
|
|
|
|
|
}];
|
|
|
|
|
|
|
|
|
|
[self.tableView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.top.mas_equalTo(self.view);
|
|
|
|
|
make.left.right.bottom.mas_equalTo(self.view);
|
|
|
|
|
}];
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-22 18:48:23 +08:00
|
|
|
|
- (void)pushViewControllerWithType:(NSInteger)type functionItem:(XPMineFuntionItemModel *)item {
|
2021-09-16 19:30:22 +08:00
|
|
|
|
switch (type) {
|
2022-01-19 16:04:46 +08:00
|
|
|
|
case XPMineItemType_Match_Manage: {
|
|
|
|
|
XPMatchManageViewController *vc = [[XPMatchManageViewController alloc] init];
|
|
|
|
|
[self.navigationController pushViewController:vc animated:YES];
|
|
|
|
|
}
|
|
|
|
|
break;
|
2021-09-16 19:30:22 +08:00
|
|
|
|
case XPMineItemType_Match_Relevance_Account:
|
2022-07-22 18:48:23 +08:00
|
|
|
|
[self pushWebViewWIthUrl:item.centerUrl];
|
2021-09-16 19:30:22 +08:00
|
|
|
|
break;
|
2022-07-26 11:08:01 +08:00
|
|
|
|
case XPMineItemType_Foot_Print:
|
|
|
|
|
{
|
|
|
|
|
XPMineFootPrintViewController *vc = [[XPMineFootPrintViewController alloc] init];
|
|
|
|
|
[self.navigationController pushViewController:vc animated:YES];
|
|
|
|
|
}
|
|
|
|
|
break;
|
2021-09-16 19:30:22 +08:00
|
|
|
|
case XPMineItemType_Teenager_Mode:
|
2021-09-22 18:30:15 +08:00
|
|
|
|
{
|
|
|
|
|
XPMineTeenagerViewController * vc = [[XPMineTeenagerViewController alloc] init];
|
|
|
|
|
vc.userInfo = self.userInfo;
|
|
|
|
|
[self.navigationController pushViewController:vc animated:YES];
|
|
|
|
|
}
|
2021-09-16 19:30:22 +08:00
|
|
|
|
break;
|
2021-09-17 19:41:09 +08:00
|
|
|
|
case XPMineItemType_Account:
|
2021-09-24 19:17:19 +08:00
|
|
|
|
{
|
2021-10-25 10:22:40 +08:00
|
|
|
|
XPMineRechargeViewController * rechargeVC = [[XPMineRechargeViewController alloc] init];
|
|
|
|
|
[self.navigationController pushViewController:rechargeVC animated:YES];
|
2021-09-24 19:17:19 +08:00
|
|
|
|
}
|
2021-09-17 19:41:09 +08:00
|
|
|
|
break;
|
|
|
|
|
case XPMineItemType_Personinfo:
|
2021-09-23 18:38:33 +08:00
|
|
|
|
{
|
|
|
|
|
XPMineUserInfoViewController * infoVC = [[XPMineUserInfoViewController alloc] init];
|
|
|
|
|
infoVC.uid = self.userInfo.uid;
|
|
|
|
|
[self.navigationController pushViewController:infoVC animated:YES];
|
|
|
|
|
}
|
2021-09-16 19:30:22 +08:00
|
|
|
|
break;
|
2021-11-04 15:27:11 +08:00
|
|
|
|
case XPMineItemType_My_Room:
|
|
|
|
|
{
|
|
|
|
|
NSString* roomUid = [NSString stringWithFormat:@"%ld", (long)self.userInfo.uid];
|
2022-01-21 19:47:46 +08:00
|
|
|
|
[Api getRoomInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
|
|
|
|
if (code == 200) {
|
|
|
|
|
RoomInfoModel * roomInfo = [RoomInfoModel modelWithJSON:data.data];
|
|
|
|
|
if (roomInfo.isReselect) {
|
|
|
|
|
XPLittleGameRoomOpenView * roomOpenView = [[XPLittleGameRoomOpenView alloc] init];
|
2022-01-22 11:35:44 +08:00
|
|
|
|
roomOpenView.roomInfo = roomInfo;
|
|
|
|
|
roomOpenView.currentVC = self;
|
2022-01-21 19:47:46 +08:00
|
|
|
|
[TTPopup popupView:roomOpenView style:TTPopupStyleActionSheet];
|
|
|
|
|
} else {
|
|
|
|
|
[XPRoomViewController openRoom:roomUid viewController:self];
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
[self showErrorToast:msg];
|
|
|
|
|
}
|
|
|
|
|
} uid:roomUid intoUid:roomUid];
|
2021-11-04 15:27:11 +08:00
|
|
|
|
}
|
|
|
|
|
break;
|
2022-07-27 15:51:09 +08:00
|
|
|
|
case XPMineItemType_Collect_Room://收藏房间
|
|
|
|
|
{
|
|
|
|
|
XPMineCollectRoomListViewController *collectVC = [[XPMineCollectRoomListViewController alloc] init];
|
|
|
|
|
[self.navigationController pushViewController:collectVC animated:YES];
|
|
|
|
|
}
|
|
|
|
|
break;
|
2021-12-16 19:02:31 +08:00
|
|
|
|
case XPMineItemType_My_Dressup:
|
|
|
|
|
{
|
|
|
|
|
XPMineDressUpViewController * dressUpVC = [[XPMineDressUpViewController alloc] init];
|
|
|
|
|
[self.navigationController pushViewController:dressUpVC animated:YES];
|
|
|
|
|
}
|
|
|
|
|
break;
|
2022-07-29 15:26:33 +08:00
|
|
|
|
case XPMineItemType_DressUp_Market:
|
|
|
|
|
{
|
|
|
|
|
XPDressUpShopViewController *dressUpShopVc = [[XPDressUpShopViewController alloc] init];
|
|
|
|
|
[self.navigationController pushViewController:dressUpShopVc animated:YES];
|
|
|
|
|
}
|
|
|
|
|
break;
|
2021-12-21 18:10:33 +08:00
|
|
|
|
case XPMineItemType_Fans_List:
|
|
|
|
|
{
|
|
|
|
|
XPMineFansViewController * fansVC = [[XPMineFansViewController alloc] init];
|
|
|
|
|
[self.navigationController pushViewController:fansVC animated:YES];
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case XPMineItemType_Attention_List:
|
|
|
|
|
{
|
|
|
|
|
XPMineAttentionViewController * attentionVC = [[XPMineAttentionViewController alloc] init];
|
|
|
|
|
[self.navigationController pushViewController:attentionVC animated:YES];
|
|
|
|
|
}
|
|
|
|
|
break;
|
2021-12-28 17:32:27 +08:00
|
|
|
|
case XPMineItemType_Noble_Center:
|
|
|
|
|
{
|
|
|
|
|
XPNobleCenterViewController *nobleCenterVC = [[XPNobleCenterViewController alloc] init];
|
|
|
|
|
[self.navigationController pushViewController:nobleCenterVC animated:YES];
|
2022-01-19 18:58:30 +08:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case XPMineItemType_Skill_Card:
|
|
|
|
|
{
|
|
|
|
|
XPSkillCardViewController *skillCardVC = [[XPSkillCardViewController alloc] init];
|
|
|
|
|
skillCardVC.uid = self.userInfo.uid;
|
|
|
|
|
[self.navigationController pushViewController:skillCardVC animated:YES];
|
2022-01-26 11:51:06 +08:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case XPMineItemType_Visitor:
|
|
|
|
|
{
|
2022-07-27 11:49:51 +08:00
|
|
|
|
self.headView.visitorUnReadCount = 0;
|
2022-01-26 11:51:06 +08:00
|
|
|
|
XPMineVisitorViewController *visitorVC = [[XPMineVisitorViewController alloc] init];
|
|
|
|
|
[self.navigationController pushViewController:visitorVC animated:YES];
|
2022-04-08 16:16:38 +08:00
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case XPMineItemType_FansTeam: {
|
|
|
|
|
XPMineFansTeamViewController *fansTeamVc = [[XPMineFansTeamViewController alloc] init];
|
|
|
|
|
[self.navigationController pushViewController:fansTeamVc animated:YES];
|
2021-12-28 17:32:27 +08:00
|
|
|
|
}
|
|
|
|
|
break;
|
2022-04-06 21:52:38 +08:00
|
|
|
|
case XPMineItemType_My_Guild:
|
|
|
|
|
{
|
2022-04-14 00:35:31 +08:00
|
|
|
|
if (self.clanInfo.clan.elderUid.length > 0) {
|
|
|
|
|
XPMineClanViewController * clanVC = [[XPMineClanViewController alloc] init];
|
|
|
|
|
clanVC.uid = [NSString stringWithFormat:@"%ld", self.userInfo.uid];
|
|
|
|
|
[self.navigationController pushViewController:clanVC animated:YES];
|
|
|
|
|
} else if(self.clanInfo.hall.hallId.length > 0) {
|
|
|
|
|
XPMineGuildViewController * guildVC = [[XPMineGuildViewController alloc] init];
|
|
|
|
|
guildVC.ownerUid = self.clanInfo.hall.ownerUid;
|
|
|
|
|
guildVC.guildId = self.clanInfo.hall.hallId;
|
|
|
|
|
[self.navigationController pushViewController:guildVC animated:YES];
|
|
|
|
|
}
|
|
|
|
|
|
2022-04-06 21:52:38 +08:00
|
|
|
|
}
|
|
|
|
|
break;
|
2021-09-16 19:30:22 +08:00
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
2021-09-17 19:41:09 +08:00
|
|
|
|
|
|
|
|
|
- (void)pushWebViewWIthUrl:(NSString *)url {
|
|
|
|
|
XPWebViewController * webVC = [[XPWebViewController alloc] init];
|
|
|
|
|
webVC.url = url;
|
|
|
|
|
[self.navigationController pushViewController:webVC animated:YES];
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-16 19:30:22 +08:00
|
|
|
|
#pragma mark - UITableViewDelegate And UITableViewDataSource
|
2022-07-22 18:48:23 +08:00
|
|
|
|
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
|
2022-09-27 15:07:31 +08:00
|
|
|
|
if (self.userInfo.parentMode) {
|
|
|
|
|
return 0;
|
|
|
|
|
} else {
|
|
|
|
|
return 3;
|
|
|
|
|
}
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
2022-07-22 18:48:23 +08:00
|
|
|
|
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
|
|
|
|
|
return 1;
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath {
|
|
|
|
|
if (indexPath.section == 0) {
|
2022-07-22 18:48:23 +08:00
|
|
|
|
return 172;
|
|
|
|
|
} else if (indexPath.section == 1) {
|
|
|
|
|
return 129;
|
|
|
|
|
} else {
|
|
|
|
|
return 80;
|
|
|
|
|
}
|
2021-09-16 19:30:22 +08:00
|
|
|
|
return 53;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
|
|
|
|
|
if (indexPath.section == 0) {
|
2022-01-19 16:04:46 +08:00
|
|
|
|
XPMineHeadItemTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineHeadItemTableViewCell class])];
|
2021-09-16 19:30:22 +08:00
|
|
|
|
if (cell == nil) {
|
2022-01-19 16:04:46 +08:00
|
|
|
|
cell = [[XPMineHeadItemTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineHeadItemTableViewCell class])];
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}
|
2022-07-22 18:48:23 +08:00
|
|
|
|
if (self.functionArray.count) {
|
|
|
|
|
cell.datasource = self.functionArray;
|
|
|
|
|
}
|
2021-09-16 19:30:22 +08:00
|
|
|
|
cell.delegate = self;
|
2022-07-27 16:33:24 +08:00
|
|
|
|
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
2021-09-16 19:30:22 +08:00
|
|
|
|
return cell;
|
2022-07-22 18:48:23 +08:00
|
|
|
|
} else if (indexPath.section == 1) {
|
|
|
|
|
XPMineGameTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPMineGameTableViewCell class])];
|
2021-09-16 19:30:22 +08:00
|
|
|
|
if (cell == nil) {
|
2022-07-22 18:48:23 +08:00
|
|
|
|
cell = [[XPMineGameTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPMineGameTableViewCell class])];
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}
|
2022-07-22 18:48:23 +08:00
|
|
|
|
if (self.littleGameArray.count) {
|
|
|
|
|
cell.datasource = self.littleGameArray;
|
|
|
|
|
}
|
|
|
|
|
cell.delegate = self;
|
2022-07-27 16:33:24 +08:00
|
|
|
|
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
2021-09-16 19:30:22 +08:00
|
|
|
|
return cell;
|
2022-07-22 18:48:23 +08:00
|
|
|
|
} else {
|
|
|
|
|
XPHomeBannerTableViewCell * cell = [tableView dequeueReusableCellWithIdentifier:NSStringFromClass([XPHomeBannerTableViewCell class])];
|
|
|
|
|
if (cell == nil) {
|
|
|
|
|
cell = [[XPHomeBannerTableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:NSStringFromClass([XPHomeBannerTableViewCell class])];
|
|
|
|
|
}
|
2022-08-05 13:04:10 +08:00
|
|
|
|
cell.isMineViewBanner = YES;
|
2022-07-22 18:48:23 +08:00
|
|
|
|
if (self.bannerArray.count) {
|
|
|
|
|
cell.bannerList = self.bannerArray;
|
|
|
|
|
}
|
|
|
|
|
cell.delegate = self;
|
2022-07-27 16:33:24 +08:00
|
|
|
|
cell.selectionStyle = UITableViewCellSelectionStyleNone;
|
2022-07-22 18:48:23 +08:00
|
|
|
|
return cell;
|
|
|
|
|
}
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section {
|
2022-01-19 16:29:07 +08:00
|
|
|
|
return 16;
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UIView *)tableView:(UITableView *)tableView viewForHeaderInSection:(NSInteger)section {
|
|
|
|
|
UIView * view = [[UIView alloc] init];
|
|
|
|
|
view.backgroundColor = [UIColor clearColor];
|
|
|
|
|
return view;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma mark - XPMineHeadViewDelegate
|
|
|
|
|
///点击头像
|
|
|
|
|
- (void)xPMineHeadView:(XPMineHeadView *)view didClickAvatar:(UserInfoModel *)info {
|
2022-07-22 18:48:23 +08:00
|
|
|
|
[self pushViewControllerWithType:XPMineItemType_Personinfo functionItem:nil];
|
2021-09-17 19:41:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
2022-07-22 18:48:23 +08:00
|
|
|
|
///点击了粉丝
|
|
|
|
|
- (void)xpMineHeadViewClickFans {
|
|
|
|
|
[self pushViewControllerWithType:XPMineItemType_Fans_List functionItem:nil];
|
2021-09-17 19:41:09 +08:00
|
|
|
|
}
|
|
|
|
|
|
2022-07-22 18:48:23 +08:00
|
|
|
|
///点击了关注
|
|
|
|
|
- (void)xpMineHeadViewClickAttention {
|
|
|
|
|
[self pushViewControllerWithType:XPMineItemType_Attention_List functionItem:nil];
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
2022-07-22 18:48:23 +08:00
|
|
|
|
///点击了技能卡
|
|
|
|
|
- (void)xpMineHeadViewClickSkillCard {
|
|
|
|
|
[self pushViewControllerWithType:XPMineItemType_Skill_Card functionItem:nil];
|
2021-12-21 18:10:33 +08:00
|
|
|
|
}
|
|
|
|
|
|
2022-07-22 18:48:23 +08:00
|
|
|
|
///点击了访客
|
|
|
|
|
- (void)xpMineHeadViewClickVisitor {
|
|
|
|
|
[self pushViewControllerWithType:XPMineItemType_Visitor functionItem:nil];
|
2021-12-21 18:10:33 +08:00
|
|
|
|
}
|
2022-01-06 17:50:59 +08:00
|
|
|
|
|
2022-07-22 18:48:23 +08:00
|
|
|
|
///点击了足迹
|
|
|
|
|
- (void)xpMineHeadViewClickFootprint {
|
2022-07-26 11:08:01 +08:00
|
|
|
|
[self pushViewControllerWithType:XPMineItemType_Foot_Print functionItem:nil];
|
2022-07-22 18:48:23 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///点击了账户中心
|
|
|
|
|
- (void)xpMineHeadViewClickAcount {
|
2022-08-08 13:15:04 +08:00
|
|
|
|
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_recharge_card_click];
|
2022-07-22 18:48:23 +08:00
|
|
|
|
[self pushViewControllerWithType:XPMineItemType_Account functionItem:nil];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///点击了贵族中心
|
2022-01-06 17:50:59 +08:00
|
|
|
|
- (void)xPMineHeadViewCliekNobleCenter {
|
2022-01-11 11:28:04 +08:00
|
|
|
|
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventvipEntranceMeClick];
|
2022-08-08 13:15:04 +08:00
|
|
|
|
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_noble_card_click];
|
2022-07-22 18:48:23 +08:00
|
|
|
|
[self pushViewControllerWithType:XPMineItemType_Noble_Center functionItem:nil];
|
2022-01-06 17:50:59 +08:00
|
|
|
|
}
|
|
|
|
|
|
2022-09-27 15:07:31 +08:00
|
|
|
|
///点击了青少年模式
|
|
|
|
|
- (void)xPmineHeadViewClickTeenager {
|
|
|
|
|
[self pushViewControllerWithType:XPMineItemType_Teenager_Mode functionItem:nil];
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-16 19:30:22 +08:00
|
|
|
|
#pragma mark - XPMineProtocol
|
2022-07-22 18:48:23 +08:00
|
|
|
|
///获取个人中心功能
|
|
|
|
|
- (void)onGetMineFuntionItemSuccess:(NSArray<XPMineFuntionItemModel *> *)items {
|
|
|
|
|
[self.functionArray removeAllObjects];
|
|
|
|
|
[self.functionArray addObjectsFromArray:items];
|
2022-07-25 18:16:45 +08:00
|
|
|
|
[self.functionArray enumerateObjectsUsingBlock:^(XPMineFuntionItemModel * _Nonnull obj, NSUInteger idx, BOOL * _Nonnull stop) {
|
2022-07-27 15:51:09 +08:00
|
|
|
|
if (obj.skipType == XPMineItemType_CP) {
|
2022-07-25 18:16:45 +08:00
|
|
|
|
[self.functionArray removeObject:obj];
|
|
|
|
|
}
|
|
|
|
|
}];
|
2022-08-08 13:15:04 +08:00
|
|
|
|
NSMutableArray *array = [NSMutableArray array];
|
|
|
|
|
for (XPMineFuntionItemModel *item in self.functionArray) {
|
|
|
|
|
[array addObject:item.centerName];
|
|
|
|
|
}
|
|
|
|
|
NSString *trackName = [array componentsJoinedByString:@","];
|
|
|
|
|
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_function_show eventAttributes:@{@"functionName" : trackName}];
|
2022-07-22 18:48:23 +08:00
|
|
|
|
[self.tableView reloadData];
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
2022-07-22 18:48:23 +08:00
|
|
|
|
///获取小游戏列表
|
|
|
|
|
- (void)onGetLittleGameListSuccess:(NSArray<LittleGameInfoModel *> *)items {
|
|
|
|
|
[self.littleGameArray removeAllObjects];
|
|
|
|
|
[self.littleGameArray addObjectsFromArray:items];
|
|
|
|
|
[self.tableView reloadData];
|
2022-08-08 13:15:04 +08:00
|
|
|
|
NSMutableArray *array = [NSMutableArray array];
|
|
|
|
|
for (LittleGameInfoModel *item in self.littleGameArray) {
|
|
|
|
|
[array addObject:item.name];
|
|
|
|
|
}
|
|
|
|
|
NSString *trackName = [array componentsJoinedByString:@","];
|
|
|
|
|
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_quick_entry_show eventAttributes:@{@"gameName" : trackName}];
|
2022-07-22 18:48:23 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///获取个人中心banner
|
|
|
|
|
- (void)onGetPersonalBannerListSuccess:(NSArray<HomeBannerInfoModel *> *)items {
|
|
|
|
|
[self.bannerArray removeAllObjects];
|
|
|
|
|
[self.bannerArray addObjectsFromArray:items];
|
2022-01-19 16:04:46 +08:00
|
|
|
|
[self.tableView reloadData];
|
2022-08-08 13:15:04 +08:00
|
|
|
|
NSMutableArray *array = [NSMutableArray array];
|
|
|
|
|
for (HomeBannerInfoModel *item in self.bannerArray) {
|
|
|
|
|
[array addObject:item.bannerId];
|
|
|
|
|
}
|
|
|
|
|
NSString *trackName = [array componentsJoinedByString:@","];
|
|
|
|
|
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_banner_show eventAttributes:@{@"bannerId" : trackName}];
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (void)onGetUserInfoSuccess:(UserInfoModel *)userInfo {
|
2022-07-29 17:09:01 +08:00
|
|
|
|
///防止重新注册时,获取到用户信息不全,调用接口时401
|
|
|
|
|
if (!userInfo.isBindPhone && [ClientConfig shareConfig].iosPhoneBind) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
if (userInfo.nick == nil || userInfo.avatar == nil) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2022-09-27 15:07:31 +08:00
|
|
|
|
self.userInfo = userInfo;
|
|
|
|
|
self.headView.userInfo = userInfo;
|
|
|
|
|
[self.tableView reloadData];
|
|
|
|
|
if (userInfo.parentMode) {
|
|
|
|
|
if (self.userRechargeView.superview) {
|
|
|
|
|
[self.userRechargeView removeFromSuperview];
|
|
|
|
|
self.userRechargeView = nil;
|
|
|
|
|
}
|
|
|
|
|
return;
|
|
|
|
|
}
|
2022-07-29 17:09:01 +08:00
|
|
|
|
[self.presenter getClanDetailInfo];
|
|
|
|
|
[self.presenter getUserWalletInfo];
|
|
|
|
|
[self.presenter getPersonItemList];
|
|
|
|
|
[self.presenter getLittleGameList];
|
|
|
|
|
[self.presenter getMineBannerList];
|
2022-07-27 15:11:11 +08:00
|
|
|
|
[self.presenter getNobleInfo];
|
2022-07-28 15:24:42 +08:00
|
|
|
|
if (userInfo.showLimitCharge) {//新用户充值优惠
|
|
|
|
|
if (!self.userRechargeView.superview) {
|
|
|
|
|
[self.view addSubview:self.userRechargeView];
|
|
|
|
|
[self.userRechargeView mas_makeConstraints:^(MASConstraintMaker *make) {
|
|
|
|
|
make.left.mas_equalTo(0);
|
|
|
|
|
make.top.mas_equalTo(kNavigationHeight + 80);
|
|
|
|
|
make.size.mas_equalTo(CGSizeMake(74, 88));
|
|
|
|
|
}];
|
2022-08-08 13:15:04 +08:00
|
|
|
|
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventUsercenterNugiftPopShow];
|
2022-07-28 15:24:42 +08:00
|
|
|
|
}
|
|
|
|
|
self.userRechargeView.endTime = userInfo.limitChargeEndTime;
|
|
|
|
|
} else {
|
|
|
|
|
[self.userRechargeView removeFromSuperview];
|
|
|
|
|
self.userRechargeView = nil;
|
|
|
|
|
}
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}
|
2022-01-19 16:04:46 +08:00
|
|
|
|
|
2022-07-22 18:48:23 +08:00
|
|
|
|
- (void)getUserWalletInfo:(WalletInfoModel *)balanceInfo {
|
|
|
|
|
self.headView.walletInfo = balanceInfo;
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-27 15:11:11 +08:00
|
|
|
|
///获取贵族信息成功
|
|
|
|
|
- (void)getNobleCenterInfoSuccess:(NobleCenterModel *)model {
|
|
|
|
|
self.headView.nobleInfo = model;
|
|
|
|
|
}
|
|
|
|
|
|
2022-07-27 16:25:51 +08:00
|
|
|
|
///获取家族信息成功
|
2022-04-14 00:35:31 +08:00
|
|
|
|
- (void)onGetClanDetailInfoSuccess:(ClanDetailInfoModel *)clanInfo {
|
|
|
|
|
self.clanInfo = clanInfo;
|
2022-07-22 18:48:23 +08:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///匹配游戏房成功
|
2022-07-26 19:09:14 +08:00
|
|
|
|
- (void)quickMatchLittleGameRoomSuccess:(HomeLittleGameRoomModel *)roomInfo mgId:(NSString *)mgId {
|
|
|
|
|
if (roomInfo.isPick && roomInfo.uid.length > 0) {
|
2022-08-08 13:15:04 +08:00
|
|
|
|
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_quick_entrysuccess_click eventAttributes:@{@"roomUid" : roomInfo.uid}];
|
2022-07-26 19:09:14 +08:00
|
|
|
|
[XPRoomViewController openRoom:roomInfo.uid viewController:self];
|
|
|
|
|
} else if (roomInfo.needOpenSelfRoom) {
|
|
|
|
|
NSString* roomUid = [NSString stringWithFormat:@"%ld", (long)self.userInfo.uid];
|
2022-08-08 13:15:04 +08:00
|
|
|
|
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_quick_entrysuccess_click eventAttributes:@{@"roomUid" : roomUid}];
|
2022-07-26 19:09:14 +08:00
|
|
|
|
[Api getRoomInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
|
|
|
|
if (code == 200) {
|
|
|
|
|
RoomInfoModel * roomInfo = [RoomInfoModel modelWithJSON:data.data];
|
|
|
|
|
if (roomInfo.mgId != [mgId intValue]) {///更新房间游戏类型
|
|
|
|
|
NSMutableDictionary * params = [NSMutableDictionary dictionary];
|
|
|
|
|
NSString * uid = [AccountInfoStorage instance].getUid;
|
|
|
|
|
NSString * ticket = [AccountInfoStorage instance].getTicket;
|
2022-12-29 19:03:03 +08:00
|
|
|
|
[params safeSetObject:ticket forKey:@"ticket"];
|
|
|
|
|
[params safeSetObject:uid forKey:@"uid"];
|
|
|
|
|
[params safeSetObject:[NSString stringWithFormat:@"%ld", roomInfo.uid] forKey:@"roomUid"];
|
2022-07-26 19:09:14 +08:00
|
|
|
|
if (roomInfo.title.length > 0) {
|
2022-12-29 19:03:03 +08:00
|
|
|
|
[params safeSetObject:roomInfo.title forKey:@"title"];
|
2022-07-26 19:09:14 +08:00
|
|
|
|
}
|
|
|
|
|
if (roomInfo.roomPwd.length > 0) {
|
2022-12-29 19:03:03 +08:00
|
|
|
|
[params safeSetObject:roomInfo.roomPwd forKey:@"roomPwd"];
|
2022-07-26 19:09:14 +08:00
|
|
|
|
} else{
|
2022-12-29 19:03:03 +08:00
|
|
|
|
[params safeSetObject:@"" forKey:@"roomPwd"];
|
2022-07-26 19:09:14 +08:00
|
|
|
|
}
|
|
|
|
|
if (roomInfo.tagId > 0) {
|
2022-12-29 19:03:03 +08:00
|
|
|
|
[params safeSetObject:[NSString stringWithFormat:@"%ld", roomInfo.tagId] forKey:@"tagId"];
|
2022-07-26 19:09:14 +08:00
|
|
|
|
}
|
2022-12-29 19:03:03 +08:00
|
|
|
|
[params safeSetObject:@(RoomType_MiniGame) forKey:@"type"];
|
|
|
|
|
[params safeSetObject:mgId forKey:@"mgId"];
|
|
|
|
|
[params safeSetObject:@(roomInfo.hasAnimationEffect) forKey:@"hasAnimationEffect"];
|
2022-07-26 19:09:14 +08:00
|
|
|
|
[Api ownerUpdateRoomInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
|
|
|
|
|
if (code == 200) {
|
|
|
|
|
[XPRoomViewController openRoom:[AccountInfoStorage instance].getUid mgId:mgId viewController:self];
|
|
|
|
|
}
|
|
|
|
|
} params:params];
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
[self showErrorToast:msg];
|
|
|
|
|
}
|
|
|
|
|
} uid:roomUid intoUid:roomUid];
|
2022-07-22 18:48:23 +08:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
///匹配游戏房失败
|
|
|
|
|
- (void)quickMatchLittleGameRoomFail:(NSString *)mgId {
|
|
|
|
|
[XPRoomViewController openRoom:[NSString stringWithFormat:@"%ld", self.userInfo.uid] mgId:mgId viewController:self];
|
2022-04-14 00:35:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
2022-01-19 16:04:46 +08:00
|
|
|
|
#pragma mark - XPMineHeadItemTableViewCellDelegate
|
2022-07-22 18:48:23 +08:00
|
|
|
|
- (void)xPMineHeadItemTableViewCell:(XPMineHeadItemTableViewCell *)cell didSelectItem:(XPMineFuntionItemModel *)item {
|
2022-08-08 13:15:04 +08:00
|
|
|
|
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_function_click eventAttributes:@{@"functionName" : item.centerName}];
|
2022-07-22 18:48:23 +08:00
|
|
|
|
[self pushViewControllerWithType:item.skipType functionItem:item];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma mark - XPHomeBannerTableViewCellDelegate
|
|
|
|
|
///点击了某个banner
|
|
|
|
|
- (void)xPHomeBannerTableViewCell:(XPHomeBannerTableViewCell *)view didClickBanner:(HomeBannerInfoModel *)info {
|
2022-08-08 13:15:04 +08:00
|
|
|
|
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventusercenter_banner_click eventAttributes:@{@"bannerId" : info.bannerId}];
|
2022-07-22 18:48:23 +08:00
|
|
|
|
switch (info.skipType) {
|
|
|
|
|
case HomeBannerInfoSkipType_Room:
|
|
|
|
|
{
|
|
|
|
|
if (info.skipUri.length > 0) {
|
|
|
|
|
[XPRoomViewController openRoom:info.skipUri viewController:self];
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case HomeBannerInfoSkipType_Web:
|
|
|
|
|
{
|
|
|
|
|
XPWebViewController *vc = [[XPWebViewController alloc]init];
|
|
|
|
|
vc.url = info.skipUri;
|
|
|
|
|
[self.navigationController pushViewController:vc animated:YES];
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#pragma mark - XPMineGameTableViewCellDelegate
|
|
|
|
|
///选择了某个游戏
|
|
|
|
|
- (void)xPMineGameTableViewCell:(XPMineGameTableViewCell *)cell didSelectItem:(LittleGameInfoModel *)item {
|
|
|
|
|
[self.presenter quickMatchLittleGameWithMgId:item.mgId];
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}
|
2022-01-19 16:04:46 +08:00
|
|
|
|
|
2022-01-26 15:51:19 +08:00
|
|
|
|
#pragma mark - NSNotification
|
|
|
|
|
- (void)onVisitorUnReadCountUpdate:(NSNotification *)noti {
|
|
|
|
|
XPMineVisitorUnReadModel *model = (XPMineVisitorUnReadModel *)noti.object;
|
2022-07-27 11:49:51 +08:00
|
|
|
|
self.headView.visitorUnReadCount = model.visitNum;
|
2022-01-26 15:51:19 +08:00
|
|
|
|
}
|
|
|
|
|
|
2022-07-29 18:56:08 +08:00
|
|
|
|
#pragma mark - 新用户充值优惠
|
|
|
|
|
- (void)onNewUserRechargeTap:(UITapGestureRecognizer *)ges {
|
2022-08-08 13:15:04 +08:00
|
|
|
|
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventUsercenterNugiftPopClick];
|
2022-07-29 18:56:08 +08:00
|
|
|
|
XPNewUserRechargeViewController *vc = [[XPNewUserRechargeViewController alloc] initWithNavigation:self.navigationController];
|
|
|
|
|
[self.navigationController presentViewController:vc animated:YES completion:nil];
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-16 19:30:22 +08:00
|
|
|
|
#pragma mark - Getters And Setters
|
|
|
|
|
- (UITableView *)tableView {
|
|
|
|
|
if (!_tableView) {
|
|
|
|
|
_tableView = [[UITableView alloc] initWithFrame:CGRectZero style:UITableViewStylePlain];
|
|
|
|
|
_tableView.delegate = self;
|
|
|
|
|
_tableView.dataSource = self;
|
|
|
|
|
_tableView.showsVerticalScrollIndicator = NO;
|
|
|
|
|
_tableView.separatorStyle = UITableViewCellSeparatorStyleNone;
|
2022-07-22 18:48:23 +08:00
|
|
|
|
[_tableView registerClass:[XPMineGameTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineGameTableViewCell class])];
|
2022-01-19 16:04:46 +08:00
|
|
|
|
[_tableView registerClass:[XPMineHeadItemTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPMineHeadItemTableViewCell class])];
|
2022-07-22 18:48:23 +08:00
|
|
|
|
[_tableView registerClass:[XPHomeBannerTableViewCell class] forCellReuseIdentifier:NSStringFromClass([XPHomeBannerTableViewCell class])];
|
2021-09-16 19:30:22 +08:00
|
|
|
|
_tableView.backgroundColor = [UIColor clearColor];
|
|
|
|
|
}
|
|
|
|
|
return _tableView;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (XPMineHeadView *)headView {
|
|
|
|
|
if (!_headView) {
|
2022-08-05 00:33:58 +08:00
|
|
|
|
CGFloat height = (KScreenWidth - 30 - 16) * 0.5 * 64 / 164;
|
|
|
|
|
_headView = [[XPMineHeadView alloc] initWithFrame:CGRectMake(0, 0,KScreenWidth , 142 +44 + height + kStatusBarHeight)];
|
2021-09-16 19:30:22 +08:00
|
|
|
|
_headView.delegate = self;
|
|
|
|
|
}
|
|
|
|
|
return _headView;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
- (UIButton *)settingButton {
|
|
|
|
|
if (!_settingButton) {
|
|
|
|
|
_settingButton = [UIButton buttonWithType:UIButtonTypeCustom];
|
|
|
|
|
[_settingButton setImage:[UIImage imageNamed:@"mine_nav_setting"] forState:UIControlStateNormal];
|
|
|
|
|
[_settingButton setImage:[UIImage imageNamed:@"mine_nav_setting"] forState:UIControlStateSelected];
|
|
|
|
|
[_settingButton addTarget:self action:@selector(settingButtonAction:) forControlEvents:UIControlEventTouchUpInside];
|
2021-09-17 19:41:09 +08:00
|
|
|
|
[_settingButton setEnlargeEdgeWithTop:10 right:10 bottom:10 left:10];
|
2021-09-16 19:30:22 +08:00
|
|
|
|
}
|
|
|
|
|
return _settingButton;
|
|
|
|
|
}
|
|
|
|
|
|
2022-01-19 16:04:46 +08:00
|
|
|
|
- (UIView *)bgImageView {
|
|
|
|
|
if (!_bgImageView) {
|
2022-09-22 14:08:26 +08:00
|
|
|
|
_bgImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"home_nav_background"]];
|
2022-01-19 16:04:46 +08:00
|
|
|
|
_bgImageView.contentMode = UIViewContentModeScaleAspectFill;
|
|
|
|
|
}
|
|
|
|
|
return _bgImageView;
|
|
|
|
|
}
|
2021-09-16 19:30:22 +08:00
|
|
|
|
|
2022-07-22 18:48:23 +08:00
|
|
|
|
- (NSMutableArray<XPMineFuntionItemModel *> *)functionArray {
|
|
|
|
|
if (!_functionArray) {
|
|
|
|
|
_functionArray = [NSMutableArray array];
|
2022-01-19 16:29:07 +08:00
|
|
|
|
}
|
2022-07-22 18:48:23 +08:00
|
|
|
|
return _functionArray;
|
2022-01-19 16:29:07 +08:00
|
|
|
|
}
|
|
|
|
|
|
2022-07-22 18:48:23 +08:00
|
|
|
|
- (NSMutableArray<LittleGameInfoModel *> *)littleGameArray {
|
|
|
|
|
if (!_littleGameArray) {
|
|
|
|
|
_littleGameArray = [NSMutableArray array];
|
|
|
|
|
}
|
|
|
|
|
return _littleGameArray;
|
2022-04-14 00:35:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
2022-07-22 18:48:23 +08:00
|
|
|
|
- (NSMutableArray<HomeBannerInfoModel *> *)bannerArray {
|
|
|
|
|
if (!_bannerArray) {
|
|
|
|
|
_bannerArray = [NSMutableArray array];
|
|
|
|
|
}
|
|
|
|
|
return _bannerArray;
|
2022-04-14 00:35:31 +08:00
|
|
|
|
}
|
|
|
|
|
|
2022-07-28 15:24:42 +08:00
|
|
|
|
- (XPMineNewUserRechargeView *)userRechargeView {
|
|
|
|
|
if (!_userRechargeView) {
|
|
|
|
|
_userRechargeView = [[XPMineNewUserRechargeView alloc] init];
|
2022-07-29 18:56:08 +08:00
|
|
|
|
UITapGestureRecognizer *tap = [[UITapGestureRecognizer alloc] initWithTarget:self action:@selector(onNewUserRechargeTap:)];
|
|
|
|
|
[_userRechargeView addGestureRecognizer:tap];
|
2022-07-28 15:24:42 +08:00
|
|
|
|
}
|
|
|
|
|
return _userRechargeView;
|
|
|
|
|
}
|
|
|
|
|
|
2021-09-16 19:30:22 +08:00
|
|
|
|
@end
|