This commit is contained in:
liyuhua
2023-12-27 18:06:18 +08:00
parent 71a8a4067f
commit 64e3eafaa8
17 changed files with 184 additions and 24 deletions

View File

@@ -215,6 +215,7 @@
23844FCB2B3AC267002AD661 /* MewMineUserInfoOnRoomView.m in Sources */ = {isa = PBXBuildFile; fileRef = 23844FCA2B3AC267002AD661 /* MewMineUserInfoOnRoomView.m */; };
23CEFB692AFB32BE00576D89 /* XPRoomAnimationTool.m in Sources */ = {isa = PBXBuildFile; fileRef = 23CEFB682AFB32BE00576D89 /* XPRoomAnimationTool.m */; };
23E1708C2AED2E080039DE62 /* YYTextAsyncLayer+XPTextAsyncLayer.m in Sources */ = {isa = PBXBuildFile; fileRef = 23E1708B2AED2E080039DE62 /* YYTextAsyncLayer+XPTextAsyncLayer.m */; };
23EEB0622B3C1B3F00E8CA05 /* MewMainHomeEmptyCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 23EEB0612B3C1B3F00E8CA05 /* MewMainHomeEmptyCell.m */; };
23F8BFF82A7A392000A36763 /* XPRoomMessagePrivilegeCardCell.m in Sources */ = {isa = PBXBuildFile; fileRef = 23F8BFF72A7A392000A36763 /* XPRoomMessagePrivilegeCardCell.m */; };
73FFADDC93E195344047A2EC /* Pods_xplan_ios.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = CACF623970097D653132D69A /* Pods_xplan_ios.framework */; };
9B0086C627BA392B0032BD2B /* AnchorStageView.m in Sources */ = {isa = PBXBuildFile; fileRef = 9B0086C527BA392B0032BD2B /* AnchorStageView.m */; };
@@ -1811,6 +1812,8 @@
23CEFB682AFB32BE00576D89 /* XPRoomAnimationTool.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomAnimationTool.m; sourceTree = "<group>"; };
23E1708A2AED2E080039DE62 /* YYTextAsyncLayer+XPTextAsyncLayer.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; name = "YYTextAsyncLayer+XPTextAsyncLayer.h"; path = "xplan-ios/Appdelegate/YYTextAsyncLayer+XPTextAsyncLayer.h"; sourceTree = SOURCE_ROOT; };
23E1708B2AED2E080039DE62 /* YYTextAsyncLayer+XPTextAsyncLayer.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; name = "YYTextAsyncLayer+XPTextAsyncLayer.m"; path = "xplan-ios/Appdelegate/YYTextAsyncLayer+XPTextAsyncLayer.m"; sourceTree = SOURCE_ROOT; };
23EEB0602B3C1B3F00E8CA05 /* MewMainHomeEmptyCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MewMainHomeEmptyCell.h; sourceTree = "<group>"; };
23EEB0612B3C1B3F00E8CA05 /* MewMainHomeEmptyCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = MewMainHomeEmptyCell.m; sourceTree = "<group>"; };
23F8BFF62A7A392000A36763 /* XPRoomMessagePrivilegeCardCell.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = XPRoomMessagePrivilegeCardCell.h; sourceTree = "<group>"; };
23F8BFF72A7A392000A36763 /* XPRoomMessagePrivilegeCardCell.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = XPRoomMessagePrivilegeCardCell.m; sourceTree = "<group>"; };
7DB00EC07F1D0ADFF900B38D /* Pods-xplan-ios.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-xplan-ios.debug.xcconfig"; path = "Target Support Files/Pods-xplan-ios/Pods-xplan-ios.debug.xcconfig"; sourceTree = "<group>"; };
@@ -4928,6 +4931,8 @@
23844FAF2B3927B3002AD661 /* MewMainHomeMoreGameHeadCell.m */,
23844FB12B392A7B002AD661 /* MewMainHomeMoreGameCell.h */,
23844FB22B392A7B002AD661 /* MewMainHomeMoreGameCell.m */,
23EEB0602B3C1B3F00E8CA05 /* MewMainHomeEmptyCell.h */,
23EEB0612B3C1B3F00E8CA05 /* MewMainHomeEmptyCell.m */,
);
path = MewHomeCell;
sourceTree = "<group>";
@@ -11104,6 +11109,7 @@
E86507E5281A7D4D006951B0 /* MessageContentTweetView.m in Sources */,
E824544B26F5BBB800BE8163 /* XPMineModifPayPwdViewController.m in Sources */,
E81C1B2227705F950020D1E4 /* Api+ArrangeMic.m in Sources */,
23EEB0622B3C1B3F00E8CA05 /* MewMainHomeEmptyCell.m in Sources */,
E800805A27FD34DE0055A8AB /* XPMineClanViewController.m in Sources */,
9BD798B4292632FE003E03E6 /* XPSessionListHeadItemView.m in Sources */,
E8ACEFF527C8EF0500F66D1A /* XPHomeHotRoomViewController.m in Sources */,

