This commit is contained in:
启星
2025-12-22 10:16:05 +08:00
parent ba4fd658a9
commit 0fcff85625
205 changed files with 26298 additions and 13203 deletions

View File

@@ -39,6 +39,8 @@
@property (nonatomic,strong)NSTimer *keepTimer;
@property (nonatomic,assign)NSInteger taskTime;
@property (nonatomic,assign)BOOL isAlert;
@end
@implementation QXGlobal
+ (instancetype)shareGlobal {
@@ -214,7 +216,10 @@
[navagationController pushViewController:vc animated:YES];
}
-(void)joinRoomWithRoomId:(NSString *)roomId isRejoin:(BOOL)isRejoin navagationController:(UINavigationController *)navagationController{
-(void)joinRoomWithRoomId:(NSString *)roomId isRejoin:(BOOL)isRejoin navagationController:(UINavigationController *)navagationController {
if ([KEYWINDOW.rootViewController isKindOfClass:[NSClassFromString(@"QXAppStartViewController") class]]) {
return;
}
if (!QXGlobal.shareGlobal.isLogin) {
[[QXGlobal shareGlobal] logOut];
return;
@@ -222,10 +227,7 @@
navagationController = (QXRoomNavigationController*)KEYWINDOW.rootViewController;
// navagationController.interactivePopGestureRecognizer.enabled = NO;
if (_miniView) {
[_miniView removeFromSuperview];
_miniView = nil;
}
if (QXGlobal.shareGlobal.taskModel != nil) {
///
if (QXGlobal.shareGlobal.taskModel.task_id.intValue == 9) {
@@ -241,6 +243,10 @@
}
}
if ([roomId isEqualToString:self.roomId]) {
if (_miniView) {
[_miniView removeFromSuperview];
_miniView = nil;
}
if ([navagationController.viewControllers containsObject:self.roomVC]) {
if (![navagationController.visibleViewController isEqual:self.roomVC]) {
[navagationController popToViewController:self.roomVC animated:YES];
@@ -296,31 +302,43 @@
return;
}
weakSelf.isClickJoinRoom = YES;
[[QXRoomMessageManager shared] joinGroupWithRoomId:roomId];
[QXMineNetwork joinRoomWithRoomId:roomId successBlock:^(QXRoomModel * _Nonnull roomModel) {
if (weakSelf.roomId && ![weakSelf.roomId isEqualToString:roomId]) {
[weakSelf quitRoomWithRoomId:weakSelf.roomId removeListener:NO];
}
// hideLoadingInView(KEYWINDOW)
// roomModel.room_info.pk_room_id = @"33";
[UIApplication sharedApplication].idleTimerDisabled = YES;
[QXMineNetwork beforeJoinRoomWithRoomId:roomId successBlock:^(NSDictionary * _Nonnull dict) {
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;
if (self != nil) {
if (self->_miniView) {
[self->_miniView removeFromSuperview];
self->_miniView = nil;
}
}
[[QXRoomMessageManager shared] joinGroupWithRoomId:roomId];
[QXMineNetwork joinRoomWithRoomId:roomId successBlock:^(QXRoomModel * _Nonnull roomModel) {
if (weakSelf.roomId && ![weakSelf.roomId isEqualToString:roomId]) {
[weakSelf quitRoomWithRoomId:weakSelf.roomId removeListener:NO];
}
[[QXRoomMessageManager shared] joinGroupWithRoomId:roomId];
[UIApplication sharedApplication].idleTimerDisabled = YES;
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;
} roomErrorBlock:^(NSString * _Nonnull roomId, NSString * _Nonnull msg) {
[weakSelf showAlertWithMessage:msg roomId:roomId];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
// hideLoadingInView(KEYWINDOW)
}];
} roomErrorBlock:^(NSString * _Nonnull roomId, NSString * _Nonnull msg) {
weakSelf.isClickJoinRoom = NO;
[weakSelf showAlertWithMessage:msg roomId:roomId];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
weakSelf.isClickJoinRoom = NO;
showToast(msg);
// hideLoadingInView(KEYWINDOW)
}];
}
}
}

View File

@@ -90,6 +90,11 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)NSString *theme_color;
/// 按钮颜色
@property (nonatomic,strong)NSString *btn_text_color;
///
//@property (nonatomic,strong)NSString *a;
//@property (nonatomic,strong)NSString *b;
//@property (nonatomic,strong)NSString *c;
//@property (nonatomic,strong)NSString *d;
@end
NS_ASSUME_NONNULL_END

View File

@@ -377,12 +377,14 @@
}
-(void)popSignTask{
MJWeakSelf
QXSignInAppView *view = [[QXSignInAppView alloc] init];
view.cancelBlock = ^{
[weakSelf popRecommendRoom];
};
[view showInView:KEYWINDOW];
if (self.signStatus.intValue != 1) {
MJWeakSelf
QXSignInAppView *view = [[QXSignInAppView alloc] init];
view.cancelBlock = ^{
[weakSelf popRecommendRoom];
};
[view showInView:KEYWINDOW];
}
}
-(void)popRecommendRoom{

View File

@@ -54,6 +54,9 @@ NS_ASSUME_NONNULL_BEGIN
- (long)remainingTime;
/// 检查是否可领取
- (BOOL)canOpenNow;
-(instancetype)copyModel;
@end

View File

@@ -20,6 +20,29 @@
- (BOOL)canOpenNow {
return [self remainingTime] <= 0;
}
-(instancetype)copyModel{
QXRedPacketModel *md = [[QXRedPacketModel alloc] init];
md.redpacket_id = self.redpacket_id;
md.password = self.password;
md.countdown = self.countdown;
md.total_amount = self.total_amount;
md.room_id = self.room_id;
md.type = self.type;
md.total_count = self.total_count;
md.coin_type = self.coin_type;
md.user_id = self.user_id;
md.avatar = self.avatar;
md.nickname = self.nickname;
md.redpacket_time = self.redpacket_time;
md.conditions = self.conditions;
md.remark = self.remark;
md.start_time = self.start_time;
md.left_amount = self.left_amount;
md.left_count = self.left_count;
md.is_qiang = self.is_qiang;
md.isAvailable = self.isAvailable;
return md;
}
@end

View File

@@ -41,6 +41,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)NSString *gift_picture;
@property (nonatomic,strong)NSString *roomId;
@property (nonatomic,strong)NSString *number;
@property (nonatomic,strong)NSString *text;
@end
NS_ASSUME_NONNULL_END

View File

@@ -53,9 +53,9 @@
#pragma mark - QXBlackListCellDelegate
-(void)didClickLoginWithModel:(QXLoginModel *)model{
__block QXLoginModel *loginModel = model;
// __block QXLoginModel *loginModel = model;
MJWeakSelf
[QXLoginNetwork loginAccountWithUser_login:model.user_id successBlock:^(id _Nonnull responseObject) {
[QXLoginNetwork loginAccountWithUser_login:model.user_id successBlock:^(QXLoginModel * _Nonnull loginModel) {
hideLoadingInView(self.view);
[[QXGlobal shareGlobal] saveLoginData:[loginModel yy_modelToJSONString]];
AppDelegate *delegate = (AppDelegate*)[UIApplication sharedApplication].delegate;
@@ -69,7 +69,7 @@
}];
}
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
}];
}

View File

@@ -24,6 +24,7 @@
@property (nonatomic,strong)QXLoginTextField *repasswordTextField;
@property (nonatomic,strong)UIButton *firstCommitBtn;
@property (nonatomic,strong)UIButton *secondCommitBtn;
@property (nonatomic,assign)BOOL isNetworking;
@end
@implementation QXForgotPwdViewController
@@ -137,18 +138,24 @@
// [self.scrollView setContentOffset:CGPointMake(SCREEN_WIDTH, 0) animated:YES];
//}
-(void)didClickSendCode:(UIButton *)sender{
if (self.isNetworking) {
return;
}
if (self.accountTextField.textField.text.length < 11) {
showToast(QXText(@"请输入正确的手机号码"));
return;
}
MJWeakSelf
self.isNetworking = YES;
[QXLoginNetwork getSmscodeWithMobile:self.accountTextField.textField.text
type:(GetSmscodeTypeFindPassword)
successBlock:^(id _Nonnull responseObject) {
weakSelf.isNetworking = NO;
[weakSelf.codeTextField startTimeDown];
}
failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
weakSelf.isNetworking = NO;
}];
}
-(void)commitAction{

View File

@@ -533,6 +533,7 @@
sender.userInteractionEnabled = NO;
MJWeakSelf
[QXLoginNetwork getSmscodeWithMobile:self.accountTextField.textField.text type:GetSmscodeTypeLogin successBlock:^(id _Nonnull responseObject) {
sender.userInteractionEnabled = YES;
[weakSelf.codeTextField startTimeDown];
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
sender.userInteractionEnabled = YES;

114
QXLive/Manager/QXLogger.h Normal file
View File

@@ -0,0 +1,114 @@
//
// QXLogger.h
// QXLive
//
// Created by 启星 on 2025/12/18.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
typedef NS_ENUM(NSUInteger, QXLogLevel) {
QXLogLevelVerbose = 0,
QXLogLevelDebug,
QXLogLevelInfo,
QXLogLevelWarning,
QXLogLevelError,
QXLogLevelFatal,
};
typedef NS_OPTIONS(NSUInteger, QXLogTarget) {
QXLogTargetConsole = 1 << 0,
QXLogTargetFile = 1 << 1,
QXLogTargetNetwork = 1 << 2,
QXLogTargetAll = 0xFF
};
/**
日志配置
*/
@interface QXLogConfig : NSObject
+ (instancetype)sharedConfig;
@property (nonatomic, assign) QXLogLevel minLogLevel;
@property (nonatomic, assign) QXLogTarget logTarget;
@property (nonatomic, assign) NSUInteger maxLogFileSize;
@property (nonatomic, assign) NSUInteger maxLogFileCount;
@property (nonatomic, assign) NSUInteger logSaveDays;
@property (nonatomic, assign) BOOL enableNetworkUpload;
@property (nonatomic, copy, nullable) NSString *uploadURL;
@property (nonatomic, assign) BOOL enableConsoleColor;
@property (nonatomic, assign) BOOL addDateToFile;
@property (nonatomic, copy, nullable) NSString *logPrefix;
@property (nonatomic, assign) BOOL enableAsync;
@property (nonatomic, assign) BOOL encryptLogFile;
@end
/**
日志工具类
*/
@interface QXLogger : NSObject
+ (instancetype)new NS_UNAVAILABLE;
- (instancetype)init NS_UNAVAILABLE;
#pragma mark - 配置
+ (QXLogConfig *)config;
+ (void)updateConfig:(void (^)(QXLogConfig *config))block;
#pragma mark - 基础日志方法
+ (void)verbose:(NSString *)format, ... NS_FORMAT_FUNCTION(1, 2);
+ (void)verboseWithTag:(NSString *)tag format:(NSString *)format, ... NS_FORMAT_FUNCTION(2, 3);
+ (void)debug:(NSString *)format, ... NS_FORMAT_FUNCTION(1, 2);
+ (void)debugWithTag:(NSString *)tag format:(NSString *)format, ... NS_FORMAT_FUNCTION(2, 3);
+ (void)info:(NSString *)format, ... NS_FORMAT_FUNCTION(1, 2);
+ (void)infoWithTag:(NSString *)tag format:(NSString *)format, ... NS_FORMAT_FUNCTION(2, 3);
+ (void)warning:(NSString *)format, ... NS_FORMAT_FUNCTION(1, 2);
+ (void)warningWithTag:(NSString *)tag format:(NSString *)format, ... NS_FORMAT_FUNCTION(2, 3);
+ (void)error:(NSString *)format, ... NS_FORMAT_FUNCTION(1, 2);
+ (void)errorWithTag:(NSString *)tag format:(NSString *)format, ... NS_FORMAT_FUNCTION(2, 3);
+ (void)fatal:(NSString *)format, ... NS_FORMAT_FUNCTION(1, 2);
+ (void)fatalWithTag:(NSString *)tag format:(NSString *)format, ... NS_FORMAT_FUNCTION(2, 3);
#pragma mark - 特殊日志方法
+ (void)network:(NSString *)method url:(NSString *)url params:(nullable id)params response:(nullable id)response error:(nullable NSError *)error;
+ (void)performance:(NSString *)tag startTime:(CFAbsoluteTime)startTime;
+ (void)userAction:(NSString *)action params:(nullable NSDictionary *)params;
+ (void)crash:(NSException *)exception;
+ (void)memoryWarning;
#pragma mark - 文件操作
+ (NSArray<NSString *> *)getAllLogFilePaths;
+ (nullable NSString *)getLatestLogFilePath;
+ (nullable NSString *)getLogContentFromFile:(NSString *)filePath;
+ (void)cleanExpiredLogs;
+ (void)cleanAllLogFiles;
#pragma mark - 文件大小管理
+ (unsigned long long)getCurrentLogFileSize;
+ (CGFloat)getCurrentLogFileSizeMB;
+ (CGFloat)getTotalLogSizeMB;
+ (NSDictionary *)getLogFileInfo:(NSString *)filePath;
+ (NSArray<NSDictionary *> *)getAllLogFileInfos;
+ (void)checkFileSizeManually;
#pragma mark - 网络上报
+ (void)uploadLogsWithCompletion:(void (^)(BOOL success, NSError * _Nullable error))completion;
+ (void)setUploadHandler:(void (^)(NSArray<NSString *> *logFilePaths, void (^complete)(BOOL success)))handler;
#pragma mark - 调试工具
+ (void)enable:(BOOL)enabled;
+ (BOOL)isEnabled;
+ (void)addCustomLogHandler:(void (^)(QXLogLevel level, NSString *tag, NSString *message))handler;
#pragma mark - 初始化
+ (void)setupLogger;
@end
NS_ASSUME_NONNULL_END

886
QXLive/Manager/QXLogger.m Normal file
View File

@@ -0,0 +1,886 @@
//
// QXLogger.m
// QXLive
//
// Created by on 2025/12/18.
//
#import "QXLogger.h"
#import <sys/utsname.h>
#import <mach/mach.h>
#include <CommonCrypto/CommonCrypto.h>
//
static dispatch_queue_t _logQueue = nil;
static QXLogConfig *_config = nil;
static NSMutableArray<NSString *> *_logBuffer = nil;
static NSMutableArray<void (^)(QXLogLevel, NSString *, NSString *)> *_customHandlers = nil;
static BOOL _isEnabled = YES;
static NSDateFormatter *_dateFormatter = nil;
static NSFileHandle *_currentFileHandle = nil;
static NSString *_currentLogFilePath = nil;
static void (^_uploadHandler)(NSArray<NSString *> *, void (^)(BOOL)) = nil;
@implementation QXLogConfig
+ (instancetype)sharedConfig {
static QXLogConfig *instance = nil;
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
instance = [[QXLogConfig alloc] init];
});
return instance;
}
- (instancetype)init {
self = [super init];
if (self) {
_minLogLevel = QXLogLevelDebug;
_logTarget = QXLogTargetConsole | QXLogTargetFile;
_maxLogFileSize = 5 * 1024 * 1024; // 5MB
_maxLogFileCount = 10;
_logSaveDays = 7;
_enableNetworkUpload = NO;
_enableConsoleColor = YES;
_addDateToFile = YES;
_enableAsync = YES;
_encryptLogFile = NO;
}
return self;
}
@end
@implementation QXLogger
#pragma mark -
+ (void)initialize {
if (self == [QXLogger class]) {
static dispatch_once_t onceToken;
dispatch_once(&onceToken, ^{
_logQueue = dispatch_queue_create("com.qx.log.queue", DISPATCH_QUEUE_SERIAL);
_config = [QXLogConfig sharedConfig];
_logBuffer = [NSMutableArray array];
_customHandlers = [NSMutableArray array];
_dateFormatter = [[NSDateFormatter alloc] init];
[_dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss.SSS"];
//
[self setupLogger];
});
}
}
+ (void)setupLogger {
//
[self createLogDirectory];
//
[self cleanExpiredLogs];
//
[self findOrCreateLogFile];
//
[[NSNotificationCenter defaultCenter] addObserver:self
selector:@selector(handleMemoryWarning)
name:UIApplicationDidReceiveMemoryWarningNotification
object:nil];
//
NSSetUncaughtExceptionHandler(&uncaughtExceptionHandler);
[self info:@"QXLogger 初始化完成"];
}
#pragma mark -
+ (void)findOrCreateLogFile {
NSString *logDir = [self logDirectory];
NSFileManager *fm = [NSFileManager defaultManager];
//
NSError *error = nil;
NSArray *files = [fm contentsOfDirectoryAtPath:logDir error:&error];
if (error) {
[self error:@"读取日志目录失败: %@", error.localizedDescription];
[self createNewLogFile];
return;
}
//
NSArray *logFiles = [files filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"SELF BEGINSWITH 'qxlog_'"]];
if (logFiles.count == 0) {
//
[self info:@"没有找到日志文件,创建新文件"];
[self createNewLogFile];
return;
}
//
NSArray *sortedFiles = [logFiles sortedArrayUsingSelector:@selector(compare:)];
NSString *latestFileName = sortedFiles.lastObject;
NSString *latestFilePath = [logDir stringByAppendingPathComponent:latestFileName];
//
NSDictionary *attrs = [fm attributesOfItemAtPath:latestFilePath error:nil];
unsigned long long fileSize = attrs ? [attrs fileSize] : 0;
CGFloat fileSizeMB = fileSize / 1024.0 / 1024.0;
CGFloat maxSizeMB = _config.maxLogFileSize / 1024.0 / 1024.0;
if (fileSize < _config.maxLogFileSize) {
// 使
[self openExistingLogFile:latestFilePath];
[self info:@"继续使用现有日志文件: %@ (%.2fMB/%.2fMB)", latestFileName, fileSizeMB, maxSizeMB];
} else {
//
[self createNewLogFile];
[self info:@"日志文件已满,创建新文件"];
}
}
+ (void)openExistingLogFile:(NSString *)filePath {
@synchronized (self) {
//
if (_currentFileHandle) {
@try {
[_currentFileHandle synchronizeFile];
[_currentFileHandle closeFile];
} @catch (NSException *exception) {
[self error:@"关闭文件句柄失败: %@", exception];
}
_currentFileHandle = nil;
}
//
NSError *error = nil;
_currentFileHandle = [NSFileHandle fileHandleForWritingToURL:[NSURL fileURLWithPath:filePath] error:&error];
if (error) {
[self error:@"打开现有日志文件失败: %@", error.localizedDescription];
[self createNewLogFile];
return;
}
//
@try {
[_currentFileHandle seekToEndOfFile];
} @catch (NSException *exception) {
[self error:@"移动到文件末尾失败: %@", exception];
[self createNewLogFile];
return;
}
_currentLogFilePath = filePath;
//
[self writeRestartMarker];
}
}
+ (void)createNewLogFile {
@synchronized (self) {
//
if (_currentFileHandle) {
@try {
[_currentFileHandle synchronizeFile];
[_currentFileHandle closeFile];
} @catch (NSException *exception) {
[self error:@"关闭文件句柄失败: %@", exception];
}
_currentFileHandle = nil;
}
//
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyyMMdd"];
NSString *dateStr = [formatter stringFromDate:[NSDate date]];
//
NSInteger nextIndex = [self getNextFileIndexForDate:dateStr];
NSString *fileName = [NSString stringWithFormat:@"qxlog_%@_%03ld.log", dateStr, (long)nextIndex];
NSString *filePath = [[self logDirectory] stringByAppendingPathComponent:fileName];
//
NSFileManager *fm = [NSFileManager defaultManager];
[fm createFileAtPath:filePath contents:nil attributes:nil];
//
NSError *error = nil;
_currentFileHandle = [NSFileHandle fileHandleForWritingToURL:[NSURL fileURLWithPath:filePath] error:&error];
if (error) {
[self error:@"打开日志文件失败: %@", error.localizedDescription];
return;
}
_currentLogFilePath = filePath;
//
[self writeFileHeader];
//
[self checkLogFileCount];
[self info:@"创建新日志文件: %@", fileName];
}
}
+ (NSInteger)getNextFileIndexForDate:(NSString *)dateStr {
NSString *logDir = [self logDirectory];
NSFileManager *fm = [NSFileManager defaultManager];
NSError *error = nil;
NSArray *files = [fm contentsOfDirectoryAtPath:logDir error:&error];
if (error) return 1;
NSString *prefix = [NSString stringWithFormat:@"qxlog_%@_", dateStr];
NSArray *todayFiles = [files filteredArrayUsingPredicate:
[NSPredicate predicateWithFormat:@"SELF BEGINSWITH %@", prefix]];
if (todayFiles.count == 0) return 1;
//
NSInteger maxIndex = 0;
for (NSString *fileName in todayFiles) {
// qxlog_20240101_001.log -> 001
NSString *baseName = [fileName stringByDeletingPathExtension];
NSArray *components = [baseName componentsSeparatedByString:@"_"];
if (components.count == 3) {
NSString *indexStr = components[2];
NSInteger index = [indexStr integerValue];
if (index > maxIndex) {
maxIndex = index;
}
}
}
return maxIndex + 1;
}
#pragma mark -
+ (void)writeRestartMarker {
if (!_currentFileHandle) return;
NSMutableString *marker = [NSMutableString string];
[marker appendString:@"\n\n"];
[marker appendString:@"═══════════════════════════════════════════════════\n"];
[marker appendFormat:@"🚀 应用重新启动 - %@\n", [_dateFormatter stringFromDate:[NSDate date]]];
[marker appendString:@"═══════════════════════════════════════════════════\n\n"];
NSData *markerData = [marker dataUsingEncoding:NSUTF8StringEncoding];
@try {
[_currentFileHandle writeData:markerData];
[_currentFileHandle synchronizeFile];
} @catch (NSException *exception) {
[self error:@"写入重启标记失败: %@", exception];
}
}
+ (void)writeFileHeader {
if (!_currentFileHandle) return;
NSMutableString *header = [NSMutableString string];
[header appendString:@"═══════════════════════════════════════════════════\n"];
[header appendString:@"📱 QXLogger 日志文件\n"];
[header appendString:@"═══════════════════════════════════════════════════\n"];
[header appendFormat:@"创建时间: %@\n", [_dateFormatter stringFromDate:[NSDate date]]];
[header appendFormat:@"设备型号: %@\n", [self deviceModel]];
[header appendFormat:@"系统版本: %@ %@\n", [UIDevice currentDevice].systemName, [UIDevice currentDevice].systemVersion];
NSString *appName = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleDisplayName"] ?:
[[NSBundle mainBundle] objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleNameKey];
NSString *version = [[NSBundle mainBundle] objectForInfoDictionaryKey:@"CFBundleShortVersionString"] ?: @"";
NSString *build = [[NSBundle mainBundle] objectForInfoDictionaryKey:(__bridge NSString *)kCFBundleVersionKey] ?: @"";
[header appendFormat:@"应用信息: %@ %@ (%@)\n", appName ?: @"", version, build];
[header appendFormat:@"文件限制: %.2fMB/文件, 最多%lu个文件\n",
_config.maxLogFileSize / 1024.0 / 1024.0,
(unsigned long)_config.maxLogFileCount];
[header appendString:@"═══════════════════════════════════════════════════\n\n"];
NSData *headerData = [header dataUsingEncoding:NSUTF8StringEncoding];
@try {
[_currentFileHandle writeData:headerData];
[_currentFileHandle synchronizeFile];
} @catch (NSException *exception) {
[self error:@"写入文件头失败: %@", exception];
}
}
#pragma mark -
+ (void)outputToFile:(NSString *)log {
@autoreleasepool {
//
[self checkLogFileSize];
//
if (!_currentFileHandle) {
[self findOrCreateLogFile];
if (!_currentFileHandle) return;
}
//
NSString *logWithNewline = [log stringByAppendingString:@"\n"];
NSData *logData = [logWithNewline dataUsingEncoding:NSUTF8StringEncoding];
@try {
[_currentFileHandle seekToEndOfFile];
[_currentFileHandle writeData:logData];
[_currentFileHandle synchronizeFile];
} @catch (NSException *exception) {
[self error:@"写入日志文件失败: %@", exception];
//
[self createNewLogFile];
}
}
}
+ (void)checkLogFileSize {
if (!_currentLogFilePath) return;
NSFileManager *fm = [NSFileManager defaultManager];
NSDictionary *attrs = [fm attributesOfItemAtPath:_currentLogFilePath error:nil];
if (attrs) {
unsigned long long fileSize = [attrs fileSize];
if (fileSize >= _config.maxLogFileSize) {
[self info:@"日志文件达到限制 (%.2fMB),创建新文件", fileSize / 1024.0 / 1024.0];
[self createNewLogFile];
}
}
}
#pragma mark -
+ (void)logWithLevel:(QXLogLevel)level tag:(nullable NSString *)tag format:(NSString *)format args:(va_list)args {
if (!_isEnabled || level < _config.minLogLevel) return;
NSString *message = [[NSString alloc] initWithFormat:format arguments:args];
if (_config.enableAsync) {
dispatch_async(_logQueue, ^{
[self processLogWithLevel:level tag:tag message:message];
});
} else {
dispatch_sync(_logQueue, ^{
[self processLogWithLevel:level tag:tag message:message];
});
}
}
+ (void)processLogWithLevel:(QXLogLevel)level tag:(nullable NSString *)tag message:(NSString *)message {
//
NSString *formattedLog = [self formatLogWithLevel:level tag:tag message:message];
//
if (_config.logTarget & QXLogTargetConsole) {
[self outputToConsole:formattedLog level:level];
}
if (_config.logTarget & QXLogTargetFile) {
[self outputToFile:formattedLog];
}
//
for (void (^handler)(QXLogLevel, NSString *, NSString *) in _customHandlers) {
handler(level, tag ?: @"", message);
}
}
+ (NSString *)formatLogWithLevel:(QXLogLevel)level tag:(nullable NSString *)tag message:(NSString *)message {
NSString *timestamp = [_dateFormatter stringFromDate:[NSDate date]];
NSString *levelStr = [self stringFromLogLevel:level];
NSString *threadInfo = [NSThread isMainThread] ? @"Main" : @"Background";
NSMutableString *log = [NSMutableString string];
[log appendFormat:@"%@ [%@]", timestamp, threadInfo];
if (_config.logPrefix.length > 0) {
[log appendFormat:@" [%@]", _config.logPrefix];
}
if (tag.length > 0) {
[log appendFormat:@" [%@]", tag];
}
[log appendFormat:@" [%@] %@", levelStr, message];
return [log copy];
}
+ (NSString *)stringFromLogLevel:(QXLogLevel)level {
switch (level) {
case QXLogLevelVerbose: return @"VERBOSE";
case QXLogLevelDebug: return @"DEBUG";
case QXLogLevelInfo: return @"INFO";
case QXLogLevelWarning: return @"WARNING";
case QXLogLevelError: return @"ERROR";
case QXLogLevelFatal: return @"FATAL";
default: return @"UNKNOWN";
}
}
+ (void)outputToConsole:(NSString *)log level:(QXLogLevel)level {
if (_config.enableConsoleColor) {
printf("%s\n", [self coloredLog:log level:level].UTF8String);
} else {
printf("%s\n", log.UTF8String);
}
}
+ (NSString *)coloredLog:(NSString *)log level:(QXLogLevel)level {
NSString *colorCode;
switch (level) {
case QXLogLevelVerbose: colorCode = @"\033[0;37m"; break; //
case QXLogLevelDebug: colorCode = @"\033[0;36m"; break; //
case QXLogLevelInfo: colorCode = @"\033[0;32m"; break; // 绿
case QXLogLevelWarning: colorCode = @"\033[0;33m"; break; //
case QXLogLevelError: colorCode = @"\033[0;31m"; break; //
case QXLogLevelFatal: colorCode = @"\033[0;35m"; break; //
default: colorCode = @"\033[0m";
}
return [NSString stringWithFormat:@"%@%@\033[0m", colorCode, log];
}
#pragma mark -
+ (void)verbose:(NSString *)format, ... {
va_list args;
va_start(args, format);
[self logWithLevel:QXLogLevelVerbose tag:nil format:format args:args];
va_end(args);
}
+ (void)verboseWithTag:(NSString *)tag format:(NSString *)format, ... {
va_list args;
va_start(args, format);
[self logWithLevel:QXLogLevelVerbose tag:tag format:format args:args];
va_end(args);
}
+ (void)debug:(NSString *)format, ... {
va_list args;
va_start(args, format);
[self logWithLevel:QXLogLevelDebug tag:nil format:format args:args];
va_end(args);
}
+ (void)debugWithTag:(NSString *)tag format:(NSString *)format, ... {
va_list args;
va_start(args, format);
[self logWithLevel:QXLogLevelDebug tag:tag format:format args:args];
va_end(args);
}
+ (void)info:(NSString *)format, ... {
va_list args;
va_start(args, format);
[self logWithLevel:QXLogLevelInfo tag:nil format:format args:args];
va_end(args);
}
+ (void)infoWithTag:(NSString *)tag format:(NSString *)format, ... {
va_list args;
va_start(args, format);
[self logWithLevel:QXLogLevelInfo tag:tag format:format args:args];
va_end(args);
}
+ (void)warning:(NSString *)format, ... {
va_list args;
va_start(args, format);
[self logWithLevel:QXLogLevelWarning tag:nil format:format args:args];
va_end(args);
}
+ (void)warningWithTag:(NSString *)tag format:(NSString *)format, ... {
va_list args;
va_start(args, format);
[self logWithLevel:QXLogLevelWarning tag:tag format:format args:args];
va_end(args);
}
+ (void)error:(NSString *)format, ... {
va_list args;
va_start(args, format);
[self logWithLevel:QXLogLevelError tag:nil format:format args:args];
va_end(args);
}
+ (void)errorWithTag:(NSString *)tag format:(NSString *)format, ... {
va_list args;
va_start(args, format);
[self logWithLevel:QXLogLevelError tag:tag format:format args:args];
va_end(args);
}
+ (void)fatal:(NSString *)format, ... {
va_list args;
va_start(args, format);
[self logWithLevel:QXLogLevelFatal tag:nil format:format args:args];
va_end(args);
}
+ (void)fatalWithTag:(NSString *)tag format:(NSString *)format, ... {
va_list args;
va_start(args, format);
[self logWithLevel:QXLogLevelFatal tag:tag format:format args:args];
va_end(args);
}
#pragma mark -
+ (void)network:(NSString *)method url:(NSString *)url params:(id)params response:(id)response error:(NSError *)error {
NSMutableString *log = [NSMutableString string];
[log appendFormat:@"🌐 %@ %@\n", method, url];
if (params) {
[log appendFormat:@"Params: %@\n", [self jsonStringFromObject:params]];
}
if (response) {
[log appendFormat:@"Response: %@\n", [self jsonStringFromObject:response]];
}
if (error) {
[log appendFormat:@"Error: %@ (Code: %ld)", error.localizedDescription, (long)error.code];
}
[self debugWithTag:@"Network" format:@"%@", log];
}
+ (void)performance:(NSString *)tag startTime:(CFAbsoluteTime)startTime {
CFAbsoluteTime endTime = CFAbsoluteTimeGetCurrent();
CFAbsoluteTime duration = (endTime - startTime) * 1000;
NSString *level = duration > 100 ? @"⚠️" : @"✅";
[self debugWithTag:@"Performance" format:@"%@ %@: %.2fms", level, tag, duration];
}
+ (void)userAction:(NSString *)action params:(NSDictionary *)params {
NSString *paramsStr = params ? [self jsonStringFromObject:params] : @"{}";
[self infoWithTag:@"UserAction" format:@"👤 %@ %@", action, paramsStr];
}
+ (void)crash:(NSException *)exception {
NSString *log = [NSString stringWithFormat:
@"💥 Crash: %@\n"
@"Reason: %@\n"
@"Stack Trace:\n%@",
exception.name,
exception.reason,
exception.callStackSymbols];
[self fatalWithTag:@"Crash" format:@"%@", log];
//
dispatch_sync(_logQueue, ^{
[self outputToFile:log];
});
}
+ (void)memoryWarning {
struct task_basic_info info;
mach_msg_type_number_t size = sizeof(info);
kern_return_t kerr = task_info(mach_task_self(), TASK_BASIC_INFO, (task_info_t)&info, &size);
if (kerr == KERN_SUCCESS) {
CGFloat usedMemory = info.resident_size / 1024.0 / 1024.0;
[self warningWithTag:@"Memory" format:@"⚠️ Memory Warning: %.2f MB used", usedMemory];
}
}
#pragma mark -
+ (NSString *)logDirectory {
NSString *docDir = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES).firstObject;
return [docDir stringByAppendingPathComponent:@"QXLogs"];
}
+ (void)createLogDirectory {
NSString *logDir = [self logDirectory];
NSFileManager *fm = [NSFileManager defaultManager];
if (![fm fileExistsAtPath:logDir]) {
NSError *error = nil;
[fm createDirectoryAtPath:logDir withIntermediateDirectories:YES attributes:nil error:&error];
if (error) {
[self error:@"创建日志目录失败: %@", error.localizedDescription];
}
}
}
+ (NSArray<NSString *> *)getAllLogFilePaths {
NSString *logDir = [self logDirectory];
NSFileManager *fm = [NSFileManager defaultManager];
NSError *error = nil;
NSArray *files = [fm contentsOfDirectoryAtPath:logDir error:&error];
if (error) return @[];
//
NSArray *logFiles = [files filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"SELF BEGINSWITH 'qxlog_'"]];
logFiles = [logFiles sortedArrayUsingSelector:@selector(compare:)];
//
NSMutableArray *fullPaths = [NSMutableArray array];
for (NSString *file in logFiles) {
[fullPaths addObject:[logDir stringByAppendingPathComponent:file]];
}
return [fullPaths copy];
}
+ (NSString *)getLatestLogFilePath {
NSArray *logFiles = [self getAllLogFilePaths];
return logFiles.lastObject;
}
+ (NSString *)getLogContentFromFile:(NSString *)filePath {
if (![[NSFileManager defaultManager] fileExistsAtPath:filePath]) {
return nil;
}
NSError *error = nil;
NSString *content = [NSString stringWithContentsOfFile:filePath
encoding:NSUTF8StringEncoding
error:&error];
if (error) {
[self error:@"读取日志文件失败: %@", error.localizedDescription];
return nil;
}
return content;
}
+ (void)checkLogFileCount {
NSString *logDir = [self logDirectory];
NSFileManager *fm = [NSFileManager defaultManager];
NSError *error = nil;
NSArray *files = [fm contentsOfDirectoryAtPath:logDir error:&error];
if (!error) {
NSArray *logFiles = [files filteredArrayUsingPredicate:[NSPredicate predicateWithFormat:@"SELF BEGINSWITH 'qxlog_'"]];
logFiles = [logFiles sortedArrayUsingSelector:@selector(compare:)];
if (logFiles.count > _config.maxLogFileCount) {
NSUInteger filesToDelete = logFiles.count - _config.maxLogFileCount;
for (NSUInteger i = 0; i < filesToDelete; i++) {
NSString *filePath = [logDir stringByAppendingPathComponent:logFiles[i]];
[fm removeItemAtPath:filePath error:nil];
[self info:@"删除旧日志文件: %@", logFiles[i]];
}
}
}
}
+ (void)cleanExpiredLogs {
if (_config.logSaveDays <= 0) return;
NSString *logDir = [self logDirectory];
NSFileManager *fm = [NSFileManager defaultManager];
NSError *error = nil;
NSArray *files = [fm contentsOfDirectoryAtPath:logDir error:&error];
if (error) return;
NSDate *now = [NSDate date];
NSCalendar *calendar = [NSCalendar currentCalendar];
for (NSString *file in files) {
if ([file hasPrefix:@"qxlog_"]) {
NSString *filePath = [logDir stringByAppendingPathComponent:file];
NSDictionary *attrs = [fm attributesOfItemAtPath:filePath error:nil];
if (attrs) {
NSDate *creationDate = [attrs fileCreationDate];
if (creationDate) {
NSDateComponents *components = [calendar components:NSCalendarUnitDay
fromDate:creationDate
toDate:now
options:0];
if (components.day > _config.logSaveDays) {
[fm removeItemAtPath:filePath error:nil];
[self info:@"删除过期日志文件: %@ (创建于: %@)", file, creationDate];
}
}
}
}
}
}
+ (void)cleanAllLogFiles {
NSString *logDir = [self logDirectory];
NSFileManager *fm = [NSFileManager defaultManager];
NSError *error = nil;
NSArray *files = [fm contentsOfDirectoryAtPath:logDir error:&error];
if (!error) {
for (NSString *file in files) {
if ([file hasPrefix:@"qxlog_"]) {
NSString *filePath = [logDir stringByAppendingPathComponent:file];
[fm removeItemAtPath:filePath error:nil];
}
}
}
[self createNewLogFile];
[self info:@"已清除所有日志文件"];
}
#pragma mark -
+ (unsigned long long)getCurrentLogFileSize {
if (!_currentLogFilePath) return 0;
NSFileManager *fm = [NSFileManager defaultManager];
NSDictionary *attrs = [fm attributesOfItemAtPath:_currentLogFilePath error:nil];
return attrs ? [attrs fileSize] : 0;
}
+ (CGFloat)getCurrentLogFileSizeMB {
return [self getCurrentLogFileSize] / 1024.0 / 1024.0;
}
+ (CGFloat)getTotalLogSizeMB {
NSArray *logFiles = [self getAllLogFilePaths];
NSFileManager *fm = [NSFileManager defaultManager];
CGFloat totalSize = 0;
for (NSString *filePath in logFiles) {
NSDictionary *attrs = [fm attributesOfItemAtPath:filePath error:nil];
if (attrs) {
totalSize += [attrs fileSize] / 1024.0 / 1024.0;
}
}
return totalSize;
}
+ (NSDictionary *)getLogFileInfo:(NSString *)filePath {
NSFileManager *fm = [NSFileManager defaultManager];
NSDictionary *attrs = [fm attributesOfItemAtPath:filePath error:nil];
if (!attrs) return @{};
NSDateFormatter *formatter = [[NSDateFormatter alloc] init];
[formatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"];
CGFloat fileSizeMB = [attrs fileSize] / 1024.0 / 1024.0;
NSDate *creationDate = [attrs fileCreationDate];
NSDate *modificationDate = [attrs fileModificationDate];
return @{
@"fileName": [filePath lastPathComponent],
@"fileSize": @([attrs fileSize]),
@"fileSizeMB": @(fileSizeMB),
@"creationDate": creationDate ? [formatter stringFromDate:creationDate] : @"",
@"modificationDate": modificationDate ? [formatter stringFromDate:modificationDate] : @"",
@"filePath": filePath
};
}
+ (NSArray<NSDictionary *> *)getAllLogFileInfos {
NSArray *logFiles = [self getAllLogFilePaths];
NSMutableArray *infos = [NSMutableArray array];
for (NSString *filePath in logFiles) {
[infos addObject:[self getLogFileInfo:filePath]];
}
return [infos copy];
}
+ (void)checkFileSizeManually {
[self checkLogFileSize];
}
#pragma mark -
+ (void)uploadLogsWithCompletion:(void (^)(BOOL, NSError * _Nullable))completion {
//
if (completion) completion(NO, nil);
}
+ (void)setUploadHandler:(void (^)(NSArray<NSString *> *, void (^)(BOOL)))handler {
_uploadHandler = [handler copy];
}
#pragma mark -
+ (QXLogConfig *)config {
return _config;
}
+ (void)updateConfig:(void (^)(QXLogConfig *))block {
if (block) {
block(_config);
}
}
+ (void)enable:(BOOL)enabled {
_isEnabled = enabled;
}
+ (BOOL)isEnabled {
return _isEnabled;
}
+ (void)addCustomLogHandler:(void (^)(QXLogLevel, NSString *, NSString *))handler {
if (handler) {
[_customHandlers addObject:[handler copy]];
}
}
#pragma mark -
+ (NSString *)deviceModel {
struct utsname systemInfo;
uname(&systemInfo);
return [NSString stringWithCString:systemInfo.machine encoding:NSUTF8StringEncoding];
}
+ (NSString *)jsonStringFromObject:(id)object {
if (!object) return @"null";
if ([object isKindOfClass:[NSString class]]) {
return object;
}
if ([NSJSONSerialization isValidJSONObject:object]) {
NSError *error = nil;
NSData *jsonData = [NSJSONSerialization dataWithJSONObject:object
options:NSJSONWritingPrettyPrinted
error:&error];
if (!error) {
return [[NSString alloc] initWithData:jsonData encoding:NSUTF8StringEncoding];
}
}
return [object description];
}
#pragma mark -
static void uncaughtExceptionHandler(NSException *exception) {
[QXLogger crash:exception];
//
usleep(200000);
//
if (NSGetUncaughtExceptionHandler()) {
NSGetUncaughtExceptionHandler()(exception);
}
}
+ (void)handleMemoryWarning {
[self memoryWarning];
}
@end

View File

@@ -135,6 +135,7 @@
QXLOG(@"收到消息%@",dataStr);
NSDictionary *dict = [NSJSONSerialization JSONObjectWithData:[dataStr dataUsingEncoding:NSUTF8StringEncoding] options:NSJSONReadingMutableContainers error:&error];
QXLOG(@"收到消息%@",dict);
[QXLogger infoWithTag:@"飘屏推送" format:@"%@",[dict yy_modelToJSONString]];
if (dict != nil && self.delegate && [self.delegate respondsToSelector:@selector(socketManager:receivedMessage:topic:)]) {
dispatch_async(dispatch_get_main_queue(), ^{
[self.delegate socketManager:@"收到消息" receivedMessage:dict topic:topic];

View File

@@ -163,6 +163,9 @@ typedef NS_ENUM(NSInteger) {
/// 签约麦邀请
QXRoomMessageTypeInviteSignUpSeat = 1094,
/// 爆币推送特效
QXRoomMessageTypeCoinBoomEffect = 1100,
}QXRoomMessageType;
NS_ASSUME_NONNULL_BEGIN
@protocol QXRoomMessageManagerDelegate <NSObject>
@@ -323,6 +326,7 @@ NS_ASSUME_NONNULL_BEGIN
@end
@interface QXRoomMessageManager : NSObject
@property (nonatomic,weak)id<QXRoomMessageManagerDelegate>delegate;
@property (nonatomic,strong,readonly)NSString *roomId;
+(instancetype)shared;

View File

@@ -47,13 +47,17 @@
[[V2TIMManager sharedInstance] addGroupListener:self];
[[V2TIMManager sharedInstance] addAdvancedMsgListener:self];
NSString *groupId = [NSString stringWithFormat:@"room%@",roomId];
self.groupId = groupId;
self.roomId = roomId;
[[V2TIMManager sharedInstance] joinGroup:groupId msg:@"大家好,我来啦" succ:^{
QXLOG(@"腾讯IM加入聊天室成功");
weakSelf.groupId = groupId;
weakSelf.roomId = roomId;
// weakSelf.groupId = groupId;
// weakSelf.roomId = roomId;
[QXLogger infoWithTag:@"房间日志" format:@"腾讯IM加入聊天室成功房间id=%@",roomId];
} fail:^(int code, NSString *desc) {
//
QXLOG(@"腾讯IM加入聊天室失败-code%d-原因%@",code,desc);
[QXLogger infoWithTag:@"房间日志" format:@"腾讯IM加入聊天室失败-code%d-原因%@",code,desc];
}];
}
-(void)quitGroupWithRoomId:(NSString *)roomId removeListener:(BOOL)removeListener{
@@ -63,6 +67,7 @@
[[V2TIMManager sharedInstance] removeGroupListener:self];
[[V2TIMManager sharedInstance] removeAdvancedMsgListener:self];
}
[QXLogger infoWithTag:@"房间日志" format:@"退出群组房间=%@%@",roomId,removeListener?@"并移除监听":@""];
NSString *groupId = [NSString stringWithFormat:@"room%@",roomId];
[[V2TIMManager sharedInstance] quitGroup:groupId succ:^{
@@ -84,6 +89,7 @@
NSData *data = msg.customElem.data;
NSString *jsonStr = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
QXLOG(@"收到广播消息---%@",jsonStr);
[QXLogger infoWithTag:@"推送日志" format:@"收到广播消息---%@",jsonStr];
QXHeadLineModel *headline = [QXHeadLineModel yy_modelWithJSON:jsonStr];
if (self.delegate && [self.delegate respondsToSelector:@selector(recieveHeadline:)]) {
[self.delegate recieveHeadline:headline];
@@ -96,6 +102,7 @@
NSString *jsonStr = [[NSString alloc] initWithData:data encoding:NSUTF8StringEncoding];
QXRoomMessage *msg = [QXRoomMessage yy_modelWithJSON:jsonStr];
NSString *groupId = [NSString stringWithFormat:@"room%@",msg.RoomId];
[QXLogger infoWithTag:@"推送日志" format:@"房间id=%@收到系统推送%@",msg.RoomId,jsonStr];
if ([groupId isEqualToString:self.groupId]) {
//
NSInteger meesageType = msg.MsgType.integerValue;
@@ -731,6 +738,15 @@
}
}
break;
case QXRoomMessageTypeCoinBoomEffect:{
QXRoomChatListModel *model = [QXRoomChatListModel yy_modelWithJSON:msg.Text];
NSString *jia_jia = [NSString stringWithFormat:@"%@",msg.Text[@"play_image"]];
[[QXGiftPlayerManager shareManager] displayChatEffectView:jia_jia];
if (self.delegate && [self.delegate respondsToSelector:@selector(didInsertMessge:)]) {
[self.delegate didInsertMessge:model];
}
}
break;
default:
break;
}

View File

@@ -36,7 +36,7 @@
<nil key="highlightedColor"/>
</label>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" red="0.98039215686274506" green="0.98039215686274506" blue="0.98039215686274506" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="9Dz-5D-uJ0" secondAttribute="bottom" constant="12" id="0lw-re-24m"/>
<constraint firstAttribute="trailing" secondItem="9Dz-5D-uJ0" secondAttribute="trailing" constant="12" id="ISs-JP-WEt"/>

View File

@@ -107,7 +107,7 @@
</userDefinedRuntimeAttributes>
</button>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" red="0.98039215686274506" green="0.98039215686274506" blue="0.98039215686274506" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstItem="sR8-oC-oyN" firstAttribute="leading" secondItem="TYD-pk-Hrj" secondAttribute="trailing" constant="8" id="4sX-G8-MLB"/>
<constraint firstAttribute="trailing" secondItem="xZb-cE-pmT" secondAttribute="trailing" constant="10" id="9Cz-Jd-aIT"/>

View File

@@ -71,7 +71,7 @@
</constraints>
</view>
</subviews>
<color key="backgroundColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<color key="backgroundColor" red="0.98039215686274506" green="0.98039215686274506" blue="0.98039215686274506" alpha="1" colorSpace="calibratedRGB"/>
<constraints>
<constraint firstAttribute="bottom" secondItem="4qD-6Q-4as" secondAttribute="bottom" constant="12" id="7ux-5R-DuW"/>
<constraint firstAttribute="trailing" secondItem="1bn-8x-RrW" secondAttribute="trailing" constant="12" id="Eho-kp-dJY"/>

View File

@@ -368,6 +368,7 @@
-(void)gotoSetting{
QXSettingViewController *vc = [[QXSettingViewController alloc] init];
vc.haveNobility = self.userModel.is_hide.intValue == 1;
vc.haveMobile = [QXGlobal.shareGlobal.loginModel.mobile isExist];
MJWeakSelf
vc.logOutBlock = ^(BOOL isCancel, NSString * _Nonnull code) {
weakSelf.cancelCode = code;

View File

@@ -17,5 +17,6 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)QXDayTaskTypeModel *model;
@property (nonatomic,strong)UIButton *titleBtn;
@property (nonatomic,strong)UIButton *lockImageBtn;
@property (nonatomic,strong)UILabel *badgeLabel;
@end
NS_ASSUME_NONNULL_END

View File

@@ -28,23 +28,34 @@
@property (nonatomic,strong)QXDayTaskModel *model;
@property (nonatomic,strong)QXDayTaskTypeModel *typeModel;
@property (nonatomic,strong)UIImageView *nodataView;
@property (nonatomic,assign)NSInteger selectedInex;
@end
@implementation QXTaskViewController
- (void)viewDidLoad {
self.isNoChangeBgImage = YES;
[super viewDidLoad];
// Do any additional setup after loading the view.
self.selectedInex = 0;
}
-(void)viewWillAppear:(BOOL)animated{
[super viewWillAppear:animated];
[self.navigationController setNavigationBarHidden:NO animated:YES];
self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:RGB16(0xffffff)};
[self getDayTask];
}
-(void)viewWillDisappear:(BOOL)animated{
[super viewWillDisappear:animated];
self.navigationController.navigationBar.titleTextAttributes = @{NSForegroundColorAttributeName:RGB16(0x000000)};
}
-(void)setNavgationItems{
[super setNavgationItems];
self.navigationItem.title = QXText(@"每日任务");
self.navigationTintColor = RGB16(0xffffff);
UIButton*recordBtn = [[UIButton alloc] initWithFrame:CGRectMake(0, 0, 44, 44)];
[recordBtn setTitle:QXText(@"礼盒记录") forState:(UIControlStateNormal)];
[recordBtn setTitleColor:QXConfig.themeColor forState:(UIControlStateNormal)];
@@ -53,11 +64,11 @@
self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:recordBtn];
}
- (void)initSubViews{
self.bgImageHidden = YES;
[self updateBgImage:@"app_home_bg"];
self.view.backgroundColor = RGB16(0xE3FAE4);
[self.view addSubview:self.topView];
self.bottomView = [[UIView alloc] initWithFrame:CGRectMake(16, self.topView.bottom, SCREEN_WIDTH-32, SCREEN_HEIGHT-self.topView.bottom-kSafeAreaBottom)];
self.bottomView.backgroundColor = RGB16(0xffffff);
self.bottomView.backgroundColor = [UIColor clearColor];
[self.bottomView addRoundedCornersWithRadius:16];
self.tableView.frame = CGRectMake(0, 48, self.bottomView.width, self.bottomView.height-48);
[self.bottomView addSubview:self.tableView];
@@ -87,15 +98,16 @@
make.right.mas_equalTo(0);
make.height.mas_equalTo(48);
}];
}
-(void)getDayTask{
MJWeakSelf
[QXMineNetwork getDayTaskListSuccessBlock:^(QXDayTaskModel * _Nonnull model) {
// for (QXDayTaskTypeModel*md in model.tasks) {
// [self sortStudentsByScoreRule:md];
// }
weakSelf.model = model;
weakSelf.topView.model = model;
weakSelf.typeModel = model.tasks.firstObject;
weakSelf.typeModel = model.tasks[weakSelf.selectedInex];
if (weakSelf.typeModel) {
weakSelf.typeModel.isSelected = YES;
[weakSelf.dataArray removeAllObjects];
@@ -107,6 +119,37 @@
}];
}
//- (void)sortStudentsByScoreRule:(QXDayTaskTypeModel*)typeModel {
// if (typeModel.task_list.count == 0) return;
// __block NSInteger count = 0;
//// wait_draw_num
// // 2 > 1 > 3
// NSArray *array = [typeModel.task_list sortedArrayUsingComparator:^NSComparisonResult(QXDayTaskListModel *obj1, QXDayTaskListModel *obj2) {
// // 2() > 1() > 3()
// NSInteger priority1 = [self priorityForScore:obj1.task_status.intValue];
// NSInteger priority2 = [self priorityForScore:obj1.task_status.intValue];
// count++;
// if (priority1 > priority2) {
// return NSOrderedAscending; // obj1
// } else if (priority1 < priority2) {
// return NSOrderedDescending; // obj2
// } else {
// //
// return NSOrderedSame;
// }
// }];
// typeModel.task_list = array;
// typeModel.wait_draw_num = count;
//}
//- (NSInteger)priorityForScore:(NSInteger)score {
// // 2() -> 3, 1() -> 2, 3() -> 1
// switch (score) {
// case 2: return 3; //
// case 1: return 2; //
// case 3: return 1; //
// default: return 0; //
// }
//}
-(void)recordAction{
QXTaskGiftRecordVC *vc = [[QXTaskGiftRecordVC alloc] init];
@@ -215,6 +258,7 @@
if (model == self.typeModel) {
return;
}
self.selectedInex = indexPath.row;
if (self.typeModel) {
self.typeModel.isSelected = NO;
}
@@ -312,6 +356,11 @@
self.titleBtn.selected = NO;
self.lockImageBtn.selected = NO;
}
if (model.wait_reward_num>0) {
self.badgeLabel.hidden = NO;
}else{
self.badgeLabel.hidden = YES;
}
}
-(void)initSubviews{
@@ -327,8 +376,8 @@
self.lockImageBtn.userInteractionEnabled = NO;
self.titleBtn = [[UIButton alloc] init];
[self.titleBtn setTitleColor:RGB16(0x333333) forState:(UIControlStateSelected)];
[self.titleBtn setTitleColor:RGB16A(0x000000,0.45) forState:(UIControlStateNormal)];
[self.titleBtn setTitleColor:RGB16A(0xffffff,0.4) forState:(UIControlStateNormal)];
[self.titleBtn setTitleColor:RGB16(0xffffff) forState:(UIControlStateSelected)];
self.titleBtn.titleLabel.font = [UIFont boldSystemFontOfSize:16];
[self addSubview:self.titleBtn];
[self.titleBtn mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -336,6 +385,17 @@
make.right.equalTo(self.lockImageBtn.mas_left);
}];
self.titleBtn.userInteractionEnabled = NO;
self.badgeLabel = [[UILabel alloc] init];
self.badgeLabel.hidden = YES;
self.badgeLabel.backgroundColor = RGB16(0xE36C4A);
[self.badgeLabel addRoundedCornersWithRadius:4];
[self addSubview:self.badgeLabel];
[self.badgeLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.right.equalTo(self.titleBtn);
make.top.mas_equalTo(12);
make.width.height.mas_equalTo(8);
}];
}
@end

