覆盖羽声

This commit is contained in:
启星
2025-10-20 09:43:10 +08:00
parent affed1af58
commit 0d82f9e0ef
1331 changed files with 43209 additions and 14707 deletions

View File

@@ -17,7 +17,7 @@
[super viewDidLoad];
// Do any additional setup after loading the view.
self.bgImaegView = [[UIImageView alloc] initWithFrame:[UIScreen mainScreen].bounds];
self.bgImaegView.image = [UIImage imageNamed:@"启动页"];;
self.bgImaegView.image = [UIImage imageNamed:@"app_start_midi1"];;
self.bgImaegView.contentMode = UIViewContentModeScaleAspectFill;
[self.view addSubview:self.bgImaegView];
// [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(loginSuccess) name:noticeUserLogin object:nil];

View File

@@ -43,7 +43,7 @@
-(void)navigationController:(UINavigationController *)navigationController didShowViewController:(UIViewController *)viewController animated:(BOOL)animated{
if (self.childViewControllers.count > 1) {
if ([self respondsToSelector:@selector(interactivePopGestureRecognizer)]) {
if ([self.visibleViewController isKindOfClass:NSClassFromString(@"QXRoomViewController")]) {
if ([self.visibleViewController isKindOfClass:NSClassFromString(@"QXRoomViewController")] || [self.visibleViewController isKindOfClass:NSClassFromString(@"QXChirldViewController")]) {
self.interactivePopGestureRecognizer.enabled = NO;
}else{
self.interactivePopGestureRecognizer.enabled = YES;

View File

@@ -15,16 +15,6 @@
typedef void (^closeBlock)(void);
typedef void (^showFinishBlock)(void);
typedef NS_ENUM(NSInteger) {
/// 房主
QXRoomRoleTypeOwner = 0,
/// 主持
QXRoomRoleTypeCompere,
/// 管理员
QXRoomRoleTypeManager,
/// 观众
QXRoomRoleTypeAudience,
}QXRoomRoleType;
@interface QXGlobal : NSObject
@@ -57,6 +47,10 @@ typedef NS_ENUM(NSInteger) {
@property (nonatomic,strong) QXRoomViewController *roomVC;
@property (nonatomic,strong) NSMutableDictionary *offLineDict;
@property (nonatomic,strong)NSString *superRoomId;
-(void)miniRoomWithRoomId:(NSString*)roomId roomCover:(NSString*)roomCover;

View File

@@ -20,11 +20,14 @@
#import "QXTimer.h"
#import <TIMPush/TIMPushManager.h>
#import "QXManagerMqtt.h"
#import "QXRedPacketManager.h"
@interface QXGlobal()
@property (nonatomic,assign)BOOL isLogin;
@property (nonatomic,strong)NSString *roomId;
@property (nonatomic,assign)BOOL isClickJoinRoom;
@property (nonatomic,strong)QXTimer *timer;
@property (nonatomic,assign)NSInteger taskTime;
@end
@@ -193,6 +196,7 @@
[[QXGlobal shareGlobal] logOut];
return;
}
navagationController = (QXBaseNavigationController*)KEYWINDOW.rootViewController;
// navagationController.interactivePopGestureRecognizer.enabled = NO;
if (_miniView) {
@@ -203,7 +207,9 @@
if ([navagationController.viewControllers containsObject:self.roomVC]) {
return;
}else{
[UIApplication sharedApplication].idleTimerDisabled = YES;
self.roomVC.hidesBottomBarWhenPushed = YES;
[self.roomVC playHWDMP4];
[navagationController pushViewController:self.roomVC animated:YES];
}
return;
@@ -211,28 +217,68 @@
if (self.roomId && ![self.roomId isEqualToString:roomId]) {
[self quitRoomWithRoomId:self.roomId];
}
[UIApplication sharedApplication].idleTimerDisabled = YES;
MJWeakSelf
if (isRejoin) {
if (self.roomVC!=nil) {
[self.roomVC playHWDMP4];
self.roomVC.hidesBottomBarWhenPushed = YES;
[navagationController pushViewController:self.roomVC animated:YES];
}else{
self.roomVC = [[QXRoomViewController alloc] init];
self.roomVC.roomId = roomId;
self.roomVC.isReJoin = isRejoin;
self.roomId = roomId;
self.roomVC.hidesBottomBarWhenPushed = YES;
[navagationController pushViewController:self.roomVC animated:YES];
if (weakSelf.isClickJoinRoom) {
return;
}
// showLoadingInView(KEYWINDOW)
weakSelf.isClickJoinRoom = YES;
[[QXRoomMessageManager shared] joinGroupWithRoomId:roomId];
[QXMineNetwork joinRoomWithRoomId:roomId successBlock:^(QXRoomModel * _Nonnull roomModel) {
[UIApplication sharedApplication].idleTimerDisabled = YES;
// hideLoadingInView(KEYWINDOW)
// roomModel.room_info.pk_room_id = @"33";
weakSelf.isClickJoinRoom = NO;
weakSelf.roomVC = [[QXRoomViewController alloc] init];
weakSelf.roomVC.roomId = roomId;
weakSelf.roomVC.isReJoin = isRejoin;
weakSelf.roomId = roomId;
weakSelf.roomVC.roomModel = roomModel;
weakSelf.roomVC.hidesBottomBarWhenPushed = YES;
[navagationController pushViewController:weakSelf.roomVC animated:YES];
weakSelf.roomId = roomId;
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
// hideLoadingInView(KEYWINDOW)
weakSelf.isClickJoinRoom = NO;
}];
}
}else{
if ([roomId isEqualToString:self.roomVC.roomId]) {
[self.roomVC playHWDMP4];
[navagationController pushViewController:self.roomVC animated:YES];
}else{
self.roomVC = [[QXRoomViewController alloc] init];
self.roomVC.roomId = roomId;
self.roomVC.isReJoin = isRejoin;
self.roomId = roomId;
self.roomVC.hidesBottomBarWhenPushed = YES;
[navagationController pushViewController:self.roomVC animated:YES];
// showLoadingInView(KEYWINDOW)
if (weakSelf.isClickJoinRoom) {
return;
}
weakSelf.isClickJoinRoom = YES;
[[QXRoomMessageManager shared] joinGroupWithRoomId:roomId];
[QXMineNetwork joinRoomWithRoomId:roomId successBlock:^(QXRoomModel * _Nonnull roomModel) {
// hideLoadingInView(KEYWINDOW)
// roomModel.room_info.pk_room_id = @"33";
[UIApplication sharedApplication].idleTimerDisabled = YES;
weakSelf.isClickJoinRoom = NO;
weakSelf.roomVC = [[QXRoomViewController alloc] init];
weakSelf.roomVC.roomId = roomId;
weakSelf.roomVC.isReJoin = isRejoin;
weakSelf.roomId = roomId;
weakSelf.roomVC.roomModel = roomModel;
weakSelf.roomVC.hidesBottomBarWhenPushed = YES;
[navagationController pushViewController:weakSelf.roomVC animated:YES];
weakSelf.roomId = roomId;
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
weakSelf.isClickJoinRoom = NO;
showToast(msg);
// hideLoadingInView(KEYWINDOW)
}];
}
}
if (QXGlobal.shareGlobal.taskModel != nil) {
@@ -253,16 +299,27 @@
-(void)quitRoomWithRoomId:(NSString *)roomId{
[UIApplication sharedApplication].idleTimerDisabled = NO;
///
[[QXRedPacketManager sharedManager] destoryRedpacketInfo];
///
[[QXGiftPlayerManager shareManager] destroyEffectSvga];
/// 退
[[QXAgoraEngine sharedEngine] leaveChannel];
///
[[QXAgoraEngine sharedEngine] ktv_DestoryKtvPlayer];
///
[[QXAgoraEngine sharedEngine] destroyEngine];
/// 退
[[QXRoomMessageManager shared] quitGroupWithRoomId:roomId];
[[QXGlobal shareGlobal].offLineDict removeAllObjects];
[[NSNotificationCenter defaultCenter] removeObserver:self];
if (_roomVC) {
///
[_roomVC.seatContentView destroyViews];
///
[_roomVC destroyViews];
}
self.roomId = nil;
_roomVC = nil;
/// http退
@@ -294,4 +351,10 @@
UIImpactFeedbackGenerator *generator = [[UIImpactFeedbackGenerator alloc] initWithStyle:UIImpactFeedbackStyleHeavy];
[generator impactOccurred];
}
-(NSMutableDictionary *)offLineDict{
if (!_offLineDict) {
_offLineDict = [NSMutableDictionary dictionary];
}
return _offLineDict;
}
@end

View File

@@ -1,38 +0,0 @@
//
// QXLocationManager.h
// YSDTrucksProject
//
// Created by 党凯 on 2020/7/17.
// Copyright © 2020 党凯. All rights reserved.
//
#import <Foundation/Foundation.h>
@protocol QXLocationManagerDelegate <NSObject>
@optional
-(void)locationSuccessWithCity:(NSString*_Nonnull)city province:(NSString*_Nonnull)province area:(NSString*_Nonnull)area address:(NSString*_Nonnull)address;
@end
NS_ASSUME_NONNULL_BEGIN
@interface QXLocationManager : NSObject
@property (nonatomic,weak)id<QXLocationManagerDelegate>delegate;
+(instancetype)shareManager;
/**
开始定位
*/
-(void)startLoction;
/**
结束定位
*/
-(void)stopLoction;
@end
NS_ASSUME_NONNULL_END

View File

@@ -1,155 +0,0 @@
//
// QXLocationManager.m
// YSDTrucksProject
//
// Created by on 2020/7/17.
// Copyright © 2020 . All rights reserved.
//
#import "QXLocationManager.h"
@interface QXLocationManager()<CLLocationManagerDelegate>
@property (nonatomic,strong)CLLocationManager *lcManager;
@end
@implementation QXLocationManager
+(instancetype)shareManager{
static QXLocationManager *manager = nil;
static dispatch_once_t predicate;
dispatch_once(&predicate, ^{
manager = [[QXLocationManager alloc] init];
});
return manager;
}
- (instancetype)init
{
self = [super init];
if (self) {
// [AMapServices sharedServices].apiKey = mapKey;
// _locationManager = [[AMapLocationManager alloc] init];
// //
// [_locationManager setDesiredAccuracy:kCLLocationAccuracyHundredMeters];
// // 2s2s
// _locationManager.locationTimeout =2;
// // 2s2s
// _locationManager.reGeocodeTimeout = 2;
// _locationManager.delegate = self;
// if ([CLLocationManager authorizationStatus]) {
//
self.lcManager = [[CLLocationManager alloc] init];
self.lcManager.delegate = self; //
// ()
self.lcManager.distanceFilter = 100;
self.lcManager.desiredAccuracy = kCLLocationAccuracyBest; // ()
[self.lcManager requestWhenInUseAuthorization];//
// [self.lcManager startUpdatingLocation]; //
// }else{
//
// //
//
// }
}
return self;
}
//-(void)amapLocationManager:(AMapLocationManager *)manager doRequireLocationAuth:(CLLocationManager *)locationManager{
// if ([CLLocationManager authorizationStatus] == kCLAuthorizationStatusNotDetermined) {
// [locationManager requestAlwaysAuthorization];
// }
//}
-(void)locationManager:(CLLocationManager *)manager didUpdateLocations:(NSArray *)locations{
NSLog(@"定位到了");
__weak typeof(self)weakSelf = self;
CLGeocoder *geocoder = [[CLGeocoder alloc]init];
[geocoder reverseGeocodeLocation:[locations firstObject] completionHandler:^(NSArray<CLPlacemark *> *_Nullable placemarks, NSError * _Nullable error) {
CLPlacemark *place = [placemarks firstObject];
//place
if (weakSelf.delegate && [weakSelf.delegate respondsToSelector:@selector(locationSuccessWithCity:province:area:address:)]) {
///
NSString *province = place.administrativeArea;
///
NSString *city = place.locality;
///
NSString *area = place.subLocality;
[weakSelf.delegate locationSuccessWithCity:place.locality province:province area:area address:place.name];
}
}];
}
-(void)locationManager:(CLLocationManager *)manager didFailWithError:(NSError *)error{
NSLog(@"获取定位失败");
}
-(void)startLoction{
if (![self checkAuthorization]) {
UIAlertController *al = [UIAlertController alertControllerWithTitle:@"您没有打开定位权限" message:nil preferredStyle:(UIAlertControllerStyleAlert)];
[al addAction:[UIAlertAction actionWithTitle:@"取消" style:(UIAlertActionStyleCancel) handler:^(UIAlertAction * _Nonnull action) {
}]];
[al addAction:[UIAlertAction actionWithTitle:@"去设置" style:(UIAlertActionStyleDefault) handler:^(UIAlertAction * _Nonnull action) {
//
NSURL * url = [NSURL URLWithString:UIApplicationOpenSettingsURLString];
if([[UIApplication sharedApplication] canOpenURL:url]) {
[[UIApplication sharedApplication] openURL:url options:@{} completionHandler:nil];
}
}]];
[KEYWINDOW.rootViewController presentViewController:al animated:YES completion:nil];
// [self.locationManager requestLocationWithReGeocode:YES completionBlock:^(CLLocation *location, AMapLocationReGeocode *regeocode, NSError *error) {
// resultBlock(location,regeocode,error);
// }];
[self.lcManager startUpdatingLocation];
}else{
// [self.locationManager requestLocationWithReGeocode:YES completionBlock:^(CLLocation *location, AMapLocationReGeocode *regeocode, NSError *error) {
// resultBlock(location,regeocode,error);
// }];
[self.lcManager startUpdatingLocation];
}
}
-(void)stopLoction{
[self.lcManager stopUpdatingLocation];
}
//
-(BOOL)checkAuthorization{
BOOL result = NO;
CLAuthorizationStatus status = [CLLocationManager authorizationStatus];
switch (status) {
//
case kCLAuthorizationStatusDenied:
result = NO;
break;
//使
case kCLAuthorizationStatusNotDetermined:
result = YES;
break;
//
case kCLAuthorizationStatusRestricted:
result = NO;
break;
//App使
case kCLAuthorizationStatusAuthorizedAlways:
result = YES;
break;
//使使
case kCLAuthorizationStatusAuthorizedWhenInUse:
result = YES;
break;
default:
break;
}
return result;
}
@end