View File

@@ -47,4 +47,5 @@ if (@available(iOS 11.0, *)) {\
#import "XPHtmlUrl.h"
#import "XPEnum.h"
#import "MewRefreshSvgaHeader.h"
#import "StatisticsServiceHelper.h"
#endif /* Base_pch */

View File

@@ -31,7 +31,20 @@ UIKIT_EXTERN NSString *const StatisticsServiceEventvipEntranceMeClick;///贵族
UIKIT_EXTERN NSString *const StatisticsServiceEventRecent_card_show;///最近在看卡片曝光
UIKIT_EXTERN NSString *const StatisticsServiceEventRecent_card_click;///最近在看卡片点击
UIKIT_EXTERN NSString *const StatisticsServiceEventGebo_tab_click;///个播页二级tab分类点击
UIKIT_EXTERN NSString *const StatisticsServiceEventRecent_homepage_show ;///首页曝光统计
UIKIT_EXTERN NSString *const StatisticsServiceEventRecent_homepage_bar_click ;///底部工具栏bar统计
UIKIT_EXTERN NSString *const StatisticsServiceEventRecent_homepage_top_tab_click ;//首页顶部tab切换点击
UIKIT_EXTERN NSString *const StatisticsServiceEventRecent_homepage_top_search_click ;///首页顶部搜索框点击
UIKIT_EXTERN NSString *const StatisticsServiceEventRecent_homepage_top_rank_click ;///首页顶部全服榜单点击
UIKIT_EXTERN NSString *const StatisticsServiceEventRecent_homepage_top_myroom_click ;///首页顶部我的房间点击
UIKIT_EXTERN NSString *const StatisticsServiceEventRecent_homepage_top_resource_click ;///首页顶部资源位点击
UIKIT_EXTERN NSString *const StatisticsServiceEventRecent_homepage_top_moregame_click ;///首页顶部更多游戏跳转点击
UIKIT_EXTERN NSString *const StatisticsServiceEventRecent_homepage_inform_click ;///首页轮播通知的跳转点击
UIKIT_EXTERN NSString *const StatisticsServiceEventRecent_homepage_banner_click ;///首页banner的跳转点击
UIKIT_EXTERN NSString *const StatisticsServiceEventRecent_homepage_room_click ;///首页房间的跳转点击
UIKIT_EXTERN NSString *const StatisticsServiceEventRecent_homepage_moregame_tab_click ;///更多游戏二级页顶部游戏分类点击
UIKIT_EXTERN NSString *const StatisticsServiceEventRecent_homepage_top_match_click ;///首页房间的跳转点击
UIKIT_EXTERN NSString *const StatisticsServiceEventRecent_homepage_moregame_user_click;//首页用户主播卡片点击
#pragma mark - 礼物
UIKIT_EXTERN NSString *const StatisticsServiceEventRoomNugivePopShow; ///房间礼物赠送弹窗曝光
UIKIT_EXTERN NSString *const StatisticsServiceEventRoomNugivePopClick; ///房间礼物赠送弹窗关闭

View File

@@ -27,6 +27,20 @@ NSString *const StatisticsServiceEventvipEntranceMeClick = @"vip_entrance_me_cli
NSString *const StatisticsServiceEventRecent_card_show = @"recent_card_show";///
NSString *const StatisticsServiceEventRecent_card_click = @"recent_card_click";///
NSString *const StatisticsServiceEventGebo_tab_click = @"gebo_tab_click";///tab
NSString *const StatisticsServiceEventRecent_homepage_show = @"homepage_show";///
NSString *const StatisticsServiceEventRecent_homepage_bar_click = @"homepage_bar_click";///bar
NSString *const StatisticsServiceEventRecent_homepage_top_tab_click = @"homepage_top_tab_click";//tab
NSString *const StatisticsServiceEventRecent_homepage_top_search_click = @"homepage_top_search_click";///
NSString *const StatisticsServiceEventRecent_homepage_top_rank_click = @"homepage_top_rank_click";///
NSString *const StatisticsServiceEventRecent_homepage_top_myroom_click = @"homepage_top_myroom_click";///
NSString *const StatisticsServiceEventRecent_homepage_top_resource_click = @"homepage_top_resource_click";///
NSString *const StatisticsServiceEventRecent_homepage_top_moregame_click = @"homepage_top_moregame_click";///
NSString *const StatisticsServiceEventRecent_homepage_inform_click = @"homepage_inform_click";///
NSString *const StatisticsServiceEventRecent_homepage_banner_click = @"homepage_banner_click";///banner
NSString *const StatisticsServiceEventRecent_homepage_room_click = @"homepage_room_click";///
NSString *const StatisticsServiceEventRecent_homepage_moregame_tab_click = @"homepage_moregame_tab_click";///
NSString *const StatisticsServiceEventRecent_homepage_top_match_click = @"homepage_top_match_click";///
NSString *const StatisticsServiceEventRecent_homepage_moregame_user_click = @"homepage_moregame_user_click";//
#pragma mark -
NSString *const StatisticsServiceEventRoomNugivePopShow = @"room_nugive_pop_show"; ///

View File

@@ -10,7 +10,11 @@
NS_ASSUME_NONNULL_BEGIN
@interface Api (Home)
/// 首页推荐的轮播图
/// @param completion 完成
/// @param uid 用户的uid
/// @param type 类型 2 房间的 1 首页的 9推荐页下面的
+ (void)homeBannerList:(HttpRequestHelperCompletion)completion uid:(NSString *)uid type:(NSString *)type;
/// 获取首页所有的tag
/// @param complection 完成
/// @param uid 用户的uid

View File

@@ -10,6 +10,8 @@
NS_ASSUME_NONNULL_BEGIN
@interface MewHomeManager : BaseMvpPresenter
///得到轮播图
-(void)mew_getMainHomeBannerList;
- (void)mew_requestMainHomeTopDataList;
/// 获取全服礼物记录列表
- (void)mew_requestMainHomeGiftRecordList;

View File

@@ -17,8 +17,17 @@
#import "MewMainHomeGameTabModel.h"
#import "MewMainHomeLittleGameInfoModel.h"
#import "MewMainHomeMoreGameModel.h"
#import "MewMainHomeBannerInfoModel.h"
@implementation MewHomeManager
///
-(void)mew_getMainHomeBannerList{
[Api mew_RequestMainHomeBannerList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {
NSArray *list = [MewMainHomeBannerInfoModel modelsWithArray:data.data];
[[self getView]mew_getMainHomeBannerListSuccess:list];
} fail:^(NSInteger code, NSString * _Nullable msg) {
}] uid:[AccountInfoStorage instance].getUid type:@"1"];
}
///
- (void)mew_requestMainHomeTopDataList {
NSString * uid = [AccountInfoStorage instance].getUid;
[Api mew_RequestMainHomeMenuList:[self createHttpCompletion:^(BaseModel * _Nonnull data) {

View File

@@ -23,7 +23,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic, copy) NSString *giftName;
@property (nonatomic, copy) NSString *giftNum;
@property (nonatomic, copy) NSString *giftPicUrl;
@property(nonatomic, assign) BOOL lock;
/// 自定义字段
/// 是否是空占位模型
@property (nonatomic, assign) BOOL isEmpty;

View File

@@ -39,6 +39,8 @@ NS_ASSUME_NONNULL_BEGIN
-(void)mew_getMainHomeGameFriendListSuccess:(NSArray *)list;
///获取大神推荐成功
-(void)mew_RequestMainHomeFriendMahoganyListSuccess:(NSArray *)list;
///得到轮播图
-(void)mew_getMainHomeBannerListSuccess:(NSArray *)list;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,16 @@
//
// MewMainHomeEmptyCell.h
// xplan-ios
//
// Created by duoban on 2023/12/27.
//
#import <UIKit/UIKit.h>
NS_ASSUME_NONNULL_BEGIN
@interface MewMainHomeEmptyCell : UICollectionViewCell
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,60 @@
//
// MewMainHomeEmptyCell.m
// xplan-ios
//
// Created by duoban on 2023/12/27.
//
#import "MewMainHomeEmptyCell.h"
@interface MewMainHomeEmptyCell()
@property (nonatomic,strong) UIImageView *mewEmptyView;
@property (nonatomic,strong) UILabel *mewtextView;
@end
@implementation MewMainHomeEmptyCell
-(instancetype)initWithFrame:(CGRect)frame{
self = [super initWithFrame:frame];
if(self){
[self installUI];
[self installConstraints];
}
return self;
}
-(void)installUI{
[self.contentView addSubview:self.mewEmptyView];
[self.contentView addSubview:self.mewtextView];
}
-(void)installConstraints{
[self.mewEmptyView mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.mas_equalTo(self.contentView);
make.top.mas_equalTo(self.contentView).offset(10);
make.size.mas_equalTo(CGSizeMake(100, 100));
}];
[self.mewtextView mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.mas_equalTo(self.mewEmptyView.mas_bottom).offset(20);
make.left.right.mas_equalTo(self.contentView);
}];
}
#pragma mark -
- (UIImageView *)mewEmptyView {
if (!_mewEmptyView) {
_mewEmptyView = [[UIImageView alloc] init];
_mewEmptyView.userInteractionEnabled = YES;
_mewEmptyView.image = [UIImageConstant defalutEmptyPlaceholder];
_mewEmptyView.layer.masksToBounds = YES;
_mewEmptyView.contentMode = UIViewContentModeScaleAspectFit;
}
return _mewEmptyView;
}
- (UILabel *)mewtextView {
if (!_mewtextView) {
_mewtextView = [[UILabel alloc] init];
_mewtextView.text = @"暂无数据";
_mewtextView.font = [UIFont systemFontOfSize:16];
_mewtextView.textAlignment = NSTextAlignmentCenter;
_mewtextView.textColor = [ThemeColor secondTextColor];
}
return _mewtextView;
}
@end

View File

@@ -101,11 +101,13 @@
[self.mewGiftNumView mas_makeConstraints:^(MASConstraintMaker *make) {
make.leading.equalTo(self.mewGiftImageView.mas_trailing).mas_offset(kGetScaleWidth(2));
make.centerY.equalTo(self);
make.trailing.equalTo(self.mewArrowView.mas_leading).mas_offset(-kGetScaleWidth(0));
}];
}
-(void)setMewGiftInfo:(MewMainHomeGiftRecordModel *)mewGiftInfo{
_mewGiftInfo = mewGiftInfo;
_mewArrowView.hidden = _mewGiftInfo.lock;
_mewSendUserHeadView.imageUrl = _mewGiftInfo.senderAvatar;
NSString *senderNick = _mewGiftInfo.senderNick.length > 4 ? [NSString stringWithFormat:@"%@...",[_mewGiftInfo.senderNick substringToIndex:4]]:_mewGiftInfo.senderNick;
_mewSendUserTextView.text = senderNick;

View File

@@ -6,7 +6,7 @@
//
#import "MewMainHomeMakeFriendVC.h"
#import "XPHomeListEmptyCollectionViewCell.h"
#import "MewMainHomeEmptyCell.h"
#import "MewMainHomeMakeFriendHeadView.h"
#import "MewHomeManager.h"
#import "MewMainHomeProtocol.h"
@@ -226,6 +226,7 @@
webVC.url = menuInfo.resourceContent;
[self.navigationController pushViewController:webVC animated:YES];
}else {
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventRecent_homepage_top_resource_click eventAttributes:@{@"type":@"E"}];
NSString * uid = [AccountInfoStorage instance].getUid;
if (menuInfo.hid.length > 0 && uid.length > 0) {
[Api mew_RequestMainHomePickResource:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
@@ -258,6 +259,7 @@
}
///
-(void)mew_selectOneClickMatchingAction:(MewMainHomeMenuInfoModel *_Nullable)menuInfo{
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventRecent_homepage_top_match_click];
[self.presenter mew_getMainHomeFriendChatPickData];
}
///
@@ -421,8 +423,10 @@
if (model.inRoomUid.length > 0) {
if (model.inMic) {
[XPRoomViewController openRoom:model.inRoomUid fromNick:model.nick fromType:UserEnterRoomFromType_Follow_User fromUid:[NSString stringWithFormat:@"%@",model.uid] viewController:self];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventRecent_homepage_moregame_user_click eventAttributes:@{@"uid":model.uid}];
}else{
[XPRoomViewController openRoom:model.inRoomUid fromNick:nil fromType:UserEnterRoomFromType_Home_Recommend fromUid:nil viewController:self];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventRecent_homepage_moregame_user_click eventAttributes:@{@"uid":model.inRoomUid}];
}
}
}
@@ -448,7 +452,7 @@
}
-(CGSize)collectionView:(UICollectionView *)collectionView layout:(UICollectionViewLayout *)collectionViewLayout sizeForItemAtIndexPath:(NSIndexPath *)indexPath{
if(self.gameId != nil && self.mewFriendList.count == 0){
return self.mewRecommendList.count == 0 ? CGSizeMake(KScreenWidth, 300):CGSizeMake(kGetScaleWidth(168), kGetScaleWidth(184));
return self.mewRecommendList.count == 0 ? CGSizeMake(KScreenWidth, 150):CGSizeMake(kGetScaleWidth(168), kGetScaleWidth(184));
}
return self.mewFriendList.count == 0 ? CGSizeMake(KScreenWidth, 150):CGSizeMake(kGetScaleWidth(168), kGetScaleWidth(184));
}
@@ -480,7 +484,7 @@
///gameIdmewRecommendList
if(self.gameId != nil && self.mewFriendList.count == 0){
if(self.mewRecommendList.count == 0){
XPHomeListEmptyCollectionViewCell * emptyCell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPHomeListEmptyCollectionViewCell class]) forIndexPath:indexPath];
MewMainHomeEmptyCell * emptyCell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([MewMainHomeEmptyCell class]) forIndexPath:indexPath];
return emptyCell;
}
MewMainHomeMakeFriendCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([MewMainHomeMakeFriendCell class]) forIndexPath:indexPath];
@@ -490,7 +494,7 @@
}
if(self.mewFriendList.count == 0){
XPHomeListEmptyCollectionViewCell * emptyCell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPHomeListEmptyCollectionViewCell class]) forIndexPath:indexPath];
MewMainHomeEmptyCell * emptyCell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([MewMainHomeEmptyCell class]) forIndexPath:indexPath];
return emptyCell;
}
MewMainHomeMakeFriendCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([MewMainHomeMakeFriendCell class]) forIndexPath:indexPath];
@@ -531,7 +535,7 @@
_mewCollectionView.delegate = self;
_mewCollectionView.dataSource = self;
[_mewCollectionView registerClass:[XPHomeListEmptyCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPHomeListEmptyCollectionViewCell class])];
[_mewCollectionView registerClass:[MewMainHomeEmptyCell class] forCellWithReuseIdentifier:NSStringFromClass([MewMainHomeEmptyCell class])];
[_mewCollectionView registerClass:[MewMainHomeMakeFriendHeadView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:NSStringFromClass([MewMainHomeMakeFriendHeadView class])];
[_mewCollectionView registerClass:[MewMainHomeMakeFriendCell class] forCellWithReuseIdentifier:NSStringFromClass([MewMainHomeMakeFriendCell class])];

View File

@@ -7,7 +7,7 @@
#import "MewMainHomeMoreGameVC.h"
#import "MewMainHomeMoreGameCell.h"
#import "XPHomeListEmptyCollectionViewCell.h"
#import "MewMainHomeEmptyCell.h"
#import "MewMainHomeMoreGameHeadView.h"
#import "MewHomeManager.h"
#import "Api+Room.h"
@@ -70,6 +70,7 @@
self.mewGameList = [NSMutableArray arrayWithArray:list];
MewMainHomeLittleGameInfoModel *gameInfo = [MewMainHomeLittleGameInfoModel new];
gameInfo.mgId = @"-9999";
gameInfo.name = @"扩列交友";
[self.mewGameList addObject:gameInfo];
[self.mewCollectionView reloadData];
}
@@ -80,6 +81,7 @@
}
#pragma mark - MewMainHomeMoreGameHeadViewDelegate
- (void)mew_selectGameAction:(MewMainHomeLittleGameInfoModel *)gameInfo{
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventRecent_homepage_moregame_tab_click eventAttributes:@{@"name":gameInfo.name}];
NSString * uid = [AccountInfoStorage instance].getUid;
if (gameInfo.mgId.length > 0 && uid.length > 0) {
[Api mew_RequestMainHomePickResource:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
@@ -167,7 +169,7 @@
}
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
if(self.mewRoomList.count == 0){
XPHomeListEmptyCollectionViewCell * emptyCell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPHomeListEmptyCollectionViewCell class]) forIndexPath:indexPath];
MewMainHomeEmptyCell * emptyCell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([MewMainHomeEmptyCell class]) forIndexPath:indexPath];
return emptyCell;
}
MewMainHomeMoreGameCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([MewMainHomeMoreGameCell class]) forIndexPath:indexPath];
@@ -204,7 +206,7 @@
_mewCollectionView.delegate = self;
_mewCollectionView.dataSource = self;
[_mewCollectionView registerClass:[XPHomeListEmptyCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPHomeListEmptyCollectionViewCell class])];
[_mewCollectionView registerClass:[MewMainHomeEmptyCell class] forCellWithReuseIdentifier:NSStringFromClass([MewMainHomeEmptyCell class])];
[_mewCollectionView registerClass:[MewMainHomeMoreGameHeadView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:NSStringFromClass([MewMainHomeMoreGameHeadView class])];
[_mewCollectionView registerClass:[MewMainHomeMoreGameCell class] forCellWithReuseIdentifier:NSStringFromClass([MewMainHomeMoreGameCell class])];

View File

@@ -8,7 +8,7 @@
#import "MewMainHomePartyVC.h"
#import "MewMainHomePartyHeadView.h"
#import "MewMainHomePartyCell.h"
#import "XPHomeListEmptyCollectionViewCell.h"
#import "MewMainHomeEmptyCell.h"
#import "MewHomeManager.h"
#import "MewMainHomeProtocol.h"
#import "XPWebViewController.h"
@@ -58,6 +58,7 @@
if (_parentMode) return;
[self.presenter mew_requestMainHomeTopDataList];
[self.presenter mew_requestMainHomeGiftRecordList];
[self.presenter mew_getMainHomeBannerList];
[self.presenter mew_requestMainHomePersonalRoomList:[AccountInfoStorage instance].getUid];
}
@@ -83,16 +84,14 @@
///
-(void)mew_getHomeGiftRecordListFail{
}
-(void)mew_getMainHomeBannerListSuccess:(NSArray *)list{
self.mewBannerArray = list;
[self.mewCollectionView reloadData];
}
//
-(void)mew_getHomePersonalRoomListSuccess:(NSArray *)list{
self.mewDataList = list;
for (MewMainHomeHotRoomModel *obj in list) {
if(obj.isBanner){
self.mewBannerArray = obj.bannerVoList;
break;
}
}
if(self.delegate && [self.delegate respondsToSelector:@selector(mew_RefreshSucceed:)]){
[self.delegate mew_RefreshSucceed:self];
}
@@ -106,6 +105,7 @@
#pragma mark - MewMainHomePartyHeadViewDelegate
/// banner
- (void)mewClickBannerAction:(MewMainHomeBannerInfoModel *_Nullable)info{
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventRecent_homepage_banner_click];
switch (info.skipType) {
case MewMainHomeBannerInfoModelSkipType_Room:
{
@@ -127,7 +127,10 @@
}
///item
- (void)mew_clickMainHomeHeadScrollView:(MewMainHomeGiftRecordModel *_Nullable)model{
if (model.roomUid.length > 0) {
if(model.roomUid.length > 0){
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventRecent_homepage_inform_click eventAttributes:@{@"roomUid":model.roomUid}];
}
if (model.roomUid.length > 0 && model.lock == NO) {
[XPRoomViewController openRoom:model.roomUid fromNick:nil fromType:UserEnterRoomFromType_Home_Recommend fromUid:nil viewController:self];
}
}
@@ -135,7 +138,7 @@
- (void)mew_clickMainHomeHeadViewMenu:(MewMainHomeMenuInfoModel *_Nullable)info{
if(info.isMorn == YES){
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventRecent_homepage_top_moregame_click];
MewMainHomeMoreGameVC *moreGameVC = [MewMainHomeMoreGameVC new];
[self.navigationController pushViewController:moreGameVC animated:YES];
return;
@@ -146,6 +149,11 @@
webVC.url = info.resourceContent;
[self.navigationController pushViewController:webVC animated:YES];
}else {
NSDictionary *typeDic = @{@"1":@"A",@"2":@"B",@"3":@"C",@"4":@"D"};
if(typeDic[info.hid]){
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventRecent_homepage_top_resource_click eventAttributes:@{@"type":typeDic[info.hid]}];
}
NSString * uid = [AccountInfoStorage instance].getUid;
if (info.hid.length > 0 && uid.length > 0) {
[Api mew_RequestMainHomePickResource:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
@@ -254,7 +262,7 @@
}
- (__kindof UICollectionViewCell *)collectionView:(UICollectionView *)collectionView cellForItemAtIndexPath:(NSIndexPath *)indexPath {
if(self.mewDataList.count == 0){
XPHomeListEmptyCollectionViewCell * emptyCell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([XPHomeListEmptyCollectionViewCell class]) forIndexPath:indexPath];
MewMainHomeEmptyCell * emptyCell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([MewMainHomeEmptyCell class]) forIndexPath:indexPath];
return emptyCell;
}
MewMainHomePartyCell *cell = [collectionView dequeueReusableCellWithReuseIdentifier:NSStringFromClass([MewMainHomePartyCell class]) forIndexPath:indexPath];
@@ -266,6 +274,7 @@
if(self.mewDataList.count == 0)return;
MewMainHomeHotRoomModel *roomModel = [self.mewDataList safeObjectAtIndex1:indexPath.row];
[XPRoomViewController openRoom:roomModel.uid viewController:self];
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventRecent_homepage_room_click eventAttributes:@{@"erbanNo":roomModel.erbanNo}];
}
#pragma mark -
- (UICollectionView *)mewCollectionView{
@@ -281,7 +290,7 @@
_mewCollectionView.dataSource = self;
[_mewCollectionView registerClass:[MewMainHomePartyHeadView class] forSupplementaryViewOfKind:UICollectionElementKindSectionHeader withReuseIdentifier:NSStringFromClass([MewMainHomePartyHeadView class])];
[_mewCollectionView registerClass:[MewMainHomePartyCell class] forCellWithReuseIdentifier:NSStringFromClass([MewMainHomePartyCell class])];
[_mewCollectionView registerClass:[XPHomeListEmptyCollectionViewCell class] forCellWithReuseIdentifier:NSStringFromClass([XPHomeListEmptyCollectionViewCell class])];
[_mewCollectionView registerClass:[MewMainHomeEmptyCell class] forCellWithReuseIdentifier:NSStringFromClass([MewMainHomeEmptyCell class])];
}