View File

@@ -10,7 +10,7 @@
NS_ASSUME_NONNULL_BEGIN
@interface QXBindMobileViewController : QXBaseViewController
@property (nonatomic,assign)BOOL haveMobile;
@end
NS_ASSUME_NONNULL_END

View File

@@ -11,9 +11,12 @@
#import "QXLoginNetwork.h"
@interface QXBindMobileViewController ()<QXLoginTextFieldDelegate>
@property (nonatomic,strong)UILabel *mobileLabel;
@property (nonatomic,strong)QXLoginTextField *oldMobileCodeTextField;
@property (nonatomic,strong)QXLoginTextField *accountTextField;
@property (nonatomic,strong)QXLoginTextField *codeTextField;
@property (nonatomic,strong)UIButton *commitBtn;
@property (nonatomic,assign)BOOL isNetworking;
@end
@implementation QXBindMobileViewController
@@ -27,46 +30,113 @@
self.navigationItem.title = QXText(@"手机绑定");
}
-(void)initSubViews{
self.accountTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, NavContentHeight+12, SCREEN_WIDTH-32, 44) type:(LoginTextTypeAccount)];
self.accountTextField.backgroundColor = RGB16(0xEFF2F8);
[self.accountTextField addRoundedCornersWithRadius:11];
[self.view addSubview:self.accountTextField];
self.codeTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, self.accountTextField.bottom+12, SCREEN_WIDTH-32, 44) type:(LoginTextTypeCode)];
self.codeTextField.backgroundColor = RGB16(0xEFF2F8);
[self.codeTextField addRoundedCornersWithRadius:11];
self.codeTextField.delegate = self;
[self.view addSubview:self.codeTextField];
self.commitBtn = [[UIButton alloc] initWithFrame:CGRectMake(38, self.codeTextField.bottom+16, SCREEN_WIDTH-38*2, 42)];
self.commitBtn.needEventInterval = 1;
[self.commitBtn setTitle:QXText(@"立即绑定") forState:(UIControlStateNormal)];
[self.commitBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
[self.commitBtn addTarget:self action:@selector(commitAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.commitBtn addRoundedCornersWithRadius:21];
self.commitBtn.titleLabel.font = [UIFont systemFontOfSize:14];
self.commitBtn.backgroundColor = QXConfig.themeColor;
[self.view addSubview:self.commitBtn];
if (self.haveMobile) {
self.mobileLabel = [[UILabel alloc] initWithFrame:CGRectMake(16, NavContentHeight+17, SCREEN_WIDTH-32, 18)];
self.mobileLabel.textColor = RGB16(0x999999);
self.mobileLabel.font = [UIFont systemFontOfSize:12];
NSString *pMobile = [QXGlobal.shareGlobal.loginModel.mobile stringByReplacingCharactersInRange:NSMakeRange(3, 4) withString:@"****"];
NSString *mobile = [NSString stringWithFormat:@"当前手机号 %@",pMobile];
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:mobile];
[attr yy_setFont:[UIFont boldSystemFontOfSize:16] range:[mobile rangeOfString:pMobile]];
[attr yy_setColor:RGB16(0x333333) range:[mobile rangeOfString:pMobile]];
self.mobileLabel.attributedText = attr;
[self.view addSubview:self.mobileLabel];
self.oldMobileCodeTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, self.mobileLabel.bottom+12, SCREEN_WIDTH-32, 44) type:(LoginTextTypeCode)];
self.oldMobileCodeTextField.backgroundColor = RGB16(0xEFF2F8);
self.oldMobileCodeTextField.textField.placeholder = @"请输入旧手机号验证码";
[self.oldMobileCodeTextField addRoundedCornersWithRadius:11];
self.oldMobileCodeTextField.delegate = self;
[self.view addSubview:self.oldMobileCodeTextField];
self.accountTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, self.oldMobileCodeTextField.bottom+12, SCREEN_WIDTH-32, 44) type:(LoginTextTypeAccount)];
self.accountTextField.backgroundColor = RGB16(0xEFF2F8);
[self.accountTextField addRoundedCornersWithRadius:11];
self.codeTextField.textField.placeholder = @"请输入新手机号";
[self.view addSubview:self.accountTextField];
self.codeTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, self.accountTextField.bottom+12, SCREEN_WIDTH-32, 44) type:(LoginTextTypeCode)];
self.codeTextField.backgroundColor = RGB16(0xEFF2F8);
[self.codeTextField addRoundedCornersWithRadius:11];
self.codeTextField.delegate = self;
self.codeTextField.textField.placeholder = @"请输入新手机号验证码";
[self.view addSubview:self.codeTextField];
self.commitBtn = [[UIButton alloc] initWithFrame:CGRectMake(38, self.codeTextField.bottom+16, SCREEN_WIDTH-38*2, 42)];
self.commitBtn.needEventInterval = 1;
[self.commitBtn setTitle:QXText(@"立即绑定") forState:(UIControlStateNormal)];
[self.commitBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
[self.commitBtn addTarget:self action:@selector(commitAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.commitBtn addRoundedCornersWithRadius:21];
self.commitBtn.titleLabel.font = [UIFont systemFontOfSize:14];
self.commitBtn.backgroundColor = QXConfig.themeColor;
[self.view addSubview:self.commitBtn];
}else{
self.accountTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, NavContentHeight+12, SCREEN_WIDTH-32, 44) type:(LoginTextTypeAccount)];
self.accountTextField.backgroundColor = RGB16(0xEFF2F8);
[self.accountTextField addRoundedCornersWithRadius:11];
[self.view addSubview:self.accountTextField];
self.codeTextField = [[QXLoginTextField alloc] initWithFrame:CGRectMake(16, self.accountTextField.bottom+12, SCREEN_WIDTH-32, 44) type:(LoginTextTypeCode)];
self.codeTextField.backgroundColor = RGB16(0xEFF2F8);
[self.codeTextField addRoundedCornersWithRadius:11];
self.codeTextField.delegate = self;
[self.view addSubview:self.codeTextField];
self.commitBtn = [[UIButton alloc] initWithFrame:CGRectMake(38, self.codeTextField.bottom+16, SCREEN_WIDTH-38*2, 42)];
self.commitBtn.needEventInterval = 1;
[self.commitBtn setTitle:QXText(@"立即绑定") forState:(UIControlStateNormal)];
[self.commitBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
[self.commitBtn addTarget:self action:@selector(commitAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.commitBtn addRoundedCornersWithRadius:21];
self.commitBtn.titleLabel.font = [UIFont systemFontOfSize:14];
self.commitBtn.backgroundColor = QXConfig.themeColor;
[self.view addSubview:self.commitBtn];
}
}
-(void)didClickSendCode:(UIButton *)sender{
if (self.accountTextField.textField.text.length < 11) {
showToast(QXText(@"请输入正确的手机号码"));
return;
if (sender == self.codeTextField.codeBtn) {
sender.userInteractionEnabled = NO;
if (self.accountTextField.textField.text.length < 11) {
showToast(QXText(@"请输入正确的手机号码"));
return;
}
if ([self.accountTextField.textField.text isEqualToString:QXGlobal.shareGlobal.loginModel.mobile]) {
showToast(QXText(@"新手机号不能与旧手机号相同"));
return;
}
GetSmscodeType type = GetSmscodeTypeFindChangeMobile;
MJWeakSelf
self.isNetworking = YES;
[QXLoginNetwork getSmscodeWithMobile:self.accountTextField.textField.text
type:type
successBlock:^(id _Nonnull responseObject) {
[weakSelf.codeTextField startTimeDown];
sender.userInteractionEnabled = YES;
}
failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
sender.userInteractionEnabled = YES;
}];
}else{
GetSmscodeType type = GetSmscodeTypeFindChangeMobile;
NSString *oldMobile = [QXGlobal shareGlobal].loginModel.mobile;
MJWeakSelf
sender.userInteractionEnabled = NO;
[QXLoginNetwork getSmscodeWithMobile:oldMobile
type:type
successBlock:^(id _Nonnull responseObject) {
[weakSelf.oldMobileCodeTextField startTimeDown];
sender.userInteractionEnabled = YES;
}
failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
sender.userInteractionEnabled = YES;
}];
}
GetSmscodeType type = GetSmscodeTypeFindBindMobile;
NSString *oldMobile = [QXGlobal shareGlobal].loginModel.mobile;
if (oldMobile.length > 0) {
type = GetSmscodeTypeFindChangeMobile;
}
MJWeakSelf
[QXLoginNetwork getSmscodeWithMobile:self.accountTextField.textField.text
type:type
successBlock:^(id _Nonnull responseObject) {
[weakSelf.codeTextField startTimeDown];
}
failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
}
-(void)commitAction{
NSString *oldMobile = [QXGlobal shareGlobal].loginModel.mobile;
@@ -79,7 +149,7 @@
showToast(QXText(@"绑定成功"));
[QXGlobal shareGlobal].loginModel.mobile = mobile;
[[QXGlobal shareGlobal]updateUserInfoWithMolde:[QXGlobal shareGlobal].loginModel];
[self.navigationController popViewControllerAnimated:YES];
[self.navigationController popToRootViewControllerAnimated:YES];
}
failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg)

