覆盖羽声
This commit is contained in:
@@ -22,17 +22,25 @@
|
||||
|
||||
//弹窗
|
||||
#import "QXChirldPopView.h" // 青少年
|
||||
#import "QXNiceGiftPopView.h" // 天降好礼
|
||||
#import "QXFirstRechargePopView.h" // 首充
|
||||
//#import "QXFirstRechargePopView.h" // 首充
|
||||
#import "QXInvitePopView.h" // 邀请
|
||||
#import "QXGiftDriftView.h" // 礼物飘屏
|
||||
#import "QXRedPacketDriftView.h" // 红包飘屏
|
||||
#import <ImSDK_Plus/ImSDK_Plus.h>
|
||||
#import "QXMessageServices.h"
|
||||
|
||||
#import "QXMeetActivityDriftView.h" // 巡乐会
|
||||
#import "QXChirldModeViewController.h"
|
||||
#import "QXAppVersionView.h"
|
||||
#import "QXLoginNetwork.h"
|
||||
#import "QXDrifRoomHourRankView.h"
|
||||
|
||||
@interface QXTabbarController ()<UITabBarControllerDelegate,QXTabBarDelegate,UINavigationControllerDelegate,MQTTClientModelDelegate,V2TIMConversationListener>
|
||||
@property(nonatomic,strong) QXTabBar *customTabBar;
|
||||
@property(nonatomic,strong) QXHomeViewController *homeVC;
|
||||
@property(nonatomic,strong) QXMeetActivityDriftView *meetView;
|
||||
@property(nonatomic,assign) BOOL isAlreadyShowChirld;
|
||||
@property(nonatomic,strong) QXAppVersionView *appUpdateView;
|
||||
@end
|
||||
|
||||
@implementation QXTabbarController
|
||||
@@ -52,9 +60,36 @@
|
||||
return;
|
||||
}
|
||||
if (QXGlobal.shareGlobal.isLogin) {
|
||||
[self performSelector:@selector(popChirldView) afterDelay:1];
|
||||
// [self performSelector:@selector(popChirldView) afterDelay:1];
|
||||
[self popChirldView];
|
||||
}
|
||||
QXLOG(@"视图即将展示");
|
||||
[self getAppVersion];
|
||||
}
|
||||
|
||||
-(void)getAppVersion{
|
||||
MJWeakSelf
|
||||
[QXLoginNetwork getAppVersionSuccessBlock:^(QXAppVersionModel * _Nonnull model) {
|
||||
|
||||
NSString *currentVersion = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"];
|
||||
NSString *latestVersion = model.version; // 从服务器获取的最新版本
|
||||
NSInteger result = [QXVersionComparator compareVersion:latestVersion withOldVersion:currentVersion];
|
||||
switch (result) {
|
||||
case 1:
|
||||
NSLog(@"需要更新:新版本 %@ 比当前版本 %@ 新", latestVersion, currentVersion);
|
||||
weakSelf.appUpdateView.model = model;
|
||||
[weakSelf.appUpdateView showInView:KEYWINDOW];
|
||||
break;
|
||||
case 0:
|
||||
NSLog(@"版本相同:当前版本 %@ 已是最新", currentVersion);
|
||||
break;
|
||||
case -1:
|
||||
NSLog(@"版本异常:新版本 %@ 比当前版本 %@ 旧", latestVersion, currentVersion);
|
||||
break;
|
||||
}
|
||||
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
|
||||
|
||||
}];
|
||||
}
|
||||
#pragma mark - 青少年模式
|
||||
-(void)popChirldView{
|
||||
@@ -65,6 +100,7 @@
|
||||
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
||||
QXLOG(@"页面关闭");
|
||||
// [weakSelf popNiceGiftView];
|
||||
[weakSelf.homeVC popFirstRechargeView];
|
||||
}];
|
||||
};
|
||||
view.gotoActionBlock = ^{
|
||||
@@ -84,7 +120,8 @@
|
||||
}];
|
||||
}
|
||||
-(void)pushToChirld{
|
||||
QXChirldViewController *vc = [[QXChirldViewController alloc] init];
|
||||
QXChirldModeViewController *vc = [[QXChirldModeViewController alloc] init];
|
||||
vc.type = 0;
|
||||
[self.navigationController pushViewController:vc animated:YES];
|
||||
}
|
||||
|
||||
@@ -107,30 +144,7 @@
|
||||
//
|
||||
// }];
|
||||
}
|
||||
-(void)popNiceGiftView{
|
||||
MJWeakSelf
|
||||
QXNiceGiftPopView *view = [[QXNiceGiftPopView alloc] init];
|
||||
view.closeActionBlock = ^{
|
||||
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
||||
QXLOG(@"页面关闭");
|
||||
[weakSelf popFirstRechargeView];
|
||||
}];
|
||||
};
|
||||
view.getActionBlock = ^{
|
||||
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
||||
QXLOG(@"页面关闭");
|
||||
}];
|
||||
};
|
||||
view.ruleActionBlock = ^{
|
||||
[[QXGlobal shareGlobal].alertViewController hideViewFinishBlock:^{
|
||||
QXLOG(@"页面关闭");
|
||||
}];
|
||||
};
|
||||
view.giftArray = @[@"",@"",@"",@"",@"",@""];
|
||||
[[QXGlobal shareGlobal] showView:view popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{
|
||||
|
||||
}];
|
||||
}
|
||||
|
||||
|
||||
-(void)popInvitePopView{
|
||||
QXInvitePopView *view = [[QXInvitePopView alloc] init];
|
||||
@@ -171,7 +185,7 @@
|
||||
// }
|
||||
QXTabbarConfig *config = [QXTabbarConfig shareInstance];
|
||||
config.imageOffset = -5;
|
||||
QXTabBar *customTabBar = [[QXTabBar alloc] initWithFrame:CGRectMake(15, 0, SCREEN_WIDTH-30, 50) centerCustom:NO config:config];
|
||||
QXTabBar *customTabBar = [[QXTabBar alloc] initWithFrame:CGRectMake(0, 0, SCREEN_WIDTH, TabbarContentHeight) centerCustom:NO config:config];
|
||||
customTabBar.backgroundColor = [UIColor whiteColor];
|
||||
customTabBar.layer.shadowColor = [UIColor grayColor].CGColor;
|
||||
customTabBar.layer.shadowOpacity = 0.5;
|
||||
@@ -179,8 +193,8 @@
|
||||
customTabBar.layer.shadowRadius = 25.0;
|
||||
customTabBar.layer.shadowPath = [UIBezierPath bezierPathWithRoundedRect:customTabBar.bounds cornerRadius:customTabBar.layer.cornerRadius].CGPath;
|
||||
customTabBar.delegate = self;
|
||||
customTabBar.layer.cornerRadius = 25.0;
|
||||
customTabBar.layer.masksToBounds = NO;
|
||||
// customTabBar.layer.cornerRadius = 25.0;
|
||||
// customTabBar.layer.masksToBounds = NO;
|
||||
self.selectedIndex = 0;
|
||||
// [self.view addSubview:customTabBar];
|
||||
self.customTabBar = customTabBar;
|
||||
@@ -254,9 +268,40 @@
|
||||
}
|
||||
|
||||
-(void)socketManager:(NSString *)socketManager receivedMessage:(NSDictionary *)message topic:(NSString *)topic{
|
||||
QXGiftScrollModel *model = [QXGiftScrollModel yy_modelWithJSON:message[@"msg"][@"list"]];
|
||||
[self.homeVC giftScrollViewShowWithModel:model];
|
||||
[[QXGiftDriftView shareView] addGiftModel:model];
|
||||
if ([topic isEqualToString:qx_room_topic]) {
|
||||
NSArray *array = [NSArray yy_modelArrayWithClass:[QXGiftScrollModel class] json:message[@"msg"][@"list"]];
|
||||
if (array.count == 0) {
|
||||
return;
|
||||
}
|
||||
[self.homeVC giftScrollViewShowWithModelList:array];
|
||||
[[QXGiftDriftView shareView] addGiftModelList:array];
|
||||
}else if([topic isEqualToString:qx_ac_topic]){
|
||||
// QXManagerMqttType
|
||||
QXMeetActivityDriftModel *model = [QXMeetActivityDriftModel yy_modelWithJSON:message[@"msg"]];
|
||||
if (model.from_type == QXMeetActivityTypeAcProgress) {
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:noticeXLHNotice object:model];
|
||||
return;
|
||||
}
|
||||
if (model.from_type == QXMeetActivityTypeAcLock) {
|
||||
[[NSNotificationCenter defaultCenter] postNotificationName:noticeXLHNotice object:model];
|
||||
}
|
||||
[[QXMeetActivityDriftView shareView] addActivityModel:model];
|
||||
}else if ([topic isEqualToString:qx_hour_ranking]){
|
||||
NSArray *arr = [NSArray yy_modelArrayWithClass:[QXRoomHourDriftModel class] json:message[@"msg"]];
|
||||
[[QXDrifRoomHourRankView shareView] addActivityModelList:arr];
|
||||
}else if ([topic isEqualToString:qx_red_redpacket]){
|
||||
QXRedPacketDriftModel *model = [QXRedPacketDriftModel yy_modelWithJSON:message[@"msg"]];
|
||||
[[QXRedPacketDriftView shareView] addRedpacketModel:model];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
-(QXAppVersionView *)appUpdateView{
|
||||
if (!_appUpdateView) {
|
||||
_appUpdateView = [[QXAppVersionView alloc] init];
|
||||
}
|
||||
return _appUpdateView;
|
||||
}
|
||||
|
||||
//-(BOOL)tabBarController:(UITabBarController *)tabBarController shouldSelectViewController:(UIViewController *)viewController{
|
||||
|
||||
Reference in New Issue
Block a user