View File

@@ -67,6 +67,8 @@
if (_mewTimer) {
[_mewTimer setFireDate:[NSDate distantPast]]; //
}
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventRecent_homepage_show];
}
- (void)viewWillDisappear:(BOOL)animated {
@@ -172,7 +174,7 @@
- (void)categoryView:(JXCategoryBaseView *)categoryView didSelectedItemAtIndex:(NSInteger)index {
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventRecent_homepage_top_tab_click eventAttributes:index == 0 ? @{@"type" : @"1"}:@{@"type" : @"2"}];
}
#pragma mark - JXPagerMainTableViewGestureDelegate
@@ -187,12 +189,14 @@
#pragma mark- MewMainHomeNavViewDelegate
///
- (void)mew_MainHomeNavView:(MewMainHomeNavView *_Nullable)view didClickSearch:(UIView *_Nullable)sender{
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventRecent_homepage_top_search_click];
XPRoomSearchContainerViewController * searchVC = [[XPRoomSearchContainerViewController alloc] init];
searchVC.modalPresentationStyle = UIModalPresentationFullScreen;
[self.navigationController presentViewController:searchVC animated:YES completion:nil];
}
///
- (void)mew_MainHomeNavView:(MewMainHomeNavView *_Nullable)view didClickRank:(UIButton *_Nullable)sender{
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventRecent_homepage_top_rank_click];
NSString *url = @"";
if([ClientConfig shareConfig].configInfo.h5Uris.count > 0){
for (XPClientH5UresModel *h5Model in [ClientConfig shareConfig].configInfo.h5Uris) {
@@ -209,6 +213,7 @@
}
///
- (void)mew_MainHomeNavView:(MewMainHomeNavView *_Nullable)view didClickRoom:(UIButton *_Nullable)sender{
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventRecent_homepage_top_myroom_click];
NSString* roomUid = [AccountInfoStorage instance].getUid;
[Api getRoomInfo:^(BaseModel * _Nullable data, NSInteger code, NSString * _Nullable msg) {
if (code == 200) {

View File

@@ -612,6 +612,17 @@ UIKIT_EXTERN NSString *kTabShowAnchorCardKey;
[[UITabBar appearance] setUnselectedItemTintColor:[ThemeColor tabbarNormalColor]];
}
}
-(void)tabBar:(UITabBar *)tabBar didSelectItem:(UITabBarItem *)item{
if([item.title isEqualToString:@"首页"]){
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventRecent_homepage_bar_click eventAttributes:@{@"type" : @"首页"}];
}else if([item.title isEqualToString:@"广场"]){
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventRecent_homepage_bar_click eventAttributes:@{@"type" : @"广场"}];
}else if([item.title isEqualToString:@"消息"]){
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventRecent_homepage_bar_click eventAttributes:@{@"type" : @"消息"}];
}else{
[StatisticsServiceHelper trackEventWithKey:StatisticsServiceEventRecent_homepage_bar_click eventAttributes:@{@"type" : @"我的"}];
}
}
- (void)initTabs:(BOOL)logined {
self.viewControllers = nil;