View File

@@ -0,0 +1,16 @@
//
// QXModifyMobileViewController.h
// QXLive
//
// Created by 启星 on 2025/12/19.
//
#import "QXBaseViewController.h"
NS_ASSUME_NONNULL_BEGIN
@interface QXModifyMobileViewController : QXBaseViewController
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,87 @@
//
// QXModifyMobileViewController.m
// QXLive
//
// Created by on 2025/12/19.
//
#import "QXModifyMobileViewController.h"
#import "QXBindMobileViewController.h"
@interface QXModifyMobileViewController ()
@property (nonatomic,strong)UIImageView *topImageView;
@property (nonatomic,strong)UILabel *titleLabel;
@property (nonatomic,strong)UILabel *mobileLabel;
@property (nonatomic,strong)UIButton *changeBtn;
@end
@implementation QXModifyMobileViewController
- (void)viewDidLoad {
[super viewDidLoad];
// Do any additional setup after loading the view.
}
-(void)setNavgationItems{
[super setNavgationItems];
self.navigationItem.title = @"更换手机号码";
}
-(void)initSubViews{
self.topImageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"change_mobile_top"]];
[self.view addSubview:self.topImageView];
[self.topImageView mas_makeConstraints:^(MASConstraintMaker *make) {
make.width.height.mas_equalTo(ScaleWidth(150));
make.top.mas_equalTo(NavContentHeight);
make.centerX.equalTo(self.view);
}];
self.titleLabel = [[UILabel alloc] init];
self.titleLabel.textColor = RGB16(0x666666);
self.titleLabel.font = [UIFont systemFontOfSize:14];
self.titleLabel.text = @"更换手机号码以后,个人信息不变";
[self.view addSubview:self.titleLabel];
[self.titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.view);
make.top.equalTo(self.topImageView.mas_bottom).offset(8);
make.height.mas_equalTo(21);
}];
self.mobileLabel = [[UILabel alloc] init];
self.mobileLabel.textColor = RGB16(0x999999);
self.mobileLabel.font = [UIFont systemFontOfSize:12];
NSString *pMobile = [QXGlobal.shareGlobal.loginModel.mobile stringByReplacingCharactersInRange:NSMakeRange(3, 4) withString:@"****"];
NSString *mobile = [NSString stringWithFormat:@"当前手机号 %@",pMobile];
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:mobile];
[attr yy_setFont:[UIFont boldSystemFontOfSize:17] range:[mobile rangeOfString:pMobile]];
[attr yy_setColor:RGB16(0x333333) range:[mobile rangeOfString:pMobile]];
self.mobileLabel.attributedText = attr;
[self.view addSubview:self.mobileLabel];
[self.mobileLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.view);
make.top.equalTo(self.titleLabel.mas_bottom).offset(8);
make.height.mas_equalTo(28);
}];
self.changeBtn = [[UIButton alloc] init];
[self.changeBtn setTitle:@"更换手机号码" forState:(UIControlStateNormal)];
[self.changeBtn setTitleColor:QXConfig.btnTextColor forState:(UIControlStateNormal)];
[self.changeBtn addTarget:self action:@selector(changeAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.changeBtn addRoundedCornersWithRadius:21];
self.changeBtn.titleLabel.font = [UIFont systemFontOfSize:14];
self.changeBtn.backgroundColor = QXConfig.themeColor;
[self.view addSubview:self.changeBtn];
[self.changeBtn mas_makeConstraints:^(MASConstraintMaker *make) {
make.centerX.equalTo(self.view);
make.top.equalTo(self.mobileLabel.mas_bottom).offset(30);
make.height.mas_equalTo(42);
make.width.mas_equalTo(ScaleWidth(300));
}];
}
-(void)changeAction{
QXBindMobileViewController *vc = [[QXBindMobileViewController alloc] init];
vc.haveMobile = YES;
[self.navigationController pushViewController:vc animated:YES];
}
@end

View File

@@ -17,6 +17,7 @@
@property (nonatomic,strong)QXLoginTextField *pwdTextField;
@property (nonatomic,strong)QXLoginTextField *repwdTextField;
@property (nonatomic,strong)UIButton *commitBtn;
@property (nonatomic,assign)BOOL isNetworking;
@end
@implementation QXSetPwdViewController
@@ -75,13 +76,19 @@
-(void)didClickSendCode:(UIButton *)sender{
MJWeakSelf
if (self.isNetworking) {
return;
}
self.isNetworking = YES;
[QXLoginNetwork getSmscodeWithMobile:[QXGlobal shareGlobal].loginModel.mobile
type:GetSmscodeTypeSetPassword
successBlock:^(id _Nonnull responseObject) {
[weakSelf.codeTextField startTimeDown];
weakSelf.isNetworking = NO;
}
failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
weakSelf.isNetworking = NO;
showToast(msg)
}];
}
-(void)commitAction{

View File

@@ -12,6 +12,7 @@ NS_ASSUME_NONNULL_BEGIN
@interface QXSettingViewController : QXBaseViewController
@property (nonatomic,copy)void(^logOutBlock)(BOOL isCancel,NSString*code);
@property (nonatomic,assign)BOOL haveNobility;
@property (nonatomic,assign)BOOL haveMobile;
@end
NS_ASSUME_NONNULL_END

View File

@@ -11,6 +11,7 @@
#import "QXAlertView.h"
#import "QXReVerificationPopView.h"
#import "QXTimer.h"
#import "QXModifyMobileViewController.h"
static NSInteger maxClickCount = 6;
@interface QXSettingViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (nonatomic,strong)UITableView *tableView;
@@ -44,18 +45,20 @@ static NSInteger maxClickCount = 6;
QXText(@"隐身进入房间"),
QXText(@"黑名单"),
QXText(@"设置密码"),
QXText(@"手机绑定"),
self.haveMobile?QXText(@"手机换绑"):QXText(@"手机绑定"),
QXText(@"关于我们"),
QXText(@"版本号")
QXText(@"版本号"),
@"上传日志"
];
}else{
section1 = @[
// QXText(@"消息通知"),
QXText(@"黑名单"),
QXText(@"设置密码"),
QXText(@"手机绑定"),
self.haveMobile?QXText(@"手机换绑"):QXText(@"手机绑定"),
QXText(@"关于我们"),
QXText(@"版本号")
QXText(@"版本号"),
@"上传日志"
];
}
@@ -72,6 +75,7 @@ static NSInteger maxClickCount = 6;
QXText(@"黑名单"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyArrow],
QXText(@"设置密码"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyArrow],
QXText(@"手机绑定"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyArrow],
QXText(@"手机换绑"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyArrow],
QXText(@"版本号"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyDetail],
QXText(@"切换账号"):[NSNumber numberWithInteger:QXSettingCellTypeOnlyArrow],
QXText(@"实名认证"):[NSNumber numberWithInteger:QXSettingCellTypeNormal],
@@ -86,6 +90,7 @@ static NSInteger maxClickCount = 6;
QXText(@"黑名单"):@"QXBlackListlViewController",
QXText(@"设置密码"):@"QXSetPwdViewController",
QXText(@"手机绑定"):@"QXBindMobileViewController",
QXText(@"手机换绑"):@"QXModifyMobileViewController",
QXText(@"版本号"):@"",
QXText(@"切换账号"):@"QXChangeAccountViewController",
QXText(@"实名认证"):[QXGlobal shareGlobal].isRealName?@"QXRealNameFinishedViewController":@"QXRealNameViewController",
@@ -100,6 +105,7 @@ static NSInteger maxClickCount = 6;
QXText(@"黑名单"):@"",
QXText(@"设置密码"):@"",
QXText(@"手机绑定"):@"",
QXText(@"手机换绑"):@"",
QXText(@"版本号"):appVersion,
QXText(@"切换账号"):@"",
QXText(@"实名认证"):@"",
@@ -174,9 +180,29 @@ static NSInteger maxClickCount = 6;
}else{
self.clickCount = 0;
}
if ([text isEqualToString:@"上传日志"]) {
__weak typeof(self)weakSelf = self;
showLoadingInView(self.view);
NSString *path = [QXLogger getLatestLogFilePath];
NSString *fileName = [path lastPathComponent];
if (![fileName isExist]) {
fileName = @"ios_log";
}
NSURL *filePath = [NSURL fileURLWithPath:path];
[[QXCOSUploadManager shareManager] uploadFile:filePath withObjectKey:fileName path:LOG_FILE_BASE_PATH complete:^(NSString * _Nonnull fileUrl, QXCOSUploadImageState state) {
dispatch_async(dispatch_get_main_queue(), ^{
hideLoadingInView(weakSelf.view);
});
[QXMineNetwork appLogReportWithLogName:fileName log_url:fileUrl successBlock:^(NSString * _Nonnull status) {
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
}];
return;
}
if ([text isEqualToString:QXText(@"账号注销")]) {
UIView *view;
if ([QXGlobal.shareGlobal.loginModel.mobile isExist]) {
[[QXGlobal shareGlobal] showView:self.codeAlertView controller:self popType:(PopViewTypeTopToCenter) tapDismiss:NO finishBlock:^{

View File

@@ -54,7 +54,8 @@ NS_ASSUME_NONNULL_BEGIN
///1 锁 0 开
@property(nonatomic,strong)NSString *is_lock;
@property(nonatomic,strong)NSArray<QXDayTaskListModel*>*task_list;
/// 待领取数量
@property(nonatomic,assign)NSInteger wait_reward_num;
@property(nonatomic,assign)BOOL isSelected;
@end

View File

@@ -36,6 +36,8 @@ NS_ASSUME_NONNULL_BEGIN
/// 是否为cp礼物 0 打开 1 锁住
@property (nonatomic,strong)NSString *is_cp;
@property (nonatomic,strong)NSString *icon;
/// 是否为师徒标签
@property (nonatomic,strong)NSString *is_teacher;

View File

@@ -0,0 +1,21 @@
//
// QXRoomActivityStatusModel.h
// QXLive
//
// Created by 启星 on 2025/12/21.
//
#import <Foundation/Foundation.h>
NS_ASSUME_NONNULL_BEGIN
@interface QXRoomActivityStatusModel : NSObject
@property (nonatomic,strong)NSString *gift_bag_id;
@property (nonatomic,strong)NSString *name;
/// 活动状态 0 未开启 1 已开启
@property (nonatomic,strong)NSString *status;
@property (nonatomic,strong)NSString *status_str;
@property (nonatomic,strong)NSString *icon;
@end
NS_ASSUME_NONNULL_END

View File

@@ -0,0 +1,12 @@
//
// QXRoomActivityStatusModel.m
// QXLive
//
// Created by on 2025/12/21.
//
#import "QXRoomActivityStatusModel.h"
@implementation QXRoomActivityStatusModel
@end

View File

@@ -54,6 +54,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)NSArray<QXUserHomeModel*>*user_list;
/// 火热值
@property (nonatomic,strong)NSString*hot_value;
@property (nonatomic,strong)NSString*lucky_water;
@end

View File

@@ -31,6 +31,7 @@
#import "QXUserSongListModel.h"
#import "QXRoomBestFriendModel.h"
#import "QXFamilyModel.h"
#import "QXRoomActivityStatusModel.h"
NS_ASSUME_NONNULL_BEGIN
@@ -291,6 +292,15 @@ NS_ASSUME_NONNULL_BEGIN
successBlock:(void (^)(NSArray<QXMyRoomHistory*>* list))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
/**
进入房间前监测
*/
+(void)beforeJoinRoomWithRoomId:(NSString *)room_id
successBlock:(void (^)(NSDictionary* dict))successBlock
roomErrorBlock:(void (^)(NSString * roomId, NSString * msg))roomErrorBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
/**
进入房间
*/
@@ -1438,7 +1448,19 @@ NS_ASSUME_NONNULL_BEGIN
+(void)appTaskWaitDrawSuccessBlock:(void (^)(NSString* num))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
/**
每日任务未领取数量
*/
+(void)appLogReportWithLogName:(NSString*)log_name
log_url:(NSString*)log_url
successBlock:(void (^)(NSString* status))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
/**
获取房间活动状态
*/
+(void)getRoomActivityStatusSuccessBlock:(void (^)(NSArray<QXRoomActivityStatusModel*>* list))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock;
@end

View File

@@ -588,6 +588,32 @@
failBlock(error,msg);
}];
}
+(void)beforeJoinRoomWithRoomId:(NSString *)room_id
successBlock:(void (^)(NSDictionary* dict))successBlock
roomErrorBlock:(void (^)(NSString * roomId, NSString * msg))roomErrorBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
[[QXRequset shareInstance] postWithUrl:QXBeforeJoinRoom parameters:@{@"room_id":room_id} needCache:NO success:^(id responseObject) {
int code = [responseObject[@"code"] intValue];
if(code == 202){
id object = responseObject[@"data"];
NSString *roomId = @"";
NSString*content = @"";
if ([object isKindOfClass:[NSDictionary class]]) {
roomId = [NSString stringWithFormat:@"%@",object[@"room_id"]];
content = [NSString stringWithFormat:@"%@",object[@"msg"]];
}
if (roomErrorBlock) {
roomErrorBlock(roomId,content);
}
}else{
if (successBlock) {
successBlock(responseObject[@"data"]);
}
}
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
failBlock(error,msg);
}];
}
+(void)joinRoomWithRoomId:(NSString *)room_id successBlock:(nonnull void (^)(QXRoomModel * _Nonnull))successBlock roomErrorBlock:(nonnull void (^)(NSString * _Nonnull, NSString * _Nonnull))roomErrorBlock failBlock:(nonnull void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{
NSDictionary *parameters =@{
@@ -710,24 +736,25 @@
successBlock(responseObject[@"data"]);
}
// NSDictionary *cp_type = [NSDictionary stringWithFormat:@"%@",responseObject[@"data"][@"cp_type"]];
id object = responseObject[@"data"][@"cp_type"];
if ([object isKindOfClass:[NSDictionary class]]) {
NSDictionary *cpDict = (NSDictionary *)object;
NSString *cp_type = [NSString stringWithFormat:@"%@",cpDict[@"cp_type"]];
if (cp_type.intValue == 1) {
/// cp
NSString *jsonStr = [cpDict jsonStringEncoded];
[[QXRoomMessageManager shared] sendC2CMessage:jsonStr messageType:(QXRoomMessageTypeSendAndRecieveCpHeartSignal) userId:userId];
}else if (cp_type.intValue == 2){
/// cp
NSString *jsonStr = [cpDict jsonStringEncoded];
[[QXRoomMessageManager shared] sendC2CMessage:jsonStr messageType:(QXRoomMessageTypeCpHeartFinished) userId:userId];
[[QXRoomMessageManager shared] showCpFinishedAlertViewWithText:[NSString stringWithFormat:@"%@",cpDict[@"text"]]];
}else{
if ([responseObject[@"data"] isKindOfClass:[NSDictionary class]]) {
id object = responseObject[@"data"][@"cp_type"];
if ([object isKindOfClass:[NSDictionary class]]) {
NSDictionary *cpDict = (NSDictionary *)object;
NSString *cp_type = [NSString stringWithFormat:@"%@",cpDict[@"cp_type"]];
if (cp_type.intValue == 1) {
/// cp
NSString *jsonStr = [cpDict jsonStringEncoded];
[[QXRoomMessageManager shared] sendC2CMessage:jsonStr messageType:(QXRoomMessageTypeSendAndRecieveCpHeartSignal) userId:userId];
}else if (cp_type.intValue == 2){
/// cp
NSString *jsonStr = [cpDict jsonStringEncoded];
[[QXRoomMessageManager shared] sendC2CMessage:jsonStr messageType:(QXRoomMessageTypeCpHeartFinished) userId:userId];
[[QXRoomMessageManager shared] showCpFinishedAlertViewWithText:[NSString stringWithFormat:@"%@",cpDict[@"text"]]];
}else{
}
}
}
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
failBlock(error,msg);
}];
@@ -2882,7 +2909,7 @@
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
[[QXRequset shareInstance] getWithUrl:QXAppSignStatus parameters:@{} needCache:NO success:^(id responseObject) {
if (successBlock) {
NSString *status = [NSString stringWithFormat:@"%@",responseObject[@"data"]];
NSString *status = [NSString stringWithFormat:@"%@",responseObject[@"data"][@"status"]];
successBlock(status);
}
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
@@ -2904,4 +2931,31 @@
failBlock(error,msg);
}];
}
+(void)appLogReportWithLogName:(NSString *)log_name log_url:(NSString *)log_url successBlock:(void (^)(NSString * _Nonnull))successBlock failBlock:(void (^)(NSError * _Nonnull, NSString * _Nonnull))failBlock{
[[QXRequset shareInstance] postWithUrl:QXAppLogReport parameters:@{@"log_name":log_name?:@"",@"log_url":log_url?:@""} needCache:NO success:^(id responseObject) {
if (successBlock) {
successBlock(responseObject);
}
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
failBlock(error,msg);
}];
}
/**
*/
+(void)getRoomActivityStatusSuccessBlock:(void (^)(NSArray<QXRoomActivityStatusModel*>* list))successBlock
failBlock:(void (^)(NSError * error, NSString * msg))failBlock{
[[QXRequset shareInstance] getWithUrl:QXActivityStatus parameters:@{} needCache:NO success:^(id responseObject) {
if (successBlock) {
NSArray *list = [NSArray yy_modelArrayWithClass:[QXRoomActivityStatusModel class] json:responseObject[@"data"]];
successBlock(list);
}
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
failBlock(error,msg);
}];
}
@end

View File

@@ -36,6 +36,7 @@ NS_ASSUME_NONNULL_BEGIN
@property (weak, nonatomic) IBOutlet UIButton *roomSubsidyBtn;
@property (nonatomic,assign)NSInteger bgImageCount;
@property (weak, nonatomic) IBOutlet UIImageView *roomWaitImageView;
@property (weak, nonatomic) IBOutlet UILabel *luckyWaterLabel;
@property (nonatomic,strong)QXRoomListModel *model;
/// 0 我创建的 1 我主持的

View File

@@ -92,10 +92,13 @@
NSString *money = [NSString stringWithFormat:@"%.4f",model.today_profit.doubleValue];
self.moneyLabel.text = [NSString stringWithFormat:@"%@",money];
[self.typeImageView sd_setImageWithURL:[NSURL URLWithString:model.label_icon] placeholderImage:nil];
self.luckyWaterLabel.text = model.lucky_water;
if (model.apply_status.intValue == 1) {
self.roomWaitImageView.hidden = NO;
self.luckyWaterLabel.hidden = YES;
}else{
self.roomWaitImageView.hidden = YES;
self.luckyWaterLabel.hidden = NO;
}
}
- (IBAction)roomDetailAction:(id)sender {

View File

@@ -130,6 +130,12 @@
<constraint firstAttribute="width" constant="64" id="sSX-Jv-Huj"/>
</constraints>
</imageView>
<label hidden="YES" opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="幸运流水:0" textAlignment="right" lineBreakMode="tailTruncation" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="2bq-E7-5RX">
<rect key="frame" x="460.33333333333331" y="116.66666666666667" width="63.666666666666686" height="16.000000000000014"/>
<fontDescription key="fontDescription" type="system" pointSize="13"/>
<color key="textColor" white="0.5" alpha="1" colorSpace="custom" customColorSpace="calibratedWhite"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="sme-1q-gFv">
<rect key="frame" x="12" y="109.66666666666667" width="82" height="30.000000000000014"/>
<constraints>
@@ -161,6 +167,7 @@
<constraint firstAttribute="trailing" secondItem="3bm-oL-g9B" secondAttribute="trailing" constant="6" id="FFG-1q-qus"/>
<constraint firstItem="N2H-oT-j7d" firstAttribute="leading" secondItem="n8c-Bl-dxD" secondAttribute="trailing" constant="8" symbolic="YES" id="IUg-ec-S0W"/>
<constraint firstItem="UEZ-KG-LO0" firstAttribute="leading" secondItem="gwx-5C-Dyi" secondAttribute="trailing" id="KiF-aV-j2i"/>
<constraint firstItem="2bq-E7-5RX" firstAttribute="centerY" secondItem="sme-1q-gFv" secondAttribute="centerY" id="KtY-XS-4qD"/>
<constraint firstItem="NQD-O5-Mxv" firstAttribute="leading" secondItem="n8c-Bl-dxD" secondAttribute="leading" id="LkZ-It-52D"/>
<constraint firstItem="n8c-Bl-dxD" firstAttribute="leading" secondItem="hCx-Bc-lup" secondAttribute="trailing" constant="8" id="Ozs-3q-8HK"/>
<constraint firstAttribute="trailing" secondItem="t6e-Ib-pCi" secondAttribute="trailing" id="Q80-US-afM"/>
@@ -185,6 +192,7 @@
<constraint firstItem="k0N-ev-a0T" firstAttribute="leading" secondItem="kMB-zj-bvu" secondAttribute="leading" constant="12" id="rB0-hW-4Ld"/>
<constraint firstAttribute="trailing" secondItem="xiq-z8-B3x" secondAttribute="trailing" constant="12" id="ukL-M0-WWd"/>
<constraint firstItem="ay1-ie-dOO" firstAttribute="centerY" secondItem="sme-1q-gFv" secondAttribute="centerY" id="vdN-zt-xpb"/>
<constraint firstItem="2bq-E7-5RX" firstAttribute="trailing" secondItem="7dX-Cp-SDr" secondAttribute="trailing" id="wtS-vE-whA"/>
</constraints>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
@@ -208,6 +216,7 @@
<outlet property="comeCountLabel" destination="RxR-I5-aqT" id="Ros-Uf-7C7"/>
<outlet property="followLabel" destination="gwx-5C-Dyi" id="uTA-Os-MrH"/>
<outlet property="headerImageView" destination="hCx-Bc-lup" id="bfX-FC-RjW"/>
<outlet property="luckyWaterLabel" destination="2bq-E7-5RX" id="W0y-PM-cDj"/>
<outlet property="moneyLabel" destination="7dX-Cp-SDr" id="igl-zs-dLw"/>
<outlet property="nickNameLabel" destination="N2H-oT-j7d" id="Zrg-Bj-xZR"/>
<outlet property="onlineLabel" destination="UEZ-KG-LO0" id="XG2-KV-U11"/>
@@ -222,6 +231,6 @@
</objects>
<resources>
<image name="my_room_wait" width="88" height="88"/>
<image name="user_header_placehoulder" width="60" height="60"/>
<image name="user_header_placehoulder" width="100" height="100"/>
</resources>
</document>

View File

@@ -16,6 +16,7 @@ NS_ASSUME_NONNULL_BEGIN
@end
@interface QXDayTaskCell : UITableViewCell
@property (weak, nonatomic) IBOutlet UIView *bgView;
@property (weak, nonatomic) IBOutlet UIImageView *iconImageView;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *subTitleLabel;

View File

@@ -15,6 +15,7 @@
if (!cell) {
cell = [[NSBundle mainBundle] loadNibNamed:cellId owner:nil options:nil].lastObject;
cell.backgroundColor = [UIColor clearColor];
cell.contentView.backgroundColor = UIColor.clearColor;
}
return cell;
}
@@ -35,15 +36,24 @@
if (model.task_status.intValue == 1) {
self.finishBtn.enabled = YES;
self.finishBtn.selected = NO;
self.finishBtn.layer.borderWidth = 1;
// self.finishBtn.layer.borderWidth = 1;
// self.bgView.layer.borderColor = RGB(184, 177, 106).CGColor;
// self.bgView.backgroundColor = RGB(110, 72, 41);
// self.bgView.layer.borderWidth = 1;
}else if (model.task_status.intValue == 2) {
self.finishBtn.enabled = YES;
self.finishBtn.selected = YES;
self.finishBtn.layer.borderWidth = 1;
// self.finishBtn.layer.borderWidth = 1;
// self.bgView.layer.borderColor = RGB(184, 177, 106).CGColor;
// self.bgView.backgroundColor = RGB(110, 72, 41);
// self.bgView.layer.borderWidth = 1;
}else{
self.finishBtn.selected = NO;
self.finishBtn.enabled = NO;
self.finishBtn.layer.borderWidth = 0;
// self.finishBtn.layer.borderWidth = 0;
// self.bgView.layer.borderColor = RGB(184, 177, 106).CGColor;
// self.bgView.backgroundColor = RGB(110, 72, 41);
// self.bgView.layer.borderWidth = 1;
}
}
- (IBAction)finishAction:(id)sender {
@@ -55,14 +65,14 @@
[super awakeFromNib];
// Initialization code
[self.finishBtn addRoundedCornersWithRadius:15];
[self.finishBtn setTitleColor:RGB16(0x3ABC6D) forState:(UIControlStateNormal)];
[self.finishBtn setTitleColor:UIColor.whiteColor forState:(UIControlStateNormal)];
[self.finishBtn setTitleColor:UIColor.whiteColor forState:(UIControlStateSelected)];
[self.finishBtn setTitleColor:RGB16(0x666666) forState:(UIControlStateDisabled)];
[self.finishBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0x3ABC6D)] forState:(UIControlStateSelected)];
[self.finishBtn setBackgroundImage:[UIImage imageWithColor:UIColor.clearColor] forState:(UIControlStateNormal)];
[self.finishBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0xF1F2F3)] forState:(UIControlStateDisabled)];
self.finishBtn.layer.borderColor = RGB16(0x3ABC6D).CGColor;
self.finishBtn.layer.borderWidth = 1;
[self.finishBtn setTitleColor:RGB16(0xD8D8D8) forState:(UIControlStateDisabled)];
[self.finishBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0xE36C4A)] forState:(UIControlStateSelected)];
[self.finishBtn setBackgroundImage:[UIImage imageWithColor:QXConfig.themeColor] forState:(UIControlStateNormal)];
[self.finishBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0xAC9993)] forState:(UIControlStateDisabled)];
// self.finishBtn.layer.borderColor = RGB16(0x3ABC6D).CGColor;
// self.finishBtn.layer.borderWidth = 1;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {

View File

@@ -17,6 +17,16 @@
<rect key="frame" x="0.0" y="0.0" width="481" height="108"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<view contentMode="scaleToFill" translatesAutoresizingMaskIntoConstraints="NO" id="vrD-8N-Rf4">
<rect key="frame" x="0.0" y="4" width="481" height="100"/>
<color key="backgroundColor" red="0.20000000000000001" green="0.16470588235294117" blue="0.27450980392156865" alpha="1" colorSpace="calibratedRGB"/>
<userDefinedRuntimeAttributes>
<userDefinedRuntimeAttribute type="boolean" keyPath="layer.masksToBounds" value="YES"/>
<userDefinedRuntimeAttribute type="number" keyPath="layer.cornerRadius">
<integer key="value" value="8"/>
</userDefinedRuntimeAttribute>
</userDefinedRuntimeAttributes>
</view>
<imageView clipsSubviews="YES" userInteractionEnabled="NO" contentMode="scaleAspectFit" horizontalHuggingPriority="251" verticalHuggingPriority="251" translatesAutoresizingMaskIntoConstraints="NO" id="Zzf-Hx-7yu">
<rect key="frame" x="16" y="9" width="40" height="40"/>
<constraints>
@@ -27,7 +37,7 @@
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="gZv-uE-Dy3">
<rect key="frame" x="62" y="9" width="333" height="69"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.20000000000000001" green="0.20000000000000001" blue="0.20000000000000001" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="1" green="1" blue="1" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
<button opaque="NO" contentMode="scaleToFill" contentHorizontalAlignment="center" contentVerticalAlignment="center" lineBreakMode="middleTruncation" translatesAutoresizingMaskIntoConstraints="NO" id="bni-4p-6Qt">
@@ -50,7 +60,7 @@
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="eqP-bF-SEp">
<rect key="frame" x="62" y="83" width="333" height="17"/>
<fontDescription key="fontDescription" type="system" pointSize="14"/>
<color key="textColor" red="0.88627450980392153" green="0.25490196078431371" blue="0.44313725490196076" alpha="1" colorSpace="calibratedRGB"/>
<color key="textColor" red="1" green="0.69019607843137254" blue="0.15294117647058825" alpha="1" colorSpace="calibratedRGB"/>
<nil key="highlightedColor"/>
</label>
</subviews>
@@ -61,9 +71,13 @@
<constraint firstItem="bni-4p-6Qt" firstAttribute="leading" secondItem="eqP-bF-SEp" secondAttribute="trailing" constant="10" id="ANm-2o-d67"/>
<constraint firstAttribute="trailing" secondItem="bni-4p-6Qt" secondAttribute="trailing" constant="16" id="FGd-NP-Bud"/>
<constraint firstItem="eqP-bF-SEp" firstAttribute="top" secondItem="gZv-uE-Dy3" secondAttribute="bottom" constant="5" id="Ftb-vc-ugs"/>
<constraint firstItem="vrD-8N-Rf4" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="4" id="Glk-DW-BDl"/>
<constraint firstItem="Zzf-Hx-7yu" firstAttribute="top" secondItem="H2p-sc-9uM" secondAttribute="top" constant="9" id="JNo-Ml-0Uf"/>
<constraint firstItem="Zzf-Hx-7yu" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" constant="16" id="LJ1-Ut-byU"/>
<constraint firstItem="vrD-8N-Rf4" firstAttribute="leading" secondItem="H2p-sc-9uM" secondAttribute="leading" id="VBb-ng-q59"/>
<constraint firstAttribute="bottom" secondItem="vrD-8N-Rf4" secondAttribute="bottom" constant="4" id="WxO-37-JHo"/>
<constraint firstItem="bni-4p-6Qt" firstAttribute="leading" secondItem="gZv-uE-Dy3" secondAttribute="trailing" constant="10" id="XUO-fj-17G"/>
<constraint firstAttribute="trailing" secondItem="vrD-8N-Rf4" secondAttribute="trailing" id="a8L-dS-yCw"/>
<constraint firstAttribute="bottom" secondItem="eqP-bF-SEp" secondAttribute="bottom" constant="8" id="iSn-GZ-hix"/>
<constraint firstItem="gZv-uE-Dy3" firstAttribute="top" secondItem="Zzf-Hx-7yu" secondAttribute="top" id="mgj-C7-FFs"/>
<constraint firstItem="eqP-bF-SEp" firstAttribute="leading" secondItem="gZv-uE-Dy3" secondAttribute="leading" id="qVo-gN-l0W"/>
@@ -71,6 +85,7 @@
</tableViewCellContentView>
<viewLayoutGuide key="safeArea" id="aW0-zy-SZf"/>
<connections>
<outlet property="bgView" destination="vrD-8N-Rf4" id="hMg-zC-qbI"/>
<outlet property="finishBtn" destination="bni-4p-6Qt" id="K8I-ow-9Uv"/>
<outlet property="iconImageView" destination="Zzf-Hx-7yu" id="D8z-6l-i8N"/>
<outlet property="subTitleLabel" destination="eqP-bF-SEp" id="NDK-d5-ZFa"/>

View File

@@ -50,18 +50,18 @@
self.bgView = [[UIView alloc] initWithFrame:CGRectMake(0, ScaleWidth(52), self.width, self.height-ScaleWidth(52)-12)];
[self.bgView addRoundedCornersWithRadius:16];
self.bgView.backgroundColor = [UIColor whiteColor];
self.bgView.backgroundColor = RGB16(0x31433F);
[self addSubview:self.bgView];
CGFloat boxWidth = (self.width-16*3)/2;
self.leftBoxView = [[QXDayTaskTopSubView alloc] initWithFrame:CGRectMake(16, 16, boxWidth, self.bgView.height-16*2)];
[self.leftBoxView addRoundedCornersWithRadius:8];
self.leftBoxView.backgroundColor = RGB16(0xFCE4ED);
self.leftBoxView.backgroundColor = RGB16(0xA457F8);
self.leftBoxView.type = QXDayTaskTopSubViewTypeLeft;
[self.bgView addSubview:self.leftBoxView];
self.rightBoxView = [[QXDayTaskTopSubView alloc] initWithFrame:CGRectMake(self.leftBoxView.right+16, 16, boxWidth, self.leftBoxView.height) ];
self.rightBoxView.backgroundColor = RGB16(0xFDE8AE);
self.rightBoxView.backgroundColor = RGB16(0xD89F47);
[self.rightBoxView addRoundedCornersWithRadius:8];
self.rightBoxView.type = QXDayTaskTopSubViewTypeRight;
[self.bgView addSubview:self.rightBoxView];
@@ -98,13 +98,13 @@
-(void)initSubviews{
self.titleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 10, self.width-20, 24)];
self.titleLabel.font = [UIFont boldSystemFontOfSize:16];
self.titleLabel.textColor = RGB16(0xE24171);
self.titleLabel.textColor = RGB16(0xffffff);
self.titleLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.titleLabel];
self.subTitleLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, self.titleLabel.bottom, self.width-20, 18)];
self.subTitleLabel.font = [UIFont systemFontOfSize:12];
self.subTitleLabel.textColor = RGB16(0x999999);
self.subTitleLabel.textColor = RGB16(0xffffff);
self.subTitleLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.subTitleLabel];
@@ -114,7 +114,7 @@
self.cornLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, self.iconImageView.bottom, self.width-20, 18)];
self.cornLabel.font = [UIFont systemFontOfSize:12];
self.cornLabel.textColor = RGB16(0x999999);
self.cornLabel.textColor = RGB16(0xffffff);
self.cornLabel.textAlignment = NSTextAlignmentCenter;
[self addSubview:self.cornLabel];
@@ -146,7 +146,7 @@
_boxModel = boxModel;
self.titleLabel.text = boxModel.name;
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:boxModel.title];
[attr yy_setColor:RGB16(0xE24171) range:[boxModel.title rangeOfString:boxModel.highest_gain]];
[attr yy_setColor:RGB16(0xFFEA00) range:[boxModel.title rangeOfString:boxModel.highest_gain]];
self.subTitleLabel.attributedText = attr;
if (boxModel.icon.length > 0 && ([boxModel.icon hasPrefix:@"http"] || [boxModel.icon hasPrefix:@"https"])) {
[self.iconImageView sd_setImageWithURL:[NSURL URLWithString:boxModel.icon]];

View File

@@ -14,6 +14,7 @@
@property (nonatomic,strong)QXLoginTextField *codeTextField;
@property (nonatomic,strong)UIButton *closeBtn;
@property (nonatomic,strong)UIButton *commitBtn;
@property (nonatomic,assign)BOOL isNetworking;
@end
@implementation QXReVerificationPopView
@@ -126,6 +127,9 @@
}
-(void)didClickSendCode:(UIButton *)sender{
if (self.isNetworking) {
return;
}
NSString*mobile = [QXGlobal shareGlobal].loginModel.mobile;
if (mobile.length == 0) {
showToast(@"请先绑定手机号");
@@ -136,10 +140,13 @@
type = GetSmscodeTypeAccountCancel;
}
MJWeakSelf
self.isNetworking = YES;
[QXLoginNetwork getSmscodeWithMobile:[QXGlobal shareGlobal].loginModel.mobile type:type successBlock:^(id _Nonnull responseObject) {
[weakSelf.codeTextField startTimeDown];
weakSelf.isNetworking = NO;
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
showToast(msg);
weakSelf.isNetworking = NO;
}];
}
@end

View File

@@ -271,7 +271,7 @@ static NSInteger HTTP_ERROR_CODE = 0;
return [manager GET:urlString parameters:parameters headers:headers progress:^(NSProgress * _Nonnull downloadProgress) {
} success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
[QXLogger network:@"网络请求" url:urlString params:parameters response:responseObject error:nil];
NSDictionary *dict = [self getResponseDictWith:responseObject urlString:urlString];
int code = [dict[@"code"] intValue];
if (code == HTTP_LOGINLOSE_CODE) {
@@ -301,7 +301,7 @@ static NSInteger HTTP_ERROR_CODE = 0;
if (fail){
fail(error,error.description,task);
};
[QXLogger network:@"网络请求" url:urlString params:parameters response:nil error:error];
NSHTTPURLResponse * responses = (NSHTTPURLResponse *)task.response;
NSLog(@"失败返回 --- URL %@ \n ---错误码 = %ld \n ---详细信息 : %@",urlString,(long)responses.statusCode,error);
}];
@@ -333,6 +333,7 @@ static NSInteger HTTP_ERROR_CODE = 0;
} progress:^(NSProgress * _Nonnull uploadProgress) {
} success:^(NSURLSessionDataTask * _Nonnull task, id _Nullable responseObject) {
[QXLogger network:@"网络请求" url:urlString params:parameters response:responseObject error:nil];
NSDictionary *dict = [self getResponseDictWith:responseObject urlString:urlString];
int code = [dict[@"code"] intValue];
if (code == HTTP_LOGINLOSE_CODE) {
@@ -361,7 +362,7 @@ static NSInteger HTTP_ERROR_CODE = 0;
if (fail){
fail(error,error.localizedDescription,task);
};
[QXLogger network:@"网络请求" url:urlString params:parameters response:nil error:error];
NSHTTPURLResponse * responses = (NSHTTPURLResponse *)task.response;
NSLog(@"失败返回 --- URL %@ \n ---错误码 = %ld \n ---详细信息 : %@",urlString,(long)responses.statusCode,error);
}];

View File

@@ -46,6 +46,7 @@
#import <Bugly/Bugly.h>
#import <AlipaySDK/AlipaySDK.h>
#import <TIMPush/TIMPushManager.h>
#import <XHLaunchAd.h>
#import <SDWebImageWebPCoder/SDWebImageWebPCoder.h>
#import "QXAppStartViewController.h"
#import "QXGiftPlayerManager.h"
@@ -86,6 +87,7 @@
SDImageWebPCoder *webPCoder = [SDImageWebPCoder sharedCoder];
[IQKeyboardManager sharedManager].enable = NO;
[[SDImageCodersManager sharedManager] addCoder:webPCoder];
[self startVideo];
[self configThirdPartLogin];
#if DEBUG
[[LLDebugTool sharedTool] startWorking];
@@ -289,6 +291,9 @@
}
}
-(void)popInviteWithModel:(QXRoomListModel*)model{
if ([KEYWINDOW.rootViewController isKindOfClass:[QXAppStartViewController class]]) {
return;
}
QXRoomNavigationController*na = (QXRoomNavigationController*)KEYWINDOW.rootViewController;
if ([na.visibleViewController isKindOfClass:[QXAlertViewController class]]) {
return;
@@ -353,4 +358,21 @@
- (void)onNotificationClicked:(NSString *)ext {
// ext
}
-(void)startVideo{
[XHLaunchAd setLaunchSourceType:SourceTypeLaunchScreen];
// [XHLaunchAd setWaitDataDuration:1];
//广
XHLaunchVideoAdConfiguration *videoAdconfiguration = [XHLaunchVideoAdConfiguration defaultConfiguration];
// NSString *path = [[NSBundle mainBundle] pathForResource:@"app_start" ofType:@"mp4"];
videoAdconfiguration.videoNameOrURLString = @"app_start.mp4";
videoAdconfiguration.duration = 2;
videoAdconfiguration.skipButtonType = SkipTypeNone;
[XHLaunchAd videoAdWithVideoAdConfiguration:videoAdconfiguration];
//广URLString/(.jpg/.gif)
// imageAdconfiguration. = model.img;
// //广(openModelNSString,,)
// imageAdconfiguration.openModel = model;
// //广
// [XHLaunchAd imageAdWithImageAdConfiguration:imageAdconfiguration delegate:self];
}
@end

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "change_mobile_top@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "change_mobile_top@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 110 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 226 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_redbag_sound_off@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_redbag_sound_off@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.4 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_redbag_sound_on@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_redbag_sound_on@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.3 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_set_room_age_ac@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_set_room_age_ac@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "room_set_room_time_ac@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "room_set_room_time_ac@3x.png",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

View File

@@ -34,7 +34,8 @@ static NSString *const FaceAuthLicense = @"Fq0Sj4UpfryHBB3inAxCwLmJUw3nNGc42mqvv
static NSInteger const TencentIMID = 1600096890;
static NSString *const TencentIMSecret = @"448a3259085924f89957c1884c761974e8fded64b9ab1c67b8e0a5a1c4b68f3f";
static NSString *const AddressOfMQTTServer = @"1.13.181.248";
//static NSString *const AddressOfMQTTServer = @"1.13.181.248";
static NSString *const AddressOfMQTTServer = @"test.vespa.qxyushen.top";
static NSInteger const AddressOfMQTTPort = 1883;
static NSInteger const AppPushId = 46164;
@@ -58,7 +59,8 @@ static NSString *const FaceAuthLicense = @"P6N+VYfdu1Op5p+QwUGdI4y64PqOnxMzChX2S
static NSInteger const TencentIMID = 1600096860;
static NSString *const TencentIMSecret = @"d9a5b8088ed39113d0c92ae434bc37528c4715c1f1d2eaedb172134eacd06103";
static NSString *const AddressOfMQTTServer = @"1.13.20.30";
//static NSString *const AddressOfMQTTServer = @"1.13.20.30";
static NSString *const AddressOfMQTTServer = @"yushengapi.qxyushen.top";
static NSInteger const AddressOfMQTTPort = 1883;
static NSInteger const AppPushId = 46163;
@@ -90,6 +92,7 @@ static NSString *const OSSEndPoint = @"oss-cn-beijing.aliyuncs.com";
//static NSString *const IMG_FILE_BASE_PATH = @"ios_images/";
static NSString *const IMG_FILE_BASE_PATH = @"images/ios_images/";
static NSString *const AUDIO_FILE_BASE_PATH = @"audios/ios_audios/";
static NSString *const LOG_FILE_BASE_PATH = @"iosAppLog/";
static NSString *const VIDEO_FILE_BASE_PATH = @"ios/videos/";
static NSString *const CHAT_IMG_FILE_BASE_PATH = @"emchat/image/ios/";
static NSString *const CHAT_VIDEO_FILE_BASE_PATH = @"emchat/videos/ios";
@@ -108,6 +111,8 @@ static NSString *const kWalletRuleHide = @"kWalletRuleHide";
static NSString *const kChirldLocalPassword = @"kChirldLocalPassword";
/// 是否开启飘屏
static NSString *const kIsCloseDrifPop = @"kIsCloseDrifPop";
/// 红包音效是否播放
static NSString *const kIsCloseRedBagSound = @"kIsCloseRedBagSound";
/// 是否可以聊天
static NSString *const kIsCanChat = @"kIsCanChat";
/// 充值多少钱可以聊天

View File

@@ -36,7 +36,7 @@
#import "QXBaseNavigationController.h"
#import "QXRoomNavigationController.h"
#import "QXCOSUploadManager.h"
#import "QXLogger.h"
#import "QXLive-Bridging-Header.h"
#endif /* PrefixHeader_pch */

View File

@@ -562,4 +562,11 @@ static NSString * QXAppSign = @"api/Tasks/dailyTasksSign";
static NSString * QXAppSignStatus = @"api/Tasks/dailyTasksSignStatus";
/// 每日任务未领取数量
static NSString * QXAppTaskWaitDraw = @"api/Tasks/dailyTasksUnReceiveCount";
/// 上传日志
static NSString * QXAppLogReport = @"api/Report/android_log_report";
/// 活动状态
static NSString * QXActivityStatus = @"api/BlindBoxTurntable/blind_box_status";
/// 加入房间
static NSString * QXBeforeJoinRoom = @"api/Room/before_join_room_check";
#endif /* Api_h */

BIN
QXLive/Other/app_start.mp4 Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

View File

@@ -7,10 +7,22 @@
#import "QXRoomViewController+Activity.h"
#import "QXMeetActivityDriftView.h"
#import "QXMineNetwork.h"
@implementation QXRoomViewController (Activity)
-(void)initActivityObeserver{
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateProgress:) name:noticeXLHNotice object:nil];
[self getRoomActivietyStatus];
}
-(void)getRoomActivietyStatus{
MJWeakSelf
[QXMineNetwork getRoomActivityStatusSuccessBlock:^(NSArray<QXRoomActivityStatusModel *> * _Nonnull list) {
weakSelf.settingView.acList = list;
} failBlock:^(NSError * _Nonnull error, NSString * _Nonnull msg) {
}];
}
-(void)updateProgress:(NSNotification *)notice{
@@ -22,8 +34,6 @@
}
if (model.from_type == QXMeetActivityTypeAcProgress) {
[self.skyView updateProgress:model.xlh_data];
[self.ageView updateProgress:model.xlh_data];
[self.timeView updateProgress:model.xlh_data];
}
if (model.xlh_data.status.intValue == 1) {
self.acTagView.end_time = model.xlh_data.end_time;

View File

@@ -105,8 +105,6 @@
-(void)meetActivityProgressIsUpdate:(NSDictionary *)updateDict{
QXXLHModel *model = [QXXLHModel yy_modelWithJSON:updateDict[@"xlh_data"]];
[self.skyView updateProgress:model];
[self.ageView updateProgress:model];
[self.timeView updateProgress:model];
if (model.status.intValue == 1) {
self.acTagView.end_time = model.end_time;
[self.view addSubview:self.acTagView];

View File

@@ -49,8 +49,15 @@
///
- (void)QXRedPacketManager:(QXRedPacketManager *)manager didRemoveRedPacket:(NSString *)packetId remainingCount:(NSInteger)remainingCount{
self.redBagTagView.count = [NSString stringWithFormat:@"%ld",remainingCount];
if (self.redbagDrawView.isShow) {
if ([self.redbagDrawView.redpacketModel.redpacket_id isEqualToString:packetId]) {
if (self.redbagDrawView.drawType != QXRedBagDrawTypeFinished) {
[self.redbagDrawView changeViewType:(QXRedBagDrawTypeOpen)];
}
}
}
}
///
- (void)QXRedPacketManager:(QXRedPacketManager *)manager didUpdateRedPacket:(QXRedPacketModel *)redPacket remainingCount:(NSInteger)remainingCount{
if (self.redbagDrawView.redpacketModel != nil && self.redbagDrawView.redpacketModel.countdown > 0) {

View File

@@ -13,6 +13,7 @@
#import "QXRoomBottomView.h"
#import "QXRoomMessageManager.h"
#import "QXSendGiftView.h"
#import "QXRoomSettingView.h"
/// 活动
#import "QXSkyPraizeView.h"/// 天空之境
@@ -41,6 +42,8 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,strong)QXRoomTitleView *titleView;
/// 底部工具栏
@property (nonatomic,strong)QXRoomBottomView *bottomView;
/// 设置
@property (nonatomic,strong)QXRoomSettingView *settingView;
/// 发送礼物
@property (nonatomic,strong)QXSendGiftView *sendGiftView;

View File

@@ -12,7 +12,6 @@
#import "QXMineNetwork.h"
#import "QXGiftPlayerManager.h"
#import "QXAgoraEngine.h"
#import "QXRoomSettingView.h"
#import "QXRoomSeatContentView.h"
#import "QXSongListModel.h"
#import "QXAlertView.h"
@@ -66,8 +65,6 @@ QXRoomUserInfoViewDelegate
///
@property (nonatomic,strong)UIView *bgEffectView;
///
@property (nonatomic,strong)QXRoomSettingView *settingView;
///
@property (nonatomic,strong)QXRoomBgSettingView *roomBgSetView;
///
@@ -110,7 +107,7 @@ QXRoomUserInfoViewDelegate
[self.navigationController setNavigationBarHidden:YES animated:YES];
if (QXGlobal.shareGlobal.isOpenRecharge) {
self.dayTaskTagView.hidden = NO;
}
}
}
-(void)viewDidAppear:(BOOL)animated{
[super viewDidAppear:animated];
@@ -308,6 +305,9 @@ QXRoomUserInfoViewDelegate
}
#pragma mark -
-(void)joinRoom{
if (![[QXRoomMessageManager shared].roomId isEqualToString:self.roomId]) {
[[QXRoomMessageManager shared] joinGroupWithRoomId:self.roomId];
}
MJWeakSelf
if (self.roomModel) {
[self resetSubviews];
@@ -503,12 +503,7 @@ QXRoomUserInfoViewDelegate
self.seatContentView.hidden = NO;
self.bottomView.hidden = NO;
NSMutableArray *userIds = [NSMutableArray array];
for (QXRoomPitModel *md in self.roomModel.room_info.pit_list) {
if (md.user_id.longLongValue > 0) {
// [userIds addObject:md.user_id];
[[NSNotificationCenter defaultCenter] postNotificationName:noticeRoomUserOnlineStatusDidChanged object:@{@"user_id":md.user_id,@"is_online":[NSNumber numberWithInteger:md.is_online.integerValue]}];
}
}
// [self getUserOnlineStatusWithUserIds:[userIds componentsJoinedByString:@","]];
self.micTeamView.countLabel.text = self.roomModel.room_info.queue_number;
@@ -530,6 +525,12 @@ QXRoomUserInfoViewDelegate
}
}
self.seatContentView.roomModel = self.roomModel;
for (QXRoomPitModel *md in self.roomModel.room_info.pit_list) {
if (md.user_id.longLongValue > 0) {
// [userIds addObject:md.user_id];
[[NSNotificationCenter defaultCenter] postNotificationName:noticeRoomUserOnlineStatusDidChanged object:@{@"user_id":md.user_id,@"is_online":[NSNumber numberWithInteger:md.is_online.integerValue]}];
}
}
if ((self.roomModel.room_info.type_id.intValue == 1 || self.roomModel.room_info.type_id.intValue == 3 || self.roomModel.room_info.type_id.intValue == 4 || self.roomModel.room_info.type_id.intValue == 8) && self.roomModel.room_info.label_id.intValue == 2){
/// k
[QXAgoraEngine sharedEngine].isPlayBgMusic = NO;
@@ -1633,6 +1634,16 @@ QXRoomUserInfoViewDelegate
[redbagView showInView:self.view];
}
break;
case QXRoomSettingTypeAgeAc:{
self.ageView.roomId = self.roomId;
[self.ageView showInView:self.view];
}
break;
case QXRoomSettingTypeTimeAc:{
self.timeView.roomId = self.roomId;
[self.timeView showInView:self.view];
}
break;
default:
break;
@@ -1819,29 +1830,29 @@ QXRoomUserInfoViewDelegate
[weakSelf.sendGiftView hide];
[weakSelf.skyView showInView:weakSelf.view];
}else if(gift.gift_bag.intValue == 11) {
weakSelf.ageView.giftModel = gift;
weakSelf.ageView.roomId = weakSelf.roomId;
weakSelf.ageView.userIds = userIds;
weakSelf.ageView.heartId = weakSelf.sendGiftView.heartId;
weakSelf.ageView.auctionId = weakSelf.sendGiftView.auctionId;
if (weakSelf.sendGiftView.type == QXSendGiftViewTypeAuction) {
weakSelf.skyView.heartId = @"";
weakSelf.skyView.auctionId = weakSelf.sendGiftView.auctionId;
}
[weakSelf.sendGiftView hide];
[weakSelf.ageView showInView:weakSelf.view];
// weakSelf.ageView.giftModel = gift;
// weakSelf.ageView.roomId = weakSelf.roomId;
// weakSelf.ageView.userIds = userIds;
// weakSelf.ageView.heartId = weakSelf.sendGiftView.heartId;
// weakSelf.ageView.auctionId = weakSelf.sendGiftView.auctionId;
// if (weakSelf.sendGiftView.type == QXSendGiftViewTypeAuction) {
// weakSelf.skyView.heartId = @"";
// weakSelf.skyView.auctionId = weakSelf.sendGiftView.auctionId;
// }
// [weakSelf.sendGiftView hide];
// [weakSelf.ageView showInView:weakSelf.view];
}else if(gift.gift_bag.intValue == 12) {
weakSelf.timeView.giftModel = gift;
weakSelf.timeView.roomId = weakSelf.roomId;
weakSelf.timeView.userIds = userIds;
weakSelf.timeView.heartId = weakSelf.sendGiftView.heartId;
weakSelf.timeView.auctionId = weakSelf.sendGiftView.auctionId;
if (weakSelf.sendGiftView.type == QXSendGiftViewTypeAuction) {
weakSelf.skyView.heartId = @"";
weakSelf.skyView.auctionId = weakSelf.sendGiftView.auctionId;
}
[weakSelf.sendGiftView hide];
[weakSelf.timeView showInView:weakSelf.view];
// weakSelf.timeView.giftModel = gift;
// weakSelf.timeView.roomId = weakSelf.roomId;
// weakSelf.timeView.userIds = userIds;
// weakSelf.timeView.heartId = weakSelf.sendGiftView.heartId;
// weakSelf.timeView.auctionId = weakSelf.sendGiftView.auctionId;
// if (weakSelf.sendGiftView.type == QXSendGiftViewTypeAuction) {
// weakSelf.skyView.heartId = @"";
// weakSelf.skyView.auctionId = weakSelf.sendGiftView.auctionId;
// }
// [weakSelf.sendGiftView hide];
// [weakSelf.timeView showInView:weakSelf.view];
}
};

View File

@@ -31,7 +31,7 @@
@property (nonatomic,assign)QXRoomRoleType roleType;
@property (nonatomic,strong)QXDynamicCommentInputView *commentView;
@property (nonatomic,assign)QXRedPacketModel* redpacketModel;
@property (nonatomic,strong)QXRedPacketModel* redpacketModel;
@end
@implementation QXRoomBottomView

View File

@@ -1003,6 +1003,11 @@ NSInteger maxMessageCount = 20;
}];
}
}
-(void)headerAction{
if (self.delegate && [self.delegate respondsToSelector:@selector(previewUserInfoWithUserId:)]) {
[self.delegate previewUserInfoWithUserId:self.message.FromUserInfo.user_id];
}
}
-(void)initSubviews{
self.bgView = [[UIView alloc] init];
self.bgView.backgroundColor = UIColor.clearColor;

View File

@@ -36,7 +36,11 @@
make.centerX.centerY.equalTo(self);
}];
self.imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_sign_start"]];
// self.imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"room_sign_start"]];
self.imageView = [[UIImageView alloc] init];
NSString *path = [[NSBundle mainBundle] pathForResource:@"sign_start" ofType:@"webp"];
NSURL *fileUrl = [NSURL fileURLWithPath:path];
[self.imageView sd_setImageWithURL:fileUrl];
self.imageView.contentMode = UIViewContentModeScaleToFill;
[self.bgView addSubview:self.imageView];
[self.imageView mas_makeConstraints:^(MASConstraintMaker *make) {
@@ -100,7 +104,7 @@
}completion:^(BOOL finished) {
}];
[self performSelector:@selector(hide) afterDelay:1];
[self performSelector:@selector(hide) afterDelay:1.5];
}
- (void)hide{

View File

@@ -32,6 +32,10 @@ NS_ASSUME_NONNULL_BEGIN
@property (nonatomic,assign)long needTime;
/// 是否是发送评论地方过来
@property (nonatomic,assign)BOOL isFromToComment;
@property (nonatomic,assign,readonly)QXRedBagDrawType drawType;
/// 是否正在展示中
@property (nonatomic,assign,readonly)BOOL isShow;
@property (nonatomic,copy)void(^toInputPwdBlock)(NSString *password,QXRedPacketModel*redpacketModel);
@property (nonatomic,copy)void(^collectRoomBlock)(void);
-(void)changeViewType:(QXRedBagDrawType)type;

View File

@@ -34,7 +34,8 @@
@property (nonatomic,strong)UILabel *bottomLabel;
@property (nonatomic,assign)QXRedBagDrawType drawType;
@property (nonatomic,assign)BOOL isDrawNet;
///
@property (nonatomic,assign)BOOL isShow;
@end
@implementation QXRedBagDrawView
- (instancetype)init
@@ -458,6 +459,7 @@
return self.drawType;
}
-(void)showInView:(UIView *)view{
self.isShow = YES;
self.bgView.y = -SCREEN_HEIGHT;
[view addSubview:self];
[UIView animateWithDuration:0.3 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
@@ -468,6 +470,7 @@
}
-(void)hide{
self.isShow = NO;
self.redpacketModel = nil;
[UIView animateWithDuration:0.3 delay:0 usingSpringWithDamping:0.5 initialSpringVelocity:1.0 options:UIViewAnimationOptionCurveEaseInOut animations:^{
self.bgView.y = SCREEN_HEIGHT;

View File

@@ -62,6 +62,12 @@ typedef NS_ENUM(NSInteger) {
QXRoomSettingTypeDrifPop = 27,
/// 发红包
QXRoomSettingTypeSendRedBag = 28,
/// 岁月之城活动
QXRoomSettingTypeAgeAc = 29,
/// 时空之巅活动
QXRoomSettingTypeTimeAc = 30,
/// 红包声音
QXRoomSettingTypeRedBagSound = 31,
}QXRoomSettingType;
NS_ASSUME_NONNULL_BEGIN
@class QXRoomSettingModel;
@@ -83,6 +89,9 @@ NS_ASSUME_NONNULL_BEGIN
-(void)showInView:(UIView *)view;
-(void)hide;
-(void)updateRole:(QXRoomRoleType)roleType isUpSeat:(BOOL)isUpSeat;
/// 更新活动显示状态
@property (nonatomic,strong)NSArray *acList;
@end

View File

@@ -18,12 +18,13 @@
#import "QXMeetActivityDriftView.h"
#import "QXDrifRoomHourRankView.h"
#import "QXRedPacketDriftView.h"
#import "QXRoomActivityStatusModel.h"
@interface QXRoomSettingView()<UIGestureRecognizerDelegate,UITableViewDelegate,UITableViewDataSource,QXRoomSettingViewDelegate>
@property (nonatomic,strong)UIView *bgView;
@property (nonatomic,strong)UIView *topView;
@property (nonatomic,strong)NSArray *titles;
@property (nonatomic,strong)NSDictionary *dataDict;
@property (nonatomic,strong)NSMutableDictionary *dataDict;
///
@property (nonatomic,strong)UIView *bottomBgView;
@@ -84,6 +85,12 @@
@property (nonatomic,strong)QXRoomSettingModel *drifPop;
///
@property (nonatomic,strong)QXRoomSettingModel *redBag;
///
@property (nonatomic,strong)QXRoomSettingModel *ageAc;
///
@property (nonatomic,strong)QXRoomSettingModel *timeAc;
///
@property (nonatomic,strong)QXRoomSettingModel *redBagSound;
///
@@ -169,8 +176,10 @@
}
BOOL isEffectsCLose = [[NSUserDefaults standardUserDefaults] boolForKey:kEffectsCLose];
BOOL isDrifPopCLose = [[NSUserDefaults standardUserDefaults] boolForKey:kIsCloseDrifPop];
BOOL isCloseRedBagSound = [[NSUserDefaults standardUserDefaults] boolForKey:kIsCloseRedBagSound];
self.roomEffects.isSelected = isEffectsCLose;
self.drifPop.isSelected = isDrifPopCLose;
self.redBagSound.isSelected = isCloseRedBagSound;
[self.tableView reloadData];
}
// isUpSeat true false
@@ -252,14 +261,42 @@
default:
break;
}
self.dataDict = @{
self.dataDict = [NSMutableDictionary dictionaryWithDictionary:@{
QXText(@"房间类型"):roomTypeArr,
QXText(@"常用工具"):toolsArr,
QXText(@"更多操作"):moreArr
};
}];
[self updateAcTools];
[self.tableView reloadData];
}
-(void)setAcList:(NSArray *)acList{
_acList = acList;
[self updateAcTools];
}
-(void)updateAcTools{
NSMutableArray *arr = [NSMutableArray arrayWithArray:[self.dataDict objectForKey:@"更多操作"]];
for (QXRoomActivityStatusModel *md in self.acList) {
if ([md.gift_bag_id isEqualToString:@"11"]) {
if (md.status.intValue == 1) {
if (![arr containsObject:self.ageAc]) {
[arr addObject:self.ageAc];
}
}
}else if ([md.gift_bag_id isEqualToString:@"12"]) {
if (md.status.intValue == 1) {
if (![arr containsObject:self.timeAc]) {
[arr addObject:self.timeAc];
}
}
}
}
[arr addObject:self.redBagSound];
[self.dataDict setObject:[NSArray arrayWithArray:arr] forKey:@"更多操作"];
}
-(BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch{
return touch.view == self;
}
@@ -635,6 +672,35 @@
}
return _redBag;
}
-(QXRoomSettingModel *)ageAc{
if (!_ageAc) {
_ageAc = [[QXRoomSettingModel alloc] init];
_ageAc.icon = @"room_set_room_age_ac";
_ageAc.name = QXText(@"岁月之城");
_ageAc.type = QXRoomSettingTypeAgeAc;
}
return _ageAc;
}
-(QXRoomSettingModel *)timeAc{
if (!_timeAc) {
_timeAc = [[QXRoomSettingModel alloc] init];
_timeAc.icon = @"room_set_room_time_ac";
_timeAc.name = QXText(@"时空之巅");
_timeAc.type = QXRoomSettingTypeTimeAc;
}
return _timeAc;
}
-(QXRoomSettingModel *)redBagSound{
if (!_redBagSound) {
_redBagSound = [[QXRoomSettingModel alloc] init];
_redBagSound.icon = @"room_redbag_sound_off";
_redBagSound.selIcon = @"room_redbag_sound_on";
_redBagSound.name = QXText(@"红包音效");
_drifPop.selName = QXText(@"红包音效");
_redBagSound.type = QXRoomSettingTypeRedBagSound;
}
return _redBagSound;
}
-(QXDirectListView *)directView{
if (!_directView) {
_directView = [[QXDirectListView alloc] init];
@@ -739,6 +805,14 @@
[[QXRedPacketDriftView shareView] drifPopIsClose:model.isSelected];
return;
}
if (model.type == QXRoomSettingTypeRedBagSound) {
model.isSelected = !model.isSelected;
QXRoomSettingSubCell *cell = [collectionView cellForItemAtIndexPath:indexPath];
cell.model = model;
[[NSUserDefaults standardUserDefaults] setBool:model.isSelected forKey:kIsCloseRedBagSound];
[[NSUserDefaults standardUserDefaults] synchronize];
return;
}
if (model.type == QXRoomSettingTypeRoomOrderMic) {
[QXMineNetwork roomChangeUpSeatTypeWithRoomId:self.roomId successBlock:^(NSDictionary * _Nonnull dict) {
// model.isSelected = !model.isSelected;

View File

@@ -203,6 +203,7 @@
NSDictionary *parm = notice.object;
NSString *uid = [NSString stringWithFormat:@"%@",[parm objectForKey:@"user_id"]];
NSInteger isOnline = [[parm objectForKey:@"is_online"] integerValue];
[QXGlobal.shareGlobal.offLineDict setObject:[NSString stringWithFormat:@"%ld",isOnline] forKey:uid];
if ([uid isEqualToString:QXGlobal.shareGlobal.loginModel.user_id]) {
self.offlineImageView.hidden = YES;
}else{

View File

@@ -128,7 +128,12 @@
}else{
self.cpImageView.hidden = YES;
}
if ([roomGiftModel.icon isExist]) {
self.cpImageView.hidden = NO;
[self.cpImageView sd_setImageWithURL:[NSURL URLWithString:roomGiftModel.icon]];
}else{
self.cpImageView.hidden = YES;
}
if ([roomGiftModel.activities_id isEqualToString:@"5"]) {
self.activityImageView.hidden = NO;
if (roomGiftModel.gift_bag.intValue == 10) {

View File

@@ -106,11 +106,16 @@
}
-(void)setModel:(QXGiftScrollModel *)model{
_model = model;
NSString *str = [NSString stringWithFormat:@"%@送给%@",model.fromUserName,model.toUserName];
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:str];
[attr yy_setColor:RGB16(0xFFDE77) range:[str rangeOfString:model.fromUserName]];
[attr yy_setColor:RGB16(0xFFDE77) range:[str rangeOfString:model.toUserName]];
self.titleLabel.attributedText = attr;
if ([model.toUserName isExist]) {
NSString *str = [NSString stringWithFormat:@"%@送给%@",model.fromUserName,model.toUserName];
NSMutableAttributedString *attr = [[NSMutableAttributedString alloc] initWithString:str];
[attr yy_setColor:RGB16(0xFFDE77) range:[str rangeOfString:model.fromUserName]];
[attr yy_setColor:RGB16(0xFFDE77) range:[str rangeOfString:model.toUserName]];
self.titleLabel.attributedText = attr;
}else{
self.titleLabel.text = model.text;
}
[self.giftImageView sd_setImageWithURL:[NSURL URLWithString:model.gift_picture]];
self.countLabel.text = [NSString stringWithFormat:@"X%@",model.number];

View File

@@ -79,8 +79,11 @@
MJWeakSelf
[QXRedPacketDriftView shareView].isPlaying = YES;
[QXRedPacketDriftView shareView].model = [QXRedPacketDriftView shareView].dataArray.firstObject;
[self.player seekToTime:CMTimeMake(0, 1)];
[self.player play];
BOOL isCloseRedBagSound = [[NSUserDefaults standardUserDefaults] boolForKey:kIsCloseRedBagSound];
if (!isCloseRedBagSound) {
[self.player seekToTime:CMTimeMake(0, 1)];
[self.player play];
}
[KEYWINDOW addSubview:[QXRedPacketDriftView shareView]];
[UIView animateWithDuration:1.5 delay:0 options:UIViewAnimationOptionCurveEaseOut animations:^{
[QXRedPacketDriftView shareView].x = (SCREEN_WIDTH-ScaleWidth(334))/2;

View File

@@ -15,7 +15,9 @@ NS_ASSUME_NONNULL_BEGIN
@class QXCOSUploadCredentialsModel;
@interface QXCOSUploadManager : NSObject
+(instancetype)shareManager;
-(void)audioUploadFile:(id)file withObjectKey:(NSString *)key complete:(void (^)(NSString * fileUrl, QXCOSUploadImageState))complete;
-(void)audioUploadFile:(id)file withObjectKey:(NSString *)key complete:(void (^)(NSString * fileUrl, QXCOSUploadImageState state))complete;
-(void)uploadFile:(id)file withObjectKey:(NSString *)key path:(NSString *)path complete:(void (^)(NSString * fileUrl, QXCOSUploadImageState state))complete;
- (void)uploadFile:(NSArray *_Nonnull)files withObjectKey:(NSArray *)objectKeys isAsync:(BOOL)isAsync complete:(void(^)(NSArray<NSString *> * names, QXCOSUploadImageState state))complete;
- (void)activityUploadFile:(NSArray *)files withObjectKey:(NSArray *)objectKeys isAsync:(BOOL)isAsync complete:(void(^)(NSArray<NSString *> *names, QXCOSUploadImageState state))complete;
- (NSString *)currentDate;

View File

@@ -27,6 +27,75 @@
}
return self;
}
-(void)uploadFile:(id)file withObjectKey:(NSString *)key path:(NSString *)path complete:(void (^)(NSString * _Nonnull, QXCOSUploadImageState))complete {
[[QXRequset shareInstance] getWithUrl:[NSString stringWithFormat:@"%@%@",ServerUrl,QXGetCosTempKeys] parameters:@{} needCache:NO success:^(id responseObject) {
QXCOSUploadModel *model = [QXCOSUploadModel yy_modelWithJSON:responseObject[@"data"]];
if (![model.region isExist] || ![model.bucket isExist] || ![model.credentials.sessionToken isExist] || ![model.credentials.tmpSecretId isExist] || ![model.credentials.tmpSecretKey isExist]) {
QXLOG(@"服务端配置错误");
complete(@"",QXCOSUploadImageFailed);
return;
}
NSString *region = model.region;
QCloudServiceConfiguration* configuration = [QCloudServiceConfiguration new];
QCloudCOSXMLEndPoint* endpoint = [[QCloudCOSXMLEndPoint alloc] init];
endpoint.regionName = region;
// 使 HTTPS
endpoint.useHTTPS = true;
configuration.endpoint = endpoint;
// COS
[QCloudCOSXMLService registerDefaultCOSXMLWithConfiguration:configuration];
[QCloudCOSTransferMangerService registerDefaultCOSTransferMangerWithConfiguration:configuration];
NSString *bucket = model.bucket;
QCloudCOSXMLUploadObjectRequest* put = [QCloudCOSXMLUploadObjectRequest new];
QCloudCredential * credential = [QCloudCredential new];
credential.secretID = model.credentials.tmpSecretId;
credential.secretKey = model.credentials.tmpSecretKey;
credential.token = model.credentials.sessionToken;
//
put.credential = credential;
put.bucket = bucket;
put.object = [NSString stringWithFormat:@"%@%@",path,key];
if ([file isKindOfClass:[UIImage class]]) {
NSData *data = UIImageJPEGRepresentation(file, 0.3);
put.body = data;
}else if ([file isKindOfClass:[NSData class]]){
put.body = file;
}else if ([file isKindOfClass:[NSURL class]]){
put.body = (NSURL *)file;
}
//
[put setSendProcessBlock:^(int64_t bytesSent,
int64_t totalBytesSent,
int64_t totalBytesExpectedToSend) {
// bytesSent
// totalBytesSent
// totalBytesExpectedToSend
}];
//
[put setFinishBlock:^(QCloudUploadObjectResult *result, NSError *error) {
if (!error) {
NSLog(@"upload object success!");
if (complete) {
complete(result.location ,QXCOSUploadImageSuccess);
}
} else {
NSLog(@"upload object failed, error: %@" , error);
if (complete) {
complete(@"",QXCOSUploadImageFailed);
}
}
}];
[[QCloudCOSTransferMangerService defaultCOSTransferManager] UploadObject:put];
} fail:^(NSError *error, NSString *msg, NSURLSessionDataTask *task) {
}];
}
-(void)audioUploadFile:(id)file withObjectKey:(NSString *)key complete:(void (^)(NSString * fileUrl, QXCOSUploadImageState state))complete{
[[QXRequset shareInstance] getWithUrl:[NSString stringWithFormat:@"%@%@",ServerUrl,QXGetCosTempKeys] parameters:@{} needCache:NO success:^(id responseObject) {

View File

@@ -77,6 +77,7 @@
[self.allRecordBtn setTitleColor:RGB16(0x5B5B5B) forState:(UIControlStateNormal)];
self.allRecordBtn.titleLabel.font = [UIFont systemFontOfSize:14];
[self.allRecordBtn addTarget:self action:@selector(recordAction:) forControlEvents:(UIControlEventTouchUpInside)];
self.allRecordBtn.hidden = YES;
[self.bgCoverView addSubview:self.allRecordBtn];

View File

@@ -10,7 +10,6 @@
NS_ASSUME_NONNULL_BEGIN
@interface QXAgePraizePoolView : UIView
@property (nonatomic,strong)QXGiftModel *giftModel;
@property (nonatomic,strong)NSString *roomId;
-(void)showInView:(UIView *)view;
@end

View File

@@ -53,17 +53,11 @@
[self.bgView addSubview:self.collectionView];
}
-(void)setGiftModel:(QXGiftModel *)giftModel{
_giftModel = giftModel;
[self getGiftList];
}
-(void)setRoomId:(NSString *)roomId{
_roomId = roomId;
}
-(void)getGiftList{
if (![self.giftModel.gift_bag isExist]) {
return;
}
if (![self.roomId isExist]) {
return;
}
@@ -71,7 +65,7 @@
return;
}
MJWeakSelf
[[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",ServerUrl,@"api/BlindBoxTurntable/get_gift_list"] parameters:@{@"gift_bag_id":self.giftModel.gift_bag?self.giftModel.gift_bag:@"",@"room_id":self.roomId?self.roomId:@""} needCache:NO success:^(id responseObject) {
[[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",ServerUrl,@"api/BlindBoxTurntable/get_gift_list"] parameters:@{@"gift_bag_id":@"11",@"room_id":self.roomId?self.roomId:@""} needCache:NO success:^(id responseObject) {
QXGiftActivityModel *model = [QXGiftActivityModel yy_modelWithJSON:responseObject[@"data"]];
weakSelf.model = model;
[self.collectionView reloadData];
@@ -89,6 +83,7 @@
}
-(void)showInView:(UIView *)view{
[self getGiftList];
self.bgView.y = SCREEN_HEIGHT;
[view addSubview:self];
[UIView animateWithDuration:0.3 animations:^{

View File

@@ -11,7 +11,6 @@ NS_ASSUME_NONNULL_BEGIN
@interface QXAgePraizeRecordView : UIView
@property (nonatomic,strong)NSString *roomId;
@property (nonatomic,strong)QXGiftModel *giftModel;
-(void)showInView:(UIView *)view;
@end

View File

@@ -77,6 +77,7 @@
[self.allRecordBtn setTitleColor:RGB16(0x5B5B5B) forState:(UIControlStateNormal)];
self.allRecordBtn.titleLabel.font = [UIFont systemFontOfSize:14];
[self.allRecordBtn addTarget:self action:@selector(recordAction:) forControlEvents:(UIControlEventTouchUpInside)];
self.allRecordBtn.hidden = YES;
[self.bgCoverView addSubview:self.allRecordBtn];
@@ -106,22 +107,15 @@
}
[self getRecordList];
}
-(void)setGiftModel:(QXGiftModel *)giftModel{
_giftModel = giftModel;
self.page = 1;
[self getRecordList];
}
-(void)getRecordList{
if (![self.giftModel.gift_bag isExist]) {
return;
}
if (![self.roomId isExist]) {
return;
}
MJWeakSelf
NSDictionary *parameters = @{
@"gift_bag_id":self.giftModel.gift_bag,
@"gift_bag_id":@"11",
@"page":[NSNumber numberWithInteger:self.page]
};
NSString *url = [NSString stringWithFormat:@"%@%@",ServerUrl,@"api/BlindBoxTurntable/get_my_record"];
@@ -171,6 +165,8 @@
}
-(void)showInView:(UIView *)view{
self.page = 1;
[self getRecordList];
self.bgView.y = SCREEN_HEIGHT;
[view addSubview:self];
[UIView animateWithDuration:0.3 animations:^{
@@ -288,8 +284,8 @@
}
-(void)setModel:(QXActivityRecordModel *)model{
_model = model;
self.giftInfoLabel.text = [NSString stringWithFormat:@"%@x%@",model.gift_name,model.count];
self.recieveInfoLabel.text = [NSString stringWithFormat:@"赠予%@",model.nickname];
// self.giftInfoLabel.text = [NSString stringWithFormat:@"%@x%@",model.gift_name,model.count];
self.recieveInfoLabel.text = [NSString stringWithFormat:@"%@x%@",model.gift_name,model.count];
[self.giftImageView sd_setImageWithURL:[NSURL URLWithString:model.base_image]];
self.timeLabel.text = model.createtime;
}
@@ -315,6 +311,8 @@
self.recieveInfoLabel = [[UILabel alloc] init];
self.recieveInfoLabel.textColor = RGB16(0xffffff);
self.recieveInfoLabel.font = [UIFont systemFontOfSize:14];
self.recieveInfoLabel.textAlignment = NSTextAlignmentCenter;
self.recieveInfoLabel.lineBreakMode = NSLineBreakByTruncatingMiddle;
[self.contentView addSubview:self.recieveInfoLabel];
[self.recieveInfoLabel mas_makeConstraints:^(MASConstraintMaker *make) {
make.top.equalTo(self.giftImageView.mas_bottom).offset(4);

View File

@@ -19,15 +19,10 @@ NS_ASSUME_NONNULL_BEGIN
@interface QXAgePraizeView : UIView
@property (nonatomic,strong)NSString *roomId;
@property (nonatomic,strong)QXGiftModel *giftModel;
@property (nonatomic,strong)QXGiftActivityModel *model;
@property (nonatomic,strong)NSString* userIds;
@property (nonatomic,strong)NSString* heartId;
@property (nonatomic,strong)NSString* auctionId;
@property (nonatomic,copy)void(^startBlock)(void);
-(void)showInView:(UIView *)view;
-(void)hide;
-(void)updateProgress:(QXXLHModel*)model;
-(void)destroyViews;
@end

View File

@@ -359,21 +359,8 @@ static NSInteger toSlowCount = 4;
}];
}
-(void)setGiftModel:(QXGiftModel *)giftModel{
_giftModel = giftModel;
[self getGiftList];
[self getMyWallet];
}
-(void)updateProgress:(QXXLHModel*)model{
if (self.model) {
self.model.xlh_data = model;
self.centerView.model = self.model;
}
}
-(void)getGiftList{
if (![self.giftModel.gift_bag isExist]) {
return;
}
if (![self.roomId isExist]) {
return;
}
@@ -381,7 +368,7 @@ static NSInteger toSlowCount = 4;
// return;
// }
MJWeakSelf
[[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",ServerUrl,@"api/BlindBoxTurntable/get_gift_list"] parameters:@{@"gift_bag_id":self.giftModel.gift_bag?self.giftModel.gift_bag:@"",@"room_id":self.roomId?self.roomId:@""} needCache:NO success:^(id responseObject) {
[[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",ServerUrl,@"api/BlindBoxTurntable/get_gift_list"] parameters:@{@"gift_bag_id":@"11",@"room_id":self.roomId?self.roomId:@""} needCache:NO success:^(id responseObject) {
QXGiftActivityModel *model = [QXGiftActivityModel yy_modelWithJSON:responseObject[@"data"]];
weakSelf.model = model;
weakSelf.centerView.model = model;
@@ -423,17 +410,12 @@ static NSInteger toSlowCount = 4;
self.hundredBtn.isDisable = YES;
}
}
-(void)setHeartId:(NSString *)heartId{
_heartId = heartId;
}
-(void)drawGiftWithNum:(NSString*)num{
NSDictionary *parameters = @{
@"gift_bag_id":self.giftModel.gift_bag,
@"gift_user_ids":self.userIds,
@"gift_bag_id":@"11",
@"room_id":self.roomId,
@"num":num,
@"heart_id":[self.heartId isExist]?self.heartId:@"",
@"auction_id":[self.auctionId isExist]?self.auctionId:@""
};
self.isDrawing = YES;
MJWeakSelf
@@ -700,15 +682,11 @@ static NSInteger toSlowCount = 4;
-(void)poolAction{
self.poolView.roomId = self.roomId;
self.poolView.giftModel = self.giftModel;
[self.poolView showInView:self];
}
-(void)recordAction{
self.recordView.roomId = self.roomId;
self.recordView.giftModel = self.giftModel;
self.recordView.roomId = self.roomId;
[self.recordView showInView:self];
}
-(NSMutableArray *)allViewsArray{
@@ -761,6 +739,7 @@ static NSInteger toSlowCount = 4;
}
-(void)showInView:(UIView *)view{
[self getGiftList];
[self getMyWallet];
[self resetViews];
self.bgView.y = SCREEN_HEIGHT;
[view addSubview:self];

View File

@@ -64,9 +64,11 @@
[self.drawRankBtn setBackgroundImage:[UIImage imageWithColor:RGB16(0x7C57FB)] forState:(UIControlStateSelected)];
[self.drawRankBtn addTarget:self action:@selector(drawRankAction) forControlEvents:(UIControlEventTouchUpInside)];
[self.bgCoverView addSubview:self.drawRankBtn];
self.drawRankBtn.hidden = YES;
self.drawRankBtn.selected = YES;
self.luckRankBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.drawRankBtn.right+16, 20, 88, 32)];
// self.luckRankBtn = [[UIButton alloc] initWithFrame:CGRectMake(self.drawRankBtn.right+16, 20, 88, 32)];
self.luckRankBtn = [[UIButton alloc] initWithFrame:CGRectMake((self.bgCoverView.width-88)/2, 20, 88, 32)];
[self.luckRankBtn setTitle:@"幸运榜单" forState:(UIControlStateNormal)];
[self.luckRankBtn setTitleColor:RGB16(0xE8E8E8) forState:(UIControlStateNormal)];
self.luckRankBtn.titleLabel.font = [UIFont boldSystemFontOfSize:14];
@@ -91,7 +93,8 @@
-(void)setRoomId:(NSString *)roomId{
_roomId = roomId;
self.page = 1;
[self getRecordListWithType:@"1"];
// [self getRecordListWithType:@"1"];
[self luckRankAction];
}
-(void)getRecordListWithType:(NSString*)type{
if (![self.roomId isExist]) {

View File

@@ -14,9 +14,9 @@ typedef NS_ENUM(NSInteger) {
/// 抽一次
QXMeetDrawBtnTypeOne = 1,
/// 抽10次
QXMeetDrawBtnTypeTen = 10,
QXMeetDrawBtnTypeTen = 5,
/// 抽100次
QXMeetDrawBtnTypeHundred = 100,
QXMeetDrawBtnTypeHundred = 8,
}QXMeetDrawBtnType;
@protocol QXMeetActivityViewDelegate <NSObject>

View File

@@ -10,7 +10,6 @@
NS_ASSUME_NONNULL_BEGIN
@interface QXTimePraizePoolView : UIView
@property (nonatomic,strong)QXGiftModel *giftModel;
@property (nonatomic,strong)NSString *roomId;
-(void)showInView:(UIView *)view;
@end

View File

@@ -53,17 +53,12 @@
[self.bgView addSubview:self.collectionView];
}
-(void)setGiftModel:(QXGiftModel *)giftModel{
_giftModel = giftModel;
[self getGiftList];
}
-(void)setRoomId:(NSString *)roomId{
_roomId = roomId;
}
-(void)getGiftList{
if (![self.giftModel.gift_bag isExist]) {
return;
}
if (![self.roomId isExist]) {
return;
}
@@ -71,7 +66,7 @@
return;
}
MJWeakSelf
[[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",ServerUrl,@"api/BlindBoxTurntable/get_gift_list"] parameters:@{@"gift_bag_id":self.giftModel.gift_bag?self.giftModel.gift_bag:@"",@"room_id":self.roomId?self.roomId:@""} needCache:NO success:^(id responseObject) {
[[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",ServerUrl,@"api/BlindBoxTurntable/get_gift_list"] parameters:@{@"gift_bag_id":@"12",@"room_id":self.roomId?self.roomId:@""} needCache:NO success:^(id responseObject) {
QXGiftActivityModel *model = [QXGiftActivityModel yy_modelWithJSON:responseObject[@"data"]];
weakSelf.model = model;
[self.collectionView reloadData];
@@ -89,6 +84,7 @@
}
-(void)showInView:(UIView *)view{
[self getGiftList];
self.bgView.y = SCREEN_HEIGHT;
[view addSubview:self];
[UIView animateWithDuration:0.3 animations:^{

View File

@@ -11,7 +11,6 @@ NS_ASSUME_NONNULL_BEGIN
@interface QXTimePraizeRecordView : UIView
@property (nonatomic,strong)NSString *roomId;
@property (nonatomic,strong)QXGiftModel *giftModel;
-(void)showInView:(UIView *)view;
@end

View File

@@ -77,6 +77,7 @@
[self.allRecordBtn setTitleColor:RGB16(0x5B5B5B) forState:(UIControlStateNormal)];
self.allRecordBtn.titleLabel.font = [UIFont systemFontOfSize:14];
[self.allRecordBtn addTarget:self action:@selector(recordAction:) forControlEvents:(UIControlEventTouchUpInside)];
self.allRecordBtn.hidden = YES;
[self.bgCoverView addSubview:self.allRecordBtn];
@@ -106,22 +107,15 @@
}
[self getRecordList];
}
-(void)setGiftModel:(QXGiftModel *)giftModel{
_giftModel = giftModel;
self.page = 1;
[self getRecordList];
}
-(void)getRecordList{
if (![self.giftModel.gift_bag isExist]) {
return;
}
if (![self.roomId isExist]) {
return;
}
MJWeakSelf
NSDictionary *parameters = @{
@"gift_bag_id":self.giftModel.gift_bag,
@"gift_bag_id":@"12",
@"page":[NSNumber numberWithInteger:self.page]
};
NSString *url = [NSString stringWithFormat:@"%@%@",ServerUrl,@"api/BlindBoxTurntable/get_my_record"];
@@ -171,6 +165,8 @@
}
-(void)showInView:(UIView *)view{
self.page = 1;
[self getRecordList];
self.bgView.y = SCREEN_HEIGHT;
[view addSubview:self];
[UIView animateWithDuration:0.3 animations:^{
@@ -288,8 +284,8 @@
}
-(void)setModel:(QXActivityRecordModel *)model{
_model = model;
self.giftInfoLabel.text = [NSString stringWithFormat:@"%@x%@",model.gift_name,model.count];
self.recieveInfoLabel.text = [NSString stringWithFormat:@"赠予%@",model.nickname];
// self.giftInfoLabel.text = [NSString stringWithFormat:@"%@x%@",model.gift_name,model.count];
self.recieveInfoLabel.text = [NSString stringWithFormat:@"%@x%@",model.gift_name,model.count];
[self.giftImageView sd_setImageWithURL:[NSURL URLWithString:model.base_image]];
self.timeLabel.text = model.createtime;
}
@@ -314,6 +310,8 @@
self.recieveInfoLabel = [[UILabel alloc] init];
self.recieveInfoLabel.textColor = RGB16(0xffffff);
self.recieveInfoLabel.textAlignment = NSTextAlignmentCenter;
self.recieveInfoLabel.lineBreakMode = NSLineBreakByTruncatingMiddle;
self.recieveInfoLabel.font = [UIFont systemFontOfSize:14];
[self.contentView addSubview:self.recieveInfoLabel];
[self.recieveInfoLabel mas_makeConstraints:^(MASConstraintMaker *make) {

View File

@@ -19,15 +19,10 @@ NS_ASSUME_NONNULL_BEGIN
@interface QXTimePraizeView : UIView
@property (nonatomic,strong)NSString *roomId;
@property (nonatomic,strong)QXGiftModel *giftModel;
@property (nonatomic,strong)QXGiftActivityModel *model;
@property (nonatomic,strong)NSString* userIds;
@property (nonatomic,strong)NSString* heartId;
@property (nonatomic,strong)NSString* auctionId;
@property (nonatomic,copy)void(^startBlock)(void);
-(void)showInView:(UIView *)view;
-(void)hide;
-(void)updateProgress:(QXXLHModel*)model;
-(void)destroyViews;
@end

View File

@@ -360,11 +360,7 @@ static NSInteger toSlowCount = 4;
}];
}
-(void)setGiftModel:(QXGiftModel *)giftModel{
_giftModel = giftModel;
[self getGiftList];
[self getMyWallet];
}
-(void)updateProgress:(QXXLHModel*)model{
if (self.model) {
self.model.xlh_data = model;
@@ -372,9 +368,6 @@ static NSInteger toSlowCount = 4;
}
}
-(void)getGiftList{
if (![self.giftModel.gift_bag isExist]) {
return;
}
if (![self.roomId isExist]) {
return;
}
@@ -382,7 +375,7 @@ static NSInteger toSlowCount = 4;
// return;
// }
MJWeakSelf
[[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",ServerUrl,@"api/BlindBoxTurntable/get_gift_list"] parameters:@{@"gift_bag_id":self.giftModel.gift_bag?self.giftModel.gift_bag:@"",@"room_id":self.roomId?self.roomId:@""} needCache:NO success:^(id responseObject) {
[[QXRequset shareInstance] postWithUrl:[NSString stringWithFormat:@"%@%@",ServerUrl,@"api/BlindBoxTurntable/get_gift_list"] parameters:@{@"gift_bag_id":@"12",@"room_id":self.roomId?self.roomId:@""} needCache:NO success:^(id responseObject) {
QXGiftActivityModel *model = [QXGiftActivityModel yy_modelWithJSON:responseObject[@"data"]];
weakSelf.model = model;
weakSelf.centerView.model = model;
@@ -424,17 +417,12 @@ static NSInteger toSlowCount = 4;
self.hundredBtn.isDisable = YES;
}
}
-(void)setHeartId:(NSString *)heartId{
_heartId = heartId;
}
-(void)drawGiftWithNum:(NSString*)num{
NSDictionary *parameters = @{
@"gift_bag_id":self.giftModel.gift_bag,
@"gift_user_ids":self.userIds,
@"gift_bag_id":@"12",
@"room_id":self.roomId,
@"num":num,
@"heart_id":[self.heartId isExist]?self.heartId:@"",
@"auction_id":[self.auctionId isExist]?self.auctionId:@""
};
self.isDrawing = YES;
MJWeakSelf
@@ -701,15 +689,11 @@ static NSInteger toSlowCount = 4;
-(void)poolAction{
self.poolView.roomId = self.roomId;
self.poolView.giftModel = self.giftModel;
[self.poolView showInView:self];
}
-(void)recordAction{
self.recordView.roomId = self.roomId;
self.recordView.giftModel = self.giftModel;
[self.recordView showInView:self];
}
-(NSMutableArray *)allViewsArray{
@@ -762,6 +746,7 @@ static NSInteger toSlowCount = 4;
}
-(void)showInView:(UIView *)view{
[self getGiftList];
[self getMyWallet];
[self resetViews];
self.bgView.y = SCREEN_HEIGHT;
[view addSubview:self];